Merge "Gallery2: Adjust the layout of bottom controls of photopage" into android_ui.lnx.1.2-dev
diff --git a/res/drawable-hdpi/knob.png b/res/drawable-hdpi/knob.png
old mode 100644
new mode 100755
index 1eba937..213c200
--- a/res/drawable-hdpi/knob.png
+++ b/res/drawable-hdpi/knob.png
Binary files differ
diff --git a/res/drawable-hdpi/switch_thumb_activated.9.png b/res/drawable-hdpi/switch_thumb_activated.9.png
deleted file mode 100644
index 072aa64..0000000
--- a/res/drawable-hdpi/switch_thumb_activated.9.png
+++ /dev/null
Binary files differ
diff --git a/res/drawable-hdpi/switch_thumb_activated.png b/res/drawable-hdpi/switch_thumb_activated.png
new file mode 100755
index 0000000..5d6c7d8
--- /dev/null
+++ b/res/drawable-hdpi/switch_thumb_activated.png
Binary files differ
diff --git a/res/drawable-hdpi/switch_thumb_off.9.png b/res/drawable-hdpi/switch_thumb_off.9.png
deleted file mode 100644
index 45786a3..0000000
--- a/res/drawable-hdpi/switch_thumb_off.9.png
+++ /dev/null
Binary files differ
diff --git a/res/drawable-hdpi/switch_thumb_off.png b/res/drawable-hdpi/switch_thumb_off.png
new file mode 100755
index 0000000..733cef6
--- /dev/null
+++ b/res/drawable-hdpi/switch_thumb_off.png
Binary files differ
diff --git a/res/layout/audio_effects_dialog.xml b/res/layout/audio_effects_dialog.xml
index 49dcafb..b2143d6 100644
--- a/res/layout/audio_effects_dialog.xml
+++ b/res/layout/audio_effects_dialog.xml
@@ -1,6 +1,6 @@
 <?xml version="1.0" encoding="utf-8"?>
 <!--
-Copyright (c) 2013, The Linux Foundation. All rights reserved.
+Copyright (c) 2013, 2016, 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
@@ -40,33 +40,58 @@
         android:layout_height="wrap_content"
         android:orientation="vertical"
         android:gravity="center_horizontal"
-        android:paddingBottom="10dp">
+        android:layout_marginStart="12dp"
+        android:layout_marginEnd="12dp">
 
-        <LinearLayout
+        <RelativeLayout
             android:id="@+id/aEffectsPanel"
             android:layout_width="wrap_content"
             android:layout_height="wrap_content"
-            android:orientation="horizontal"
             android:layout_marginTop="12dp"
             android:layout_marginBottom="10dp"
             android:gravity="center_vertical">
 
-            <com.android.gallery3d.ui.Knob
-                android:id="@+id/bBStrengthKnob"
+            <RelativeLayout
                 android:layout_width="wrap_content"
                 android:layout_height="wrap_content"
-                android:layout_weight="1"
-                custom:label="@string/bass_boost_strength"
-                custom:foreground="@drawable/knob" />
+                android:layout_weight="1">
+                <com.android.gallery3d.ui.Knob
+                    android:id="@+id/bBStrengthKnob"
+                    android:layout_width="wrap_content"
+                    android:layout_height="wrap_content"
+                    android:layout_centerHorizontal="true"
+                    custom:foreground="@drawable/knob"/>
+                <TextView
+                    android:layout_width="wrap_content"
+                    android:layout_height="wrap_content"
+                    android:layout_centerHorizontal="true"
+                    android:layout_below="@id/bBStrengthKnob"
+                    android:layout_marginTop="12dp"
+                    android:textColor="@android:color/black"
+                    android:text="@string/bass_boost_strength"/>
+            </RelativeLayout>
 
-            <com.android.gallery3d.ui.Knob
-                android:id="@+id/vIStrengthKnob"
+            <RelativeLayout
                 android:layout_width="wrap_content"
                 android:layout_height="wrap_content"
