Skip to content

Commit

Permalink
Fix: Fixed a few DEPRECATION warning.
Browse files Browse the repository at this point in the history
  • Loading branch information
CreativeCodeCat committed May 21, 2024
1 parent 16365ec commit 7dfddc7
Show file tree
Hide file tree
Showing 6 changed files with 31 additions and 37 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,6 @@ import android.view.View
import android.view.Window
import android.view.WindowInsets
import android.view.WindowManager
import android.view.inputmethod.InputMethodManager
import android.widget.TextView
import android.widget.Toast
import androidx.appcompat.widget.LinearLayoutCompat
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ class BottomDialogHelper @Inject constructor() {
val window = dialog?.window
if (window != null) {
window.addFlags(WindowManager.LayoutParams.FLAG_DRAWS_SYSTEM_BAR_BACKGROUNDS)
@Suppress("DEPRECATION")
window.clearFlags(WindowManager.LayoutParams.FLAG_TRANSLUCENT_STATUS)
window.statusBarColor = Color.TRANSPARENT
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,6 @@ import com.github.droidworksstudio.launcher.helper.FingerprintHelper
import com.github.droidworksstudio.launcher.helper.PreferenceHelper
import com.github.droidworksstudio.launcher.listener.OnItemClickedListener
import com.github.droidworksstudio.launcher.listener.OnItemMoveListener
import com.github.droidworksstudio.launcher.ui.bottomsheetdialog.AppInfoBottomSheetFragment
import com.github.droidworksstudio.launcher.viewmodel.AppViewModel
import dagger.hilt.android.AndroidEntryPoint
import kotlinx.coroutines.launch
Expand All @@ -36,7 +35,8 @@ import javax.inject.Inject
class FavoriteFragment : Fragment(), OnItemClickedListener.OnAppsClickedListener,
OnItemClickedListener.BottomSheetDismissListener,
OnItemClickedListener.OnAppStateClickListener,
FingerprintHelper.Callback,OnItemMoveListener.OnItemActionListener{
OnItemMoveListener.OnItemActionListener,
FingerprintHelper.Callback {
private var _binding: FragmentFavoriteBinding? = null

private val binding get() = _binding!!
Expand Down Expand Up @@ -103,10 +103,10 @@ class FavoriteFragment : Fragment(), OnItemClickedListener.OnAppsClickedListener


private fun observeHomeAppOrder() {
//binding.favoriteAdapter.adapter = favoriteAdapter
binding.favoriteAdapter.adapter = favoriteAdapter
val listener: OnItemMoveListener.OnItemActionListener = favoriteAdapter

val simpleItemTouchCallback = object : ItemTouchHelper.Callback() {
val simpleItemTouchCallback = object : ItemTouchHelper.Callback() {

override fun onChildDraw(
canvas: Canvas, recyclerView: RecyclerView,
Expand Down Expand Up @@ -152,6 +152,7 @@ class FavoriteFragment : Fragment(), OnItemClickedListener.OnAppsClickedListener
}

override fun onSwiped(viewHolder: RecyclerView.ViewHolder, direction: Int) {
@Suppress("DEPRECATION")
listener.onViewSwiped(viewHolder.adapterPosition)
}

Expand Down Expand Up @@ -181,14 +182,6 @@ class FavoriteFragment : Fragment(), OnItemClickedListener.OnAppsClickedListener
}
}

private fun showSelectedApp(appInfo: AppInfo) {
val bottomSheetFragment = AppInfoBottomSheetFragment(appInfo)
bottomSheetFragment.setOnBottomSheetDismissedListener(this)
bottomSheetFragment.setOnAppStateClickListener(this)
bottomSheetFragment.show(parentFragmentManager, "BottomSheetDialog")

}

override fun onBottomSheetDismissed() {
TODO("Not yet implemented")
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ class HiddenFragment : Fragment(), OnItemClickedListener.OnAppsClickedListener,
OnItemClickedListener.OnAppLongClickedListener,
OnItemClickedListener.BottomSheetDismissListener,
OnItemClickedListener.OnAppStateClickListener,
FingerprintHelper.Callback{
FingerprintHelper.Callback {
private var _binding: FragmentHiddenBinding? = null

private val binding get() = _binding!!
Expand Down Expand Up @@ -78,6 +78,7 @@ class HiddenFragment : Fragment(), OnItemClickedListener.OnAppsClickedListener,

private fun observeHiddenApps() {
viewModel.compareInstalledAppInfo()
@Suppress("DEPRECATION")
viewLifecycleOwner.lifecycleScope.launchWhenCreated {
viewModel.hiddenApps.collect {
hiddenAdapter.updateData(it)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,33 +11,33 @@ class PreferenceViewModel @Inject constructor(
private val preferenceHelper: PreferenceHelper)
: ViewModel() {

val firstLaunchLiveData: MutableLiveData<Boolean> = MutableLiveData()
private val firstLaunchLiveData: MutableLiveData<Boolean> = MutableLiveData()
val showStatusBarLiveData: MutableLiveData<Boolean> = MutableLiveData()
val showTimeLiveData: MutableLiveData<Boolean> = MutableLiveData()
val showDateLiveData: MutableLiveData<Boolean> = MutableLiveData()
val showDailyWordLiveData: MutableLiveData<Boolean> = MutableLiveData()
val showBatteryLiveData: MutableLiveData<Boolean> = MutableLiveData()
val showAppIconLiveData: MutableLiveData<Boolean> = MutableLiveData()
val homeAppAlignmentLiveData: MutableLiveData<Int> = MutableLiveData()
val homeDateAlignmentLiveData: MutableLiveData<Int> = MutableLiveData()
val homeTimeAlignmentLiveData: MutableLiveData<Int> = MutableLiveData()
val homeDailyWordAlignmentLiveData: MutableLiveData<Int> = MutableLiveData()
val dateColorLiveData: MutableLiveData<Int> = MutableLiveData()
val timeColorLiveData: MutableLiveData<Int> = MutableLiveData()
val batteryColorLiveData: MutableLiveData<Int> = MutableLiveData()
val dailyWordColorLiveData: MutableLiveData<Int> = MutableLiveData()
val appColorLiveData: MutableLiveData<Int> = MutableLiveData()
val dateTextSizeLiveData: MutableLiveData<Float> = MutableLiveData()
val timeTextSizeLiveData: MutableLiveData<Float> = MutableLiveData()
val appTextSizeLiveData: MutableLiveData<Float> = MutableLiveData()
val batteryTextSizeLiveData: MutableLiveData<Float> = MutableLiveData()
val tapLockScreenLiveData: MutableLiveData<Boolean> = MutableLiveData()
val swipeNotificationLiveData: MutableLiveData<Boolean> = MutableLiveData()
val swipeSearchLiveData: MutableLiveData<Boolean> = MutableLiveData()
val autoOpenAppsLiveData: MutableLiveData<Boolean> = MutableLiveData()
val autoKeyboardLiveData: MutableLiveData<Boolean> = MutableLiveData()
val lockSettingsLiveData: MutableLiveData<Boolean> = MutableLiveData()
val appPaddingSizeLiveData: MutableLiveData<Float> = MutableLiveData()
private val showAppIconLiveData: MutableLiveData<Boolean> = MutableLiveData()
private val homeAppAlignmentLiveData: MutableLiveData<Int> = MutableLiveData()
private val homeDateAlignmentLiveData: MutableLiveData<Int> = MutableLiveData()
private val homeTimeAlignmentLiveData: MutableLiveData<Int> = MutableLiveData()
private val homeDailyWordAlignmentLiveData: MutableLiveData<Int> = MutableLiveData()
private val dateColorLiveData: MutableLiveData<Int> = MutableLiveData()
private val timeColorLiveData: MutableLiveData<Int> = MutableLiveData()
private val batteryColorLiveData: MutableLiveData<Int> = MutableLiveData()
private val dailyWordColorLiveData: MutableLiveData<Int> = MutableLiveData()
private val appColorLiveData: MutableLiveData<Int> = MutableLiveData()
private val dateTextSizeLiveData: MutableLiveData<Float> = MutableLiveData()
private val timeTextSizeLiveData: MutableLiveData<Float> = MutableLiveData()
private val appTextSizeLiveData: MutableLiveData<Float> = MutableLiveData()
private val batteryTextSizeLiveData: MutableLiveData<Float> = MutableLiveData()
private val tapLockScreenLiveData: MutableLiveData<Boolean> = MutableLiveData()
private val swipeNotificationLiveData: MutableLiveData<Boolean> = MutableLiveData()
private val swipeSearchLiveData: MutableLiveData<Boolean> = MutableLiveData()
private val autoOpenAppsLiveData: MutableLiveData<Boolean> = MutableLiveData()
private val autoKeyboardLiveData: MutableLiveData<Boolean> = MutableLiveData()
private val lockSettingsLiveData: MutableLiveData<Boolean> = MutableLiveData()
private val appPaddingSizeLiveData: MutableLiveData<Float> = MutableLiveData()

fun setFirstLaunch(firstLaunch: Boolean) {
preferenceHelper.firstLaunch = firstLaunch
Expand Down
2 changes: 1 addition & 1 deletion gradle.properties
Original file line number Diff line number Diff line change
Expand Up @@ -21,4 +21,4 @@ kotlin.code.style=official
# resources declared in the library itself and none from the library's dependencies,
# thereby reducing the size of the R class for that library
android.nonTransitiveRClass=true
android.nonFinalResIds=false
android.nonFinalResIds=true

0 comments on commit 7dfddc7

Please sign in to comment.