Comments (1)
Hi, I want to do the same thing - Changing the thumb during runtime.
So I looked at their code and find a way to do that.
The idea is simple, just copy their SeekArc as a base one and made modifications on it to get extra functions, then use the local new class as a replacement.
I do not know how to modify the library managed by gradle. So this is an alternative way from the stackoverflow.
Step 1, download the SeekArc.java from this repo and put it somewhere in your project. Now you have a local SeekArc class yourself and you can modify it then use it as custom view.
Step 2, insert the following code
public void setmThumb(Drawable newThumb){
mThumb = newThumb;
int thumbHalfheight = (int) mThumb.getIntrinsicHeight() / 2;
int thumbHalfWidth = (int) mThumb.getIntrinsicWidth() / 2;
mThumb.setBounds(-thumbHalfWidth, -thumbHalfheight, thumbHalfWidth,
thumbHalfheight);
invalidate();
}
And that is it.
You just need to replace the official SeekArc with your custom one and you could get/set the thumb.
I did not write the get method, but it is obvious as you can see from the set method.
PS : I did not test this method with different sizes of thumb, but it seems should work fine.
from seekarc.
Related Issues (20)
- Locking the SeekArc when 360 is reached, instead of starting from 0 HOT 6
- Any plan to port to Xamarin? HOT 1
- Progress width is not changing
- setMin and getMin in not available. HOT 1
- Slow response on animating slider / Lag on calling it inside fragment HOT 1
- How do I add left and right arcs to make a circle?
- How do I add two semi arc with left and right to make a circle?
- Provide code in objective c HOT 1
- Enable Disable SeekArc from different threads doesn't work
- Gradient coloring for seek arc HOT 1
- Cannot easily drag to min or max
- Unable set max value programatically HOT 2
- Using Readme example not showing HOT 1
- Manifest error while building project HOT 4
- how to change seekArc thumb or thumb color? HOT 1
- duplicate value for resource
- Namespace 'seekarc' is not bound.
- updating progress and arc colors programmatically HOT 1
- Gradle build Failing HOT 1
- How we can add thumb programatically..not in xml
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 seekarc.