-                android:layout_weight="1"
-                custom:label="@string/virtualizer_strength"
-                custom:foreground="@drawable/knob" />
-
-        </LinearLayout>
+                android:layout_marginEnd="24dp"
+                android:layout_alignParentRight="true"
+                android:layout_weight="1">
+                <com.android.gallery3d.ui.Knob
+                    android:id="@+id/vIStrengthKnob"
+                    android:layout_width="wrap_content"
+                    android:layout_height="wrap_content"
+                    android:layout_centerHorizontal="true"
+                    custom:foreground="@drawable/knob"/>
+                <TextView
+                    android:layout_width="wrap_content"
+                    android:layout_height="wrap_content"
+                    android:layout_below="@id/vIStrengthKnob"
+                    android:layout_marginTop="12dp"
+                    android:layout_centerHorizontal="true"
+                    android:textColor="@android:color/black"
+                    android:text="@string/virtualizer_strength"/>
+            </RelativeLayout>
+        </RelativeLayout>
     </LinearLayout>
 </LinearLayout>
diff --git a/res/layout/audio_effects_title.xml b/res/layout/audio_effects_title.xml
index fcfb11d..2e200d5 100644
--- a/res/layout/audio_effects_title.xml
+++ b/res/layout/audio_effects_title.xml
@@ -1,6 +1,6 @@
 <?xml version="1.0" encoding="utf-8"?>
 <!--
-Copyright (c) 2014, The Linux Foundation. All rights reserved.
+Copyright (c) 2014, 2016, 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
@@ -40,9 +40,10 @@
         android:gravity="left|center_vertical"
         android:layout_width="wrap_content"
         android:layout_height="wrap_content"
-        android:layout_marginStart="10dp"
+        android:layout_marginStart="24dp"
         android:layout_marginTop="10dp"
         android:layout_marginBottom="10dp"
+        android:textColor="@android:color/black"
         android:textSize="20dp" />
 
     <View
@@ -54,7 +55,8 @@
         android:id="@+id/audio_effects_switch"
         android:textOn=""
         android:textOff=""
+        android:background="@null"
+        android:gravity="center_vertical|right"
         android:layout_width="72dp"
-        android:layout_height="34dp"
-        android:layout_marginEnd="4dp"/>
+        android:layout_height="34dp"/>
 </LinearLayout>
diff --git a/res/menu/album.xml b/res/menu/album.xml
index 00fd3ff..8151d1f 100644
--- a/res/menu/album.xml
+++ b/res/menu/album.xml
@@ -21,7 +21,7 @@
     <item android:id="@+id/action_slideshow"
             android:icon="@drawable/slideshow"
             android:title="@string/slideshow"
-            android:showAsAction="ifRoom" />
+            android:showAsAction="never" />
     <item android:id="@+id/action_select"
             android:title="@string/select_item"
             android:showAsAction="never" />
diff --git a/res/values/dimens.xml b/res/values/dimens.xml
index 2b72812..d636a9a 100644
--- a/res/values/dimens.xml
+++ b/res/values/dimens.xml
@@ -132,11 +132,11 @@
     <dimen name="albumset_icon_size">25dp</dimen>
 
       <!-- configuration for albumset page in Landscape-->
-    <dimen name="albumset_slot_gap_land">29dp</dimen>
-    <dimen name="albumset_padding_top_land">30dp</dimen>
-    <dimen name="albumset_padding_bottom_land">30dp</dimen>
-    <dimen name="albumset_padding_left_land">30dp</dimen>
-    <dimen name="albumset_padding_right_land">30dp</dimen>
+    <dimen name="albumset_slot_gap_land">4dp</dimen>
+    <dimen name="albumset_padding_top_land">4dp</dimen>
+    <dimen name="albumset_padding_bottom_land">4dp</dimen>
+    <dimen name="albumset_padding_left_land">4dp</dimen>
+    <dimen name="albumset_padding_right_land">4dp</dimen>
 
     <!-- configuration for album page -->
     <integer name="album_rows_land">2</integer>
