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

Commit 7a2c59df authored by Sherry Zhou's avatar Sherry Zhou
Browse files

Fix smartspace disappearing when changing from small to large weather clock...

Fix smartspace disappearing when changing from small to large weather clock and the switching to other clock

The reason is that we changed alpha in ClockSizeTransition but not
change it back in SmartspaceVisibilityTransition

Bug: 327461585
Test: manual
Flag: ACONFIG com.android.systemui.migrate_clocks_to_blueprint STAGING

Change-Id: I53230827f108e420b32de357b35bdb4de73e4a7c
parent d588b98d
Loading
Loading
Loading
Loading
+9 −2
Original line number Diff line number Diff line
@@ -38,6 +38,7 @@ import com.android.systemui.keyguard.ui.viewmodel.KeyguardClockViewModel
import com.android.systemui.keyguard.ui.viewmodel.KeyguardSmartspaceViewModel
import com.android.systemui.lifecycle.repeatWhenAttached
import com.android.systemui.res.R
import com.android.systemui.shared.R as sharedR
import javax.inject.Inject
import kotlin.math.max

@@ -217,15 +218,21 @@ constructor(
        if (!DEBUG || currentClock == null) return
        val smallClockViewId = R.id.lockscreen_clock_view
        val largeClockViewId = currentClock.largeClock.layout.views[0].id
        val smartspaceDateId = sharedR.id.date_smartspace_view
        Log.i(
            TAG,
            "applyCsToSmallClock: vis=${cs.getVisibility(smallClockViewId)} " +
                "alpha=${cs.getConstraint(smallClockViewId).propertySet}"
                "alpha=${cs.getConstraint(smallClockViewId).propertySet.alpha}"
        )
        Log.i(
            TAG,
            "applyCsToLargeClock: vis=${cs.getVisibility(largeClockViewId)} " +
                "alpha=${cs.getConstraint(largeClockViewId).propertySet}"
                "alpha=${cs.getConstraint(largeClockViewId).propertySet.alpha}"
        )
        Log.i(
            TAG,
            "applyCsToSmartspaceDate: vis=${cs.getVisibility(smartspaceDateId)} " +
                "alpha=${cs.getConstraint(smartspaceDateId).propertySet.alpha}"
        )
    }
}
+10 −5
Original line number Diff line number Diff line
@@ -18,7 +18,6 @@ package com.android.systemui.keyguard.ui.view.layout.sections

import android.content.Context
import android.view.View
import android.view.View.GONE
import android.view.ViewTreeObserver.OnGlobalLayoutListener
import androidx.constraintlayout.widget.Barrier
import androidx.constraintlayout.widget.ConstraintLayout
@@ -205,8 +204,7 @@ constructor(
        smartspaceController.requestSmartspaceUpdate()

        constraintSet.apply {
            setVisibility(
                sharedR.id.weather_smartspace_view,
            val weatherVisibility =
                when (keyguardClockViewModel.hasCustomWeatherDataDisplay.value) {
                    true -> ConstraintSet.GONE
                    false ->
@@ -215,11 +213,18 @@ constructor(
                            false -> ConstraintSet.GONE
                        }
                }
            setVisibility(sharedR.id.weather_smartspace_view, weatherVisibility)
            setAlpha(
                sharedR.id.weather_smartspace_view,
                if (weatherVisibility == ConstraintSet.VISIBLE) 1f else 0f
            )
            setVisibility(
                sharedR.id.date_smartspace_view,
            val dateVisibility =
                if (keyguardClockViewModel.hasCustomWeatherDataDisplay.value) ConstraintSet.GONE
                else ConstraintSet.VISIBLE
            setVisibility(sharedR.id.date_smartspace_view, dateVisibility)
            setAlpha(
                sharedR.id.date_smartspace_view,
                if (dateVisibility == ConstraintSet.VISIBLE) 1f else 0f
            )
        }
    }