Java 类android.app.ProgressDialog 实例源码
项目:mininoteview
文件:TextEdit.java
private void encryptDataAndSave(byte[] password)
{
try
{
binText = strText.getBytes(Charset.forName("UTF-8"));
binText = MyUtil.encryptChiData(binText, MyUtil.md5Key(password));
progressDlg = ProgressDialog.show(
TextEdit.this, null, getString(R.string.notify_saving), true, false);
new FileWriteThread().start();
}
catch(Exception e)
{
e.printStackTrace();
//PasswordBox.resetPassword();
showMessage(getString(R.string.alert_general_error) + "\n" + e.toString());
}
}
项目:FuelUp
文件:BackupFragment.java
@Override
public void onStart() {
super.onStart();
mProgress = new ProgressDialog(getContext());
mProgress.setCanceledOnTouchOutside(false);
mProgress.setMessage("Calling Drive API ...");
String accountName = PreferencesUtils.getAccountName(getContext());
if (!ConnectivityUtils.isGooglePlayServicesAvailable(getContext())) {
acquireGooglePlayServices();
} else {
mCredential.setSelectedAccountName(accountName);
showRemoveButton = true;
mAccountName.setText(accountName);
mSyncStatus.setText(R.string.googleDrive_cannot_connect);
checkPermissions();
}
}
项目:Crimson
文件:CheckupReminders.java
private void setReminder() {
progressDialog = new ProgressDialog(this);
progressDialog.setTitle(getString(R.string.app_name));
progressDialog.setMessage(getString(R.string.wait));
progressDialog.setIndeterminate(true);
progressDialog.setCancelable(false);
String name = nameET.getText().toString();
String address = addressET.getText().toString();
String full_date = onDateEt.getText().toString();
if (name.trim().length() > 0 && address.trim().length() > 0 && full_date.trim().length() > 0) {
progressDialog.show();
setReminderNow(name, address, full_date);
} else
Toast.makeText(this, getString(R.string.please_input), Toast.LENGTH_LONG).show();
}
项目:SmartMath
文件:MFPFileManagerActivity.java
public static void loadChart(final Context context, final String strChartFilePath) {
final ProgressDialog dlgLoadingChartProgress = ProgressDialog.show(context, context.getString(R.string.please_wait),
context.getString(R.string.loading_chart), true);
final Handler handler = new Handler();
Thread threadLoadChart = new Thread(new Runnable() {
@Override
public void run() {
final Intent intent = new Intent(context, ActivityChartDemon.class);
intent.putExtra(ChartOperator.VMFPChartPath, strChartFilePath);
handler.post(new Runnable() {
@Override
public void run() {
context.startActivity(intent);
dlgLoadingChartProgress.dismiss();
}
});
}
});
threadLoadChart.start();
}
项目:q-mail
文件:AttachmentDownloadDialogFragment.java
@Override
public Dialog onCreateDialog(Bundle savedInstanceState) {
Bundle args = getArguments();
int size = args.getInt(ARG_SIZE);
String message = args.getString(ARG_MESSAGE);
messagingListener = new SimpleMessagingListener() {
@Override
public void updateProgress(int progress) {
dialog.setProgress(progress);
}
};
messagingController = MessagingController.getInstance(getActivity());
messagingController.addListener(messagingListener);
dialog = new ProgressDialog(getActivity());
dialog.setMessage(message);
dialog.setMax(size);
dialog.setProgressStyle(ProgressDialog.STYLE_HORIZONTAL);
dialog.setProgress(0);
dialog.show();
return dialog;
}
项目:TaipeiTechRefined
文件:CourseDetailActivity.java
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.course_detail);
Intent i = getIntent();
courseNo = i.getStringExtra("CourseNo");
if (courseNo == null) {
finish();
return;
}
mToolbar = (Toolbar) findViewById(R.id.main_toolbar);
setSupportActionBar(mToolbar);
setActionBar();
mProgressDialog = ProgressDialog.show(this, null, getString(R.string.course_loading), true);
Thread t = new Thread(new CourseDetailRunnable(courseDetailHandler,
courseNo));
t.start();
}
项目:AndroidFFmpegCompress
文件:MainActivity.java
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_main);
mRecordView = (RecordView) findViewById(R.id.recordView);
mDurationTv = (TextView) findViewById(R.id.tv_duration);
mCompressInfoTv = (TextView) findViewById(R.id.tv_info);
mVideoSizeTv = (TextView) findViewById(R.id.tv_size);
mDialog = new ProgressDialog(this);
mDialog.setTitle("正在压缩");
mDialog.setCanceledOnTouchOutside(false);
mRecordView.setOnRecordCallback(new RecordView.OnRecordCallback() {
@Override
public void onFinish() {
mVideoSizeTv.setText("大小:" + mRecordView.getRecordFileSize() + "Mb");
}
@Override
public void onProgress(int total, int curr) {
mDurationTv.setText(curr + "/" + total);
mVideoSizeTv.setText("大小:" + mRecordView.getRecordFileSize() + "Mb");
Log.d(TAG, "onProgress:" + mRecordView.getRecordFileSize());
}
});
}
项目:GitHub
文件:GoogleLogin.java
@Override
public void login(@NonNull SmartLoginConfig config) {
GoogleApiClient apiClient = config.getGoogleApiClient();
Activity activity = config.getActivity();
if (apiClient == null) {
GoogleSignInOptions gso = new GoogleSignInOptions.Builder(GoogleSignInOptions.DEFAULT_SIGN_IN)
.requestEmail()
.requestProfile()
.build();
apiClient = new GoogleApiClient.Builder(activity)
.addApi(Auth.GOOGLE_SIGN_IN_API, gso)
.build();
}
ProgressDialog progress = ProgressDialog.show(activity, "", activity.getString(R.string.logging_holder), true);
Intent signInIntent = Auth.GoogleSignInApi.getSignInIntent(apiClient);
activity.startActivityForResult(signInIntent, Constants.GOOGLE_LOGIN_REQUEST);
progress.dismiss();
}
项目:TaipeiTechRefined
文件:PortalActivity.java
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_portal);
mToolbar = (Toolbar) findViewById(R.id.main_toolbar);
setSupportActionBar(mToolbar);
setActionBar();
WebView webview = (WebView) findViewById(R.id.webview);
webview.setWebViewClient(new WebViewClient());
webview.clearCache(true);
webview.clearHistory();
webview.getSettings().setJavaScriptEnabled(true);
webview.getSettings().setJavaScriptCanOpenWindowsAutomatically(true);
String account = Model.getInstance().getAccount();
String password = Model.getInstance().getPassword();
if (!TextUtils.isEmpty(account) && !TextUtils.isEmpty(password)) {
mProgressDialog = ProgressDialog.show(this, null,
getString(R.string.nportal_loggingin));
Thread loginThread = new Thread(new LoginNportalRunnable(account, password,
new LoginHandler(this)));
loginThread.start();
}
}
项目:imui-tutorial
文件:MainActivity.java
@Override
protected Dialog onCreateDialog(int id) {
switch (id) {
case progress_bar_type:
progrssDialog = new ProgressDialog(this);
progrssDialog.setMessage("Downloading model. Please wait...");
progrssDialog.setIndeterminate(false);
progrssDialog.setMax(100);
progrssDialog.setCancelable(false);
progrssDialog.setProgressStyle(ProgressDialog.STYLE_HORIZONTAL);
progrssDialog.show();
return progrssDialog;
default:
return null;
}
}
项目:Matrix-Calculator-for-Android
文件:DeterminantFragment.java
public void RunToGetDeterminant(final int pos, final ProgressDialog px) {
Runnable runnable = new Runnable() {
@Override
public void run() {
double var = SquareList.get(pos).GetDeterminant(px);
Message message = new Message();
Bundle bundle = new Bundle();
bundle.putDouble("RESULTANT", var);
message.setData(bundle);
px.dismiss();
myhandler.sendMessage(message);
}
};
Thread thread = new Thread(runnable);
thread.start();
}
项目:aos-Video
文件:DeleteDialog.java
@Override
public Dialog onCreateDialog(Bundle savedInstanceState) {
String title ="";
int icon=-1 ;
icon= R.drawable.filetype_video;
ProgressDialog pd = new ProgressDialog(getActivity());
pd.setTitle(title);
if(icon >=0)
pd.setIcon(icon);
pd.setMessage(getText(R.string.deleting));
pd.setIndeterminate(true);
pd.setCancelable(true);
return pd;
}
项目:BikeLine
文件:MainActivity.java
/**
* Binding service after the fine location permission is granted
*/
private void startBindingService() {
// Start GPSService which offers user location across activities
positionDialog = new ProgressDialog(this);
positionDialog.setTitle(getResources().getString(R.string.access_location_title));
positionDialog.setMessage(getResources().getString(R.string.access_location_message));
positionDialog.setIndeterminate(true);
positionDialog.setCancelable(false);
positionDialog.setButton(DialogInterface.BUTTON_NEGATIVE, "取消", new DialogInterface.OnClickListener() {
@Override
public void onClick(DialogInterface dialog, int which) {
dialog.dismiss();
positionDialog = null;
}
});
positionDialog.show();
if (isMyServiceRunning(GPSService.class))
bindService(serviceIntent, mConnection, Context.BIND_AUTO_CREATE);
else
super.startService(serviceIntent);
}
项目:ceji_android
文件:ReadingFragment.java
@Override
public void parseEntryStart(int entry) {
if ( ! isAdded() || getActivity() == null ) {
return;
}
this.viewSwitcher.clearAnimation();
this.viewSwitcher.setBackgroundDrawable(null);
restoreColorProfile();
displayPageNumber(-1); //Clear page number
ProgressDialog progressDialog = getWaitDialog();
progressDialog.setMessage(getString( R.string.loading_wait));
progressDialog.show();
}
项目:GCSApp
文件:EaseBaiduMapActivity.java
private void showMapWithLocationClient() {
String str1 = getResources().getString(R.string.Making_sure_your_location);
progressDialog = new ProgressDialog(this);
progressDialog.setCanceledOnTouchOutside(false);
progressDialog.setProgressStyle(ProgressDialog.STYLE_SPINNER);
progressDialog.setMessage(str1);
progressDialog.setOnCancelListener(new OnCancelListener() {
public void onCancel(DialogInterface arg0) {
if (progressDialog.isShowing()) {
progressDialog.dismiss();
}
Log.d("map", "cancel retrieve location");
finish();
}
});
progressDialog.show();
mLocClient = new LocationClient(this);
mLocClient.registerLocationListener(myListener);
LocationClientOption option = new LocationClientOption();
option.setOpenGps(true);// open gps
// option.setCoorType("bd09ll");
// Johnson change to use gcj02 coordination. chinese national standard
// so need to conver to bd09 everytime when draw on baidu map
option.setCoorType("gcj02");
option.setScanSpan(30000);
option.setAddrType("all");
mLocClient.setLocOption(option);
}
项目:ArscEditor
文件:SearchString.java
@Override
// doInBackground执行前执行
protected void onPreExecute() {
// 创建进度条对象
mdialog = new ProgressDialog(mContext);
// 设置进度条提示的信息
mdialog.setMessage(mContext.getString(R.string.searching));
// 设置点击进度条外,进度条不消失
mdialog.setCancelable(false);
// 设置进度条样式为圆形
mdialog.setProgressStyle(ProgressDialog.STYLE_SPINNER);
// 显示进度条
mdialog.show();
}
项目:Blogg
文件:MainActivity.java
@Override
protected void onPreExecute(){
super.onPreExecute();
progressDialog = new ProgressDialog(MainActivity.this);
progressDialog.setMessage("Updating Post...");
progressDialog.show();
}
项目:KTools
文件:FileSystemActivity.java
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_file_system);
ButterKnife.bind(this);
assetManager = getAssets();
mProgressDialog = new ProgressDialog(this);
}
项目:RetrofitUrlManager
文件:MainActivity.java
private void initView() {
setContentView(R.layout.activity_main);
mUrl1 = (EditText) findViewById(R.id.et_url1);
mUrl2 = (EditText) findViewById(R.id.et_url2);
mUrl3 = (EditText) findViewById(R.id.et_url3);
mGlobalUrl = (EditText) findViewById(R.id.et_global_url);
mProgressDialog = new ProgressDialog(this);
mUrl1.setSelection(mUrl1.getText().toString().length());
}
项目:FindX
文件:SelectHome.java
@Override
protected void onPreExecute() {
super.onPreExecute();
pDialog = new ProgressDialog(SelectHome.this);
pDialog.setMessage("Saving location");
pDialog.setIndeterminate(false);
pDialog.setCancelable(false);
pDialog.show();
}
项目:zabbkit-android
文件:LoadingDialog.java
@NonNull
@Override
public Dialog onCreateDialog(Bundle savedInstanceState) {
ProgressDialog mProgressDialog = ProgressDialog.show(getActivity(), "",
getString(R.string.loading), true);
mProgressDialog.setCanceledOnTouchOutside(false);
return mProgressDialog;
}
项目:FindX
文件:Log_in.java
@Override
protected void onPreExecute() {
super.onPreExecute();
pDialog = new ProgressDialog(Log_in.this);
pDialog.setMessage("Loging in....");
pDialog.setIndeterminate(false);
pDialog.setCancelable(false);
pDialog.show();
}
项目:RxProgress
文件:RxProgress.java
private <T> Observable<T> forObservable(Observable<T> source) {
return Observable.using(this::makeDialog,
new Function<ProgressDialog, ObservableSource<? extends T>>() {
@Override
public ObservableSource<? extends T> apply(@NonNull ProgressDialog dialog) throws Exception {
return Observable.create(emitter -> {
if (builder.cancelable) {
dialog.setOnCancelListener(dialogInterface -> emitter.onComplete());
}
dialog.setOnDismissListener(dialogInterface -> emitter.onComplete());
source.subscribe(emitter::onNext, emitter::onError, emitter::onComplete);
});
}
}, Dialog::dismiss);
}
项目:AppGoogleMaps
文件:MainActivity.java
public void callProgressDialog(){
if (progressDialog != null && progressDialog.isShowing())
progressDialog.dismiss();
else
progressDialog = ProgressDialog.show(this, "Please wait.",
"Finding direction..!", true);
}
项目:Howl
文件:ChatFragment.java
private void init() {
mProgressDialog = new ProgressDialog(getActivity());
mProgressDialog.setTitle(getString(R.string.loading));
mProgressDialog.setMessage(getString(R.string.please_wait));
mProgressDialog.setIndeterminate(true);
mIBSend.setOnClickListener(this);
// mETxtMessage.setOnEditorActionListener(this);
mChatPresenter = new ChatPresenter(this);
mChatPresenter.getMessage(FirebaseAuth.getInstance().getCurrentUser().getUid(),
getArguments().getString(Constants.ARG_RECEIVER_UID));
}
项目:ADBToolKitsInstaller
文件:MainActivity.java
public RunCommandsTask(Context context, List<String> commands, String title, boolean runWithRoot) {
mCommands = commands;
this.mTitle = title;
this.mContext = context;
dialog = new ProgressDialog(context);
dialogBuilder = new AlertDialog.Builder(context);
this.runWithRoot = runWithRoot;
}
项目:q-mail
文件:Accounts.java
@Override
protected void showProgressDialog() {
String title = mActivity.getString(R.string.settings_import_activate_account_header);
int passwordCount = (mOutgoingPassword == null) ? 1 : 2;
String message = mActivity.getResources().getQuantityString(
R.plurals.settings_import_setting_passwords, passwordCount);
mProgressDialog = ProgressDialog.show(mActivity, title, message, true);
}
项目:RootPGPExplorer
文件:InitActivity.java
@Override
protected void onPreExecute() {
permissionGranted =false;
dialog =new ProgressDialog(InitActivity.this);
dialog.setIndeterminate(true);
dialog.setMessage("Settings up application");
dialog.setTitle("Application setup");
dialog.setCancelable(false);
}
项目:CustomAndroidOneSheeld
文件:FoursquareShield.java
public void loginToFoursquare() {
ProgressDialog prog = new ProgressDialog(activity);
prog.setMessage(activity.getString(R.string.foursquare_please_wait));
prog.setCancelable(false);
prog.show();
foursquare = new Foursquare(
ApiObjects.foursquare.get("client_key"),
ApiObjects.foursquare.get("client_secret"),
redirectUrl);
foursquare.authorize(getActivity(),
new FoursquareAuthenDialogListener());
prog.cancel();
}
项目:LeCatApp
文件:DownloadTool.java
@Override
protected void onPreExecute() {
dialog = new ProgressDialog(context);
dialog.setCancelable(false);
dialog.setTitle("下载最新版本...");
dialog.setProgressStyle(ProgressDialog.STYLE_HORIZONTAL);
dialog.show();
}
项目:Paathshala
文件:cs.java
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_cs);
fileList = new ArrayList<>();
lv = (ListView) findViewById(R.id.listViewFile);
progressDialog = new ProgressDialog(this);
progressDialog.setMessage("Loading Database. Please wait!!");
progressDialog.show();
mDatabaseRef = FirebaseDatabase.getInstance().getReference(upl.FB_DATABASE_PATH);
mDatabaseRef.addValueEventListener(new ValueEventListener() {
@Override
public void onDataChange(DataSnapshot dataSnapshot) {
progressDialog.dismiss();
for (DataSnapshot snapshot : dataSnapshot.getChildren()) {
FileUpload file = snapshot.getValue(FileUpload.class);
fileList.add(file);
}
adapter = new FileListAdapter(cs.this, R.layout.file_item, fileList);
lv.setAdapter(adapter);
}
@Override
public void onCancelled(DatabaseError databaseError) {
progressDialog.dismiss();
}
});
}
项目:MVP-Android
文件:ProgressDialogUtils.java
public void openProgress(int message){
activity.runOnUiThread(() -> {
progressDialog = new ProgressDialog(activity);
progressDialog.setMessage(activity.getString(message));
progressDialog.show();
});
}
项目:EasyHttp
文件:RxGetActivity.java
@Override
protected void onCreate(@Nullable Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.get_main);
ButterKnife.bind(this);
dialog = new ProgressDialog(this);
}
项目:basicapp
文件:ApiSubscriber.java
public ApiSubscriber(Context context, boolean cancleable, @NonNull ProgressDialog dialog){
this.context = new WeakReference<>(context);
this.dialog = dialog;
this.cancleable = cancleable;
dialog.setCancelable(cancleable);
dialog.setOnCancelListener(this);
}
项目:mousetodon
文件:MouseApp.java
void startWaitingWindow(final String s) {
runOnUiThread(new Runnable() {
@Override
public void run() {
if (waitwin==null) {
waitwin=ProgressDialog.show(MouseApp.main,"Connect "+instanceDomain+"...",s);
}
}
});
}
项目:GitHub
文件:LoginActivity.java
public void login() {
Log.d(TAG, "Login");
if (!validate()) {
onLoginFailed();
return;
}
_loginButton.setEnabled(false);
final ProgressDialog progressDialog = new ProgressDialog(LoginActivity.this,
R.style.AppTheme_Dark_Dialog);
progressDialog.setIndeterminate(true);
progressDialog.setMessage("Authenticating...");
progressDialog.show();
String email = _emailText.getText().toString();
String password = _passwordText.getText().toString();
// TODO: Implement your own authentication logic here.
new android.os.Handler().postDelayed(
new Runnable() {
public void run() {
// On complete call either onLoginSuccess or onLoginFailed
onLoginSuccess();
// onLoginFailed();
progressDialog.dismiss();
}
}, 3000);
}
项目:FindX
文件:Sign_up.java
@Override
protected void onPreExecute() {
super.onPreExecute();
pDialog = new ProgressDialog(Sign_up.this);
pDialog.setMessage("Checking availability of digiPune ID....");
pDialog.setIndeterminate(false);
pDialog.setCancelable(false);
pDialog.show();
}
项目:MyPlace
文件:LoginActivity.java
public void login() {
Log.d(TAG, "login");
if (!validate()) {
onLoginFailed();
return;
}
_login.setEnabled(false);
progressDialog = new ProgressDialog(LoginActivity.this);
progressDialog.setIndeterminate(true);
progressDialog.setMessage("Authenticating");
progressDialog.show();
username = _username.getText().toString();
password = _password.getText().toString();
LocalBroadcastManager.getInstance(this).registerReceiver(loginBroadcastReceiver,
new IntentFilter(ConnectionService.BROADCAST_TAG));
loginHandler.postDelayed(failLoginAfterDelay, 10000);
try {
mService.sendMessage(JSONParser.signinRequest(username, password));
} catch (JSONException e) {
e.printStackTrace();
}
}
项目:marauders
文件:SignupActivity.java
public void signup() {
Log.d(TAG, "Signup");
if (!validate()) {
onSignupFailed();
return;
}
_signupButton.setEnabled(false);
final ProgressDialog progressDialog = new ProgressDialog(SignupActivity.this,
R.style.Theme_AppCompat_DayNight_Dialog);
progressDialog.setIndeterminate(true);
progressDialog.setMessage("Creating Account...");
progressDialog.show();
String name = _nameText.getText().toString();
String email = _emailText.getText().toString();
String password = _passwordText.getText().toString();
// TODO: Implement your own signup logic here.
new android.os.Handler().postDelayed(
new Runnable() {
public void run() {
// On complete call either onSignupSuccess or onSignupFailed
// depending on success
onSignupSuccess();
// onSignupFailed();
progressDialog.dismiss();
}
}, 3000);
}
项目:AndroidNetwork
文件:AppBaseActivity.java
@Override
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
//初始化ProgressDialog
final ProgressDialog dialog = new ProgressDialog(this);
dialog.setMessage(getResources().getString(R.string.str_loading));
dialog.setCanceledOnTouchOutside(false);
dlg = dialog;
}