@@ -161,14 +161,14 @@ class HomeFragment : Fragment(), View.OnClickListener, View.OnLongClickListener
161
161
binding.dateTimeLayout.isVisible = prefs.dateTimeVisibility != Constants .DateTime .OFF
162
162
binding.clock.isVisible = Constants .DateTime .isTimeVisible(prefs.dateTimeVisibility)
163
163
binding.date.isVisible = Constants .DateTime .isDateVisible(prefs.dateTimeVisibility)
164
- val day = SimpleDateFormat (" EEE, dd MMM" , Locale .getDefault()).format(Date ())
165
- if (prefs.showStatusBar)
166
- binding.date.text = day
167
- else {
164
+
165
+ var dateText = SimpleDateFormat (" EEE, dd MMM" , Locale .getDefault()).format(Date ())
166
+ if (! prefs.showStatusBar) {
168
167
val battery = (requireContext().getSystemService(Context .BATTERY_SERVICE ) as BatteryManager )
169
168
.getIntProperty(BatteryManager .BATTERY_PROPERTY_CAPACITY )
170
- binding.date.text = getString(R .string.day_battery, day , battery)
169
+ dateText = getString(R .string.day_battery, dateText , battery)
171
170
}
171
+ binding.date.text = dateText.replace(" .," , " ," )
172
172
}
173
173
174
174
private fun populateHomeScreen (appCountUpdated : Boolean ) {
@@ -266,11 +266,13 @@ class HomeFragment : Fragment(), View.OnClickListener, View.OnLongClickListener
266
266
267
267
private fun launchApp (appName : String , packageName : String , activityClassName : String? , userString : String ) {
268
268
viewModel.selectedApp(
269
- AppModel (appName,
269
+ AppModel (
270
+ appName,
270
271
null ,
271
272
packageName,
272
273
activityClassName,
273
- getUserHandleFromString(requireContext(), userString)),
274
+ getUserHandleFromString(requireContext(), userString)
275
+ ),
274
276
Constants .FLAG_LAUNCH_APP
275
277
)
276
278
}
@@ -307,20 +309,24 @@ class HomeFragment : Fragment(), View.OnClickListener, View.OnLongClickListener
307
309
private fun openSwipeRightApp () {
308
310
if (! prefs.swipeRightEnabled) return
309
311
if (prefs.appPackageSwipeRight.isNotEmpty())
310
- launchApp(prefs.appNameSwipeRight,
312
+ launchApp(
313
+ prefs.appNameSwipeRight,
311
314
prefs.appPackageSwipeRight,
312
315
prefs.appActivityClassNameRight,
313
- android.os.Process .myUserHandle().toString())
316
+ android.os.Process .myUserHandle().toString()
317
+ )
314
318
else openDialerApp(requireContext())
315
319
}
316
320
317
321
private fun openSwipeLeftApp () {
318
322
if (! prefs.swipeLeftEnabled) return
319
323
if (prefs.appPackageSwipeLeft.isNotEmpty())
320
- launchApp(prefs.appNameSwipeLeft,
324
+ launchApp(
325
+ prefs.appNameSwipeLeft,
321
326
prefs.appPackageSwipeLeft,
322
327
prefs.appActivityClassNameSwipeLeft,
323
- android.os.Process .myUserHandle().toString())
328
+ android.os.Process .myUserHandle().toString()
329
+ )
324
330
else openCameraApp(requireContext())
325
331
}
326
332
0 commit comments