Viewpager Relex Circle indicator Color
Asked Answered
G

2

13

The default color of the viewpager indicator is white.
In relex viewpager indicator in github,
it doesn't include on how to change the color of the indicator.
Is it possible?

  <LinearLayout
            android:layout_width="match_parent"
            android:layout_height="match_parent">

            <me.relex.circleindicator.CircleIndicator
                android:id="@+id/pagerIndicator"
                app:ci_width="10dp"
                app:ci_height="10dp"
                android:layout_width="match_parent"
                android:layout_height="36dp"
                android:layout_gravity="bottom"
                android:layout_marginBottom="8dp" />
        </LinearLayout>
Gaston answered 24/12, 2015 at 7:44 Comment(1)
ask this on library threadAsseverate
S
24
    <me.relex.circleindicator.CircleIndicator
        android:id="@+id/pagerIndicator"
        app:ci_width="10dp"
        app:ci_height="10dp"
        app:ci_drawable="@drawable/circleindicator_round"
        android:layout_width="match_parent"
        android:layout_height="36dp"
        android:layout_gravity="bottom"
        android:layout_marginBottom="8dp" />

I Dont Care What Padding or Margin You Do

but create a drawable XML File and Add these codes

<?xml version="1.0" encoding="utf-8"?>
  <shape xmlns:android="http://schemas.android.com/apk/res/android">
    <solid android:color="@color/colorAccent"/>
    <corners android:radius="10dp"/>
  </shape>

Call it what ever you want But use

`app:ci_drawable="@drawable/circleindicator_round"`

worked for me

Swinney answered 13/4, 2017 at 16:1 Comment(1)
perfect. Thanks :)Impassible
H
5

From the github page: Under properties

<LinearLayout
        android:layout_width="match_parent"
        android:layout_height="match_parent">

        <me.relex.circleindicator.CircleIndicator
            android:id="@+id/pagerIndicator"
            app:ci_width="10dp"
            app:ci_height="10dp"
            app:ci_drawable="your drawable defining the color"
            android:layout_width="match_parent"
            android:layout_height="36dp"
            android:layout_gravity="bottom"
            android:layout_marginBottom="8dp" />
</LinearLayout>
Hecate answered 24/12, 2015 at 7:58 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.