Java Code Examples for com.blankj.utilcode.utils.ToastUtils#showShortToast()
The following examples show how to use
com.blankj.utilcode.utils.ToastUtils#showShortToast() .
You can vote up the ones you like or vote down the ones you don't like,
and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
Source File: SplashActivity.java From Bailan with Apache License 2.0 | 6 votes |
/** * 申请权限结果回调 * @param requestCode 请求码 * @param permissions 申请权限的数组 * @param grantResults 申请权限成功与否的结果 */ @Override public void onRequestPermissionsResult(int requestCode, @NonNull String[] permissions, @NonNull int[] grantResults) { super.onRequestPermissionsResult(requestCode, permissions, grantResults); switch (requestCode){ case 1: if (grantResults.length > 0 && grantResults[0]==PackageManager.PERMISSION_GRANTED){ //申请成功 ToastUtils.showShortToast("授权SD卡权限成功"); }else { //申请失败 ToastUtils.showShortToast("授权SD卡权限失败 可能会影响应用的使用"); } break; } }
Example 2
Source File: SplashActivity.java From Bailan with Apache License 2.0 | 6 votes |
/** * 申请权限结果回调 * @param requestCode 请求码 * @param permissions 申请权限的数组 * @param grantResults 申请权限成功与否的结果 */ @Override public void onRequestPermissionsResult(int requestCode, @NonNull String[] permissions, @NonNull int[] grantResults) { super.onRequestPermissionsResult(requestCode, permissions, grantResults); switch (requestCode){ case 1: if (grantResults.length > 0 && grantResults[0]==PackageManager.PERMISSION_GRANTED){ //申请成功 ToastUtils.showShortToast("授权SD卡权限成功"); }else { //申请失败 ToastUtils.showShortToast("授权SD卡权限失败 可能会影响应用的使用"); } break; } }
Example 3
Source File: LivePlayChatFragment.java From C9MJ with Apache License 2.0 | 6 votes |
@OnClick(R.id.tv_send) public void onClick() { String danmu = et_danmu.getText().toString(); if (TextUtils.isEmpty(danmu)) { ToastUtils.showShortToast("发送弹幕内容不能为空"); return; } else if (activity == null) { ToastUtils.showShortToast("发送弹幕内容失败"); return; } //新建弹幕对象 DanmuBean danmuBean = new DanmuBean(); DanmuBean.DataBean dataBean = new DanmuBean.DataBean(); DanmuBean.DataBean.FromBean fromBean = new DanmuBean.DataBean.FromBean(); fromBean.setNickName(getString(R.string.chat_name)); fromBean.setUserName(getString(R.string.chat_name)); dataBean.setFrom(fromBean); dataBean.setContent(danmu); danmuBean.setData(dataBean); activity.addDanmuOnDanmakuView(danmuBean, true); this.addDanmuOnRecyclerView(danmuBean); et_danmu.setText(null); }
Example 4
Source File: MainFragment.java From C9MJ with Apache License 2.0 | 5 votes |
@Override public boolean onBackPressedSupport() { if (System.currentTimeMillis() - exitTime > 2000) { exitTime = System.currentTimeMillis(); ToastUtils.showShortToast(getString(R.string.second_exit)); return true; } else { return super.onBackPressedSupport(); } }
Example 5
Source File: GalleryActivity.java From C9MJ with Apache License 2.0 | 4 votes |
@Override public void showError(String message) { ToastUtils.showShortToast(message); }
Example 6
Source File: DemoListFragment.java From C9MJ with Apache License 2.0 | 4 votes |
@Override public void showError(String message) { ProgressUtil.dismiss(); ToastUtils.showShortToast(message); }
Example 7
Source File: ExploreDetailFragment.java From C9MJ with Apache License 2.0 | 4 votes |
@Override public void showError(String message) { ToastUtils.showShortToast(message); }
Example 8
Source File: ExploreListFragment.java From C9MJ with Apache License 2.0 | 4 votes |
@Override public void showError(String message) { refreshLayout.setRefreshing(false); adapter.loadMoreFail();//在加载失败的时候调用showLoadMoreFailedView()就能显示加载失败的footer了,点击footer会重新加载 ToastUtils.showShortToast(message); }
Example 9
Source File: LiveListFragment.java From C9MJ with Apache License 2.0 | 4 votes |
@Override public void showError(String message) { refreshLayout.setRefreshing(false); adapter.loadMoreFail();//在加载失败的时候调用showLoadMoreFailedView()就能显示加载失败的footer了,点击footer会重新加载 ToastUtils.showShortToast(message); }
Example 10
Source File: LivePlayActivity.java From C9MJ with Apache License 2.0 | 4 votes |
@Override public void showError(String message) { ToastUtils.showShortToast(message); }
Example 11
Source File: DemoNormalFragment.java From C9MJ with Apache License 2.0 | 4 votes |
@Override public void showError(String message) { ProgressUtil.dismiss(); ToastUtils.showShortToast(message); }