Remove raw SSD activity wrapper methods
ober
4323a741def928c9b3c03d0aaff5e22f8b8daec8
--- a/templates/ssd-review.ss +++ b/templates/ssd-review.ss @@ -5664,10 +5664,6 @@ (activity : MainActivity) (uri : Uri)) : (List SsdPdfChoice) (kotlin-member-call findSsdPdfsFromTree)) - (extern (mainActivityUniquePdfChoicesRaw - (activity : MainActivity) - (choices : (List SsdPdfChoice))) : (List SsdPdfChoice) - (kotlin-member-call uniquePdfChoices)) (extern (mainActivityShowPdfChoiceDialogRaw (activity : MainActivity) (choices : (List SsdPdfChoice)) @@ -8029,9 +8025,9 @@ (uriParse (nullableTextOrEmpty remembered)))) (begin)) (let ((unique - (mainActivityUniquePdfChoicesRaw - activity - choices))) + (ssdPdfUniqueSortedLimitedChoices + choices + (int32 1000)))) (mainActivityRunOnUiThreadRaw activity (lambda () @@ -10417,8 +10413,8 @@ " button(\"Save\") { mainActivitySaveTruth(this@MainActivity, truthStore, currentSession) }," " ))" " addView(actionRow(" - " button(\"Pull Truth\") { pullTruthDump() }," - " button(\"Push Truth\") { pushTruthDump() }," + " button(\"Pull Truth\") { mainActivityPullTruthDumpAsync(this@MainActivity, truthStore) }," + " button(\"Push Truth\") { mainActivityPushTruthDumpAsync(this@MainActivity, truthStore) }," " button(\"Sync Folder\") { syncTruthFolder() }," " ))" " }" @@ -10785,14 +10781,6 @@ " startActivityForResult(intent, REQ_SYNC_TREE)" " }" "" - " private fun pullTruthDump() {" - " mainActivityPullTruthDumpAsync(this, truthStore)" - " }" - "" - " private fun pushTruthDump() {" - " mainActivityPushTruthDumpAsync(this, truthStore)" - " }" - "" " override fun onActivityResult(requestCode: Int, resultCode: Int, data: Intent?) {" " super.onActivityResult(requestCode, resultCode, data)" " if (activityResultRejected(resultCode, RESULT_OK)) return" @@ -10848,11 +10836,7 @@ " .edit()" " .putString(PREF_SSD_PDF_TREE_URI, uri.toString())" " .apply()" - " showSsdPdfBrowser(uri)" - " }" - "" - " private fun showSsdPdfBrowser(treeUri: Uri) {" - " mainActivityShowSsdPdfBrowserAsync(this, treeUri)" + " mainActivityShowSsdPdfBrowserAsync(this, uri)" " }" "" " internal fun showPdfChoiceDialog(choices: List<SsdPdfChoice>, title: String) {" @@ -10901,7 +10885,7 @@ " val choices = mutableListOf<SsdPdfChoice>()" " choices.addAll(findDownloadSsdPdfsViaMediaStore())" " choices.addAll(findDownloadSsdPdfsViaFiles())" - " return uniquePdfChoices(choices)" + " return ssdPdfUniqueSortedLimitedChoices(choices, MAX_SSD_PDF_CHOICES)" " }" "" " private fun findDownloadSsdPdfsViaMediaStore(): List<SsdPdfChoice> {" @@ -10958,7 +10942,7 @@ " private fun findSsdPdfs(root: DocumentFile): List<SsdPdfChoice> {" " val choices = mutableListOf<SsdPdfChoice>()" " collectSsdPdfs(root, \"\", choices, 0)" - " return uniquePdfChoices(choices)" + " return ssdPdfUniqueSortedLimitedChoices(choices, MAX_SSD_PDF_CHOICES)" " }" "" " private fun collectSsdPdfs(" @@ -10986,10 +10970,6 @@ " }" " }" "" - " internal fun uniquePdfChoices(choices: List<SsdPdfChoice>): List<SsdPdfChoice> {" - " return ssdPdfUniqueSortedLimitedChoices(choices, MAX_SSD_PDF_CHOICES)" - " }" - "" " private fun hasDirectDownloadAccess(): Boolean {" " if (sdkAtLeast(Build.VERSION.SDK_INT, Build.VERSION_CODES.R)) {" " if (Environment.isExternalStorageManager()) return true"