fix transition flash between apps
- Set app-opening class BEFORE loading content to prevent flash - Keep app-closing at opacity 0 after animation ends - Remove unnecessary class removal in playCloseAnimation
This commit is contained in:
@@ -60,6 +60,12 @@ function loadAppContent_internal(app_id, app_path, skip_animation)
|
||||
|
||||
-- Load app content using C++ function
|
||||
if loadAppContent then
|
||||
-- Set opening animation BEFORE loading content to prevent flash
|
||||
if not skip_animation then
|
||||
app_container:SetClass("app-opening", true)
|
||||
app_container:SetClass("app-closing", false)
|
||||
end
|
||||
|
||||
local success = loadAppContent(app_container, app_path)
|
||||
showLoading(false)
|
||||
|
||||
@@ -68,17 +74,12 @@ function loadAppContent_internal(app_id, app_path, skip_animation)
|
||||
current_app_path = app_path
|
||||
print("[Shell] App loaded: " .. app_id)
|
||||
|
||||
-- Play opening animation (unless skipped for initial load)
|
||||
if not skip_animation then
|
||||
app_container:SetClass("app-opening", true)
|
||||
app_container:SetClass("app-closing", false)
|
||||
-- Remove animation class after it completes
|
||||
if setTimeout then
|
||||
if not skip_animation and setTimeout then
|
||||
setTimeout(function()
|
||||
app_container:SetClass("app-opening", false)
|
||||
end, 300)
|
||||
end
|
||||
end
|
||||
|
||||
-- If home was loaded, populate apps dynamically
|
||||
if app_id == "home" then
|
||||
@@ -144,7 +145,8 @@ local function playCloseAnimation(callback)
|
||||
app_container:SetClass("app-closing", true)
|
||||
app_container:SetClass("app-opening", false)
|
||||
setTimeout(function()
|
||||
app_container:SetClass("app-closing", false)
|
||||
-- Don't remove app-closing yet - callback will load new content
|
||||
-- and loadAppContent_internal will switch to app-opening
|
||||
if callback then callback() end
|
||||
end, 200)
|
||||
else
|
||||
|
||||
@@ -58,6 +58,9 @@
|
||||
|
||||
.app-closing {
|
||||
animation: 0.2s quadratic-in app-close;
|
||||
/* Keep at end state after animation */
|
||||
opacity: 0;
|
||||
transform: scale(0.8);
|
||||
}
|
||||
|
||||
@keyframes app-open {
|
||||
|
||||
Reference in New Issue
Block a user