Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 7548f9fa authored by Treehugger Robot's avatar Treehugger Robot Committed by Android (Google) Code Review
Browse files

Merge changes I45ede2eb,Ie802e1fe,If7be9b12,I33e66103,I520affe2, ... into 24D1-dev

* changes:
  Screenshot shelf (xml version)
  Remove obsolete classes ActionProxyReceiver and DeleteScreenshotReceiver
  Move screenshot scroll capture code into its own package
  Use AssistedFactory for ScreenshotViewProxy
  Move more code into ScreenshotViewProxy
  Move dismissal logic into the ScreenshotViewProxy
  Simplify ScreenshotController/ViewProxy interface
  Abstract out surface between ScreenshotController and ScreenshotView
  Switch to using withContext in ScreenshotSoundController
parents 3f115039 6b2d650d
Loading
Loading
Loading
Loading
+1 −10
Original line number Diff line number Diff line
@@ -430,7 +430,7 @@
            </intent-filter>
        </receiver>

        <activity android:name=".screenshot.LongScreenshotActivity"
        <activity android:name=".screenshot.scroll.LongScreenshotActivity"
                  android:theme="@style/LongScreenshotActivity"
                  android:process=":screenshot"
                  android:exported="false"
@@ -525,15 +525,6 @@
            </intent-filter>
        </activity-alias>

        <!-- Springboard for launching the share and edit activity. This needs to be in the main
             system ui process since we need to notify the status bar to dismiss the keyguard -->
        <receiver android:name=".screenshot.ActionProxyReceiver"
            android:exported="false" />

        <!-- Callback for deleting screenshot notification -->
        <receiver android:name=".screenshot.DeleteScreenshotReceiver"
            android:exported="false" />

        <!-- Callback for invoking a smart action from the screenshot notification. -->
        <receiver android:name=".screenshot.SmartActionsReceiver"
                  android:exported="false"/>
+7 −0
Original line number Diff line number Diff line
@@ -404,6 +404,13 @@ flag {
    bug: "309933761"
}

flag {
    name: "screenshot_shelf_ui"
    namespace: "systemui"
    description: "Use new shelf UI flow for screenshots"
    bug: "329659738"
}

