Search in sources :

Example 26 with ScrollView

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);
}
Also used : LayoutParams(android.view.ViewGroup.LayoutParams) ScrollView(android.widget.ScrollView) FrameLayout(android.widget.FrameLayout) SwipeRefreshLayout(android.support.v4.widget.SwipeRefreshLayout) ScrollView(android.widget.ScrollView) View(android.view.View) MotionEvent(android.view.MotionEvent)

Example 27 with ScrollView

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);
}
Also used : ScrollView(android.widget.ScrollView) SimpleScrollingStrategy(com.marshalchen.common.uimodule.cooldraganddrop.SimpleScrollingStrategy) ActionBar(android.support.v7.app.ActionBar)

Example 28 with ScrollView

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);
}
Also used : ScrollView(android.widget.ScrollView) TextWatcher(android.text.TextWatcher) Editable(android.text.Editable) Paint(android.graphics.Paint)

Example 29 with ScrollView

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

Example 30 with ScrollView

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

Aggregations

ScrollView (android.widget.ScrollView)366 View (android.view.View)173 TextView (android.widget.TextView)148 LinearLayout (android.widget.LinearLayout)93 ImageView (android.widget.ImageView)65 ViewGroup (android.view.ViewGroup)53 Button (android.widget.Button)36 EditText (android.widget.EditText)36 ListView (android.widget.ListView)29 AbsListView (android.widget.AbsListView)27 RecyclerView (android.support.v7.widget.RecyclerView)25 Intent (android.content.Intent)24 AdapterView (android.widget.AdapterView)24 GridLayout (android.widget.GridLayout)24 WebView (android.webkit.WebView)22 SuppressLint (android.annotation.SuppressLint)21 ArrayList (java.util.ArrayList)21 FrameLayout (android.widget.FrameLayout)19 Dialog (android.app.Dialog)16 DialogInterface (android.content.DialogInterface)16