Spikeysanju / MotionToast

🌈 A Beautiful Motion Toast Library for Kotlin Android
1.49k stars 131 forks source link

Duration not working #49

Open SulemanIcon opened 2 years ago

SulemanIcon commented 2 years ago

LONG DRATION not working,.. as well custom duration not working...

Fahriar-Ahammed commented 2 years ago

Same problem with me.

bohdanbezp commented 2 years ago

The issue seems to be that MotionToast uses a native Android toast mechanism and recent API levels don't respect non-standard toast durations by hiding the toast after Toast.LENGTH_SHORT period by default. I have added the ability to use LONG_DURATION within my fork's branch here - https://github.com/Simplx-dev/MotionToast/tree/toast_duration_fix

It does not accept arbitrary durations, however. Only MotionToast.LONG_DURATION and MotionToast.SHORT_DURATION which are translated to Toast.LENGTH_LONG and Toast.LENGTH_SHORT respectively are supported.

Most likely I'll create a pull request here with the changes soon if my previous PR gets merged.