use of android.app.DialogFragment in project xabber-android by redsolution.
the class ContactSubscriptionDialog method newInstance.
public static DialogFragment newInstance(AccountJid account, UserJid contact) {
DialogFragment fragment = new ContactSubscriptionDialog();
setArguments(account, contact, fragment);
return fragment;
}
use of android.app.DialogFragment in project xabber-android by redsolution.
the class MucInviteDialog method newInstance.
public static DialogFragment newInstance(AccountJid account, UserJid contact) {
DialogFragment fragment = new MucInviteDialog();
setArguments(account, contact, fragment);
return fragment;
}
use of android.app.DialogFragment in project AisenWeiBo by wangdan.
the class VersionDialogFragment method launch.
public static void launch(Activity context) {
Fragment fragment = context.getFragmentManager().findFragmentByTag("DialogFragment");
if (fragment != null) {
context.getFragmentManager().beginTransaction().remove(fragment).commit();
}
VersionDialogFragment dialogFragment = new VersionDialogFragment();
dialogFragment.show(context.getFragmentManager(), "DialogFragment");
}
use of android.app.DialogFragment in project UniPool by divya21raj.
the class NewEntryDialog method onCreateDialog.
@Override
public Dialog onCreateDialog(Bundle savedInstanceState) {
AlertDialog.Builder builder = new AlertDialog.Builder(getActivity());
// Get the layout inflater
LayoutInflater inflater = getActivity().getLayoutInflater();
// Inflate and set the layout for the dialog
// Pass null as the parent view because its going in the dialog layout
View view = inflater.inflate(R.layout.dialog_new_entry, null);
builder.setView(view).setPositiveButton("Create", (dialog, id) -> {
// Do nothing here because we override this button later in onResume to change the close behaviour.
// However, we still need this because on older versions of Android unless we
// pass a handler the button doesn't get instantiated
}).setNegativeButton("Cancel", (dialog, id) -> NewEntryDialog.this.getDialog().cancel());
source = null;
destination = null;
message = null;
time = "";
findSource = view.findViewById(R.id.findSourceEditText);
findDestination = view.findViewById(R.id.findDestinationEditText);
setTime = view.findViewById(R.id.setTimeEditText);
setDate = view.findViewById(R.id.setDateEditText);
messageText = view.findViewById(R.id.newEntryMessageText);
// get current location buttons
Button getCurrentLocationButton0 = view.findViewById(R.id.get_current_location_button0);
getCurrentLocationButton0.setOnClickListener(this::onRequestCurrentLocation);
Button getCurrentLocationButton1 = view.findViewById(R.id.get_current_location_button1);
getCurrentLocationButton1.setOnClickListener(this::onRequestCurrentLocation);
// predictSourceAndDestination();
findSource.setOnClickListener(v -> findSource());
findDestination.setOnClickListener(v -> findDestination());
setTime.setOnClickListener(timeView -> openTimePickerDialog(false));
setDate.setOnClickListener(v -> {
DatePickerFragment.setSetDate(setDate);
DialogFragment newFragment = new DatePickerFragment();
newFragment.show(getFragmentManager(), "Date Picker");
});
mGoogleApiClient = new GoogleApiClient.Builder(getActivity()).addApi(Places.GEO_DATA_API).addApi(Places.PLACE_DETECTION_API).addConnectionCallbacks(this).addOnConnectionFailedListener(this).build();
return builder.create();
}
use of android.app.DialogFragment in project android_packages_apps_Dialer by LineageOS.
the class SpecialCharSequenceMgr method handlePinEntry.
static boolean handlePinEntry(final Context context, final String input) {
if ((input.startsWith("**04") || input.startsWith("**05")) && input.endsWith("#")) {
List<PhoneAccountHandle> subscriptionAccountHandles = TelecomUtil.getSubscriptionPhoneAccounts(context);
boolean hasUserSelectedDefault = subscriptionAccountHandles.contains(TelecomUtil.getDefaultOutgoingPhoneAccount(context, PhoneAccount.SCHEME_TEL));
if (subscriptionAccountHandles.size() <= 1 || hasUserSelectedDefault) {
// a subscription account.
return TelecomUtil.handleMmi(context, input, null);
} else {
SelectPhoneAccountListener listener = new HandleMmiAccountSelectedCallback(context, input);
DialogFragment dialogFragment = SelectPhoneAccountDialogFragment.newInstance(SelectPhoneAccountDialogOptionsUtil.builderWithAccounts(subscriptionAccountHandles).build(), listener);
dialogFragment.show(((Activity) context).getFragmentManager(), TAG_SELECT_ACCT_FRAGMENT);
}
return true;
}
return false;
}
Aggregations