Search in sources :

Example 56 with DialogFragment

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;
}
Also used : DialogFragment(android.app.DialogFragment)

Example 57 with DialogFragment

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;
}
Also used : DialogFragment(android.app.DialogFragment)

Example 58 with DialogFragment

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");
}
Also used : Fragment(android.app.Fragment) DialogFragment(android.app.DialogFragment)

Example 59 with 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();
}
Also used : AlertDialog(android.support.v7.app.AlertDialog) Context(android.content.Context) TimePickerDialog(android.app.TimePickerDialog) Bundle(android.os.Bundle) ConnectionResult(com.google.android.gms.common.ConnectionResult) PackageManager(android.content.pm.PackageManager) Globals(garbagecollectors.com.unipool.application.Globals) Date(java.util.Date) SimpleDateFormat(java.text.SimpleDateFormat) Dialog(android.app.Dialog) Intent(android.content.Intent) NonNull(android.support.annotation.NonNull) GenLocation(garbagecollectors.com.unipool.models.GenLocation) GooglePlayServicesRepairableException(com.google.android.gms.common.GooglePlayServicesRepairableException) PlaceLikelihood(com.google.android.gms.location.places.PlaceLikelihood) Manifest(android.Manifest) SuppressLint(android.annotation.SuppressLint) Calendar(java.util.Calendar) GoogleApiClient(com.google.android.gms.common.api.GoogleApiClient) Toast(android.widget.Toast) View(android.view.View) Button(android.widget.Button) PendingResult(com.google.android.gms.common.api.PendingResult) DialogFragment(android.app.DialogFragment) ParseException(java.text.ParseException) AutocompleteFilter(com.google.android.gms.location.places.AutocompleteFilter) LatLng(com.google.android.gms.maps.model.LatLng) OnTimeSetListener(android.app.TimePickerDialog.OnTimeSetListener) LayoutInflater(android.view.LayoutInflater) PlaceLikelihoodBuffer(com.google.android.gms.location.places.PlaceLikelihoodBuffer) Places(com.google.android.gms.location.places.Places) ContextCompat(android.support.v4.content.ContextCompat) BaseActivity.finalCurrentUser(garbagecollectors.com.unipool.activities.BaseActivity.finalCurrentUser) R(garbagecollectors.com.unipool.R) TripEntry(garbagecollectors.com.unipool.models.TripEntry) ActivityCompat(android.support.v4.app.ActivityCompat) AlertDialog(android.support.v7.app.AlertDialog) GooglePlayServicesNotAvailableException(com.google.android.gms.common.GooglePlayServicesNotAvailableException) TimePicker(android.widget.TimePicker) Nullable(android.support.annotation.Nullable) Place(com.google.android.gms.location.places.Place) UtilityMethods(garbagecollectors.com.unipool.application.UtilityMethods) EditText(android.widget.EditText) PlaceAutocomplete(com.google.android.gms.location.places.ui.PlaceAutocomplete) Button(android.widget.Button) LayoutInflater(android.view.LayoutInflater) DialogFragment(android.app.DialogFragment) View(android.view.View)

Example 60 with DialogFragment

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;
}
Also used : PhoneAccountHandle(android.telecom.PhoneAccountHandle) DialogFragment(android.app.DialogFragment) SelectPhoneAccountDialogFragment(com.android.contacts.common.widget.SelectPhoneAccountDialogFragment) SelectPhoneAccountListener(com.android.contacts.common.widget.SelectPhoneAccountDialogFragment.SelectPhoneAccountListener)

Aggregations

DialogFragment (android.app.DialogFragment)110 InstrumentedDialogFragment (com.android.settings.core.instrumentation.InstrumentedDialogFragment)26 Fragment (android.app.Fragment)13 Activity (android.app.Activity)12 FragmentManager (android.app.FragmentManager)8 SelectPhoneAccountDialogFragment (com.android.contacts.common.widget.SelectPhoneAccountDialogFragment)8 FragmentTransaction (android.app.FragmentTransaction)7 PhoneAccountHandle (android.telecom.PhoneAccountHandle)7 SupportDisclaimerDialogFragment (com.android.settings.support.SupportDisclaimerDialogFragment)7 SupportPhoneDialogFragment (com.android.settings.support.SupportPhoneDialogFragment)7 SelectPhoneAccountListener (com.android.contacts.common.widget.SelectPhoneAccountDialogFragment.SelectPhoneAccountListener)6 Context (android.content.Context)5 Bundle (android.os.Bundle)5 CustomDialogPreference (com.android.settingslib.CustomDialogPreference)5 CustomEditTextPreference (com.android.settingslib.CustomEditTextPreference)5 Intent (android.content.Intent)4 KeyguardManager (android.app.KeyguardManager)3 ProgressDialog (android.app.ProgressDialog)3 Uri (android.net.Uri)3 TelephonyManager (android.telephony.TelephonyManager)3