diff --git a/app/src/main/java/eu/ottop/yamlauncher/Animations.kt b/app/src/main/java/eu/ottop/yamlauncher/Animations.kt index 9cb2537..05e8d03 100644 --- a/app/src/main/java/eu/ottop/yamlauncher/Animations.kt +++ b/app/src/main/java/eu/ottop/yamlauncher/Animations.kt @@ -28,8 +28,8 @@ class Animations () { } fun showApps(binding: ActivityMainBinding) { - binding.homeView.fadeOut() binding.appView.slideInFromBottom() + binding.homeView.fadeOut() } fun backgroundIn(activity: Activity, originalColor: Int, duration: Long = 100) { @@ -95,7 +95,7 @@ class Animations () { .setDuration(duration) .setListener(object : AnimatorListenerAdapter() { override fun onAnimationEnd(animation: Animator) { - visibility = View.INVISIBLE + visibility = View.GONE } }) } @@ -122,7 +122,7 @@ class Animations () { .setDuration(duration) .setListener(object : AnimatorListenerAdapter() { override fun onAnimationEnd(animation: Animator) { - visibility = View.INVISIBLE + visibility = View.GONE } })} } diff --git a/app/src/main/java/eu/ottop/yamlauncher/MainActivity.kt b/app/src/main/java/eu/ottop/yamlauncher/MainActivity.kt index 3f673f9..22f1bd1 100644 --- a/app/src/main/java/eu/ottop/yamlauncher/MainActivity.kt +++ b/app/src/main/java/eu/ottop/yamlauncher/MainActivity.kt @@ -111,10 +111,8 @@ class MainActivity : AppCompatActivity(), SharedPreferences.OnSharedPreferenceCh preferences.registerOnSharedPreferenceChangeListener(this) - window.setBackgroundDrawable( - ColorDrawable( - Color.parseColor(preferences.getString("bgColor", "#00000000")) - ) + window.decorView.setBackgroundColor( + Color.parseColor(preferences.getString("bgColor", "#00000000")) ) searchView = findViewById(R.id.searchView) @@ -159,8 +157,8 @@ class MainActivity : AppCompatActivity(), SharedPreferences.OnSharedPreferenceCh } binding.homeView.setOnTouchListener { _, event -> - gestureDetector.onTouchEvent(event) super.onTouchEvent(event) + gestureDetector.onTouchEvent(event) true // Return true if the touch event is handled } @@ -229,11 +227,10 @@ class MainActivity : AppCompatActivity(), SharedPreferences.OnSharedPreferenceCh } "bgColor" -> { - window.setBackgroundDrawable( - ColorDrawable( + window.setBackgroundDrawable(ColorDrawable(Color.parseColor("#00000000"))) + window.decorView.setBackgroundColor( Color.parseColor(preferences?.getString(key, "#00000000")) ) - ) } "textColor" -> { @@ -331,7 +328,8 @@ class MainActivity : AppCompatActivity(), SharedPreferences.OnSharedPreferenceCh @SuppressLint("NotifyDataSetChanged") override fun onResume() { super.onResume() - + binding.homeView.visibility = View.VISIBLE + binding.appView.visibility = View.INVISIBLE adapter?.notifyDataSetChanged() } @@ -372,7 +370,7 @@ class MainActivity : AppCompatActivity(), SharedPreferences.OnSharedPreferenceCh startActivity(phoneIntent) } } - return false + return true } override fun onLongPress(e: MotionEvent) {