All Questions

Filter by
Sorted by
Tagged with
6 votes
3 answers
16k views

GridLayout in Kotlin?

I am trying to get a 2x6 (WxH) GridLayout in my Kotlin Android application. I have my xml and fragment / adapter set up for a RecyclerView but am a bit at a loss for as how to apply a GridLayout to ...
arcade16's user avatar
  • 1,535
6 votes
3 answers
3k views

How to center content of GridLayoutManager?

Just trying to center my RecyclerView horizontal. Here is the xml: <?xml version="1.0" encoding="utf-8"?> <RelativeLayout xmlns:android="http://schemas.android.com/...
Aaron Waller's user avatar
3 votes
1 answer
1k views

GridLayout vs. RecyclerView with GridLayoutManager

I am just starting with Android development and there are at least two ways to build a grid: using GridLayout or using a RecyclerView with a GridLayoutManager. Is there any case/reason still to use ...
me.at.coding's user avatar
  • 16.3k
3 votes
1 answer
320 views

Adding Dynamic Buttons to different layouts for phone and tablet using RecyclerView with GridLayoutManager

I am adding dynamic buttons to a layout. Each button is added one at a time, and the layout must update itself if new buttons were added based on a user's action. So the layout could have 3 buttons, ...
Natalie's user avatar
  • 315
3 votes
0 answers
483 views

RecyclerView Grid Layout Fit items to screen

I want to fit the items to the screen. When I have 4 four item I used this: recyclerView.layoutManager = GridLayoutManager(requireContext(), 2, RecyclerView.VERTICAL, false) And when I have 20 item ...
Abdulsamet Kılınçarslan's user avatar
2 votes
3 answers
7k views

Resizing and positioning RecyclerView items

I am using RecyclerView to show items in Grid layout. Below is the image of emulator and the desire results i need to achieve. Left side (executing) image is the output on my emulator, while Right ...
java bee's user avatar
  • 125
2 votes
4 answers
823 views

Android - GridLayoutManager - Load items in list vertically?

I have a list of let's say 20 items. I want to be able to load them like this 1 11 2 12 3 13 4 14 5 15 6 16 7 17 8 18 9 19 10 20 I'm using a RecyclerView with a GridLayoutManager Using ...
Dave's user avatar
  • 43
1 vote
1 answer
4k views

Align Items of RecyclerView in each row in android

I'm using RecyclerView with StaggeredGridLayoutManager to show tables of courses in my application, and that was OK, like the picture below: But, How can I adjust all Items of the second row to be ...
BOULOUZA NASSER's user avatar
1 vote
1 answer
1k views

RecycleView + grid with different image size

I would like to do something like the following image: As you can see, there's a gridlayout with two columns per row. Inside each column, there is an image (that should fit different depending on ...
Lechucico's user avatar
  • 1,944
1 vote
2 answers
2k views

Android RecyclerView GridLayout size issue

I am trying to achieve the following result. Expected Result Image And I am getting the following result. Actual Result Image can anyone guide me to achieve the expected results. I have shared my ...
JavaEnthusias's user avatar
1 vote
1 answer
1k views

How to autofit Recycler View items to its height and width with GridLayoutManager

I'm writing a calendar app, so I have 28-31 items to show. In the worst case, I will have 4 rows and 7 columns and in the best case, 5 rows and 7 columns. I'm using GridLayoutManager, so: ...
Eugene Korotkov's user avatar
1 vote
0 answers
64 views

Increasing column count in GridLayoutManager causing significant jank

My app allows user to increase column count to 5. When column is set to 1-4 there seems to be no jank. It is a Android gallery app using recyclerview and Glide. When column is set to 5 is when the ...
BigDX's user avatar
  • 3,529
1 vote
0 answers
565 views

GridLayout: How can the CardView "exceed" the boundaries of the Grid?

I have searched for days for the answer to this without any luck. Hopefully someone can point me in the right direction on what I should do, I'm not asking someone to write the code for me. Please do ...
Imran Hamid's user avatar
1 vote
1 answer
114 views

How to display progress bar during span size is changed in Recycler View GridLayout?

