Skip to content

Commit

Permalink
add one more indicator type:circular_bubble
Browse files Browse the repository at this point in the history
  • Loading branch information
warkiz committed Dec 17, 2017
1 parent 391423c commit 4777d8c
Show file tree
Hide file tree
Showing 13 changed files with 66 additions and 149 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -33,35 +33,35 @@ public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle sa
textView1.setText("continuous");
content.addView(textView1);
//CONTINUOUS
IndicatorSeekBar indicatorSeekBar1 = new IndicatorSeekBar.Builder(getContext()).setIndicatorStay(true).setSeekBarType(IndicatorSeekBarType.CONTINUOUS).setMax(88).setMin(2).setProgress(33).setBackgroundTrackSize(2).setBackgroundTrackColor(Color.parseColor("#FF0000")).setProgressTrackSize(4).setProgressTrackColor(Color.parseColor("#FF0000")).setThumbColor(Color.parseColor("#FF0000")).showIndicator(true).setIndicatorType(IndicatorType.ROUNDED_CORNERS).setIndicatorColor(Color.parseColor("#FF0000")).build();
IndicatorSeekBar indicatorSeekBar1 = new IndicatorSeekBar.Builder(getContext()).setIndicatorStay(true).setSeekBarType(IndicatorSeekBarType.CONTINUOUS).setMax(88).setMin(2).setProgress(33).setBackgroundTrackSize(2).setBackgroundTrackColor(Color.parseColor("#FF0000")).setProgressTrackSize(4).setProgressTrackColor(Color.parseColor("#FF0000")).setThumbColor(Color.parseColor("#FF0000")).showIndicator(true).setIndicatorType(IndicatorType.RECTANGLE_ROUNDED_CORNER).setIndicatorColor(Color.parseColor("#FF0000")).build();
content.addView(indicatorSeekBar1);

TextView textView2 = getTextView();
textView2.setText("continuous_texts_ends");
content.addView(textView2);
//CONTINUOUS_TEXTS_ENDS
IndicatorSeekBar indicatorSeekBar2 = new IndicatorSeekBar.Builder(getContext()).setThumbDrawable(R.mipmap.ic_launcher).setSeekBarType(IndicatorSeekBarType.CONTINUOUS_TEXTS_ENDS).setMax(45).setMin(3).setLeftEndText("LEFT").setRightEndText("RIGHT").setProgress(33).setBackgroundTrackSize(1).setBackgroundTrackColor(Color.parseColor("#FF0000")).setProgressTrackSize(3).setProgressTrackColor(Color.parseColor("#FF0000")).showIndicator(true).setIndicatorType(IndicatorType.SQUARE_CORNERS).setIndicatorColor(Color.parseColor("#FF0000")).build();
IndicatorSeekBar indicatorSeekBar2 = new IndicatorSeekBar.Builder(getContext()).setThumbDrawable(R.mipmap.ic_launcher).setSeekBarType(IndicatorSeekBarType.CONTINUOUS_TEXTS_ENDS).setMax(45).setMin(3).setLeftEndText("LEFT").setRightEndText("RIGHT").setProgress(33).setBackgroundTrackSize(1).setBackgroundTrackColor(Color.parseColor("#FF0000")).setProgressTrackSize(3).setProgressTrackColor(Color.parseColor("#FF0000")).showIndicator(true).setIndicatorType(IndicatorType.RECTANGLE).setIndicatorColor(Color.parseColor("#FF0000")).build();
content.addView(indicatorSeekBar2);

TextView textView3 = getTextView();
textView3.setText("discrete_ticks");
content.addView(textView3);
//DISCRETE_TICKS
IndicatorSeekBar indicatorSeekBar3 = new IndicatorSeekBar.Builder(getContext()).setMax(200).setMin(0).setSeekBarType(IndicatorSeekBarType.DISCRETE_TICKS).setTickType(TickType.OVAL).setTickColor(Color.parseColor("#0000FF")).setTickSize(8).setTickNum(8).setProgress(67).setBackgroundTrackSize(2).setBackgroundTrackColor(Color.parseColor("#666666")).setProgressTrackSize(3).setProgressTrackColor(Color.parseColor("#0000FF")).showIndicator(true).setIndicatorType(IndicatorType.SQUARE_CORNERS).setIndicatorColor(Color.parseColor("#0000FF")).build();
IndicatorSeekBar indicatorSeekBar3 = new IndicatorSeekBar.Builder(getContext()).setMax(200).setMin(0).setSeekBarType(IndicatorSeekBarType.DISCRETE_TICKS).setTickType(TickType.OVAL).setTickColor(Color.parseColor("#0000FF")).setTickSize(8).setTickNum(8).setProgress(67).setBackgroundTrackSize(2).setBackgroundTrackColor(Color.parseColor("#666666")).setProgressTrackSize(3).setProgressTrackColor(Color.parseColor("#0000FF")).showIndicator(true).setIndicatorType(IndicatorType.RECTANGLE).setIndicatorColor(Color.parseColor("#0000FF")).build();
content.addView(indicatorSeekBar3);

