Skip to content

Commit

Permalink
Merge branch 'refs/heads/1203-file-manager-can-not-be-found-when-doin…
Browse files Browse the repository at this point in the history
…g-backups' into develop
  • Loading branch information
sds100 committed Jul 7, 2024
2 parents 91cffbf + b172419 commit b5e96fe
Show file tree
Hide file tree
Showing 4 changed files with 9 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -61,14 +61,14 @@ class HomeFragment : Fragment() {
}

private val backupFingerprintMapsLauncher =
registerForActivityResult(CreateDocument("todo/todo")) {
registerForActivityResult(CreateDocument(FileUtils.MIME_TYPE_ZIP)) {
it ?: return@registerForActivityResult

homeViewModel.backupFingerprintMaps(it.toString())
}

private val backupKeyMapsLauncher =
registerForActivityResult(CreateDocument("todo/todo")) {
registerForActivityResult(CreateDocument(FileUtils.MIME_TYPE_ZIP)) {
it ?: return@registerForActivityResult

homeViewModel.backupSelectedKeyMaps(it.toString())
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ import com.michaelflisar.dragselectrecyclerview.DragSelectionProcessor
import io.github.sds100.keymapper.R
import io.github.sds100.keymapper.databinding.FragmentSimpleRecyclerviewBinding
import io.github.sds100.keymapper.logEntry
import io.github.sds100.keymapper.system.files.FileUtils
import io.github.sds100.keymapper.util.Inject
import io.github.sds100.keymapper.util.State
import io.github.sds100.keymapper.util.launchRepeatOnLifecycle
Expand All @@ -43,7 +44,7 @@ class LogFragment : SimpleRecyclerViewFragment<LogEntryListItem>() {
private val recyclerViewController by lazy { RecyclerViewController() }

private val saveLogToFileLauncher =
registerForActivityResult(CreateDocument("todo/todo")) {
registerForActivityResult(CreateDocument(FileUtils.MIME_TYPE_ZIP)) {
it ?: return@registerForActivityResult

viewModel.onPickFileToSaveTo(it.toString())
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ import androidx.lifecycle.Lifecycle
import androidx.lifecycle.lifecycleScope
import com.github.appintro.AppIntro2
import io.github.sds100.keymapper.R
import io.github.sds100.keymapper.system.files.FileUtils
import io.github.sds100.keymapper.system.permissions.RequestPermissionDelegate
import io.github.sds100.keymapper.util.Inject
import io.github.sds100.keymapper.util.launchRepeatOnLifecycle
Expand All @@ -27,7 +28,7 @@ class ReportBugActivity : AppIntro2() {
private lateinit var requestPermissionDelegate: RequestPermissionDelegate

private val chooseReportLocationLauncher =
registerForActivityResult(CreateDocument("todo/todo")) {
registerForActivityResult(CreateDocument(FileUtils.MIME_TYPE_ZIP)) {
it ?: return@registerForActivityResult

viewModel.onChooseBugReportLocation(it.toString())
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ import android.content.Intent
import android.os.Build
import android.os.Bundle
import android.view.View
import androidx.activity.result.contract.ActivityResultContracts
import androidx.activity.result.contract.ActivityResultContracts.CreateDocument
import androidx.annotation.RequiresApi
import androidx.lifecycle.Lifecycle
Expand All @@ -21,6 +22,7 @@ import io.github.sds100.keymapper.backup.BackupUtils
import io.github.sds100.keymapper.data.Keys
import io.github.sds100.keymapper.data.PreferenceDefaults
import io.github.sds100.keymapper.shizuku.ShizukuUtils
import io.github.sds100.keymapper.system.files.FileUtils
import io.github.sds100.keymapper.system.notifications.NotificationController
import io.github.sds100.keymapper.system.notifications.NotificationUtils
import io.github.sds100.keymapper.util.firstBlocking
Expand Down Expand Up @@ -49,7 +51,7 @@ class MainSettingsFragment : BaseSettingsFragment() {
}

private val chooseAutomaticBackupLocationLauncher =
registerForActivityResult(CreateDocument("todo/todo")) {
registerForActivityResult(CreateDocument(FileUtils.MIME_TYPE_ZIP)) {
it ?: return@registerForActivityResult

viewModel.setAutomaticBackupLocation(it.toString())
Expand Down

0 comments on commit b5e96fe

Please sign in to comment.