summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorOwen Lin <owenlin@google.com>2012-08-27 10:01:22 +0800
committerOwen Lin <owenlin@google.com>2012-08-28 17:09:06 +0800
commit3fa6947fc3909020f3a37cc1fd9a9b9d4d9f93e8 (patch)
tree09fed8d063a548349588d4c44530c2da7ad33c4b
parent898a2f4540635528a0916b0a6b0a177869854ae9 (diff)
downloadandroid_packages_apps_Gallery2-3fa6947fc3909020f3a37cc1fd9a9b9d4d9f93e8.tar.gz
android_packages_apps_Gallery2-3fa6947fc3909020f3a37cc1fd9a9b9d4d9f93e8.tar.bz2
android_packages_apps_Gallery2-3fa6947fc3909020f3a37cc1fd9a9b9d4d9f93e8.zip
Fix some UI bugs in using SherlockActionBar.
- Use sherlock's verion of requestWindowFeature. - Use sherlock's theme in Custom selection list. bug: 6927267 Change-Id: I706e45378b10e6e088e048d97fcaca57fb4bf3f4
-rw-r--r--res/layout/action_mode.xml4
-rw-r--r--res/layout/popup_list_item.xml5
-rw-r--r--res/values-v11/styles.xml23
-rw-r--r--res/values/styles.xml2
-rw-r--r--src/com/android/gallery3d/app/CropImage.java2
-rw-r--r--src/com/android/gallery3d/app/Gallery.java2
-rw-r--r--src/com/android/gallery3d/app/MovieActivity.java4
-rw-r--r--src/com/android/gallery3d/app/PickerActivity.java2
-rw-r--r--src/com/android/gallery3d/ui/PopupList.java4
9 files changed, 15 insertions, 33 deletions
diff --git a/res/layout/action_mode.xml b/res/layout/action_mode.xml
index d4b3c23d3..9650de69d 100644
--- a/res/layout/action_mode.xml
+++ b/res/layout/action_mode.xml
@@ -29,8 +29,10 @@
android:layout_height="match_parent"
android:src="@drawable/dropdown_ic_arrow_normal_holo_dark" />
<Button android:id="@+id/selection_menu"
+ style="?attr/actionButtonStyle"
android:divider="?android:attr/listDividerAlertDialog"
- style="?android:attr/borderlessButtonStyle"
+ android:textAppearance="?attr/textAppearanceLargePopupMenu"
+ android:textColor="?attr/actionMenuTextColor"
android:singleLine="true"
android:gravity="left|center_vertical"
android:paddingRight="25dip"
diff --git a/res/layout/popup_list_item.xml b/res/layout/popup_list_item.xml
index 3c43e8c1a..a72f5b402 100644
--- a/res/layout/popup_list_item.xml
+++ b/res/layout/popup_list_item.xml
@@ -18,10 +18,11 @@
android:id="@android:id/text1"
android:layout_width="match_parent"
android:layout_height="wrap_content"
- android:textAppearance="?android:attr/textAppearanceListItemSmall"
+ android:textAppearance="?attr/textAppearanceLargePopupMenu"
+ android:singleLine="true"
android:gravity="center_vertical"
android:paddingLeft="16dp"
android:paddingRight="16dp"
- android:minHeight="?attr/listPreferredItemHeightSmall"
+ android:minHeight="?attr/dropdownListPreferredItemHeight"
android:minWidth="196dp"
/>
diff --git a/res/values-v11/styles.xml b/res/values-v11/styles.xml
deleted file mode 100644
index 56c036317..000000000
--- a/res/values-v11/styles.xml
+++ /dev/null
@@ -1,23 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<!-- Copyright (C) 2012 The Android Open Source Project
-
- Licensed under the Apache License, Version 2.0 (the "License");
- you may not use this file except in compliance with the License.
- You may obtain a copy of the License at
-
- http://www.apache.org/licenses/LICENSE-2.0
-
- Unless required by applicable law or agreed to in writing, software
- distributed under the License is distributed on an "AS IS" BASIS,
- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- See the License for the specific language governing permissions and
- limitations under the License.
--->
-
-<resources>
- <style name="Theme.GalleryBase" parent="android:Theme.Holo">
- <item name="listPreferredItemHeightSmall">48dp</item>
- <item name="switchStyle">@android:style/Widget.CompoundButton</item>
- </style>
- <style name="Theme.Gallery.Dialog" parent="android:Theme.Holo.Dialog"/>
-</resources>
diff --git a/res/values/styles.xml b/res/values/styles.xml
index 10354a146..889d7f429 100644
--- a/res/values/styles.xml
+++ b/res/values/styles.xml
@@ -19,7 +19,7 @@
<item name="listPreferredItemHeightSmall">48dp</item>
<item name="switchStyle">@android:style/Widget.CompoundButton</item>
</style>
- <style name="Theme.Gallery.Dialog" parent="android:Theme.Dialog"/>
+ <style name="Theme.Gallery.Dialog" parent="Theme.Sherlock.Dialog"/>
<style name="Theme.Gallery" parent="Theme.GalleryBase">
<item name="android:displayOptions"></item>
<item name="android:windowContentOverlay">@null</item>
diff --git a/src/com/android/gallery3d/app/CropImage.java b/src/com/android/gallery3d/app/CropImage.java
index 7798e7682..c9621496a 100644
--- a/src/com/android/gallery3d/app/CropImage.java
+++ b/src/com/android/gallery3d/app/CropImage.java
@@ -40,12 +40,12 @@ import android.os.Message;
import android.provider.MediaStore;
import android.provider.MediaStore.Images;
import android.util.FloatMath;
-import android.view.Window;
import android.widget.Toast;
import com.actionbarsherlock.app.ActionBar;
import com.actionbarsherlock.view.Menu;
import com.actionbarsherlock.view.MenuItem;
+import com.actionbarsherlock.view.Window;
import com.android.gallery3d.R;
import com.android.gallery3d.common.ApiHelper;
import com.android.gallery3d.common.BitmapUtils;
diff --git a/src/com/android/gallery3d/app/Gallery.java b/src/com/android/gallery3d/app/Gallery.java
index 0d5770cd5..ae104eb53 100644
--- a/src/com/android/gallery3d/app/Gallery.java
+++ b/src/com/android/gallery3d/app/Gallery.java
@@ -26,9 +26,9 @@ import android.database.Cursor;
import android.net.Uri;
import android.os.Bundle;
import android.provider.OpenableColumns;
-import android.view.Window;
import android.widget.Toast;
+import com.actionbarsherlock.view.Window;
import com.android.gallery3d.R;
import com.android.gallery3d.common.Utils;
import com.android.gallery3d.data.DataManager;
diff --git a/src/com/android/gallery3d/app/MovieActivity.java b/src/com/android/gallery3d/app/MovieActivity.java
index 820bd1003..d725e6d12 100644
--- a/src/com/android/gallery3d/app/MovieActivity.java
+++ b/src/com/android/gallery3d/app/MovieActivity.java
@@ -75,8 +75,8 @@ public class MovieActivity extends SherlockActivity {
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
- requestWindowFeature(Window.FEATURE_ACTION_BAR);
- requestWindowFeature(Window.FEATURE_ACTION_BAR_OVERLAY);
+ getSherlock().requestFeature(Window.FEATURE_ACTION_BAR);
+ getSherlock().requestFeature(Window.FEATURE_ACTION_BAR_OVERLAY);
setContentView(R.layout.movie_view);
View rootView = findViewById(R.id.movie_view_root);
diff --git a/src/com/android/gallery3d/app/PickerActivity.java b/src/com/android/gallery3d/app/PickerActivity.java
index a26711e15..1eb95d0c6 100644
--- a/src/com/android/gallery3d/app/PickerActivity.java
+++ b/src/com/android/gallery3d/app/PickerActivity.java
@@ -19,11 +19,11 @@ package com.android.gallery3d.app;
import android.os.Bundle;
import android.view.View;
import android.view.View.OnClickListener;
-import android.view.Window;
import com.actionbarsherlock.view.Menu;
import com.actionbarsherlock.view.MenuInflater;
import com.actionbarsherlock.view.MenuItem;
+import com.actionbarsherlock.view.Window;
import com.android.gallery3d.R;
import com.android.gallery3d.ui.GLRootView;
diff --git a/src/com/android/gallery3d/ui/PopupList.java b/src/com/android/gallery3d/ui/PopupList.java
index 9cd381430..dd6269380 100644
--- a/src/com/android/gallery3d/ui/PopupList.java
+++ b/src/com/android/gallery3d/ui/PopupList.java
@@ -157,7 +157,9 @@ public class PopupList {
popup.setBackgroundDrawable(mContext.getResources().getDrawable(
R.drawable.menu_dropdown_panel_holo_dark));
- mContentList = new ListView(mContext);
+
+ mContentList = new ListView(mContext, null,
+ com.actionbarsherlock.R.attr.dropDownListViewStyle);
mContentList.setAdapter(new ItemDataAdapter());
mContentList.setOnItemClickListener(mOnItemClickListener);
popup.setContentView(mContentList);