I am trying to change width of a view programmatically, but it doesn't work, nothing changes. This is the code: And in my fragment, I try this: ...
I am trying to change width of a view programmatically, but it doesn't work, nothing changes. This is the code: And in my fragment, I try this: ...
I have a set of 20 XML buttons that I need to access to programmatically change their margins based on a toggle. After heavy research and tons of fail ...
I'm facing this issue: I have recyclerview that shows images I've searched for but the items in recyclerview appears like their height is math_parent ...
I want to fit cells to TableRow, as I did it in the xml. like setting weight = 1. tried many solutions on the github, but don't know why non of them w ...
I'm trying to change the height and the width from fixed to match parent or wrap content when images are loaded into the recycler view https://stackov ...
EDIT 09.05.2021: In general, I would like to programatically adjust the LayoutParams of some Buttons depending on the display size of the smartphone ...
I want to make a method that computes the margin values based on the parent's height and width. The code below outputs -1 for both height and width. H ...
I got a problem when trying to update dynamically the layoutParams of a view. The view to update is a ConstraintLayout, and I want to dynamically cha ...
How can I loop this process? I want to shrink the size of a textview with each button click. It will work for one button click, but will not shrink fo ...
I'm adding new fragments dynamically to an existing fragment and I'm doing some calculation to infer the size of the new fragment. After getting the n ...
So I'm creating some CardViews inside a for loop and I want to add a Button to the bottom of each CardView. I'm setting the LayoutParams of the CardV ...
I am making an app that adds stickers on photos and i want to resize the sticker with a pinch gesture. I have a Frame Layout with an ImageView and ...
I have an application which shows floating overlay windows and it works fine. It uses WindowManager.LayoutParams.TYPE_PHONE for the windows however an ...
I noticed, that a TextView with the same textSize can have a different height depending on the String it is displaying. I disscovered it when paiting ...
I try to add a ConstraintLayout programmatically. It's working but WRAP_CONTENT isn't working. The Layout is always MATCH_PARENT. The Android Develop ...
I want to display a box with suggested entries next to an EditText. I figured I'd have to set LayoutParams (like suggested in this question. However, ...
I am trying to split a sentence into words and put the words into a RelativeLayout as TextViews, but when I set layoutparams to TextView, doesn't take ...
Thanks in advance :) Context I have a game that is running at ~120 FPS and it dynamically creates multiple imageviews that move around the screen. T ...
I have ConstraintLayout with WRAP_CONTENT height, in which i show/hide RecyclerView (or another ConstraintLayout) by changing it's height from 0 (MATC ...
I want to set margin to my main layout with programmatically. I use layout params as following code. val parMain = mainLayout?.layoutParams as Constr ...