|
|
@ -3,6 +3,7 @@ |
|
|
|
|
|
|
|
|
package org.yuzu.yuzu_emu.fragments |
|
|
package org.yuzu.yuzu_emu.fragments |
|
|
|
|
|
|
|
|
|
|
|
import android.annotation.SuppressLint |
|
|
import android.os.Bundle |
|
|
import android.os.Bundle |
|
|
import android.text.TextUtils |
|
|
import android.text.TextUtils |
|
|
import android.view.LayoutInflater |
|
|
import android.view.LayoutInflater |
|
|
@ -73,6 +74,8 @@ class GamePropertiesFragment : Fragment() { |
|
|
return binding.root |
|
|
return binding.root |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
// This is using the correct scope, lint is just acting up |
|
|
|
|
|
@SuppressLint("UnsafeRepeatOnLifecycleDetector") |
|
|
override fun onViewCreated(view: View, savedInstanceState: Bundle?) { |
|
|
override fun onViewCreated(view: View, savedInstanceState: Bundle?) { |
|
|
super.onViewCreated(view, savedInstanceState) |
|
|
super.onViewCreated(view, savedInstanceState) |
|
|
homeViewModel.setNavigationVisibility(visible = false, animated = true) |
|
|
homeViewModel.setNavigationVisibility(visible = false, animated = true) |
|
|
@ -99,7 +102,8 @@ class GamePropertiesFragment : Fragment() { |
|
|
|
|
|
|
|
|
reloadList() |
|
|
reloadList() |
|
|
|
|
|
|
|
|
viewLifecycleOwner.lifecycleScope.launch { |
|
|
|
|
|
|
|
|
viewLifecycleOwner.lifecycleScope.apply { |
|
|
|
|
|
launch { |
|
|
repeatOnLifecycle(Lifecycle.State.STARTED) { |
|
|
repeatOnLifecycle(Lifecycle.State.STARTED) { |
|
|
homeViewModel.openImportSaves.collect { |
|
|
homeViewModel.openImportSaves.collect { |
|
|
if (it) { |
|
|
if (it) { |
|
|
@ -109,6 +113,17 @@ class GamePropertiesFragment : Fragment() { |
|
|
} |
|
|
} |
|
|
} |
|
|
} |
|
|
} |
|
|
} |
|
|
|
|
|
launch { |
|
|
|
|
|
repeatOnLifecycle(Lifecycle.State.STARTED) { |
|
|
|
|
|
homeViewModel.reloadPropertiesList.collect { |
|
|
|
|
|
if (it) { |
|
|
|
|
|
reloadList() |
|
|
|
|
|
homeViewModel.reloadPropertiesList(false) |
|
|
|
|
|
} |
|
|
|
|
|
} |
|
|
|
|
|
} |
|
|
|
|
|
} |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
setInsets() |
|
|
setInsets() |
|
|
} |
|
|
} |
|
|
@ -214,7 +229,7 @@ class GamePropertiesFragment : Fragment() { |
|
|
R.string.save_data_deleted_successfully, |
|
|
R.string.save_data_deleted_successfully, |
|
|
Toast.LENGTH_SHORT |
|
|
Toast.LENGTH_SHORT |
|
|
).show() |
|
|
).show() |
|
|
reloadList() |
|
|
|
|
|
|
|
|
homeViewModel.reloadPropertiesList(true) |
|
|
} |
|
|
} |
|
|
).show(parentFragmentManager, MessageDialogFragment.TAG) |
|
|
).show(parentFragmentManager, MessageDialogFragment.TAG) |
|
|
} |
|
|
} |
|
|
@ -242,13 +257,20 @@ class GamePropertiesFragment : Fragment() { |
|
|
} |
|
|
} |
|
|
} |
|
|
} |
|
|
) { |
|
|
) { |
|
|
|
|
|
MessageDialogFragment.newInstance( |
|
|
|
|
|
requireActivity(), |
|
|
|
|
|
titleId = R.string.clear_shader_cache, |
|
|
|
|
|
descriptionId = R.string.clear_shader_cache_warning_description, |
|
|
|
|
|
positiveAction = { |
|
|
shaderCacheDir.deleteRecursively() |
|
|
shaderCacheDir.deleteRecursively() |
|
|
Toast.makeText( |
|
|
Toast.makeText( |
|
|
YuzuApplication.appContext, |
|
|
YuzuApplication.appContext, |
|
|
R.string.cleared_shaders_successfully, |
|
|
R.string.cleared_shaders_successfully, |
|
|
Toast.LENGTH_SHORT |
|
|
Toast.LENGTH_SHORT |
|
|
).show() |
|
|
).show() |
|
|
reloadList() |
|
|
|
|
|
|
|
|
homeViewModel.reloadPropertiesList(true) |
|
|
|
|
|
} |
|
|
|
|
|
).show(parentFragmentManager, MessageDialogFragment.TAG) |
|
|
} |
|
|
} |
|
|
) |
|
|
) |
|
|
} |
|
|
} |
|
|
@ -388,7 +410,7 @@ class GamePropertiesFragment : Fragment() { |
|
|
getString(R.string.save_file_imported_success), |
|
|
getString(R.string.save_file_imported_success), |
|
|
Toast.LENGTH_LONG |
|
|
Toast.LENGTH_LONG |
|
|
).show() |
|
|
).show() |
|
|
reloadList() |
|
|
|
|
|
|
|
|
homeViewModel.reloadPropertiesList(true) |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
cacheSaveDir.deleteRecursively() |
|
|
cacheSaveDir.deleteRecursively() |
|
|
|