yankai-victor / RingButton

Apache License 2.0
152 stars 33 forks source link

Can we change the color of the outer ring and font. #8

Closed SaadbinWaheed closed 4 years ago

SaadbinWaheed commented 7 years ago

From blue to any other.

yankai-victor commented 7 years ago

There are some attributes you can use


<attr name="ringbutton_circleColor" format="color" />
<attr name="ringbutton_textColor" format="color" />
<attr name="ringbutton_pressedColor" format="color" />
<attr name="ringbutton_dividerColor" format="color" />
SaadbinWaheed commented 7 years ago

Thank you!! <3

SaadbinWaheed commented 7 years ago

I'm sort of new, can you guide me as to where should I add these?

yankai-victor commented 7 years ago

There is a demo. https://github.com/yankai-victor/RingButton/blob/master/example/src/main/res/layout/activity_main.xml

<com.victor.ringbutton.RingButton
        android:id="@+id/ringButton"
        app:ringbutton_upText="Take Photo"
        app:ringbutton_downText="Hand Write"
        app:ringbutton_upDrawable="@drawable/take_photo"
        app:ringbutton_downDrawable="@drawable/hand_write"
        app:ringbutton_circleColor ="#ff0000"
        android:layout_centerInParent="true"
        android:layout_width="240dp"
        android:layout_height="240dp"/>

You can add app:ringbutton_circleColor ="#ff0000" in the layout xml

SaadbinWaheed commented 7 years ago

Got it. I thought I'd have to add the attributes in the attrs file. Damn! Thanks a bunch!