mirror of
https://github.com/He4eT/yamf_launcher.git
synced 2026-05-05 01:47:24 +00:00
Fixed a major app menu duplication bug (upon changing to transparent bg from another after initial app launch)
This commit is contained in:
parent
71af6d7d49
commit
7f7a7f4286
2 changed files with 11 additions and 13 deletions
|
|
@ -28,8 +28,8 @@ class Animations () {
|
||||||
}
|
}
|
||||||
|
|
||||||
fun showApps(binding: ActivityMainBinding) {
|
fun showApps(binding: ActivityMainBinding) {
|
||||||
binding.homeView.fadeOut()
|
|
||||||
binding.appView.slideInFromBottom()
|
binding.appView.slideInFromBottom()
|
||||||
|
binding.homeView.fadeOut()
|
||||||
}
|
}
|
||||||
|
|
||||||
fun backgroundIn(activity: Activity, originalColor: Int, duration: Long = 100) {
|
fun backgroundIn(activity: Activity, originalColor: Int, duration: Long = 100) {
|
||||||
|
|
@ -95,7 +95,7 @@ class Animations () {
|
||||||
.setDuration(duration)
|
.setDuration(duration)
|
||||||
.setListener(object : AnimatorListenerAdapter() {
|
.setListener(object : AnimatorListenerAdapter() {
|
||||||
override fun onAnimationEnd(animation: Animator) {
|
override fun onAnimationEnd(animation: Animator) {
|
||||||
visibility = View.INVISIBLE
|
visibility = View.GONE
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
@ -122,7 +122,7 @@ class Animations () {
|
||||||
.setDuration(duration)
|
.setDuration(duration)
|
||||||
.setListener(object : AnimatorListenerAdapter() {
|
.setListener(object : AnimatorListenerAdapter() {
|
||||||
override fun onAnimationEnd(animation: Animator) {
|
override fun onAnimationEnd(animation: Animator) {
|
||||||
visibility = View.INVISIBLE
|
visibility = View.GONE
|
||||||
}
|
}
|
||||||
})}
|
})}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -111,11 +111,9 @@ class MainActivity : AppCompatActivity(), SharedPreferences.OnSharedPreferenceCh
|
||||||
|
|
||||||
preferences.registerOnSharedPreferenceChangeListener(this)
|
preferences.registerOnSharedPreferenceChangeListener(this)
|
||||||
|
|
||||||
window.setBackgroundDrawable(
|
window.decorView.setBackgroundColor(
|
||||||
ColorDrawable(
|
|
||||||
Color.parseColor(preferences.getString("bgColor", "#00000000"))
|
Color.parseColor(preferences.getString("bgColor", "#00000000"))
|
||||||
)
|
)
|
||||||
)
|
|
||||||
|
|
||||||
searchView = findViewById(R.id.searchView)
|
searchView = findViewById(R.id.searchView)
|
||||||
|
|
||||||
|
|
@ -159,8 +157,8 @@ class MainActivity : AppCompatActivity(), SharedPreferences.OnSharedPreferenceCh
|
||||||
}
|
}
|
||||||
|
|
||||||
binding.homeView.setOnTouchListener { _, event ->
|
binding.homeView.setOnTouchListener { _, event ->
|
||||||
gestureDetector.onTouchEvent(event)
|
|
||||||
super.onTouchEvent(event)
|
super.onTouchEvent(event)
|
||||||
|
gestureDetector.onTouchEvent(event)
|
||||||
true // Return true if the touch event is handled
|
true // Return true if the touch event is handled
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -229,11 +227,10 @@ class MainActivity : AppCompatActivity(), SharedPreferences.OnSharedPreferenceCh
|
||||||
}
|
}
|
||||||
|
|
||||||
"bgColor" -> {
|
"bgColor" -> {
|
||||||
window.setBackgroundDrawable(
|
window.setBackgroundDrawable(ColorDrawable(Color.parseColor("#00000000")))
|
||||||
ColorDrawable(
|
window.decorView.setBackgroundColor(
|
||||||
Color.parseColor(preferences?.getString(key, "#00000000"))
|
Color.parseColor(preferences?.getString(key, "#00000000"))
|
||||||
)
|
)
|
||||||
)
|
|
||||||
}
|
}
|
||||||
|
|
||||||
"textColor" -> {
|
"textColor" -> {
|
||||||
|
|
@ -331,7 +328,8 @@ class MainActivity : AppCompatActivity(), SharedPreferences.OnSharedPreferenceCh
|
||||||
@SuppressLint("NotifyDataSetChanged")
|
@SuppressLint("NotifyDataSetChanged")
|
||||||
override fun onResume() {
|
override fun onResume() {
|
||||||
super.onResume()
|
super.onResume()
|
||||||
|
binding.homeView.visibility = View.VISIBLE
|
||||||
|
binding.appView.visibility = View.INVISIBLE
|
||||||
adapter?.notifyDataSetChanged()
|
adapter?.notifyDataSetChanged()
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -372,7 +370,7 @@ class MainActivity : AppCompatActivity(), SharedPreferences.OnSharedPreferenceCh
|
||||||
startActivity(phoneIntent)
|
startActivity(phoneIntent)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
return false
|
return true
|
||||||
}
|
}
|
||||||
|
|
||||||
override fun onLongPress(e: MotionEvent) {
|
override fun onLongPress(e: MotionEvent) {
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue