From 434e1a05ca5578f517058f39999b34db504b33c2 Mon Sep 17 00:00:00 2001 From: Tyler Gunn Date: Tue, 12 Aug 2014 12:14:25 -0700 Subject: Correcting dialpad animations in landscape (2/3). 1. Fixed slide in/out animations for RTL locales. Bug: 16463723 Change-Id: I526efec7795c891cbb4fa27776bb8be7d26ac114 --- .../src/com/android/incallui/InCallActivity.java | 20 ++++++++++++++++---- 1 file changed, 16 insertions(+), 4 deletions(-) (limited to 'InCallUI') diff --git a/InCallUI/src/com/android/incallui/InCallActivity.java b/InCallUI/src/com/android/incallui/InCallActivity.java index b650e7beb..ae27c51c0 100644 --- a/InCallUI/src/com/android/incallui/InCallActivity.java +++ b/InCallUI/src/com/android/incallui/InCallActivity.java @@ -27,6 +27,7 @@ import android.content.Intent; import android.content.res.Configuration; import android.os.Bundle; import android.telephony.DisconnectCause; +import android.text.TextUtils; import android.view.ViewTreeObserver; import android.view.animation.Animation; import android.view.animation.AnimationUtils; @@ -40,6 +41,8 @@ import com.android.phone.common.animation.AnimUtils; import com.android.phone.common.animation.AnimationListenerAdapter; import com.android.incallui.Call.State; +import java.util.Locale; + /** * Phone app "in call" screen. */ @@ -114,10 +117,19 @@ public class InCallActivity extends Activity { mCurrentOrientation = getResources().getConfiguration().orientation; mIsLandscape = getResources().getConfiguration().orientation == Configuration.ORIENTATION_LANDSCAPE; - mSlideIn = AnimationUtils.loadAnimation(this, - mIsLandscape ? R.anim.dialpad_slide_in_right : R.anim.dialpad_slide_in_bottom); - mSlideOut = AnimationUtils.loadAnimation(this, - mIsLandscape ? R.anim.dialpad_slide_out_right : R.anim.dialpad_slide_out_bottom); + + 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); -- cgit v1.2.3