From 4622b61cdf304cdfba278b9c5fa1bc76979dae6d Mon Sep 17 00:00:00 2001 From: Tyler Gunn Date: Mon, 12 Oct 2015 16:50:59 -0700 Subject: 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 --- src/com/android/dialer/calllog/CallLogActivity.java | 15 ++++++++++++++- 1 file changed, 14 insertions(+), 1 deletion(-) (limited to 'src') 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; @@ -62,9 +63,14 @@ public class CallLogActivity extends TransactionSafeActivity implements ViewPage super(fm); } + @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; + } } -- cgit v1.2.3