项目作者: agarasul

项目描述 :
Simple customizable Triangle Seekbar
高级语言: Java
项目地址: git://github.com/agarasul/TriangleSeekbar.git
创建时间: 2019-04-01T21:25:17Z
项目社区:https://github.com/agarasul/TriangleSeekbar

开源协议:

下载


TriangleSeekbar

It’s simple lightweight Triangle Seekbar library

Triangle Seekbar Demo

Attributes that you can change

All of this attributes also can be changed from code with relevant methods.

Attribute What it does What type of argument it receives
app:seekbarColor color of seekbar color (For example #b7b7b7)
app:seekbarLoadingColor progress color of seekbar color (For example #b7b7b7)
app:textColor progress text color color (For example #b7b7b7)
app:textFontName set font for progress text font which should locate in assets/fonts folder
app:textFontSize set font size for progress text For example 14f
app:showProgress Should progress text visible or not true or false
app:progressTextPosition The position of progress text in the seekbar Possible positions topLeft,topRight,bottomLeft,bottomRight,center
app:progress Default progress for seekbar value from 0.0 to 1.0

Usage

  1. <az.rasul.triangleseekbar.TriangleSeekbar
  2. android:id="@+id/triangleSeekbar"
  3. android:layout_width="match_parent"
  4. android:layout_height="200dp"
  5. app:showProgress="true"
  6. app:progressTextPosition="center"
  7. app:textFontName="Roboto-Medium.otf"
  8. app:textFontSize="48sp"
  9. app:progress="0.5"
  10. app:seekbarColor="@color/colorPrimary"
  11. app:seekbarLoadingColor="@color/colorAccent"
  12. app:textColor="#E1BEE7"></az.rasul.triangleseekbar.TriangleSeekbar>

In your code you add listener to progress change:

  1. TriangleSeekbar triangleSeekbar = findViewById(R.id.triangleSeekbar);
  2. triangleSeekbar.setProgressListener(new TriangleSeekbar.ProgressListener() {
  3. @Override
  4. public void onProgressChange(float progress) {
  5. progressText.setText(String.valueOf(progress));
  6. }
  7. });

Installation


Add it in your root build.gradle at the end of repositories:

  1. allprojects {
  2. repositories {
  3. ...
  4. maven { url 'https://jitpack.io' }
  5. }
  6. }

Add the dependency

  1. dependencies {
  2. implementation 'com.github.agarasul:TriangleSeekbar:latest.version'
  3. }

License

  1. Copyright 2019 Rasul Aghakishiyev
  2. Licensed under the Apache License, Version 2.0 (the "License");
  3. you may not use this file except in compliance with the License.
  4. You may obtain a copy of the License at
  5. http://www.apache.org/licenses/LICENSE-2.0
  6. Unless required by applicable law or agreed to in writing, software
  7. distributed under the License is distributed on an "AS IS" BASIS,
  8. WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  9. See the License for the specific language governing permissions and
  10. limitations under the License.