Loading src/com/android/contacts/common/list/ViewPagerTabs.java +14 −2 Original line number Diff line number Diff line Loading @@ -219,8 +219,9 @@ public class ViewPagerTabs extends HorizontalScrollView implements ViewPager.OnP tabView.setOnLongClickListener(new OnTabLongClickListener(position)); tabView.setPadding(mSidePadding, 0, mSidePadding, 0); mTabStrip.addView(tabView, new LinearLayout.LayoutParams(LayoutParams.WRAP_CONTENT, LayoutParams.MATCH_PARENT, 1)); mTabStrip.addView(tabView, position, new LinearLayout.LayoutParams( LayoutParams.WRAP_CONTENT, LayoutParams.MATCH_PARENT, 1)); // Default to the first child being selected if (position == 0) { Loading @@ -229,6 +230,17 @@ public class ViewPagerTabs extends HorizontalScrollView implements ViewPager.OnP } } /** * Refresh a tab at a certain index by removing it and reconstructing it. * * @param index The index of the tab view we wish to update. */ public void updateTab(int index) { View view = mTabStrip.getChildAt(index); mTabStrip.removeView(view); addTab(mPager.getAdapter().getPageTitle(index), index); } @Override public void onPageScrolled(int position, float positionOffset, int positionOffsetPixels) { position = getRtlPosition(position); Loading Loading
src/com/android/contacts/common/list/ViewPagerTabs.java +14 −2 Original line number Diff line number Diff line Loading @@ -219,8 +219,9 @@ public class ViewPagerTabs extends HorizontalScrollView implements ViewPager.OnP tabView.setOnLongClickListener(new OnTabLongClickListener(position)); tabView.setPadding(mSidePadding, 0, mSidePadding, 0); mTabStrip.addView(tabView, new LinearLayout.LayoutParams(LayoutParams.WRAP_CONTENT, LayoutParams.MATCH_PARENT, 1)); mTabStrip.addView(tabView, position, new LinearLayout.LayoutParams( LayoutParams.WRAP_CONTENT, LayoutParams.MATCH_PARENT, 1)); // Default to the first child being selected if (position == 0) { Loading @@ -229,6 +230,17 @@ public class ViewPagerTabs extends HorizontalScrollView implements ViewPager.OnP } } /** * Refresh a tab at a certain index by removing it and reconstructing it. * * @param index The index of the tab view we wish to update. */ public void updateTab(int index) { View view = mTabStrip.getChildAt(index); mTabStrip.removeView(view); addTab(mPager.getAdapter().getPageTitle(index), index); } @Override public void onPageScrolled(int position, float positionOffset, int positionOffsetPixels) { position = getRtlPosition(position); Loading