Loading packages/SystemUI/multivalentTests/src/com/android/systemui/screenshot/ui/viewmodel/ScreenshotViewModelTest.kt +4 −7 Original line number Diff line number Diff line Loading @@ -16,25 +16,22 @@ package com.android.systemui.screenshot.ui.viewmodel import android.view.accessibility.AccessibilityManager import androidx.test.ext.junit.runners.AndroidJUnit4 import androidx.test.filters.SmallTest import com.android.systemui.SysuiTestCase import com.google.common.truth.Truth.assertThat import org.junit.Test import org.junit.runner.RunWith import org.mockito.Mockito.mock @SmallTest @RunWith(AndroidJUnit4::class) class ScreenshotViewModelTest : SysuiTestCase() { private val accessibilityManager: AccessibilityManager = mock(AccessibilityManager::class.java) private val appearance = ActionButtonAppearance(null, "Label", "Description") private val onclick = {} @Test fun testAddAction() { val viewModel = ScreenshotViewModel(accessibilityManager) val viewModel = ScreenshotViewModel() assertThat(viewModel.actions.value).isEmpty() Loading @@ -50,7 +47,7 @@ class ScreenshotViewModelTest : SysuiTestCase() { @Test fun testRemoveAction() { val viewModel = ScreenshotViewModel(accessibilityManager) val viewModel = ScreenshotViewModel() val firstId = viewModel.addAction(ActionButtonAppearance(null, "", ""), false, {}) val secondId = viewModel.addAction(appearance, false, onclick) Loading @@ -69,7 +66,7 @@ class ScreenshotViewModelTest : SysuiTestCase() { @Test fun testUpdateActionAppearance() { val viewModel = ScreenshotViewModel(accessibilityManager) val viewModel = ScreenshotViewModel() val id = viewModel.addAction(appearance, false, onclick) val otherAppearance = ActionButtonAppearance(null, "Other", "Other") Loading @@ -83,7 +80,7 @@ class ScreenshotViewModelTest : SysuiTestCase() { companion object { init { SysuiTestCase.waitUntilMockitoCanBeInitialized() waitUntilMockitoCanBeInitialized() } } } packages/SystemUI/res/layout/screenshot_shelf.xml +0 −22 Original line number Diff line number Diff line Loading @@ -117,28 +117,6 @@ android:elevation="5dp" 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="7dp" 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:color/materialColorPrimary" android:tint="@androidprv:color/materialColorOnPrimary" android:padding="4dp" android:src="@drawable/ic_close"/> </FrameLayout> <ImageView android:id="@+id/screenshot_scrollable_preview" android:layout_width="wrap_content" Loading packages/SystemUI/src/com/android/systemui/screenshot/dagger/ScreenshotModule.java +0 −9 Original line number Diff line number Diff line Loading @@ -18,7 +18,6 @@ package com.android.systemui.screenshot.dagger; import android.app.Service; import android.content.Context; import android.view.accessibility.AccessibilityManager; import com.android.internal.util.ScreenshotHelper; import com.android.systemui.dagger.SysUISingleton; Loading @@ -38,7 +37,6 @@ import com.android.systemui.screenshot.appclips.AppClipsService; import com.android.systemui.screenshot.message.MessageModule; import com.android.systemui.screenshot.policy.ScreenshotPolicyModule; import com.android.systemui.screenshot.proxy.ScreenshotProxyModule; import com.android.systemui.screenshot.ui.viewmodel.ScreenshotViewModel; import dagger.Binds; import dagger.Module; Loading Loading @@ -83,13 +81,6 @@ public abstract class ScreenshotModule { abstract ScreenshotSoundController bindScreenshotSoundController( ScreenshotSoundControllerImpl screenshotSoundProviderImpl); @Provides @SysUISingleton static ScreenshotViewModel providesScreenshotViewModel( AccessibilityManager accessibilityManager) { return new ScreenshotViewModel(accessibilityManager); } @Provides static InteractiveScreenshotHandler.Factory providesScreenshotController( ScreenshotController.Factory screenshotController) { Loading packages/SystemUI/src/com/android/systemui/screenshot/ui/ScreenshotAnimationController.kt +0 −2 Original line number Diff line number Diff line Loading @@ -63,14 +63,12 @@ class ScreenshotAnimationController( listOf<View>( view.requireViewById(R.id.screenshot_preview_border), view.requireViewById(R.id.screenshot_badge), view.requireViewById(R.id.screenshot_dismiss_button), ) private val fadeUI = listOf<View>( view.requireViewById(R.id.screenshot_preview_border), view.requireViewById(R.id.actions_container_background), view.requireViewById(R.id.screenshot_badge), view.requireViewById(R.id.screenshot_dismiss_button), view.requireViewById(R.id.screenshot_message_container), ) Loading packages/SystemUI/src/com/android/systemui/screenshot/ui/ScreenshotShelfView.kt +0 −3 Original line number Diff line number Diff line Loading @@ -47,7 +47,6 @@ class ScreenshotShelfView(context: Context, attrs: AttributeSet? = null) : private val tmpRect = Rect() private lateinit var actionsContainerBackground: View private lateinit var actionsContainer: View private lateinit var dismissButton: View // Prepare an internal `GestureDetector` to determine when we can initiate a touch-interception // session (with the client's provided `onTouchInterceptListener`). We delegate out to their Loading Loading @@ -108,7 +107,6 @@ class ScreenshotShelfView(context: Context, attrs: AttributeSet? = null) : screenshotStatic = requireViewById(R.id.screenshot_static) actionsContainerBackground = requireViewById(R.id.actions_container_background) actionsContainer = requireViewById(R.id.actions_container) dismissButton = requireViewById(R.id.screenshot_dismiss_button) // Configure to extend the timeout during ongoing gestures (i.e. scrolls) that are already // being handled by our child views. Loading Loading @@ -234,7 +232,6 @@ class ScreenshotShelfView(context: Context, attrs: AttributeSet? = null) : val padding = FloatingWindowUtil.dpToPx(displayMetrics, -1 * TOUCH_PADDING_DP).toInt() swipeRegion.addInsetView(screenshotPreview, padding) swipeRegion.addInsetView(actionsContainerBackground, padding) swipeRegion.addInsetView(dismissButton, padding) findViewById<View>(R.id.screenshot_message_container)?.let { swipeRegion.addInsetView(it, padding) } Loading Loading
packages/SystemUI/multivalentTests/src/com/android/systemui/screenshot/ui/viewmodel/ScreenshotViewModelTest.kt +4 −7 Original line number Diff line number Diff line Loading @@ -16,25 +16,22 @@ package com.android.systemui.screenshot.ui.viewmodel import android.view.accessibility.AccessibilityManager import androidx.test.ext.junit.runners.AndroidJUnit4 import androidx.test.filters.SmallTest import com.android.systemui.SysuiTestCase import com.google.common.truth.Truth.assertThat import org.junit.Test import org.junit.runner.RunWith import org.mockito.Mockito.mock @SmallTest @RunWith(AndroidJUnit4::class) class ScreenshotViewModelTest : SysuiTestCase() { private val accessibilityManager: AccessibilityManager = mock(AccessibilityManager::class.java) private val appearance = ActionButtonAppearance(null, "Label", "Description") private val onclick = {} @Test fun testAddAction() { val viewModel = ScreenshotViewModel(accessibilityManager) val viewModel = ScreenshotViewModel() assertThat(viewModel.actions.value).isEmpty() Loading @@ -50,7 +47,7 @@ class ScreenshotViewModelTest : SysuiTestCase() { @Test fun testRemoveAction() { val viewModel = ScreenshotViewModel(accessibilityManager) val viewModel = ScreenshotViewModel() val firstId = viewModel.addAction(ActionButtonAppearance(null, "", ""), false, {}) val secondId = viewModel.addAction(appearance, false, onclick) Loading @@ -69,7 +66,7 @@ class ScreenshotViewModelTest : SysuiTestCase() { @Test fun testUpdateActionAppearance() { val viewModel = ScreenshotViewModel(accessibilityManager) val viewModel = ScreenshotViewModel() val id = viewModel.addAction(appearance, false, onclick) val otherAppearance = ActionButtonAppearance(null, "Other", "Other") Loading @@ -83,7 +80,7 @@ class ScreenshotViewModelTest : SysuiTestCase() { companion object { init { SysuiTestCase.waitUntilMockitoCanBeInitialized() waitUntilMockitoCanBeInitialized() } } }
packages/SystemUI/res/layout/screenshot_shelf.xml +0 −22 Original line number Diff line number Diff line Loading @@ -117,28 +117,6 @@ android:elevation="5dp" 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="7dp" 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:color/materialColorPrimary" android:tint="@androidprv:color/materialColorOnPrimary" android:padding="4dp" android:src="@drawable/ic_close"/> </FrameLayout> <ImageView android:id="@+id/screenshot_scrollable_preview" android:layout_width="wrap_content" Loading
packages/SystemUI/src/com/android/systemui/screenshot/dagger/ScreenshotModule.java +0 −9 Original line number Diff line number Diff line Loading @@ -18,7 +18,6 @@ package com.android.systemui.screenshot.dagger; import android.app.Service; import android.content.Context; import android.view.accessibility.AccessibilityManager; import com.android.internal.util.ScreenshotHelper; import com.android.systemui.dagger.SysUISingleton; Loading @@ -38,7 +37,6 @@ import com.android.systemui.screenshot.appclips.AppClipsService; import com.android.systemui.screenshot.message.MessageModule; import com.android.systemui.screenshot.policy.ScreenshotPolicyModule; import com.android.systemui.screenshot.proxy.ScreenshotProxyModule; import com.android.systemui.screenshot.ui.viewmodel.ScreenshotViewModel; import dagger.Binds; import dagger.Module; Loading Loading @@ -83,13 +81,6 @@ public abstract class ScreenshotModule { abstract ScreenshotSoundController bindScreenshotSoundController( ScreenshotSoundControllerImpl screenshotSoundProviderImpl); @Provides @SysUISingleton static ScreenshotViewModel providesScreenshotViewModel( AccessibilityManager accessibilityManager) { return new ScreenshotViewModel(accessibilityManager); } @Provides static InteractiveScreenshotHandler.Factory providesScreenshotController( ScreenshotController.Factory screenshotController) { Loading
packages/SystemUI/src/com/android/systemui/screenshot/ui/ScreenshotAnimationController.kt +0 −2 Original line number Diff line number Diff line Loading @@ -63,14 +63,12 @@ class ScreenshotAnimationController( listOf<View>( view.requireViewById(R.id.screenshot_preview_border), view.requireViewById(R.id.screenshot_badge), view.requireViewById(R.id.screenshot_dismiss_button), ) private val fadeUI = listOf<View>( view.requireViewById(R.id.screenshot_preview_border), view.requireViewById(R.id.actions_container_background), view.requireViewById(R.id.screenshot_badge), view.requireViewById(R.id.screenshot_dismiss_button), view.requireViewById(R.id.screenshot_message_container), ) Loading
packages/SystemUI/src/com/android/systemui/screenshot/ui/ScreenshotShelfView.kt +0 −3 Original line number Diff line number Diff line Loading @@ -47,7 +47,6 @@ class ScreenshotShelfView(context: Context, attrs: AttributeSet? = null) : private val tmpRect = Rect() private lateinit var actionsContainerBackground: View private lateinit var actionsContainer: View private lateinit var dismissButton: View // Prepare an internal `GestureDetector` to determine when we can initiate a touch-interception // session (with the client's provided `onTouchInterceptListener`). We delegate out to their Loading Loading @@ -108,7 +107,6 @@ class ScreenshotShelfView(context: Context, attrs: AttributeSet? = null) : screenshotStatic = requireViewById(R.id.screenshot_static) actionsContainerBackground = requireViewById(R.id.actions_container_background) actionsContainer = requireViewById(R.id.actions_container) dismissButton = requireViewById(R.id.screenshot_dismiss_button) // Configure to extend the timeout during ongoing gestures (i.e. scrolls) that are already // being handled by our child views. Loading Loading @@ -234,7 +232,6 @@ class ScreenshotShelfView(context: Context, attrs: AttributeSet? = null) : val padding = FloatingWindowUtil.dpToPx(displayMetrics, -1 * TOUCH_PADDING_DP).toInt() swipeRegion.addInsetView(screenshotPreview, padding) swipeRegion.addInsetView(actionsContainerBackground, padding) swipeRegion.addInsetView(dismissButton, padding) findViewById<View>(R.id.screenshot_message_container)?.let { swipeRegion.addInsetView(it, padding) } Loading