Search in sources :

Example 1 with SimpleScrollingStrategy

use of com.marshalchen.common.uimodule.cooldraganddrop.SimpleScrollingStrategy 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)

Aggregations

ActionBar (android.support.v7.app.ActionBar)1 ScrollView (android.widget.ScrollView)1 SimpleScrollingStrategy (com.marshalchen.common.uimodule.cooldraganddrop.SimpleScrollingStrategy)1