Merge "Standardize screenshot naming scheme"
This commit is contained in:
committed by
Android (Google) Code Review
commit
8936d55c17
@@ -17,7 +17,7 @@
|
||||
<ripple
|
||||
xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
xmlns:androidprv="http://schemas.android.com/apk/prv/res/android"
|
||||
android:color="@color/global_screenshot_button_ripple">
|
||||
android:color="@color/screenshot_button_ripple">
|
||||
<item android:id="@android:id/background">
|
||||
<shape android:shape="rectangle">
|
||||
<solid android:color="?androidprv:attr/colorAccentSecondary"/>
|
||||
|
||||
@@ -17,6 +17,6 @@
|
||||
<shape xmlns:android="http://schemas.android.com/apk/res/android" android:shape="rectangle">
|
||||
<gradient
|
||||
android:angle="90"
|
||||
android:startColor="@color/global_screenshot_background_protection_start"
|
||||
android:startColor="@color/screenshot_background_protection_start"
|
||||
android:endColor="#00000000"/>
|
||||
</shape>
|
||||
@@ -1,42 +0,0 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<!-- Copyright (C) 2011 The Android Open Source Project
|
||||
|
||||
Licensed under the Apache License, Version 2.0 (the "License");
|
||||
you may not use this file except in compliance with the License.
|
||||
You may obtain a copy of the License at
|
||||
|
||||
http://www.apache.org/licenses/LICENSE-2.0
|
||||
|
||||
Unless required by applicable law or agreed to in writing, software
|
||||
distributed under the License is distributed on an "AS IS" BASIS,
|
||||
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
See the License for the specific language governing permissions and
|
||||
limitations under the License.
|
||||
-->
|
||||
<FrameLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent">
|
||||
<ImageView android:id="@+id/global_screenshot_legacy_background"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:src="@android:color/black"
|
||||
android:visibility="gone" />
|
||||
<ImageView android:id="@+id/global_screenshot_legacy"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_gravity="center"
|
||||
android:background="@drawable/screenshot_panel"
|
||||
android:visibility="gone"
|
||||
android:adjustViewBounds="true" />
|
||||
<ImageView android:id="@+id/global_screenshot_legacy_flash"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:src="@android:color/white"
|
||||
android:visibility="gone" />
|
||||
<com.android.systemui.screenshot.ScreenshotSelectorView
|
||||
android:id="@+id/global_screenshot_legacy_selector"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:visibility="gone"
|
||||
android:pointerIcon="crosshair"/>
|
||||
</FrameLayout>
|
||||
@@ -16,7 +16,7 @@
|
||||
-->
|
||||
<com.android.systemui.screenshot.ScreenshotView
|
||||
xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
android:id="@+id/global_screenshot_frame"
|
||||
android:id="@+id/screenshot_frame"
|
||||
android:theme="@style/Screenshot"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
@@ -29,25 +29,25 @@
|
||||
android:clickable="true"
|
||||
android:importantForAccessibility="no"/>
|
||||
<ImageView
|
||||
android:id="@+id/global_screenshot_actions_background"
|
||||
android:id="@+id/screenshot_actions_background"
|
||||
android:layout_height="@dimen/screenshot_bg_protection_height"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_gravity="bottom"
|
||||
android:alpha="0.0"
|
||||
android:src="@drawable/screenshot_actions_background_protection"/>
|
||||
<ImageView
|
||||
android:id="@+id/global_screenshot_flash"
|
||||
android:id="@+id/screenshot_flash"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:visibility="gone"
|
||||
android:elevation="@dimen/screenshot_preview_elevation"
|
||||
android:src="@android:color/white"/>
|
||||
<com.android.systemui.screenshot.ScreenshotSelectorView
|
||||
android:id="@+id/global_screenshot_selector"
|
||||
android:id="@+id/screenshot_selector"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:visibility="gone"
|
||||
android:pointerIcon="crosshair"/>
|
||||
<include layout="@layout/global_screenshot_static"
|
||||
android:id="@+id/global_screenshot_static"/>
|
||||
<include layout="@layout/screenshot_static"
|
||||
android:id="@+id/screenshot_static"/>
|
||||
</com.android.systemui.screenshot.ScreenshotView>
|
||||
@@ -16,7 +16,7 @@
|
||||
-->
|
||||
<com.android.systemui.screenshot.ScreenshotActionChip
|
||||
xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
android:id="@+id/global_screenshot_action_chip"
|
||||
android:id="@+id/screenshot_action_chip"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginStart="@dimen/screenshot_action_chip_margin_start"
|
||||
@@ -20,19 +20,19 @@
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent">
|
||||
<ImageView
|
||||
android:id="@+id/global_screenshot_actions_container_background"
|
||||
android:id="@+id/screenshot_actions_container_background"
|
||||
android:visibility="gone"
|
||||
android:layout_height="0dp"
|
||||
android:layout_width="0dp"
|
||||
android:elevation="1dp"
|
||||
android:background="@drawable/action_chip_container_background"
|
||||
android:layout_marginStart="@dimen/screenshot_action_container_margin_horizontal"
|
||||
app:layout_constraintBottom_toBottomOf="@+id/global_screenshot_actions_container"
|
||||
app:layout_constraintBottom_toBottomOf="@+id/screenshot_actions_container"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintTop_toTopOf="@+id/global_screenshot_actions_container"
|
||||
app:layout_constraintEnd_toEndOf="@+id/global_screenshot_actions_container"/>
|
||||
app:layout_constraintTop_toTopOf="@+id/screenshot_actions_container"
|
||||
app:layout_constraintEnd_toEndOf="@+id/screenshot_actions_container"/>
|
||||
<HorizontalScrollView
|
||||
android:id="@+id/global_screenshot_actions_container"
|
||||
android:id="@+id/screenshot_actions_container"
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginEnd="@dimen/screenshot_action_container_margin_horizontal"
|
||||
@@ -44,23 +44,23 @@
|
||||
app:layout_constraintWidth_percent="1.0"
|
||||
app:layout_constraintWidth_max="wrap"
|
||||
app:layout_constraintBottom_toBottomOf="parent"
|
||||
app:layout_constraintStart_toEndOf="@+id/global_screenshot_preview_border"
|
||||
app:layout_constraintStart_toEndOf="@+id/screenshot_preview_border"
|
||||
app:layout_constraintEnd_toEndOf="parent">
|
||||
<LinearLayout
|
||||
android:id="@+id/global_screenshot_actions"
|
||||
android:id="@+id/screenshot_actions"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content">
|
||||
<include layout="@layout/global_screenshot_action_chip"
|
||||
<include layout="@layout/screenshot_action_chip"
|
||||
android:id="@+id/screenshot_share_chip"/>
|
||||
<include layout="@layout/global_screenshot_action_chip"
|
||||
<include layout="@layout/screenshot_action_chip"
|
||||
android:id="@+id/screenshot_edit_chip"/>
|
||||
<include layout="@layout/global_screenshot_action_chip"
|
||||
<include layout="@layout/screenshot_action_chip"
|
||||
android:id="@+id/screenshot_scroll_chip"
|
||||
android:visibility="gone" />
|
||||
</LinearLayout>
|
||||
</HorizontalScrollView>
|
||||
<View
|
||||
android:id="@+id/global_screenshot_preview_border"
|
||||
android:id="@+id/screenshot_preview_border"
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="0dp"
|
||||
android:layout_marginStart="@dimen/screenshot_offset_x"
|
||||
@@ -78,18 +78,18 @@
|
||||
android:layout_height="wrap_content"
|
||||
app:barrierMargin="4dp"
|
||||
app:barrierDirection="end"
|
||||
app:constraint_referenced_ids="global_screenshot_preview"/>
|
||||
app:constraint_referenced_ids="screenshot_preview"/>
|
||||
<androidx.constraintlayout.widget.Barrier
|
||||
android:id="@+id/screenshot_preview_top"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
app:barrierDirection="top"
|
||||
app:barrierMargin="-4dp"
|
||||
app:constraint_referenced_ids="global_screenshot_preview"/>
|
||||
app:constraint_referenced_ids="screenshot_preview"/>
|
||||
<ImageView
|
||||
android:id="@+id/global_screenshot_preview"
|
||||
android:id="@+id/screenshot_preview"
|
||||
android:visibility="invisible"
|
||||
android:layout_width="@dimen/global_screenshot_x_scale"
|
||||
android:layout_width="@dimen/screenshot_x_scale"
|
||||
android:layout_margin="4dp"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_gravity="center"
|
||||
@@ -98,24 +98,24 @@
|
||||
android:scaleType="fitEnd"
|
||||
android:background="@drawable/screenshot_preview_background"
|
||||
android:adjustViewBounds="true"
|
||||
app:layout_constraintBottom_toBottomOf="@+id/global_screenshot_preview_border"
|
||||
app:layout_constraintStart_toStartOf="@+id/global_screenshot_preview_border"
|
||||
app:layout_constraintEnd_toEndOf="@+id/global_screenshot_preview_border"
|
||||
app:layout_constraintTop_toTopOf="@+id/global_screenshot_preview_border">
|
||||
app:layout_constraintBottom_toBottomOf="@+id/screenshot_preview_border"
|
||||
app:layout_constraintStart_toStartOf="@+id/screenshot_preview_border"
|
||||
app:layout_constraintEnd_toEndOf="@+id/screenshot_preview_border"
|
||||
app:layout_constraintTop_toTopOf="@+id/screenshot_preview_border">
|
||||
</ImageView>
|
||||
<FrameLayout
|
||||
android:id="@+id/global_screenshot_dismiss_button"
|
||||
android:id="@+id/screenshot_dismiss_button"
|
||||
android:layout_width="@dimen/screenshot_dismiss_button_tappable_size"
|
||||
android:layout_height="@dimen/screenshot_dismiss_button_tappable_size"
|
||||
android:elevation="7dp"
|
||||
android:visibility="gone"
|
||||
app:layout_constraintStart_toEndOf="@id/global_screenshot_preview"
|
||||
app:layout_constraintEnd_toEndOf="@id/global_screenshot_preview"
|
||||
app:layout_constraintTop_toTopOf="@id/global_screenshot_preview"
|
||||
app:layout_constraintBottom_toTopOf="@id/global_screenshot_preview"
|
||||
app:layout_constraintStart_toEndOf="@id/screenshot_preview"
|
||||
app:layout_constraintEnd_toEndOf="@id/screenshot_preview"
|
||||
app:layout_constraintTop_toTopOf="@id/screenshot_preview"
|
||||
app:layout_constraintBottom_toTopOf="@id/screenshot_preview"
|
||||
android:contentDescription="@string/screenshot_dismiss_description">
|
||||
<ImageView
|
||||
android:id="@+id/global_screenshot_dismiss_image"
|
||||
android:id="@+id/screenshot_dismiss_image"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:layout_margin="@dimen/screenshot_dismiss_button_margin"
|
||||
@@ -127,16 +127,16 @@
|
||||
android:layout_height="wrap_content"
|
||||
android:scaleType="matrix"
|
||||
android:visibility="gone"
|
||||
app:layout_constraintStart_toStartOf="@id/global_screenshot_preview"
|
||||
app:layout_constraintTop_toTopOf="@id/global_screenshot_preview"
|
||||
app:layout_constraintStart_toStartOf="@id/screenshot_preview"
|
||||
app:layout_constraintTop_toTopOf="@id/screenshot_preview"
|
||||
android:elevation="@dimen/screenshot_preview_elevation"/>
|
||||
<View
|
||||
android:id="@+id/screenshot_transition_view"
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="0dp"
|
||||
android:visibility="invisible"
|
||||
app:layout_constraintStart_toStartOf="@id/global_screenshot_preview"
|
||||
app:layout_constraintTop_toTopOf="@id/global_screenshot_preview"
|
||||
app:layout_constraintEnd_toEndOf="@id/global_screenshot_preview"
|
||||
app:layout_constraintBottom_toBottomOf="@id/global_screenshot_preview"/>
|
||||
app:layout_constraintStart_toStartOf="@id/screenshot_preview"
|
||||
app:layout_constraintTop_toTopOf="@id/screenshot_preview"
|
||||
app:layout_constraintEnd_toEndOf="@id/screenshot_preview"
|
||||
app:layout_constraintBottom_toBottomOf="@id/screenshot_preview"/>
|
||||
</androidx.constraintlayout.widget.ConstraintLayout>
|
||||
@@ -59,14 +59,8 @@
|
||||
<color name="global_actions_alert_text">@color/GM2_red_300</color>
|
||||
|
||||
<!-- Global screenshot actions -->
|
||||
<color name="global_screenshot_button_background">@color/GM2_grey_800</color>
|
||||
<color name="global_screenshot_button_ripple">#42FFFFFF</color>
|
||||
<color name="global_screenshot_button_text">#FFFFFF</color>
|
||||
<color name="global_screenshot_button_border">@color/GM2_grey_600</color>
|
||||
<color name="global_screenshot_button_icon">@color/GM2_blue_300</color>
|
||||
<color name="global_screenshot_dismiss_background">@color/GM2_grey_800</color>
|
||||
<color name="global_screenshot_dismiss_foreground">#FFFFFF</color>
|
||||
<color name="global_screenshot_background_protection_start">#80000000</color> <!-- 50% black -->
|
||||
<color name="screenshot_button_ripple">#42FFFFFF</color>
|
||||
<color name="screenshot_background_protection_start">#80000000</color> <!-- 50% black -->
|
||||
|
||||
<!-- Media -->
|
||||
<color name="media_divider">#85ffffff</color>
|
||||
|
||||
@@ -196,8 +196,8 @@
|
||||
<color name="default_invocation_lights_color">#ffffffff</color> <!-- white -->
|
||||
|
||||
<!-- Global screenshot actions -->
|
||||
<color name="global_screenshot_button_ripple">#1f000000</color>
|
||||
<color name="global_screenshot_background_protection_start">#40000000</color> <!-- 25% black -->
|
||||
<color name="screenshot_button_ripple">#1f000000</color>
|
||||
<color name="screenshot_background_protection_start">#40000000</color> <!-- 25% black -->
|
||||
|
||||
<!-- GM2 colors -->
|
||||
<color name="GM2_grey_50">#F8F9FA</color>
|
||||
|
||||
@@ -322,10 +322,7 @@
|
||||
<!-- Dimensions related to screenshots -->
|
||||
|
||||
<!-- The padding on the global screenshot background image -->
|
||||
<dimen name="global_screenshot_legacy_bg_padding">20dp</dimen>
|
||||
<dimen name="global_screenshot_bg_padding">20dp</dimen>
|
||||
<dimen name="global_screenshot_bg_protection_height">400dp</dimen>
|
||||
<dimen name="global_screenshot_x_scale">80dp</dimen>
|
||||
<dimen name="screenshot_x_scale">80dp</dimen>
|
||||
<dimen name="screenshot_bg_protection_height">242dp</dimen>
|
||||
<dimen name="screenshot_preview_elevation">4dp</dimen>
|
||||
<dimen name="screenshot_offset_y">8dp</dimen>
|
||||
|
||||
@@ -378,8 +378,7 @@ class SaveImageInBackgroundTask extends AsyncTask<Void, Void, Void> {
|
||||
List<Notification.Action> actions, Context context) {
|
||||
List<Notification.Action> broadcastActions = new ArrayList<>();
|
||||
for (Notification.Action action : actions) {
|
||||
// Proxy smart actions through {@link GlobalScreenshot.SmartActionsReceiver}
|
||||
// for logging smart actions.
|
||||
// Proxy smart actions through {@link SmartActionsReceiver} for logging smart actions.
|
||||
Bundle extras = action.getExtras();
|
||||
String actionType = extras.getString(
|
||||
ScreenshotNotificationSmartActionsProvider.ACTION_TYPE,
|
||||
@@ -433,8 +432,7 @@ class SaveImageInBackgroundTask extends AsyncTask<Void, Void, Void> {
|
||||
context, 0, sharingIntent,
|
||||
PendingIntent.FLAG_CANCEL_CURRENT | PendingIntent.FLAG_IMMUTABLE);
|
||||
|
||||
// Proxy smart actions through {@link GlobalScreenshot.SmartActionsReceiver}
|
||||
// for logging smart actions.
|
||||
// Proxy smart actions through {@link SmartActionsReceiver} for logging smart actions.
|
||||
Bundle extras = action.getExtras();
|
||||
String actionType = extras.getString(
|
||||
ScreenshotNotificationSmartActionsProvider.ACTION_TYPE,
|
||||
|
||||
@@ -452,7 +452,7 @@ public class ScreenshotController {
|
||||
|
||||
// Inflate the screenshot layout
|
||||
mScreenshotView = (ScreenshotView)
|
||||
LayoutInflater.from(mContext).inflate(R.layout.global_screenshot, null);
|
||||
LayoutInflater.from(mContext).inflate(R.layout.screenshot, null);
|
||||
mScreenshotView.init(mUiEventLogger, new ScreenshotView.ScreenshotViewCallback() {
|
||||
@Override
|
||||
public void onUserInteraction() {
|
||||
|
||||
@@ -193,7 +193,7 @@ public class ScreenshotView extends FrameLayout implements
|
||||
super(context, attrs, defStyleAttr, defStyleRes);
|
||||
mResources = mContext.getResources();
|
||||
|
||||
mCornerSizeX = mResources.getDimensionPixelSize(R.dimen.global_screenshot_x_scale);
|
||||
mCornerSizeX = mResources.getDimensionPixelSize(R.dimen.screenshot_x_scale);
|
||||
mDismissDeltaY = mResources.getDimensionPixelSize(
|
||||
R.dimen.screenshot_dismissal_height_delta);
|
||||
|
||||
@@ -339,23 +339,23 @@ public class ScreenshotView extends FrameLayout implements
|
||||
@Override // View
|
||||
protected void onFinishInflate() {
|
||||
mScrollingScrim = requireNonNull(findViewById(R.id.screenshot_scrolling_scrim));
|
||||
mScreenshotStatic = requireNonNull(findViewById(R.id.global_screenshot_static));
|
||||
mScreenshotPreview = requireNonNull(findViewById(R.id.global_screenshot_preview));
|
||||
mScreenshotStatic = requireNonNull(findViewById(R.id.screenshot_static));
|
||||
mScreenshotPreview = requireNonNull(findViewById(R.id.screenshot_preview));
|
||||
mTransitionView = requireNonNull(findViewById(R.id.screenshot_transition_view));
|
||||
mScreenshotPreviewBorder = requireNonNull(
|
||||
findViewById(R.id.global_screenshot_preview_border));
|
||||
findViewById(R.id.screenshot_preview_border));
|
||||
mScreenshotPreview.setClipToOutline(true);
|
||||
|
||||
mActionsContainerBackground = requireNonNull(findViewById(
|
||||
R.id.global_screenshot_actions_container_background));
|
||||
mActionsContainer = requireNonNull(findViewById(R.id.global_screenshot_actions_container));
|
||||
mActionsView = requireNonNull(findViewById(R.id.global_screenshot_actions));
|
||||
R.id.screenshot_actions_container_background));
|
||||
mActionsContainer = requireNonNull(findViewById(R.id.screenshot_actions_container));
|
||||
mActionsView = requireNonNull(findViewById(R.id.screenshot_actions));
|
||||
mBackgroundProtection = requireNonNull(
|
||||
findViewById(R.id.global_screenshot_actions_background));
|
||||
mDismissButton = requireNonNull(findViewById(R.id.global_screenshot_dismiss_button));
|
||||
findViewById(R.id.screenshot_actions_background));
|
||||
mDismissButton = requireNonNull(findViewById(R.id.screenshot_dismiss_button));
|
||||
mScrollablePreview = requireNonNull(findViewById(R.id.screenshot_scrollable_preview));
|
||||
mScreenshotFlash = requireNonNull(findViewById(R.id.global_screenshot_flash));
|
||||
mScreenshotSelectorView = requireNonNull(findViewById(R.id.global_screenshot_selector));
|
||||
mScreenshotFlash = requireNonNull(findViewById(R.id.screenshot_flash));
|
||||
mScreenshotSelectorView = requireNonNull(findViewById(R.id.screenshot_selector));
|
||||
mShareChip = requireNonNull(mActionsContainer.findViewById(R.id.screenshot_share_chip));
|
||||
mEditChip = requireNonNull(mActionsContainer.findViewById(R.id.screenshot_edit_chip));
|
||||
mScrollChip = requireNonNull(mActionsContainer.findViewById(R.id.screenshot_scroll_chip));
|
||||
@@ -452,7 +452,7 @@ public class ScreenshotView extends FrameLayout implements
|
||||
mOrientationPortrait = (orientation == ORIENTATION_PORTRAIT);
|
||||
updateInsets(insets);
|
||||
int screenshotFixedSize =
|
||||
mContext.getResources().getDimensionPixelSize(R.dimen.global_screenshot_x_scale);
|
||||
mContext.getResources().getDimensionPixelSize(R.dimen.screenshot_x_scale);
|
||||
ViewGroup.LayoutParams params = mScreenshotPreview.getLayoutParams();
|
||||
if (mOrientationPortrait) {
|
||||
params.width = screenshotFixedSize;
|
||||
@@ -748,7 +748,7 @@ public class ScreenshotView extends FrameLayout implements
|
||||
|
||||
for (Notification.Action smartAction : imageData.smartActions) {
|
||||
ScreenshotActionChip actionChip = (ScreenshotActionChip) inflater.inflate(
|
||||
R.layout.global_screenshot_action_chip, mActionsView, false);
|
||||
R.layout.screenshot_action_chip, mActionsView, false);
|
||||
actionChip.setText(smartAction.title);
|
||||
actionChip.setIcon(smartAction.getIcon(), false);
|
||||
actionChip.setPendingIntent(smartAction.actionIntent,
|
||||
@@ -767,7 +767,7 @@ public class ScreenshotView extends FrameLayout implements
|
||||
if (mPendingInteraction == null) {
|
||||
LayoutInflater inflater = LayoutInflater.from(mContext);
|
||||
mQuickShareChip = (ScreenshotActionChip) inflater.inflate(
|
||||
R.layout.global_screenshot_action_chip, mActionsView, false);
|
||||
R.layout.screenshot_action_chip, mActionsView, false);
|
||||
mQuickShareChip.setText(quickShareAction.title);
|
||||
mQuickShareChip.setIcon(quickShareAction.getIcon(), false);
|
||||
mQuickShareChip.setOnClickListener(v -> {
|
||||
|
||||
Reference in New Issue
Block a user