Last active
October 11, 2017 14:20
-
-
Save eugenebrusov/1410b9303096d70ab5276515e328a80c to your computer and use it in GitHub Desktop.
CardView - media 16:9 and actions
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.v7.widget.CardView | |
xmlns:android="http://schemas.android.com/apk/res/android" | |
style="@style/CardView.Light" | |
android:layout_width="match_parent" | |
android:layout_height="wrap_content" | |
android:layout_marginTop="8dp" | |
android:layout_marginStart="8dp" | |
android:layout_marginEnd="8dp"> | |
<android.support.constraint.ConstraintLayout | |
xmlns:app="http://schemas.android.com/apk/res-auto" | |
android:layout_width="match_parent" | |
android:layout_height="wrap_content"> | |
<ImageView | |
android:id="@+id/media_image" | |
android:layout_width="0dp" | |
android:layout_height="0dp" | |
android:scaleType="centerCrop" | |
app:layout_constraintDimensionRatio="H,16:9" | |
app:layout_constraintTop_toTopOf="parent" | |
app:layout_constraintStart_toStartOf="parent" | |
app:layout_constraintEnd_toEndOf="parent" | |
app:layout_constraintBottom_toTopOf="@+id/share_button" | |
app:layout_constraintVertical_chainStyle="packed" /> | |
<ImageButton | |
android:id="@+id/favorite_button" | |
android:layout_width="wrap_content" | |
android:layout_height="wrap_content" | |
android:background="#00FFFFFF" | |
android:padding="12dp" | |
app:srcCompat="@drawable/ic_favorite_black_24dp" | |
app:layout_constraintTop_toTopOf="@+id/bookmark_button" | |
app:layout_constraintEnd_toStartOf="@+id/bookmark_button" /> | |
<ImageButton | |
android:id="@+id/bookmark_button" | |
android:layout_width="wrap_content" | |
android:layout_height="wrap_content" | |
android:background="#00FFFFFF" | |
android:padding="12dp" | |
app:srcCompat="@drawable/ic_bookmark_black_24dp" | |
app:layout_constraintTop_toTopOf="@+id/share_button" | |
app:layout_constraintEnd_toStartOf="@+id/share_button" /> | |
<ImageButton | |
android:id="@+id/share_button" | |
android:layout_width="wrap_content" | |
android:layout_height="wrap_content" | |
android:layout_marginEnd="8dp" | |
android:background="#00FFFFFF" | |
android:padding="12dp" | |
app:srcCompat="@drawable/ic_share_black_24dp" | |
app:layout_constraintTop_toBottomOf="@+id/media_image" | |
app:layout_constraintEnd_toEndOf="parent" | |
app:layout_constraintBottom_toBottomOf="parent" /> | |
</android.support.constraint.ConstraintLayout> | |
</android.support.v7.widget.CardView> |
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
<vector android:alpha="0.54" android:height="24dp" | |
android:viewportHeight="24.0" android:viewportWidth="24.0" | |
android:width="24dp" xmlns:android="http://schemas.android.com/apk/res/android"> | |
<path android:fillColor="#FF000000" android:pathData="M12,21.35l-1.45,-1.32C5.4,15.36 2,12.28 2,8.5 2,5.42 4.42,3 7.5,3c1.74,0 3.41,0.81 4.5,2.09C13.09,3.81 14.76,3 16.5,3 19.58,3 22,5.42 22,8.5c0,3.78 -3.4,6.86 -8.55,11.54L12,21.35z"/> | |
</vector> |
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
<vector android:alpha="0.54" android:height="24dp" | |
android:viewportHeight="24.0" android:viewportWidth="24.0" | |
android:width="24dp" xmlns:android="http://schemas.android.com/apk/res/android"> | |
<path android:fillColor="#FF000000" android:pathData="M17,3H7c-1.1,0 -1.99,0.9 -1.99,2L5,21l7,-3 7,3V5c0,-1.1 -0.9,-2 -2,-2z"/> | |
</vector> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment