SuperToasts
SuperToasts copied to clipboard
Gravity doesn't work when style.TYPE_BUTTON is used
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?