From eeffb12e3b5f1f6e6b9c1546679482e5fa894f33 Mon Sep 17 00:00:00 2001 From: FooIbar <118464521+FooIbar@users.noreply.github.com> Date: Fri, 15 Dec 2023 15:22:03 +0800 Subject: [PATCH] Cleanup code --- app/src/main/AndroidManifest.xml | 1 - .../exception/CloudflareBypassException.kt | 5 ----- .../com/hippo/ehviewer/ui/WebViewActivity.kt | 18 ----------------- .../com/hippo/ehviewer/ui/main/GalleryList.kt | 20 ------------------- .../ehviewer/ui/screen/DownloadsScreen.kt | 3 ++- app/src/main/res/values-de/strings.xml | 10 ---------- app/src/main/res/values-es/strings.xml | 12 ----------- app/src/main/res/values-fr/strings.xml | 12 ----------- app/src/main/res/values-ja/strings.xml | 12 ----------- app/src/main/res/values-ko/strings.xml | 10 ---------- app/src/main/res/values-nb-rNO/strings.xml | 7 ------- app/src/main/res/values-sw720dp/dimens.xml | 1 - app/src/main/res/values-th/strings.xml | 10 ---------- app/src/main/res/values-tr/strings.xml | 9 --------- app/src/main/res/values-zh-rCN/strings.xml | 12 ----------- app/src/main/res/values-zh-rHK/strings.xml | 12 ----------- app/src/main/res/values-zh-rTW/strings.xml | 12 ----------- app/src/main/res/values/dimens.xml | 1 - app/src/main/res/values/ids.xml | 1 - app/src/main/res/values/strings.xml | 12 ----------- 20 files changed, 2 insertions(+), 178 deletions(-) delete mode 100644 app/src/main/kotlin/com/hippo/ehviewer/client/exception/CloudflareBypassException.kt delete mode 100644 app/src/main/kotlin/com/hippo/ehviewer/ui/WebViewActivity.kt diff --git a/app/src/main/AndroidManifest.xml b/app/src/main/AndroidManifest.xml index 298c666af..372555821 100755 --- a/app/src/main/AndroidManifest.xml +++ b/app/src/main/AndroidManifest.xml @@ -139,7 +139,6 @@ android:launchMode="singleTask" android:taskAffinity="" android:theme="@android:style/Theme.Translucent.NoTitleBar" /> - Unit, onLoading: suspend CoroutineScope.() -> Unit, ) { - val context = LocalContext.current val layoutDirection = LocalLayoutDirection.current val marginH = dimensionResource(id = R.dimen.gallery_list_margin_h) val marginV = dimensionResource(id = R.dimen.gallery_list_margin_v) @@ -175,7 +168,6 @@ fun GalleryList( } } - val dialogState = LocalDialogState.current when (val state = data.loadState.refresh) { is LoadState.Loading -> if (!refreshState.isRefreshing && scrollToTopOnRefresh) { LaunchedEffect(Unit) { @@ -200,18 +192,6 @@ fun GalleryList( is LoadState.Error -> { Surface { - LaunchedEffect(state) { - if (state.error.cause is CloudflareBypassException) { - dialogState.awaitPermissionOrCancel(title = R.string.cloudflare_bypass_failed) { - Text(text = stringResource(id = R.string.open_in_webview)) - } - context.startActivity( - Intent(context, WebViewActivity::class.java).apply { - putExtra(WebViewActivity.KEY_URL, EhUrl.host) - }, - ) - } - } ErrorTip( modifier = Modifier.widthIn(max = 228.dp) .clip(ShapeDefaults.Small).clickable { data.retry() }, diff --git a/app/src/main/kotlin/com/hippo/ehviewer/ui/screen/DownloadsScreen.kt b/app/src/main/kotlin/com/hippo/ehviewer/ui/screen/DownloadsScreen.kt index 13416d551..dbadb9421 100644 --- a/app/src/main/kotlin/com/hippo/ehviewer/ui/screen/DownloadsScreen.kt +++ b/app/src/main/kotlin/com/hippo/ehviewer/ui/screen/DownloadsScreen.kt @@ -138,6 +138,7 @@ fun DownloadsScreen(navigator: DestinationsNavigator) { val labelsList = DownloadManager.labelList val newLabel = stringResource(R.string.new_label_title) + val renameLabel = stringResource(R.string.rename_label_title) val labelsStr = stringResource(R.string.download_labels) val labelEmpty = stringResource(R.string.label_text_is_empty) val defaultInvalid = stringResource(R.string.label_text_is_invalid) @@ -276,7 +277,7 @@ fun DownloadsScreen(navigator: DestinationsNavigator) { IconButton( onClick = { coroutineScope.launch { - val new = dialogState.awaitInputText(title = newLabel, hint = labelsStr) { text -> + val new = dialogState.awaitInputText(title = renameLabel, hint = labelsStr) { text -> when { text.isBlank() -> labelEmpty text == defaultName -> defaultInvalid diff --git a/app/src/main/res/values-de/strings.xml b/app/src/main/res/values-de/strings.xml index cd62af242..bbd7a46ed 100755 --- a/app/src/main/res/values-de/strings.xml +++ b/app/src/main/res/values-de/strings.xml @@ -59,21 +59,12 @@ ExHentai durchsuchen E-Hentai durchsuchen Die Welt ist so groß und der Panda sitzt ganz allein - Suchen Suche nach dem Schlüsselwort Suche nach einem Bild - Normale Suche - Erweiterte Optionen Suche nach einem Bild - Normale Suche - Suche in gefolgten Etiketten - Einen Uploader spezifizieren - Ein Etikett spezifizieren - Erweitere Optionen aktivieren Gelöschte Galerien anzeigen Nur die Galerien mit Torrentdateien anzeigen Mindestpunktzahl: - Seiten: zu Standard-Filter deaktivieren für: Sprache @@ -231,7 +222,6 @@ Blocker erstellen Blocker-Text Die blockierten Galerien wurde in EHentai nicht angezeigt.\n\nTitel-Blocker: die Galerien, deren Titel das Wort enthalten, ausschließen.\n\nUploader-Blocker: Die vom Uploader hochgeladen Galerien ausschließen.\n\nEtikett-Blocker: Die Galerien, die die Etikett haben, ausschließen. Es wird länger dauern, Galerieliste zu laden.\n\nEtikettnamensraum-Blocker: Die Galerien, die den Etikettnamensraum haben, ausschließen. Es wird länger dauern, Galerieliste zu laden. - Normale Suche: Nur durchsuchen.\n\nSuche in gefolgten Etiketten: Nur die Galerien, die die gefolgten Etiketten haben, durchsuchen.\n\nUploader spezifizieren: Die Galerien, die vom Uploader hochgeladen sind, auflisten. Andere Optionen werden ignoriert.\n\nEtikett spezifizieren: Die Galerien, die das Etikett haben, auflisten. Nur ein Etikett kann eingegeben werden. Andere Optionen werden ignoriert. EHentai-Einstellungen Zum Speichern der Einstellungen auf Häkchen tippen Das Bild teilen diff --git a/app/src/main/res/values-es/strings.xml b/app/src/main/res/values-es/strings.xml index cc1e96b2a..31c47957e 100644 --- a/app/src/main/res/values-es/strings.xml +++ b/app/src/main/res/values-es/strings.xml @@ -78,29 +78,17 @@ Buscar E-Hentai El mundo es grande y el panda está sentado solo - Buscar - Búsqueda por palabras clave Búsqueda de imagen - Búsqueda normal - Opciones avanzadas Búsqueda de imágenes - Búsqueda general - Uploader específicos - Etiquetas específicas - Habilitar opciones avanzadas - - Búsqueda normal: Solo busca.\n\nBúsqueda de suscripción: Buscar etiquetas suscriptas.n\nUploader especifico: Listar de galerías subidas por el uploader. Otras opciones serán ignoradas.\n\nEtiquetas específicas: Listar las galerías que contienen la etiqueta. Solo se acepta una etiqueta. Otras opciones serán ignoradas. Mostrar galerías borradas Mostrar solo galerías con torrents Valoración mínima: - Búsqueda de etiquetas suscritas Seleccionar imagen Usar búsqueda similar Buscar solo portadas Seleccione la imagen primero - Páginas: hasta Deshabilitar filtros para: Lenguaje diff --git a/app/src/main/res/values-fr/strings.xml b/app/src/main/res/values-fr/strings.xml index dd86ac7dc..1e7f06aad 100755 --- a/app/src/main/res/values-fr/strings.xml +++ b/app/src/main/res/values-fr/strings.xml @@ -81,26 +81,14 @@ Le monde est grand et le panda s\'assied tout seul. Vous pouvez suivre des tags à Paramètres -> EH -> Mes tags. - Chercher - Recherche du mot-clé Recherche d\'une image - Recherche normale - Options avancées Recherche d\'une image - Recherche dans les tags suivis - Chercher - Spécifier un uploader - Spécifier un tag - Activer options avancées - - Recherche normale : faire recherche.\n\nRecherche dans les tags suivis : seulement rechercher dans les tags suivis.\n\nSpécifer un uploader : faire la liste des galeries mises en ligne par l\'uploader spécifié. Autres options sont ignorées.\n\nSpécifier un tag : faire la liste des galeries qui contiennent le tag spécifié. Vous ne pouvez spécifier qu\'un tag. Autres options sont ignorées. Montrer les galeries supprimées Seulement montrer galeries avec des fiches torrent Minimum note : - Pages : à Désactiver le filtre par défaut pour les items suivants : Langue diff --git a/app/src/main/res/values-ja/strings.xml b/app/src/main/res/values-ja/strings.xml index 1aa795ef4..48534ecc7 100644 --- a/app/src/main/res/values-ja/strings.xml +++ b/app/src/main/res/values-ja/strings.xml @@ -79,26 +79,14 @@ 何も見つかりませんでした。 リストは空です。設定->EH->マイタグにてタグを購読することができます。 - 検索 - キーワードで検索 画像で検索 - 検索 - その他のオプション 画像検索 - 一般検索 - 購読検索 - アップローダを検索 - タグを検索 - その他のオプションを有効化 - - 普通検索:検索します。\n\n購読検索:購読しているタグで検索します。\n\nアップローダを検索:このアップローダーがアップロードしたギャラリーをリストします。他のオプションは無視されます。\n\nタグを検索:指定したタグを含むギャラリーをリストします。他のオプションは無視されます。 削除済みのギャラリーを表示 Torrentのあるギャラリーのみを表示 評価の下限: - ページ: から まで 既定フィルターから下記のものを例外とする: diff --git a/app/src/main/res/values-ko/strings.xml b/app/src/main/res/values-ko/strings.xml index db3ed6a29..6a1749d85 100755 --- a/app/src/main/res/values-ko/strings.xml +++ b/app/src/main/res/values-ko/strings.xml @@ -82,20 +82,10 @@ 갤러리 열기 The World is Big and the panda sit alone - 검색 - 키워드 검색 이미지 검색 - 일반 검색 - 고급 옵션 이미지 검색 - 일반 검색 - 업로더 지정 - 태그 지정 - 고급 옵션 사용 - - 일반 검색: 그냥 검색합니다.\n\n업로더 지정: 해당 업로더가 업로드한 갤러리를 검색합니다. 다른 옵션은 무시됩니다.\n\n태그 지정: 해당 태그를 포함한 갤러리를 검색합니다. 하나의 태그만 지정할 수 있으며, 다른 옵션은 무시됩니다. Expunged 갤러리 표시 토렌트 파일이 있는 갤러리만 검색 diff --git a/app/src/main/res/values-nb-rNO/strings.xml b/app/src/main/res/values-nb-rNO/strings.xml index 08f544851..1a35b90d2 100644 --- a/app/src/main/res/values-nb-rNO/strings.xml +++ b/app/src/main/res/values-nb-rNO/strings.xml @@ -36,18 +36,12 @@ Torrent (%d) Del Åpne galleriet - Normalt søk - Abonnementssøk til Opplaster Slett - Søk Bildesøk - Normalt søk Søk i omslag Bildesøk - Angi opplaster - Angi etikett Velg bilde 3 stjerner Les @@ -64,7 +58,6 @@ Gjenoppfrisk Skjønner Nøkkelordssøk - Sider: Etiketter Ubegrenset diff --git a/app/src/main/res/values-sw720dp/dimens.xml b/app/src/main/res/values-sw720dp/dimens.xml index 0ec53bce7..af0fbb504 100644 --- a/app/src/main/res/values-sw720dp/dimens.xml +++ b/app/src/main/res/values-sw720dp/dimens.xml @@ -1,4 +1,3 @@ 480dp - 24dp diff --git a/app/src/main/res/values-th/strings.xml b/app/src/main/res/values-th/strings.xml index bee447cd0..6f7a9b9ff 100644 --- a/app/src/main/res/values-th/strings.xml +++ b/app/src/main/res/values-th/strings.xml @@ -82,20 +82,10 @@ เปิดแกลเลอรี่ โลกนั้นนะมันกว้างงงงงใหญ่ไพรศาล และแพนด้านั่งโดดเดี่ยวเดียวดายในโลกกลมๆ - ค้นหา - คีย์เวิร์ดในการค้นหา ค้นหาด้วยรูป - ค้นหาแบบธรรมดา - ตัวเลือกขั้นสูง ค้นหาด้วยรูปภาพ - ค้นหาแบบธรรมดา - ระบุผู้อัพโหลด - ระบุป้ายกำกับ - เปิดโหมดค้นหาขั้นสูง - - ค้นหาแบบธรรมดา: ค้นหาแบบง๊ายง่าย\n\nระบุผู้อัพโหลด: ค้นหาแกลเลอรี่ที่อัพโหลดโดยระบุชื่อผู้ใช้ของคนอัพโหลด โดยตัวเลือกอื่นๆจะถูกข้ามไป\n\nระบุป้ายกำกับ: ค้นหาแกลเลอรี่ที่ถูกใส่ป้ายกำกับหรือแท็กไว้ในแต่ละแกลเลอรี่ ระบุได้เพียงหนึ่งป้ายกำกับ ตัวเลือกอื่นๆจะถูกข้ามไป แสดงแกลเลอรี่ที่ถูกลบออก แสดงผลเฉพาะแกลเลอรี่ที่มีไฟล์ Torrents diff --git a/app/src/main/res/values-tr/strings.xml b/app/src/main/res/values-tr/strings.xml index abfe2b54a..efffff867 100644 --- a/app/src/main/res/values-tr/strings.xml +++ b/app/src/main/res/values-tr/strings.xml @@ -46,17 +46,9 @@ Giriş başarısız Anladım Dünya büyük olmasına rağmen pandacık yalnız oturuyor - Arayın Anahtar Kelime Arama Görsel Arama - Normal Arama - Gelişmiş Seçenekler Görsel Arama - Normal arama - Abonelik araması - Belirli yükleyici - Belirli etiket - Gelişmiş seçenekleri etkinleştir Yalnızca Silinen Galerileri Gösteri Yalnızca Torrent\'li Galerileri Göster En Az Derecelendirme: @@ -91,7 +83,6 @@ Hangi galeri sitesini ziyaret etmek istiyorsunuz\? E-Hentai\'de Arayın Etiketlere Ayarlar->EH->Etiketlerim yerinden abone olun - Sayfa: Aynı bir hızlı arama zaten var. Adı \"%s\". Sayfa oranı en fazla 10un altında olamaz BENIOKU diff --git a/app/src/main/res/values-zh-rCN/strings.xml b/app/src/main/res/values-zh-rCN/strings.xml index 041ae71ba..79a596d2b 100644 --- a/app/src/main/res/values-zh-rCN/strings.xml +++ b/app/src/main/res/values-zh-rCN/strings.xml @@ -62,8 +62,6 @@ 登录失败 若持续出错,请尝试“通过网页登录”或“通过 Cookie 登录”。 知道了 - 未能绕过 Cloudflare 验证 - 在 WebView 中打开链接以通过验证? 你想选择哪个画廊站点? e-hentai:对任何人开放\nexhentai:仅对登录用户开放 @@ -74,22 +72,12 @@ 打开画廊 什么都没有找到 请至 设置->EH->我的标签 订阅标签 - 搜索 关键字搜索 图片搜索 - 普通搜索 - 高级选项 图片搜索 - 一般搜索 - 订阅搜索 - 指定上传者 - 指定标签 - 启用高级选项 - 一般搜索:就是搜索。\n\n订阅搜素:在订阅中搜索。\n\n指定上传者:列出该上传者上传的画廊。其他选项会被忽略。\n\n指定标签:列出含有该标签的画廊。其他选项会被忽略。 已删除 有种子 最低评分: - 页数: 到 页数最大值至少为 10 页数范围差至少为 20 diff --git a/app/src/main/res/values-zh-rHK/strings.xml b/app/src/main/res/values-zh-rHK/strings.xml index 792b0fc8b..91819bf93 100755 --- a/app/src/main/res/values-zh-rHK/strings.xml +++ b/app/src/main/res/values-zh-rHK/strings.xml @@ -85,26 +85,14 @@ 什麼都沒有找到 請至 設置->EH->我的標籤 訂閲標籤 - 搜索 - 關鍵字搜索 圖片搜索 - 普通搜索 - 高級選項 圖片搜索 - 一般搜索 - 訂閲搜索 - 指定上傳者 - 指定標籤 - 啟用高級選項 - - 一般搜索:就是搜索。\n\n訂閲搜素:在訂閲中搜索。\n\n指定上傳者:列出該上傳者上傳的畫廊。其他選項會被忽略。\n\n指定標籤:列出含有該標籤的畫廊。其他選項會被忽略。 已刪除 有種子 最低評分: - 頁數: 到 禁用排除項: 語言 diff --git a/app/src/main/res/values-zh-rTW/strings.xml b/app/src/main/res/values-zh-rTW/strings.xml index afbf6c07c..1689da128 100644 --- a/app/src/main/res/values-zh-rTW/strings.xml +++ b/app/src/main/res/values-zh-rTW/strings.xml @@ -62,8 +62,6 @@ 登入失敗 若持續出錯,請嘗試“通過網頁登入”或“通過 Cookie 登入”。 知道了 - 未能繞過 Cloudflare 驗證 - 在 WebView 中開啟網址以完成驗證? 你想選擇哪個圖庫站台? e-hentai:對任何人開放\nexhentai:僅對登入使用者開放 @@ -74,22 +72,12 @@ 開啟圖庫 什麼都沒找到 請至 設定->EH->我的標籤 訂閱標籤 - 搜尋 關鍵字搜尋 圖片搜尋 - 一般搜尋 - 進階選項 圖片搜尋 - 一般搜尋 - 訂閱搜尋 - 指定上傳者 - 指定標籤 - 啟用進階選項 - 一般搜尋:就是搜尋。\n\n訂閱搜尋:在訂閱中搜尋。\n\n指定上傳者:列出該上傳者上傳的圖庫。其他選項會被忽略。\n\n指定標籤:列出含有該標籤的圖庫。其他選項會被忽略。 已被移除 有種子 最低評分: - 頁數: 到 頁數最大值至少為 10 頁數範圍差至少為 20 diff --git a/app/src/main/res/values/dimens.xml b/app/src/main/res/values/dimens.xml index b188d1f89..e87c41950 100644 --- a/app/src/main/res/values/dimens.xml +++ b/app/src/main/res/values/dimens.xml @@ -56,6 +56,5 @@ 192dp 0dp - 16dp diff --git a/app/src/main/res/values/ids.xml b/app/src/main/res/values/ids.xml index 9b5a26658..74fe7530a 100644 --- a/app/src/main/res/values/ids.xml +++ b/app/src/main/res/values/ids.xml @@ -16,7 +16,6 @@ - diff --git a/app/src/main/res/values/strings.xml b/app/src/main/res/values/strings.xml index 43e43b8a1..fd33a7430 100644 --- a/app/src/main/res/values/strings.xml +++ b/app/src/main/res/values/strings.xml @@ -100,8 +100,6 @@ Sign in failed If this issue continues, try \"Sign in via WebView\" or \"Sign in via cookies\". Got it - Failed to bypass Cloudflare challenge - Open URL in WebView to finish the challenge? Which gallery site do you want to visit? e-hentai: available for anyone\nexhentai: available for who has signed in @@ -112,22 +110,12 @@ Open the gallery The World is Big and the panda sit alone Subscribe to tags in Settings->EH->My tags - Search Keyword search Image search - Normal Search - Advanced Options Image Search - Normal search - Subscription search - Specify uploader - Specify tag - Enable advance options - Normal search: Simply search.\n\nSubscription search: Search in subscriptions.\n\nSpecify uploader: Search for galleries uploaded by the specified uploader. All other options will be ignored.\n\nSpecify tag: Search for galleries that contain the specified tag. Only one tag accepted. Other options will be ignored. Expunged Has Torrent Minimum Rating: - Pages: to The page range maximum cannot be below 10 The page range must be at least 20