Commit 1617fecb authored by Finnur Thorarinsson's avatar Finnur Thorarinsson Committed by Commit Bot

[Android] Photo Picker: Update large video play button to match mocks.

The small blue Play button was used when in full screen mode,
but with this CL it changes to a centered large Play button.

Bug: 895776, 656015
Change-Id: I502d77d0cc3d88a57e4b251b152651b1a4b6311f
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1970475
Auto-Submit: Finnur Thorarinsson <finnur@chromium.org>
Commit-Queue: Boris Sazonov <bsazonov@chromium.org>
Reviewed-by: default avatarBoris Sazonov <bsazonov@chromium.org>
Cr-Commit-Position: refs/heads/master@{#726390}
parent af8229a0
......@@ -61,6 +61,15 @@
</LinearLayout>
</FrameLayout>
<ImageView
android:id="@+id/large_play_button"
android:layout_width="48dp"
android:layout_height="48dp"
android:layout_gravity="center"
android:contentDescription="@string/accessibility_play_video"
android:visibility="gone"
app:srcCompat="@drawable/ic_play_circle_24dp_white" />
<ImageView
android:id="@+id/selected"
android:layout_width="26dp"
......
......@@ -80,6 +80,9 @@ public class PickerBitmapView extends SelectableItemView<PickerBitmap> {
// The Play button in the top right corner. Only shown for videos.
private ImageView mPlayButton;
// The large Play button (in the middle when in full-screen mode). Only shown for videos.
private ImageView mPlayButtonLarge;
// The little shader in the top left corner (provides backdrop for selection ring on
// unfavorable image backgrounds).
private ImageView mScrim;
......@@ -133,6 +136,8 @@ public class PickerBitmapView extends SelectableItemView<PickerBitmap> {
mVideoDuration = findViewById(R.id.video_duration);
mPlayButton = findViewById(R.id.small_play_button);
mPlayButton.setOnClickListener(this);
mPlayButtonLarge = findViewById(R.id.large_play_button);
mPlayButtonLarge.setOnClickListener(this);
}
@Override
......@@ -160,7 +165,7 @@ public class PickerBitmapView extends SelectableItemView<PickerBitmap> {
@Override
public final void onClick(View view) {
if (view == mPlayButton) {
if (view == mPlayButton || view == mPlayButtonLarge) {
mCategoryView.playVideo(mBitmapDetails.getUri());
} else {
super.onClick(view);
......@@ -448,6 +453,7 @@ public class PickerBitmapView extends SelectableItemView<PickerBitmap> {
private void resetTile() {
mBitmapDetails = null;
mIconView.setImageBitmap(null);
mPlayButtonLarge.setVisibility(View.GONE);
mVideoDuration.setText("");
mVideoControlsSmall.setVisibility(View.GONE);
mUnselectedView.setVisibility(View.GONE);
......@@ -490,9 +496,15 @@ public class PickerBitmapView extends SelectableItemView<PickerBitmap> {
&& mCategoryView.isMultiSelectAllowed();
mUnselectedView.setVisibility(showUnselectedToggle ? View.VISIBLE : View.GONE);
mScrim.setVisibility(showUnselectedToggle ? View.VISIBLE : View.GONE);
mVideoControlsSmall.setVisibility(
mImageLoaded && mBitmapDetails.type() == PickerBitmap.TileTypes.VIDEO ? View.VISIBLE
boolean showVideoControls =
mImageLoaded && mBitmapDetails.type() == PickerBitmap.TileTypes.VIDEO;
mVideoControlsSmall.setVisibility(showVideoControls && !mCategoryView.isInMagnifyingMode()
? View.VISIBLE
: View.GONE);
mPlayButtonLarge.setVisibility(
showVideoControls && mCategoryView.isInMagnifyingMode() ? View.VISIBLE : View.GONE);
if (!special) {
updateSelectionBorder(animateBorderChanges);
}
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment