From 54b216f09e5e1d263b7284d196e9f942d62516ad Mon Sep 17 00:00:00 2001 From: tibbi Date: Tue, 13 Feb 2018 14:21:50 +0100 Subject: [PATCH 01/71] update commons to 3.11.15 --- app/build.gradle | 2 +- .../kotlin/com/simplemobiletools/gallery/extensions/Activity.kt | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/app/build.gradle b/app/build.gradle index b02036847..31a0c64e4 100644 --- a/app/build.gradle +++ b/app/build.gradle @@ -46,7 +46,7 @@ ext { } dependencies { - implementation 'com.simplemobiletools:commons:3.11.1' + implementation 'com.simplemobiletools:commons:3.11.15' implementation 'com.theartofdev.edmodo:android-image-cropper:2.6.0' implementation 'com.android.support:multidex:1.0.2' implementation 'com.google.code.gson:gson:2.8.2' diff --git a/app/src/main/kotlin/com/simplemobiletools/gallery/extensions/Activity.kt b/app/src/main/kotlin/com/simplemobiletools/gallery/extensions/Activity.kt index 3103a84a9..dd8630889 100644 --- a/app/src/main/kotlin/com/simplemobiletools/gallery/extensions/Activity.kt +++ b/app/src/main/kotlin/com/simplemobiletools/gallery/extensions/Activity.kt @@ -177,7 +177,7 @@ fun BaseSimpleActivity.tryCopyMoveFilesTo(files: ArrayList, isCopyOperatio val source = if (files[0].isFile) files[0].parent else files[0].absolutePath PickDirectoryDialog(this, source) { - copyMoveFilesTo(files, source.trimEnd('/'), it, isCopyOperation, true, callback) + copyMoveFilesTo(files, source.trimEnd('/'), it, isCopyOperation, true, config.shouldShowHidden, callback) } } From fe94602fc2b12b51603268cab090705663f7cf72 Mon Sep 17 00:00:00 2001 From: crusepath <36575237+crusepath@users.noreply.github.com> Date: Sun, 18 Feb 2018 05:38:53 +0900 Subject: [PATCH 02/71] Update strings.xml add Japanese. --- app/src/main/res/values-ja/strings.xml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/app/src/main/res/values-ja/strings.xml b/app/src/main/res/values-ja/strings.xml index 540a8f242..027be91cc 100644 --- a/app/src/main/res/values-ja/strings.xml +++ b/app/src/main/res/values-ja/strings.xml @@ -22,8 +22,8 @@ 音量 明るさ Do not ask again in this session - Lock orientation - Unlock orientation + 画面の向きを固定する + 固定の向きを解除する 表示メディア種 From 0329a046cff819ef3105d042c784df2a5718c487 Mon Sep 17 00:00:00 2001 From: crusepath <36575237+crusepath@users.noreply.github.com> Date: Sun, 18 Feb 2018 05:45:49 +0900 Subject: [PATCH 03/71] Update strings.xml --- app/src/main/res/values-ja/strings.xml | 50 +++++++++++++------------- 1 file changed, 25 insertions(+), 25 deletions(-) diff --git a/app/src/main/res/values-ja/strings.xml b/app/src/main/res/values-ja/strings.xml index 027be91cc..21927bf2c 100644 --- a/app/src/main/res/values-ja/strings.xml +++ b/app/src/main/res/values-ja/strings.xml @@ -7,11 +7,11 @@ (非表示) フォルダーをピン留めする フォルダーのピン留めを外す - Pin to the top + トップにピン留めする 全てを表示 - すべてのフォルダー - フォルダーを選択する - その他のフォルダー + すべてのフォルダ + フォルダを選択する + その他のフォルダ 地図で表示 位置情報がありません 列数を増やす @@ -21,9 +21,9 @@ デフォルトに戻す 音量 明るさ - Do not ask again in this session + このセッションでは再度たずねない 画面の向きを固定する - 固定の向きを解除する + 向きの固定を解除する 表示メディア種 @@ -34,24 +34,24 @@ 絞り込み条件を変更 - 対象のフォルダーに「.nomedia」というファイルを作成し、フォルダーを非表示にします。そのフォルダー以下のすべてのサブフォルダーも、同様に非表示となります。非表示となったフォルダーを見るには、「設定」の中にある「非表示のフォルダーを表示」オプションを切り替えてください。このフォルダーを非表示にしますか? + 対象のフォルダに「.nomedia」というファイルを作成し、フォルダを非表示にします。そのフォルダ以下のすべてのサブフォルダも、同様に非表示となります。非表示となったフォルダを見るには、「設定」の中にある「非表示のフォルダを表示」オプションを切り替えてください。このフォルダを非表示にしますか? 除外する - 除外フォルダー - 除外フォルダーを管理 - 選択したフォルダーとそのサブフォルダーを、Simple Galleyの一覧から除外します。除外したフォルダーは「設定」で管理できます。 - 親フォルダーを選択して除外することもできます。 - フォルダーを除外すると、サブフォルダーも含めSimple Galleyの一覧から除外します。他のアプリでは引き続き表示されます。\\n\\n他のアプリでも非表示にしたい場合は、「非表示」機能を使用してください。 + 除外フォルダ + 除外フォルダを管理 + 選択したフォルダとそのサブフォルダを、Simple Galleyの一覧から除外します。除外したフォルダは「設定」で管理できます。 + 親フォルダを選択して除外することもできます。 + フォルダを除外すると、サブフォルダも含めSimple Galleyの一覧から除外します。他のアプリでは引き続き表示されます。\\n\\n他のアプリでも非表示にしたい場合は、「非表示」機能を使用してください。 すべて解除 - 除外するフォルダーの登録をすべて解除しますか? フォルダー自体は削除されません。 - Hidden folders - Manage hidden folders - Seems like you don\'t have any folders hidden with a \".nomedia\" file. + 除外するフォルダの登録をすべて解除しますか? フォルダー自体は削除されません。 + 非表示フォルダ + 非表示フォルダを管理する + \".nomedia\"ファイルで隠されたフォルダはありません。 - 追加フォルダー - 追加フォルダーを管理 - フォルダーを追加 - メディアを含んでいるフォルダーがアプリから認識されていない場合は、手動で追加できます。 + 追加フォルダ + 追加フォルダを管理 + フォルダを追加 + メディアを含んでいるフォルダがアプリから認識されていない場合は、手動で追加できます。 リサイズ @@ -107,9 +107,9 @@ スライドショーに表示するメディアがありません - Change view type - Grid - List + 表示形式の変更 + グリッド + リスト ビデオを自動再生する @@ -125,7 +125,7 @@ Black background and status bar at fullscreen media サムネイル画面を横方向にスクロール フルスクリーン時にシステムUIを非表示にする - メディアの削除後にフォルダーが空になった場合、そのフォルダーを削除する + メディアの削除後にフォルダが空になった場合、そのフォルダを削除する Allow controlling photo brightness with vertical gestures ビデオ再生中に、音量と明るさを縦方向のジェスチャーで変更する Show folder media count on the main view @@ -149,7 +149,7 @@ 写真やビデオを見るためのシンプルなツール。 日付、サイズ、名前で、昇順または降順にアイテムを並べ替えることができ、写真は拡大表示できます。 メディアファイルは、ディスプレイのサイズに応じて複数の列に表示されます。 名前の変更、共有、削除、コピー、移動が可能です。 画像をトリミング、回転、または壁紙としてアプリから直接設定することもできます。 - ギャラリーは、画像やビデオのプレビュー、メールクライアントで添付ファイルの追加など、サードパーティの用途にも提供されます。 毎日の使用には完璧です。 + ギャラリーは、画像やビデオのプレビュー、メールクライアントで添付ファイルの追加など、サードパーティの用途にも提供されます。 日々の使用には最適です。 The fingerprint permission is needed for locking either hidden item visibility, or the whole app. From cf4878501fb3c130f0f03268082f3f4238dea94a Mon Sep 17 00:00:00 2001 From: crusepath <36575237+crusepath@users.noreply.github.com> Date: Sun, 18 Feb 2018 06:14:14 +0900 Subject: [PATCH 04/71] Update strings.xml --- app/src/main/res/values-ja/strings.xml | 22 +++++++++++----------- 1 file changed, 11 insertions(+), 11 deletions(-) diff --git a/app/src/main/res/values-ja/strings.xml b/app/src/main/res/values-ja/strings.xml index 21927bf2c..cc9e66421 100644 --- a/app/src/main/res/values-ja/strings.xml +++ b/app/src/main/res/values-ja/strings.xml @@ -89,9 +89,9 @@ 壁紙を正常に設定しました 縦向きの縦横比 横向きの縦横比 - Home screen - Lock screen - Home and lock screen + ホーム画面 + ロック画面 + ホーム画面とロック画面 スライドショー @@ -122,36 +122,36 @@ システム設定に従う 端末の向きに従う メディアの縦横比に従う - Black background and status bar at fullscreen media + フルスクリーン表示の背景色とステータスバーの背景色を黒にする サムネイル画面を横方向にスクロール フルスクリーン時にシステムUIを非表示にする メディアの削除後にフォルダが空になった場合、そのフォルダを削除する Allow controlling photo brightness with vertical gestures ビデオ再生中に、音量と明るさを縦方向のジェスチャーで変更する - Show folder media count on the main view + フォルダの中にあるメディアの数をメイン画面に表示する フルスクリーンメニューの「共有」を「回転」に置き換える Show extended details over fullscreen media Manage extended details - Allow one finger zoom at fullscreen media + フルスクリーン表示のメディアを指ひとつでズームできるようにする Allow instantly changing media by clicking on screen sides Replace deep zoomable images with better quality ones Hide extended details when status bar is hidden Do an extra check to avoid showing invalid files - Thumbnails - Fullscreen media - Extended details + サムネイル + メディアのみ + 詳細も表示する 写真やビデオを見るためのギャラリー。広告はありません。 - 写真やビデオを見るためのシンプルなツール。 日付、サイズ、名前で、昇順または降順にアイテムを並べ替えることができ、写真は拡大表示できます。 メディアファイルは、ディスプレイのサイズに応じて複数の列に表示されます。 名前の変更、共有、削除、コピー、移動が可能です。 画像をトリミング、回転、または壁紙としてアプリから直接設定することもできます。 + 写真やビデオを見るためのシンプルなツール。 日付、サイズ、名前で、昇順または降順にアイテムを並べ替えることができ、写真は拡大表示できます。 メディアファイルは、画面のサイズに応じて最適な列数で表示されます。 名前の変更、共有、削除、コピー、移動が可能です。 画像をトリミング、回転、または壁紙としてアプリから直接設定することもできます。 ギャラリーは、画像やビデオのプレビュー、メールクライアントで添付ファイルの追加など、サードパーティの用途にも提供されます。 日々の使用には最適です。 - The fingerprint permission is needed for locking either hidden item visibility, or the whole app. + 隠しアイテムを表示したりアプリそのものをロックするには指紋認証の許可が必要です。 広告や不要なアクセス許可は含まれていません。 完全にオープンソースで、ダークテーマも提供しています。 From ea1e26ebe3ee23765817ef55760286ff70ce9d1b Mon Sep 17 00:00:00 2001 From: crusepath <36575237+crusepath@users.noreply.github.com> Date: Sun, 18 Feb 2018 06:21:54 +0900 Subject: [PATCH 05/71] Update strings.xml --- app/src/main/res/values-ja/strings.xml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/app/src/main/res/values-ja/strings.xml b/app/src/main/res/values-ja/strings.xml index cc9e66421..e8a51fcac 100644 --- a/app/src/main/res/values-ja/strings.xml +++ b/app/src/main/res/values-ja/strings.xml @@ -126,12 +126,12 @@ サムネイル画面を横方向にスクロール フルスクリーン時にシステムUIを非表示にする メディアの削除後にフォルダが空になった場合、そのフォルダを削除する - Allow controlling photo brightness with vertical gestures + 垂直のジェスチャーで写真の明るさを制御できるようにする ビデオ再生中に、音量と明るさを縦方向のジェスチャーで変更する フォルダの中にあるメディアの数をメイン画面に表示する フルスクリーンメニューの「共有」を「回転」に置き換える - Show extended details over fullscreen media - Manage extended details + フルスクリーン画面に詳細を重ねて表示する + 詳細内容を管理する フルスクリーン表示のメディアを指ひとつでズームできるようにする Allow instantly changing media by clicking on screen sides Replace deep zoomable images with better quality ones From 7e0cf1cf1b51ed5f4792d76f264cc29c11e4348a Mon Sep 17 00:00:00 2001 From: crusepath <36575237+crusepath@users.noreply.github.com> Date: Sun, 18 Feb 2018 06:34:19 +0900 Subject: [PATCH 06/71] Update strings.xml --- app/src/main/res/values-ja/strings.xml | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/app/src/main/res/values-ja/strings.xml b/app/src/main/res/values-ja/strings.xml index e8a51fcac..289b522cc 100644 --- a/app/src/main/res/values-ja/strings.xml +++ b/app/src/main/res/values-ja/strings.xml @@ -5,8 +5,8 @@ 編集 カメラを開く (非表示) - フォルダーをピン留めする - フォルダーのピン留めを外す + フォルダをピン留めする + フォルダのピン留めを外す トップにピン留めする 全てを表示 すべてのフォルダ @@ -26,7 +26,7 @@ 向きの固定を解除する - 表示メディア種 + 表示するメディアの種類 画像 ビデオ GIF @@ -42,7 +42,7 @@ 親フォルダを選択して除外することもできます。 フォルダを除外すると、サブフォルダも含めSimple Galleyの一覧から除外します。他のアプリでは引き続き表示されます。\\n\\n他のアプリでも非表示にしたい場合は、「非表示」機能を使用してください。 すべて解除 - 除外するフォルダの登録をすべて解除しますか? フォルダー自体は削除されません。 + 除外するフォルダの登録をすべて解除しますか? フォルダ自体は削除されません。 非表示フォルダ 非表示フォルダを管理する \".nomedia\"ファイルで隠されたフォルダはありません。 @@ -131,12 +131,12 @@ フォルダの中にあるメディアの数をメイン画面に表示する フルスクリーンメニューの「共有」を「回転」に置き換える フルスクリーン画面に詳細を重ねて表示する - 詳細内容を管理する + 詳細表示を管理する フルスクリーン表示のメディアを指ひとつでズームできるようにする - Allow instantly changing media by clicking on screen sides - Replace deep zoomable images with better quality ones - Hide extended details when status bar is hidden - Do an extra check to avoid showing invalid files + 画面の端を押してメディアをすぐに変更できるようにする + ズーム可能な画像をより高画質なものに置き換える + ステータスバーが非表示の時は詳細を表示しない + 無効なファイルを表示しないための調査を行います サムネイル From e2f0193b3085489a3f2e79840c141738cbe126b2 Mon Sep 17 00:00:00 2001 From: en2sv Date: Sun, 18 Feb 2018 20:10:22 +0100 Subject: [PATCH 07/71] Update Swedish translation --- app/src/main/res/values-sv/strings.xml | 30 +++++++++++++------------- 1 file changed, 15 insertions(+), 15 deletions(-) diff --git a/app/src/main/res/values-sv/strings.xml b/app/src/main/res/values-sv/strings.xml index b65c23c2d..40b112102 100644 --- a/app/src/main/res/values-sv/strings.xml +++ b/app/src/main/res/values-sv/strings.xml @@ -5,9 +5,9 @@ Redigera Starta kameran (dold) - Fäst mappen - Släpp mappen - Pin to the top + Fäst mapp + Lossa mapp + Fäst högst upp Visa alla mappars innehåll Alla mappar Byt till mappvy @@ -62,14 +62,14 @@ Ange en giltig bildupplösning - Redigera + Redigerare Spara Rotera Sökväg Ogiltig bildsökväg Bilden kunde inte redigeras Redigera bilden med: - Hittade ingen bildredigerare + Ingen bildredigerare hittades Okänd filplats Det gick inte att skriva över källfilen Rotera åt vänster @@ -116,7 +116,7 @@ Visa/dölj filnamnen Spela upp videor om och om igen Animera GIF-bilders miniatyrer - Maximal ljusstyrka när media visas + Maximal ljusstyrka när media visas i helskärmsläge Beskär miniatyrer till kvadrater Rotera media i helskärmsläge Systeminställning @@ -126,22 +126,22 @@ Rulla horisontellt genom miniatyrer Dölj systemanvändargränssnittet automatiskt när media visas i helskärmsläge Ta bort tomma mappar när deras innehåll tas bort - Allow controlling photo brightness with vertical gestures + Tillåt styrning av fotoljusstyrka med vertikala gester Tillåt styrning av videovolym och videoljusstyrka med vertikala gester Visa antalet mediefiler i varje mapp i huvudvyn Ersätt Dela med Rotera i helskärmsmenyn Visa utökad information över media i helskärmsläge Hantera utökad information - Allow one finger zoom at fullscreen media - Allow instantly changing media by clicking on screen sides - Replace deep zoomable images with better quality ones - Hide extended details when status bar is hidden - Do an extra check to avoid showing invalid files + Tillåt zoomning med ett finger när media visas i helskärmsläge + Tillåt snabbyte av media genom tryckning på skärmens kanter + Ersätt djupt zoombara bilder med bilder av bättre kvalitet + Dölj utökad information när statusfältet är dolt + Gör en extra kontroll för att hindra ogiltiga filer från att visas - Thumbnails - Fullscreen media - Extended details + Miniatyrer + Visning av media i helskärmsläge + Utökad information From fb49949fac6cd0116a40b088f48eff057cdbf1e9 Mon Sep 17 00:00:00 2001 From: tibbi Date: Mon, 19 Feb 2018 00:30:34 +0100 Subject: [PATCH 08/71] adding some FAQ strings --- app/src/main/res/values-ar/strings.xml | 20 ++++++++++++++++++++ app/src/main/res/values-ca/strings.xml | 20 ++++++++++++++++++++ app/src/main/res/values-cs/strings.xml | 20 ++++++++++++++++++++ app/src/main/res/values-de/strings.xml | 20 ++++++++++++++++++++ app/src/main/res/values-es/strings.xml | 20 ++++++++++++++++++++ app/src/main/res/values-fi/strings.xml | 20 ++++++++++++++++++++ app/src/main/res/values-fr/strings.xml | 20 ++++++++++++++++++++ app/src/main/res/values-gl/strings.xml | 20 ++++++++++++++++++++ app/src/main/res/values-hr/strings.xml | 20 ++++++++++++++++++++ app/src/main/res/values-hu/strings.xml | 20 ++++++++++++++++++++ app/src/main/res/values-it/strings.xml | 20 ++++++++++++++++++++ app/src/main/res/values-ja/strings.xml | 20 ++++++++++++++++++++ app/src/main/res/values-ko-rKR/strings.xml | 20 ++++++++++++++++++++ app/src/main/res/values-nb/strings.xml | 20 ++++++++++++++++++++ app/src/main/res/values-nl/strings.xml | 20 ++++++++++++++++++++ app/src/main/res/values-pl/strings.xml | 20 ++++++++++++++++++++ app/src/main/res/values-pt-rBR/strings.xml | 20 ++++++++++++++++++++ app/src/main/res/values-pt/strings.xml | 20 ++++++++++++++++++++ app/src/main/res/values-ru/strings.xml | 20 ++++++++++++++++++++ app/src/main/res/values-sk/strings.xml | 20 ++++++++++++++++++++ app/src/main/res/values-sv/strings.xml | 20 ++++++++++++++++++++ app/src/main/res/values-tr/strings.xml | 20 ++++++++++++++++++++ app/src/main/res/values-zh-rCN/strings.xml | 20 ++++++++++++++++++++ app/src/main/res/values-zh-rTW/strings.xml | 20 ++++++++++++++++++++ app/src/main/res/values/strings.xml | 20 ++++++++++++++++++++ 25 files changed, 500 insertions(+) diff --git a/app/src/main/res/values-ar/strings.xml b/app/src/main/res/values-ar/strings.xml index f75a61d8c..3001d290d 100644 --- a/app/src/main/res/values-ar/strings.xml +++ b/app/src/main/res/values-ar/strings.xml @@ -147,6 +147,26 @@ Fullscreen media Extended details + + How can I make Simple Gallery the default device gallery? + First you have to find the currently default gallery in the Apps section of your device settings, look for a button that says something like \"Open by default\", click on it, then select \"Clear defaults\". + The next time you will try opening an image or video you should see an app picker, where you can select Simple Gallery and make it the default app. + I locked the app with a password, but I forgot it. What can I do? + You can solve it in 2 ways. You can either reinstall the app, or find the app in your device settings and select \"Clear data\". It will reset all your settings, it will not remove any media files. + How can I make an album always appear at the top? + You can long press the desired album and select the Pin icon at the actionmenu, that will pin it to the top. You can pin multiple folders too, pinned items will be sorted by the default sorting method. + How can I fast-forward videos? + You can click on the current or max duration texts near the seekbar, that will move the video either backward, or forward. + What is the difference between hiding and excluding a folder? + Exclude prevents displaying the folder only in Simple Gallery, while Hide works system-wise and it hides the folder from other galleries too. It works by creating an empty \".nomedia\" file in the given folder, which you can then remove with any file manager too. + Why do folders with music cover art or stickers show up? + It can happen that you will see some unusual albums show up. You can easily exclude them by long pressing them and selecting Exclude. In the next dialog you can then select the parent folder, chances are it will prevent the other related albums showing up too. + A folder with images isn\'t showing up, what can I do? + That can have multiple reasons, but solving it is easy. Just go in Settings -> Manage Included Folders, select Plus and navigate to the required folder. + What if I want just a few particular folders visible? + Adding a folder at the Included Folders doesn\'t automatically exclude anything. What you can do is go in Settings -> Manage Excluded Folders, exclude the root folder \"/\", then add the desired folders at Settings -> Manage Included Folders. + That will make only the selected folders visible, as both excluding and including are recursive and if a folder is both excluded and included, it will show up. + استوديو لعرض الصور والفيديو بدون اعلانات. diff --git a/app/src/main/res/values-ca/strings.xml b/app/src/main/res/values-ca/strings.xml index 37c20d263..38bff8b37 100644 --- a/app/src/main/res/values-ca/strings.xml +++ b/app/src/main/res/values-ca/strings.xml @@ -143,6 +143,26 @@ Mitjans a pantalla completa Detalls estesos + + How can I make Simple Gallery the default device gallery? + First you have to find the currently default gallery in the Apps section of your device settings, look for a button that says something like \"Open by default\", click on it, then select \"Clear defaults\". + The next time you will try opening an image or video you should see an app picker, where you can select Simple Gallery and make it the default app. + I locked the app with a password, but I forgot it. What can I do? + You can solve it in 2 ways. You can either reinstall the app, or find the app in your device settings and select \"Clear data\". It will reset all your settings, it will not remove any media files. + How can I make an album always appear at the top? + You can long press the desired album and select the Pin icon at the actionmenu, that will pin it to the top. You can pin multiple folders too, pinned items will be sorted by the default sorting method. + How can I fast-forward videos? + You can click on the current or max duration texts near the seekbar, that will move the video either backward, or forward. + What is the difference between hiding and excluding a folder? + Exclude prevents displaying the folder only in Simple Gallery, while Hide works system-wise and it hides the folder from other galleries too. It works by creating an empty \".nomedia\" file in the given folder, which you can then remove with any file manager too. + Why do folders with music cover art or stickers show up? + It can happen that you will see some unusual albums show up. You can easily exclude them by long pressing them and selecting Exclude. In the next dialog you can then select the parent folder, chances are it will prevent the other related albums showing up too. + A folder with images isn\'t showing up, what can I do? + That can have multiple reasons, but solving it is easy. Just go in Settings -> Manage Included Folders, select Plus and navigate to the required folder. + What if I want just a few particular folders visible? + Adding a folder at the Included Folders doesn\'t automatically exclude anything. What you can do is go in Settings -> Manage Excluded Folders, exclude the root folder \"/\", then add the desired folders at Settings -> Manage Included Folders. + That will make only the selected folders visible, as both excluding and including are recursive and if a folder is both excluded and included, it will show up. + Una galeria per veure imatges i vídeos sense publicitat. diff --git a/app/src/main/res/values-cs/strings.xml b/app/src/main/res/values-cs/strings.xml index 16b76fe49..a8b529767 100644 --- a/app/src/main/res/values-cs/strings.xml +++ b/app/src/main/res/values-cs/strings.xml @@ -143,6 +143,26 @@ Fullscreen media Extended details + + How can I make Simple Gallery the default device gallery? + First you have to find the currently default gallery in the Apps section of your device settings, look for a button that says something like \"Open by default\", click on it, then select \"Clear defaults\". + The next time you will try opening an image or video you should see an app picker, where you can select Simple Gallery and make it the default app. + I locked the app with a password, but I forgot it. What can I do? + You can solve it in 2 ways. You can either reinstall the app, or find the app in your device settings and select \"Clear data\". It will reset all your settings, it will not remove any media files. + How can I make an album always appear at the top? + You can long press the desired album and select the Pin icon at the actionmenu, that will pin it to the top. You can pin multiple folders too, pinned items will be sorted by the default sorting method. + How can I fast-forward videos? + You can click on the current or max duration texts near the seekbar, that will move the video either backward, or forward. + What is the difference between hiding and excluding a folder? + Exclude prevents displaying the folder only in Simple Gallery, while Hide works system-wise and it hides the folder from other galleries too. It works by creating an empty \".nomedia\" file in the given folder, which you can then remove with any file manager too. + Why do folders with music cover art or stickers show up? + It can happen that you will see some unusual albums show up. You can easily exclude them by long pressing them and selecting Exclude. In the next dialog you can then select the parent folder, chances are it will prevent the other related albums showing up too. + A folder with images isn\'t showing up, what can I do? + That can have multiple reasons, but solving it is easy. Just go in Settings -> Manage Included Folders, select Plus and navigate to the required folder. + What if I want just a few particular folders visible? + Adding a folder at the Included Folders doesn\'t automatically exclude anything. What you can do is go in Settings -> Manage Excluded Folders, exclude the root folder \"/\", then add the desired folders at Settings -> Manage Included Folders. + That will make only the selected folders visible, as both excluding and including are recursive and if a folder is both excluded and included, it will show up. + Galerie na prohlížení obrázků a videí bez reklam. diff --git a/app/src/main/res/values-de/strings.xml b/app/src/main/res/values-de/strings.xml index b02e45e42..62c6e4fa5 100644 --- a/app/src/main/res/values-de/strings.xml +++ b/app/src/main/res/values-de/strings.xml @@ -143,6 +143,26 @@ Vollbild-Medien Erweiterte Details + + How can I make Simple Gallery the default device gallery? + First you have to find the currently default gallery in the Apps section of your device settings, look for a button that says something like \"Open by default\", click on it, then select \"Clear defaults\". + The next time you will try opening an image or video you should see an app picker, where you can select Simple Gallery and make it the default app. + I locked the app with a password, but I forgot it. What can I do? + You can solve it in 2 ways. You can either reinstall the app, or find the app in your device settings and select \"Clear data\". It will reset all your settings, it will not remove any media files. + How can I make an album always appear at the top? + You can long press the desired album and select the Pin icon at the actionmenu, that will pin it to the top. You can pin multiple folders too, pinned items will be sorted by the default sorting method. + How can I fast-forward videos? + You can click on the current or max duration texts near the seekbar, that will move the video either backward, or forward. + What is the difference between hiding and excluding a folder? + Exclude prevents displaying the folder only in Simple Gallery, while Hide works system-wise and it hides the folder from other galleries too. It works by creating an empty \".nomedia\" file in the given folder, which you can then remove with any file manager too. + Why do folders with music cover art or stickers show up? + It can happen that you will see some unusual albums show up. You can easily exclude them by long pressing them and selecting Exclude. In the next dialog you can then select the parent folder, chances are it will prevent the other related albums showing up too. + A folder with images isn\'t showing up, what can I do? + That can have multiple reasons, but solving it is easy. Just go in Settings -> Manage Included Folders, select Plus and navigate to the required folder. + What if I want just a few particular folders visible? + Adding a folder at the Included Folders doesn\'t automatically exclude anything. What you can do is go in Settings -> Manage Excluded Folders, exclude the root folder \"/\", then add the desired folders at Settings -> Manage Included Folders. + That will make only the selected folders visible, as both excluding and including are recursive and if a folder is both excluded and included, it will show up. + Eine schlichte Galerie zum Betrachten von Bildern und Videos, ganz ohne Werbung. diff --git a/app/src/main/res/values-es/strings.xml b/app/src/main/res/values-es/strings.xml index a6889d070..a00ae0484 100644 --- a/app/src/main/res/values-es/strings.xml +++ b/app/src/main/res/values-es/strings.xml @@ -143,6 +143,26 @@ Medios a pantalla compelta Detalles ampliados + + How can I make Simple Gallery the default device gallery? + First you have to find the currently default gallery in the Apps section of your device settings, look for a button that says something like \"Open by default\", click on it, then select \"Clear defaults\". + The next time you will try opening an image or video you should see an app picker, where you can select Simple Gallery and make it the default app. + I locked the app with a password, but I forgot it. What can I do? + You can solve it in 2 ways. You can either reinstall the app, or find the app in your device settings and select \"Clear data\". It will reset all your settings, it will not remove any media files. + How can I make an album always appear at the top? + You can long press the desired album and select the Pin icon at the actionmenu, that will pin it to the top. You can pin multiple folders too, pinned items will be sorted by the default sorting method. + How can I fast-forward videos? + You can click on the current or max duration texts near the seekbar, that will move the video either backward, or forward. + What is the difference between hiding and excluding a folder? + Exclude prevents displaying the folder only in Simple Gallery, while Hide works system-wise and it hides the folder from other galleries too. It works by creating an empty \".nomedia\" file in the given folder, which you can then remove with any file manager too. + Why do folders with music cover art or stickers show up? + It can happen that you will see some unusual albums show up. You can easily exclude them by long pressing them and selecting Exclude. In the next dialog you can then select the parent folder, chances are it will prevent the other related albums showing up too. + A folder with images isn\'t showing up, what can I do? + That can have multiple reasons, but solving it is easy. Just go in Settings -> Manage Included Folders, select Plus and navigate to the required folder. + What if I want just a few particular folders visible? + Adding a folder at the Included Folders doesn\'t automatically exclude anything. What you can do is go in Settings -> Manage Excluded Folders, exclude the root folder \"/\", then add the desired folders at Settings -> Manage Included Folders. + That will make only the selected folders visible, as both excluding and including are recursive and if a folder is both excluded and included, it will show up. + Una galería para ver fotos y vídeos sin publicidad. diff --git a/app/src/main/res/values-fi/strings.xml b/app/src/main/res/values-fi/strings.xml index 5db309a6c..be0841e1f 100644 --- a/app/src/main/res/values-fi/strings.xml +++ b/app/src/main/res/values-fi/strings.xml @@ -143,6 +143,26 @@ Fullscreen media Extended details + + How can I make Simple Gallery the default device gallery? + First you have to find the currently default gallery in the Apps section of your device settings, look for a button that says something like \"Open by default\", click on it, then select \"Clear defaults\". + The next time you will try opening an image or video you should see an app picker, where you can select Simple Gallery and make it the default app. + I locked the app with a password, but I forgot it. What can I do? + You can solve it in 2 ways. You can either reinstall the app, or find the app in your device settings and select \"Clear data\". It will reset all your settings, it will not remove any media files. + How can I make an album always appear at the top? + You can long press the desired album and select the Pin icon at the actionmenu, that will pin it to the top. You can pin multiple folders too, pinned items will be sorted by the default sorting method. + How can I fast-forward videos? + You can click on the current or max duration texts near the seekbar, that will move the video either backward, or forward. + What is the difference between hiding and excluding a folder? + Exclude prevents displaying the folder only in Simple Gallery, while Hide works system-wise and it hides the folder from other galleries too. It works by creating an empty \".nomedia\" file in the given folder, which you can then remove with any file manager too. + Why do folders with music cover art or stickers show up? + It can happen that you will see some unusual albums show up. You can easily exclude them by long pressing them and selecting Exclude. In the next dialog you can then select the parent folder, chances are it will prevent the other related albums showing up too. + A folder with images isn\'t showing up, what can I do? + That can have multiple reasons, but solving it is easy. Just go in Settings -> Manage Included Folders, select Plus and navigate to the required folder. + What if I want just a few particular folders visible? + Adding a folder at the Included Folders doesn\'t automatically exclude anything. What you can do is go in Settings -> Manage Excluded Folders, exclude the root folder \"/\", then add the desired folders at Settings -> Manage Included Folders. + That will make only the selected folders visible, as both excluding and including are recursive and if a folder is both excluded and included, it will show up. + Galleria kuvien ja videoiden katsomiseen ilman mainoksia. diff --git a/app/src/main/res/values-fr/strings.xml b/app/src/main/res/values-fr/strings.xml index 2163d8031..aa2e411c9 100644 --- a/app/src/main/res/values-fr/strings.xml +++ b/app/src/main/res/values-fr/strings.xml @@ -143,6 +143,26 @@ Média plein écran Détails supplémentaires + + How can I make Simple Gallery the default device gallery? + First you have to find the currently default gallery in the Apps section of your device settings, look for a button that says something like \"Open by default\", click on it, then select \"Clear defaults\". + The next time you will try opening an image or video you should see an app picker, where you can select Simple Gallery and make it the default app. + I locked the app with a password, but I forgot it. What can I do? + You can solve it in 2 ways. You can either reinstall the app, or find the app in your device settings and select \"Clear data\". It will reset all your settings, it will not remove any media files. + How can I make an album always appear at the top? + You can long press the desired album and select the Pin icon at the actionmenu, that will pin it to the top. You can pin multiple folders too, pinned items will be sorted by the default sorting method. + How can I fast-forward videos? + You can click on the current or max duration texts near the seekbar, that will move the video either backward, or forward. + What is the difference between hiding and excluding a folder? + Exclude prevents displaying the folder only in Simple Gallery, while Hide works system-wise and it hides the folder from other galleries too. It works by creating an empty \".nomedia\" file in the given folder, which you can then remove with any file manager too. + Why do folders with music cover art or stickers show up? + It can happen that you will see some unusual albums show up. You can easily exclude them by long pressing them and selecting Exclude. In the next dialog you can then select the parent folder, chances are it will prevent the other related albums showing up too. + A folder with images isn\'t showing up, what can I do? + That can have multiple reasons, but solving it is easy. Just go in Settings -> Manage Included Folders, select Plus and navigate to the required folder. + What if I want just a few particular folders visible? + Adding a folder at the Included Folders doesn\'t automatically exclude anything. What you can do is go in Settings -> Manage Excluded Folders, exclude the root folder \"/\", then add the desired folders at Settings -> Manage Included Folders. + That will make only the selected folders visible, as both excluding and including are recursive and if a folder is both excluded and included, it will show up. + Un album pour visionner photos et vidéos sans publicité. diff --git a/app/src/main/res/values-gl/strings.xml b/app/src/main/res/values-gl/strings.xml index ae64e382a..9ea956825 100644 --- a/app/src/main/res/values-gl/strings.xml +++ b/app/src/main/res/values-gl/strings.xml @@ -143,6 +143,26 @@ Fullscreen media Extended details + + How can I make Simple Gallery the default device gallery? + First you have to find the currently default gallery in the Apps section of your device settings, look for a button that says something like \"Open by default\", click on it, then select \"Clear defaults\". + The next time you will try opening an image or video you should see an app picker, where you can select Simple Gallery and make it the default app. + I locked the app with a password, but I forgot it. What can I do? + You can solve it in 2 ways. You can either reinstall the app, or find the app in your device settings and select \"Clear data\". It will reset all your settings, it will not remove any media files. + How can I make an album always appear at the top? + You can long press the desired album and select the Pin icon at the actionmenu, that will pin it to the top. You can pin multiple folders too, pinned items will be sorted by the default sorting method. + How can I fast-forward videos? + You can click on the current or max duration texts near the seekbar, that will move the video either backward, or forward. + What is the difference between hiding and excluding a folder? + Exclude prevents displaying the folder only in Simple Gallery, while Hide works system-wise and it hides the folder from other galleries too. It works by creating an empty \".nomedia\" file in the given folder, which you can then remove with any file manager too. + Why do folders with music cover art or stickers show up? + It can happen that you will see some unusual albums show up. You can easily exclude them by long pressing them and selecting Exclude. In the next dialog you can then select the parent folder, chances are it will prevent the other related albums showing up too. + A folder with images isn\'t showing up, what can I do? + That can have multiple reasons, but solving it is easy. Just go in Settings -> Manage Included Folders, select Plus and navigate to the required folder. + What if I want just a few particular folders visible? + Adding a folder at the Included Folders doesn\'t automatically exclude anything. What you can do is go in Settings -> Manage Excluded Folders, exclude the root folder \"/\", then add the desired folders at Settings -> Manage Included Folders. + That will make only the selected folders visible, as both excluding and including are recursive and if a folder is both excluded and included, it will show up. + Unha galería para ver fotos e videos, pero non publicidade. diff --git a/app/src/main/res/values-hr/strings.xml b/app/src/main/res/values-hr/strings.xml index 36fb734fb..13d80f62c 100644 --- a/app/src/main/res/values-hr/strings.xml +++ b/app/src/main/res/values-hr/strings.xml @@ -143,6 +143,26 @@ Fullscreen media Extended details + + How can I make Simple Gallery the default device gallery? + First you have to find the currently default gallery in the Apps section of your device settings, look for a button that says something like \"Open by default\", click on it, then select \"Clear defaults\". + The next time you will try opening an image or video you should see an app picker, where you can select Simple Gallery and make it the default app. + I locked the app with a password, but I forgot it. What can I do? + You can solve it in 2 ways. You can either reinstall the app, or find the app in your device settings and select \"Clear data\". It will reset all your settings, it will not remove any media files. + How can I make an album always appear at the top? + You can long press the desired album and select the Pin icon at the actionmenu, that will pin it to the top. You can pin multiple folders too, pinned items will be sorted by the default sorting method. + How can I fast-forward videos? + You can click on the current or max duration texts near the seekbar, that will move the video either backward, or forward. + What is the difference between hiding and excluding a folder? + Exclude prevents displaying the folder only in Simple Gallery, while Hide works system-wise and it hides the folder from other galleries too. It works by creating an empty \".nomedia\" file in the given folder, which you can then remove with any file manager too. + Why do folders with music cover art or stickers show up? + It can happen that you will see some unusual albums show up. You can easily exclude them by long pressing them and selecting Exclude. In the next dialog you can then select the parent folder, chances are it will prevent the other related albums showing up too. + A folder with images isn\'t showing up, what can I do? + That can have multiple reasons, but solving it is easy. Just go in Settings -> Manage Included Folders, select Plus and navigate to the required folder. + What if I want just a few particular folders visible? + Adding a folder at the Included Folders doesn\'t automatically exclude anything. What you can do is go in Settings -> Manage Excluded Folders, exclude the root folder \"/\", then add the desired folders at Settings -> Manage Included Folders. + That will make only the selected folders visible, as both excluding and including are recursive and if a folder is both excluded and included, it will show up. + Galerija za pregledavanje slika, GIFova i videa bez reklama. diff --git a/app/src/main/res/values-hu/strings.xml b/app/src/main/res/values-hu/strings.xml index f6ee30b59..1063aeb86 100644 --- a/app/src/main/res/values-hu/strings.xml +++ b/app/src/main/res/values-hu/strings.xml @@ -143,6 +143,26 @@ Fullscreen media Extended details + + How can I make Simple Gallery the default device gallery? + First you have to find the currently default gallery in the Apps section of your device settings, look for a button that says something like \"Open by default\", click on it, then select \"Clear defaults\". + The next time you will try opening an image or video you should see an app picker, where you can select Simple Gallery and make it the default app. + I locked the app with a password, but I forgot it. What can I do? + You can solve it in 2 ways. You can either reinstall the app, or find the app in your device settings and select \"Clear data\". It will reset all your settings, it will not remove any media files. + How can I make an album always appear at the top? + You can long press the desired album and select the Pin icon at the actionmenu, that will pin it to the top. You can pin multiple folders too, pinned items will be sorted by the default sorting method. + How can I fast-forward videos? + You can click on the current or max duration texts near the seekbar, that will move the video either backward, or forward. + What is the difference between hiding and excluding a folder? + Exclude prevents displaying the folder only in Simple Gallery, while Hide works system-wise and it hides the folder from other galleries too. It works by creating an empty \".nomedia\" file in the given folder, which you can then remove with any file manager too. + Why do folders with music cover art or stickers show up? + It can happen that you will see some unusual albums show up. You can easily exclude them by long pressing them and selecting Exclude. In the next dialog you can then select the parent folder, chances are it will prevent the other related albums showing up too. + A folder with images isn\'t showing up, what can I do? + That can have multiple reasons, but solving it is easy. Just go in Settings -> Manage Included Folders, select Plus and navigate to the required folder. + What if I want just a few particular folders visible? + Adding a folder at the Included Folders doesn\'t automatically exclude anything. What you can do is go in Settings -> Manage Excluded Folders, exclude the root folder \"/\", then add the desired folders at Settings -> Manage Included Folders. + That will make only the selected folders visible, as both excluding and including are recursive and if a folder is both excluded and included, it will show up. + A gallery for viewing photos and videos without ads. diff --git a/app/src/main/res/values-it/strings.xml b/app/src/main/res/values-it/strings.xml index a0bb6b6bd..91ead8f87 100644 --- a/app/src/main/res/values-it/strings.xml +++ b/app/src/main/res/values-it/strings.xml @@ -143,6 +143,26 @@ Media a schermo intero Dettagli estesi + + How can I make Simple Gallery the default device gallery? + First you have to find the currently default gallery in the Apps section of your device settings, look for a button that says something like \"Open by default\", click on it, then select \"Clear defaults\". + The next time you will try opening an image or video you should see an app picker, where you can select Simple Gallery and make it the default app. + I locked the app with a password, but I forgot it. What can I do? + You can solve it in 2 ways. You can either reinstall the app, or find the app in your device settings and select \"Clear data\". It will reset all your settings, it will not remove any media files. + How can I make an album always appear at the top? + You can long press the desired album and select the Pin icon at the actionmenu, that will pin it to the top. You can pin multiple folders too, pinned items will be sorted by the default sorting method. + How can I fast-forward videos? + You can click on the current or max duration texts near the seekbar, that will move the video either backward, or forward. + What is the difference between hiding and excluding a folder? + Exclude prevents displaying the folder only in Simple Gallery, while Hide works system-wise and it hides the folder from other galleries too. It works by creating an empty \".nomedia\" file in the given folder, which you can then remove with any file manager too. + Why do folders with music cover art or stickers show up? + It can happen that you will see some unusual albums show up. You can easily exclude them by long pressing them and selecting Exclude. In the next dialog you can then select the parent folder, chances are it will prevent the other related albums showing up too. + A folder with images isn\'t showing up, what can I do? + That can have multiple reasons, but solving it is easy. Just go in Settings -> Manage Included Folders, select Plus and navigate to the required folder. + What if I want just a few particular folders visible? + Adding a folder at the Included Folders doesn\'t automatically exclude anything. What you can do is go in Settings -> Manage Excluded Folders, exclude the root folder \"/\", then add the desired folders at Settings -> Manage Included Folders. + That will make only the selected folders visible, as both excluding and including are recursive and if a folder is both excluded and included, it will show up. + Una galleria per visualizzare foto e video senza pubblicità. diff --git a/app/src/main/res/values-ja/strings.xml b/app/src/main/res/values-ja/strings.xml index 289b522cc..482bf6016 100644 --- a/app/src/main/res/values-ja/strings.xml +++ b/app/src/main/res/values-ja/strings.xml @@ -143,6 +143,26 @@ メディアのみ 詳細も表示する + + How can I make Simple Gallery the default device gallery? + First you have to find the currently default gallery in the Apps section of your device settings, look for a button that says something like \"Open by default\", click on it, then select \"Clear defaults\". + The next time you will try opening an image or video you should see an app picker, where you can select Simple Gallery and make it the default app. + I locked the app with a password, but I forgot it. What can I do? + You can solve it in 2 ways. You can either reinstall the app, or find the app in your device settings and select \"Clear data\". It will reset all your settings, it will not remove any media files. + How can I make an album always appear at the top? + You can long press the desired album and select the Pin icon at the actionmenu, that will pin it to the top. You can pin multiple folders too, pinned items will be sorted by the default sorting method. + How can I fast-forward videos? + You can click on the current or max duration texts near the seekbar, that will move the video either backward, or forward. + What is the difference between hiding and excluding a folder? + Exclude prevents displaying the folder only in Simple Gallery, while Hide works system-wise and it hides the folder from other galleries too. It works by creating an empty \".nomedia\" file in the given folder, which you can then remove with any file manager too. + Why do folders with music cover art or stickers show up? + It can happen that you will see some unusual albums show up. You can easily exclude them by long pressing them and selecting Exclude. In the next dialog you can then select the parent folder, chances are it will prevent the other related albums showing up too. + A folder with images isn\'t showing up, what can I do? + That can have multiple reasons, but solving it is easy. Just go in Settings -> Manage Included Folders, select Plus and navigate to the required folder. + What if I want just a few particular folders visible? + Adding a folder at the Included Folders doesn\'t automatically exclude anything. What you can do is go in Settings -> Manage Excluded Folders, exclude the root folder \"/\", then add the desired folders at Settings -> Manage Included Folders. + That will make only the selected folders visible, as both excluding and including are recursive and if a folder is both excluded and included, it will show up. + 写真やビデオを見るためのギャラリー。広告はありません。 diff --git a/app/src/main/res/values-ko-rKR/strings.xml b/app/src/main/res/values-ko-rKR/strings.xml index 813ff8565..0b5d9d254 100644 --- a/app/src/main/res/values-ko-rKR/strings.xml +++ b/app/src/main/res/values-ko-rKR/strings.xml @@ -143,6 +143,26 @@ Fullscreen media Extended details + + How can I make Simple Gallery the default device gallery? + First you have to find the currently default gallery in the Apps section of your device settings, look for a button that says something like \"Open by default\", click on it, then select \"Clear defaults\". + The next time you will try opening an image or video you should see an app picker, where you can select Simple Gallery and make it the default app. + I locked the app with a password, but I forgot it. What can I do? + You can solve it in 2 ways. You can either reinstall the app, or find the app in your device settings and select \"Clear data\". It will reset all your settings, it will not remove any media files. + How can I make an album always appear at the top? + You can long press the desired album and select the Pin icon at the actionmenu, that will pin it to the top. You can pin multiple folders too, pinned items will be sorted by the default sorting method. + How can I fast-forward videos? + You can click on the current or max duration texts near the seekbar, that will move the video either backward, or forward. + What is the difference between hiding and excluding a folder? + Exclude prevents displaying the folder only in Simple Gallery, while Hide works system-wise and it hides the folder from other galleries too. It works by creating an empty \".nomedia\" file in the given folder, which you can then remove with any file manager too. + Why do folders with music cover art or stickers show up? + It can happen that you will see some unusual albums show up. You can easily exclude them by long pressing them and selecting Exclude. In the next dialog you can then select the parent folder, chances are it will prevent the other related albums showing up too. + A folder with images isn\'t showing up, what can I do? + That can have multiple reasons, but solving it is easy. Just go in Settings -> Manage Included Folders, select Plus and navigate to the required folder. + What if I want just a few particular folders visible? + Adding a folder at the Included Folders doesn\'t automatically exclude anything. What you can do is go in Settings -> Manage Excluded Folders, exclude the root folder \"/\", then add the desired folders at Settings -> Manage Included Folders. + That will make only the selected folders visible, as both excluding and including are recursive and if a folder is both excluded and included, it will show up. + 광고없이 사진과 동영상을 볼 수 있는 갤러리. diff --git a/app/src/main/res/values-nb/strings.xml b/app/src/main/res/values-nb/strings.xml index cf7e1d702..5f3c66456 100644 --- a/app/src/main/res/values-nb/strings.xml +++ b/app/src/main/res/values-nb/strings.xml @@ -143,6 +143,26 @@ Mediavisning Utvidede detaljer + + How can I make Simple Gallery the default device gallery? + First you have to find the currently default gallery in the Apps section of your device settings, look for a button that says something like \"Open by default\", click on it, then select \"Clear defaults\". + The next time you will try opening an image or video you should see an app picker, where you can select Simple Gallery and make it the default app. + I locked the app with a password, but I forgot it. What can I do? + You can solve it in 2 ways. You can either reinstall the app, or find the app in your device settings and select \"Clear data\". It will reset all your settings, it will not remove any media files. + How can I make an album always appear at the top? + You can long press the desired album and select the Pin icon at the actionmenu, that will pin it to the top. You can pin multiple folders too, pinned items will be sorted by the default sorting method. + How can I fast-forward videos? + You can click on the current or max duration texts near the seekbar, that will move the video either backward, or forward. + What is the difference between hiding and excluding a folder? + Exclude prevents displaying the folder only in Simple Gallery, while Hide works system-wise and it hides the folder from other galleries too. It works by creating an empty \".nomedia\" file in the given folder, which you can then remove with any file manager too. + Why do folders with music cover art or stickers show up? + It can happen that you will see some unusual albums show up. You can easily exclude them by long pressing them and selecting Exclude. In the next dialog you can then select the parent folder, chances are it will prevent the other related albums showing up too. + A folder with images isn\'t showing up, what can I do? + That can have multiple reasons, but solving it is easy. Just go in Settings -> Manage Included Folders, select Plus and navigate to the required folder. + What if I want just a few particular folders visible? + Adding a folder at the Included Folders doesn\'t automatically exclude anything. What you can do is go in Settings -> Manage Excluded Folders, exclude the root folder \"/\", then add the desired folders at Settings -> Manage Included Folders. + That will make only the selected folders visible, as both excluding and including are recursive and if a folder is both excluded and included, it will show up. + A gallery for viewing photos and videos without ads. diff --git a/app/src/main/res/values-nl/strings.xml b/app/src/main/res/values-nl/strings.xml index b966fa1f6..58290dd2c 100644 --- a/app/src/main/res/values-nl/strings.xml +++ b/app/src/main/res/values-nl/strings.xml @@ -143,6 +143,26 @@ Volledig scherm Uitgebreide informatie + + How can I make Simple Gallery the default device gallery? + First you have to find the currently default gallery in the Apps section of your device settings, look for a button that says something like \"Open by default\", click on it, then select \"Clear defaults\". + The next time you will try opening an image or video you should see an app picker, where you can select Simple Gallery and make it the default app. + I locked the app with a password, but I forgot it. What can I do? + You can solve it in 2 ways. You can either reinstall the app, or find the app in your device settings and select \"Clear data\". It will reset all your settings, it will not remove any media files. + How can I make an album always appear at the top? + You can long press the desired album and select the Pin icon at the actionmenu, that will pin it to the top. You can pin multiple folders too, pinned items will be sorted by the default sorting method. + How can I fast-forward videos? + You can click on the current or max duration texts near the seekbar, that will move the video either backward, or forward. + What is the difference between hiding and excluding a folder? + Exclude prevents displaying the folder only in Simple Gallery, while Hide works system-wise and it hides the folder from other galleries too. It works by creating an empty \".nomedia\" file in the given folder, which you can then remove with any file manager too. + Why do folders with music cover art or stickers show up? + It can happen that you will see some unusual albums show up. You can easily exclude them by long pressing them and selecting Exclude. In the next dialog you can then select the parent folder, chances are it will prevent the other related albums showing up too. + A folder with images isn\'t showing up, what can I do? + That can have multiple reasons, but solving it is easy. Just go in Settings -> Manage Included Folders, select Plus and navigate to the required folder. + What if I want just a few particular folders visible? + Adding a folder at the Included Folders doesn\'t automatically exclude anything. What you can do is go in Settings -> Manage Excluded Folders, exclude the root folder \"/\", then add the desired folders at Settings -> Manage Included Folders. + That will make only the selected folders visible, as both excluding and including are recursive and if a folder is both excluded and included, it will show up. + Een galerij voor afbeeldingen en video\'s, zonder advertenties. diff --git a/app/src/main/res/values-pl/strings.xml b/app/src/main/res/values-pl/strings.xml index 1ba92b71f..92dfb63e7 100644 --- a/app/src/main/res/values-pl/strings.xml +++ b/app/src/main/res/values-pl/strings.xml @@ -143,6 +143,26 @@    Widok pełnoekranowy    Dodatkowe szczegóły + + How can I make Simple Gallery the default device gallery? + First you have to find the currently default gallery in the Apps section of your device settings, look for a button that says something like \"Open by default\", click on it, then select \"Clear defaults\". + The next time you will try opening an image or video you should see an app picker, where you can select Simple Gallery and make it the default app. + I locked the app with a password, but I forgot it. What can I do? + You can solve it in 2 ways. You can either reinstall the app, or find the app in your device settings and select \"Clear data\". It will reset all your settings, it will not remove any media files. + How can I make an album always appear at the top? + You can long press the desired album and select the Pin icon at the actionmenu, that will pin it to the top. You can pin multiple folders too, pinned items will be sorted by the default sorting method. + How can I fast-forward videos? + You can click on the current or max duration texts near the seekbar, that will move the video either backward, or forward. + What is the difference between hiding and excluding a folder? + Exclude prevents displaying the folder only in Simple Gallery, while Hide works system-wise and it hides the folder from other galleries too. It works by creating an empty \".nomedia\" file in the given folder, which you can then remove with any file manager too. + Why do folders with music cover art or stickers show up? + It can happen that you will see some unusual albums show up. You can easily exclude them by long pressing them and selecting Exclude. In the next dialog you can then select the parent folder, chances are it will prevent the other related albums showing up too. + A folder with images isn\'t showing up, what can I do? + That can have multiple reasons, but solving it is easy. Just go in Settings -> Manage Included Folders, select Plus and navigate to the required folder. + What if I want just a few particular folders visible? + Adding a folder at the Included Folders doesn\'t automatically exclude anything. What you can do is go in Settings -> Manage Excluded Folders, exclude the root folder \"/\", then add the desired folders at Settings -> Manage Included Folders. + That will make only the selected folders visible, as both excluding and including are recursive and if a folder is both excluded and included, it will show up. + Prosta galeria bez reklam do przeglądania obrazów i filmów. diff --git a/app/src/main/res/values-pt-rBR/strings.xml b/app/src/main/res/values-pt-rBR/strings.xml index 14d8ea1f3..31771ec6f 100644 --- a/app/src/main/res/values-pt-rBR/strings.xml +++ b/app/src/main/res/values-pt-rBR/strings.xml @@ -143,6 +143,26 @@ Mídia em tela cheia Detalhes extendidos + + How can I make Simple Gallery the default device gallery? + First you have to find the currently default gallery in the Apps section of your device settings, look for a button that says something like \"Open by default\", click on it, then select \"Clear defaults\". + The next time you will try opening an image or video you should see an app picker, where you can select Simple Gallery and make it the default app. + I locked the app with a password, but I forgot it. What can I do? + You can solve it in 2 ways. You can either reinstall the app, or find the app in your device settings and select \"Clear data\". It will reset all your settings, it will not remove any media files. + How can I make an album always appear at the top? + You can long press the desired album and select the Pin icon at the actionmenu, that will pin it to the top. You can pin multiple folders too, pinned items will be sorted by the default sorting method. + How can I fast-forward videos? + You can click on the current or max duration texts near the seekbar, that will move the video either backward, or forward. + What is the difference between hiding and excluding a folder? + Exclude prevents displaying the folder only in Simple Gallery, while Hide works system-wise and it hides the folder from other galleries too. It works by creating an empty \".nomedia\" file in the given folder, which you can then remove with any file manager too. + Why do folders with music cover art or stickers show up? + It can happen that you will see some unusual albums show up. You can easily exclude them by long pressing them and selecting Exclude. In the next dialog you can then select the parent folder, chances are it will prevent the other related albums showing up too. + A folder with images isn\'t showing up, what can I do? + That can have multiple reasons, but solving it is easy. Just go in Settings -> Manage Included Folders, select Plus and navigate to the required folder. + What if I want just a few particular folders visible? + Adding a folder at the Included Folders doesn\'t automatically exclude anything. What you can do is go in Settings -> Manage Excluded Folders, exclude the root folder \"/\", then add the desired folders at Settings -> Manage Included Folders. + That will make only the selected folders visible, as both excluding and including are recursive and if a folder is both excluded and included, it will show up. + Um aplicativo para visualizar fotos e vídeos. diff --git a/app/src/main/res/values-pt/strings.xml b/app/src/main/res/values-pt/strings.xml index c158d291d..8bd412cdb 100644 --- a/app/src/main/res/values-pt/strings.xml +++ b/app/src/main/res/values-pt/strings.xml @@ -143,6 +143,26 @@ Multimédia em ecrã completo Detalhes extra + + How can I make Simple Gallery the default device gallery? + First you have to find the currently default gallery in the Apps section of your device settings, look for a button that says something like \"Open by default\", click on it, then select \"Clear defaults\". + The next time you will try opening an image or video you should see an app picker, where you can select Simple Gallery and make it the default app. + I locked the app with a password, but I forgot it. What can I do? + You can solve it in 2 ways. You can either reinstall the app, or find the app in your device settings and select \"Clear data\". It will reset all your settings, it will not remove any media files. + How can I make an album always appear at the top? + You can long press the desired album and select the Pin icon at the actionmenu, that will pin it to the top. You can pin multiple folders too, pinned items will be sorted by the default sorting method. + How can I fast-forward videos? + You can click on the current or max duration texts near the seekbar, that will move the video either backward, or forward. + What is the difference between hiding and excluding a folder? + Exclude prevents displaying the folder only in Simple Gallery, while Hide works system-wise and it hides the folder from other galleries too. It works by creating an empty \".nomedia\" file in the given folder, which you can then remove with any file manager too. + Why do folders with music cover art or stickers show up? + It can happen that you will see some unusual albums show up. You can easily exclude them by long pressing them and selecting Exclude. In the next dialog you can then select the parent folder, chances are it will prevent the other related albums showing up too. + A folder with images isn\'t showing up, what can I do? + That can have multiple reasons, but solving it is easy. Just go in Settings -> Manage Included Folders, select Plus and navigate to the required folder. + What if I want just a few particular folders visible? + Adding a folder at the Included Folders doesn\'t automatically exclude anything. What you can do is go in Settings -> Manage Excluded Folders, exclude the root folder \"/\", then add the desired folders at Settings -> Manage Included Folders. + That will make only the selected folders visible, as both excluding and including are recursive and if a folder is both excluded and included, it will show up. + Uma aplicação para ver fotografias e vídeos. diff --git a/app/src/main/res/values-ru/strings.xml b/app/src/main/res/values-ru/strings.xml index e727a4dbf..4081630dd 100644 --- a/app/src/main/res/values-ru/strings.xml +++ b/app/src/main/res/values-ru/strings.xml @@ -143,6 +143,26 @@ Полноэкранное отображение медиафайлов Подробности + + How can I make Simple Gallery the default device gallery? + First you have to find the currently default gallery in the Apps section of your device settings, look for a button that says something like \"Open by default\", click on it, then select \"Clear defaults\". + The next time you will try opening an image or video you should see an app picker, where you can select Simple Gallery and make it the default app. + I locked the app with a password, but I forgot it. What can I do? + You can solve it in 2 ways. You can either reinstall the app, or find the app in your device settings and select \"Clear data\". It will reset all your settings, it will not remove any media files. + How can I make an album always appear at the top? + You can long press the desired album and select the Pin icon at the actionmenu, that will pin it to the top. You can pin multiple folders too, pinned items will be sorted by the default sorting method. + How can I fast-forward videos? + You can click on the current or max duration texts near the seekbar, that will move the video either backward, or forward. + What is the difference between hiding and excluding a folder? + Exclude prevents displaying the folder only in Simple Gallery, while Hide works system-wise and it hides the folder from other galleries too. It works by creating an empty \".nomedia\" file in the given folder, which you can then remove with any file manager too. + Why do folders with music cover art or stickers show up? + It can happen that you will see some unusual albums show up. You can easily exclude them by long pressing them and selecting Exclude. In the next dialog you can then select the parent folder, chances are it will prevent the other related albums showing up too. + A folder with images isn\'t showing up, what can I do? + That can have multiple reasons, but solving it is easy. Just go in Settings -> Manage Included Folders, select Plus and navigate to the required folder. + What if I want just a few particular folders visible? + Adding a folder at the Included Folders doesn\'t automatically exclude anything. What you can do is go in Settings -> Manage Excluded Folders, exclude the root folder \"/\", then add the desired folders at Settings -> Manage Included Folders. + That will make only the selected folders visible, as both excluding and including are recursive and if a folder is both excluded and included, it will show up. + Галерея для просмотра изображений и видео. Без рекламы. diff --git a/app/src/main/res/values-sk/strings.xml b/app/src/main/res/values-sk/strings.xml index 21dd19109..870d97b9c 100644 --- a/app/src/main/res/values-sk/strings.xml +++ b/app/src/main/res/values-sk/strings.xml @@ -143,6 +143,26 @@ Celoobrazovkový režim Rozšírené vlastnosti + + Ako viem spraviť Jednoduchú Galériu predvolenou galériou zariadenia? + Najprv musíte nájsť v nastaveniach zariadenia,sekcii Aplikácie, súčasnú predvolenú galériu, zvoliť tlačidlo s textom v zmysle \"Nastavenie predvoleného otvárania\" a následne \"Vymazať predvolené nastavenia\". + Ak potom skúsite otvoriť obrázok alebo video, zobrazí sa zoznam aplikácií, kde viete zvoliť Jednoduchú Galériu a nastaviť ju ako predvolenú. + Uzamkol som apku heslom, ale zabudol som ho. Čo môžem spraviť? + Viete to vyriešǐť 2 spôsobmi. Môžete apku buď preinštalovať, alebo ju nájsť v nastaveniach zariadenia a zvoliť \"Vymazať údaje\". Vymaže to iba nastavenia, nie súbory. + Ako môžem dosiahnuť, aby bol daný album stále zobrazený prvý? + Môžete označiť daný priečinok dlhým podržaním a zvoliť tlačidlo s obrázkom pripinačky, to ho pripne na vrch. Môžete pripnúť aj viacero priečinkov, budú zoradené podľa zvoleného radenia. + Ako viem posunúť video vpred? + Môžete kliknúť na texty súčasnej, alebo maximálnej dĺžky videa, ktoré sú vedľa indikátora súčasného progresu. To posunie video buď vpred, alebo vzad. + Aký je rozdiel medzi Skrytím a Vylúčením priečinka? + Kým vylúčenie predíde zobrazeniu priečinka iba vrámci Jednoduchej Galérie, skrytie ho ukryje vrámci celého systému, teda to ovplyvní aj ostatné galérie. Skrytie funguje pomocou vytvorenia prázdneho \".nomedia\" súboru v danom priečinku, ktorý viete vymazať aj nejakým správcom súborov. + Prečo sa mi zobrazujú priečinky s obalmi hudobných albumov, alebo nálepkami? + Môže sa stať, že sa vám zobrazia aj nezvyčajné priečinky. Viete ich ale jednoducho ukryť pomocou ich zvolenia dlhým podržaním a zvolením Vylúčiť. Ak na nasledovnom dialógu zvolíte vylúčenie rodičovského priečinka, pravdepodobne budú vylúčené aj ostatné, podobné priečinky. + Priečinok s fotkami sa mi nezobrazuje, čo môžem urobiť? + Môže to mať viacero dôvodov, riešenie je ale jednoduché. Choďte do Nastavenia -> Spravovať pridané priečinky, zvoľte Plus a zvoľte vytúžený priečinok. + Čo v prípade, ak chcem mať zobrazených iba pár priečinkov? + Pridanie priečinka medzi Pridané Priečinky automaticky nevylúči ostatné. Môžete ale ísť do Nastavenia -> Spravovať vylúčené priečinky a zvoliť Koreňový priečinok \"/\", následne pridať žiadané priečinky v Nastavenia -> Spravovať pridané priečinky. + To spôsobí, že budú zobrazené iba vyžiadané priečinky, keďže aj vylúčenie, aj pridanie fungujú rekurzívne a ak je priečinok vylúčený, aj pridaný, bude viditeľný. + Galéria na prezeranie obrázkov a videí bez reklám. diff --git a/app/src/main/res/values-sv/strings.xml b/app/src/main/res/values-sv/strings.xml index 40b112102..537dd513b 100644 --- a/app/src/main/res/values-sv/strings.xml +++ b/app/src/main/res/values-sv/strings.xml @@ -143,6 +143,26 @@ Visning av media i helskärmsläge Utökad information + + How can I make Simple Gallery the default device gallery? + First you have to find the currently default gallery in the Apps section of your device settings, look for a button that says something like \"Open by default\", click on it, then select \"Clear defaults\". + The next time you will try opening an image or video you should see an app picker, where you can select Simple Gallery and make it the default app. + I locked the app with a password, but I forgot it. What can I do? + You can solve it in 2 ways. You can either reinstall the app, or find the app in your device settings and select \"Clear data\". It will reset all your settings, it will not remove any media files. + How can I make an album always appear at the top? + You can long press the desired album and select the Pin icon at the actionmenu, that will pin it to the top. You can pin multiple folders too, pinned items will be sorted by the default sorting method. + How can I fast-forward videos? + You can click on the current or max duration texts near the seekbar, that will move the video either backward, or forward. + What is the difference between hiding and excluding a folder? + Exclude prevents displaying the folder only in Simple Gallery, while Hide works system-wise and it hides the folder from other galleries too. It works by creating an empty \".nomedia\" file in the given folder, which you can then remove with any file manager too. + Why do folders with music cover art or stickers show up? + It can happen that you will see some unusual albums show up. You can easily exclude them by long pressing them and selecting Exclude. In the next dialog you can then select the parent folder, chances are it will prevent the other related albums showing up too. + A folder with images isn\'t showing up, what can I do? + That can have multiple reasons, but solving it is easy. Just go in Settings -> Manage Included Folders, select Plus and navigate to the required folder. + What if I want just a few particular folders visible? + Adding a folder at the Included Folders doesn\'t automatically exclude anything. What you can do is go in Settings -> Manage Excluded Folders, exclude the root folder \"/\", then add the desired folders at Settings -> Manage Included Folders. + That will make only the selected folders visible, as both excluding and including are recursive and if a folder is both excluded and included, it will show up. + Ett galleri för att visa foton och videor utan reklam. diff --git a/app/src/main/res/values-tr/strings.xml b/app/src/main/res/values-tr/strings.xml index 834639abb..1519848b2 100644 --- a/app/src/main/res/values-tr/strings.xml +++ b/app/src/main/res/values-tr/strings.xml @@ -143,6 +143,26 @@ Fullscreen media Extended details + + How can I make Simple Gallery the default device gallery? + First you have to find the currently default gallery in the Apps section of your device settings, look for a button that says something like \"Open by default\", click on it, then select \"Clear defaults\". + The next time you will try opening an image or video you should see an app picker, where you can select Simple Gallery and make it the default app. + I locked the app with a password, but I forgot it. What can I do? + You can solve it in 2 ways. You can either reinstall the app, or find the app in your device settings and select \"Clear data\". It will reset all your settings, it will not remove any media files. + How can I make an album always appear at the top? + You can long press the desired album and select the Pin icon at the actionmenu, that will pin it to the top. You can pin multiple folders too, pinned items will be sorted by the default sorting method. + How can I fast-forward videos? + You can click on the current or max duration texts near the seekbar, that will move the video either backward, or forward. + What is the difference between hiding and excluding a folder? + Exclude prevents displaying the folder only in Simple Gallery, while Hide works system-wise and it hides the folder from other galleries too. It works by creating an empty \".nomedia\" file in the given folder, which you can then remove with any file manager too. + Why do folders with music cover art or stickers show up? + It can happen that you will see some unusual albums show up. You can easily exclude them by long pressing them and selecting Exclude. In the next dialog you can then select the parent folder, chances are it will prevent the other related albums showing up too. + A folder with images isn\'t showing up, what can I do? + That can have multiple reasons, but solving it is easy. Just go in Settings -> Manage Included Folders, select Plus and navigate to the required folder. + What if I want just a few particular folders visible? + Adding a folder at the Included Folders doesn\'t automatically exclude anything. What you can do is go in Settings -> Manage Excluded Folders, exclude the root folder \"/\", then add the desired folders at Settings -> Manage Included Folders. + That will make only the selected folders visible, as both excluding and including are recursive and if a folder is both excluded and included, it will show up. + Fotoğrafları ve videoları reklamsız görüntülemek için kullanılan bir galeri. diff --git a/app/src/main/res/values-zh-rCN/strings.xml b/app/src/main/res/values-zh-rCN/strings.xml index f4439d761..09d2ea1c2 100644 --- a/app/src/main/res/values-zh-rCN/strings.xml +++ b/app/src/main/res/values-zh-rCN/strings.xml @@ -143,6 +143,26 @@ 全屏显示媒体 扩展详情 + + How can I make Simple Gallery the default device gallery? + First you have to find the currently default gallery in the Apps section of your device settings, look for a button that says something like \"Open by default\", click on it, then select \"Clear defaults\". + The next time you will try opening an image or video you should see an app picker, where you can select Simple Gallery and make it the default app. + I locked the app with a password, but I forgot it. What can I do? + You can solve it in 2 ways. You can either reinstall the app, or find the app in your device settings and select \"Clear data\". It will reset all your settings, it will not remove any media files. + How can I make an album always appear at the top? + You can long press the desired album and select the Pin icon at the actionmenu, that will pin it to the top. You can pin multiple folders too, pinned items will be sorted by the default sorting method. + How can I fast-forward videos? + You can click on the current or max duration texts near the seekbar, that will move the video either backward, or forward. + What is the difference between hiding and excluding a folder? + Exclude prevents displaying the folder only in Simple Gallery, while Hide works system-wise and it hides the folder from other galleries too. It works by creating an empty \".nomedia\" file in the given folder, which you can then remove with any file manager too. + Why do folders with music cover art or stickers show up? + It can happen that you will see some unusual albums show up. You can easily exclude them by long pressing them and selecting Exclude. In the next dialog you can then select the parent folder, chances are it will prevent the other related albums showing up too. + A folder with images isn\'t showing up, what can I do? + That can have multiple reasons, but solving it is easy. Just go in Settings -> Manage Included Folders, select Plus and navigate to the required folder. + What if I want just a few particular folders visible? + Adding a folder at the Included Folders doesn\'t automatically exclude anything. What you can do is go in Settings -> Manage Excluded Folders, exclude the root folder \"/\", then add the desired folders at Settings -> Manage Included Folders. + That will make only the selected folders visible, as both excluding and including are recursive and if a folder is both excluded and included, it will show up. + 一个没有广告,用来观看照片及视频的相册。 diff --git a/app/src/main/res/values-zh-rTW/strings.xml b/app/src/main/res/values-zh-rTW/strings.xml index db09cd9f1..cebcd39a3 100644 --- a/app/src/main/res/values-zh-rTW/strings.xml +++ b/app/src/main/res/values-zh-rTW/strings.xml @@ -143,6 +143,26 @@ 全螢幕媒體檔案 詳細資訊 + + How can I make Simple Gallery the default device gallery? + First you have to find the currently default gallery in the Apps section of your device settings, look for a button that says something like \"Open by default\", click on it, then select \"Clear defaults\". + The next time you will try opening an image or video you should see an app picker, where you can select Simple Gallery and make it the default app. + I locked the app with a password, but I forgot it. What can I do? + You can solve it in 2 ways. You can either reinstall the app, or find the app in your device settings and select \"Clear data\". It will reset all your settings, it will not remove any media files. + How can I make an album always appear at the top? + You can long press the desired album and select the Pin icon at the actionmenu, that will pin it to the top. You can pin multiple folders too, pinned items will be sorted by the default sorting method. + How can I fast-forward videos? + You can click on the current or max duration texts near the seekbar, that will move the video either backward, or forward. + What is the difference between hiding and excluding a folder? + Exclude prevents displaying the folder only in Simple Gallery, while Hide works system-wise and it hides the folder from other galleries too. It works by creating an empty \".nomedia\" file in the given folder, which you can then remove with any file manager too. + Why do folders with music cover art or stickers show up? + It can happen that you will see some unusual albums show up. You can easily exclude them by long pressing them and selecting Exclude. In the next dialog you can then select the parent folder, chances are it will prevent the other related albums showing up too. + A folder with images isn\'t showing up, what can I do? + That can have multiple reasons, but solving it is easy. Just go in Settings -> Manage Included Folders, select Plus and navigate to the required folder. + What if I want just a few particular folders visible? + Adding a folder at the Included Folders doesn\'t automatically exclude anything. What you can do is go in Settings -> Manage Excluded Folders, exclude the root folder \"/\", then add the desired folders at Settings -> Manage Included Folders. + That will make only the selected folders visible, as both excluding and including are recursive and if a folder is both excluded and included, it will show up. + 一個用來瀏覽相片和影片,且沒有廣告的相簿。 diff --git a/app/src/main/res/values/strings.xml b/app/src/main/res/values/strings.xml index abf2cb0ca..def375277 100644 --- a/app/src/main/res/values/strings.xml +++ b/app/src/main/res/values/strings.xml @@ -143,6 +143,26 @@ Fullscreen media Extended details + + How can I make Simple Gallery the default device gallery? + First you have to find the currently default gallery in the Apps section of your device settings, look for a button that says something like \"Open by default\", click on it, then select \"Clear defaults\". + The next time you will try opening an image or video you should see an app picker, where you can select Simple Gallery and make it the default app. + I locked the app with a password, but I forgot it. What can I do? + You can solve it in 2 ways. You can either reinstall the app, or find the app in your device settings and select \"Clear data\". It will reset all your settings, it will not remove any media files. + How can I make an album always appear at the top? + You can long press the desired album and select the Pin icon at the actionmenu, that will pin it to the top. You can pin multiple folders too, pinned items will be sorted by the default sorting method. + How can I fast-forward videos? + You can click on the current or max duration texts near the seekbar, that will move the video either backward, or forward. + What is the difference between hiding and excluding a folder? + Exclude prevents displaying the folder only in Simple Gallery, while Hide works system-wise and it hides the folder from other galleries too. It works by creating an empty \".nomedia\" file in the given folder, which you can then remove with any file manager too. + Why do folders with music cover art or stickers show up? + It can happen that you will see some unusual albums show up. You can easily exclude them by long pressing them and selecting Exclude. In the next dialog you can then select the parent folder, chances are it will prevent the other related albums showing up too. + A folder with images isn\'t showing up, what can I do? + That can have multiple reasons, but solving it is easy. Just go in Settings -> Manage Included Folders, select Plus and navigate to the required folder. + What if I want just a few particular folders visible? + Adding a folder at the Included Folders doesn\'t automatically exclude anything. What you can do is go in Settings -> Manage Excluded Folders, exclude the root folder \"/\", then add the desired folders at Settings -> Manage Included Folders. + That will make only the selected folders visible, as both excluding and including are recursive and if a folder is both excluded and included, it will show up. + A gallery for viewing photos and videos without ads. From 7eded8f6625016dc7498f0e33edb2a9cc0a7625b Mon Sep 17 00:00:00 2001 From: gregory678 Date: Mon, 19 Feb 2018 10:21:52 +0100 Subject: [PATCH 09/71] Update strings.xml --- app/src/main/res/values-pl/strings.xml | 42 ++++++++++++-------------- 1 file changed, 20 insertions(+), 22 deletions(-) diff --git a/app/src/main/res/values-pl/strings.xml b/app/src/main/res/values-pl/strings.xml index 92dfb63e7..7576543e1 100644 --- a/app/src/main/res/values-pl/strings.xml +++ b/app/src/main/res/values-pl/strings.xml @@ -40,7 +40,7 @@ Zarządzaj wykluczonymi folderami Działa na folderach galerii. Możesz zarządzać wykluczonymi folderami w ustawieniach aplikacji. Wykluczyć folder nadrzędny? - Wykluczenie folderów ukryje je tylko w aplikacji Simple Gallery, w innych aplikacjach będą one wciąż widoczne.\n\nJeśli chcesz je ukryć także w innych aplikacjach, użyj funkcji ukrywania. +    Wykluczenie folderów ukryje je tylko w niniejszej aplikacji, w innych aplikacjach będą one wciąż widoczne.\n\nJeśli chcesz je ukryć także w innych aplikacjach, użyj funkcji ukrywania. Usuń wszystko Usunąć wszystkie foldery z listy wykluczonych? Foldery nie zostaną fizycznie usunięte.   Ukryte foldery @@ -126,8 +126,8 @@ Przewijaj miniatury poziomo Ukrywaj interfejs przy pełnoekranowym podglądzie Usuwaj puste foldery po usunięciu ich zawartości - Allow controlling photo brightness with vertical gestures - Zezwalaj na kontrolę jasności i głośności filmów pionowymi gestami +    Zezwalaj na kontrolowanie jasności zdjęcia pionowymi gestami +    Zezwalaj na kontrolowanie jasności i głośności filmów pionowymi gestami Pokazuj liczbę elementów w folderach w głównym widoku Zamień funkcję udostępniania na obracanie w menu pełnoekranowym Dodatkowe szczegóły przy podglądzie pełnoekranowym @@ -136,7 +136,7 @@    Zezwalaj na natychmiastową zmianę multimediów po kliknięciu boków ekranu    Zamieniaj powiększalne obrazy na te o lepszej jakości    Ukrywaj dodatkowe szczegóły gdy pasek stanu jest ukryty - Do an extra check to avoid showing invalid files +    Dodatkowe sprawdzenie w celu uniknięcia pokazywania niewłaściwych plików    Miniatury @@ -144,24 +144,22 @@    Dodatkowe szczegóły - How can I make Simple Gallery the default device gallery? - First you have to find the currently default gallery in the Apps section of your device settings, look for a button that says something like \"Open by default\", click on it, then select \"Clear defaults\". - The next time you will try opening an image or video you should see an app picker, where you can select Simple Gallery and make it the default app. - I locked the app with a password, but I forgot it. What can I do? - You can solve it in 2 ways. You can either reinstall the app, or find the app in your device settings and select \"Clear data\". It will reset all your settings, it will not remove any media files. - How can I make an album always appear at the top? - You can long press the desired album and select the Pin icon at the actionmenu, that will pin it to the top. You can pin multiple folders too, pinned items will be sorted by the default sorting method. - How can I fast-forward videos? - You can click on the current or max duration texts near the seekbar, that will move the video either backward, or forward. - What is the difference between hiding and excluding a folder? - Exclude prevents displaying the folder only in Simple Gallery, while Hide works system-wise and it hides the folder from other galleries too. It works by creating an empty \".nomedia\" file in the given folder, which you can then remove with any file manager too. - Why do folders with music cover art or stickers show up? - It can happen that you will see some unusual albums show up. You can easily exclude them by long pressing them and selecting Exclude. In the next dialog you can then select the parent folder, chances are it will prevent the other related albums showing up too. - A folder with images isn\'t showing up, what can I do? - That can have multiple reasons, but solving it is easy. Just go in Settings -> Manage Included Folders, select Plus and navigate to the required folder. - What if I want just a few particular folders visible? - Adding a folder at the Included Folders doesn\'t automatically exclude anything. What you can do is go in Settings -> Manage Excluded Folders, exclude the root folder \"/\", then add the desired folders at Settings -> Manage Included Folders. - That will make only the selected folders visible, as both excluding and including are recursive and if a folder is both excluded and included, it will show up. +    Jak mogę ustawić tą aplikację jako domyślną aplikację galerii? +    Znajdź obecną domyślną aplikację galerii w ustawieniach systemowych (sekcja \'Aplikacje\'). Na ekranie z informacjami o niej kliknij \'Otwórz domyślnie\', a następnie \'Wyczyść domyślne\'. Gdy podczas następnej próby otwarcia zdjęcia czy filmu system zapyta Cię jaką aplikacją to zrobić, wybierz Prostą Galerię i opcję zapamiętania tego wyboru. +    Zablokowałem(-am) aplikację hasłem i wyleciało mi ono z głowy. Co mogę zrobić? +    Masz dwie opcje: przeinstalowanie aplikacji lub wyczyszczenie jej ustawień. Niezależnie od wyboru, pliki pozostaną nienaruszone. +    Jak sprawić, aby album(y) zawsze pojawiał(y) się na górze? +    Przytrzymaj album(y) i wybierz ikonę przypięcia w pasku akcji. +    Jak mogę przwijać filmy? +    Kliknij na napisie z czasem trwania filmu, bądź tym z obecnym momentem filmu. +    Jaka jest różnica pomiędzy ukryciem, a wykluczeniem folderu? +    Wykluczenie działa tylko w obrębie niniejszej aplikacji (wszędzie indziej pliki są normalnie widoczne), ukrywanie - w obrębie całego systemu (nie widać ich nigdzie), dodawany jest wtedy do folderu pusty plik \'.nomedia\', który możesz usunąć w dowolnym menedżerze plików. +    Dlaczego pokazują mi się foldery z okładkami do piosenek i tym podobne rzeczy?/string> +    Cóż, zdjęcie to zdjęcie. Aplikacja nie wie, czy to jest akurat okładka od piosenki, czy cokolwiek innego. Aby ukryć niechciane rzeczy, przytrzymaj je i wybierz opcję \'Wyklucz\' z paska akcji. +    Nie pokazuje(-ą) mi się folder(y) ze zdjęciami / filmami. Co mogę zrobić? +    Wejdź do ustawień aplikacji i w sekcji z dołączonymi folderami dodaj tenże folder do listy. +    Co jeśli chcę widzieć tylko.wybrane foldery? +    Przejdź do sekcji z wykluczonymi folderami w ustawieniach aplikacji, dodaj tam folder główny (\"/\"), a następnie dodaj pożądane foldery w sekcji z dołączonymi folderami. From 5b4a0f63f90800bbf81d75210aba45774cecc70c Mon Sep 17 00:00:00 2001 From: tibbi Date: Mon, 19 Feb 2018 17:42:55 +0100 Subject: [PATCH 10/71] adding a missing strings close tag --- app/src/main/res/values-pl/strings.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/src/main/res/values-pl/strings.xml b/app/src/main/res/values-pl/strings.xml index 7576543e1..5a0ece732 100644 --- a/app/src/main/res/values-pl/strings.xml +++ b/app/src/main/res/values-pl/strings.xml @@ -154,7 +154,7 @@    Kliknij na napisie z czasem trwania filmu, bądź tym z obecnym momentem filmu.    Jaka jest różnica pomiędzy ukryciem, a wykluczeniem folderu?    Wykluczenie działa tylko w obrębie niniejszej aplikacji (wszędzie indziej pliki są normalnie widoczne), ukrywanie - w obrębie całego systemu (nie widać ich nigdzie), dodawany jest wtedy do folderu pusty plik \'.nomedia\', który możesz usunąć w dowolnym menedżerze plików. -    Dlaczego pokazują mi się foldery z okładkami do piosenek i tym podobne rzeczy?/string> +    Dlaczego pokazują mi się foldery z okładkami do piosenek i tym podobne rzeczy?    Cóż, zdjęcie to zdjęcie. Aplikacja nie wie, czy to jest akurat okładka od piosenki, czy cokolwiek innego. Aby ukryć niechciane rzeczy, przytrzymaj je i wybierz opcję \'Wyklucz\' z paska akcji.    Nie pokazuje(-ą) mi się folder(y) ze zdjęciami / filmami. Co mogę zrobić?    Wejdź do ustawień aplikacji i w sekcji z dołączonymi folderami dodaj tenże folder do listy. From 0e60aca74c52c5bc55918f12043baeb7a8a34cdc Mon Sep 17 00:00:00 2001 From: tibbi Date: Mon, 19 Feb 2018 18:08:26 +0100 Subject: [PATCH 11/71] add some helper functions for getting fastscroller bubble text --- .../simplemobiletools/gallery/activities/MainActivity.kt | 6 ++++-- .../simplemobiletools/gallery/activities/MediaActivity.kt | 6 ++++-- 2 files changed, 8 insertions(+), 4 deletions(-) diff --git a/app/src/main/kotlin/com/simplemobiletools/gallery/activities/MainActivity.kt b/app/src/main/kotlin/com/simplemobiletools/gallery/activities/MainActivity.kt index 3c59a8361..ecbf4c525 100644 --- a/app/src/main/kotlin/com/simplemobiletools/gallery/activities/MainActivity.kt +++ b/app/src/main/kotlin/com/simplemobiletools/gallery/activities/MainActivity.kt @@ -619,16 +619,18 @@ class MainActivity : SimpleActivity(), DirectoryAdapter.DirOperationsListener { if (allowHorizontalScroll) { directories_horizontal_fastscroller.allowBubbleDisplay = config.showInfoBubble directories_horizontal_fastscroller.setViews(directories_grid, directories_refresh_layout) { - directories_horizontal_fastscroller.updateBubbleText(mDirs[it].getBubbleText()) + directories_horizontal_fastscroller.updateBubbleText(getBubbleTextItem(it)) } } else { directories_vertical_fastscroller.allowBubbleDisplay = config.showInfoBubble directories_vertical_fastscroller.setViews(directories_grid, directories_refresh_layout) { - directories_vertical_fastscroller.updateBubbleText(mDirs[it].getBubbleText()) + directories_vertical_fastscroller.updateBubbleText(getBubbleTextItem(it)) } } } + private fun getBubbleTextItem(index: Int) = getRecyclerAdapter().dirs.getOrNull(index)?.getBubbleText() ?: "" + private fun checkLastMediaChanged() { if (isActivityDestroyed()) return diff --git a/app/src/main/kotlin/com/simplemobiletools/gallery/activities/MediaActivity.kt b/app/src/main/kotlin/com/simplemobiletools/gallery/activities/MediaActivity.kt index 82d8990ad..9ce048b91 100644 --- a/app/src/main/kotlin/com/simplemobiletools/gallery/activities/MediaActivity.kt +++ b/app/src/main/kotlin/com/simplemobiletools/gallery/activities/MediaActivity.kt @@ -334,16 +334,18 @@ class MediaActivity : SimpleActivity(), MediaAdapter.MediaOperationsListener { if (allowHorizontalScroll) { media_horizontal_fastscroller.allowBubbleDisplay = config.showInfoBubble media_horizontal_fastscroller.setViews(media_grid, media_refresh_layout) { - media_horizontal_fastscroller.updateBubbleText(mMedia[it].getBubbleText()) + media_horizontal_fastscroller.updateBubbleText(getBubbleTextItem(it)) } } else { media_vertical_fastscroller.allowBubbleDisplay = config.showInfoBubble media_vertical_fastscroller.setViews(media_grid, media_refresh_layout) { - media_vertical_fastscroller.updateBubbleText(mMedia[it].getBubbleText()) + media_vertical_fastscroller.updateBubbleText(getBubbleTextItem(it)) } } } + private fun getBubbleTextItem(index: Int) = getRecyclerAdapter().media.getOrNull(index)?.getBubbleText() ?: "" + private fun checkLastMediaChanged() { if (isActivityDestroyed()) return From a93a7719a0bae0bd226c0104e87957855c74f564 Mon Sep 17 00:00:00 2001 From: fricyo <30796677+fricyo@users.noreply.github.com> Date: Tue, 20 Feb 2018 01:08:45 +0800 Subject: [PATCH 12/71] Translation update --- app/src/main/res/values-zh-rTW/strings.xml | 36 +++++++++++----------- 1 file changed, 18 insertions(+), 18 deletions(-) diff --git a/app/src/main/res/values-zh-rTW/strings.xml b/app/src/main/res/values-zh-rTW/strings.xml index cebcd39a3..89bbf4182 100644 --- a/app/src/main/res/values-zh-rTW/strings.xml +++ b/app/src/main/res/values-zh-rTW/strings.xml @@ -144,24 +144,24 @@ 詳細資訊 - How can I make Simple Gallery the default device gallery? - First you have to find the currently default gallery in the Apps section of your device settings, look for a button that says something like \"Open by default\", click on it, then select \"Clear defaults\". - The next time you will try opening an image or video you should see an app picker, where you can select Simple Gallery and make it the default app. - I locked the app with a password, but I forgot it. What can I do? - You can solve it in 2 ways. You can either reinstall the app, or find the app in your device settings and select \"Clear data\". It will reset all your settings, it will not remove any media files. - How can I make an album always appear at the top? - You can long press the desired album and select the Pin icon at the actionmenu, that will pin it to the top. You can pin multiple folders too, pinned items will be sorted by the default sorting method. - How can I fast-forward videos? - You can click on the current or max duration texts near the seekbar, that will move the video either backward, or forward. - What is the difference between hiding and excluding a folder? - Exclude prevents displaying the folder only in Simple Gallery, while Hide works system-wise and it hides the folder from other galleries too. It works by creating an empty \".nomedia\" file in the given folder, which you can then remove with any file manager too. - Why do folders with music cover art or stickers show up? - It can happen that you will see some unusual albums show up. You can easily exclude them by long pressing them and selecting Exclude. In the next dialog you can then select the parent folder, chances are it will prevent the other related albums showing up too. - A folder with images isn\'t showing up, what can I do? - That can have multiple reasons, but solving it is easy. Just go in Settings -> Manage Included Folders, select Plus and navigate to the required folder. - What if I want just a few particular folders visible? - Adding a folder at the Included Folders doesn\'t automatically exclude anything. What you can do is go in Settings -> Manage Excluded Folders, exclude the root folder \"/\", then add the desired folders at Settings -> Manage Included Folders. - That will make only the selected folders visible, as both excluding and including are recursive and if a folder is both excluded and included, it will show up. + 我如何將簡易相簿設為預設相簿? + 首先你必須先在裝置設定中應用程式部分尋找目前預設相簿,找到一個像是\"預設開啟(Open by default)\"的按鈕,點下去,然後選擇\"清除預設(Clear defaults)\"。 + 下次你要開啟圖片或影片時應該會看到程式選擇器,你可以在那裡選擇簡易相簿並設為預設程式。 + 我用密碼鎖住了這應用程式,但我忘記了。怎麼辦? + 有兩個解決方法。你可以重新安裝應用程式,或者在裝置設定中找到這程式然後選擇\"清除資料(Clear data)\"。這將重置你程式內所有設定,不會移除任何媒體檔案。 + 我如何讓某個相冊總是出現在頂端? + 你可以長按想要的相冊,然後在操作選單中選擇[圖釘]圖示,就會釘選於頂端。你也能釘選多個資料夾,釘選的項目會依預設的排序方法來排序。 + 我如何快轉影片? + 你可以點擊進度條附近的當前或總時長文字,影片就會快轉或倒轉。 + 隱藏和排除資料夾,兩者有什麼不同? + [排除]只在簡易相簿中避免顯示出來;而[隱藏]則作用於整個系統,資料夾也會被其他相簿隱藏。這是藉由在指定資料夾內建立一個\".nomedia\"空白檔案來進行隱藏,你之後也能用任何檔案管理器移除。 + 為什麼有些音樂專輯封面或貼圖的資料夾會出現? + 這情況可能發生,你會看到一些異常的相冊出現。你可以長按再選擇[排除]來輕易排除他們。在下個對話框,你可以選擇上層資料夾,有可能讓其他相關相冊也避免出現。 + 有一個圖片資料夾沒有顯示出來,怎麼辦? + 可能有多種原因,不過很好解決。只要到[設定] -> [管理包含資料夾],選擇[加號]然後導引到需要的資料夾。 + 如果我只想看到幾個特定的資料夾,怎麼做? + 在[包含資料夾]內添加資料夾並不會自動排除任何東西。你能做的是到[設定] -> [管理排除資料夾],排除根目錄 \"/\",然後在[設定] -> [管理包含資料夾]添加想要的資料夾。 + 那樣的話就只有選擇的資料夾可見。因為排除和包含都是遞迴的,如果一個資料夾被排除又被包含,則會顯示出來。 From 44895ae3654c5cb00185ec8650d1af7d1526211b Mon Sep 17 00:00:00 2001 From: tibbi Date: Mon, 19 Feb 2018 18:11:20 +0100 Subject: [PATCH 13/71] add a null check at video fastforwarding --- .../com/simplemobiletools/gallery/fragments/VideoFragment.kt | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/app/src/main/kotlin/com/simplemobiletools/gallery/fragments/VideoFragment.kt b/app/src/main/kotlin/com/simplemobiletools/gallery/fragments/VideoFragment.kt index 5cf2dc092..1f7ee9084 100644 --- a/app/src/main/kotlin/com/simplemobiletools/gallery/fragments/VideoFragment.kt +++ b/app/src/main/kotlin/com/simplemobiletools/gallery/fragments/VideoFragment.kt @@ -471,6 +471,10 @@ class VideoFragment : ViewPagerFragment(), SurfaceHolder.Callback, SeekBar.OnSee } private fun skip(forward: Boolean) { + if (mMediaPlayer == null) { + return + } + val curr = mMediaPlayer!!.currentPosition val twoPercents = mMediaPlayer!!.duration / 50 val newProgress = if (forward) curr + twoPercents else curr - twoPercents From fb493459dea8cee32d5afe7be70fbe14d5d8417e Mon Sep 17 00:00:00 2001 From: tibbi Date: Mon, 19 Feb 2018 20:24:32 +0100 Subject: [PATCH 14/71] update commons to 3.12.6 --- app/build.gradle | 2 +- .../gallery/activities/EditActivity.kt | 6 +- .../gallery/activities/MainActivity.kt | 8 ++- .../gallery/activities/MediaActivity.kt | 16 +++--- .../gallery/activities/PhotoVideoActivity.kt | 13 +++-- .../gallery/activities/ViewPagerActivity.kt | 53 +++++++++--------- .../gallery/adapters/DirectoryAdapter.kt | 21 ++++--- .../adapters/ManageHiddenFoldersAdapter.kt | 3 +- .../gallery/adapters/MediaAdapter.kt | 44 ++++++++------- .../gallery/dialogs/ChangeSortingDialog.kt | 2 +- .../gallery/extensions/Activity.kt | 56 +++++++++---------- .../gallery/extensions/FileDirItem.kt | 6 ++ .../gallery/fragments/ViewPagerFragment.kt | 2 +- .../gallery/helpers/Config.kt | 8 +-- .../gallery/helpers/Constants.kt | 1 - .../gallery/helpers/MediaFetcher.kt | 3 +- .../gallery/models/Medium.kt | 4 +- app/src/main/res/values/integers.xml | 2 + 18 files changed, 130 insertions(+), 120 deletions(-) create mode 100644 app/src/main/kotlin/com/simplemobiletools/gallery/extensions/FileDirItem.kt diff --git a/app/build.gradle b/app/build.gradle index 31a0c64e4..40875409d 100644 --- a/app/build.gradle +++ b/app/build.gradle @@ -46,7 +46,7 @@ ext { } dependencies { - implementation 'com.simplemobiletools:commons:3.11.15' + implementation 'com.simplemobiletools:commons:3.12.6' implementation 'com.theartofdev.edmodo:android-image-cropper:2.6.0' implementation 'com.android.support:multidex:1.0.2' implementation 'com.google.code.gson:gson:2.8.2' diff --git a/app/src/main/kotlin/com/simplemobiletools/gallery/activities/EditActivity.kt b/app/src/main/kotlin/com/simplemobiletools/gallery/activities/EditActivity.kt index c1408b2c9..628f66457 100644 --- a/app/src/main/kotlin/com/simplemobiletools/gallery/activities/EditActivity.kt +++ b/app/src/main/kotlin/com/simplemobiletools/gallery/activities/EditActivity.kt @@ -12,6 +12,7 @@ import android.view.Menu import android.view.MenuItem import com.simplemobiletools.commons.extensions.* import com.simplemobiletools.commons.helpers.PERMISSION_WRITE_STORAGE +import com.simplemobiletools.commons.models.FileDirItem import com.simplemobiletools.gallery.R import com.simplemobiletools.gallery.dialogs.ResizeDialog import com.simplemobiletools.gallery.dialogs.SaveAsDialog @@ -191,7 +192,8 @@ class EditActivity : SimpleActivity(), CropImageView.OnCropImageCompleteListener try { Thread { val file = File(path) - getFileOutputStream(file) { + val fileDirItem = FileDirItem(path, path.getFilenameFromPath()) + getFileOutputStream(fileDirItem) { if (it != null) { saveBitmap(file, bitmap, it) } else { @@ -227,7 +229,7 @@ class EditActivity : SimpleActivity(), CropImageView.OnCropImageCompleteListener } private fun editWith() { - openEditor(uri) + openEditor(uri.toString()) isEditingWithThirdParty = true } diff --git a/app/src/main/kotlin/com/simplemobiletools/gallery/activities/MainActivity.kt b/app/src/main/kotlin/com/simplemobiletools/gallery/activities/MainActivity.kt index ecbf4c525..e3361fff0 100644 --- a/app/src/main/kotlin/com/simplemobiletools/gallery/activities/MainActivity.kt +++ b/app/src/main/kotlin/com/simplemobiletools/gallery/activities/MainActivity.kt @@ -20,6 +20,7 @@ import com.simplemobiletools.commons.extensions.* import com.simplemobiletools.commons.helpers.PERMISSION_WRITE_STORAGE import com.simplemobiletools.commons.helpers.SORT_BY_DATE_MODIFIED import com.simplemobiletools.commons.helpers.SORT_BY_DATE_TAKEN +import com.simplemobiletools.commons.models.FileDirItem import com.simplemobiletools.commons.models.RadioItem import com.simplemobiletools.commons.models.Release import com.simplemobiletools.commons.views.MyGridLayoutManager @@ -233,7 +234,7 @@ class MainActivity : SimpleActivity(), DirectoryAdapter.DirOperationsListener { val newFolder = File(config.tempFolderPath) if (newFolder.exists() && newFolder.isDirectory) { if (newFolder.list()?.isEmpty() == true) { - deleteFile(newFolder, true) + deleteFile(newFolder.toFileDirItem(applicationContext), true) } } config.tempFolderPath = "" @@ -352,7 +353,8 @@ class MainActivity : SimpleActivity(), DirectoryAdapter.DirOperationsListener { } override fun deleteFolders(folders: ArrayList) { - deleteFolders(folders) { + val fileDirItems = folders.map { FileDirItem(it.absolutePath, it.name, true) } as ArrayList + deleteFolders(fileDirItems) { runOnUiThread { refreshItems() } @@ -522,7 +524,7 @@ class MainActivity : SimpleActivity(), DirectoryAdapter.DirOperationsListener { private fun fillIntentPath(resultData: Intent, resultIntent: Intent) { val path = resultData.data.path val uri = getFilePublicUri(File(path), BuildConfig.APPLICATION_ID) - val type = path.getMimeTypeFromPath() + val type = path.getMimeType() resultIntent.setDataAndTypeAndNormalize(uri, type) resultIntent.addFlags(Intent.FLAG_GRANT_READ_URI_PERMISSION) } diff --git a/app/src/main/kotlin/com/simplemobiletools/gallery/activities/MediaActivity.kt b/app/src/main/kotlin/com/simplemobiletools/gallery/activities/MediaActivity.kt index 9ce048b91..87b35c151 100644 --- a/app/src/main/kotlin/com/simplemobiletools/gallery/activities/MediaActivity.kt +++ b/app/src/main/kotlin/com/simplemobiletools/gallery/activities/MediaActivity.kt @@ -26,6 +26,7 @@ import com.simplemobiletools.commons.dialogs.RadioGroupDialog import com.simplemobiletools.commons.extensions.* import com.simplemobiletools.commons.helpers.PERMISSION_WRITE_STORAGE import com.simplemobiletools.commons.helpers.REQUEST_EDIT_IMAGE +import com.simplemobiletools.commons.models.FileDirItem import com.simplemobiletools.commons.models.RadioItem import com.simplemobiletools.commons.views.MyGridLayoutManager import com.simplemobiletools.commons.views.MyRecyclerView @@ -442,9 +443,9 @@ class MediaActivity : SimpleActivity(), MediaAdapter.MediaOperationsListener { } private fun deleteDirectoryIfEmpty() { - val file = File(mPath) - if (config.deleteEmptyFolders && !file.isDownloadsFolder() && file.isDirectory && file.list()?.isEmpty() == true) { - deleteFile(file, true) + val fileDirItem = FileDirItem(mPath, mPath.getFilenameFromPath()) + if (config.deleteEmptyFolders && !fileDirItem.isDownloadsFolder() && fileDirItem.isDirectory && fileDirItem.getProperFileCount(applicationContext, true) == 0) { + deleteFile(fileDirItem, true) } } @@ -610,10 +611,9 @@ class MediaActivity : SimpleActivity(), MediaAdapter.MediaOperationsListener { } finish() } else { - val file = File(path) - val isVideo = file.isVideoFast() + val isVideo = path.isVideoFast() if (isVideo) { - openFile(Uri.fromFile(file), false) + openPath(path, false) } else { Intent(this, ViewPagerActivity::class.java).apply { putExtra(PATH, path) @@ -666,8 +666,8 @@ class MediaActivity : SimpleActivity(), MediaAdapter.MediaOperationsListener { } } - override fun deleteFiles(files: ArrayList) { - val filtered = files.filter { it.isImageVideoGif() } as ArrayList + override fun deleteFiles(fileDirItems: ArrayList) { + val filtered = fileDirItems.filter { it.path.isImageVideoGif() } as ArrayList deleteFiles(filtered) { if (!it) { toast(R.string.unknown_error_occurred) diff --git a/app/src/main/kotlin/com/simplemobiletools/gallery/activities/PhotoVideoActivity.kt b/app/src/main/kotlin/com/simplemobiletools/gallery/activities/PhotoVideoActivity.kt index 602154896..1eee71390 100644 --- a/app/src/main/kotlin/com/simplemobiletools/gallery/activities/PhotoVideoActivity.kt +++ b/app/src/main/kotlin/com/simplemobiletools/gallery/activities/PhotoVideoActivity.kt @@ -59,7 +59,7 @@ open class PhotoVideoActivity : SimpleActivity(), ViewPagerFragment.FragmentList private fun checkIntent(savedInstanceState: Bundle? = null) { mUri = intent.data ?: return if (intent.extras?.containsKey(REAL_FILE_PATH) == true) { - mUri = intent.extras.get(REAL_FILE_PATH) as Uri + mUri = Uri.parse(intent.extras.get(REAL_FILE_PATH) as String) } mIsFromGallery = intent.getBooleanExtra(IS_FROM_GALLERY, false) @@ -131,14 +131,15 @@ open class PhotoVideoActivity : SimpleActivity(), ViewPagerFragment.FragmentList } override fun onOptionsItemSelected(item: MenuItem): Boolean { - if (mMedium == null) + if (mMedium == null) { return true + } when (item.itemId) { - R.id.menu_set_as -> setAs(mUri!!) - R.id.menu_open_with -> openFile(mUri!!, true) - R.id.menu_share -> shareUri(mUri!!) - R.id.menu_edit -> openEditor(mUri!!) + R.id.menu_set_as -> setAs(mUri!!.toString()) + R.id.menu_open_with -> openPath(mUri!!.toString(), true) + R.id.menu_share -> sharePath(mUri!!.toString()) + R.id.menu_edit -> openEditor(mUri!!.toString()) R.id.menu_properties -> showProperties() else -> return super.onOptionsItemSelected(item) } diff --git a/app/src/main/kotlin/com/simplemobiletools/gallery/activities/ViewPagerActivity.kt b/app/src/main/kotlin/com/simplemobiletools/gallery/activities/ViewPagerActivity.kt index 80e41d7c5..89e25594d 100644 --- a/app/src/main/kotlin/com/simplemobiletools/gallery/activities/ViewPagerActivity.kt +++ b/app/src/main/kotlin/com/simplemobiletools/gallery/activities/ViewPagerActivity.kt @@ -33,6 +33,7 @@ import com.simplemobiletools.commons.helpers.IS_FROM_GALLERY import com.simplemobiletools.commons.helpers.PERMISSION_WRITE_STORAGE import com.simplemobiletools.commons.helpers.REQUEST_EDIT_IMAGE import com.simplemobiletools.commons.helpers.REQUEST_SET_AS +import com.simplemobiletools.commons.models.FileDirItem import com.simplemobiletools.gallery.R import com.simplemobiletools.gallery.adapters.MyPagerAdapter import com.simplemobiletools.gallery.asynctasks.GetMediaAsynctask @@ -180,10 +181,9 @@ class ViewPagerActivity : SimpleActivity(), ViewPager.OnPageChangeListener, View return } - val file = File(mPath) - if (!file.exists() && file.length() == 0L) { + if (!getDoesFilePathExist(mPath)) { Thread { - deleteFromMediaStore(file) + deleteFromMediaStore(mPath) }.start() finish() return @@ -201,7 +201,7 @@ class ViewPagerActivity : SimpleActivity(), ViewPager.OnPageChangeListener, View showSystemUI() - mDirectory = file.parent + mDirectory = mPath.getParentPath().trimEnd('/') supportActionBar?.title = mPath.getFilenameFromPath() view_pager.onGlobalLayout { @@ -272,18 +272,18 @@ class ViewPagerActivity : SimpleActivity(), ViewPager.OnPageChangeListener, View return true when (item.itemId) { - R.id.menu_set_as -> setAs(Uri.fromFile(getCurrentFile())) + R.id.menu_set_as -> setAs(getCurrentPath()) R.id.menu_slideshow -> initSlideshow() R.id.menu_copy_to -> copyMoveTo(true) R.id.menu_move_to -> copyMoveTo(false) - R.id.menu_open_with -> openFile(Uri.fromFile(getCurrentFile()), true) + R.id.menu_open_with -> openPath(getCurrentPath(), true) R.id.menu_hide -> toggleFileVisibility(true) R.id.menu_unhide -> toggleFileVisibility(false) R.id.menu_share_1 -> shareMedium(getCurrentMedium()!!) R.id.menu_share_2 -> shareMedium(getCurrentMedium()!!) R.id.menu_delete -> checkDeleteConfirmation() R.id.menu_rename -> renameFile() - R.id.menu_edit -> openEditor(Uri.fromFile(getCurrentFile())) + R.id.menu_edit -> openEditor(getCurrentPath()) R.id.menu_properties -> showProperties() R.id.menu_show_on_map -> showOnMap() R.id.menu_rotate_right -> rotateImage(90) @@ -462,8 +462,9 @@ class ViewPagerActivity : SimpleActivity(), ViewPager.OnPageChangeListener, View } private fun copyMoveTo(isCopyOperation: Boolean) { - val files = ArrayList(1).apply { add(getCurrentFile()) } - tryCopyMoveFilesTo(files, isCopyOperation) { + val currPath = getCurrentPath() + val fileDirItems = arrayListOf(FileDirItem(currPath, currPath.getFilenameFromPath())) + tryCopyMoveFilesTo(fileDirItems, isCopyOperation) { config.tempFolderPath = "" if (!isCopyOperation) { refreshViewPager() @@ -472,13 +473,13 @@ class ViewPagerActivity : SimpleActivity(), ViewPager.OnPageChangeListener, View } private fun toggleFileVisibility(hide: Boolean) { - toggleFileVisibility(getCurrentFile(), hide) { - val newFileName = it.absolutePath.getFilenameFromPath() + toggleFileVisibility(getCurrentPath(), hide) { + val newFileName = it.getFilenameFromPath() supportActionBar?.title = newFileName getCurrentMedium()!!.apply { name = newFileName - path = it.absolutePath + path = it getCurrentMedia()[mPos] = this } invalidateOptionsMenu() @@ -508,8 +509,7 @@ class ViewPagerActivity : SimpleActivity(), ViewPager.OnPageChangeListener, View private fun saveImageAs() { val currPath = getCurrentPath() SaveAsDialog(this, currPath, false) { - val selectedFile = File(it) - handleSAFDialog(selectedFile) { + handleSAFDialog(it) { Thread { saveImageToFile(currPath, it) }.start() @@ -523,7 +523,7 @@ class ViewPagerActivity : SimpleActivity(), ViewPager.OnPageChangeListener, View val tmpFile = File(filesDir, ".tmp_${newPath.getFilenameFromPath()}") try { val bitmap = BitmapFactory.decodeFile(oldPath) - getFileOutputStream(tmpFile) { + getFileOutputStream(tmpFile.toFileDirItem(applicationContext)) { if (it == null) { toast(R.string.unknown_error_occurred) return@getFileOutputStream @@ -536,16 +536,16 @@ class ViewPagerActivity : SimpleActivity(), ViewPager.OnPageChangeListener, View saveFile(tmpFile, bitmap, it as FileOutputStream) } - if (tmpFile.length() > 0 && newFile.exists()) { - deleteFile(newFile) + if (tmpFile.length() > 0 && getDoesFilePathExist(newPath)) { + deleteFile(FileDirItem(newPath, newPath.getFilenameFromPath())) } copyFile(tmpFile, newFile) - scanFile(newFile) + scanPath(newPath) toast(R.string.file_saved) if (config.keepLastModified) { newFile.setLastModified(oldLastModified) - updateLastModified(newFile, oldLastModified) + updateLastModified(newPath, oldLastModified) } it.flush() @@ -565,7 +565,7 @@ class ViewPagerActivity : SimpleActivity(), ViewPager.OnPageChangeListener, View } catch (e: Exception) { showErrorToast(e) } finally { - deleteFile(tmpFile) + deleteFile(FileDirItem(newPath, newPath.getFilenameFromPath())) } } @@ -573,7 +573,7 @@ class ViewPagerActivity : SimpleActivity(), ViewPager.OnPageChangeListener, View var inputStream: InputStream? = null var out: OutputStream? = null try { - val fileDocument = if (isPathOnSD(destination.absolutePath)) getFileDocument(destination.parent) else null + val fileDocument = if (isPathOnSD(destination.absolutePath)) getDocumentFile(destination.parent) else null out = getFileOutputStreamSync(destination.absolutePath, source.getMimeType(), fileDocument) inputStream = FileInputStream(source) inputStream.copyTo(out!!) @@ -735,7 +735,8 @@ class ViewPagerActivity : SimpleActivity(), ViewPager.OnPageChangeListener, View } private fun deleteConfirmed() { - deleteFile(File(getCurrentMedia()[mPos].path)) { + val path = getCurrentMedia()[mPos].path + deleteFile(FileDirItem(path, path.getFilenameFromPath())) { refreshViewPager() } } @@ -811,9 +812,9 @@ class ViewPagerActivity : SimpleActivity(), ViewPager.OnPageChangeListener, View } private fun deleteDirectoryIfEmpty() { - val file = File(mDirectory) - if (config.deleteEmptyFolders && !file.isDownloadsFolder() && file.isDirectory && file.list()?.isEmpty() == true) { - deleteFile(file, true) + val fileDirItem = FileDirItem(mDirectory, mDirectory.getFilenameFromPath(), getIsPathDirectory(mDirectory)) + if (config.deleteEmptyFolders && !fileDirItem.isDownloadsFolder() && fileDirItem.isDirectory && fileDirItem.getProperFileCount(applicationContext, true) == 0) { + deleteFile(fileDirItem, true) } scanPath(mDirectory) @@ -821,7 +822,7 @@ class ViewPagerActivity : SimpleActivity(), ViewPager.OnPageChangeListener, View private fun checkOrientation() { if (!mIsOrientationLocked && config.screenRotation == ROTATE_BY_ASPECT_RATIO) { - val res = getCurrentFile().getResolution() + val res = getCurrentPath().getResolution() ?: return if (res.x > res.y) { requestedOrientation = ActivityInfo.SCREEN_ORIENTATION_LANDSCAPE } else if (res.x < res.y) { diff --git a/app/src/main/kotlin/com/simplemobiletools/gallery/adapters/DirectoryAdapter.kt b/app/src/main/kotlin/com/simplemobiletools/gallery/adapters/DirectoryAdapter.kt index f6efe8972..cc3bde953 100644 --- a/app/src/main/kotlin/com/simplemobiletools/gallery/adapters/DirectoryAdapter.kt +++ b/app/src/main/kotlin/com/simplemobiletools/gallery/adapters/DirectoryAdapter.kt @@ -11,6 +11,7 @@ import com.simplemobiletools.commons.dialogs.ConfirmationDialog import com.simplemobiletools.commons.dialogs.PropertiesDialog import com.simplemobiletools.commons.dialogs.RenameItemDialog import com.simplemobiletools.commons.extensions.* +import com.simplemobiletools.commons.models.FileDirItem import com.simplemobiletools.commons.views.FastScroller import com.simplemobiletools.commons.views.MyRecyclerView import com.simplemobiletools.gallery.R @@ -76,6 +77,10 @@ class DirectoryAdapter(activity: BaseSimpleActivity, var dirs: MutableList showProperties() R.id.cab_rename -> renameDir() @@ -213,16 +218,14 @@ class DirectoryAdapter(activity: BaseSimpleActivity, var dirs: MutableList() + val paths = ArrayList() selectedPositions.forEach { val dir = File(dirs[it].path) - files.addAll(dir.listFiles().filter { it.isFile && it.isImageVideoGif() }) + paths.addAll(dir.list().filter { !activity.getIsPathDirectory(it) && it.isImageVideoGif() }) } - activity.tryCopyMoveFilesTo(files, isCopyOperation) { + val fileDirItems = paths.map { FileDirItem(it, it.getFilenameFromPath()) } as ArrayList + activity.tryCopyMoveFilesTo(fileDirItems, isCopyOperation) { config.tempFolderPath = "" listener?.refreshItems() finishActMode() @@ -236,10 +239,6 @@ class DirectoryAdapter(activity: BaseSimpleActivity, var dirs: MutableList(selectedPositions.size) val removeFolders = ArrayList(selectedPositions.size) @@ -253,7 +252,7 @@ class DirectoryAdapter(activity: BaseSimpleActivity, var dirs: MutableList, val listener: RefreshRecyclerViewListener?, @@ -70,7 +69,7 @@ class ManageHiddenFoldersAdapter(activity: BaseSimpleActivity, var folders: Arra } if (sdCardPaths.isNotEmpty()) { - activity.handleSAFDialog(File(sdCardPaths.first())) { + activity.handleSAFDialog(sdCardPaths.first()) { unhideFolders(removeFolders) } } else { diff --git a/app/src/main/kotlin/com/simplemobiletools/gallery/adapters/MediaAdapter.kt b/app/src/main/kotlin/com/simplemobiletools/gallery/adapters/MediaAdapter.kt index e54fd102c..fc07bcca2 100644 --- a/app/src/main/kotlin/com/simplemobiletools/gallery/adapters/MediaAdapter.kt +++ b/app/src/main/kotlin/com/simplemobiletools/gallery/adapters/MediaAdapter.kt @@ -1,6 +1,5 @@ package com.simplemobiletools.gallery.adapters -import android.net.Uri import android.os.Handler import android.os.Looper import android.view.Menu @@ -13,7 +12,9 @@ import com.simplemobiletools.commons.dialogs.PropertiesDialog import com.simplemobiletools.commons.dialogs.RenameItemDialog import com.simplemobiletools.commons.extensions.applyColorFilter import com.simplemobiletools.commons.extensions.beVisibleIf +import com.simplemobiletools.commons.extensions.getFilenameFromPath import com.simplemobiletools.commons.extensions.isActivityDestroyed +import com.simplemobiletools.commons.models.FileDirItem import com.simplemobiletools.commons.views.FastScroller import com.simplemobiletools.commons.views.MyRecyclerView import com.simplemobiletools.gallery.R @@ -23,7 +24,6 @@ import com.simplemobiletools.gallery.helpers.VIEW_TYPE_LIST import com.simplemobiletools.gallery.models.Medium import kotlinx.android.synthetic.main.photo_video_item_grid.view.* import java.io.File -import java.util.* class MediaAdapter(activity: BaseSimpleActivity, var media: MutableList, val listener: MediaOperationsListener?, val isAGetIntent: Boolean, val allowMultiplePicks: Boolean, recyclerView: MyRecyclerView, fastScroller: FastScroller? = null, @@ -86,6 +86,10 @@ class MediaAdapter(activity: BaseSimpleActivity, var media: MutableList, } override fun actionItemPressed(id: Int) { + if (selectedPositions.isEmpty()) { + return + } + when (id) { R.id.cab_confirm_selection -> confirmSelection() R.id.cab_properties -> showProperties() @@ -97,8 +101,8 @@ class MediaAdapter(activity: BaseSimpleActivity, var media: MutableList, R.id.cab_copy_to -> copyMoveTo(true) R.id.cab_move_to -> copyMoveTo(false) R.id.cab_select_all -> selectAll() - R.id.cab_open_with -> activity.openFile(Uri.fromFile(getCurrentFile()), true) - R.id.cab_set_as -> activity.setAs(Uri.fromFile(getCurrentFile())) + R.id.cab_open_with -> activity.openPath(getCurrentPath(), true) + R.id.cab_set_as -> activity.setAs(getCurrentPath()) R.id.cab_delete -> checkDeleteConfirmation() } } @@ -145,7 +149,7 @@ class MediaAdapter(activity: BaseSimpleActivity, var media: MutableList, } private fun renameFile() { - RenameItemDialog(activity, getCurrentFile().absolutePath) { + RenameItemDialog(activity, getCurrentPath()) { activity.runOnUiThread { listener?.refreshItems() finishActMode() @@ -154,15 +158,14 @@ class MediaAdapter(activity: BaseSimpleActivity, var media: MutableList, } private fun editFile() { - activity.openEditor(Uri.fromFile(getCurrentFile())) + activity.openEditor(getCurrentPath()) finishActMode() } private fun toggleFileVisibility(hide: Boolean) { Thread { getSelectedMedia().forEach { - val oldFile = File(it.path) - activity.toggleFileVisibility(oldFile, hide) + activity.toggleFileVisibility(it.path, hide) } activity.runOnUiThread { listener?.refreshItems() @@ -180,10 +183,11 @@ class MediaAdapter(activity: BaseSimpleActivity, var media: MutableList, } private fun copyMoveTo(isCopyOperation: Boolean) { - val files = ArrayList() - selectedPositions.forEach { files.add(File(media[it].path)) } + val paths = ArrayList() + selectedPositions.forEach { paths.add(media[it].path) } - activity.tryCopyMoveFilesTo(files, isCopyOperation) { + val fileDirItems = paths.map { FileDirItem(it, it.getFilenameFromPath()) } as ArrayList + activity.tryCopyMoveFilesTo(fileDirItems, isCopyOperation) { config.tempFolderPath = "" if (!isCopyOperation) { listener?.refreshItems() @@ -211,14 +215,12 @@ class MediaAdapter(activity: BaseSimpleActivity, var media: MutableList, deleteFiles() } - private fun getCurrentFile() = File(media[selectedPositions.first()].path) + private fun getCurrentPath() = media[selectedPositions.first()].path + + private fun getCurrentFile() = File(getCurrentPath()) private fun deleteFiles() { - if (selectedPositions.isEmpty()) { - return - } - - val files = ArrayList(selectedPositions.size) + val fileDirItems = ArrayList(selectedPositions.size) val removeMedia = ArrayList(selectedPositions.size) if (media.size <= selectedPositions.first()) { @@ -227,15 +229,15 @@ class MediaAdapter(activity: BaseSimpleActivity, var media: MutableList, } val SAFPath = media[selectedPositions.first()].path - activity.handleSAFDialog(File(SAFPath)) { + activity.handleSAFDialog(SAFPath) { selectedPositions.sortedDescending().forEach { val medium = media[it] - files.add(File(medium.path)) + fileDirItems.add(FileDirItem(medium.path, medium.name)) removeMedia.add(medium) } media.removeAll(removeMedia) - listener?.deleteFiles(files) + listener?.deleteFiles(fileDirItems) removeSelectedItems() } } @@ -314,7 +316,7 @@ class MediaAdapter(activity: BaseSimpleActivity, var media: MutableList, interface MediaOperationsListener { fun refreshItems() - fun deleteFiles(files: ArrayList) + fun deleteFiles(fileDirItems: ArrayList) fun selectedPaths(paths: ArrayList) } diff --git a/app/src/main/kotlin/com/simplemobiletools/gallery/dialogs/ChangeSortingDialog.kt b/app/src/main/kotlin/com/simplemobiletools/gallery/dialogs/ChangeSortingDialog.kt index d83d10237..efbf4fe0e 100644 --- a/app/src/main/kotlin/com/simplemobiletools/gallery/dialogs/ChangeSortingDialog.kt +++ b/app/src/main/kotlin/com/simplemobiletools/gallery/dialogs/ChangeSortingDialog.kt @@ -81,7 +81,7 @@ class ChangeSortingDialog(val activity: BaseSimpleActivity, val isDirectorySorti config.saveFileSorting(path, sorting) } else { config.removeFileSorting(path) - config.fileSorting = sorting + config.sorting = sorting } } callback() diff --git a/app/src/main/kotlin/com/simplemobiletools/gallery/extensions/Activity.kt b/app/src/main/kotlin/com/simplemobiletools/gallery/extensions/Activity.kt index dd8630889..77ad06b56 100644 --- a/app/src/main/kotlin/com/simplemobiletools/gallery/extensions/Activity.kt +++ b/app/src/main/kotlin/com/simplemobiletools/gallery/extensions/Activity.kt @@ -2,7 +2,6 @@ package com.simplemobiletools.gallery.extensions import android.app.Activity import android.content.Intent -import android.net.Uri import android.provider.MediaStore import android.support.v7.app.AppCompatActivity import android.view.View @@ -17,6 +16,7 @@ import com.google.gson.reflect.TypeToken import com.simplemobiletools.commons.activities.BaseSimpleActivity import com.simplemobiletools.commons.extensions.* import com.simplemobiletools.commons.helpers.* +import com.simplemobiletools.commons.models.FileDirItem import com.simplemobiletools.gallery.BuildConfig import com.simplemobiletools.gallery.R import com.simplemobiletools.gallery.activities.SimpleActivity @@ -32,34 +32,33 @@ import pl.droidsonroids.gif.GifDrawable import java.io.File import java.util.* -fun Activity.shareUri(uri: Uri) { - shareUri(uri, BuildConfig.APPLICATION_ID) +fun Activity.sharePath(path: String) { + sharePathIntent(path, BuildConfig.APPLICATION_ID) } -fun Activity.shareUris(uris: ArrayList) { - shareUris(uris, BuildConfig.APPLICATION_ID) +fun Activity.sharePaths(paths: ArrayList) { + sharePathsIntent(paths, BuildConfig.APPLICATION_ID) } fun Activity.shareMedium(medium: Medium) { - val file = File(medium.path) - shareUri(Uri.fromFile(file)) + sharePath(medium.path) } fun Activity.shareMedia(media: List) { - val uris = media.map { Uri.fromFile(File(it.path)) } as ArrayList - shareUris(uris) + val paths = media.map { it.path } as ArrayList + sharePaths(paths) } -fun Activity.setAs(uri: Uri) { - setAs(uri, BuildConfig.APPLICATION_ID) +fun Activity.setAs(path: String) { + setAsIntent(path, BuildConfig.APPLICATION_ID) } -fun Activity.openFile(uri: Uri, forceChooser: Boolean) { - openFile(uri, forceChooser, BuildConfig.APPLICATION_ID) +fun Activity.openPath(path: String, forceChooser: Boolean) { + openPathIntent(path, forceChooser, BuildConfig.APPLICATION_ID) } -fun Activity.openEditor(uri: Uri) { - openEditor(uri, BuildConfig.APPLICATION_ID) +fun Activity.openEditor(path: String) { + openEditorIntent(path, BuildConfig.APPLICATION_ID) } fun Activity.launchCamera() { @@ -100,8 +99,8 @@ fun BaseSimpleActivity.addNoMedia(path: String, callback: () -> Unit) { return if (needsStupidWritePermissions(path)) { - handleSAFDialog(file) { - val fileDocument = getFileDocument(path) + handleSAFDialog(file.absolutePath) { + val fileDocument = getDocumentFile(path) if (fileDocument?.exists() == true && fileDocument.isDirectory) { fileDocument.createFile("", NOMEDIA) } else { @@ -123,22 +122,23 @@ fun BaseSimpleActivity.addNoMedia(path: String, callback: () -> Unit) { fun BaseSimpleActivity.removeNoMedia(path: String, callback: (() -> Unit)? = null) { val file = File(path, NOMEDIA) - deleteFile(file) { + deleteFile(file.toFileDirItem(applicationContext)) { callback?.invoke() } } -fun BaseSimpleActivity.toggleFileVisibility(oldFile: File, hide: Boolean, callback: ((newFile: File) -> Unit)? = null) { - val path = oldFile.parent - var filename = oldFile.name +fun BaseSimpleActivity.toggleFileVisibility(oldPath: String, hide: Boolean, callback: ((newPath: String) -> Unit)? = null) { + val path = oldPath.getParentPath() + var filename = oldPath.getFilenameFromPath() filename = if (hide) { ".${filename.trimStart('.')}" } else { filename.substring(1, filename.length) } - val newFile = File(path, filename) - renameFile(oldFile, newFile) { - callback?.invoke(newFile) + + val newPath = "$path/$filename" + renameFile(oldPath, newPath) { + callback?.invoke(newPath) } } @@ -169,15 +169,15 @@ fun Activity.loadImage(type: Int, path: String, target: MySquareImageView, horiz } } -fun BaseSimpleActivity.tryCopyMoveFilesTo(files: ArrayList, isCopyOperation: Boolean, callback: () -> Unit) { - if (files.isEmpty()) { +fun BaseSimpleActivity.tryCopyMoveFilesTo(fileDirItems: ArrayList, isCopyOperation: Boolean, callback: () -> Unit) { + if (fileDirItems.isEmpty()) { toast(R.string.unknown_error_occurred) return } - val source = if (files[0].isFile) files[0].parent else files[0].absolutePath + val source = fileDirItems[0].getParentPath() PickDirectoryDialog(this, source) { - copyMoveFilesTo(files, source.trimEnd('/'), it, isCopyOperation, true, config.shouldShowHidden, callback) + copyMoveFilesTo(fileDirItems, source.trimEnd('/'), it, isCopyOperation, true, config.shouldShowHidden, callback) } } diff --git a/app/src/main/kotlin/com/simplemobiletools/gallery/extensions/FileDirItem.kt b/app/src/main/kotlin/com/simplemobiletools/gallery/extensions/FileDirItem.kt new file mode 100644 index 000000000..b882a9bb7 --- /dev/null +++ b/app/src/main/kotlin/com/simplemobiletools/gallery/extensions/FileDirItem.kt @@ -0,0 +1,6 @@ +package com.simplemobiletools.gallery.extensions + +import android.os.Environment +import com.simplemobiletools.commons.models.FileDirItem + +fun FileDirItem.isDownloadsFolder() = path == Environment.getExternalStoragePublicDirectory(Environment.DIRECTORY_DOWNLOADS).toString() diff --git a/app/src/main/kotlin/com/simplemobiletools/gallery/fragments/ViewPagerFragment.kt b/app/src/main/kotlin/com/simplemobiletools/gallery/fragments/ViewPagerFragment.kt index 8cb977537..fecbcc23d 100644 --- a/app/src/main/kotlin/com/simplemobiletools/gallery/fragments/ViewPagerFragment.kt +++ b/app/src/main/kotlin/com/simplemobiletools/gallery/fragments/ViewPagerFragment.kt @@ -45,7 +45,7 @@ abstract class ViewPagerFragment : Fragment() { } if (detailsFlag and EXT_RESOLUTION != 0) { - file.getResolution().formatAsResolution().let { if (it.isNotEmpty()) details.appendln(it) } + file.absolutePath.getResolution()?.formatAsResolution().let { if (it?.isNotEmpty() == true) details.appendln(it) } } if (detailsFlag and EXT_LAST_MODIFIED != 0) { diff --git a/app/src/main/kotlin/com/simplemobiletools/gallery/helpers/Config.kt b/app/src/main/kotlin/com/simplemobiletools/gallery/helpers/Config.kt index 333937de6..e8a691f53 100644 --- a/app/src/main/kotlin/com/simplemobiletools/gallery/helpers/Config.kt +++ b/app/src/main/kotlin/com/simplemobiletools/gallery/helpers/Config.kt @@ -16,23 +16,19 @@ class Config(context: Context) : BaseConfig(context) { fun newInstance(context: Context) = Config(context) } - var fileSorting: Int - get() = prefs.getInt(SORT_ORDER, SORT_BY_DATE_MODIFIED or SORT_DESCENDING) - set(order) = prefs.edit().putInt(SORT_ORDER, order).apply() - var directorySorting: Int get() = prefs.getInt(DIRECTORY_SORT_ORDER, SORT_BY_DATE_MODIFIED or SORT_DESCENDING) set(order) = prefs.edit().putInt(DIRECTORY_SORT_ORDER, order).apply() fun saveFileSorting(path: String, value: Int) { if (path.isEmpty()) { - fileSorting = value + sorting = value } else { prefs.edit().putInt(SORT_FOLDER_PREFIX + path.toLowerCase(), value).apply() } } - fun getFileSorting(path: String) = prefs.getInt(SORT_FOLDER_PREFIX + path.toLowerCase(), fileSorting) + fun getFileSorting(path: String) = prefs.getInt(SORT_FOLDER_PREFIX + path.toLowerCase(), sorting) fun removeFileSorting(path: String) { prefs.edit().remove(SORT_FOLDER_PREFIX + path.toLowerCase()).apply() diff --git a/app/src/main/kotlin/com/simplemobiletools/gallery/helpers/Constants.kt b/app/src/main/kotlin/com/simplemobiletools/gallery/helpers/Constants.kt index b4ecd1a6d..9d30dd61f 100644 --- a/app/src/main/kotlin/com/simplemobiletools/gallery/helpers/Constants.kt +++ b/app/src/main/kotlin/com/simplemobiletools/gallery/helpers/Constants.kt @@ -1,7 +1,6 @@ package com.simplemobiletools.gallery.helpers // shared preferences -const val SORT_ORDER = "sort_order" const val DIRECTORY_SORT_ORDER = "directory_sort_order" const val SORT_FOLDER_PREFIX = "sort_folder_" const val SHOW_HIDDEN_MEDIA = "show_hidden_media" diff --git a/app/src/main/kotlin/com/simplemobiletools/gallery/helpers/MediaFetcher.kt b/app/src/main/kotlin/com/simplemobiletools/gallery/helpers/MediaFetcher.kt index 6df8fc016..3621bb8b6 100644 --- a/app/src/main/kotlin/com/simplemobiletools/gallery/helpers/MediaFetcher.kt +++ b/app/src/main/kotlin/com/simplemobiletools/gallery/helpers/MediaFetcher.kt @@ -138,8 +138,9 @@ class MediaFetcher(val context: Context) { if (cur.moveToFirst()) { do { try { - if (shouldStop) + if (shouldStop) { break + } val path = cur.getStringValue(MediaStore.Images.Media.DATA).trim() var filename = cur.getStringValue(MediaStore.Images.Media.DISPLAY_NAME)?.trim() ?: "" diff --git a/app/src/main/kotlin/com/simplemobiletools/gallery/models/Medium.kt b/app/src/main/kotlin/com/simplemobiletools/gallery/models/Medium.kt index fb9e7a213..f00aedda9 100644 --- a/app/src/main/kotlin/com/simplemobiletools/gallery/models/Medium.kt +++ b/app/src/main/kotlin/com/simplemobiletools/gallery/models/Medium.kt @@ -2,7 +2,7 @@ package com.simplemobiletools.gallery.models import com.simplemobiletools.commons.extensions.formatDate import com.simplemobiletools.commons.extensions.formatSize -import com.simplemobiletools.commons.extensions.getMimeTypeFromPath +import com.simplemobiletools.commons.extensions.getMimeType import com.simplemobiletools.commons.extensions.isDng import com.simplemobiletools.commons.helpers.* import com.simplemobiletools.gallery.helpers.TYPE_GIF @@ -24,7 +24,7 @@ data class Medium(var name: String, var path: String, val modified: Long, val ta fun isDng() = path.isDng() - fun getMimeType() = path.getMimeTypeFromPath() + fun getMimeType() = path.getMimeType() override fun compareTo(other: Medium): Int { var result: Int diff --git a/app/src/main/res/values/integers.xml b/app/src/main/res/values/integers.xml index e27e3e8f5..1ba77d374 100644 --- a/app/src/main/res/values/integers.xml +++ b/app/src/main/res/values/integers.xml @@ -3,4 +3,6 @@ 3 3 4 + + 1026 From 783d73cff4f819b5f8f44ab59b146f469053655d Mon Sep 17 00:00:00 2001 From: tibbi Date: Mon, 19 Feb 2018 21:11:37 +0100 Subject: [PATCH 15/71] make use of real_file_path at the editor --- app/build.gradle | 2 +- .../gallery/activities/EditActivity.kt | 30 +++++++++++-------- .../gallery/activities/ViewPagerActivity.kt | 2 +- .../gallery/dialogs/SaveAsDialog.kt | 3 +- 4 files changed, 21 insertions(+), 16 deletions(-) diff --git a/app/build.gradle b/app/build.gradle index 40875409d..b4d27725e 100644 --- a/app/build.gradle +++ b/app/build.gradle @@ -46,7 +46,7 @@ ext { } dependencies { - implementation 'com.simplemobiletools:commons:3.12.6' + implementation 'com.simplemobiletools:commons:3.12.7' implementation 'com.theartofdev.edmodo:android-image-cropper:2.6.0' implementation 'com.android.support:multidex:1.0.2' implementation 'com.google.code.gson:gson:2.8.2' diff --git a/app/src/main/kotlin/com/simplemobiletools/gallery/activities/EditActivity.kt b/app/src/main/kotlin/com/simplemobiletools/gallery/activities/EditActivity.kt index 628f66457..70265732b 100644 --- a/app/src/main/kotlin/com/simplemobiletools/gallery/activities/EditActivity.kt +++ b/app/src/main/kotlin/com/simplemobiletools/gallery/activities/EditActivity.kt @@ -12,6 +12,7 @@ import android.view.Menu import android.view.MenuItem import com.simplemobiletools.commons.extensions.* import com.simplemobiletools.commons.helpers.PERMISSION_WRITE_STORAGE +import com.simplemobiletools.commons.helpers.REAL_FILE_PATH import com.simplemobiletools.commons.models.FileDirItem import com.simplemobiletools.gallery.R import com.simplemobiletools.gallery.dialogs.ResizeDialog @@ -61,10 +62,10 @@ class EditActivity : SimpleActivity(), CropImageView.OnCropImageCompleteListener return } - saveUri = if (intent.extras?.containsKey(MediaStore.EXTRA_OUTPUT) == true) { - intent.extras!!.get(MediaStore.EXTRA_OUTPUT) as Uri - } else { - uri + saveUri = when { + intent.extras?.containsKey(REAL_FILE_PATH) == true -> Uri.fromFile(File(intent.extras.get(REAL_FILE_PATH) as String)) + intent.extras?.containsKey(MediaStore.EXTRA_OUTPUT) == true -> intent.extras!!.get(MediaStore.EXTRA_OUTPUT) as Uri + else -> uri } isCropIntent = intent.extras?.get(CROP) == "true" @@ -172,13 +173,15 @@ class EditActivity : SimpleActivity(), CropImageView.OnCropImageCompleteListener saveBitmapToFile(result.bitmap, it) } } else if (saveUri.scheme == "content") { - val newPath = applicationContext.getRealPathFromURI(saveUri) ?: "" - if (!newPath.isEmpty()) { - SaveAsDialog(this, newPath, true) { - saveBitmapToFile(result.bitmap, it) - } - } else { - toast(R.string.image_editing_failed) + var newPath = applicationContext.getRealPathFromURI(saveUri) ?: "" + var shouldAppendFilename = true + if (newPath.isEmpty()) { + newPath = "$internalStoragePath/${getCurrentFormattedDateTime()}.${saveUri.toString().getFilenameExtension()}" + shouldAppendFilename = false + } + + SaveAsDialog(this, newPath, shouldAppendFilename) { + saveBitmapToFile(result.bitmap, it) } } else { toast(R.string.unknown_file_location) @@ -209,11 +212,12 @@ class EditActivity : SimpleActivity(), CropImageView.OnCropImageCompleteListener } private fun saveBitmap(file: File, bitmap: Bitmap, out: OutputStream) { + toast(R.string.saving) if (resizeWidth > 0 && resizeHeight > 0) { val resized = Bitmap.createScaledBitmap(bitmap, resizeWidth, resizeHeight, false) - resized.compress(file.getCompressionFormat(), 90, out) + resized.compress(file.absolutePath.getCompressionFormat(), 90, out) } else { - bitmap.compress(file.getCompressionFormat(), 90, out) + bitmap.compress(file.absolutePath.getCompressionFormat(), 90, out) } setResult(Activity.RESULT_OK, intent) scanFinalPath(file.absolutePath) diff --git a/app/src/main/kotlin/com/simplemobiletools/gallery/activities/ViewPagerActivity.kt b/app/src/main/kotlin/com/simplemobiletools/gallery/activities/ViewPagerActivity.kt index 89e25594d..c5f9dfa70 100644 --- a/app/src/main/kotlin/com/simplemobiletools/gallery/activities/ViewPagerActivity.kt +++ b/app/src/main/kotlin/com/simplemobiletools/gallery/activities/ViewPagerActivity.kt @@ -587,7 +587,7 @@ class ViewPagerActivity : SimpleActivity(), ViewPager.OnPageChangeListener, View val matrix = Matrix() matrix.postRotate(mRotationDegrees) val bmp = Bitmap.createBitmap(bitmap, 0, 0, bitmap.width, bitmap.height, matrix, true) - bmp.compress(file.getCompressionFormat(), 90, out) + bmp.compress(file.absolutePath.getCompressionFormat(), 90, out) } private fun saveRotation(source: File, destination: File) { diff --git a/app/src/main/kotlin/com/simplemobiletools/gallery/dialogs/SaveAsDialog.kt b/app/src/main/kotlin/com/simplemobiletools/gallery/dialogs/SaveAsDialog.kt index 792ede406..201de45dd 100644 --- a/app/src/main/kotlin/com/simplemobiletools/gallery/dialogs/SaveAsDialog.kt +++ b/app/src/main/kotlin/com/simplemobiletools/gallery/dialogs/SaveAsDialog.kt @@ -13,7 +13,8 @@ import java.io.File class SaveAsDialog(val activity: BaseSimpleActivity, val path: String, val appendFilename: Boolean, val callback: (savePath: String) -> Unit) { init { - var realPath = File(path).parent.trimEnd('/') + var realPath = path.getParentPath().trimEnd('/') + val view = activity.layoutInflater.inflate(R.layout.dialog_save_as, null).apply { save_as_path.text = activity.humanizePath(realPath) From 83100a233091ba74d3f417fe4e6981801e879caf Mon Sep 17 00:00:00 2001 From: tibbi Date: Mon, 19 Feb 2018 21:15:05 +0100 Subject: [PATCH 16/71] properly handle real_file_path at opening videos --- .../simplemobiletools/gallery/activities/PhotoVideoActivity.kt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/src/main/kotlin/com/simplemobiletools/gallery/activities/PhotoVideoActivity.kt b/app/src/main/kotlin/com/simplemobiletools/gallery/activities/PhotoVideoActivity.kt index 1eee71390..1a67e6333 100644 --- a/app/src/main/kotlin/com/simplemobiletools/gallery/activities/PhotoVideoActivity.kt +++ b/app/src/main/kotlin/com/simplemobiletools/gallery/activities/PhotoVideoActivity.kt @@ -59,7 +59,7 @@ open class PhotoVideoActivity : SimpleActivity(), ViewPagerFragment.FragmentList private fun checkIntent(savedInstanceState: Bundle? = null) { mUri = intent.data ?: return if (intent.extras?.containsKey(REAL_FILE_PATH) == true) { - mUri = Uri.parse(intent.extras.get(REAL_FILE_PATH) as String) + mUri = Uri.fromFile(File(intent.extras.get(REAL_FILE_PATH) as String)) } mIsFromGallery = intent.getBooleanExtra(IS_FROM_GALLERY, false) From cc06109649c7c97f84c465eff4cf7882fa3bd0bd Mon Sep 17 00:00:00 2001 From: tibbi Date: Mon, 19 Feb 2018 22:37:02 +0100 Subject: [PATCH 17/71] adding a FAQ item about image quality --- app/src/main/res/values-ar/strings.xml | 2 ++ app/src/main/res/values-ca/strings.xml | 2 ++ app/src/main/res/values-cs/strings.xml | 2 ++ app/src/main/res/values-de/strings.xml | 2 ++ app/src/main/res/values-es/strings.xml | 2 ++ app/src/main/res/values-fi/strings.xml | 2 ++ app/src/main/res/values-fr/strings.xml | 2 ++ app/src/main/res/values-gl/strings.xml | 2 ++ app/src/main/res/values-hr/strings.xml | 2 ++ app/src/main/res/values-hu/strings.xml | 2 ++ app/src/main/res/values-it/strings.xml | 2 ++ app/src/main/res/values-ja/strings.xml | 2 ++ app/src/main/res/values-ko-rKR/strings.xml | 2 ++ app/src/main/res/values-nb/strings.xml | 2 ++ app/src/main/res/values-nl/strings.xml | 2 ++ app/src/main/res/values-pl/strings.xml | 2 ++ app/src/main/res/values-pt-rBR/strings.xml | 2 ++ app/src/main/res/values-pt/strings.xml | 2 ++ app/src/main/res/values-ru/strings.xml | 2 ++ app/src/main/res/values-sk/strings.xml | 2 ++ app/src/main/res/values-sv/strings.xml | 2 ++ app/src/main/res/values-tr/strings.xml | 2 ++ app/src/main/res/values-zh-rCN/strings.xml | 2 ++ app/src/main/res/values-zh-rTW/strings.xml | 2 ++ app/src/main/res/values/strings.xml | 2 ++ 25 files changed, 50 insertions(+) diff --git a/app/src/main/res/values-ar/strings.xml b/app/src/main/res/values-ar/strings.xml index 3001d290d..cabd543ff 100644 --- a/app/src/main/res/values-ar/strings.xml +++ b/app/src/main/res/values-ar/strings.xml @@ -166,6 +166,8 @@ What if I want just a few particular folders visible? Adding a folder at the Included Folders doesn\'t automatically exclude anything. What you can do is go in Settings -> Manage Excluded Folders, exclude the root folder \"/\", then add the desired folders at Settings -> Manage Included Folders. That will make only the selected folders visible, as both excluding and including are recursive and if a folder is both excluded and included, it will show up. + Fullscreen images have weird artifacts, can I somehow improve the quality? + Yea, there is a toggle in Settings saying \"Replace deep zoomable images with better quality ones\", you can use that. It will improve the quality of the images, but they will get blurred once you try zooming in too much. diff --git a/app/src/main/res/values-ca/strings.xml b/app/src/main/res/values-ca/strings.xml index 38bff8b37..950c6e4ea 100644 --- a/app/src/main/res/values-ca/strings.xml +++ b/app/src/main/res/values-ca/strings.xml @@ -162,6 +162,8 @@ What if I want just a few particular folders visible? Adding a folder at the Included Folders doesn\'t automatically exclude anything. What you can do is go in Settings -> Manage Excluded Folders, exclude the root folder \"/\", then add the desired folders at Settings -> Manage Included Folders. That will make only the selected folders visible, as both excluding and including are recursive and if a folder is both excluded and included, it will show up. + Fullscreen images have weird artifacts, can I somehow improve the quality? + Yea, there is a toggle in Settings saying \"Replace deep zoomable images with better quality ones\", you can use that. It will improve the quality of the images, but they will get blurred once you try zooming in too much. diff --git a/app/src/main/res/values-cs/strings.xml b/app/src/main/res/values-cs/strings.xml index a8b529767..bf5510018 100644 --- a/app/src/main/res/values-cs/strings.xml +++ b/app/src/main/res/values-cs/strings.xml @@ -162,6 +162,8 @@ What if I want just a few particular folders visible? Adding a folder at the Included Folders doesn\'t automatically exclude anything. What you can do is go in Settings -> Manage Excluded Folders, exclude the root folder \"/\", then add the desired folders at Settings -> Manage Included Folders. That will make only the selected folders visible, as both excluding and including are recursive and if a folder is both excluded and included, it will show up. + Fullscreen images have weird artifacts, can I somehow improve the quality? + Yea, there is a toggle in Settings saying \"Replace deep zoomable images with better quality ones\", you can use that. It will improve the quality of the images, but they will get blurred once you try zooming in too much. diff --git a/app/src/main/res/values-de/strings.xml b/app/src/main/res/values-de/strings.xml index 62c6e4fa5..49cdc556d 100644 --- a/app/src/main/res/values-de/strings.xml +++ b/app/src/main/res/values-de/strings.xml @@ -162,6 +162,8 @@ What if I want just a few particular folders visible? Adding a folder at the Included Folders doesn\'t automatically exclude anything. What you can do is go in Settings -> Manage Excluded Folders, exclude the root folder \"/\", then add the desired folders at Settings -> Manage Included Folders. That will make only the selected folders visible, as both excluding and including are recursive and if a folder is both excluded and included, it will show up. + Fullscreen images have weird artifacts, can I somehow improve the quality? + Yea, there is a toggle in Settings saying \"Replace deep zoomable images with better quality ones\", you can use that. It will improve the quality of the images, but they will get blurred once you try zooming in too much. diff --git a/app/src/main/res/values-es/strings.xml b/app/src/main/res/values-es/strings.xml index a00ae0484..b0b4632cb 100644 --- a/app/src/main/res/values-es/strings.xml +++ b/app/src/main/res/values-es/strings.xml @@ -162,6 +162,8 @@ What if I want just a few particular folders visible? Adding a folder at the Included Folders doesn\'t automatically exclude anything. What you can do is go in Settings -> Manage Excluded Folders, exclude the root folder \"/\", then add the desired folders at Settings -> Manage Included Folders. That will make only the selected folders visible, as both excluding and including are recursive and if a folder is both excluded and included, it will show up. + Fullscreen images have weird artifacts, can I somehow improve the quality? + Yea, there is a toggle in Settings saying \"Replace deep zoomable images with better quality ones\", you can use that. It will improve the quality of the images, but they will get blurred once you try zooming in too much. diff --git a/app/src/main/res/values-fi/strings.xml b/app/src/main/res/values-fi/strings.xml index be0841e1f..f16ada23f 100644 --- a/app/src/main/res/values-fi/strings.xml +++ b/app/src/main/res/values-fi/strings.xml @@ -162,6 +162,8 @@ What if I want just a few particular folders visible? Adding a folder at the Included Folders doesn\'t automatically exclude anything. What you can do is go in Settings -> Manage Excluded Folders, exclude the root folder \"/\", then add the desired folders at Settings -> Manage Included Folders. That will make only the selected folders visible, as both excluding and including are recursive and if a folder is both excluded and included, it will show up. + Fullscreen images have weird artifacts, can I somehow improve the quality? + Yea, there is a toggle in Settings saying \"Replace deep zoomable images with better quality ones\", you can use that. It will improve the quality of the images, but they will get blurred once you try zooming in too much. diff --git a/app/src/main/res/values-fr/strings.xml b/app/src/main/res/values-fr/strings.xml index aa2e411c9..b2c0f3a59 100644 --- a/app/src/main/res/values-fr/strings.xml +++ b/app/src/main/res/values-fr/strings.xml @@ -162,6 +162,8 @@ What if I want just a few particular folders visible? Adding a folder at the Included Folders doesn\'t automatically exclude anything. What you can do is go in Settings -> Manage Excluded Folders, exclude the root folder \"/\", then add the desired folders at Settings -> Manage Included Folders. That will make only the selected folders visible, as both excluding and including are recursive and if a folder is both excluded and included, it will show up. + Fullscreen images have weird artifacts, can I somehow improve the quality? + Yea, there is a toggle in Settings saying \"Replace deep zoomable images with better quality ones\", you can use that. It will improve the quality of the images, but they will get blurred once you try zooming in too much. diff --git a/app/src/main/res/values-gl/strings.xml b/app/src/main/res/values-gl/strings.xml index 9ea956825..4d71563d8 100644 --- a/app/src/main/res/values-gl/strings.xml +++ b/app/src/main/res/values-gl/strings.xml @@ -162,6 +162,8 @@ What if I want just a few particular folders visible? Adding a folder at the Included Folders doesn\'t automatically exclude anything. What you can do is go in Settings -> Manage Excluded Folders, exclude the root folder \"/\", then add the desired folders at Settings -> Manage Included Folders. That will make only the selected folders visible, as both excluding and including are recursive and if a folder is both excluded and included, it will show up. + Fullscreen images have weird artifacts, can I somehow improve the quality? + Yea, there is a toggle in Settings saying \"Replace deep zoomable images with better quality ones\", you can use that. It will improve the quality of the images, but they will get blurred once you try zooming in too much. diff --git a/app/src/main/res/values-hr/strings.xml b/app/src/main/res/values-hr/strings.xml index 13d80f62c..5b3ff3fb8 100644 --- a/app/src/main/res/values-hr/strings.xml +++ b/app/src/main/res/values-hr/strings.xml @@ -162,6 +162,8 @@ What if I want just a few particular folders visible? Adding a folder at the Included Folders doesn\'t automatically exclude anything. What you can do is go in Settings -> Manage Excluded Folders, exclude the root folder \"/\", then add the desired folders at Settings -> Manage Included Folders. That will make only the selected folders visible, as both excluding and including are recursive and if a folder is both excluded and included, it will show up. + Fullscreen images have weird artifacts, can I somehow improve the quality? + Yea, there is a toggle in Settings saying \"Replace deep zoomable images with better quality ones\", you can use that. It will improve the quality of the images, but they will get blurred once you try zooming in too much. diff --git a/app/src/main/res/values-hu/strings.xml b/app/src/main/res/values-hu/strings.xml index 1063aeb86..946385bfa 100644 --- a/app/src/main/res/values-hu/strings.xml +++ b/app/src/main/res/values-hu/strings.xml @@ -162,6 +162,8 @@ What if I want just a few particular folders visible? Adding a folder at the Included Folders doesn\'t automatically exclude anything. What you can do is go in Settings -> Manage Excluded Folders, exclude the root folder \"/\", then add the desired folders at Settings -> Manage Included Folders. That will make only the selected folders visible, as both excluding and including are recursive and if a folder is both excluded and included, it will show up. + Fullscreen images have weird artifacts, can I somehow improve the quality? + Yea, there is a toggle in Settings saying \"Replace deep zoomable images with better quality ones\", you can use that. It will improve the quality of the images, but they will get blurred once you try zooming in too much. diff --git a/app/src/main/res/values-it/strings.xml b/app/src/main/res/values-it/strings.xml index 91ead8f87..e2bf44d15 100644 --- a/app/src/main/res/values-it/strings.xml +++ b/app/src/main/res/values-it/strings.xml @@ -162,6 +162,8 @@ What if I want just a few particular folders visible? Adding a folder at the Included Folders doesn\'t automatically exclude anything. What you can do is go in Settings -> Manage Excluded Folders, exclude the root folder \"/\", then add the desired folders at Settings -> Manage Included Folders. That will make only the selected folders visible, as both excluding and including are recursive and if a folder is both excluded and included, it will show up. + Fullscreen images have weird artifacts, can I somehow improve the quality? + Yea, there is a toggle in Settings saying \"Replace deep zoomable images with better quality ones\", you can use that. It will improve the quality of the images, but they will get blurred once you try zooming in too much. diff --git a/app/src/main/res/values-ja/strings.xml b/app/src/main/res/values-ja/strings.xml index 482bf6016..3f21d49a0 100644 --- a/app/src/main/res/values-ja/strings.xml +++ b/app/src/main/res/values-ja/strings.xml @@ -162,6 +162,8 @@ What if I want just a few particular folders visible? Adding a folder at the Included Folders doesn\'t automatically exclude anything. What you can do is go in Settings -> Manage Excluded Folders, exclude the root folder \"/\", then add the desired folders at Settings -> Manage Included Folders. That will make only the selected folders visible, as both excluding and including are recursive and if a folder is both excluded and included, it will show up. + Fullscreen images have weird artifacts, can I somehow improve the quality? + Yea, there is a toggle in Settings saying \"Replace deep zoomable images with better quality ones\", you can use that. It will improve the quality of the images, but they will get blurred once you try zooming in too much. diff --git a/app/src/main/res/values-ko-rKR/strings.xml b/app/src/main/res/values-ko-rKR/strings.xml index 0b5d9d254..1f0b79242 100644 --- a/app/src/main/res/values-ko-rKR/strings.xml +++ b/app/src/main/res/values-ko-rKR/strings.xml @@ -162,6 +162,8 @@ What if I want just a few particular folders visible? Adding a folder at the Included Folders doesn\'t automatically exclude anything. What you can do is go in Settings -> Manage Excluded Folders, exclude the root folder \"/\", then add the desired folders at Settings -> Manage Included Folders. That will make only the selected folders visible, as both excluding and including are recursive and if a folder is both excluded and included, it will show up. + Fullscreen images have weird artifacts, can I somehow improve the quality? + Yea, there is a toggle in Settings saying \"Replace deep zoomable images with better quality ones\", you can use that. It will improve the quality of the images, but they will get blurred once you try zooming in too much. diff --git a/app/src/main/res/values-nb/strings.xml b/app/src/main/res/values-nb/strings.xml index 5f3c66456..f0145b3b4 100644 --- a/app/src/main/res/values-nb/strings.xml +++ b/app/src/main/res/values-nb/strings.xml @@ -162,6 +162,8 @@ What if I want just a few particular folders visible? Adding a folder at the Included Folders doesn\'t automatically exclude anything. What you can do is go in Settings -> Manage Excluded Folders, exclude the root folder \"/\", then add the desired folders at Settings -> Manage Included Folders. That will make only the selected folders visible, as both excluding and including are recursive and if a folder is both excluded and included, it will show up. + Fullscreen images have weird artifacts, can I somehow improve the quality? + Yea, there is a toggle in Settings saying \"Replace deep zoomable images with better quality ones\", you can use that. It will improve the quality of the images, but they will get blurred once you try zooming in too much. diff --git a/app/src/main/res/values-nl/strings.xml b/app/src/main/res/values-nl/strings.xml index 58290dd2c..fd1179b37 100644 --- a/app/src/main/res/values-nl/strings.xml +++ b/app/src/main/res/values-nl/strings.xml @@ -162,6 +162,8 @@ What if I want just a few particular folders visible? Adding a folder at the Included Folders doesn\'t automatically exclude anything. What you can do is go in Settings -> Manage Excluded Folders, exclude the root folder \"/\", then add the desired folders at Settings -> Manage Included Folders. That will make only the selected folders visible, as both excluding and including are recursive and if a folder is both excluded and included, it will show up. + Fullscreen images have weird artifacts, can I somehow improve the quality? + Yea, there is a toggle in Settings saying \"Replace deep zoomable images with better quality ones\", you can use that. It will improve the quality of the images, but they will get blurred once you try zooming in too much. diff --git a/app/src/main/res/values-pl/strings.xml b/app/src/main/res/values-pl/strings.xml index 5a0ece732..1b285bf3a 100644 --- a/app/src/main/res/values-pl/strings.xml +++ b/app/src/main/res/values-pl/strings.xml @@ -160,6 +160,8 @@    Wejdź do ustawień aplikacji i w sekcji z dołączonymi folderami dodaj tenże folder do listy.    Co jeśli chcę widzieć tylko.wybrane foldery?    Przejdź do sekcji z wykluczonymi folderami w ustawieniach aplikacji, dodaj tam folder główny (\"/\"), a następnie dodaj pożądane foldery w sekcji z dołączonymi folderami. + Fullscreen images have weird artifacts, can I somehow improve the quality? + Yea, there is a toggle in Settings saying \"Replace deep zoomable images with better quality ones\", you can use that. It will improve the quality of the images, but they will get blurred once you try zooming in too much. diff --git a/app/src/main/res/values-pt-rBR/strings.xml b/app/src/main/res/values-pt-rBR/strings.xml index 31771ec6f..7141eecbb 100644 --- a/app/src/main/res/values-pt-rBR/strings.xml +++ b/app/src/main/res/values-pt-rBR/strings.xml @@ -162,6 +162,8 @@ What if I want just a few particular folders visible? Adding a folder at the Included Folders doesn\'t automatically exclude anything. What you can do is go in Settings -> Manage Excluded Folders, exclude the root folder \"/\", then add the desired folders at Settings -> Manage Included Folders. That will make only the selected folders visible, as both excluding and including are recursive and if a folder is both excluded and included, it will show up. + Fullscreen images have weird artifacts, can I somehow improve the quality? + Yea, there is a toggle in Settings saying \"Replace deep zoomable images with better quality ones\", you can use that. It will improve the quality of the images, but they will get blurred once you try zooming in too much. diff --git a/app/src/main/res/values-pt/strings.xml b/app/src/main/res/values-pt/strings.xml index 8bd412cdb..35979003c 100644 --- a/app/src/main/res/values-pt/strings.xml +++ b/app/src/main/res/values-pt/strings.xml @@ -162,6 +162,8 @@ What if I want just a few particular folders visible? Adding a folder at the Included Folders doesn\'t automatically exclude anything. What you can do is go in Settings -> Manage Excluded Folders, exclude the root folder \"/\", then add the desired folders at Settings -> Manage Included Folders. That will make only the selected folders visible, as both excluding and including are recursive and if a folder is both excluded and included, it will show up. + Fullscreen images have weird artifacts, can I somehow improve the quality? + Yea, there is a toggle in Settings saying \"Replace deep zoomable images with better quality ones\", you can use that. It will improve the quality of the images, but they will get blurred once you try zooming in too much. diff --git a/app/src/main/res/values-ru/strings.xml b/app/src/main/res/values-ru/strings.xml index 4081630dd..f7cd378f5 100644 --- a/app/src/main/res/values-ru/strings.xml +++ b/app/src/main/res/values-ru/strings.xml @@ -162,6 +162,8 @@ What if I want just a few particular folders visible? Adding a folder at the Included Folders doesn\'t automatically exclude anything. What you can do is go in Settings -> Manage Excluded Folders, exclude the root folder \"/\", then add the desired folders at Settings -> Manage Included Folders. That will make only the selected folders visible, as both excluding and including are recursive and if a folder is both excluded and included, it will show up. + Fullscreen images have weird artifacts, can I somehow improve the quality? + Yea, there is a toggle in Settings saying \"Replace deep zoomable images with better quality ones\", you can use that. It will improve the quality of the images, but they will get blurred once you try zooming in too much. diff --git a/app/src/main/res/values-sk/strings.xml b/app/src/main/res/values-sk/strings.xml index 870d97b9c..469dcfa1e 100644 --- a/app/src/main/res/values-sk/strings.xml +++ b/app/src/main/res/values-sk/strings.xml @@ -162,6 +162,8 @@ Čo v prípade, ak chcem mať zobrazených iba pár priečinkov? Pridanie priečinka medzi Pridané Priečinky automaticky nevylúči ostatné. Môžete ale ísť do Nastavenia -> Spravovať vylúčené priečinky a zvoliť Koreňový priečinok \"/\", následne pridať žiadané priečinky v Nastavenia -> Spravovať pridané priečinky. To spôsobí, že budú zobrazené iba vyžiadané priečinky, keďže aj vylúčenie, aj pridanie fungujú rekurzívne a ak je priečinok vylúčený, aj pridaný, bude viditeľný. + Fotky na celú obrazovku majú zhoršenú kvalitu, viem ju nejak zlepšiť? + Áno, v nastaveniach je prepínač s textom \"Nahradiť hlboko priblížiteľné obrázky s obrázkami s lepšou kvalitou\", môžete ho skúsiť. Spôsobí to vyššiu kvalitu obrázkov, po priblížení sa ale budú rozmazávať oveľa skôr. diff --git a/app/src/main/res/values-sv/strings.xml b/app/src/main/res/values-sv/strings.xml index 537dd513b..ccc80b3b9 100644 --- a/app/src/main/res/values-sv/strings.xml +++ b/app/src/main/res/values-sv/strings.xml @@ -162,6 +162,8 @@ What if I want just a few particular folders visible? Adding a folder at the Included Folders doesn\'t automatically exclude anything. What you can do is go in Settings -> Manage Excluded Folders, exclude the root folder \"/\", then add the desired folders at Settings -> Manage Included Folders. That will make only the selected folders visible, as both excluding and including are recursive and if a folder is both excluded and included, it will show up. + Fullscreen images have weird artifacts, can I somehow improve the quality? + Yea, there is a toggle in Settings saying \"Replace deep zoomable images with better quality ones\", you can use that. It will improve the quality of the images, but they will get blurred once you try zooming in too much. diff --git a/app/src/main/res/values-tr/strings.xml b/app/src/main/res/values-tr/strings.xml index 1519848b2..fd4101be4 100644 --- a/app/src/main/res/values-tr/strings.xml +++ b/app/src/main/res/values-tr/strings.xml @@ -162,6 +162,8 @@ What if I want just a few particular folders visible? Adding a folder at the Included Folders doesn\'t automatically exclude anything. What you can do is go in Settings -> Manage Excluded Folders, exclude the root folder \"/\", then add the desired folders at Settings -> Manage Included Folders. That will make only the selected folders visible, as both excluding and including are recursive and if a folder is both excluded and included, it will show up. + Fullscreen images have weird artifacts, can I somehow improve the quality? + Yea, there is a toggle in Settings saying \"Replace deep zoomable images with better quality ones\", you can use that. It will improve the quality of the images, but they will get blurred once you try zooming in too much. diff --git a/app/src/main/res/values-zh-rCN/strings.xml b/app/src/main/res/values-zh-rCN/strings.xml index 09d2ea1c2..7325a9610 100644 --- a/app/src/main/res/values-zh-rCN/strings.xml +++ b/app/src/main/res/values-zh-rCN/strings.xml @@ -162,6 +162,8 @@ What if I want just a few particular folders visible? Adding a folder at the Included Folders doesn\'t automatically exclude anything. What you can do is go in Settings -> Manage Excluded Folders, exclude the root folder \"/\", then add the desired folders at Settings -> Manage Included Folders. That will make only the selected folders visible, as both excluding and including are recursive and if a folder is both excluded and included, it will show up. + Fullscreen images have weird artifacts, can I somehow improve the quality? + Yea, there is a toggle in Settings saying \"Replace deep zoomable images with better quality ones\", you can use that. It will improve the quality of the images, but they will get blurred once you try zooming in too much. diff --git a/app/src/main/res/values-zh-rTW/strings.xml b/app/src/main/res/values-zh-rTW/strings.xml index 89bbf4182..369a9def6 100644 --- a/app/src/main/res/values-zh-rTW/strings.xml +++ b/app/src/main/res/values-zh-rTW/strings.xml @@ -162,6 +162,8 @@ 如果我只想看到幾個特定的資料夾,怎麼做? 在[包含資料夾]內添加資料夾並不會自動排除任何東西。你能做的是到[設定] -> [管理排除資料夾],排除根目錄 \"/\",然後在[設定] -> [管理包含資料夾]添加想要的資料夾。 那樣的話就只有選擇的資料夾可見。因為排除和包含都是遞迴的,如果一個資料夾被排除又被包含,則會顯示出來。 + Fullscreen images have weird artifacts, can I somehow improve the quality? + Yea, there is a toggle in Settings saying \"Replace deep zoomable images with better quality ones\", you can use that. It will improve the quality of the images, but they will get blurred once you try zooming in too much. diff --git a/app/src/main/res/values/strings.xml b/app/src/main/res/values/strings.xml index def375277..777a359b9 100644 --- a/app/src/main/res/values/strings.xml +++ b/app/src/main/res/values/strings.xml @@ -162,6 +162,8 @@ What if I want just a few particular folders visible? Adding a folder at the Included Folders doesn\'t automatically exclude anything. What you can do is go in Settings -> Manage Excluded Folders, exclude the root folder \"/\", then add the desired folders at Settings -> Manage Included Folders. That will make only the selected folders visible, as both excluding and including are recursive and if a folder is both excluded and included, it will show up. + Fullscreen images have weird artifacts, can I somehow improve the quality? + Yea, there is a toggle in Settings saying \"Replace deep zoomable images with better quality ones\", you can use that. It will improve the quality of the images, but they will get blurred once you try zooming in too much. From 2083865c98b2b351c599c7bf407f2baf17df950b Mon Sep 17 00:00:00 2001 From: tibbi Date: Mon, 19 Feb 2018 23:09:49 +0100 Subject: [PATCH 18/71] do not modify real_file_path if it points to an OTG device --- .../simplemobiletools/gallery/activities/EditActivity.kt | 9 ++++++++- .../gallery/activities/PhotoVideoActivity.kt | 5 ++++- .../simplemobiletools/gallery/adapters/MediaAdapter.kt | 3 --- .../simplemobiletools/gallery/helpers/MediaFetcher.kt | 2 +- 4 files changed, 13 insertions(+), 6 deletions(-) diff --git a/app/src/main/kotlin/com/simplemobiletools/gallery/activities/EditActivity.kt b/app/src/main/kotlin/com/simplemobiletools/gallery/activities/EditActivity.kt index 70265732b..bfda0f48c 100644 --- a/app/src/main/kotlin/com/simplemobiletools/gallery/activities/EditActivity.kt +++ b/app/src/main/kotlin/com/simplemobiletools/gallery/activities/EditActivity.kt @@ -63,7 +63,14 @@ class EditActivity : SimpleActivity(), CropImageView.OnCropImageCompleteListener } saveUri = when { - intent.extras?.containsKey(REAL_FILE_PATH) == true -> Uri.fromFile(File(intent.extras.get(REAL_FILE_PATH) as String)) + intent.extras?.containsKey(REAL_FILE_PATH) == true -> { + val realPath = intent.extras.get(REAL_FILE_PATH) as String + if (isPathOnOTG(realPath)) { + Uri.parse(realPath) + } else { + Uri.fromFile(File(realPath)) + } + } intent.extras?.containsKey(MediaStore.EXTRA_OUTPUT) == true -> intent.extras!!.get(MediaStore.EXTRA_OUTPUT) as Uri else -> uri } diff --git a/app/src/main/kotlin/com/simplemobiletools/gallery/activities/PhotoVideoActivity.kt b/app/src/main/kotlin/com/simplemobiletools/gallery/activities/PhotoVideoActivity.kt index 1a67e6333..3305f0086 100644 --- a/app/src/main/kotlin/com/simplemobiletools/gallery/activities/PhotoVideoActivity.kt +++ b/app/src/main/kotlin/com/simplemobiletools/gallery/activities/PhotoVideoActivity.kt @@ -59,7 +59,10 @@ open class PhotoVideoActivity : SimpleActivity(), ViewPagerFragment.FragmentList private fun checkIntent(savedInstanceState: Bundle? = null) { mUri = intent.data ?: return if (intent.extras?.containsKey(REAL_FILE_PATH) == true) { - mUri = Uri.fromFile(File(intent.extras.get(REAL_FILE_PATH) as String)) + val realPath = intent.extras.get(REAL_FILE_PATH) as String + if (!isPathOnOTG(realPath)) { + mUri = Uri.fromFile(File(realPath)) + } } mIsFromGallery = intent.getBooleanExtra(IS_FROM_GALLERY, false) diff --git a/app/src/main/kotlin/com/simplemobiletools/gallery/adapters/MediaAdapter.kt b/app/src/main/kotlin/com/simplemobiletools/gallery/adapters/MediaAdapter.kt index fc07bcca2..55b9269bc 100644 --- a/app/src/main/kotlin/com/simplemobiletools/gallery/adapters/MediaAdapter.kt +++ b/app/src/main/kotlin/com/simplemobiletools/gallery/adapters/MediaAdapter.kt @@ -23,7 +23,6 @@ import com.simplemobiletools.gallery.extensions.* import com.simplemobiletools.gallery.helpers.VIEW_TYPE_LIST import com.simplemobiletools.gallery.models.Medium import kotlinx.android.synthetic.main.photo_video_item_grid.view.* -import java.io.File class MediaAdapter(activity: BaseSimpleActivity, var media: MutableList, val listener: MediaOperationsListener?, val isAGetIntent: Boolean, val allowMultiplePicks: Boolean, recyclerView: MyRecyclerView, fastScroller: FastScroller? = null, @@ -217,8 +216,6 @@ class MediaAdapter(activity: BaseSimpleActivity, var media: MutableList, private fun getCurrentPath() = media[selectedPositions.first()].path - private fun getCurrentFile() = File(getCurrentPath()) - private fun deleteFiles() { val fileDirItems = ArrayList(selectedPositions.size) val removeMedia = ArrayList(selectedPositions.size) diff --git a/app/src/main/kotlin/com/simplemobiletools/gallery/helpers/MediaFetcher.kt b/app/src/main/kotlin/com/simplemobiletools/gallery/helpers/MediaFetcher.kt index 3621bb8b6..719d96721 100644 --- a/app/src/main/kotlin/com/simplemobiletools/gallery/helpers/MediaFetcher.kt +++ b/app/src/main/kotlin/com/simplemobiletools/gallery/helpers/MediaFetcher.kt @@ -217,7 +217,7 @@ class MediaFetcher(val context: Context) { if (directories.containsKey(parentDir)) { directories[parentDir]!!.add(medium) } else { - directories.put(parentDir, arrayListOf(medium)) + directories[parentDir] = arrayListOf(medium) } } return directories From 6f84478bfa1dedb149548d80b828e821f92db331 Mon Sep 17 00:00:00 2001 From: tibbi Date: Mon, 19 Feb 2018 23:10:01 +0100 Subject: [PATCH 19/71] update commons to 3.12.11 --- app/build.gradle | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/build.gradle b/app/build.gradle index b4d27725e..d535e90f5 100644 --- a/app/build.gradle +++ b/app/build.gradle @@ -46,7 +46,7 @@ ext { } dependencies { - implementation 'com.simplemobiletools:commons:3.12.7' + implementation 'com.simplemobiletools:commons:3.12.11' implementation 'com.theartofdev.edmodo:android-image-cropper:2.6.0' implementation 'com.android.support:multidex:1.0.2' implementation 'com.google.code.gson:gson:2.8.2' From 93ba5d67de61f4979db3502edfbbb74adc69ec8a Mon Sep 17 00:00:00 2001 From: tibbi Date: Mon, 19 Feb 2018 23:25:29 +0100 Subject: [PATCH 20/71] fetch latest media ID at creating the app to avoid duplicate refreshing --- .../gallery/activities/MainActivity.kt | 11 ++++++++--- .../simplemobiletools/gallery/helpers/MediaFetcher.kt | 3 ++- 2 files changed, 10 insertions(+), 4 deletions(-) diff --git a/app/src/main/kotlin/com/simplemobiletools/gallery/activities/MainActivity.kt b/app/src/main/kotlin/com/simplemobiletools/gallery/activities/MainActivity.kt index e3361fff0..3fabb044d 100644 --- a/app/src/main/kotlin/com/simplemobiletools/gallery/activities/MainActivity.kt +++ b/app/src/main/kotlin/com/simplemobiletools/gallery/activities/MainActivity.kt @@ -96,6 +96,7 @@ class MainActivity : SimpleActivity(), DirectoryAdapter.DirOperationsListener { } mIsPasswordProtectionPending = config.appPasswordProtectionOn + setupLatestMediaId() } override fun onStart() { @@ -553,9 +554,7 @@ class MainActivity : SimpleActivity(), DirectoryAdapter.DirOperationsListener { private fun gotDirectories(newDirs: ArrayList, isFromCache: Boolean) { if (!isFromCache) { - Thread { - mLatestMediaId = getLatestMediaId() - }.start() + setupLatestMediaId() } val dirs = getSortedDirectories(newDirs) @@ -633,6 +632,12 @@ class MainActivity : SimpleActivity(), DirectoryAdapter.DirOperationsListener { private fun getBubbleTextItem(index: Int) = getRecyclerAdapter().dirs.getOrNull(index)?.getBubbleText() ?: "" + private fun setupLatestMediaId() { + Thread { + mLatestMediaId = getLatestMediaId() + }.start() + } + private fun checkLastMediaChanged() { if (isActivityDestroyed()) return diff --git a/app/src/main/kotlin/com/simplemobiletools/gallery/helpers/MediaFetcher.kt b/app/src/main/kotlin/com/simplemobiletools/gallery/helpers/MediaFetcher.kt index 719d96721..adb3702e1 100644 --- a/app/src/main/kotlin/com/simplemobiletools/gallery/helpers/MediaFetcher.kt +++ b/app/src/main/kotlin/com/simplemobiletools/gallery/helpers/MediaFetcher.kt @@ -113,8 +113,9 @@ class MediaFetcher(val context: Context) { private fun getSelectionArgsQuery(path: String): Array? { return if (path.isEmpty()) { - if (context.isAndroidFour()) + if (context.isAndroidFour()) { return null + } if (context.hasExternalSDCard()) { arrayOf("${context.internalStoragePath}/%", "${context.sdCardPath}/%") From a8e87bafcc896df4154e7497886d04ad3b4ba51f Mon Sep 17 00:00:00 2001 From: tibbi Date: Tue, 20 Feb 2018 00:17:06 +0100 Subject: [PATCH 21/71] properly scan OTG folders if manually included --- .../asynctasks/GetDirectoriesAsynctask.kt | 6 +- .../gallery/helpers/MediaFetcher.kt | 67 ++++++++++++++++--- 2 files changed, 64 insertions(+), 9 deletions(-) diff --git a/app/src/main/kotlin/com/simplemobiletools/gallery/asynctasks/GetDirectoriesAsynctask.kt b/app/src/main/kotlin/com/simplemobiletools/gallery/asynctasks/GetDirectoriesAsynctask.kt index b6c6bae21..0869a976d 100644 --- a/app/src/main/kotlin/com/simplemobiletools/gallery/asynctasks/GetDirectoriesAsynctask.kt +++ b/app/src/main/kotlin/com/simplemobiletools/gallery/asynctasks/GetDirectoriesAsynctask.kt @@ -3,6 +3,7 @@ package com.simplemobiletools.gallery.asynctasks import android.content.Context import android.os.AsyncTask import com.simplemobiletools.commons.extensions.* +import com.simplemobiletools.commons.helpers.OTG_PATH import com.simplemobiletools.commons.helpers.PERMISSION_WRITE_STORAGE import com.simplemobiletools.commons.helpers.SORT_DESCENDING import com.simplemobiletools.gallery.R @@ -28,13 +29,15 @@ class GetDirectoriesAsynctask(val context: Context, val isPickVideo: Boolean, va val directories = ArrayList() val hidden = context.resources.getString(R.string.hidden) val albumCovers = config.parseAlbumCovers() + val hasOTG = context.hasOTGConnected() && context.config.OTGBasePath.isNotEmpty() + for ((path, curMedia) in groupedMedia) { Medium.sorting = config.getFileSorting(path) curMedia.sort() val firstItem = curMedia.first() val lastItem = curMedia.last() - val parentDir = File(firstItem.path).parent + val parentDir = if (hasOTG && context.isPathOnOTG(firstItem.path)) firstItem.path.getParentPath() else File(firstItem.path).parent var thumbnail = firstItem.path albumCovers.forEach { if (it.path == parentDir && File(it.tmb).exists()) { @@ -45,6 +48,7 @@ class GetDirectoriesAsynctask(val context: Context, val isPickVideo: Boolean, va var dirName = when (parentDir) { context.internalStoragePath -> context.getString(R.string.internal) context.sdCardPath -> context.getString(R.string.sd_card) + OTG_PATH -> context.getString(R.string.otg) else -> parentDir.getFilenameFromPath() } diff --git a/app/src/main/kotlin/com/simplemobiletools/gallery/helpers/MediaFetcher.kt b/app/src/main/kotlin/com/simplemobiletools/gallery/helpers/MediaFetcher.kt index adb3702e1..b89a58565 100644 --- a/app/src/main/kotlin/com/simplemobiletools/gallery/helpers/MediaFetcher.kt +++ b/app/src/main/kotlin/com/simplemobiletools/gallery/helpers/MediaFetcher.kt @@ -4,10 +4,7 @@ import android.content.Context import android.database.Cursor import android.provider.MediaStore import com.simplemobiletools.commons.extensions.* -import com.simplemobiletools.commons.helpers.SORT_BY_DATE_MODIFIED -import com.simplemobiletools.commons.helpers.SORT_BY_NAME -import com.simplemobiletools.commons.helpers.SORT_BY_SIZE -import com.simplemobiletools.commons.helpers.SORT_DESCENDING +import com.simplemobiletools.commons.helpers.* import com.simplemobiletools.gallery.extensions.config import com.simplemobiletools.gallery.extensions.containsNoMedia import com.simplemobiletools.gallery.models.Medium @@ -195,7 +192,11 @@ class MediaFetcher(val context: Context) { } config.includedFolders.filter { it.isNotEmpty() && (curPath.isEmpty() || it == curPath) }.forEach { - getMediaInFolder(it, curMedia, isPickImage, isPickVideo, filterMedia) + if (context.isPathOnOTG(it)) { + getMediaOnOTG(it, curMedia, isPickImage, isPickVideo, filterMedia) + } else { + getMediaInFolder(it, curMedia, isPickImage, isPickVideo, filterMedia) + } } if (isThirdPartyIntent && curPath.isNotEmpty() && curMedia.isEmpty()) { @@ -210,11 +211,14 @@ class MediaFetcher(val context: Context) { private fun groupDirectories(media: ArrayList): HashMap> { val directories = LinkedHashMap>() + val hasOTG = context.hasOTGConnected() && context.config.OTGBasePath.isNotEmpty() for (medium in media) { - if (shouldStop) + if (shouldStop) { break + } - val parentDir = File(medium.path).parent?.toLowerCase() ?: continue + val parentDir = (if (hasOTG && medium.path.startsWith(OTG_PATH)) medium.path.getParentPath().toLowerCase() else File(medium.path).parent?.toLowerCase()) + ?: continue if (directories.containsKey(parentDir)) { directories[parentDir]!!.add(medium) } else { @@ -260,8 +264,9 @@ class MediaFetcher(val context: Context) { private fun getMediaInFolder(folder: String, curMedia: ArrayList, isPickImage: Boolean, isPickVideo: Boolean, filterMedia: Int) { val files = File(folder).listFiles() ?: return for (file in files) { - if (shouldStop) + if (shouldStop) { break + } val filename = file.name val isImage = filename.isImageFast() @@ -302,6 +307,52 @@ class MediaFetcher(val context: Context) { } } + private fun getMediaOnOTG(folder: String, curMedia: ArrayList, isPickImage: Boolean, isPickVideo: Boolean, filterMedia: Int) { + val files = context.getDocumentFile(folder)?.listFiles() ?: return + for (file in files) { + if (shouldStop) { + return + } + + val filename = file.name + val isImage = filename.isImageFast() + val isVideo = if (isImage) false else filename.isVideoFast() + val isGif = if (isImage || isVideo) false else filename.isGif() + + if (!isImage && !isVideo && !isGif) + continue + + if (isVideo && (isPickImage || filterMedia and VIDEOS == 0)) + continue + + if (isImage && (isPickVideo || filterMedia and IMAGES == 0)) + continue + + if (isGif && filterMedia and GIFS == 0) + continue + + val size = file.length() + if (size <= 0L && !file.exists()) + continue + + val dateTaken = file.lastModified() + val dateModified = file.lastModified() + + val type = when { + isImage -> TYPE_IMAGE + isVideo -> TYPE_VIDEO + else -> TYPE_GIF + } + + val path = file.uri.toString().replaceFirst("${context.config.OTGBasePath}%3A", OTG_PATH) + val medium = Medium(filename, path, dateModified, dateTaken, size, type) + val isAlreadyAdded = curMedia.any { it.path == path } + if (!isAlreadyAdded) { + curMedia.add(medium) + } + } + } + private fun getSortingForFolder(path: String): String { val sorting = context.config.getFileSorting(path) val sortValue = when { From 0419ef90a71f686cda3cc9509e766bfaefa6416b Mon Sep 17 00:00:00 2001 From: tibbi Date: Tue, 20 Feb 2018 10:46:41 +0100 Subject: [PATCH 22/71] make folder Inclusion really recursive --- .../com/simplemobiletools/gallery/helpers/MediaFetcher.kt | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/app/src/main/kotlin/com/simplemobiletools/gallery/helpers/MediaFetcher.kt b/app/src/main/kotlin/com/simplemobiletools/gallery/helpers/MediaFetcher.kt index b89a58565..46c4e30e1 100644 --- a/app/src/main/kotlin/com/simplemobiletools/gallery/helpers/MediaFetcher.kt +++ b/app/src/main/kotlin/com/simplemobiletools/gallery/helpers/MediaFetcher.kt @@ -268,6 +268,11 @@ class MediaFetcher(val context: Context) { break } + if (file.isDirectory) { + getMediaInFolder(file.absolutePath, curMedia, isPickImage, isPickVideo, filterMedia) + continue + } + val filename = file.name val isImage = filename.isImageFast() val isVideo = if (isImage) false else filename.isVideoFast() From d5496e04ba94d6df8e77cedb018df5b07adf7b97 Mon Sep 17 00:00:00 2001 From: tibbi Date: Tue, 20 Feb 2018 11:22:04 +0100 Subject: [PATCH 23/71] give proper folder names to OTG subfolders --- .../gallery/asynctasks/GetDirectoriesAsynctask.kt | 8 +++++++- .../com/simplemobiletools/gallery/helpers/MediaFetcher.kt | 3 ++- 2 files changed, 9 insertions(+), 2 deletions(-) diff --git a/app/src/main/kotlin/com/simplemobiletools/gallery/asynctasks/GetDirectoriesAsynctask.kt b/app/src/main/kotlin/com/simplemobiletools/gallery/asynctasks/GetDirectoriesAsynctask.kt index 0869a976d..c9f8c60ef 100644 --- a/app/src/main/kotlin/com/simplemobiletools/gallery/asynctasks/GetDirectoriesAsynctask.kt +++ b/app/src/main/kotlin/com/simplemobiletools/gallery/asynctasks/GetDirectoriesAsynctask.kt @@ -49,7 +49,13 @@ class GetDirectoriesAsynctask(val context: Context, val isPickVideo: Boolean, va context.internalStoragePath -> context.getString(R.string.internal) context.sdCardPath -> context.getString(R.string.sd_card) OTG_PATH -> context.getString(R.string.otg) - else -> parentDir.getFilenameFromPath() + else -> { + if (parentDir.startsWith(OTG_PATH)) { + parentDir.getParentPath().trimEnd('/').substringAfterLast('/') + } else { + parentDir.getFilenameFromPath() + } + } } if (File(parentDir).containsNoMedia()) { diff --git a/app/src/main/kotlin/com/simplemobiletools/gallery/helpers/MediaFetcher.kt b/app/src/main/kotlin/com/simplemobiletools/gallery/helpers/MediaFetcher.kt index 46c4e30e1..65347f4e1 100644 --- a/app/src/main/kotlin/com/simplemobiletools/gallery/helpers/MediaFetcher.kt +++ b/app/src/main/kotlin/com/simplemobiletools/gallery/helpers/MediaFetcher.kt @@ -2,6 +2,7 @@ package com.simplemobiletools.gallery.helpers import android.content.Context import android.database.Cursor +import android.net.Uri import android.provider.MediaStore import com.simplemobiletools.commons.extensions.* import com.simplemobiletools.commons.helpers.* @@ -349,7 +350,7 @@ class MediaFetcher(val context: Context) { else -> TYPE_GIF } - val path = file.uri.toString().replaceFirst("${context.config.OTGBasePath}%3A", OTG_PATH) + val path = Uri.decode(file.uri.toString().replaceFirst("${context.config.OTGBasePath}%3A", OTG_PATH)) val medium = Medium(filename, path, dateModified, dateTaken, size, type) val isAlreadyAdded = curMedia.any { it.path == path } if (!isAlreadyAdded) { From 55fa9a04d5d3f129d20e0b47dc8f27de005e58c4 Mon Sep 17 00:00:00 2001 From: tibbi Date: Tue, 20 Feb 2018 11:41:15 +0100 Subject: [PATCH 24/71] use proper actionbar title at OTG folders --- .../simplemobiletools/gallery/activities/MediaActivity.kt | 7 ++++++- .../gallery/asynctasks/GetDirectoriesAsynctask.kt | 2 +- 2 files changed, 7 insertions(+), 2 deletions(-) diff --git a/app/src/main/kotlin/com/simplemobiletools/gallery/activities/MediaActivity.kt b/app/src/main/kotlin/com/simplemobiletools/gallery/activities/MediaActivity.kt index 87b35c151..dd4d9703d 100644 --- a/app/src/main/kotlin/com/simplemobiletools/gallery/activities/MediaActivity.kt +++ b/app/src/main/kotlin/com/simplemobiletools/gallery/activities/MediaActivity.kt @@ -24,6 +24,7 @@ import com.google.gson.Gson import com.simplemobiletools.commons.dialogs.ConfirmationDialog import com.simplemobiletools.commons.dialogs.RadioGroupDialog import com.simplemobiletools.commons.extensions.* +import com.simplemobiletools.commons.helpers.OTG_PATH import com.simplemobiletools.commons.helpers.PERMISSION_WRITE_STORAGE import com.simplemobiletools.commons.helpers.REQUEST_EDIT_IMAGE import com.simplemobiletools.commons.models.FileDirItem @@ -278,7 +279,11 @@ class MediaActivity : SimpleActivity(), MediaAdapter.MediaOperationsListener { private fun tryloadGallery() { handlePermission(PERMISSION_WRITE_STORAGE) { if (it) { - val dirName = getHumanizedFilename(mPath) + val dirName = when { + mPath == OTG_PATH -> getString(R.string.otg) + mPath.startsWith(OTG_PATH) -> mPath.trimEnd('/').substringAfterLast('/') + else -> getHumanizedFilename(mPath) + } supportActionBar?.title = if (mShowAll) resources.getString(R.string.all_folders) else dirName getMedia() setupLayoutManager() diff --git a/app/src/main/kotlin/com/simplemobiletools/gallery/asynctasks/GetDirectoriesAsynctask.kt b/app/src/main/kotlin/com/simplemobiletools/gallery/asynctasks/GetDirectoriesAsynctask.kt index c9f8c60ef..d4b20cf2c 100644 --- a/app/src/main/kotlin/com/simplemobiletools/gallery/asynctasks/GetDirectoriesAsynctask.kt +++ b/app/src/main/kotlin/com/simplemobiletools/gallery/asynctasks/GetDirectoriesAsynctask.kt @@ -51,7 +51,7 @@ class GetDirectoriesAsynctask(val context: Context, val isPickVideo: Boolean, va OTG_PATH -> context.getString(R.string.otg) else -> { if (parentDir.startsWith(OTG_PATH)) { - parentDir.getParentPath().trimEnd('/').substringAfterLast('/') + parentDir.trimEnd('/').substringAfterLast('/') } else { parentDir.getFilenameFromPath() } From 771e59b5cff759e8fa8ed6dfe485d712413685bc Mon Sep 17 00:00:00 2001 From: tibbi Date: Tue, 20 Feb 2018 14:05:03 +0100 Subject: [PATCH 25/71] properly display OTG file thumbnails --- app/build.gradle | 2 +- .../gallery/adapters/MediaAdapter.kt | 15 +++++++++------ .../gallery/asynctasks/GetDirectoriesAsynctask.kt | 6 +++++- 3 files changed, 15 insertions(+), 8 deletions(-) diff --git a/app/build.gradle b/app/build.gradle index d535e90f5..1a597b002 100644 --- a/app/build.gradle +++ b/app/build.gradle @@ -46,7 +46,7 @@ ext { } dependencies { - implementation 'com.simplemobiletools:commons:3.12.11' + implementation 'com.simplemobiletools:commons:3.12.12' implementation 'com.theartofdev.edmodo:android-image-cropper:2.6.0' implementation 'com.android.support:multidex:1.0.2' implementation 'com.google.code.gson:gson:2.8.2' diff --git a/app/src/main/kotlin/com/simplemobiletools/gallery/adapters/MediaAdapter.kt b/app/src/main/kotlin/com/simplemobiletools/gallery/adapters/MediaAdapter.kt index 55b9269bc..35c22031d 100644 --- a/app/src/main/kotlin/com/simplemobiletools/gallery/adapters/MediaAdapter.kt +++ b/app/src/main/kotlin/com/simplemobiletools/gallery/adapters/MediaAdapter.kt @@ -10,10 +10,7 @@ import com.simplemobiletools.commons.activities.BaseSimpleActivity import com.simplemobiletools.commons.adapters.MyRecyclerViewAdapter import com.simplemobiletools.commons.dialogs.PropertiesDialog import com.simplemobiletools.commons.dialogs.RenameItemDialog -import com.simplemobiletools.commons.extensions.applyColorFilter -import com.simplemobiletools.commons.extensions.beVisibleIf -import com.simplemobiletools.commons.extensions.getFilenameFromPath -import com.simplemobiletools.commons.extensions.isActivityDestroyed +import com.simplemobiletools.commons.extensions.* import com.simplemobiletools.commons.models.FileDirItem import com.simplemobiletools.commons.views.FastScroller import com.simplemobiletools.commons.views.MyRecyclerView @@ -38,6 +35,7 @@ class MediaAdapter(activity: BaseSimpleActivity, var media: MutableList, private var loadImageInstantly = false private var delayHandler = Handler(Looper.getMainLooper()) private var currentMediaHash = media.hashCode() + private val hasOTGConnected = activity.hasOTGConnected() private var scrollHorizontally = config.scrollHorizontally private var animateGifs = config.animateGifs @@ -290,15 +288,20 @@ class MediaAdapter(activity: BaseSimpleActivity, var media: MutableList, photo_name.text = medium.name photo_name.tag = medium.path + var thumbnailPath = medium.path + if (hasOTGConnected && activity.isPathOnOTG(thumbnailPath)) { + thumbnailPath = thumbnailPath.getOTGPublicPath(context) + } + if (loadImageInstantly) { - activity.loadImage(medium.type, medium.path, medium_thumbnail, scrollHorizontally, animateGifs, cropThumbnails) + activity.loadImage(medium.type, thumbnailPath, medium_thumbnail, scrollHorizontally, animateGifs, cropThumbnails) } else { medium_thumbnail.setImageDrawable(null) medium_thumbnail.isHorizontalScrolling = scrollHorizontally delayHandler.postDelayed({ val isVisible = visibleItemPaths.contains(medium.path) if (isVisible) { - activity.loadImage(medium.type, medium.path, medium_thumbnail, scrollHorizontally, animateGifs, cropThumbnails) + activity.loadImage(medium.type, thumbnailPath, medium_thumbnail, scrollHorizontally, animateGifs, cropThumbnails) } }, IMAGE_LOAD_DELAY) } diff --git a/app/src/main/kotlin/com/simplemobiletools/gallery/asynctasks/GetDirectoriesAsynctask.kt b/app/src/main/kotlin/com/simplemobiletools/gallery/asynctasks/GetDirectoriesAsynctask.kt index d4b20cf2c..d1f86f01e 100644 --- a/app/src/main/kotlin/com/simplemobiletools/gallery/asynctasks/GetDirectoriesAsynctask.kt +++ b/app/src/main/kotlin/com/simplemobiletools/gallery/asynctasks/GetDirectoriesAsynctask.kt @@ -39,8 +39,12 @@ class GetDirectoriesAsynctask(val context: Context, val isPickVideo: Boolean, va val lastItem = curMedia.last() val parentDir = if (hasOTG && context.isPathOnOTG(firstItem.path)) firstItem.path.getParentPath() else File(firstItem.path).parent var thumbnail = firstItem.path + if (thumbnail.startsWith(OTG_PATH)) { + thumbnail = thumbnail.getOTGPublicPath(context) + } + albumCovers.forEach { - if (it.path == parentDir && File(it.tmb).exists()) { + if (it.path == parentDir && context.getDoesFilePathExist(it.tmb)) { thumbnail = it.tmb } } From a0bdc0b46b50c30c1ba5e0afd13a92d7aff533b3 Mon Sep 17 00:00:00 2001 From: tibbi Date: Tue, 20 Feb 2018 14:35:35 +0100 Subject: [PATCH 26/71] properly show OTG subfolder thumbnails --- .../gallery/activities/MediaActivity.kt | 5 +-- .../gallery/helpers/MediaFetcher.kt | 34 +++++++++++-------- 2 files changed, 23 insertions(+), 16 deletions(-) diff --git a/app/src/main/kotlin/com/simplemobiletools/gallery/activities/MediaActivity.kt b/app/src/main/kotlin/com/simplemobiletools/gallery/activities/MediaActivity.kt index dd4d9703d..081d0df72 100644 --- a/app/src/main/kotlin/com/simplemobiletools/gallery/activities/MediaActivity.kt +++ b/app/src/main/kotlin/com/simplemobiletools/gallery/activities/MediaActivity.kt @@ -425,10 +425,11 @@ class MediaActivity : SimpleActivity(), MediaAdapter.MediaOperationsListener { private fun hideFolder() { addNoMedia(mPath) { runOnUiThread { - if (!config.shouldShowHidden) + if (!config.shouldShowHidden) { finish() - else + } else { invalidateOptionsMenu() + } } } } diff --git a/app/src/main/kotlin/com/simplemobiletools/gallery/helpers/MediaFetcher.kt b/app/src/main/kotlin/com/simplemobiletools/gallery/helpers/MediaFetcher.kt index 65347f4e1..838741c1f 100644 --- a/app/src/main/kotlin/com/simplemobiletools/gallery/helpers/MediaFetcher.kt +++ b/app/src/main/kotlin/com/simplemobiletools/gallery/helpers/MediaFetcher.kt @@ -75,21 +75,27 @@ class MediaFetcher(val context: Context) { } fun getFilesFrom(curPath: String, isPickImage: Boolean, isPickVideo: Boolean): ArrayList { - val projection = arrayOf(MediaStore.Images.Media._ID, - MediaStore.Images.Media.DISPLAY_NAME, - MediaStore.Images.Media.DATE_TAKEN, - MediaStore.Images.Media.DATE_MODIFIED, - MediaStore.Images.Media.DATA, - MediaStore.Images.Media.SIZE) - val uri = MediaStore.Files.getContentUri("external") - val selection = getSelectionQuery(curPath) - val selectionArgs = getSelectionArgsQuery(curPath) + if (curPath.startsWith(OTG_PATH)) { + val curMedia = ArrayList() + getMediaOnOTG(curPath, curMedia, isPickImage, isPickVideo, context.config.filterMedia) + return curMedia + } else { + val projection = arrayOf(MediaStore.Images.Media._ID, + MediaStore.Images.Media.DISPLAY_NAME, + MediaStore.Images.Media.DATE_TAKEN, + MediaStore.Images.Media.DATE_MODIFIED, + MediaStore.Images.Media.DATA, + MediaStore.Images.Media.SIZE) + val uri = MediaStore.Files.getContentUri("external") + val selection = getSelectionQuery(curPath) + val selectionArgs = getSelectionArgsQuery(curPath) - return try { - val cur = context.contentResolver.query(uri, projection, selection, selectionArgs, getSortingForFolder(curPath)) - parseCursor(context, cur, isPickImage, isPickVideo, curPath) - } catch (e: Exception) { - ArrayList() + return try { + val cur = context.contentResolver.query(uri, projection, selection, selectionArgs, getSortingForFolder(curPath)) + parseCursor(context, cur, isPickImage, isPickVideo, curPath) + } catch (e: Exception) { + ArrayList() + } } } From a1a23217b97967d03379bced43010f645f0c8ca8 Mon Sep 17 00:00:00 2001 From: tibbi Date: Tue, 20 Feb 2018 15:25:31 +0100 Subject: [PATCH 27/71] do not unselect media files after copy --- .../com/simplemobiletools/gallery/adapters/MediaAdapter.kt | 1 - 1 file changed, 1 deletion(-) diff --git a/app/src/main/kotlin/com/simplemobiletools/gallery/adapters/MediaAdapter.kt b/app/src/main/kotlin/com/simplemobiletools/gallery/adapters/MediaAdapter.kt index 35c22031d..72731aaa2 100644 --- a/app/src/main/kotlin/com/simplemobiletools/gallery/adapters/MediaAdapter.kt +++ b/app/src/main/kotlin/com/simplemobiletools/gallery/adapters/MediaAdapter.kt @@ -189,7 +189,6 @@ class MediaAdapter(activity: BaseSimpleActivity, var media: MutableList, if (!isCopyOperation) { listener?.refreshItems() } - finishActMode() } } From b70292652bb032f83af9fe1bf5e65472c332dbc1 Mon Sep 17 00:00:00 2001 From: tibbi Date: Tue, 20 Feb 2018 15:43:26 +0100 Subject: [PATCH 28/71] fix loading of fullscreen OTG media --- app/build.gradle | 2 +- .../gallery/activities/EditActivity.kt | 3 ++- .../gallery/activities/PhotoVideoActivity.kt | 4 ++-- .../gallery/activities/ViewPagerActivity.kt | 8 ++++---- .../gallery/adapters/MediaAdapter.kt | 3 ++- .../asynctasks/GetDirectoriesAsynctask.kt | 2 +- .../simplemobiletools/gallery/extensions/File.kt | 3 --- .../gallery/fragments/PhotoFragment.kt | 16 ++++++++++------ .../gallery/helpers/MediaFetcher.kt | 2 +- 9 files changed, 23 insertions(+), 20 deletions(-) diff --git a/app/build.gradle b/app/build.gradle index 1a597b002..9c2198418 100644 --- a/app/build.gradle +++ b/app/build.gradle @@ -46,7 +46,7 @@ ext { } dependencies { - implementation 'com.simplemobiletools:commons:3.12.12' + implementation 'com.simplemobiletools:commons:3.12.13' implementation 'com.theartofdev.edmodo:android-image-cropper:2.6.0' implementation 'com.android.support:multidex:1.0.2' implementation 'com.google.code.gson:gson:2.8.2' diff --git a/app/src/main/kotlin/com/simplemobiletools/gallery/activities/EditActivity.kt b/app/src/main/kotlin/com/simplemobiletools/gallery/activities/EditActivity.kt index bfda0f48c..4b8c448c6 100644 --- a/app/src/main/kotlin/com/simplemobiletools/gallery/activities/EditActivity.kt +++ b/app/src/main/kotlin/com/simplemobiletools/gallery/activities/EditActivity.kt @@ -11,6 +11,7 @@ import android.provider.MediaStore import android.view.Menu import android.view.MenuItem import com.simplemobiletools.commons.extensions.* +import com.simplemobiletools.commons.helpers.OTG_PATH import com.simplemobiletools.commons.helpers.PERMISSION_WRITE_STORAGE import com.simplemobiletools.commons.helpers.REAL_FILE_PATH import com.simplemobiletools.commons.models.FileDirItem @@ -65,7 +66,7 @@ class EditActivity : SimpleActivity(), CropImageView.OnCropImageCompleteListener saveUri = when { intent.extras?.containsKey(REAL_FILE_PATH) == true -> { val realPath = intent.extras.get(REAL_FILE_PATH) as String - if (isPathOnOTG(realPath)) { + if (realPath.startsWith(OTG_PATH)) { Uri.parse(realPath) } else { Uri.fromFile(File(realPath)) diff --git a/app/src/main/kotlin/com/simplemobiletools/gallery/activities/PhotoVideoActivity.kt b/app/src/main/kotlin/com/simplemobiletools/gallery/activities/PhotoVideoActivity.kt index 3305f0086..beb01858a 100644 --- a/app/src/main/kotlin/com/simplemobiletools/gallery/activities/PhotoVideoActivity.kt +++ b/app/src/main/kotlin/com/simplemobiletools/gallery/activities/PhotoVideoActivity.kt @@ -11,6 +11,7 @@ import android.view.View import com.simplemobiletools.commons.dialogs.PropertiesDialog import com.simplemobiletools.commons.extensions.* import com.simplemobiletools.commons.helpers.IS_FROM_GALLERY +import com.simplemobiletools.commons.helpers.OTG_PATH import com.simplemobiletools.commons.helpers.PERMISSION_WRITE_STORAGE import com.simplemobiletools.commons.helpers.REAL_FILE_PATH import com.simplemobiletools.gallery.R @@ -60,13 +61,12 @@ open class PhotoVideoActivity : SimpleActivity(), ViewPagerFragment.FragmentList mUri = intent.data ?: return if (intent.extras?.containsKey(REAL_FILE_PATH) == true) { val realPath = intent.extras.get(REAL_FILE_PATH) as String - if (!isPathOnOTG(realPath)) { + if (!realPath.startsWith(OTG_PATH)) { mUri = Uri.fromFile(File(realPath)) } } mIsFromGallery = intent.getBooleanExtra(IS_FROM_GALLERY, false) - if (mUri!!.scheme == "file") { scanPath(mUri!!.path) sendViewPagerIntent(mUri!!.path) diff --git a/app/src/main/kotlin/com/simplemobiletools/gallery/activities/ViewPagerActivity.kt b/app/src/main/kotlin/com/simplemobiletools/gallery/activities/ViewPagerActivity.kt index c5f9dfa70..e0cc68a17 100644 --- a/app/src/main/kotlin/com/simplemobiletools/gallery/activities/ViewPagerActivity.kt +++ b/app/src/main/kotlin/com/simplemobiletools/gallery/activities/ViewPagerActivity.kt @@ -29,10 +29,7 @@ import com.bumptech.glide.Glide import com.simplemobiletools.commons.dialogs.PropertiesDialog import com.simplemobiletools.commons.dialogs.RenameItemDialog import com.simplemobiletools.commons.extensions.* -import com.simplemobiletools.commons.helpers.IS_FROM_GALLERY -import com.simplemobiletools.commons.helpers.PERMISSION_WRITE_STORAGE -import com.simplemobiletools.commons.helpers.REQUEST_EDIT_IMAGE -import com.simplemobiletools.commons.helpers.REQUEST_SET_AS +import com.simplemobiletools.commons.helpers.* import com.simplemobiletools.commons.models.FileDirItem import com.simplemobiletools.gallery.R import com.simplemobiletools.gallery.adapters.MyPagerAdapter @@ -202,6 +199,9 @@ class ViewPagerActivity : SimpleActivity(), ViewPager.OnPageChangeListener, View showSystemUI() mDirectory = mPath.getParentPath().trimEnd('/') + if (mDirectory.startsWith(OTG_PATH.trimEnd('/'))) { + mDirectory += "/" + } supportActionBar?.title = mPath.getFilenameFromPath() view_pager.onGlobalLayout { diff --git a/app/src/main/kotlin/com/simplemobiletools/gallery/adapters/MediaAdapter.kt b/app/src/main/kotlin/com/simplemobiletools/gallery/adapters/MediaAdapter.kt index 72731aaa2..7c599a9b0 100644 --- a/app/src/main/kotlin/com/simplemobiletools/gallery/adapters/MediaAdapter.kt +++ b/app/src/main/kotlin/com/simplemobiletools/gallery/adapters/MediaAdapter.kt @@ -11,6 +11,7 @@ import com.simplemobiletools.commons.adapters.MyRecyclerViewAdapter import com.simplemobiletools.commons.dialogs.PropertiesDialog import com.simplemobiletools.commons.dialogs.RenameItemDialog import com.simplemobiletools.commons.extensions.* +import com.simplemobiletools.commons.helpers.OTG_PATH import com.simplemobiletools.commons.models.FileDirItem import com.simplemobiletools.commons.views.FastScroller import com.simplemobiletools.commons.views.MyRecyclerView @@ -288,7 +289,7 @@ class MediaAdapter(activity: BaseSimpleActivity, var media: MutableList, photo_name.tag = medium.path var thumbnailPath = medium.path - if (hasOTGConnected && activity.isPathOnOTG(thumbnailPath)) { + if (hasOTGConnected && thumbnailPath.startsWith(OTG_PATH)) { thumbnailPath = thumbnailPath.getOTGPublicPath(context) } diff --git a/app/src/main/kotlin/com/simplemobiletools/gallery/asynctasks/GetDirectoriesAsynctask.kt b/app/src/main/kotlin/com/simplemobiletools/gallery/asynctasks/GetDirectoriesAsynctask.kt index d1f86f01e..a7165c1c9 100644 --- a/app/src/main/kotlin/com/simplemobiletools/gallery/asynctasks/GetDirectoriesAsynctask.kt +++ b/app/src/main/kotlin/com/simplemobiletools/gallery/asynctasks/GetDirectoriesAsynctask.kt @@ -37,7 +37,7 @@ class GetDirectoriesAsynctask(val context: Context, val isPickVideo: Boolean, va val firstItem = curMedia.first() val lastItem = curMedia.last() - val parentDir = if (hasOTG && context.isPathOnOTG(firstItem.path)) firstItem.path.getParentPath() else File(firstItem.path).parent + val parentDir = if (hasOTG && firstItem.path.startsWith(OTG_PATH)) firstItem.path.getParentPath() else File(firstItem.path).parent var thumbnail = firstItem.path if (thumbnail.startsWith(OTG_PATH)) { thumbnail = thumbnail.getOTGPublicPath(context) diff --git a/app/src/main/kotlin/com/simplemobiletools/gallery/extensions/File.kt b/app/src/main/kotlin/com/simplemobiletools/gallery/extensions/File.kt index 668c3acb5..2f05233c9 100644 --- a/app/src/main/kotlin/com/simplemobiletools/gallery/extensions/File.kt +++ b/app/src/main/kotlin/com/simplemobiletools/gallery/extensions/File.kt @@ -1,9 +1,6 @@ package com.simplemobiletools.gallery.extensions -import android.os.Environment import com.simplemobiletools.gallery.helpers.NOMEDIA import java.io.File fun File.containsNoMedia() = isDirectory && File(this, NOMEDIA).exists() - -fun File.isDownloadsFolder() = absolutePath == Environment.getExternalStoragePublicDirectory(Environment.DIRECTORY_DOWNLOADS).toString() diff --git a/app/src/main/kotlin/com/simplemobiletools/gallery/fragments/PhotoFragment.kt b/app/src/main/kotlin/com/simplemobiletools/gallery/fragments/PhotoFragment.kt index 18a2d23a3..fba95f9f5 100644 --- a/app/src/main/kotlin/com/simplemobiletools/gallery/fragments/PhotoFragment.kt +++ b/app/src/main/kotlin/com/simplemobiletools/gallery/fragments/PhotoFragment.kt @@ -24,6 +24,7 @@ import com.bumptech.glide.request.target.Target import com.davemorrissey.labs.subscaleview.ImageSource import com.davemorrissey.labs.subscaleview.SubsamplingScaleImageView import com.simplemobiletools.commons.extensions.* +import com.simplemobiletools.commons.helpers.OTG_PATH import com.simplemobiletools.gallery.R import com.simplemobiletools.gallery.activities.PhotoActivity import com.simplemobiletools.gallery.activities.ViewPagerActivity @@ -204,10 +205,11 @@ class PhotoFragment : ViewPagerFragment() { private fun loadGif() { try { - gifDrawable = if (medium.path.startsWith("content://") || medium.path.startsWith("file://")) { - GifDrawable(context!!.contentResolver, Uri.parse(medium.path)) + val pathToLoad = getPathToLoad() + gifDrawable = if (pathToLoad.startsWith("content://") || pathToLoad.startsWith("file://")) { + GifDrawable(context!!.contentResolver, Uri.parse(pathToLoad)) } else { - GifDrawable(medium.path) + GifDrawable(pathToLoad) } if (!isFragmentVisible) { @@ -241,7 +243,7 @@ class PhotoFragment : ViewPagerFragment() { Glide.with(this) .asBitmap() - .load(medium.path) + .load(getPathToLoad()) .apply(options) .listener(object : RequestListener { override fun onLoadFailed(e: GlideException?, model: Any?, target: Target?, isFirstResource: Boolean) = false @@ -259,7 +261,7 @@ class PhotoFragment : ViewPagerFragment() { Glide.with(this) .asBitmap() - .load(medium.path) + .load(getPathToLoad()) .thumbnail(0.2f) .apply(options) .into(view.gif_view) @@ -273,7 +275,7 @@ class PhotoFragment : ViewPagerFragment() { maxScale = 10f beVisible() isQuickScaleEnabled = context.config.oneFingerZoom - setImage(ImageSource.uri(medium.path)) + setImage(ImageSource.uri(getPathToLoad())) orientation = if (imageOrientation == -1) SubsamplingScaleImageView.ORIENTATION_USE_EXIF else degreesForRotation(imageOrientation) setEagerLoadingEnabled(false) setExecutor(AsyncTask.SERIAL_EXECUTOR) @@ -308,6 +310,8 @@ class PhotoFragment : ViewPagerFragment() { } } + private fun getPathToLoad() = if (medium.path.startsWith(OTG_PATH)) medium.path.getOTGPublicPath(context!!) else medium.path + private fun getImageOrientation(): Int { val defaultOrientation = -1 var orient = defaultOrientation diff --git a/app/src/main/kotlin/com/simplemobiletools/gallery/helpers/MediaFetcher.kt b/app/src/main/kotlin/com/simplemobiletools/gallery/helpers/MediaFetcher.kt index 838741c1f..6413485a5 100644 --- a/app/src/main/kotlin/com/simplemobiletools/gallery/helpers/MediaFetcher.kt +++ b/app/src/main/kotlin/com/simplemobiletools/gallery/helpers/MediaFetcher.kt @@ -199,7 +199,7 @@ class MediaFetcher(val context: Context) { } config.includedFolders.filter { it.isNotEmpty() && (curPath.isEmpty() || it == curPath) }.forEach { - if (context.isPathOnOTG(it)) { + if (it.startsWith(OTG_PATH)) { getMediaOnOTG(it, curMedia, isPickImage, isPickVideo, filterMedia) } else { getMediaInFolder(it, curMedia, isPickImage, isPickVideo, filterMedia) From 66993d784eea1365a25be990849f42067acec711 Mon Sep 17 00:00:00 2001 From: tibbi Date: Tue, 20 Feb 2018 16:05:50 +0100 Subject: [PATCH 29/71] use real_file_path at photoVideoActivity better --- .../simplemobiletools/gallery/activities/EditActivity.kt | 2 +- .../gallery/activities/PhotoVideoActivity.kt | 9 ++++----- .../gallery/activities/ViewPagerActivity.kt | 4 ++++ 3 files changed, 9 insertions(+), 6 deletions(-) diff --git a/app/src/main/kotlin/com/simplemobiletools/gallery/activities/EditActivity.kt b/app/src/main/kotlin/com/simplemobiletools/gallery/activities/EditActivity.kt index 4b8c448c6..54de2bfd5 100644 --- a/app/src/main/kotlin/com/simplemobiletools/gallery/activities/EditActivity.kt +++ b/app/src/main/kotlin/com/simplemobiletools/gallery/activities/EditActivity.kt @@ -65,7 +65,7 @@ class EditActivity : SimpleActivity(), CropImageView.OnCropImageCompleteListener saveUri = when { intent.extras?.containsKey(REAL_FILE_PATH) == true -> { - val realPath = intent.extras.get(REAL_FILE_PATH) as String + val realPath = intent.extras.getString(REAL_FILE_PATH) if (realPath.startsWith(OTG_PATH)) { Uri.parse(realPath) } else { diff --git a/app/src/main/kotlin/com/simplemobiletools/gallery/activities/PhotoVideoActivity.kt b/app/src/main/kotlin/com/simplemobiletools/gallery/activities/PhotoVideoActivity.kt index beb01858a..f3c4084bd 100644 --- a/app/src/main/kotlin/com/simplemobiletools/gallery/activities/PhotoVideoActivity.kt +++ b/app/src/main/kotlin/com/simplemobiletools/gallery/activities/PhotoVideoActivity.kt @@ -11,7 +11,6 @@ import android.view.View import com.simplemobiletools.commons.dialogs.PropertiesDialog import com.simplemobiletools.commons.extensions.* import com.simplemobiletools.commons.helpers.IS_FROM_GALLERY -import com.simplemobiletools.commons.helpers.OTG_PATH import com.simplemobiletools.commons.helpers.PERMISSION_WRITE_STORAGE import com.simplemobiletools.commons.helpers.REAL_FILE_PATH import com.simplemobiletools.gallery.R @@ -60,10 +59,10 @@ open class PhotoVideoActivity : SimpleActivity(), ViewPagerFragment.FragmentList private fun checkIntent(savedInstanceState: Bundle? = null) { mUri = intent.data ?: return if (intent.extras?.containsKey(REAL_FILE_PATH) == true) { - val realPath = intent.extras.get(REAL_FILE_PATH) as String - if (!realPath.startsWith(OTG_PATH)) { - mUri = Uri.fromFile(File(realPath)) - } + val realPath = intent.extras.getString(REAL_FILE_PATH) + sendViewPagerIntent(realPath) + finish() + return } mIsFromGallery = intent.getBooleanExtra(IS_FROM_GALLERY, false) diff --git a/app/src/main/kotlin/com/simplemobiletools/gallery/activities/ViewPagerActivity.kt b/app/src/main/kotlin/com/simplemobiletools/gallery/activities/ViewPagerActivity.kt index e0cc68a17..7fff7e8c4 100644 --- a/app/src/main/kotlin/com/simplemobiletools/gallery/activities/ViewPagerActivity.kt +++ b/app/src/main/kotlin/com/simplemobiletools/gallery/activities/ViewPagerActivity.kt @@ -172,6 +172,10 @@ class ViewPagerActivity : SimpleActivity(), ViewPager.OnPageChangeListener, View } } + if (intent.extras?.containsKey(REAL_FILE_PATH) == true) { + mPath = intent.extras.getString(REAL_FILE_PATH) + } + if (mPath.isEmpty()) { toast(R.string.unknown_error_occurred) finish() From c25513fbcf425cdc5143e5be7ab9eea539652683 Mon Sep 17 00:00:00 2001 From: tibbi Date: Tue, 20 Feb 2018 16:12:43 +0100 Subject: [PATCH 30/71] properly play OTG videos --- .../gallery/fragments/PhotoFragment.kt | 11 ++++------- .../gallery/fragments/VideoFragment.kt | 5 ++--- .../gallery/fragments/ViewPagerFragment.kt | 3 +++ 3 files changed, 9 insertions(+), 10 deletions(-) diff --git a/app/src/main/kotlin/com/simplemobiletools/gallery/fragments/PhotoFragment.kt b/app/src/main/kotlin/com/simplemobiletools/gallery/fragments/PhotoFragment.kt index fba95f9f5..d53a36a04 100644 --- a/app/src/main/kotlin/com/simplemobiletools/gallery/fragments/PhotoFragment.kt +++ b/app/src/main/kotlin/com/simplemobiletools/gallery/fragments/PhotoFragment.kt @@ -24,7 +24,6 @@ import com.bumptech.glide.request.target.Target import com.davemorrissey.labs.subscaleview.ImageSource import com.davemorrissey.labs.subscaleview.SubsamplingScaleImageView import com.simplemobiletools.commons.extensions.* -import com.simplemobiletools.commons.helpers.OTG_PATH import com.simplemobiletools.gallery.R import com.simplemobiletools.gallery.activities.PhotoActivity import com.simplemobiletools.gallery.activities.ViewPagerActivity @@ -205,7 +204,7 @@ class PhotoFragment : ViewPagerFragment() { private fun loadGif() { try { - val pathToLoad = getPathToLoad() + val pathToLoad = getPathToLoad(medium) gifDrawable = if (pathToLoad.startsWith("content://") || pathToLoad.startsWith("file://")) { GifDrawable(context!!.contentResolver, Uri.parse(pathToLoad)) } else { @@ -243,7 +242,7 @@ class PhotoFragment : ViewPagerFragment() { Glide.with(this) .asBitmap() - .load(getPathToLoad()) + .load(getPathToLoad(medium)) .apply(options) .listener(object : RequestListener { override fun onLoadFailed(e: GlideException?, model: Any?, target: Target?, isFirstResource: Boolean) = false @@ -261,7 +260,7 @@ class PhotoFragment : ViewPagerFragment() { Glide.with(this) .asBitmap() - .load(getPathToLoad()) + .load(getPathToLoad(medium)) .thumbnail(0.2f) .apply(options) .into(view.gif_view) @@ -275,7 +274,7 @@ class PhotoFragment : ViewPagerFragment() { maxScale = 10f beVisible() isQuickScaleEnabled = context.config.oneFingerZoom - setImage(ImageSource.uri(getPathToLoad())) + setImage(ImageSource.uri(getPathToLoad(medium))) orientation = if (imageOrientation == -1) SubsamplingScaleImageView.ORIENTATION_USE_EXIF else degreesForRotation(imageOrientation) setEagerLoadingEnabled(false) setExecutor(AsyncTask.SERIAL_EXECUTOR) @@ -310,8 +309,6 @@ class PhotoFragment : ViewPagerFragment() { } } - private fun getPathToLoad() = if (medium.path.startsWith(OTG_PATH)) medium.path.getOTGPublicPath(context!!) else medium.path - private fun getImageOrientation(): Int { val defaultOrientation = -1 var orient = defaultOrientation diff --git a/app/src/main/kotlin/com/simplemobiletools/gallery/fragments/VideoFragment.kt b/app/src/main/kotlin/com/simplemobiletools/gallery/fragments/VideoFragment.kt index 1f7ee9084..ff6d46b89 100644 --- a/app/src/main/kotlin/com/simplemobiletools/gallery/fragments/VideoFragment.kt +++ b/app/src/main/kotlin/com/simplemobiletools/gallery/fragments/VideoFragment.kt @@ -183,7 +183,6 @@ class VideoFragment : ViewPagerFragment(), SurfaceHolder.Callback, SeekBar.OnSee private fun initTimeHolder() { val res = resources - val height = context!!.navigationBarHeight val left = mTimeHolder!!.paddingLeft val top = mTimeHolder!!.paddingTop var right = mTimeHolder!!.paddingRight @@ -315,7 +314,7 @@ class VideoFragment : ViewPagerFragment(), SurfaceHolder.Callback, SeekBar.OnSee return } - val mediumPath = if (wasEncoded) mEncodedPath else medium.path + val mediumPath = if (wasEncoded) mEncodedPath else getPathToLoad(medium) try { mMediaPlayer = MediaPlayer().apply { setDataSource(context, Uri.parse(mediumPath)) @@ -327,7 +326,7 @@ class VideoFragment : ViewPagerFragment(), SurfaceHolder.Callback, SeekBar.OnSee prepare() } } catch (e: IOException) { - mEncodedPath = Uri.encode(medium.path) + mEncodedPath = Uri.encode(getPathToLoad(medium)) if (wasEncoded) { releaseMediaPlayer() } else { diff --git a/app/src/main/kotlin/com/simplemobiletools/gallery/fragments/ViewPagerFragment.kt b/app/src/main/kotlin/com/simplemobiletools/gallery/fragments/ViewPagerFragment.kt index fecbcc23d..d1c9a4253 100644 --- a/app/src/main/kotlin/com/simplemobiletools/gallery/fragments/ViewPagerFragment.kt +++ b/app/src/main/kotlin/com/simplemobiletools/gallery/fragments/ViewPagerFragment.kt @@ -2,6 +2,7 @@ package com.simplemobiletools.gallery.fragments import android.support.v4.app.Fragment import com.simplemobiletools.commons.extensions.* +import com.simplemobiletools.commons.helpers.OTG_PATH import com.simplemobiletools.gallery.extensions.config import com.simplemobiletools.gallery.helpers.* import com.simplemobiletools.gallery.models.Medium @@ -65,4 +66,6 @@ abstract class ViewPagerFragment : Fragment() { } return details.toString().trim() } + + fun getPathToLoad(medium: Medium) = if (medium.path.startsWith(OTG_PATH)) medium.path.getOTGPublicPath(context!!) else medium.path } From 04d42d6772fa4fa5ff214243783327d672cf88ca Mon Sep 17 00:00:00 2001 From: tibbi Date: Tue, 20 Feb 2018 16:37:22 +0100 Subject: [PATCH 31/71] use proper orientation at otg images --- .../simplemobiletools/gallery/fragments/PhotoFragment.kt | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/app/src/main/kotlin/com/simplemobiletools/gallery/fragments/PhotoFragment.kt b/app/src/main/kotlin/com/simplemobiletools/gallery/fragments/PhotoFragment.kt index d53a36a04..b13b06422 100644 --- a/app/src/main/kotlin/com/simplemobiletools/gallery/fragments/PhotoFragment.kt +++ b/app/src/main/kotlin/com/simplemobiletools/gallery/fragments/PhotoFragment.kt @@ -24,6 +24,7 @@ import com.bumptech.glide.request.target.Target import com.davemorrissey.labs.subscaleview.ImageSource import com.davemorrissey.labs.subscaleview.SubsamplingScaleImageView import com.simplemobiletools.commons.extensions.* +import com.simplemobiletools.commons.helpers.OTG_PATH import com.simplemobiletools.gallery.R import com.simplemobiletools.gallery.activities.PhotoActivity import com.simplemobiletools.gallery.activities.ViewPagerActivity @@ -314,11 +315,12 @@ class PhotoFragment : ViewPagerFragment() { var orient = defaultOrientation try { - val exif = android.media.ExifInterface(medium.path) + val pathToLoad = getPathToLoad(medium) + val exif = android.media.ExifInterface(pathToLoad) orient = exif.getAttributeInt(android.media.ExifInterface.TAG_ORIENTATION, defaultOrientation) - if (orient == defaultOrientation) { - val uri = if (medium.path.startsWith("content:/")) Uri.parse(medium.path) else Uri.fromFile(File(medium.path)) + if (orient == defaultOrientation || medium.path.startsWith(OTG_PATH)) { + val uri = if (pathToLoad.startsWith("content:/")) Uri.parse(pathToLoad) else Uri.fromFile(File(pathToLoad)) val inputStream = context!!.contentResolver.openInputStream(uri) val exif2 = ExifInterface() exif2.readExif(inputStream, ExifInterface.Options.OPTION_ALL) From 6ce9ea4b8d2b47542e6c8817189359ce4ba8ef75 Mon Sep 17 00:00:00 2001 From: tibbi Date: Tue, 20 Feb 2018 17:41:22 +0100 Subject: [PATCH 32/71] scan exlicitly included OTG folders recursively --- .../gallery/asynctasks/GetMediaAsynctask.kt | 2 +- .../gallery/helpers/MediaFetcher.kt | 29 +++++++++++-------- 2 files changed, 18 insertions(+), 13 deletions(-) diff --git a/app/src/main/kotlin/com/simplemobiletools/gallery/asynctasks/GetMediaAsynctask.kt b/app/src/main/kotlin/com/simplemobiletools/gallery/asynctasks/GetMediaAsynctask.kt index a3b8a2b5d..ff9d6230d 100644 --- a/app/src/main/kotlin/com/simplemobiletools/gallery/asynctasks/GetMediaAsynctask.kt +++ b/app/src/main/kotlin/com/simplemobiletools/gallery/asynctasks/GetMediaAsynctask.kt @@ -25,7 +25,7 @@ class GetMediaAsynctask(val context: Context, val mPath: String, val isPickVideo media.sort() media } else { - mediaFetcher.getFilesFrom(mPath, isPickImage, isPickVideo) + mediaFetcher.getFilesFrom(mPath, isPickImage, isPickVideo, false) } } diff --git a/app/src/main/kotlin/com/simplemobiletools/gallery/helpers/MediaFetcher.kt b/app/src/main/kotlin/com/simplemobiletools/gallery/helpers/MediaFetcher.kt index 6413485a5..f223a3b08 100644 --- a/app/src/main/kotlin/com/simplemobiletools/gallery/helpers/MediaFetcher.kt +++ b/app/src/main/kotlin/com/simplemobiletools/gallery/helpers/MediaFetcher.kt @@ -19,7 +19,7 @@ class MediaFetcher(val context: Context) { var shouldStop = false fun getMediaByDirectories(isPickVideo: Boolean, isPickImage: Boolean): HashMap> { - val media = getFilesFrom("", isPickImage, isPickVideo) + val media = getFilesFrom("", isPickImage, isPickVideo, true) val excludedPaths = context.config.excludedFolders val includedPaths = context.config.includedFolders val showHidden = context.config.shouldShowHidden @@ -74,10 +74,10 @@ class MediaFetcher(val context: Context) { }.start() } - fun getFilesFrom(curPath: String, isPickImage: Boolean, isPickVideo: Boolean): ArrayList { + fun getFilesFrom(curPath: String, isPickImage: Boolean, isPickVideo: Boolean, allowRecursion: Boolean): ArrayList { if (curPath.startsWith(OTG_PATH)) { val curMedia = ArrayList() - getMediaOnOTG(curPath, curMedia, isPickImage, isPickVideo, context.config.filterMedia) + getMediaOnOTG(curPath, curMedia, isPickImage, isPickVideo, context.config.filterMedia, allowRecursion) return curMedia } else { val projection = arrayOf(MediaStore.Images.Media._ID, @@ -92,7 +92,7 @@ class MediaFetcher(val context: Context) { return try { val cur = context.contentResolver.query(uri, projection, selection, selectionArgs, getSortingForFolder(curPath)) - parseCursor(context, cur, isPickImage, isPickVideo, curPath) + parseCursor(context, cur, isPickImage, isPickVideo, curPath, allowRecursion) } catch (e: Exception) { ArrayList() } @@ -131,7 +131,7 @@ class MediaFetcher(val context: Context) { } } - private fun parseCursor(context: Context, cur: Cursor, isPickImage: Boolean, isPickVideo: Boolean, curPath: String): ArrayList { + private fun parseCursor(context: Context, cur: Cursor, isPickImage: Boolean, isPickVideo: Boolean, curPath: String, allowRecursion: Boolean): ArrayList { val curMedia = ArrayList() val config = context.config val filterMedia = config.filterMedia @@ -200,14 +200,14 @@ class MediaFetcher(val context: Context) { config.includedFolders.filter { it.isNotEmpty() && (curPath.isEmpty() || it == curPath) }.forEach { if (it.startsWith(OTG_PATH)) { - getMediaOnOTG(it, curMedia, isPickImage, isPickVideo, filterMedia) + getMediaOnOTG(it, curMedia, isPickImage, isPickVideo, filterMedia, allowRecursion) } else { - getMediaInFolder(it, curMedia, isPickImage, isPickVideo, filterMedia) + getMediaInFolder(it, curMedia, isPickImage, isPickVideo, filterMedia, allowRecursion) } } if (isThirdPartyIntent && curPath.isNotEmpty() && curMedia.isEmpty()) { - getMediaInFolder(curPath, curMedia, isPickImage, isPickVideo, filterMedia) + getMediaInFolder(curPath, curMedia, isPickImage, isPickVideo, filterMedia, allowRecursion) } Medium.sorting = config.getFileSorting(curPath) @@ -268,15 +268,15 @@ class MediaFetcher(val context: Context) { private fun isThisOrParentExcluded(path: String, excludedPaths: MutableSet, includedPaths: MutableSet) = includedPaths.none { path.startsWith(it) } && excludedPaths.any { path.startsWith(it) } - private fun getMediaInFolder(folder: String, curMedia: ArrayList, isPickImage: Boolean, isPickVideo: Boolean, filterMedia: Int) { + private fun getMediaInFolder(folder: String, curMedia: ArrayList, isPickImage: Boolean, isPickVideo: Boolean, filterMedia: Int, allowRecursion: Boolean) { val files = File(folder).listFiles() ?: return for (file in files) { if (shouldStop) { break } - if (file.isDirectory) { - getMediaInFolder(file.absolutePath, curMedia, isPickImage, isPickVideo, filterMedia) + if (file.isDirectory && allowRecursion) { + getMediaInFolder(file.absolutePath, curMedia, isPickImage, isPickVideo, filterMedia, allowRecursion) continue } @@ -319,13 +319,18 @@ class MediaFetcher(val context: Context) { } } - private fun getMediaOnOTG(folder: String, curMedia: ArrayList, isPickImage: Boolean, isPickVideo: Boolean, filterMedia: Int) { + private fun getMediaOnOTG(folder: String, curMedia: ArrayList, isPickImage: Boolean, isPickVideo: Boolean, filterMedia: Int, allowRecursion: Boolean) { val files = context.getDocumentFile(folder)?.listFiles() ?: return for (file in files) { if (shouldStop) { return } + if (file.isDirectory && allowRecursion) { + getMediaOnOTG("$folder${file.name}", curMedia, isPickImage, isPickVideo, filterMedia, allowRecursion) + continue + } + val filename = file.name val isImage = filename.isImageFast() val isVideo = if (isImage) false else filename.isVideoFast() From 6976c35ee481a6ed728322c818db15fa0175973b Mon Sep 17 00:00:00 2001 From: tibbi Date: Tue, 20 Feb 2018 18:40:25 +0100 Subject: [PATCH 33/71] make sure the directory thumbnail file exists --- .../gallery/asynctasks/GetDirectoriesAsynctask.kt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/src/main/kotlin/com/simplemobiletools/gallery/asynctasks/GetDirectoriesAsynctask.kt b/app/src/main/kotlin/com/simplemobiletools/gallery/asynctasks/GetDirectoriesAsynctask.kt index a7165c1c9..2050d4798 100644 --- a/app/src/main/kotlin/com/simplemobiletools/gallery/asynctasks/GetDirectoriesAsynctask.kt +++ b/app/src/main/kotlin/com/simplemobiletools/gallery/asynctasks/GetDirectoriesAsynctask.kt @@ -38,7 +38,7 @@ class GetDirectoriesAsynctask(val context: Context, val isPickVideo: Boolean, va val firstItem = curMedia.first() val lastItem = curMedia.last() val parentDir = if (hasOTG && firstItem.path.startsWith(OTG_PATH)) firstItem.path.getParentPath() else File(firstItem.path).parent - var thumbnail = firstItem.path + var thumbnail = curMedia.firstOrNull { context.getDoesFilePathExist(it.path) }?.path ?: "" if (thumbnail.startsWith(OTG_PATH)) { thumbnail = thumbnail.getOTGPublicPath(context) } From c27182284483da6712578fd34889f55d59a4b0ce Mon Sep 17 00:00:00 2001 From: tibbi Date: Tue, 20 Feb 2018 19:27:31 +0100 Subject: [PATCH 34/71] check storage permission before getting latest media id --- .../com/simplemobiletools/gallery/activities/MainActivity.kt | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/app/src/main/kotlin/com/simplemobiletools/gallery/activities/MainActivity.kt b/app/src/main/kotlin/com/simplemobiletools/gallery/activities/MainActivity.kt index 3fabb044d..d2df2fcf4 100644 --- a/app/src/main/kotlin/com/simplemobiletools/gallery/activities/MainActivity.kt +++ b/app/src/main/kotlin/com/simplemobiletools/gallery/activities/MainActivity.kt @@ -17,6 +17,7 @@ import com.simplemobiletools.commons.dialogs.CreateNewFolderDialog import com.simplemobiletools.commons.dialogs.FilePickerDialog import com.simplemobiletools.commons.dialogs.RadioGroupDialog import com.simplemobiletools.commons.extensions.* +import com.simplemobiletools.commons.helpers.PERMISSION_READ_STORAGE import com.simplemobiletools.commons.helpers.PERMISSION_WRITE_STORAGE import com.simplemobiletools.commons.helpers.SORT_BY_DATE_MODIFIED import com.simplemobiletools.commons.helpers.SORT_BY_DATE_TAKEN @@ -634,7 +635,9 @@ class MainActivity : SimpleActivity(), DirectoryAdapter.DirOperationsListener { private fun setupLatestMediaId() { Thread { - mLatestMediaId = getLatestMediaId() + if (hasPermission(PERMISSION_READ_STORAGE)) { + mLatestMediaId = getLatestMediaId() + } }.start() } From 6d806035eed60020693b2113e8b51505597a443e Mon Sep 17 00:00:00 2001 From: tibbi Date: Tue, 20 Feb 2018 19:56:30 +0100 Subject: [PATCH 35/71] scan invalid path at viewpager activity instead of deleting --- .../simplemobiletools/gallery/activities/ViewPagerActivity.kt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/src/main/kotlin/com/simplemobiletools/gallery/activities/ViewPagerActivity.kt b/app/src/main/kotlin/com/simplemobiletools/gallery/activities/ViewPagerActivity.kt index 7fff7e8c4..b63add956 100644 --- a/app/src/main/kotlin/com/simplemobiletools/gallery/activities/ViewPagerActivity.kt +++ b/app/src/main/kotlin/com/simplemobiletools/gallery/activities/ViewPagerActivity.kt @@ -184,7 +184,7 @@ class ViewPagerActivity : SimpleActivity(), ViewPager.OnPageChangeListener, View if (!getDoesFilePathExist(mPath)) { Thread { - deleteFromMediaStore(mPath) + scanPath(mPath) }.start() finish() return From a70ac7c825a6bb768b26d5857ce0ea93c8417028 Mon Sep 17 00:00:00 2001 From: tibbi Date: Tue, 20 Feb 2018 20:09:44 +0100 Subject: [PATCH 36/71] check 2 more parents if they contain a .nomedia file --- .../gallery/asynctasks/GetDirectoriesAsynctask.kt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/src/main/kotlin/com/simplemobiletools/gallery/asynctasks/GetDirectoriesAsynctask.kt b/app/src/main/kotlin/com/simplemobiletools/gallery/asynctasks/GetDirectoriesAsynctask.kt index 2050d4798..ac1a0669e 100644 --- a/app/src/main/kotlin/com/simplemobiletools/gallery/asynctasks/GetDirectoriesAsynctask.kt +++ b/app/src/main/kotlin/com/simplemobiletools/gallery/asynctasks/GetDirectoriesAsynctask.kt @@ -62,7 +62,7 @@ class GetDirectoriesAsynctask(val context: Context, val isPickVideo: Boolean, va } } - if (File(parentDir).containsNoMedia()) { + if (File(parentDir).containsNoMedia() || File(parentDir).parentFile?.containsNoMedia() == true || File(parentDir).parentFile?.parentFile?.containsNoMedia() == true) { dirName += " $hidden" } From c108e09ccf1c4f199325be4862c9e8ad30ce2846 Mon Sep 17 00:00:00 2001 From: tibbi Date: Tue, 20 Feb 2018 20:16:15 +0100 Subject: [PATCH 37/71] lets make the parent nomedia check nicer --- .../asynctasks/GetDirectoriesAsynctask.kt | 4 ++-- .../simplemobiletools/gallery/extensions/File.kt | 14 ++++++++++++++ .../gallery/helpers/MediaFetcher.kt | 16 ++-------------- 3 files changed, 18 insertions(+), 16 deletions(-) diff --git a/app/src/main/kotlin/com/simplemobiletools/gallery/asynctasks/GetDirectoriesAsynctask.kt b/app/src/main/kotlin/com/simplemobiletools/gallery/asynctasks/GetDirectoriesAsynctask.kt index ac1a0669e..e4ee2ee21 100644 --- a/app/src/main/kotlin/com/simplemobiletools/gallery/asynctasks/GetDirectoriesAsynctask.kt +++ b/app/src/main/kotlin/com/simplemobiletools/gallery/asynctasks/GetDirectoriesAsynctask.kt @@ -8,7 +8,7 @@ import com.simplemobiletools.commons.helpers.PERMISSION_WRITE_STORAGE import com.simplemobiletools.commons.helpers.SORT_DESCENDING import com.simplemobiletools.gallery.R import com.simplemobiletools.gallery.extensions.config -import com.simplemobiletools.gallery.extensions.containsNoMedia +import com.simplemobiletools.gallery.extensions.doesParentHaveNoMedia import com.simplemobiletools.gallery.extensions.sumByLong import com.simplemobiletools.gallery.helpers.MediaFetcher import com.simplemobiletools.gallery.models.Directory @@ -62,7 +62,7 @@ class GetDirectoriesAsynctask(val context: Context, val isPickVideo: Boolean, va } } - if (File(parentDir).containsNoMedia() || File(parentDir).parentFile?.containsNoMedia() == true || File(parentDir).parentFile?.parentFile?.containsNoMedia() == true) { + if (File(parentDir).doesParentHaveNoMedia()) { dirName += " $hidden" } diff --git a/app/src/main/kotlin/com/simplemobiletools/gallery/extensions/File.kt b/app/src/main/kotlin/com/simplemobiletools/gallery/extensions/File.kt index 2f05233c9..df5aaf241 100644 --- a/app/src/main/kotlin/com/simplemobiletools/gallery/extensions/File.kt +++ b/app/src/main/kotlin/com/simplemobiletools/gallery/extensions/File.kt @@ -4,3 +4,17 @@ import com.simplemobiletools.gallery.helpers.NOMEDIA import java.io.File fun File.containsNoMedia() = isDirectory && File(this, NOMEDIA).exists() + +fun File.doesParentHaveNoMedia(): Boolean { + var curFile = this + while (true) { + if (curFile.containsNoMedia()) { + return true + } + curFile = curFile.parentFile + if (curFile.absolutePath == "/") { + break + } + } + return false +} diff --git a/app/src/main/kotlin/com/simplemobiletools/gallery/helpers/MediaFetcher.kt b/app/src/main/kotlin/com/simplemobiletools/gallery/helpers/MediaFetcher.kt index f223a3b08..d4016c36b 100644 --- a/app/src/main/kotlin/com/simplemobiletools/gallery/helpers/MediaFetcher.kt +++ b/app/src/main/kotlin/com/simplemobiletools/gallery/helpers/MediaFetcher.kt @@ -8,6 +8,7 @@ import com.simplemobiletools.commons.extensions.* import com.simplemobiletools.commons.helpers.* import com.simplemobiletools.gallery.extensions.config import com.simplemobiletools.gallery.extensions.containsNoMedia +import com.simplemobiletools.gallery.extensions.doesParentHaveNoMedia import com.simplemobiletools.gallery.models.Medium import java.io.File import java.util.LinkedHashMap @@ -244,7 +245,7 @@ class MediaFetcher(val context: Context) { } else if (!showHidden && file.isDirectory && file.canonicalFile == file.absoluteFile) { var containsNoMediaOrDot = file.containsNoMedia() || path.contains("/.") if (!containsNoMediaOrDot) { - containsNoMediaOrDot = checkParentHasNoMedia(file.parentFile) + containsNoMediaOrDot = file.doesParentHaveNoMedia() } !containsNoMediaOrDot } else { @@ -252,19 +253,6 @@ class MediaFetcher(val context: Context) { } } - private fun checkParentHasNoMedia(file: File): Boolean { - var curFile = file - while (true) { - if (curFile.containsNoMedia()) { - return true - } - curFile = curFile.parentFile - if (curFile.absolutePath == "/") - break - } - return false - } - private fun isThisOrParentExcluded(path: String, excludedPaths: MutableSet, includedPaths: MutableSet) = includedPaths.none { path.startsWith(it) } && excludedPaths.any { path.startsWith(it) } From f8713c120855eefe75bca2a74d30766383ba0213 Mon Sep 17 00:00:00 2001 From: tibbi Date: Tue, 20 Feb 2018 20:31:45 +0100 Subject: [PATCH 38/71] update commons to 3.12.14 --- app/build.gradle | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/build.gradle b/app/build.gradle index 9c2198418..c8ce9331b 100644 --- a/app/build.gradle +++ b/app/build.gradle @@ -46,7 +46,7 @@ ext { } dependencies { - implementation 'com.simplemobiletools:commons:3.12.13' + implementation 'com.simplemobiletools:commons:3.12.14' implementation 'com.theartofdev.edmodo:android-image-cropper:2.6.0' implementation 'com.android.support:multidex:1.0.2' implementation 'com.google.code.gson:gson:2.8.2' From e994b77232287b9ccb62e5519b4f36e3465febdf Mon Sep 17 00:00:00 2001 From: tibbi Date: Tue, 20 Feb 2018 20:50:11 +0100 Subject: [PATCH 39/71] try ensuring that the screenshots folders is properly added to the mediastore --- .../gallery/activities/MainActivity.kt | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/app/src/main/kotlin/com/simplemobiletools/gallery/activities/MainActivity.kt b/app/src/main/kotlin/com/simplemobiletools/gallery/activities/MainActivity.kt index d2df2fcf4..ccfaa66f6 100644 --- a/app/src/main/kotlin/com/simplemobiletools/gallery/activities/MainActivity.kt +++ b/app/src/main/kotlin/com/simplemobiletools/gallery/activities/MainActivity.kt @@ -5,6 +5,7 @@ import android.content.ClipData import android.content.Intent import android.net.Uri import android.os.Bundle +import android.os.Environment import android.os.Handler import android.provider.MediaStore import android.support.v7.widget.GridLayoutManager @@ -283,6 +284,17 @@ class MainActivity : SimpleActivity(), DirectoryAdapter.DirOperationsListener { gotDirectories(addTempFolderIfNeeded(it), false) } mCurrAsyncTask!!.execute() + + // try ensuring that the screenshots folders is properly added to the mediastore + if (config.appRunCount < 5) { + Thread { + val pictures = Environment.getExternalStoragePublicDirectory(Environment.DIRECTORY_PICTURES) + val screenshots = File(pictures, "Screenshots") + if (screenshots.exists()) { + scanFile(screenshots) + } + }.start() + } } private fun showSortingDialog() { From 909419371c8a7095c6fef1ae9c9e7f23bf7bd850 Mon Sep 17 00:00:00 2001 From: tibbi Date: Tue, 20 Feb 2018 21:22:33 +0100 Subject: [PATCH 40/71] adding FAQ items --- app/src/main/AndroidManifest.xml | 5 +++++ .../gallery/extensions/Activity.kt | 15 ++++++++++++++- 2 files changed, 19 insertions(+), 1 deletion(-) diff --git a/app/src/main/AndroidManifest.xml b/app/src/main/AndroidManifest.xml index 8eead3683..b4915161f 100644 --- a/app/src/main/AndroidManifest.xml +++ b/app/src/main/AndroidManifest.xml @@ -98,6 +98,11 @@ android:label="@string/customize_colors" android:parentActivityName=".activities.SettingsActivity"/> + + Date: Tue, 20 Feb 2018 22:10:49 +0100 Subject: [PATCH 41/71] fix the zoom level glitch at rotating images by aspect ratio --- app/build.gradle | 2 +- .../com/simplemobiletools/gallery/fragments/PhotoFragment.kt | 2 ++ 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/app/build.gradle b/app/build.gradle index c8ce9331b..161420813 100644 --- a/app/build.gradle +++ b/app/build.gradle @@ -55,7 +55,7 @@ dependencies { implementation 'com.github.chrisbanes:PhotoView:2.1.3' //implementation 'com.davemorrissey.labs:subsampling-scale-image-view:3.9.0' - implementation 'com.github.tibbi:subsampling-scale-image-view:v3.9.0.1-fork' + implementation 'com.github.tibbi:subsampling-scale-image-view:v3.9.0.6-fork' debugImplementation "com.squareup.leakcanary:leakcanary-android:$leakCanaryVersion" releaseImplementation "com.squareup.leakcanary:leakcanary-android-no-op:$leakCanaryVersion" diff --git a/app/src/main/kotlin/com/simplemobiletools/gallery/fragments/PhotoFragment.kt b/app/src/main/kotlin/com/simplemobiletools/gallery/fragments/PhotoFragment.kt index b13b06422..8a5a3560e 100644 --- a/app/src/main/kotlin/com/simplemobiletools/gallery/fragments/PhotoFragment.kt +++ b/app/src/main/kotlin/com/simplemobiletools/gallery/fragments/PhotoFragment.kt @@ -31,6 +31,7 @@ import com.simplemobiletools.gallery.activities.ViewPagerActivity import com.simplemobiletools.gallery.extensions.* import com.simplemobiletools.gallery.helpers.GlideRotateTransformation import com.simplemobiletools.gallery.helpers.MEDIUM +import com.simplemobiletools.gallery.helpers.ROTATE_BY_ASPECT_RATIO import com.simplemobiletools.gallery.models.Medium import it.sephiroth.android.library.exif2.ExifInterface import kotlinx.android.synthetic.main.pager_photo_item.view.* @@ -275,6 +276,7 @@ class PhotoFragment : ViewPagerFragment() { maxScale = 10f beVisible() isQuickScaleEnabled = context.config.oneFingerZoom + setResetScaleOnSizeChange(context.config.screenRotation != ROTATE_BY_ASPECT_RATIO) setImage(ImageSource.uri(getPathToLoad(medium))) orientation = if (imageOrientation == -1) SubsamplingScaleImageView.ORIENTATION_USE_EXIF else degreesForRotation(imageOrientation) setEagerLoadingEnabled(false) From 9858a149eaeca1ceb8101fc19ec584173fc600ab Mon Sep 17 00:00:00 2001 From: tibbi Date: Tue, 20 Feb 2018 23:20:34 +0100 Subject: [PATCH 42/71] properly determine image width and height at rotation by aspect ratio --- .../gallery/activities/ViewPagerActivity.kt | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-) diff --git a/app/src/main/kotlin/com/simplemobiletools/gallery/activities/ViewPagerActivity.kt b/app/src/main/kotlin/com/simplemobiletools/gallery/activities/ViewPagerActivity.kt index b63add956..2abb43dee 100644 --- a/app/src/main/kotlin/com/simplemobiletools/gallery/activities/ViewPagerActivity.kt +++ b/app/src/main/kotlin/com/simplemobiletools/gallery/activities/ViewPagerActivity.kt @@ -826,10 +826,20 @@ class ViewPagerActivity : SimpleActivity(), ViewPager.OnPageChangeListener, View private fun checkOrientation() { if (!mIsOrientationLocked && config.screenRotation == ROTATE_BY_ASPECT_RATIO) { + var flipSides = false + try { + val pathToLoad = getCurrentPath() + val exif = android.media.ExifInterface(pathToLoad) + val orientation = exif.getAttributeInt(android.media.ExifInterface.TAG_ORIENTATION, -1) + flipSides = orientation == ExifInterface.ORIENTATION_ROTATE_90 || orientation == ExifInterface.ORIENTATION_ROTATE_270 + } catch (e: Exception) { + } val res = getCurrentPath().getResolution() ?: return - if (res.x > res.y) { + val width = if (flipSides) res.y else res.x + val height = if (flipSides) res.x else res.y + if (width > height) { requestedOrientation = ActivityInfo.SCREEN_ORIENTATION_LANDSCAPE - } else if (res.x < res.y) { + } else if (width < height) { requestedOrientation = ActivityInfo.SCREEN_ORIENTATION_PORTRAIT } } From 893a60d5bbbb9b6d657ccd187f38c4c03ced688d Mon Sep 17 00:00:00 2001 From: tibbi Date: Tue, 20 Feb 2018 23:32:33 +0100 Subject: [PATCH 43/71] update version to 3.5.0 --- app/build.gradle | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/app/build.gradle b/app/build.gradle index 161420813..af7d9778d 100644 --- a/app/build.gradle +++ b/app/build.gradle @@ -10,8 +10,8 @@ android { applicationId "com.simplemobiletools.gallery" minSdkVersion 16 targetSdkVersion 27 - versionCode 161 - versionName "3.4.1" + versionCode 162 + versionName "3.5.0" multiDexEnabled true setProperty("archivesBaseName", "gallery") } From 78ae1f1d5d4c271cdff90ed36aa0dd689184b662 Mon Sep 17 00:00:00 2001 From: tibbi Date: Tue, 20 Feb 2018 23:32:40 +0100 Subject: [PATCH 44/71] updating changelog --- CHANGELOG.md | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 375d504a6..29f2597d5 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,6 +1,17 @@ Changelog ========== +Version 3.5.0 *(2018-02-20)* +---------------------------- + + * Added copy/move progress notification + * Fixed some glitches a round rotating media by aspect ratio + * Added FAQ + * Make explicit folder inclusion recursive + * Added initial OTG device support + * Rewrote third party intent handling and file handling, fixed some bugs along the way + * Probably added some new bugs + Version 3.4.1 *(2018-02-09)* ---------------------------- From 403dde02fb9d5bba70b5985d9567877208fe3395 Mon Sep 17 00:00:00 2001 From: tibbi Date: Wed, 21 Feb 2018 13:44:07 +0100 Subject: [PATCH 45/71] make sure some items are selected before trying to delete --- .../simplemobiletools/gallery/adapters/DirectoryAdapter.kt | 4 ++++ .../com/simplemobiletools/gallery/adapters/MediaAdapter.kt | 4 ++++ 2 files changed, 8 insertions(+) diff --git a/app/src/main/kotlin/com/simplemobiletools/gallery/adapters/DirectoryAdapter.kt b/app/src/main/kotlin/com/simplemobiletools/gallery/adapters/DirectoryAdapter.kt index cc3bde953..91d11445d 100644 --- a/app/src/main/kotlin/com/simplemobiletools/gallery/adapters/DirectoryAdapter.kt +++ b/app/src/main/kotlin/com/simplemobiletools/gallery/adapters/DirectoryAdapter.kt @@ -239,6 +239,10 @@ class DirectoryAdapter(activity: BaseSimpleActivity, var dirs: MutableList(selectedPositions.size) val removeFolders = ArrayList(selectedPositions.size) diff --git a/app/src/main/kotlin/com/simplemobiletools/gallery/adapters/MediaAdapter.kt b/app/src/main/kotlin/com/simplemobiletools/gallery/adapters/MediaAdapter.kt index 7c599a9b0..4a7c2a5c2 100644 --- a/app/src/main/kotlin/com/simplemobiletools/gallery/adapters/MediaAdapter.kt +++ b/app/src/main/kotlin/com/simplemobiletools/gallery/adapters/MediaAdapter.kt @@ -215,6 +215,10 @@ class MediaAdapter(activity: BaseSimpleActivity, var media: MutableList, private fun getCurrentPath() = media[selectedPositions.first()].path private fun deleteFiles() { + if (selectedPositions.isEmpty()) { + return + } + val fileDirItems = ArrayList(selectedPositions.size) val removeMedia = ArrayList(selectedPositions.size) From 3e7ce0a221c76c09053029d2e29e9906ed608a84 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Solatec=20Inform=C3=A0tica?= <35220662+Solatec@users.noreply.github.com> Date: Thu, 22 Feb 2018 15:47:01 +0100 Subject: [PATCH 46/71] Update strings.xml --- app/src/main/res/values-ca/strings.xml | 40 +++++++++++++------------- 1 file changed, 20 insertions(+), 20 deletions(-) diff --git a/app/src/main/res/values-ca/strings.xml b/app/src/main/res/values-ca/strings.xml index 950c6e4ea..56a79fd1e 100644 --- a/app/src/main/res/values-ca/strings.xml +++ b/app/src/main/res/values-ca/strings.xml @@ -144,26 +144,26 @@ Detalls estesos - How can I make Simple Gallery the default device gallery? - First you have to find the currently default gallery in the Apps section of your device settings, look for a button that says something like \"Open by default\", click on it, then select \"Clear defaults\". - The next time you will try opening an image or video you should see an app picker, where you can select Simple Gallery and make it the default app. - I locked the app with a password, but I forgot it. What can I do? - You can solve it in 2 ways. You can either reinstall the app, or find the app in your device settings and select \"Clear data\". It will reset all your settings, it will not remove any media files. - How can I make an album always appear at the top? - You can long press the desired album and select the Pin icon at the actionmenu, that will pin it to the top. You can pin multiple folders too, pinned items will be sorted by the default sorting method. - How can I fast-forward videos? - You can click on the current or max duration texts near the seekbar, that will move the video either backward, or forward. - What is the difference between hiding and excluding a folder? - Exclude prevents displaying the folder only in Simple Gallery, while Hide works system-wise and it hides the folder from other galleries too. It works by creating an empty \".nomedia\" file in the given folder, which you can then remove with any file manager too. - Why do folders with music cover art or stickers show up? - It can happen that you will see some unusual albums show up. You can easily exclude them by long pressing them and selecting Exclude. In the next dialog you can then select the parent folder, chances are it will prevent the other related albums showing up too. - A folder with images isn\'t showing up, what can I do? - That can have multiple reasons, but solving it is easy. Just go in Settings -> Manage Included Folders, select Plus and navigate to the required folder. - What if I want just a few particular folders visible? - Adding a folder at the Included Folders doesn\'t automatically exclude anything. What you can do is go in Settings -> Manage Excluded Folders, exclude the root folder \"/\", then add the desired folders at Settings -> Manage Included Folders. - That will make only the selected folders visible, as both excluding and including are recursive and if a folder is both excluded and included, it will show up. - Fullscreen images have weird artifacts, can I somehow improve the quality? - Yea, there is a toggle in Settings saying \"Replace deep zoomable images with better quality ones\", you can use that. It will improve the quality of the images, but they will get blurred once you try zooming in too much. + Com puc fer que Simple Gallery sigui la galeria de dispositius predeterminada? + Primer heu de trobar la galeria actualment predeterminada a la secció Aplicacions de la configuració del vostre dispositiu, cerqueu un botó que digui alguna cosa semblant a \"Obrir per defecte \", feu-hi clic i seleccioneu \"Esborra valors predeterminats \". + La propera vegada que proveu d\'obrir una imatge o un vídeo, haureu de veure un selector d\'aplicació, on podeu seleccionar Simple Galeria i convertir-la en la aplicació predeterminada. + Vaig bloquejar l\'aplicació amb una contrasenya, però l\'he oblidat. Què puc fer? + Es pot resoldre de dues maneres. Podeu tornar a instal·lar l\'aplicació o trobar l\'aplicació a la configuració del dispositiu i seleccionar \"Esborrar dades \". Això reiniciarà totes les configuracions, no eliminarà cap fitxer multimèdia. + Com puc fer que un àlbum sempre aparegui a la part superior? + Podeu prémer l'àlbum desitjat i seleccionar la icona de la xinxeta al menú d'acció i el fixarà a la part superior. També podeu enganxar diverses carpetes, els elements fixats s'ordenaran pel mètode de classificació predeterminat. + Com puc fer avançar els vídeos? + Podeu fer clic als textos actuals o de duració màxima que hi ha a prop de la barra de cerca, això mourà el vídeo cap a enrere o cap endavant. + Quina és la diferència entre ocultar i excloure una carpeta? + Excloure impedeix mostrar la carpeta només a Simple Galery, mentre que Ocultar també amaga la carpeta a altres galeries. Funciona creant un fitxer \". Nomedia \" buit a la carpeta donada, que podeu eliminar amb qualsevol gestor de fitxers. + Per què apareixen les carpetes amb les portades de la música o adhesius? + Pot passar que veuràs que apareixen alguns àlbums inusuals. Podeu excloure\'ls fàcilment prement-los i seleccionant Excloure. Al següent diàleg, podeu seleccionar la carpeta principal, és probable que impedeixi que apareguin altres àlbums relacionats. + Una carpeta amb imatges no apareix, què puc fer? + Això pot tenir diversos motius, però resoldre-ho és fàcil. Accediu a Configuració -> Gestiona les carpetes incloses, seleccioneu Més i navegueu fins a la carpeta necessària. + Què passa si vull veure només algunes carpetes concretes? + L\'addició d\'una carpeta a les carpetes incloses no exclou automàticament res. El que podeu fer és anar a Configuració -> Gestionar carpetes excloses, excloure la carpeta arrel \"/\" i, a continuació, afegir les carpetes desitjades a Configuració -> Gestionar carpetes incloses. + Això farà que només les carpetes seleccionades siguin visibles, ja que tant excloure com incloure són recursius i si una carpeta està exclosa i inclosa, es mostrarà. + Les imatges a pantalla completa tenen artefactes estranys, puc millorar d'alguna manera la qualitat? + Sí, hi ha un commutador a la configuració que diu \"Substituïu imatges ampliades i de gran qualitat\", podeu fer-ho. Millora la qualitat de les imatges, però es borraran una vegada que intenteu fer zoom massa. From 03164ba27d125f40c2a73b073a1f79c7f8bfecde Mon Sep 17 00:00:00 2001 From: tibbi Date: Thu, 22 Feb 2018 15:52:42 +0100 Subject: [PATCH 47/71] escaping some apostrophes --- app/src/main/res/values-ca/strings.xml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/app/src/main/res/values-ca/strings.xml b/app/src/main/res/values-ca/strings.xml index 56a79fd1e..d387bb0bc 100644 --- a/app/src/main/res/values-ca/strings.xml +++ b/app/src/main/res/values-ca/strings.xml @@ -150,7 +150,7 @@ Vaig bloquejar l\'aplicació amb una contrasenya, però l\'he oblidat. Què puc fer? Es pot resoldre de dues maneres. Podeu tornar a instal·lar l\'aplicació o trobar l\'aplicació a la configuració del dispositiu i seleccionar \"Esborrar dades \". Això reiniciarà totes les configuracions, no eliminarà cap fitxer multimèdia. Com puc fer que un àlbum sempre aparegui a la part superior? - Podeu prémer l'àlbum desitjat i seleccionar la icona de la xinxeta al menú d'acció i el fixarà a la part superior. També podeu enganxar diverses carpetes, els elements fixats s'ordenaran pel mètode de classificació predeterminat. + Podeu prémer l\'àlbum desitjat i seleccionar la icona de la xinxeta al menú d\'acció i el fixarà a la part superior. També podeu enganxar diverses carpetes, els elements fixats s'ordenaran pel mètode de classificació predeterminat. Com puc fer avançar els vídeos? Podeu fer clic als textos actuals o de duració màxima que hi ha a prop de la barra de cerca, això mourà el vídeo cap a enrere o cap endavant. Quina és la diferència entre ocultar i excloure una carpeta? @@ -162,7 +162,7 @@ Què passa si vull veure només algunes carpetes concretes? L\'addició d\'una carpeta a les carpetes incloses no exclou automàticament res. El que podeu fer és anar a Configuració -> Gestionar carpetes excloses, excloure la carpeta arrel \"/\" i, a continuació, afegir les carpetes desitjades a Configuració -> Gestionar carpetes incloses. Això farà que només les carpetes seleccionades siguin visibles, ja que tant excloure com incloure són recursius i si una carpeta està exclosa i inclosa, es mostrarà. - Les imatges a pantalla completa tenen artefactes estranys, puc millorar d'alguna manera la qualitat? + Les imatges a pantalla completa tenen artefactes estranys, puc millorar d\'alguna manera la qualitat? Sí, hi ha un commutador a la configuració que diu \"Substituïu imatges ampliades i de gran qualitat\", podeu fer-ho. Millora la qualitat de les imatges, però es borraran una vegada que intenteu fer zoom massa. From 91661f6d82a57742d2b621b0cec6a26cb16c3ca2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Solatec=20Inform=C3=A0tica?= <35220662+Solatec@users.noreply.github.com> Date: Thu, 22 Feb 2018 15:58:39 +0100 Subject: [PATCH 48/71] Update strings.xml --- app/src/main/res/values-es/strings.xml | 40 +++++++++++++------------- 1 file changed, 20 insertions(+), 20 deletions(-) diff --git a/app/src/main/res/values-es/strings.xml b/app/src/main/res/values-es/strings.xml index b0b4632cb..3801bd937 100644 --- a/app/src/main/res/values-es/strings.xml +++ b/app/src/main/res/values-es/strings.xml @@ -144,26 +144,26 @@ Detalles ampliados - How can I make Simple Gallery the default device gallery? - First you have to find the currently default gallery in the Apps section of your device settings, look for a button that says something like \"Open by default\", click on it, then select \"Clear defaults\". - The next time you will try opening an image or video you should see an app picker, where you can select Simple Gallery and make it the default app. - I locked the app with a password, but I forgot it. What can I do? - You can solve it in 2 ways. You can either reinstall the app, or find the app in your device settings and select \"Clear data\". It will reset all your settings, it will not remove any media files. - How can I make an album always appear at the top? - You can long press the desired album and select the Pin icon at the actionmenu, that will pin it to the top. You can pin multiple folders too, pinned items will be sorted by the default sorting method. - How can I fast-forward videos? - You can click on the current or max duration texts near the seekbar, that will move the video either backward, or forward. - What is the difference between hiding and excluding a folder? - Exclude prevents displaying the folder only in Simple Gallery, while Hide works system-wise and it hides the folder from other galleries too. It works by creating an empty \".nomedia\" file in the given folder, which you can then remove with any file manager too. - Why do folders with music cover art or stickers show up? - It can happen that you will see some unusual albums show up. You can easily exclude them by long pressing them and selecting Exclude. In the next dialog you can then select the parent folder, chances are it will prevent the other related albums showing up too. - A folder with images isn\'t showing up, what can I do? - That can have multiple reasons, but solving it is easy. Just go in Settings -> Manage Included Folders, select Plus and navigate to the required folder. - What if I want just a few particular folders visible? - Adding a folder at the Included Folders doesn\'t automatically exclude anything. What you can do is go in Settings -> Manage Excluded Folders, exclude the root folder \"/\", then add the desired folders at Settings -> Manage Included Folders. - That will make only the selected folders visible, as both excluding and including are recursive and if a folder is both excluded and included, it will show up. - Fullscreen images have weird artifacts, can I somehow improve the quality? - Yea, there is a toggle in Settings saying \"Replace deep zoomable images with better quality ones\", you can use that. It will improve the quality of the images, but they will get blurred once you try zooming in too much. + ¿Cómo puedo hacer que Simple Gallery sea la galería de dispositivos predeterminada? + Primero tiene que encontrar la galería predeterminada actualmente en la sección Aplicaciones de la configuración de su dispositivo, busque un botón que diga algo como \"Abrir por defecto \", haga clic en él, luego seleccione \"Borrar valores predeterminados \". + La próxima vez que intente abrir una imagen o video, debería ver un selector de aplicaciones, donde puede seleccionar Galería simple y convertirla en la aplicación predeterminada. + He protegido la aplicación con una contraseña, pero la he olvidado. ¿Que puedo hacer? + Puedes resolverlo de 2 maneras. Puede reinstalar la aplicación o encontrar la aplicación en la configuración de su dispositivo y seleccionar \"Borrar datos \". Restablecerá todas sus configuraciones, no eliminará ningún archivo multimedia. + ¿Cómo puedo hacer que un álbum siempre aparezca en la parte superior? + Puede aguantar pulaso el álbum deseado y seleccionar el ícono Pin en el menú de acción, que lo fijará en la parte superior. También puede anclar varias carpetas, los artículos fijados se ordenarán por el método de clasificación predeterminado. + ¿Cómo puedo avanzar videos? + Puede hacer clic en los textos de duración actual o máxima cerca de la barra de búsqueda, que moverán el video hacia atrás o hacia adelante. + ¿Cuál es la diferencia entre ocultar y excluir una carpeta? + Excluir evita mostrar la carpeta solo en Simple Gallery, mientras que Ocultar funciona en el sistema y oculta la carpeta de otras galerías también. Funciona al crear un archivo \".nomedia \" vacío en la carpeta determinada, que luego puede eliminar también con cualquier administrador de archivos. + ¿Por qué aparecen las carpetas con la portada de la música o las pegatinas? + Puede suceder que veas aparecer algunos álbumes inusuales. Puede excluirlos fácilmente presionándolos durante mucho tiempo y seleccionando Excluir. En el siguiente cuadro de diálogo, puede seleccionar la carpeta principal, lo más probable es que evite que aparezcan otros álbumes relacionados. + Una carpeta con imágenes no aparece, ¿qué puedo hacer? + Eso puede tener múltiples razones, pero resolverlo es fácil. Simplemente vaya a Configuración -> Administrar carpetas incluidas, seleccione Más y vaya a la carpeta requerida. + ¿Qué pasa si quiero solo algunas carpetas concretas visibles? + Agregar una carpeta en las carpetas incluidas no excluye automáticamente nada. Lo que puede hacer es ir a Ajustes -> Administrar carpetas excluidas, excluir la carpeta raíz \"/\", luego agregar las carpetas deseadas en Configuración -> Administrar carpetas incluidas. + Esto hará que solo las carpetas seleccionadas sean visibles, ya que tanto la exclusión como la inclusión son recursivas y si una carpeta está excluida e incluida, aparecerá. + Las imágenes a pantalla completa tienen artefactos extraños, ¿puedo de alguna manera mejorar la calidad? + Sí, hay una alternancia en Configuración que dice \"Reemplazar imágenes con zoom profundo con las de mejor calidad\", puedes usar eso. Mejorará la calidad de las imágenes, pero se volverán borrosas una vez que intente ampliar demasiado. From f27cf3ba66fce11cf69936bd78b1d91dfc8d0a1c Mon Sep 17 00:00:00 2001 From: fricyo <30796677+fricyo@users.noreply.github.com> Date: Fri, 23 Feb 2018 14:38:29 +0800 Subject: [PATCH 49/71] Update Translation --- app/src/main/res/values-zh-rTW/strings.xml | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/app/src/main/res/values-zh-rTW/strings.xml b/app/src/main/res/values-zh-rTW/strings.xml index 369a9def6..647c2b65a 100644 --- a/app/src/main/res/values-zh-rTW/strings.xml +++ b/app/src/main/res/values-zh-rTW/strings.xml @@ -162,8 +162,8 @@ 如果我只想看到幾個特定的資料夾,怎麼做? 在[包含資料夾]內添加資料夾並不會自動排除任何東西。你能做的是到[設定] -> [管理排除資料夾],排除根目錄 \"/\",然後在[設定] -> [管理包含資料夾]添加想要的資料夾。 那樣的話就只有選擇的資料夾可見。因為排除和包含都是遞迴的,如果一個資料夾被排除又被包含,則會顯示出來。 - Fullscreen images have weird artifacts, can I somehow improve the quality? - Yea, there is a toggle in Settings saying \"Replace deep zoomable images with better quality ones\", you can use that. It will improve the quality of the images, but they will get blurred once you try zooming in too much. + 全螢幕圖片有雜質,我有辦法提高品質嗎? + 可啊,[設定]內有個開關叫做「可深度縮放的圖片用品質更佳的來取代」,你能用用看。這會提高圖片的品質,不過一旦你放大太多就會模糊掉。 @@ -171,13 +171,13 @@ 一個適合用來瀏覽相片和影片的簡單工具。可以根據日期、大小、名稱來遞增或遞減排序項目,相片能被縮放。媒體檔案會依畫面大小呈現在數個欄位內,你可以使用縮放手勢來改變欄數。媒體檔案可以重新命名、分享、刪除、複製、移動;圖片還能縮放、旋轉、翻轉,或者直接設為桌布。 - 這相簿也支援第三方應用,像是預覽圖片/影片、添加電子信箱附件...等功能,日常使用上相當適合。 + 這相簿也支援第三方使用,像是預覽圖片/影片、添加電子信箱附件...等功能,日常使用上相當適合。 指紋權限用來鎖定隱藏的項目或是整個程式。 - 優點包含沒廣告,也沒非必要的權限,而且完全開放原始碼,並提供自訂顏色。 + 不包含廣告,也沒非必要的權限,而且完全開放原始碼,並提供自訂顏色。 - 這只是一個大系列應用程式的其中一項程式,你可以在這發現更多 http://www.simplemobiletools.com + 這程式只是一個大系列應用程式中的其中一項,你可以在這發現更多 http://www.simplemobiletools.com Suodata media @@ -43,8 +43,8 @@ Kansion poissulkeminen piilottaa kansion alikansioineen vain Simple Galleryssa, ne jäävät näkyviin muihin sovelluksiin.\n\nJos haluat piilottaa kansion myös muissa sovelluksissa, käytä piilota-funktiota. Poista kaikki Poista kaikki kansiot poissuljettujen listasta? Tämä ei poista kansioita. - Hidden folders - Manage hidden folders + Piilotetut kansiot + Hallitse piilotettuja kansioita Seems like you don\'t have any folders hidden with a \".nomedia\" file. @@ -89,9 +89,9 @@ Taustakuva asetettu onnistuneesti Kuvasuhde pystyssä Kuvasuhde vaakatasossa - Home screen - Lock screen - Home and lock screen + Aloitusnäyttö + Lukitusnäyttö + Aloitusnäyttö ja lukitusnäyttö Diaesitys @@ -122,29 +122,29 @@ Järjestelmän asetukset Laitteen kierto Kuvasuhde - Black background and status bar at fullscreen media + Musta tausta ja tilapalkki täyden ruudun tilassa Vieritä pienoiskuvia vaakasuorassa Piilota järjestelmän UI automaattisesti koko näytön mediassa Poista tyhjät kansiot kansion tyhjennyksen jälkeen - Allow controlling photo brightness with vertical gestures + Salli kirkkauden säätäminen pystysuorilla eleillä Salli videon äänenvoimakkuuden ja kirkkauden säätö pystysuorilla eleillä - Show folder media count on the main view + Näytä kansioiden sisällön määrä päänäkymässä Korvaa jakaminen kääntämisellä koko näytön tilassa - Show extended details over fullscreen media - Manage extended details - Allow one finger zoom at fullscreen media - Allow instantly changing media by clicking on screen sides - Replace deep zoomable images with better quality ones - Hide extended details when status bar is hidden - Do an extra check to avoid showing invalid files + Näytä yksityiskohtaiset tiedot täyden näytön tilassa + Hallitse yksityiskohtaisia tietoja + Salli lähentäminen yhdellä sormella täyden ruudun tilassa + Salli median selaaminen ruudun reunoja koskettamalla + Korvaa syvälle lähennettävät kuvat parempilaatuisella + Piilota yksityiskohtaiset tiedot kun tilapalkki on piilotettu + Tee ylimääräinen tarkistus rikkinäisten tiedostojen varalta - Thumbnails - Fullscreen media - Extended details + Esikatselukuvat + Täyden näytön media + Yksityiskohtaiset tiedot - How can I make Simple Gallery the default device gallery? + Miten voin tehdä Simple Gallerystä oletusgalleriasovelluksen? First you have to find the currently default gallery in the Apps section of your device settings, look for a button that says something like \"Open by default\", click on it, then select \"Clear defaults\". The next time you will try opening an image or video you should see an app picker, where you can select Simple Gallery and make it the default app. I locked the app with a password, but I forgot it. What can I do? From 7289d0a8ea05d62f3b2ed505ce496aa8b892150e Mon Sep 17 00:00:00 2001 From: tibbi Date: Fri, 23 Feb 2018 22:17:38 +0100 Subject: [PATCH 53/71] adding a new FAQ item --- .../com/simplemobiletools/gallery/extensions/Activity.kt | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/app/src/main/kotlin/com/simplemobiletools/gallery/extensions/Activity.kt b/app/src/main/kotlin/com/simplemobiletools/gallery/extensions/Activity.kt index 813965564..87a1b6971 100644 --- a/app/src/main/kotlin/com/simplemobiletools/gallery/extensions/Activity.kt +++ b/app/src/main/kotlin/com/simplemobiletools/gallery/extensions/Activity.kt @@ -72,8 +72,9 @@ fun Activity.launchCamera() { } fun SimpleActivity.launchAbout() { - val faqItems = arrayOf( + val faqItems = arrayListOf( FAQItem(R.string.faq_2_title_commons, R.string.faq_2_text_commons), + FAQItem(R.string.faq_3_title_commons, R.string.faq_3_text_commons), FAQItem(R.string.faq_1_title, R.string.faq_1_text), FAQItem(R.string.faq_2_title, R.string.faq_2_text), FAQItem(R.string.faq_3_title, R.string.faq_3_text), From 72ffa243a5a747046962d517b38fb4bc5bacce48 Mon Sep 17 00:00:00 2001 From: tibbi Date: Fri, 23 Feb 2018 23:16:17 +0100 Subject: [PATCH 54/71] fix #668, properly handle Instant media change with Aspect Ratio rotation --- .../simplemobiletools/gallery/activities/ViewPagerActivity.kt | 2 ++ 1 file changed, 2 insertions(+) diff --git a/app/src/main/kotlin/com/simplemobiletools/gallery/activities/ViewPagerActivity.kt b/app/src/main/kotlin/com/simplemobiletools/gallery/activities/ViewPagerActivity.kt index 646f734ec..e5ae3cc86 100644 --- a/app/src/main/kotlin/com/simplemobiletools/gallery/activities/ViewPagerActivity.kt +++ b/app/src/main/kotlin/com/simplemobiletools/gallery/activities/ViewPagerActivity.kt @@ -859,10 +859,12 @@ class ViewPagerActivity : SimpleActivity(), ViewPager.OnPageChangeListener, View override fun goToPrevItem() { view_pager.setCurrentItem(view_pager.currentItem - 1, false) + checkOrientation() } override fun goToNextItem() { view_pager.setCurrentItem(view_pager.currentItem + 1, false) + checkOrientation() } private fun checkSystemUI() { From 9280533c74702df481b30b29f9162d206ad500d5 Mon Sep 17 00:00:00 2001 From: tibbi Date: Fri, 23 Feb 2018 23:30:09 +0100 Subject: [PATCH 55/71] added a toggle for always skipping Delete confirmation dialog --- app/build.gradle | 2 +- .../gallery/activities/SettingsActivity.kt | 9 ++++++++ .../gallery/activities/ViewPagerActivity.kt | 2 +- .../gallery/adapters/DirectoryAdapter.kt | 6 ++++- .../gallery/adapters/MediaAdapter.kt | 2 +- app/src/main/res/layout/activity_settings.xml | 23 +++++++++++++++++++ 6 files changed, 40 insertions(+), 4 deletions(-) diff --git a/app/build.gradle b/app/build.gradle index cf8c2d5be..1766d3de5 100644 --- a/app/build.gradle +++ b/app/build.gradle @@ -46,7 +46,7 @@ ext { } dependencies { - implementation 'com.simplemobiletools:commons:3.12.22' + implementation 'com.simplemobiletools:commons:3.12.24' implementation 'com.theartofdev.edmodo:android-image-cropper:2.6.0' implementation 'com.android.support:multidex:1.0.2' implementation 'com.google.code.gson:gson:2.8.2' diff --git a/app/src/main/kotlin/com/simplemobiletools/gallery/activities/SettingsActivity.kt b/app/src/main/kotlin/com/simplemobiletools/gallery/activities/SettingsActivity.kt index 4d16a3980..09e3c774c 100644 --- a/app/src/main/kotlin/com/simplemobiletools/gallery/activities/SettingsActivity.kt +++ b/app/src/main/kotlin/com/simplemobiletools/gallery/activities/SettingsActivity.kt @@ -63,6 +63,7 @@ class SettingsActivity : SimpleActivity() { setupShowExtendedDetails() setupHideExtendedDetails() setupManageExtendedDetails() + setupSkipDeleteConfirmation() updateTextColors(settings_holder) setupSectionColors() } @@ -363,6 +364,14 @@ class SettingsActivity : SimpleActivity() { } } + private fun setupSkipDeleteConfirmation() { + settings_skip_delete_confirmation.isChecked = config.skipDeleteConfirmation + settings_skip_delete_confirmation_holder.setOnClickListener { + settings_skip_delete_confirmation.toggle() + config.skipDeleteConfirmation = settings_skip_delete_confirmation.isChecked + } + } + private fun setupScreenRotation() { settings_screen_rotation.text = getScreenRotationText() settings_screen_rotation_holder.setOnClickListener { diff --git a/app/src/main/kotlin/com/simplemobiletools/gallery/activities/ViewPagerActivity.kt b/app/src/main/kotlin/com/simplemobiletools/gallery/activities/ViewPagerActivity.kt index e5ae3cc86..386737db0 100644 --- a/app/src/main/kotlin/com/simplemobiletools/gallery/activities/ViewPagerActivity.kt +++ b/app/src/main/kotlin/com/simplemobiletools/gallery/activities/ViewPagerActivity.kt @@ -724,7 +724,7 @@ class ViewPagerActivity : SimpleActivity(), ViewPager.OnPageChangeListener, View } private fun checkDeleteConfirmation() { - if (mSkipConfirmationDialog) { + if (mSkipConfirmationDialog || config.skipDeleteConfirmation) { deleteConfirmed() } else { askConfirmDelete() diff --git a/app/src/main/kotlin/com/simplemobiletools/gallery/adapters/DirectoryAdapter.kt b/app/src/main/kotlin/com/simplemobiletools/gallery/adapters/DirectoryAdapter.kt index 91d11445d..8cc83bb5d 100644 --- a/app/src/main/kotlin/com/simplemobiletools/gallery/adapters/DirectoryAdapter.kt +++ b/app/src/main/kotlin/com/simplemobiletools/gallery/adapters/DirectoryAdapter.kt @@ -233,8 +233,12 @@ class DirectoryAdapter(activity: BaseSimpleActivity, var dirs: MutableList, } private fun checkDeleteConfirmation() { - if (skipConfirmationDialog) { + if (skipConfirmationDialog || config.skipDeleteConfirmation) { deleteFiles() } else { askConfirmDelete() diff --git a/app/src/main/res/layout/activity_settings.xml b/app/src/main/res/layout/activity_settings.xml index 98d195bbb..c1bfe8b79 100644 --- a/app/src/main/res/layout/activity_settings.xml +++ b/app/src/main/res/layout/activity_settings.xml @@ -895,5 +895,28 @@ android:text="@string/keep_last_modified"/> + + + + + + From a5372f97a364e5b0f69bae7d8f8b7c50c4fd84cd Mon Sep 17 00:00:00 2001 From: tibbi Date: Sat, 24 Feb 2018 00:21:46 +0100 Subject: [PATCH 56/71] add a switch for toggling Pull-to-refresh --- app/build.gradle | 2 +- .../gallery/activities/MainActivity.kt | 2 +- .../gallery/activities/MediaActivity.kt | 3 +- .../gallery/activities/SettingsActivity.kt | 9 ++++++ .../gallery/helpers/Config.kt | 4 --- .../gallery/helpers/Constants.kt | 1 - app/src/main/res/layout/activity_settings.xml | 29 +++++++++++++++++-- 7 files changed, 38 insertions(+), 12 deletions(-) diff --git a/app/build.gradle b/app/build.gradle index 1766d3de5..eba887b67 100644 --- a/app/build.gradle +++ b/app/build.gradle @@ -46,7 +46,7 @@ ext { } dependencies { - implementation 'com.simplemobiletools:commons:3.12.24' + implementation 'com.simplemobiletools:commons:3.13.0' implementation 'com.theartofdev.edmodo:android-image-cropper:2.6.0' implementation 'com.android.support:multidex:1.0.2' implementation 'com.google.code.gson:gson:2.8.2' diff --git a/app/src/main/kotlin/com/simplemobiletools/gallery/activities/MainActivity.kt b/app/src/main/kotlin/com/simplemobiletools/gallery/activities/MainActivity.kt index ccfaa66f6..c6b8469fd 100644 --- a/app/src/main/kotlin/com/simplemobiletools/gallery/activities/MainActivity.kt +++ b/app/src/main/kotlin/com/simplemobiletools/gallery/activities/MainActivity.kt @@ -137,6 +137,7 @@ class MainActivity : SimpleActivity(), DirectoryAdapter.DirOperationsListener { directories_horizontal_fastscroller.updateBubbleColors() directories_vertical_fastscroller.updateBubbleColors() + directories_refresh_layout.isEnabled = config.enablePullToRefresh invalidateOptionsMenu() directories_empty_text_label.setTextColor(config.textColor) directories_empty_text.setTextColor(getAdjustedPrimaryColor()) @@ -622,7 +623,6 @@ class MainActivity : SimpleActivity(), DirectoryAdapter.DirOperationsListener { private fun setupScrollDirection() { val allowHorizontalScroll = config.scrollHorizontally && config.viewTypeFolders == VIEW_TYPE_GRID - directories_refresh_layout.isEnabled = !config.scrollHorizontally directories_vertical_fastscroller.isHorizontal = false directories_vertical_fastscroller.beGoneIf(allowHorizontalScroll) diff --git a/app/src/main/kotlin/com/simplemobiletools/gallery/activities/MediaActivity.kt b/app/src/main/kotlin/com/simplemobiletools/gallery/activities/MediaActivity.kt index 081d0df72..5b5d07f84 100644 --- a/app/src/main/kotlin/com/simplemobiletools/gallery/activities/MediaActivity.kt +++ b/app/src/main/kotlin/com/simplemobiletools/gallery/activities/MediaActivity.kt @@ -134,6 +134,7 @@ class MediaActivity : SimpleActivity(), MediaAdapter.MediaOperationsListener { media_horizontal_fastscroller.updateBubbleColors() media_vertical_fastscroller.updateBubbleColors() + media_refresh_layout.isEnabled = config.enablePullToRefresh tryloadGallery() invalidateOptionsMenu() media_empty_text_label.setTextColor(config.textColor) @@ -329,8 +330,6 @@ class MediaActivity : SimpleActivity(), MediaAdapter.MediaOperationsListener { private fun setupScrollDirection() { val allowHorizontalScroll = config.scrollHorizontally && config.viewTypeFiles == VIEW_TYPE_GRID - media_refresh_layout.isEnabled = !config.scrollHorizontally - media_vertical_fastscroller.isHorizontal = false media_vertical_fastscroller.beGoneIf(allowHorizontalScroll) diff --git a/app/src/main/kotlin/com/simplemobiletools/gallery/activities/SettingsActivity.kt b/app/src/main/kotlin/com/simplemobiletools/gallery/activities/SettingsActivity.kt index 09e3c774c..0930d4463 100644 --- a/app/src/main/kotlin/com/simplemobiletools/gallery/activities/SettingsActivity.kt +++ b/app/src/main/kotlin/com/simplemobiletools/gallery/activities/SettingsActivity.kt @@ -57,6 +57,7 @@ class SettingsActivity : SimpleActivity() { setupShowMediaCount() setupKeepLastModified() setupShowInfoBubble() + setupEnablePullToRefresh() setupOneFingerZoom() setupAllowInstantChange() setupReplaceZoomableImages() @@ -310,6 +311,14 @@ class SettingsActivity : SimpleActivity() { } } + private fun setupEnablePullToRefresh() { + settings_enable_pull_to_refresh.isChecked = config.enablePullToRefresh + settings_enable_pull_to_refresh_holder.setOnClickListener { + settings_enable_pull_to_refresh.toggle() + config.enablePullToRefresh = settings_enable_pull_to_refresh.isChecked + } + } + private fun setupOneFingerZoom() { settings_one_finger_zoom.isChecked = config.oneFingerZoom settings_one_finger_zoom_holder.setOnClickListener { diff --git a/app/src/main/kotlin/com/simplemobiletools/gallery/helpers/Config.kt b/app/src/main/kotlin/com/simplemobiletools/gallery/helpers/Config.kt index e8a691f53..c8543c2e4 100644 --- a/app/src/main/kotlin/com/simplemobiletools/gallery/helpers/Config.kt +++ b/app/src/main/kotlin/com/simplemobiletools/gallery/helpers/Config.kt @@ -233,10 +233,6 @@ class Config(context: Context) : BaseConfig(context) { return Gson().fromJson>(albumCovers, listType) ?: ArrayList(1) } - var scrollHorizontally: Boolean - get() = prefs.getBoolean(SCROLL_HORIZONTALLY, false) - set(scrollHorizontally) = prefs.edit().putBoolean(SCROLL_HORIZONTALLY, scrollHorizontally).apply() - var hideSystemUI: Boolean get() = prefs.getBoolean(HIDE_SYSTEM_UI, false) set(hideSystemUI) = prefs.edit().putBoolean(HIDE_SYSTEM_UI, hideSystemUI).apply() diff --git a/app/src/main/kotlin/com/simplemobiletools/gallery/helpers/Constants.kt b/app/src/main/kotlin/com/simplemobiletools/gallery/helpers/Constants.kt index 9d30dd61f..bf251b41b 100644 --- a/app/src/main/kotlin/com/simplemobiletools/gallery/helpers/Constants.kt +++ b/app/src/main/kotlin/com/simplemobiletools/gallery/helpers/Constants.kt @@ -30,7 +30,6 @@ const val HIDE_FOLDER_TOOLTIP_SHOWN = "hide_folder_tooltip_shown" const val EXCLUDED_FOLDERS = "excluded_folders" const val INCLUDED_FOLDERS = "included_folders" const val ALBUM_COVERS = "album_covers" -const val SCROLL_HORIZONTALLY = "scroll_horizontally" const val HIDE_SYSTEM_UI = "hide_system_ui" const val REPLACE_SHARE_WITH_ROTATE = "replace_share_with_rotate" const val DELETE_EMPTY_FOLDERS = "delete_empty_folders" diff --git a/app/src/main/res/layout/activity_settings.xml b/app/src/main/res/layout/activity_settings.xml index c1bfe8b79..a41f8df5c 100644 --- a/app/src/main/res/layout/activity_settings.xml +++ b/app/src/main/res/layout/activity_settings.xml @@ -401,6 +401,29 @@ android:textAllCaps="true" android:textSize="@dimen/smaller_text_size"/> + + + + + + + android:text="@string/enable_pull_to_refresh"/> From f121a6563fd342bcd13a4da634a578b529c8a140 Mon Sep 17 00:00:00 2001 From: kniddl <10777535+kniddl@users.noreply.github.com> Date: Sat, 24 Feb 2018 15:22:16 +0100 Subject: [PATCH 57/71] Updated German FAQ section --- app/src/main/res/values-de/strings.xml | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/app/src/main/res/values-de/strings.xml b/app/src/main/res/values-de/strings.xml index 49cdc556d..2aaa5215e 100644 --- a/app/src/main/res/values-de/strings.xml +++ b/app/src/main/res/values-de/strings.xml @@ -144,15 +144,15 @@ Erweiterte Details - How can I make Simple Gallery the default device gallery? - First you have to find the currently default gallery in the Apps section of your device settings, look for a button that says something like \"Open by default\", click on it, then select \"Clear defaults\". - The next time you will try opening an image or video you should see an app picker, where you can select Simple Gallery and make it the default app. - I locked the app with a password, but I forgot it. What can I do? - You can solve it in 2 ways. You can either reinstall the app, or find the app in your device settings and select \"Clear data\". It will reset all your settings, it will not remove any media files. - How can I make an album always appear at the top? - You can long press the desired album and select the Pin icon at the actionmenu, that will pin it to the top. You can pin multiple folders too, pinned items will be sorted by the default sorting method. - How can I fast-forward videos? - You can click on the current or max duration texts near the seekbar, that will move the video either backward, or forward. + Wie kann ich Schlichte Galerie als Standardanwendung auswählen? + Zunächst musst du unter \"Apps\" in den Geräteeinstellungen die aktuelle Standardgalerie finden. Suche nach einer Bedienfläche wie \"Standardmässig öffnen\", betätige diese und wähle \"Standardeinstellungen löschen\". + Das nächste Mal, wenn du ein Bild oder ein Video öffnest, sollte ein Appwähler erscheinen und Schlichte Gallerie als Standard ausgewählt werden können. + Ich habe die App mit einem Passwort geschützt, aber ich habe es vergessen. Was kann ich tun? + Es gibt zwei Möglichkeiten: Entweder du installierst die App erneut oder du gehst unter Apps in den Geräteeinstellungen und wählst \"Daten löschen\". Alle Einstellungen werden zurückgesetzt, alle Mediendateien bleiben unberührt. + Wie kann ich ein Album immer zuoberst erscheinen lassen? + Du kannst lange auf das gewünschte Album drücken und im Aktionsmenü das Stecknadelsymbol auswählen; es wird nun zuoberst angepinnt. Ebenso kannst du mehrere Ordner anpinnen. Angepinnte Objekte werden nach der Standardmethode sortiert. + Wie kann ich Videos vorspulen? + Du kannst auf den Text der aktuellen oder der maximalen Dauer nahe der Suchleiste drücken, um das Video zurück- oder vorzuspulen. What is the difference between hiding and excluding a folder? Exclude prevents displaying the folder only in Simple Gallery, while Hide works system-wise and it hides the folder from other galleries too. It works by creating an empty \".nomedia\" file in the given folder, which you can then remove with any file manager too. Why do folders with music cover art or stickers show up? From 97236d6ed2c95228ebd41d3e9794677863863ac7 Mon Sep 17 00:00:00 2001 From: tibbi Date: Sat, 24 Feb 2018 20:16:03 +0100 Subject: [PATCH 58/71] always refresh viewpager when successfully returning from the editor --- app/build.gradle | 2 +- .../com/simplemobiletools/gallery/activities/EditActivity.kt | 2 +- .../com/simplemobiletools/gallery/activities/MainActivity.kt | 3 ++- .../simplemobiletools/gallery/activities/ViewPagerActivity.kt | 1 + 4 files changed, 5 insertions(+), 3 deletions(-) diff --git a/app/build.gradle b/app/build.gradle index eba887b67..0f3fcb483 100644 --- a/app/build.gradle +++ b/app/build.gradle @@ -46,7 +46,7 @@ ext { } dependencies { - implementation 'com.simplemobiletools:commons:3.13.0' + implementation 'com.simplemobiletools:commons:3.13.4' implementation 'com.theartofdev.edmodo:android-image-cropper:2.6.0' implementation 'com.android.support:multidex:1.0.2' implementation 'com.google.code.gson:gson:2.8.2' diff --git a/app/src/main/kotlin/com/simplemobiletools/gallery/activities/EditActivity.kt b/app/src/main/kotlin/com/simplemobiletools/gallery/activities/EditActivity.kt index 54de2bfd5..37a17ae93 100644 --- a/app/src/main/kotlin/com/simplemobiletools/gallery/activities/EditActivity.kt +++ b/app/src/main/kotlin/com/simplemobiletools/gallery/activities/EditActivity.kt @@ -204,7 +204,7 @@ class EditActivity : SimpleActivity(), CropImageView.OnCropImageCompleteListener Thread { val file = File(path) val fileDirItem = FileDirItem(path, path.getFilenameFromPath()) - getFileOutputStream(fileDirItem) { + getFileOutputStream(fileDirItem, true) { if (it != null) { saveBitmap(file, bitmap, it) } else { diff --git a/app/src/main/kotlin/com/simplemobiletools/gallery/activities/MainActivity.kt b/app/src/main/kotlin/com/simplemobiletools/gallery/activities/MainActivity.kt index c6b8469fd..3803f5b59 100644 --- a/app/src/main/kotlin/com/simplemobiletools/gallery/activities/MainActivity.kt +++ b/app/src/main/kotlin/com/simplemobiletools/gallery/activities/MainActivity.kt @@ -654,8 +654,9 @@ class MainActivity : SimpleActivity(), DirectoryAdapter.DirOperationsListener { } private fun checkLastMediaChanged() { - if (isActivityDestroyed()) + if (isActivityDestroyed()) { return + } mLastMediaHandler.removeCallbacksAndMessages(null) mLastMediaHandler.postDelayed({ diff --git a/app/src/main/kotlin/com/simplemobiletools/gallery/activities/ViewPagerActivity.kt b/app/src/main/kotlin/com/simplemobiletools/gallery/activities/ViewPagerActivity.kt index 386737db0..605565680 100644 --- a/app/src/main/kotlin/com/simplemobiletools/gallery/activities/ViewPagerActivity.kt +++ b/app/src/main/kotlin/com/simplemobiletools/gallery/activities/ViewPagerActivity.kt @@ -713,6 +713,7 @@ class ViewPagerActivity : SimpleActivity(), ViewPager.OnPageChangeListener, View if (requestCode == REQUEST_EDIT_IMAGE) { if (resultCode == Activity.RESULT_OK && resultData != null) { mPos = -1 + mPrevHashcode = 0 refreshViewPager() } } else if (requestCode == REQUEST_SET_AS) { From 9366db12ce592ebee789822d6cd71a4f2ed1dcc8 Mon Sep 17 00:00:00 2001 From: tibbi Date: Sat, 24 Feb 2018 23:46:44 +0100 Subject: [PATCH 59/71] update commons to 3.13.6 --- app/build.gradle | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/build.gradle b/app/build.gradle index 0f3fcb483..30cfc7400 100644 --- a/app/build.gradle +++ b/app/build.gradle @@ -46,7 +46,7 @@ ext { } dependencies { - implementation 'com.simplemobiletools:commons:3.13.4' + implementation 'com.simplemobiletools:commons:3.13.6' implementation 'com.theartofdev.edmodo:android-image-cropper:2.6.0' implementation 'com.android.support:multidex:1.0.2' implementation 'com.google.code.gson:gson:2.8.2' From 6e31046b995374829c75f9587d868d40df3f10c2 Mon Sep 17 00:00:00 2001 From: tibbi Date: Sun, 25 Feb 2018 00:11:42 +0100 Subject: [PATCH 60/71] add the 2 new toggles in the release notes --- .../com/simplemobiletools/gallery/activities/MainActivity.kt | 1 + app/src/main/res/values/donottranslate.xml | 1 + 2 files changed, 2 insertions(+) diff --git a/app/src/main/kotlin/com/simplemobiletools/gallery/activities/MainActivity.kt b/app/src/main/kotlin/com/simplemobiletools/gallery/activities/MainActivity.kt index 3803f5b59..c4142ac5b 100644 --- a/app/src/main/kotlin/com/simplemobiletools/gallery/activities/MainActivity.kt +++ b/app/src/main/kotlin/com/simplemobiletools/gallery/activities/MainActivity.kt @@ -726,6 +726,7 @@ class MainActivity : SimpleActivity(), DirectoryAdapter.DirOperationsListener { add(Release(143, R.string.release_143)) add(Release(158, R.string.release_158)) add(Release(159, R.string.release_159)) + add(Release(163, R.string.release_163)) checkWhatsNew(this, BuildConfig.VERSION_CODE) } } diff --git a/app/src/main/res/values/donottranslate.xml b/app/src/main/res/values/donottranslate.xml index 929e5a89d..09fed2594 100644 --- a/app/src/main/res/values/donottranslate.xml +++ b/app/src/main/res/values/donottranslate.xml @@ -2,6 +2,7 @@ + Added toggles for disabling Pull-to-refresh and permanent Delete dialog confirmation skipping Added a toggle for replacing deep zoomable images with better quality ones\n Added a toggle for hiding Extended details when the statusbar is hidden\n From 9a29feafb8e483a9dc4c26ad4002302979f83b00 Mon Sep 17 00:00:00 2001 From: tibbi Date: Sun, 25 Feb 2018 00:13:04 +0100 Subject: [PATCH 61/71] update version to 3.5.1 --- app/build.gradle | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/app/build.gradle b/app/build.gradle index 30cfc7400..7179a8da5 100644 --- a/app/build.gradle +++ b/app/build.gradle @@ -10,8 +10,8 @@ android { applicationId "com.simplemobiletools.gallery" minSdkVersion 16 targetSdkVersion 27 - versionCode 162 - versionName "3.5.0" + versionCode 163 + versionName "3.5.1" multiDexEnabled true setProperty("archivesBaseName", "gallery") } From 4e8197b88639032925478d35dc583724854f7cfa Mon Sep 17 00:00:00 2001 From: tibbi Date: Sun, 25 Feb 2018 00:13:09 +0100 Subject: [PATCH 62/71] updating changelog --- CHANGELOG.md | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 29f2597d5..1fc4faa0f 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,6 +1,13 @@ Changelog ========== +Version 3.5.1 *(2018-02-25)* +---------------------------- + + * Added a toggle for disabling pull-to-refresh + * Added a toggle for permanent Delete confirmation dialog skipping + * Fixed saving image after editing + Version 3.5.0 *(2018-02-20)* ---------------------------- From b8dd4bd5abd1217f3703df421587c29e223160b2 Mon Sep 17 00:00:00 2001 From: tibbi Date: Sun, 25 Feb 2018 09:43:10 +0100 Subject: [PATCH 63/71] fix copying whole folders on the internal storage --- .../com/simplemobiletools/gallery/adapters/DirectoryAdapter.kt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/src/main/kotlin/com/simplemobiletools/gallery/adapters/DirectoryAdapter.kt b/app/src/main/kotlin/com/simplemobiletools/gallery/adapters/DirectoryAdapter.kt index 8cc83bb5d..a795756e5 100644 --- a/app/src/main/kotlin/com/simplemobiletools/gallery/adapters/DirectoryAdapter.kt +++ b/app/src/main/kotlin/com/simplemobiletools/gallery/adapters/DirectoryAdapter.kt @@ -221,7 +221,7 @@ class DirectoryAdapter(activity: BaseSimpleActivity, var dirs: MutableList() selectedPositions.forEach { val dir = File(dirs[it].path) - paths.addAll(dir.list().filter { !activity.getIsPathDirectory(it) && it.isImageVideoGif() }) + paths.addAll(dir.listFiles().filter { !activity.getIsPathDirectory(it.absolutePath) && it.absolutePath.isImageVideoGif() }.map { it.absolutePath }) } val fileDirItems = paths.map { FileDirItem(it, it.getFilenameFromPath()) } as ArrayList From 119276672ae1cf2c58b3d2f6734e0ea52c003a64 Mon Sep 17 00:00:00 2001 From: tibbi Date: Sun, 25 Feb 2018 13:43:25 +0100 Subject: [PATCH 64/71] properly play videos if their filename contains a colon --- app/build.gradle | 2 +- .../simplemobiletools/gallery/fragments/VideoFragment.kt | 7 ++++++- 2 files changed, 7 insertions(+), 2 deletions(-) diff --git a/app/build.gradle b/app/build.gradle index 7179a8da5..3898d3175 100644 --- a/app/build.gradle +++ b/app/build.gradle @@ -46,7 +46,7 @@ ext { } dependencies { - implementation 'com.simplemobiletools:commons:3.13.6' + implementation 'com.simplemobiletools:commons:3.13.7' implementation 'com.theartofdev.edmodo:android-image-cropper:2.6.0' implementation 'com.android.support:multidex:1.0.2' implementation 'com.google.code.gson:gson:2.8.2' diff --git a/app/src/main/kotlin/com/simplemobiletools/gallery/fragments/VideoFragment.kt b/app/src/main/kotlin/com/simplemobiletools/gallery/fragments/VideoFragment.kt index ff6d46b89..ce03f165b 100644 --- a/app/src/main/kotlin/com/simplemobiletools/gallery/fragments/VideoFragment.kt +++ b/app/src/main/kotlin/com/simplemobiletools/gallery/fragments/VideoFragment.kt @@ -14,6 +14,7 @@ import android.view.animation.AnimationUtils import android.widget.SeekBar import android.widget.TextView import com.simplemobiletools.commons.extensions.* +import com.simplemobiletools.gallery.BuildConfig import com.simplemobiletools.gallery.R import com.simplemobiletools.gallery.activities.VideoActivity import com.simplemobiletools.gallery.extensions.* @@ -21,6 +22,7 @@ import com.simplemobiletools.gallery.helpers.MEDIUM import com.simplemobiletools.gallery.helpers.MediaSideScroll import com.simplemobiletools.gallery.models.Medium import kotlinx.android.synthetic.main.pager_video_item.view.* +import java.io.File import java.io.IOException class VideoFragment : ViewPagerFragment(), SurfaceHolder.Callback, SeekBar.OnSeekBarChangeListener { @@ -315,9 +317,12 @@ class VideoFragment : ViewPagerFragment(), SurfaceHolder.Callback, SeekBar.OnSee } val mediumPath = if (wasEncoded) mEncodedPath else getPathToLoad(medium) + + // this workaround is needed for example if the filename contains a colon + val fileUri = if (mediumPath.startsWith("/")) context!!.getFilePublicUri(File(mediumPath), BuildConfig.APPLICATION_ID) else Uri.parse(mediumPath) try { mMediaPlayer = MediaPlayer().apply { - setDataSource(context, Uri.parse(mediumPath)) + setDataSource(context, fileUri) setDisplay(mSurfaceHolder) setOnCompletionListener { videoCompleted() } setOnVideoSizeChangedListener { mediaPlayer, width, height -> setVideoSize() } From 3c798fe3fbce7d41d1527eb49107470762f36409 Mon Sep 17 00:00:00 2001 From: tibbi Date: Sun, 25 Feb 2018 14:06:27 +0100 Subject: [PATCH 65/71] update commons to 3.13.8 --- app/build.gradle | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/build.gradle b/app/build.gradle index 3898d3175..1972a6b72 100644 --- a/app/build.gradle +++ b/app/build.gradle @@ -46,7 +46,7 @@ ext { } dependencies { - implementation 'com.simplemobiletools:commons:3.13.7' + implementation 'com.simplemobiletools:commons:3.13.8' implementation 'com.theartofdev.edmodo:android-image-cropper:2.6.0' implementation 'com.android.support:multidex:1.0.2' implementation 'com.google.code.gson:gson:2.8.2' From 7fa167463d8a1875bfc5153234e6622f79477248 Mon Sep 17 00:00:00 2001 From: tibbi Date: Sun, 25 Feb 2018 14:09:16 +0100 Subject: [PATCH 66/71] update version to 3.5.2 --- app/build.gradle | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/app/build.gradle b/app/build.gradle index 1972a6b72..143dea1d4 100644 --- a/app/build.gradle +++ b/app/build.gradle @@ -10,8 +10,8 @@ android { applicationId "com.simplemobiletools.gallery" minSdkVersion 16 targetSdkVersion 27 - versionCode 163 - versionName "3.5.1" + versionCode 164 + versionName "3.5.2" multiDexEnabled true setProperty("archivesBaseName", "gallery") } From a34d807dd6090af88e4c18b4feaa3e21048e43d4 Mon Sep 17 00:00:00 2001 From: tibbi Date: Sun, 25 Feb 2018 14:09:21 +0100 Subject: [PATCH 67/71] updating changelog --- CHANGELOG.md | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 1fc4faa0f..d791cdf73 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,6 +1,13 @@ Changelog ========== +Version 3.5.2 *(2018-02-25)* +---------------------------- + + * Fixed third party intent uri generation + * Properly handle files with colon in filename + * Fix copying whole folders + Version 3.5.1 *(2018-02-25)* ---------------------------- From 6b17dff4d6e3c81981491d213cc669fcfdc74b29 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Xos=C3=A9=20M?= Date: Mon, 26 Feb 2018 15:09:52 +0100 Subject: [PATCH 68/71] galician: faq section --- app/src/main/res/values-gl/strings.xml | 62 +++++++++++++------------- 1 file changed, 31 insertions(+), 31 deletions(-) diff --git a/app/src/main/res/values-gl/strings.xml b/app/src/main/res/values-gl/strings.xml index 4d71563d8..a4b605bc9 100644 --- a/app/src/main/res/values-gl/strings.xml +++ b/app/src/main/res/values-gl/strings.xml @@ -43,9 +43,9 @@ Excluír un cartafol xunto cos subcartafoles só terá efecto en Simple Gallery, seguirán sendo visibles en outros aplicativos.\n\nSi tamén quere excluílos en outros aplicativos, utilice a opción Agochar. Eliminar todos Eliminar todos os cartafoles da lista de excluídos? Esto non borrará os cartafoles. - Hidden folders + Cartafoles ocultos Xestionar cartafoles ocultos - Seems like you don\'t have any folders hidden with a \".nomedia\" file. + Semella que non ten ningún cartafol oculto con un ficheiro \".nomedia\". Cartafoles incluídos @@ -86,7 +86,7 @@ Fallou establecer fondo de pantalla Establecer fondo de pantalla con: Establecendo fondo de pantalla… - fondo de pantalla establecido con éxito + Fondo de pantalla establecido con éxito Proporción de Retrato Proporción de Paisaxe Pantalla de incio @@ -126,44 +126,44 @@ Desplazar iconas horizontalmente Agochar controis do sistema cando visualice a pantalla completa Borrar cartafoles baldeiros cando elmine o seu contido - Allow controlling photo brightness with vertical gestures + Permitir controlar o brillo da foto con xestos verticais Permitir controlar o volume do vídeo e o brillo con xestos verticáis Mostrar a conta de medios do cartafol na vista principal Substituír Compartir con Rotar no menú de pantalla completa Mostrar información pormenorizada sobre medios a pantalla completa Xestionar información polo miúdo Permitir zoom con un dedo a pantalla completa - Allow instantly changing media by clicking on screen sides - Replace deep zoomable images with better quality ones - Hide extended details when status bar is hidden - Do an extra check to avoid showing invalid files + Permitir o cambio instantáneo de medios pulsando nos lados da pantalla + Substituír imaxes con un gran zoom por por outras con mellor calidade + Agochar detalles extendidos cando a barra de estado está oculta + Facer unha comprobación extra para evitar mostrar ficheiros non válidos - Thumbnails - Fullscreen media - Extended details + Iconas + Medios a pantalla completa + Detalles ampliados - How can I make Simple Gallery the default device gallery? - First you have to find the currently default gallery in the Apps section of your device settings, look for a button that says something like \"Open by default\", click on it, then select \"Clear defaults\". - The next time you will try opening an image or video you should see an app picker, where you can select Simple Gallery and make it the default app. - I locked the app with a password, but I forgot it. What can I do? - You can solve it in 2 ways. You can either reinstall the app, or find the app in your device settings and select \"Clear data\". It will reset all your settings, it will not remove any media files. - How can I make an album always appear at the top? - You can long press the desired album and select the Pin icon at the actionmenu, that will pin it to the top. You can pin multiple folders too, pinned items will be sorted by the default sorting method. - How can I fast-forward videos? - You can click on the current or max duration texts near the seekbar, that will move the video either backward, or forward. - What is the difference between hiding and excluding a folder? - Exclude prevents displaying the folder only in Simple Gallery, while Hide works system-wise and it hides the folder from other galleries too. It works by creating an empty \".nomedia\" file in the given folder, which you can then remove with any file manager too. - Why do folders with music cover art or stickers show up? - It can happen that you will see some unusual albums show up. You can easily exclude them by long pressing them and selecting Exclude. In the next dialog you can then select the parent folder, chances are it will prevent the other related albums showing up too. - A folder with images isn\'t showing up, what can I do? - That can have multiple reasons, but solving it is easy. Just go in Settings -> Manage Included Folders, select Plus and navigate to the required folder. - What if I want just a few particular folders visible? - Adding a folder at the Included Folders doesn\'t automatically exclude anything. What you can do is go in Settings -> Manage Excluded Folders, exclude the root folder \"/\", then add the desired folders at Settings -> Manage Included Folders. - That will make only the selected folders visible, as both excluding and including are recursive and if a folder is both excluded and included, it will show up. - Fullscreen images have weird artifacts, can I somehow improve the quality? - Yea, there is a toggle in Settings saying \"Replace deep zoomable images with better quality ones\", you can use that. It will improve the quality of the images, but they will get blurred once you try zooming in too much. + Cómo podo facer que Simple Gallery sexa a galería por omisión no dispositivo? + Primeiro debe atopar a galería por omsión actual na sección de App nos axustes do dispositivo, buscar un botón que diga algo como \"Abrir por omisión\", pulsalo e despois seleccionar \"Limpar por omisión\". + A próxima vez que intente abrir unha imaxe ou vídeo aparecerá un selector de aplicativos onde pode escoller Simple Gallery e facela o aplicativo por omisión. + Asegurei o aplicativo con un contrasinal, pero esquecino. Qué podo facer? + Pode solucionado de dous xeitos. Ou ben reinstalar o aplicativo ou buscar o aplicativo nos axustes do dispositivo e escoller \"Limpar datos\". Restablecerá todos os seus axustes, mais non eliminará ficheiros de medios. + Cómo podo facer que un álbume apareza sempre arriba de todo? + Pode manter premido o álbume e escoller a icona de Fixar no menú de accións, esto fixarao arriba. Pode fixar varios cartafoles tambén, os elementos fixados estarán ordenados polo criterio por omisión. + Cómo podo aumentar a velocidade de reprodución de vídeo? + Pode pulsar no texto de duración actual ou máxima preto da barra de busca, esto moverá ou vídeo hacia adiante ou atrás. + Cal é a diferenza entre agochar e excluír un cartafol? + A Exclusión prevén que se mostre o cartafol só en Simple Gallery, mentras Agochar funciona para todo o sistema e agocha o cartafol para outras galerías tamén. Esto funciona creando un ficheiro baldeiro de nome \".nomedia\" no cartafol, que tamén pode quitar con calquer xestor de ficheiros. + Por qué aparecen cartafoles de música con portadas ou pegatinas? + Pode acontecer que vexa que aparecen álbumes raros. Pode excluílos con facilidade mantendo premidos e escollendo Excluír. No seguinte diálogo pode escoller o cartafol pai, esto probablemente agoche outros álbumes relacionados. + Un cartafol con imaxes non aparece, qué podo facer? + Esto pode acontecer por varias razóns, pero é doado resolvelo. Vaia a Axustes -> xestionar cartafoles incluídos, escolle o Máis e navegar ate o cartafol requerido. + E qué pasa si só quero que sexan visibles certos cartafoles + Engadir un cartafol a Cartafoles incluídos non exclúe nada de xeito automático. O que pode facer é ir a Axustes -> Xestionar cartafoles incluídos, excluír o cartafol root \"/\", e despóis engadir os cartafoles desexados con Axustes -> Xestionar Cartafoles Incluídos. + Esto fará visibles só aos cartafoles escollidos, como tanto excluír e incluír son recursivos e si está excluído e logo incluído, será mostrado. + As imaxes a pantalla completa teñen píxeles extranos, podo mellorar a calidade da imaxe? + Si, hai unha opción en Axustes que di \"Substituír imaxes con un gran zoom con imaxes de mellor calidade\", pode usar eso. mellorará a calidade das imaxes, mais farase máis borrosaxa si intenta facer moito zoom. From 1a0e7a9c9bcb3ffd877018666c7de05dc668fb68 Mon Sep 17 00:00:00 2001 From: Rodrigo Date: Mon, 26 Feb 2018 16:46:59 -0300 Subject: [PATCH 69/71] Update strings.xml --- app/src/main/res/values-pt-rBR/strings.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/src/main/res/values-pt-rBR/strings.xml b/app/src/main/res/values-pt-rBR/strings.xml index 7141eecbb..5c8c8958e 100644 --- a/app/src/main/res/values-pt-rBR/strings.xml +++ b/app/src/main/res/values-pt-rBR/strings.xml @@ -126,7 +126,7 @@ Rolar miniaturas horizontalmente Esconder interface do sistema automaticamente quando em tela cheia Apagar pastas vazias após deleter seu conteúdo - Allow controlling photo brightness with vertical gestures + Permitir controle do brilho com gestos na vertical Permitir controle do volume e brilho com gestos na vertical Mostrar quantidade de arquivos das pastas Substituir botão "Compartilhar" por "Rotação de tela" quando em tela cheia From f1b578e824c34b4118dab0bae5ad07568a316d66 Mon Sep 17 00:00:00 2001 From: bulbarsaur Date: Tue, 27 Feb 2018 12:44:37 +0900 Subject: [PATCH 70/71] Update Korean translation --- app/src/main/res/values-ko-rKR/strings.xml | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/app/src/main/res/values-ko-rKR/strings.xml b/app/src/main/res/values-ko-rKR/strings.xml index 1f0b79242..7d0bf7910 100644 --- a/app/src/main/res/values-ko-rKR/strings.xml +++ b/app/src/main/res/values-ko-rKR/strings.xml @@ -34,18 +34,18 @@ 필터 변경 - 현재폴더 및 모든 하위폴더를 \'.nomedia\' 폴더를 생성하여 숨김니다. 숨김 처리된 모들 폴더는 옵션설정의 \'숨김파일 보기\' 메뉴를 이용하여 다시 보실 수 있습니다. 계속 하시겠습니까? + 현재폴더 및 모든 하위폴더를 \'.nomedia\' 폴더를 생성하여 숨김니다. 숨김 처리된 모든 폴더는 옵션설정의 \'숨김파일 보기\' 메뉴를 이용하여 다시 보실 수 있습니다. 계속 하시겠습니까? 제외하기 제외된 폴더 제외된 폴더관리 현재폴더 및 모든 하위폴더를 심플 갤러리에서 제외시킵니다. 제외된 폴더는 옵션설정에서 관리 할 수 있습니다. 상위 폴더를 제외 하시겠습니까? - Excluding folders will make them together with their subfolders hidden just in Simple Gallery, they will still be visible in other applications.\n\nIf you want to hide them from other apps too, use the Hide function. + 폴더를 제외하면 하위폴더까지 심플 갤러리에서 숨김처리 되지만, 다른 앱에서는 숨김처리 되지 않습니다. \n\n다른 앱에서도 보이지 않게 하려면 숨김기능을 사용하십시오. 모두 제거 제외 목록을 모두 삭제 하시겠습니다? 목록을 삭제해도 폴더가 삭제되지는 않습니다. - Hidden folders - Manage hidden folders - Seems like you don\'t have any folders hidden with a \".nomedia\" file. + 숨겨진 폴더 + 숨김폴더 관리 + \".nomedia\" 하위에 숨김 처리된 폴더가 존재하지 않습니다. 포함된 폴더 @@ -122,19 +122,19 @@ 시스템 설정 디바이스 회전 가로세로 비율 - Black background and status bar at fullscreen media + 전체화면 모드에서 검정색 배경 및 상태바 사용 섬네일 수평스크롤 전체화면 모드에서 시스템 UI 숨김 콘텐츠 삭제 후 빈폴더 삭제 - Allow controlling photo brightness with vertical gestures + 상하 제스처로 사진 밝기 제어 수직 제스처로 비디오 볼륨 및 밝기 제어 폴더에 포함된 미디어파일 수 표시 전체화면 메뉴의 공유 아이콘을 회전 아이콘으로 변경 전체화면 모드에서 세부정보 표시 확장된 세부정보 관리 - Allow one finger zoom at fullscreen media - Allow instantly changing media by clicking on screen sides - Replace deep zoomable images with better quality ones + 전체화면 모드에서 한 손가락으로 확대 및 축소 + 측면 클릭으로 미디어 즉시변경 + 확대 축소 가능한 이미지를 더 좋은 품질로 교체 Hide extended details when status bar is hidden Do an extra check to avoid showing invalid files From ba6b2c68b85f35a8b13ca5c38096fc41596a04be Mon Sep 17 00:00:00 2001 From: bulbarsaur Date: Tue, 27 Feb 2018 15:06:49 +0900 Subject: [PATCH 71/71] Update Korean translation --- app/src/main/res/values-ko-rKR/strings.xml | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/app/src/main/res/values-ko-rKR/strings.xml b/app/src/main/res/values-ko-rKR/strings.xml index 7d0bf7910..7ffb81c98 100644 --- a/app/src/main/res/values-ko-rKR/strings.xml +++ b/app/src/main/res/values-ko-rKR/strings.xml @@ -136,12 +136,12 @@ 측면 클릭으로 미디어 즉시변경 확대 축소 가능한 이미지를 더 좋은 품질로 교체 Hide extended details when status bar is hidden - Do an extra check to avoid showing invalid files + 잘못된 파일 표시를 방지하기 위해 추가 검사 수행 - Thumbnails - Fullscreen media - Extended details + 섬네일 + 미디어 전체화면 + 확장 된 세부 정보 How can I make Simple Gallery the default device gallery?