Search in sources :

Example 81 with DialogFragment

use of android.app.DialogFragment in project android_packages_apps_Dialer by MoKee.

the class InCallActivity method onCreate.

@Override
protected void onCreate(Bundle icicle) {
    Log.d(this, "onCreate()...  this = " + this);
    super.onCreate(icicle);
    // set this flag so this activity will stay in front of the keyguard
    // Have the WindowManager filter out touch events that are "too fat".
    int flags = WindowManager.LayoutParams.FLAG_SHOW_WHEN_LOCKED | WindowManager.LayoutParams.FLAG_TURN_SCREEN_ON | WindowManager.LayoutParams.FLAG_IGNORE_CHEEK_PRESSES;
    getWindow().addFlags(flags);
    // Setup action bar for the conference call manager.
    requestWindowFeature(Window.FEATURE_ACTION_BAR_OVERLAY);
    if (getActionBar() != null) {
        getActionBar().setDisplayHomeAsUpEnabled(true);
        getActionBar().setDisplayShowTitleEnabled(true);
        getActionBar().hide();
    }
    // TODO(klp): Do we need to add this back when prox sensor is not available?
    // lp.inputFeatures |= WindowManager.LayoutParams.INPUT_FEATURE_DISABLE_USER_ACTIVITY;
    // Since activity is created newly, clear full screen flag. This will ensure that
    // the flag is in sync with actual UI when UI is recreated due to orientation change.
    InCallPresenter.getInstance().clearFullscreen();
    setContentView(R.layout.incall_screen);
    internalResolveIntent(getIntent());
    mIsLandscape = getResources().getConfiguration().orientation == Configuration.ORIENTATION_LANDSCAPE;
    final boolean isRtl = TextUtils.getLayoutDirectionFromLocale(Locale.getDefault()) == View.LAYOUT_DIRECTION_RTL;
    if (mIsLandscape) {
        mSlideIn = AnimationUtils.loadAnimation(this, isRtl ? R.anim.dialpad_slide_in_left : R.anim.dialpad_slide_in_right);
        mSlideOut = AnimationUtils.loadAnimation(this, isRtl ? R.anim.dialpad_slide_out_left : R.anim.dialpad_slide_out_right);
    } else {
        mSlideIn = AnimationUtils.loadAnimation(this, R.anim.dialpad_slide_in_bottom);
        mSlideOut = AnimationUtils.loadAnimation(this, R.anim.dialpad_slide_out_bottom);
    }
    mSlideIn.setInterpolator(AnimUtils.EASE_IN);
    mSlideOut.setInterpolator(AnimUtils.EASE_OUT);
    mSlideOut.setAnimationListener(mSlideOutListener);
    // If the dialpad fragment already exists, retrieve it.  This is important when rotating as
    // we will not be able to hide or show the dialpad after the rotation otherwise.
    Fragment existingFragment = getFragmentManager().findFragmentByTag(DialpadFragment.class.getName());
    if (existingFragment != null) {
        mDialpadFragment = (DialpadFragment) existingFragment;
    }
    if (icicle != null) {
        // to receive it.
        if (icicle.containsKey(SHOW_DIALPAD_EXTRA)) {
            boolean showDialpad = icicle.getBoolean(SHOW_DIALPAD_EXTRA);
            mShowDialpadRequest = showDialpad ? DIALPAD_REQUEST_SHOW : DIALPAD_REQUEST_HIDE;
            mAnimateDialpadOnShow = false;
        }
        mDtmfText = icicle.getString(DIALPAD_TEXT_EXTRA);
        SelectPhoneAccountDialogFragment dialogFragment = (SelectPhoneAccountDialogFragment) getFragmentManager().findFragmentByTag(TAG_SELECT_ACCT_FRAGMENT);
        if (dialogFragment != null) {
            dialogFragment.setListener(mSelectAcctListener);
        }
    }
    mInCallOrientationEventListener = new InCallOrientationEventListener(this);
    if (CallList.getInstance().isDsdaEnabled()) {
        mDsdaTabLayout = (TabLayout) findViewById(R.id.dsda_tabs);
        mDsdaTabLayout.addOnTabSelectedListener(this);
        mSubManager = SubscriptionManager.from(this);
        mSubManager.addOnSubscriptionsChangedListener(mSubListener);
        mSubInfos = mSubManager.getActiveSubscriptionInfoList();
    }
    Log.d(this, "onCreate(): exit");
}
Also used : SelectPhoneAccountDialogFragment(com.android.contacts.common.widget.SelectPhoneAccountDialogFragment) DialogFragment(android.app.DialogFragment) Fragment(android.app.Fragment) SelectPhoneAccountDialogFragment(com.android.contacts.common.widget.SelectPhoneAccountDialogFragment) Point(android.graphics.Point)

