Java Code Examples for android.app.progressdialog#setIcon()

The following examples show how to use android.app.progressdialog#setIcon() . 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: DialogUtils.java    From mytracks with Apache License 2.0 6 votes vote down vote up
/**
 * Creates a progress dialog.
 *
 * @param spinner true to use the spinner style
 * @param context the context
 * @param messageId the progress message id
 * @param onCancelListener the cancel listener
 * @param formatArgs the format arguments for the message id
 */
private static ProgressDialog createProgressDialog(boolean spinner, final Context context,
    int messageId, DialogInterface.OnCancelListener onCancelListener, Object... formatArgs) {
  final ProgressDialog progressDialog = new ProgressDialog(context);
  progressDialog.setCancelable(true);
  progressDialog.setCanceledOnTouchOutside(false);
  progressDialog.setIcon(android.R.drawable.ic_dialog_info);
  progressDialog.setIndeterminate(true);
  progressDialog.setMessage(context.getString(messageId, formatArgs));
  progressDialog.setOnCancelListener(onCancelListener);
  progressDialog.setProgressStyle(spinner ? ProgressDialog.STYLE_SPINNER
      : ProgressDialog.STYLE_HORIZONTAL);
  progressDialog.setTitle(R.string.generic_progress_title);
  progressDialog.setOnShowListener(new DialogInterface.OnShowListener() {

      @Override
    public void onShow(DialogInterface dialog) {
      setDialogTitleDivider(context, progressDialog);
    }
  });
  return progressDialog;
}
 
Example 2
Source File: Logger.java    From screenstandby with GNU General Public License v2.0 6 votes vote down vote up
public static void ShowLog(Context context)
{
       //Display the progress dialog
	try
	{
		pInfo = context.getPackageManager().getPackageInfo( context.getPackageName(), 0);
	}
	catch(Exception ex) {
		Log(context, ex);
	}
       progressDialog = new ProgressDialog(context);    
       progressDialog.setProgressStyle(ProgressDialog.STYLE_SPINNER | ProgressDialog.THEME_HOLO_DARK);
       progressDialog.setTitle("Saving debug info");  
       progressDialog.setMessage("Collecting data. Please wait...\n(no private info will be collected)");
       progressDialog.setCancelable(false);
       progressDialog.setIcon(R.drawable.debuggingico);
       progressDialog.setIndeterminate(true);
       progressDialog.show();
       new LoadViewTask(context).execute();
}
 
Example 3
Source File: ReadTask.java    From lua-for-android with BSD 3-Clause "New" or "Revised" License 5 votes vote down vote up
public ReadTask(LuaEditor edit, File file) {
    _file = file;
    _len = _file.length();
    _edit = new WeakReference<>(edit);
    _dlg = new ProgressDialog(edit.getContext());
    _dlg.setProgressStyle(ProgressDialog.STYLE_HORIZONTAL);
    _dlg.setTitle(edit.getContext().getString(R.string.Opening));
    _dlg.setIcon(android.R.drawable.ic_dialog_info);
    _dlg.setIndeterminate(true);
}
 
Example 4
Source File: MainActivity.java    From LiuAGeAndroid with MIT License 5 votes vote down vote up
/**
 * 弹出下载对话框
 */
public void showDownloadDialog() {
    mDownloadDialog = new ProgressDialog(mContext);
    mDownloadDialog.setIcon(R.mipmap.ic_launcher);
    mDownloadDialog.setTitle("版本更新");
    mDownloadDialog.setProgressStyle(ProgressDialog.STYLE_HORIZONTAL);
    mDownloadDialog.setMessage("正在玩命下载中......");
    mDownloadDialog.getWindow().setGravity(Gravity.CENTER);
    mDownloadDialog.setMax(100);
    mDownloadDialog.show();
}
 
Example 5
Source File: PreventFragment.java    From prevent with Do What The F*ck You Want To Public License 5 votes vote down vote up
@Override
protected void onPreExecute() {
    PreventActivity pa = wr.get();
    if (pa != null) {
        dialog = new ProgressDialog(pa);
        dialog.setTitle(R.string.app_name);
        dialog.setIcon(R.drawable.ic_launcher);
        dialog.setProgressStyle(ProgressDialog.STYLE_HORIZONTAL);
        dialog.setCancelable(false);
        dialog.setMax(mAdapter.getSize());
        dialog.show();
        labelLoader = new LabelLoader(pa);
    }
}
 
Example 6
Source File: MainActivity.java    From BaoKanAndroid with MIT License 5 votes vote down vote up
/**
 * 弹出下载对话框
 */
