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

Quick action: Support for different backgrounds and quick actions #2

Open
Knickedi opened this issue Oct 26, 2011 · 3 comments
Open
Assignees
Labels

Comments

@Knickedi
Copy link
Owner

Quote of the request:

Hey Knickedi,

Fantastic tools! One thing I was hoping to learn was whether it is possible to specify a different background drawable for each item in the list's adapter. In my example I want to color code comments. So I either want:
mQuickActionSetup.setBackgroundResource(R.drawable.comment_background_blue);
or
mQuickActionSetup.setBackgroundResource(R.drawable.comment_background_red);

However if I specify this in the getView method, all the comments will have the background of the last value specified. Could you point me in the right direction for modifying your library to support multiple backgrounds for the hidden view?

On the same topic, specifying differing drawables for the action item icons that are revealed in each list item would also be a welcome addition.

Thanks!
Brian

I'm working on that. Hope to commit API extension soon...

@ghost ghost assigned Knickedi Oct 26, 2011
@Knickedi
Copy link
Owner Author

I thought this should be extended in the existing API but there's an simple option:
Just use list view type for that...that's what its actually there for.
I added an (really ugly) example in the showcase which demonstrates how to do that.

@brianmuse
Copy link

Hey Knickedi,

Thanks for the update, this turned out to work great.

I would just reiterate to others looking to do this, make sure you override the getViewTypeCount and getItemViewType methods in your adapter. Otherwise all views in the list will be recycled and you will have inconsistant hidden view backgrounds since you can only call setHiddenViewSetup once per view.

Thanks again!

@Knickedi
Copy link
Owner Author

No problem, glad I could help.
But I see the problem of the static behavior of the given setup.
I have an extension in mind and will keep improving the API.
Thank for your inspiration and feedback!

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

No branches or pull requests

2 participants