Skip to content

Instantly share code, notes, and snippets.

@alorma
Last active August 29, 2015 14:19
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save alorma/607a294a4a025bc319cf to your computer and use it in GitHub Desktop.
Save alorma/607a294a4a025bc319cf to your computer and use it in GitHub Desktop.
Example cardview
<android.support.v7.widget.CardView xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:card_view="http://schemas.android.com/apk/res-auto"
xmlns:tools="http://schemas.android.com/tools"
xmlns:card="http://schemas.android.com/apk/res-auto"
android:layout_gravity="center"
android:layout_width="match_parent"
android:layout_height="180dp"
android:background="@color/white"
card_view:cardCornerRadius="4dp"
android:clickable="true"
card_view:cardElevation="@dimen/gapSmall"
android:layout_margin="@dimen/gapMedium"
android:foreground="?android:attr/selectableItemBackground">
<LinearLayout
android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="vertical">
<ImageView
android:layout_width="match_parent"
android:layout_height="160dp"
android:id="@+id/image"
android:scaleType="fitXY" />
<LinearLayout
android:layout_width="match_parent"
android:layout_height="match_parent">
<TextView
android:layout_width="match_parent"
android:layout_height="wrap_content"
style="@style/Base.TextAppearance.AppCompat.Subhead"
android:textColor="?attr/colorPrimary"
android:id="@+id/text"
tools:text="41.23424,1.2424"/>
</LinearLayout>
</LinearLayout>
</android.support.v7.widget.CardView>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment