Last active
May 15, 2019 06:11
-
-
Save dineshmm23/3239b7077920a779b0b649814f45d335 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class LongToastMessageShower implements MessageShower{ | |
private Toast toast; | |
public LongToastMessageShower(Context appContext){ | |
this.toast = Toast.makeText(appContext,"",Toast.LENGTH_LONG); | |
} | |
@Override | |
public void showMessage(String message){ | |
toast.cancel(); | |
toast.setText(message); | |
toast.show(); | |
} | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
interface MessageShower{ | |
void showMessage(String message); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment