use of android.widget.HorizontalScrollView in project Resurrection_packages_apps_Settings by ResurrectionRemix.
the class PagerSlidingTabStrip method onLayout.
@Override
protected void onLayout(boolean changed, int l, int t, int r, int b) {
if (isPaddingMiddle && mTabsContainer.getChildCount() > 0) {
View view = mTabsContainer.getChildAt(0);
int halfWidthFirstTab = view.getMeasuredWidth() / 2;
mPaddingLeft = mPaddingRight = getWidth() / 2 - halfWidthFirstTab;
}
if (isPaddingMiddle || mPaddingLeft > 0 || mPaddingRight > 0) {
int width;
if (isPaddingMiddle) {
width = getWidth();
} else {
// Account for manually set padding for offsetting tab start and end positions.
width = getWidth() - mPaddingLeft - mPaddingRight;
}
//Make sure tabContainer is bigger than the HorizontalScrollView to be able to scroll
mTabsContainer.setMinimumWidth(width);
//Clipping padding to false to see the tabs while we pass them swiping
setClipToPadding(false);
}
setPadding(mPaddingLeft, getPaddingTop(), mPaddingRight, getPaddingBottom());
if (mScrollOffset == 0) {
mScrollOffset = getWidth() / 2 - mPaddingLeft;
}
if (mPager != null) {
mCurrentPosition = mPager.getCurrentItem();
}
mCurrentPositionOffset = 0f;
scrollToChild(mCurrentPosition, 0);
updateSelection(mCurrentPosition);
super.onLayout(changed, l, t, r, b);
}
use of android.widget.HorizontalScrollView in project RecyclerViewAnimator by dkmeteor.
the class PullToRefreshHorizontalScrollView method createRefreshableView.
@Override
protected HorizontalScrollView createRefreshableView(Context context, AttributeSet attrs) {
HorizontalScrollView scrollView;
if (VERSION.SDK_INT >= VERSION_CODES.GINGERBREAD) {
scrollView = new InternalHorizontalScrollViewSDK9(context, attrs);
} else {
scrollView = new HorizontalScrollView(context, attrs);
}
scrollView.setId(R.id.scrollview);
return scrollView;
}
Aggregations