use of android.widget.ScrollView in project RxBinding by JakeWharton.
the class RxSwipeRefreshLayoutTestActivity method onCreate.
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
swipeRefreshLayout = new SwipeRefreshLayout(this);
swipeRefreshLayout.setId(R.id.swipe_refresh_layout);
swipeRefreshLayout.setOnTouchListener(new View.OnTouchListener() {
@Override
public boolean onTouch(View v, MotionEvent event) {
if (MotionEventCompat.getActionMasked(event) == MotionEvent.ACTION_UP) {
handler.removeCallbacks(stopRefreshing);
handler.postDelayed(stopRefreshing, 300);
}
return false;
}
});
ScrollView scrollView = new ScrollView(this);
LayoutParams scrollParams = new LayoutParams(MATCH_PARENT, MATCH_PARENT);
swipeRefreshLayout.addView(scrollView, scrollParams);
FrameLayout emptyView = new FrameLayout(this);
LayoutParams emptyParams = new LayoutParams(MATCH_PARENT, 100000);
scrollView.addView(emptyView, emptyParams);
setContentView(swipeRefreshLayout);
}
use of android.widget.ScrollView in project UltimateAndroid by cymcsg.
the class CoolDragAndDropActivity method onCreate.
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.cooldrag_drop_activity);
ActionBar actionBar = getSupportActionBar();
actionBar.setDisplayHomeAsUpEnabled(true);
ScrollView scrollView = (ScrollView) findViewById(R.id.scrollView);
mCoolDragAndDropGridView = (CoolDragAndDropGridView) findViewById(R.id.coolDragAndDropGridView);
for (int r = 0; r < 2; r++) {
mItems.add(new Item(R.drawable.cool_drag_drop_ic_local_search_airport_highlighted, 1, "Airport", "Heathrow"));
mItems.add(new Item(R.drawable.cool_drag_drop_ic_local_search_bar_highlighted, 2, "Bar", "Connaught Bar"));
mItems.add(new Item(R.drawable.cool_drag_drop_ic_local_search_drink_highlighted, 2, "Drink", "Tequila"));
mItems.add(new Item(R.drawable.cool_drag_drop_ic_local_search_eat_highlighted, 2, "Eat", "Sliced Steaks"));
mItems.add(new Item(R.drawable.cool_drag_drop_ic_local_search_florist_highlighted, 1, "Florist", "Roses"));
mItems.add(new Item(R.drawable.cool_drag_drop_ic_local_search_gas_station_highlighted, 3, "Gas station", "QuickChek"));
mItems.add(new Item(R.drawable.cool_drag_drop_ic_local_search_general_highlighted, 1, "General", "Service Station"));
mItems.add(new Item(R.drawable.cool_drag_drop_ic_local_search_grocery_store_highlighted, 1, "Grocery", "E-Z-Mart"));
mItems.add(new Item(R.drawable.cool_drag_drop_ic_local_search_pizza_highlighted, 1, "Pizza", "Pizza Hut"));
mItems.add(new Item(R.drawable.cool_drag_drop_ic_local_search_post_office_highlighted, 2, "Post office", "USPS"));
mItems.add(new Item(R.drawable.cool_drag_drop_ic_local_search_see_highlighted, 2, "See", "Tower Bridge"));
mItems.add(new Item(R.drawable.cool_drag_drop_ic_local_search_shipping_service_highlighted, 3, "Shipping service", "Celio*"));
}
mItemAdapter = new ItemAdapter(this, mItems);
mCoolDragAndDropGridView.setAdapter(mItemAdapter);
mCoolDragAndDropGridView.setScrollingStrategy(new SimpleScrollingStrategy(scrollView));
mCoolDragAndDropGridView.setDragAndDropListener(this);
mCoolDragAndDropGridView.setOnItemLongClickListener(this);
}
use of android.widget.ScrollView in project UltimateAndroid by cymcsg.
the class MarqueeView method initView.
private void initView(Context context) {
// Scroll View
LayoutParams sv1lp = new LayoutParams(LayoutParams.MATCH_PARENT, LayoutParams.WRAP_CONTENT);
sv1lp.gravity = Gravity.CENTER_HORIZONTAL;
mScrollView = new ScrollView(context);
// Scroll View 1 - Text Field
mTextField = (TextView) getChildAt(0);
removeView(mTextField);
mScrollView.addView(mTextField, new ScrollView.LayoutParams(TEXTVIEW_VIRTUAL_WIDTH, LayoutParams.WRAP_CONTENT));
mTextField.addTextChangedListener(new TextWatcher() {
@Override
public void beforeTextChanged(CharSequence charSequence, int i, int i2, int i3) {
}
@Override
public void onTextChanged(CharSequence charSequence, int i, int i2, int i3) {
}
@Override
public void afterTextChanged(Editable editable) {
final boolean continueAnimation = mStarted;
reset();
prepareAnimation();
cutTextView();
post(new Runnable() {
@Override
public void run() {
if (continueAnimation) {
startMarquee();
}
}
});
}
});
addView(mScrollView, sv1lp);
}
use of android.widget.ScrollView in project android_frameworks_base by DirtyUnicorns.
the class DpiTestActivity method scrollWrap.
private View scrollWrap(View view) {
ScrollView scroller = new ScrollView(this);
scroller.addView(view, new ScrollView.LayoutParams(ScrollView.LayoutParams.MATCH_PARENT, ScrollView.LayoutParams.MATCH_PARENT));
return scroller;
}
use of android.widget.ScrollView in project android_frameworks_base by DirtyUnicorns.
the class ActivityTestMain method scrollWrap.
private View scrollWrap(View view) {
ScrollView scroller = new ScrollView(this);
scroller.addView(view, new ScrollView.LayoutParams(ScrollView.LayoutParams.MATCH_PARENT, ScrollView.LayoutParams.MATCH_PARENT));
return scroller;
}
Aggregations