Comments (4)
Never mind. Found a solution to do this.
from asymmetricgridview.
How did you do?
from asymmetricgridview.
@gayathri-nair03 What is the solution?
from asymmetricgridview.
@gonzalomelov & @rayray - I did not reference this library, instead copied all reqd files into my project, so that I could edit some lines of code, as required. U might also try extending the existing classes, for the same requirement. Anyway, here's how I did it.
- Go to class AsymmetricGridViewAdapter
- Method - getView()
- Towards the end of this method, there is a line of code setting the view's layout params. Something like this:
view.setLayoutParams(new LinearLayout.LayoutParams(getRowWidth(currentItem.getItem()),
getRowHeight(currentItem.getItem())));
If you observe, here the row height is being set to one particular value - getRowHeight(). - You can change this row height to a px value of your own, as I did -
//START - Gayatri - Added for specifying row heights
if (currentItem.getItem().getRowSpan() == 1) {
view.setLayoutParams(
new LinearLayout.LayoutParams(getRowWidth(currentItem.getItem()),
context.getResources()
.getDimensionPixelSize(
R.dimen.photo_grid_height)));
} else {
view.setLayoutParams(
new LinearLayout.LayoutParams(getRowWidth(currentItem.getItem()),
context.getResources()
.getDimensionPixelSize(
R.dimen.hor_photo_height)));
}
//Added block ends here
P.S - I see that this library has undergone a refactoring now, with support for Recycler View. I have worked with the previous version.
Hope this helps.
from asymmetricgridview.
Related Issues (20)
- Simple example for adding images
- Get rid of ListView HOT 1
- setEnabled , setclickable HOT 2
- function setEnabled
- java.lang.Integer cannot be cast to com.felipecsl.asymmetricgridview.library.model.AsymmetricItem HOT 3
- notify adapter
- setOnClickListener don't work! HOT 1
- Dynamic resizing of elements in a grid HOT 1
- Can someone give a simple snippet code with a custom adapter, document seems to be so complex with little to no explanation HOT 1
- Recycler view Endless Scroll for pagination, How should I do? HOT 1
- scrollToPosition() scrollTo() restoreInstanceState() do not scroll and keep recycler at the top
- AssymetricRecyclerView : some cells configuration are not allowed
- 上拉的问题 HOT 1
- notifyItemRangeInserted is not working
- Can't Access RecyclerViewAdapter
- Nested Scrolling is not Working?
- Update readme HOT 2
- Can't make it work as sample app is outdated HOT 1
- Drag & drop feature support HOT 1
- A HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from asymmetricgridview.