@@ -151,11 +151,11 @@
     <dimen name="album_padding_right">3dp</dimen>
 
       <!-- configuration for album page in Landscape-->
-    <dimen name="album_slot_gap_land">7dp</dimen>
-    <dimen name="album_padding_top_land">16dp</dimen>
-    <dimen name="album_padding_bottom_land">7dp</dimen>
-    <dimen name="album_padding_left_land">16dp</dimen>
-    <dimen name="album_padding_right_land">16dp</dimen>
+    <dimen name="album_slot_gap_land">3dp</dimen>
+    <dimen name="album_padding_top_land">3dp</dimen>
+    <dimen name="album_padding_bottom_land">3dp</dimen>
+    <dimen name="album_padding_left_land">3dp</dimen>
+    <dimen name="album_padding_right_land">3dp</dimen>
 
     <!-- configuration for manage page -->
     <dimen name="cache_pin_size">24dp</dimen>
@@ -202,8 +202,8 @@
     <dimen name="dialog_text_size">14sp</dimen>
 
     <dimen name="timeline_port_slot_gap">3dp</dimen>
-    <dimen name="timeline_land_slot_gap">7dp</dimen>
-    <dimen name="timeline_land_margin">16dp</dimen>
+    <dimen name="timeline_land_slot_gap">3dp</dimen>
+    <dimen name="timeline_land_margin">3dp</dimen>
     <dimen name="timeline_port_margin">3dp</dimen>
     <dimen name="timeline_title_height">48dp</dimen>
     <dimen name="timeline_title_font_size">14sp</dimen>
diff --git a/src/com/android/gallery3d/app/AlbumPage.java b/src/com/android/gallery3d/app/AlbumPage.java
index 5fc16aa..6a35557 100644
--- a/src/com/android/gallery3d/app/AlbumPage.java
+++ b/src/com/android/gallery3d/app/AlbumPage.java
@@ -187,27 +187,16 @@
             int paddingRight;
             int paddingTop;
 
