From 8c27e4eba629211dc70470109ba71309c4c6b8e0 Mon Sep 17 00:00:00 2001 From: Naveen Date: Tue, 12 Dec 2023 19:46:44 +0530 Subject: [PATCH] Rename package names --- app/proguard-rules.pro | 4 +- app/src/main/AndroidManifest.xml | 14 +- .../pro/dialogs/GrantAllFilesDialog.kt | 23 ---- .../gallery/pro/extensions/FileDirItem.kt | 5 - .../gallery/pro/extensions/Int.kt | 5 - .../gallery/pro/models/ThumbnailItem.kt | 3 - .../pro => org/fossify/gallery}/App.kt | 4 +- .../gallery}/activities/EditActivity.kt | 91 +++++++------ .../activities/ExcludedFoldersActivity.kt | 22 ++-- .../activities/HiddenFoldersActivity.kt | 28 ++-- .../activities/IncludedFoldersActivity.kt | 20 +-- .../gallery}/activities/MainActivity.kt | 93 +++++++------- .../gallery}/activities/MediaActivity.kt | 76 +++++------ .../activities/PanoramaPhotoActivity.kt | 20 +-- .../activities/PanoramaVideoActivity.kt | 32 ++--- .../gallery}/activities/PhotoActivity.kt | 2 +- .../gallery}/activities/PhotoVideoActivity.kt | 34 ++--- .../gallery}/activities/SearchActivity.kt | 48 +++---- .../activities/SetWallpaperActivity.kt | 24 ++-- .../gallery}/activities/SettingsActivity.kt | 64 +++++----- .../gallery}/activities/SimpleActivity.kt | 24 ++-- .../gallery}/activities/SplashActivity.kt | 16 +-- .../gallery}/activities/VideoActivity.kt | 2 +- .../activities/VideoPlayerActivity.kt | 22 ++-- .../gallery}/activities/ViewPagerActivity.kt | 98 +++++++------- .../activities/WidgetConfigureActivity.kt | 28 ++-- .../gallery}/adapters/DirectoryAdapter.kt | 70 +++++----- .../gallery}/adapters/DirectoryItemBinding.kt | 10 +- .../gallery}/adapters/FiltersAdapter.kt | 8 +- .../gallery}/adapters/ManageFoldersAdapter.kt | 26 ++-- .../adapters/ManageHiddenFoldersAdapter.kt | 22 ++-- .../fossify/gallery}/adapters/MediaAdapter.kt | 52 ++++---- .../gallery}/adapters/MediaItemBinding.kt | 14 +- .../gallery}/adapters/MyPagerAdapter.kt | 16 +-- .../adapters/PortraitPhotosAdapter.kt | 8 +- .../gallery}/asynctasks/GetMediaAsynctask.kt | 20 +-- .../gallery}/databases/GalleryDatabase.kt | 6 +- .../dialogs/AllFilesPermissionDialog.kt | 12 +- .../dialogs/ChangeFileThumbnailStyleDialog.kt | 20 +-- .../ChangeFolderThumbnailStyleDialog.kt | 26 ++-- .../gallery}/dialogs/ChangeGroupingDialog.kt | 22 ++-- .../gallery}/dialogs/ChangeSortingDialog.kt | 22 ++-- .../gallery}/dialogs/ChangeViewTypeDialog.kt | 24 ++-- .../dialogs/ConfirmDeleteFolderDialog.kt | 12 +- .../dialogs/CustomAspectRatioDialog.kt | 18 +-- .../dialogs/DeleteWithRememberDialog.kt | 14 +- .../gallery}/dialogs/ExcludeFolderDialog.kt | 22 ++-- .../gallery}/dialogs/ExportFavoritesDialog.kt | 26 ++-- .../gallery}/dialogs/FilterMediaDialog.kt | 20 +-- .../gallery/dialogs/GrantAllFilesDialog.kt | 23 ++++ .../dialogs/ManageBottomActionsDialog.kt | 18 +-- .../dialogs/ManageExtendedDetailsDialog.kt | 18 +-- .../dialogs/OtherAspectRatioDialog.kt | 12 +- .../gallery}/dialogs/PickDirectoryDialog.kt | 42 +++--- .../gallery}/dialogs/PickMediumDialog.kt | 42 +++--- .../fossify/gallery}/dialogs/ResizeDialog.kt | 14 +- .../dialogs/ResizeMultipleImagesDialog.kt | 24 ++-- .../gallery}/dialogs/ResizeWithPathDialog.kt | 28 ++-- .../fossify/gallery}/dialogs/SaveAsDialog.kt | 28 ++-- .../gallery}/dialogs/SlideshowDialog.kt | 36 +++--- .../fossify/gallery}/extensions/Activity.kt | 88 ++++++------- .../fossify/gallery}/extensions/ArrayList.kt | 6 +- .../fossify/gallery}/extensions/Context.kt | 76 ++++++----- .../gallery}/extensions/ExifInterface.kt | 2 +- .../fossify/gallery/extensions/FileDirItem.kt | 5 + .../org/fossify/gallery/extensions/Int.kt | 5 + .../fossify/gallery}/extensions/Resources.kt | 2 +- .../fossify/gallery}/extensions/String.kt | 13 +- .../fossify/gallery}/extensions/View.kt | 2 +- .../gallery}/fragments/PhotoFragment.kt | 49 +++---- .../gallery}/fragments/VideoFragment.kt | 32 ++--- .../gallery}/fragments/ViewPagerFragment.kt | 30 ++--- .../fossify/gallery}/helpers/Config.kt | 31 ++--- .../fossify/gallery}/helpers/Constants.kt | 4 +- .../helpers/DefaultPageTransformer.kt | 2 +- .../gallery}/helpers/FadePageTransformer.kt | 2 +- .../helpers/FilterThumbnailsManager.kt | 4 +- .../helpers/GridSpacingItemDecoration.kt | 6 +- .../fossify/gallery}/helpers/IsoTypeReader.kt | 2 +- .../fossify/gallery}/helpers/MediaFetcher.kt | 40 +++--- .../gallery}/helpers/MyGlideImageDecoder.kt | 2 +- .../gallery}/helpers/MyWidgetProvider.kt | 26 ++-- .../gallery}/helpers/PicassoRegionDecoder.kt | 2 +- .../PicassoRoundedCornersTransformation.kt | 2 +- .../gallery}/helpers/RotateTransformation.kt | 2 +- .../gallery}/interfaces/DateTakensDao.kt | 4 +- .../gallery}/interfaces/DirectoryDao.kt | 6 +- .../interfaces/DirectoryOperationsListener.kt | 4 +- .../gallery}/interfaces/FavoritesDao.kt | 4 +- .../interfaces/MediaOperationsListener.kt | 6 +- .../fossify/gallery}/interfaces/MediumDao.kt | 4 +- .../fossify/gallery}/interfaces/WidgetsDao.kt | 4 +- .../fossify/gallery}/jobs/NewPhotoFetcher.kt | 12 +- .../fossify/gallery}/models/AlbumCover.kt | 2 +- .../fossify/gallery}/models/DateTaken.kt | 2 +- .../fossify/gallery}/models/Directory.kt | 10 +- .../fossify/gallery}/models/Favorite.kt | 2 +- .../fossify/gallery}/models/FilterItem.kt | 2 +- .../fossify/gallery}/models/Medium.kt | 14 +- .../fossify/gallery}/models/PaintOptions.kt | 2 +- .../fossify/gallery/models/ThumbnailItem.kt | 3 + .../gallery}/models/ThumbnailSection.kt | 2 +- .../fossify/gallery}/models/Widget.kt | 2 +- .../receivers/BootCompletedReceiver.kt | 8 +- .../receivers/RefreshMediaReceiver.kt | 6 +- .../fossify/gallery}/svg/SvgDecoder.kt | 4 +- .../gallery}/svg/SvgDrawableTranscoder.kt | 4 +- .../fossify/gallery}/svg/SvgModule.kt | 2 +- .../gallery}/svg/SvgSoftwareLayerSetter.kt | 2 +- .../gallery}/views/EditorDrawCanvas.kt | 8 +- .../gallery}/views/InstantItemSwitch.kt | 8 +- .../fossify/gallery}/views/MediaSideScroll.kt | 10 +- app/src/main/res/layout/activity_edit.xml | 2 +- app/src/main/res/layout/activity_main.xml | 12 +- .../res/layout/activity_manage_folders.xml | 6 +- app/src/main/res/layout/activity_media.xml | 10 +- app/src/main/res/layout/activity_medium.xml | 2 +- app/src/main/res/layout/activity_search.xml | 8 +- app/src/main/res/layout/activity_settings.xml | 120 +++++++++--------- .../main/res/layout/activity_video_player.xml | 4 +- .../res/layout/activity_widget_config.xml | 12 +- .../layout/bottom_editor_actions_filter.xml | 7 +- .../res/layout/bottom_editor_draw_actions.xml | 13 +- .../res/layout/bottom_video_time_holder.xml | 2 +- .../dialog_change_file_thumbnail_style.xml | 12 +- .../dialog_change_folder_thumbnail_style.xml | 12 +- .../res/layout/dialog_change_grouping.xml | 26 ++-- .../main/res/layout/dialog_change_sorting.xml | 24 ++-- .../res/layout/dialog_change_view_type.xml | 8 +- .../layout/dialog_confirm_delete_folder.xml | 2 +- .../res/layout/dialog_custom_aspect_ratio.xml | 10 +- .../layout/dialog_delete_with_remember.xml | 6 +- .../res/layout/dialog_directory_picker.xml | 10 +- .../main/res/layout/dialog_exclude_folder.xml | 4 +- .../res/layout/dialog_export_favorites.xml | 8 +- .../main/res/layout/dialog_filter_media.xml | 12 +- .../res/layout/dialog_grant_all_files.xml | 2 +- .../layout/dialog_manage_bottom_actions.xml | 63 +++++---- .../layout/dialog_manage_extended_details.xml | 39 +++--- .../main/res/layout/dialog_medium_picker.xml | 4 +- .../res/layout/dialog_other_aspect_ratio.xml | 26 ++-- .../main/res/layout/dialog_resize_image.xml | 12 +- .../layout/dialog_resize_image_with_path.xml | 22 ++-- .../layout/dialog_resize_multiple_images.xml | 4 +- app/src/main/res/layout/dialog_save_as.xml | 12 +- app/src/main/res/layout/dialog_slideshow.xml | 20 +-- .../directory_item_grid_rounded_corners.xml | 2 +- .../res/layout/directory_item_grid_square.xml | 2 +- .../main/res/layout/directory_item_list.xml | 2 +- .../main/res/layout/item_manage_folder.xml | 2 +- app/src/main/res/layout/pager_photo_item.xml | 8 +- app/src/main/res/layout/pager_video_item.xml | 4 +- app/src/main/res/layout/photo_item_grid.xml | 6 +- app/src/main/res/layout/photo_item_list.xml | 2 +- app/src/main/res/layout/thumbnail_section.xml | 5 +- app/src/main/res/layout/video_item_grid.xml | 2 +- app/src/main/res/layout/video_item_list.xml | 6 +- app/src/main/res/values/donottranslate.xml | 2 +- app/src/main/res/xml/widget_info.xml | 2 +- .../pro/activities/NewPhotoEditActivity.kt | 30 ++--- .../pro/activities/NewVideoEditActivity.kt | 24 ++-- fastlane/Appfile | 2 +- gradle/libs.versions.toml | 4 +- settings.gradle.kts | 2 +- 164 files changed, 1405 insertions(+), 1387 deletions(-) delete mode 100644 app/src/main/kotlin/com/simplemobiletools/gallery/pro/dialogs/GrantAllFilesDialog.kt delete mode 100644 app/src/main/kotlin/com/simplemobiletools/gallery/pro/extensions/FileDirItem.kt delete mode 100644 app/src/main/kotlin/com/simplemobiletools/gallery/pro/extensions/Int.kt delete mode 100644 app/src/main/kotlin/com/simplemobiletools/gallery/pro/models/ThumbnailItem.kt rename app/src/main/kotlin/{com/simplemobiletools/gallery/pro => org/fossify/gallery}/App.kt (84%) rename app/src/main/kotlin/{com/simplemobiletools/gallery/pro => org/fossify/gallery}/activities/EditActivity.kt (92%) rename app/src/main/kotlin/{com/simplemobiletools/gallery/pro => org/fossify/gallery}/activities/ExcludedFoldersActivity.kt (76%) rename app/src/main/kotlin/{com/simplemobiletools/gallery/pro => org/fossify/gallery}/activities/HiddenFoldersActivity.kt (70%) rename app/src/main/kotlin/{com/simplemobiletools/gallery/pro => org/fossify/gallery}/activities/IncludedFoldersActivity.kt (75%) rename app/src/main/kotlin/{com/simplemobiletools/gallery/pro => org/fossify/gallery}/activities/MainActivity.kt (94%) rename app/src/main/kotlin/{com/simplemobiletools/gallery/pro => org/fossify/gallery}/activities/MediaActivity.kt (92%) rename app/src/main/kotlin/{com/simplemobiletools/gallery/pro => org/fossify/gallery}/activities/PanoramaPhotoActivity.kt (91%) rename app/src/main/kotlin/{com/simplemobiletools/gallery/pro => org/fossify/gallery}/activities/PanoramaVideoActivity.kt (91%) rename app/src/main/kotlin/{com/simplemobiletools/gallery/pro => org/fossify/gallery}/activities/PhotoActivity.kt (79%) rename app/src/main/kotlin/{com/simplemobiletools/gallery/pro => org/fossify/gallery}/activities/PhotoVideoActivity.kt (93%) rename app/src/main/kotlin/{com/simplemobiletools/gallery/pro => org/fossify/gallery}/activities/SearchActivity.kt (84%) rename app/src/main/kotlin/{com/simplemobiletools/gallery/pro => org/fossify/gallery}/activities/SetWallpaperActivity.kt (88%) rename app/src/main/kotlin/{com/simplemobiletools/gallery/pro => org/fossify/gallery}/activities/SettingsActivity.kt (94%) rename app/src/main/kotlin/{com/simplemobiletools/gallery/pro => org/fossify/gallery}/activities/SimpleActivity.kt (79%) rename app/src/main/kotlin/{com/simplemobiletools/gallery/pro => org/fossify/gallery}/activities/SplashActivity.kt (70%) rename app/src/main/kotlin/{com/simplemobiletools/gallery/pro => org/fossify/gallery}/activities/VideoActivity.kt (79%) rename app/src/main/kotlin/{com/simplemobiletools/gallery/pro => org/fossify/gallery}/activities/VideoPlayerActivity.kt (97%) rename app/src/main/kotlin/{com/simplemobiletools/gallery/pro => org/fossify/gallery}/activities/ViewPagerActivity.kt (93%) rename app/src/main/kotlin/{com/simplemobiletools/gallery/pro => org/fossify/gallery}/activities/WidgetConfigureActivity.kt (86%) rename app/src/main/kotlin/{com/simplemobiletools/gallery/pro => org/fossify/gallery}/adapters/DirectoryAdapter.kt (93%) rename app/src/main/kotlin/{com/simplemobiletools/gallery/pro => org/fossify/gallery}/adapters/DirectoryItemBinding.kt (89%) rename app/src/main/kotlin/{com/simplemobiletools/gallery/pro => org/fossify/gallery}/adapters/FiltersAdapter.kt (89%) rename app/src/main/kotlin/{com/simplemobiletools/gallery/pro => org/fossify/gallery}/adapters/ManageFoldersAdapter.kt (80%) rename app/src/main/kotlin/{com/simplemobiletools/gallery/pro => org/fossify/gallery}/adapters/ManageHiddenFoldersAdapter.kt (81%) rename app/src/main/kotlin/{com/simplemobiletools/gallery/pro => org/fossify/gallery}/adapters/MediaAdapter.kt (93%) rename app/src/main/kotlin/{com/simplemobiletools/gallery/pro => org/fossify/gallery}/adapters/MediaItemBinding.kt (86%) rename app/src/main/kotlin/{com/simplemobiletools/gallery/pro => org/fossify/gallery}/adapters/MyPagerAdapter.kt (80%) rename app/src/main/kotlin/{com/simplemobiletools/gallery/pro => org/fossify/gallery}/adapters/PortraitPhotosAdapter.kt (93%) rename app/src/main/kotlin/{com/simplemobiletools/gallery/pro => org/fossify/gallery}/asynctasks/GetMediaAsynctask.kt (82%) rename app/src/main/kotlin/{com/simplemobiletools/gallery/pro => org/fossify/gallery}/databases/GalleryDatabase.kt (96%) rename app/src/main/kotlin/{com/simplemobiletools/gallery/pro => org/fossify/gallery}/dialogs/AllFilesPermissionDialog.kt (67%) rename app/src/main/kotlin/{com/simplemobiletools/gallery/pro => org/fossify/gallery}/dialogs/ChangeFileThumbnailStyleDialog.kt (79%) rename app/src/main/kotlin/{com/simplemobiletools/gallery/pro => org/fossify/gallery}/dialogs/ChangeFolderThumbnailStyleDialog.kt (83%) rename app/src/main/kotlin/{com/simplemobiletools/gallery/pro => org/fossify/gallery}/dialogs/ChangeGroupingDialog.kt (83%) rename app/src/main/kotlin/{com/simplemobiletools/gallery/pro => org/fossify/gallery}/dialogs/ChangeSortingDialog.kt (86%) rename app/src/main/kotlin/{com/simplemobiletools/gallery/pro => org/fossify/gallery}/dialogs/ChangeViewTypeDialog.kt (73%) rename app/src/main/kotlin/{com/simplemobiletools/gallery/pro => org/fossify/gallery}/dialogs/ConfirmDeleteFolderDialog.kt (61%) rename app/src/main/kotlin/{com/simplemobiletools/gallery/pro => org/fossify/gallery}/dialogs/CustomAspectRatioDialog.kt (68%) rename app/src/main/kotlin/{com/simplemobiletools/gallery/pro => org/fossify/gallery}/dialogs/DeleteWithRememberDialog.kt (65%) rename app/src/main/kotlin/{com/simplemobiletools/gallery/pro => org/fossify/gallery}/dialogs/ExcludeFolderDialog.kt (73%) rename app/src/main/kotlin/{com/simplemobiletools/gallery/pro => org/fossify/gallery}/dialogs/ExportFavoritesDialog.kt (73%) rename app/src/main/kotlin/{com/simplemobiletools/gallery/pro => org/fossify/gallery}/dialogs/FilterMediaDialog.kt (71%) create mode 100644 app/src/main/kotlin/org/fossify/gallery/dialogs/GrantAllFilesDialog.kt rename app/src/main/kotlin/{com/simplemobiletools/gallery/pro => org/fossify/gallery}/dialogs/ManageBottomActionsDialog.kt (84%) rename app/src/main/kotlin/{com/simplemobiletools/gallery/pro => org/fossify/gallery}/dialogs/ManageExtendedDetailsDialog.kt (77%) rename app/src/main/kotlin/{com/simplemobiletools/gallery/pro => org/fossify/gallery}/dialogs/OtherAspectRatioDialog.kt (88%) rename app/src/main/kotlin/{com/simplemobiletools/gallery/pro => org/fossify/gallery}/dialogs/PickDirectoryDialog.kt (84%) rename app/src/main/kotlin/{com/simplemobiletools/gallery/pro => org/fossify/gallery}/dialogs/PickMediumDialog.kt (71%) rename app/src/main/kotlin/{com/simplemobiletools/gallery/pro => org/fossify/gallery}/dialogs/ResizeDialog.kt (84%) rename app/src/main/kotlin/{com/simplemobiletools/gallery/pro => org/fossify/gallery}/dialogs/ResizeMultipleImagesDialog.kt (83%) rename app/src/main/kotlin/{com/simplemobiletools/gallery/pro => org/fossify/gallery}/dialogs/ResizeWithPathDialog.kt (80%) rename app/src/main/kotlin/{com/simplemobiletools/gallery/pro => org/fossify/gallery}/dialogs/SaveAsDialog.kt (76%) rename app/src/main/kotlin/{com/simplemobiletools/gallery/pro => org/fossify/gallery}/dialogs/SlideshowDialog.kt (77%) rename app/src/main/kotlin/{com/simplemobiletools/gallery/pro => org/fossify/gallery}/extensions/Activity.kt (89%) rename app/src/main/kotlin/{com/simplemobiletools/gallery/pro => org/fossify/gallery}/extensions/ArrayList.kt (75%) rename app/src/main/kotlin/{com/simplemobiletools/gallery/pro => org/fossify/gallery}/extensions/Context.kt (93%) rename app/src/main/kotlin/{com/simplemobiletools/gallery/pro => org/fossify/gallery}/extensions/ExifInterface.kt (97%) create mode 100644 app/src/main/kotlin/org/fossify/gallery/extensions/FileDirItem.kt create mode 100644 app/src/main/kotlin/org/fossify/gallery/extensions/Int.kt rename app/src/main/kotlin/{com/simplemobiletools/gallery/pro => org/fossify/gallery}/extensions/Resources.kt (93%) rename app/src/main/kotlin/{com/simplemobiletools/gallery/pro => org/fossify/gallery}/extensions/String.kt (91%) rename app/src/main/kotlin/{com/simplemobiletools/gallery/pro => org/fossify/gallery}/extensions/View.kt (87%) rename app/src/main/kotlin/{com/simplemobiletools/gallery/pro => org/fossify/gallery}/fragments/PhotoFragment.kt (95%) rename app/src/main/kotlin/{com/simplemobiletools/gallery/pro => org/fossify/gallery}/fragments/VideoFragment.kt (95%) rename app/src/main/kotlin/{com/simplemobiletools/gallery/pro => org/fossify/gallery}/fragments/ViewPagerFragment.kt (87%) rename app/src/main/kotlin/{com/simplemobiletools/gallery/pro => org/fossify/gallery}/helpers/Config.kt (96%) rename app/src/main/kotlin/{com/simplemobiletools/gallery/pro => org/fossify/gallery}/helpers/Constants.kt (99%) rename app/src/main/kotlin/{com/simplemobiletools/gallery/pro => org/fossify/gallery}/helpers/DefaultPageTransformer.kt (79%) rename app/src/main/kotlin/{com/simplemobiletools/gallery/pro => org/fossify/gallery}/helpers/FadePageTransformer.kt (89%) rename app/src/main/kotlin/{com/simplemobiletools/gallery/pro => org/fossify/gallery}/helpers/FilterThumbnailsManager.kt (86%) rename app/src/main/kotlin/{com/simplemobiletools/gallery/pro => org/fossify/gallery}/helpers/GridSpacingItemDecoration.kt (93%) rename app/src/main/kotlin/{com/simplemobiletools/gallery/pro => org/fossify/gallery}/helpers/IsoTypeReader.kt (93%) rename app/src/main/kotlin/{com/simplemobiletools/gallery/pro => org/fossify/gallery}/helpers/MediaFetcher.kt (95%) rename app/src/main/kotlin/{com/simplemobiletools/gallery/pro => org/fossify/gallery}/helpers/MyGlideImageDecoder.kt (95%) rename app/src/main/kotlin/{com/simplemobiletools/gallery/pro => org/fossify/gallery}/helpers/MyWidgetProvider.kt (82%) rename app/src/main/kotlin/{com/simplemobiletools/gallery/pro => org/fossify/gallery}/helpers/PicassoRegionDecoder.kt (97%) rename app/src/main/kotlin/{com/simplemobiletools/gallery/pro => org/fossify/gallery}/helpers/PicassoRoundedCornersTransformation.kt (95%) rename app/src/main/kotlin/{com/simplemobiletools/gallery/pro => org/fossify/gallery}/helpers/RotateTransformation.kt (93%) rename app/src/main/kotlin/{com/simplemobiletools/gallery/pro => org/fossify/gallery}/interfaces/DateTakensDao.kt (84%) rename app/src/main/kotlin/{com/simplemobiletools/gallery/pro => org/fossify/gallery}/interfaces/DirectoryDao.kt (89%) rename app/src/main/kotlin/{com/simplemobiletools/gallery/pro => org/fossify/gallery}/interfaces/DirectoryOperationsListener.kt (67%) rename app/src/main/kotlin/{com/simplemobiletools/gallery/pro => org/fossify/gallery}/interfaces/FavoritesDao.kt (90%) rename app/src/main/kotlin/{com/simplemobiletools/gallery/pro => org/fossify/gallery}/interfaces/MediaOperationsListener.kt (60%) rename app/src/main/kotlin/{com/simplemobiletools/gallery/pro => org/fossify/gallery}/interfaces/MediumDao.kt (95%) rename app/src/main/kotlin/{com/simplemobiletools/gallery/pro => org/fossify/gallery}/interfaces/WidgetsDao.kt (79%) rename app/src/main/kotlin/{com/simplemobiletools/gallery/pro => org/fossify/gallery}/jobs/NewPhotoFetcher.kt (92%) rename app/src/main/kotlin/{com/simplemobiletools/gallery/pro => org/fossify/gallery}/models/AlbumCover.kt (54%) rename app/src/main/kotlin/{com/simplemobiletools/gallery/pro => org/fossify/gallery}/models/DateTaken.kt (94%) rename app/src/main/kotlin/{com/simplemobiletools/gallery/pro => org/fossify/gallery}/models/Directory.kt (86%) rename app/src/main/kotlin/{com/simplemobiletools/gallery/pro => org/fossify/gallery}/models/Favorite.kt (90%) rename app/src/main/kotlin/{com/simplemobiletools/gallery/pro => org/fossify/gallery}/models/FilterItem.kt (75%) rename app/src/main/kotlin/{com/simplemobiletools/gallery/pro => org/fossify/gallery}/models/Medium.kt (90%) rename app/src/main/kotlin/{com/simplemobiletools/gallery/pro => org/fossify/gallery}/models/PaintOptions.kt (70%) create mode 100644 app/src/main/kotlin/org/fossify/gallery/models/ThumbnailItem.kt rename app/src/main/kotlin/{com/simplemobiletools/gallery/pro => org/fossify/gallery}/models/ThumbnailSection.kt (57%) rename app/src/main/kotlin/{com/simplemobiletools/gallery/pro => org/fossify/gallery}/models/Widget.kt (89%) rename app/src/main/kotlin/{com/simplemobiletools/gallery/pro => org/fossify/gallery}/receivers/BootCompletedReceiver.kt (60%) rename app/src/main/kotlin/{com/simplemobiletools/gallery/pro => org/fossify/gallery}/receivers/RefreshMediaReceiver.kt (65%) rename app/src/main/kotlin/{com/simplemobiletools/gallery/pro => org/fossify/gallery}/svg/SvgDecoder.kt (89%) rename app/src/main/kotlin/{com/simplemobiletools/gallery/pro => org/fossify/gallery}/svg/SvgDrawableTranscoder.kt (87%) rename app/src/main/kotlin/{com/simplemobiletools/gallery/pro => org/fossify/gallery}/svg/SvgModule.kt (93%) rename app/src/main/kotlin/{com/simplemobiletools/gallery/pro => org/fossify/gallery}/svg/SvgSoftwareLayerSetter.kt (95%) rename app/src/main/kotlin/{com/simplemobiletools/gallery/pro => org/fossify/gallery}/views/EditorDrawCanvas.kt (94%) rename app/src/main/kotlin/{com/simplemobiletools/gallery/pro => org/fossify/gallery}/views/InstantItemSwitch.kt (90%) rename app/src/main/kotlin/{com/simplemobiletools/gallery/pro => org/fossify/gallery}/views/MediaSideScroll.kt (96%) diff --git a/app/proguard-rules.pro b/app/proguard-rules.pro index 24dd56d45..23230d57f 100644 --- a/app/proguard-rules.pro +++ b/app/proguard-rules.pro @@ -1,6 +1,6 @@ --keep class com.simplemobiletools.** { *; } +-keep class org.fossify.** { *; } -dontwarn android.graphics.Canvas --dontwarn com.simplemobiletools.** +-dontwarn org.fossify.** -dontwarn org.apache.** # Picasso diff --git a/app/src/main/AndroidManifest.xml b/app/src/main/AndroidManifest.xml index 698161e19..bfc4e026b 100644 --- a/app/src/main/AndroidManifest.xml +++ b/app/src/main/AndroidManifest.xml @@ -34,8 +34,8 @@ - - + + @@ -294,7 +294,7 @@ android:name=".receivers.RefreshMediaReceiver" android:exported="true"> - + diff --git a/app/src/main/kotlin/com/simplemobiletools/gallery/pro/dialogs/GrantAllFilesDialog.kt b/app/src/main/kotlin/com/simplemobiletools/gallery/pro/dialogs/GrantAllFilesDialog.kt deleted file mode 100644 index 32ab21194..000000000 --- a/app/src/main/kotlin/com/simplemobiletools/gallery/pro/dialogs/GrantAllFilesDialog.kt +++ /dev/null @@ -1,23 +0,0 @@ -package com.simplemobiletools.gallery.pro.dialogs - -import com.simplemobiletools.commons.activities.BaseSimpleActivity -import com.simplemobiletools.commons.extensions.applyColorFilter -import com.simplemobiletools.commons.extensions.getAlertDialogBuilder -import com.simplemobiletools.commons.extensions.getProperTextColor -import com.simplemobiletools.commons.extensions.setupDialogStuff -import com.simplemobiletools.gallery.pro.databinding.DialogGrantAllFilesBinding -import com.simplemobiletools.gallery.pro.extensions.launchGrantAllFilesIntent - -class GrantAllFilesDialog(val activity: BaseSimpleActivity) { - init { - val binding = DialogGrantAllFilesBinding.inflate(activity.layoutInflater) - binding.grantAllFilesImage.applyColorFilter(activity.getProperTextColor()) - - activity.getAlertDialogBuilder() - .setPositiveButton(com.simplemobiletools.commons.R.string.ok) { dialog, which -> activity.launchGrantAllFilesIntent() } - .setNegativeButton(com.simplemobiletools.commons.R.string.cancel, null) - .apply { - activity.setupDialogStuff(binding.root, this) { alertDialog -> } - } - } -} diff --git a/app/src/main/kotlin/com/simplemobiletools/gallery/pro/extensions/FileDirItem.kt b/app/src/main/kotlin/com/simplemobiletools/gallery/pro/extensions/FileDirItem.kt deleted file mode 100644 index c67eebabb..000000000 --- a/app/src/main/kotlin/com/simplemobiletools/gallery/pro/extensions/FileDirItem.kt +++ /dev/null @@ -1,5 +0,0 @@ -package com.simplemobiletools.gallery.pro.extensions - -import com.simplemobiletools.commons.models.FileDirItem - -fun FileDirItem.isDownloadsFolder() = path.isDownloadsFolder() diff --git a/app/src/main/kotlin/com/simplemobiletools/gallery/pro/extensions/Int.kt b/app/src/main/kotlin/com/simplemobiletools/gallery/pro/extensions/Int.kt deleted file mode 100644 index 7792ef112..000000000 --- a/app/src/main/kotlin/com/simplemobiletools/gallery/pro/extensions/Int.kt +++ /dev/null @@ -1,5 +0,0 @@ -package com.simplemobiletools.gallery.pro.extensions - -import com.simplemobiletools.commons.helpers.SORT_DESCENDING - -fun Int.isSortingAscending() = this and SORT_DESCENDING == 0 diff --git a/app/src/main/kotlin/com/simplemobiletools/gallery/pro/models/ThumbnailItem.kt b/app/src/main/kotlin/com/simplemobiletools/gallery/pro/models/ThumbnailItem.kt deleted file mode 100644 index 4d2deaa31..000000000 --- a/app/src/main/kotlin/com/simplemobiletools/gallery/pro/models/ThumbnailItem.kt +++ /dev/null @@ -1,3 +0,0 @@ -package com.simplemobiletools.gallery.pro.models - -open class ThumbnailItem diff --git a/app/src/main/kotlin/com/simplemobiletools/gallery/pro/App.kt b/app/src/main/kotlin/org/fossify/gallery/App.kt similarity index 84% rename from app/src/main/kotlin/com/simplemobiletools/gallery/pro/App.kt rename to app/src/main/kotlin/org/fossify/gallery/App.kt index ef2768318..2f61925ff 100644 --- a/app/src/main/kotlin/com/simplemobiletools/gallery/pro/App.kt +++ b/app/src/main/kotlin/org/fossify/gallery/App.kt @@ -1,12 +1,12 @@ -package com.simplemobiletools.gallery.pro +package org.fossify.gallery import android.app.Application import com.github.ajalt.reprint.core.Reprint -import com.simplemobiletools.commons.extensions.checkUseEnglish import com.squareup.picasso.Downloader import com.squareup.picasso.Picasso import okhttp3.Request import okhttp3.Response +import org.fossify.commons.extensions.checkUseEnglish class App : Application() { override fun onCreate() { diff --git a/app/src/main/kotlin/com/simplemobiletools/gallery/pro/activities/EditActivity.kt b/app/src/main/kotlin/org/fossify/gallery/activities/EditActivity.kt similarity index 92% rename from app/src/main/kotlin/com/simplemobiletools/gallery/pro/activities/EditActivity.kt rename to app/src/main/kotlin/org/fossify/gallery/activities/EditActivity.kt index ffea6d0cd..c881f8a45 100644 --- a/app/src/main/kotlin/com/simplemobiletools/gallery/pro/activities/EditActivity.kt +++ b/app/src/main/kotlin/org/fossify/gallery/activities/EditActivity.kt @@ -1,4 +1,4 @@ -package com.simplemobiletools.gallery.pro.activities +package org.fossify.gallery.activities import android.annotation.TargetApi import android.app.Activity @@ -25,29 +25,29 @@ import com.bumptech.glide.request.RequestListener import com.bumptech.glide.request.RequestOptions import com.bumptech.glide.request.target.Target import com.canhub.cropper.CropImageView -import com.simplemobiletools.commons.dialogs.ColorPickerDialog -import com.simplemobiletools.commons.dialogs.ConfirmationDialog -import com.simplemobiletools.commons.extensions.* -import com.simplemobiletools.commons.helpers.NavigationIcon -import com.simplemobiletools.commons.helpers.REAL_FILE_PATH -import com.simplemobiletools.commons.helpers.ensureBackgroundThread -import com.simplemobiletools.commons.helpers.isNougatPlus -import com.simplemobiletools.commons.models.FileDirItem -import com.simplemobiletools.gallery.pro.BuildConfig -import com.simplemobiletools.gallery.pro.R -import com.simplemobiletools.gallery.pro.adapters.FiltersAdapter -import com.simplemobiletools.gallery.pro.databinding.ActivityEditBinding -import com.simplemobiletools.gallery.pro.dialogs.OtherAspectRatioDialog -import com.simplemobiletools.gallery.pro.dialogs.ResizeDialog -import com.simplemobiletools.gallery.pro.dialogs.SaveAsDialog -import com.simplemobiletools.gallery.pro.extensions.config -import com.simplemobiletools.gallery.pro.extensions.copyNonDimensionAttributesTo -import com.simplemobiletools.gallery.pro.extensions.fixDateTaken -import com.simplemobiletools.gallery.pro.extensions.openEditor -import com.simplemobiletools.gallery.pro.helpers.* -import com.simplemobiletools.gallery.pro.models.FilterItem import com.zomato.photofilters.FilterPack import com.zomato.photofilters.imageprocessors.Filter +import org.fossify.commons.dialogs.ColorPickerDialog +import org.fossify.commons.dialogs.ConfirmationDialog +import org.fossify.commons.extensions.* +import org.fossify.commons.helpers.NavigationIcon +import org.fossify.commons.helpers.REAL_FILE_PATH +import org.fossify.commons.helpers.ensureBackgroundThread +import org.fossify.commons.helpers.isNougatPlus +import org.fossify.commons.models.FileDirItem +import org.fossify.gallery.BuildConfig +import org.fossify.gallery.R +import org.fossify.gallery.adapters.FiltersAdapter +import org.fossify.gallery.databinding.ActivityEditBinding +import org.fossify.gallery.dialogs.OtherAspectRatioDialog +import org.fossify.gallery.dialogs.ResizeDialog +import org.fossify.gallery.dialogs.SaveAsDialog +import org.fossify.gallery.extensions.config +import org.fossify.gallery.extensions.copyNonDimensionAttributesTo +import org.fossify.gallery.extensions.fixDateTaken +import org.fossify.gallery.extensions.openEditor +import org.fossify.gallery.helpers.* +import org.fossify.gallery.models.FilterItem import java.io.* import kotlin.math.max @@ -79,8 +79,10 @@ class EditActivity : SimpleActivity(), CropImageView.OnCropImageCompleteListener private var resizeHeight = 0 private var drawColor = 0 private var lastOtherAspectRatio: Pair? = null - private var currPrimaryAction = PRIMARY_ACTION_NONE - private var currCropRotateAction = CROP_ROTATE_ASPECT_RATIO + private var currPrimaryAction = + PRIMARY_ACTION_NONE + private var currCropRotateAction = + CROP_ROTATE_ASPECT_RATIO private var currAspectRatio = ASPECT_RATIO_FREE private var isCropIntent = false private var isEditingWithThirdParty = false @@ -102,7 +104,7 @@ class EditActivity : SimpleActivity(), CropImageView.OnCropImageCompleteListener setupOptionsMenu() handlePermission(getPermissionToRequest()) { if (!it) { - toast(com.simplemobiletools.commons.R.string.no_storage_permissions) + toast(org.fossify.commons.R.string.no_storage_permissions) finish() } initEditActivity() @@ -230,7 +232,7 @@ class EditActivity : SimpleActivity(), CropImageView.OnCropImageCompleteListener bottomCropRotateClicked() } - if (filterInitialBitmap != null && currentFilter != null && currentFilter.filter.name != getString(com.simplemobiletools.commons.R.string.none)) { + if (filterInitialBitmap != null && currentFilter != null && currentFilter.filter.name != getString(org.fossify.commons.R.string.none)) { binding.defaultImageView.onGlobalLayout { applyFilter(currentFilter) } @@ -333,7 +335,7 @@ class EditActivity : SimpleActivity(), CropImageView.OnCropImageCompleteListener val currentFilter = getFiltersAdapter()?.getCurrentFilter() ?: return val filePathGetter = getNewFilePath() SaveAsDialog(this, filePathGetter.first, filePathGetter.second) { - toast(com.simplemobiletools.commons.R.string.saving) + toast(org.fossify.commons.R.string.saving) // clean up everything to free as much memory as possible binding.defaultImageView.setImageResource(0) @@ -347,7 +349,7 @@ class EditActivity : SimpleActivity(), CropImageView.OnCropImageCompleteListener currentFilter.filter.processFilter(originalBitmap) saveBitmapToFile(originalBitmap, it, false) } catch (e: OutOfMemoryError) { - toast(com.simplemobiletools.commons.R.string.out_of_memory_error) + toast(org.fossify.commons.R.string.out_of_memory_error) } } } @@ -374,7 +376,7 @@ class EditActivity : SimpleActivity(), CropImageView.OnCropImageCompleteListener binding.defaultImageView.isVisible() -> { val currentFilter = getFiltersAdapter()?.getCurrentFilter() if (currentFilter == null) { - toast(com.simplemobiletools.commons.R.string.unknown_error_occurred) + toast(org.fossify.commons.R.string.unknown_error_occurred) return@ensureBackgroundThread } @@ -399,7 +401,10 @@ class EditActivity : SimpleActivity(), CropImageView.OnCropImageCompleteListener val bytes = ByteArrayOutputStream() bitmap.compress(CompressFormat.PNG, 0, bytes) - val folder = File(cacheDir, TEMP_FOLDER_NAME) + val folder = File( + cacheDir, + TEMP_FOLDER_NAME + ) if (!folder.exists()) { if (!folder.mkdir()) { callback(null) @@ -430,7 +435,7 @@ class EditActivity : SimpleActivity(), CropImageView.OnCropImageCompleteListener if (it != null) { sharePathIntent(it, BuildConfig.APPLICATION_ID) } else { - toast(com.simplemobiletools.commons.R.string.unknown_error_occurred) + toast(org.fossify.commons.R.string.unknown_error_occurred) } } } @@ -655,7 +660,7 @@ class EditActivity : SimpleActivity(), CropImageView.OnCropImageCompleteListener val filterThumbnailsManager = FilterThumbnailsManager() filterThumbnailsManager.clearThumbs() - val noFilter = Filter(getString(com.simplemobiletools.commons.R.string.none)) + val noFilter = Filter(getString(org.fossify.commons.R.string.none)) filterThumbnailsManager.addThumb(FilterItem(bitmap, noFilter)) FilterPack.getFilterPack(this).forEach { @@ -683,7 +688,8 @@ class EditActivity : SimpleActivity(), CropImageView.OnCropImageCompleteListener if (currPrimaryAction != PRIMARY_ACTION_CROP_ROTATE) { binding.bottomAspectRatios.root.beGone() - currCropRotateAction = CROP_ROTATE_NONE + currCropRotateAction = + CROP_ROTATE_NONE } updateCropRotateActionButtons() } @@ -759,7 +765,7 @@ class EditActivity : SimpleActivity(), CropImageView.OnCropImageCompleteListener private fun resizeImage() { val point = getAreaSize() if (point == null) { - toast(com.simplemobiletools.commons.R.string.unknown_error_occurred) + toast(org.fossify.commons.R.string.unknown_error_occurred) return } @@ -772,8 +778,13 @@ class EditActivity : SimpleActivity(), CropImageView.OnCropImageCompleteListener private fun shouldCropSquare(): Boolean { val extras = intent.extras - return if (extras != null && extras.containsKey(ASPECT_X) && extras.containsKey(ASPECT_Y)) { - extras.getInt(ASPECT_X) == extras.getInt(ASPECT_Y) + return if (extras != null && extras.containsKey(ASPECT_X) && extras.containsKey( + ASPECT_Y + ) + ) { + extras.getInt(ASPECT_X) == extras.getInt( + ASPECT_Y + ) } else { false } @@ -875,7 +886,7 @@ class EditActivity : SimpleActivity(), CropImageView.OnCropImageCompleteListener val label = "sknahT .moc.slootelibomelpmis.www morf eno lanigiro eht daolnwod ytefas nwo ruoy roF .ppa eht fo noisrev ekaf a gnisu era uoY".reversed() runOnUiThread { - ConfirmationDialog(this, label, positive = com.simplemobiletools.commons.R.string.ok, negative = 0) { + ConfirmationDialog(this, label, positive = org.fossify.commons.R.string.ok, negative = 0) { launchViewIntent("6629852208836920709=di?ved/sppa/erots/moc.elgoog.yalp//:sptth".reversed()) } } @@ -903,14 +914,14 @@ class EditActivity : SimpleActivity(), CropImageView.OnCropImageCompleteListener } catch (e: Exception) { showErrorToast(e) } catch (e: OutOfMemoryError) { - toast(com.simplemobiletools.commons.R.string.out_of_memory_error) + toast(org.fossify.commons.R.string.out_of_memory_error) } } @TargetApi(Build.VERSION_CODES.N) private fun saveBitmap(file: File, bitmap: Bitmap, out: OutputStream, showSavingToast: Boolean) { if (showSavingToast) { - toast(com.simplemobiletools.commons.R.string.saving) + toast(org.fossify.commons.R.string.saving) } if (resizeWidth > 0 && resizeHeight > 0) { @@ -943,7 +954,7 @@ class EditActivity : SimpleActivity(), CropImageView.OnCropImageCompleteListener rescanPaths(paths) { fixDateTaken(paths, false) setResult(Activity.RESULT_OK, intent) - toast(com.simplemobiletools.commons.R.string.file_saved) + toast(org.fossify.commons.R.string.file_saved) finish() } } diff --git a/app/src/main/kotlin/com/simplemobiletools/gallery/pro/activities/ExcludedFoldersActivity.kt b/app/src/main/kotlin/org/fossify/gallery/activities/ExcludedFoldersActivity.kt similarity index 76% rename from app/src/main/kotlin/com/simplemobiletools/gallery/pro/activities/ExcludedFoldersActivity.kt rename to app/src/main/kotlin/org/fossify/gallery/activities/ExcludedFoldersActivity.kt index 11127c368..c8aca6cd4 100644 --- a/app/src/main/kotlin/com/simplemobiletools/gallery/pro/activities/ExcludedFoldersActivity.kt +++ b/app/src/main/kotlin/org/fossify/gallery/activities/ExcludedFoldersActivity.kt @@ -1,15 +1,15 @@ -package com.simplemobiletools.gallery.pro.activities +package org.fossify.gallery.activities import android.os.Bundle -import com.simplemobiletools.commons.dialogs.FilePickerDialog -import com.simplemobiletools.commons.extensions.* -import com.simplemobiletools.commons.helpers.NavigationIcon -import com.simplemobiletools.commons.helpers.isRPlus -import com.simplemobiletools.commons.interfaces.RefreshRecyclerViewListener -import com.simplemobiletools.gallery.pro.R -import com.simplemobiletools.gallery.pro.adapters.ManageFoldersAdapter -import com.simplemobiletools.gallery.pro.databinding.ActivityManageFoldersBinding -import com.simplemobiletools.gallery.pro.extensions.config +import org.fossify.commons.dialogs.FilePickerDialog +import org.fossify.commons.extensions.* +import org.fossify.commons.helpers.NavigationIcon +import org.fossify.commons.helpers.isRPlus +import org.fossify.commons.interfaces.RefreshRecyclerViewListener +import org.fossify.gallery.R +import org.fossify.gallery.adapters.ManageFoldersAdapter +import org.fossify.gallery.databinding.ActivityManageFoldersBinding +import org.fossify.gallery.extensions.config class ExcludedFoldersActivity : SimpleActivity(), RefreshRecyclerViewListener { @@ -21,7 +21,7 @@ class ExcludedFoldersActivity : SimpleActivity(), RefreshRecyclerViewListener { setContentView(binding.root) updateFolders() setupOptionsMenu() - binding.manageFoldersToolbar.title = getString(com.simplemobiletools.commons.R.string.excluded_folders) + binding.manageFoldersToolbar.title = getString(org.fossify.commons.R.string.excluded_folders) updateMaterialActivityViews(binding.manageFoldersCoordinator, binding.manageFoldersList, useTransparentNavigation = true, useTopSearchMenu = false) setupMaterialScrollListener(binding.manageFoldersList, binding.manageFoldersToolbar) diff --git a/app/src/main/kotlin/com/simplemobiletools/gallery/pro/activities/HiddenFoldersActivity.kt b/app/src/main/kotlin/org/fossify/gallery/activities/HiddenFoldersActivity.kt similarity index 70% rename from app/src/main/kotlin/com/simplemobiletools/gallery/pro/activities/HiddenFoldersActivity.kt rename to app/src/main/kotlin/org/fossify/gallery/activities/HiddenFoldersActivity.kt index 028815ae1..9ec2ac27b 100644 --- a/app/src/main/kotlin/com/simplemobiletools/gallery/pro/activities/HiddenFoldersActivity.kt +++ b/app/src/main/kotlin/org/fossify/gallery/activities/HiddenFoldersActivity.kt @@ -1,19 +1,19 @@ -package com.simplemobiletools.gallery.pro.activities +package org.fossify.gallery.activities import android.os.Bundle -import com.simplemobiletools.commons.dialogs.FilePickerDialog -import com.simplemobiletools.commons.extensions.beVisibleIf -import com.simplemobiletools.commons.extensions.getProperTextColor -import com.simplemobiletools.commons.extensions.viewBinding -import com.simplemobiletools.commons.helpers.NavigationIcon -import com.simplemobiletools.commons.helpers.ensureBackgroundThread -import com.simplemobiletools.commons.interfaces.RefreshRecyclerViewListener -import com.simplemobiletools.gallery.pro.R -import com.simplemobiletools.gallery.pro.adapters.ManageHiddenFoldersAdapter -import com.simplemobiletools.gallery.pro.databinding.ActivityManageFoldersBinding -import com.simplemobiletools.gallery.pro.extensions.addNoMedia -import com.simplemobiletools.gallery.pro.extensions.config -import com.simplemobiletools.gallery.pro.extensions.getNoMediaFolders +import org.fossify.commons.dialogs.FilePickerDialog +import org.fossify.commons.extensions.beVisibleIf +import org.fossify.commons.extensions.getProperTextColor +import org.fossify.commons.extensions.viewBinding +import org.fossify.commons.helpers.NavigationIcon +import org.fossify.commons.helpers.ensureBackgroundThread +import org.fossify.commons.interfaces.RefreshRecyclerViewListener +import org.fossify.gallery.R +import org.fossify.gallery.adapters.ManageHiddenFoldersAdapter +import org.fossify.gallery.databinding.ActivityManageFoldersBinding +import org.fossify.gallery.extensions.addNoMedia +import org.fossify.gallery.extensions.config +import org.fossify.gallery.extensions.getNoMediaFolders class HiddenFoldersActivity : SimpleActivity(), RefreshRecyclerViewListener { diff --git a/app/src/main/kotlin/com/simplemobiletools/gallery/pro/activities/IncludedFoldersActivity.kt b/app/src/main/kotlin/org/fossify/gallery/activities/IncludedFoldersActivity.kt similarity index 75% rename from app/src/main/kotlin/com/simplemobiletools/gallery/pro/activities/IncludedFoldersActivity.kt rename to app/src/main/kotlin/org/fossify/gallery/activities/IncludedFoldersActivity.kt index 5c54c2c57..9569ac8b3 100644 --- a/app/src/main/kotlin/com/simplemobiletools/gallery/pro/activities/IncludedFoldersActivity.kt +++ b/app/src/main/kotlin/org/fossify/gallery/activities/IncludedFoldersActivity.kt @@ -1,15 +1,15 @@ -package com.simplemobiletools.gallery.pro.activities +package org.fossify.gallery.activities import android.os.Bundle -import com.simplemobiletools.commons.extensions.beVisibleIf -import com.simplemobiletools.commons.extensions.getProperTextColor -import com.simplemobiletools.commons.extensions.viewBinding -import com.simplemobiletools.commons.helpers.NavigationIcon -import com.simplemobiletools.commons.interfaces.RefreshRecyclerViewListener -import com.simplemobiletools.gallery.pro.R -import com.simplemobiletools.gallery.pro.adapters.ManageFoldersAdapter -import com.simplemobiletools.gallery.pro.databinding.ActivityManageFoldersBinding -import com.simplemobiletools.gallery.pro.extensions.config +import org.fossify.commons.extensions.beVisibleIf +import org.fossify.commons.extensions.getProperTextColor +import org.fossify.commons.extensions.viewBinding +import org.fossify.commons.helpers.NavigationIcon +import org.fossify.commons.interfaces.RefreshRecyclerViewListener +import org.fossify.gallery.R +import org.fossify.gallery.adapters.ManageFoldersAdapter +import org.fossify.gallery.databinding.ActivityManageFoldersBinding +import org.fossify.gallery.extensions.config class IncludedFoldersActivity : SimpleActivity(), RefreshRecyclerViewListener { diff --git a/app/src/main/kotlin/com/simplemobiletools/gallery/pro/activities/MainActivity.kt b/app/src/main/kotlin/org/fossify/gallery/activities/MainActivity.kt similarity index 94% rename from app/src/main/kotlin/com/simplemobiletools/gallery/pro/activities/MainActivity.kt rename to app/src/main/kotlin/org/fossify/gallery/activities/MainActivity.kt index b52bd673e..f357de76f 100644 --- a/app/src/main/kotlin/com/simplemobiletools/gallery/pro/activities/MainActivity.kt +++ b/app/src/main/kotlin/org/fossify/gallery/activities/MainActivity.kt @@ -1,4 +1,4 @@ -package com.simplemobiletools.gallery.pro.activities +package org.fossify.gallery.activities import android.app.Activity import android.content.ClipData @@ -13,32 +13,32 @@ import android.view.ViewGroup import android.widget.RelativeLayout import android.widget.Toast import androidx.recyclerview.widget.RecyclerView -import com.simplemobiletools.commons.dialogs.ConfirmationDialog -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.* -import com.simplemobiletools.commons.models.FileDirItem -import com.simplemobiletools.commons.models.RadioItem -import com.simplemobiletools.commons.models.Release -import com.simplemobiletools.commons.views.MyGridLayoutManager -import com.simplemobiletools.commons.views.MyRecyclerView -import com.simplemobiletools.gallery.pro.BuildConfig -import com.simplemobiletools.gallery.pro.R -import com.simplemobiletools.gallery.pro.adapters.DirectoryAdapter -import com.simplemobiletools.gallery.pro.databases.GalleryDatabase -import com.simplemobiletools.gallery.pro.databinding.ActivityMainBinding -import com.simplemobiletools.gallery.pro.dialogs.ChangeSortingDialog -import com.simplemobiletools.gallery.pro.dialogs.ChangeViewTypeDialog -import com.simplemobiletools.gallery.pro.dialogs.FilterMediaDialog -import com.simplemobiletools.gallery.pro.dialogs.GrantAllFilesDialog -import com.simplemobiletools.gallery.pro.extensions.* -import com.simplemobiletools.gallery.pro.helpers.* -import com.simplemobiletools.gallery.pro.interfaces.DirectoryOperationsListener -import com.simplemobiletools.gallery.pro.jobs.NewPhotoFetcher -import com.simplemobiletools.gallery.pro.models.Directory -import com.simplemobiletools.gallery.pro.models.Medium +import org.fossify.commons.dialogs.ConfirmationDialog +import org.fossify.commons.dialogs.CreateNewFolderDialog +import org.fossify.commons.dialogs.FilePickerDialog +import org.fossify.commons.dialogs.RadioGroupDialog +import org.fossify.commons.extensions.* +import org.fossify.commons.helpers.* +import org.fossify.commons.models.FileDirItem +import org.fossify.commons.models.RadioItem +import org.fossify.commons.models.Release +import org.fossify.commons.views.MyGridLayoutManager +import org.fossify.commons.views.MyRecyclerView +import org.fossify.gallery.BuildConfig +import org.fossify.gallery.R +import org.fossify.gallery.adapters.DirectoryAdapter +import org.fossify.gallery.databases.GalleryDatabase +import org.fossify.gallery.databinding.ActivityMainBinding +import org.fossify.gallery.dialogs.ChangeSortingDialog +import org.fossify.gallery.dialogs.ChangeViewTypeDialog +import org.fossify.gallery.dialogs.FilterMediaDialog +import org.fossify.gallery.dialogs.GrantAllFilesDialog +import org.fossify.gallery.extensions.* +import org.fossify.gallery.helpers.* +import org.fossify.gallery.interfaces.DirectoryOperationsListener +import org.fossify.gallery.jobs.NewPhotoFetcher +import org.fossify.gallery.models.Directory +import org.fossify.gallery.models.Medium import java.io.* class MainActivity : SimpleActivity(), DirectoryOperationsListener { @@ -161,7 +161,7 @@ class MainActivity : SimpleActivity(), DirectoryOperationsListener { // just request the permission, tryLoadGallery will then trigger in onResume handleMediaPermissions { success -> if (!success) { - toast(com.simplemobiletools.commons.R.string.no_storage_permissions) + toast(org.fossify.commons.R.string.no_storage_permissions) finish() } } @@ -257,9 +257,9 @@ class MainActivity : SimpleActivity(), DirectoryOperationsListener { } if (config.searchAllFilesByDefault) { - binding.mainMenu.updateHintText(getString(com.simplemobiletools.commons.R.string.search_files)) + binding.mainMenu.updateHintText(getString(org.fossify.commons.R.string.search_files)) } else { - binding.mainMenu.updateHintText(getString(com.simplemobiletools.commons.R.string.search_folders)) + binding.mainMenu.updateHintText(getString(org.fossify.commons.R.string.search_folders)) } } @@ -357,7 +357,7 @@ class MainActivity : SimpleActivity(), DirectoryOperationsListener { findItem(R.id.column_count).isVisible = config.viewTypeFolders == VIEW_TYPE_GRID findItem(R.id.set_as_default_folder).isVisible = !config.defaultFolder.isEmpty() findItem(R.id.open_recycle_bin).isVisible = config.useRecycleBin && !config.showRecycleBinAtFolders - findItem(R.id.more_apps_from_us).isVisible = !resources.getBoolean(com.simplemobiletools.commons.R.bool.hide_google_relations) + findItem(R.id.more_apps_from_us).isVisible = !resources.getBoolean(org.fossify.commons.R.bool.hide_google_relations) } } @@ -459,7 +459,7 @@ class MainActivity : SimpleActivity(), DirectoryOperationsListener { val newFolder = File(config.tempFolderPath) if (getDoesFilePathExist(newFolder.absolutePath) && newFolder.isDirectory) { if (newFolder.getProperSize(true) == 0L && newFolder.getFileCount(true) == 0 && newFolder.list()?.isEmpty() == true) { - toast(String.format(getString(com.simplemobiletools.commons.R.string.deleting_folder), config.tempFolderPath), Toast.LENGTH_LONG) + toast(String.format(getString(org.fossify.commons.R.string.deleting_folder), config.tempFolderPath), Toast.LENGTH_LONG) tryDeleteFileDirItem(newFolder.toFileDirItem(applicationContext), true, true) } } @@ -510,12 +510,12 @@ class MainActivity : SimpleActivity(), DirectoryOperationsListener { mWasDefaultFolderChecked = true } - if (isPackageInstalled("com.simplemobiletools.gallery")) { + if (isPackageInstalled("org.fossify.gallery")) { ConfirmationDialog( this, "", - com.simplemobiletools.commons.R.string.upgraded_from_free_gallery, - com.simplemobiletools.commons.R.string.ok, + org.fossify.commons.R.string.upgraded_from_free_gallery, + org.fossify.commons.R.string.ok, 0, false ) {} @@ -532,7 +532,7 @@ class MainActivity : SimpleActivity(), DirectoryOperationsListener { setupLayoutManager() } else { - toast(com.simplemobiletools.commons.R.string.no_storage_permissions) + toast(org.fossify.commons.R.string.no_storage_permissions) finish() } } @@ -659,7 +659,7 @@ class MainActivity : SimpleActivity(), DirectoryOperationsListener { fileDirItems.isEmpty() -> return fileDirItems.size == 1 -> { try { - toast(String.format(getString(com.simplemobiletools.commons.R.string.deleting_folder), fileDirItems.first().name)) + toast(String.format(getString(org.fossify.commons.R.string.deleting_folder), fileDirItems.first().name)) } catch (e: Exception) { showErrorToast(e) } @@ -667,7 +667,7 @@ class MainActivity : SimpleActivity(), DirectoryOperationsListener { else -> { val baseString = - if (config.useRecycleBin && !config.tempSkipRecycleBin) com.simplemobiletools.commons.R.plurals.moving_items_into_bin else com.simplemobiletools.commons.R.plurals.delete_items + if (config.useRecycleBin && !config.tempSkipRecycleBin) org.fossify.commons.R.plurals.moving_items_into_bin else org.fossify.commons.R.plurals.delete_items val deletingItems = resources.getQuantityString(baseString, fileDirItems.size, fileDirItems.size) toast(deletingItems) } @@ -696,7 +696,7 @@ class MainActivity : SimpleActivity(), DirectoryOperationsListener { if (it) { deleteFilteredFileDirItems(itemsToDelete, folders) } else { - toast(com.simplemobiletools.commons.R.string.unknown_error_occurred) + toast(org.fossify.commons.R.string.unknown_error_occurred) } } } else { @@ -796,7 +796,7 @@ class MainActivity : SimpleActivity(), DirectoryOperationsListener { private fun changeColumnCount() { val items = ArrayList() for (i in 1..MAX_COLUMN_COUNT) { - items.add(RadioItem(i, resources.getQuantityString(com.simplemobiletools.commons.R.plurals.column_counts, i, i))) + items.add(RadioItem(i, resources.getQuantityString(org.fossify.commons.R.plurals.column_counts, i, i))) } val currentColumnCount = (binding.directoriesGrid.layoutManager as MyGridLayoutManager).spanCount @@ -971,7 +971,7 @@ class MainActivity : SimpleActivity(), DirectoryOperationsListener { if (mediaDB.getDeletedMediaCount() > 0) { val recycleBin = Directory().apply { path = RECYCLE_BIN - name = getString(com.simplemobiletools.commons.R.string.recycle_bin) + name = getString(org.fossify.commons.R.string.recycle_bin) location = LOCATION_INTERNAL } @@ -985,7 +985,7 @@ class MainActivity : SimpleActivity(), DirectoryOperationsListener { if (mediaDB.getFavoritesCount() > 0) { val favorites = Directory().apply { path = FAVORITES - name = getString(com.simplemobiletools.commons.R.string.favorites) + name = getString(org.fossify.commons.R.string.favorites) location = LOCATION_INTERNAL } @@ -1174,10 +1174,7 @@ class MainActivity : SimpleActivity(), DirectoryOperationsListener { // do not add excluded folders and their subfolders at everShownFolders dirs.filter { dir -> - if (excludedFolders.any { dir.path.startsWith(it) }) { - return@filter false - } - return@filter true + return@filter !excludedFolders.any { dir.path.startsWith(it) } }.mapTo(everShownFolders) { it.path } try { @@ -1223,11 +1220,11 @@ class MainActivity : SimpleActivity(), DirectoryOperationsListener { binding.directoriesEmptyPlaceholder2.beVisibleIf(dirs.isEmpty() && mLoadedInitialPhotos) if (binding.mainMenu.isSearchOpen) { - binding.directoriesEmptyPlaceholder.text = getString(com.simplemobiletools.commons.R.string.no_items_found) + binding.directoriesEmptyPlaceholder.text = getString(org.fossify.commons.R.string.no_items_found) binding.directoriesEmptyPlaceholder2.beGone() } else if (dirs.isEmpty() && config.filterMedia == getDefaultFileFilter()) { if (isRPlus() && !isExternalStorageManager()) { - binding.directoriesEmptyPlaceholder.text = getString(com.simplemobiletools.commons.R.string.no_items_found) + binding.directoriesEmptyPlaceholder.text = getString(org.fossify.commons.R.string.no_items_found) binding.directoriesEmptyPlaceholder2.beGone() } else { binding.directoriesEmptyPlaceholder.text = getString(R.string.no_media_add_included) diff --git a/app/src/main/kotlin/com/simplemobiletools/gallery/pro/activities/MediaActivity.kt b/app/src/main/kotlin/org/fossify/gallery/activities/MediaActivity.kt similarity index 92% rename from app/src/main/kotlin/com/simplemobiletools/gallery/pro/activities/MediaActivity.kt rename to app/src/main/kotlin/org/fossify/gallery/activities/MediaActivity.kt index 281c745b0..e7ee8654c 100644 --- a/app/src/main/kotlin/com/simplemobiletools/gallery/pro/activities/MediaActivity.kt +++ b/app/src/main/kotlin/org/fossify/gallery/activities/MediaActivity.kt @@ -1,4 +1,4 @@ -package com.simplemobiletools.gallery.pro.activities +package org.fossify.gallery.activities import android.app.Activity import android.app.WallpaperManager @@ -15,27 +15,27 @@ import com.bumptech.glide.Glide import com.bumptech.glide.request.RequestOptions import com.bumptech.glide.request.target.SimpleTarget import com.bumptech.glide.request.transition.Transition -import com.simplemobiletools.commons.dialogs.ConfirmationDialog -import com.simplemobiletools.commons.dialogs.CreateNewFolderDialog -import com.simplemobiletools.commons.dialogs.RadioGroupDialog -import com.simplemobiletools.commons.extensions.* -import com.simplemobiletools.commons.helpers.* -import com.simplemobiletools.commons.models.FileDirItem -import com.simplemobiletools.commons.models.RadioItem -import com.simplemobiletools.commons.views.MyGridLayoutManager -import com.simplemobiletools.commons.views.MyRecyclerView -import com.simplemobiletools.gallery.pro.R -import com.simplemobiletools.gallery.pro.adapters.MediaAdapter -import com.simplemobiletools.gallery.pro.asynctasks.GetMediaAsynctask -import com.simplemobiletools.gallery.pro.databases.GalleryDatabase -import com.simplemobiletools.gallery.pro.databinding.ActivityMediaBinding -import com.simplemobiletools.gallery.pro.dialogs.* -import com.simplemobiletools.gallery.pro.extensions.* -import com.simplemobiletools.gallery.pro.helpers.* -import com.simplemobiletools.gallery.pro.interfaces.MediaOperationsListener -import com.simplemobiletools.gallery.pro.models.Medium -import com.simplemobiletools.gallery.pro.models.ThumbnailItem -import com.simplemobiletools.gallery.pro.models.ThumbnailSection +import org.fossify.commons.dialogs.ConfirmationDialog +import org.fossify.commons.dialogs.CreateNewFolderDialog +import org.fossify.commons.dialogs.RadioGroupDialog +import org.fossify.commons.extensions.* +import org.fossify.commons.helpers.* +import org.fossify.commons.models.FileDirItem +import org.fossify.commons.models.RadioItem +import org.fossify.commons.views.MyGridLayoutManager +import org.fossify.commons.views.MyRecyclerView +import org.fossify.gallery.R +import org.fossify.gallery.adapters.MediaAdapter +import org.fossify.gallery.asynctasks.GetMediaAsynctask +import org.fossify.gallery.databases.GalleryDatabase +import org.fossify.gallery.databinding.ActivityMediaBinding +import org.fossify.gallery.dialogs.* +import org.fossify.gallery.extensions.* +import org.fossify.gallery.helpers.* +import org.fossify.gallery.interfaces.MediaOperationsListener +import org.fossify.gallery.models.Medium +import org.fossify.gallery.models.ThumbnailItem +import org.fossify.gallery.models.ThumbnailSection import java.io.File import java.io.IOException @@ -105,12 +105,12 @@ class MediaActivity : SimpleActivity(), MediaOperationsListener { if (mShowAll) { registerFileUpdateListener() - if (isPackageInstalled("com.simplemobiletools.gallery")) { + if (isPackageInstalled("org.fossify.gallery")) { ConfirmationDialog( this, "", - com.simplemobiletools.commons.R.string.upgraded_from_free_gallery, - com.simplemobiletools.commons.R.string.ok, + org.fossify.commons.R.string.upgraded_from_free_gallery, + org.fossify.commons.R.string.ok, 0, false ) {} @@ -364,7 +364,7 @@ class MediaActivity : SimpleActivity(), MediaOperationsListener { val grouped = MediaFetcher(applicationContext).groupMedia(filtered as ArrayList, mPath) runOnUiThread { if (grouped.isEmpty()) { - binding.mediaEmptyTextPlaceholder.text = getString(com.simplemobiletools.commons.R.string.no_items_found) + binding.mediaEmptyTextPlaceholder.text = getString(org.fossify.commons.R.string.no_items_found) binding.mediaEmptyTextPlaceholder.beVisible() binding.mediaFastscroller.beGone() } else { @@ -384,16 +384,16 @@ class MediaActivity : SimpleActivity(), MediaOperationsListener { handlePermission(getPermissionToRequest()) { if (it) { val dirName = when { - mPath == FAVORITES -> getString(com.simplemobiletools.commons.R.string.favorites) - mPath == RECYCLE_BIN -> getString(com.simplemobiletools.commons.R.string.recycle_bin) - mPath == config.OTGPath -> getString(com.simplemobiletools.commons.R.string.usb) + mPath == FAVORITES -> getString(org.fossify.commons.R.string.favorites) + mPath == RECYCLE_BIN -> getString(org.fossify.commons.R.string.recycle_bin) + mPath == config.OTGPath -> getString(org.fossify.commons.R.string.usb) else -> getHumanizedFilename(mPath) } val searchHint = if (mShowAll) { - getString(com.simplemobiletools.commons.R.string.search_files) + getString(org.fossify.commons.R.string.search_files) } else { - getString(com.simplemobiletools.commons.R.string.search_in_placeholder, dirName) + getString(org.fossify.commons.R.string.search_in_placeholder, dirName) } binding.mediaMenu.updateHintText(searchHint) @@ -407,7 +407,7 @@ class MediaActivity : SimpleActivity(), MediaOperationsListener { getMedia() setupLayoutManager() } else { - toast(com.simplemobiletools.commons.R.string.no_storage_permissions) + toast(org.fossify.commons.R.string.no_storage_permissions) finish() } } @@ -631,7 +631,7 @@ class MediaActivity : SimpleActivity(), MediaOperationsListener { } if (mPath == RECYCLE_BIN) { - binding.mediaEmptyTextPlaceholder.setText(com.simplemobiletools.commons.R.string.no_items_found) + binding.mediaEmptyTextPlaceholder.setText(org.fossify.commons.R.string.no_items_found) binding.mediaEmptyTextPlaceholder.beVisible() binding.mediaEmptyTextPlaceholder2.beGone() } else { @@ -770,7 +770,7 @@ class MediaActivity : SimpleActivity(), MediaOperationsListener { private fun changeColumnCount() { val items = ArrayList() for (i in 1..MAX_COLUMN_COUNT) { - items.add(RadioItem(i, resources.getQuantityString(com.simplemobiletools.commons.R.plurals.column_counts, i, i))) + items.add(RadioItem(i, resources.getQuantityString(org.fossify.commons.R.plurals.column_counts, i, i))) } val currentColumnCount = (binding.mediaGrid.layoutManager as MyGridLayoutManager).spanCount @@ -903,18 +903,18 @@ class MediaActivity : SimpleActivity(), MediaOperationsListener { } if (config.useRecycleBin && !skipRecycleBin && !filtered.first().path.startsWith(recycleBinPath)) { - val movingItems = resources.getQuantityString(com.simplemobiletools.commons.R.plurals.moving_items_into_bin, filtered.size, filtered.size) + val movingItems = resources.getQuantityString(org.fossify.commons.R.plurals.moving_items_into_bin, filtered.size, filtered.size) toast(movingItems) movePathsInRecycleBin(filtered.map { it.path } as ArrayList) { if (it) { deleteFilteredFiles(filtered) } else { - toast(com.simplemobiletools.commons.R.string.unknown_error_occurred) + toast(org.fossify.commons.R.string.unknown_error_occurred) } } } else { - val deletingItems = resources.getQuantityString(com.simplemobiletools.commons.R.plurals.deleting_items, filtered.size, filtered.size) + val deletingItems = resources.getQuantityString(org.fossify.commons.R.plurals.deleting_items, filtered.size, filtered.size) toast(deletingItems) deleteFilteredFiles(filtered) } @@ -925,7 +925,7 @@ class MediaActivity : SimpleActivity(), MediaOperationsListener { private fun deleteFilteredFiles(filtered: ArrayList) { deleteFiles(filtered) { if (!it) { - toast(com.simplemobiletools.commons.R.string.unknown_error_occurred) + toast(org.fossify.commons.R.string.unknown_error_occurred) return@deleteFiles } diff --git a/app/src/main/kotlin/com/simplemobiletools/gallery/pro/activities/PanoramaPhotoActivity.kt b/app/src/main/kotlin/org/fossify/gallery/activities/PanoramaPhotoActivity.kt similarity index 91% rename from app/src/main/kotlin/com/simplemobiletools/gallery/pro/activities/PanoramaPhotoActivity.kt rename to app/src/main/kotlin/org/fossify/gallery/activities/PanoramaPhotoActivity.kt index d4e66c4b5..420e8a711 100644 --- a/app/src/main/kotlin/com/simplemobiletools/gallery/pro/activities/PanoramaPhotoActivity.kt +++ b/app/src/main/kotlin/org/fossify/gallery/activities/PanoramaPhotoActivity.kt @@ -1,4 +1,4 @@ -package com.simplemobiletools.gallery.pro.activities +package org.fossify.gallery.activities import android.content.res.Configuration import android.graphics.Bitmap @@ -12,15 +12,15 @@ import android.view.WindowInsetsController import android.widget.RelativeLayout import com.google.vr.sdk.widgets.pano.VrPanoramaEventListener import com.google.vr.sdk.widgets.pano.VrPanoramaView -import com.simplemobiletools.commons.extensions.* -import com.simplemobiletools.commons.helpers.ensureBackgroundThread -import com.simplemobiletools.commons.helpers.isRPlus -import com.simplemobiletools.gallery.pro.R -import com.simplemobiletools.gallery.pro.databinding.ActivityPanoramaPhotoBinding -import com.simplemobiletools.gallery.pro.extensions.config -import com.simplemobiletools.gallery.pro.extensions.hideSystemUI -import com.simplemobiletools.gallery.pro.extensions.showSystemUI -import com.simplemobiletools.gallery.pro.helpers.PATH +import org.fossify.commons.extensions.* +import org.fossify.commons.helpers.ensureBackgroundThread +import org.fossify.commons.helpers.isRPlus +import org.fossify.gallery.R +import org.fossify.gallery.databinding.ActivityPanoramaPhotoBinding +import org.fossify.gallery.extensions.config +import org.fossify.gallery.extensions.hideSystemUI +import org.fossify.gallery.extensions.showSystemUI +import org.fossify.gallery.helpers.PATH open class PanoramaPhotoActivity : SimpleActivity() { private val CARDBOARD_DISPLAY_MODE = 3 diff --git a/app/src/main/kotlin/com/simplemobiletools/gallery/pro/activities/PanoramaVideoActivity.kt b/app/src/main/kotlin/org/fossify/gallery/activities/PanoramaVideoActivity.kt similarity index 91% rename from app/src/main/kotlin/com/simplemobiletools/gallery/pro/activities/PanoramaVideoActivity.kt rename to app/src/main/kotlin/org/fossify/gallery/activities/PanoramaVideoActivity.kt index 028fd557d..8ba7d997e 100644 --- a/app/src/main/kotlin/com/simplemobiletools/gallery/pro/activities/PanoramaVideoActivity.kt +++ b/app/src/main/kotlin/org/fossify/gallery/activities/PanoramaVideoActivity.kt @@ -1,4 +1,4 @@ -package com.simplemobiletools.gallery.pro.activities +package org.fossify.gallery.activities import android.content.res.Configuration import android.graphics.Color @@ -13,16 +13,16 @@ import android.widget.RelativeLayout import android.widget.SeekBar import com.google.vr.sdk.widgets.video.VrVideoEventListener import com.google.vr.sdk.widgets.video.VrVideoView -import com.simplemobiletools.commons.extensions.* -import com.simplemobiletools.commons.helpers.isRPlus -import com.simplemobiletools.gallery.pro.R -import com.simplemobiletools.gallery.pro.databinding.ActivityPanoramaVideoBinding -import com.simplemobiletools.gallery.pro.extensions.config -import com.simplemobiletools.gallery.pro.extensions.hasNavBar -import com.simplemobiletools.gallery.pro.extensions.hideSystemUI -import com.simplemobiletools.gallery.pro.extensions.showSystemUI -import com.simplemobiletools.gallery.pro.helpers.MIN_SKIP_LENGTH -import com.simplemobiletools.gallery.pro.helpers.PATH +import org.fossify.commons.extensions.* +import org.fossify.commons.helpers.isRPlus +import org.fossify.gallery.R +import org.fossify.gallery.databinding.ActivityPanoramaVideoBinding +import org.fossify.gallery.extensions.config +import org.fossify.gallery.extensions.hasNavBar +import org.fossify.gallery.extensions.hideSystemUI +import org.fossify.gallery.extensions.showSystemUI +import org.fossify.gallery.helpers.MIN_SKIP_LENGTH +import org.fossify.gallery.helpers.PATH import java.io.File open class PanoramaVideoActivity : SimpleActivity(), SeekBar.OnSeekBarChangeListener { @@ -149,7 +149,7 @@ open class PanoramaVideoActivity : SimpleActivity(), SeekBar.OnSeekBarChangeList mIsPlaying = true resumeVideo() } else { - binding.bottomVideoTimeHolder.videoTogglePlayPause.setImageResource(com.simplemobiletools.commons.R.drawable.ic_play_outline_vector) + binding.bottomVideoTimeHolder.videoTogglePlayPause.setImageResource(org.fossify.commons.R.drawable.ic_play_outline_vector) } binding.bottomVideoTimeHolder.videoTogglePlayPause.beVisible() } @@ -204,7 +204,7 @@ open class PanoramaVideoActivity : SimpleActivity(), SeekBar.OnSeekBarChangeList } private fun resumeVideo() { - binding.bottomVideoTimeHolder.videoTogglePlayPause.setImageResource(com.simplemobiletools.commons.R.drawable.ic_pause_outline_vector) + binding.bottomVideoTimeHolder.videoTogglePlayPause.setImageResource(org.fossify.commons.R.drawable.ic_pause_outline_vector) if (mCurrTime == mDuration) { setVideoProgress(0) mPlayOnReady = true @@ -217,7 +217,7 @@ open class PanoramaVideoActivity : SimpleActivity(), SeekBar.OnSeekBarChangeList private fun pauseVideo() { binding.vrVideoView.pauseVideo() - binding.bottomVideoTimeHolder.videoTogglePlayPause.setImageResource(com.simplemobiletools.commons.R.drawable.ic_play_outline_vector) + binding.bottomVideoTimeHolder.videoTogglePlayPause.setImageResource(org.fossify.commons.R.drawable.ic_play_outline_vector) window.clearFlags(WindowManager.LayoutParams.FLAG_KEEP_SCREEN_ON) } @@ -253,7 +253,7 @@ open class PanoramaVideoActivity : SimpleActivity(), SeekBar.OnSeekBarChangeList binding.bottomVideoTimeHolder.root.background = resources.getDrawable(R.drawable.gradient_background) binding.bottomVideoTimeHolder.root.onGlobalLayout { val newBottomMargin = binding.bottomVideoTimeHolder.root.height - resources.getDimension(R.dimen.video_player_play_pause_size) - .toInt() - resources.getDimension(com.simplemobiletools.commons.R.dimen.activity_margin).toInt() + .toInt() - resources.getDimension(org.fossify.commons.R.dimen.activity_margin).toInt() (binding.explore.layoutParams as RelativeLayout.LayoutParams).bottomMargin = newBottomMargin (binding.cardboard.layoutParams as RelativeLayout.LayoutParams).apply { @@ -262,7 +262,7 @@ open class PanoramaVideoActivity : SimpleActivity(), SeekBar.OnSeekBarChangeList } binding.explore.requestLayout() } - binding.bottomVideoTimeHolder.videoTogglePlayPause.setImageResource(com.simplemobiletools.commons.R.drawable.ic_play_outline_vector) + binding.bottomVideoTimeHolder.videoTogglePlayPause.setImageResource(org.fossify.commons.R.drawable.ic_play_outline_vector) binding.cardboard.setOnClickListener { binding.vrVideoView.displayMode = CARDBOARD_DISPLAY_MODE diff --git a/app/src/main/kotlin/com/simplemobiletools/gallery/pro/activities/PhotoActivity.kt b/app/src/main/kotlin/org/fossify/gallery/activities/PhotoActivity.kt similarity index 79% rename from app/src/main/kotlin/com/simplemobiletools/gallery/pro/activities/PhotoActivity.kt rename to app/src/main/kotlin/org/fossify/gallery/activities/PhotoActivity.kt index 95c439d3a..84d4940ef 100644 --- a/app/src/main/kotlin/com/simplemobiletools/gallery/pro/activities/PhotoActivity.kt +++ b/app/src/main/kotlin/org/fossify/gallery/activities/PhotoActivity.kt @@ -1,4 +1,4 @@ -package com.simplemobiletools.gallery.pro.activities +package org.fossify.gallery.activities import android.os.Bundle diff --git a/app/src/main/kotlin/com/simplemobiletools/gallery/pro/activities/PhotoVideoActivity.kt b/app/src/main/kotlin/org/fossify/gallery/activities/PhotoVideoActivity.kt similarity index 93% rename from app/src/main/kotlin/com/simplemobiletools/gallery/pro/activities/PhotoVideoActivity.kt rename to app/src/main/kotlin/org/fossify/gallery/activities/PhotoVideoActivity.kt index 6e9b2a0d7..69c737674 100644 --- a/app/src/main/kotlin/com/simplemobiletools/gallery/pro/activities/PhotoVideoActivity.kt +++ b/app/src/main/kotlin/org/fossify/gallery/activities/PhotoVideoActivity.kt @@ -1,4 +1,4 @@ -package com.simplemobiletools.gallery.pro.activities +package org.fossify.gallery.activities import android.content.Intent import android.content.res.Configuration @@ -10,18 +10,18 @@ import android.provider.MediaStore import android.text.Html import android.view.View import android.widget.RelativeLayout -import com.simplemobiletools.commons.dialogs.PropertiesDialog -import com.simplemobiletools.commons.extensions.* -import com.simplemobiletools.commons.helpers.* -import com.simplemobiletools.gallery.pro.BuildConfig -import com.simplemobiletools.gallery.pro.R -import com.simplemobiletools.gallery.pro.databinding.FragmentHolderBinding -import com.simplemobiletools.gallery.pro.extensions.* -import com.simplemobiletools.gallery.pro.fragments.PhotoFragment -import com.simplemobiletools.gallery.pro.fragments.VideoFragment -import com.simplemobiletools.gallery.pro.fragments.ViewPagerFragment -import com.simplemobiletools.gallery.pro.helpers.* -import com.simplemobiletools.gallery.pro.models.Medium +import org.fossify.commons.dialogs.PropertiesDialog +import org.fossify.commons.extensions.* +import org.fossify.commons.helpers.* +import org.fossify.gallery.BuildConfig +import org.fossify.gallery.R +import org.fossify.gallery.databinding.FragmentHolderBinding +import org.fossify.gallery.extensions.* +import org.fossify.gallery.fragments.PhotoFragment +import org.fossify.gallery.fragments.VideoFragment +import org.fossify.gallery.fragments.ViewPagerFragment +import org.fossify.gallery.helpers.* +import org.fossify.gallery.models.Medium import java.io.File import java.io.FileInputStream @@ -51,7 +51,7 @@ open class PhotoVideoActivity : SimpleActivity(), ViewPagerFragment.FragmentList if (it) { checkIntent(savedInstanceState) } else { - toast(com.simplemobiletools.commons.R.string.no_storage_permissions) + toast(org.fossify.commons.R.string.no_storage_permissions) finish() } } @@ -100,8 +100,8 @@ open class PhotoVideoActivity : SimpleActivity(), ViewPagerFragment.FragmentList (binding.fragmentViewerAppbar.layoutParams as RelativeLayout.LayoutParams).topMargin = statusBarHeight binding.fragmentViewerToolbar.apply { setTitleTextColor(Color.WHITE) - overflowIcon = resources.getColoredDrawableWithColor(com.simplemobiletools.commons.R.drawable.ic_three_dots_vector, Color.WHITE) - navigationIcon = resources.getColoredDrawableWithColor(com.simplemobiletools.commons.R.drawable.ic_arrow_left_vector, Color.WHITE) + overflowIcon = resources.getColoredDrawableWithColor(org.fossify.commons.R.drawable.ic_three_dots_vector, Color.WHITE) + navigationIcon = resources.getColoredDrawableWithColor(org.fossify.commons.R.drawable.ic_arrow_left_vector, Color.WHITE) } updateMenuItemColors(binding.fragmentViewerToolbar.menu, forceWhiteIcons = true) @@ -254,7 +254,7 @@ open class PhotoVideoActivity : SimpleActivity(), ViewPagerFragment.FragmentList private fun launchVideoPlayer() { val newUri = getFinalUriFromPath(mUri.toString(), BuildConfig.APPLICATION_ID) if (newUri == null) { - toast(com.simplemobiletools.commons.R.string.unknown_error_occurred) + toast(org.fossify.commons.R.string.unknown_error_occurred) return } diff --git a/app/src/main/kotlin/com/simplemobiletools/gallery/pro/activities/SearchActivity.kt b/app/src/main/kotlin/org/fossify/gallery/activities/SearchActivity.kt similarity index 84% rename from app/src/main/kotlin/com/simplemobiletools/gallery/pro/activities/SearchActivity.kt rename to app/src/main/kotlin/org/fossify/gallery/activities/SearchActivity.kt index ed0fbc636..d0665d595 100644 --- a/app/src/main/kotlin/com/simplemobiletools/gallery/pro/activities/SearchActivity.kt +++ b/app/src/main/kotlin/org/fossify/gallery/activities/SearchActivity.kt @@ -1,4 +1,4 @@ -package com.simplemobiletools.gallery.pro.activities +package org.fossify.gallery.activities import android.content.Intent import android.os.Bundle @@ -6,23 +6,23 @@ import android.view.ViewGroup import android.widget.RelativeLayout import androidx.recyclerview.widget.GridLayoutManager import androidx.recyclerview.widget.RecyclerView -import com.simplemobiletools.commons.extensions.* -import com.simplemobiletools.commons.helpers.VIEW_TYPE_GRID -import com.simplemobiletools.commons.helpers.ensureBackgroundThread -import com.simplemobiletools.commons.models.FileDirItem -import com.simplemobiletools.commons.views.MyGridLayoutManager -import com.simplemobiletools.gallery.pro.R -import com.simplemobiletools.gallery.pro.adapters.MediaAdapter -import com.simplemobiletools.gallery.pro.asynctasks.GetMediaAsynctask -import com.simplemobiletools.gallery.pro.databinding.ActivitySearchBinding -import com.simplemobiletools.gallery.pro.extensions.* -import com.simplemobiletools.gallery.pro.helpers.GridSpacingItemDecoration -import com.simplemobiletools.gallery.pro.helpers.MediaFetcher -import com.simplemobiletools.gallery.pro.helpers.PATH -import com.simplemobiletools.gallery.pro.helpers.SHOW_ALL -import com.simplemobiletools.gallery.pro.interfaces.MediaOperationsListener -import com.simplemobiletools.gallery.pro.models.Medium -import com.simplemobiletools.gallery.pro.models.ThumbnailItem +import org.fossify.commons.extensions.* +import org.fossify.commons.helpers.VIEW_TYPE_GRID +import org.fossify.commons.helpers.ensureBackgroundThread +import org.fossify.commons.models.FileDirItem +import org.fossify.commons.views.MyGridLayoutManager +import org.fossify.gallery.R +import org.fossify.gallery.adapters.MediaAdapter +import org.fossify.gallery.asynctasks.GetMediaAsynctask +import org.fossify.gallery.databinding.ActivitySearchBinding +import org.fossify.gallery.extensions.* +import org.fossify.gallery.helpers.GridSpacingItemDecoration +import org.fossify.gallery.helpers.MediaFetcher +import org.fossify.gallery.helpers.PATH +import org.fossify.gallery.helpers.SHOW_ALL +import org.fossify.gallery.interfaces.MediaOperationsListener +import org.fossify.gallery.models.Medium +import org.fossify.gallery.models.ThumbnailItem import java.io.File class SearchActivity : SimpleActivity(), MediaOperationsListener { @@ -60,7 +60,7 @@ class SearchActivity : SimpleActivity(), MediaOperationsListener { binding.searchMenu.setupMenu() binding.searchMenu.toggleForceArrowBackIcon(true) binding.searchMenu.focusView() - binding.searchMenu.updateHintText(getString(com.simplemobiletools.commons.R.string.search_files)) + binding.searchMenu.updateHintText(getString(org.fossify.commons.R.string.search_files)) binding.searchMenu.onNavigateBackClickListener = { if (binding.searchMenu.getCurrentQuery().isEmpty()) { @@ -97,7 +97,7 @@ class SearchActivity : SimpleActivity(), MediaOperationsListener { val grouped = MediaFetcher(applicationContext).groupMedia(filtered as ArrayList, "") runOnUiThread { if (grouped.isEmpty()) { - binding.searchEmptyTextPlaceholder.text = getString(com.simplemobiletools.commons.R.string.no_items_found) + binding.searchEmptyTextPlaceholder.text = getString(org.fossify.commons.R.string.no_items_found) binding.searchEmptyTextPlaceholder.beVisible() } else { binding.searchEmptyTextPlaceholder.beGone() @@ -246,18 +246,18 @@ class SearchActivity : SimpleActivity(), MediaOperationsListener { } if (config.useRecycleBin && !skipRecycleBin && !filtered.first().path.startsWith(recycleBinPath)) { - val movingItems = resources.getQuantityString(com.simplemobiletools.commons.R.plurals.moving_items_into_bin, filtered.size, filtered.size) + val movingItems = resources.getQuantityString(org.fossify.commons.R.plurals.moving_items_into_bin, filtered.size, filtered.size) toast(movingItems) movePathsInRecycleBin(filtered.map { it.path } as ArrayList) { if (it) { deleteFilteredFiles(filtered) } else { - toast(com.simplemobiletools.commons.R.string.unknown_error_occurred) + toast(org.fossify.commons.R.string.unknown_error_occurred) } } } else { - val deletingItems = resources.getQuantityString(com.simplemobiletools.commons.R.plurals.deleting_items, filtered.size, filtered.size) + val deletingItems = resources.getQuantityString(org.fossify.commons.R.plurals.deleting_items, filtered.size, filtered.size) toast(deletingItems) deleteFilteredFiles(filtered) } @@ -266,7 +266,7 @@ class SearchActivity : SimpleActivity(), MediaOperationsListener { private fun deleteFilteredFiles(filtered: ArrayList) { deleteFiles(filtered) { if (!it) { - toast(com.simplemobiletools.commons.R.string.unknown_error_occurred) + toast(org.fossify.commons.R.string.unknown_error_occurred) return@deleteFiles } diff --git a/app/src/main/kotlin/com/simplemobiletools/gallery/pro/activities/SetWallpaperActivity.kt b/app/src/main/kotlin/org/fossify/gallery/activities/SetWallpaperActivity.kt similarity index 88% rename from app/src/main/kotlin/com/simplemobiletools/gallery/pro/activities/SetWallpaperActivity.kt rename to app/src/main/kotlin/org/fossify/gallery/activities/SetWallpaperActivity.kt index f03bddbfd..102d9c2a6 100644 --- a/app/src/main/kotlin/com/simplemobiletools/gallery/pro/activities/SetWallpaperActivity.kt +++ b/app/src/main/kotlin/org/fossify/gallery/activities/SetWallpaperActivity.kt @@ -1,4 +1,4 @@ -package com.simplemobiletools.gallery.pro.activities +package org.fossify.gallery.activities import android.app.Activity import android.app.WallpaperManager @@ -7,16 +7,16 @@ import android.graphics.Bitmap import android.net.Uri import android.os.Bundle import com.canhub.cropper.CropImageView -import com.simplemobiletools.commons.dialogs.RadioGroupDialog -import com.simplemobiletools.commons.extensions.checkAppSideloading -import com.simplemobiletools.commons.extensions.toast -import com.simplemobiletools.commons.extensions.viewBinding -import com.simplemobiletools.commons.helpers.NavigationIcon -import com.simplemobiletools.commons.helpers.ensureBackgroundThread -import com.simplemobiletools.commons.helpers.isNougatPlus -import com.simplemobiletools.commons.models.RadioItem -import com.simplemobiletools.gallery.pro.R -import com.simplemobiletools.gallery.pro.databinding.ActivitySetWallpaperBinding +import org.fossify.commons.dialogs.RadioGroupDialog +import org.fossify.commons.extensions.checkAppSideloading +import org.fossify.commons.extensions.toast +import org.fossify.commons.extensions.viewBinding +import org.fossify.commons.helpers.NavigationIcon +import org.fossify.commons.helpers.ensureBackgroundThread +import org.fossify.commons.helpers.isNougatPlus +import org.fossify.commons.models.RadioItem +import org.fossify.gallery.R +import org.fossify.gallery.databinding.ActivitySetWallpaperBinding class SetWallpaperActivity : SimpleActivity(), CropImageView.OnCropImageCompleteListener { private val RATIO_PORTRAIT = 0 @@ -163,7 +163,7 @@ class SetWallpaperActivity : SimpleActivity(), CropImageView.OnCropImageComplete } setResult(Activity.RESULT_OK) } catch (e: OutOfMemoryError) { - toast(com.simplemobiletools.commons.R.string.out_of_memory_error) + toast(org.fossify.commons.R.string.out_of_memory_error) setResult(Activity.RESULT_CANCELED) } finish() diff --git a/app/src/main/kotlin/com/simplemobiletools/gallery/pro/activities/SettingsActivity.kt b/app/src/main/kotlin/org/fossify/gallery/activities/SettingsActivity.kt similarity index 94% rename from app/src/main/kotlin/com/simplemobiletools/gallery/pro/activities/SettingsActivity.kt rename to app/src/main/kotlin/org/fossify/gallery/activities/SettingsActivity.kt index ead9601c3..26f96ee6d 100644 --- a/app/src/main/kotlin/com/simplemobiletools/gallery/pro/activities/SettingsActivity.kt +++ b/app/src/main/kotlin/org/fossify/gallery/activities/SettingsActivity.kt @@ -1,4 +1,4 @@ -package com.simplemobiletools.gallery.pro.activities +package org.fossify.gallery.activities import android.app.Activity import android.content.ActivityNotFoundException @@ -8,16 +8,16 @@ import android.text.TextUtils import android.widget.Toast import com.google.gson.Gson import com.google.gson.reflect.TypeToken -import com.simplemobiletools.commons.dialogs.* -import com.simplemobiletools.commons.extensions.* -import com.simplemobiletools.commons.helpers.* -import com.simplemobiletools.commons.models.RadioItem -import com.simplemobiletools.gallery.pro.R -import com.simplemobiletools.gallery.pro.databinding.ActivitySettingsBinding -import com.simplemobiletools.gallery.pro.dialogs.* -import com.simplemobiletools.gallery.pro.extensions.* -import com.simplemobiletools.gallery.pro.helpers.* -import com.simplemobiletools.gallery.pro.models.AlbumCover +import org.fossify.commons.dialogs.* +import org.fossify.commons.extensions.* +import org.fossify.commons.helpers.* +import org.fossify.commons.models.RadioItem +import org.fossify.gallery.R +import org.fossify.gallery.databinding.ActivitySettingsBinding +import org.fossify.gallery.dialogs.* +import org.fossify.gallery.extensions.* +import org.fossify.gallery.helpers.* +import org.fossify.gallery.models.AlbumCover import java.io.File import java.io.InputStream import java.io.OutputStream @@ -197,7 +197,7 @@ class SettingsActivity : SimpleActivity() { private fun setupManageIncludedFolders() { if (isRPlus() && !isExternalStorageManager()) { binding.settingsManageIncludedFolders.text = - "${getString(R.string.manage_included_folders)} (${getString(com.simplemobiletools.commons.R.string.no_permission)})" + "${getString(R.string.manage_included_folders)} (${getString(org.fossify.commons.R.string.no_permission)})" } else { binding.settingsManageIncludedFolders.setText(R.string.manage_included_folders) } @@ -231,9 +231,9 @@ class SettingsActivity : SimpleActivity() { private fun setupShowHiddenItems() { if (isRPlus() && !isExternalStorageManager()) { binding.settingsShowHiddenItems.text = - "${getString(com.simplemobiletools.commons.R.string.show_hidden_items)} (${getString(com.simplemobiletools.commons.R.string.no_permission)})" + "${getString(org.fossify.commons.R.string.show_hidden_items)} (${getString(org.fossify.commons.R.string.no_permission)})" } else { - binding.settingsShowHiddenItems.setText(com.simplemobiletools.commons.R.string.show_hidden_items) + binding.settingsShowHiddenItems.setText(org.fossify.commons.R.string.show_hidden_items) } binding.settingsShowHiddenItems.isChecked = config.showHiddenMedia @@ -363,8 +363,8 @@ class SettingsActivity : SimpleActivity() { if (config.isHiddenPasswordProtectionOn) { val confirmationTextId = if (config.hiddenProtectionType == PROTECTION_FINGERPRINT) - com.simplemobiletools.commons.R.string.fingerprint_setup_successfully else com.simplemobiletools.commons.R.string.protection_setup_successfully - ConfirmationDialog(this, "", confirmationTextId, com.simplemobiletools.commons.R.string.ok, 0) { } + org.fossify.commons.R.string.fingerprint_setup_successfully else org.fossify.commons.R.string.protection_setup_successfully + ConfirmationDialog(this, "", confirmationTextId, org.fossify.commons.R.string.ok, 0) { } } } } @@ -386,8 +386,8 @@ class SettingsActivity : SimpleActivity() { if (config.isExcludedPasswordProtectionOn) { val confirmationTextId = if (config.excludedProtectionType == PROTECTION_FINGERPRINT) - com.simplemobiletools.commons.R.string.fingerprint_setup_successfully else com.simplemobiletools.commons.R.string.protection_setup_successfully - ConfirmationDialog(this, "", confirmationTextId, com.simplemobiletools.commons.R.string.ok, 0) { } + org.fossify.commons.R.string.fingerprint_setup_successfully else org.fossify.commons.R.string.protection_setup_successfully + ConfirmationDialog(this, "", confirmationTextId, org.fossify.commons.R.string.ok, 0) { } } } } @@ -408,8 +408,8 @@ class SettingsActivity : SimpleActivity() { if (config.isAppPasswordProtectionOn) { val confirmationTextId = if (config.appProtectionType == PROTECTION_FINGERPRINT) - com.simplemobiletools.commons.R.string.fingerprint_setup_successfully else com.simplemobiletools.commons.R.string.protection_setup_successfully - ConfirmationDialog(this, "", confirmationTextId, com.simplemobiletools.commons.R.string.ok, 0) { } + org.fossify.commons.R.string.fingerprint_setup_successfully else org.fossify.commons.R.string.protection_setup_successfully + ConfirmationDialog(this, "", confirmationTextId, org.fossify.commons.R.string.ok, 0) { } } } } @@ -430,8 +430,8 @@ class SettingsActivity : SimpleActivity() { if (config.isDeletePasswordProtectionOn) { val confirmationTextId = if (config.deleteProtectionType == PROTECTION_FINGERPRINT) - com.simplemobiletools.commons.R.string.fingerprint_setup_successfully else com.simplemobiletools.commons.R.string.protection_setup_successfully - ConfirmationDialog(this, "", confirmationTextId, com.simplemobiletools.commons.R.string.ok, 0) { } + org.fossify.commons.R.string.fingerprint_setup_successfully else org.fossify.commons.R.string.protection_setup_successfully + ConfirmationDialog(this, "", confirmationTextId, org.fossify.commons.R.string.ok, 0) { } } } } @@ -712,7 +712,7 @@ class SettingsActivity : SimpleActivity() { binding.settingsEmptyRecycleBinHolder.setOnClickListener { if (mRecycleBinContentSize == 0L) { - toast(com.simplemobiletools.commons.R.string.recycle_bin_empty) + toast(org.fossify.commons.R.string.recycle_bin_empty) } else { showRecycleBinEmptyingDialog { emptyTheRecycleBin() @@ -753,7 +753,7 @@ class SettingsActivity : SimpleActivity() { try { startActivityForResult(this, SELECT_EXPORT_FAVORITES_FILE_INTENT) } catch (e: ActivityNotFoundException) { - toast(com.simplemobiletools.commons.R.string.system_service_disabled, Toast.LENGTH_LONG) + toast(org.fossify.commons.R.string.system_service_disabled, Toast.LENGTH_LONG) } catch (e: Exception) { showErrorToast(e) } @@ -776,7 +776,7 @@ class SettingsActivity : SimpleActivity() { private fun exportFavoritesTo(outputStream: OutputStream?) { if (outputStream == null) { - toast(com.simplemobiletools.commons.R.string.unknown_error_occurred) + toast(org.fossify.commons.R.string.unknown_error_occurred) return } @@ -789,15 +789,15 @@ class SettingsActivity : SimpleActivity() { } } - toast(com.simplemobiletools.commons.R.string.exporting_successful) + toast(org.fossify.commons.R.string.exporting_successful) } else { - toast(com.simplemobiletools.commons.R.string.no_items_found) + toast(org.fossify.commons.R.string.no_items_found) } } } private fun getExportFavoritesFilename(): String { - val appName = baseConfig.appId.removeSuffix(".debug").removeSuffix(".pro").removePrefix("com.simplemobiletools.") + val appName = baseConfig.appId.removeSuffix(".debug").removeSuffix(".pro").removePrefix("org.fossify.") return "$appName-favorites_${getCurrentFormattedDateTime()}" } @@ -825,7 +825,7 @@ class SettingsActivity : SimpleActivity() { private fun importFavorites(inputStream: InputStream?) { if (inputStream == null) { - toast(com.simplemobiletools.commons.R.string.unknown_error_occurred) + toast(org.fossify.commons.R.string.unknown_error_occurred) return } @@ -846,7 +846,7 @@ class SettingsActivity : SimpleActivity() { } } - toast(if (importedItems > 0) com.simplemobiletools.commons.R.string.importing_successful else com.simplemobiletools.commons.R.string.no_entries_for_importing) + toast(if (importedItems > 0) org.fossify.commons.R.string.importing_successful else org.fossify.commons.R.string.no_entries_for_importing) } } @@ -968,7 +968,7 @@ class SettingsActivity : SimpleActivity() { private fun parseFile(inputStream: InputStream?) { if (inputStream == null) { - toast(com.simplemobiletools.commons.R.string.unknown_error_occurred) + toast(org.fossify.commons.R.string.unknown_error_occurred) return } @@ -1096,7 +1096,7 @@ class SettingsActivity : SimpleActivity() { } } - toast(if (configValues.size > 0) com.simplemobiletools.commons.R.string.settings_imported_successfully else com.simplemobiletools.commons.R.string.no_entries_for_importing) + toast(if (configValues.size > 0) org.fossify.commons.R.string.settings_imported_successfully else org.fossify.commons.R.string.no_entries_for_importing) runOnUiThread { setupSettingItems() } diff --git a/app/src/main/kotlin/com/simplemobiletools/gallery/pro/activities/SimpleActivity.kt b/app/src/main/kotlin/org/fossify/gallery/activities/SimpleActivity.kt similarity index 79% rename from app/src/main/kotlin/com/simplemobiletools/gallery/pro/activities/SimpleActivity.kt rename to app/src/main/kotlin/org/fossify/gallery/activities/SimpleActivity.kt index 6d02ad838..84a2cf5e9 100644 --- a/app/src/main/kotlin/com/simplemobiletools/gallery/pro/activities/SimpleActivity.kt +++ b/app/src/main/kotlin/org/fossify/gallery/activities/SimpleActivity.kt @@ -1,21 +1,21 @@ -package com.simplemobiletools.gallery.pro.activities +package org.fossify.gallery.activities import android.database.ContentObserver import android.net.Uri import android.provider.MediaStore.Images import android.provider.MediaStore.Video import android.view.WindowManager -import com.simplemobiletools.commons.activities.BaseSimpleActivity -import com.simplemobiletools.commons.dialogs.FilePickerDialog -import com.simplemobiletools.commons.extensions.getParentPath -import com.simplemobiletools.commons.extensions.getRealPathFromURI -import com.simplemobiletools.commons.extensions.scanPathRecursively -import com.simplemobiletools.commons.helpers.ensureBackgroundThread -import com.simplemobiletools.commons.helpers.isPiePlus -import com.simplemobiletools.gallery.pro.R -import com.simplemobiletools.gallery.pro.extensions.addPathToDB -import com.simplemobiletools.gallery.pro.extensions.config -import com.simplemobiletools.gallery.pro.extensions.updateDirectoryPath +import org.fossify.commons.activities.BaseSimpleActivity +import org.fossify.commons.dialogs.FilePickerDialog +import org.fossify.commons.extensions.getParentPath +import org.fossify.commons.extensions.getRealPathFromURI +import org.fossify.commons.extensions.scanPathRecursively +import org.fossify.commons.helpers.ensureBackgroundThread +import org.fossify.commons.helpers.isPiePlus +import org.fossify.gallery.R +import org.fossify.gallery.extensions.addPathToDB +import org.fossify.gallery.extensions.config +import org.fossify.gallery.extensions.updateDirectoryPath open class SimpleActivity : BaseSimpleActivity() { val observer = object : ContentObserver(null) { diff --git a/app/src/main/kotlin/com/simplemobiletools/gallery/pro/activities/SplashActivity.kt b/app/src/main/kotlin/org/fossify/gallery/activities/SplashActivity.kt similarity index 70% rename from app/src/main/kotlin/com/simplemobiletools/gallery/pro/activities/SplashActivity.kt rename to app/src/main/kotlin/org/fossify/gallery/activities/SplashActivity.kt index e09840bd4..857806763 100644 --- a/app/src/main/kotlin/com/simplemobiletools/gallery/pro/activities/SplashActivity.kt +++ b/app/src/main/kotlin/org/fossify/gallery/activities/SplashActivity.kt @@ -1,13 +1,13 @@ -package com.simplemobiletools.gallery.pro.activities +package org.fossify.gallery.activities import android.content.Intent -import com.simplemobiletools.commons.activities.BaseSplashActivity -import com.simplemobiletools.commons.helpers.ensureBackgroundThread -import com.simplemobiletools.gallery.pro.extensions.config -import com.simplemobiletools.gallery.pro.extensions.favoritesDB -import com.simplemobiletools.gallery.pro.extensions.getFavoriteFromPath -import com.simplemobiletools.gallery.pro.extensions.mediaDB -import com.simplemobiletools.gallery.pro.models.Favorite +import org.fossify.commons.activities.BaseSplashActivity +import org.fossify.commons.helpers.ensureBackgroundThread +import org.fossify.gallery.extensions.config +import org.fossify.gallery.extensions.favoritesDB +import org.fossify.gallery.extensions.getFavoriteFromPath +import org.fossify.gallery.extensions.mediaDB +import org.fossify.gallery.models.Favorite class SplashActivity : BaseSplashActivity() { override fun initActivity() { diff --git a/app/src/main/kotlin/com/simplemobiletools/gallery/pro/activities/VideoActivity.kt b/app/src/main/kotlin/org/fossify/gallery/activities/VideoActivity.kt similarity index 79% rename from app/src/main/kotlin/com/simplemobiletools/gallery/pro/activities/VideoActivity.kt rename to app/src/main/kotlin/org/fossify/gallery/activities/VideoActivity.kt index 78fa61955..23f703264 100644 --- a/app/src/main/kotlin/com/simplemobiletools/gallery/pro/activities/VideoActivity.kt +++ b/app/src/main/kotlin/org/fossify/gallery/activities/VideoActivity.kt @@ -1,4 +1,4 @@ -package com.simplemobiletools.gallery.pro.activities +package org.fossify.gallery.activities import android.os.Bundle diff --git a/app/src/main/kotlin/com/simplemobiletools/gallery/pro/activities/VideoPlayerActivity.kt b/app/src/main/kotlin/org/fossify/gallery/activities/VideoPlayerActivity.kt similarity index 97% rename from app/src/main/kotlin/com/simplemobiletools/gallery/pro/activities/VideoPlayerActivity.kt rename to app/src/main/kotlin/org/fossify/gallery/activities/VideoPlayerActivity.kt index 81715f88c..72f35e957 100644 --- a/app/src/main/kotlin/com/simplemobiletools/gallery/pro/activities/VideoPlayerActivity.kt +++ b/app/src/main/kotlin/org/fossify/gallery/activities/VideoPlayerActivity.kt @@ -1,4 +1,4 @@ -package com.simplemobiletools.gallery.pro.activities +package org.fossify.gallery.activities import android.app.Activity import android.content.Intent @@ -25,11 +25,11 @@ import androidx.media3.exoplayer.SeekParameters import androidx.media3.exoplayer.source.DefaultMediaSourceFactory import androidx.media3.exoplayer.source.MediaSource import androidx.media3.exoplayer.source.ProgressiveMediaSource -import com.simplemobiletools.commons.extensions.* -import com.simplemobiletools.gallery.pro.R -import com.simplemobiletools.gallery.pro.databinding.ActivityVideoPlayerBinding -import com.simplemobiletools.gallery.pro.extensions.* -import com.simplemobiletools.gallery.pro.helpers.* +import org.fossify.commons.extensions.* +import org.fossify.gallery.R +import org.fossify.gallery.databinding.ActivityVideoPlayerBinding +import org.fossify.gallery.extensions.* +import org.fossify.gallery.helpers.* @UnstableApi open class VideoPlayerActivity : SimpleActivity(), SeekBar.OnSeekBarChangeListener, TextureView.SurfaceTextureListener { @@ -119,8 +119,8 @@ open class VideoPlayerActivity : SimpleActivity(), SeekBar.OnSeekBarChangeListen (binding.videoAppbar.layoutParams as RelativeLayout.LayoutParams).topMargin = statusBarHeight binding.videoToolbar.apply { setTitleTextColor(Color.WHITE) - overflowIcon = resources.getColoredDrawableWithColor(com.simplemobiletools.commons.R.drawable.ic_three_dots_vector, Color.WHITE) - navigationIcon = resources.getColoredDrawableWithColor(com.simplemobiletools.commons.R.drawable.ic_arrow_left_vector, Color.WHITE) + overflowIcon = resources.getColoredDrawableWithColor(org.fossify.commons.R.drawable.ic_three_dots_vector, Color.WHITE) + navigationIcon = resources.getColoredDrawableWithColor(org.fossify.commons.R.drawable.ic_arrow_left_vector, Color.WHITE) } updateMenuItemColors(binding.videoToolbar.menu, forceWhiteIcons = true) @@ -304,7 +304,7 @@ open class VideoPlayerActivity : SimpleActivity(), SeekBar.OnSeekBarChangeListen if (config.autoplayVideos) { resumeVideo() } else { - binding.bottomVideoTimeHolder.videoTogglePlayPause.setImageResource(com.simplemobiletools.commons.R.drawable.ic_play_outline_vector) + binding.bottomVideoTimeHolder.videoTogglePlayPause.setImageResource(org.fossify.commons.R.drawable.ic_play_outline_vector) } } } @@ -319,7 +319,7 @@ open class VideoPlayerActivity : SimpleActivity(), SeekBar.OnSeekBarChangeListen } private fun resumeVideo() { - binding.bottomVideoTimeHolder.videoTogglePlayPause.setImageResource(com.simplemobiletools.commons.R.drawable.ic_pause_outline_vector) + binding.bottomVideoTimeHolder.videoTogglePlayPause.setImageResource(org.fossify.commons.R.drawable.ic_pause_outline_vector) if (mExoPlayer == null) { return } @@ -336,7 +336,7 @@ open class VideoPlayerActivity : SimpleActivity(), SeekBar.OnSeekBarChangeListen } private fun pauseVideo() { - binding.bottomVideoTimeHolder.videoTogglePlayPause.setImageResource(com.simplemobiletools.commons.R.drawable.ic_play_outline_vector) + binding.bottomVideoTimeHolder.videoTogglePlayPause.setImageResource(org.fossify.commons.R.drawable.ic_play_outline_vector) if (mExoPlayer == null) { return } diff --git a/app/src/main/kotlin/com/simplemobiletools/gallery/pro/activities/ViewPagerActivity.kt b/app/src/main/kotlin/org/fossify/gallery/activities/ViewPagerActivity.kt similarity index 93% rename from app/src/main/kotlin/com/simplemobiletools/gallery/pro/activities/ViewPagerActivity.kt rename to app/src/main/kotlin/org/fossify/gallery/activities/ViewPagerActivity.kt index e898823c0..550f79590 100644 --- a/app/src/main/kotlin/com/simplemobiletools/gallery/pro/activities/ViewPagerActivity.kt +++ b/app/src/main/kotlin/org/fossify/gallery/activities/ViewPagerActivity.kt @@ -1,4 +1,4 @@ -package com.simplemobiletools.gallery.pro.activities +package org.fossify.gallery.activities import android.animation.Animator import android.animation.ValueAnimator @@ -34,26 +34,26 @@ import com.bumptech.glide.load.engine.GlideException import com.bumptech.glide.request.RequestListener import com.bumptech.glide.request.RequestOptions import com.bumptech.glide.request.target.Target -import com.simplemobiletools.commons.dialogs.PropertiesDialog -import com.simplemobiletools.commons.dialogs.RenameItemDialog -import com.simplemobiletools.commons.extensions.* -import com.simplemobiletools.commons.helpers.* -import com.simplemobiletools.commons.models.FileDirItem -import com.simplemobiletools.gallery.pro.BuildConfig -import com.simplemobiletools.gallery.pro.R -import com.simplemobiletools.gallery.pro.adapters.MyPagerAdapter -import com.simplemobiletools.gallery.pro.asynctasks.GetMediaAsynctask -import com.simplemobiletools.gallery.pro.databinding.ActivityMediumBinding -import com.simplemobiletools.gallery.pro.dialogs.DeleteWithRememberDialog -import com.simplemobiletools.gallery.pro.dialogs.SaveAsDialog -import com.simplemobiletools.gallery.pro.dialogs.SlideshowDialog -import com.simplemobiletools.gallery.pro.extensions.* -import com.simplemobiletools.gallery.pro.fragments.PhotoFragment -import com.simplemobiletools.gallery.pro.fragments.VideoFragment -import com.simplemobiletools.gallery.pro.fragments.ViewPagerFragment -import com.simplemobiletools.gallery.pro.helpers.* -import com.simplemobiletools.gallery.pro.models.Medium -import com.simplemobiletools.gallery.pro.models.ThumbnailItem +import org.fossify.commons.dialogs.PropertiesDialog +import org.fossify.commons.dialogs.RenameItemDialog +import org.fossify.commons.extensions.* +import org.fossify.commons.helpers.* +import org.fossify.commons.models.FileDirItem +import org.fossify.gallery.BuildConfig +import org.fossify.gallery.R +import org.fossify.gallery.adapters.MyPagerAdapter +import org.fossify.gallery.asynctasks.GetMediaAsynctask +import org.fossify.gallery.databinding.ActivityMediumBinding +import org.fossify.gallery.dialogs.DeleteWithRememberDialog +import org.fossify.gallery.dialogs.SaveAsDialog +import org.fossify.gallery.dialogs.SlideshowDialog +import org.fossify.gallery.extensions.* +import org.fossify.gallery.fragments.PhotoFragment +import org.fossify.gallery.fragments.VideoFragment +import org.fossify.gallery.fragments.ViewPagerFragment +import org.fossify.gallery.helpers.* +import org.fossify.gallery.models.Medium +import org.fossify.gallery.models.ThumbnailItem import java.io.File import kotlin.math.min @@ -100,7 +100,7 @@ class ViewPagerActivity : SimpleActivity(), ViewPager.OnPageChangeListener, View if (it) { initViewPager() } else { - toast(com.simplemobiletools.commons.R.string.no_storage_permissions) + toast(org.fossify.commons.R.string.no_storage_permissions) finish() } } @@ -213,8 +213,8 @@ class ViewPagerActivity : SimpleActivity(), ViewPager.OnPageChangeListener, View (binding.mediumViewerAppbar.layoutParams as RelativeLayout.LayoutParams).topMargin = statusBarHeight binding.mediumViewerToolbar.apply { setTitleTextColor(Color.WHITE) - overflowIcon = resources.getColoredDrawableWithColor(com.simplemobiletools.commons.R.drawable.ic_three_dots_vector, Color.WHITE) - navigationIcon = resources.getColoredDrawableWithColor(com.simplemobiletools.commons.R.drawable.ic_arrow_left_vector, Color.WHITE) + overflowIcon = resources.getColoredDrawableWithColor(org.fossify.commons.R.drawable.ic_three_dots_vector, Color.WHITE) + navigationIcon = resources.getColoredDrawableWithColor(org.fossify.commons.R.drawable.ic_arrow_left_vector, Color.WHITE) } updateMenuItemColors(binding.mediumViewerToolbar.menu, forceWhiteIcons = true) @@ -315,7 +315,7 @@ class ViewPagerActivity : SimpleActivity(), ViewPager.OnPageChangeListener, View } if (mPath.isEmpty()) { - toast(com.simplemobiletools.commons.R.string.unknown_error_occurred) + toast(org.fossify.commons.R.string.unknown_error_occurred) finish() return } @@ -560,7 +560,7 @@ class ViewPagerActivity : SimpleActivity(), ViewPager.OnPageChangeListener, View animator.addUpdateListener(object : ValueAnimator.AnimatorUpdateListener { var oldDragPosition = 0 override fun onAnimationUpdate(animation: ValueAnimator) { - if (binding.viewPager?.isFakeDragging == true) { + if (binding.viewPager.isFakeDragging == true) { val dragPosition = animation.animatedValue as Int val dragOffset = dragPosition - oldDragPosition oldDragPosition = dragPosition @@ -666,7 +666,7 @@ class ViewPagerActivity : SimpleActivity(), ViewPager.OnPageChangeListener, View private fun copyMoveTo(isCopyOperation: Boolean) { val currPath = getCurrentPath() if (!isCopyOperation && currPath.startsWith(recycleBinPath)) { - toast(com.simplemobiletools.commons.R.string.moving_recycle_bin_items_disabled, Toast.LENGTH_LONG) + toast(org.fossify.commons.R.string.moving_recycle_bin_items_disabled, Toast.LENGTH_LONG) return } @@ -728,12 +728,12 @@ class ViewPagerActivity : SimpleActivity(), ViewPager.OnPageChangeListener, View private fun getChangeOrientationIcon(): Int { return if (mIsOrientationLocked) { if (requestedOrientation == ActivityInfo.SCREEN_ORIENTATION_PORTRAIT) { - com.simplemobiletools.commons.R.drawable.ic_orientation_portrait_vector + org.fossify.commons.R.drawable.ic_orientation_portrait_vector } else { - com.simplemobiletools.commons.R.drawable.ic_orientation_landscape_vector + org.fossify.commons.R.drawable.ic_orientation_landscape_vector } } else { - com.simplemobiletools.commons.R.drawable.ic_orientation_auto_vector + org.fossify.commons.R.drawable.ic_orientation_auto_vector } } @@ -746,11 +746,11 @@ class ViewPagerActivity : SimpleActivity(), ViewPager.OnPageChangeListener, View return@handleSAFDialog } - toast(com.simplemobiletools.commons.R.string.saving) + toast(org.fossify.commons.R.string.saving) ensureBackgroundThread { val photoFragment = getCurrentPhotoFragment() ?: return@ensureBackgroundThread saveRotatedImageToFile(currPath, newPath, photoFragment.mCurrentRotationDegrees, true) { - toast(com.simplemobiletools.commons.R.string.file_saved) + toast(org.fossify.commons.R.string.file_saved) getCurrentPhotoFragment()?.mCurrentRotationDegrees = 0 refreshMenuItems() } @@ -854,13 +854,13 @@ class ViewPagerActivity : SimpleActivity(), ViewPager.OnPageChangeListener, View } binding.bottomActions.bottomShare.beVisibleIf(visibleBottomActions and BOTTOM_ACTION_SHARE != 0) - binding.bottomActions.bottomShare.setOnLongClickListener { toast(com.simplemobiletools.commons.R.string.share); true } + binding.bottomActions.bottomShare.setOnLongClickListener { toast(org.fossify.commons.R.string.share); true } binding.bottomActions.bottomShare.setOnClickListener { shareMediumPath(getCurrentPath()) } binding.bottomActions.bottomDelete.beVisibleIf(visibleBottomActions and BOTTOM_ACTION_DELETE != 0) - binding.bottomActions.bottomDelete.setOnLongClickListener { toast(com.simplemobiletools.commons.R.string.delete); true } + binding.bottomActions.bottomDelete.setOnLongClickListener { toast(org.fossify.commons.R.string.delete); true } binding.bottomActions.bottomDelete.setOnClickListener { checkDeleteConfirmation() } @@ -873,7 +873,7 @@ class ViewPagerActivity : SimpleActivity(), ViewPager.OnPageChangeListener, View binding.bottomActions.bottomProperties.applyColorFilter(Color.WHITE) binding.bottomActions.bottomProperties.beVisibleIf(visibleBottomActions and BOTTOM_ACTION_PROPERTIES != 0) - binding.bottomActions.bottomProperties.setOnLongClickListener { toast(com.simplemobiletools.commons.R.string.properties); true } + binding.bottomActions.bottomProperties.setOnLongClickListener { toast(org.fossify.commons.R.string.properties); true } binding.bottomActions.bottomProperties.setOnClickListener { showProperties() } @@ -904,7 +904,7 @@ class ViewPagerActivity : SimpleActivity(), ViewPager.OnPageChangeListener, View binding.bottomActions.bottomToggleFileVisibility.beVisibleIf(visibleBottomActions and BOTTOM_ACTION_TOGGLE_VISIBILITY != 0) binding.bottomActions.bottomToggleFileVisibility.setOnLongClickListener { - toast(if (currentMedium?.isHidden() == true) com.simplemobiletools.commons.R.string.unhide else com.simplemobiletools.commons.R.string.hide); true + toast(if (currentMedium?.isHidden() == true) org.fossify.commons.R.string.unhide else org.fossify.commons.R.string.hide); true } binding.bottomActions.bottomToggleFileVisibility.setOnClickListener { @@ -916,31 +916,31 @@ class ViewPagerActivity : SimpleActivity(), ViewPager.OnPageChangeListener, View } binding.bottomActions.bottomRename.beVisibleIf(visibleBottomActions and BOTTOM_ACTION_RENAME != 0 && currentMedium?.getIsInRecycleBin() == false) - binding.bottomActions.bottomRename.setOnLongClickListener { toast(com.simplemobiletools.commons.R.string.rename); true } + binding.bottomActions.bottomRename.setOnLongClickListener { toast(org.fossify.commons.R.string.rename); true } binding.bottomActions.bottomRename.setOnClickListener { checkMediaManagementAndRename() } binding.bottomActions.bottomSetAs.beVisibleIf(visibleBottomActions and BOTTOM_ACTION_SET_AS != 0) - binding.bottomActions.bottomSetAs.setOnLongClickListener { toast(com.simplemobiletools.commons.R.string.set_as); true } + binding.bottomActions.bottomSetAs.setOnLongClickListener { toast(org.fossify.commons.R.string.set_as); true } binding.bottomActions.bottomSetAs.setOnClickListener { setAs(getCurrentPath()) } binding.bottomActions.bottomCopy.beVisibleIf(visibleBottomActions and BOTTOM_ACTION_COPY != 0) - binding.bottomActions.bottomCopy.setOnLongClickListener { toast(com.simplemobiletools.commons.R.string.copy); true } + binding.bottomActions.bottomCopy.setOnLongClickListener { toast(org.fossify.commons.R.string.copy); true } binding.bottomActions.bottomCopy.setOnClickListener { checkMediaManagementAndCopy(true) } binding.bottomActions.bottomMove.beVisibleIf(visibleBottomActions and BOTTOM_ACTION_MOVE != 0) - binding.bottomActions.bottomMove.setOnLongClickListener { toast(com.simplemobiletools.commons.R.string.move); true } + binding.bottomActions.bottomMove.setOnLongClickListener { toast(org.fossify.commons.R.string.move); true } binding.bottomActions.bottomMove.setOnClickListener { moveFileTo() } binding.bottomActions.bottomResize.beVisibleIf(visibleBottomActions and BOTTOM_ACTION_RESIZE != 0 && currentMedium?.isImage() == true) - binding.bottomActions.bottomResize.setOnLongClickListener { toast(com.simplemobiletools.commons.R.string.resize); true } + binding.bottomActions.bottomResize.setOnLongClickListener { toast(org.fossify.commons.R.string.resize); true } binding.bottomActions.bottomResize.setOnClickListener { resizeImage() } @@ -952,11 +952,11 @@ class ViewPagerActivity : SimpleActivity(), ViewPager.OnPageChangeListener, View } val favoriteIcon = - if (medium.isFavorite) com.simplemobiletools.commons.R.drawable.ic_star_vector else com.simplemobiletools.commons.R.drawable.ic_star_outline_vector + if (medium.isFavorite) org.fossify.commons.R.drawable.ic_star_vector else org.fossify.commons.R.drawable.ic_star_outline_vector binding.bottomActions.bottomFavorite.setImageResource(favoriteIcon) val hideIcon = - if (medium.isHidden()) com.simplemobiletools.commons.R.drawable.ic_unhide_vector else com.simplemobiletools.commons.R.drawable.ic_hide_vector + if (medium.isHidden()) org.fossify.commons.R.drawable.ic_unhide_vector else org.fossify.commons.R.drawable.ic_hide_vector binding.bottomActions.bottomToggleFileVisibility.setImageResource(hideIcon) binding.bottomActions.bottomRotate.beVisibleIf(config.visibleBottomActions and BOTTOM_ACTION_ROTATE != 0 && getCurrentMedium()?.isImage() == true) @@ -992,7 +992,7 @@ class ViewPagerActivity : SimpleActivity(), ViewPager.OnPageChangeListener, View try { val resolution = path.getImageResolution(this) if (resolution == null) { - toast(com.simplemobiletools.commons.R.string.unknown_error_occurred) + toast(org.fossify.commons.R.string.unknown_error_occurred) return } @@ -1073,9 +1073,9 @@ class ViewPagerActivity : SimpleActivity(), ViewPager.OnPageChangeListener, View val isInRecycleBin = getCurrentMedium()!!.getIsInRecycleBin() val baseString = if (config.useRecycleBin && !config.tempSkipRecycleBin && !isInRecycleBin) { - com.simplemobiletools.commons.R.string.move_to_recycle_bin_confirmation + org.fossify.commons.R.string.move_to_recycle_bin_confirmation } else { - com.simplemobiletools.commons.R.string.deletion_confirmation + org.fossify.commons.R.string.deletion_confirmation } val message = String.format(resources.getString(baseString), filenameAndSize) @@ -1128,7 +1128,7 @@ class ViewPagerActivity : SimpleActivity(), ViewPager.OnPageChangeListener, View } } } else { - toast(com.simplemobiletools.commons.R.string.unknown_error_occurred) + toast(org.fossify.commons.R.string.unknown_error_occurred) } } } @@ -1186,7 +1186,7 @@ class ViewPagerActivity : SimpleActivity(), ViewPager.OnPageChangeListener, View val isSDOrOtgRootFolder = isAStorageRootFolder(oldPath.getParentPath()) && !oldPath.startsWith(internalStoragePath) if (isRPlus() && isSDOrOtgRootFolder && !isExternalStorageManager()) { - toast(com.simplemobiletools.commons.R.string.rename_in_sd_card_system_restriction, Toast.LENGTH_LONG) + toast(org.fossify.commons.R.string.rename_in_sd_card_system_restriction, Toast.LENGTH_LONG) return } @@ -1347,7 +1347,7 @@ class ViewPagerActivity : SimpleActivity(), ViewPager.OnPageChangeListener, View startActivityForResult(this, REQUEST_VIEW_VIDEO) } catch (e: ActivityNotFoundException) { if (!tryGenericMimeType(this, mimeType, newUri)) { - toast(com.simplemobiletools.commons.R.string.no_app_found) + toast(org.fossify.commons.R.string.no_app_found) } } catch (e: Exception) { showErrorToast(e) diff --git a/app/src/main/kotlin/com/simplemobiletools/gallery/pro/activities/WidgetConfigureActivity.kt b/app/src/main/kotlin/org/fossify/gallery/activities/WidgetConfigureActivity.kt similarity index 86% rename from app/src/main/kotlin/com/simplemobiletools/gallery/pro/activities/WidgetConfigureActivity.kt rename to app/src/main/kotlin/org/fossify/gallery/activities/WidgetConfigureActivity.kt index 7e93849f3..c29d5892e 100644 --- a/app/src/main/kotlin/com/simplemobiletools/gallery/pro/activities/WidgetConfigureActivity.kt +++ b/app/src/main/kotlin/org/fossify/gallery/activities/WidgetConfigureActivity.kt @@ -1,4 +1,4 @@ -package com.simplemobiletools.gallery.pro.activities +package org.fossify.gallery.activities import android.app.Activity import android.appwidget.AppWidgetManager @@ -9,17 +9,17 @@ import android.graphics.drawable.ColorDrawable import android.os.Bundle import android.widget.RemoteViews import com.bumptech.glide.signature.ObjectKey -import com.simplemobiletools.commons.dialogs.ColorPickerDialog -import com.simplemobiletools.commons.extensions.* -import com.simplemobiletools.commons.helpers.ensureBackgroundThread -import com.simplemobiletools.gallery.pro.R -import com.simplemobiletools.gallery.pro.databinding.ActivityWidgetConfigBinding -import com.simplemobiletools.gallery.pro.dialogs.PickDirectoryDialog -import com.simplemobiletools.gallery.pro.extensions.* -import com.simplemobiletools.gallery.pro.helpers.MyWidgetProvider -import com.simplemobiletools.gallery.pro.helpers.ROUNDED_CORNERS_NONE -import com.simplemobiletools.gallery.pro.models.Directory -import com.simplemobiletools.gallery.pro.models.Widget +import org.fossify.commons.dialogs.ColorPickerDialog +import org.fossify.commons.extensions.* +import org.fossify.commons.helpers.ensureBackgroundThread +import org.fossify.gallery.R +import org.fossify.gallery.databinding.ActivityWidgetConfigBinding +import org.fossify.gallery.dialogs.PickDirectoryDialog +import org.fossify.gallery.extensions.* +import org.fossify.gallery.helpers.MyWidgetProvider +import org.fossify.gallery.helpers.ROUNDED_CORNERS_NONE +import org.fossify.gallery.models.Directory +import org.fossify.gallery.models.Widget class WidgetConfigureActivity : SimpleActivity() { private var mBgAlpha = 0f @@ -88,8 +88,8 @@ class WidgetConfigureActivity : SimpleActivity() { updateBackgroundColor() mTextColor = config.widgetTextColor - if (mTextColor == resources.getColor(com.simplemobiletools.commons.R.color.default_widget_text_color) && config.isUsingSystemTheme) { - mTextColor = resources.getColor(com.simplemobiletools.commons.R.color.you_primary_color, theme) + if (mTextColor == resources.getColor(org.fossify.commons.R.color.default_widget_text_color) && config.isUsingSystemTheme) { + mTextColor = resources.getColor(org.fossify.commons.R.color.you_primary_color, theme) } updateTextColor() diff --git a/app/src/main/kotlin/com/simplemobiletools/gallery/pro/adapters/DirectoryAdapter.kt b/app/src/main/kotlin/org/fossify/gallery/adapters/DirectoryAdapter.kt similarity index 93% rename from app/src/main/kotlin/com/simplemobiletools/gallery/pro/adapters/DirectoryAdapter.kt rename to app/src/main/kotlin/org/fossify/gallery/adapters/DirectoryAdapter.kt index 80809b34d..3810c0e28 100644 --- a/app/src/main/kotlin/com/simplemobiletools/gallery/pro/adapters/DirectoryAdapter.kt +++ b/app/src/main/kotlin/org/fossify/gallery/adapters/DirectoryAdapter.kt @@ -1,4 +1,4 @@ -package com.simplemobiletools.gallery.pro.adapters +package org.fossify.gallery.adapters import android.content.Intent import android.content.pm.ShortcutInfo @@ -19,31 +19,31 @@ import androidx.swiperefreshlayout.widget.SwipeRefreshLayout import com.bumptech.glide.Glide import com.google.gson.Gson import com.qtalk.recyclerviewfastscroller.RecyclerViewFastScroller -import com.simplemobiletools.commons.activities.BaseSimpleActivity -import com.simplemobiletools.commons.adapters.MyRecyclerViewAdapter -import com.simplemobiletools.commons.dialogs.* -import com.simplemobiletools.commons.extensions.* -import com.simplemobiletools.commons.helpers.* -import com.simplemobiletools.commons.interfaces.ItemMoveCallback -import com.simplemobiletools.commons.interfaces.ItemTouchHelperContract -import com.simplemobiletools.commons.interfaces.StartReorderDragListener -import com.simplemobiletools.commons.models.FileDirItem -import com.simplemobiletools.commons.views.MyRecyclerView -import com.simplemobiletools.gallery.pro.R -import com.simplemobiletools.gallery.pro.activities.MediaActivity -import com.simplemobiletools.gallery.pro.databinding.DirectoryItemGridRoundedCornersBinding -import com.simplemobiletools.gallery.pro.databinding.DirectoryItemGridSquareBinding -import com.simplemobiletools.gallery.pro.databinding.DirectoryItemListBinding -import com.simplemobiletools.gallery.pro.dialogs.ConfirmDeleteFolderDialog -import com.simplemobiletools.gallery.pro.dialogs.ExcludeFolderDialog -import com.simplemobiletools.gallery.pro.dialogs.PickMediumDialog -import com.simplemobiletools.gallery.pro.extensions.* -import com.simplemobiletools.gallery.pro.helpers.* -import com.simplemobiletools.gallery.pro.interfaces.DirectoryOperationsListener -import com.simplemobiletools.gallery.pro.models.AlbumCover -import com.simplemobiletools.gallery.pro.models.Directory +import org.fossify.commons.activities.BaseSimpleActivity +import org.fossify.commons.adapters.MyRecyclerViewAdapter +import org.fossify.commons.dialogs.* +import org.fossify.commons.extensions.* +import org.fossify.commons.helpers.* +import org.fossify.commons.interfaces.ItemMoveCallback +import org.fossify.commons.interfaces.ItemTouchHelperContract +import org.fossify.commons.interfaces.StartReorderDragListener +import org.fossify.commons.models.FileDirItem +import org.fossify.commons.views.MyRecyclerView +import org.fossify.gallery.R +import org.fossify.gallery.activities.MediaActivity +import org.fossify.gallery.databinding.DirectoryItemGridRoundedCornersBinding +import org.fossify.gallery.databinding.DirectoryItemGridSquareBinding +import org.fossify.gallery.databinding.DirectoryItemListBinding +import org.fossify.gallery.dialogs.ConfirmDeleteFolderDialog +import org.fossify.gallery.dialogs.ExcludeFolderDialog +import org.fossify.gallery.dialogs.PickMediumDialog +import org.fossify.gallery.extensions.* +import org.fossify.gallery.helpers.* +import org.fossify.gallery.interfaces.DirectoryOperationsListener +import org.fossify.gallery.models.AlbumCover +import org.fossify.gallery.models.Directory import java.io.File -import java.util.* +import java.util.Collections class DirectoryAdapter( activity: BaseSimpleActivity, var dirs: ArrayList, val listener: DirectoryOperationsListener?, recyclerView: MyRecyclerView, @@ -242,7 +242,7 @@ class DirectoryAdapter( val sourcePath = firstDir.path val dir = File(sourcePath) if (activity.isAStorageRootFolder(dir.absolutePath)) { - activity.toast(com.simplemobiletools.commons.R.string.rename_folder_root) + activity.toast(org.fossify.commons.R.string.rename_folder_root) return } @@ -297,7 +297,7 @@ class DirectoryAdapter( } } else { if (selectedPaths.any { it.isThisOrParentFolderHidden() }) { - ConfirmationDialog(activity, "", R.string.cant_unhide_folder, com.simplemobiletools.commons.R.string.ok, 0) {} + ConfirmationDialog(activity, "", R.string.cant_unhide_folder, org.fossify.commons.R.string.ok, 0) {} return } @@ -596,9 +596,9 @@ class DirectoryAdapter( ConfirmationDialog( activity, "", - com.simplemobiletools.commons.R.string.empty_recycle_bin_confirmation, - com.simplemobiletools.commons.R.string.yes, - com.simplemobiletools.commons.R.string.no + org.fossify.commons.R.string.empty_recycle_bin_confirmation, + org.fossify.commons.R.string.yes, + org.fossify.commons.R.string.no ) { deleteFolders() } @@ -609,18 +609,18 @@ class DirectoryAdapter( val folder = getSelectedPaths().first().getFilenameFromPath() "\"$folder\"" } else { - resources.getQuantityString(com.simplemobiletools.commons.R.plurals.delete_items, itemsCnt, itemsCnt) + resources.getQuantityString(org.fossify.commons.R.plurals.delete_items, itemsCnt, itemsCnt) } val fileDirItem = getFirstSelectedItem() ?: return val baseString = if (!config.useRecycleBin || config.tempSkipRecycleBin || (isOneItemSelected() && fileDirItem.areFavorites())) { - com.simplemobiletools.commons.R.string.deletion_confirmation + org.fossify.commons.R.string.deletion_confirmation } else { - com.simplemobiletools.commons.R.string.move_to_recycle_bin_confirmation + org.fossify.commons.R.string.move_to_recycle_bin_confirmation } val question = String.format(resources.getString(baseString), items) - val warning = resources.getQuantityString(com.simplemobiletools.commons.R.plurals.delete_warning, itemsCnt, itemsCnt) + val warning = resources.getQuantityString(org.fossify.commons.R.plurals.delete_warning, itemsCnt, itemsCnt) ConfirmDeleteFolderDialog(activity, question, warning) { deleteFolders() } @@ -834,7 +834,7 @@ class DirectoryAdapter( dirPin.beVisibleIf(pinnedFolders.contains(directory.path)) dirLocation.beVisibleIf(directory.location != LOCATION_INTERNAL) if (dirLocation.isVisible()) { - dirLocation.setImageResource(if (directory.location == LOCATION_SD) com.simplemobiletools.commons.R.drawable.ic_sd_card_vector else com.simplemobiletools.commons.R.drawable.ic_usb_vector) + dirLocation.setImageResource(if (directory.location == LOCATION_SD) org.fossify.commons.R.drawable.ic_sd_card_vector else org.fossify.commons.R.drawable.ic_usb_vector) } photoCnt.text = directory.subfoldersMediaCount.toString() diff --git a/app/src/main/kotlin/com/simplemobiletools/gallery/pro/adapters/DirectoryItemBinding.kt b/app/src/main/kotlin/org/fossify/gallery/adapters/DirectoryItemBinding.kt similarity index 89% rename from app/src/main/kotlin/com/simplemobiletools/gallery/pro/adapters/DirectoryItemBinding.kt rename to app/src/main/kotlin/org/fossify/gallery/adapters/DirectoryItemBinding.kt index bd91efdf6..b0fb7f665 100644 --- a/app/src/main/kotlin/com/simplemobiletools/gallery/pro/adapters/DirectoryItemBinding.kt +++ b/app/src/main/kotlin/org/fossify/gallery/adapters/DirectoryItemBinding.kt @@ -1,12 +1,12 @@ -package com.simplemobiletools.gallery.pro.adapters +package org.fossify.gallery.adapters import android.view.ViewGroup import android.widget.ImageView import android.widget.TextView -import com.simplemobiletools.commons.views.MySquareImageView -import com.simplemobiletools.gallery.pro.databinding.DirectoryItemGridRoundedCornersBinding -import com.simplemobiletools.gallery.pro.databinding.DirectoryItemGridSquareBinding -import com.simplemobiletools.gallery.pro.databinding.DirectoryItemListBinding +import org.fossify.commons.views.MySquareImageView +import org.fossify.gallery.databinding.DirectoryItemGridRoundedCornersBinding +import org.fossify.gallery.databinding.DirectoryItemGridSquareBinding +import org.fossify.gallery.databinding.DirectoryItemListBinding interface DirectoryItemBinding { val root: ViewGroup diff --git a/app/src/main/kotlin/com/simplemobiletools/gallery/pro/adapters/FiltersAdapter.kt b/app/src/main/kotlin/org/fossify/gallery/adapters/FiltersAdapter.kt similarity index 89% rename from app/src/main/kotlin/com/simplemobiletools/gallery/pro/adapters/FiltersAdapter.kt rename to app/src/main/kotlin/org/fossify/gallery/adapters/FiltersAdapter.kt index e32bccea5..8c26459f8 100644 --- a/app/src/main/kotlin/com/simplemobiletools/gallery/pro/adapters/FiltersAdapter.kt +++ b/app/src/main/kotlin/org/fossify/gallery/adapters/FiltersAdapter.kt @@ -1,13 +1,13 @@ -package com.simplemobiletools.gallery.pro.adapters +package org.fossify.gallery.adapters import android.content.Context import android.view.LayoutInflater import android.view.View import android.view.ViewGroup import androidx.recyclerview.widget.RecyclerView -import com.simplemobiletools.gallery.pro.R -import com.simplemobiletools.gallery.pro.databinding.EditorFilterItemBinding -import com.simplemobiletools.gallery.pro.models.FilterItem +import org.fossify.gallery.R +import org.fossify.gallery.databinding.EditorFilterItemBinding +import org.fossify.gallery.models.FilterItem class FiltersAdapter(val context: Context, val filterItems: ArrayList, val itemClick: (Int) -> Unit) : RecyclerView.Adapter() { diff --git a/app/src/main/kotlin/com/simplemobiletools/gallery/pro/adapters/ManageFoldersAdapter.kt b/app/src/main/kotlin/org/fossify/gallery/adapters/ManageFoldersAdapter.kt similarity index 80% rename from app/src/main/kotlin/com/simplemobiletools/gallery/pro/adapters/ManageFoldersAdapter.kt rename to app/src/main/kotlin/org/fossify/gallery/adapters/ManageFoldersAdapter.kt index d83cb288d..31e0a6457 100644 --- a/app/src/main/kotlin/com/simplemobiletools/gallery/pro/adapters/ManageFoldersAdapter.kt +++ b/app/src/main/kotlin/org/fossify/gallery/adapters/ManageFoldersAdapter.kt @@ -1,16 +1,16 @@ -package com.simplemobiletools.gallery.pro.adapters +package org.fossify.gallery.adapters import android.view.* import android.widget.PopupMenu -import com.simplemobiletools.commons.activities.BaseSimpleActivity -import com.simplemobiletools.commons.adapters.MyRecyclerViewAdapter -import com.simplemobiletools.commons.extensions.getPopupMenuTheme -import com.simplemobiletools.commons.extensions.getProperTextColor -import com.simplemobiletools.commons.extensions.setupViewBackground -import com.simplemobiletools.commons.interfaces.RefreshRecyclerViewListener -import com.simplemobiletools.commons.views.MyRecyclerView -import com.simplemobiletools.gallery.pro.databinding.ItemManageFolderBinding -import com.simplemobiletools.gallery.pro.extensions.config +import org.fossify.commons.activities.BaseSimpleActivity +import org.fossify.commons.adapters.MyRecyclerViewAdapter +import org.fossify.commons.extensions.getPopupMenuTheme +import org.fossify.commons.extensions.getProperTextColor +import org.fossify.commons.extensions.setupViewBackground +import org.fossify.commons.interfaces.RefreshRecyclerViewListener +import org.fossify.commons.views.MyRecyclerView +import org.fossify.gallery.databinding.ItemManageFolderBinding +import org.fossify.gallery.extensions.config class ManageFoldersAdapter( activity: BaseSimpleActivity, var folders: ArrayList, val isShowingExcludedFolders: Boolean, val listener: RefreshRecyclerViewListener?, @@ -23,13 +23,13 @@ class ManageFoldersAdapter( setupDragListener(true) } - override fun getActionMenuId() = com.simplemobiletools.commons.R.menu.cab_remove_only + override fun getActionMenuId() = org.fossify.commons.R.menu.cab_remove_only override fun prepareActionMode(menu: Menu) {} override fun actionItemPressed(id: Int) { when (id) { - com.simplemobiletools.commons.R.id.cab_remove -> removeSelection() + org.fossify.commons.R.id.cab_remove -> removeSelection() } } @@ -91,7 +91,7 @@ class ManageFoldersAdapter( setOnMenuItemClickListener { item -> val eventTypeId = folder.hashCode() when (item.itemId) { - com.simplemobiletools.commons.R.id.cab_remove -> { + org.fossify.commons.R.id.cab_remove -> { executeItemMenuOperation(eventTypeId) { removeSelection() } diff --git a/app/src/main/kotlin/com/simplemobiletools/gallery/pro/adapters/ManageHiddenFoldersAdapter.kt b/app/src/main/kotlin/org/fossify/gallery/adapters/ManageHiddenFoldersAdapter.kt similarity index 81% rename from app/src/main/kotlin/com/simplemobiletools/gallery/pro/adapters/ManageHiddenFoldersAdapter.kt rename to app/src/main/kotlin/org/fossify/gallery/adapters/ManageHiddenFoldersAdapter.kt index 41e10fe44..04c6fe32e 100644 --- a/app/src/main/kotlin/com/simplemobiletools/gallery/pro/adapters/ManageHiddenFoldersAdapter.kt +++ b/app/src/main/kotlin/org/fossify/gallery/adapters/ManageHiddenFoldersAdapter.kt @@ -1,18 +1,18 @@ -package com.simplemobiletools.gallery.pro.adapters +package org.fossify.gallery.adapters import android.view.Menu import android.view.View import android.view.ViewGroup -import com.simplemobiletools.commons.activities.BaseSimpleActivity -import com.simplemobiletools.commons.adapters.MyRecyclerViewAdapter -import com.simplemobiletools.commons.extensions.getProperTextColor -import com.simplemobiletools.commons.extensions.isPathOnSD -import com.simplemobiletools.commons.extensions.setupViewBackground -import com.simplemobiletools.commons.interfaces.RefreshRecyclerViewListener -import com.simplemobiletools.commons.views.MyRecyclerView -import com.simplemobiletools.gallery.pro.R -import com.simplemobiletools.gallery.pro.databinding.ItemManageFolderBinding -import com.simplemobiletools.gallery.pro.extensions.removeNoMedia +import org.fossify.commons.activities.BaseSimpleActivity +import org.fossify.commons.adapters.MyRecyclerViewAdapter +import org.fossify.commons.extensions.getProperTextColor +import org.fossify.commons.extensions.isPathOnSD +import org.fossify.commons.extensions.setupViewBackground +import org.fossify.commons.interfaces.RefreshRecyclerViewListener +import org.fossify.commons.views.MyRecyclerView +import org.fossify.gallery.R +import org.fossify.gallery.databinding.ItemManageFolderBinding +import org.fossify.gallery.extensions.removeNoMedia class ManageHiddenFoldersAdapter( activity: BaseSimpleActivity, var folders: ArrayList, val listener: RefreshRecyclerViewListener?, diff --git a/app/src/main/kotlin/com/simplemobiletools/gallery/pro/adapters/MediaAdapter.kt b/app/src/main/kotlin/org/fossify/gallery/adapters/MediaAdapter.kt similarity index 93% rename from app/src/main/kotlin/com/simplemobiletools/gallery/pro/adapters/MediaAdapter.kt rename to app/src/main/kotlin/org/fossify/gallery/adapters/MediaAdapter.kt index 5e4adefb9..07f7f91b8 100644 --- a/app/src/main/kotlin/com/simplemobiletools/gallery/pro/adapters/MediaAdapter.kt +++ b/app/src/main/kotlin/org/fossify/gallery/adapters/MediaAdapter.kt @@ -1,4 +1,4 @@ -package com.simplemobiletools.gallery.pro.adapters +package org.fossify.gallery.adapters import android.content.Intent import android.content.pm.ShortcutInfo @@ -13,25 +13,25 @@ import android.widget.Toast import androidx.core.view.allViews import com.bumptech.glide.Glide import com.qtalk.recyclerviewfastscroller.RecyclerViewFastScroller -import com.simplemobiletools.commons.activities.BaseSimpleActivity -import com.simplemobiletools.commons.adapters.MyRecyclerViewAdapter -import com.simplemobiletools.commons.dialogs.PropertiesDialog -import com.simplemobiletools.commons.dialogs.RenameDialog -import com.simplemobiletools.commons.dialogs.RenameItemDialog -import com.simplemobiletools.commons.extensions.* -import com.simplemobiletools.commons.helpers.* -import com.simplemobiletools.commons.models.FileDirItem -import com.simplemobiletools.commons.views.MyRecyclerView -import com.simplemobiletools.gallery.pro.R -import com.simplemobiletools.gallery.pro.activities.ViewPagerActivity -import com.simplemobiletools.gallery.pro.databinding.* -import com.simplemobiletools.gallery.pro.dialogs.DeleteWithRememberDialog -import com.simplemobiletools.gallery.pro.extensions.* -import com.simplemobiletools.gallery.pro.helpers.* -import com.simplemobiletools.gallery.pro.interfaces.MediaOperationsListener -import com.simplemobiletools.gallery.pro.models.Medium -import com.simplemobiletools.gallery.pro.models.ThumbnailItem -import com.simplemobiletools.gallery.pro.models.ThumbnailSection +import org.fossify.commons.activities.BaseSimpleActivity +import org.fossify.commons.adapters.MyRecyclerViewAdapter +import org.fossify.commons.dialogs.PropertiesDialog +import org.fossify.commons.dialogs.RenameDialog +import org.fossify.commons.dialogs.RenameItemDialog +import org.fossify.commons.extensions.* +import org.fossify.commons.helpers.* +import org.fossify.commons.models.FileDirItem +import org.fossify.commons.views.MyRecyclerView +import org.fossify.gallery.R +import org.fossify.gallery.activities.ViewPagerActivity +import org.fossify.gallery.databinding.* +import org.fossify.gallery.dialogs.DeleteWithRememberDialog +import org.fossify.gallery.extensions.* +import org.fossify.gallery.helpers.* +import org.fossify.gallery.interfaces.MediaOperationsListener +import org.fossify.gallery.models.Medium +import org.fossify.gallery.models.ThumbnailItem +import org.fossify.gallery.models.ThumbnailSection class MediaAdapter( activity: BaseSimpleActivity, var media: ArrayList, val listener: MediaOperationsListener?, val isAGetIntent: Boolean, @@ -241,7 +241,7 @@ class MediaAdapter( val isSDOrOtgRootFolder = activity.isAStorageRootFolder(firstPath.getParentPath()) && !firstPath.startsWith(activity.internalStoragePath) if (isRPlus() && isSDOrOtgRootFolder && !isExternalStorageManager()) { - activity.toast(com.simplemobiletools.commons.R.string.rename_in_sd_card_system_restriction, Toast.LENGTH_LONG) + activity.toast(org.fossify.commons.R.string.rename_in_sd_card_system_restriction, Toast.LENGTH_LONG) finishActMode() return } @@ -353,7 +353,7 @@ class MediaAdapter( private fun handleRotate(paths: List, degrees: Int) { var fileCnt = paths.size rotatedImagePaths.clear() - activity.toast(com.simplemobiletools.commons.R.string.saving) + activity.toast(org.fossify.commons.R.string.saving) ensureBackgroundThread { paths.forEach { rotatedImagePaths.add(it) @@ -405,7 +405,7 @@ class MediaAdapter( }.toMutableList() as ArrayList if (!isCopyOperation && paths.any { it.startsWith(recycleBinPath) }) { - activity.toast(com.simplemobiletools.commons.R.string.moving_recycle_bin_items_disabled, Toast.LENGTH_LONG) + activity.toast(org.fossify.commons.R.string.moving_recycle_bin_items_disabled, Toast.LENGTH_LONG) } if (fileDirItems.isEmpty()) { @@ -499,13 +499,13 @@ class MediaAdapter( fileDirItems.add(curFileDirItem) } val fileSize = fileDirItems.sumByLong { it.getProperSize(activity, countHidden = true) }.formatSize() - val deleteItemsString = resources.getQuantityString(com.simplemobiletools.commons.R.plurals.delete_items, itemsCnt, itemsCnt) + val deleteItemsString = resources.getQuantityString(org.fossify.commons.R.plurals.delete_items, itemsCnt, itemsCnt) "$deleteItemsString ($fileSize)" } val isRecycleBin = firstPath.startsWith(activity.recycleBinPath) val baseString = - if (config.useRecycleBin && !config.tempSkipRecycleBin && !isRecycleBin) com.simplemobiletools.commons.R.string.move_to_recycle_bin_confirmation else com.simplemobiletools.commons.R.string.deletion_confirmation + if (config.useRecycleBin && !config.tempSkipRecycleBin && !isRecycleBin) org.fossify.commons.R.string.move_to_recycle_bin_confirmation else org.fossify.commons.R.string.deletion_confirmation val question = String.format(resources.getString(baseString), itemsAndSize) val showSkipRecycleBinOption = config.useRecycleBin && !isRecycleBin @@ -619,7 +619,7 @@ class MediaAdapter( playPortraitOutline?.beVisibleIf(medium.isVideo() || medium.isPortrait()) if (medium.isVideo()) { - playPortraitOutline?.setImageResource(com.simplemobiletools.commons.R.drawable.ic_play_outline_vector) + playPortraitOutline?.setImageResource(org.fossify.commons.R.drawable.ic_play_outline_vector) playPortraitOutline?.beVisible() } else if (medium.isPortrait()) { playPortraitOutline?.setImageResource(R.drawable.ic_portrait_photo_vector) diff --git a/app/src/main/kotlin/com/simplemobiletools/gallery/pro/adapters/MediaItemBinding.kt b/app/src/main/kotlin/org/fossify/gallery/adapters/MediaItemBinding.kt similarity index 86% rename from app/src/main/kotlin/com/simplemobiletools/gallery/pro/adapters/MediaItemBinding.kt rename to app/src/main/kotlin/org/fossify/gallery/adapters/MediaItemBinding.kt index 6f3db6b27..56866e711 100644 --- a/app/src/main/kotlin/com/simplemobiletools/gallery/pro/adapters/MediaItemBinding.kt +++ b/app/src/main/kotlin/org/fossify/gallery/adapters/MediaItemBinding.kt @@ -1,13 +1,13 @@ -package com.simplemobiletools.gallery.pro.adapters +package org.fossify.gallery.adapters import android.view.ViewGroup import android.widget.ImageView import android.widget.TextView -import com.simplemobiletools.commons.views.MySquareImageView -import com.simplemobiletools.gallery.pro.databinding.PhotoItemGridBinding -import com.simplemobiletools.gallery.pro.databinding.PhotoItemListBinding -import com.simplemobiletools.gallery.pro.databinding.VideoItemGridBinding -import com.simplemobiletools.gallery.pro.databinding.VideoItemListBinding +import org.fossify.commons.views.MySquareImageView +import org.fossify.gallery.databinding.PhotoItemGridBinding +import org.fossify.gallery.databinding.PhotoItemListBinding +import org.fossify.gallery.databinding.VideoItemGridBinding +import org.fossify.gallery.databinding.VideoItemListBinding interface MediaItemBinding { val root: ViewGroup @@ -53,7 +53,7 @@ class VideoListMediaItemBinding(val binding: VideoItemListBinding) : MediaItemBi override val root: ViewGroup = binding.root override val mediaItemHolder: ViewGroup = binding.mediaItemHolder override val favorite: ImageView = binding.favorite - override val playPortraitOutline: ImageView? = binding.playPortraitOutline + override val playPortraitOutline: ImageView = binding.playPortraitOutline override val fileType: TextView? = null override val mediumName: TextView = binding.mediumName override val videoDuration: TextView = binding.videoDuration diff --git a/app/src/main/kotlin/com/simplemobiletools/gallery/pro/adapters/MyPagerAdapter.kt b/app/src/main/kotlin/org/fossify/gallery/adapters/MyPagerAdapter.kt similarity index 80% rename from app/src/main/kotlin/com/simplemobiletools/gallery/pro/adapters/MyPagerAdapter.kt rename to app/src/main/kotlin/org/fossify/gallery/adapters/MyPagerAdapter.kt index 02be99de0..b95564e52 100644 --- a/app/src/main/kotlin/com/simplemobiletools/gallery/pro/adapters/MyPagerAdapter.kt +++ b/app/src/main/kotlin/org/fossify/gallery/adapters/MyPagerAdapter.kt @@ -1,4 +1,4 @@ -package com.simplemobiletools.gallery.pro.adapters +package org.fossify.gallery.adapters import android.os.Bundle import android.os.Parcelable @@ -7,13 +7,13 @@ import androidx.fragment.app.Fragment import androidx.fragment.app.FragmentManager import androidx.fragment.app.FragmentStatePagerAdapter import androidx.viewpager.widget.PagerAdapter -import com.simplemobiletools.gallery.pro.activities.ViewPagerActivity -import com.simplemobiletools.gallery.pro.fragments.PhotoFragment -import com.simplemobiletools.gallery.pro.fragments.VideoFragment -import com.simplemobiletools.gallery.pro.fragments.ViewPagerFragment -import com.simplemobiletools.gallery.pro.helpers.MEDIUM -import com.simplemobiletools.gallery.pro.helpers.SHOULD_INIT_FRAGMENT -import com.simplemobiletools.gallery.pro.models.Medium +import org.fossify.gallery.activities.ViewPagerActivity +import org.fossify.gallery.fragments.PhotoFragment +import org.fossify.gallery.fragments.VideoFragment +import org.fossify.gallery.fragments.ViewPagerFragment +import org.fossify.gallery.helpers.MEDIUM +import org.fossify.gallery.helpers.SHOULD_INIT_FRAGMENT +import org.fossify.gallery.models.Medium class MyPagerAdapter(val activity: ViewPagerActivity, fm: FragmentManager, val media: MutableList) : FragmentStatePagerAdapter(fm) { private val fragments = HashMap() diff --git a/app/src/main/kotlin/com/simplemobiletools/gallery/pro/adapters/PortraitPhotosAdapter.kt b/app/src/main/kotlin/org/fossify/gallery/adapters/PortraitPhotosAdapter.kt similarity index 93% rename from app/src/main/kotlin/com/simplemobiletools/gallery/pro/adapters/PortraitPhotosAdapter.kt rename to app/src/main/kotlin/org/fossify/gallery/adapters/PortraitPhotosAdapter.kt index f626a69b1..b20a07615 100644 --- a/app/src/main/kotlin/com/simplemobiletools/gallery/pro/adapters/PortraitPhotosAdapter.kt +++ b/app/src/main/kotlin/org/fossify/gallery/adapters/PortraitPhotosAdapter.kt @@ -1,4 +1,4 @@ -package com.simplemobiletools.gallery.pro.adapters +package org.fossify.gallery.adapters import android.content.Context import android.view.LayoutInflater @@ -10,9 +10,9 @@ import com.bumptech.glide.load.engine.DiskCacheStrategy import com.bumptech.glide.load.resource.drawable.DrawableTransitionOptions import com.bumptech.glide.request.RequestOptions import com.bumptech.glide.signature.ObjectKey -import com.simplemobiletools.commons.extensions.getFileKey -import com.simplemobiletools.gallery.pro.R -import com.simplemobiletools.gallery.pro.databinding.PortraitPhotoItemBinding +import org.fossify.commons.extensions.getFileKey +import org.fossify.gallery.R +import org.fossify.gallery.databinding.PortraitPhotoItemBinding class PortraitPhotosAdapter(val context: Context, val photos: ArrayList, val sideElementWidth: Int, val itemClick: (Int, Int) -> Unit) : RecyclerView.Adapter() { diff --git a/app/src/main/kotlin/com/simplemobiletools/gallery/pro/asynctasks/GetMediaAsynctask.kt b/app/src/main/kotlin/org/fossify/gallery/asynctasks/GetMediaAsynctask.kt similarity index 82% rename from app/src/main/kotlin/com/simplemobiletools/gallery/pro/asynctasks/GetMediaAsynctask.kt rename to app/src/main/kotlin/org/fossify/gallery/asynctasks/GetMediaAsynctask.kt index bac04000f..dab4202b0 100644 --- a/app/src/main/kotlin/com/simplemobiletools/gallery/pro/asynctasks/GetMediaAsynctask.kt +++ b/app/src/main/kotlin/org/fossify/gallery/asynctasks/GetMediaAsynctask.kt @@ -1,16 +1,16 @@ -package com.simplemobiletools.gallery.pro.asynctasks +package org.fossify.gallery.asynctasks import android.content.Context import android.os.AsyncTask -import com.simplemobiletools.commons.helpers.FAVORITES -import com.simplemobiletools.commons.helpers.SORT_BY_DATE_MODIFIED -import com.simplemobiletools.commons.helpers.SORT_BY_DATE_TAKEN -import com.simplemobiletools.commons.helpers.SORT_BY_SIZE -import com.simplemobiletools.gallery.pro.extensions.config -import com.simplemobiletools.gallery.pro.extensions.getFavoritePaths -import com.simplemobiletools.gallery.pro.helpers.* -import com.simplemobiletools.gallery.pro.models.Medium -import com.simplemobiletools.gallery.pro.models.ThumbnailItem +import org.fossify.commons.helpers.FAVORITES +import org.fossify.commons.helpers.SORT_BY_DATE_MODIFIED +import org.fossify.commons.helpers.SORT_BY_DATE_TAKEN +import org.fossify.commons.helpers.SORT_BY_SIZE +import org.fossify.gallery.extensions.config +import org.fossify.gallery.extensions.getFavoritePaths +import org.fossify.gallery.helpers.* +import org.fossify.gallery.models.Medium +import org.fossify.gallery.models.ThumbnailItem class GetMediaAsynctask( val context: Context, val mPath: String, val isPickImage: Boolean = false, val isPickVideo: Boolean = false, diff --git a/app/src/main/kotlin/com/simplemobiletools/gallery/pro/databases/GalleryDatabase.kt b/app/src/main/kotlin/org/fossify/gallery/databases/GalleryDatabase.kt similarity index 96% rename from app/src/main/kotlin/com/simplemobiletools/gallery/pro/databases/GalleryDatabase.kt rename to app/src/main/kotlin/org/fossify/gallery/databases/GalleryDatabase.kt index 18a7d7a7d..80a10ecd6 100644 --- a/app/src/main/kotlin/com/simplemobiletools/gallery/pro/databases/GalleryDatabase.kt +++ b/app/src/main/kotlin/org/fossify/gallery/databases/GalleryDatabase.kt @@ -1,4 +1,4 @@ -package com.simplemobiletools.gallery.pro.databases +package org.fossify.gallery.databases import android.content.Context import androidx.room.Database @@ -6,8 +6,8 @@ import androidx.room.Room import androidx.room.RoomDatabase import androidx.room.migration.Migration import androidx.sqlite.db.SupportSQLiteDatabase -import com.simplemobiletools.gallery.pro.interfaces.* -import com.simplemobiletools.gallery.pro.models.* +import org.fossify.gallery.interfaces.* +import org.fossify.gallery.models.* @Database(entities = [Directory::class, Medium::class, Widget::class, DateTaken::class, Favorite::class], version = 10) abstract class GalleryDatabase : RoomDatabase() { diff --git a/app/src/main/kotlin/com/simplemobiletools/gallery/pro/dialogs/AllFilesPermissionDialog.kt b/app/src/main/kotlin/org/fossify/gallery/dialogs/AllFilesPermissionDialog.kt similarity index 67% rename from app/src/main/kotlin/com/simplemobiletools/gallery/pro/dialogs/AllFilesPermissionDialog.kt rename to app/src/main/kotlin/org/fossify/gallery/dialogs/AllFilesPermissionDialog.kt index 6526d7390..62d7001c7 100644 --- a/app/src/main/kotlin/com/simplemobiletools/gallery/pro/dialogs/AllFilesPermissionDialog.kt +++ b/app/src/main/kotlin/org/fossify/gallery/dialogs/AllFilesPermissionDialog.kt @@ -1,11 +1,11 @@ -package com.simplemobiletools.gallery.pro.dialogs +package org.fossify.gallery.dialogs import android.widget.TextView import androidx.appcompat.app.AlertDialog -import com.simplemobiletools.commons.activities.BaseSimpleActivity -import com.simplemobiletools.commons.extensions.getAlertDialogBuilder -import com.simplemobiletools.commons.extensions.setupDialogStuff -import com.simplemobiletools.gallery.pro.R +import org.fossify.commons.activities.BaseSimpleActivity +import org.fossify.commons.extensions.getAlertDialogBuilder +import org.fossify.commons.extensions.setupDialogStuff +import org.fossify.gallery.R class AllFilesPermissionDialog( val activity: BaseSimpleActivity, message: String = "", val callback: (result: Boolean) -> Unit, val neutralPressed: () -> Unit @@ -13,7 +13,7 @@ class AllFilesPermissionDialog( private var dialog: AlertDialog? = null init { - val view = activity.layoutInflater.inflate(com.simplemobiletools.commons.R.layout.dialog_message, null) + val view = activity.layoutInflater.inflate(org.fossify.commons.R.layout.dialog_message, null) view.findViewById(R.id.message).text = message activity.getAlertDialogBuilder().setPositiveButton(R.string.all_files) { dialog, which -> positivePressed() } diff --git a/app/src/main/kotlin/com/simplemobiletools/gallery/pro/dialogs/ChangeFileThumbnailStyleDialog.kt b/app/src/main/kotlin/org/fossify/gallery/dialogs/ChangeFileThumbnailStyleDialog.kt similarity index 79% rename from app/src/main/kotlin/com/simplemobiletools/gallery/pro/dialogs/ChangeFileThumbnailStyleDialog.kt rename to app/src/main/kotlin/org/fossify/gallery/dialogs/ChangeFileThumbnailStyleDialog.kt index 0429f05e1..7a8b7b527 100644 --- a/app/src/main/kotlin/com/simplemobiletools/gallery/pro/dialogs/ChangeFileThumbnailStyleDialog.kt +++ b/app/src/main/kotlin/org/fossify/gallery/dialogs/ChangeFileThumbnailStyleDialog.kt @@ -1,13 +1,13 @@ -package com.simplemobiletools.gallery.pro.dialogs +package org.fossify.gallery.dialogs import android.content.DialogInterface -import com.simplemobiletools.commons.activities.BaseSimpleActivity -import com.simplemobiletools.commons.dialogs.RadioGroupDialog -import com.simplemobiletools.commons.extensions.getAlertDialogBuilder -import com.simplemobiletools.commons.extensions.setupDialogStuff -import com.simplemobiletools.commons.models.RadioItem -import com.simplemobiletools.gallery.pro.databinding.DialogChangeFileThumbnailStyleBinding -import com.simplemobiletools.gallery.pro.extensions.config +import org.fossify.commons.activities.BaseSimpleActivity +import org.fossify.commons.dialogs.RadioGroupDialog +import org.fossify.commons.extensions.getAlertDialogBuilder +import org.fossify.commons.extensions.setupDialogStuff +import org.fossify.commons.models.RadioItem +import org.fossify.gallery.databinding.DialogChangeFileThumbnailStyleBinding +import org.fossify.gallery.extensions.config class ChangeFileThumbnailStyleDialog(val activity: BaseSimpleActivity) : DialogInterface.OnClickListener { private var config = activity.config @@ -48,8 +48,8 @@ class ChangeFileThumbnailStyleDialog(val activity: BaseSimpleActivity) : DialogI updateThumbnailSpacingText() activity.getAlertDialogBuilder() - .setPositiveButton(com.simplemobiletools.commons.R.string.ok, this) - .setNegativeButton(com.simplemobiletools.commons.R.string.cancel, null) + .setPositiveButton(org.fossify.commons.R.string.ok, this) + .setNegativeButton(org.fossify.commons.R.string.cancel, null) .apply { activity.setupDialogStuff(binding.root, this) } diff --git a/app/src/main/kotlin/com/simplemobiletools/gallery/pro/dialogs/ChangeFolderThumbnailStyleDialog.kt b/app/src/main/kotlin/org/fossify/gallery/dialogs/ChangeFolderThumbnailStyleDialog.kt similarity index 83% rename from app/src/main/kotlin/com/simplemobiletools/gallery/pro/dialogs/ChangeFolderThumbnailStyleDialog.kt rename to app/src/main/kotlin/org/fossify/gallery/dialogs/ChangeFolderThumbnailStyleDialog.kt index 06173bafa..f4d3db198 100644 --- a/app/src/main/kotlin/com/simplemobiletools/gallery/pro/dialogs/ChangeFolderThumbnailStyleDialog.kt +++ b/app/src/main/kotlin/org/fossify/gallery/dialogs/ChangeFolderThumbnailStyleDialog.kt @@ -1,4 +1,4 @@ -package com.simplemobiletools.gallery.pro.dialogs +package org.fossify.gallery.dialogs import android.content.DialogInterface import android.widget.RelativeLayout @@ -6,15 +6,15 @@ import com.bumptech.glide.Glide import com.bumptech.glide.load.resource.bitmap.CenterCrop import com.bumptech.glide.load.resource.bitmap.RoundedCorners import com.bumptech.glide.request.RequestOptions -import com.simplemobiletools.commons.activities.BaseSimpleActivity -import com.simplemobiletools.commons.extensions.* -import com.simplemobiletools.gallery.pro.R -import com.simplemobiletools.gallery.pro.adapters.toItemBinding -import com.simplemobiletools.gallery.pro.databinding.DialogChangeFolderThumbnailStyleBinding -import com.simplemobiletools.gallery.pro.databinding.DirectoryItemGridRoundedCornersBinding -import com.simplemobiletools.gallery.pro.databinding.DirectoryItemGridSquareBinding -import com.simplemobiletools.gallery.pro.extensions.config -import com.simplemobiletools.gallery.pro.helpers.* +import org.fossify.commons.activities.BaseSimpleActivity +import org.fossify.commons.extensions.* +import org.fossify.gallery.R +import org.fossify.gallery.adapters.toItemBinding +import org.fossify.gallery.databinding.DialogChangeFolderThumbnailStyleBinding +import org.fossify.gallery.databinding.DirectoryItemGridRoundedCornersBinding +import org.fossify.gallery.databinding.DirectoryItemGridSquareBinding +import org.fossify.gallery.extensions.config +import org.fossify.gallery.helpers.* class ChangeFolderThumbnailStyleDialog(val activity: BaseSimpleActivity, val callback: () -> Unit) : DialogInterface.OnClickListener { private var config = activity.config @@ -24,8 +24,8 @@ class ChangeFolderThumbnailStyleDialog(val activity: BaseSimpleActivity, val cal init { activity.getAlertDialogBuilder() - .setPositiveButton(com.simplemobiletools.commons.R.string.ok, this) - .setNegativeButton(com.simplemobiletools.commons.R.string.cancel, null) + .setPositiveButton(org.fossify.commons.R.string.ok, this) + .setNegativeButton(org.fossify.commons.R.string.cancel, null) .apply { activity.setupDialogStuff(binding.root, this) { setupStyle() @@ -106,7 +106,7 @@ class ChangeFolderThumbnailStyleDialog(val activity: BaseSimpleActivity, val cal .apply(options) if (useRoundedCornersLayout) { - val cornerRadius = root.resources.getDimension(com.simplemobiletools.commons.R.dimen.rounded_corner_radius_big).toInt() + val cornerRadius = root.resources.getDimension(org.fossify.commons.R.dimen.rounded_corner_radius_big).toInt() builder = builder.transform(CenterCrop(), RoundedCorners(cornerRadius)) sampleBinding.dirName.setTextColor(activity.getProperTextColor()) sampleBinding.photoCnt.setTextColor(activity.getProperTextColor()) diff --git a/app/src/main/kotlin/com/simplemobiletools/gallery/pro/dialogs/ChangeGroupingDialog.kt b/app/src/main/kotlin/org/fossify/gallery/dialogs/ChangeGroupingDialog.kt similarity index 83% rename from app/src/main/kotlin/com/simplemobiletools/gallery/pro/dialogs/ChangeGroupingDialog.kt rename to app/src/main/kotlin/org/fossify/gallery/dialogs/ChangeGroupingDialog.kt index e76fb6bde..f47e2284b 100644 --- a/app/src/main/kotlin/com/simplemobiletools/gallery/pro/dialogs/ChangeGroupingDialog.kt +++ b/app/src/main/kotlin/org/fossify/gallery/dialogs/ChangeGroupingDialog.kt @@ -1,14 +1,14 @@ -package com.simplemobiletools.gallery.pro.dialogs +package org.fossify.gallery.dialogs import android.content.DialogInterface -import com.simplemobiletools.commons.activities.BaseSimpleActivity -import com.simplemobiletools.commons.extensions.beVisibleIf -import com.simplemobiletools.commons.extensions.getAlertDialogBuilder -import com.simplemobiletools.commons.extensions.setupDialogStuff -import com.simplemobiletools.gallery.pro.R -import com.simplemobiletools.gallery.pro.databinding.DialogChangeGroupingBinding -import com.simplemobiletools.gallery.pro.extensions.config -import com.simplemobiletools.gallery.pro.helpers.* +import org.fossify.commons.activities.BaseSimpleActivity +import org.fossify.commons.extensions.beVisibleIf +import org.fossify.commons.extensions.getAlertDialogBuilder +import org.fossify.commons.extensions.setupDialogStuff +import org.fossify.gallery.R +import org.fossify.gallery.databinding.DialogChangeGroupingBinding +import org.fossify.gallery.extensions.config +import org.fossify.gallery.helpers.* class ChangeGroupingDialog(val activity: BaseSimpleActivity, val path: String = "", val callback: () -> Unit) : DialogInterface.OnClickListener { @@ -25,8 +25,8 @@ class ChangeGroupingDialog(val activity: BaseSimpleActivity, val path: String = } activity.getAlertDialogBuilder() - .setPositiveButton(com.simplemobiletools.commons.R.string.ok, this) - .setNegativeButton(com.simplemobiletools.commons.R.string.cancel, null) + .setPositiveButton(org.fossify.commons.R.string.ok, this) + .setNegativeButton(org.fossify.commons.R.string.cancel, null) .apply { activity.setupDialogStuff(binding.root, this, R.string.group_by) } diff --git a/app/src/main/kotlin/com/simplemobiletools/gallery/pro/dialogs/ChangeSortingDialog.kt b/app/src/main/kotlin/org/fossify/gallery/dialogs/ChangeSortingDialog.kt similarity index 86% rename from app/src/main/kotlin/com/simplemobiletools/gallery/pro/dialogs/ChangeSortingDialog.kt rename to app/src/main/kotlin/org/fossify/gallery/dialogs/ChangeSortingDialog.kt index 6770b8e22..f10cd49d8 100644 --- a/app/src/main/kotlin/com/simplemobiletools/gallery/pro/dialogs/ChangeSortingDialog.kt +++ b/app/src/main/kotlin/org/fossify/gallery/dialogs/ChangeSortingDialog.kt @@ -1,13 +1,13 @@ -package com.simplemobiletools.gallery.pro.dialogs +package org.fossify.gallery.dialogs import android.content.DialogInterface -import com.simplemobiletools.commons.activities.BaseSimpleActivity -import com.simplemobiletools.commons.extensions.* -import com.simplemobiletools.commons.helpers.* -import com.simplemobiletools.gallery.pro.R -import com.simplemobiletools.gallery.pro.databinding.DialogChangeSortingBinding -import com.simplemobiletools.gallery.pro.extensions.config -import com.simplemobiletools.gallery.pro.helpers.SHOW_ALL +import org.fossify.commons.activities.BaseSimpleActivity +import org.fossify.commons.extensions.* +import org.fossify.commons.helpers.* +import org.fossify.gallery.R +import org.fossify.gallery.databinding.DialogChangeSortingBinding +import org.fossify.gallery.extensions.config +import org.fossify.gallery.helpers.SHOW_ALL class ChangeSortingDialog( val activity: BaseSimpleActivity, val isDirectorySorting: Boolean, val showFolderCheckbox: Boolean, @@ -34,10 +34,10 @@ class ChangeSortingDialog( } activity.getAlertDialogBuilder() - .setPositiveButton(com.simplemobiletools.commons.R.string.ok, this) - .setNegativeButton(com.simplemobiletools.commons.R.string.cancel, null) + .setPositiveButton(org.fossify.commons.R.string.ok, this) + .setNegativeButton(org.fossify.commons.R.string.cancel, null) .apply { - activity.setupDialogStuff(binding.root, this, com.simplemobiletools.commons.R.string.sort_by) + activity.setupDialogStuff(binding.root, this, org.fossify.commons.R.string.sort_by) } setupSortRadio() diff --git a/app/src/main/kotlin/com/simplemobiletools/gallery/pro/dialogs/ChangeViewTypeDialog.kt b/app/src/main/kotlin/org/fossify/gallery/dialogs/ChangeViewTypeDialog.kt similarity index 73% rename from app/src/main/kotlin/com/simplemobiletools/gallery/pro/dialogs/ChangeViewTypeDialog.kt rename to app/src/main/kotlin/org/fossify/gallery/dialogs/ChangeViewTypeDialog.kt index 322a0f443..3b05b0800 100644 --- a/app/src/main/kotlin/com/simplemobiletools/gallery/pro/dialogs/ChangeViewTypeDialog.kt +++ b/app/src/main/kotlin/org/fossify/gallery/dialogs/ChangeViewTypeDialog.kt @@ -1,14 +1,14 @@ -package com.simplemobiletools.gallery.pro.dialogs +package org.fossify.gallery.dialogs -import com.simplemobiletools.commons.activities.BaseSimpleActivity -import com.simplemobiletools.commons.extensions.beVisibleIf -import com.simplemobiletools.commons.extensions.getAlertDialogBuilder -import com.simplemobiletools.commons.extensions.setupDialogStuff -import com.simplemobiletools.commons.helpers.VIEW_TYPE_GRID -import com.simplemobiletools.commons.helpers.VIEW_TYPE_LIST -import com.simplemobiletools.gallery.pro.databinding.DialogChangeViewTypeBinding -import com.simplemobiletools.gallery.pro.extensions.config -import com.simplemobiletools.gallery.pro.helpers.SHOW_ALL +import org.fossify.commons.activities.BaseSimpleActivity +import org.fossify.commons.extensions.beVisibleIf +import org.fossify.commons.extensions.getAlertDialogBuilder +import org.fossify.commons.extensions.setupDialogStuff +import org.fossify.commons.helpers.VIEW_TYPE_GRID +import org.fossify.commons.helpers.VIEW_TYPE_LIST +import org.fossify.gallery.databinding.DialogChangeViewTypeBinding +import org.fossify.gallery.extensions.config +import org.fossify.gallery.helpers.SHOW_ALL class ChangeViewTypeDialog(val activity: BaseSimpleActivity, val fromFoldersView: Boolean, val path: String = "", val callback: () -> Unit) { private val binding = DialogChangeViewTypeBinding.inflate(activity.layoutInflater) @@ -45,8 +45,8 @@ class ChangeViewTypeDialog(val activity: BaseSimpleActivity, val fromFoldersView } activity.getAlertDialogBuilder() - .setPositiveButton(com.simplemobiletools.commons.R.string.ok) { dialog, which -> dialogConfirmed() } - .setNegativeButton(com.simplemobiletools.commons.R.string.cancel, null) + .setPositiveButton(org.fossify.commons.R.string.ok) { dialog, which -> dialogConfirmed() } + .setNegativeButton(org.fossify.commons.R.string.cancel, null) .apply { activity.setupDialogStuff(binding.root, this) } diff --git a/app/src/main/kotlin/com/simplemobiletools/gallery/pro/dialogs/ConfirmDeleteFolderDialog.kt b/app/src/main/kotlin/org/fossify/gallery/dialogs/ConfirmDeleteFolderDialog.kt similarity index 61% rename from app/src/main/kotlin/com/simplemobiletools/gallery/pro/dialogs/ConfirmDeleteFolderDialog.kt rename to app/src/main/kotlin/org/fossify/gallery/dialogs/ConfirmDeleteFolderDialog.kt index c209e0b5d..be05fcad2 100644 --- a/app/src/main/kotlin/com/simplemobiletools/gallery/pro/dialogs/ConfirmDeleteFolderDialog.kt +++ b/app/src/main/kotlin/org/fossify/gallery/dialogs/ConfirmDeleteFolderDialog.kt @@ -1,10 +1,10 @@ -package com.simplemobiletools.gallery.pro.dialogs +package org.fossify.gallery.dialogs import android.app.Activity import androidx.appcompat.app.AlertDialog -import com.simplemobiletools.commons.extensions.getAlertDialogBuilder -import com.simplemobiletools.commons.extensions.setupDialogStuff -import com.simplemobiletools.gallery.pro.databinding.DialogConfirmDeleteFolderBinding +import org.fossify.commons.extensions.getAlertDialogBuilder +import org.fossify.commons.extensions.setupDialogStuff +import org.fossify.gallery.databinding.DialogConfirmDeleteFolderBinding class ConfirmDeleteFolderDialog(activity: Activity, message: String, warningMessage: String, val callback: () -> Unit) { private var dialog: AlertDialog? = null @@ -15,8 +15,8 @@ class ConfirmDeleteFolderDialog(activity: Activity, message: String, warningMess binding.messageWarning.text = warningMessage activity.getAlertDialogBuilder() - .setPositiveButton(com.simplemobiletools.commons.R.string.yes) { dialog, which -> dialogConfirmed() } - .setNegativeButton(com.simplemobiletools.commons.R.string.no, null) + .setPositiveButton(org.fossify.commons.R.string.yes) { dialog, which -> dialogConfirmed() } + .setNegativeButton(org.fossify.commons.R.string.no, null) .apply { activity.setupDialogStuff(binding.root, this) { alertDialog -> dialog = alertDialog diff --git a/app/src/main/kotlin/com/simplemobiletools/gallery/pro/dialogs/CustomAspectRatioDialog.kt b/app/src/main/kotlin/org/fossify/gallery/dialogs/CustomAspectRatioDialog.kt similarity index 68% rename from app/src/main/kotlin/com/simplemobiletools/gallery/pro/dialogs/CustomAspectRatioDialog.kt rename to app/src/main/kotlin/org/fossify/gallery/dialogs/CustomAspectRatioDialog.kt index 020b05b8d..60d4ca7b0 100644 --- a/app/src/main/kotlin/com/simplemobiletools/gallery/pro/dialogs/CustomAspectRatioDialog.kt +++ b/app/src/main/kotlin/org/fossify/gallery/dialogs/CustomAspectRatioDialog.kt @@ -1,13 +1,13 @@ -package com.simplemobiletools.gallery.pro.dialogs +package org.fossify.gallery.dialogs import android.widget.EditText import androidx.appcompat.app.AlertDialog -import com.simplemobiletools.commons.activities.BaseSimpleActivity -import com.simplemobiletools.commons.extensions.getAlertDialogBuilder -import com.simplemobiletools.commons.extensions.setupDialogStuff -import com.simplemobiletools.commons.extensions.showKeyboard -import com.simplemobiletools.commons.extensions.value -import com.simplemobiletools.gallery.pro.databinding.DialogCustomAspectRatioBinding +import org.fossify.commons.activities.BaseSimpleActivity +import org.fossify.commons.extensions.getAlertDialogBuilder +import org.fossify.commons.extensions.setupDialogStuff +import org.fossify.commons.extensions.showKeyboard +import org.fossify.commons.extensions.value +import org.fossify.gallery.databinding.DialogCustomAspectRatioBinding class CustomAspectRatioDialog( val activity: BaseSimpleActivity, val defaultCustomAspectRatio: Pair?, val callback: (aspectRatio: Pair) -> Unit @@ -19,8 +19,8 @@ class CustomAspectRatioDialog( } activity.getAlertDialogBuilder() - .setPositiveButton(com.simplemobiletools.commons.R.string.ok, null) - .setNegativeButton(com.simplemobiletools.commons.R.string.cancel, null) + .setPositiveButton(org.fossify.commons.R.string.ok, null) + .setNegativeButton(org.fossify.commons.R.string.cancel, null) .apply { activity.setupDialogStuff(binding.root, this) { alertDialog -> alertDialog.showKeyboard(binding.aspectRatioWidth) diff --git a/app/src/main/kotlin/com/simplemobiletools/gallery/pro/dialogs/DeleteWithRememberDialog.kt b/app/src/main/kotlin/org/fossify/gallery/dialogs/DeleteWithRememberDialog.kt similarity index 65% rename from app/src/main/kotlin/com/simplemobiletools/gallery/pro/dialogs/DeleteWithRememberDialog.kt rename to app/src/main/kotlin/org/fossify/gallery/dialogs/DeleteWithRememberDialog.kt index fd57f69c7..a1ee23aaf 100644 --- a/app/src/main/kotlin/com/simplemobiletools/gallery/pro/dialogs/DeleteWithRememberDialog.kt +++ b/app/src/main/kotlin/org/fossify/gallery/dialogs/DeleteWithRememberDialog.kt @@ -1,11 +1,11 @@ -package com.simplemobiletools.gallery.pro.dialogs +package org.fossify.gallery.dialogs import android.app.Activity import androidx.appcompat.app.AlertDialog -import com.simplemobiletools.commons.extensions.beGoneIf -import com.simplemobiletools.commons.extensions.getAlertDialogBuilder -import com.simplemobiletools.commons.extensions.setupDialogStuff -import com.simplemobiletools.gallery.pro.databinding.DialogDeleteWithRememberBinding +import org.fossify.commons.extensions.beGoneIf +import org.fossify.commons.extensions.getAlertDialogBuilder +import org.fossify.commons.extensions.setupDialogStuff +import org.fossify.gallery.databinding.DialogDeleteWithRememberBinding class DeleteWithRememberDialog( private val activity: Activity, @@ -21,8 +21,8 @@ class DeleteWithRememberDialog( binding.deleteRememberTitle.text = message binding.skipTheRecycleBinCheckbox.beGoneIf(!showSkipRecycleBinOption) activity.getAlertDialogBuilder() - .setPositiveButton(com.simplemobiletools.commons.R.string.yes) { dialog, which -> dialogConfirmed() } - .setNegativeButton(com.simplemobiletools.commons.R.string.no, null) + .setPositiveButton(org.fossify.commons.R.string.yes) { dialog, which -> dialogConfirmed() } + .setNegativeButton(org.fossify.commons.R.string.no, null) .apply { activity.setupDialogStuff(binding.root, this) { alertDialog -> dialog = alertDialog diff --git a/app/src/main/kotlin/com/simplemobiletools/gallery/pro/dialogs/ExcludeFolderDialog.kt b/app/src/main/kotlin/org/fossify/gallery/dialogs/ExcludeFolderDialog.kt similarity index 73% rename from app/src/main/kotlin/com/simplemobiletools/gallery/pro/dialogs/ExcludeFolderDialog.kt rename to app/src/main/kotlin/org/fossify/gallery/dialogs/ExcludeFolderDialog.kt index dbdba0698..d23f31b67 100644 --- a/app/src/main/kotlin/com/simplemobiletools/gallery/pro/dialogs/ExcludeFolderDialog.kt +++ b/app/src/main/kotlin/org/fossify/gallery/dialogs/ExcludeFolderDialog.kt @@ -1,15 +1,15 @@ -package com.simplemobiletools.gallery.pro.dialogs +package org.fossify.gallery.dialogs import android.view.ViewGroup import android.widget.RadioGroup -import com.simplemobiletools.commons.activities.BaseSimpleActivity -import com.simplemobiletools.commons.databinding.RadioButtonBinding -import com.simplemobiletools.commons.extensions.beVisibleIf -import com.simplemobiletools.commons.extensions.getAlertDialogBuilder -import com.simplemobiletools.commons.extensions.getBasePath -import com.simplemobiletools.commons.extensions.setupDialogStuff -import com.simplemobiletools.gallery.pro.databinding.DialogExcludeFolderBinding -import com.simplemobiletools.gallery.pro.extensions.config +import org.fossify.commons.activities.BaseSimpleActivity +import org.fossify.commons.databinding.RadioButtonBinding +import org.fossify.commons.extensions.beVisibleIf +import org.fossify.commons.extensions.getAlertDialogBuilder +import org.fossify.commons.extensions.getBasePath +import org.fossify.commons.extensions.setupDialogStuff +import org.fossify.gallery.databinding.DialogExcludeFolderBinding +import org.fossify.gallery.extensions.config class ExcludeFolderDialog(val activity: BaseSimpleActivity, val selectedPaths: List, val callback: () -> Unit) { private val alternativePaths = getAlternativePathsList() @@ -33,8 +33,8 @@ class ExcludeFolderDialog(val activity: BaseSimpleActivity, val selectedPaths: L } activity.getAlertDialogBuilder() - .setPositiveButton(com.simplemobiletools.commons.R.string.ok) { dialog, which -> dialogConfirmed() } - .setNegativeButton(com.simplemobiletools.commons.R.string.cancel, null) + .setPositiveButton(org.fossify.commons.R.string.ok) { dialog, which -> dialogConfirmed() } + .setNegativeButton(org.fossify.commons.R.string.cancel, null) .apply { activity.setupDialogStuff(binding.root, this) } diff --git a/app/src/main/kotlin/com/simplemobiletools/gallery/pro/dialogs/ExportFavoritesDialog.kt b/app/src/main/kotlin/org/fossify/gallery/dialogs/ExportFavoritesDialog.kt similarity index 73% rename from app/src/main/kotlin/com/simplemobiletools/gallery/pro/dialogs/ExportFavoritesDialog.kt rename to app/src/main/kotlin/org/fossify/gallery/dialogs/ExportFavoritesDialog.kt index 0df365ae0..907cf1faf 100644 --- a/app/src/main/kotlin/com/simplemobiletools/gallery/pro/dialogs/ExportFavoritesDialog.kt +++ b/app/src/main/kotlin/org/fossify/gallery/dialogs/ExportFavoritesDialog.kt @@ -1,13 +1,13 @@ -package com.simplemobiletools.gallery.pro.dialogs +package org.fossify.gallery.dialogs import androidx.appcompat.app.AlertDialog -import com.simplemobiletools.commons.activities.BaseSimpleActivity -import com.simplemobiletools.commons.dialogs.ConfirmationDialog -import com.simplemobiletools.commons.dialogs.FilePickerDialog -import com.simplemobiletools.commons.extensions.* -import com.simplemobiletools.gallery.pro.R -import com.simplemobiletools.gallery.pro.databinding.DialogExportFavoritesBinding -import com.simplemobiletools.gallery.pro.extensions.config +import org.fossify.commons.activities.BaseSimpleActivity +import org.fossify.commons.dialogs.ConfirmationDialog +import org.fossify.commons.dialogs.FilePickerDialog +import org.fossify.commons.extensions.* +import org.fossify.gallery.R +import org.fossify.gallery.databinding.DialogExportFavoritesBinding +import org.fossify.gallery.extensions.config class ExportFavoritesDialog( val activity: BaseSimpleActivity, val defaultFilename: String, val hidePath: Boolean, @@ -39,28 +39,28 @@ class ExportFavoritesDialog( } activity.getAlertDialogBuilder() - .setPositiveButton(com.simplemobiletools.commons.R.string.ok, null) - .setNegativeButton(com.simplemobiletools.commons.R.string.cancel, null) + .setPositiveButton(org.fossify.commons.R.string.ok, null) + .setNegativeButton(org.fossify.commons.R.string.cancel, null) .apply { activity.setupDialogStuff(binding.root, this, R.string.export_favorite_paths) { alertDialog -> alertDialog.getButton(AlertDialog.BUTTON_POSITIVE).setOnClickListener { var filename = binding.exportFavoritesFilename.value if (filename.isEmpty()) { - activity.toast(com.simplemobiletools.commons.R.string.filename_cannot_be_empty) + activity.toast(org.fossify.commons.R.string.filename_cannot_be_empty) return@setOnClickListener } filename += ".txt" val newPath = "${folder.trimEnd('/')}/$filename" if (!newPath.getFilenameFromPath().isAValidFilename()) { - activity.toast(com.simplemobiletools.commons.R.string.filename_invalid_characters) + activity.toast(org.fossify.commons.R.string.filename_invalid_characters) return@setOnClickListener } activity.config.lastExportedFavoritesFolder = folder if (!hidePath && activity.getDoesFilePathExist(newPath)) { val title = String.format( - activity.getString(com.simplemobiletools.commons.R.string.file_already_exists_overwrite), + activity.getString(org.fossify.commons.R.string.file_already_exists_overwrite), newPath.getFilenameFromPath() ) ConfirmationDialog(activity, title) { diff --git a/app/src/main/kotlin/com/simplemobiletools/gallery/pro/dialogs/FilterMediaDialog.kt b/app/src/main/kotlin/org/fossify/gallery/dialogs/FilterMediaDialog.kt similarity index 71% rename from app/src/main/kotlin/com/simplemobiletools/gallery/pro/dialogs/FilterMediaDialog.kt rename to app/src/main/kotlin/org/fossify/gallery/dialogs/FilterMediaDialog.kt index 0d41f03ba..a784d4f8a 100644 --- a/app/src/main/kotlin/com/simplemobiletools/gallery/pro/dialogs/FilterMediaDialog.kt +++ b/app/src/main/kotlin/org/fossify/gallery/dialogs/FilterMediaDialog.kt @@ -1,12 +1,12 @@ -package com.simplemobiletools.gallery.pro.dialogs +package org.fossify.gallery.dialogs -import com.simplemobiletools.commons.activities.BaseSimpleActivity -import com.simplemobiletools.commons.extensions.getAlertDialogBuilder -import com.simplemobiletools.commons.extensions.setupDialogStuff -import com.simplemobiletools.gallery.pro.R -import com.simplemobiletools.gallery.pro.databinding.DialogFilterMediaBinding -import com.simplemobiletools.gallery.pro.extensions.config -import com.simplemobiletools.gallery.pro.helpers.* +import org.fossify.commons.activities.BaseSimpleActivity +import org.fossify.commons.extensions.getAlertDialogBuilder +import org.fossify.commons.extensions.setupDialogStuff +import org.fossify.gallery.R +import org.fossify.gallery.databinding.DialogFilterMediaBinding +import org.fossify.gallery.extensions.config +import org.fossify.gallery.helpers.* class FilterMediaDialog(val activity: BaseSimpleActivity, val callback: (result: Int) -> Unit) { private val binding = DialogFilterMediaBinding.inflate(activity.layoutInflater) @@ -23,8 +23,8 @@ class FilterMediaDialog(val activity: BaseSimpleActivity, val callback: (result: } activity.getAlertDialogBuilder() - .setPositiveButton(com.simplemobiletools.commons.R.string.ok) { dialog, which -> dialogConfirmed() } - .setNegativeButton(com.simplemobiletools.commons.R.string.cancel, null) + .setPositiveButton(org.fossify.commons.R.string.ok) { dialog, which -> dialogConfirmed() } + .setNegativeButton(org.fossify.commons.R.string.cancel, null) .apply { activity.setupDialogStuff(binding.root, this, R.string.filter_media) } diff --git a/app/src/main/kotlin/org/fossify/gallery/dialogs/GrantAllFilesDialog.kt b/app/src/main/kotlin/org/fossify/gallery/dialogs/GrantAllFilesDialog.kt new file mode 100644 index 000000000..617bc0e04 --- /dev/null +++ b/app/src/main/kotlin/org/fossify/gallery/dialogs/GrantAllFilesDialog.kt @@ -0,0 +1,23 @@ +package org.fossify.gallery.dialogs + +import org.fossify.commons.activities.BaseSimpleActivity +import org.fossify.commons.extensions.applyColorFilter +import org.fossify.commons.extensions.getAlertDialogBuilder +import org.fossify.commons.extensions.getProperTextColor +import org.fossify.commons.extensions.setupDialogStuff +import org.fossify.gallery.databinding.DialogGrantAllFilesBinding +import org.fossify.gallery.extensions.launchGrantAllFilesIntent + +class GrantAllFilesDialog(val activity: BaseSimpleActivity) { + init { + val binding = DialogGrantAllFilesBinding.inflate(activity.layoutInflater) + binding.grantAllFilesImage.applyColorFilter(activity.getProperTextColor()) + + activity.getAlertDialogBuilder() + .setPositiveButton(org.fossify.commons.R.string.ok) { dialog, which -> activity.launchGrantAllFilesIntent() } + .setNegativeButton(org.fossify.commons.R.string.cancel, null) + .apply { + activity.setupDialogStuff(binding.root, this) { alertDialog -> } + } + } +} diff --git a/app/src/main/kotlin/com/simplemobiletools/gallery/pro/dialogs/ManageBottomActionsDialog.kt b/app/src/main/kotlin/org/fossify/gallery/dialogs/ManageBottomActionsDialog.kt similarity index 84% rename from app/src/main/kotlin/com/simplemobiletools/gallery/pro/dialogs/ManageBottomActionsDialog.kt rename to app/src/main/kotlin/org/fossify/gallery/dialogs/ManageBottomActionsDialog.kt index b627aa9d2..2a9c76152 100644 --- a/app/src/main/kotlin/com/simplemobiletools/gallery/pro/dialogs/ManageBottomActionsDialog.kt +++ b/app/src/main/kotlin/org/fossify/gallery/dialogs/ManageBottomActionsDialog.kt @@ -1,11 +1,11 @@ -package com.simplemobiletools.gallery.pro.dialogs +package org.fossify.gallery.dialogs -import com.simplemobiletools.commons.activities.BaseSimpleActivity -import com.simplemobiletools.commons.extensions.getAlertDialogBuilder -import com.simplemobiletools.commons.extensions.setupDialogStuff -import com.simplemobiletools.gallery.pro.databinding.DialogManageBottomActionsBinding -import com.simplemobiletools.gallery.pro.extensions.config -import com.simplemobiletools.gallery.pro.helpers.* +import org.fossify.commons.activities.BaseSimpleActivity +import org.fossify.commons.extensions.getAlertDialogBuilder +import org.fossify.commons.extensions.setupDialogStuff +import org.fossify.gallery.databinding.DialogManageBottomActionsBinding +import org.fossify.gallery.extensions.config +import org.fossify.gallery.helpers.* class ManageBottomActionsDialog(val activity: BaseSimpleActivity, val callback: (result: Int) -> Unit) { private val binding = DialogManageBottomActionsBinding.inflate(activity.layoutInflater) @@ -31,8 +31,8 @@ class ManageBottomActionsDialog(val activity: BaseSimpleActivity, val callback: } activity.getAlertDialogBuilder() - .setPositiveButton(com.simplemobiletools.commons.R.string.ok) { dialog, which -> dialogConfirmed() } - .setNegativeButton(com.simplemobiletools.commons.R.string.cancel, null) + .setPositiveButton(org.fossify.commons.R.string.ok) { dialog, which -> dialogConfirmed() } + .setNegativeButton(org.fossify.commons.R.string.cancel, null) .apply { activity.setupDialogStuff(binding.root, this) } diff --git a/app/src/main/kotlin/com/simplemobiletools/gallery/pro/dialogs/ManageExtendedDetailsDialog.kt b/app/src/main/kotlin/org/fossify/gallery/dialogs/ManageExtendedDetailsDialog.kt similarity index 77% rename from app/src/main/kotlin/com/simplemobiletools/gallery/pro/dialogs/ManageExtendedDetailsDialog.kt rename to app/src/main/kotlin/org/fossify/gallery/dialogs/ManageExtendedDetailsDialog.kt index 5dcbc0ab0..a3cc79249 100644 --- a/app/src/main/kotlin/com/simplemobiletools/gallery/pro/dialogs/ManageExtendedDetailsDialog.kt +++ b/app/src/main/kotlin/org/fossify/gallery/dialogs/ManageExtendedDetailsDialog.kt @@ -1,11 +1,11 @@ -package com.simplemobiletools.gallery.pro.dialogs +package org.fossify.gallery.dialogs -import com.simplemobiletools.commons.activities.BaseSimpleActivity -import com.simplemobiletools.commons.extensions.getAlertDialogBuilder -import com.simplemobiletools.commons.extensions.setupDialogStuff -import com.simplemobiletools.gallery.pro.databinding.DialogManageExtendedDetailsBinding -import com.simplemobiletools.gallery.pro.extensions.config -import com.simplemobiletools.gallery.pro.helpers.* +import org.fossify.commons.activities.BaseSimpleActivity +import org.fossify.commons.extensions.getAlertDialogBuilder +import org.fossify.commons.extensions.setupDialogStuff +import org.fossify.gallery.databinding.DialogManageExtendedDetailsBinding +import org.fossify.gallery.extensions.config +import org.fossify.gallery.helpers.* class ManageExtendedDetailsDialog(val activity: BaseSimpleActivity, val callback: (result: Int) -> Unit) { private val binding = DialogManageExtendedDetailsBinding.inflate(activity.layoutInflater) @@ -25,8 +25,8 @@ class ManageExtendedDetailsDialog(val activity: BaseSimpleActivity, val callback } activity.getAlertDialogBuilder() - .setPositiveButton(com.simplemobiletools.commons.R.string.ok) { dialog, which -> dialogConfirmed() } - .setNegativeButton(com.simplemobiletools.commons.R.string.cancel, null) + .setPositiveButton(org.fossify.commons.R.string.ok) { dialog, which -> dialogConfirmed() } + .setNegativeButton(org.fossify.commons.R.string.cancel, null) .apply { activity.setupDialogStuff(binding.root, this) } diff --git a/app/src/main/kotlin/com/simplemobiletools/gallery/pro/dialogs/OtherAspectRatioDialog.kt b/app/src/main/kotlin/org/fossify/gallery/dialogs/OtherAspectRatioDialog.kt similarity index 88% rename from app/src/main/kotlin/com/simplemobiletools/gallery/pro/dialogs/OtherAspectRatioDialog.kt rename to app/src/main/kotlin/org/fossify/gallery/dialogs/OtherAspectRatioDialog.kt index 2d7649303..005fb184d 100644 --- a/app/src/main/kotlin/com/simplemobiletools/gallery/pro/dialogs/OtherAspectRatioDialog.kt +++ b/app/src/main/kotlin/org/fossify/gallery/dialogs/OtherAspectRatioDialog.kt @@ -1,10 +1,10 @@ -package com.simplemobiletools.gallery.pro.dialogs +package org.fossify.gallery.dialogs import androidx.appcompat.app.AlertDialog -import com.simplemobiletools.commons.activities.BaseSimpleActivity -import com.simplemobiletools.commons.extensions.getAlertDialogBuilder -import com.simplemobiletools.commons.extensions.setupDialogStuff -import com.simplemobiletools.gallery.pro.databinding.DialogOtherAspectRatioBinding +import org.fossify.commons.activities.BaseSimpleActivity +import org.fossify.commons.extensions.getAlertDialogBuilder +import org.fossify.commons.extensions.setupDialogStuff +import org.fossify.gallery.databinding.DialogOtherAspectRatioBinding class OtherAspectRatioDialog( val activity: BaseSimpleActivity, @@ -58,7 +58,7 @@ class OtherAspectRatioDialog( } activity.getAlertDialogBuilder() - .setNegativeButton(com.simplemobiletools.commons.R.string.cancel, null) + .setNegativeButton(org.fossify.commons.R.string.cancel, null) .apply { activity.setupDialogStuff(binding.root, this) { alertDialog -> dialog = alertDialog diff --git a/app/src/main/kotlin/com/simplemobiletools/gallery/pro/dialogs/PickDirectoryDialog.kt b/app/src/main/kotlin/org/fossify/gallery/dialogs/PickDirectoryDialog.kt similarity index 84% rename from app/src/main/kotlin/com/simplemobiletools/gallery/pro/dialogs/PickDirectoryDialog.kt rename to app/src/main/kotlin/org/fossify/gallery/dialogs/PickDirectoryDialog.kt index 53c8251c5..9a5f54dad 100644 --- a/app/src/main/kotlin/com/simplemobiletools/gallery/pro/dialogs/PickDirectoryDialog.kt +++ b/app/src/main/kotlin/org/fossify/gallery/dialogs/PickDirectoryDialog.kt @@ -1,4 +1,4 @@ -package com.simplemobiletools.gallery.pro.dialogs +package org.fossify.gallery.dialogs import android.graphics.Color import android.view.KeyEvent @@ -6,17 +6,17 @@ import android.view.inputmethod.EditorInfo import android.widget.Toast import androidx.appcompat.app.AlertDialog import androidx.recyclerview.widget.RecyclerView -import com.simplemobiletools.commons.activities.BaseSimpleActivity -import com.simplemobiletools.commons.dialogs.FilePickerDialog -import com.simplemobiletools.commons.extensions.* -import com.simplemobiletools.commons.helpers.VIEW_TYPE_GRID -import com.simplemobiletools.commons.views.MyGridLayoutManager -import com.simplemobiletools.commons.views.MySearchMenu -import com.simplemobiletools.gallery.pro.R -import com.simplemobiletools.gallery.pro.adapters.DirectoryAdapter -import com.simplemobiletools.gallery.pro.databinding.DialogDirectoryPickerBinding -import com.simplemobiletools.gallery.pro.extensions.* -import com.simplemobiletools.gallery.pro.models.Directory +import org.fossify.commons.activities.BaseSimpleActivity +import org.fossify.commons.dialogs.FilePickerDialog +import org.fossify.commons.extensions.* +import org.fossify.commons.helpers.VIEW_TYPE_GRID +import org.fossify.commons.views.MyGridLayoutManager +import org.fossify.commons.views.MySearchMenu +import org.fossify.gallery.R +import org.fossify.gallery.adapters.DirectoryAdapter +import org.fossify.gallery.databinding.DialogDirectoryPickerBinding +import org.fossify.gallery.extensions.* +import org.fossify.gallery.models.Directory class PickDirectoryDialog( val activity: BaseSimpleActivity, @@ -51,8 +51,8 @@ class PickDirectoryDialog( configureSearchView() val builder = activity.getAlertDialogBuilder() - .setPositiveButton(com.simplemobiletools.commons.R.string.ok, null) - .setNegativeButton(com.simplemobiletools.commons.R.string.cancel, null) + .setPositiveButton(org.fossify.commons.R.string.ok, null) + .setNegativeButton(org.fossify.commons.R.string.cancel, null) .setOnKeyListener { dialogInterface, i, keyEvent -> if (keyEvent.action == KeyEvent.ACTION_UP && i == KeyEvent.KEYCODE_BACK) { backPressed() @@ -65,7 +65,7 @@ class PickDirectoryDialog( } builder.apply { - activity.setupDialogStuff(binding.root, this, com.simplemobiletools.commons.R.string.select_destination) { alertDialog -> + activity.setupDialogStuff(binding.root, this, org.fossify.commons.R.string.select_destination) { alertDialog -> dialog = alertDialog binding.directoriesShowHidden.beVisibleIf(!context.config.shouldShowHidden) binding.directoriesShowHidden.setOnClickListener { @@ -82,7 +82,7 @@ class PickDirectoryDialog( } private fun configureSearchView() = with(searchView) { - updateHintText(context.getString(com.simplemobiletools.commons.R.string.search_folders)) + updateHintText(context.getString(org.fossify.commons.R.string.search_folders)) searchEditText.imeOptions = EditorInfo.IME_ACTION_DONE toggleHideOnScroll(!config.scrollHorizontally) @@ -100,13 +100,13 @@ class PickDirectoryDialog( private fun MySearchMenu.setSearchViewListeners() { onSearchOpenListener = { - updateSearchViewLeftIcon(com.simplemobiletools.commons.R.drawable.ic_cross_vector) + updateSearchViewLeftIcon(org.fossify.commons.R.drawable.ic_cross_vector) } onSearchClosedListener = { searchEditText.clearFocus() activity.hideKeyboard(searchEditText) - updateSearchViewLeftIcon(com.simplemobiletools.commons.R.drawable.ic_search_vector) + updateSearchViewLeftIcon(org.fossify.commons.R.drawable.ic_search_vector) } onSearchTextChangedListener = { text -> @@ -145,7 +145,7 @@ class PickDirectoryDialog( directoriesEmptyPlaceholder.beVisibleIf(dirs.isEmpty()) if (folderSearchView.isSearchOpen) { - directoriesEmptyPlaceholder.text = root.context.getString(com.simplemobiletools.commons.R.string.no_items_found) + directoriesEmptyPlaceholder.text = root.context.getString(org.fossify.commons.R.string.no_items_found) } directoriesFastscroller.beVisibleIf(directoriesEmptyPlaceholder.isGone()) @@ -203,10 +203,10 @@ class PickDirectoryDialog( val path = clickedDir.path if (clickedDir.subfoldersCount == 1 || !activity.config.groupDirectSubfolders) { if (isPickingCopyMoveDestination && path.trimEnd('/') == sourcePath) { - activity.toast(com.simplemobiletools.commons.R.string.source_and_destination_same) + activity.toast(org.fossify.commons.R.string.source_and_destination_same) return@DirectoryAdapter } else if (isPickingCopyMoveDestination && activity.isRestrictedWithSAFSdk30(path) && !activity.isInDownloadDir(path)) { - activity.toast(com.simplemobiletools.commons.R.string.system_folder_copy_restriction, Toast.LENGTH_LONG) + activity.toast(org.fossify.commons.R.string.system_folder_copy_restriction, Toast.LENGTH_LONG) return@DirectoryAdapter } else { activity.handleLockedFolderOpening(path) { success -> diff --git a/app/src/main/kotlin/com/simplemobiletools/gallery/pro/dialogs/PickMediumDialog.kt b/app/src/main/kotlin/org/fossify/gallery/dialogs/PickMediumDialog.kt similarity index 71% rename from app/src/main/kotlin/com/simplemobiletools/gallery/pro/dialogs/PickMediumDialog.kt rename to app/src/main/kotlin/org/fossify/gallery/dialogs/PickMediumDialog.kt index 5c8e14f98..4f110a180 100644 --- a/app/src/main/kotlin/com/simplemobiletools/gallery/pro/dialogs/PickMediumDialog.kt +++ b/app/src/main/kotlin/org/fossify/gallery/dialogs/PickMediumDialog.kt @@ -1,24 +1,24 @@ -package com.simplemobiletools.gallery.pro.dialogs +package org.fossify.gallery.dialogs import androidx.appcompat.app.AlertDialog import androidx.recyclerview.widget.RecyclerView -import com.simplemobiletools.commons.activities.BaseSimpleActivity -import com.simplemobiletools.commons.extensions.getAlertDialogBuilder -import com.simplemobiletools.commons.extensions.getProperPrimaryColor -import com.simplemobiletools.commons.extensions.setupDialogStuff -import com.simplemobiletools.commons.helpers.VIEW_TYPE_GRID -import com.simplemobiletools.commons.views.MyGridLayoutManager -import com.simplemobiletools.gallery.pro.R -import com.simplemobiletools.gallery.pro.adapters.MediaAdapter -import com.simplemobiletools.gallery.pro.asynctasks.GetMediaAsynctask -import com.simplemobiletools.gallery.pro.databinding.DialogMediumPickerBinding -import com.simplemobiletools.gallery.pro.extensions.config -import com.simplemobiletools.gallery.pro.extensions.getCachedMedia -import com.simplemobiletools.gallery.pro.helpers.GridSpacingItemDecoration -import com.simplemobiletools.gallery.pro.helpers.SHOW_ALL -import com.simplemobiletools.gallery.pro.models.Medium -import com.simplemobiletools.gallery.pro.models.ThumbnailItem -import com.simplemobiletools.gallery.pro.models.ThumbnailSection +import org.fossify.commons.activities.BaseSimpleActivity +import org.fossify.commons.extensions.getAlertDialogBuilder +import org.fossify.commons.extensions.getProperPrimaryColor +import org.fossify.commons.extensions.setupDialogStuff +import org.fossify.commons.helpers.VIEW_TYPE_GRID +import org.fossify.commons.views.MyGridLayoutManager +import org.fossify.gallery.R +import org.fossify.gallery.adapters.MediaAdapter +import org.fossify.gallery.asynctasks.GetMediaAsynctask +import org.fossify.gallery.databinding.DialogMediumPickerBinding +import org.fossify.gallery.extensions.config +import org.fossify.gallery.extensions.getCachedMedia +import org.fossify.gallery.helpers.GridSpacingItemDecoration +import org.fossify.gallery.helpers.SHOW_ALL +import org.fossify.gallery.models.Medium +import org.fossify.gallery.models.ThumbnailItem +import org.fossify.gallery.models.ThumbnailSection class PickMediumDialog(val activity: BaseSimpleActivity, val path: String, val callback: (path: String) -> Unit) { private var dialog: AlertDialog? = null @@ -37,11 +37,11 @@ class PickMediumDialog(val activity: BaseSimpleActivity, val path: String, val c binding.mediaFastscroller.updateColors(activity.getProperPrimaryColor()) activity.getAlertDialogBuilder() - .setPositiveButton(com.simplemobiletools.commons.R.string.ok, null) - .setNegativeButton(com.simplemobiletools.commons.R.string.cancel, null) + .setPositiveButton(org.fossify.commons.R.string.ok, null) + .setNegativeButton(org.fossify.commons.R.string.cancel, null) .setNeutralButton(R.string.other_folder) { dialogInterface, i -> showOtherFolder() } .apply { - activity.setupDialogStuff(binding.root, this, com.simplemobiletools.commons.R.string.select_photo) { alertDialog -> + activity.setupDialogStuff(binding.root, this, org.fossify.commons.R.string.select_photo) { alertDialog -> dialog = alertDialog } } diff --git a/app/src/main/kotlin/com/simplemobiletools/gallery/pro/dialogs/ResizeDialog.kt b/app/src/main/kotlin/org/fossify/gallery/dialogs/ResizeDialog.kt similarity index 84% rename from app/src/main/kotlin/com/simplemobiletools/gallery/pro/dialogs/ResizeDialog.kt rename to app/src/main/kotlin/org/fossify/gallery/dialogs/ResizeDialog.kt index 034104e0a..f8db80770 100644 --- a/app/src/main/kotlin/com/simplemobiletools/gallery/pro/dialogs/ResizeDialog.kt +++ b/app/src/main/kotlin/org/fossify/gallery/dialogs/ResizeDialog.kt @@ -1,12 +1,12 @@ -package com.simplemobiletools.gallery.pro.dialogs +package org.fossify.gallery.dialogs import android.graphics.Point import android.widget.EditText import androidx.appcompat.app.AlertDialog -import com.simplemobiletools.commons.activities.BaseSimpleActivity -import com.simplemobiletools.commons.extensions.* -import com.simplemobiletools.gallery.pro.R -import com.simplemobiletools.gallery.pro.databinding.DialogResizeImageBinding +import org.fossify.commons.activities.BaseSimpleActivity +import org.fossify.commons.extensions.* +import org.fossify.gallery.R +import org.fossify.gallery.databinding.DialogResizeImageBinding class ResizeDialog(val activity: BaseSimpleActivity, val size: Point, val callback: (newSize: Point) -> Unit) { init { @@ -48,8 +48,8 @@ class ResizeDialog(val activity: BaseSimpleActivity, val size: Point, val callba } activity.getAlertDialogBuilder() - .setPositiveButton(com.simplemobiletools.commons.R.string.ok, null) - .setNegativeButton(com.simplemobiletools.commons.R.string.cancel, null) + .setPositiveButton(org.fossify.commons.R.string.ok, null) + .setNegativeButton(org.fossify.commons.R.string.cancel, null) .apply { activity.setupDialogStuff(binding.root, this, R.string.resize_and_save) { alertDialog -> alertDialog.showKeyboard(binding.resizeImageWidth) diff --git a/app/src/main/kotlin/com/simplemobiletools/gallery/pro/dialogs/ResizeMultipleImagesDialog.kt b/app/src/main/kotlin/org/fossify/gallery/dialogs/ResizeMultipleImagesDialog.kt similarity index 83% rename from app/src/main/kotlin/com/simplemobiletools/gallery/pro/dialogs/ResizeMultipleImagesDialog.kt rename to app/src/main/kotlin/org/fossify/gallery/dialogs/ResizeMultipleImagesDialog.kt index 341968fbc..e8a1d205b 100644 --- a/app/src/main/kotlin/com/simplemobiletools/gallery/pro/dialogs/ResizeMultipleImagesDialog.kt +++ b/app/src/main/kotlin/org/fossify/gallery/dialogs/ResizeMultipleImagesDialog.kt @@ -1,15 +1,15 @@ -package com.simplemobiletools.gallery.pro.dialogs +package org.fossify.gallery.dialogs import android.graphics.Point import androidx.appcompat.app.AlertDialog -import com.simplemobiletools.commons.activities.BaseSimpleActivity -import com.simplemobiletools.commons.extensions.* -import com.simplemobiletools.commons.helpers.ensureBackgroundThread -import com.simplemobiletools.gallery.pro.R -import com.simplemobiletools.gallery.pro.databinding.DialogResizeMultipleImagesBinding -import com.simplemobiletools.gallery.pro.extensions.ensureWriteAccess -import com.simplemobiletools.gallery.pro.extensions.rescanPathsAndUpdateLastModified -import com.simplemobiletools.gallery.pro.extensions.resizeImage +import org.fossify.commons.activities.BaseSimpleActivity +import org.fossify.commons.extensions.* +import org.fossify.commons.helpers.ensureBackgroundThread +import org.fossify.gallery.R +import org.fossify.gallery.databinding.DialogResizeMultipleImagesBinding +import org.fossify.gallery.extensions.ensureWriteAccess +import org.fossify.gallery.extensions.rescanPathsAndUpdateLastModified +import org.fossify.gallery.extensions.resizeImage import java.io.File import kotlin.math.roundToInt @@ -35,8 +35,8 @@ class ResizeMultipleImagesDialog( } activity.getAlertDialogBuilder() - .setPositiveButton(com.simplemobiletools.commons.R.string.ok, null) - .setNegativeButton(com.simplemobiletools.commons.R.string.cancel, null) + .setPositiveButton(org.fossify.commons.R.string.ok, null) + .setNegativeButton(org.fossify.commons.R.string.cancel, null) .apply { activity.setupDialogStuff(binding.root, this, R.string.resize_multiple_images) { alertDialog -> dialog = alertDialog @@ -95,7 +95,7 @@ class ResizeMultipleImagesDialog( } } } catch (e: OutOfMemoryError) { - toast(com.simplemobiletools.commons.R.string.out_of_memory_error) + toast(org.fossify.commons.R.string.out_of_memory_error) } catch (e: Exception) { showErrorToast(e) } diff --git a/app/src/main/kotlin/com/simplemobiletools/gallery/pro/dialogs/ResizeWithPathDialog.kt b/app/src/main/kotlin/org/fossify/gallery/dialogs/ResizeWithPathDialog.kt similarity index 80% rename from app/src/main/kotlin/com/simplemobiletools/gallery/pro/dialogs/ResizeWithPathDialog.kt rename to app/src/main/kotlin/org/fossify/gallery/dialogs/ResizeWithPathDialog.kt index ce402bcb7..615a68a59 100644 --- a/app/src/main/kotlin/com/simplemobiletools/gallery/pro/dialogs/ResizeWithPathDialog.kt +++ b/app/src/main/kotlin/org/fossify/gallery/dialogs/ResizeWithPathDialog.kt @@ -1,15 +1,15 @@ -package com.simplemobiletools.gallery.pro.dialogs +package org.fossify.gallery.dialogs import android.graphics.Point import android.widget.EditText import androidx.appcompat.app.AlertDialog -import com.simplemobiletools.commons.activities.BaseSimpleActivity -import com.simplemobiletools.commons.dialogs.ConfirmationDialog -import com.simplemobiletools.commons.dialogs.FilePickerDialog -import com.simplemobiletools.commons.extensions.* -import com.simplemobiletools.gallery.pro.R -import com.simplemobiletools.gallery.pro.databinding.DialogResizeImageWithPathBinding -import com.simplemobiletools.gallery.pro.extensions.config +import org.fossify.commons.activities.BaseSimpleActivity +import org.fossify.commons.dialogs.ConfirmationDialog +import org.fossify.commons.dialogs.FilePickerDialog +import org.fossify.commons.extensions.* +import org.fossify.gallery.R +import org.fossify.gallery.databinding.DialogResizeImageWithPathBinding +import org.fossify.gallery.extensions.config class ResizeWithPathDialog(val activity: BaseSimpleActivity, val size: Point, val path: String, val callback: (newSize: Point, newPath: String) -> Unit) { init { @@ -69,8 +69,8 @@ class ResizeWithPathDialog(val activity: BaseSimpleActivity, val size: Point, va } activity.getAlertDialogBuilder() - .setPositiveButton(com.simplemobiletools.commons.R.string.ok, null) - .setNegativeButton(com.simplemobiletools.commons.R.string.cancel, null) + .setPositiveButton(org.fossify.commons.R.string.ok, null) + .setNegativeButton(org.fossify.commons.R.string.cancel, null) .apply { activity.setupDialogStuff(binding.root, this) { alertDialog -> alertDialog.showKeyboard(binding.resizeImageWidth) @@ -87,24 +87,24 @@ class ResizeWithPathDialog(val activity: BaseSimpleActivity, val size: Point, va val filename = binding.filenameValue.value val extension = binding.extensionValue.value if (filename.isEmpty()) { - activity.toast(com.simplemobiletools.commons.R.string.filename_cannot_be_empty) + activity.toast(org.fossify.commons.R.string.filename_cannot_be_empty) return@setOnClickListener } if (extension.isEmpty()) { - activity.toast(com.simplemobiletools.commons.R.string.extension_cannot_be_empty) + activity.toast(org.fossify.commons.R.string.extension_cannot_be_empty) return@setOnClickListener } val newFilename = "$filename.$extension" val newPath = "${realPath.trimEnd('/')}/$newFilename" if (!newFilename.isAValidFilename()) { - activity.toast(com.simplemobiletools.commons.R.string.filename_invalid_characters) + activity.toast(org.fossify.commons.R.string.filename_invalid_characters) return@setOnClickListener } if (activity.getDoesFilePathExist(newPath)) { - val title = String.format(activity.getString(com.simplemobiletools.commons.R.string.file_already_exists_overwrite), newFilename) + val title = String.format(activity.getString(org.fossify.commons.R.string.file_already_exists_overwrite), newFilename) ConfirmationDialog(activity, title) { callback(newSize, newPath) alertDialog.dismiss() diff --git a/app/src/main/kotlin/com/simplemobiletools/gallery/pro/dialogs/SaveAsDialog.kt b/app/src/main/kotlin/org/fossify/gallery/dialogs/SaveAsDialog.kt similarity index 76% rename from app/src/main/kotlin/com/simplemobiletools/gallery/pro/dialogs/SaveAsDialog.kt rename to app/src/main/kotlin/org/fossify/gallery/dialogs/SaveAsDialog.kt index ccd170e95..254394ea0 100644 --- a/app/src/main/kotlin/com/simplemobiletools/gallery/pro/dialogs/SaveAsDialog.kt +++ b/app/src/main/kotlin/org/fossify/gallery/dialogs/SaveAsDialog.kt @@ -1,12 +1,12 @@ -package com.simplemobiletools.gallery.pro.dialogs +package org.fossify.gallery.dialogs import androidx.appcompat.app.AlertDialog -import com.simplemobiletools.commons.activities.BaseSimpleActivity -import com.simplemobiletools.commons.dialogs.ConfirmationDialog -import com.simplemobiletools.commons.dialogs.FilePickerDialog -import com.simplemobiletools.commons.extensions.* -import com.simplemobiletools.commons.helpers.isRPlus -import com.simplemobiletools.gallery.pro.databinding.DialogSaveAsBinding +import org.fossify.commons.activities.BaseSimpleActivity +import org.fossify.commons.dialogs.ConfirmationDialog +import org.fossify.commons.dialogs.FilePickerDialog +import org.fossify.commons.extensions.* +import org.fossify.commons.helpers.isRPlus +import org.fossify.gallery.databinding.DialogSaveAsBinding import java.io.File class SaveAsDialog( @@ -47,35 +47,35 @@ class SaveAsDialog( } activity.getAlertDialogBuilder() - .setPositiveButton(com.simplemobiletools.commons.R.string.ok, null) - .setNegativeButton(com.simplemobiletools.commons.R.string.cancel) { dialog, which -> cancelCallback?.invoke() } + .setPositiveButton(org.fossify.commons.R.string.ok, null) + .setNegativeButton(org.fossify.commons.R.string.cancel) { dialog, which -> cancelCallback?.invoke() } .setOnCancelListener { cancelCallback?.invoke() } .apply { - activity.setupDialogStuff(binding.root, this, com.simplemobiletools.commons.R.string.save_as) { alertDialog -> + activity.setupDialogStuff(binding.root, this, org.fossify.commons.R.string.save_as) { alertDialog -> alertDialog.showKeyboard(binding.filenameValue) alertDialog.getButton(AlertDialog.BUTTON_POSITIVE).setOnClickListener { val filename = binding.filenameValue.value val extension = binding.extensionValue.value if (filename.isEmpty()) { - activity.toast(com.simplemobiletools.commons.R.string.filename_cannot_be_empty) + activity.toast(org.fossify.commons.R.string.filename_cannot_be_empty) return@setOnClickListener } if (extension.isEmpty()) { - activity.toast(com.simplemobiletools.commons.R.string.extension_cannot_be_empty) + activity.toast(org.fossify.commons.R.string.extension_cannot_be_empty) return@setOnClickListener } val newFilename = "$filename.$extension" val newPath = "${realPath.trimEnd('/')}/$newFilename" if (!newFilename.isAValidFilename()) { - activity.toast(com.simplemobiletools.commons.R.string.filename_invalid_characters) + activity.toast(org.fossify.commons.R.string.filename_invalid_characters) return@setOnClickListener } if (activity.getDoesFilePathExist(newPath)) { - val title = String.format(activity.getString(com.simplemobiletools.commons.R.string.file_already_exists_overwrite), newFilename) + val title = String.format(activity.getString(org.fossify.commons.R.string.file_already_exists_overwrite), newFilename) ConfirmationDialog(activity, title) { if ((isRPlus() && !isExternalStorageManager())) { val fileDirItem = arrayListOf(File(newPath).toFileDirItem(activity)) diff --git a/app/src/main/kotlin/com/simplemobiletools/gallery/pro/dialogs/SlideshowDialog.kt b/app/src/main/kotlin/org/fossify/gallery/dialogs/SlideshowDialog.kt similarity index 77% rename from app/src/main/kotlin/com/simplemobiletools/gallery/pro/dialogs/SlideshowDialog.kt rename to app/src/main/kotlin/org/fossify/gallery/dialogs/SlideshowDialog.kt index 648ea26e7..3bfc23d92 100644 --- a/app/src/main/kotlin/com/simplemobiletools/gallery/pro/dialogs/SlideshowDialog.kt +++ b/app/src/main/kotlin/org/fossify/gallery/dialogs/SlideshowDialog.kt @@ -1,27 +1,27 @@ -package com.simplemobiletools.gallery.pro.dialogs +package org.fossify.gallery.dialogs import androidx.appcompat.app.AlertDialog -import com.simplemobiletools.commons.activities.BaseSimpleActivity -import com.simplemobiletools.commons.dialogs.RadioGroupDialog -import com.simplemobiletools.commons.extensions.getAlertDialogBuilder -import com.simplemobiletools.commons.extensions.hideKeyboard -import com.simplemobiletools.commons.extensions.setupDialogStuff -import com.simplemobiletools.commons.extensions.value -import com.simplemobiletools.commons.models.RadioItem -import com.simplemobiletools.gallery.pro.R -import com.simplemobiletools.gallery.pro.databinding.DialogSlideshowBinding -import com.simplemobiletools.gallery.pro.extensions.config -import com.simplemobiletools.gallery.pro.helpers.SLIDESHOW_ANIMATION_FADE -import com.simplemobiletools.gallery.pro.helpers.SLIDESHOW_ANIMATION_NONE -import com.simplemobiletools.gallery.pro.helpers.SLIDESHOW_ANIMATION_SLIDE -import com.simplemobiletools.gallery.pro.helpers.SLIDESHOW_DEFAULT_INTERVAL +import org.fossify.commons.activities.BaseSimpleActivity +import org.fossify.commons.dialogs.RadioGroupDialog +import org.fossify.commons.extensions.getAlertDialogBuilder +import org.fossify.commons.extensions.hideKeyboard +import org.fossify.commons.extensions.setupDialogStuff +import org.fossify.commons.extensions.value +import org.fossify.commons.models.RadioItem +import org.fossify.gallery.R +import org.fossify.gallery.databinding.DialogSlideshowBinding +import org.fossify.gallery.extensions.config +import org.fossify.gallery.helpers.SLIDESHOW_ANIMATION_FADE +import org.fossify.gallery.helpers.SLIDESHOW_ANIMATION_NONE +import org.fossify.gallery.helpers.SLIDESHOW_ANIMATION_SLIDE +import org.fossify.gallery.helpers.SLIDESHOW_DEFAULT_INTERVAL class SlideshowDialog(val activity: BaseSimpleActivity, val callback: () -> Unit) { private val binding: DialogSlideshowBinding init { binding = DialogSlideshowBinding.inflate(activity.layoutInflater).apply { - intervalHint.hint = activity.getString(com.simplemobiletools.commons.R.string.seconds_raw).replaceFirstChar { it.uppercaseChar() } + intervalHint.hint = activity.getString(org.fossify.commons.R.string.seconds_raw).replaceFirstChar { it.uppercaseChar() } intervalValue.setOnClickListener { intervalValue.selectAll() } @@ -72,8 +72,8 @@ class SlideshowDialog(val activity: BaseSimpleActivity, val callback: () -> Unit setupValues() activity.getAlertDialogBuilder() - .setPositiveButton(com.simplemobiletools.commons.R.string.ok, null) - .setNegativeButton(com.simplemobiletools.commons.R.string.cancel, null) + .setPositiveButton(org.fossify.commons.R.string.ok, null) + .setNegativeButton(org.fossify.commons.R.string.cancel, null) .apply { activity.setupDialogStuff(binding.root, this) { alertDialog -> alertDialog.hideKeyboard() diff --git a/app/src/main/kotlin/com/simplemobiletools/gallery/pro/extensions/Activity.kt b/app/src/main/kotlin/org/fossify/gallery/extensions/Activity.kt similarity index 89% rename from app/src/main/kotlin/com/simplemobiletools/gallery/pro/extensions/Activity.kt rename to app/src/main/kotlin/org/fossify/gallery/extensions/Activity.kt index e0e129c38..3fca51ff7 100644 --- a/app/src/main/kotlin/com/simplemobiletools/gallery/pro/extensions/Activity.kt +++ b/app/src/main/kotlin/org/fossify/gallery/extensions/Activity.kt @@ -1,4 +1,4 @@ -package com.simplemobiletools.gallery.pro.extensions +package org.fossify.gallery.extensions import android.annotation.TargetApi import android.app.Activity @@ -26,29 +26,29 @@ import com.bumptech.glide.Glide import com.bumptech.glide.load.DecodeFormat import com.bumptech.glide.load.engine.DiskCacheStrategy import com.bumptech.glide.request.RequestOptions -import com.simplemobiletools.commons.activities.BaseSimpleActivity -import com.simplemobiletools.commons.dialogs.ConfirmationDialog -import com.simplemobiletools.commons.dialogs.SecurityDialog -import com.simplemobiletools.commons.extensions.* -import com.simplemobiletools.commons.helpers.* -import com.simplemobiletools.commons.models.FAQItem -import com.simplemobiletools.commons.models.FileDirItem -import com.simplemobiletools.gallery.pro.BuildConfig -import com.simplemobiletools.gallery.pro.R -import com.simplemobiletools.gallery.pro.activities.MediaActivity -import com.simplemobiletools.gallery.pro.activities.SettingsActivity -import com.simplemobiletools.gallery.pro.activities.SimpleActivity -import com.simplemobiletools.gallery.pro.dialogs.AllFilesPermissionDialog -import com.simplemobiletools.gallery.pro.dialogs.PickDirectoryDialog -import com.simplemobiletools.gallery.pro.dialogs.ResizeMultipleImagesDialog -import com.simplemobiletools.gallery.pro.dialogs.ResizeWithPathDialog -import com.simplemobiletools.gallery.pro.helpers.DIRECTORY -import com.simplemobiletools.gallery.pro.helpers.RECYCLE_BIN -import com.simplemobiletools.gallery.pro.models.DateTaken import com.squareup.picasso.Picasso +import org.fossify.commons.activities.BaseSimpleActivity +import org.fossify.commons.dialogs.ConfirmationDialog +import org.fossify.commons.dialogs.SecurityDialog +import org.fossify.commons.extensions.* +import org.fossify.commons.helpers.* +import org.fossify.commons.models.FAQItem +import org.fossify.commons.models.FileDirItem +import org.fossify.gallery.BuildConfig +import org.fossify.gallery.R +import org.fossify.gallery.activities.MediaActivity +import org.fossify.gallery.activities.SettingsActivity +import org.fossify.gallery.activities.SimpleActivity +import org.fossify.gallery.dialogs.AllFilesPermissionDialog +import org.fossify.gallery.dialogs.PickDirectoryDialog +import org.fossify.gallery.dialogs.ResizeMultipleImagesDialog +import org.fossify.gallery.dialogs.ResizeWithPathDialog +import org.fossify.gallery.helpers.DIRECTORY +import org.fossify.gallery.helpers.RECYCLE_BIN +import org.fossify.gallery.models.DateTaken import java.io.* import java.text.SimpleDateFormat -import java.util.* +import java.util.Locale fun Activity.sharePath(path: String) { sharePathIntent(path, BuildConfig.APPLICATION_ID) @@ -99,7 +99,7 @@ fun SimpleActivity.launchAbout() { FAQItem(R.string.faq_7_title, R.string.faq_7_text), FAQItem(R.string.faq_14_title, R.string.faq_14_text), FAQItem(R.string.faq_1_title, R.string.faq_1_text), - FAQItem(com.simplemobiletools.commons.R.string.faq_5_title_commons, com.simplemobiletools.commons.R.string.faq_5_text_commons), + FAQItem(org.fossify.commons.R.string.faq_5_title_commons, org.fossify.commons.R.string.faq_5_text_commons), FAQItem(R.string.faq_5_title, R.string.faq_5_text), FAQItem(R.string.faq_4_title, R.string.faq_4_text), FAQItem(R.string.faq_6_title, R.string.faq_6_text), @@ -110,14 +110,14 @@ fun SimpleActivity.launchAbout() { FAQItem(R.string.faq_15_title, R.string.faq_15_text), FAQItem(R.string.faq_2_title, R.string.faq_2_text), FAQItem(R.string.faq_18_title, R.string.faq_18_text), - FAQItem(com.simplemobiletools.commons.R.string.faq_9_title_commons, com.simplemobiletools.commons.R.string.faq_9_text_commons), + FAQItem(org.fossify.commons.R.string.faq_9_title_commons, org.fossify.commons.R.string.faq_9_text_commons), ) - if (!resources.getBoolean(com.simplemobiletools.commons.R.bool.hide_google_relations)) { - faqItems.add(FAQItem(com.simplemobiletools.commons.R.string.faq_2_title_commons, com.simplemobiletools.commons.R.string.faq_2_text_commons)) - faqItems.add(FAQItem(com.simplemobiletools.commons.R.string.faq_6_title_commons, com.simplemobiletools.commons.R.string.faq_6_text_commons)) - faqItems.add(FAQItem(com.simplemobiletools.commons.R.string.faq_7_title_commons, com.simplemobiletools.commons.R.string.faq_7_text_commons)) - faqItems.add(FAQItem(com.simplemobiletools.commons.R.string.faq_10_title_commons, com.simplemobiletools.commons.R.string.faq_10_text_commons)) + if (!resources.getBoolean(org.fossify.commons.R.bool.hide_google_relations)) { + faqItems.add(FAQItem(org.fossify.commons.R.string.faq_2_title_commons, org.fossify.commons.R.string.faq_2_text_commons)) + faqItems.add(FAQItem(org.fossify.commons.R.string.faq_6_title_commons, org.fossify.commons.R.string.faq_6_text_commons)) + faqItems.add(FAQItem(org.fossify.commons.R.string.faq_7_title_commons, org.fossify.commons.R.string.faq_7_text_commons)) + faqItems.add(FAQItem(org.fossify.commons.R.string.faq_10_title_commons, org.fossify.commons.R.string.faq_10_text_commons)) } if (isRPlus() && !isExternalStorageManager()) { @@ -138,7 +138,7 @@ fun BaseSimpleActivity.handleMediaManagementPrompt(callback: () -> Unit) { if (Environment.isExternalStorageManager()) { callback() } else { - var messagePrompt = getString(com.simplemobiletools.commons.R.string.access_storage_prompt) + var messagePrompt = getString(org.fossify.commons.R.string.access_storage_prompt) messagePrompt += if (isSPlus()) { "\n\n${getString(R.string.media_management_alternative)}" } else { @@ -214,7 +214,7 @@ fun BaseSimpleActivity.addNoMedia(path: String, callback: () -> Unit) { addNoMediaIntoMediaStore(file.absolutePath) callback() } else { - toast(com.simplemobiletools.commons.R.string.unknown_error_occurred) + toast(org.fossify.commons.R.string.unknown_error_occurred) callback() } } @@ -225,7 +225,7 @@ fun BaseSimpleActivity.addNoMedia(path: String, callback: () -> Unit) { addNoMediaIntoMediaStore(file.absolutePath) } } else { - toast(com.simplemobiletools.commons.R.string.unknown_error_occurred) + toast(org.fossify.commons.R.string.unknown_error_occurred) } } catch (e: Exception) { showErrorToast(e) @@ -296,7 +296,7 @@ fun BaseSimpleActivity.toggleFileVisibility(oldPath: String, hide: Boolean, call fun BaseSimpleActivity.tryCopyMoveFilesTo(fileDirItems: ArrayList, isCopyOperation: Boolean, callback: (destinationPath: String) -> Unit) { if (fileDirItems.isEmpty()) { - toast(com.simplemobiletools.commons.R.string.unknown_error_occurred) + toast(org.fossify.commons.R.string.unknown_error_occurred) return } @@ -477,10 +477,10 @@ fun BaseSimpleActivity.emptyTheRecycleBin(callback: (() -> Unit)? = null) { recycleBin.deleteRecursively() mediaDB.clearRecycleBin() directoryDB.deleteRecycleBin() - toast(com.simplemobiletools.commons.R.string.recycle_bin_emptied) + toast(org.fossify.commons.R.string.recycle_bin_emptied) callback?.invoke() } catch (e: Exception) { - toast(com.simplemobiletools.commons.R.string.unknown_error_occurred) + toast(org.fossify.commons.R.string.unknown_error_occurred) } } } @@ -498,9 +498,9 @@ fun BaseSimpleActivity.showRecycleBinEmptyingDialog(callback: () -> Unit) { ConfirmationDialog( this, "", - com.simplemobiletools.commons.R.string.empty_recycle_bin_confirmation, - com.simplemobiletools.commons.R.string.yes, - com.simplemobiletools.commons.R.string.no + org.fossify.commons.R.string.empty_recycle_bin_confirmation, + org.fossify.commons.R.string.yes, + org.fossify.commons.R.string.no ) { callback() } @@ -617,7 +617,7 @@ fun AppCompatActivity.fixDateTaken( runOnUiThread { if (showToasts) { - toast(if (didUpdateFile) R.string.dates_fixed_successfully else com.simplemobiletools.commons.R.string.unknown_error_occurred) + toast(if (didUpdateFile) R.string.dates_fixed_successfully else org.fossify.commons.R.string.unknown_error_occurred) } callback?.invoke() @@ -653,7 +653,7 @@ fun BaseSimpleActivity.saveRotatedImageToFile(oldPath: String, newPath: String, getFileOutputStream(tmpFileDirItem) { if (it == null) { if (showToasts) { - toast(com.simplemobiletools.commons.R.string.unknown_error_occurred) + toast(org.fossify.commons.R.string.unknown_error_occurred) } return@getFileOutputStream } @@ -678,7 +678,7 @@ fun BaseSimpleActivity.saveRotatedImageToFile(oldPath: String, newPath: String, } } catch (e: OutOfMemoryError) { if (showToasts) { - toast(com.simplemobiletools.commons.R.string.out_of_memory_error) + toast(org.fossify.commons.R.string.out_of_memory_error) } } catch (e: Exception) { if (showToasts) { @@ -698,7 +698,7 @@ fun Activity.tryRotateByExif(path: String, degrees: Int, showToasts: Boolean, ca fileRotatedSuccessfully(path, oldLastModified) callback.invoke() if (showToasts) { - toast(com.simplemobiletools.commons.R.string.file_saved) + toast(org.fossify.commons.R.string.file_saved) } true } else { @@ -807,7 +807,7 @@ fun BaseSimpleActivity.launchResizeImageDialog(path: String, callback: (() -> Un try { resizeImage(path, newPath, newSize) { success -> if (success) { - toast(com.simplemobiletools.commons.R.string.file_saved) + toast(org.fossify.commons.R.string.file_saved) val paths = arrayListOf(file.absolutePath) rescanPathsAndUpdateLastModified(paths, pathLastModifiedMap) { @@ -820,7 +820,7 @@ fun BaseSimpleActivity.launchResizeImageDialog(path: String, callback: (() -> Un } } } catch (e: OutOfMemoryError) { - toast(com.simplemobiletools.commons.R.string.out_of_memory_error) + toast(org.fossify.commons.R.string.out_of_memory_error) } catch (e: Exception) { showErrorToast(e) } @@ -888,7 +888,7 @@ fun Activity.getShortcutImage(tmb: String, drawable: Drawable, callback: () -> U .diskCacheStrategy(DiskCacheStrategy.NONE) .fitCenter() - val size = resources.getDimension(com.simplemobiletools.commons.R.dimen.shortcut_size).toInt() + val size = resources.getDimension(org.fossify.commons.R.dimen.shortcut_size).toInt() val builder = Glide.with(this) .asDrawable() .load(tmb) diff --git a/app/src/main/kotlin/com/simplemobiletools/gallery/pro/extensions/ArrayList.kt b/app/src/main/kotlin/org/fossify/gallery/extensions/ArrayList.kt similarity index 75% rename from app/src/main/kotlin/com/simplemobiletools/gallery/pro/extensions/ArrayList.kt rename to app/src/main/kotlin/org/fossify/gallery/extensions/ArrayList.kt index 551b47d61..2370bd9b4 100644 --- a/app/src/main/kotlin/com/simplemobiletools/gallery/pro/extensions/ArrayList.kt +++ b/app/src/main/kotlin/org/fossify/gallery/extensions/ArrayList.kt @@ -1,7 +1,7 @@ -package com.simplemobiletools.gallery.pro.extensions +package org.fossify.gallery.extensions -import com.simplemobiletools.gallery.pro.helpers.* -import com.simplemobiletools.gallery.pro.models.Medium +import org.fossify.gallery.helpers.* +import org.fossify.gallery.models.Medium fun ArrayList.getDirMediaTypes(): Int { var types = 0 diff --git a/app/src/main/kotlin/com/simplemobiletools/gallery/pro/extensions/Context.kt b/app/src/main/kotlin/org/fossify/gallery/extensions/Context.kt similarity index 93% rename from app/src/main/kotlin/com/simplemobiletools/gallery/pro/extensions/Context.kt rename to app/src/main/kotlin/org/fossify/gallery/extensions/Context.kt index 2ef92ecfc..94600b0bc 100644 --- a/app/src/main/kotlin/com/simplemobiletools/gallery/pro/extensions/Context.kt +++ b/app/src/main/kotlin/org/fossify/gallery/extensions/Context.kt @@ -1,4 +1,4 @@ -package com.simplemobiletools.gallery.pro.extensions +package org.fossify.gallery.extensions import android.appwidget.AppWidgetManager import android.content.ComponentName @@ -32,21 +32,22 @@ import com.bumptech.glide.request.RequestListener import com.bumptech.glide.request.RequestOptions import com.bumptech.glide.request.target.Target import com.bumptech.glide.signature.ObjectKey -import com.simplemobiletools.commons.extensions.* -import com.simplemobiletools.commons.helpers.* -import com.simplemobiletools.commons.views.MySquareImageView -import com.simplemobiletools.gallery.pro.R -import com.simplemobiletools.gallery.pro.asynctasks.GetMediaAsynctask -import com.simplemobiletools.gallery.pro.databases.GalleryDatabase -import com.simplemobiletools.gallery.pro.helpers.* -import com.simplemobiletools.gallery.pro.interfaces.* -import com.simplemobiletools.gallery.pro.models.* -import com.simplemobiletools.gallery.pro.svg.SvgSoftwareLayerSetter import com.squareup.picasso.Picasso +import org.fossify.commons.extensions.* +import org.fossify.commons.helpers.* +import org.fossify.commons.views.MySquareImageView +import org.fossify.gallery.R +import org.fossify.gallery.asynctasks.GetMediaAsynctask +import org.fossify.gallery.databases.GalleryDatabase +import org.fossify.gallery.helpers.* +import org.fossify.gallery.interfaces.* +import org.fossify.gallery.models.* +import org.fossify.gallery.svg.SvgSoftwareLayerSetter import java.io.File import java.io.FileInputStream import java.nio.ByteBuffer import java.nio.channels.FileChannel +import java.util.Locale import kotlin.collections.set import kotlin.math.max @@ -130,37 +131,44 @@ fun Context.getSortedDirectories(source: ArrayList): ArrayList { if (o1.sortValue.isEmpty()) { - o1.sortValue = o1.name.toLowerCase() + o1.sortValue = o1.name.lowercase(Locale.getDefault()) } if (o2.sortValue.isEmpty()) { - o2.sortValue = o2.name.toLowerCase() + o2.sortValue = o2.name.lowercase(Locale.getDefault()) } if (sorting and SORT_USE_NUMERIC_VALUE != 0) { - AlphanumericComparator().compare(o1.sortValue.normalizeString().toLowerCase(), o2.sortValue.normalizeString().toLowerCase()) + AlphanumericComparator().compare( + o1.sortValue.normalizeString().lowercase(Locale.getDefault()), + o2.sortValue.normalizeString().lowercase(Locale.getDefault()) + ) } else { - o1.sortValue.normalizeString().toLowerCase().compareTo(o2.sortValue.normalizeString().toLowerCase()) + o1.sortValue.normalizeString().lowercase(Locale.getDefault()).compareTo(o2.sortValue.normalizeString().lowercase(Locale.getDefault())) } } sorting and SORT_BY_PATH != 0 -> { if (o1.sortValue.isEmpty()) { - o1.sortValue = o1.path.toLowerCase() + o1.sortValue = o1.path.lowercase(Locale.getDefault()) } if (o2.sortValue.isEmpty()) { - o2.sortValue = o2.path.toLowerCase() + o2.sortValue = o2.path.lowercase(Locale.getDefault()) } if (sorting and SORT_USE_NUMERIC_VALUE != 0) { - AlphanumericComparator().compare(o1.sortValue.toLowerCase(), o2.sortValue.toLowerCase()) + AlphanumericComparator().compare(o1.sortValue.lowercase(Locale.getDefault()), o2.sortValue.lowercase(Locale.getDefault())) } else { - o1.sortValue.toLowerCase().compareTo(o2.sortValue.toLowerCase()) + o1.sortValue.lowercase(Locale.getDefault()).compareTo(o2.sortValue.lowercase(Locale.getDefault())) } } - sorting and SORT_BY_PATH != 0 -> AlphanumericComparator().compare(o1.sortValue.toLowerCase(), o2.sortValue.toLowerCase()) + sorting and SORT_BY_PATH != 0 -> AlphanumericComparator().compare( + o1.sortValue.lowercase(Locale.getDefault()), + o2.sortValue.lowercase(Locale.getDefault()) + ) + sorting and SORT_BY_SIZE != 0 -> (o1.sortValue.toLongOrNull() ?: 0).compareTo(o2.sortValue.toLongOrNull() ?: 0) sorting and SORT_BY_DATE_MODIFIED != 0 -> (o1.sortValue.toLongOrNull() ?: 0).compareTo(o2.sortValue.toLongOrNull() ?: 0) else -> (o1.sortValue.toLongOrNull() ?: 0).compareTo(o2.sortValue.toLongOrNull() ?: 0) @@ -230,7 +238,7 @@ private fun Context.addParentWithoutMediaFiles(into: ArrayList, path: path, subDirs.first().tmb, getFolderNameFromPath(path), - subDirs.sumBy { it.mediaCnt }, + subDirs.sumOf { it.mediaCnt }, lastModified, dateTaken, subDirs.sumByLong { it.size }, @@ -454,11 +462,11 @@ fun Context.checkAppendingHidden(path: String, hidden: String, includedFolders: fun Context.getFolderNameFromPath(path: String): String { return when (path) { - internalStoragePath -> getString(com.simplemobiletools.commons.R.string.internal) - sdCardPath -> getString(com.simplemobiletools.commons.R.string.sd_card) - otgPath -> getString(com.simplemobiletools.commons.R.string.usb) - FAVORITES -> getString(com.simplemobiletools.commons.R.string.favorites) - RECYCLE_BIN -> getString(com.simplemobiletools.commons.R.string.recycle_bin) + internalStoragePath -> getString(org.fossify.commons.R.string.internal) + sdCardPath -> getString(org.fossify.commons.R.string.sd_card) + otgPath -> getString(org.fossify.commons.R.string.usb) + FAVORITES -> getString(org.fossify.commons.R.string.favorites) + RECYCLE_BIN -> getString(org.fossify.commons.R.string.recycle_bin) else -> path.getFilenameFromPath() } } @@ -534,11 +542,15 @@ fun Context.loadImageBase( } if (roundCorners != ROUNDED_CORNERS_NONE) { - val cornerSize = if (roundCorners == ROUNDED_CORNERS_SMALL) com.simplemobiletools.commons.R.dimen.rounded_corner_radius_small else com.simplemobiletools.commons.R.dimen.rounded_corner_radius_big + val cornerSize = + if (roundCorners == ROUNDED_CORNERS_SMALL) org.fossify.commons.R.dimen.rounded_corner_radius_small else org.fossify.commons.R.dimen.rounded_corner_radius_big val cornerRadius = resources.getDimension(cornerSize).toInt() val roundedCornersTransform = RoundedCorners(cornerRadius) options.optionalTransform(MultiTransformation(CenterCrop(), roundedCornersTransform)) - options.optionalTransform(WebpDrawable::class.java, MultiTransformation(WebpDrawableTransformation(CenterCrop()), WebpDrawableTransformation(roundedCornersTransform))) + options.optionalTransform( + WebpDrawable::class.java, + MultiTransformation(WebpDrawableTransformation(CenterCrop()), WebpDrawableTransformation(roundedCornersTransform)) + ) } WebpBitmapFactory.sUseSystemDecoder = false // CVE-2023-4863 @@ -583,7 +595,7 @@ fun Context.loadSVG(path: String, target: MySquareImageView, cropThumbnails: Boo if (roundCorners != ROUNDED_CORNERS_NONE) { val cornerSize = - if (roundCorners == ROUNDED_CORNERS_SMALL) com.simplemobiletools.commons.R.dimen.rounded_corner_radius_small else com.simplemobiletools.commons.R.dimen.rounded_corner_radius_big + if (roundCorners == ROUNDED_CORNERS_SMALL) org.fossify.commons.R.dimen.rounded_corner_radius_small else org.fossify.commons.R.dimen.rounded_corner_radius_big val cornerRadius = resources.getDimension(cornerSize).toInt() builder = builder.transform(CenterCrop(), RoundedCorners(cornerRadius)) } @@ -609,7 +621,7 @@ fun Context.tryLoadingWithPicasso(path: String, view: MySquareImageView, cropThu if (roundCorners != ROUNDED_CORNERS_NONE) { val cornerSize = - if (roundCorners == ROUNDED_CORNERS_SMALL) com.simplemobiletools.commons.R.dimen.rounded_corner_radius_small else com.simplemobiletools.commons.R.dimen.rounded_corner_radius_big + if (roundCorners == ROUNDED_CORNERS_SMALL) org.fossify.commons.R.dimen.rounded_corner_radius_small else org.fossify.commons.R.dimen.rounded_corner_radius_big val cornerRadius = resources.getDimension(cornerSize).toInt() builder = builder.transform(PicassoRoundedCornersTransformation(cornerRadius.toFloat())) } @@ -848,7 +860,7 @@ fun Context.updateFavorite(path: String, isFavorite: Boolean) { favoritesDB.deleteFavoritePath(path) } } catch (e: Exception) { - toast(com.simplemobiletools.commons.R.string.unknown_error_occurred) + toast(org.fossify.commons.R.string.unknown_error_occurred) } } @@ -929,7 +941,7 @@ fun Context.parseFileChannel(path: String, fc: FileChannel, level: Int, start: L } } - val xmlString = sb.toString().toLowerCase() + val xmlString = sb.toString().lowercase(Locale.getDefault()) if (xmlString.contains("gspherical:projectiontype>equirectangular") || xmlString.contains("gspherical:projectiontype=\"equirectangular\"")) { callback.invoke() } diff --git a/app/src/main/kotlin/com/simplemobiletools/gallery/pro/extensions/ExifInterface.kt b/app/src/main/kotlin/org/fossify/gallery/extensions/ExifInterface.kt similarity index 97% rename from app/src/main/kotlin/com/simplemobiletools/gallery/pro/extensions/ExifInterface.kt rename to app/src/main/kotlin/org/fossify/gallery/extensions/ExifInterface.kt index 6522c828b..412827e55 100644 --- a/app/src/main/kotlin/com/simplemobiletools/gallery/pro/extensions/ExifInterface.kt +++ b/app/src/main/kotlin/org/fossify/gallery/extensions/ExifInterface.kt @@ -1,4 +1,4 @@ -package com.simplemobiletools.gallery.pro.extensions +package org.fossify.gallery.extensions import androidx.exifinterface.media.ExifInterface import java.lang.reflect.Field diff --git a/app/src/main/kotlin/org/fossify/gallery/extensions/FileDirItem.kt b/app/src/main/kotlin/org/fossify/gallery/extensions/FileDirItem.kt new file mode 100644 index 000000000..1a0eeefbc --- /dev/null +++ b/app/src/main/kotlin/org/fossify/gallery/extensions/FileDirItem.kt @@ -0,0 +1,5 @@ +package org.fossify.gallery.extensions + +import org.fossify.commons.models.FileDirItem + +fun FileDirItem.isDownloadsFolder() = path.isDownloadsFolder() diff --git a/app/src/main/kotlin/org/fossify/gallery/extensions/Int.kt b/app/src/main/kotlin/org/fossify/gallery/extensions/Int.kt new file mode 100644 index 000000000..c47f8f48e --- /dev/null +++ b/app/src/main/kotlin/org/fossify/gallery/extensions/Int.kt @@ -0,0 +1,5 @@ +package org.fossify.gallery.extensions + +import org.fossify.commons.helpers.SORT_DESCENDING + +fun Int.isSortingAscending() = this and SORT_DESCENDING == 0 diff --git a/app/src/main/kotlin/com/simplemobiletools/gallery/pro/extensions/Resources.kt b/app/src/main/kotlin/org/fossify/gallery/extensions/Resources.kt similarity index 93% rename from app/src/main/kotlin/com/simplemobiletools/gallery/pro/extensions/Resources.kt rename to app/src/main/kotlin/org/fossify/gallery/extensions/Resources.kt index d086fb7a5..6fe190f2a 100644 --- a/app/src/main/kotlin/com/simplemobiletools/gallery/pro/extensions/Resources.kt +++ b/app/src/main/kotlin/org/fossify/gallery/extensions/Resources.kt @@ -1,4 +1,4 @@ -package com.simplemobiletools.gallery.pro.extensions +package org.fossify.gallery.extensions import android.content.Context import android.content.res.Resources diff --git a/app/src/main/kotlin/com/simplemobiletools/gallery/pro/extensions/String.kt b/app/src/main/kotlin/org/fossify/gallery/extensions/String.kt similarity index 91% rename from app/src/main/kotlin/com/simplemobiletools/gallery/pro/extensions/String.kt rename to app/src/main/kotlin/org/fossify/gallery/extensions/String.kt index dee1aef64..c1077a4fb 100644 --- a/app/src/main/kotlin/com/simplemobiletools/gallery/pro/extensions/String.kt +++ b/app/src/main/kotlin/org/fossify/gallery/extensions/String.kt @@ -1,11 +1,12 @@ -package com.simplemobiletools.gallery.pro.extensions +package org.fossify.gallery.extensions import android.os.Environment -import com.simplemobiletools.commons.extensions.isExternalStorageManager -import com.simplemobiletools.commons.helpers.NOMEDIA -import com.simplemobiletools.commons.helpers.isRPlus +import org.fossify.commons.extensions.isExternalStorageManager +import org.fossify.commons.helpers.NOMEDIA +import org.fossify.commons.helpers.isRPlus import java.io.File import java.io.IOException +import java.util.Locale fun String.isThisOrParentIncluded(includedPaths: MutableSet) = includedPaths.any { equals(it, true) } || includedPaths.any { "$this/".startsWith("$it/", true) } @@ -84,9 +85,9 @@ fun String.shouldFolderBeVisible( // recognize /sdcard/DCIM as the same folder as /storage/emulated/0/DCIM fun String.getDistinctPath(): String { return try { - File(this).canonicalPath.toLowerCase() + File(this).canonicalPath.lowercase(Locale.getDefault()) } catch (e: IOException) { - toLowerCase() + lowercase(Locale.getDefault()) } } diff --git a/app/src/main/kotlin/com/simplemobiletools/gallery/pro/extensions/View.kt b/app/src/main/kotlin/org/fossify/gallery/extensions/View.kt similarity index 87% rename from app/src/main/kotlin/com/simplemobiletools/gallery/pro/extensions/View.kt rename to app/src/main/kotlin/org/fossify/gallery/extensions/View.kt index 24107d2a2..fb26dca30 100644 --- a/app/src/main/kotlin/com/simplemobiletools/gallery/pro/extensions/View.kt +++ b/app/src/main/kotlin/org/fossify/gallery/extensions/View.kt @@ -1,4 +1,4 @@ -package com.simplemobiletools.gallery.pro.extensions +package org.fossify.gallery.extensions import android.os.SystemClock import android.view.MotionEvent diff --git a/app/src/main/kotlin/com/simplemobiletools/gallery/pro/fragments/PhotoFragment.kt b/app/src/main/kotlin/org/fossify/gallery/fragments/PhotoFragment.kt similarity index 95% rename from app/src/main/kotlin/com/simplemobiletools/gallery/pro/fragments/PhotoFragment.kt rename to app/src/main/kotlin/org/fossify/gallery/fragments/PhotoFragment.kt index 715f23472..60a8cf944 100644 --- a/app/src/main/kotlin/com/simplemobiletools/gallery/pro/fragments/PhotoFragment.kt +++ b/app/src/main/kotlin/org/fossify/gallery/fragments/PhotoFragment.kt @@ -1,4 +1,4 @@ -package com.simplemobiletools.gallery.pro.fragments +package org.fossify.gallery.fragments import android.content.Intent import android.content.res.Configuration @@ -38,31 +38,32 @@ import com.davemorrissey.labs.subscaleview.ImageRegionDecoder import com.davemorrissey.labs.subscaleview.SubsamplingScaleImageView import com.github.penfeizhou.animation.apng.APNGDrawable import com.github.penfeizhou.animation.webp.WebPDrawable -import com.simplemobiletools.commons.activities.BaseSimpleActivity -import com.simplemobiletools.commons.extensions.* -import com.simplemobiletools.commons.helpers.ensureBackgroundThread -import com.simplemobiletools.commons.helpers.isRPlus -import com.simplemobiletools.gallery.pro.R -import com.simplemobiletools.gallery.pro.activities.PanoramaPhotoActivity -import com.simplemobiletools.gallery.pro.activities.PhotoActivity -import com.simplemobiletools.gallery.pro.activities.PhotoVideoActivity -import com.simplemobiletools.gallery.pro.activities.ViewPagerActivity -import com.simplemobiletools.gallery.pro.adapters.PortraitPhotosAdapter -import com.simplemobiletools.gallery.pro.databinding.PagerPhotoItemBinding -import com.simplemobiletools.gallery.pro.extensions.config -import com.simplemobiletools.gallery.pro.extensions.saveRotatedImageToFile -import com.simplemobiletools.gallery.pro.extensions.sendFakeClick -import com.simplemobiletools.gallery.pro.helpers.* -import com.simplemobiletools.gallery.pro.models.Medium -import com.simplemobiletools.gallery.pro.svg.SvgSoftwareLayerSetter import com.squareup.picasso.Callback import com.squareup.picasso.Picasso import it.sephiroth.android.library.exif2.ExifInterface import org.apache.sanselan.common.byteSources.ByteSourceInputStream import org.apache.sanselan.formats.jpeg.JpegImageParser +import org.fossify.commons.activities.BaseSimpleActivity +import org.fossify.commons.extensions.* +import org.fossify.commons.helpers.ensureBackgroundThread +import org.fossify.commons.helpers.isRPlus +import org.fossify.gallery.R +import org.fossify.gallery.activities.PanoramaPhotoActivity +import org.fossify.gallery.activities.PhotoActivity +import org.fossify.gallery.activities.PhotoVideoActivity +import org.fossify.gallery.activities.ViewPagerActivity +import org.fossify.gallery.adapters.PortraitPhotosAdapter +import org.fossify.gallery.databinding.PagerPhotoItemBinding +import org.fossify.gallery.extensions.config +import org.fossify.gallery.extensions.saveRotatedImageToFile +import org.fossify.gallery.extensions.sendFakeClick +import org.fossify.gallery.helpers.* +import org.fossify.gallery.models.Medium +import org.fossify.gallery.svg.SvgSoftwareLayerSetter import pl.droidsonroids.gif.InputSource import java.io.File import java.io.FileOutputStream +import java.util.Locale import kotlin.math.ceil class PhotoFragment : ViewPagerFragment() { @@ -197,7 +198,7 @@ class PhotoFragment : ViewPagerFragment() { rotated.compress(Bitmap.CompressFormat.JPEG, 100, out) mMedium.path = file.absolutePath } catch (e: Exception) { - requireActivity().toast(com.simplemobiletools.commons.R.string.unknown_error_occurred) + requireActivity().toast(org.fossify.commons.R.string.unknown_error_occurred) return mView } finally { out?.close() @@ -529,7 +530,7 @@ class PhotoFragment : ViewPagerFragment() { if (files != null) { val screenWidth = requireContext().realScreenSize.x val itemWidth = - resources.getDimension(R.dimen.portrait_photos_stripe_height).toInt() + resources.getDimension(com.simplemobiletools.commons.R.dimen.one_dp) + resources.getDimension(R.dimen.portrait_photos_stripe_height).toInt() + resources.getDimension(org.fossify.commons.R.dimen.one_dp) .toInt() val sideWidth = screenWidth / 2 - itemWidth / 2 val fakeItemsCnt = ceil(sideWidth / itemWidth.toDouble()).toInt() @@ -591,7 +592,7 @@ class PhotoFragment : ViewPagerFragment() { } private fun setupStripeBottomMargin() { - var bottomMargin = requireContext().navigationBarHeight + resources.getDimension(com.simplemobiletools.commons.R.dimen.normal_margin).toInt() + var bottomMargin = requireContext().navigationBarHeight + resources.getDimension(org.fossify.commons.R.dimen.normal_margin).toInt() if (requireContext().config.bottomActions) { bottomMargin += resources.getDimension(R.dimen.bottom_actions_height).toInt() } @@ -734,7 +735,7 @@ class PhotoFragment : ViewPagerFragment() { private fun getMinTileDpi(): Int { val metrics = resources.displayMetrics val averageDpi = (metrics.xdpi + metrics.ydpi) / 2 - val device = "${Build.BRAND} ${Build.MODEL}".toLowerCase() + val device = "${Build.BRAND} ${Build.MODEL}".lowercase(Locale.getDefault()) return when { WEIRD_DEVICES.contains(device) -> WEIRD_TILE_DPI averageDpi > 400 -> HIGH_TILE_DPI @@ -744,7 +745,7 @@ class PhotoFragment : ViewPagerFragment() { } private fun checkIfPanorama() { - mIsPanorama = try { + mIsPanorama = try { if (mMedium.path.startsWith("content:/")) { requireContext().contentResolver.openInputStream(Uri.parse(mMedium.path)) } else { @@ -894,7 +895,7 @@ class PhotoFragment : ViewPagerFragment() { } private fun getExtendedDetailsY(height: Int): Float { - val smallMargin = context?.resources?.getDimension(com.simplemobiletools.commons.R.dimen.small_margin) ?: return 0f + val smallMargin = context?.resources?.getDimension(org.fossify.commons.R.dimen.small_margin) ?: return 0f val fullscreenOffset = smallMargin + if (mIsFullscreen) 0 else requireContext().navigationBarHeight val actionsHeight = if (requireContext().config.bottomActions && !mIsFullscreen) resources.getDimension(R.dimen.bottom_actions_height) else 0f return requireContext().realScreenSize.y - height - actionsHeight - fullscreenOffset diff --git a/app/src/main/kotlin/com/simplemobiletools/gallery/pro/fragments/VideoFragment.kt b/app/src/main/kotlin/org/fossify/gallery/fragments/VideoFragment.kt similarity index 95% rename from app/src/main/kotlin/com/simplemobiletools/gallery/pro/fragments/VideoFragment.kt rename to app/src/main/kotlin/org/fossify/gallery/fragments/VideoFragment.kt index c4cc359a9..b3c4dd4c5 100644 --- a/app/src/main/kotlin/com/simplemobiletools/gallery/pro/fragments/VideoFragment.kt +++ b/app/src/main/kotlin/org/fossify/gallery/fragments/VideoFragment.kt @@ -1,4 +1,4 @@ -package com.simplemobiletools.gallery.pro.fragments +package org.fossify.gallery.fragments import android.content.Intent import android.content.res.Configuration @@ -25,18 +25,18 @@ import androidx.media3.exoplayer.source.DefaultMediaSourceFactory import androidx.media3.exoplayer.source.MediaSource import androidx.media3.exoplayer.source.ProgressiveMediaSource import com.bumptech.glide.Glide -import com.simplemobiletools.commons.extensions.* -import com.simplemobiletools.commons.helpers.ensureBackgroundThread -import com.simplemobiletools.gallery.pro.R -import com.simplemobiletools.gallery.pro.activities.PanoramaVideoActivity -import com.simplemobiletools.gallery.pro.activities.VideoActivity -import com.simplemobiletools.gallery.pro.databinding.PagerVideoItemBinding -import com.simplemobiletools.gallery.pro.extensions.config -import com.simplemobiletools.gallery.pro.extensions.hasNavBar -import com.simplemobiletools.gallery.pro.extensions.parseFileChannel -import com.simplemobiletools.gallery.pro.helpers.* -import com.simplemobiletools.gallery.pro.models.Medium -import com.simplemobiletools.gallery.pro.views.MediaSideScroll +import org.fossify.commons.extensions.* +import org.fossify.commons.helpers.ensureBackgroundThread +import org.fossify.gallery.R +import org.fossify.gallery.activities.PanoramaVideoActivity +import org.fossify.gallery.activities.VideoActivity +import org.fossify.gallery.databinding.PagerVideoItemBinding +import org.fossify.gallery.extensions.config +import org.fossify.gallery.extensions.hasNavBar +import org.fossify.gallery.extensions.parseFileChannel +import org.fossify.gallery.helpers.* +import org.fossify.gallery.models.Medium +import org.fossify.gallery.views.MediaSideScroll import java.io.File import java.io.FileInputStream @@ -537,7 +537,7 @@ class VideoFragment : ViewPagerFragment(), TextureView.SurfaceTextureListener, S } private fun getExtendedDetailsY(height: Int): Float { - val smallMargin = context?.resources?.getDimension(com.simplemobiletools.commons.R.dimen.small_margin) ?: return 0f + val smallMargin = context?.resources?.getDimension(org.fossify.commons.R.dimen.small_margin) ?: return 0f val fullscreenOffset = smallMargin + if (mIsFullscreen) 0 else requireContext().navigationBarHeight var actionsHeight = 0f if (!mIsFullscreen) { @@ -654,7 +654,7 @@ class VideoFragment : ViewPagerFragment(), TextureView.SurfaceTextureListener, S } if (!wasEnded || !mConfig.loopVideos) { - mPlayPauseButton.setImageResource(com.simplemobiletools.commons.R.drawable.ic_pause_outline_vector) + mPlayPauseButton.setImageResource(org.fossify.commons.R.drawable.ic_pause_outline_vector) } if (!mWasVideoStarted) { @@ -680,7 +680,7 @@ class VideoFragment : ViewPagerFragment(), TextureView.SurfaceTextureListener, S mExoPlayer?.playWhenReady = false } - mPlayPauseButton.setImageResource(com.simplemobiletools.commons.R.drawable.ic_play_outline_vector) + mPlayPauseButton.setImageResource(org.fossify.commons.R.drawable.ic_play_outline_vector) activity?.window?.clearFlags(WindowManager.LayoutParams.FLAG_KEEP_SCREEN_ON) mPositionAtPause = mExoPlayer?.currentPosition ?: 0L } diff --git a/app/src/main/kotlin/com/simplemobiletools/gallery/pro/fragments/ViewPagerFragment.kt b/app/src/main/kotlin/org/fossify/gallery/fragments/ViewPagerFragment.kt similarity index 87% rename from app/src/main/kotlin/com/simplemobiletools/gallery/pro/fragments/ViewPagerFragment.kt rename to app/src/main/kotlin/org/fossify/gallery/fragments/ViewPagerFragment.kt index 5c1e9ea4e..bc5bac63e 100644 --- a/app/src/main/kotlin/com/simplemobiletools/gallery/pro/fragments/ViewPagerFragment.kt +++ b/app/src/main/kotlin/org/fossify/gallery/fragments/ViewPagerFragment.kt @@ -1,4 +1,4 @@ -package com.simplemobiletools.gallery.pro.fragments +package org.fossify.gallery.fragments import android.provider.MediaStore import android.provider.MediaStore.Files @@ -6,10 +6,10 @@ import android.provider.MediaStore.Images import android.view.MotionEvent import androidx.exifinterface.media.ExifInterface import androidx.fragment.app.Fragment -import com.simplemobiletools.commons.extensions.* -import com.simplemobiletools.gallery.pro.extensions.config -import com.simplemobiletools.gallery.pro.helpers.* -import com.simplemobiletools.gallery.pro.models.Medium +import org.fossify.commons.extensions.* +import org.fossify.gallery.extensions.config +import org.fossify.gallery.helpers.* +import org.fossify.gallery.models.Medium import java.io.File abstract class ViewPagerFragment : Fragment() { @@ -53,39 +53,39 @@ abstract class ViewPagerFragment : Fragment() { val details = StringBuilder() val detailsFlag = context!!.config.extendedDetails if (detailsFlag and EXT_NAME != 0) { - medium.name.let { if (it.isNotEmpty()) details.appendln(it) } + medium.name.let { if (it.isNotEmpty()) details.appendLine(it) } } if (detailsFlag and EXT_PATH != 0) { - path.let { if (it.isNotEmpty()) details.appendln(it) } + path.let { if (it.isNotEmpty()) details.appendLine(it) } } if (detailsFlag and EXT_SIZE != 0) { - file.length().formatSize().let { if (it.isNotEmpty()) details.appendln(it) } + file.length().formatSize().let { if (it.isNotEmpty()) details.appendLine(it) } } if (detailsFlag and EXT_RESOLUTION != 0) { - context!!.getResolution(file.absolutePath)?.formatAsResolution().let { if (it?.isNotEmpty() == true) details.appendln(it) } + context!!.getResolution(file.absolutePath)?.formatAsResolution().let { if (it?.isNotEmpty() == true) details.appendLine(it) } } if (detailsFlag and EXT_LAST_MODIFIED != 0) { - getFileLastModified(file).let { if (it.isNotEmpty()) details.appendln(it) } + getFileLastModified(file).let { if (it.isNotEmpty()) details.appendLine(it) } } if (detailsFlag and EXT_DATE_TAKEN != 0) { - exif.getExifDateTaken(context!!).let { if (it.isNotEmpty()) details.appendln(it) } + exif.getExifDateTaken(context!!).let { if (it.isNotEmpty()) details.appendLine(it) } } if (detailsFlag and EXT_CAMERA_MODEL != 0) { - exif.getExifCameraModel().let { if (it.isNotEmpty()) details.appendln(it) } + exif.getExifCameraModel().let { if (it.isNotEmpty()) details.appendLine(it) } } if (detailsFlag and EXT_EXIF_PROPERTIES != 0) { - exif.getExifProperties().let { if (it.isNotEmpty()) details.appendln(it) } + exif.getExifProperties().let { if (it.isNotEmpty()) details.appendLine(it) } } if (detailsFlag and EXT_GPS != 0) { - getLatLonAltitude(medium.path).let { if (it.isNotEmpty()) details.appendln(it) } + getLatLonAltitude(medium.path).let { if (it.isNotEmpty()) details.appendLine(it) } } return details.toString().trim() } @@ -147,7 +147,7 @@ abstract class ViewPagerFragment : Fragment() { val downGestureDuration = System.currentTimeMillis() - mTouchDownTime if (!mIgnoreCloseDown && (Math.abs(diffY) > Math.abs(diffX)) && (diffY < -mCloseDownThreshold) && downGestureDuration < MAX_CLOSE_DOWN_GESTURE_DURATION && context?.config?.allowDownGesture == true) { activity?.finish() - activity?.overridePendingTransition(0, com.simplemobiletools.commons.R.anim.slide_down) + activity?.overridePendingTransition(0, org.fossify.commons.R.anim.slide_down) } mIgnoreCloseDown = false } diff --git a/app/src/main/kotlin/com/simplemobiletools/gallery/pro/helpers/Config.kt b/app/src/main/kotlin/org/fossify/gallery/helpers/Config.kt similarity index 96% rename from app/src/main/kotlin/com/simplemobiletools/gallery/pro/helpers/Config.kt rename to app/src/main/kotlin/org/fossify/gallery/helpers/Config.kt index b50e69740..cf8044251 100644 --- a/app/src/main/kotlin/com/simplemobiletools/gallery/pro/helpers/Config.kt +++ b/app/src/main/kotlin/org/fossify/gallery/helpers/Config.kt @@ -1,14 +1,15 @@ -package com.simplemobiletools.gallery.pro.helpers +package org.fossify.gallery.helpers import android.content.Context import android.content.res.Configuration import android.os.Environment import com.google.gson.Gson import com.google.gson.reflect.TypeToken -import com.simplemobiletools.commons.helpers.* -import com.simplemobiletools.gallery.pro.R -import com.simplemobiletools.gallery.pro.models.AlbumCover +import org.fossify.commons.helpers.* +import org.fossify.gallery.R +import org.fossify.gallery.models.AlbumCover import java.util.Arrays +import java.util.Locale class Config(context: Context) : BaseConfig(context) { companion object { @@ -23,12 +24,12 @@ class Config(context: Context) : BaseConfig(context) { if (path.isEmpty()) { groupBy = value } else { - prefs.edit().putInt(GROUP_FOLDER_PREFIX + path.toLowerCase(), value).apply() + prefs.edit().putInt(GROUP_FOLDER_PREFIX + path.lowercase(Locale.getDefault()), value).apply() } } fun getFolderGrouping(path: String): Int { - var groupBy = prefs.getInt(GROUP_FOLDER_PREFIX + path.toLowerCase(), groupBy) + var groupBy = prefs.getInt(GROUP_FOLDER_PREFIX + path.lowercase(Locale.getDefault()), groupBy) if (path != SHOW_ALL && groupBy and GROUP_BY_FOLDER != 0) { groupBy -= GROUP_BY_FOLDER + 1 } @@ -36,26 +37,26 @@ class Config(context: Context) : BaseConfig(context) { } fun removeFolderGrouping(path: String) { - prefs.edit().remove(GROUP_FOLDER_PREFIX + path.toLowerCase()).apply() + prefs.edit().remove(GROUP_FOLDER_PREFIX + path.lowercase(Locale.getDefault())).apply() } - fun hasCustomGrouping(path: String) = prefs.contains(GROUP_FOLDER_PREFIX + path.toLowerCase()) + fun hasCustomGrouping(path: String) = prefs.contains(GROUP_FOLDER_PREFIX + path.lowercase(Locale.getDefault())) fun saveFolderViewType(path: String, value: Int) { if (path.isEmpty()) { viewTypeFiles = value } else { - prefs.edit().putInt(VIEW_TYPE_PREFIX + path.toLowerCase(), value).apply() + prefs.edit().putInt(VIEW_TYPE_PREFIX + path.lowercase(Locale.getDefault()), value).apply() } } - fun getFolderViewType(path: String) = prefs.getInt(VIEW_TYPE_PREFIX + path.toLowerCase(), viewTypeFiles) + fun getFolderViewType(path: String) = prefs.getInt(VIEW_TYPE_PREFIX + path.lowercase(Locale.getDefault()), viewTypeFiles) fun removeFolderViewType(path: String) { - prefs.edit().remove(VIEW_TYPE_PREFIX + path.toLowerCase()).apply() + prefs.edit().remove(VIEW_TYPE_PREFIX + path.lowercase(Locale.getDefault())).apply() } - fun hasCustomViewType(path: String) = prefs.contains(VIEW_TYPE_PREFIX + path.toLowerCase()) + fun hasCustomViewType(path: String) = prefs.contains(VIEW_TYPE_PREFIX + path.lowercase(Locale.getDefault())) var wasHideFolderTooltipShown: Boolean get() = prefs.getBoolean(HIDE_FOLDER_TOOLTIP_SHOWN, false) @@ -396,16 +397,16 @@ class Config(context: Context) : BaseConfig(context) { set(bottomActions) = prefs.edit().putBoolean(BOTTOM_ACTIONS, bottomActions).apply() fun removeLastVideoPosition(path: String) { - prefs.edit().remove("$LAST_VIDEO_POSITION_PREFIX${path.toLowerCase()}").apply() + prefs.edit().remove("$LAST_VIDEO_POSITION_PREFIX${path.lowercase(Locale.getDefault())}").apply() } fun saveLastVideoPosition(path: String, value: Int) { if (path.isNotEmpty()) { - prefs.edit().putInt("$LAST_VIDEO_POSITION_PREFIX${path.toLowerCase()}", value).apply() + prefs.edit().putInt("$LAST_VIDEO_POSITION_PREFIX${path.lowercase(Locale.getDefault())}", value).apply() } } - fun getLastVideoPosition(path: String) = prefs.getInt("$LAST_VIDEO_POSITION_PREFIX${path.toLowerCase()}", 0) + fun getLastVideoPosition(path: String) = prefs.getInt("$LAST_VIDEO_POSITION_PREFIX${path.lowercase(Locale.getDefault())}", 0) fun getAllLastVideoPositions() = prefs.all.filterKeys { it.startsWith(LAST_VIDEO_POSITION_PREFIX) diff --git a/app/src/main/kotlin/com/simplemobiletools/gallery/pro/helpers/Constants.kt b/app/src/main/kotlin/org/fossify/gallery/helpers/Constants.kt similarity index 99% rename from app/src/main/kotlin/com/simplemobiletools/gallery/pro/helpers/Constants.kt rename to app/src/main/kotlin/org/fossify/gallery/helpers/Constants.kt index d5af5d1a3..ef117fc2a 100644 --- a/app/src/main/kotlin/com/simplemobiletools/gallery/pro/helpers/Constants.kt +++ b/app/src/main/kotlin/org/fossify/gallery/helpers/Constants.kt @@ -1,6 +1,6 @@ -package com.simplemobiletools.gallery.pro.helpers +package org.fossify.gallery.helpers -import com.simplemobiletools.commons.helpers.* +import org.fossify.commons.helpers.* // shared preferences const val DIRECTORY_SORT_ORDER = "directory_sort_order" diff --git a/app/src/main/kotlin/com/simplemobiletools/gallery/pro/helpers/DefaultPageTransformer.kt b/app/src/main/kotlin/org/fossify/gallery/helpers/DefaultPageTransformer.kt similarity index 79% rename from app/src/main/kotlin/com/simplemobiletools/gallery/pro/helpers/DefaultPageTransformer.kt rename to app/src/main/kotlin/org/fossify/gallery/helpers/DefaultPageTransformer.kt index 95981ba4a..7788c78fb 100644 --- a/app/src/main/kotlin/com/simplemobiletools/gallery/pro/helpers/DefaultPageTransformer.kt +++ b/app/src/main/kotlin/org/fossify/gallery/helpers/DefaultPageTransformer.kt @@ -1,4 +1,4 @@ -package com.simplemobiletools.gallery.pro.helpers +package org.fossify.gallery.helpers import android.view.View import androidx.viewpager.widget.ViewPager diff --git a/app/src/main/kotlin/com/simplemobiletools/gallery/pro/helpers/FadePageTransformer.kt b/app/src/main/kotlin/org/fossify/gallery/helpers/FadePageTransformer.kt similarity index 89% rename from app/src/main/kotlin/com/simplemobiletools/gallery/pro/helpers/FadePageTransformer.kt rename to app/src/main/kotlin/org/fossify/gallery/helpers/FadePageTransformer.kt index 3ed113b40..80c4058dd 100644 --- a/app/src/main/kotlin/com/simplemobiletools/gallery/pro/helpers/FadePageTransformer.kt +++ b/app/src/main/kotlin/org/fossify/gallery/helpers/FadePageTransformer.kt @@ -1,4 +1,4 @@ -package com.simplemobiletools.gallery.pro.helpers +package org.fossify.gallery.helpers import android.view.View import androidx.viewpager.widget.ViewPager diff --git a/app/src/main/kotlin/com/simplemobiletools/gallery/pro/helpers/FilterThumbnailsManager.kt b/app/src/main/kotlin/org/fossify/gallery/helpers/FilterThumbnailsManager.kt similarity index 86% rename from app/src/main/kotlin/com/simplemobiletools/gallery/pro/helpers/FilterThumbnailsManager.kt rename to app/src/main/kotlin/org/fossify/gallery/helpers/FilterThumbnailsManager.kt index d517cf74d..b30df4a80 100644 --- a/app/src/main/kotlin/com/simplemobiletools/gallery/pro/helpers/FilterThumbnailsManager.kt +++ b/app/src/main/kotlin/org/fossify/gallery/helpers/FilterThumbnailsManager.kt @@ -1,7 +1,7 @@ -package com.simplemobiletools.gallery.pro.helpers +package org.fossify.gallery.helpers import android.graphics.Bitmap -import com.simplemobiletools.gallery.pro.models.FilterItem +import org.fossify.gallery.models.FilterItem class FilterThumbnailsManager { private var filterThumbnails = ArrayList(10) diff --git a/app/src/main/kotlin/com/simplemobiletools/gallery/pro/helpers/GridSpacingItemDecoration.kt b/app/src/main/kotlin/org/fossify/gallery/helpers/GridSpacingItemDecoration.kt similarity index 93% rename from app/src/main/kotlin/com/simplemobiletools/gallery/pro/helpers/GridSpacingItemDecoration.kt rename to app/src/main/kotlin/org/fossify/gallery/helpers/GridSpacingItemDecoration.kt index 227833039..85f399fcf 100644 --- a/app/src/main/kotlin/com/simplemobiletools/gallery/pro/helpers/GridSpacingItemDecoration.kt +++ b/app/src/main/kotlin/org/fossify/gallery/helpers/GridSpacingItemDecoration.kt @@ -1,10 +1,10 @@ -package com.simplemobiletools.gallery.pro.helpers +package org.fossify.gallery.helpers import android.graphics.Rect import android.view.View import androidx.recyclerview.widget.RecyclerView -import com.simplemobiletools.gallery.pro.models.Medium -import com.simplemobiletools.gallery.pro.models.ThumbnailItem +import org.fossify.gallery.models.Medium +import org.fossify.gallery.models.ThumbnailItem class GridSpacingItemDecoration( val spanCount: Int, val spacing: Int, val isScrollingHorizontally: Boolean, val addSideSpacing: Boolean, diff --git a/app/src/main/kotlin/com/simplemobiletools/gallery/pro/helpers/IsoTypeReader.kt b/app/src/main/kotlin/org/fossify/gallery/helpers/IsoTypeReader.kt similarity index 93% rename from app/src/main/kotlin/com/simplemobiletools/gallery/pro/helpers/IsoTypeReader.kt rename to app/src/main/kotlin/org/fossify/gallery/helpers/IsoTypeReader.kt index d8c33e72d..70466cad5 100644 --- a/app/src/main/kotlin/com/simplemobiletools/gallery/pro/helpers/IsoTypeReader.kt +++ b/app/src/main/kotlin/org/fossify/gallery/helpers/IsoTypeReader.kt @@ -1,4 +1,4 @@ -package com.simplemobiletools.gallery.pro.helpers +package org.fossify.gallery.helpers import java.io.UnsupportedEncodingException import java.nio.ByteBuffer diff --git a/app/src/main/kotlin/com/simplemobiletools/gallery/pro/helpers/MediaFetcher.kt b/app/src/main/kotlin/org/fossify/gallery/helpers/MediaFetcher.kt similarity index 95% rename from app/src/main/kotlin/com/simplemobiletools/gallery/pro/helpers/MediaFetcher.kt rename to app/src/main/kotlin/org/fossify/gallery/helpers/MediaFetcher.kt index d17e5f3bf..272e30e7c 100644 --- a/app/src/main/kotlin/com/simplemobiletools/gallery/pro/helpers/MediaFetcher.kt +++ b/app/src/main/kotlin/org/fossify/gallery/helpers/MediaFetcher.kt @@ -1,4 +1,4 @@ -package com.simplemobiletools.gallery.pro.helpers +package org.fossify.gallery.helpers import android.content.ContentResolver import android.content.Context @@ -11,13 +11,13 @@ import android.provider.MediaStore import android.provider.MediaStore.Files import android.provider.MediaStore.Images import android.text.format.DateFormat -import com.simplemobiletools.commons.extensions.* -import com.simplemobiletools.commons.helpers.* -import com.simplemobiletools.gallery.pro.R -import com.simplemobiletools.gallery.pro.extensions.* -import com.simplemobiletools.gallery.pro.models.Medium -import com.simplemobiletools.gallery.pro.models.ThumbnailItem -import com.simplemobiletools.gallery.pro.models.ThumbnailSection +import org.fossify.commons.extensions.* +import org.fossify.commons.helpers.* +import org.fossify.gallery.R +import org.fossify.gallery.extensions.* +import org.fossify.gallery.models.Medium +import org.fossify.gallery.models.ThumbnailItem +import org.fossify.gallery.models.ThumbnailSection import java.io.File import java.util.Calendar import java.util.Locale @@ -44,12 +44,12 @@ class MediaFetcher(val context: Context) { } } else { if (curPath != FAVORITES && curPath != RECYCLE_BIN && isRPlus() && !isExternalStorageManager()) { - if (android11Files?.containsKey(curPath.toLowerCase()) == true) { - curMedia.addAll(android11Files[curPath.toLowerCase()]!!) + if (android11Files?.containsKey(curPath.lowercase(Locale.getDefault())) == true) { + curMedia.addAll(android11Files[curPath.lowercase(Locale.getDefault())]!!) } else if (android11Files == null) { val files = getAndroid11FolderMedia(isPickImage, isPickVideo, favoritePaths, false, getProperDateTaken, dateTakens) - if (files.containsKey(curPath.toLowerCase())) { - curMedia.addAll(files[curPath.toLowerCase()]!!) + if (files.containsKey(curPath.lowercase(Locale.getDefault()))) { + curMedia.addAll(files[curPath.lowercase(Locale.getDefault())]!!) } } } @@ -773,17 +773,17 @@ class MediaFetcher(val context: Context) { var result = when { sorting and SORT_BY_NAME != 0 -> { if (sorting and SORT_USE_NUMERIC_VALUE != 0) { - AlphanumericComparator().compare(o1.name.normalizeString().toLowerCase(), o2.name.normalizeString().toLowerCase()) + AlphanumericComparator().compare(o1.name.normalizeString().lowercase(Locale.getDefault()), o2.name.normalizeString().lowercase(Locale.getDefault())) } else { - o1.name.normalizeString().toLowerCase().compareTo(o2.name.normalizeString().toLowerCase()) + o1.name.normalizeString().lowercase(Locale.getDefault()).compareTo(o2.name.normalizeString().lowercase(Locale.getDefault())) } } sorting and SORT_BY_PATH != 0 -> { if (sorting and SORT_USE_NUMERIC_VALUE != 0) { - AlphanumericComparator().compare(o1.path.toLowerCase(), o2.path.toLowerCase()) + AlphanumericComparator().compare(o1.path.lowercase(Locale.getDefault()), o2.path.lowercase(Locale.getDefault())) } else { - o1.path.toLowerCase().compareTo(o2.path.toLowerCase()) + o1.path.lowercase(Locale.getDefault()).compareTo(o2.path.lowercase(Locale.getDefault())) } } @@ -866,13 +866,13 @@ class MediaFetcher(val context: Context) { grouping and GROUP_BY_LAST_MODIFIED_MONTHLY != 0 || grouping and GROUP_BY_DATE_TAKEN_MONTHLY != 0 -> formatDate(key, false) grouping and GROUP_BY_FILE_TYPE != 0 -> getFileTypeString(key) - grouping and GROUP_BY_EXTENSION != 0 -> key.toUpperCase() + grouping and GROUP_BY_EXTENSION != 0 -> key.uppercase(Locale.getDefault()) grouping and GROUP_BY_FOLDER != 0 -> context.humanizePath(key) else -> key } if (result.isEmpty()) { - result = context.getString(com.simplemobiletools.commons.R.string.unknown) + result = context.getString(org.fossify.commons.R.string.unknown) } return if (grouping and GROUP_SHOW_FILE_COUNT != 0) { @@ -884,8 +884,8 @@ class MediaFetcher(val context: Context) { private fun getFinalDate(date: String, today: String, yesterday: String): String { return when (date) { - today -> context.getString(com.simplemobiletools.commons.R.string.today) - yesterday -> context.getString(com.simplemobiletools.commons.R.string.yesterday) + today -> context.getString(org.fossify.commons.R.string.today) + yesterday -> context.getString(org.fossify.commons.R.string.yesterday) else -> date } } diff --git a/app/src/main/kotlin/com/simplemobiletools/gallery/pro/helpers/MyGlideImageDecoder.kt b/app/src/main/kotlin/org/fossify/gallery/helpers/MyGlideImageDecoder.kt similarity index 95% rename from app/src/main/kotlin/com/simplemobiletools/gallery/pro/helpers/MyGlideImageDecoder.kt rename to app/src/main/kotlin/org/fossify/gallery/helpers/MyGlideImageDecoder.kt index 0287a3b39..a5da7b2c1 100644 --- a/app/src/main/kotlin/com/simplemobiletools/gallery/pro/helpers/MyGlideImageDecoder.kt +++ b/app/src/main/kotlin/org/fossify/gallery/helpers/MyGlideImageDecoder.kt @@ -1,4 +1,4 @@ -package com.simplemobiletools.gallery.pro.helpers +package org.fossify.gallery.helpers import android.content.Context import android.graphics.Bitmap diff --git a/app/src/main/kotlin/com/simplemobiletools/gallery/pro/helpers/MyWidgetProvider.kt b/app/src/main/kotlin/org/fossify/gallery/helpers/MyWidgetProvider.kt similarity index 82% rename from app/src/main/kotlin/com/simplemobiletools/gallery/pro/helpers/MyWidgetProvider.kt rename to app/src/main/kotlin/org/fossify/gallery/helpers/MyWidgetProvider.kt index 6dfc107ec..60889d70c 100644 --- a/app/src/main/kotlin/com/simplemobiletools/gallery/pro/helpers/MyWidgetProvider.kt +++ b/app/src/main/kotlin/org/fossify/gallery/helpers/MyWidgetProvider.kt @@ -1,4 +1,4 @@ -package com.simplemobiletools.gallery.pro.helpers +package org.fossify.gallery.helpers import android.app.PendingIntent import android.appwidget.AppWidgetManager @@ -10,18 +10,18 @@ import android.widget.RemoteViews import com.bumptech.glide.Glide import com.bumptech.glide.load.engine.DiskCacheStrategy import com.bumptech.glide.request.RequestOptions -import com.simplemobiletools.commons.extensions.applyColorFilter -import com.simplemobiletools.commons.extensions.getFileSignature -import com.simplemobiletools.commons.extensions.setText -import com.simplemobiletools.commons.extensions.setVisibleIf -import com.simplemobiletools.commons.helpers.ensureBackgroundThread -import com.simplemobiletools.gallery.pro.R -import com.simplemobiletools.gallery.pro.activities.MediaActivity -import com.simplemobiletools.gallery.pro.extensions.config -import com.simplemobiletools.gallery.pro.extensions.directoryDB -import com.simplemobiletools.gallery.pro.extensions.getFolderNameFromPath -import com.simplemobiletools.gallery.pro.extensions.widgetsDB -import com.simplemobiletools.gallery.pro.models.Widget +import org.fossify.commons.extensions.applyColorFilter +import org.fossify.commons.extensions.getFileSignature +import org.fossify.commons.extensions.setText +import org.fossify.commons.extensions.setVisibleIf +import org.fossify.commons.helpers.ensureBackgroundThread +import org.fossify.gallery.R +import org.fossify.gallery.activities.MediaActivity +import org.fossify.gallery.extensions.config +import org.fossify.gallery.extensions.directoryDB +import org.fossify.gallery.extensions.getFolderNameFromPath +import org.fossify.gallery.extensions.widgetsDB +import org.fossify.gallery.models.Widget class MyWidgetProvider : AppWidgetProvider() { private fun setupAppOpenIntent(context: Context, views: RemoteViews, id: Int, widget: Widget) { diff --git a/app/src/main/kotlin/com/simplemobiletools/gallery/pro/helpers/PicassoRegionDecoder.kt b/app/src/main/kotlin/org/fossify/gallery/helpers/PicassoRegionDecoder.kt similarity index 97% rename from app/src/main/kotlin/com/simplemobiletools/gallery/pro/helpers/PicassoRegionDecoder.kt rename to app/src/main/kotlin/org/fossify/gallery/helpers/PicassoRegionDecoder.kt index 35a7c6cfc..b124c9c1b 100644 --- a/app/src/main/kotlin/com/simplemobiletools/gallery/pro/helpers/PicassoRegionDecoder.kt +++ b/app/src/main/kotlin/org/fossify/gallery/helpers/PicassoRegionDecoder.kt @@ -1,4 +1,4 @@ -package com.simplemobiletools.gallery.pro.helpers +package org.fossify.gallery.helpers import android.content.Context import android.graphics.* diff --git a/app/src/main/kotlin/com/simplemobiletools/gallery/pro/helpers/PicassoRoundedCornersTransformation.kt b/app/src/main/kotlin/org/fossify/gallery/helpers/PicassoRoundedCornersTransformation.kt similarity index 95% rename from app/src/main/kotlin/com/simplemobiletools/gallery/pro/helpers/PicassoRoundedCornersTransformation.kt rename to app/src/main/kotlin/org/fossify/gallery/helpers/PicassoRoundedCornersTransformation.kt index 26ee0584d..0914eced8 100644 --- a/app/src/main/kotlin/com/simplemobiletools/gallery/pro/helpers/PicassoRoundedCornersTransformation.kt +++ b/app/src/main/kotlin/org/fossify/gallery/helpers/PicassoRoundedCornersTransformation.kt @@ -1,4 +1,4 @@ -package com.simplemobiletools.gallery.pro.helpers +package org.fossify.gallery.helpers import android.graphics.* import com.squareup.picasso.Transformation diff --git a/app/src/main/kotlin/com/simplemobiletools/gallery/pro/helpers/RotateTransformation.kt b/app/src/main/kotlin/org/fossify/gallery/helpers/RotateTransformation.kt similarity index 93% rename from app/src/main/kotlin/com/simplemobiletools/gallery/pro/helpers/RotateTransformation.kt rename to app/src/main/kotlin/org/fossify/gallery/helpers/RotateTransformation.kt index 9fb0fd127..6a64f902a 100644 --- a/app/src/main/kotlin/com/simplemobiletools/gallery/pro/helpers/RotateTransformation.kt +++ b/app/src/main/kotlin/org/fossify/gallery/helpers/RotateTransformation.kt @@ -1,4 +1,4 @@ -package com.simplemobiletools.gallery.pro.helpers +package org.fossify.gallery.helpers import android.graphics.Bitmap import android.graphics.Matrix diff --git a/app/src/main/kotlin/com/simplemobiletools/gallery/pro/interfaces/DateTakensDao.kt b/app/src/main/kotlin/org/fossify/gallery/interfaces/DateTakensDao.kt similarity index 84% rename from app/src/main/kotlin/com/simplemobiletools/gallery/pro/interfaces/DateTakensDao.kt rename to app/src/main/kotlin/org/fossify/gallery/interfaces/DateTakensDao.kt index 5041727e9..7ff933e96 100644 --- a/app/src/main/kotlin/com/simplemobiletools/gallery/pro/interfaces/DateTakensDao.kt +++ b/app/src/main/kotlin/org/fossify/gallery/interfaces/DateTakensDao.kt @@ -1,10 +1,10 @@ -package com.simplemobiletools.gallery.pro.interfaces +package org.fossify.gallery.interfaces import androidx.room.Dao import androidx.room.Insert import androidx.room.OnConflictStrategy import androidx.room.Query -import com.simplemobiletools.gallery.pro.models.DateTaken +import org.fossify.gallery.models.DateTaken @Dao interface DateTakensDao { diff --git a/app/src/main/kotlin/com/simplemobiletools/gallery/pro/interfaces/DirectoryDao.kt b/app/src/main/kotlin/org/fossify/gallery/interfaces/DirectoryDao.kt similarity index 89% rename from app/src/main/kotlin/com/simplemobiletools/gallery/pro/interfaces/DirectoryDao.kt rename to app/src/main/kotlin/org/fossify/gallery/interfaces/DirectoryDao.kt index aa0aaaaca..99179c166 100644 --- a/app/src/main/kotlin/com/simplemobiletools/gallery/pro/interfaces/DirectoryDao.kt +++ b/app/src/main/kotlin/org/fossify/gallery/interfaces/DirectoryDao.kt @@ -1,11 +1,11 @@ -package com.simplemobiletools.gallery.pro.interfaces +package org.fossify.gallery.interfaces import androidx.room.Dao import androidx.room.Insert import androidx.room.OnConflictStrategy import androidx.room.Query -import com.simplemobiletools.gallery.pro.helpers.RECYCLE_BIN -import com.simplemobiletools.gallery.pro.models.Directory +import org.fossify.gallery.helpers.RECYCLE_BIN +import org.fossify.gallery.models.Directory @Dao interface DirectoryDao { diff --git a/app/src/main/kotlin/com/simplemobiletools/gallery/pro/interfaces/DirectoryOperationsListener.kt b/app/src/main/kotlin/org/fossify/gallery/interfaces/DirectoryOperationsListener.kt similarity index 67% rename from app/src/main/kotlin/com/simplemobiletools/gallery/pro/interfaces/DirectoryOperationsListener.kt rename to app/src/main/kotlin/org/fossify/gallery/interfaces/DirectoryOperationsListener.kt index b4f265969..b3db2b64a 100644 --- a/app/src/main/kotlin/com/simplemobiletools/gallery/pro/interfaces/DirectoryOperationsListener.kt +++ b/app/src/main/kotlin/org/fossify/gallery/interfaces/DirectoryOperationsListener.kt @@ -1,6 +1,6 @@ -package com.simplemobiletools.gallery.pro.interfaces +package org.fossify.gallery.interfaces -import com.simplemobiletools.gallery.pro.models.Directory +import org.fossify.gallery.models.Directory import java.io.File interface DirectoryOperationsListener { diff --git a/app/src/main/kotlin/com/simplemobiletools/gallery/pro/interfaces/FavoritesDao.kt b/app/src/main/kotlin/org/fossify/gallery/interfaces/FavoritesDao.kt similarity index 90% rename from app/src/main/kotlin/com/simplemobiletools/gallery/pro/interfaces/FavoritesDao.kt rename to app/src/main/kotlin/org/fossify/gallery/interfaces/FavoritesDao.kt index 39a4c4530..6402a23b9 100644 --- a/app/src/main/kotlin/com/simplemobiletools/gallery/pro/interfaces/FavoritesDao.kt +++ b/app/src/main/kotlin/org/fossify/gallery/interfaces/FavoritesDao.kt @@ -1,10 +1,10 @@ -package com.simplemobiletools.gallery.pro.interfaces +package org.fossify.gallery.interfaces import androidx.room.Dao import androidx.room.Insert import androidx.room.OnConflictStrategy import androidx.room.Query -import com.simplemobiletools.gallery.pro.models.Favorite +import org.fossify.gallery.models.Favorite @Dao interface FavoritesDao { diff --git a/app/src/main/kotlin/com/simplemobiletools/gallery/pro/interfaces/MediaOperationsListener.kt b/app/src/main/kotlin/org/fossify/gallery/interfaces/MediaOperationsListener.kt similarity index 60% rename from app/src/main/kotlin/com/simplemobiletools/gallery/pro/interfaces/MediaOperationsListener.kt rename to app/src/main/kotlin/org/fossify/gallery/interfaces/MediaOperationsListener.kt index 26a61b0aa..89b2d8ec2 100644 --- a/app/src/main/kotlin/com/simplemobiletools/gallery/pro/interfaces/MediaOperationsListener.kt +++ b/app/src/main/kotlin/org/fossify/gallery/interfaces/MediaOperationsListener.kt @@ -1,7 +1,7 @@ -package com.simplemobiletools.gallery.pro.interfaces +package org.fossify.gallery.interfaces -import com.simplemobiletools.commons.models.FileDirItem -import com.simplemobiletools.gallery.pro.models.ThumbnailItem +import org.fossify.commons.models.FileDirItem +import org.fossify.gallery.models.ThumbnailItem interface MediaOperationsListener { fun refreshItems() diff --git a/app/src/main/kotlin/com/simplemobiletools/gallery/pro/interfaces/MediumDao.kt b/app/src/main/kotlin/org/fossify/gallery/interfaces/MediumDao.kt similarity index 95% rename from app/src/main/kotlin/com/simplemobiletools/gallery/pro/interfaces/MediumDao.kt rename to app/src/main/kotlin/org/fossify/gallery/interfaces/MediumDao.kt index 22bd3af6a..01f03a848 100644 --- a/app/src/main/kotlin/com/simplemobiletools/gallery/pro/interfaces/MediumDao.kt +++ b/app/src/main/kotlin/org/fossify/gallery/interfaces/MediumDao.kt @@ -1,7 +1,7 @@ -package com.simplemobiletools.gallery.pro.interfaces +package org.fossify.gallery.interfaces import androidx.room.* -import com.simplemobiletools.gallery.pro.models.Medium +import org.fossify.gallery.models.Medium @Dao interface MediumDao { diff --git a/app/src/main/kotlin/com/simplemobiletools/gallery/pro/interfaces/WidgetsDao.kt b/app/src/main/kotlin/org/fossify/gallery/interfaces/WidgetsDao.kt similarity index 79% rename from app/src/main/kotlin/com/simplemobiletools/gallery/pro/interfaces/WidgetsDao.kt rename to app/src/main/kotlin/org/fossify/gallery/interfaces/WidgetsDao.kt index b6ecb2492..1bf13086f 100644 --- a/app/src/main/kotlin/com/simplemobiletools/gallery/pro/interfaces/WidgetsDao.kt +++ b/app/src/main/kotlin/org/fossify/gallery/interfaces/WidgetsDao.kt @@ -1,10 +1,10 @@ -package com.simplemobiletools.gallery.pro.interfaces +package org.fossify.gallery.interfaces import androidx.room.Dao import androidx.room.Insert import androidx.room.OnConflictStrategy import androidx.room.Query -import com.simplemobiletools.gallery.pro.models.Widget +import org.fossify.gallery.models.Widget @Dao interface WidgetsDao { diff --git a/app/src/main/kotlin/com/simplemobiletools/gallery/pro/jobs/NewPhotoFetcher.kt b/app/src/main/kotlin/org/fossify/gallery/jobs/NewPhotoFetcher.kt similarity index 92% rename from app/src/main/kotlin/com/simplemobiletools/gallery/pro/jobs/NewPhotoFetcher.kt rename to app/src/main/kotlin/org/fossify/gallery/jobs/NewPhotoFetcher.kt index ad91c0d96..db311d036 100644 --- a/app/src/main/kotlin/com/simplemobiletools/gallery/pro/jobs/NewPhotoFetcher.kt +++ b/app/src/main/kotlin/org/fossify/gallery/jobs/NewPhotoFetcher.kt @@ -1,4 +1,4 @@ -package com.simplemobiletools.gallery.pro.jobs +package org.fossify.gallery.jobs import android.annotation.TargetApi import android.app.job.JobInfo @@ -15,11 +15,11 @@ import android.os.Handler import android.provider.MediaStore import android.provider.MediaStore.Images import android.provider.MediaStore.Video -import com.simplemobiletools.commons.extensions.getParentPath -import com.simplemobiletools.commons.extensions.getStringValue -import com.simplemobiletools.commons.helpers.ensureBackgroundThread -import com.simplemobiletools.gallery.pro.extensions.addPathToDB -import com.simplemobiletools.gallery.pro.extensions.updateDirectoryPath +import org.fossify.commons.extensions.getParentPath +import org.fossify.commons.extensions.getStringValue +import org.fossify.commons.helpers.ensureBackgroundThread +import org.fossify.gallery.extensions.addPathToDB +import org.fossify.gallery.extensions.updateDirectoryPath // based on https://developer.android.com/reference/android/app/job/JobInfo.Builder.html#addTriggerContentUri(android.app.job.JobInfo.TriggerContentUri) @TargetApi(Build.VERSION_CODES.N) diff --git a/app/src/main/kotlin/com/simplemobiletools/gallery/pro/models/AlbumCover.kt b/app/src/main/kotlin/org/fossify/gallery/models/AlbumCover.kt similarity index 54% rename from app/src/main/kotlin/com/simplemobiletools/gallery/pro/models/AlbumCover.kt rename to app/src/main/kotlin/org/fossify/gallery/models/AlbumCover.kt index c4afd11b1..8aca118dc 100644 --- a/app/src/main/kotlin/com/simplemobiletools/gallery/pro/models/AlbumCover.kt +++ b/app/src/main/kotlin/org/fossify/gallery/models/AlbumCover.kt @@ -1,3 +1,3 @@ -package com.simplemobiletools.gallery.pro.models +package org.fossify.gallery.models data class AlbumCover(val path: String, val tmb: String) diff --git a/app/src/main/kotlin/com/simplemobiletools/gallery/pro/models/DateTaken.kt b/app/src/main/kotlin/org/fossify/gallery/models/DateTaken.kt similarity index 94% rename from app/src/main/kotlin/com/simplemobiletools/gallery/pro/models/DateTaken.kt rename to app/src/main/kotlin/org/fossify/gallery/models/DateTaken.kt index be3be7100..1594d1ae9 100644 --- a/app/src/main/kotlin/com/simplemobiletools/gallery/pro/models/DateTaken.kt +++ b/app/src/main/kotlin/org/fossify/gallery/models/DateTaken.kt @@ -1,4 +1,4 @@ -package com.simplemobiletools.gallery.pro.models +package org.fossify.gallery.models import androidx.room.ColumnInfo import androidx.room.Entity diff --git a/app/src/main/kotlin/com/simplemobiletools/gallery/pro/models/Directory.kt b/app/src/main/kotlin/org/fossify/gallery/models/Directory.kt similarity index 86% rename from app/src/main/kotlin/com/simplemobiletools/gallery/pro/models/Directory.kt rename to app/src/main/kotlin/org/fossify/gallery/models/Directory.kt index 702c36091..21b5775bc 100644 --- a/app/src/main/kotlin/com/simplemobiletools/gallery/pro/models/Directory.kt +++ b/app/src/main/kotlin/org/fossify/gallery/models/Directory.kt @@ -1,12 +1,12 @@ -package com.simplemobiletools.gallery.pro.models +package org.fossify.gallery.models import android.content.Context import androidx.room.* import com.bumptech.glide.signature.ObjectKey -import com.simplemobiletools.commons.extensions.formatDate -import com.simplemobiletools.commons.extensions.formatSize -import com.simplemobiletools.commons.helpers.* -import com.simplemobiletools.gallery.pro.helpers.RECYCLE_BIN +import org.fossify.commons.extensions.formatDate +import org.fossify.commons.extensions.formatSize +import org.fossify.commons.helpers.* +import org.fossify.gallery.helpers.RECYCLE_BIN @Entity(tableName = "directories", indices = [Index(value = ["path"], unique = true)]) data class Directory( diff --git a/app/src/main/kotlin/com/simplemobiletools/gallery/pro/models/Favorite.kt b/app/src/main/kotlin/org/fossify/gallery/models/Favorite.kt similarity index 90% rename from app/src/main/kotlin/com/simplemobiletools/gallery/pro/models/Favorite.kt rename to app/src/main/kotlin/org/fossify/gallery/models/Favorite.kt index a1bd56ac3..023a73b40 100644 --- a/app/src/main/kotlin/com/simplemobiletools/gallery/pro/models/Favorite.kt +++ b/app/src/main/kotlin/org/fossify/gallery/models/Favorite.kt @@ -1,4 +1,4 @@ -package com.simplemobiletools.gallery.pro.models +package org.fossify.gallery.models import androidx.room.ColumnInfo import androidx.room.Entity diff --git a/app/src/main/kotlin/com/simplemobiletools/gallery/pro/models/FilterItem.kt b/app/src/main/kotlin/org/fossify/gallery/models/FilterItem.kt similarity index 75% rename from app/src/main/kotlin/com/simplemobiletools/gallery/pro/models/FilterItem.kt rename to app/src/main/kotlin/org/fossify/gallery/models/FilterItem.kt index ce826e57e..b40fa6000 100644 --- a/app/src/main/kotlin/com/simplemobiletools/gallery/pro/models/FilterItem.kt +++ b/app/src/main/kotlin/org/fossify/gallery/models/FilterItem.kt @@ -1,4 +1,4 @@ -package com.simplemobiletools.gallery.pro.models +package org.fossify.gallery.models import android.graphics.Bitmap import com.zomato.photofilters.imageprocessors.Filter diff --git a/app/src/main/kotlin/com/simplemobiletools/gallery/pro/models/Medium.kt b/app/src/main/kotlin/org/fossify/gallery/models/Medium.kt similarity index 90% rename from app/src/main/kotlin/com/simplemobiletools/gallery/pro/models/Medium.kt rename to app/src/main/kotlin/org/fossify/gallery/models/Medium.kt index e14d97272..076db8f64 100644 --- a/app/src/main/kotlin/com/simplemobiletools/gallery/pro/models/Medium.kt +++ b/app/src/main/kotlin/org/fossify/gallery/models/Medium.kt @@ -1,12 +1,12 @@ -package com.simplemobiletools.gallery.pro.models +package org.fossify.gallery.models import android.content.Context import androidx.room.* import com.bumptech.glide.signature.ObjectKey -import com.simplemobiletools.commons.extensions.* -import com.simplemobiletools.commons.helpers.* -import com.simplemobiletools.commons.models.FileDirItem -import com.simplemobiletools.gallery.pro.helpers.* +import org.fossify.commons.extensions.* +import org.fossify.commons.helpers.* +import org.fossify.commons.models.FileDirItem +import org.fossify.gallery.helpers.* import java.io.File import java.io.Serializable import java.util.Calendar @@ -54,7 +54,7 @@ data class Medium( fun isHidden() = name.startsWith('.') - fun isHeic() = name.toLowerCase().endsWith(".heic") || name.toLowerCase().endsWith(".heif") + fun isHeic() = name.lowercase(Locale.getDefault()).endsWith(".heic") || name.lowercase(Locale.getDefault()).endsWith(".heif") fun getBubbleText(sorting: Int, context: Context, dateFormat: String, timeFormat: String) = when { sorting and SORT_BY_NAME != 0 -> name @@ -72,7 +72,7 @@ data class Medium( groupBy and GROUP_BY_DATE_TAKEN_DAILY != 0 -> getDayStartTS(taken, false) groupBy and GROUP_BY_DATE_TAKEN_MONTHLY != 0 -> getDayStartTS(taken, true) groupBy and GROUP_BY_FILE_TYPE != 0 -> type.toString() - groupBy and GROUP_BY_EXTENSION != 0 -> name.getFilenameExtension().toLowerCase() + groupBy and GROUP_BY_EXTENSION != 0 -> name.getFilenameExtension().lowercase(Locale.getDefault()) groupBy and GROUP_BY_FOLDER != 0 -> parentPath else -> "" } diff --git a/app/src/main/kotlin/com/simplemobiletools/gallery/pro/models/PaintOptions.kt b/app/src/main/kotlin/org/fossify/gallery/models/PaintOptions.kt similarity index 70% rename from app/src/main/kotlin/com/simplemobiletools/gallery/pro/models/PaintOptions.kt rename to app/src/main/kotlin/org/fossify/gallery/models/PaintOptions.kt index fc1cacb2a..99f09a204 100644 --- a/app/src/main/kotlin/com/simplemobiletools/gallery/pro/models/PaintOptions.kt +++ b/app/src/main/kotlin/org/fossify/gallery/models/PaintOptions.kt @@ -1,4 +1,4 @@ -package com.simplemobiletools.gallery.pro.models +package org.fossify.gallery.models import android.graphics.Color diff --git a/app/src/main/kotlin/org/fossify/gallery/models/ThumbnailItem.kt b/app/src/main/kotlin/org/fossify/gallery/models/ThumbnailItem.kt new file mode 100644 index 000000000..f3f5e09fd --- /dev/null +++ b/app/src/main/kotlin/org/fossify/gallery/models/ThumbnailItem.kt @@ -0,0 +1,3 @@ +package org.fossify.gallery.models + +open class ThumbnailItem diff --git a/app/src/main/kotlin/com/simplemobiletools/gallery/pro/models/ThumbnailSection.kt b/app/src/main/kotlin/org/fossify/gallery/models/ThumbnailSection.kt similarity index 57% rename from app/src/main/kotlin/com/simplemobiletools/gallery/pro/models/ThumbnailSection.kt rename to app/src/main/kotlin/org/fossify/gallery/models/ThumbnailSection.kt index 1655cad89..b0d88960f 100644 --- a/app/src/main/kotlin/com/simplemobiletools/gallery/pro/models/ThumbnailSection.kt +++ b/app/src/main/kotlin/org/fossify/gallery/models/ThumbnailSection.kt @@ -1,3 +1,3 @@ -package com.simplemobiletools.gallery.pro.models +package org.fossify.gallery.models data class ThumbnailSection(val title: String) : ThumbnailItem() diff --git a/app/src/main/kotlin/com/simplemobiletools/gallery/pro/models/Widget.kt b/app/src/main/kotlin/org/fossify/gallery/models/Widget.kt similarity index 89% rename from app/src/main/kotlin/com/simplemobiletools/gallery/pro/models/Widget.kt rename to app/src/main/kotlin/org/fossify/gallery/models/Widget.kt index 2efa88f34..ba8142ba8 100644 --- a/app/src/main/kotlin/com/simplemobiletools/gallery/pro/models/Widget.kt +++ b/app/src/main/kotlin/org/fossify/gallery/models/Widget.kt @@ -1,4 +1,4 @@ -package com.simplemobiletools.gallery.pro.models +package org.fossify.gallery.models import androidx.room.ColumnInfo import androidx.room.Entity diff --git a/app/src/main/kotlin/com/simplemobiletools/gallery/pro/receivers/BootCompletedReceiver.kt b/app/src/main/kotlin/org/fossify/gallery/receivers/BootCompletedReceiver.kt similarity index 60% rename from app/src/main/kotlin/com/simplemobiletools/gallery/pro/receivers/BootCompletedReceiver.kt rename to app/src/main/kotlin/org/fossify/gallery/receivers/BootCompletedReceiver.kt index f8aae1326..97cfe03ec 100644 --- a/app/src/main/kotlin/com/simplemobiletools/gallery/pro/receivers/BootCompletedReceiver.kt +++ b/app/src/main/kotlin/org/fossify/gallery/receivers/BootCompletedReceiver.kt @@ -1,11 +1,11 @@ -package com.simplemobiletools.gallery.pro.receivers +package org.fossify.gallery.receivers import android.content.BroadcastReceiver import android.content.Context import android.content.Intent -import com.simplemobiletools.commons.helpers.ensureBackgroundThread -import com.simplemobiletools.gallery.pro.extensions.updateDirectoryPath -import com.simplemobiletools.gallery.pro.helpers.MediaFetcher +import org.fossify.commons.helpers.ensureBackgroundThread +import org.fossify.gallery.extensions.updateDirectoryPath +import org.fossify.gallery.helpers.MediaFetcher class BootCompletedReceiver : BroadcastReceiver() { override fun onReceive(context: Context, intent: Intent) { diff --git a/app/src/main/kotlin/com/simplemobiletools/gallery/pro/receivers/RefreshMediaReceiver.kt b/app/src/main/kotlin/org/fossify/gallery/receivers/RefreshMediaReceiver.kt similarity index 65% rename from app/src/main/kotlin/com/simplemobiletools/gallery/pro/receivers/RefreshMediaReceiver.kt rename to app/src/main/kotlin/org/fossify/gallery/receivers/RefreshMediaReceiver.kt index 3aa81b2f5..276b8263e 100644 --- a/app/src/main/kotlin/com/simplemobiletools/gallery/pro/receivers/RefreshMediaReceiver.kt +++ b/app/src/main/kotlin/org/fossify/gallery/receivers/RefreshMediaReceiver.kt @@ -1,10 +1,10 @@ -package com.simplemobiletools.gallery.pro.receivers +package org.fossify.gallery.receivers import android.content.BroadcastReceiver import android.content.Context import android.content.Intent -import com.simplemobiletools.commons.helpers.REFRESH_PATH -import com.simplemobiletools.gallery.pro.extensions.addPathToDB +import org.fossify.commons.helpers.REFRESH_PATH +import org.fossify.gallery.extensions.addPathToDB class RefreshMediaReceiver : BroadcastReceiver() { override fun onReceive(context: Context, intent: Intent) { diff --git a/app/src/main/kotlin/com/simplemobiletools/gallery/pro/svg/SvgDecoder.kt b/app/src/main/kotlin/org/fossify/gallery/svg/SvgDecoder.kt similarity index 89% rename from app/src/main/kotlin/com/simplemobiletools/gallery/pro/svg/SvgDecoder.kt rename to app/src/main/kotlin/org/fossify/gallery/svg/SvgDecoder.kt index 7bc47c9f8..e7b83906a 100644 --- a/app/src/main/kotlin/com/simplemobiletools/gallery/pro/svg/SvgDecoder.kt +++ b/app/src/main/kotlin/org/fossify/gallery/svg/SvgDecoder.kt @@ -1,4 +1,4 @@ -package com.simplemobiletools.gallery.pro.svg +package org.fossify.gallery.svg import com.bumptech.glide.load.Options import com.bumptech.glide.load.ResourceDecoder @@ -15,7 +15,7 @@ class SvgDecoder : ResourceDecoder { override fun handles(source: InputStream, options: Options) = true @Throws(IOException::class) - override fun decode(source: InputStream, width: Int, height: Int, options: Options): Resource? { + override fun decode(source: InputStream, width: Int, height: Int, options: Options): Resource { try { val svg = SVG.getFromInputStream(source) return SimpleResource(svg) diff --git a/app/src/main/kotlin/com/simplemobiletools/gallery/pro/svg/SvgDrawableTranscoder.kt b/app/src/main/kotlin/org/fossify/gallery/svg/SvgDrawableTranscoder.kt similarity index 87% rename from app/src/main/kotlin/com/simplemobiletools/gallery/pro/svg/SvgDrawableTranscoder.kt rename to app/src/main/kotlin/org/fossify/gallery/svg/SvgDrawableTranscoder.kt index e447136e9..dfd343514 100644 --- a/app/src/main/kotlin/com/simplemobiletools/gallery/pro/svg/SvgDrawableTranscoder.kt +++ b/app/src/main/kotlin/org/fossify/gallery/svg/SvgDrawableTranscoder.kt @@ -1,4 +1,4 @@ -package com.simplemobiletools.gallery.pro.svg +package org.fossify.gallery.svg import android.graphics.drawable.PictureDrawable import com.bumptech.glide.load.Options @@ -8,7 +8,7 @@ import com.bumptech.glide.load.resource.transcode.ResourceTranscoder import com.caverock.androidsvg.SVG class SvgDrawableTranscoder : ResourceTranscoder { - override fun transcode(toTranscode: Resource, options: Options): Resource? { + override fun transcode(toTranscode: Resource, options: Options): Resource { val svg = toTranscode.get() val picture = svg.renderToPicture() val drawable = PictureDrawable(picture) diff --git a/app/src/main/kotlin/com/simplemobiletools/gallery/pro/svg/SvgModule.kt b/app/src/main/kotlin/org/fossify/gallery/svg/SvgModule.kt similarity index 93% rename from app/src/main/kotlin/com/simplemobiletools/gallery/pro/svg/SvgModule.kt rename to app/src/main/kotlin/org/fossify/gallery/svg/SvgModule.kt index ee15a2274..e8ed7bb93 100644 --- a/app/src/main/kotlin/com/simplemobiletools/gallery/pro/svg/SvgModule.kt +++ b/app/src/main/kotlin/org/fossify/gallery/svg/SvgModule.kt @@ -1,4 +1,4 @@ -package com.simplemobiletools.gallery.pro.svg +package org.fossify.gallery.svg import android.content.Context import android.graphics.drawable.PictureDrawable diff --git a/app/src/main/kotlin/com/simplemobiletools/gallery/pro/svg/SvgSoftwareLayerSetter.kt b/app/src/main/kotlin/org/fossify/gallery/svg/SvgSoftwareLayerSetter.kt similarity index 95% rename from app/src/main/kotlin/com/simplemobiletools/gallery/pro/svg/SvgSoftwareLayerSetter.kt rename to app/src/main/kotlin/org/fossify/gallery/svg/SvgSoftwareLayerSetter.kt index 777f5666b..d2a80b75a 100644 --- a/app/src/main/kotlin/com/simplemobiletools/gallery/pro/svg/SvgSoftwareLayerSetter.kt +++ b/app/src/main/kotlin/org/fossify/gallery/svg/SvgSoftwareLayerSetter.kt @@ -1,4 +1,4 @@ -package com.simplemobiletools.gallery.pro.svg +package org.fossify.gallery.svg import android.graphics.drawable.PictureDrawable import android.widget.ImageView diff --git a/app/src/main/kotlin/com/simplemobiletools/gallery/pro/views/EditorDrawCanvas.kt b/app/src/main/kotlin/org/fossify/gallery/views/EditorDrawCanvas.kt similarity index 94% rename from app/src/main/kotlin/com/simplemobiletools/gallery/pro/views/EditorDrawCanvas.kt rename to app/src/main/kotlin/org/fossify/gallery/views/EditorDrawCanvas.kt index 9439217bc..5e2db52a6 100644 --- a/app/src/main/kotlin/com/simplemobiletools/gallery/pro/views/EditorDrawCanvas.kt +++ b/app/src/main/kotlin/org/fossify/gallery/views/EditorDrawCanvas.kt @@ -1,13 +1,13 @@ -package com.simplemobiletools.gallery.pro.views +package org.fossify.gallery.views import android.content.Context import android.graphics.* import android.util.AttributeSet import android.view.MotionEvent import android.view.View -import com.simplemobiletools.commons.extensions.getProperPrimaryColor -import com.simplemobiletools.gallery.pro.R -import com.simplemobiletools.gallery.pro.models.PaintOptions +import org.fossify.commons.extensions.getProperPrimaryColor +import org.fossify.gallery.R +import org.fossify.gallery.models.PaintOptions class EditorDrawCanvas(context: Context, attrs: AttributeSet) : View(context, attrs) { private var mCurX = 0f diff --git a/app/src/main/kotlin/com/simplemobiletools/gallery/pro/views/InstantItemSwitch.kt b/app/src/main/kotlin/org/fossify/gallery/views/InstantItemSwitch.kt similarity index 90% rename from app/src/main/kotlin/com/simplemobiletools/gallery/pro/views/InstantItemSwitch.kt rename to app/src/main/kotlin/org/fossify/gallery/views/InstantItemSwitch.kt index 269a66289..917a228f5 100644 --- a/app/src/main/kotlin/com/simplemobiletools/gallery/pro/views/InstantItemSwitch.kt +++ b/app/src/main/kotlin/org/fossify/gallery/views/InstantItemSwitch.kt @@ -1,13 +1,13 @@ -package com.simplemobiletools.gallery.pro.views +package org.fossify.gallery.views import android.content.Context import android.util.AttributeSet import android.view.MotionEvent import android.view.ViewGroup import android.widget.RelativeLayout -import com.simplemobiletools.gallery.pro.helpers.CLICK_MAX_DISTANCE -import com.simplemobiletools.gallery.pro.helpers.CLICK_MAX_DURATION -import com.simplemobiletools.gallery.pro.helpers.DRAG_THRESHOLD +import org.fossify.gallery.helpers.CLICK_MAX_DISTANCE +import org.fossify.gallery.helpers.CLICK_MAX_DURATION +import org.fossify.gallery.helpers.DRAG_THRESHOLD // handle only one finger clicks, pass other events to the parent view and ignore it when received again class InstantItemSwitch(context: Context, attrs: AttributeSet) : RelativeLayout(context, attrs) { diff --git a/app/src/main/kotlin/com/simplemobiletools/gallery/pro/views/MediaSideScroll.kt b/app/src/main/kotlin/org/fossify/gallery/views/MediaSideScroll.kt similarity index 96% rename from app/src/main/kotlin/com/simplemobiletools/gallery/pro/views/MediaSideScroll.kt rename to app/src/main/kotlin/org/fossify/gallery/views/MediaSideScroll.kt index ecc251374..c41d920c9 100644 --- a/app/src/main/kotlin/com/simplemobiletools/gallery/pro/views/MediaSideScroll.kt +++ b/app/src/main/kotlin/org/fossify/gallery/views/MediaSideScroll.kt @@ -1,4 +1,4 @@ -package com.simplemobiletools.gallery.pro.views +package org.fossify.gallery.views import android.app.Activity import android.content.Context @@ -11,10 +11,10 @@ import android.view.MotionEvent import android.view.ViewGroup import android.widget.RelativeLayout import android.widget.TextView -import com.simplemobiletools.commons.extensions.onGlobalLayout -import com.simplemobiletools.gallery.pro.R -import com.simplemobiletools.gallery.pro.extensions.audioManager -import com.simplemobiletools.gallery.pro.helpers.DRAG_THRESHOLD +import org.fossify.commons.extensions.onGlobalLayout +import org.fossify.gallery.R +import org.fossify.gallery.extensions.audioManager +import org.fossify.gallery.helpers.DRAG_THRESHOLD // allow horizontal swipes through the layout, else it can cause glitches at zoomed in images class MediaSideScroll(context: Context, attrs: AttributeSet) : RelativeLayout(context, attrs) { diff --git a/app/src/main/res/layout/activity_edit.xml b/app/src/main/res/layout/activity_edit.xml index e3ba641dd..f38938a34 100644 --- a/app/src/main/res/layout/activity_edit.xml +++ b/app/src/main/res/layout/activity_edit.xml @@ -43,7 +43,7 @@ app:cropBackgroundColor="@color/crop_image_view_background" app:cropInitialCropWindowPaddingRatio="0" /> - - @@ -16,7 +16,7 @@ android:layout_height="wrap_content" app:layout_behavior="@string/appbar_scrolling_view_behavior"> - - - - diff --git a/app/src/main/res/layout/activity_manage_folders.xml b/app/src/main/res/layout/activity_manage_folders.xml index 98369adf7..d7eafe948 100644 --- a/app/src/main/res/layout/activity_manage_folders.xml +++ b/app/src/main/res/layout/activity_manage_folders.xml @@ -19,15 +19,15 @@ android:layout_height="wrap_content" android:layout_marginTop="?attr/actionBarSize"> - + app:layoutManager="org.fossify.commons.views.MyLinearLayoutManager" /> - - @@ -16,7 +16,7 @@ android:layout_height="wrap_content" app:layout_behavior="@string/appbar_scrolling_view_behavior"> - - - diff --git a/app/src/main/res/layout/activity_medium.xml b/app/src/main/res/layout/activity_medium.xml index 2a430109a..33901ccd1 100644 --- a/app/src/main/res/layout/activity_medium.xml +++ b/app/src/main/res/layout/activity_medium.xml @@ -5,7 +5,7 @@ android:layout_width="match_parent" android:layout_height="match_parent"> - diff --git a/app/src/main/res/layout/activity_search.xml b/app/src/main/res/layout/activity_search.xml index 3e95d607d..f7b75b207 100644 --- a/app/src/main/res/layout/activity_search.xml +++ b/app/src/main/res/layout/activity_search.xml @@ -5,7 +5,7 @@ android:layout_width="match_parent" android:layout_height="match_parent"> - @@ -16,7 +16,7 @@ android:layout_height="match_parent" app:layout_behavior="@string/appbar_scrolling_view_behavior"> - - diff --git a/app/src/main/res/layout/activity_settings.xml b/app/src/main/res/layout/activity_settings.xml index 08d5f7b3d..4e2014e1a 100644 --- a/app/src/main/res/layout/activity_settings.xml +++ b/app/src/main/res/layout/activity_settings.xml @@ -41,7 +41,7 @@ android:layout_width="match_parent" android:layout_height="wrap_content"> - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/app/src/main/res/layout/activity_widget_config.xml b/app/src/main/res/layout/activity_widget_config.xml index f9f9e8684..b8adbd414 100644 --- a/app/src/main/res/layout/activity_widget_config.xml +++ b/app/src/main/res/layout/activity_widget_config.xml @@ -25,7 +25,7 @@ android:layout_height="wrap_content" android:background="?attr/selectableItemBackground"> - - - - - - - - + app:layoutManager="org.fossify.commons.views.MyLinearLayoutManager" /> diff --git a/app/src/main/res/layout/bottom_editor_draw_actions.xml b/app/src/main/res/layout/bottom_editor_draw_actions.xml index 07fe2fb2c..618d00429 100644 --- a/app/src/main/res/layout/bottom_editor_draw_actions.xml +++ b/app/src/main/res/layout/bottom_editor_draw_actions.xml @@ -1,13 +1,12 @@ - - + app:layout_constraintTop_toTopOf="@+id/bottom_draw_color" /> + app:layout_constraintTop_toTopOf="parent" /> + app:layout_constraintTop_toTopOf="parent" /> + app:layout_constraintTop_toTopOf="parent" /> diff --git a/app/src/main/res/layout/bottom_video_time_holder.xml b/app/src/main/res/layout/bottom_video_time_holder.xml index 4bc0748b8..f5bd1e8ff 100644 --- a/app/src/main/res/layout/bottom_video_time_holder.xml +++ b/app/src/main/res/layout/bottom_video_time_holder.xml @@ -58,7 +58,7 @@ android:textColor="@android:color/white" tools:text="00:00" /> - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + - - - + diff --git a/app/src/main/res/layout/dialog_delete_with_remember.xml b/app/src/main/res/layout/dialog_delete_with_remember.xml index 24902b3d5..4429e3668 100644 --- a/app/src/main/res/layout/dialog_delete_with_remember.xml +++ b/app/src/main/res/layout/dialog_delete_with_remember.xml @@ -7,7 +7,7 @@ android:paddingTop="@dimen/big_margin" android:paddingRight="@dimen/big_margin"> - - - - - - - - - - - - - + diff --git a/app/src/main/res/layout/dialog_filter_media.xml b/app/src/main/res/layout/dialog_filter_media.xml index 0117f3c01..17c757104 100644 --- a/app/src/main/res/layout/dialog_filter_media.xml +++ b/app/src/main/res/layout/dialog_filter_media.xml @@ -12,7 +12,7 @@ android:paddingTop="@dimen/activity_margin" android:paddingRight="@dimen/activity_margin"> - - - - - - - - @@ -14,125 +13,125 @@ android:paddingTop="@dimen/medium_margin" android:paddingRight="@dimen/activity_margin"> - + android:text="@string/toggle_favorite" /> - + android:text="@string/edit" /> - + android:text="@string/share" /> - + android:text="@string/delete" /> - + android:text="@string/rotate" /> - + android:text="@string/properties" /> - + android:text="@string/change_orientation" /> - + android:text="@string/slideshow" /> - + android:text="@string/show_on_map" /> - + android:text="@string/toggle_file_visibility" /> - + android:text="@string/rename" /> - + android:text="@string/set_as" /> - + android:text="@string/copy" /> - + android:text="@string/move" /> - + android:text="@string/resize" /> diff --git a/app/src/main/res/layout/dialog_manage_extended_details.xml b/app/src/main/res/layout/dialog_manage_extended_details.xml index 610b21304..c9d5280e2 100644 --- a/app/src/main/res/layout/dialog_manage_extended_details.xml +++ b/app/src/main/res/layout/dialog_manage_extended_details.xml @@ -1,6 +1,5 @@ - @@ -14,77 +13,77 @@ android:paddingTop="@dimen/medium_margin" android:paddingRight="@dimen/activity_margin"> - + android:text="@string/filename" /> - + android:text="@string/path" /> - + android:text="@string/size" /> - + android:text="@string/resolution" /> - + android:text="@string/last_modified" /> - + android:text="@string/date_taken" /> - + android:text="@string/camera" /> - + android:text="@string/exif" /> - + android:text="@string/gps_coordinates" /> diff --git a/app/src/main/res/layout/dialog_medium_picker.xml b/app/src/main/res/layout/dialog_medium_picker.xml index 5e9a02d1c..9dd0c517a 100644 --- a/app/src/main/res/layout/dialog_medium_picker.xml +++ b/app/src/main/res/layout/dialog_medium_picker.xml @@ -10,12 +10,12 @@ android:layout_width="match_parent" android:layout_height="wrap_content"> - diff --git a/app/src/main/res/layout/dialog_other_aspect_ratio.xml b/app/src/main/res/layout/dialog_other_aspect_ratio.xml index 2a0643443..22ac070bd 100644 --- a/app/src/main/res/layout/dialog_other_aspect_ratio.xml +++ b/app/src/main/res/layout/dialog_other_aspect_ratio.xml @@ -22,7 +22,7 @@ android:layout_marginBottom="@dimen/medium_margin" android:layout_weight="1"> - - - - - - - - - - - - - - - + - - - + - - - + - - - + - - + - - + - - + diff --git a/app/src/main/res/layout/dialog_resize_multiple_images.xml b/app/src/main/res/layout/dialog_resize_multiple_images.xml index a9aa638fe..a4f3d35b7 100644 --- a/app/src/main/res/layout/dialog_resize_multiple_images.xml +++ b/app/src/main/res/layout/dialog_resize_multiple_images.xml @@ -14,7 +14,7 @@ app:layout_constraintStart_toStartOf="parent" app:layout_constraintTop_toTopOf="parent" /> - - + diff --git a/app/src/main/res/layout/dialog_save_as.xml b/app/src/main/res/layout/dialog_save_as.xml index 6f441d44a..ff0bc8d71 100644 --- a/app/src/main/res/layout/dialog_save_as.xml +++ b/app/src/main/res/layout/dialog_save_as.xml @@ -6,7 +6,7 @@ android:orientation="vertical" android:padding="@dimen/activity_margin"> - - + - - + - - + diff --git a/app/src/main/res/layout/dialog_slideshow.xml b/app/src/main/res/layout/dialog_slideshow.xml index e8ac16481..5caa9ea93 100644 --- a/app/src/main/res/layout/dialog_slideshow.xml +++ b/app/src/main/res/layout/dialog_slideshow.xml @@ -11,7 +11,7 @@ android:layout_height="wrap_content" android:orientation="vertical"> - - - + - - - - - - - - diff --git a/app/src/main/res/layout/directory_item_grid_square.xml b/app/src/main/res/layout/directory_item_grid_square.xml index 2d48c8c4d..b7d106c2d 100644 --- a/app/src/main/res/layout/directory_item_grid_square.xml +++ b/app/src/main/res/layout/directory_item_grid_square.xml @@ -8,7 +8,7 @@ android:focusable="true" android:padding="1px"> - diff --git a/app/src/main/res/layout/directory_item_list.xml b/app/src/main/res/layout/directory_item_list.xml index c46a655c4..b4ca9af7b 100644 --- a/app/src/main/res/layout/directory_item_list.xml +++ b/app/src/main/res/layout/directory_item_list.xml @@ -12,7 +12,7 @@ android:paddingTop="@dimen/small_margin" android:paddingBottom="@dimen/small_margin"> - diff --git a/app/src/main/res/layout/item_manage_folder.xml b/app/src/main/res/layout/item_manage_folder.xml index 496ad73d9..b01c30007 100644 --- a/app/src/main/res/layout/item_manage_folder.xml +++ b/app/src/main/res/layout/item_manage_folder.xml @@ -9,7 +9,7 @@ android:focusable="true" android:paddingStart="@dimen/activity_margin"> - - + app:layoutManager="org.fossify.commons.views.MyLinearLayoutManager" /> - - - - diff --git a/app/src/main/res/layout/photo_item_grid.xml b/app/src/main/res/layout/photo_item_grid.xml index 63a8fd64a..777369eda 100644 --- a/app/src/main/res/layout/photo_item_grid.xml +++ b/app/src/main/res/layout/photo_item_grid.xml @@ -7,7 +7,7 @@ android:clickable="true" android:focusable="true"> - @@ -34,9 +34,9 @@ android:layout_alignParentTop="true" android:layout_alignParentEnd="true" android:layout_margin="@dimen/small_margin" - android:padding="@dimen/small_margin" - android:gravity="end" android:background="@drawable/circle_black_background" + android:gravity="end" + android:padding="@dimen/small_margin" android:src="@drawable/ic_star_vector" android:visibility="gone" /> diff --git a/app/src/main/res/layout/photo_item_list.xml b/app/src/main/res/layout/photo_item_list.xml index a09968570..360c24f26 100644 --- a/app/src/main/res/layout/photo_item_list.xml +++ b/app/src/main/res/layout/photo_item_list.xml @@ -13,7 +13,7 @@ android:paddingTop="@dimen/small_margin" android:paddingBottom="@dimen/small_margin"> - diff --git a/app/src/main/res/layout/thumbnail_section.xml b/app/src/main/res/layout/thumbnail_section.xml index 65d51f7df..ca6422cfd 100644 --- a/app/src/main/res/layout/thumbnail_section.xml +++ b/app/src/main/res/layout/thumbnail_section.xml @@ -1,9 +1,8 @@ - + android:textSize="@dimen/bigger_text_size" /> diff --git a/app/src/main/res/layout/video_item_grid.xml b/app/src/main/res/layout/video_item_grid.xml index 65b8b00dd..c9cff3354 100644 --- a/app/src/main/res/layout/video_item_grid.xml +++ b/app/src/main/res/layout/video_item_grid.xml @@ -7,7 +7,7 @@ android:clickable="true" android:focusable="true"> - diff --git a/app/src/main/res/layout/video_item_list.xml b/app/src/main/res/layout/video_item_list.xml index b864b835b..3f0ad4db5 100644 --- a/app/src/main/res/layout/video_item_list.xml +++ b/app/src/main/res/layout/video_item_list.xml @@ -12,7 +12,7 @@ android:paddingTop="@dimen/small_margin" android:paddingBottom="@dimen/small_margin"> - @@ -24,9 +24,9 @@ android:layout_alignParentTop="true" android:layout_alignParentEnd="true" android:layout_margin="@dimen/smaller_margin" - android:padding="@dimen/tiny_margin" - android:gravity="end" android:background="@drawable/circle_black_background" + android:gravity="end" + android:padding="@dimen/tiny_margin" android:src="@drawable/ic_star_vector" android:visibility="gone" /> diff --git a/app/src/main/res/values/donottranslate.xml b/app/src/main/res/values/donottranslate.xml index 19127696d..bd6ae6f42 100644 --- a/app/src/main/res/values/donottranslate.xml +++ b/app/src/main/res/values/donottranslate.xml @@ -3,7 +3,7 @@ GIF RAW SVG - com.simplemobiletools.gallery.pro + org.fossify.gallery Allow temporarily showing excluded folders on Android 11+ diff --git a/app/src/main/res/xml/widget_info.xml b/app/src/main/res/xml/widget_info.xml index 6f2b56ed7..d3ea3bba9 100644 --- a/app/src/main/res/xml/widget_info.xml +++ b/app/src/main/res/xml/widget_info.xml @@ -1,6 +1,6 @@