GithubHelp home page GithubHelp logo

enginebai / swagpoints Goto Github PK

View Code? Open in Web Editor NEW
315.0 6.0 50.0 1.26 MB

An Android custom circular SeekBar that supports max/min range and step settings.

Home Page: https://enginebai.com/2018/05/07/android-custom-view/

License: Apache License 2.0

Java 100.00%
android custom-view seekbar circular-progress-bar java

swagpoints's Introduction

SwagPoints

License Download

SwagPoints - An Android custom circular SeekBar that supports max/min range and step settings.

SwagPoints

Gradle

dependencies {
	...
	compile 'com.dualcores.swagpoints:swagpoints:1.0.2'
}

Usage

  • In XML layout:
<com.dualcores.swagpoints.SwagPoints
    xmlns:swagpoints="http://schemas.android.com/apk/res-auto"
    android:id="@+id/seekbar_point"
    android:layout_width="match_parent"
    android:layout_height="340dp"
    android:layout_gravity="center"
    android:padding="64dp"
    swagpoints:min="100"
    swagpoints:max="1000"
    swagpoints:step="100"
    swagpoints:progressColor="@color/color_progress"
    swagpoints:progressWidth="12dp"
    swagpoints:arcColor="@color/color_arc"
    swagpoints:arcWidth="8dp"
    swagpoints:textSize="72sp"
    swagpoints:textColor="@color/colorText"
    swagpoints:indicatorIcon="@drawable/indicator"
    />

Remember to add layout_padding to make sure that there is enough space to display the whole widget and indicator drawable.

If you don't add any layout_padding, the arc will extend the whole width/height, and the indicator drawable will be truncated (as below diagram).

  • All customizable attributes:
<declare-styleable name="SwagPoints">
    <attr name="points" format="integer" />
    <attr name="max" format="integer" />
    <attr name="min" format="integer"/>
    <attr name="step" format="integer"/>
    <attr name="indicatorIcon" format="reference" />
    <attr name="progressWidth" format="dimension" />
    <attr name="progressColor" format="color" />
    <attr name="arcWidth" format="dimension" />
    <attr name="arcColor" format="color" />
    <attr name="textSize" format="dimension"/>
    <attr name="textColor" format="color"/>
    <attr name="clockwise" format="boolean" />
    <attr name="enabled" format="boolean" />
</declare-styleable>

Sample

  • Clone the repository and check out the app module.
  • Download the app Swag – Exchange Personal Snaps on Google Play. This widget is used in the send point dialog.

Licence

Copyright 2016 Engine Bai

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.

swagpoints's People

Contributors

cls63amg avatar enginebai avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar

swagpoints's Issues

SwagPoint Error report!

Hi!
First of all would like to thank you for the best framework I ever found to create a Circular Seekbar in Android..
I´m using it in a project that I create a remote control to a ventilator using Bluetooth LE for Android and your Circular Seekbar (SwagPoint) works as a Speed Control.

But I have found some problems using it and I like to report you and maybe you can fix this for me!!

  • The range goes between 0 and 80 with steps in 10. It works fine but some times when I try to change from 70 to 80 the progress bar stock on 70 and the number shows 80 (kind of bug, I guess).

  • The other problem I have is almost the same, when I change from 70 to 80, in the listener I have a SharedPreferences who save the values and instead of 80, the listener gives to me 0 (zero). It´s not every time, just sometimes... But it happens and it´s not good.

can you help me ?

SwagPoints cannot center text



<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
 xmlns:swagpoints="http://schemas.android.com/apk/res-auto"
 android:layout_width="match_parent"
 android:layout_height="match_parent"
 android:background="@color/colorPrimary"
 >

 <android.support.v7.widget.Toolbar
 android:id="@+id/toolbar"
 android:layout_width="match_parent"
 android:layout_height="wrap_content"
 android:background="@color/colorPrimaryDark"
 />

 <com.dualcores.swagpoints.SwagPoints
 android:layout_below="@+id/toolbar"
 xmlns:swagpoints="http://schemas.android.com/apk/res-auto"
 android:id="@+id/seekbar_point"
 android:layout_width="match_parent"
 android:layout_height="340dp"
 android:layout_gravity="center"
 android:padding="64dp"
 swagpoints:min="100"
 swagpoints:max="1000"
 swagpoints:step="100"
 swagpoints:progressColor="@color/color_progress"
 swagpoints:progressWidth="12dp"
 swagpoints:arcColor="@color/color_arc"
 swagpoints:arcWidth="8dp"
 swagpoints:textSize="72sp"
 swagpoints:textColor="#ffffff"
 swagpoints:indicatorIcon="@drawable/indicator"
 />



貼這段SwagPoints中間的字沒辦法置中

set points

it seems that setting the points value in case of edit it doesn't work
i'm using binding.swagpoints.points = 5000(max value) and the value isn't set :/ can i get some help with it?

progress doesn't come back to zero

hi
please answer my question . i use your library for music player and set point for player position . now when i play or track music work good but when music finish and i want to repeat the music progress can't set and stay on the max or end of progress and stay on full and doesn't be changed .
please check and call me.
tnx.

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.