use of org.holoeverywhere.app.Dialog in project mobile-android by photo.
the class PhotoDetailsEditFragment method updatePhotoDetails.
private void updatePhotoDetails() {
final ProgressDialogLoadingControl loadingControl = new ProgressDialogLoadingControl(getActivity(), true, false, getString(R.string.updating_photo_message));
Runnable runOnSuccess = new Runnable() {
@Override
public void run() {
// need to self dismiss on successful editing
Dialog dialog = PhotoDetailsEditFragment.this.getDialog();
if (dialog != null && dialog.isShowing()) {
PhotoDetailsEditFragment.this.dismissAllowingStateLoss();
}
}
};
PhotoUtils.updatePhoto(photo, titleText.getText().toString(), descriptionText.getText().toString(), TagUtils.getTags(tagsText.getText().toString()), privateSwitch.isChecked(), runOnSuccess, loadingControl);
}
use of org.holoeverywhere.app.Dialog in project mobile-android by photo.
the class PhotoDetailsEditFragment method onCreateDialog.
@Override
public Dialog onCreateDialog(Bundle savedInstanceState) {
Dialog result = super.onCreateDialog(savedInstanceState);
result.setTitle(R.string.photo_edit_dialog_title);
return result;
}
use of org.holoeverywhere.app.Dialog in project mobile-android by photo.
the class AlbumCreateFragment method createAlbum.
private void createAlbum() {
final ProgressDialogLoadingControl loadingControl = new ProgressDialogLoadingControl(getActivity(), true, false, getString(R.string.creating_album_message));
Runnable runOnSuccess = new Runnable() {
@Override
public void run() {
// need to self dismiss on successful editing
Dialog dialog = AlbumCreateFragment.this.getDialog();
if (dialog != null && dialog.isShowing()) {
AlbumCreateFragment.this.dismissAllowingStateLoss();
}
}
};
AlbumUtils.createAlbum(titleText.getText().toString(), runOnSuccess, loadingControl);
}
use of org.holoeverywhere.app.Dialog in project HoloEverywhere by Prototik.
the class PreferenceScreen method showDialog.
@SuppressLint("NewApi")
protected void showDialog(Bundle state) {
Context preferenceContext = getContext();
Context context = PreferenceInit.unwrap(getContext());
final int contextTheme = getThemeResId(context);
if (mListView != null) {
mListView.setAdapter(null);
}
View childPrefScreen = LayoutInflater.inflate(preferenceContext, R.layout.preference_list_fragment);
mListView = (ListView) childPrefScreen.findViewById(android.R.id.list);
bind(mListView);
final CharSequence title = getTitle();
final boolean titleEmpty = TextUtils.isEmpty(title);
Dialog dialog = mDialog = new PreferenceDialog(context, contextTheme);
if (titleEmpty) {
dialog.requestWindowFeature(Window.FEATURE_NO_TITLE);
} else {
if (VERSION.SDK_INT >= 11) {
dialog.requestWindowFeature(Window.FEATURE_ACTION_BAR);
}
dialog.setContentView(childPrefScreen);
dialog.setTitle(title);
}
dialog.setOnDismissListener(this);
onPrepareDialog(dialog);
if (state != null) {
dialog.onRestoreInstanceState(state);
}
getPreferenceManager().addPreferencesScreen(dialog);
dialog.show();
}
use of org.holoeverywhere.app.Dialog in project little-bear-dictionary by daimajia.
the class PreferenceScreen method showDialog.
@SuppressLint("NewApi")
private void showDialog(Bundle state) {
Context context = getContext();
if (mListView != null) {
mListView.setAdapter(null);
}
final int theme = getThemeResId(context);
LayoutInflater inflater = LayoutInflater.from(context);
View childPrefScreen = inflater.inflate(R.layout.preference_list_fragment, null);
mListView = (ListView) childPrefScreen.findViewById(android.R.id.list);
bind(mListView);
final CharSequence title = getTitle();
final boolean titleEmpty = TextUtils.isEmpty(title);
Dialog dialog = mDialog = new PreferenceDialog(theme);
if (titleEmpty) {
dialog.requestWindowFeature(Window.FEATURE_NO_TITLE);
} else {
if (VERSION.SDK_INT >= 11) {
dialog.requestWindowFeature(Window.FEATURE_ACTION_BAR);
}
dialog.setContentView(childPrefScreen);
dialog.setTitle(title);
}
dialog.setOnDismissListener(this);
if (state != null) {
dialog.onRestoreInstanceState(state);
}
getPreferenceManager().addPreferencesScreen(dialog);
dialog.show();
}
Aggregations