Skip to content

Instantly share code, notes, and snippets.

Created March 13, 2013 16:17
Show Gist options
  • Star 5 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save anonymous/5153717 to your computer and use it in GitHub Desktop.
Save anonymous/5153717 to your computer and use it in GitHub Desktop.
---///PRE-HONEYCOMB USING ACTIONBAR SHERLOCK////----
/layout/actionbar_custom_view_done_discard.xml
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="horizontal" >
<include layout="@layout/actionbar_discard_button" />
<View
android:layout_width="0.5dp"
android:layout_height="match_parent"
android:layout_marginTop="12dp"
android:layout_marginBottom="12dp"
android:background="#55FFFFFF" />
<include layout="@layout/actionbar_done_button" />
</LinearLayout>
/layout/actionbar_discard_button.xml
<FrameLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:id="@+id/actionbar_discard"
android:layout_width="0dp"
android:layout_height="match_parent"
android:layout_weight="1"
android:paddingRight="20dp"
android:background="@drawable/selectable_background_mystyle" >
<TextView
style="@style/Widget.Sherlock.ActionBar.TabText"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="center"
android:drawableLeft="@drawable/ic_menu_cancel"
android:drawablePadding="8dp"
android:gravity="center_vertical"
android:text="@string/menu_cancel" />
</FrameLayout>
/layout/actionbar_done_button.xml
<FrameLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:id="@+id/actionbar_done"
android:layout_width="0dp"
android:layout_height="match_parent"
android:layout_weight="1"
android:paddingRight="20dp"
android:background="@drawable/selectable_background_mystyle" >
<TextView
style="@style/Widget.Sherlock.ActionBar.TabText"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="center"
android:drawableLeft="@drawable/ic_menu_save"
android:drawablePadding="8dp"
android:gravity="center_vertical"
android:text="@string/menu_save" />
</FrameLayout>
-----///POST-HONEYCOMB USING ROMAN'S CODE////------
/layout-v11/actionbar_custom_view_done_discard.xml
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:divider="?android:attr/dividerVertical"
android:dividerPadding="12dp"
android:orientation="horizontal"
android:showDividers="middle" >
<include layout="@layout/actionbar_discard_button" />
<include layout="@layout/actionbar_done_button" />
</LinearLayout>
/layout-v11/actionbar_discard_button.xml
<FrameLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:id="@+id/actionbar_discard"
style="?android:actionButtonStyle"
android:layout_width="0dp"
android:layout_height="match_parent"
android:layout_weight="1"
android:background="@drawable/selectable_background_mystyle" >
<TextView style="?android:actionBarTabTextStyle"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="center"
android:paddingRight="20dp"
android:drawableLeft="@drawable/ic_menu_cancel"
android:drawablePadding="8dp"
android:gravity="center_vertical"
android:text="@string/menu_cancel" />
</FrameLayout>
/layout-v11/actionbar_done_button.xml
<FrameLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:id="@+id/actionbar_done"
style="?android:actionButtonStyle"
android:layout_width="0dp"
android:layout_height="match_parent"
android:layout_weight="1"
android:background="@drawable/selectable_background_mystyle" >
<TextView
style="?android:actionBarTabTextStyle"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="center"
android:drawableLeft="@drawable/ic_menu_save"
android:drawablePadding="8dp"
android:gravity="center_vertical"
android:paddingRight="20dp"
android:text="@string/menu_save" />
</FrameLayout>
@virusman
Copy link

What is @drawable/selectable_background_mystyle?

@trant
Copy link

trant commented Sep 27, 2013

where is selectable_background_mystyle ?

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