稍微完善输入法以及输入法体验页
This commit is contained in:
@@ -34,15 +34,21 @@ class MainActivity : AppCompatActivity() {
|
||||
|
||||
// 5. 添加导航监听(用于某些 Fragment 隐藏底部导航栏)
|
||||
navController.addOnDestinationChangedListener { _, destination, _ ->
|
||||
when (destination.id) {
|
||||
R.id.rechargeFragment, R.id.goldCoinRechargeFragment,R.id.PersonalSettings,R.id.MySkin,R.id.searchFragment,R.id.MyKeyboard,R.id.searchResultFragment,R.id.keyboardDetailFragment,R.id.feedbackFragment,R.id.notificationFragment-> {
|
||||
bottomNav.visibility = View.GONE
|
||||
}
|
||||
else -> {
|
||||
bottomNav.visibility = View.VISIBLE
|
||||
}
|
||||
|
||||
// 只有这些页面显示 BottomNav
|
||||
val pagesWithBottomNav = setOf(
|
||||
R.id.mineFragment,
|
||||
R.id.homeFragment,
|
||||
R.id.shopFragment
|
||||
)
|
||||
|
||||
if (destination.id in pagesWithBottomNav) {
|
||||
bottomNav.visibility = View.VISIBLE
|
||||
} else {
|
||||
bottomNav.visibility = View.GONE
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
// 6. 检查是否有导航参数,处理从键盘跳转过来的请求
|
||||
handleNavigationFromIntent()
|
||||
|
||||
Reference in New Issue
Block a user