Search in sources :

Example 16 with HorizontalScrollView

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);
}
Also used : HorizontalScrollView(android.widget.HorizontalScrollView) View(android.view.View) TextView(android.widget.TextView) SuppressLint(android.annotation.SuppressLint) Paint(android.graphics.Paint)

Example 17 with HorizontalScrollView

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;
}
Also used : HorizontalScrollView(android.widget.HorizontalScrollView)

Aggregations

HorizontalScrollView (android.widget.HorizontalScrollView)17 View (android.view.View)6 LinearLayout (android.widget.LinearLayout)6 TextView (android.widget.TextView)6 ImageView (android.widget.ImageView)3 ScrollView (android.widget.ScrollView)3 LayoutParams (android.widget.LinearLayout.LayoutParams)2 SuppressLint (android.annotation.SuppressLint)1 Paint (android.graphics.Paint)1 Callback (android.os.Handler.Callback)1 Message (android.os.Message)1 KeyEvent (android.view.KeyEvent)1 ViewGroup (android.view.ViewGroup)1 ViewTreeObserver (android.view.ViewTreeObserver)1 OnGlobalLayoutListener (android.view.ViewTreeObserver.OnGlobalLayoutListener)1 AdapterView (android.widget.AdapterView)1 EditText (android.widget.EditText)1 FrameLayout (android.widget.FrameLayout)1 Spinner (android.widget.Spinner)1 CustomPlatform (cn.sharesdk.framework.CustomPlatform)1