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

Commit 6f126f45 authored by Aaron Liu's avatar Aaron Liu
Browse files

Remove MovableElement for small clock.

Small clock does not animate when in a movable element. I'm not entirely
sure why, but there doesn't seem to be any issue if the small clock just
uses the elemen modifier key.

Fixes: 332550069
Test: Switch between small clock and large clock.
Flag: ACONFIG com.android.systemui.compose_lockscreen DEVELOPMENT
Change-Id: Iaa2e6462bef20ea88684f57940936b69ac649e04
parent 3011d258
Loading
Loading
Loading
Loading
+18 −27
Original line number Diff line number Diff line
@@ -34,7 +34,6 @@ import androidx.compose.ui.viewinterop.AndroidView
import androidx.core.view.contains
import com.android.compose.animation.scene.SceneScope
import com.android.compose.modifiers.padding
import com.android.systemui.customization.R as customizationR
import com.android.systemui.customization.R
import com.android.systemui.keyguard.ui.composable.blueprint.ClockElementKeys.largeClockElementKey
import com.android.systemui.keyguard.ui.composable.blueprint.ClockElementKeys.smallClockElementKey
@@ -65,32 +64,24 @@ constructor(
            return
        }
        val context = LocalContext.current
        MovableElement(key = smallClockElementKey, modifier = modifier) {
            content {
        AndroidView(
            factory = { context ->
                FrameLayout(context).apply {
                    ensureClockViewExists(checkNotNull(currentClock).smallClock.view)
                }
            },
                    update = {
                        it.ensureClockViewExists(checkNotNull(currentClock).smallClock.view)
                    },
            update = { it.ensureClockViewExists(checkNotNull(currentClock).smallClock.view) },
            modifier =
                        Modifier.height(dimensionResource(R.dimen.small_clock_height))
                            .padding(
                                horizontal =
                                    dimensionResource(customizationR.dimen.clock_padding_start)
                            )
                modifier
                    .height(dimensionResource(R.dimen.small_clock_height))
                    .padding(top = { viewModel.getSmallClockTopMargin(context) })
                    .onTopPlacementChanged(onTopChanged)
                    .burnInAware(
                        viewModel = aodBurnInViewModel,
                        params = burnInParams,
                            ),
                    )
            }
        }
                    .element(smallClockElementKey),
        )
    }

    @Composable