Search in sources :

Example 1 with AnimationListenerAdapter

use of com.android.dialer.animation.AnimationListenerAdapter 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)

Aggregations

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