Search in sources :

Example 1 with SelectPhoneAccountDialogFragment

use of com.android.contacts.common.widget.SelectPhoneAccountDialogFragment in project android_packages_apps_Dialer by LineageOS.

the class InCallActivityCommon method onCreate.

public void onCreate(Bundle 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;
    inCallActivity.getWindow().addFlags(flags);
    inCallActivity.setContentView(R.layout.incall_screen);
    internalResolveIntent(inCallActivity.getIntent());
    boolean isLandscape = inCallActivity.getResources().getConfiguration().orientation == Configuration.ORIENTATION_LANDSCAPE;
    boolean isRtl = ViewUtil.isRtl();
    if (isLandscape) {
        dialpadSlideInAnimation = AnimationUtils.loadAnimation(inCallActivity, isRtl ? R.anim.dialpad_slide_in_left : R.anim.dialpad_slide_in_right);
        dialpadSlideOutAnimation = AnimationUtils.loadAnimation(inCallActivity, isRtl ? R.anim.dialpad_slide_out_left : R.anim.dialpad_slide_out_right);
    } else {
        dialpadSlideInAnimation = AnimationUtils.loadAnimation(inCallActivity, R.anim.dialpad_slide_in_bottom);
        dialpadSlideOutAnimation = AnimationUtils.loadAnimation(inCallActivity, R.anim.dialpad_slide_out_bottom);
    }
    dialpadSlideInAnimation.setInterpolator(AnimUtils.EASE_IN);
    dialpadSlideOutAnimation.setInterpolator(AnimUtils.EASE_OUT);
    dialpadSlideOutAnimation.setAnimationListener(new AnimationListenerAdapter() {

        @Override
        public void onAnimationEnd(Animation animation) {
            performHideDialpadFragment();
        }
    });
    if (icicle != null) {
        // in onResume() to ensure the hosting fragment has been inflated and is ready to receive it.
        if (icicle.containsKey(INTENT_EXTRA_SHOW_DIALPAD)) {
            boolean showDialpad = icicle.getBoolean(INTENT_EXTRA_SHOW_DIALPAD);
            showDialpadRequest = showDialpad ? DIALPAD_REQUEST_SHOW : DIALPAD_REQUEST_HIDE;
            animateDialpadOnShow = false;
        }
        dtmfTextToPreopulate = icicle.getString(DIALPAD_TEXT_KEY);
        SelectPhoneAccountDialogFragment dialogFragment = (SelectPhoneAccountDialogFragment) inCallActivity.getFragmentManager().findFragmentByTag(TAG_SELECT_ACCOUNT_FRAGMENT);
        if (dialogFragment != null) {
            dialogFragment.setListener(selectAccountListener);
        }
    }
    InternationalCallOnWifiDialogFragment existingInternationalFragment = (InternationalCallOnWifiDialogFragment) inCallActivity.getSupportFragmentManager().findFragmentByTag(TAG_INTERNATIONAL_CALL_ON_WIFI);
    if (existingInternationalFragment != null) {
        LogUtil.i("InCallActivityCommon.onCreate", "international fragment exists attaching callback");
        existingInternationalFragment.setCallback(internationalCallOnWifiCallback);
    }
    inCallOrientationEventListener = new InCallOrientationEventListener(inCallActivity);
}
Also used : SelectPhoneAccountDialogFragment(com.android.contacts.common.widget.SelectPhoneAccountDialogFragment) Animation(android.view.animation.Animation) InternationalCallOnWifiDialogFragment(com.android.incallui.telecomeventui.InternationalCallOnWifiDialogFragment) AnimationListenerAdapter(com.android.dialer.animation.AnimationListenerAdapter)

Example 2 with SelectPhoneAccountDialogFragment

use of com.android.contacts.common.widget.SelectPhoneAccountDialogFragment in project android_packages_apps_Dialer by MoKee.

the class InCallActivity method dismissPendingDialogs.

public void dismissPendingDialogs() {
    if (mDialog != null) {
        mDialog.dismiss();
        mDialog = null;
    }
    SelectPhoneAccountDialogFragment dialogFragment = (SelectPhoneAccountDialogFragment) getFragmentManager().findFragmentByTag(TAG_SELECT_ACCT_FRAGMENT);
    if (dialogFragment != null) {
        dialogFragment.dismiss();
    }
    if (mAnswerFragment != null) {
        mAnswerFragment.dismissPendingDialogs();
    }
    InCallCsRedialHandler.getInstance().dismissPendingDialogs();
    InCallLowBatteryListener.getInstance().dismissPendingDialogs();
}
Also used : SelectPhoneAccountDialogFragment(com.android.contacts.common.widget.SelectPhoneAccountDialogFragment)

Example 3 with SelectPhoneAccountDialogFragment

use of com.android.contacts.common.widget.SelectPhoneAccountDialogFragment 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)

Aggregations

SelectPhoneAccountDialogFragment (com.android.contacts.common.widget.SelectPhoneAccountDialogFragment)3 DialogFragment (android.app.DialogFragment)1 Fragment (android.app.Fragment)1 Point (android.graphics.Point)1 Animation (android.view.animation.Animation)1 AnimationListenerAdapter (com.android.dialer.animation.AnimationListenerAdapter)1 InternationalCallOnWifiDialogFragment (com.android.incallui.telecomeventui.InternationalCallOnWifiDialogFragment)1