diff options
author | Tyler Gunn <tgunn@google.com> | 2015-10-12 16:50:59 -0700 |
---|---|---|
committer | Tyler Gunn <tgunn@google.com> | 2015-10-13 16:24:25 -0700 |
commit | 4622b61cdf304cdfba278b9c5fa1bc76979dae6d (patch) | |
tree | 3c54fdc7916c0649b7daf109d9fe9902ef55946f /src/com/android/dialer/calllog | |
parent | c8a187e5fc4c6d9de1fba451801805414f84fa6d (diff) |
DO NOT MERGE Correct issue where content of "All" and "Missed" tabs reversed in RTL.
Root cause of issue was that the tab indexes were not reversed in RTL mode.
Made a similar change as was made in ListsFragment.
Bug: 24690256
Change-Id: Ifa7ae1127298aa098dd8201b4d1e095baa3c14e8
Diffstat (limited to 'src/com/android/dialer/calllog')
-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; + } } |