3,261
questions
0
votes
0
answers
37
views
Android MotionLayout OnSwipe glitch after programmatically created transition ends. Only happens one time, then animation is consistent
Attached at the bottom are images to help visualise the issue.
The XML MotionScene for the MotionLayout has four Transitions defined with OnSwipe mechanisms. Additionally, the fragment has two ...
0
votes
2
answers
38
views
Android: How to set Max Width to match parent's width with layout_width="wrap_content"?
The width of the TextView below needs to match it's content width (in a ConstraintLayout), however when the content includes a long text, it currently extends horizontally beyond the width of the ...
1
vote
0
answers
18
views
Why the view go outside of screen by ConstrainLayout in the condition of RTL?
Problem
Here is my layout file:
activity_main.xml
<?xml version="1.0" encoding="utf-8"?>
<androidx.constraintlayout.widget.ConstraintLayout xmlns:android="http://...
0
votes
0
answers
23
views
Android - NavController - Reopening fragment is maintaining the Accessibility focus
I've two fragments -
IntroFragment
DetailFragment
Intro layout -
<?xml version="1.0" encoding="utf-8"?>
<androidx.constraintlayout.widget.ConstraintLayout xmlns:android=&...
1
vote
0
answers
46
views
Ludo Game in Android Studio - Pawn Movement Issues on Different Devices
I am currently developing a Ludo game in Android Studio and have run into a significant issue regarding the movement of pawns across different devices.
Project Setup:
I have created a grid using ...
0
votes
1
answer
30
views
Cannot display an image in Constraint Layout
I have this xml but the image is only shown when I hard the width and height of the image. I am not sure why the constraints as I provided in the code are not working.
<merge
xmlns:android=&...
0
votes
1
answer
69
views
bias in jetpack compose ConstraintLayout
For example, I want the right side to align with Image's start when the Text width is less than screen's width, and the Text will wrap automatically when the Text's width is more than screen's width ,...
1
vote
1
answer
50
views
ConstraintLayout Custom view refusing to be used as a contraint
I've created some custom views based on ContraintLayout, which is basically a pairing of a textview and some other component.
EditTextCompat and SwitchCompat.
Both of them are basically created the ...
1
vote
0
answers
24
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
How to limit ScrollView content inside CardView in ConstraintLayout on Kotlin. In Runtime the content show out of bounds
I am having trouble with the content of a ScrollView inside a CardView in ConstraintLayout. In the Design view it shows as I need it but on runtime the content of the ScrollView is shown covering the ...
0
votes
2
answers
35
views
Compose ConstraintLayout's pivots aren't working as intended?
I am trying to use Compose's ConstraintLayout composable to place a composable on 30% midway through the screen from the top.
I tried using the pivotY attribute in the constraint DSL to no avail, ...
0
votes
0
answers
24
views
Increasingly Large Spacing Between Rows in a RecyclerView in a ConstraintLayout
The spacing between rows in my RecyclerView becomes increasingly large. Setting layout_height to wrap_content didn't seem to fix this common spacing issue.
XML of recycler row:
<?xml version="...
0
votes
0
answers
21
views
Kotlin: How to access ConstraintLayout's layout_gravity attribute at runtime
I have the following resource (message_item.xml) which is a ConstraintLayout where I set the layout_gravity to "left"
<androidx.constraintlayout.widget.ConstraintLayout ...
android:id=...
0
votes
1
answer
38
views
Cardviews not scrollable inside scrollview
In the beginning, I searched for a solution to the problem extensively but couldn't resolve it, even after trying all the solutions and answers to similar questions here.
I have a scrollview which ...
0
votes
0
answers
30
views
How do I implement the UI as in the image below using constraint layout with XML in android studio?
how do I implement the below UI using constraint layout with xml in android studio?
0
votes
0
answers
14
views
A problem with the placement of an element in the constraint laoyut
I use a guide line to design the screens in the application, and for some reason when I try to place an image it doesn't place it well
The code I have a problem with
`<ImageView
android:id=&...
2
votes
2
answers
166
views
Convert XML Constraint Layout to Jetpack Compose - Chain Style, Bias
I am trying to create a specific layout with two views: a TextView and an ImageView. The TextView is dynamic, meaning the length of the text can vary. If the length of the text is less than the width ...
1
vote
1
answer
53
views
Constraint Layout items overlapping: Smart wrap text does not work when two opposing items intertwine
I want to make a list item which contains two texts , one anchored to the start of parent and one to the end of parent, I want the space to be dynamically handled each time and if too long it should ...
0
votes
0
answers
28
views
How do I bring the MedicineDetails card below nameRow (Box) using constraint layout?
This is how my preview looks without the MedicineDetails card
I want MedicineDetails card to be aligned below Add Medicine Box. I used constraint layout to do this.
But MedicineDetails card is coming ...
0
votes
0
answers
17
views
Constraint Layout for textview wrap for single and multiple line with icon
I have a constraint layout which contains a textview and a info icon (clickable) and value text next to it. I want to reduce the gap to 4 px between text and icon. I can reduce the gap by set the ...
0
votes
0
answers
50
views
Responsive buttons using guidelines and constraynt layout in kotlin android studio
Hi I am doing kotlin calculator app for university homework and i had buttons being placed like this
<Button
android:id="@+id/button_two"
android:layout_width="0dp&...
0
votes
2
answers
38
views
How prevent RecyclerView from overwriting the view beneath it?
This is my layout:
<androidx.appcompat.widget.LinearLayoutCompat xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto&...
0
votes
0
answers
35
views
Overlapping Constraint Layout: Buttons not clickable
I want to create a dynamic layout, in the mean that the parallel aligned piecharts (black circles) will be transformed into a diagonal alignment. And to give it even more height I want to wrap the ...
0
votes
1
answer
34
views
Is ConstraintLayout broken?
This is my Activity layout:
<androidx.constraintlayout.widget.ConstraintLayout
xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android....
0
votes
0
answers
34
views
Strange black bar at the bottom of the screen android
Screenshot
app theme: Theme.Material3.DayNight.NoActionBar
this id
this is the manifest:
<activity
android:name=".ui.activities.BaseActivity"
android:exported=&...
0
votes
0
answers
17
views
How to make a face using Constraint Layout?
I am trying to make an app in Android Studio for constructing identikits.
I have a constraint layout with ImageViews of every face part, but when I loads they all shuffle. I found out that the ...
0
votes
0
answers
31
views
Positioning in a ConstraintLayout
I have three views: a TextView, a LinearLayout and a Switch inside a ConstraintLayout:
<merge xmlns:tools="http://schemas.android.com/tools"
xmlns:app="http://schemas.android.com/...
0
votes
0
answers
22
views
How to prevent elements overlapping in android XML Constraint Layout?
So I am practicing on the android constraint layout, I have a project on android its more of dictionary. Word can have one or more meanings. When there are more words, they overlap. I have tried ...
1
vote
1
answer
30
views
Ellipsize not working with side by side text view in XML
mock
Trying to build something like this in a Constraint layout. Both textviews are side by side that are too long and should be ellipsized. Setting the layout_width to 0dp would stretch out the ...
0
votes
1
answer
73
views
Android UpdateLayoutParams match_constraint not matching new given constraints
I have a task that I'm attempting to accomplish: to change constraints and update the layout programmatically when font scale configuration changes. Here I have the following code on a recyclerview ...
0
votes
1
answer
23
views
Can't align image view to the left edge
I want to align the lower views to the left edge of the top view
enter the image description here
but they go away like this:
enter image description here
<?xml version="1.0" encoding=&...
0
votes
1
answer
21
views
How can I get the images to scale with different screen sizes in Android Studio?
In my code my app runs fine, but I am running into issues when I am using a different screen size. The buttons line up correctly but the images do not scale at all.
This is my XML file
<?xml ...
0
votes
1
answer
38
views
Foreground overlapping in constraintlayout
I have two constraintlayouts nested in another constraintlayout. I've set a foreground image for the parent constraintlayout but the image overlaps on the other two layouts as you can see in the image
...
1
vote
1
answer
35
views
Setting the constraintSet at runtime isn't aligning correctly against the parent's end
I have the following code snippet in xml. Its just showing 3 different views. But at runtime I want to change the alignment. However, the textviewShopNow should align at the parent End. But there ...
0
votes
0
answers
23
views
How to chain Material 3 Design TextInputLayout with TextInputEditText using Android constraint layout?
I created constraint layout large form with many text inputs. Sometimes with two or three text inputs in one horizontal line. Now is neccesary to add Material 3 Design and there is problem to chain ...
0
votes
1
answer
36
views
Understanding the Impact of Including ConstraintLayout Dependency in Android Projects
I'm using constraintlayout to design my activity:
<androidx.constraintlayout.widget.ConstraintLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://...
1
vote
7
answers
306
views
Aligning a textview after a textview it was aligned to visibility is gone
When the coupon which is the small icon is gone, this part in the layout
<androidx.appcompat.widget.AppCompatImageView
android:id="@+id/imageViewCoupon"
android:layout_width="...
1
vote
2
answers
135
views
How to center the child view but keep aspect ratio in ConstraintLayout
I am using ConstraintLayout that contains child view.
I want this child view centered but keeping aspect ratio.
Layout (landscape) variant:
<?xml version="1.0" encoding="utf-8"?&...
1
vote
0
answers
106
views
Scrollable ComposeView in XML ConstraintLayout: scroll position jumping on state change
I have a ComposeView that is constrained to another View in an XML ConstraintLayout. The ComposeView houses a Column with VerticalScroll. Whenever you are scrolled to the bottom of the column and ...
1
vote
1
answer
30
views
Constraint layout making dependent view gone the UI is distorted
I have the below UI which is fine till the Live image is visible
Below is the XML layout
<androidx.constraintlayout.widget.ConstraintLayout xmlns:android="http://schemas.android.com/apk/res/...
0
votes
1
answer
52
views
Is there a way to remove the space between the top of the screen and top of the image in ScrollView?
I wanted to display my super-tall image, so I tried to put it into ScrollView,and constraint it to the top of the screen so it would be possible to scroll through it. I imagined it would fill in the ...
0
votes
1
answer
34
views
ConstraintLayout not expanding
So this is a bit difficult to describe please bear with me.
I have a fragment with a ScrollView and a ConstraintLayout inside.
The idea is that the fragment should be filled with a survey so there are ...
0
votes
1
answer
34
views
Adding new TextViews to ConstraintLayout doesn't work onCreate but works afterwards
I'm making a dynamic grid of colored TextViews as to make tiles, since it's dynamic, so I want the gridSize to be able to be changed while it's running, I need to do it programmatically.
The problem ...
0
votes
1
answer
61
views
Android Constraint Layout by orientation
I am trying to build a layout with constraint layout that has 2 views. In the portrait view, I want the veiws to be vertically stacked and in the landscape view I want the views to be next to each ...
0
votes
0
answers
39
views
Dynamically size the header section based on the content size with a min and max Height
I'm trying to achieve the below screen
Design
Screen is divided into 2 parts :
The header part (min height 30%, max 50% of the screen height)
The content part
The content decides the height of the ...
0
votes
1
answer
53
views
Positioning an Overlaying or floating View Above another view in Layout
In an Android application, I have a layout containing a TextView at the top and two elements beneath it: an icon and another TextView. The second TextView displays a numerical value that undergoes a ...
1
vote
2
answers
63
views
ConstraintLayout: view in vertical chain should wrap content up to 1/3 of the space
I have two RecyclerViews view_a and view_b vertically on top of each other within a ConstraintLayout.
Width: easy, match_parent. My problem is the height.
The bottom view_b should wrap its content, ...
1
vote
0
answers
32
views
LazColumn not scrolling to the bottom of the items list with Compose content into chained element into ConstraintLayout
I'm sorry for the long title, but it's a little difficult to explain.
I have a LazyColumn Composable into a FragmentContainerView. This container at the same time into a ConstraintLayout, sharing the ...
0
votes
1
answer
273
views
Adding child composable function with constraint layout into parent constraint layout in jetpack compose
i have planed to use constraint layout for my app. i want to include child composable with constraint layout into parent composable. when i try to do like normal way of including, it doesn't work, i ...
0
votes
1
answer
39
views
How to make the Barrier position accurate when using constrainedWidth?
<?xml version="1.0" encoding="utf-8"?>
<androidx.constraintlayout.widget.ConstraintLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:...