I am using RecyclerView with GridLayout to display products. I have a button which changes the span size when clicked. I have used gridLayoutManager.setSpanSizeLookup to dynamically change the span ...
Mirza Asad's user avatar
0 votes
1 answer
3k views

Changing number of columns with GridLayoutManager and RecyclerView for Auto Fit Screen

I'm using Recyclerview in fragment... Inside my fragment I'm setting my GridLayout in the following way: myTV.setLayoutManager(new GridLayoutManager(getActivity(),3)); code says,Only 3 columns for ...
Mr.Soft's user avatar
  • 143
0 votes
2 answers
1k views

Android RecyclerView column amount based on item width in GridLayout

I'd like to get similar effect with GridLayoutManager/adapter with RecyclerView like shown at the picture - columns amount does not depend on screen width, but on the item with (text width). So far I'...
Alice's user avatar
  • 91
0 votes
2 answers
2k views

Dynamic buttons added to a GridLayout using RecyclerView are added on top of each other

I want to add dynamic buttons to a grid layout as shown below. Each button is added one at a time, and the layout must update itself to have the buttons in rows. My problem is that when a new button ...
Natalie's user avatar
  • 315
0 votes
1 answer
464 views

How to implement horizontal & vertical chain type concept in recyclerview gridlayout?

As always I have read through several posts on this topic across this site. If this truly is duplication I will delete this question. Majority of cases on here are dealing with orientation changes or ...
UnknownError's user avatar
0 votes
1 answer
84 views

How to set vertical distance between cards in GridLayoutManager

I've simple card.xmllayout in which one image is presented, it's size is 300px x 300px. For displaying cards I've made Recycler View and RecyclerAdapter, and initialized all stuff to works in form of ...
amtrax's user avatar
  • 649
0 votes
2 answers
2k views

RecycleView using GridLayout

I got this exception using recyclingView in a Fragment: java.lang.NullPointerException at android.support.v7.widget.RecyclerView.onMeasure(RecyclerView.java:1764) at android.view.View....
Alfaplus's user avatar
  • 1,723
0 votes
0 answers
13 views

How to remove the space occupied by hidden items in a Recyclerview?

I have created a Recyclerview in which the functionality is on option selection of 1st question I have to show/hide the child question. But after hiding the item in adapter it is leaving the span ...
Kalpana Aneyrao's user avatar
0 votes
1 answer
379 views

got E/No adapter attached; skipping layout even when I attach a Layoutmanager and the adapter

I try to create a recyclerview for my gallery photo and video, I'm sur the data is correctly collected, an adapter is created and attached to my recycler view before the error. I created the ...
Clamore's user avatar
  • 25
0 votes
2 answers
69 views

Android Studio GridLayout reverse not working

I'm currently making a instagram type of app in Android Studio, my app only shows the newest pic at the bottom of the grid. The Collections.reverse(arrayList) is not working here's my main.java ...
Vinz Jose's user avatar
0 votes
2 answers
44 views

Android Studio Recycler View have gaps between the rows. Help me fix

I followed this tutorial on youtube for my school project. The app is able to display selected images from gallery but the recycler view have gaps in every row. What do I code to fix this app? help. ...
Vinz Jose's user avatar
0 votes
0 answers
30 views

how to disable button of one item when other item is clicked in a row in gridlayout

I want, that when the user click on the button of left item, certain function happens and the button on the right got disable, same vice versa with other button on the right. Videoview is inside the ...
Aditya Sharma's user avatar
0 votes
0 answers
274 views

Solved : Grid RecyclerView White Space After Adding Spacing with ItemDecorator

I have a 3 column grid recycle view, when I add space in between items using custom item decoration, some of the items in the recycler view get white space on them as in the picture. Decorator class ...
Sreehari K's user avatar
0 votes
0 answers
667 views

How can I dynamically set the span size of an Item from a recyclerView with GridLayoutManager?

I'm trying to show six items in a Recycler View using GridLayoutManager with span row count equals 2. But when I have a single item on a row, I want his width to be match parent (to cover the entire ...
Razvan Andrei's user avatar
0 votes
1 answer
483 views

RecyclerView GridLayoutManager is showing extra margin top and bottom

