Skip to content

Instantly share code, notes, and snippets.

@donnfelker
Created December 2, 2011 20:44
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save donnfelker/1424761 to your computer and use it in GitHub Desktop.
Save donnfelker/1424761 to your computer and use it in GitHub Desktop.
Count Bubble Layout
<?xml version="1.0" encoding="utf-8"?>
<shape android:shape="rectangle" xmlns:android="http://schemas.android.com/apk/res/android">
<gradient
android:angle="90"
android:startColor="#b30e13"
android:endColor="#f5343b"
/>
<padding android:bottom="3dp" android:left="9dp" android:right="9dp" android:top="3dp" />
<stroke android:width="2dp" android:color="#ffffff" />
<corners android:radius="10dp" />
</shape>
<FrameLayout
android:layout_height="wrap_content"
android:layout_width="wrap_content"
android:padding="30dp">
<Button
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="Inbox"
android:background="@drawable/dark_button"
android:textColor="#FFFFFF"
/>
<LinearLayout
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:background="@drawable/count_bubble"
android:gravity="center"
android:layout_gravity="right"
android:padding="4dp"
android:layout_marginRight="2dp"
android:layout_marginTop="2dp"
>
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="45"
android:textColor="#FFFFFF"
android:textStyle="bold"
android:textSize="4pt"
/>
</LinearLayout>
</FrameLayout>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment