diff options
author | Tyler Gunn <tgunn@google.com> | 2015-10-15 16:41:07 +0000 |
---|---|---|
committer | Android (Google) Code Review <android-gerrit@google.com> | 2015-10-15 16:41:07 +0000 |
commit | 4999105796f54c3eb77b5e3daad5135d8d42536a (patch) | |
tree | 0a17f08e313a2b2fdd03052e191004f3532eea65 | |
parent | 8f1be9edcd49f2ee4dbff6fca640628beef18d58 (diff) | |
parent | 4622b61cdf304cdfba278b9c5fa1bc76979dae6d (diff) |
Merge "DO NOT MERGE Correct issue where content of "All" and "Missed" tabs reversed in RTL." into ub-contactsdialer-a-dev
-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 2bcd8d492..c1923b2e4 100644 --- a/src/com/android/dialer/calllog/CallLogActivity.java +++ b/src/com/android/dialer/calllog/CallLogActivity.java @@ -40,6 +40,7 @@ import com.android.contacts.commonbind.analytics.AnalyticsUtil; import com.android.dialer.DialtactsActivity; import com.android.dialer.R; import com.android.dialer.TransactionSafeActivity; +import com.android.dialer.util.DialerUtils; public class CallLogActivity extends TransactionSafeActivity implements ViewPager.OnPageChangeListener { private ViewPager mViewPager; @@ -63,8 +64,13 @@ public class CallLogActivity extends TransactionSafeActivity implements ViewPage } @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, true /* isCallLogActivity */); @@ -233,4 +239,11 @@ public class CallLogActivity extends TransactionSafeActivity implements ViewPage } return null; } + + private int getRtlPosition(int position) { + if (DialerUtils.isRtl()) { + return mViewPagerAdapter.getCount() - 1 - position; + } + return position; + } } |