From 96182c88c3c6426d3188f09f364b44cfdfc443d0 Mon Sep 17 00:00:00 2001 From: MM20 <15646950+MM2-0@users.noreply.github.com> Date: Sun, 26 Feb 2023 17:54:07 +0100 Subject: [PATCH] Improve launch app gesture transition --- .../launcher2/ui/launcher/LauncherScaffoldVM.kt | 15 ++++++++++----- 1 file changed, 10 insertions(+), 5 deletions(-) diff --git a/app/ui/src/main/java/de/mm20/launcher2/ui/launcher/LauncherScaffoldVM.kt b/app/ui/src/main/java/de/mm20/launcher2/ui/launcher/LauncherScaffoldVM.kt index 110a0690..1dc63a11 100644 --- a/app/ui/src/main/java/de/mm20/launcher2/ui/launcher/LauncherScaffoldVM.kt +++ b/app/ui/src/main/java/de/mm20/launcher2/ui/launcher/LauncherScaffoldVM.kt @@ -1,10 +1,12 @@ package de.mm20.launcher2.ui.launcher -import android.app.ActivityOptions +import android.app.Activity import android.content.Context +import android.graphics.Rect import androidx.compose.runtime.getValue import androidx.compose.runtime.mutableStateOf import androidx.compose.runtime.setValue +import androidx.core.app.ActivityOptionsCompat import androidx.lifecycle.MutableLiveData import androidx.lifecycle.ViewModel import androidx.lifecycle.asLiveData @@ -211,10 +213,13 @@ class LauncherScaffoldVM : ViewModel(), KoinComponent { } GestureAction.LaunchApp -> { - val options = ActivityOptions.makeCustomAnimation( - context, - android.R.anim.fade_in, - android.R.anim.fade_out, + val view = (context as Activity).window.decorView + val options = ActivityOptionsCompat.makeScaleUpAnimation( + view, + 0, + 0, + view.width, + view.height ) when (gesture) { Gesture.SwipeLeft -> gestureState.value.swipeLeftApp