public void showDownloadDialog() {
    mDownloadDialog = new ProgressDialog(mContext);
    mDownloadDialog.setIcon(R.mipmap.ic_launcher);
    mDownloadDialog.setTitle("版本更新");
    mDownloadDialog.setProgressStyle(ProgressDialog.STYLE_HORIZONTAL);
    mDownloadDialog.setMessage("正在玩命下载中......");
    mDownloadDialog.getWindow().setGravity(Gravity.CENTER);
    mDownloadDialog.setMax(100);
    mDownloadDialog.show();
}
 
Example 7
Source File: ClassesListActivity.java    From android-classyshark with Apache License 2.0 5 votes vote down vote up
@Override
protected void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    setContentView(R.layout.activity_classes_list);

    lv = (ListView) findViewById(R.id.listView);
    uriFromIntent = getIntent().getData();
    classesList = new ClassesNamesList();

    setActionBar();

    InputStream uriStream;
    try {

        mProgressDialog = new ProgressDialog(ClassesListActivity.this);
        mProgressDialog.setIcon(R.mipmap.ic_launcher);
        mProgressDialog.setMessage("¸.·´¯`·.´¯`·.¸¸.·´¯`·.¸><(((º>");
        mProgressDialog.setIndeterminate(false);
        mProgressDialog.setCancelable(false);
        mProgressDialog.show();

        uriStream = UriUtils.getStreamFromUri(ClassesListActivity.this,
                uriFromIntent);

        final byte[] bytes = IOUtils.toByteArray(uriStream);

        new FillClassesNamesThread(bytes).start();

        new StartDexLoaderThread(bytes).start();

    } catch (Exception e) {
        e.printStackTrace();
    }
}
 
Example 8
Source File: RemoteControllerActivity.java    From screenstandby with GNU General Public License v2.0 5 votes vote down vote up
@Override
public void onClick(View v) {
	RemoteAppPackages rap = mCore.getRemoteAppPackages();
	if (rap != null)
	{
		showAppDialog(rap);
	}
	else
	{
    	progressDialog = new ProgressDialog(RemoteControllerActivity.this);    
        progressDialog.setProgressStyle(ProgressDialog.STYLE_SPINNER | ProgressDialog.THEME_HOLO_DARK);
        progressDialog.setTitle("Fetching app list");  
        progressDialog.setMessage("Requesting list of applications from remote device...");
        progressDialog.setCancelable(false);
        progressDialog.setIndeterminate(true);
        progressDialog.setIcon(R.drawable.launchappico);
        progressDialog.show();
        Runnable rCallback = new Runnable(){
			@Override
			public void run() {
					runOnUiThread(new Runnable() {
						@Override
						public void run() {
							RemoteAppPackages rap2 = mCore.getRemoteAppPackages();
							progressDialog.dismiss();
							if (rap2 != null)
								showAppDialog(rap2);
							else
								Toast.makeText(RemoteControllerActivity.this, "An error occurred during fetching app list", Toast.LENGTH_SHORT).show();
						}});
			}};
		mCore.requestRemoteAppPackages(rCallback);
	}
}
 
Example 9
Source File: UpdateChecker.java    From screenstandby with GNU General Public License v2.0 5 votes vote down vote up
public static void CheckForUpdate(Context c)
{
	progressDialog = new ProgressDialog(c);    
       progressDialog.setProgressStyle(ProgressDialog.STYLE_SPINNER | ProgressDialog.THEME_HOLO_DARK);
       progressDialog.setTitle("Checking for update");  
       progressDialog.setMessage("Please wait...\n");
       progressDialog.setCancelable(false);
       progressDialog.setIcon(android.R.drawable.ic_menu_upload);
       progressDialog.setIndeterminate(true);
       progressDialog.show();
       new LoadViewTask(c).execute();
}
 
Example 10
Source File: SettingsFragment.java    From android_gisapp with GNU General Public License v3.0 5 votes vote down vote up
@Override
protected void onPreExecute()
{
    //not good solution but rare used so let it be
    ControlHelper.lockScreenOrientation(mActivity);
    mProgressDialog = new ProgressDialog(mActivity);
    mProgressDialog.setTitle(R.string.moving);
    mProgressDialog.setMessage(mActivity.getString(R.string.warning_map_moving));
    mProgressDialog.setIndeterminate(true);
    mProgressDialog.setCancelable(false);
    mProgressDialog.setIcon(R.drawable.ic_action_warning_light);
    mProgressDialog.show();
}