tankery / circularseekbar Goto Github PK
View Code? Open in Web Editor NEWCustom circular SeekBar (Circle, Semi-circle, and Ellipse) for Android
License: Apache License 2.0
Custom circular SeekBar (Circle, Semi-circle, and Ellipse) for Android
License: Apache License 2.0
I am having issue with sliding the seekbar to progress 0 or progress 100 (the ends of the seekbar). When I get close to the ends, around 3-5 or 95-97, the seekbar stops tracking my finger and just stops. I can get to 0 or 100 progress, but I have to carefully take a few attempts to slide it into place.
Any ideas what is causing this?
Here is my xml:
<me.tankery.lib.circularseekbar.CircularSeekBar android:id="@+id/wellnessQViewQSeekBar" android:layout_width="match_parent" android:layout_height="match_parent" app:cs_circle_color="@color/white" app:cs_circle_progress_color="#02CFD5" app:cs_circle_stroke_width="40dp" app:cs_circle_style="butt" app:cs_end_angle="40" app:cs_lock_enabled="false" app:cs_max="100" app:cs_move_outside_circle="true" app:cs_start_angle="90" app:layout_constraintEnd_toEndOf="parent" app:layout_constraintStart_toStartOf="parent" app:layout_constraintTop_toTopOf="parent" />
There have the options to set Pointer Color from progress.setPointerColor(0xfffff000);
But how to set progress.setPointerIcon
Hi,
Is there a way to have a semi-circle start at 0 middle point and move left negative number and right positive numbers. Using cs_start_angle
and cs_end_angle
does the semi circle however I can't set it to start in the middle and use negative numbers.
Any direction of achieving this would be really appreciated.
i have a drawable with gradient color, but i do not where to implement.
In normal seekbar, the drawable can be set in progressDrawable
Do you think it's possible to have sort of scale attached to the bar ?
just to indicate the actual progress being selected
Please add drawable thumb, with setThumb method.
Tnx,
Cris
Is it possible to have text on the inside of the seek bar?
I want change a step size on my circular seekbar . How Can I ? Can you be fast ıt's urgen for me
The current thumb is at value of 0. When changing the seek bar speedy, the value jumps to 100. I suspect the following code block.
else if (lockAtEnd && lockEnabled) {
mProgress = mMax; // Suspected here.
recalculateAll();
invalidate();
if (mOnCircularSeekBarChangeListener != null) {
mOnCircularSeekBarChangeListener.onProgressChanged(this, mProgress, true);
}
}
how to set minimum value
Please add feature incrementProgressBy ()
Example
.setMax(8);
.incrementProgressBy(1);
I solved this feature, using Math.floor() and force change progress value:
if progress is 0.3 up to 1
if progress is 3.4 up to 4
....
seekBar.setOnSeekBarChangeListener(new CircularSeekBar.OnCircularSeekBarChangeListener() {
@Override
public void onProgressChanged(CircularSeekBar circularSeekBar, float progress, boolean fromUser) {
String message = String.format("Progress changed to %.2f, fromUser %s", progress, fromUser);
Log.d("Main", message);
if (progress>0) circularSeekBar.setProgress( (float) Math.floor(progress));
}
}
Hi,
I'm trying to find out the best solution to set the progress direction either clockwise (like now) or counter clockwise. Any Tips what part of the CircularSeekBar Code I have to update or change?
Is it possible to use this seekbar discretely or with integer values instead of floats. It sounds like its possible from reading the readme file but I cant see or figure out how to
Your code does not support user interaction when the CSB is in a Fragment. Once the Fragment gets recreated by the system, the user loses control of the MotionEvent and the progress stops. Maybe consider to put the MotionEvent, mUserIsMovingPointer, mPointerPosition, mStartAngle in the Bundle in onSaveInstanceState() and then restore it if needed in onRestoreInstanceState(Parcelable state)
I have a requirement like adding image drawable to the pointer and that drawable is outside the circle. I need to move the drawable to change progress. I did changes to add drawable instead of pointer circle, but how to move this drawable outside the circle. I tried like this
canvas.drawBitmap(bitmap,
mPointerPositionXY[0] , mPointerPositionXY[1] ,
mPaint);
This is showing the bitmap but i need to set this drawable outside the circle.
From the code, i just got the radius till the circle border.
Please help me.
Thanks in advance
I try this, not work
binding.circularSeekBar.circleProgressColor = requireContext().getColorCompat(R.color.md_red_A200)'
steps:
result:
the blue progress highlight follows the pointer while it is dragged 0-359 but disappears when 360 is reached.
note:
works ok on older android (eg 7.0/nougat or 4.4/kitkat etc)
I'm getting this error any one has the fix?
Caused by: groovy.lang.MissingPropertyException: Could not get unknown property 'ossrhUsername' for Credentials [username: null] of type org.gradle.internal.credentials.DefaultPasswordCredentials_Decorated.
Add Custom Thumb feature
I am notable to get progress value.
In override fun onProgressChanged(
circularSeekBar: CircularSeekBar?,
progress: Float,
fromUser: Boolean
) {
}
I am trying to show toast but app getting crashed.
Hi,
i just learning the custom views by doing changes and updates. can you tell me how to increase pointer redius to show the progress in pointer. please! am trying many ways, the text , i put that. but in between the short width and height, the text showing overlape amoung them... can u explain me please :)
as JCenter going to sunset
Wonderful library.
Can one use gradient color for the progress?
Thanks
I have a RecyclerView and each item has a CircularSeekBar, when scrolling the RecyclerView the touch of the CircularSeekBar interferes , so I want to make progress to be changed only when user touches on the pointer
I need to set the min and max values of SeekBar programmatically within the application. I can set the max value but I didn't know how to set the min value.
Hello,
Great library! Just one issue, I noticed that sometimes near the end the seek bar is jumping backwards, I'm using it with MediaPlayer, here is my code:
fun setupSeekBar(audioSeekBar: CircularSeekBar) {
audioSeekBar.setOnSeekBarChangeListener(object : CircularSeekBar.OnCircularSeekBarChangeListener {
override fun onProgressChanged(seekBar: CircularSeekBar, progress: Float, b: Boolean) {
logger.logError("progress: $progress max: ${seekBar.max}")
}
override fun onStartTrackingTouch(seekBar: CircularSeekBar) {
model.getMediaPlayer().seekTo(seekBar.progress.toInt())
}
override fun onStopTrackingTouch(seekBar: CircularSeekBar) {}
})
}
fun setupAudioProgressBar(progressBar: CircularSeekBar, handler: Handler) {
progressBar.let {
it.max = model.getMediaPlayer().duration.toFloat()
val interval: Long = 100
val statusChecker = object : Runnable {
override fun run() {
it.progress = model.getMediaPlayer().currentPosition.toFloat()
handler.postDelayed(this, interval)
}
}
statusChecker.run()
}
}
and here are logs of progress and max:
(in the beginning progress is always increasing)
progress: 5112.0 max: 5400.0
progress: 5256.0 max: 5400.0
progress: 5328.0 max: 5400.0
progress: 5256.0 max: 5400.0
Would it be possible to implement animated progress from one value to another - smooth movement?
Is there any way to make the seekbar endless? Without a start or beginning, just the degree of turn and the direction per second?
Any plans to add such a counter rounds functionality ?
Taken from similar ios lib:
https://github.com/HamzaGhazouani/HGCircularSlider/blob/master/Screenshots/Circular.gif
Regarding min I saw your answer on #41. Your suggestion with offset is work for read value, but what if I want to write value as well i.e. pointer should be disabled at start position with offset ?
I am using your library to make a music player app. And i got trouble when use app:cs_max and app:cs_progress while using data binding
Cannot find a setter for \u003cme.tankery.lib.circularseekbar.CircularSeekBar app:cs_max\u003e that accepts parameter type \u0027java.lang.Integer\u0027\n\nIf a binding adapter provides the setter, check that the adapter is annotated correctly and that the parameter type matches.
How can I solve this problem?
Thanks!
负进进度支持是哪个属性?
How can the direction of the progress bar be counterclockwise? I see a counterclockwise preview in the example, but according to the example, it is actually not like this.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.