| 6 | import com.github.catvod.spider.Init; |
| 7 | |
| 8 | public class Notify { |
| 9 | |
| 10 | private Toast mToast; |
| 11 | |
| 12 | private static class Loader { |
| 13 | static volatile Notify INSTANCE = new Notify(); |
| 14 | } |
| 15 | |
| 16 | private static Notify get() { |
| 17 | return Loader.INSTANCE; |
| 18 | } |
| 19 | |
| 20 | public static void show(String text) { |
| 21 | Init.post(new Runnable() { |
| 22 | @Override |
| 23 | public void run() { |
| 24 | get().makeText(text); |
| 25 | } |
| 26 | }); |
| 27 | } |
| 28 | |
| 29 | private void makeText(String message) { |
| 30 | if (TextUtils.isEmpty(message)) return; |
| 31 | if (mToast != null) mToast.cancel(); |
| 32 | mToast = Toast.makeText(Init.context(), message, Toast.LENGTH_LONG); |
| 33 | mToast.show(); |
| 34 | } |
| 35 | } |
nothing calls this directly
no outgoing calls
no test coverage detected