TextView textView4 = getTextView();
textView4.setText("discrete_ticks_texts");
content.addView(textView4);
//DISCRETE_TICKS_TEXTS
IndicatorSeekBar indicatorSeekBar4 = new IndicatorSeekBar.Builder(getContext()).setTextArray(R.array.tick_below_text_length_5).setSeekBarType(IndicatorSeekBarType.DISCRETE_TICKS_TEXTS).setTickType(TickType.REC).setTickColor(Color.parseColor("#FFFFFF")).setTextSize(13).setTextColor(Color.parseColor("#0000FF")).setBackgroundTrackColor(Color.parseColor("#800000FF")).setProgressTrackColor(Color.parseColor("#0000FF")).setProgressTrackSize(3).setBackgroundTrackSize(2).showIndicator(true).setIndicatorType(IndicatorType.ROUNDED_CORNERS).setIndicatorColor(Color.parseColor("#0000FF")).setIndicatorTextSize(20).setIndicatorTextColor(Color.parseColor("#FFFFFF")).build();
IndicatorSeekBar indicatorSeekBar4 = new IndicatorSeekBar.Builder(getContext()).setTextArray(R.array.tick_below_text_length_5).setSeekBarType(IndicatorSeekBarType.DISCRETE_TICKS_TEXTS).setTickType(TickType.REC).setTickColor(Color.parseColor("#FFFFFF")).setTextSize(13).setTextColor(Color.parseColor("#0000FF")).setBackgroundTrackColor(Color.parseColor("#800000FF")).setProgressTrackColor(Color.parseColor("#0000FF")).setProgressTrackSize(3).setBackgroundTrackSize(2).showIndicator(true).setIndicatorType(IndicatorType.RECTANGLE_ROUNDED_CORNER).setIndicatorColor(Color.parseColor("#0000FF")).setIndicatorTextSize(20).setIndicatorTextColor(Color.parseColor("#FFFFFF")).build();
content.addView(indicatorSeekBar4);

TextView textView5 = getTextView();
textView5.setText("discrete_ticks_texts_ends");
content.addView(textView5);
//DISCRETE_TICKS_TEXTS_ENDS
IndicatorSeekBar indicatorSeekBar5 = new IndicatorSeekBar.Builder(getContext()).setSeekBarType(IndicatorSeekBarType.DISCRETE_TICKS_TEXTS_ENDS).setLeftEndText("LAST").setIndicatorCustomLayout(R.layout.custom_indicator_blue).setRightEndText("NEXT").setTickDrawable(getResources().getDrawable(R.drawable.thumb_rec_0_corner)).setThumbDrawable(R.drawable.thumb_rec_0_corner_big).setTextColor(Color.parseColor("#0000FF")).showIndicator(true).build();
IndicatorSeekBar indicatorSeekBar5 = new IndicatorSeekBar.Builder(getContext()).setIndicatorType(IndicatorType.CIRCULAR_BUBBLE).setProgress(50).setIndicatorStay(true).setSeekBarType(IndicatorSeekBarType.DISCRETE_TICKS_TEXTS_ENDS).setTickNum(6).setLeftEndText("LAST").setRightEndText("NEXT").setTickDrawable(getResources().getDrawable(R.drawable.thumb_rec_0_corner)).setThumbDrawable(R.drawable.thumb_rec_0_corner_big).setTextColor(Color.parseColor("#0000FF")).showIndicator(true).build();
content.addView(indicatorSeekBar5);
return root;
}
Expand Down
10 changes: 0 additions & 10 deletions app/src/main/res/drawable/custom_indicator_bg_oval_pink.xml

This file was deleted.

11 changes: 8 additions & 3 deletions app/src/main/res/layout/continuous.xml
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,9 @@
android:layout_height="wrap_content"
app:isb_max="78.8"
app:isb_min="10.2"
app:isb_indicator_type="rectangle"
app:isb_progress="50.3"
app:isb_indicator_stay="true"
app:isb_progress_value_float="true"
app:isb_show_indicator="true" />

