Android Circular Music ProgressBar


Source link: https://github.com/aliab/circular-music-progressbar

Android Circular Music ProgressBar

Description

This Circular Progress bar is a designed and made for music players that need beautiful music progress bar. Choosed for best of the day at uplabs.com

Usage

To use Circular Music ProgressBar you must add it as a dependency in your Gradle build:

Step 1. Add the JitPack repository to your build file Add it in your root build.gradle at the end of repositories:

allprojects {
  repositories {

...
maven {
 url "https://jitpack.io" 
}
  
}
 
}

Step 2. Add the dependency

dependencies {

  compile 'com.github.aliab:circular-music-progressbar:v1.3.0' 
}

Then add the view to your layout:

 <info.abdolahi.CircularMusicProgressBar

xmlns:app="http://schemas.android.com/apk/res-auto"

android:id="@+id/album_art"

android:layout_width="300dp"

android:layout_height="300dp"

android:layout_gravity="center"

android:src="@drawable/maron5"

app:border_color="#00796B"

app:border_width="2dp"

app:centercircle_diammterer="1"

app:progress_color="#80CBC4"

app:progress_startAngle="40"  app:draw_anticlockwise="false" />

XML attributes

 <info.abdolahi.CircularMusicProgressBar

app:border_color="#00796B"

app:border_width="2dp"

app:centercircle_diammterer="1"

app:progress_color="#80CBC4"

app:progress_startAngle="40"  app:draw_anticlockwise="true" />

XML attributes

Name Type Default Description
border_color Color Color.BLACK ProgressBar background color
border_width dimen 2 Thicknes of progress bar
centercircle_diammterer Float 0.805f Number between 0 and 1, that change diammeter of album art image
progress_color Color Color.BLUE ProgressBar active state color
progress_startAngle Float 0 Number between 0 and 360 that describe Start angle of progress bar active state
draw_anticlockwise Boolean false If set to true, progress will be Anti-Clockwise

Public Methods

Name Description
setValue(float) Change value of progress with animation
setValueWithNoAnimation(float) Change value of progress with animation
setBorderProgressColor(Color) Set progressbar active state color
setBorderColor(Color) Set progressbar non-active state color
setProgressAnimationState(boolean) Change state of progress value animation. set it to 'false' if you don't want any animation
setProgressAnimatorInterpolator(TimeInterpolator) Change interpolator of animation to get more effect on animation
setOnCircularBarChangeListener(OnCircularSeekBarChangeListener listener) Get an update if user want to seek to position or click on image

Note: Because I extended ImageView you can use all ImageView public methods too.

Limitations

  • The ScaleType is always CENTER_CROP and you'll get an exception if you try to change it. This is (currently) by design as it's perfectly fine for music album art.
  • Enabling adjustViewBounds is not supported as this requires an unsupported ScaleType
  • If you use an image loading library like Picasso or Glide, you need to disable their fade animations to avoid messed up images. For Picasso use the noFade() option, for Glide use dontAnimate(). If you want to keep the fadeIn animation, you have to fetch the image into a Target and apply a custom animation yourself when receiving the Bitmap.
  • Using a TransitionDrawable with CircleImageView doesn't work properly and leads to messed up images.

Todo

  • Animation interpolator setter
  • Animation disable/enable method
  • Support Anti-Clockwise progress
  • Drag to seek listener
  • Buffering mode animation
  • Change thickness of borderes independently
  • Support shadow/glow

Changelog

v1.3.0

  • Support drag to specific position
  • Some measurement bug fix

v1.2.0

  • Support Anti-Clockwise progress

v1.1.1

  • Fix Force Close when add view dynamically

v1.1.0

  • Public method for change animation interpolator
  • Public method to disable animation

v1.0.1

  • Remove AllowBackup from manifest of library

v1.0.0

  • Initial release

CREDITS

License


 The MIT License (MIT)  Copyright (c) 2017 Ali Abdolahi  Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:  The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.  THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.  

Resources

FloatingText is a text widget that can floating above view with animation.

A small, yet full-featured framework that allows building View-based Android applications. Conductor provides a light-weight wrapper around standard Android Views that does just about everything you'd want.

IntelliJ IDEA/Android Studio plugin that adds a 'Step Builder' action to the Generate menu (Alt+Insert) which generates a Builder class which follows the Step Builder pattern.

An android widget to input passcode.

GenericRenderers is an Android library created to avoid all the boilerplate needed to use a RecyclerView with adapters.

Cursor binding which uses annotation processing to generate boilerplate code for you.

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