DynamicGrid

Drag and drop GridView for Android

  • Owner: askerov/DynamicGrid
  • Platform:
  • License:: Apache License 2.0
  • Category::
  • Topic:
  • Like:
    0
      Compare:

Github stars Tracking Chart

DynamicGrid

Drag and drop GridView for Android.

Depricated

It's much better to use solutions based on recycler view. For example https://github.com/h6ah4i/android-advancedrecyclerview

Demo

Requirements

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

Usage

All the same as for normal GridView. Adapter must extends
AbstractDynamicGridAdapter
or BaseDynamicGridAdapter

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

Or from onItemClik() and onItemLongClick()

gridView.startEditMode(position);

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 example here.

Credits

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

Main metrics

Overview
Name With Owneraskerov/DynamicGrid
Primary LanguageJava
Program languageJava (Language Count: 1)
Platform
License:Apache License 2.0
所有者活动
Created At2013-09-09 17:59:04
Pushed At2018-05-22 08:00:18
Last Commit At2016-02-16 12:12:16
Release Count0
用户参与
Stargazers Count0.9k
Watchers Count50
Fork Count284
Commits Count80
Has Issues Enabled
Issues Count71
Issue Open Count49
Pull Requests Count12
Pull Requests Open Count2
Pull Requests Close Count7
项目设置
Has Wiki Enabled
Is Archived
Is Fork
Is Locked
Is Mirror
Is Private