summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorzdi <zdi@codeaurora.org>2016-03-07 17:53:57 +0800
committerSteve Kondik <steve@cyngn.com>2016-09-26 04:54:48 -0700
commit59c0acc1390fe43d5e567032a29e632c266c7ef5 (patch)
tree9a49f431fd0d9b58e6c8c48c579d9ac51bdb33fe
parentd8b1e9a2b1f5926fdb9855d2d0a37acd2e8d46ab (diff)
downloadandroid_packages_apps_Gallery2-59c0acc1390fe43d5e567032a29e632c266c7ef5.tar.gz
android_packages_apps_Gallery2-59c0acc1390fe43d5e567032a29e632c266c7ef5.tar.bz2
android_packages_apps_Gallery2-59c0acc1390fe43d5e567032a29e632c266c7ef5.zip
Gallery2: Modify the UI of audio effect.
Modify the UI of audio effect according to UX specification document. Change-Id: I03b337290f4d8dbf3600ee04c3796a5883c03046 CRs-Fixed: 986763
-rwxr-xr-x[-rw-r--r--]res/drawable-hdpi/knob.pngbin51511 -> 5435 bytes
-rw-r--r--res/drawable-hdpi/switch_thumb_activated.9.pngbin5117 -> 0 bytes
-rwxr-xr-xres/drawable-hdpi/switch_thumb_activated.pngbin0 -> 2594 bytes
-rw-r--r--res/drawable-hdpi/switch_thumb_off.9.pngbin5098 -> 0 bytes
-rwxr-xr-xres/drawable-hdpi/switch_thumb_off.pngbin0 -> 2549 bytes
-rw-r--r--res/layout/audio_effects_dialog.xml57
-rw-r--r--res/layout/audio_effects_title.xml10
-rw-r--r--src/com/android/gallery3d/app/MovieActivity.java8
-rw-r--r--src/com/android/gallery3d/ui/Knob.java3
9 files changed, 52 insertions, 26 deletions
diff --git a/res/drawable-hdpi/knob.png b/res/drawable-hdpi/knob.png
index 1eba937fe..213c20010 100644..100755
--- 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 072aa649c..000000000
--- 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 000000000..5d6c7d8eb
--- /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 45786a309..000000000
--- 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 000000000..733cef674
--- /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 49dcafb56..b2143d643 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 @@ IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
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 fcfb11d1e..2e200d5aa 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 @@ IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
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 @@ IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
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/src/com/android/gallery3d/app/MovieActivity.java b/src/com/android/gallery3d/app/MovieActivity.java
index 3e1aa5323..ad6767f78 100644
--- a/src/com/android/gallery3d/app/MovieActivity.java
+++ b/src/com/android/gallery3d/app/MovieActivity.java
@@ -347,13 +347,13 @@ public class MovieActivity extends Activity {
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);
@@ -403,7 +403,7 @@ public class MovieActivity extends Activity {
});
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() {
@@ -436,8 +436,6 @@ public class MovieActivity extends Activity {
.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/Knob.java b/src/com/android/gallery3d/ui/Knob.java
index 179023e02..b427c2f1e 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 @@ public class Knob extends FrameLayout {
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);