Skip to content

Instantly share code, notes, and snippets.

@nxsyed
Created February 19, 2019 19:09
Show Gist options
  • Save nxsyed/75d8a0581941de7ce3d881dfea4bb7f8 to your computer and use it in GitHub Desktop.
Save nxsyed/75d8a0581941de7ce3d881dfea4bb7f8 to your computer and use it in GitHub Desktop.
<?xml version="1.0" encoding="utf-8"?>
<!-- https://qiita.com/ntsk/items/dac92596742e18470a55 -->
<android.support.v7.widget.CardView
xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:background="?attr/selectableItemBackground"
android:foreground="?attr/selectableItemBackground"
app:cardUseCompatPadding="true"
app:cardPreventCornerOverlap="false"
app:cardCornerRadius="8dp"
app:cardBackgroundColor="@android:color/white">
<com.makeramen.roundedimageview.RoundedImageView
android:id="@+id/item_image"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:scaleType="centerCrop"
app:riv_corner_radius="8dp"/>
<LinearLayout
android:orientation="vertical"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_gravity="bottom"
android:padding="16dp"
android:background="@drawable/gradation_black">
<TextView
android:id="@+id/item_name"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:textStyle="bold"
android:textColor="@android:color/white"
android:textSize="26sp"/>
<TextView
android:id="@+id/item_city"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:textStyle="bold"
android:textColor="@android:color/white"
android:textSize="20sp"/>
</LinearLayout>
<FrameLayout
android:id="@+id/left_overlay"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:background="@drawable/overlay_black">
<ImageView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:src="@drawable/skip_white_120dp"
android:layout_gravity="center"/>
</FrameLayout>
<FrameLayout
android:id="@+id/right_overlay"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:background="@drawable/overlay_black">
<ImageView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:src="@drawable/like_white_120dp"
android:layout_gravity="center"/>
</FrameLayout>
<FrameLayout
android:id="@+id/top_overlay"
android:layout_width="match_parent"
android:layout_height="match_parent">
</FrameLayout>
<FrameLayout
android:id="@+id/bottom_overlay"
android:layout_width="match_parent"
android:layout_height="match_parent">
</FrameLayout>
</android.support.v7.widget.CardView>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment