mirror of
https://github.com/He4eT/yamf_launcher.git
synced 2026-05-05 01:47:24 +00:00
Fixed pressing home key staying in app menu
This commit is contained in:
parent
b97193a173
commit
9d8ce304bd
3 changed files with 20 additions and 10 deletions
|
|
@ -4,6 +4,7 @@
|
|||
|
||||
<uses-permission android:name="android.permission.REQUEST_DELETE_PACKAGES"/>
|
||||
|
||||
|
||||
<queries>
|
||||
<intent>
|
||||
<action android:name="android.intent.action.MAIN" />
|
||||
|
|
@ -20,22 +21,22 @@
|
|||
android:supportsRtl="true"
|
||||
android:theme="@style/Theme.YamLauncher"
|
||||
tools:targetApi="34">
|
||||
<activity
|
||||
android:name=".AppMenuActivity"
|
||||
android:screenOrientation="portrait"
|
||||
android:theme="@style/Theme.YamLauncher"
|
||||
android:windowSoftInputMode="adjustResize">
|
||||
</activity>
|
||||
<activity
|
||||
android:name=".MainActivity"
|
||||
android:exported="true"
|
||||
android:screenOrientation="portrait"
|
||||
android:theme="@style/Theme.YamLauncher"
|
||||
android:windowSoftInputMode="adjustResize">
|
||||
android:windowSoftInputMode="adjustResize"
|
||||
android:launchMode="singleTask">
|
||||
|
||||
<intent-filter>
|
||||
<action android:name="android.intent.action.MAIN" />
|
||||
|
||||
<category android:name="android.intent.category.LAUNCHER" />
|
||||
|
||||
<category android:name="android.intent.category.HOME" />
|
||||
|
||||
<category android:name="android.intent.category.DEFAULT" />
|
||||
</intent-filter>
|
||||
</activity>
|
||||
|
||||
|
|
|
|||
|
|
@ -66,7 +66,6 @@ class AppMenuActivity : AppCompatActivity(), AppMenuAdapter.OnItemClickListener,
|
|||
binding = ActivityAppMenuBinding.inflate(layoutInflater)
|
||||
setContentView(binding.root)
|
||||
setSupportActionBar(null)
|
||||
|
||||
if (menuMode == "shortcut") {
|
||||
binding.menutitle.visibility = View.VISIBLE
|
||||
}
|
||||
|
|
|
|||
|
|
@ -4,10 +4,12 @@ import android.animation.Animator
|
|||
import android.animation.AnimatorListenerAdapter
|
||||
import android.animation.ArgbEvaluator
|
||||
import android.animation.ObjectAnimator
|
||||
import android.content.BroadcastReceiver
|
||||
import android.content.Context
|
||||
import android.content.Intent
|
||||
import android.content.IntentFilter
|
||||
import android.content.pm.LauncherActivityInfo
|
||||
import android.content.pm.LauncherApps
|
||||
import android.graphics.Color
|
||||
import android.os.Bundle
|
||||
import android.os.Handler
|
||||
import android.os.Looper
|
||||
|
|
@ -39,7 +41,6 @@ import kotlinx.coroutines.launch
|
|||
import kotlinx.coroutines.withContext
|
||||
import kotlin.math.abs
|
||||
|
||||
|
||||
class MainActivity : AppCompatActivity(), AppMenuAdapter.OnItemClickListener, AppMenuAdapter.OnShortcutListener, AppMenuAdapter.OnItemLongClickListener {
|
||||
|
||||
private lateinit var binding: ActivityMainBinding
|
||||
|
|
@ -135,6 +136,8 @@ class MainActivity : AppCompatActivity(), AppMenuAdapter.OnItemClickListener, Ap
|
|||
|
||||
}
|
||||
})
|
||||
|
||||
|
||||
}
|
||||
|
||||
private fun setupSearch() {
|
||||
|
|
@ -197,6 +200,12 @@ class MainActivity : AppCompatActivity(), AppMenuAdapter.OnItemClickListener, Ap
|
|||
return this.replace("[^a-zA-Z0-9]".toRegex(), "")
|
||||
}
|
||||
|
||||
override fun onNewIntent(intent: Intent?) {
|
||||
binding.appView.slideOutToBottom()
|
||||
binding.homeView.FadeIn()
|
||||
super.onNewIntent(intent)
|
||||
|
||||
}
|
||||
override fun onStop() {
|
||||
super.onStop()
|
||||
job?.cancel()
|
||||
|
|
@ -210,6 +219,7 @@ class MainActivity : AppCompatActivity(), AppMenuAdapter.OnItemClickListener, Ap
|
|||
|
||||
override fun onStart() {
|
||||
super.onStart()
|
||||
|
||||
startTask()
|
||||
|
||||
// Keyboard is sometimes open when going back to the app, so close it.
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue