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

Padding next button and final button #295

Open
nicolasvc opened this issue Jul 23, 2020 · 1 comment
Open

Padding next button and final button #295

nicolasvc opened this issue Jul 23, 2020 · 1 comment

Comments

@nicolasvc
Copy link

5b1b6d9c-8c20-4e2c-a881-9dc8df5c404b
cc7d3ac2-b12e-43ba-b5f6-9a9211d3de55

Hello, I am new to android and the problem I have is that the next button cuts the background as shown in the image and when it is the final button, the icon does not appear and the text moves to the left, being cut and not What part of the implementation am I failing, I upload the implementation of the `get view model (int) code
Thank you very much for reading and help me.

CODE :
public StepViewModel getViewModel(@IntRange(from = 0) int position) {
StepViewModel.Builder builder = new StepViewModel.Builder(context);
switch (position) {
case 0:
builder
.setEndButtonLabel(context.getString(R.string.botonSiguente))
.setBackButtonLabel(context.getString(R.string.botonSalir))
.setNextButtonEndDrawableResId(R.drawable.ic_next)
.setBackButtonStartDrawableResId(StepViewModel.NULL_DRAWABLE);
break;
case 1:
builder
.setEndButtonLabel(context.getString(R.string.botonSiguente))
.setBackButtonLabel(context.getString(R.string.botonAtras))
.setNextButtonEndDrawableResId(R.drawable.ic_next)
.setBackButtonStartDrawableResId(R.drawable.ic_back);
break;
case 2:
builder
.setEndButtonLabel(context.getString(R.string.botonFinalizar))
.setBackButtonLabel(context.getString(R.string.botonAtras))
.setBackButtonStartDrawableResId(R.drawable.ic_back)
.setNextButtonEndDrawableResId(R.drawable.ic_check);
break;

        default:
            throw new IllegalArgumentException("Unsupported position: " + position);
    }
    return builder.create();
}
@olsey
Copy link

olsey commented Aug 16, 2021

This is how you add padding to the next button
((ViewGroup)((ViewGroup) stepperLayout).getChildAt(2)).getChildAt(2).setPadding(30,0,30,0);

and this is how you add padding to complete button
((ViewGroup)((ViewGroup) stepperLayout).getChildAt(2)).getChildAt(3).setPadding(30,0,30,0);

I would suggest you to debug the StepperLayout you have and see what is has inside and customize it however you want

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