Change theme
Help
Press space for more information.
Show links for this issue (Shortcut: i, l)
Copy issue ID
Previous Issue (Shortcut: k)
Next Issue (Shortcut: j)
Sign in to use full features.
Vote: I am impacted
Notification menu
Refresh (Shortcut: Shift+r)
Go home (Shortcut: u)
Pending code changes (auto-populated)
View issue level access limits(Press Alt + Right arrow for more information)
Attachment actions
Unintended behavior
View staffing
Description
implementation 'androidx.constraintlayout:constraintlayout:2.1.4'
The scenario is that I have 2 TextViews aligned with one another, above some other View.
Both have max of 2 lines of text.
But, when both get 2 lines or more, only one of them gets to reach 2 lines properly.
See attached.
Layout is as such:
<?xml version="1.0" encoding="utf-8"?>
<FrameLayout xmlns:android="
xmlns:app="
xmlns:tools="
android:layout_width="match_parent" android:layout_height="333dp"
tools:background="@drawable/rounded_background">
<androidx.constraintlayout.widget.ConstraintLayout
android:layout_width="match_parent" android:layout_height="match_parent">
<androidx.constraintlayout.widget.Guideline
android:id="@+id/rightGuideline" android:layout_width="wrap_content"
android:layout_height="wrap_content" android:orientation="vertical"
app:layout_constraintGuide_end="8dp" />
<androidx.constraintlayout.widget.Guideline
android:id="@+id/leftGuideline" android:layout_width="wrap_content"
android:layout_height="wrap_content" android:orientation="vertical"
app:layout_constraintGuide_begin="8dp" />
<com.google.android.material.button.MaterialButton
android:id="@+id/callToActionButton"
android:layout_width="0px" android:layout_height="wrap_content"
android:layout_marginBottom="11dp" app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintEnd_toEndOf="@id/rightGuideline"
app:layout_constraintStart_toStartOf="@id/leftGuideline"
tools:text="@tools:sample/lorem" />
<ImageView
android:id="@+id/mediaView" android:layout_width="0px"
android:layout_height="172dp" android:foreground="?attr/selectableItemBackground"
app:layout_constraintBottom_toTopOf="@id/callToActionButton"
app:layout_constraintEnd_toEndOf="@id/rightGuideline"
app:layout_constraintStart_toStartOf="@id/leftGuideline"
tools:background="@tools:sample/backgrounds/scenic" />
<ImageView
android:id="@+id/iconImageView"
android:layout_width="36dp" android:layout_height="36dp"
android:foreground="?attr/selectableItemBackground" android:scaleType="centerCrop"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintBottom_toTopOf="@id/mediaView"
app:layout_constraintStart_toStartOf="@id/leftGuideline"
app:layout_constraintTop_toTopOf="parent" tools:src="@tools:sample/avatars"
tools:targetApi="m" />
<TextView
android:id="@+id/headlineTextView"
android:layout_width="0px" android:layout_height="wrap_content"
android:layout_marginStart="17dp" android:layout_marginTop="-2dp"
android:background="?attr/selectableItemBackground" android:ellipsize="end"
android:maxLines="2" android:textColor="?android:textColorPrimary"
android:textSize="19sp" app:layout_constrainedHeight="true"
app:layout_constraintBottom_toTopOf="@id/bodyTextView"
app:layout_constraintEnd_toEndOf="@id/rightGuideline"
app:layout_constraintStart_toEndOf="@id/iconImageView"
app:layout_constraintTop_toTopOf="@id/iconImageView"
app:layout_constraintVertical_bias="0" app:layout_constraintVertical_chainStyle="packed"
tools:text="sad\nzxc\nzxc" />
<TextView
android:id="@+id/bodyTextView"
android:layout_width="0px" android:layout_height="wrap_content"
android:background="?attr/selectableItemBackground" android:ellipsize="end"
android:maxLines="2" android:textColor="?android:textColorPrimary"
android:textSize="13sp" app:layout_constrainedHeight="true"
app:layout_constraintBottom_toTopOf="@id/mediaView"
app:layout_constraintEnd_toEndOf="@id/rightGuideline"
app:layout_constraintStart_toStartOf="@id/headlineTextView"
app:layout_constraintTop_toBottomOf="@id/headlineTextView"
tools:text="sad\nzxc\nzxc" />
</androidx.constraintlayout.widget.ConstraintLayout>
</FrameLayout>
Android Studio Jellyfish | 2023.3.1 Canary 10
Build #AI-233.14475.28.2331.11456607, built on February 16, 2024
Runtime version: 17.0.10+0--11446219 amd64
VM: OpenJDK 64-Bit Server VM by JetBrains s.r.o.
Windows 11.0
GC: G1 Young Generation, G1 Old Generation
Memory: 4086M
Cores: 12
Registry:
debugger.watches.in.variables=false
Non-Bundled Plugins:
com.github.drjacky.avocado (3.3.3)
cn.jxzhang.plugin.json-formatter (1.4)
com.intellij.marketplace (233.14475.49)
Show As ... (1.0.3)
String Manipulation (9.12.0)
GenerateSerialVersionUID (3.0.3)
idea.plugin.protoeditor (233.13135.65)
com.steve.plugins.autoscroll (1.1)
com.dethlex.numberconverter (2.0.0)
izhangzhihao.rainbow.brackets (2024.2.1)
com.ppismerov.ksvu (0.0.1)
net.aquadc.mike.plugin (0.31)
com.developerphil.adbidea (1.6.13)
GenerateSerializationHelpers (1.0.6)