diff options
Diffstat (limited to 'java/com/android/incallui/incall/impl/InCallFragment.java')
-rw-r--r-- | java/com/android/incallui/incall/impl/InCallFragment.java | 29 |
1 files changed, 12 insertions, 17 deletions
diff --git a/java/com/android/incallui/incall/impl/InCallFragment.java b/java/com/android/incallui/incall/impl/InCallFragment.java index 02e9b4add..b6ae4902a 100644 --- a/java/com/android/incallui/incall/impl/InCallFragment.java +++ b/java/com/android/incallui/incall/impl/InCallFragment.java @@ -25,9 +25,11 @@ import android.os.Bundle; import android.os.Handler; import android.support.annotation.NonNull; import android.support.annotation.Nullable; +import android.support.design.widget.TabLayout; import android.support.v4.app.Fragment; import android.support.v4.app.FragmentTransaction; import android.support.v4.content.ContextCompat; +import android.support.v4.view.ViewPager; import android.telecom.CallAudioState; import android.telephony.TelephonyManager; import android.view.LayoutInflater; @@ -72,8 +74,8 @@ public class InCallFragment extends Fragment private List<ButtonController> buttonControllers = new ArrayList<>(); private View endCallButton; - private InCallPaginator paginator; - private LockableViewPager pager; + private TabLayout tabLayout; + private ViewPager pager; private InCallPagerAdapter adapter; private ContactGridManager contactGridManager; private InCallScreenDelegate inCallScreenDelegate; @@ -132,8 +134,8 @@ public class InCallFragment extends Fragment getResources().getDimensionPixelSize(R.dimen.incall_avatar_size), true /* showAnonymousAvatar */); - paginator = (InCallPaginator) view.findViewById(R.id.incall_paginator); - pager = (LockableViewPager) view.findViewById(R.id.incall_pager); + tabLayout = (TabLayout) view.findViewById(R.id.incall_tab_dots); + pager = (ViewPager) view.findViewById(R.id.incall_pager); endCallButton = view.findViewById(R.id.incall_end_call); endCallButton.setOnClickListener(this); @@ -246,8 +248,8 @@ public class InCallFragment extends Fragment } if (adapter.getCount() > 1) { - paginator.setVisibility(View.VISIBLE); - paginator.setupWithViewPager(pager); + tabLayout.setVisibility(pager.getVisibility()); + tabLayout.setupWithViewPager(pager, true); if (!stateRestored) { new Handler() .postDelayed( @@ -261,9 +263,9 @@ public class InCallFragment extends Fragment } }, 2000); - } else { - paginator.setVisibility(View.GONE); } + } else { + tabLayout.setVisibility(View.GONE); } } @@ -426,15 +428,8 @@ public class InCallFragment extends Fragment int visibility = numVisibleButtons == 0 ? View.GONE : View.VISIBLE; pager.setVisibility(visibility); - if (adapter != null - && adapter.getCount() > 1 - && getResources().getInteger(R.integer.incall_num_rows) > 1) { - paginator.setVisibility(View.VISIBLE); - pager.setSwipingLocked(false); - } else { - paginator.setVisibility(View.GONE); - pager.setSwipingLocked(true); - pager.setCurrentItem(adapter.getButtonGridPosition()); + if (adapter != null && adapter.getCount() > 1) { + tabLayout.setVisibility(visibility); } } |