flag {
   name: "run_fingerprint_detect_on_dismissible_keyguard"
   namespace: "systemui"
+1 −1
Original line number Diff line number Diff line
@@ -69,7 +69,7 @@
        tools:minHeight="100dp"
        tools:minWidth="100dp" />

    <com.android.systemui.screenshot.CropView
    <com.android.systemui.screenshot.scroll.CropView
        android:id="@+id/crop_view"
        android:layout_width="0px"
        android:layout_height="0px"
+2 −2
Original line number Diff line number Diff line
@@ -100,7 +100,7 @@
        app:layout_constraintStart_toStartOf="parent"
        android:transitionName="screenshot_preview_image"/>

    <com.android.systemui.screenshot.CropView
    <com.android.systemui.screenshot.scroll.CropView
        android:id="@+id/crop_view"
        android:layout_width="0px"
        android:layout_height="0px"
@@ -122,7 +122,7 @@
        tools:minHeight="100dp"
        tools:minWidth="100dp" />

    <com.android.systemui.screenshot.MagnifierView
    <com.android.systemui.screenshot.scroll.MagnifierView
        android:id="@+id/magnifier"
        android:visibility="invisible"
        android:layout_width="200dp"
+160 −0
Original line number Diff line number Diff line
<?xml version="1.0" encoding="utf-8"?>
<!--
  ~ Copyright (C) 2024 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.
  -->
<com.android.systemui.screenshot.ui.ScreenshotShelfView
    xmlns:android="http://schemas.android.com/apk/res/android"
    xmlns:androidprv="http://schemas.android.com/apk/prv/res/android"
    xmlns:app="http://schemas.android.com/apk/res-auto"
    android:layout_width="match_parent"
    android:layout_height="match_parent">
    <ImageView
        android:id="@+id/actions_container_background"
        android:visibility="gone"
        android:layout_height="0dp"
        android:layout_width="0dp"
        android:elevation="4dp"
        android:background="@drawable/action_chip_container_background"
        android:layout_marginStart="@dimen/overlay_action_container_margin_horizontal"
        android:layout_marginBottom="@dimen/overlay_action_container_margin_bottom"
        app:layout_constraintStart_toStartOf="parent"
        app:layout_constraintTop_toTopOf="@+id/actions_container"
        app:layout_constraintEnd_toEndOf="@+id/actions_container"
        app:layout_constraintBottom_toTopOf="@id/guideline"/>
    <HorizontalScrollView
        android:id="@+id/actions_container"
        android:layout_width="0dp"
        android:layout_height="wrap_content"
        android:layout_marginEnd="@dimen/overlay_action_container_margin_horizontal"
        android:paddingEnd="@dimen/overlay_action_container_padding_end"
        android:paddingVertical="@dimen/overlay_action_container_padding_vertical"
        android:elevation="4dp"
        android:scrollbars="none"
        app:layout_constraintHorizontal_bias="0"
        app:layout_constraintWidth_percent="1.0"
        app:layout_constraintWidth_max="wrap"
        app:layout_constraintStart_toEndOf="@+id/screenshot_preview_border"
        app:layout_constraintEnd_toEndOf="parent"
        app:layout_constraintBottom_toBottomOf="@id/actions_container_background">
        <LinearLayout
            android:id="@+id/screenshot_actions"
            android:layout_width="wrap_content"
            android:layout_height="wrap_content">
            <include layout="@layout/overlay_action_chip"
                     android:id="@+id/screenshot_share_chip"/>
            <include layout="@layout/overlay_action_chip"
                     android:id="@+id/screenshot_edit_chip"/>
            <include layout="@layout/overlay_action_chip"
                     android:id="@+id/screenshot_scroll_chip"
                     android:visibility="gone" />
        </LinearLayout>
    </HorizontalScrollView>
    <View
        android:id="@+id/screenshot_preview_border"
        android:layout_width="0dp"
        android:layout_height="0dp"
        android:layout_marginStart="16dp"
        android:layout_marginTop="@dimen/overlay_border_width_neg"
        android:layout_marginEnd="@dimen/overlay_border_width_neg"
        android:layout_marginBottom="14dp"
        android:elevation="8dp"
        android:background="@drawable/overlay_border"
        app:layout_constraintStart_toStartOf="parent"
        app:layout_constraintTop_toTopOf="@id/screenshot_preview"
        app:layout_constraintEnd_toEndOf="@id/screenshot_preview"
        app:layout_constraintBottom_toBottomOf="parent"/>
    <ImageView
        android:id="@+id/screenshot_preview"
        android:layout_width="@dimen/overlay_x_scale"
        android:layout_height="wrap_content"
        android:layout_marginStart="@dimen/overlay_border_width"
        android:layout_marginBottom="@dimen/overlay_border_width"
        android:layout_gravity="center"
        android:elevation="8dp"
        android:contentDescription="@string/screenshot_edit_description"
        android:scaleType="fitEnd"
        android:background="@drawable/overlay_preview_background"
        android:adjustViewBounds="true"
        android:clickable="true"
        app:layout_constraintStart_toStartOf="@id/screenshot_preview_border"
        app:layout_constraintBottom_toBottomOf="@id/screenshot_preview_border"/>
    <ImageView
        android:id="@+id/screenshot_badge"
        android:layout_width="56dp"
        android:layout_height="56dp"
        android:visibility="gone"
        android:elevation="9dp"
        app:layout_constraintBottom_toBottomOf="@id/screenshot_preview_border"
        app:layout_constraintEnd_toEndOf="@id/screenshot_preview_border"/>
    <FrameLayout
        android:id="@+id/screenshot_dismiss_button"
        android:layout_width="@dimen/overlay_dismiss_button_tappable_size"
        android:layout_height="@dimen/overlay_dismiss_button_tappable_size"
        android:elevation="11dp"
        android:visibility="gone"
        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/screenshot_dismiss_image"
            android:layout_width="match_parent"
            android:layout_height="match_parent"
            android:layout_margin="@dimen/overlay_dismiss_button_margin"
            android:background="@drawable/circular_background"
            android:backgroundTint="?androidprv:attr/materialColorPrimary"
            android:tint="?androidprv:attr/materialColorOnPrimary"
            android:padding="4dp"
            android:src="@drawable/ic_close"/>
    </FrameLayout>
    <ImageView
        android:id="@+id/screenshot_scrollable_preview"
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:scaleType="matrix"
        android:visibility="gone"
        app:layout_constraintStart_toStartOf="@id/screenshot_preview"
        app:layout_constraintTop_toTopOf="@id/screenshot_preview"
        android:elevation="7dp"/>

    <androidx.constraintlayout.widget.Guideline
        android:id="@+id/guideline"
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:orientation="horizontal"
        app:layout_constraintGuide_end="0dp" />

    <FrameLayout
        android:id="@+id/screenshot_message_container"
        android:layout_width="0dp"
        android:layout_height="wrap_content"
        android:layout_marginHorizontal="@dimen/overlay_action_container_margin_horizontal"
        android:layout_marginTop="4dp"
        android:layout_marginBottom="@dimen/overlay_action_container_margin_bottom"
        android:paddingHorizontal="@dimen/overlay_action_container_padding_end"
        android:paddingVertical="@dimen/overlay_action_container_padding_vertical"
        android:elevation="4dp"
        android:background="@drawable/action_chip_container_background"
        android:visibility="gone"
        app:layout_constraintTop_toBottomOf="@id/guideline"
        app:layout_constraintStart_toStartOf="parent"
        app:layout_constraintEnd_toEndOf="parent"
        app:layout_constraintWidth_max="450dp"
        app:layout_constraintHorizontal_bias="0">
        <include layout="@layout/screenshot_work_profile_first_run" />
        <include layout="@layout/screenshot_detection_notice" />
    </FrameLayout>
</com.android.systemui.screenshot.ui.ScreenshotShelfView>
Loading