• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1 package com.android.systemui.qs
2 
3 import com.android.systemui.qs.dagger.QSScope
4 import javax.inject.Inject
5 
6 @QSScope
7 class QSSquishinessController @Inject constructor(
8     private val qsAnimator: QSAnimator,
9     private val qsPanelController: QSPanelController,
10     private val quickQSPanelController: QuickQSPanelController
11 ) {
12 
13     /**
14      * Fraction from 0 to 1, where 0 is collapsed and 1 expanded.
15      */
16     var squishiness: Float = 1f
17     set(value) {
18         if (field == value) {
19             return
20         }
21         if ((field != 1f && value == 1f) || (field != 0f && value == 0f)) {
22             qsAnimator.requestAnimatorUpdate()
23         }
24         field = value
25         updateSquishiness()
26     }
27 
28     /**
29      * Change the height of all tiles and repositions their siblings.
30      */
updateSquishinessnull31     private fun updateSquishiness() {
32         qsPanelController.setSquishinessFraction(squishiness)
33         quickQSPanelController.setSquishinessFraction(squishiness)
34     }
35 }