I am using Recycler View and GridLayoutManager and it is showing margin at the top and bottom of the image here is what I'm getting: onBindViewHolder: @Override public void onBindViewHolder(@...
Sheraz Tariq's user avatar
0 votes
0 answers
57 views

Android Recyclerview section creation/customization/layout change

Is there a way to create a recyclerview with sections that a fully customizable? I have found this library for creating sections inside recyclerview and that part works fine. But what I want is to ...
rimes's user avatar
  • 851
0 votes
0 answers
100 views

Showing a big margin between each row item in recyclerview with grid layout manager

I have the following XML which I inflate into a Recyclerview with a grid layout manager - <?xml version="1.0" encoding="utf-8"?> <LinearLayout xmlns:android="http://schemas.android.com/apk/...
Alon Shlider's user avatar
  • 1,258
0 votes
1 answer
127 views

The last item can't show when RecyclerView in GridLayout

I found that my last item in RecyclerView can't show when RecyclerView inside GridLayot. I try to remove GridLayot and just use RecyclerView, and it can show all items, but I can't use these solution ...
playground's user avatar
0 votes
2 answers
317 views

Problem with Switch buttons on RecyclerView

I'm kinda new to Android developing and I hope you can help me. I have one RecyclerView, with each cardview showing one image, two text views and one switch button. This app is for myself and I wanted ...
chuckles's user avatar
0 votes
1 answer
108 views

How do you center a gridlayout horizontally using recyclerview?

I am trying to center a gridlayout using recycler view. The code listed below is what I have attempted but it and messed around with, but wasn't really understanding how it worked. The icons show up ...
bjmcallister's user avatar
0 votes
1 answer
368 views

Android GridLayoutManager one background image for whole row

I am trying to make simple layout but can't get it work. Goal is to have activity which show (configurable) count of books like books on shelf. I have recycler view in main activity (so I can scroll ...
AmateurAndy's user avatar
0 votes
1 answer
1k views

How to maintain equal size of cardview items in a recyclerview without hard coding the size?

Image of list I wish to replicate. I am designing an app that displays a list similar to the one displayed in the image. I actually will be implementing 3 lists of the same kind stacked below each ...
Coolio Cena's user avatar
0 votes
1 answer
442 views

How to implement override getItem() method in FirebaseRecyclerAdapter correctly

I am retrieving data from firebase database using FirebaseRecyclerAdapter. I am using a GridLayout to display the data. My data is ordered by push() keys in firebase database, and I would like to ...
ben's user avatar
  • 159
0 votes
1 answer
63 views

Is there a way to hold a particular element of a recyclerview on the top?

I am using a recyclerView, with a GridLayoutManager layout. The recycler view contains 2 types on ViewHolders, one having span size equal to 3 in order to separate different types of grid elements ...
hamid's user avatar
  • 97
0 votes
1 answer
1k views

Using RecyclerView in Fragment that added in MainActivity, showing double items, items behind items

When scrolling down, it shows up grid items but behind items there are same items showing. Don't know why this happening. Using Custom adapter, Grid layout Manager. Here, I'm adding fragment in ...
Hassan M Ashraful's user avatar
0 votes
1 answer
42 views

Enlarge (pop) element in grid, not pushing the other Views

I would like to know if there is an easy way of having a grid of elements, where when one of the elements is pressed, This state: Changes, to reveal the touched element (center element here) For a ...
Krisztiaan's user avatar
0 votes
1 answer
306 views

Recyclerview with GridLayout. Add a divider only if date of next item differ

I have a RecyclerView with a GridLayout. My data is a List of ordered objects by date. I need to add a divider if next item has different date that current one. Here is my class: public class ...
Rainmaker's user avatar
  • 10.8k
-1 votes
1 answer
873 views

GridLayoutManager same background for each row

I have been trying this project in link. Everything is working fine. I got an output also. I would like to enhance it but I don't know what to do. I am having a background , I need to keep it as ...
Om Bala's user avatar
  • 169
-1 votes
1 answer
60 views

Android how to achieve this type of layout with rows and col span

Requirement: I should be able to scroll entire view if left view is visible or not (all components should scroll at a time if i scroll anywhere with in the view). By clicking on show/hide left view ...
Naresh Gunda's user avatar