A circular seek bar for Android

Overview

CircularSeekBar

A circular seek bar for Android.

Modification

1. Modified setProgress(int progress) method.

2. Added hideSeekBar() To hide seekbar.

3. Added ShowSeekBar() To show seekbar; Bydefault its visible.


Screenshot:

Imgur

Sample usage:

public class Welcome extends Activity {
	CircularSeekBar circularSeekbar;

	@Override
	protected void onCreate(Bundle savedInstanceState) {
		super.onCreate(savedInstanceState);
		circularSeekbar = new CircularSeekBar(this);
		circularSeekbar.setMaxProgress(100);
		circularSeekbar.setProgress(100);
		setContentView(circularSeekbar);
		circularSeekbar.invalidate();

		circularSeekbar.setSeekBarChangeListener(new OnSeekChangeListener() {

			@Override
			public void onProgressChange(CircularSeekBar view, int newProgress) {
				Log.d("Welcome", "Progress:" + view.getProgress() + "/" + view.getMaxProgress());
			}
		});

	}
}

Advanced Usage

Advanced Usage Documentation

Comments
  • Bugging displaying of the handle

    Bugging displaying of the handle

    Hello everyone!

    I have a problem using the CircularSeekBar that is strange for me: Everything works fine and looks great, until I change the text of the textView in the same relative layout.

    I call this method in onProgressChange: private void updateStatus(int progress) { TextView tv = (TextView) findViewById(R.id.status_seekbar_noise); int hz = (int) calcHzFromPercent(progress); tv.setText(hz+" Hz"); }

    If I remove the tv.setText()-method, everything works fine. If I try to use the line, the handle of the seekbar jumps back to 0 degrees and then back to where it should be. This flattering happens all the time. So what is wrong with my code? Or is it the code in the CircularSeekBar-Class.

    If anyone knows the solution please tell me.

    Best regards and thanks for the great code!

    opened by raptus93 1
  • Missing license

    Missing license

    It would be very nice to have some license for that library. Because for now no commercial product can use it (at least legally) - thus less developers are involved in solving bugs.

    opened by tajchert 1
  • Modified setProgress() and added method to visible/hide seekbar.

    Modified setProgress() and added method to visible/hide seekbar.

    1. setProgress() method was not calculating new Percent correctly now fixed .
    2. Added hideSeekBar() method to hide seekbar.
    3. Added ShowSeekBar() method to show seekbar; By Default its visible.
    opened by learnNcode 0
  • Improve the responsivness of the slider

    Improve the responsivness of the slider

    I did some really small changes on CircularSeekBar and it makes it more responsive.

    Changing the adjustmentFactor and improving the way to compute the poisition of the marker on the circle

    opened by lethargicpanda 0
  • why the event SeekBarChangeListener don't work in fragment ?

    why the event SeekBarChangeListener don't work in fragment ?

    My code is...

    public class FragmentCadastro1 extends Fragment{

    CircularSeekBar circularSeekbar;
    
    @Override
    public View onCreateView(LayoutInflater inflater, ViewGroup container,
            Bundle savedInstanceState) {
    
        View view = inflater.inflate(R.layout.fragment_cadastro_1, container,
                false);
        circularSeekbar = new CircularSeekBar(getActivity());
        circularSeekbar.setMaxProgress(100);
        circularSeekbar.setProgress(100);
        circularSeekbar.invalidate();
    
        circularSeekbar.setSeekBarChangeListener(new OnSeekChangeListener() {
    
            @Override
            public void onProgressChange(CircularSeekBar view, int newProgress) {
                Log.i("Welcome", "Progress:" + view.getProgress() + "/" + view.getMaxProgress());
            }
        });
    
    
    
        return view;
    }
    

    does not come in LogCat no events...why ? Context ?

    opened by diogo10 0
  • incorrect max angle

    incorrect max angle

    hi all, i found a problem about the max angle...if you print the angle inside the onSeekChangeListener like below:

    mSeekBar.setSeekBarChangeListener(new CircularSeekBar.OnSeekChangeListener() { @Override public void onProgressChange(CircularSeekBar view, int newProgress) { Log.d("onProgressChange", view.getAngle()); } });

    you will find that the angle reaches from 0 degree to 360 degree, which is incorrect and should be 359 degree instead.

    hope my finding is useful. cheers!

    opened by tommykamkcm 0
  • Not setting / displaying in Fragment correctly

    Not setting / displaying in Fragment correctly

    I can use circularSeekBar in a fragment which is displayed in via an activity fine. (The first fragment displayed.) I have a problem when it is not the first fragment that is displayed. E.g. If I had another Fragment displaying and I replace it with the one that contains the circularSeekBar. The circularSeekBar is display but not correctly. It appears it is not fully updated. I can touch it and then it corrects itself. What can I do to correct this. It appears it needs some type of refresh.

    opened by casillic 1
  • drawable hidden

    drawable hidden

    Hi,

    I have to create circular seek bar with drawable image inside circle. While moving the image. seek bar progress is to be set. But image is hiding because it is drawn inside rectangle. How can i draw circle by giving some distance between rectangle border?

    opened by subhasrig 2
  • onMeasure will not return heights

    onMeasure will not return heights

    getHeight() and getWidth does not return height and width of view if used in onMeasure; they return 0.

    Height and width are assigned in the drawing phase which, in essence occurs way after onMeasure is called.

    There is a simple fix for this:

    protected void onMeasure(int widthMeasureSpec, int heightMeasureSpec) { super.onMeasure(widthMeasureSpec, heightMeasureSpec); width = View.MeasureSpec.getSize(widthMeasureSpec); height = View.MeasureSpec.getSize(heightMeasureSpec);

        int size = (width > height) ? height : width; // Choose the smaller
        // between width and
        // height to make a
        // square
    
        cx = width / 2; // Center X for circle
        cy = height / 2; // Center Y for circle
        outerRadius = size / 2; // Radius of the outer circle
    
        innerRadius = outerRadius - barWidth; // Radius of the inner circle
    
        left = cx - outerRadius; // Calculate left bound of our rect
        right = cx + outerRadius;// Calculate right bound of our rect
        top = cy - outerRadius;// Calculate top bound of our rect
        bottom = cy + outerRadius;// Calculate bottom bound of our rect
    
        startPointX = cx; // 12 O'clock X coordinate
        startPointY = cy - outerRadius;// 12 O'clock Y coordinate
        markPointX = startPointX;// Initial locatino of the marker X coordinate
        markPointY = startPointY;// Initial locatino of the marker Y coordinate
    
        rect.set(left, top, right, bottom); // assign size to rect
    }
    

    This will work in any layout, activity or fragment.

    Best wishes, and great code. +1

    opened by Litterfeldt 1
Owner
Raghav Sood
Raghav Sood
Custom circular SeekBar (Circle, Semi-circle, and Ellipse) View/Widget for Android

CircularSeekBar Android CircularSeekBar Custom View/Widget This is a custom circular SeekBar. It can be used to create SeekBars that are: -Full Circle

Matt Joseph 462 Dec 19, 2022
Simple custom Android View providing a Circular spin to SeekBars

CircularSeekBar This is a simple Seek Bar, in the shape of a circle, responsive to the speed of the spin: the faster you spin the control, the faster

Mikel 34 Feb 18, 2022
A simple material-based support library to bring consistent SeekBars on Android 14 and above

SeekBarCompat A support library for the material design SeekBar in Android for API 14 and above. Screenshot On APIs 14 and above - Seekbars would look

Ahmed Rizwan 157 Dec 27, 2022
Android widget for selecting a range of values.

MaterialRangeBar MaterialRangeBar is a fork from https://github.com/edmodo/range-bar that adds some basic material styling, as well as start and end v

null 1.7k Dec 30, 2022
Android circle seekbar widget inspired from: https://github.com/LarsWerkman/HoloColorPicker

Android HoloCircleSeekBar A Circle SeekBar inspired by Android Holo ColorPicker designed by Marie Schweiz and developed by Lars Werkman. How to integr

Jesus 232 Nov 10, 2022
StartPointSeekBar is a custom view for the Android platform that makes it possible to have a SeekBar to have custom start point.

Forked/Inspired from https://code.google.com/p/range-seek-bar/ by [email protected] This solves the problem as described in http://

Gaurav Vashisth 142 Dec 29, 2022
A color picker seekbar for android.

ColorSeekBar A color picker seekbar for android. Download Use Gradle compile 'com.divyanshu.colorseekbar:colorseekbar:1.0.2' or Maven <dependency>

Divyanshu Bhargava 129 Nov 29, 2022
Ranger is custom view which able to act like android seekbar.

Ranger is custom view which able to act like android seekbar.

Enes Zor 3 Oct 17, 2021
A circular seek bar for Android

CircularSeekBar A circular seek bar for Android. Modification 1. Modified setProgress(int progress) method. 2. Added hideSeekBar() To hide seekbar. 3.

Raghav Sood 289 Nov 25, 2022
A simple time second selector seek bar custom made

A simple time second selector seek bar custom made How to To get a Git project into your build: Step 1. Add the JitPack repository to your build file

Mohammed Nadil 2 Nov 26, 2021
Material style circular progress bar for Android

Material CircularProgressView Indeterminate Determinate Description This CircularProgressView is a (surprisingly) circular progress bar Android View t

Rahat Ahmed 760 Nov 30, 2022
A swipe button for Android with a circular progress bar for async operations

ProSwipeButton A swipe button for Android with a circular progress bar for async operations Gradle dependencies { ... compile 'in.shadowfax:pr

Shadowfax Technologies 340 Nov 13, 2022
An android library to easily add circular progress bar into your Jetpack Compose apps.

CircularProgressBar for Jetpack Compose An android library to easily add circular progress bar into your Jetpack Compose apps. Have a Look Usage Circu

Hitanshu Dhawan 38 Oct 30, 2022
A player/ recorder visualizer with the swipe to seek functionality.

iiVisu A player/ recorder visualizer with the swipe to seek functionality. Demo Setup Step 1. Add the JitPack repository to your build file Add it in

Iman Irandoost 126 Nov 25, 2022
Fast Seek for ExoPlayer

FastExoPlayerSeeker Introduction Adds fast seeking for exoplayer. (Note: it also depends on the amount of video encoding, mainly IDR Frames) How to in

Jan Rabe 40 Dec 27, 2022
Custom & highly configurable seek slider with sliding intervals, disabled state and every possible setting to tackle!

LabeledSeekSlider Custom & highly configurable seek slider with sliding intervals, disabled state and every possible setting to tackle! Minimum target

Edgar Žigis 78 Sep 27, 2022
Hide and seek revamped.

TreasureFind TreasureFind is a modern ice breaker game ultilizing your inseparable companion (phone). You can play the game with a group of friends or

Edward Zhou 2 Jul 20, 2022
[] Action bar implementation which uses the native action bar on Android 4.0+ and a custom implementation on pre-4.0 through a single API and theme.

DEPRECATED ActionBarSherlock is deprecated. No more development will be taking place. For an up-to-date action bar backport use AppCompat. Thanks for

Jake Wharton 7.1k Dec 24, 2022
IOSProgressBar is a progress-bar lib for android. And the progress-bar looks like iOS system style

IOSProgressBar is a progress-bar lib for android. And the progress-bar looks like iOS system style

heyangyang 6 Aug 25, 2022