Last active
March 3, 2017 14:22
-
-
Save Bodo1981/08c40e5cc496554aa961797aee7bbc41 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<android.support.constraint.ConstraintLayout | |
xmlns:android="http://schemas.android.com/apk/res/android" | |
xmlns:app="http://schemas.android.com/apk/res-auto" | |
xmlns:tools="http://schemas.android.com/tools" | |
android:layout_width="match_parent" | |
android:layout_height="wrap_content" | |
android:padding="6dp" | |
> | |
<ImageView | |
android:id="@+id/document_image" | |
android:layout_width="115dp" | |
android:layout_height="86dp" | |
android:scaleType="centerCrop" | |
app:layout_constraintDimensionRatio="115:86" | |
app:layout_constraintLeft_toLeftOf="parent" | |
app:layout_constraintTop_toTopOf="parent" | |
tools:background="@color/gray_light" | |
/> | |
<ImageView | |
android:id="@+id/document_icon" | |
android:layout_width="20dp" | |
android:layout_height="20dp" | |
android:padding="2dp" | |
app:layout_constraintBottom_toBottomOf="@+id/document_image" | |
app:layout_constraintLeft_toLeftOf="@+id/document_image" | |
app:layout_constraintTop_toTopOf="@+id/document_image" | |
app:layout_constraintVertical_bias="0.9" | |
tools:background="#CC0000" | |
tools:src="@android:drawable/arrow_down_float" | |
/> | |
<TextView | |
android:id="@+id/document_headline_first" | |
android:layout_width="0dp" | |
android:layout_height="wrap_content" | |
android:layout_marginLeft="10dp" | |
android:layout_marginRight="10dp" | |
android:ellipsize="end" | |
android:maxLines="2" | |
android:textColor="#6B6B6B" | |
android:textSize="16sp" | |
app:layout_constraintLeft_toRightOf="@+id/document_image" | |
app:layout_constraintRight_toRightOf="parent" | |
app:layout_constraintTop_toTopOf="@+id/document_image" | |
tools:text="Lorem ipsum dolor sit amet, consetetur sadipscing elitr" | |
/> | |
<TextView | |
android:id="@+id/document_teaser" | |
android:layout_width="0dp" | |
android:layout_height="wrap_content" | |
app:layout_constraintLeft_toLeftOf="@+id/document_headline_first" | |
app:layout_constraintRight_toRightOf="@+id/document_headline_first" | |
app:layout_constraintTop_toBottomOf="@+id/document_headline_first" | |
tools:text="Lorem ipsum dolor sit amet, consetetur sadipscing elitr, sed diam nonumy eirmod tempor invidunt ut labore et dolore magna aliquyam erat, sed diam voluptua. At vero eos et accusam et justo duo dolores et ea rebum. Stet clita kasd gubergren, no sea takimata sanctus est Lorem ipsum dolor sit amet. Lorem ipsum dolor sit amet, consetetur sadipscing elitr, sed diam nonumy eirmod tempor invidunt ut labore et dolore magna aliquyam erat, sed diam voluptua. At vero eos et accusam et justo duo dolores et ea rebum. Stet clita kasd gubergren, no sea takimata sanctus est Lorem ipsum dolor sit amet." | |
/> | |
</android.support.constraint.ConstraintLayout> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
ConstraintLayout 1.0.1 is not working with the above xml file. But 1.0.0 is working!
possible workarounds:
android:layout_height="match_parent"
instead of wrap_content (not possible because all layouts in recyclerview are too big)