当前位置: 首页>>代码示例>>Java>>正文


Java ProgressDialog.setProgressStyle方法代码示例

本文整理汇总了Java中android.app.ProgressDialog.setProgressStyle方法的典型用法代码示例。如果您正苦于以下问题:Java ProgressDialog.setProgressStyle方法的具体用法?Java ProgressDialog.setProgressStyle怎么用?Java ProgressDialog.setProgressStyle使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在android.app.ProgressDialog的用法示例。


在下文中一共展示了ProgressDialog.setProgressStyle方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: onPreExecute

import android.app.ProgressDialog; //导入方法依赖的package包/类
@Override
protected void onPreExecute() {
    PowerManager pm = (PowerManager) context.getSystemService(Context.POWER_SERVICE);
    wakeLock = pm.newWakeLock(PowerManager.PARTIAL_WAKE_LOCK, getClass().getName());
    wakeLock.acquire();

    progressDialog = new ProgressDialog(context);
    progressDialog.setIcon(R.mipmap.ic_launcher);
    progressDialog.setTitle(R.string.app_name);
    progressDialog.setMessage(context.getString(R.string.msg_downloading, url.toString()));
    progressDialog.setIndeterminate(true);
    progressDialog.setProgressStyle(ProgressDialog.STYLE_HORIZONTAL);
    progressDialog.setCancelable(true);
    progressDialog.setOnCancelListener(new DialogInterface.OnCancelListener() {
        @Override
        public void onCancel(DialogInterface dialog) {
            DownloadTask.this.cancel(true);
        }
    });
    progressDialog.show();
}
 
开发者ID:miankai,项目名称:MKAPP,代码行数:22,代码来源:DownloadTask.java

示例2: onCreate

import android.app.ProgressDialog; //导入方法依赖的package包/类
@Override
protected void onCreate(Bundle bundle) {
    super.onCreate(bundle);
    progressDialog = new ProgressDialog(this);
    progressDialog.setIndeterminate(false);
    progressDialog.setCancelable(false);
    progressDialog.setProgressStyle(ProgressDialog.STYLE_SPINNER);
    progressDialog.show();

    // NavigationBar
    if (PreferencesUtil.getInstance().isNavigationBarVisible()) {
        AndroidInputUtil.showNavigationBar(getWindow());
    } else {
        AndroidInputUtil.hideNavigationBar(getWindow());
    }
    // orientation
    boolean orientationVertical = PreferencesUtil.getInstance().isOrientationVertical();
    boolean orientationHorizontal = PreferencesUtil.getInstance().isOrientationHorizontal();
    if (orientationHorizontal && orientationVertical) {
        setRequestedOrientation(ActivityInfo.SCREEN_ORIENTATION_FULL_SENSOR);
    } else if (orientationHorizontal) {
        setRequestedOrientation(ActivityInfo.SCREEN_ORIENTATION_SENSOR_LANDSCAPE);
    } else if (orientationVertical) {
        setRequestedOrientation(ActivityInfo.SCREEN_ORIENTATION_SENSOR_PORTRAIT);
    }
}
 
开发者ID:dmitrykolesnikovich,项目名称:featurea,代码行数:27,代码来源:MainActivity.java

示例3: onCreateDialog

import android.app.ProgressDialog; //导入方法依赖的package包/类
@Override
protected Dialog onCreateDialog(int id) {
    //pDialog.show();
    switch (id) {
        case progress_bar_type:
            pDialog = new ProgressDialog(this);
            pDialog.setMessage("Downloading " + u + ".pdf");
            pDialog.setIndeterminate(false);
            pDialog.setMax(100);
            pDialog.setProgressStyle(ProgressDialog.STYLE_HORIZONTAL);
            pDialog.setCancelable(true);
            pDialog.setCanceledOnTouchOutside(false);
            pDialog.setButton(ProgressDialog.BUTTON_NEGATIVE, "Background", new DialogInterface.OnClickListener() {
                @Override
                public void onClick(DialogInterface dialog, int which) {
                    //Cancel download task
                    pDialog.cancel();
                    Toast.makeText(PdfSelector.this,
                            "Downloading in background", Toast.LENGTH_SHORT).show();
                    startActivity(new Intent(PdfSelector.this, Subjects.class));
                    //finish();
                }
            });
            pDialog.show();
            return pDialog;
        default:
            return null;
    }
}
 
开发者ID:Shobhit-pandey,项目名称:CollegeDoc,代码行数:30,代码来源:PdfSelector.java

示例4: queryCredit

import android.app.ProgressDialog; //导入方法依赖的package包/类
private void queryCredit() {
    if (WifiUtility.isNetworkAvailable(getActivity())) {
        if(Utility.checkAccount(getActivity())) {
            pd = new ProgressDialog(getActivity());
            pd.setProgressStyle(ProgressDialog.STYLE_HORIZONTAL);
            pd.setProgress(0);
            pd.setTitle(getString(R.string.credit_updating));
            pd.setCancelable(false);
            pd.show();
            nextThread = new Thread(new CreditLoginRunnable(creditLoginHandler));
            loginNportal();
        }
    } else {
        Toast.makeText(getActivity(), R.string.check_network_available,
                Toast.LENGTH_LONG).show();
    }
}
 
