Crystal Range Seekbar

Additional

Language
Java
Version
N/A
Created
Jul 17, 2016
Updated
Oct 24, 2018
Owner
Syed Owais Ali (syedowaisali)
Contributors
BraisGabin
olidroide
kirvis250
ahmed alkhashab (ahmedalkhashab)
Syed Owais Ali (syedowaisali)
hhoang
fashioncj
artzmb
sousav
aleksandr1592
zoltanbalint
mxl
bearlysophisticated
13
Activity
Badge
Generate
Download
Source code
APK file

Blurb

Crystal Range Seekbar

An extended version of seekbar and range seekbar with basic and advanced customization.

Usage

Add a dependency to your build.gradle:

dependencies {
    compile 'com.crystal:crystalrangeseekbar:1.1.3'
}

Features

  • Customize with xml using custom handy attributes.
  • Customize in your activity, fragment or dialog.
  • Styling with your own widget.
  • Creating newly widget from activity, fragment or dialog.

Sample usage - Seekbar

Default style using xml.

<com.crystal.crystalrangeseekbar.widgets.CrystalSeekbar
    android:id="@+id/rangeSeekbar1"
    android:layout_width="match_parent"
    android:layout_height="wrap_content"/>

Styling with bubble animation using custom widget

BubbleThumbSeekbar.<com.crystal.crystalrangeseekbar.widgets.BubbleThumbSeekbarandroid:id="@+id/rangeSeekbar2"android:layout_width="match_parent"android:layout_height="wrap_content"app:corner_radius="10"app:min_value="50"app:max_value="150"app:bar_color="#C69E89"app:bar_highlight_color="#A54B17"app:left_thumb_color="#775E4F"app:left_thumb_color_pressed="#4C2D1A"app:data_type="_integer"/>


Styling with bubble animation with drawable using custom widget

BubbleThumbSeekbar.<com.crystal.crystalrangeseekbar.widgets.BubbleThumbSeekbarandroid:id="@+id/rangeSeekbar3"android:layout_width="match_parent"android:layout_height="wrap_content"app:corner_radius="10"app:min_value="0"app:max_value="100"app:steps="5"app:bar_color="#F7BB88"app:bar_highlight_color="#E07416"app:left_thumb_image="@drawable/thumb"app:left_thumb_image_pressed="@drawable/thumb_pressed"app:data_type="_integer"/>

Right to Left position (rtl)

<com.crystal.crystalrangeseekbar.widgets.CrystalSeekbarandroid:id="@+id/rangeSeekbar7"android:layout_width="match_parent"android:layout_height="wrap_content"app:position="right"/>

Right to Left position with drawable position update from code (rtl)

<com.crystal.crystalrangeseekbar.widgets.CrystalSeekbarandroid:id="@+id/rangeSeekbar8"android:layout_width="match_parent"android:layout_height="wrap_content"app:min_value="100"app:max_value="200"app:steps="5"app:bar_color="#F7BB88"app:bar_highlight_color="#E07416"app:left_thumb_image="@drawable/thumb"app:left_thumb_image_pressed="@drawable/thumb_pressed"app:data_type="_integer"/>
// get seekbar from viewfinalCrystalSeekbar rangeSeekbar = (CrystalSeekbar) rootView.findViewById(R.id.rangeSeekbar8); // change position left to right rangeSeekbar.setPosition(CrystalSeekbar.Position.RIGHT).apply();

Create new seekbar from code and add to any view.

// get seekbar from viewfinalCrystalSeekbar seekbar =newCrystalSeekbar(getActivity()); // get min and max text viewfinalTextView tvMin = (TextView) rootView.findViewById(R.id.textMin5); finalTextView tvMax = (TextView) rootView.findViewById(R.id.textMax5); // set listener seekbar.setOnSeekbarChangeListener(newOnSeekbarChangeListener() { @OverridepublicvoidvalueChanged(NumberminValue) { tvMin.setText(String.valueOf(minValue)); } }); // set final value listener seekbar.setOnSeekbarFinalValueListener(newOnSeekbarFinalValueListener() { @OverridepublicvoidfinalValue(Numbervalue) { Log.d("CRS=>", String.valueOf(value)); } }); // get range seekbar containerRelativeLayout container = (RelativeLayout) rootView.findViewById(R.id.contRangeSeekbar5); container.addView(rangeSeekbar);

Styling with create custom widget