Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
Ad layout
<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:id="@+id/ad_relative_layout_root"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_margin="8dp"
android:background="@color/primary_500"
android:padding="8dp">
<de.hdodenhof.circleimageview.CircleImageView xmlns:app="http://schemas.android.com/apk/res-auto"
android:id="@+id/ad_icon"
android:layout_width="36dp"
android:layout_height="36dp"
android:src="@drawable/ic_catch_it"
android:layout_centerVertical="true"
android:layout_gravity="center_horizontal"
app:border_color="@color/grey_300"
app:border_width="1dp" />
<TextView
android:id="@+id/ad_headline"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginLeft="16dp"
android:layout_toRightOf="@+id/ad_icon"
android:fontFamily="@string/font_family_heading"
android:text="Catch it"
android:textColor="@color/white"
android:textSize="14sp" />
<TextView
android:id="@+id/ad_body_text"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_below="@+id/ad_headline"
android:layout_marginLeft="16dp"
android:layout_marginRight="16dp"
android:layout_toLeftOf="@+id/ad_call_to_action"
android:layout_toRightOf="@+id/ad_icon"
android:fontFamily="@string/font_family_light"
android:text="Real time conversations of what's going on in your neighbourhood."
android:textColor="@color/primary_50"
android:textSize="12sp" />
<TextView
android:id="@+id/ad_call_to_action"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentRight="true"
android:layout_centerVertical="true"
android:text="Catch it"
android:background="@drawable/shape_call_to_action_background"
android:fontFamily="@string/font_family_heading"
android:paddingBottom="8dp"
android:paddingLeft="16dp"
android:paddingRight="16dp"
android:paddingTop="8dp"
android:textColor="@color/primary_500"
android:textSize="12sp" />
</RelativeLayout>
@vipulyaara

This comment has been minimized.

Copy link
Owner Author

@vipulyaara vipulyaara commented Aug 31, 2015

Here is how I am including this layout in my activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment