-
Notifications
You must be signed in to change notification settings - Fork 44
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
Added ability to display any view inside a tab for both the content and the background. #32
base: master
Are you sure you want to change the base?
Conversation
…brary with a reference to one in the Android support library repository.
… any View as the content and/or background for a tab: - IconTabProvider has been replaced by TabCustomViewProvider, which allows you to place any view at all inside a tab. This is obviously very flexible but the original motivation was to support custom ImageView subclasses that download images from the Internet. - Added TabBackgroundProvider which allows each tab to set any View as a background for a tab. - Indicator and divider drawing has been moved from onDraw() to dispatchDraw() in order to enforce drawing over subviews, rather than behind them. - The current tab now has its selection state set, which again makes for more visual flexibility. - Sample has been updated to demonstrate new functionality.
…ing to ensure the indicator is always on top.
…the default resource.
…o notifyDataSetChanged().
…aces and hence caused attribute name collisions with the official Android app compatibility library.
What is the status of this pull request? I want this feature badly. |
clocksmith, the fork is stable and has been used in several production apps for many months. So feel free to pull from the fork directly. |
@Benjamin-Dobell can you please update your pull request to the current dev branch? Would love to add this functionality to version 1.1.0 |
@Benjamin-Dobell Wanna this feature~~!!! Thanks~ |
This one is much better than the main repo. Now I was wondering how do I highlight the current tab when using a getPageTabCustomView ? I want my current tab to be a certain tint, but with this all of the tabs are the same tint. The underline makes it easy to see which tab is selected though |
@ericlw In my fork, the sample actually shows this behaviour off. Take a look at createBackground() where the StateListDrawable is created. In the fork the current tab is automatically set to be "selected", so you can define a different Drawable for android.R.attr.state_selected. @astuetz I'm sorry that it doesn't merge at the moment. Although, to be fair it did merge cleanly at the time I made the pull request ;) Anyway, I don't want to divert the user-base from the main repo, so when I get a chance I will get this ready to merge again. |
👍 for updating it to be ready to merge. @Benjamin-Dobell What conflicts are you running into? Is there anything we can do to help you? |
and make small fixes
is the TabCustomViewProvider ever going to be merged in? |
I am also waiting for these new features to be merged. Till then i am using Benjamin-Dobell repo. |
Hello, How to add view from xml in ContactPagerAdapter? |
Really bummed TabCustomViewProvider is not merged in. I spent hours switching my sliding tabs to this. :( |
Tab appearances are now much more flexible with the ability to display any View as the content and/or background for a tab:
The changes made obviously offer a great deal of flexibility but the original motivation was to support images downloaded from the Internet (rather than using resources) for both the background and content.