Git Product home page Git Product logo

rotarybutton's Introduction

RotaryButton

Custom view for user who want to have a rotary button like volume button (volume knob) or an arc progress bar.

preview

Installation

Add jitpack.io repository to your root build.gradle:

allprojects {
 repositories {
    google()
    jcenter()
    maven { url "https://jitpack.io" }
 }
}

Add the dependency to your module build.gradle:

implementation 'com.github.hiennv3192:rotarybutton:1.0.5'

API

Method Xml Description Default value
setEnabled android:enabled make view enable to interact true
isEnabled Check view is enable or not
setProgressBgImgRes app:rotary_progressBackgroundDrawable Set the image for progress's background
setProgressFgImgRes app:rotary_progressForegroundDrawable Set the image for progress's foreground
setButtonBgImgRes app:rotary_buttonBackgroundDrawable Set the image for button's background
setButtonFgImgRes app:rotary_buttonForegroundDrawable Set the image for button's foreground
setProgressMax app:rotary_progressMax Set max for progress 100
getProgressMax Get max progress
setProgress app:rotary_progress Set progress
getProgress Get current progress
setMaxRotateDegrees app:rotary_maxRotateDegrees Set the max rotation degrees of button 270
setProgressStartDegrees app:rotary_progressStartDegrees Starting angle (in degrees) where the progress begins 135
setButtonStartDegrees app:rotary_buttonStartDegrees Set the start point in degrees of button foreground 135
setProgressPadding app:rotary_progressPadding Set padding for progress foreground and progress background 0
setButtonBgPadding app:rotary_buttonBackgroundPadding Set padding for button background 100
setButtonFgPadding app:rotary_buttonForegroundPadding Set padding for button foreground 180
setOnSeekBarChangeListener Add a listener that will be invoked when the user interacts(start touch, rotate, stop touch) with the view
setOnClickListener Add a listener that will be invoked when the user interacts(touch only) with the view

Note

Please besure your progress foreground image, progress background image, button foreground image, button background image are square

License

Copyright 2020 Nguyễn Văn Hiển

Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at

   http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.

rotarybutton's People

Contributors

hiennv3192 avatar

Stargazers

 avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.