Search in sources :

Example 6 with HorizontalScrollView

use of android.widget.HorizontalScrollView in project xdroid by shamanland.

the class HorizontalSpinner method onFinishInflate.

@Override
protected void onFinishInflate() {
    super.onFinishInflate();
    mLinearLayout = new LinearLayout(getContext());
    mLinearLayout.setOrientation(LinearLayout.HORIZONTAL);
    mScrollView = new HorizontalScrollView(getContext());
    mScrollView.addView(mLinearLayout, new ViewGroup.LayoutParams(ViewGroup.LayoutParams.WRAP_CONTENT, ViewGroup.LayoutParams.WRAP_CONTENT));
    mScrollView.setHorizontalScrollBarEnabled(isHorizontalScrollBarEnabled());
    addView(mScrollView, new ViewGroup.LayoutParams(ViewGroup.LayoutParams.MATCH_PARENT, ViewGroup.LayoutParams.WRAP_CONTENT));
    updateState();
}
Also used : ViewGroup(android.view.ViewGroup) HorizontalScrollView(android.widget.HorizontalScrollView) LinearLayout(android.widget.LinearLayout)

Example 7 with HorizontalScrollView

use of android.widget.HorizontalScrollView in project PullToRefresh-PinnedSection-ListView by tongcpp.

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)

Example 8 with HorizontalScrollView

use of android.widget.HorizontalScrollView in project StaggeredGridView by bulletnoid.

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)

Example 9 with HorizontalScrollView

use of android.widget.HorizontalScrollView in project Launcher3 by chislon.

the class WallpaperPickerActivity method initializeScrollForRtl.

private void initializeScrollForRtl() {
    final HorizontalScrollView scroll = (HorizontalScrollView) findViewById(R.id.wallpaper_scroll_container);
    if (scroll.getLayoutDirection() == View.LAYOUT_DIRECTION_RTL) {
        final ViewTreeObserver observer = scroll.getViewTreeObserver();
        observer.addOnGlobalLayoutListener(new OnGlobalLayoutListener() {

            public void onGlobalLayout() {
                LinearLayout masterWallpaperList = (LinearLayout) findViewById(R.id.master_wallpaper_list);
                scroll.scrollTo(masterWallpaperList.getWidth(), 0);
                scroll.getViewTreeObserver().removeOnGlobalLayoutListener(this);
            }
        });
    }
}
Also used : OnGlobalLayoutListener(android.view.ViewTreeObserver.OnGlobalLayoutListener) HorizontalScrollView(android.widget.HorizontalScrollView) ViewTreeObserver(android.view.ViewTreeObserver) LinearLayout(android.widget.LinearLayout)

Example 10 with HorizontalScrollView

use of android.widget.HorizontalScrollView in project stetho by facebook.

the class AccessibilityUtil method isTopLevelScrollItem.

/**
   * Determines whether the provided {@link View} and {@link AccessibilityNodeInfoCompat} is a
   * top-level item in a scrollable container.
   *
   * @param view The {@link View} to evaluate
   * @param node The {@link AccessibilityNodeInfoCompat} to evaluate
   * @return {@code true} if it is a top-level item in a scrollable container.
   */
public static boolean isTopLevelScrollItem(@Nullable AccessibilityNodeInfoCompat node, @Nullable View view) {
    if (node == null || view == null) {
        return false;
    }
    View parent = (View) ViewCompat.getParentForAccessibility(view);
    if (parent == null) {
        return false;
    }
    if (node.isScrollable()) {
        return true;
    }
    List actionList = node.getActionList();
    if (actionList.contains(AccessibilityNodeInfoCompat.ACTION_SCROLL_FORWARD) || actionList.contains(AccessibilityNodeInfoCompat.ACTION_SCROLL_BACKWARD)) {
        return true;
    }
    // containers, but Spinner is a special case.
    if (parent instanceof Spinner) {
        return false;
    }
    return parent instanceof AdapterView || parent instanceof ScrollView || parent instanceof HorizontalScrollView;
}
Also used : HorizontalScrollView(android.widget.HorizontalScrollView) ScrollView(android.widget.ScrollView) Spinner(android.widget.Spinner) List(java.util.List) AdapterView(android.widget.AdapterView) HorizontalScrollView(android.widget.HorizontalScrollView) ScrollView(android.widget.ScrollView) View(android.view.View) AdapterView(android.widget.AdapterView) 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