felipecsl / AsymmetricGridView

Android ListView that mimics a GridView with asymmetric items. Supports items with row span and column span
http://felipecsl.com/AsymmetricGridView
MIT License
1.84k stars 431 forks source link

erorr in "adapter" #63

Closed hoAlimoradi closed 7 years ago

hoAlimoradi commented 7 years ago

I cant use AsymmetricGridView library becuase found erorr in "adapter" , how to declear it? can you send me sample project ?

hadidez commented 7 years ago

same problem.

felipecsl commented 7 years ago

Please share more details about your problem. What "error" are you seeing? "How to declare" what? The sample project is in the repository, you can browse it and run the sample app yourself.

hoAlimoradi commented 7 years ago

I mean this line : adapter = new ListAdapter(this, listView, items); please help me

urieluvd commented 5 years ago

I know this is old but i'll clarify it just in case someone finds it useful. ListAdapter is an interface. So, this line adapter = new ListAdapter(this, listView, items); means that you must instantiate your custom adapter that implements ListAdapter

Just like some adapters extens other classes like:

public class MyCustomViewPagerAdapter extends EnchantedViewPagerAdapter{ }

you should declare your adapter and use it in that instantiation.

public class MyCustomGalleryListAdapter implements ListAdapter {
    private Context myContext;
    private AsymmetricGridView listView;
    private ArrayList<AsymmetricItem> myElements;

   public(Context myContext,  AsymmetricGridView  listView, ArrayList<AsymmetricItem> myElements){
      this.myContext = myContext;
      this.listView = listView;
      this.myElements = myElements;
   }

   // All other interface methods and implementations

}

And then adapter = new MyCustomGalleryListAdapter(this, listView, items);