@@ -119,6 +119,8 @@ class HomeFragment : Fragment(), View.OnClickListener, View.OnLongClickListener
119
119
ViewModelProvider (this )[MainViewModel ::class .java]
120
120
} ? : throw Exception (" Invalid Activity" )
121
121
122
+ viewModel.ismlauncherDefault()
123
+
122
124
deviceManager =
123
125
context?.getSystemService(Context .DEVICE_POLICY_SERVICE ) as DevicePolicyManager
124
126
@Suppress(" DEPRECATION" )
@@ -306,14 +308,11 @@ class HomeFragment : Fragment(), View.OnClickListener, View.OnLongClickListener
306
308
307
309
private fun initObservers () {
308
310
binding.apply {
309
- if (prefs.firstSettingsOpen) {
310
- firstRunTips.visibility = View .VISIBLE
311
- setDefaultLauncher.visibility = View .GONE
312
- } else firstRunTips.visibility = View .GONE
311
+ if (prefs.firstSettingsOpen) firstRunTips.visibility = View .VISIBLE
312
+ else firstRunTips.visibility = View .GONE
313
313
314
- if (! ismlauncherDefault(requireContext())) {
315
- setDefaultLauncher.visibility = View .VISIBLE
316
- }
314
+ if (! ismlauncherDefault(requireContext())) setDefaultLauncher.visibility = View .VISIBLE
315
+ else setDefaultLauncher.visibility = View .GONE
317
316
}
318
317
319
318
with (viewModel) {
@@ -381,10 +380,12 @@ class HomeFragment : Fragment(), View.OnClickListener, View.OnLongClickListener
381
380
showDailyWord.observe(viewLifecycleOwner) {
382
381
binding.dailyWord.visibility = if (it) View .VISIBLE else View .GONE
383
382
}
384
-
385
383
showFloating.observe(viewLifecycleOwner) {
386
384
binding.floatingActionButton.visibility = if (it) View .VISIBLE else View .GONE
387
385
}
386
+ launcherDefault.observe(viewLifecycleOwner) {
387
+ binding.setDefaultLauncher.visibility = if (it) View .VISIBLE else View .GONE
388
+ }
388
389
}
389
390
}
390
391
@@ -936,9 +937,9 @@ class HomeFragment : Fragment(), View.OnClickListener, View.OnLongClickListener
936
937
937
938
// Set margins based on navigation mode
938
939
val margins = if (isGestureNav) {
939
- listOf (50 , 100 , 150 , 200 ) // Adjusted margins for gesture navigation
940
+ listOf (100 , 150 , 200 , 250 ) // Adjusted margins for gesture navigation
940
941
} else {
941
- listOf (100 , 150 , 200 , 250 ) // Adjusted margins for 3-button navigation
942
+ listOf (150 , 200 , 250 , 300 ) // Adjusted margins for 3-button navigation
942
943
}
943
944
944
945
val visibleViews = views.filter { it.isVisible }
0 commit comments