Expand All @@ -53,6 +55,7 @@
app:isb_indicator_text_color="#000000"
app:isb_max="880"
app:isb_progress="674"
app:isb_indicator_type="rectangle_rounded_corner"
app:isb_seek_bar_type="continuous_texts_ends"
app:isb_show_indicator="true"
app:isb_text_color="@color/color_red"
Expand All @@ -69,9 +72,9 @@
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginTop="16dp"
app:isb_indicator_text_color="@color/color_blue"
app:isb_indicator_text_color="#FFF"
app:isb_indicator_text_size="19dp"
app:isb_indicator_type="rounded_corners"
app:isb_indicator_type="rectangle_rounded_corner"
app:isb_progress="46"
app:isb_seek_bar_type="continuous"
app:isb_show_indicator="true"
Expand Down Expand Up @@ -109,12 +112,14 @@
android:layout_height="wrap_content"
app:isb_max="100.0"
app:isb_min="0.0"
app:isb_progress="59.3"
app:isb_progress="80.3"
app:isb_indicator_type="circular_bubble"
app:isb_progress_value_float="true"
app:isb_show_indicator="true"
app:isb_text_color="@color/color_blue"
app:isb_thumb_color="@color/color_blue"
app:isb_thumb_progress_stay="true"
app:isb_indicator_stay="true"
app:isb_track_background_bar_color="@color/color_green"
app:isb_track_progress_bar_color="@color/color_blue"
app:isb_track_progress_bar_size="4dp"
Expand Down
73 changes: 33 additions & 40 deletions app/src/main/res/layout/custom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -17,65 +17,67 @@

<TextView
style="@style/subtitle_text_style"
android:text="1. custom thumb drawable" />
android:text="1. custom top content view for indicator" />

<com.warkiz.widget.IndicatorSeekBar
android:layout_width="match_parent"
android:layout_height="wrap_content"
app:isb_progress="50"
app:isb_indicator_custom_top_content_layout="@layout/custom_top_content_view_rect"
app:isb_max="99.9"
app:isb_min="10.8"
app:isb_indicator_stay="true"
app:isb_progress="80"
app:isb_progress_value_float="true"
app:isb_seek_bar_type="discrete_ticks_texts"
app:isb_show_indicator="true"
app:isb_thumb_drawable="@drawable/thumb_custom" />

<TextView
style="@style/subtitle_text_style"
android:text="2. custom tick drawable" />
app:isb_tick_num="6"
app:isb_tick_type="oval"
app:isb_track_progress_bar_size="3dp" />

<com.warkiz.widget.IndicatorSeekBar
android:layout_width="match_parent"
android:layout_height="wrap_content"
app:isb_indicator_type="rounded_corners"
app:isb_progress="34"
android:layout_marginTop="36dp"
app:isb_indicator_stay="true"
app:isb_indicator_custom_top_content_layout="@layout/custom_top_content_view_round"
app:isb_indicator_type="rectangle_rounded_corner"
app:isb_progress="67"
app:isb_seek_bar_type="discrete_ticks_texts"
app:isb_show_indicator="true"
app:isb_tick_drawable="@drawable/tick_custom"
app:isb_tick_num="7" />
app:isb_text_array="@array/tick_below_text_length_6"
app:isb_text_color="@color/color_blue"
app:isb_tick_drawable="@mipmap/ic_launcher"
app:isb_tick_num="6" />

<TextView
style="@style/subtitle_text_style"
android:text="3. custom top content view for indicator" />
android:text="2. custom thumb drawable" />

<com.warkiz.widget.IndicatorSeekBar
android:layout_width="match_parent"
android:layout_height="wrap_content"
app:isb_indicator_custom_top_content_layout="@layout/custom_top_content_view_rect"
app:isb_max="99.9"
app:isb_min="10.8"
app:isb_progress="50"
app:isb_progress_value_float="true"
app:isb_seek_bar_type="discrete_ticks_texts"
app:isb_show_indicator="true"
app:isb_tick_num="6"
app:isb_tick_type="oval"
app:isb_track_progress_bar_size="3dp" />
app:isb_thumb_drawable="@drawable/thumb_custom" />

<TextView
style="@style/subtitle_text_style"
android:text="2. custom tick drawable" />

<com.warkiz.widget.IndicatorSeekBar
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginTop="16dp"
app:isb_indicator_custom_top_content_layout="@layout/custom_top_content_view_round"
app:isb_indicator_type="rounded_corners"
app:isb_progress="67"
app:isb_indicator_type="rectangle_rounded_corner"
app:isb_progress="34"
app:isb_seek_bar_type="discrete_ticks_texts"
app:isb_show_indicator="true"
app:isb_text_array="@array/tick_below_text_length_6"
app:isb_text_color="@color/color_blue"
app:isb_tick_drawable="@mipmap/ic_launcher"
app:isb_tick_num="6" />
app:isb_tick_drawable="@drawable/tick_custom"
app:isb_tick_num="7" />


<TextView
style="@style/subtitle_text_style"
android:text="4. custom indicator" />
android:text="3. custom indicator" />

