Gallery2: Adjust the UI in trim video.

Adjust the UI in trim video according to UX specification document.

Change-Id: I46d06355f0f5c835acf123f4d44466306e831a9a
CRs-Fixed: 986776
diff --git a/res/drawable-hdpi/bg_vidcontrol.png b/res/drawable-hdpi/bg_vidcontrol.png
deleted file mode 100644
index dfe2da1..0000000
--- a/res/drawable-hdpi/bg_vidcontrol.png
+++ /dev/null
Binary files differ
diff --git a/res/drawable-hdpi/text_select_handle_left.png b/res/drawable-hdpi/text_select_handle_left.png
index d2ed06d..abefa9e 100644
--- a/res/drawable-hdpi/text_select_handle_left.png
+++ b/res/drawable-hdpi/text_select_handle_left.png
Binary files differ
diff --git a/res/drawable-hdpi/text_select_handle_right.png b/res/drawable-hdpi/text_select_handle_right.png
index e419249..5679a17 100644
--- a/res/drawable-hdpi/text_select_handle_right.png
+++ b/res/drawable-hdpi/text_select_handle_right.png
Binary files differ
diff --git a/res/drawable-mdpi/bg_vidcontrol.png b/res/drawable-mdpi/bg_vidcontrol.png
deleted file mode 100644
index 5a5ce55..0000000
--- a/res/drawable-mdpi/bg_vidcontrol.png
+++ /dev/null
Binary files differ
diff --git a/res/drawable-mdpi/text_select_handle_left.png b/res/drawable-mdpi/text_select_handle_left.png
index 750cdea..2ef6f7c 100644
--- a/res/drawable-mdpi/text_select_handle_left.png
+++ b/res/drawable-mdpi/text_select_handle_left.png
Binary files differ
diff --git a/res/drawable-mdpi/text_select_handle_right.png b/res/drawable-mdpi/text_select_handle_right.png
index fc3d144..9e426c7 100644
--- a/res/drawable-mdpi/text_select_handle_right.png
+++ b/res/drawable-mdpi/text_select_handle_right.png
Binary files differ
diff --git a/res/drawable-sw600dp/bg_vidcontrol.png b/res/drawable-sw600dp/bg_vidcontrol.png
deleted file mode 100644
index dfe2da1..0000000
--- a/res/drawable-sw600dp/bg_vidcontrol.png
+++ /dev/null
Binary files differ
diff --git a/res/drawable-xhdpi/bg_vidcontrol.png b/res/drawable-xhdpi/bg_vidcontrol.png
deleted file mode 100644
index 0eb8148..0000000
--- a/res/drawable-xhdpi/bg_vidcontrol.png
+++ /dev/null
Binary files differ
diff --git a/res/drawable-xhdpi/text_select_handle_left.png b/res/drawable-xhdpi/text_select_handle_left.png
index 98d10c9..cfa3bb0 100644
--- a/res/drawable-xhdpi/text_select_handle_left.png
+++ b/res/drawable-xhdpi/text_select_handle_left.png
Binary files differ
diff --git a/res/drawable-xhdpi/text_select_handle_right.png b/res/drawable-xhdpi/text_select_handle_right.png
index b3a0c9f..90c8869 100644
--- a/res/drawable-xhdpi/text_select_handle_right.png
+++ b/res/drawable-xhdpi/text_select_handle_right.png
Binary files differ
diff --git a/res/drawable-xxhdpi/text_select_handle_left.png b/res/drawable-xxhdpi/text_select_handle_left.png
new file mode 100644
index 0000000..dbfa59c
--- /dev/null
+++ b/res/drawable-xxhdpi/text_select_handle_left.png
Binary files differ
diff --git a/res/drawable-xxhdpi/text_select_handle_right.png b/res/drawable-xxhdpi/text_select_handle_right.png
new file mode 100644
index 0000000..f161017
--- /dev/null
+++ b/res/drawable-xxhdpi/text_select_handle_right.png
Binary files differ
diff --git a/res/drawable/bg_vidcontrol.xml b/res/drawable/bg_vidcontrol.xml
new file mode 100644
index 0000000..fcfacf1
--- /dev/null
+++ b/res/drawable/bg_vidcontrol.xml
@@ -0,0 +1,40 @@
+<?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="24dp"
+    android:height="24dp"
+    android:viewportHeight="48.0"
+    android:viewportWidth="48.0">
+    <path
+        android:fillColor="#FF000000"
+        android:fillAlpha="0.5"
+        android:pathData="M24,24m-24,0a24,24 0,1 1,48 0a24,24 0,1 1,-48 0" />
+</vector>
diff --git a/res/layout/trim_menu.xml b/res/layout/trim_menu.xml
index c46be4c..1642645 100644
--- a/res/layout/trim_menu.xml
+++ b/res/layout/trim_menu.xml
@@ -18,6 +18,11 @@
         android:layout_width="match_parent"
         android:layout_height="match_parent"
         android:layout_centerVertical="true">
