1 /* 2 * Copyright (C) 2024 The Android Open Source Project 3 * 4 * Licensed under the Apache License, Version 2.0 (the "License"); 5 * you may not use this file except in compliance with the License. 6 * You may obtain a copy of the License at 7 * 8 * http://www.apache.org/licenses/LICENSE-2.0 9 * 10 * Unless required by applicable law or agreed to in writing, software 11 * distributed under the License is distributed on an "AS IS" BASIS, 12 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 * See the License for the specific language governing permissions and 14 * limitations under the License. 15 */ 16 17 package com.android.systemui.screenshot 18 19 import android.animation.Animator 20 import android.app.Notification 21 import android.content.Context 22 import android.graphics.Bitmap 23 import android.graphics.Rect 24 import android.view.ScrollCaptureResponse 25 import android.view.View 26 import android.view.ViewGroup 27 import android.view.WindowInsets 28 import com.android.systemui.screenshot.scroll.ScrollCaptureController 29 30 /** Abstraction of the surface between ScreenshotController and ScreenshotView */ 31 interface ScreenshotViewProxy { 32 val view: ViewGroup 33 val screenshotPreview: View 34 35 var packageName: String 36 var callbacks: ScreenshotView.ScreenshotViewCallback? 37 var screenshot: ScreenshotData? 38 39 val isAttachedToWindow: Boolean 40 val isDismissing: Boolean 41 val isPendingSharedTransition: Boolean 42 resetnull43 fun reset() 44 fun updateInsets(insets: WindowInsets) 45 fun updateOrientation(insets: WindowInsets) 46 fun createScreenshotDropInAnimation(screenRect: Rect, showFlash: Boolean): Animator 47 fun addQuickShareChip(quickShareAction: Notification.Action) 48 fun setChipIntents(imageData: ScreenshotController.SavedImageData) 49 fun requestDismissal(event: ScreenshotEvent?) 50 51 fun showScrollChip(packageName: String, onClick: Runnable) 52 fun hideScrollChip() 53 fun prepareScrollingTransition( 54 response: ScrollCaptureResponse, 55 screenBitmap: Bitmap, 56 newScreenshot: Bitmap, 57 screenshotTakenInPortrait: Boolean, 58 onTransitionPrepared: Runnable, 59 ) 60 fun startLongScreenshotTransition( 61 transitionDestination: Rect, 62 onTransitionEnd: Runnable, 63 longScreenshot: ScrollCaptureController.LongScreenshot 64 ) 65 fun restoreNonScrollingUi() 66 fun fadeForSharedTransition() 67 68 fun stopInputListening() 69 fun requestFocus() 70 fun announceForAccessibility(string: String) 71 fun prepareEntranceAnimation(runnable: Runnable) 72 73 interface Factory { 74 fun getProxy(context: Context, displayId: Int): ScreenshotViewProxy 75 } 76 } 77