<com.warkiz.widget.IndicatorSeekBar
android:layout_width="match_parent"
Expand All @@ -84,6 +86,7 @@
app:isb_indicator_custom_layout="@layout/custom_indicator_rec"
app:isb_indicator_type="custom"
app:isb_progress="20"
app:isb_indicator_stay="true"
app:isb_show_indicator="true"
app:isb_thumb_progress_stay="true" />

Expand All @@ -99,21 +102,11 @@
app:isb_thumb_drawable="@mipmap/ic_launcher"
app:isb_tick_color="#FFF"
app:isb_tick_num="6"
app:isb_indicator_stay="true"
app:isb_track_background_bar_color="@color/color_pink"
app:isb_track_progress_bar_color="@color/color_blue"
app:isb_track_progress_bar_size="4dp" />

<com.warkiz.widget.IndicatorSeekBar
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginTop="16dp"
app:isb_indicator_custom_layout="@layout/custom_indicator_red"
app:isb_indicator_stay="true"
app:isb_indicator_type="custom"
app:isb_progress="50"
app:isb_seek_bar_type="discrete_ticks_texts_ends"
app:isb_show_indicator="true" />

</LinearLayout>

</ScrollView>
37 changes: 8 additions & 29 deletions app/src/main/res/layout/custom_indicator.xml
Original file line number Diff line number Diff line change
Expand Up @@ -25,31 +25,21 @@
android:layout_height="wrap_content"
android:layout_marginTop="16dp"
app:isb_indicator_custom_top_content_layout="@layout/custom_top_content_view_rect_without_progress"
app:isb_indicator_type="square_corners"
app:isb_indicator_type="rectangle_rounded_corner"
app:isb_progress="20"
app:isb_show_indicator="true" />

<com.warkiz.widget.IndicatorSeekBar
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginTop="16dp"
android:layout_marginTop="36dp"
app:isb_indicator_custom_layout="@layout/custom_indicator_oval_without_progress"
app:isb_indicator_stay="true"
app:isb_indicator_type="custom"
app:isb_progress="30"
app:isb_progress="70"
app:isb_show_indicator="true"
app:isb_thumb_drawable="@mipmap/ic_launcher" />

<com.warkiz.widget.IndicatorSeekBar
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginTop="16dp"
app:isb_indicator_custom_layout="@layout/custom_indicator_blue_without_progress"
app:isb_indicator_type="custom"
app:isb_progress="50"
app:isb_seek_bar_type="discrete_ticks_texts"
app:isb_tick_drawable="@mipmap/ic_launcher"
app:isb_tick_num="6" />

<TextView
style="@style/subtitle_text_style"
android:text="2. indicator_with_progress" />
Expand All @@ -59,29 +49,18 @@
android:layout_height="wrap_content"
android:layout_marginTop="16dp"
app:isb_indicator_custom_top_content_layout="@layout/custom_top_content_view_rect"
app:isb_indicator_type="square_corners"
app:isb_progress="20" />
app:isb_indicator_type="rectangle"
app:isb_progress="80" />

<com.warkiz.widget.IndicatorSeekBar
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginTop="16dp"
app:isb_indicator_custom_layout="@layout/custom_indicator_oval"
app:isb_indicator_type="custom"
app:isb_progress="30"
app:isb_thumb_drawable="@mipmap/ic_launcher" />

<com.warkiz.widget.IndicatorSeekBar
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginTop="16dp"
app:isb_indicator_custom_layout="@layout/custom_indicator_blue"
app:isb_indicator_stay="true"
app:isb_indicator_type="custom"
app:isb_progress="50"
app:isb_seek_bar_type="discrete_ticks_texts"
app:isb_tick_drawable="@mipmap/ic_launcher"
app:isb_tick_num="6" />
app:isb_progress="20"
app:isb_thumb_drawable="@mipmap/ic_launcher" />

</LinearLayout>

Expand Down
19 changes: 0 additions & 19 deletions app/src/main/res/layout/custom_indicator_blue.xml

This file was deleted.

19 changes: 0 additions & 19 deletions app/src/main/res/layout/custom_indicator_blue_without_progress.xml

This file was deleted.

7 changes: 5 additions & 2 deletions app/src/main/res/layout/custom_indicator_rec.xml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_width="60dp"
android:layout_height="wrap_content"
android:background="#FF0000"
android:gravity="center_vertical"
android:orientation="horizontal"
Expand All @@ -18,6 +18,9 @@
android:text="I am a customized indicator. "
android:textColor="#FFFFFF"/>


<!--if you does not want to change this text by progress,
you can set the TextView's id to others(not isb_progress).-->
<TextView
android:id="@+id/isb_progress"
android:layout_width="wrap_content"
Expand Down
Loading

0 comments on commit 4777d8c

Please sign in to comment.