Circular Slider


Source link: https://github.com/milosmns/circular-slider-android

Circular Slider

What is this?

Circular Slider is a custom-built Android View used for choosing numbers. It works similarly to the regular slider control (SeekBar), just goes around in a circular fashion - simple enough. Note that the thumb scroller (the thing you drag around) can be either a solid-color circle or a custom drawable (like a PNG image).

Requirements

  • Android 3.0 or later (Minimum SDK level 11)
  • Android Studio (to compile and use)
  • Eclipse is not supported

Getting Started

  1. Download Android Studio
  2. Launch Android Studio
  3. Start your new project
  4. Open your project's main Gradle file, in root directory ( /build.gradle)
  5. Make sure you are using jcenter() in the repository block ( mavenCentral() should work too)
  6. Open your app module Gradle file, for example /app/build.gradle
  7. In dependencies block, add the following line: compile 'me.angrybyte.slider:slider:1.4.2'
  8. Click Tools/Android/Sync Project with Gradle Files or click on the Sync icon in the top toolbar
  9. Click Run/Run 'app' to see if it's resolved correctly

This will run the app on your device. You may need to download a newer version of Gradle, which will be available in the Android Studio UI if compile fails.

What does it look like?

A dark variant

Sample usage

<me.angrybyte.circularslider.CircularSlider
  android:id="@+id/circular"
  android:layout_width="match_parent"
  android:layout_height="match_parent"
  android:padding="30dp"
  circular:angle="3.14"
  circular:border_color="#505090"
  circular:border_thickness="14dp"
  circular:border_gradient_colors="#f05151;#4a90e2;#4a90e2"
  circular:thumb_color="#30AEFF"
  circular:thumb_size="24dp" />

Explanation of attributes

Here are some short explanations for the attributes provided by the view. You can leave out any of them, values will get set to default ones.

  • angle: ( float) The current position of the slider thumb, a pi-based value of the angle (radians).
  • start_angle: ( float) The starting position of the slider thumb, a pi-based valued of the angle (radians).
  • border_thickness: ( dimension) How thick should the slider border be (this can be a 0-dimension).
  • border_color: ( color) Recolors the slider border to the specified color.
  • border_gradient_colors: ( string) Creates a gradient on the slider's circular edge. Format: "#f05151;#4a90e2;#4a90e2"
  • thumb_size: ( dimension) Radius of the slider thumb (thumb is the slider's movable part).
  • thumb_image: ( reference) Set this to use an image instead of a colored circle for the slider thumb.
  • thumb_color: ( color) Set this to use a colored circle instead of an image for the slider thumb.

Note that thumb color and thumb image are mutually exclusive, you can't use both.

Support

If you've found an error while using the library, please file an issue. All patches are encouraged, and may be submitted by forking this project and submitting a pull request through GitHub. Some more help can be found here:

Resources

reflection-no-reflection is a proof on concept to create an API that is 100% compatible reflection API, but without any reflection. Performance stuff for Android and Java.

AKA VectorDrawableCompat: A 14+ backport of VectorDrawable.

Create useful .gitignore files for your project.

adk-toolkit exposes an AdkManager to manage UsbManager and UsbAccessory. In this way you don't need to fully understand some background concept about how ADK works but, as soon as possible, you should read ADK official documentation.

Robojava is a Gradle plugin that allows simple integration of Robolectric into Android Studio. This plugin works by creating a stub java project. This allows extending it with powerful plugins that are compatible with gradle java projects, but not with gradle android projects, like Gradle Cobertura Plugin for example.

CircleIndicator is a lightweight viewpager indicator like in nexus 5 launcher.

Topics


2D Engines   3D Engines   9-Patch   Action Bars   Activities   ADB   Advertisements   Analytics   Animations   ANR   AOP   API   APK   APT   Architecture   Audio   Autocomplete   Background Processing   Backward Compatibility   Badges   Bar Codes   Benchmarking   Bitmaps   Bluetooth   Blur Effects   Bread Crumbs   BRMS   Browser Extensions   Build Systems   Bundles   Buttons   Caching   Camera   Canvas   Cards   Carousels   Changelog   Checkboxes   Cloud Storages   Color Analysis   Color Pickers   Colors   Comet/Push   Compass Sensors   Conferences   Content Providers   Continuous Integration   Crash Reports   Credit Cards   Credits   CSV   Curl/Flip   Data Binding   Data Generators   Data Structures   Database   Database Browsers   Date &   Debugging   Decompilers   Deep Links   Dependency Injections   Design   Design Patterns   Dex   Dialogs   Distributed Computing   Distribution Platforms   Download Managers   Drawables   Emoji   Emulators   EPUB   Equalizers &   Event Buses   Exception Handling   Face Recognition   Feedback &   File System   File/Directory   Fingerprint   Floating Action   Fonts   Forms   Fragments   FRP   FSM   Functional Programming   Gamepads   Games   Geocaching   Gestures   GIF   Glow Pad   Gradle Plugins   Graphics   Grid Views   Highlighting   HTML   HTTP Mocking   Icons   IDE   IDE Plugins   Image Croppers   Image Loaders   Image Pickers   Image Processing   Image Views   Instrumentation   Intents   Job Schedulers   JSON   Keyboard   Kotlin   Layouts   Library Demos   List View   List Views   Localization   Location   Lock Patterns   Logcat   Logging   Mails   Maps   Markdown   Mathematics   Maven Plugins   MBaaS   Media   Menus   Messaging   MIME   Mobile Web   Native Image   Navigation   NDK   Networking   NFC   NoSQL   Number Pickers   OAuth   Object Mocking   OCR Engines   OpenGL   ORM   Other Pickers   Parallax List   Parcelables   Particle Systems   Password Inputs   PDF   Permissions   Physics Engines   Platforms   Plugin Frameworks   Preferences   Progress Indicators   ProGuard   Properties   Protocol Buffer   Pull To   Purchases   Push/Pull   QR Codes   Quick Return   Radio Buttons   Range Bars   Ratings   Recycler Views   Resources   REST   Ripple Effects   RSS   Screenshots   Scripting   Scroll Views   SDK   Search Inputs   Security   Sensors   Services   Showcase Views   Signatures   Sliding Panels   Snackbars   SOAP   Social Networks   Spannable   Spinners   Splash Screens   SSH   Static Analysis   Status Bars   Styling   SVG   System   Tags   Task Managers   TDD &   Template Engines   Testing   Testing Tools   Text Formatting   Text Views   Text Watchers   Text-to   Toasts   Toolkits For   Tools   Tooltips   Trainings   TV   Twitter   Updaters   USB   User Stories   Utils   Validation   Video   View Adapters   View Pagers   Views   Watch Face   Wearable Data   Wearables   Weather   Web Tools   Web Views   WebRTC   WebSockets   Wheel Widgets   Wi-Fi   Widgets   Windows   Wizards   XML   XMPP   YAML   ZIP Codes