Skip to content
This repository has been archived by the owner on Jun 30, 2024. It is now read-only.

Gravity doesn't work when style.TYPE_BUTTON is used #129

Open
Surakshaajith opened this issue Mar 6, 2020 · 0 comments
Open

Gravity doesn't work when style.TYPE_BUTTON is used #129

Surakshaajith opened this issue Mar 6, 2020 · 0 comments

Comments

@Surakshaajith
Copy link

Surakshaajith commented Mar 6, 2020

Hi am trying to add gravity in main activity, applying

.setGravity(Gravity.TOP) takes the toast out of the screen.

I tried adding position with the gravity and it doesnt work

 position_x = (int) (CommonClass.width * 0.24);
position_y = (int) (CommonClass.height * 0.18);

 SuperActivityToast.create(activity, new Style(), Style.TYPE_BUTTON)
                        .setButtonText("UNDO")
                        .setButtonIconResource(R.drawable.ic_home_black_24dp)
                        .setProgressBarColor(Color.WHITE)
                        .setText(s)
                        .setGravity(Gravity.TOP,position_x,position_y)
                        .setDuration(Style.DURATION_VERY_SHORT)
                        .setFrame(Style.FRAME_STANDARD)
                        .setColor(this.getResources().getColor(R.color.bluetoast))
                        .setPriorityLevel(Style.PRIORITY_HIGH)
                        .setAnimations(Style.ANIMATIONS_POP).show();

is there any possibility that i could toast by setting offset in x and y using TYPE_BUTTON?

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

No branches or pull requests

1 participant