-            if (right - left > bottom - top) {
-                if (mViewType) {
-                    paddingTop = mConfig.paddingLeft;
-                } else {
-                    paddingTop = mConfigList.paddingLeft;
-                }
-                paddingBottom = mConfig.paddingBottomLand;
-                paddingRight = mConfig.paddingRightLand;
-                paddingLeft = mConfig.paddingLeftLand;
+            if (mViewType) {
+                paddingTop = mConfig.paddingLeft;
+                paddingLeft = mConfig.paddingLeft;
+            } else {
+                paddingTop = mConfigList.paddingLeft;
+                paddingLeft = mConfigList.paddingLeft;
             }
-            else {
-                if (mViewType) {
-                    paddingTop = mConfig.paddingLeft;
-                    paddingLeft = mConfig.paddingLeft;
-                } else {
-                    paddingTop = mConfigList.paddingLeft;
-                    paddingLeft = mConfigList.paddingLeft;
-                }
-                paddingBottom = mConfig.paddingBottom;
-                paddingRight = mConfig.paddingRight;
-            }
+            paddingBottom = mConfig.paddingBottom;
+            paddingRight = mConfig.paddingRight;
+
             int slotViewTop = mActivity.getGalleryActionBar().getHeight()
                     + paddingTop;
             int slotViewBottom = bottom - top - paddingBottom;
diff --git a/src/com/android/gallery3d/app/MovieActivity.java b/src/com/android/gallery3d/app/MovieActivity.java
index 87c2242..01d8d26 100644
--- a/src/com/android/gallery3d/app/MovieActivity.java
+++ b/src/com/android/gallery3d/app/MovieActivity.java
@@ -368,13 +368,13 @@
 
             mSwitch = (ToggleButton) title.findViewById(R.id.audio_effects_switch);
             mSwitch.setChecked(enabled);
-            mSwitch.setBackgroundResource(enabled ?
+            mSwitch.setButtonDrawable(enabled ?
                     R.drawable.switch_thumb_activated : R.drawable.switch_thumb_off);
 
             mSwitch.setOnCheckedChangeListener(new CompoundButton.OnCheckedChangeListener() {
                 @Override
                 public void onCheckedChanged(CompoundButton buttonView, boolean isChecked) {
-                    mSwitch.setBackgroundResource(isChecked ?
+                    mSwitch.setButtonDrawable(isChecked ?
                             R.drawable.switch_thumb_activated : R.drawable.switch_thumb_off);
                     if(mBassBoostEffect != null) {
                         mBassBoostEffect.setEnabled(isChecked);
@@ -424,7 +424,7 @@
             });
 
             mEffectDialog = new AlertDialog.Builder(MovieActivity.this,
-                    AlertDialog.THEME_HOLO_DARK)
+                    AlertDialog.THEME_DEVICE_DEFAULT_LIGHT)
                 .setCustomTitle(title)
                 .setView(content)
                 .setPositiveButton(R.string.ok, new DialogInterface.OnClickListener() {
@@ -457,8 +457,6 @@
                 .setCancelable(false)
                 .create();
             mEffectDialog.show();
-            mEffectDialog.findViewById(com.android.internal.R.id.titleDivider)
-                .setBackgroundResource(R.color.highlight);
         }
     }
 
diff --git a/src/com/android/gallery3d/ui/AbstractSlotRenderer.java b/src/com/android/gallery3d/ui/AbstractSlotRenderer.java
index e9190e3..f5a0809 100644
--- a/src/com/android/gallery3d/ui/AbstractSlotRenderer.java
+++ b/src/com/android/gallery3d/ui/AbstractSlotRenderer.java
@@ -78,7 +78,7 @@
         int side = Math.min(width, height) / 6;
         if (!isGridViewShown)
             width = thumbSize;
-        mVideoPlayIcon.draw(canvas, (width - side) / 2, (height - side) / 2, side, side);
+        mVideoPlayIcon.draw(canvas, width / 8 - side / 2, height * 7 / 8 - side / 2, side, side);
     }
 
     protected void drawDrmOverlay(GLCanvas canvas, int width, int height, int Drm_mediaType,
diff --git a/src/com/android/gallery3d/ui/Knob.java b/src/com/android/gallery3d/ui/Knob.java
index 179023e..b427c2f 100644
--- a/src/com/android/gallery3d/ui/Knob.java
+++ b/src/com/android/gallery3d/ui/Knob.java
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2013, The Linux Foundation. All rights reserved.
+ * Copyright (c) 2013, 2016, 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
@@ -114,6 +114,7 @@
         mDisabledColor = res.getColor(R.color.disabled_knob);
 
         ((ImageView) findViewById(R.id.knob_foreground)).setImageResource(foreground);
+        ((ImageView) findViewById(R.id.knob_foreground)).setAlpha(0.35f);
 
         mLabelTV = (TextView) findViewById(R.id.knob_label);
         mLabelTV.setText(label);
diff --git a/src/org/codeaurora/gallery3d/video/ExtensionHelper.java b/src/org/codeaurora/gallery3d/video/ExtensionHelper.java
index b515610..5983512 100755
--- a/src/org/codeaurora/gallery3d/video/ExtensionHelper.java
+++ b/src/org/codeaurora/gallery3d/video/ExtensionHelper.java
@@ -62,7 +62,6 @@
         }
         if (playlist == true) {
             group.addHooker(new MovieListHooker()); // add it for common feature.
-            group.addHooker(new StepOptionSettingsHooker());
         }
         if (speaker == true) {
             group.addHooker(new SpeakerHooker());