Skip to content

Instantly share code, notes, and snippets.

@gotoark
Created January 16, 2018 16:30
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 gotoark/2cf1f553c904659b5b6220d75ff01f5a to your computer and use it in GitHub Desktop.
Save gotoark/2cf1f553c904659b5b6220d75ff01f5a to your computer and use it in GitHub Desktop.
Sample Layout with Banner and Menu Tiles
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout 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="match_parent"
android:orientation="vertical"
android:weightSum="10"
tools:context="com.arkthepro.periyakuppam.Home">
<android.support.v7.widget.CardView
android:layout_width="match_parent"
android:layout_height="0dp"
android:layout_gravity="center"
android:layout_margin="4dp"
android:layout_weight="4"
android:background="@color/colorAccent"
android:elevation="1dp"
app:cardBackgroundColor="@color/colorAccent"
app:cardCornerRadius="4dp" />
<LinearLayout
android:layout_width="match_parent"
android:layout_height="0dp"
android:layout_marginBottom="4dp"
android:layout_weight="3"
android:weightSum="4">
<android.support.v7.widget.CardView
android:id="@+id/btn_history"
android:layout_width="0dp"
android:layout_height="match_parent"
android:layout_marginEnd="2dp"
android:layout_marginLeft="4dp"
android:layout_marginRight="2dp"
android:layout_marginStart="4dp"
android:layout_weight="2"
android:elevation="1dp"
app:cardBackgroundColor="@color/colorPrimaryDark"
app:cardCornerRadius="4dp" />
<android.support.v7.widget.CardView
android:id="@+id/btn_info"
android:layout_width="0dp"
android:layout_height="match_parent"
android:layout_marginEnd="2dp"
android:layout_marginLeft="2dp"
android:layout_marginRight="4dp"
android:layout_marginStart="4dp"
android:layout_weight="2"
android:elevation="1dp"
app:cardBackgroundColor="@color/colorAccent"
app:cardCornerRadius="4dp" />
</LinearLayout>
<LinearLayout
android:layout_width="match_parent"
android:layout_height="0dp"
android:layout_marginBottom="4dp"
android:layout_weight="3"
android:weightSum="4">
<android.support.v7.widget.CardView
android:id="@+id/btn_tourist_places"
android:layout_width="0dp"
android:layout_height="match_parent"
android:layout_marginEnd="2dp"
android:layout_marginLeft="4dp"
android:layout_marginRight="2dp"
android:layout_marginStart="4dp"
android:layout_weight="2"
android:background="@color/colorPrimaryDark"
android:elevation="1dp"
app:cardBackgroundColor="@color/colorAccent"
app:cardCornerRadius="4dp"
/>
<android.support.v7.widget.CardView
android:id="@+id/btn_bus_timings"
android:layout_width="0dp"
android:layout_height="match_parent"
android:layout_marginEnd="2dp"
android:layout_marginLeft="2dp"
android:layout_marginRight="4dp"
android:layout_marginStart="4dp"
android:layout_weight="2"
android:background="@color/colorPrimaryDark"
android:elevation="1dp"
app:cardBackgroundColor="@color/colorPrimaryDark"
app:cardCornerRadius="4dp"
/>
</LinearLayout>
</LinearLayout>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment