Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
  • Loading branch information
ohhorob committed Feb 10, 2011
2 parents 5feecdf + 638dce2 commit b31fd76
Show file tree
Hide file tree
Showing 5 changed files with 27 additions and 11 deletions.
6 changes: 6 additions & 0 deletions README.md
Expand Up @@ -62,6 +62,12 @@ If you don't like the default colors that is defined in the [colors.xml](https:/

The same can be done with the drawables, layouts and everything else that is located in the ActionBar project.

## Contributions

* ohhorob, https://github.com/ohhorob
* denravonska, https://github.com/denravonska
* rpdillon, https://github.com/rpdillon/

## License
Copyright (c) 2010 [Johan Nilsson](http://markupartist.com)

Expand Down
13 changes: 6 additions & 7 deletions actionbar/res/layout/actionbar.xml
Expand Up @@ -16,14 +16,14 @@
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:id="@+id/screen"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:layout_height="@dimen/actionbar_height"
android:orientation="horizontal"
android:background="#0000"
>
<RelativeLayout
android:id="@+id/actionbar_home"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_height="@dimen/actionbar_height"
android:orientation="horizontal"
android:layout_alignParentLeft="true"
android:layout_centerVertical="true"
Expand All @@ -32,15 +32,15 @@
<ImageView
android:id="@+id/actionbar_home_logo"
android:layout_width="wrap_content"
android:layout_height="45dip"
android:layout_height="@dimen/actionbar_height"
android:background="@drawable/actionbar_btn"
android:padding="0dip"
android:visibility="gone"
/>
<RelativeLayout
android:id="@+id/actionbar_home_bg"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_height="@dimen/actionbar_height"
android:orientation="horizontal"
android:layout_alignParentLeft="true"
android:layout_centerVertical="true"
Expand All @@ -50,16 +50,15 @@
<!-- TODO: Make configurable. -->
<ImageButton
android:id="@+id/actionbar_home_btn"
style="@style/ActionBarItem"
style="@style/ActionBarHomeItem"
android:background="@drawable/actionbar_btn"
android:layout_marginRight="1px"
/>
</RelativeLayout>

<LinearLayout
android:id="@+id/actionbar_actions"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_height="@dimen/actionbar_height"
android:layout_alignParentRight="true"
android:layout_centerVertical="true"
android:layout_margin="0dp"
Expand Down
10 changes: 7 additions & 3 deletions actionbar/res/values/styles.xml
Expand Up @@ -21,9 +21,13 @@
<item name="android:background">@drawable/actionbar_background</item>
</style>
<style name="ActionBarItem">
<item name="android:layout_width">wrap_content</item>
<item name="android:layout_height">wrap_content</item>
<item name="android:layout_width">@dimen/actionbar_item_width</item>
<item name="android:layout_height">@dimen/actionbar_height</item>
<item name="android:padding">5dp</item>
<item name="android:layout_marginLeft">1px</item>
</style>
</resources>
<style name="ActionBarHomeItem" parent="ActionBarItem">
<item name="android:layout_marginRight">1px</item>
<item name="android:layout_marginLeft">0px</item>
</style>
</resources>
7 changes: 7 additions & 0 deletions actionbarexample/res/values/styles.xml
@@ -1,10 +1,17 @@
<?xml version="1.0" encoding="utf-8"?>
<resources>
<!--
Example of how one could override the default style for the ActionBarItem.
The style below is used in conjunction with the actionBar.setHomeAction
that's comment out in the HomeActivity.
-->
<!--
<style name="ActionBarItem">
<item name="android:layout_width">wrap_content</item>
<item name="android:layout_height">wrap_content</item>
<item name="android:paddingLeft">5dp</item>
<item name="android:paddingRight">5dp</item>
<item name="android:layout_margin">0px</item>
</style>
-->
</resources>
Expand Up @@ -17,8 +17,8 @@ public void onCreate(Bundle savedInstanceState) {
setContentView(R.layout.main);

ActionBar actionBar = (ActionBar) findViewById(R.id.actionbar);
//actionBar.setHomeAction(new IntentAction(this, createIntent(this), R.drawable.ic_title_home_demo));
actionBar.setTitle("Home");
actionBar.setHomeAction(new IntentAction(this, createIntent(this), R.drawable.ic_title_home_demo));
actionBar.addAction(new IntentAction(this, createShareIntent(), R.drawable.ic_title_share_default));
actionBar.addAction(new IntentAction(this, new Intent(this, OtherActivity.class), R.drawable.ic_title_export_default));
}
Expand Down

0 comments on commit b31fd76

Please sign in to comment.