Loading packages/SystemUI/res/layout/screenshot_shelf.xml +9 −1 Original line number Diff line number Diff line Loading @@ -135,11 +135,12 @@ android:id="@+id/screenshot_scrollable_preview" android:layout_width="wrap_content" android:layout_height="wrap_content" android:clipToOutline="true" android:scaleType="matrix" android:visibility="gone" app:layout_constraintStart_toStartOf="@id/screenshot_preview" app:layout_constraintTop_toTopOf="@id/screenshot_preview" android:elevation="7dp"/> android:elevation="3dp"/> <androidx.constraintlayout.widget.Guideline android:id="@+id/guideline" Loading Loading @@ -169,6 +170,13 @@ <include layout="@layout/screenshot_detection_notice" /> </FrameLayout> </androidx.constraintlayout.widget.ConstraintLayout> <ImageView android:id="@+id/screenshot_scrolling_scrim" android:layout_width="match_parent" android:layout_height="match_parent" android:visibility="gone" android:clickable="true" android:importantForAccessibility="no"/> <ImageView android:id="@+id/screenshot_flash" android:layout_width="match_parent" Loading packages/SystemUI/src/com/android/systemui/screenshot/ActionExecutor.kt +14 −7 Original line number Diff line number Diff line Loading @@ -25,7 +25,6 @@ import android.content.Intent import android.os.UserHandle import android.util.Log import android.util.Pair import android.view.View import android.view.Window import com.android.app.tracing.coroutines.launch import com.android.internal.app.ChooserActivity Loading @@ -41,8 +40,8 @@ constructor( private val intentExecutor: ActionIntentExecutor, @Application private val applicationScope: CoroutineScope, @Assisted val window: Window, @Assisted val transitionView: View, @Assisted val onDismiss: (() -> Unit) @Assisted val viewProxy: ScreenshotViewProxy, @Assisted val finishDismiss: () -> Unit, ) { var isPendingSharedTransition = false Loading @@ -50,6 +49,7 @@ constructor( fun startSharedTransition(intent: Intent, user: UserHandle, overrideTransition: Boolean) { isPendingSharedTransition = true viewProxy.fadeForSharedTransition() val windowTransition = createWindowTransition() applicationScope.launch("$TAG#launchIntentAsync") { intentExecutor.launchIntent( Loading @@ -70,7 +70,7 @@ constructor( ActivityOptions.MODE_BACKGROUND_ACTIVITY_START_ALLOWED ) pendingIntent.send(options.toBundle()) onDismiss.invoke() viewProxy.requestDismissal(null) } catch (e: PendingIntent.CanceledException) { Log.e(TAG, "Intent cancelled", e) } Loading @@ -89,7 +89,7 @@ constructor( override fun hideSharedElements() { isPendingSharedTransition = false onDismiss.invoke() finishDismiss.invoke() } override fun onFinish() {} Loading @@ -98,13 +98,20 @@ constructor( window, callbacks, null, Pair.create(transitionView, ChooserActivity.FIRST_IMAGE_PREVIEW_TRANSITION_NAME) Pair.create( viewProxy.screenshotPreview, ChooserActivity.FIRST_IMAGE_PREVIEW_TRANSITION_NAME ) ) } @AssistedFactory interface Factory { fun create(window: Window, transitionView: View, onDismiss: (() -> Unit)): ActionExecutor fun create( window: Window, viewProxy: ScreenshotViewProxy, finishDismiss: (() -> Unit) ): ActionExecutor } companion object { Loading packages/SystemUI/src/com/android/systemui/screenshot/ActionIntentCreator.kt +1 −0 Original line number Diff line number Diff line Loading @@ -97,6 +97,7 @@ object ActionIntentCreator { .putExtra(LongScreenshotActivity.EXTRA_SCREENSHOT_USER_HANDLE, owner) .addFlags(Intent.FLAG_ACTIVITY_NEW_TASK) .addFlags(Intent.FLAG_ACTIVITY_CLEAR_TOP) .addFlags(Intent.FLAG_ACTIVITY_NO_ANIMATION) } private const val EXTRA_EDIT_SOURCE = "edit_source" Loading packages/SystemUI/src/com/android/systemui/screenshot/LegacyScreenshotViewProxy.kt +2 −0 Original line number Diff line number Diff line Loading @@ -157,6 +157,8 @@ constructor( override fun restoreNonScrollingUi() = view.restoreNonScrollingUi() override fun fadeForSharedTransition() {} // unused override fun stopInputListening() = view.stopInputListening() override fun requestFocus() { Loading packages/SystemUI/src/com/android/systemui/screenshot/ScreenshotController.java +8 −8 Original line number Diff line number Diff line Loading @@ -317,9 +317,9 @@ public class ScreenshotController { mConfigChanges.applyNewConfig(context.getResources()); reloadAssets(); mActionExecutor = actionExecutorFactory.create(mWindow, mViewProxy.getScreenshotPreview(), mActionExecutor = actionExecutorFactory.create(mWindow, mViewProxy, () -> { requestDismissal(null); finishDismiss(); return Unit.INSTANCE; }); Loading Loading @@ -623,9 +623,11 @@ public class ScreenshotController { (response) -> { mUiEventLogger.log(ScreenshotEvent.SCREENSHOT_LONG_SCREENSHOT_IMPRESSION, 0, response.getPackageName()); if (screenshotShelfUi2() && mActionsProvider != null) { if (screenshotShelfUi2()) { if (mActionsProvider != null) { mActionsProvider.onScrollChipReady( () -> onScrollButtonClicked(owner, response)); } } else { mViewProxy.showScrollChip(response.getPackageName(), () -> onScrollButtonClicked(owner, response)); Loading Loading @@ -657,9 +659,7 @@ public class ScreenshotController { () -> { final Intent intent = ActionIntentCreator.INSTANCE.createLongScreenshotIntent( owner, mContext); mActionIntentExecutor.launchIntentAsync(intent, owner, true, ActivityOptions.makeCustomAnimation(mContext, 0, 0), null); mActionIntentExecutor.launchIntentAsync(intent, owner, true, null, null); }, mViewProxy::restoreNonScrollingUi, mViewProxy::startLongScreenshotTransition); Loading Loading
packages/SystemUI/res/layout/screenshot_shelf.xml +9 −1 Original line number Diff line number Diff line Loading @@ -135,11 +135,12 @@ android:id="@+id/screenshot_scrollable_preview" android:layout_width="wrap_content" android:layout_height="wrap_content" android:clipToOutline="true" android:scaleType="matrix" android:visibility="gone" app:layout_constraintStart_toStartOf="@id/screenshot_preview" app:layout_constraintTop_toTopOf="@id/screenshot_preview" android:elevation="7dp"/> android:elevation="3dp"/> <androidx.constraintlayout.widget.Guideline android:id="@+id/guideline" Loading Loading @@ -169,6 +170,13 @@ <include layout="@layout/screenshot_detection_notice" /> </FrameLayout> </androidx.constraintlayout.widget.ConstraintLayout> <ImageView android:id="@+id/screenshot_scrolling_scrim" android:layout_width="match_parent" android:layout_height="match_parent" android:visibility="gone" android:clickable="true" android:importantForAccessibility="no"/> <ImageView android:id="@+id/screenshot_flash" android:layout_width="match_parent" Loading
packages/SystemUI/src/com/android/systemui/screenshot/ActionExecutor.kt +14 −7 Original line number Diff line number Diff line Loading @@ -25,7 +25,6 @@ import android.content.Intent import android.os.UserHandle import android.util.Log import android.util.Pair import android.view.View import android.view.Window import com.android.app.tracing.coroutines.launch import com.android.internal.app.ChooserActivity Loading @@ -41,8 +40,8 @@ constructor( private val intentExecutor: ActionIntentExecutor, @Application private val applicationScope: CoroutineScope, @Assisted val window: Window, @Assisted val transitionView: View, @Assisted val onDismiss: (() -> Unit) @Assisted val viewProxy: ScreenshotViewProxy, @Assisted val finishDismiss: () -> Unit, ) { var isPendingSharedTransition = false Loading @@ -50,6 +49,7 @@ constructor( fun startSharedTransition(intent: Intent, user: UserHandle, overrideTransition: Boolean) { isPendingSharedTransition = true viewProxy.fadeForSharedTransition() val windowTransition = createWindowTransition() applicationScope.launch("$TAG#launchIntentAsync") { intentExecutor.launchIntent( Loading @@ -70,7 +70,7 @@ constructor( ActivityOptions.MODE_BACKGROUND_ACTIVITY_START_ALLOWED ) pendingIntent.send(options.toBundle()) onDismiss.invoke() viewProxy.requestDismissal(null) } catch (e: PendingIntent.CanceledException) { Log.e(TAG, "Intent cancelled", e) } Loading @@ -89,7 +89,7 @@ constructor( override fun hideSharedElements() { isPendingSharedTransition = false onDismiss.invoke() finishDismiss.invoke() } override fun onFinish() {} Loading @@ -98,13 +98,20 @@ constructor( window, callbacks, null, Pair.create(transitionView, ChooserActivity.FIRST_IMAGE_PREVIEW_TRANSITION_NAME) Pair.create( viewProxy.screenshotPreview, ChooserActivity.FIRST_IMAGE_PREVIEW_TRANSITION_NAME ) ) } @AssistedFactory interface Factory { fun create(window: Window, transitionView: View, onDismiss: (() -> Unit)): ActionExecutor fun create( window: Window, viewProxy: ScreenshotViewProxy, finishDismiss: (() -> Unit) ): ActionExecutor } companion object { Loading
packages/SystemUI/src/com/android/systemui/screenshot/ActionIntentCreator.kt +1 −0 Original line number Diff line number Diff line Loading @@ -97,6 +97,7 @@ object ActionIntentCreator { .putExtra(LongScreenshotActivity.EXTRA_SCREENSHOT_USER_HANDLE, owner) .addFlags(Intent.FLAG_ACTIVITY_NEW_TASK) .addFlags(Intent.FLAG_ACTIVITY_CLEAR_TOP) .addFlags(Intent.FLAG_ACTIVITY_NO_ANIMATION) } private const val EXTRA_EDIT_SOURCE = "edit_source" Loading
packages/SystemUI/src/com/android/systemui/screenshot/LegacyScreenshotViewProxy.kt +2 −0 Original line number Diff line number Diff line Loading @@ -157,6 +157,8 @@ constructor( override fun restoreNonScrollingUi() = view.restoreNonScrollingUi() override fun fadeForSharedTransition() {} // unused override fun stopInputListening() = view.stopInputListening() override fun requestFocus() { Loading
packages/SystemUI/src/com/android/systemui/screenshot/ScreenshotController.java +8 −8 Original line number Diff line number Diff line Loading @@ -317,9 +317,9 @@ public class ScreenshotController { mConfigChanges.applyNewConfig(context.getResources()); reloadAssets(); mActionExecutor = actionExecutorFactory.create(mWindow, mViewProxy.getScreenshotPreview(), mActionExecutor = actionExecutorFactory.create(mWindow, mViewProxy, () -> { requestDismissal(null); finishDismiss(); return Unit.INSTANCE; }); Loading Loading @@ -623,9 +623,11 @@ public class ScreenshotController { (response) -> { mUiEventLogger.log(ScreenshotEvent.SCREENSHOT_LONG_SCREENSHOT_IMPRESSION, 0, response.getPackageName()); if (screenshotShelfUi2() && mActionsProvider != null) { if (screenshotShelfUi2()) { if (mActionsProvider != null) { mActionsProvider.onScrollChipReady( () -> onScrollButtonClicked(owner, response)); } } else { mViewProxy.showScrollChip(response.getPackageName(), () -> onScrollButtonClicked(owner, response)); Loading Loading @@ -657,9 +659,7 @@ public class ScreenshotController { () -> { final Intent intent = ActionIntentCreator.INSTANCE.createLongScreenshotIntent( owner, mContext); mActionIntentExecutor.launchIntentAsync(intent, owner, true, ActivityOptions.makeCustomAnimation(mContext, 0, 0), null); mActionIntentExecutor.launchIntentAsync(intent, owner, true, null, null); }, mViewProxy::restoreNonScrollingUi, mViewProxy::startLongScreenshotTransition); Loading