Giter Club home page Giter Club logo

colorseekbar's Introduction

ColorSeekbar

ScreenShot:

ColorSeekbar Attrs

<declare-styleable name="ColorSeekBar">
    <attr name="colorSeekBarColorSeeds" format="reference" />
    <attr name="colorSeekBarBarHeight" format="dimension" />
    <attr name="colorSeekBarProgress" format="integer" />
    <attr name="colorSeekBarRadius" format="dimension" />
    <attr name="colorSeekBarMaxProgress" format="integer" />
    <attr name="colorSeekBarVertical" format="boolean" />
    <attr name="colorSeekBarShowThumb" format="boolean" />
    <attr name="colorSeekBarBorderColor" format="color" />
    <attr name="colorSeekBarBorderSize" format="dimension" />
</declare-styleable>

AlphaSeekbar Attrs

<declare-styleable name="AlphaSeekBar">
    <attr name="alphaSeekBarHeight" format="dimension" />
    <attr name="alphaSeekBarRadius" format="dimension" />
    <attr name="alphaSeekBarShowGrid" format="boolean" />
    <attr name="alphaSeekBarShowThumb" format="boolean" />
    <attr name="alphaSeekBarSizeGrid" format="dimension" />
    <attr name="alphaSeekBarProgress" format="integer" />
    <attr name="alphaSeekBarVertical" format="boolean" />
    <attr name="alphaSeekBarMaxProgress" format="integer" />
    <attr name="alphaSeekBarBorderColor" format="color" />
    <attr name="alphaSeekBarBorderSize" format="dimension" />
    <attr name="alphaSeekBarDirection" format="enum">
        <enum name="LEFT_TO_RIGHT" value="0"/>
        <enum name="RIGHT_TO_LEFT" value="1"/>
        <enum name="TOP_TO_BOTTOM" value="2"/>
        <enum name="BOTTOM_TO_TOP" value="3"/>
    </attr>
</declare-styleable>

Gradle:

Release API Android Arsenal

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

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

Step 2. Add the dependency

implementation 'com.github.rtugeek:colorseekbar:2.0.3'

Usage

XML

<com.rtugeek.android.colorseekbar.ColorSeekBar 
    android:id="@+id/colorSeekBar"
    android:layout_width="match_parent"
    app:colorSeeds="@array/material_colors"
    android:layout_height="wrap_content" />

<com.rtugeek.android.colorseekbar.AlphaSeekBar 
    android:id="@+id/alphaSeekBar"
    android:layout_width="match_parent" 
    android:layout_height="wrap_content" />

Kotlin

colorSeekBar.maxProgress = 1000
colorSeekBar.progress = 50
colorSeekBar.borderColor = Color.BLACK
colorSeekBar.borderRadius = 10
colorSeekBar.borderSize = 10
colorSeekBar.thumbDrawer = DefaultThumbDrawer(30,Color.WHITE,Color.BLUE)
colorSeekBar.isVertical = false
colorSeekBar.barHeight = 10
colorSeekBar.color = Color.BLACK // or colorSeekBar.progress = 100
//lock thumb
colorSeekBar.isEnabled =false


alphaSeekBar.maxProgress = 1000
alphaSeekBar.borderColor = Color.BLACK
alphaSeekBar.borderRadius = 10
alphaSeekBar.borderSize = 10
alphaSeekBar.thumbDrawer = DefaultThumbDrawer(30,Color.WHITE,Color.BLUE)
alphaSeekBar.isVertical = false
alphaSeekBar.barHeight = 10
alphaSeekBar.alphaValue = 255 // or alphaSeekBar.progress = 100

Listener

colorSeekBar.setOnColorChangeListener { progress, color ->
    Log.i("TAG", "===progress:$progress-color:$color===")
}

alphaSeekBar.setOnAlphaChangeListener { progress, alpha ->
    Log.i("AlphaSeekBarFragment", "===progress:$progress-alpha:$alpha===")
}

Thumb Drawer

  • com.rtugeek.android.colorseekbar.thumb.DefaultThumbDrawer
  • com.rtugeek.android.colorseekbar.thumb.DrawableThumbDrawer - Load thumb from drawable resource
  • com.rtugeek.android.colorseekbar.thumb.ThumbDrawer - Implement this interface if you want to customize thumb

Vertical Bar

<com.rtugeek.android.colorseekbar.ColorSeekBar 
    android:id="@+id/colorSlider"
    android:layout_width="match_parent" 
    app:colorSeeds="@array/material_colors"
    app:colorSeekBarVertical="true" 
    android:layout_height="wrap_content" />

Spread the word

License

        DO WHAT THE FUCK YOU WANT TO PUBLIC LICENSE
                Version 2, December 2004

Copyright (C) 2004 Leon Fu <[email protected]>

Everyone is permitted to copy and distribute verbatim or modified
copies of this license document, and changing it is allowed as long
as the name is changed.

        DO WHAT THE FUCK YOU WANT TO PUBLIC LICENSE
TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION

 0. You just DO WHAT THE FUCK YOU WANT TO.

colorseekbar's People

Contributors

rtugeek avatar tobaloidee avatar bryant1410 avatar subhamtyagi avatar lemaneh 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.