Clean up strings and resources (#8253)

* Clean up strings and resources

* fix pringle's typo

* restore catching file pick errors

* add back file chooser title

* revert #7740 and remove try-catch of chooser-wrapped intent

* swap xmlns lines

* swap xml tools lines
This commit is contained in:
stevenyomi
2022-10-21 05:48:13 +08:00
committed by GitHub
parent 7a360779b3
commit 824d5e22bc
35 changed files with 100 additions and 235 deletions

View File

@@ -70,7 +70,6 @@ import kotlin.math.roundToInt
/**
* Controller that shows the currently active downloads.
* Uses R.layout.fragment_download_queue.
*/
class DownloadController :
FullComposeController<DownloadPresenter>(),

View File

@@ -56,7 +56,7 @@ class LibraryController(
onClickFilter = ::showSettingsSheet,
onClickRefresh = {
val started = LibraryUpdateService.start(context, it)
context.toast(if (started) R.string.updating_library else R.string.update_already_running)
context.toast(if (started) R.string.updating_category else R.string.update_already_running)
started
},
onClickInvertSelection = { presenter.invertSelection(presenter.activeCategory) },

View File

@@ -6,8 +6,6 @@ import android.content.Intent
import android.graphics.drawable.BitmapDrawable
import android.net.Uri
import android.os.Bundle
import androidx.activity.result.PickVisualMediaRequest
import androidx.activity.result.contract.ActivityResultContracts.PickVisualMedia
import androidx.compose.runtime.Composable
import androidx.compose.runtime.collectAsState
import androidx.compose.runtime.remember
@@ -88,7 +86,7 @@ class MangaFullCoverDialog : FullComposeController<MangaFullCoverDialog.MangaFul
} catch (e: Throwable) {
withUIContext {
logcat(LogPriority.ERROR, e)
activity.toast(R.string.error_saving_cover)
activity.toast(R.string.error_sharing_cover)
}
}
}
@@ -114,8 +112,11 @@ class MangaFullCoverDialog : FullComposeController<MangaFullCoverDialog.MangaFul
private fun changeCover(action: EditCoverAction) {
when (action) {
EditCoverAction.EDIT -> {
// This will open new Photo Picker eventually.
// See https://github.com/tachiyomiorg/tachiyomi/pull/8253#issuecomment-1285747310
val intent = Intent(Intent.ACTION_GET_CONTENT).apply { type = "image/*" }
startActivityForResult(
PickVisualMedia().createIntent(activity!!, PickVisualMediaRequest(PickVisualMedia.ImageOnly)),
Intent.createChooser(intent, resources?.getString(R.string.file_select_cover)),
REQUEST_IMAGE_OPEN,
)
}