diff options
author | Treehugger Robot <treehugger-gerrit@google.com> | 2018-04-07 01:26:59 +0000 |
---|---|---|
committer | Gerrit Code Review <noreply-gerritcodereview@google.com> | 2018-04-07 01:26:59 +0000 |
commit | ce62c87e280ff90ef602b438bf9a5daec2a8b16d (patch) | |
tree | d610853faa402cbd3d6f0ce514ea0ed8b794c513 /java/com/android/dialer/app/list/DialtactsPagerAdapter.java | |
parent | 1ab138ae73314be6a54ee8d3aed18548f80be05e (diff) | |
parent | 7c4d9bb81e738698ff5fd2392c62b547190fc7d9 (diff) |
Merge changes I5e4a4ada,I792a6f03
* changes:
Convert new speed dial to support fragment and add it to new peer.
Only request focus on search edit text when it's slide down.
Diffstat (limited to 'java/com/android/dialer/app/list/DialtactsPagerAdapter.java')
-rw-r--r-- | java/com/android/dialer/app/list/DialtactsPagerAdapter.java | 24 |
1 files changed, 4 insertions, 20 deletions
diff --git a/java/com/android/dialer/app/list/DialtactsPagerAdapter.java b/java/com/android/dialer/app/list/DialtactsPagerAdapter.java index 364ae6fad..317f24fef 100644 --- a/java/com/android/dialer/app/list/DialtactsPagerAdapter.java +++ b/java/com/android/dialer/app/list/DialtactsPagerAdapter.java @@ -18,7 +18,6 @@ package com.android.dialer.app.list; import android.app.Fragment; import android.app.FragmentManager; -import android.content.Context; import android.support.annotation.IntDef; import android.support.v13.app.FragmentPagerAdapter; import android.view.ViewGroup; @@ -26,11 +25,9 @@ import com.android.dialer.app.calllog.CallLogFragment; import com.android.dialer.app.calllog.VisualVoicemailCallLogFragment; import com.android.dialer.common.Assert; import com.android.dialer.common.LogUtil; -import com.android.dialer.configprovider.ConfigProviderBindings; import com.android.dialer.contactsfragment.ContactsFragment; import com.android.dialer.contactsfragment.ContactsFragment.Header; import com.android.dialer.database.CallLogQueryHandler; -import com.android.dialer.speeddial.SpeedDialFragment; import com.android.dialer.util.ViewUtil; import java.lang.annotation.Retention; import java.lang.annotation.RetentionPolicy; @@ -55,9 +52,7 @@ public class DialtactsPagerAdapter extends FragmentPagerAdapter { private final List<Fragment> fragments = new ArrayList<>(); private final String[] tabTitles; - private final boolean useNewSpeedDialTab; private OldSpeedDialFragment oldSpeedDialFragment; - private SpeedDialFragment speedDialFragment; private CallLogFragment callLogFragment; private ContactsFragment contactsFragment; private CallLogFragment voicemailFragment; @@ -65,10 +60,8 @@ public class DialtactsPagerAdapter extends FragmentPagerAdapter { private boolean hasActiveVoicemailProvider; public DialtactsPagerAdapter( - Context context, FragmentManager fm, String[] tabTitles, boolean hasVoicemailProvider) { + FragmentManager fm, String[] tabTitles, boolean hasVoicemailProvider) { super(fm); - useNewSpeedDialTab = - ConfigProviderBindings.get(context).getBoolean("enable_new_favorites_tab", false); this.tabTitles = tabTitles; hasActiveVoicemailProvider = hasVoicemailProvider; fragments.addAll(Collections.nCopies(TAB_COUNT_WITH_VOICEMAIL, null)); @@ -84,17 +77,10 @@ public class DialtactsPagerAdapter extends FragmentPagerAdapter { LogUtil.d("ViewPagerAdapter.getItem", "position: %d", position); switch (getRtlPosition(position)) { case TAB_INDEX_SPEED_DIAL: - if (useNewSpeedDialTab) { - if (speedDialFragment == null) { - speedDialFragment = SpeedDialFragment.newInstance(); - } - return speedDialFragment; - } else { - if (oldSpeedDialFragment == null) { - oldSpeedDialFragment = new OldSpeedDialFragment(); - } - return oldSpeedDialFragment; + if (oldSpeedDialFragment == null) { + oldSpeedDialFragment = new OldSpeedDialFragment(); } + return oldSpeedDialFragment; case TAB_INDEX_HISTORY: if (callLogFragment == null) { callLogFragment = new CallLogFragment(CallLogQueryHandler.CALL_TYPE_ALL); @@ -128,8 +114,6 @@ public class DialtactsPagerAdapter extends FragmentPagerAdapter { final Fragment fragment = (Fragment) super.instantiateItem(container, position); if (fragment instanceof OldSpeedDialFragment) { oldSpeedDialFragment = (OldSpeedDialFragment) fragment; - } else if (fragment instanceof SpeedDialFragment) { - speedDialFragment = (SpeedDialFragment) fragment; } else if (fragment instanceof CallLogFragment && position == TAB_INDEX_HISTORY) { callLogFragment = (CallLogFragment) fragment; } else if (fragment instanceof ContactsFragment) { |