Comments (3)
Hello Adam and thanks for you PR.
The idea is to keep at minimum the project dependencies, that's why I didn't import the support-compat
in the first place.
In the code you can see that I have a comment and @RequiresApi(api = Build.VERSION_CODES.M):
/**
* You can simulate the use of this method with by calling {@link #setProgressColor(int)} with ContextCompat:
* setProgressColor(ContextCompat.getColor(resId));
*/
@RequiresApi(api = Build.VERSION_CODES.M)
public void setProgressColorResource(@ColorRes int resId) {
setProgressColor(getContext().getColor(resId));
}
If you're compiling for min API >= M you won't have a problem. Otherwise you should use setProgressColor(ContextCompat.getColor(resId)
(this delegates the dependency to your project)
Cheers.
from seekbarrangedview.
When you look into the method definion you can see it, but compiler didn't highlight this usage with any warning/error though my min is 21 ;)
Yes, adding dependency would be maybe too much, libraries usually include some custom helper methods. Depends how you prefer :)
I already use setProgressColor()
but had colleced some crashes.
Thx for the work anyway!
from seekbarrangedview.
When you look into the method definion you can see it, but compiler didn't highlight this usage with any warning/error though my min is 21 ;)
Really? Now that's strange, I've added the annotation @RequiresApi(api = Build.VERSION_CODES.M)
(M = 23) to prevent situations like these.
Thx for the work anyway!
Hey np, thanks for using it :)
from seekbarrangedview.
Related Issues (12)
- Step size alteration? HOT 4
- Thumb overlap issue HOT 1
- duplicate value for resource 'attr/min' with config ''. HOT 15
- CHANGELOG HOT 2
- Block overlap of Min and Max value at certain place HOT 1
- set min and max value from program HOT 2
- 1.0.3 doesn't reference as 1.0.2? HOT 1
- Current min max
- Cast exception on onSaveInstanceState and onRestoreInstanceState HOT 1
- NullPointerException HOT 2
- Unable to use XML drawables for thumbs HOT 2
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from seekbarrangedview.