summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDanny Baumann <dannybaumann@web.de>2016-02-10 13:08:59 +0100
committerGerrit Code Review <gerrit@cyanogenmod.org>2016-02-15 10:08:07 -0800
commitc584b55146c51feda057bb0faa455f57cda76c8b (patch)
treebccaa66e8c56e9315baf6408cce25ac97946352b
parent40bcbea44b82d127cc289ca0967cfc9d353667f6 (diff)
downloadandroid_packages_apps_Snap-c584b55146c51feda057bb0faa455f57cda76c8b.tar.gz
android_packages_apps_Snap-c584b55146c51feda057bb0faa455f57cda76c8b.tar.bz2
android_packages_apps_Snap-c584b55146c51feda057bb0faa455f57cda76c8b.zip
De-uglify menu.
Change-Id: I19d8a3d5a12c4be06bced056b80ad1a354c6b761
-rw-r--r--res/drawable/list_border.xml2
-rw-r--r--res/drawable/scene_filter_item_bg.xml (renamed from res/drawable/list_selector.xml)2
-rw-r--r--res/drawable/scene_mode_view_border_selected.xml36
-rw-r--r--res/drawable/setting_list_item_bg.xml (renamed from res/drawable/scene_mode_view_border.xml)12
-rw-r--r--res/drawable/setting_picker.xml21
-rw-r--r--res/layout/camera_filmstrip.xml3
-rw-r--r--res/layout/filter_mode_view.xml11
-rw-r--r--res/layout/horiz_grid.xml1
-rw-r--r--res/layout/list_menu.xml1
-rw-r--r--res/layout/list_menu_item.xml8
-rw-r--r--res/layout/list_sub_menu.xml5
-rw-r--r--res/layout/list_sub_menu_item.xml4
-rw-r--r--res/layout/scene_mode_view.xml8
-rw-r--r--res/layout/vertical_grid.xml1
-rw-r--r--res/values/colors.xml9
-rw-r--r--res/values/styles.xml6
-rw-r--r--src/com/android/camera/PhotoMenu.java21
-rw-r--r--src/com/android/camera/PhotoUI.java5
-rw-r--r--src/com/android/camera/VideoMenu.java11
-rw-r--r--src/com/android/camera/VideoUI.java4
-rw-r--r--src/com/android/camera/ui/ListMenu.java7
21 files changed, 42 insertions, 136 deletions
diff --git a/res/drawable/list_border.xml b/res/drawable/list_border.xml
index 1ab11ddfe..7d05a087f 100644
--- a/res/drawable/list_border.xml
+++ b/res/drawable/list_border.xml
@@ -29,7 +29,7 @@
<shape xmlns:android="http://schemas.android.com/apk/res/android"
android:shape="rectangle" >
- <solid android:color="@color/setting_color" />
+ <solid android:color="@color/popup_background" />
<stroke
android:width="1dip"
diff --git a/res/drawable/list_selector.xml b/res/drawable/scene_filter_item_bg.xml
index ada9b365a..2e2b06343 100644
--- a/res/drawable/list_selector.xml
+++ b/res/drawable/scene_filter_item_bg.xml
@@ -28,7 +28,7 @@
-->
<selector xmlns:android="http://schemas.android.com/apk/res/android">
- <item android:drawable="@color/setting_color_light" android:state_pressed="true"/>
+ <item android:drawable="@color/scene_item_selected" android:state_activated="true"/>
<item android:drawable="@android:color/transparent"/>
</selector>
diff --git a/res/drawable/scene_mode_view_border_selected.xml b/res/drawable/scene_mode_view_border_selected.xml
deleted file mode 100644
index 535e2d168..000000000
--- a/res/drawable/scene_mode_view_border_selected.xml
+++ /dev/null
@@ -1,36 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<!-- Copyright (c) 2014, The Linux Foundation. All rights reserved.
-
- Redistribution and use in source and binary forms, with or without
- modification, are permitted provided that the following conditions are
- met:
- * Redistributions of source code must retain the above copyright
- notice, this list of conditions and the following disclaimer.
- * Redistributions in binary form must reproduce the above
- copyright notice, this list of conditions and the following
- disclaimer in the documentation and/or other materials provided
- with the distribution.
- * Neither the name of The Linux Foundation nor the names of its
- contributors may be used to endorse or promote products derived
- from this software without specific prior written permission.
-
- THIS SOFTWARE IS PROVIDED "AS IS" AND ANY EXPRESS OR IMPLIED
- WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
- MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT
- ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS
- BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR
- BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
- WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE
- OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN
- IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
--->
-<shape xmlns:android="http://schemas.android.com/apk/res/android"
- android:shape="rectangle" >
-
- <stroke
- android:width="1dip"
- android:color="#cc33b5e5" />
-
-</shape>
diff --git a/res/drawable/scene_mode_view_border.xml b/res/drawable/setting_list_item_bg.xml
index 68431ece6..079f036c0 100644
--- a/res/drawable/scene_mode_view_border.xml
+++ b/res/drawable/setting_list_item_bg.xml
@@ -26,11 +26,11 @@
OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN
IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-->
-<shape xmlns:android="http://schemas.android.com/apk/res/android"
- android:shape="rectangle" >
+<selector xmlns:android="http://schemas.android.com/apk/res/android">
- <stroke
- android:width="1dip"
- android:color="#cc000000" />
+ <item android:drawable="@color/setting_list_pressed" android:state_pressed="true"/>
+ <item android:drawable="@color/setting_list_selected" android:state_checked="true"/>
+ <item android:drawable="@color/setting_list_selected" android:state_activated="true"/>
+ <item android:drawable="@android:color/transparent"/>
-</shape>
+</selector>
diff --git a/res/drawable/setting_picker.xml b/res/drawable/setting_picker.xml
deleted file mode 100644
index c3bff41ea..000000000
--- a/res/drawable/setting_picker.xml
+++ /dev/null
@@ -1,21 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<!-- Copyright (C) 2010 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.
--->
-
-<selector xmlns:android="http://schemas.android.com/apk/res/android">
- <item android:state_checked="true"
- android:drawable="@drawable/list_pressed_holo_light" />
- <item android:drawable="@android:color/transparent" />
-</selector>
diff --git a/res/layout/camera_filmstrip.xml b/res/layout/camera_filmstrip.xml
index df6b7a267..30da433a3 100644
--- a/res/layout/camera_filmstrip.xml
+++ b/res/layout/camera_filmstrip.xml
@@ -51,9 +51,6 @@
android:text="@string/rendering_photo_sphere"
android:textColor="@color/white"
android:textSize="14sp"
- android:shadowDx="0"
- android:shadowDy="0"
- android:shadowRadius="2"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:visibility="visible"
diff --git a/res/layout/filter_mode_view.xml b/res/layout/filter_mode_view.xml
index 558d7ce77..d4128f533 100644
--- a/res/layout/filter_mode_view.xml
+++ b/res/layout/filter_mode_view.xml
@@ -35,24 +35,21 @@
<LinearLayout
android:layout_width="@dimen/filter_mode_width"
android:layout_height="@dimen/filter_mode_height"
- android:orientation="vertical">
+ android:background="@drawable/scene_filter_item_bg"
+ android:orientation="vertical"
+ android:padding="2dp">
<ImageView
android:id="@+id/image"
android:layout_width="80dp"
android:layout_height="80dp"
- android:layout_gravity="center"
- android:padding="2dp" />
+ android:layout_gravity="center" />
<TextView
android:id="@+id/label"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="center"
- android:shadowColor="@android:color/black"
- android:shadowDx="1"
- android:shadowDy="1"
- android:shadowRadius="2"
android:singleLine="true"
android:textColor="@android:color/white"
android:textSize="13sp"
diff --git a/res/layout/horiz_grid.xml b/res/layout/horiz_grid.xml
index 910b0ea66..63dc5cf3c 100644
--- a/res/layout/horiz_grid.xml
+++ b/res/layout/horiz_grid.xml
@@ -29,7 +29,6 @@
<HorizontalScrollView xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="match_parent"
- android:alpha="0.85"
android:background="@color/popup_background"
android:scrollbars="none" >
diff --git a/res/layout/list_menu.xml b/res/layout/list_menu.xml
index e110fd571..dd4354456 100644
--- a/res/layout/list_menu.xml
+++ b/res/layout/list_menu.xml
@@ -29,7 +29,6 @@
<com.android.camera.ui.ListMenu xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="@dimen/big_setting_popup_window_width"
android:layout_height="wrap_content"
- android:alpha="0.85"
android:background="@color/popup_background"
android:scrollbars="none" >
diff --git a/res/layout/list_menu_item.xml b/res/layout/list_menu_item.xml
index f8addf82c..025bb607d 100644
--- a/res/layout/list_menu_item.xml
+++ b/res/layout/list_menu_item.xml
@@ -29,7 +29,7 @@
<com.android.camera.ui.ListMenuItem xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
- android:orientation="horizontal"
+ android:background="@drawable/setting_list_item_bg"
android:padding="5dip" >
<ImageView
@@ -37,6 +37,7 @@
android:layout_width="@dimen/setting_item_icon_width"
android:layout_height="@dimen/setting_item_icon_width"
android:layout_alignParentLeft="true"
+ android:layout_centerVertical="true"
android:layout_marginRight="20dp"
android:gravity="center" />
@@ -44,7 +45,6 @@
android:id="@+id/title"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
- android:layout_alignTop="@+id/list_image"
android:layout_toRightOf="@+id/list_image"
android:textColor="@android:color/white"
android:textStyle="bold" />
@@ -56,10 +56,6 @@
android:layout_below="@id/title"
android:layout_marginTop="1dip"
android:layout_toRightOf="@+id/list_image"
- android:shadowColor="@android:color/black"
- android:shadowDx="1"
- android:shadowDy="1"
- android:shadowRadius="2"
android:text="@string/crop_save"
android:textColor="@color/white"
android:textSize="10dip"
diff --git a/res/layout/list_sub_menu.xml b/res/layout/list_sub_menu.xml
index eaab0948e..6d4ff1aff 100644
--- a/res/layout/list_sub_menu.xml
+++ b/res/layout/list_sub_menu.xml
@@ -29,11 +29,8 @@
<com.android.camera.ui.ListSubMenu xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="wrap_content"
- android:alpha="0.85"
android:background="@drawable/list_border"
- android:divider="@color/list_divider_color"
- android:dividerHeight="1dp"
- android:listSelector="@drawable/list_selector"
+ android:choiceMode="singleChoice"
android:scrollbars="none" >
</com.android.camera.ui.ListSubMenu>
diff --git a/res/layout/list_sub_menu_item.xml b/res/layout/list_sub_menu_item.xml
index f2b043692..472462885 100644
--- a/res/layout/list_sub_menu_item.xml
+++ b/res/layout/list_sub_menu_item.xml
@@ -42,10 +42,6 @@
<TextView
android:id="@+id/text"
style="@style/CustomSettingItemTitle"
- android:shadowColor="@android:color/transparent"
- android:shadowDx="1"
- android:shadowDy="1"
- android:shadowRadius="2"
android:textColor="@android:color/white"
android:textStyle="bold" />
diff --git a/res/layout/scene_mode_view.xml b/res/layout/scene_mode_view.xml
index d4c2a259c..88d6e89d4 100644
--- a/res/layout/scene_mode_view.xml
+++ b/res/layout/scene_mode_view.xml
@@ -30,15 +30,13 @@
android:layout_width="wrap_content"
android:layout_height="match_parent"
android:layout_gravity="center"
- android:orientation="vertical"
android:padding="@dimen/scene_mode_padding" >
<LinearLayout
- android:id="@+id/border"
android:layout_width="@dimen/scene_mode_width"
android:layout_height="@dimen/scene_mode_height"
android:layout_gravity="center"
- android:background="@drawable/scene_mode_view_border"
+ android:background="@drawable/scene_filter_item_bg"
android:orientation="vertical"
android:padding="2dp" >
@@ -54,10 +52,6 @@
android:layout_height="wrap_content"
android:layout_gravity="center"
android:gravity="center"
- android:shadowColor="@android:color/black"
- android:shadowDx="1"
- android:shadowDy="1"
- android:shadowRadius="2"
android:singleLine="true"
android:textColor="@android:color/white"
android:textSize="13sp"
diff --git a/res/layout/vertical_grid.xml b/res/layout/vertical_grid.xml
index 0754d0483..9c746f9ed 100644
--- a/res/layout/vertical_grid.xml
+++ b/res/layout/vertical_grid.xml
@@ -29,7 +29,6 @@
<ScrollView xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="match_parent"
- android:alpha="0.85"
android:background="@color/popup_background"
android:scrollbars="none" >
diff --git a/res/values/colors.xml b/res/values/colors.xml
index 780110544..4fdc3e3f9 100644
--- a/res/values/colors.xml
+++ b/res/values/colors.xml
@@ -56,7 +56,7 @@
<color name="time_lapse_arc">@color/grey</color>
<color name="indicator_background">@color/black</color>
<color name="popup_title_color">@color/blue</color>
- <color name="popup_background">@color/black</color>
+ <color name="popup_background">#c0212121</color>
<color name="pano_progress_empty">@color/black</color>
<color name="pano_progress_done">#33525E</color>
<color name="pano_progress_indication">@color/blue</color>
@@ -71,9 +71,10 @@
<color name="focus_color">#ffffffff</color>
<color name="gray">@color/grey</color>
- <color name="setting_color">@color/black</color>
- <color name="setting_color_light">@color/white</color>
- <color name="list_divider_color">@color/black</color>
+ <color name="setting_list_selected">#40fafafa</color>
+ <color name="setting_list_pressed">#60fafafa</color>
+ <color name="list_divider_color">#e0212121</color>
+ <color name="scene_item_selected">@color/setting_list_selected</color>
<color name="camera_control_bg_opaque">@color/black</color>
<color name="camera_control_bg_transparent">#40212121</color>
diff --git a/res/values/styles.xml b/res/values/styles.xml
index e20b69913..b3ee810e1 100644
--- a/res/values/styles.xml
+++ b/res/values/styles.xml
@@ -114,7 +114,7 @@
<item name="android:layout_height">@dimen/setting_row_height</item>
<item name="android:paddingLeft">@dimen/setting_item_list_margin</item>
<item name="android:paddingRight">@dimen/setting_item_list_margin</item>
- <item name="android:background">@drawable/setting_picker</item>
+ <item name="android:background">@drawable/setting_list_item_bg</item>
</style>
<style name="CustomSettingRow">
<item name="android:gravity">center_vertical</item>
@@ -123,7 +123,7 @@
<item name="android:layout_height">@dimen/setting_row_height</item>
<item name="android:paddingLeft">10dp</item>
<item name="android:paddingRight">@dimen/setting_item_list_margin</item>
- <item name="android:background">@drawable/setting_picker</item>
+ <item name="android:background">@drawable/setting_list_item_bg</item>
</style>
<style name="OnViewfinderLabel">
<item name="android:gravity">center</item>
@@ -161,7 +161,7 @@
<item name="android:paddingBottom">9dp</item>
<item name="android:paddingLeft">2dp</item>
<item name="android:paddingRight">2dp</item>
- <item name="android:background">@drawable/setting_picker</item>
+ <item name="android:background">@drawable/setting_list_item_bg</item>
</style>
<style name="EffectSettingItemTitle">
<item name="android:textSize">@dimen/effect_setting_item_text_size</item>
diff --git a/src/com/android/camera/PhotoMenu.java b/src/com/android/camera/PhotoMenu.java
index e38c872c9..4b158590d 100644
--- a/src/com/android/camera/PhotoMenu.java
+++ b/src/com/android/camera/PhotoMenu.java
@@ -375,7 +375,7 @@ public class PhotoMenu extends MenuController
public void animateFadeIn(final ListView v) {
ViewPropertyAnimator vp = v.animate();
- vp.alpha(0.85f).setDuration(ANIMATION_DURATION);
+ vp.alpha(1f).setDuration(ANIMATION_DURATION);
vp.start();
}
@@ -869,10 +869,8 @@ public class PhotoMenu extends MenuController
onSettingChanged(pref);
updateSceneModeIcon(pref);
for (View v1 : views) {
- v1.setBackgroundResource(R.drawable.scene_mode_view_border);
+ v1.setActivated(v1 == v);
}
- View border = v.findViewById(R.id.border);
- border.setBackgroundResource(R.drawable.scene_mode_view_border_selected);
}
}
@@ -880,10 +878,8 @@ public class PhotoMenu extends MenuController
}
});
- View border = layout2.findViewById(R.id.border);
- views[j] = border;
- if (i == init)
- border.setBackgroundResource(R.drawable.scene_mode_view_border_selected);
+ views[j] = layout2;
+ layout2.setActivated(i == init);
imageView.setImageResource(thumbnails[i]);
label.setText(entries[i]);
layout.addView(layout2);
@@ -1006,19 +1002,16 @@ public class PhotoMenu extends MenuController
pref.setValueIndex(j);
onSettingChanged(pref);
for (View v1 : views) {
- v1.setBackground(null);
+ v1.setActivated(v1 == v);
}
- ImageView image = (ImageView) v.findViewById(R.id.image);
- image.setBackgroundColor(0xff33b5e5);
}
}
return true;
}
});
- views[j] = imageView;
- if (i == init)
- imageView.setBackgroundColor(0xff33b5e5);
+ views[j] = layout2;
+ layout2.setActivated(i == init);
TextView label = (TextView) layout2.findViewById(R.id.label);
imageView.setImageResource(thumbnails[i]);
label.setText(entries[i]);
diff --git a/src/com/android/camera/PhotoUI.java b/src/com/android/camera/PhotoUI.java
index 926550049..b00db1434 100644
--- a/src/com/android/camera/PhotoUI.java
+++ b/src/com/android/camera/PhotoUI.java
@@ -837,8 +837,9 @@ public class PhotoUI implements PieListener,
mMenu.animateSlideIn(mMenuLayout, CameraActivity.SETTING_LIST_WIDTH_1, true);
if (level == 2)
mMenu.animateFadeIn(popup);
- } else
- popup.setAlpha(0.85f);
+ } else {
+ popup.setAlpha(1f);
+ }
}
public void removeLevel2() {
diff --git a/src/com/android/camera/VideoMenu.java b/src/com/android/camera/VideoMenu.java
index 3e43ff26d..5abb727ee 100644
--- a/src/com/android/camera/VideoMenu.java
+++ b/src/com/android/camera/VideoMenu.java
@@ -310,7 +310,7 @@ public class VideoMenu extends MenuController
public void animateFadeIn(final ListView v) {
ViewPropertyAnimator vp = v.animate();
- vp.alpha(0.85f).setDuration(ANIMATION_DURATION);
+ vp.alpha(1f).setDuration(ANIMATION_DURATION);
vp.start();
}
@@ -618,10 +618,8 @@ public class VideoMenu extends MenuController
if (System.currentTimeMillis() - startTime < CLICK_THRESHOLD) {
pref.setValueIndex(j);
for (View v1 : views) {
- v1.setBackground(null);
+ v1.setActivated(v1 == v);
}
- ImageView image = (ImageView) v.findViewById(R.id.image);
- image.setBackgroundColor(0xff33b5e5);
onSettingChanged(pref);
}
@@ -630,9 +628,8 @@ public class VideoMenu extends MenuController
}
});
- views[j] = imageView;
- if (i == init)
- imageView.setBackgroundColor(0xff33b5e5);
+ views[j] = layout2;
+ layout2.setActivated(i == init);
TextView label = (TextView) layout2.findViewById(R.id.label);
imageView.setImageResource(thumbnails[i]);
label.setText(entries[i]);
diff --git a/src/com/android/camera/VideoUI.java b/src/com/android/camera/VideoUI.java
index d5255ccbe..778e067a2 100644
--- a/src/com/android/camera/VideoUI.java
+++ b/src/com/android/camera/VideoUI.java
@@ -796,9 +796,9 @@ public class VideoUI implements PieRenderer.PieListener,
mVideoMenu.animateSlideIn(mMenuLayout, CameraActivity.SETTING_LIST_WIDTH_1, true);
if (level == 2)
mVideoMenu.animateFadeIn(popup);
+ } else {
+ popup.setAlpha(1f);
}
- else
- popup.setAlpha(0.85f);
}
public ViewGroup getMenuLayout() {
diff --git a/src/com/android/camera/ui/ListMenu.java b/src/com/android/camera/ui/ListMenu.java
index 64bdc342b..2de32b28f 100644
--- a/src/com/android/camera/ui/ListMenu.java
+++ b/src/com/android/camera/ui/ListMenu.java
@@ -124,7 +124,6 @@ public class ListMenu extends ListView
ArrayAdapter<ListPreference> mListItemAdapter = new MoreSettingAdapter();
setAdapter(mListItemAdapter);
setOnItemClickListener(this);
- setSelector(android.R.color.transparent);
// Initialize mEnabled
mEnabled = new boolean[mListItem.size()];
for (int i = 0; i < mEnabled.length; i++) {
@@ -184,10 +183,8 @@ public class ListMenu extends ListView
public void resetHighlight() {
int count = getChildCount();
for (int i = 0; i < count; i++) {
- View v = getChildAt(i);
- v.setBackground(null);
+ getChildAt(i).setActivated(false);
}
-
}
@Override
@@ -205,7 +202,7 @@ public class ListMenu extends ListView
if (mListener != null) {
resetHighlight();
ListPreference pref = mListItem.get(position);
- view.setBackgroundColor(getContext().getResources().getColor(R.color.setting_color));
+ view.setActivated(true);
mListener.onPreferenceClicked(pref, (int) view.getY());
}