Linked Questions

0 votes
1 answer
1k views

I am building an activity that shows two horizontal scroll views. The top one holds large images while the lower one holds the thumbnails of those images. When the user clicks on a thumbnail the upper ...
Pankaj Agarwal's user avatar
-1 votes
4 answers
615 views

First, I know this is a duplicate of other question but I couldn't manage to fix it so I created my own question for help. I am trying to get the RelativeLayout width, it was successful at first but I ...
Guy Balas's user avatar
1 vote
2 answers
917 views

I would like to get position X or Y of view (ie button) programmatically but in solutions from link (https://blog.takescoop.com/android-view-measurement-d1f2f5c98f75) returned values are wrong. I ...
John Johnson's user avatar
0 votes
1 answer
829 views

I'm using data binding to setup a RecyclerView. Here is the binding adapter: fun setRecyclerDevices(recyclerView: RecyclerView, items: List<Device>, itemBinder: MultipleTypeItemBinder, ...
jaumard's user avatar
  • 8,322
1 vote
2 answers
771 views

I have a few buttons with different text length. I'd like to make all buttons equal to the button with the longest text. Their width is android:layout_width="wrap_content" So the buttons have ...
Niaz's user avatar
  • 564
0 votes
2 answers
773 views

Here's my code: val inflater = LayoutInflater.from(this) val popupView = inflater.inflate(R.layout.small_player, null) val popupWindow = PopupWindow(popupView, ViewGroup.LayoutParams.MATCH_PARENT, ...
Filippo's user avatar
  • 294
0 votes
1 answer
716 views

I want to place spinning wheel progress bar at (x, y) location in relative layout. To do that, I have to know the size of progress bar. How do I know size of progress bar? Is there better way than ...
user1301568's user avatar
  • 2,153
1 vote
1 answer
715 views

I need to know the size of a Button (or any other view). But none of the procedures in lifecycle (onCreate, onStart, OnResume) seem to know it, as the Button seems not yet to be initialized! ... ...
Aquaball's user avatar
  • 111
2 votes
1 answer
520 views

In my application i have gridview in linearlayout. Due to different sizes of screen, i want to calculate the width of the gridview's container (which in linearlayout) and then i will decide, how many ...
abidkhan303's user avatar
  • 1,791
0 votes
1 answer
493 views

I created two short methods to help me to show or hide a view when a certain checkbox is checked. I have a Init method, in which I initialize a checkbox and a view, and a toggle method that is called ...
Beppi's's user avatar
  • 2,129
2 votes
1 answer
629 views

Based on answers in SOF, like this I have tried to measure the view late enough (onPreDraw) unlike the question opener in the above question link. I have this code: ViewTreeObserver ...
Elad Benda's user avatar
  • 36.9k
0 votes
1 answer
410 views

How i can get Width or Height of a View in Android ? when using getWidth() getHeight() methods they are returning 0 and another sub question is getWidth() return value in dp or px ..
FsCode's user avatar
  • 132
0 votes
1 answer
241 views

I'm going to use dialog fragments. There is an item called writing_comment_item.xml in the dialogfragment, and I want to set the height of 5 items. I used the inflate() function, I used getHeight() to ...
ybybyb's user avatar
  • 1,809
2 votes
1 answer
502 views

I've seen a ton of different questions and answers to the problems people are having with retrieving height and width of views, particularly this thread. The following are mentioned methods to ...
mpellegr's user avatar
  • 3,202
0 votes
2 answers
383 views

maybe I'm tired but I miss something in what's happening in my code. I have an activity with fragments. My activity HomeActivity calls a webservice to fill a List (my business object), it does this ...
Gaetan L.'s user avatar
  • 685

15 30 50 per page
1
4
5
6 7 8