From 7bc71033eebdb9ad46b1ab122dd23454ff8ec646 Mon Sep 17 00:00:00 2001 From: queuejw Date: Sat, 17 Aug 2024 18:48:37 +0400 Subject: [PATCH] edit mode improvements --- .../metrolauncher/content/NewStart.kt | 44 +++++++++---------- 1 file changed, 21 insertions(+), 23 deletions(-) diff --git a/app/src/main/java/ru/dimon6018/metrolauncher/content/NewStart.kt b/app/src/main/java/ru/dimon6018/metrolauncher/content/NewStart.kt index 7a08de8..ee9950d 100644 --- a/app/src/main/java/ru/dimon6018/metrolauncher/content/NewStart.kt +++ b/app/src/main/java/ru/dimon6018/metrolauncher/content/NewStart.kt @@ -590,12 +590,11 @@ class NewStart: Fragment(), OnStartDragListener { val diffResult = DiffUtil.calculateDiff(diffUtilCallback, false) diffResult.dispatchUpdatesTo(this) } - @SuppressLint("NotifyDataSetChanged") fun enableEditMode() { Log.d("EditMode", "enter edit mode") (requireActivity() as Main).configureViewPagerScroll(false) binding.startAppsTiles.animate().scaleX(0.9f).scaleY(0.9f).setDuration(300).start() - binding.backgroundWallpaper.animate().scaleX(0.9f).scaleY(0.9f).setDuration(300).start() + binding.backgroundWallpaper.animate().scaleX(0.9f).scaleY(0.82f).setDuration(300).start() if(PREFS!!.isParallaxEnabled || !PREFS!!.isWallpaperUsed) { binding.startFrame.setBackgroundColor( if (PREFS!!.isLightThemeUsed) ContextCompat.getColor( @@ -604,10 +603,11 @@ class NewStart: Fragment(), OnStartDragListener { ) else ContextCompat.getColor(context, android.R.color.background_dark) ) } + for(anim in animList) { + anim.start() + } isEditMode = true - notifyDataSetChanged() } - @SuppressLint("NotifyDataSetChanged") fun disableEditMode() { Log.d("EditMode", "exit edit mode") (requireActivity() as Main).configureViewPagerScroll(true) @@ -621,8 +621,11 @@ class NewStart: Fragment(), OnStartDragListener { for(anim in animList) { anim.cancel() } - animList.clear() - notifyDataSetChanged() + for (i in 0..