use of android.app.ProgressDialog in project JamsMusicPlayer by psaravan.
the class AsyncCopyMoveTask method onPreExecute.
protected void onPreExecute() {
pd = new ProgressDialog(mFragment.getActivity());
pd.setCancelable(false);
pd.setIndeterminate(false);
if (mShouldMove) {
pd.setTitle(R.string.move);
pd.setMessage(mContext.getResources().getString(R.string.moving_file));
} else {
pd.setTitle(R.string.copy);
pd.setMessage(mContext.getResources().getString(R.string.copying_file));
}
pd.setButton(DialogInterface.BUTTON_NEUTRAL, mContext.getResources().getString(R.string.run_in_background), new OnClickListener() {
@Override
public void onClick(DialogInterface arg0, int arg1) {
pd.dismiss();
}
});
pd.show();
}
use of android.app.ProgressDialog in project JamsMusicPlayer by psaravan.
the class AsyncAutoGetAlbumArtTask method onPreExecute.
public void onPreExecute() {
super.onPreExecute();
pd = new ProgressDialog(mActivity);
pd.setTitle(R.string.downloading_album_art);
pd.setProgressStyle(ProgressDialog.STYLE_HORIZONTAL);
pd.setCancelable(false);
pd.setCanceledOnTouchOutside(false);
pd.setMessage(mContext.getResources().getString(R.string.scanning_for_missing_art));
pd.setButton(DialogInterface.BUTTON_NEGATIVE, mContext.getResources().getString(R.string.cancel), new OnClickListener() {
@Override
public void onClick(DialogInterface dialog, int which) {
dialog.dismiss();
task.cancel(true);
}
});
pd.show();
}
use of android.app.ProgressDialog in project weiciyuan by qii.
the class CommonProgressDialogFragment method onCreateDialog.
@Override
public Dialog onCreateDialog(Bundle savedInstanceState) {
ProgressDialog dialog = new ProgressDialog(getActivity());
dialog.setMessage(getArguments().getString("content"));
return dialog;
}
use of android.app.ProgressDialog in project android-ocr by rmtheis.
the class CaptureActivity method displayProgressDialog.
void displayProgressDialog() {
// Set up the indeterminate progress dialog box
indeterminateDialog = new ProgressDialog(this);
indeterminateDialog.setTitle("Please wait");
String ocrEngineModeName = getOcrEngineModeName();
if (ocrEngineModeName.equals("Both")) {
indeterminateDialog.setMessage("Performing OCR using Cube and Tesseract...");
} else {
indeterminateDialog.setMessage("Performing OCR using " + ocrEngineModeName + "...");
}
indeterminateDialog.setCancelable(false);
indeterminateDialog.show();
}
use of android.app.ProgressDialog in project android-ocr by rmtheis.
the class CaptureActivity method initOcrEngine.
/**
* Requests initialization of the OCR engine with the given parameters.
*
* @param storageRoot Path to location of the tessdata directory to use
* @param languageCode Three-letter ISO 639-3 language code for OCR
* @param languageName Name of the language for OCR, for example, "English"
*/
private void initOcrEngine(File storageRoot, String languageCode, String languageName) {
isEngineReady = false;
// Set up the dialog box for the thermometer-style download progress indicator
if (dialog != null) {
dialog.dismiss();
}
dialog = new ProgressDialog(this);
// If we have a language that only runs using Cube, then set the ocrEngineMode to Cube
if (ocrEngineMode != TessBaseAPI.OEM_CUBE_ONLY) {
for (String s : CUBE_REQUIRED_LANGUAGES) {
if (s.equals(languageCode)) {
ocrEngineMode = TessBaseAPI.OEM_CUBE_ONLY;
SharedPreferences prefs = PreferenceManager.getDefaultSharedPreferences(this);
prefs.edit().putString(PreferencesActivity.KEY_OCR_ENGINE_MODE, getOcrEngineModeName()).commit();
}
}
}
// If our language doesn't support Cube, then set the ocrEngineMode to Tesseract
if (ocrEngineMode != TessBaseAPI.OEM_TESSERACT_ONLY) {
boolean cubeOk = false;
for (String s : CUBE_SUPPORTED_LANGUAGES) {
if (s.equals(languageCode)) {
cubeOk = true;
}
}
if (!cubeOk) {
ocrEngineMode = TessBaseAPI.OEM_TESSERACT_ONLY;
SharedPreferences prefs = PreferenceManager.getDefaultSharedPreferences(this);
prefs.edit().putString(PreferencesActivity.KEY_OCR_ENGINE_MODE, getOcrEngineModeName()).commit();
}
}
// Display the name of the OCR engine we're initializing in the indeterminate progress dialog box
indeterminateDialog = new ProgressDialog(this);
indeterminateDialog.setTitle("Please wait");
String ocrEngineModeName = getOcrEngineModeName();
if (ocrEngineModeName.equals("Both")) {
indeterminateDialog.setMessage("Initializing Cube and Tesseract OCR engines for " + languageName + "...");
} else {
indeterminateDialog.setMessage("Initializing " + ocrEngineModeName + " OCR engine for " + languageName + "...");
}
indeterminateDialog.setCancelable(false);
indeterminateDialog.show();
if (handler != null) {
handler.quitSynchronously();
}
// with low memory that crash when running OCR with Cube, and prevent unwanted delays.
if (ocrEngineMode == TessBaseAPI.OEM_CUBE_ONLY || ocrEngineMode == TessBaseAPI.OEM_TESSERACT_CUBE_COMBINED) {
Log.d(TAG, "Disabling continuous preview");
isContinuousModeActive = false;
SharedPreferences prefs = PreferenceManager.getDefaultSharedPreferences(this);
prefs.edit().putBoolean(PreferencesActivity.KEY_CONTINUOUS_PREVIEW, false);
}
// Start AsyncTask to install language data and init OCR
baseApi = new TessBaseAPI();
new OcrInitAsyncTask(this, baseApi, dialog, indeterminateDialog, languageCode, languageName, ocrEngineMode).execute(storageRoot.toString());
}
Aggregations