Conflicting attribute names with AppCompat library #41
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Intro
There is an inherent problem in declaring styleable attributes on Android: you may end up with conflicting attribute names when you use multiple library projects that declare custom attributes.
Problem
In PagerSlidingTabStrip there are some attribute names that conflict with ones that exist in the AppCompat library project, which is part of the official android support library. Namely, the two attributes affected are:
dividerPadding
textAllCaps
The problem is that currently you cannot include in your project both PagerSlidingTabStrip and AppCompat, as your project won't build. The error log on Eclipse is the following:
Solution
The suggested solution in such cases is to put a prefix to all attributes in third party libraries, so that conflicts are avoided. An easier solution would be to simply change the names of the two affected attributes, but for consistency purposes I created this pull request that prefixes all declared attributes in PagerSlidingTabStrip with the word
strip
.Result
You are able to use both PagerSlidingTabStrip and AppCompat in your project, along with any other android library projects. Happy :-)