开发者ID:kamisakihideyoshi,项目名称:TaipeiTechRefined,代码行数:18,代码来源:CreditFragment.java

示例5: onCreate

import android.app.ProgressDialog; //导入方法依赖的package包/类
@Override
protected void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    setContentView(R.layout.activity_main);

    tv = (TextView) findViewById(R.id.label);
    handler = new Handler(getMainLooper());

    progressDialog = new ProgressDialog(this);
    progressDialog.setMessage("Downloading MP3...");
    progressDialog.setIndeterminate(true);
    progressDialog.setProgressStyle(ProgressDialog.STYLE_HORIZONTAL);
    progressDialog.setCancelable(true);

    if(!requestPermissions()){
        handleIntent();
    }
}
 
开发者ID:bornabesic,项目名称:yt-mp3-downloader-android,代码行数:19,代码来源:MainActivity.java

示例6: showProgressDialog

import android.app.ProgressDialog; //导入方法依赖的package包/类
private void showProgressDialog(final Context context) {
    final ProgressDialog progressDialog = new ProgressDialog(context);
    progressDialog.setProgressStyle(ProgressDialog.STYLE_HORIZONTAL);
    progressDialog.setCancelable(false);
    progressDialog.setTitle("软件更新");
    progressDialog.setIndeterminate(false);
    new ModelUpdateApk().downloadFile("http://zhstatic.zhihu.com/pkg/store/daily/zhihu-daily-zhihu-2.6.0(744)-release.apk", new ProgressResponseListener() {
        @Override
        public void onResponseProgress(long bytesRead, long contentLength, boolean done) {
            progressDialog.setProgress((int) (bytesRead * 100 / contentLength));
            if (done) {
                progressDialog.dismiss();
            }
        }
    }, new ModelUpdateApk.SuccessListner() {
        @Override
        public void onSuccess() {
            File file = new File(App.getApplication().getExternalFilesDir(null) + File.separator + "ZHRB.apk");
            ApkUtils.installAPK(App.getApplication(), file);
        }

        @Override
        public void onFail() {
            Toast.makeText(context, "下载失败", Toast.LENGTH_SHORT).show();
        }
    });
    progressDialog.show();
}
 
开发者ID:Mrqinlei,项目名称:ImitateZHRB,代码行数:29,代码来源:UpdateManager.java

示例7: showWaitDialog

import android.app.ProgressDialog; //导入方法依赖的package包/类
/**
 * Common method been created for showing wait progress bar
 *
 * @param title   the title
 * @param message the message
 * @param context the context
 */
protected void showWaitDialog(String title, String message, Context context) {

    closeWaitDialog();
    mWaitDialog = new ProgressDialog(context); // this = YourActivity
    mWaitDialog.setProgressStyle(ProgressDialog.STYLE_SPINNER);
    mWaitDialog.setMessage(message);
    mWaitDialog.setIndeterminate(true);
    mWaitDialog.setTitle(title);
    mWaitDialog.setCancelable(false);
    mWaitDialog.show();

}
 
开发者ID:Welloculus,项目名称:MobileAppForPatient,代码行数:20,代码来源:BaseActivity.java

示例8: onNewIntent

import android.app.ProgressDialog; //导入方法依赖的package包/类
@Override
protected void onNewIntent(Intent intent) {
    if (canResult != null) {
        if(DniDialog.getInstance() != null){
            DniDialog.getInstance().dismiss();
        }
        final Tag discoveredTag = intent.getParcelableExtra(NfcAdapter.EXTRA_TAG);
        Log.d("com.mifirma", "Tag: " + discoveredTag);

        final ProgressDialog progDailog = new ProgressDialog(MainActivity.this);
        progDailog.setMessage(this.getResources().getString(R.string.loadingNFC));
        progDailog.setIndeterminate(false);
        progDailog.setProgressStyle(ProgressDialog.STYLE_SPINNER);
        progDailog.setCancelable(false);
        progDailog.show();

        try {
            // Ejecutamos la tarea de firma
            new KeyStoreLoadTask(
                this,
                canResult,
                progDailog
            ).execute(discoveredTag);
        }
        catch (final Throwable e){
            if(DniDialog.getInstance() != null){
                DniDialog.getInstance().dismiss();
            }
            progDailog.dismiss();
            canResult = null;
            Log.w("com.mifirma", "Error inicializando DNIe NFC: " + e);
            Toast.makeText(this, "Ha sido imposible usar el DNI NFC, inténtelo de nuevo.", Toast.LENGTH_LONG).show();
        }

    }
}
 
开发者ID:MiFirma,项目名称:mi-firma-android,代码行数:37,代码来源:MainActivity.java

示例9: onListItemClick

