summaryrefslogtreecommitdiff
path: root/InCallUI
diff options
context:
space:
mode:
authorTyler Gunn <tgunn@google.com>2014-08-12 12:14:25 -0700
committerTyler Gunn <tgunn@google.com>2014-08-12 12:14:25 -0700
commit434e1a05ca5578f517058f39999b34db504b33c2 (patch)
tree4b6289a143bf3b0195a07e4ffddaf264b781b244 /InCallUI
parentad4d6914883fae5deaee693e52b68cfaa79097d0 (diff)
Correcting dialpad animations in landscape (2/3).
1. Fixed slide in/out animations for RTL locales. Bug: 16463723 Change-Id: I526efec7795c891cbb4fa27776bb8be7d26ac114
Diffstat (limited to 'InCallUI')
-rw-r--r--InCallUI/src/com/android/incallui/InCallActivity.java20
1 files changed, 16 insertions, 4 deletions
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);