Search in sources :

Example 1 with InternationalCallOnWifiDialogFragment

use of com.android.incallui.telecomeventui.InternationalCallOnWifiDialogFragment 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 InternationalCallOnWifiDialogFragment

use of com.android.incallui.telecomeventui.InternationalCallOnWifiDialogFragment in project android_packages_apps_Dialer by LineageOS.

the class InCallActivityCommon method showInternationalCallOnWifiDialog.

void showInternationalCallOnWifiDialog(@NonNull DialerCall call) {
    LogUtil.enterBlock("InCallActivityCommon.showInternationalCallOnWifiDialog");
    if (!InternationalCallOnWifiDialogFragment.shouldShow(inCallActivity)) {
        LogUtil.i("InCallActivityCommon.showInternationalCallOnWifiDialog", "InternationalCallOnWifiDialogFragment.shouldShow returned false");
        return;
    }
    InternationalCallOnWifiDialogFragment fragment = InternationalCallOnWifiDialogFragment.newInstance(call.getId(), internationalCallOnWifiCallback);
    fragment.show(inCallActivity.getSupportFragmentManager(), TAG_INTERNATIONAL_CALL_ON_WIFI);
}
Also used : InternationalCallOnWifiDialogFragment(com.android.incallui.telecomeventui.InternationalCallOnWifiDialogFragment)

Example 3 with InternationalCallOnWifiDialogFragment

use of com.android.incallui.telecomeventui.InternationalCallOnWifiDialogFragment in project android_packages_apps_Dialer by LineageOS.

the class InCallActivityCommon method dismissPendingDialogs.

void dismissPendingDialogs() {
    if (dialog != null) {
        dialog.dismiss();
        dialog = null;
    }
    if (selectPhoneAccountDialogFragment != null) {
        selectPhoneAccountDialogFragment.dismiss();
        selectPhoneAccountDialogFragment = null;
    }
    InternationalCallOnWifiDialogFragment internationalCallOnWifiFragment = (InternationalCallOnWifiDialogFragment) inCallActivity.getSupportFragmentManager().findFragmentByTag(TAG_INTERNATIONAL_CALL_ON_WIFI);
    if (internationalCallOnWifiFragment != null) {
        LogUtil.i("InCallActivityCommon.dismissPendingDialogs", "dismissing InternationalCallOnWifiDialogFragment");
        internationalCallOnWifiFragment.dismiss();
    }
}
Also used : InternationalCallOnWifiDialogFragment(com.android.incallui.telecomeventui.InternationalCallOnWifiDialogFragment)

Aggregations

InternationalCallOnWifiDialogFragment (com.android.incallui.telecomeventui.InternationalCallOnWifiDialogFragment)3 Animation (android.view.animation.Animation)1 SelectPhoneAccountDialogFragment (com.android.contacts.common.widget.SelectPhoneAccountDialogFragment)1 AnimationListenerAdapter (com.android.dialer.animation.AnimationListenerAdapter)1