import android.app.ProgressDialog; //导入方法依赖的package包/类
@Override
public void onListItemClick(ListView L, View V, int position, long id) {
    ProgressDialog progressDialog = new ProgressDialog(getContext());
    progressDialog.setMessage(getString(R.string.Calculating));
    progressDialog.setProgressStyle(ProgressDialog.STYLE_HORIZONTAL);
    progressDialog.setIndeterminate(false);
    progressDialog.setCanceledOnTouchOutside(false);
    progressDialog.show();
    progress = progressDialog;
    if (ENABLED_NO_DECIMAL)
        RunAndGetDeterminantWithAdjoint(position, progressDialog);
    else
        RunNewGetInverse(position, progressDialog);
}
 
开发者ID:coder3101,项目名称:Matrix-Calculator-for-Android,代码行数:15,代码来源:InverseFragment.java

示例10: onPreExecute

import android.app.ProgressDialog; //导入方法依赖的package包/类
@Override
protected void onPreExecute() {
  progressDialog = new ProgressDialog(context);
  progressDialog.setProgressStyle(ProgressDialog.STYLE_HORIZONTAL);
  progressDialog.setCancelable(false);
  progressDialog.setIndeterminate(false);
  progressDialog.setTitle(R.string.trimmer__deleting);
  progressDialog.setMessage(context.getString(R.string.trimmer__deleting_old_messages));
  progressDialog.setMax(100);
  progressDialog.show();
}
 
开发者ID:CableIM,项目名称:Cable-Android,代码行数:12,代码来源:Trimmer.java

示例11: onPreExecute

import android.app.ProgressDialog; //导入方法依赖的package包/类
@Override
protected  void onPreExecute() { //Activity is on progress
 barProgressDialog = new ProgressDialog(BloodTable.this);
 barProgressDialog.setTitle("Saving Image");
 barProgressDialog.setMessage("Saving Image in progress ...");
 barProgressDialog.setProgressStyle(ProgressDialog.STYLE_SPINNER);
 barProgressDialog.show();
}
 
开发者ID:sdrausty,项目名称:buildAPKsApps,代码行数:9,代码来源:BloodTable.java

示例12: record

import android.app.ProgressDialog; //导入方法依赖的package包/类
@ProtoMethod(description = "Starts recording", example = "")
@ProtoMethodParam(params = {"showProgressBoolean"})
public PAudioRecorder record(String fileName) {
    init();

    recorder.setOutputFile(getAppRunner().getProject().getFullPathForFile(fileName));
    try {
        recorder.prepare();
    } catch (Exception e) {
        e.printStackTrace();
    }

    if (showProgress && getActivity() != null) {
        mProgressDialog = new ProgressDialog(getActivity());
        mProgressDialog.setTitle("Record!");
        mProgressDialog.setProgressStyle(ProgressDialog.STYLE_SPINNER);
        mProgressDialog.setButton(DialogInterface.BUTTON_POSITIVE, "Stop recording",
                new DialogInterface.OnClickListener() {
                    @Override
                    public void onClick(final DialogInterface dialog, final int whichButton) {
                        mProgressDialog.dismiss();
                        stop();
                    }
                });

        mProgressDialog.setOnCancelListener(new DialogInterface.OnCancelListener() {
            @Override
            public void onCancel(DialogInterface p1) {
                stop();
            }
        });
        mProgressDialog.show();
    }

    recorder.start();

    return this;
}
 
开发者ID:victordiaz,项目名称:phonk,代码行数:39,代码来源:PAudioRecorder.java

示例13: SmoothMeshTask

import android.app.ProgressDialog; //导入方法依赖的package包/类
public SmoothMeshTask(MainSurfaceActivity context) {

            activity = context;
            progressBar = new ProgressDialog(context);
            progressBar.setMessage("Smoothing Mesh ...");
            progressBar.setIndeterminate(true);
            progressBar.setProgressStyle(ProgressDialog.STYLE_SPINNER);
        }
 
开发者ID:WissamElkadi,项目名称:TriMeshKit,代码行数:9,代码来源:MainSurfaceActivity.java

示例14: onPreExecute

import android.app.ProgressDialog; //导入方法依赖的package包/类
protected void onPreExecute() {

            progressDialog = new ProgressDialog(activity);
            progressDialog.setMessage(activity.getString(R.string.deleting));
            progressDialog.setProgressStyle(ProgressDialog.STYLE_HORIZONTAL);
            progressDialog.setIndeterminate(true);
            progressDialog.setProgressNumberFormat(null);
            progressDialog.setProgressPercentFormat(null);
            progressDialog.setCancelable(false);
            progressDialog.show();
        }
 
开发者ID:enricocid,项目名称:Gallery-example,代码行数:12,代码来源:DeleteFileUtils.java

示例15: getProgressDialog

import android.app.ProgressDialog; //导入方法依赖的package包/类
public static ProgressDialog getProgressDialog(Context context) {
    ProgressDialog progressDialog = new ProgressDialog(context);
    progressDialog.setCancelable(false);
    progressDialog.setMax(100);
    progressDialog.setProgressStyle(ProgressDialog.STYLE_HORIZONTAL);
    progressDialog.setMessage(context.getString(R.string.please_wait));
    return progressDialog;
}
 
开发者ID:mobilemaster128,项目名称:quickblox-android,代码行数:9,代码来源:DialogUtils.java


注:本文中的android.app.ProgressDialog.setProgressStyle方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。