Example 82 with DialogFragment

use of android.app.DialogFragment in project android_packages_apps_Dialer by MoKee.

the class FillCallLogTestActivity method showTimePickerDialog.

/**
 * Shows a time picker dialog, storing the results in the time field.
 */
public void showTimePickerDialog(View v) {
    DialogFragment newFragment = new TimePickerFragment();
    newFragment.show(getFragmentManager(), "timePicker");
}
Also used : DialogFragment(android.app.DialogFragment)

Example 83 with DialogFragment

use of android.app.DialogFragment in project android_packages_apps_Dialer by MoKee.

the class FilteredNumberCompatInstrumentationTest method testShowBlockNumberDialogFlow_AlreadyBlocked.

public void testShowBlockNumberDialogFlow_AlreadyBlocked() throws InterruptedException {
    if (!CompatUtils.isNCompatible()) {
        return;
    }
    ContentValues values = new ContentValues();
    values.put(BlockedNumbers.COLUMN_ORIGINAL_NUMBER, NUMBER);
    mContentResolver.insert(BlockedNumbers.CONTENT_URI, values);
    FilteredNumberCompat.setHasMigratedToNewBlocking(false);
    getInstrumentation().runOnMainSync(new Runnable() {

        @Override
        public void run() {
            FilteredNumberCompat.showBlockNumberDialogFlow(mContentResolver, null, NUMBER, COUNTRY_ISO, E164_NUMBER, R.id.floating_action_button_container, mFragmentManager, null);
        }
    });
    getInstrumentation().waitForIdleSync();
    final DialogFragment migrateDialogFragment = (DialogFragment) mFragmentManager.findFragmentByTag("MigrateBlockedNumbers");
    assertTrue(migrateDialogFragment.getDialog().isShowing());
    getInstrumentation().runOnMainSync(new Runnable() {

        @Override
        public void run() {
            ((AlertDialog) migrateDialogFragment.getDialog()).getButton(DialogInterface.BUTTON_POSITIVE).performClick();
        }
    });
    getInstrumentation().waitForIdleSync();
    assertNull(mFragmentManager.findFragmentByTag("BlockNumberDialog"));
}
Also used : ContentValues(android.content.ContentValues) AlertDialog(android.app.AlertDialog) DialogFragment(android.app.DialogFragment)

Example 84 with DialogFragment

use of android.app.DialogFragment in project xabber-android by redsolution.

the class MucPrivateChatInvitationDialog method newInstance.

public static DialogFragment newInstance(AccountJid account, UserJid contact) {
    DialogFragment fragment = new MucPrivateChatInvitationDialog();
    setArguments(account, contact, fragment);
    return fragment;
}
Also used : DialogFragment(android.app.DialogFragment)

Example 85 with DialogFragment

use of android.app.DialogFragment in project NotificationPeekPort by lzanita09.

the class DialogHelper method showAboutDialog.

public static void showAboutDialog(Activity activity) {
    FragmentManager fm = activity.getFragmentManager();
    FragmentTransaction ft = fm.beginTransaction();
    ((DialogFragment) Fragment.instantiate(activity, AboutDialogFragment.class.getName())).show(ft, ABOUT_DIALOG_TAG);
}
Also used : FragmentManager(android.app.FragmentManager) FragmentTransaction(android.app.FragmentTransaction) DialogFragment(android.app.DialogFragment)

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