+    <ImageView
+        android:id="@+id/exit_trim"
+        android:layout_width="wrap_content"
+        android:layout_height="match_parent"
+        android:src="@drawable/cancel"/>
     <TextView
         android:id="@+id/start_trim"
         android:layout_marginStart="8dp"
@@ -25,8 +30,9 @@
         android:layout_height="match_parent"
         android:text="@string/save"
         android:textAllCaps="true"
-        android:textSize="14sp"
+        android:layout_gravity="right"
+        android:textSize="16sp"
+        android:textColor="@color/primary_text"
         android:gravity="left|center_vertical"
-        android:drawableStart="@drawable/menu_save_photo"
         android:drawablePadding="8dp" />
 </FrameLayout>
diff --git a/res/values/strings.xml b/res/values/strings.xml
index 7bf2876..516c5be 100755
--- a/res/values/strings.xml
+++ b/res/values/strings.xml
@@ -543,7 +543,7 @@
     <string name="pano_progress_text">Rendering panorama</string>
 
     <!-- The label on the button that will save an edited image -->
-    <string name="save" msgid="8140440041190264400">Done</string>
+    <string name="save" msgid="8140440041190264400">Save</string>
 
     <!-- A label representing the action of importing media item(s) [CHAR LIMIT=20] -->
     <string name="ingest_import">@string/Import</string>
diff --git a/src/com/android/gallery3d/app/TimeBar.java b/src/com/android/gallery3d/app/TimeBar.java
index 1d08989..7bd37b1 100755
--- a/src/com/android/gallery3d/app/TimeBar.java
+++ b/src/com/android/gallery3d/app/TimeBar.java
@@ -244,7 +244,7 @@
             mScrubberTop = progressY - mScrubber.getHeight() / 2 + 1;
             mProgressBar.set(
                     getPaddingLeft() + margin, progressY,
-                    w - getPaddingRight() - margin, progressY + 4);
+                    w - getPaddingRight() - margin, progressY + 6);
         }
         update();
     }
diff --git a/src/com/android/gallery3d/app/TrimControllerOverlay.java b/src/com/android/gallery3d/app/TrimControllerOverlay.java
index 9d2e7ae..5bf3b03 100644
--- a/src/com/android/gallery3d/app/TrimControllerOverlay.java
+++ b/src/com/android/gallery3d/app/TrimControllerOverlay.java
@@ -23,6 +23,7 @@
 import android.view.MotionEvent;
 import android.view.View;
 
+import com.android.gallery3d.R;
 import com.android.gallery3d.common.ApiHelper;
 
 /**
@@ -32,6 +33,7 @@
 
     public TrimControllerOverlay(Context context) {
         super(context);
+        mPlayPauseReplayView.setBackgroundResource(R.drawable.bg_vidcontrol);
     }
 
     @Override
diff --git a/src/com/android/gallery3d/app/TrimTimeBar.java b/src/com/android/gallery3d/app/TrimTimeBar.java
index cf66188..7e26b28 100644
--- a/src/com/android/gallery3d/app/TrimTimeBar.java
+++ b/src/com/android/gallery3d/app/TrimTimeBar.java
@@ -181,7 +181,7 @@
             mTrimEndScrubberTop = progressY;
             mProgressBar.set(
                     getPaddingLeft() + margin, progressY,
-                    w - getPaddingRight() - margin, progressY + 4);
+                    w - getPaddingRight() - margin, progressY + 6);
         }
         update();
     }
diff --git a/src/com/android/gallery3d/app/TrimVideo.java b/src/com/android/gallery3d/app/TrimVideo.java
index a52c256..37da98a 100644
--- a/src/com/android/gallery3d/app/TrimVideo.java
+++ b/src/com/android/gallery3d/app/TrimVideo.java
@@ -29,6 +29,7 @@
 import android.view.View;
 import android.view.ViewGroup;
 import android.view.Window;
+import android.widget.ImageView;
 import android.widget.TextView;
 import android.widget.Toast;
 import android.widget.VideoView;
@@ -47,6 +48,7 @@
 
     private VideoView mVideoView;
     private TextView mSaveVideoTextView;
+    private ImageView mExitImageView;
     private TrimControllerOverlay mController;
     private Context mContext;
     private Uri mUri;
@@ -83,6 +85,14 @@
         actionBar.setDisplayOptions(displayOptions, displayOptions);
         actionBar.setCustomView(R.layout.trim_menu);
 
+        mExitImageView = (ImageView) findViewById(R.id.exit_trim);
+        mExitImageView.setOnClickListener(new View.OnClickListener() {
+            @Override
+            public void onClick(View v) {
+                finish();
+            }
+        });
+
         mSaveVideoTextView = (TextView) findViewById(R.id.start_trim);
         mSaveVideoTextView.setOnClickListener(new View.OnClickListener() {
             @Override