0

I want to display images into tiles like windows phone menu. We can do this using AsymmetricGridView library. But I want to display in single imageview not in GridView. Do like this into Single Imageview, enter image description here

Is it Possible to do like this into single view or imageview? if it is then suggest me how?

Yeldar Kurmangaliyev
  • 33,467
  • 12
  • 59
  • 101
Das
  • 141
  • 13

3 Answers3

2

refer this , it might help you
https://github.com/jacobmoncur/QuiltViewLibrary

Ravi
  • 34,851
  • 21
  • 122
  • 183
  • if i dont want to scroll it and only fix six, it can be possible?? – Das Sep 17 '15 at 06:41
  • i guess by removing "app:scrollOrientation="horizontal|vertical" , might be possible, but i am not sure, you can give a try – Ravi Sep 17 '15 at 06:46
2

for this purpose you can use AsymmetricGridView. An Android custom ListView that implements multiple columns and variable sized elements.Please note that this is currently in a preview state. This basically means that the API is not fixed and you should expect changes between releases. firstly Add lib from here:https://github.com/felipecsl/AsymmetricGridView. and then Add this in layout file:

<com.felipecsl.asymmetricgridview.library.widget.AsymmetricGridView
xmlns:android="http://schemas.android.com/apk/res/android"
android:id="@+id/listView"
android:layout_width="match_parent"
android:layout_height="match_parent"/>

and In your activity class:

 @Override
protected void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    setContentView(R.layout.activity_main);
    listView = (AsymmetricGridView) findViewById(R.id.listView);

    // Choose your own preferred column width
    listView.setRequestedColumnWidth(Utils.dpToPx(this, 120));
    final List<AsymmetricItem> items = new ArrayList<>();

    // initialize your items array
adapter = new ListAdapter(this, listView, items);
AsymmetricGridViewAdapter asymmetricAdapter =
        new AsymmetricGridViewAdapter<>(this, listView, adapter);
    listView.setAdapter(asymmetricAdapter);
}

Toggle to enable/disable reordering of elements to better fill the grid:

 // Setting to true will move items up and down to better use the space
// Defaults to false.
listView.setAllowReordering(true);
listView.isAllowReordering(); // true

enjoy your code:)

John smith
  • 1,781
  • 17
  • 27
-1

You can use StaggeredGrid or PinterestListView. Please visit below links:

https://github.com/etsy/AndroidStaggeredGrid

https://github.com/GDG-Korea/PinterestLikeAdapterView

https://github.com/vladexologija/PinterestListView

Sagar Zala
  • 4,854
  • 9
  • 34
  • 62