'GridView'에 해당되는 글 1건

DynamicGrid

Drag and drop GridView for Android provide mechanism to reorder grid items

Demo

example

Requrements

Rearranging items require api 8 (Froyo). All grid item animations require api 11 (Honeycomb).

Usage

Usage same as for normal GridView except adapter. Adapter must extends AbstractDynamicGridAdapter orBaseDynamicGridAdapter

gridView = (DynamicGridView) findViewById(R.id.dynamic_grid);
// pass to adapter context, list of items and number of columns count
gridView.setAdapter(new MyDynamicGridAdapter(this, itemsList, 3));

To start Drag'n'drop mode:

gridView.startEditMode();

To stop:

gridView.stopEditMode();

Adding drop listener:

gridView.setOnDropListener(new DynamicGridView.OnDropListener(){
    @Override
    public void onActionDrop(){
        // stop edit mode immediately after drop item
        gridView.stopEditMode();
        }
    });

You can find more detailed usage examle here.

Credits

DynamicGridView based on Daniel Olshansky ListView cell dragging and rearranging video.


https://github.com/askerov/DynamicGrid

'IT > Android' 카테고리의 다른 글

android blindsview  (0) 2014.03.25
HeaderGridView  (0) 2014.03.25
회전목마 리스트  (0) 2014.03.20
라운드 이미지뷰  (0) 2014.03.18
리스트뷰 아이템 위치 바꾸기  (0) 2014.03.18
블로그 이미지

날기억해

Android / IOS / PHP / System Engineer / Service Architecture/ MongoDB / AWS / Mysql / Linux / Python / C++ / Vue.js / node.js / Java / Iot / BLE / Firebase / Bigdata Architecture / AD Server / SDK / Epub /

,