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
|
-- Load app content using C++ function
|
||||||
if loadAppContent then
|
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)
|
local success = loadAppContent(app_container, app_path)
|
||||||
showLoading(false)
|
showLoading(false)
|
||||||
|
|
||||||
@@ -68,16 +74,11 @@ function loadAppContent_internal(app_id, app_path, skip_animation)
|
|||||||
current_app_path = app_path
|
current_app_path = app_path
|
||||||
print("[Shell] App loaded: " .. app_id)
|
print("[Shell] App loaded: " .. app_id)
|
||||||
|
|
||||||
-- Play opening animation (unless skipped for initial load)
|
-- Remove animation class after it completes
|
||||||
if not skip_animation then
|
if not skip_animation and setTimeout then
|
||||||
app_container:SetClass("app-opening", true)
|
setTimeout(function()
|
||||||
app_container:SetClass("app-closing", false)
|
app_container:SetClass("app-opening", false)
|
||||||
-- Remove animation class after it completes
|
end, 300)
|
||||||
if setTimeout then
|
|
||||||
setTimeout(function()
|
|
||||||
app_container:SetClass("app-opening", false)
|
|
||||||
end, 300)
|
|
||||||
end
|
|
||||||
end
|
end
|
||||||
|
|
||||||
-- If home was loaded, populate apps dynamically
|
-- If home was loaded, populate apps dynamically
|
||||||
@@ -144,7 +145,8 @@ local function playCloseAnimation(callback)
|
|||||||
app_container:SetClass("app-closing", true)
|
app_container:SetClass("app-closing", true)
|
||||||
app_container:SetClass("app-opening", false)
|
app_container:SetClass("app-opening", false)
|
||||||
setTimeout(function()
|
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
|
if callback then callback() end
|
||||||
end, 200)
|
end, 200)
|
||||||
else
|
else
|
||||||
|
|||||||
@@ -58,6 +58,9 @@
|
|||||||
|
|
||||||
.app-closing {
|
.app-closing {
|
||||||
animation: 0.2s quadratic-in app-close;
|
animation: 0.2s quadratic-in app-close;
|
||||||
|
/* Keep at end state after animation */
|
||||||
|
opacity: 0;
|
||||||
|
transform: scale(0.8);
|
||||||
}
|
}
|
||||||
|
|
||||||
@keyframes app-open {
|
@keyframes app-open {
|
||||||
|
|||||||
Reference in New Issue
Block a user