本文整理汇总了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();
}
示例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);
}
}
示例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;
}
}
示例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();
}
}
示例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();
}
}
示例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();
}
示例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();
}
示例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();
}
}
}
示例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);
}
示例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();
}
示例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();
}
示例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;
}
示例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);
}
示例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();
}
示例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;
}