summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorzdi <zdi@codeaurora.org>2016-04-18 15:21:47 +0800
committerGerrit - the friendly Code Review server <code-review@localhost>2016-04-19 21:41:06 -0700
commit63b2c37cc8cdf3c2266f834ed9c9b8ff6f89e380 (patch)
treeba35760902caa8b45d3ebe7575438b37a3e914a8
parent45e77b8fe6a6fb9f30622e7cca76be7d959d27f7 (diff)
downloadandroid_packages_apps_Gallery2-63b2c37cc8cdf3c2266f834ed9c9b8ff6f89e380.tar.gz
android_packages_apps_Gallery2-63b2c37cc8cdf3c2266f834ed9c9b8ff6f89e380.tar.bz2
android_packages_apps_Gallery2-63b2c37cc8cdf3c2266f834ed9c9b8ff6f89e380.zip
Gallery2: Adjust the layout of trim video and Audio+.
Adjust the view of trim and Audio+ according to UX specification document. Change-Id: I20066bace85c1956e7a27e5e63bd6eeeedca183e CRs-Fixed: 1003393
-rw-r--r--res/drawable-hdpi/ic_vidcontrol_reload.pngbin1940 -> 0 bytes
-rw-r--r--res/drawable-mdpi/ic_vidcontrol_reload.pngbin1208 -> 0 bytes
-rw-r--r--res/drawable-sw600dp/ic_vidcontrol_reload.pngbin1940 -> 0 bytes
-rw-r--r--res/drawable-xhdpi/ic_vidcontrol_reload.pngbin2694 -> 0 bytes
-rw-r--r--res/drawable/ic_vidcontrol_reload.xml39
-rw-r--r--res/layout/audio_effects_dialog.xml3
-rwxr-xr-xres/values-zh-rCN/strings.xml6
-rw-r--r--res/values/dimens.xml2
-rwxr-xr-xres/values/strings.xml8
-rwxr-xr-xsrc/com/android/gallery3d/app/TimeBar.java2
-rw-r--r--src/com/android/gallery3d/app/TrimTimeBar.java39
-rw-r--r--src/com/android/gallery3d/app/TrimVideo.java24
12 files changed, 101 insertions, 22 deletions
diff --git a/res/drawable-hdpi/ic_vidcontrol_reload.png b/res/drawable-hdpi/ic_vidcontrol_reload.png
deleted file mode 100644
index bf8d5299c..000000000
--- a/res/drawable-hdpi/ic_vidcontrol_reload.png
+++ /dev/null
Binary files differ
diff --git a/res/drawable-mdpi/ic_vidcontrol_reload.png b/res/drawable-mdpi/ic_vidcontrol_reload.png
deleted file mode 100644
index 51b1f4834..000000000
--- a/res/drawable-mdpi/ic_vidcontrol_reload.png
+++ /dev/null
Binary files differ
diff --git a/res/drawable-sw600dp/ic_vidcontrol_reload.png b/res/drawable-sw600dp/ic_vidcontrol_reload.png
deleted file mode 100644
index bf8d5299c..000000000
--- a/res/drawable-sw600dp/ic_vidcontrol_reload.png
+++ /dev/null
Binary files differ
diff --git a/res/drawable-xhdpi/ic_vidcontrol_reload.png b/res/drawable-xhdpi/ic_vidcontrol_reload.png
deleted file mode 100644
index 2aaf4919a..000000000
--- a/res/drawable-xhdpi/ic_vidcontrol_reload.png
+++ /dev/null
Binary files differ
diff --git a/res/drawable/ic_vidcontrol_reload.xml b/res/drawable/ic_vidcontrol_reload.xml
new file mode 100644
index 000000000..c0a42844a
--- /dev/null
+++ b/res/drawable/ic_vidcontrol_reload.xml
@@ -0,0 +1,39 @@
+<?xml version="1.0" encoding="utf-8"?>
+<!--
+ Copyright (c) 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
+ 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.
+-->
+
+<vector xmlns:android="http://schemas.android.com/apk/res/android"
+ android:width="60dp"
+ android:height="60dp"
+ android:viewportHeight="144.0"
+ android:viewportWidth="144.0">
+ <path
+ android:fillColor="#FFFFFFFF"
+ android:pathData="M72,42V32L58,46l14,14V50c12.2,0 22,9.8 22,22c0,12.2 -9.8,22 -22,22s-22,-9.8 -22,-22c0,-5.7 2.2,-11 5.8,-14.9l-5.7,-5.6C45.1,56.9 42,64.1 42,72c0,16.6 13.4,30 30,30s30,-13.4 30,-30S88.6,42 72,42z" />
+</vector>
diff --git a/res/layout/audio_effects_dialog.xml b/res/layout/audio_effects_dialog.xml
index b2143d643..a14cd1e54 100644
--- a/res/layout/audio_effects_dialog.xml
+++ b/res/layout/audio_effects_dialog.xml
@@ -54,6 +54,7 @@ IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
<RelativeLayout
android:layout_width="wrap_content"
android:layout_height="wrap_content"
+ android:layout_marginStart="12dp"
android:layout_weight="1">
<com.android.gallery3d.ui.Knob
android:id="@+id/bBStrengthKnob"
@@ -74,7 +75,7 @@ IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
<RelativeLayout
android:layout_width="wrap_content"
android:layout_height="wrap_content"
- android:layout_marginEnd="24dp"
+ android:layout_marginEnd="12dp"
android:layout_alignParentRight="true"
android:layout_weight="1">
<com.android.gallery3d.ui.Knob
diff --git a/res/values-zh-rCN/strings.xml b/res/values-zh-rCN/strings.xml
index ce3518de0..d2ec99f57 100755
--- a/res/values-zh-rCN/strings.xml
+++ b/res/values-zh-rCN/strings.xml
@@ -450,7 +450,7 @@
</plurals>
<string name="bass_boost_strength" msgid="882301530007752270">"低音增强"</string>
- <string name="virtualizer_strength" msgid="5035111173763913313">"3D 音效"</string>
+ <string name="virtualizer_strength" msgid="5035111173763913313">"环绕声"</string>
<string name="audio_effects" msgid="612896145300512593">"音效"</string>
<string name="headset_plug">“插入耳机体验音效”</string>
<string name="text_makeup_whiten">美白</string>
@@ -468,4 +468,8 @@
<string name="action_viewtype_list">列表视图</string>
<string name="tvEmptyAlbum">没有图片</string>
<string name="tvEmptyVideos">没有视频</string>
+
+ <string name="trim_video_exit_title">放弃更改?</string>
+ <string name="trim_video_exit_msg">是否放弃对当前影片的操作?</string>
+ <string name="trim_video_exit_discard">放弃</string>
</resources>
diff --git a/res/values/dimens.xml b/res/values/dimens.xml
index a3115eb7c..ea0ced68e 100644
--- a/res/values/dimens.xml
+++ b/res/values/dimens.xml
@@ -209,5 +209,7 @@
<dimen name="timeline_title_font_size">14sp</dimen>
<dimen name="timebar_height">60dp</dimen>
+ <dimen name="timebar_margin">30dp</dimen>
+ <dimen name="timebar_time_margin">45dp</dimen>
<dimen name="livestream_icon_padding">12dp</dimen>
</resources>
diff --git a/res/values/strings.xml b/res/values/strings.xml
index 7d33f8a15..336962488 100755
--- a/res/values/strings.xml
+++ b/res/values/strings.xml
@@ -1,5 +1,5 @@
<?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.
Not a Contribution.
Copyright (C) 2007 The Android Open Source Project
@@ -1145,7 +1145,7 @@ CHAR LIMIT = NONE] -->
<string name="bass_boost_strength">Bass boost</string>
<!-- The label for the 3d effect knob of the audio effects dialog. -->
- <string name="virtualizer_strength">3D effect</string>
+ <string name="virtualizer_strength">Surround sound</string>
<!-- The label for the audio effects menu. -->
<string name="audio_effects">Audio effects</string>
@@ -1193,4 +1193,8 @@ CHAR LIMIT = NONE] -->
<string name="seestraight_acts">See Straight</string>
<string name="seestraight_input_image_is_small">Input image is too small to process.</string>
<string name="seestraight_process_fail">Couldn\'t process the image.</string>
+
+ <string name="trim_video_exit_title">Discard changes?</string>
+ <string name="trim_video_exit_msg">Discard the changes made to this video?</string>
+ <string name="trim_video_exit_discard">DISCARD</string>
</resources>
diff --git a/src/com/android/gallery3d/app/TimeBar.java b/src/com/android/gallery3d/app/TimeBar.java
index aed8eeccc..f66dfdfcd 100755
--- a/src/com/android/gallery3d/app/TimeBar.java
+++ b/src/com/android/gallery3d/app/TimeBar.java
@@ -91,7 +91,7 @@ public class TimeBar extends View {
private ITimeBarSecondaryProgressExt mSecondaryProgressExt = new TimeBarSecondaryProgressExtImpl();
private ITimeBarInfoExt mInfoExt = new TimeBarInfoExtImpl();
- private ITimeBarLayoutExt mLayoutExt = new TimeBarLayoutExtImpl();
+ protected ITimeBarLayoutExt mLayoutExt = new TimeBarLayoutExtImpl();
public TimeBar(Context context, Listener listener) {
super(context);
diff --git a/src/com/android/gallery3d/app/TrimTimeBar.java b/src/com/android/gallery3d/app/TrimTimeBar.java
index 7e26b2860..8dad597a1 100644
--- a/src/com/android/gallery3d/app/TrimTimeBar.java
+++ b/src/com/android/gallery3d/app/TrimTimeBar.java
@@ -49,6 +49,9 @@ public class TrimTimeBar extends TimeBar {
private int mTrimStartTime;
private int mTrimEndTime;
+ private int mTimeBarMargin;
+ private int mTimeBarTimeMargin;
+
private final Bitmap mTrimStartScrubber;
private final Bitmap mTrimEndScrubber;
public TrimTimeBar(Context context, Listener listener) {
@@ -69,6 +72,9 @@ public class TrimTimeBar extends TimeBar {
// touch padding since we have 3 scrubbers now.
mScrubberPadding = 0;
mVPaddingInPx = mVPaddingInPx * 3 / 2;
+ mTimeBarMargin = context.getResources().getDimensionPixelSize(R.dimen.timebar_margin);
+ mTimeBarTimeMargin = context.getResources().
+ getDimensionPixelSize(R.dimen.timebar_time_margin);
}
private int getBarPosFromTime(int time) {
@@ -174,14 +180,14 @@ public class TrimTimeBar extends TimeBar {
if (mShowTimes) {
margin += mTimeBounds.width();
}
- int progressY = h / 4;
- int scrubberY = progressY - mScrubber.getHeight() / 2 + 1;
- mScrubberTop = scrubberY;
+ margin = mLayoutExt.getProgressMargin(margin);
+ int progressY = (h + mScrubberPadding) / 2;
mTrimStartScrubberTop = progressY;
mTrimEndScrubberTop = progressY;
+ mScrubberTop = progressY - mScrubber.getHeight() / 2 + 1;
mProgressBar.set(
- getPaddingLeft() + margin, progressY,
- w - getPaddingRight() - margin, progressY + 6);
+ mTimeBarMargin + margin, progressY,
+ w - mTimeBarMargin - margin, progressY + 6);
}
update();
}
@@ -191,18 +197,19 @@ public class TrimTimeBar extends TimeBar {
// draw progress bars
canvas.drawRect(mProgressBar, mProgressPaint);
canvas.drawRect(mPlayedBar, mPlayedPaint);
-
if (mShowTimes) {
- canvas.drawText(
- stringForTime(mTrimStartTime),
- mTimeBounds.width() / 2 + getPaddingLeft(),
- mTimeBounds.height() / 2 + mTrimStartScrubberTop,
- mTimeTextPaint);
- canvas.drawText(
- stringForTime(mTrimEndTime),
- getWidth() - getPaddingRight() - mTimeBounds.width() / 2,
- mTimeBounds.height() / 2 + mTrimStartScrubberTop,
- mTimeTextPaint);
+ canvas.drawText(
+ stringForTime(mCurrentTime),
+ mTimeBarTimeMargin,
+ mTimeBounds.height() + mVPaddingInPx / 2 + mScrubberPadding -
+ mLayoutExt.getProgressOffset(mTimeBounds),
+ mTimeTextPaint);
+ canvas.drawText(
+ stringForTime(mTotalTime),
+ getWidth() - mTimeBarTimeMargin,
+ mTimeBounds.height() + mVPaddingInPx / 2 + mScrubberPadding -
+ mLayoutExt.getProgressOffset(mTimeBounds),
+ mTimeTextPaint);
}
// draw extra scrubbers
diff --git a/src/com/android/gallery3d/app/TrimVideo.java b/src/com/android/gallery3d/app/TrimVideo.java
index 37da98a4e..6905e62d5 100644
--- a/src/com/android/gallery3d/app/TrimVideo.java
+++ b/src/com/android/gallery3d/app/TrimVideo.java
@@ -18,8 +18,10 @@ package com.android.gallery3d.app;
import android.app.ActionBar;
import android.app.Activity;
+import android.app.AlertDialog;
import android.app.ProgressDialog;
import android.content.Context;
+import android.content.DialogInterface;
import android.content.Intent;
import android.media.MediaPlayer;
import android.net.Uri;
@@ -50,6 +52,7 @@ public class TrimVideo extends Activity implements
private TextView mSaveVideoTextView;
private ImageView mExitImageView;
private TrimControllerOverlay mController;
+ private AlertDialog mExitDialog;
private Context mContext;
private Uri mUri;
private final Handler mHandler = new Handler();
@@ -89,7 +92,26 @@ public class TrimVideo extends Activity implements
mExitImageView.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
- finish();
+ mExitDialog = new AlertDialog.Builder(TrimVideo.this,
+ AlertDialog.THEME_DEVICE_DEFAULT_LIGHT).
+ setTitle(R.string.trim_video_exit_title).
+ setMessage(R.string.trim_video_exit_msg).
+ setPositiveButton(R.string.trim_video_exit_discard,
+ new DialogInterface.OnClickListener() {
+ @Override
+ public void onClick(DialogInterface dialog, int which) {
+ finish();
+ }
+ }).
+ setNegativeButton(R.string.review_cancel,
+ new DialogInterface.OnClickListener() {
+ @Override
+ public void onClick(DialogInterface dialog, int which) {
+ dialog.dismiss();
+ }
+ }).
+ create();
+ mExitDialog.show();
}
});