diff options
author | Danny Baumann <dannybaumann@web.de> | 2016-02-10 13:08:59 +0100 |
---|---|---|
committer | Michael Bestas <mikeioannina@gmail.com> | 2017-01-04 21:57:47 +0200 |
commit | 3d8cfc56712f2572ffa8a852b8a4a480e4edc500 (patch) | |
tree | ea60318c9b7088e6ad20d06bf6893110044d1273 | |
parent | e0579901aa6dd58979f1f8e68f8f63dd1eedafdd (diff) | |
download | android_packages_apps_Snap-3d8cfc56712f2572ffa8a852b8a4a480e4edc500.tar.gz android_packages_apps_Snap-3d8cfc56712f2572ffa8a852b8a4a480e4edc500.tar.bz2 android_packages_apps_Snap-3d8cfc56712f2572ffa8a852b8a4a480e4edc500.zip |
De-uglify menu.
Change-Id: I19d8a3d5a12c4be06bced056b80ad1a354c6b761
22 files changed, 46 insertions, 137 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 2075a94f4..cb49367d0 100644 --- a/res/layout/camera_filmstrip.xml +++ b/res/layout/camera_filmstrip.xml @@ -50,9 +50,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 53ef47682..45ab11f96 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 @@ -38,13 +38,13 @@ android:layout_height="@dimen/setting_item_icon_width" android:layout_alignParentStart="true" android:layout_marginEnd="15dp" + android:layout_centerVertical="true" android:gravity="center" /> <TextView android:id="@+id/title" android:layout_width="wrap_content" android:layout_height="wrap_content" - android:layout_alignTop="@+id/list_image" android:layout_toEndOf="@+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_toEndOf="@+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 db417d689..f5f5f63c6 100644 --- a/res/layout/list_sub_menu_item.xml +++ b/res/layout/list_sub_menu_item.xml @@ -45,10 +45,6 @@ android:id="@+id/text" style="@style/CustomSettingItemTitle" android:layout_toRightOf="@+id/image" - 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 54cb7a68d..2f9ff101e 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 91a162e6d..58fb26079 100644 --- a/res/values/styles.xml +++ b/res/values/styles.xml @@ -113,7 +113,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> @@ -122,7 +122,7 @@ <item name="android:layout_height">@dimen/setting_row_height</item> <item name="android:paddingLeft">4dp</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> @@ -160,7 +160,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 0ae9f7875..e8745a9fc 100755 --- a/src/com/android/camera/PhotoMenu.java +++ b/src/com/android/camera/PhotoMenu.java @@ -442,7 +442,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(); } @@ -1068,10 +1068,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); animateSlideOutPreviewMenu(); } @@ -1080,10 +1078,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); @@ -1219,19 +1215,16 @@ public class PhotoMenu extends MenuController changeFilterModeControlIcon(pref.getValue()); 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 6651d8317..6b8299c7c 100644 --- a/src/com/android/camera/PhotoUI.java +++ b/src/com/android/camera/PhotoUI.java @@ -880,8 +880,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 756ceb93e..6b06a1111 100644 --- a/src/com/android/camera/VideoMenu.java +++ b/src/com/android/camera/VideoMenu.java @@ -317,7 +317,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(); } @@ -622,10 +622,8 @@ public class VideoMenu extends MenuController pref.setValueIndex(j); changeFilterModeControlIcon(pref.getValue()); for (View v1 : views) { - v1.setBackground(null); + v1.setActivated(v1 == v); } - ImageView image = (ImageView) v.findViewById(R.id.image); - image.setBackgroundColor(0xff33b5e5); onSettingChanged(pref); } @@ -634,9 +632,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 f4b336b82..18dd3c1dd 100644 --- a/src/com/android/camera/VideoUI.java +++ b/src/com/android/camera/VideoUI.java @@ -907,9 +907,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/CameraControls.java b/src/com/android/camera/ui/CameraControls.java index 881225995..4d608a4bb 100644 --- a/src/com/android/camera/ui/CameraControls.java +++ b/src/com/android/camera/ui/CameraControls.java @@ -1005,8 +1005,10 @@ public class CameraControls extends RotatableLayout { }; for (View v : views) { if (v != null) { - ((RotateImageView) v).setOrientation(orientation, - animation); + if (v instanceof RotateImageView) { + ((RotateImageView) v).setOrientation(orientation, + animation); + } } } layoutRemaingPhotos(); diff --git a/src/com/android/camera/ui/ListMenu.java b/src/com/android/camera/ui/ListMenu.java index cda758b9c..1e9d436a8 100644 --- a/src/com/android/camera/ui/ListMenu.java +++ b/src/com/android/camera/ui/ListMenu.java @@ -182,7 +182,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++) { @@ -242,8 +241,7 @@ 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); } mHighlighted = -1; } @@ -264,7 +262,7 @@ public class ListMenu extends ListView resetHighlight(); ListPreference pref = mListItem.get(position); mHighlighted = position; - view.setBackgroundColor(getContext().getResources().getColor(R.color.setting_color)); + view.setActivated(true); mListener.onPreferenceClicked(pref, (int) view.getY()); } |