android-process-button icon indicating copy to clipboard operation
android-process-button copied to clipboard

Unable to change button color

Open greenreader9 opened this issue 1 year ago • 2 comments

Hello

Having some trouble implementing your code, I can't seem to change the color of the button, it always stays at the default that you have configured.

activity_name.xml:

    <com.dd.processbutton.iml.ActionProcessButton
        android:id="@+id/signupButton"
        android:layout_width="match_parent"
        android:layout_height="48dp"
        android:layout_marginBottom="16dp"
        android:layout_marginTop="24dp"
        app:layout_constraintTop_toBottomOf="@+id/passwordEditText"
        app:layout_constraintStart_toStartOf="parent"
        app:layout_constraintEnd_toEndOf="parent"
        android:text="@string/create_account"
        android:textColor="@android:color/white"
        android:textSize="18sp"
        custom:pb_colorNormal="@color/colorPrimary"
        custom:pb_colorPressed="@color/colorPrimaryVariant"/>

colorPrimary and colorPrimaryVariant are defined in colors.xml:

<?xml version="1.0" encoding="utf-8"?>
<resources>

    <color name="colorPrimary">#BA85FB</color>
    <color name="colorPrimaryVariant"><![CDATA[@color/purple_700]]></color>
    <color name="colorOnPrimary">#FFFFFF</color>

</resources>

activity.java:

ProgressGenerator progressGenerator = new ProgressGenerator(this);
ActionProcessButton signupButton = (ActionProcessButton) findViewById(R.id.signupButton);
signupButton.setMode(ActionProcessButton.Mode.ENDLESS);

The button should be purple, but it is still blue:

image

Am I missing something in the XML file?

Thank you

greenreader9 avatar Aug 06 '24 22:08 greenreader9

Uploading IMG20240830222205.jpg…

Vik452 avatar Aug 31 '24 08:08 Vik452

Uploading IMG20240830222205.jpg…

Looks like that image did not fully upload, can you try again?

greenreader9 avatar Aug 31 '24 13:08 greenreader9