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

back button color cannot be changed #274

Open
wisien92 opened this issue Nov 19, 2018 · 5 comments
Open

back button color cannot be changed #274

wisien92 opened this issue Nov 19, 2018 · 5 comments

Comments

@wisien92
Copy link

Hi,

I can't seem to change the back button background color (as well as next or complete).

I have changed the colors to be greyish - but this changes only text color.

		<com.stepstone.stepper.StepperLayout
		android:id="@+id/stepperLayout"
		android:layout_width="match_parent"
		android:layout_height="match_parent"
		android:paddingStart="8dp"
		android:paddingTop="16dp"
		android:paddingEnd="8dp"
		app:ms_backButtonColor="#707070"
		app:ms_completeButtonColor="#707070"
		app:ms_nextButtonColor="#707070"
		app:ms_showBackButtonOnFirstStep="true"
		app:ms_stepperType="dots"
		tools:theme="@style/AppTheme"/>

Yet my back button has the same color as my app accent. I have tried setting backbutton drawable also but without any effect. Is it possible that overriding getViewModel in adapter is causing this?

@wisien92
Copy link
Author

I made a workaround for that

    findViewById<View>(com.stepstone.stepper.R.id.ms_stepPrevButton).backgroundTintList = ColorStateList.valueOf(ContextCompat.getColor(this, android.R.color.white))

but it's kinda ugly - setting background tint would be nice btw.

@abir-hasan
Copy link

In my case back-button was taking the colorPrimary as it's background. Theme.MaterialComponents.Light.DarkActionBar was my parent theme. When i made another custom style with Theme.AppCompat.Light.DarkActionBar then back button reverted back to it's original color.

@zawadz88
Copy link
Contributor

zawadz88 commented May 2, 2019

Hi,
Sorry for replying so late. To change the background color of a button you need to use ms_backButtonBackground instead. See: https://github.com/stepstone-tech/android-material-stepper#view-attributes There's an example in the sample app if I remember correctly.

@abir-hasan
Copy link

Hi,
Sorry for replying so late. To change the background color of a button you need to use ms_backButtonBackground instead. See: https://github.com/stepstone-tech/android-material-stepper#view-attributes There's an example in the sample app if I remember correctly.

I've used ms_backButtonBackground but it wasn't working due to material theme. When i reverted back to appCompat theme, then it worked. So i'm guessing there might be an issue with this library theme and material theme compatibility.

@Renk01
Copy link

Renk01 commented May 11, 2019

Hi Guys,
I had the same issue. After switching my app theme, in order to use material theme the background of the back-button was set to the accent color of my app. After i added app:ms_backButtonBackground="@android:color/transparent" everything was fine again.

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

4 participants