|
|
@ -4,6 +4,7 @@
|
|
|
|
package org.yuzu.yuzu_emu.fragments
|
|
|
|
package org.yuzu.yuzu_emu.fragments
|
|
|
|
|
|
|
|
|
|
|
|
import android.Manifest
|
|
|
|
import android.Manifest
|
|
|
|
|
|
|
|
import android.annotation.SuppressLint
|
|
|
|
import android.content.Intent
|
|
|
|
import android.content.Intent
|
|
|
|
import android.os.Build
|
|
|
|
import android.os.Build
|
|
|
|
import android.os.Bundle
|
|
|
|
import android.os.Bundle
|
|
|
@ -75,6 +76,8 @@ class SetupFragment : 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?) {
|
|
|
|
mainActivity = requireActivity() as MainActivity
|
|
|
|
mainActivity = requireActivity() as MainActivity
|
|
|
|
|
|
|
|
|
|
|
@ -206,7 +209,8 @@ class SetupFragment : Fragment() {
|
|
|
|
)
|
|
|
|
)
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
viewLifecycleOwner.lifecycleScope.launch {
|
|
|
|
viewLifecycleOwner.lifecycleScope.apply {
|
|
|
|
|
|
|
|
launch {
|
|
|
|
repeatOnLifecycle(Lifecycle.State.CREATED) {
|
|
|
|
repeatOnLifecycle(Lifecycle.State.CREATED) {
|
|
|
|
homeViewModel.shouldPageForward.collect {
|
|
|
|
homeViewModel.shouldPageForward.collect {
|
|
|
|
if (it) {
|
|
|
|
if (it) {
|
|
|
@ -216,6 +220,17 @@ class SetupFragment : Fragment() {
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
launch {
|
|
|
|
|
|
|
|
repeatOnLifecycle(Lifecycle.State.CREATED) {
|
|
|
|
|
|
|
|
homeViewModel.gamesDirSelected.collect {
|
|
|
|
|
|
|
|
if (it) {
|
|
|
|
|
|
|
|
gamesDirCallback.onStepCompleted()
|
|
|
|
|
|
|
|
homeViewModel.setGamesDirSelected(false)
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
binding.viewPager2.apply {
|
|
|
|
binding.viewPager2.apply {
|
|
|
|
adapter = SetupAdapter(requireActivity() as AppCompatActivity, pages)
|
|
|
|
adapter = SetupAdapter(requireActivity() as AppCompatActivity, pages)
|
|
|
@ -339,7 +354,6 @@ class SetupFragment : Fragment() {
|
|
|
|
registerForActivityResult(ActivityResultContracts.OpenDocumentTree()) { result ->
|
|
|
|
registerForActivityResult(ActivityResultContracts.OpenDocumentTree()) { result ->
|
|
|
|
if (result != null) {
|
|
|
|
if (result != null) {
|
|
|
|
mainActivity.processGamesDir(result)
|
|
|
|
mainActivity.processGamesDir(result)
|
|
|
|
gamesDirCallback.onStepCompleted()
|
|
|
|
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|