diff options
author | Tyler Gunn <tgunn@google.com> | 2014-08-12 22:39:20 +0000 |
---|---|---|
committer | Android (Google) Code Review <android-gerrit@google.com> | 2014-08-12 20:55:12 +0000 |
commit | cf1c6b805796866e4c84ca52ca00b77bd0785200 (patch) | |
tree | 4c7d1c17805edc5cf6881e7e53c687c8e899d16f | |
parent | 531d1de3e0a80685bf6aeea626defdf989f32e6d (diff) | |
parent | 434e1a05ca5578f517058f39999b34db504b33c2 (diff) |
Merge "Correcting dialpad animations in landscape (2/3)." into lmp-dev
-rw-r--r-- | InCallUI/src/com/android/incallui/InCallActivity.java | 20 |
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 51fbce7f4..1f7db588c 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. */ @@ -120,10 +123,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); |