diff options
author | Tyler Gunn <tgunn@google.com> | 2015-10-13 20:10:38 +0000 |
---|---|---|
committer | Android Git Automerger <android-git-automerger@android.com> | 2015-10-13 20:10:38 +0000 |
commit | 47d933cb02f794b7bb3991d7d772e2314074c4a2 (patch) | |
tree | 0771f5880555aa6397523fe1ae7c17d41e44c067 | |
parent | ebc4a0ff768af67a392c1f173188a0b051d0e626 (diff) | |
parent | 2f311c7bbedd2200d8f91035303b0a359598ff7f (diff) |
am 2f311c7b: am ccf6c7a8: Correct issue where content of "All" and "Missed" tabs reversed in RTL.
* commit '2f311c7bbedd2200d8f91035303b0a359598ff7f':
Correct issue where content of "All" and "Missed" tabs reversed in RTL.
-rw-r--r-- | src/com/android/dialer/calllog/CallLogActivity.java | 15 |
1 files changed, 14 insertions, 1 deletions
diff --git a/src/com/android/dialer/calllog/CallLogActivity.java b/src/com/android/dialer/calllog/CallLogActivity.java index 1f6c49066..97e601630 100644 --- a/src/com/android/dialer/calllog/CallLogActivity.java +++ b/src/com/android/dialer/calllog/CallLogActivity.java @@ -39,6 +39,7 @@ import com.android.contacts.common.util.PermissionsUtil; import com.android.contacts.commonbind.analytics.AnalyticsUtil; import com.android.dialer.DialtactsActivity; import com.android.dialer.R; +import com.android.dialer.util.DialerUtils; import com.android.dialer.voicemail.VoicemailStatusHelper; import com.android.dialer.voicemail.VoicemailStatusHelperImpl; @@ -64,8 +65,13 @@ public class CallLogActivity extends Activity implements ViewPager.OnPageChangeL } @Override + public long getItemId(int position) { + return getRtlPosition(position); + } + + @Override public Fragment getItem(int position) { - switch (position) { + switch (getRtlPosition(position)) { case TAB_INDEX_ALL: return new CallLogFragment(CallLogQueryHandler.CALL_TYPE_ALL); case TAB_INDEX_MISSED: @@ -229,4 +235,11 @@ public class CallLogActivity extends Activity implements ViewPager.OnPageChangeL } return null; } + + private int getRtlPosition(int position) { + if (DialerUtils.isRtl()) { + return mViewPagerAdapter.getCount() - 1 - position; + } + return position; + } } |