Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

How can i change the back button background with androidx #285

Open
shanu95 opened this issue Sep 18, 2019 · 1 comment
Open

How can i change the back button background with androidx #285

shanu95 opened this issue Sep 18, 2019 · 1 comment

Comments

@shanu95
Copy link

shanu95 commented Sep 18, 2019

I'm using the library with latest androidx and when i set the back button background it doesnt working. it aligns to end of the left and only changes background to colorprimary. not working as mentioned. anyway to fix the problem? if set the background to transparent it works but clicking ripple effect not working. if i set the background to ?android:selectableItemBackground it works but if set ?android:selectableItemBackground to both next and back button next button aligns to the end of the right. how to fix this problem?

<com.stepstone.stepper.StepperLayout xmlns:android="http://schemas.android.com/apk/res/android" xmlns:app="http://schemas.android.com/apk/res-auto" android:id="@+id/stepperLayout" android:layout_width="match_parent" android:layout_height="match_parent" app:ms_bottomNavigationBackground="@color/white" app:ms_stepperType="progress_bar" app:ms_backButtonBackground="@color/colorPrimaryDark" app:ms_showBackButtonOnFirstStep="true" app:ms_activeStepColor="@color/colorPrimary" app:ms_nextButtonColor="@color/colorPrimary" app:ms_backButtonColor="@color/colorPrimary" app:ms_completeButtonColor="@color/colorPrimary" />

@olsey
Copy link

olsey commented Aug 16, 2021

Back button is a MaterialButton, so it is directly related with the <item name="colorPrimary">@color/your_color</item>

One way is to change that and your button will be that color, other way is this:
((ViewGroup)((ViewGroup) stepperLayout).getChildAt(2)).getChildAt(2).setBackgroundColor(getResources().getColor(R.color.Green));
or change tint color like this

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants