本文整理汇总了Java中com.afollestad.materialdialogs.MaterialDialog.dismiss方法的典型用法代码示例。如果您正苦于以下问题:Java MaterialDialog.dismiss方法的具体用法?Java MaterialDialog.dismiss怎么用?Java MaterialDialog.dismiss使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类com.afollestad.materialdialogs.MaterialDialog
的用法示例。
在下文中一共展示了MaterialDialog.dismiss方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: directlyDownload
import com.afollestad.materialdialogs.MaterialDialog; //导入方法依赖的package包/类
private void directlyDownload(String downloadUrl) {
final MaterialDialog dialog = new MaterialDialog.Builder(getContext())
.title(R.string.text_downloading)
.progress(false, 100)
.show();
final String path = StorageScriptProvider.DEFAULT_DIRECTORY_PATH + "AutoJs.apk";
final DownloadTask task = new DownloadTask() {
@Override
protected void onProgressUpdate(Integer... values) {
super.onProgressUpdate(values);
dialog.setProgress(values[0]);
}
@Override
protected void onPostExecute(Boolean result) {
super.onPostExecute(result);
dialog.dismiss();
if (!result) {
Toast.makeText(getContext(), R.string.text_download_failed, Toast.LENGTH_SHORT).show();
} else {
IntentUtil.installApk(getContext(), path);
}
}
};
task.execute(downloadUrl, path);
}
开发者ID:feifadaima,项目名称:https-github.com-hyb1996-NoRootScriptDroid,代码行数:27,代码来源:UpdateInfoDialogBuilder.java
示例2: directlyDownload
import com.afollestad.materialdialogs.MaterialDialog; //导入方法依赖的package包/类
private void directlyDownload(String downloadUrl) {
final MaterialDialog dialog = new MaterialDialog.Builder(getContext())
.title(R.string.text_downloading)
.progress(false, 100)
.show();
final String path = StorageFileProvider.DEFAULT_DIRECTORY_PATH + "AutoJs.apk";
final DownloadTask task = new DownloadTask() {
@Override
protected void onProgressUpdate(Integer... values) {
super.onProgressUpdate(values);
dialog.setProgress(values[0]);
}
@Override
protected void onPostExecute(Boolean result) {
super.onPostExecute(result);
dialog.dismiss();
if (!result) {
Toast.makeText(getContext(), R.string.text_download_failed, Toast.LENGTH_SHORT).show();
} else {
IntentUtil.installApk(getContext(), path);
}
}
};
task.execute(downloadUrl, path);
}
示例3: onBuildLongClicked
import com.afollestad.materialdialogs.MaterialDialog; //导入方法依赖的package包/类
@Override
public void onBuildLongClicked(final BuildViewHolder buildViewHolder) {
Context context = getActivity();
final MaterialSimpleListAdapter adapter = new MaterialSimpleListAdapter(new MaterialSimpleListAdapter.Callback() {
@Override
public void onMaterialListItemSelected(MaterialDialog dialog, int index, MaterialSimpleListItem item) {
long buildId = buildViewHolder.viewModel.getBuildId();
switch (index) {
case 0:
editBuild(buildId);
break;
case 1:
confirmDeleteBuild(buildId);
break;
case 2:
exportBuild(buildId);
break;
default:
Timber.e("Unknown context menu item selected, index = " + index);
break;
}
dialog.dismiss();
}
});
adapter.add(new MaterialSimpleListItem.Builder(context)
.content(R.string.menu_edit_build)
.build());
adapter.add(new MaterialSimpleListItem.Builder(context)
.content(R.string.menu_delete_build)
.build());
adapter.add(new MaterialSimpleListItem.Builder(context)
.content(R.string.menu_export_build)
.build());
new MaterialDialog.Builder(context)
.title(buildViewHolder.viewModel.getName())
.adapter(adapter, null)
.show();
}