use of android.app.Dialog in project JieCaoVideoPlayer by lipangit.
the class JCVideoPlayerStandardFresco method showVolumeDialog.
@Override
public void showVolumeDialog(float deltaY, int volumePercent) {
super.showVolumeDialog(deltaY, volumePercent);
if (mVolumeDialog == null) {
View localView = LayoutInflater.from(getContext()).inflate(R.layout.jc_dialog_volume, null);
mDialogVolumeProgressBar = ((ProgressBar) localView.findViewById(R.id.volume_progressbar));
mVolumeDialog = new Dialog(getContext(), R.style.jc_style_dialog_progress);
mVolumeDialog.setContentView(localView);
mVolumeDialog.getWindow().addFlags(8);
mVolumeDialog.getWindow().addFlags(32);
mVolumeDialog.getWindow().addFlags(16);
mVolumeDialog.getWindow().setLayout(-2, -2);
WindowManager.LayoutParams localLayoutParams = mVolumeDialog.getWindow().getAttributes();
localLayoutParams.gravity = Gravity.CENTER;
mVolumeDialog.getWindow().setAttributes(localLayoutParams);
}
if (!mVolumeDialog.isShowing()) {
mVolumeDialog.show();
}
mDialogVolumeProgressBar.setProgress(volumePercent);
}
use of android.app.Dialog in project WordPress-Android by wordpress-mobile.
the class AlertUtils method showAlert.
/**
* Show Alert Dialog
* @param context
* @param titleId
* @param message
*/
public static void showAlert(Context context, int titleId, String message) {
Dialog dlg = new AlertDialog.Builder(context).setTitle(titleId).setPositiveButton(android.R.string.ok, null).setMessage(message).create();
dlg.show();
}
use of android.app.Dialog in project WordPress-Android by wordpress-mobile.
the class AlertUtils method showAlert.
/**
* Show Alert Dialog
* @param context
* @param titleId
* @param messageId
*/
public static void showAlert(Context context, int titleId, int messageId) {
Dialog dlg = new AlertDialog.Builder(context).setTitle(titleId).setPositiveButton(android.R.string.ok, null).setMessage(messageId).create();
dlg.show();
}
use of android.app.Dialog in project platform_frameworks_base by android.
the class DialogPreference method showDialog.
/**
* Shows the dialog associated with this Preference. This is normally initiated
* automatically on clicking on the preference. Call this method if you need to
* show the dialog on some other event.
*
* @param state Optional instance state to restore on the dialog
*/
protected void showDialog(Bundle state) {
Context context = getContext();
mWhichButtonClicked = DialogInterface.BUTTON_NEGATIVE;
mBuilder = new AlertDialog.Builder(context).setTitle(mDialogTitle).setIcon(mDialogIcon).setPositiveButton(mPositiveButtonText, this).setNegativeButton(mNegativeButtonText, this);
View contentView = onCreateDialogView();
if (contentView != null) {
onBindDialogView(contentView);
mBuilder.setView(contentView);
} else {
mBuilder.setMessage(mDialogMessage);
}
onPrepareDialogBuilder(mBuilder);
getPreferenceManager().registerOnActivityDestroyListener(this);
// Create the dialog
final Dialog dialog = mDialog = mBuilder.create();
if (state != null) {
dialog.onRestoreInstanceState(state);
}
if (needInputMethod()) {
requestInputMethod(dialog);
}
dialog.setOnDismissListener(this);
dialog.show();
}
use of android.app.Dialog in project platform_frameworks_base by android.
the class PreferenceScreen method showDialog.
private void showDialog(Bundle state) {
Context context = getContext();
if (mListView != null) {
mListView.setAdapter(null);
}
LayoutInflater inflater = (LayoutInflater) context.getSystemService(Context.LAYOUT_INFLATER_SERVICE);
View childPrefScreen = inflater.inflate(mLayoutResId, null);
View titleView = childPrefScreen.findViewById(android.R.id.title);
mListView = (ListView) childPrefScreen.findViewById(android.R.id.list);
if (mDividerSpecified) {
mListView.setDivider(mDividerDrawable);
}
bind(mListView);
// Set the title bar if title is available, else no title bar
final CharSequence title = getTitle();
Dialog dialog = mDialog = new Dialog(context, context.getThemeResId());
if (TextUtils.isEmpty(title)) {
if (titleView != null) {
titleView.setVisibility(View.GONE);
}
dialog.getWindow().requestFeature(Window.FEATURE_NO_TITLE);
} else {
if (titleView instanceof TextView) {
((TextView) titleView).setText(title);
titleView.setVisibility(View.VISIBLE);
} else {
dialog.setTitle(title);
}
}
dialog.setContentView(childPrefScreen);
dialog.setOnDismissListener(this);
if (state != null) {
dialog.onRestoreInstanceState(state);
}
// Add the screen to the list of preferences screens opened as dialogs
getPreferenceManager().addPreferencesScreen(dialog);
dialog.show();
}
Aggregations