454 questions
2 votes
1 answer
80 views
Unable to specify weight in Composable with no Column declared in it
I am trying to build a simple calculator using jetpack compose, my composables are: calculator(): this composable composes the whole calculator calculatorRow(): it creates a Row of Buttons When I ...
1 vote
0 answers
33 views
Android ConstraintLayout - adjust width of Childs
I need to have a composition which dynamically adjusts child view width depending on available space. Rules: Right and Left dividers always visible Dividers size: min 6dp, max 16dp Dividers can ...
0 votes
1 answer
36 views
Textview text goes down when it's 2 lines
I have below code. <LinearLayout android:layout_marginStart="@dimen/space_10" android:layout_marginEnd="@dimen/space_10" android:layout_width="match_parent&...
1 vote
0 answers
52 views
Android text view (weight and marquee) resetting when another view updates
I have a horizontal Linear Layout with two texts, and i want to make them both visible, but since The size of the first text may vary in size, i have 2 conditions to fulfill on this scenario: In ...
0 votes
1 answer
40 views
TextView.text is cut mid width inside TableLayout TableRow
Main issue: text is squished so hard by View, so it gets cut. Key moments: TableRow is a child of LinearLayout so weight is supported. TableRow contains one TextView with android:layout_width="...
0 votes
1 answer
288 views
Center a button and a TextView with ellipsis in Android
I have following code with a TextView and a Button and I want them to be centered. The problem occurs when the text is too long so it pushes the button off the screen even if I use ellipsis. I do not ...
0 votes
1 answer
59 views
How to make a Linear and a Relative Layout share horizontal screen space as percentages?
How to make a Linear and a Relative Layout share horizontal space as percentages? The LinearLayout on the left needs to have a percentage width of the screen, and the RelativeLayout on the right can ...
5 votes
1 answer
3k views
Fill max width inside FlowRow - jetpack compose
I to want a row where the items goes to the next line if it gets to small. Fair enough, i am using FlowRow for that. I want the items to take up the space on the line they are on. Ok, tried to use ...
0 votes
2 answers
100 views
android layout auto adjust to different screen sizes
I have below xml nested with Linear Layout and assigned weightSum but with different screen sizes few editText are overlapping eachother or are moving out of the screen. I tried changing value for ...
1 vote
1 answer
143 views
Android layout weight makes layout width 0
I have a LinearLayout under a LinearLayout (master layout), both vertical orientation. I set the master weight sum to 1 and I add the child layout using code with weight of 0.8 and set the width to 0 ...
0 votes
1 answer
99 views
Notification Clicks in Custom View
enter link description hereI create a custom layout for notification in android.I use remoteview for building notification and also add setOnClickPendingIntent() in some widgets of custom layout.But ...
0 votes
0 answers
67 views
Layout weight for text view inside a scrollview
I have a layout with two TextInputLayout with layout weights set for their heights and a table layout like this And here is the layout file <?xml version="1.0" encoding="utf-8"?...
0 votes
2 answers
41 views
Child views not getting equal space with `layout_weight` attribute
I am trying to create the following XML layout. <?xml version="1.0" encoding="utf-8"?> <LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" ...
0 votes
2 answers
560 views
layout_constraintHorizontal_weight=1 is not working in ConstraintLayout
I have used layout_constraintHorizontal_weight=1 in three constraintLayout to make them equally divide horizontally. But it is not working. Why it is not taking in my code I am not getting. at the ...
0 votes
1 answer
52 views
How to make content center of horizontally equally divided views in ConstraintLayout android
I need to divide 3 views equally horizontally and the content of the views to be centered. I tried using the link: https://medium.com/@nomanr/constraintlayout-chains-4f3b58ea15bb But I'm unable to ...