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();
}
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;
}
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;
}
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);
}
});
}
}
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;
}
Aggregations