IndicatorSeekBar icon indicating copy to clipboard operation
IndicatorSeekBar copied to clipboard

can't set Indicator color programmatically

Open Aye-Myat-Mon opened this issue 6 years ago • 6 comments

I want to set indicator color programmatically like if(seekBar.getProgress() == 25{ seekBar.setIndicatorColor("#fffff"); } I found no function name to set color. Please help me.Thanks.

Aye-Myat-Mon avatar Jan 12 '19 09:01 Aye-Myat-Mon

You can custom a indicator and set/change the indicator's view you wanted.like: seekbar.getIndicator().setContentView(your indicatorView, textView( to show progress, must can be found in indicatorView)); then you can change the indicatorView you wanted.

warkiz avatar Jan 22 '19 03:01 warkiz

@Aye-Myat-Mon were you able to get it working?

paul-man avatar Jun 01 '19 23:06 paul-man

Thank you, I’ve already found solution like you said 😁. indicator.setContentview() really worked well.

Aye-Myat-Mon avatar Jun 01 '19 23:06 Aye-Myat-Mon

@Aye-Myat-Mon @warkiz I also want to change the color of indicator but after reading your comments i can't what to write after indiactor.setContentView Can you explain a little bit more

Umar431497 avatar Dec 26 '19 11:12 Umar431497

@Aye-Myat-Mon @warkiz @paul-man can u give me a programming example of changing indicator color?

Umar431497 avatar Dec 26 '19 11:12 Umar431497

@Umar431497 @paul-man In my case, I did like this: In java,

final LayoutInflater factory = getLayoutInflater(); final View background = factory.inflate(R.layout.custom_indicator, null); indicatorBg = background.findViewById(R.id.relative); indicatorText = background.findViewById(R.id.isb_progress); seekBar.getIndicator().setContentView(background);

In xml, I added custom background drawable(indicator_blue_bg) in RelativeLayout. `<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android" android:layout_width="match_parent" android:layout_height="match_parent">

<RelativeLayout
    android:id="@+id/indicator_layout"
    android:layout_centerHorizontal="true"
    android:layout_width="wrap_content"
    android:layout_height="wrap_content"
    android:background="@drawable/indicator_blue_bg"
    android:gravity="center_vertical"
    android:orientation="horizontal"
    android:paddingTop="8dp"
    android:paddingBottom="8dp"
    android:paddingStart="16dp"
    android:paddingEnd="16dp"
    android:elevation="2dp">
    <TextView
        android:id="@+id/isb_progress"
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:paddingBottom="16dp"
        android:paddingStart="2dp"
        android:paddingEnd="1dp"
        style="@style/Venus15RegularPrimary"
        android:fontFamily="@font/apercu"
        android:layout_centerHorizontal="true"/>

</RelativeLayout>

</RelativeLayout>` It worked for me. Good luck!!!

Aye-Myat-Mon avatar Jan 07 '20 04:01 Aye-Myat-Mon