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

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

@Surakshaajith

Description

@Surakshaajith

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?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions