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

Skip to content
Snippets Groups Projects
Commit 1ad38e26 authored by Michał Brzeziński's avatar Michał Brzeziński Committed by Android (Google) Code Review
Browse files

Merge "Collapsing shade when user clicks on shade_header_system_icons from...

Merge "Collapsing shade when user clicks on shade_header_system_icons from shade header" into udc-qpr-dev
parents cfcb3663 2b97d96a
Branches
No related tags found
No related merge requests found
...@@ -1076,6 +1076,8 @@ public final class NotificationPanelViewController implements ShadeSurface, Dump ...@@ -1076,6 +1076,8 @@ public final class NotificationPanelViewController implements ShadeSurface, Dump
mTapAgainViewController.init(); mTapAgainViewController.init();
mShadeHeaderController.init(); mShadeHeaderController.init();
mShadeHeaderController.setShadeCollapseAction(
() -> collapse(/* delayed= */ false , /* speedUpFactor= */ 1.0f));
mKeyguardUnfoldTransition.ifPresent(u -> u.setup(mView)); mKeyguardUnfoldTransition.ifPresent(u -> u.setup(mView));
mNotificationPanelUnfoldAnimationController.ifPresent(controller -> mNotificationPanelUnfoldAnimationController.ifPresent(controller ->
controller.setup(mNotificationContainerParent)); controller.setup(mNotificationContainerParent));
......
...@@ -122,6 +122,8 @@ constructor( ...@@ -122,6 +122,8 @@ constructor(
} }
} }
var shadeCollapseAction: Runnable? = null
private lateinit var iconManager: StatusBarIconController.TintedIconManager private lateinit var iconManager: StatusBarIconController.TintedIconManager
private lateinit var carrierIconSlots: List<String> private lateinit var carrierIconSlots: List<String>
private lateinit var mShadeCarrierGroupController: ShadeCarrierGroupController private lateinit var mShadeCarrierGroupController: ShadeCarrierGroupController
...@@ -469,9 +471,11 @@ constructor( ...@@ -469,9 +471,11 @@ constructor(
if (largeScreenActive) { if (largeScreenActive) {
logInstantEvent("Large screen constraints set") logInstantEvent("Large screen constraints set")
header.setTransition(LARGE_SCREEN_HEADER_TRANSITION_ID) header.setTransition(LARGE_SCREEN_HEADER_TRANSITION_ID)
systemIcons.setOnClickListener { shadeCollapseAction?.run() }
} else { } else {
logInstantEvent("Small screen constraints set") logInstantEvent("Small screen constraints set")
header.setTransition(HEADER_TRANSITION_ID) header.setTransition(HEADER_TRANSITION_ID)
systemIcons.setOnClickListener(null)
} }
header.jumpToState(header.startState) header.jumpToState(header.startState)
updatePosition() updatePosition()
......
...@@ -29,6 +29,7 @@ import android.view.DisplayCutout ...@@ -29,6 +29,7 @@ import android.view.DisplayCutout
import android.view.View import android.view.View
import android.view.ViewPropertyAnimator import android.view.ViewPropertyAnimator
import android.view.WindowInsets import android.view.WindowInsets
import android.widget.LinearLayout
import android.widget.TextView import android.widget.TextView
import androidx.constraintlayout.motion.widget.MotionLayout import androidx.constraintlayout.motion.widget.MotionLayout
import androidx.constraintlayout.widget.ConstraintSet import androidx.constraintlayout.widget.ConstraintSet
...@@ -127,6 +128,7 @@ class ShadeHeaderControllerTest : SysuiTestCase() { ...@@ -127,6 +128,7 @@ class ShadeHeaderControllerTest : SysuiTestCase() {
var viewVisibility = View.GONE var viewVisibility = View.GONE
var viewAlpha = 1f var viewAlpha = 1f
private val systemIcons = LinearLayout(context)
private lateinit var shadeHeaderController: ShadeHeaderController private lateinit var shadeHeaderController: ShadeHeaderController
private lateinit var carrierIconSlots: List<String> private lateinit var carrierIconSlots: List<String>
private val configurationController = FakeConfigurationController() private val configurationController = FakeConfigurationController()
...@@ -146,6 +148,7 @@ class ShadeHeaderControllerTest : SysuiTestCase() { ...@@ -146,6 +148,7 @@ class ShadeHeaderControllerTest : SysuiTestCase() {
.thenReturn(batteryMeterView) .thenReturn(batteryMeterView)
whenever<StatusIconContainer>(view.findViewById(R.id.statusIcons)).thenReturn(statusIcons) whenever<StatusIconContainer>(view.findViewById(R.id.statusIcons)).thenReturn(statusIcons)
whenever<View>(view.findViewById(R.id.shade_header_system_icons)).thenReturn(systemIcons)
viewContext = Mockito.spy(context) viewContext = Mockito.spy(context)
whenever(view.context).thenReturn(viewContext) whenever(view.context).thenReturn(viewContext)
...@@ -450,6 +453,17 @@ class ShadeHeaderControllerTest : SysuiTestCase() { ...@@ -450,6 +453,17 @@ class ShadeHeaderControllerTest : SysuiTestCase() {
verify(view).setTransition(ShadeHeaderController.HEADER_TRANSITION_ID) verify(view).setTransition(ShadeHeaderController.HEADER_TRANSITION_ID)
} }
@Test
fun testLargeScreenActive_collapseActionRun_onSystemIconsClick() {
shadeHeaderController.largeScreenActive = true
var wasRun = false
shadeHeaderController.shadeCollapseAction = Runnable { wasRun = true }
systemIcons.performClick()
assertThat(wasRun).isTrue()
}
@Test @Test
fun testShadeExpandedFraction() { fun testShadeExpandedFraction() {
// View needs to be visible for this to actually take effect // View needs to be visible for this to actually take effect
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment