summaryrefslogtreecommitdiff
path: root/src/com/android/dialer/list/ListsFragment.java
diff options
context:
space:
mode:
authorAndrew Lee <anwlee@google.com>2015-05-05 14:10:35 -0700
committerAndrew Lee <anwlee@google.com>2015-05-05 14:11:28 -0700
commitfdfeaaf4e5ae0277a03529e501eb1c562f769851 (patch)
treebcc7f5c25666f9f9ba0afe852832cceec37264fb /src/com/android/dialer/list/ListsFragment.java
parent7ea6420e790c4206f4cfa44ff22604536cebd5f7 (diff)
Change FAB icon and behavior for contacts tab.
+ Change the icon/behavior depending on the tab position. + Move current tab position logic from DialtactsActivity into the lists fragment. - Delete unused method, shift some helpers around. Bug: 19366434 Change-Id: I6da767300907b3afd006248afb882bebde7bdfe6
Diffstat (limited to 'src/com/android/dialer/list/ListsFragment.java')
-rw-r--r--src/com/android/dialer/list/ListsFragment.java11
1 files changed, 11 insertions, 0 deletions
diff --git a/src/com/android/dialer/list/ListsFragment.java b/src/com/android/dialer/list/ListsFragment.java
index f22a5d19c..f714e45c7 100644
--- a/src/com/android/dialer/list/ListsFragment.java
+++ b/src/com/android/dialer/list/ListsFragment.java
@@ -80,6 +80,11 @@ public class ListsFragment extends Fragment implements ViewPager.OnPageChangeLis
private int[] mTabIcons;
/**
+ * The position of the currently selected tab.
+ */
+ private int mTabPosition = TAB_INDEX_SPEED_DIAL;
+
+ /**
* Call shortcuts older than this date (persisted in shared preferences) will not show up in
* at the top of the screen
*/
@@ -226,6 +231,8 @@ public class ListsFragment extends Fragment implements ViewPager.OnPageChangeLis
@Override
public void onPageSelected(int position) {
+ mTabPosition = getRtlPosition(position);
+
final int count = mOnPageChangeListeners.size();
for (int i = 0; i < count; i++) {
mOnPageChangeListeners.get(i).onPageSelected(position);
@@ -241,6 +248,10 @@ public class ListsFragment extends Fragment implements ViewPager.OnPageChangeLis
}
}
+ public int getTabPosition() {
+ return mTabPosition;
+ }
+
public void showRemoveView(boolean show) {
mRemoveViewContent.setVisibility(show ? View.VISIBLE : View.GONE);
mRemoveView.setAlpha(show ? 0 : 1);