Permalink
Browse files

ui improvements.

  • Loading branch information...
1 parent 1b51fd9 commit 14b8933f0919693cfcfa0310626ec51189d3901a @mariotaku committed Nov 26, 2012
View
@@ -7,7 +7,7 @@
<uses-sdk
android:minSdkVersion="4"
- android:targetSdkVersion="16"/>
+ android:targetSdkVersion="17"/>
<permission-group
android:name="org.mariotaku.twidere.ACCESS_APPLICATION"
@@ -1,9 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<ImageButton xmlns:android="http://schemas.android.com/apk/res/android"
- android:layout_width="@dimen/actionbar_button_width"
- android:layout_height="match_parent"
- android:background="@drawable/actionbar_item_background_holo_dark"
- android:ellipsize="marquee"
- android:gravity="center"
- android:padding="4dp"
- android:scaleType="center"/>
View
@@ -18,6 +18,15 @@
<item name="tabBackground">@null</item>
<item name="editTextStyle">@style/Widget.Holo.EditText</item>
<item name="preferenceTitleStyle">@style/TextAppearance.Holo.Medium</item>
+
+ <!-- for programmatic instantiation -->
+ <item name="actionBarBackground">@drawable/actionbar_bg_dark_holo</item>
+ <item name="actionBarTitleStyle">@style/Widget.ActionBarTitle</item>
+ <item name="actionBarItemStyle">@style/Widget.ActionBarItem</item>
+ <item name="actionBarItemHomeStyle">@style/Widget.ActionBarHomeItem</item>
+ <item name="actionBarHomeAsUpIndicator">@drawable/actionbar_back_dark</item>
+ <item name="actionBarIndeterminateProgressStyle">?android:attr/progressBarStyleSmall</item>
+
<item name="android:windowBackground">@drawable/background_holo_dark</item>
<item name="android:galleryItemBackground">@drawable/gallery_item_background</item>
</style>
@@ -28,8 +37,16 @@
<item name="tabBackground">@drawable/tab_background_dark</item>
<item name="editTextStyle">@style/Widget.Holo.Light.EditText</item>
<item name="preferenceTitleStyle">@style/TextAppearance.Holo.Light.Medium</item>
+
+ <!-- for programmatic instantiation -->
+ <item name="actionBarBackground">@drawable/actionbar_bg_light_darkactionbar_holo</item>
+ <item name="actionBarTitleStyle">@style/Widget.ActionBarTitle</item>
+ <item name="actionBarItemStyle">@style/Widget.ActionBarItem.Light</item>
+ <item name="actionBarItemHomeStyle">@style/Widget.ActionBarHomeItem.Light</item>
+ <item name="actionBarHomeAsUpIndicator">@drawable/actionbar_back_light</item>
+ <item name="actionBarIndeterminateProgressStyle">?android:attr/progressBarStyleSmall</item>
+
<item name="android:windowBackground">@drawable/background_holo_light</item>
- <item name="actionBarBackground">@drawable/bg_actionbar_light_theme</item>
<item name="android:galleryItemBackground">@drawable/gallery_item_background</item>
</style>
@@ -49,4 +66,4 @@
<item name="android:galleryItemBackground">@drawable/gallery_item_background</item>
</style>
-</resources>
+</resources>
@@ -3,7 +3,6 @@
<style name="WindowTitle.Holo" parent="android:Widget.TextView">
<item name="android:maxLines">1</item>
- <item name="android:scrollHorizontally">true</item>
<item name="android:textAppearance">?android:attr/textAppearanceMedium</item>
</style>
@@ -13,7 +12,6 @@
<style name="DialogWindowTitle.Holo" parent="android:Widget.TextView">
<item name="android:maxLines">1</item>
- <item name="android:scrollHorizontally">true</item>
<item name="android:background">@drawable/actionbar_bg_dark_holo</item>
<item name="android:textAppearance">@style/TextAppearance.Holo.DialogWindowTitle</item>
</style>
@@ -62,7 +60,6 @@
<item name="android:paddingLeft">6dp</item>
<item name="android:paddingRight">6dp</item>
<item name="android:singleLine">true</item>
- <item name="android:ellipsize">marquee</item>
</style>
<style name="Widget.ActionBarTitle" parent="Widget.ActionBarTitleBase">
@@ -89,4 +86,4 @@
<item name="android:paddingRight">4dp</item>
</style>
-</resources>
+</resources>
@@ -26,7 +26,6 @@
<item name="android:windowContentOverlay">@drawable/actionbar_shadow</item>
<!-- for programmatic instantiation -->
-
<item name="actionBarBackground">@drawable/actionbar_bg_light_darkactionbar_holo</item>
<item name="actionBarTitleStyle">@style/Widget.ActionBarTitle.Inverse</item>
<item name="actionBarItemStyle">@style/Widget.ActionBarItem</item>
@@ -46,6 +45,14 @@
<item name="android:windowContentOverlay">@null</item>
<item name="android:windowAnimationStyle">@android:style/Animation.Dialog</item>
<item name="android:windowSoftInputMode">stateUnspecified|adjustPan</item>
+
+ <!-- for programmatic instantiation -->
+ <item name="actionBarBackground">@drawable/actionbar_bg_dark_holo</item>
+ <item name="actionBarTitleStyle">@style/Widget.ActionBarTitle</item>
+ <item name="actionBarItemStyle">@style/Widget.ActionBarItem</item>
+ <item name="actionBarItemHomeStyle">@style/Widget.ActionBarHomeItem</item>
+ <item name="actionBarHomeAsUpIndicator">@drawable/actionbar_back_dark</item>
+ <item name="actionBarIndeterminateProgressStyle">?android:attr/progressBarStyle</item>
<item name="menuBarBackground">@drawable/actionbar_bg_bottom_dark_holo</item>
<item name="popupBackground">@drawable/popup_holo_light</item>
<item name="actionModeBackground">@drawable/cab_background_top_holo_dark</item>
@@ -59,6 +66,14 @@
<item name="android:windowContentOverlay">@null</item>
<item name="android:windowAnimationStyle">@android:style/Animation.Dialog</item>
<item name="android:windowSoftInputMode">stateUnspecified|adjustPan</item>
+
+ <!-- for programmatic instantiation -->
+ <item name="actionBarBackground">@drawable/actionbar_bg_light_darkactionbar_holo</item>
+ <item name="actionBarTitleStyle">@style/Widget.ActionBarTitle.Inverse</item>
+ <item name="actionBarItemStyle">@style/Widget.ActionBarItem</item>
+ <item name="actionBarItemHomeStyle">@style/Widget.ActionBarHomeItem</item>
+ <item name="actionBarHomeAsUpIndicator">@drawable/actionbar_back_dark</item>
+ <item name="actionBarIndeterminateProgressStyle">?android:attr/progressBarStyle</item>
<item name="menuBarBackground">@drawable/actionbar_bg_bottom_light_holo</item>
<item name="popupBackground">@drawable/popup_holo_light</item>
<item name="actionModeBackground">@drawable/cab_background_top_holo_light</item>
@@ -72,4 +87,4 @@
<item name="android:windowNoTitle">true</item>
</style>
-</resources>
+</resources>
@@ -7,7 +7,6 @@
import android.content.Context;
import android.util.AttributeSet;
import android.view.Gravity;
-import android.view.LayoutInflater;
import android.view.Menu;
import android.view.MenuInflater;
import android.view.MenuItem;
@@ -92,8 +91,7 @@ protected void onDetachedFromWindow() {
private View addMenuButton(final MenuItem item) {
- final ImageButton actionButton = (ImageButton) LayoutInflater.from(mContext).inflate(R.layout.menu_button_item,
- null);
+ final ImageButton actionButton = new ImageButton(mContext, null, R.attr.actionBarItemStyle);
final LayoutParams params = new LayoutParams((int) getResources().getDimension(R.dimen.actionbar_button_width),
ViewGroup.LayoutParams.MATCH_PARENT);
@@ -129,7 +127,6 @@ public boolean onLongClick(final View v) {
if (item.getItemId() == android.R.id.home) return false;
final Toast t = Toast.makeText(mContext, item.getTitle(), Toast.LENGTH_SHORT);
-
final int[] screenPos = new int[2];
v.getLocationOnScreen(screenPos);

0 comments on commit 14b8933

Please sign in to comment.