Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Creation of more/less accordions #2

Open
jt234 opened this issue Jul 9, 2012 · 7 comments
Open

Creation of more/less accordions #2

jt234 opened this issue Jul 9, 2012 · 7 comments
Assignees

Comments

@jt234
Copy link

jt234 commented Jul 9, 2012

The number of accordion views is locked to the amount of elements you have in the string array labelled accordion_sections.

To give the developer more flexibility it could be ideal to remove this connection from the string array as I have done.

I was just wondering if there would be any problem in doing this.

My first thought may be a problem with the value returned by getChildCount().

Any thoughts/ideas wouldn't go unnoticed,
Cheers,
jt234

@hamsterready
Copy link
Owner

Hi jt234,

Thanks for this, need to have a look but it should be fairly simple to be allowed to add more sections in runtime. Recently I added some methods to be allowed to hide sections so maybe that's a temporary options for you (create all what you need, then hide and show on demand).

Cheers,

@jt234
Copy link
Author

jt234 commented Jul 11, 2012

Hi hamsterready,

I think it would be a nice feature to be able to have the ability, as you have stated, to add more accordion sections programmatically.

I might have a go at creating the encasing <com.sentaca.android.accordion.widget.AccordionView ... > </com.sentaca.android.accordion.widget.AccordionView> programmatically (although I highly doubt this will work, in fact I know it wont) just to see if I can get it to work.

But when it comes to it, I think that the use of your hidden sections will have to be a temporary fix for me.

Thanks for your quick feedback.

Cheers,
jt234

@jt234
Copy link
Author

jt234 commented Aug 2, 2012

After a bit of research and working code I have found that it is more idealistic to utilize the android ExpandableListView. You would be able to create an accordion type view while also being able to create/remove accordion elements programmatically.

@hamsterready
Copy link
Owner

Hi jt234,

First version was based on ListView but I have hit some major issues with passing events to ui components added to this kind of accordion. Possibly was doing something wrong :)

@ghost ghost assigned hamsterready Oct 23, 2012
@mona2787
Copy link

i have to create a dynamic Accordian, means each time when accordian will shown it has different number of section.
how could i do it?

@hamsterready
Copy link
Owner

@mona2787 have a look at #4 maybe it will work in your case.

At the moment I have no time to add this - but should be doable... will try to fix it sooner or later.

@mona2787
Copy link

Thanks hamsterready,
my problem has been solved.

 SharedPreferences savedSession = context.getSharedPreferences(Claims_Section, Context.MODE_PRIVATE);       
 String sectionArr=savedSession.getString(SECTION_ARRAY,"") ;
 sectionHeaders=sectionArr.split("\\^");
  //sectionHeaders = getResources().getStringArray(sectionHeadersResourceId);

and modified the children layout .

thanks a lot for such a wonderful code.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants