Merge pull request #10 from FossifyOrg/fossify_rebranding

Rename package names
This commit is contained in:
Naveen Singh 2023-12-14 18:45:09 +05:30 committed by GitHub
commit f9522c3d3c
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
246 changed files with 1521 additions and 1574 deletions

View file

@ -101,7 +101,7 @@ android {
}
dependencies {
implementation(libs.simple.tools.commons)
implementation(libs.fossify.commons)
implementation(libs.android.image.cropper)
implementation(libs.exif)
implementation(libs.android.gif.drawable)

View file

@ -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

View file

@ -34,8 +34,8 @@
<uses-sdk tools:overrideLibrary="com.google.vr.widgets.common, com.google.vr.sdk.widgets.pano" />
<queries>
<package android:name="com.simplemobiletools.gallery.debug" />
<package android:name="com.simplemobiletools.gallery" />
<package android:name="org.fossify.gallery.debug" />
<package android:name="org.fossify.gallery" />
</queries>
<uses-feature
@ -43,7 +43,7 @@
android:required="false" />
<application
android:name=".App"
android:name="org.fossify.gallery.App"
android:allowBackup="true"
android:appCategory="image"
android:icon="@mipmap/ic_launcher"
@ -122,14 +122,14 @@
</activity>
<activity
android:name="com.simplemobiletools.commons.activities.AboutActivity"
android:name="org.fossify.commons.activities.AboutActivity"
android:configChanges="orientation"
android:exported="false"
android:label="@string/about"
android:parentActivityName=".activities.MainActivity" />
<activity
android:name="com.simplemobiletools.commons.activities.CustomizationActivity"
android:name="org.fossify.commons.activities.CustomizationActivity"
android:configChanges="orientation"
android:exported="false"
android:label="@string/customize_colors"
@ -223,7 +223,7 @@
</activity>
<activity
android:name=".activities.EditActivity"
android:name="org.fossify.gallery.activities.EditActivity"
android:configChanges="orientation"
android:exported="true"
android:label="@string/basic_editor">
@ -294,7 +294,7 @@
android:name=".receivers.RefreshMediaReceiver"
android:exported="true">
<intent-filter>
<action android:name="com.simplemobiletools.REFRESH_MEDIA" />
<action android:name="org.fossify.REFRESH_MEDIA" />
</intent-filter>
</receiver>

View file

@ -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 -> }
}
}
}

View file

@ -1,5 +0,0 @@
package com.simplemobiletools.gallery.pro.extensions
import com.simplemobiletools.commons.models.FileDirItem
fun FileDirItem.isDownloadsFolder() = path.isDownloadsFolder()

View file

@ -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

View file

@ -1,3 +0,0 @@
package com.simplemobiletools.gallery.pro.models
open class ThumbnailItem

View file

@ -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() {

View file

@ -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<Float, Float>? = 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()
}
}

View file

@ -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)

View file

@ -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 {

View file

@ -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 {

View file

@ -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,31 @@ 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.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 +160,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 +256,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 +356,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 +458,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,17 +509,6 @@ class MainActivity : SimpleActivity(), DirectoryOperationsListener {
mWasDefaultFolderChecked = true
}
if (isPackageInstalled("com.simplemobiletools.gallery")) {
ConfirmationDialog(
this,
"",
com.simplemobiletools.commons.R.string.upgraded_from_free_gallery,
com.simplemobiletools.commons.R.string.ok,
0,
false
) {}
}
checkOTGPath()
checkDefaultSpamFolders()
@ -532,7 +520,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 +647,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 +655,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 +684,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 +784,7 @@ class MainActivity : SimpleActivity(), DirectoryOperationsListener {
private fun changeColumnCount() {
val items = ArrayList<RadioItem>()
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 +959,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 +973,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 +1162,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 +1208,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)
@ -1505,16 +1490,6 @@ class MainActivity : SimpleActivity(), DirectoryOperationsListener {
private fun checkWhatsNewDialog() {
arrayListOf<Release>().apply {
add(Release(213, R.string.release_213))
add(Release(217, R.string.release_217))
add(Release(220, R.string.release_220))
add(Release(221, R.string.release_221))
add(Release(225, R.string.release_225))
add(Release(258, R.string.release_258))
add(Release(277, R.string.release_277))
add(Release(295, R.string.release_295))
add(Release(327, R.string.release_327))
add(Release(369, R.string.release_369))
checkWhatsNew(this, BuildConfig.VERSION_CODE)
}
}

View file

@ -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
@ -104,17 +104,6 @@ class MediaActivity : SimpleActivity(), MediaOperationsListener {
if (mShowAll) {
registerFileUpdateListener()
if (isPackageInstalled("com.simplemobiletools.gallery")) {
ConfirmationDialog(
this,
"",
com.simplemobiletools.commons.R.string.upgraded_from_free_gallery,
com.simplemobiletools.commons.R.string.ok,
0,
false
) {}
}
}
binding.mediaEmptyTextPlaceholder2.setOnClickListener {
@ -364,7 +353,7 @@ class MediaActivity : SimpleActivity(), MediaOperationsListener {
val grouped = MediaFetcher(applicationContext).groupMedia(filtered as ArrayList<Medium>, 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 +373,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 +396,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 +620,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 +759,7 @@ class MediaActivity : SimpleActivity(), MediaOperationsListener {
private fun changeColumnCount() {
val items = ArrayList<RadioItem>()
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 +892,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<String>) {
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 +914,7 @@ class MediaActivity : SimpleActivity(), MediaOperationsListener {
private fun deleteFilteredFiles(filtered: ArrayList<FileDirItem>) {
deleteFiles(filtered) {
if (!it) {
toast(com.simplemobiletools.commons.R.string.unknown_error_occurred)
toast(org.fossify.commons.R.string.unknown_error_occurred)
return@deleteFiles
}

View file

@ -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

View file

@ -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

View file

@ -1,4 +1,4 @@
package com.simplemobiletools.gallery.pro.activities
package org.fossify.gallery.activities
import android.os.Bundle

View file

@ -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
}

View file

@ -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<Medium>, "")
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<String>) {
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<FileDirItem>) {
deleteFiles(filtered) {
if (!it) {
toast(com.simplemobiletools.commons.R.string.unknown_error_occurred)
toast(org.fossify.commons.R.string.unknown_error_occurred)
return@deleteFiles
}

View file

@ -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()

View file

@ -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()
}

View file

@ -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) {

View file

@ -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() {

View file

@ -1,4 +1,4 @@
package com.simplemobiletools.gallery.pro.activities
package org.fossify.gallery.activities
import android.os.Bundle

View file

@ -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
}

View file

@ -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)

View file

@ -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()

View file

@ -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<Directory>, 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()

View file

@ -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

View file

@ -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<FilterItem>, val itemClick: (Int) -> Unit) :
RecyclerView.Adapter<FiltersAdapter.ViewHolder>() {

View file

@ -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<String>, 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()
}

View file

@ -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<String>, val listener: RefreshRecyclerViewListener?,

View file

@ -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<ThumbnailItem>, 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<String>, 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)

View file

@ -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

View file

@ -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<Medium>) : FragmentStatePagerAdapter(fm) {
private val fragments = HashMap<Int, ViewPagerFragment>()

View file

@ -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<String>, val sideElementWidth: Int, val itemClick: (Int, Int) -> Unit) :
RecyclerView.Adapter<PortraitPhotosAdapter.ViewHolder>() {

View file

@ -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,

View file

@ -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() {

View file

@ -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<TextView>(R.id.message).text = message
activity.getAlertDialogBuilder().setPositiveButton(R.string.all_files) { dialog, which -> positivePressed() }

View file

@ -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)
}

View file

@ -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())

View file

@ -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)
}

View file

@ -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()

View file

@ -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)
}

View file

@ -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

View file

@ -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<Float, Float>?, val callback: (aspectRatio: Pair<Float, Float>) -> 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)

View file

@ -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

View file

@ -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<String>, 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)
}

View file

@ -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) {

View file

@ -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)
}

View file

@ -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 -> }
}
}
}

View file

@ -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)
}

View file

@ -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)
}

View file

@ -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

View file

@ -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 ->

View file

@ -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
}
}

View file

@ -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)

View file

@ -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)
}

View file

@ -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()

View file

@ -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))

View file

@ -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()

View file

@ -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<FileDirItem>, 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)

View file

@ -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<Medium>.getDirMediaTypes(): Int {
var types = 0

View file

@ -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<Directory>): ArrayList<Direct
var result = when {
sorting and SORT_BY_NAME != 0 -> {
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<Directory>, 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()
}

View file

@ -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

View file

@ -0,0 +1,5 @@
package org.fossify.gallery.extensions
import org.fossify.commons.models.FileDirItem
fun FileDirItem.isDownloadsFolder() = path.isDownloadsFolder()

View file

@ -0,0 +1,5 @@
package org.fossify.gallery.extensions
import org.fossify.commons.helpers.SORT_DESCENDING
fun Int.isSortingAscending() = this and SORT_DESCENDING == 0

View file

@ -1,4 +1,4 @@
package com.simplemobiletools.gallery.pro.extensions
package org.fossify.gallery.extensions
import android.content.Context
import android.content.res.Resources

View file

@ -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<String>) =
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())
}
}

View file

@ -1,4 +1,4 @@
package com.simplemobiletools.gallery.pro.extensions
package org.fossify.gallery.extensions
import android.os.SystemClock
import android.view.MotionEvent

View file

@ -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

View file

@ -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
}

View file

@ -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
}

View file

@ -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)

View file

@ -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"

View file

@ -1,4 +1,4 @@
package com.simplemobiletools.gallery.pro.helpers
package org.fossify.gallery.helpers
import android.view.View
import androidx.viewpager.widget.ViewPager

View file

@ -1,4 +1,4 @@
package com.simplemobiletools.gallery.pro.helpers
package org.fossify.gallery.helpers
import android.view.View
import androidx.viewpager.widget.ViewPager

View file

@ -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<FilterItem>(10)

View file

@ -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,

View file

@ -1,4 +1,4 @@
package com.simplemobiletools.gallery.pro.helpers
package org.fossify.gallery.helpers
import java.io.UnsupportedEncodingException
import java.nio.ByteBuffer

View file

@ -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
}
}

View file

@ -1,4 +1,4 @@
package com.simplemobiletools.gallery.pro.helpers
package org.fossify.gallery.helpers
import android.content.Context
import android.graphics.Bitmap

View file

@ -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) {

View file

@ -1,4 +1,4 @@
package com.simplemobiletools.gallery.pro.helpers
package org.fossify.gallery.helpers
import android.content.Context
import android.graphics.*

View file

@ -1,4 +1,4 @@
package com.simplemobiletools.gallery.pro.helpers
package org.fossify.gallery.helpers
import android.graphics.*
import com.squareup.picasso.Transformation

View file

@ -1,4 +1,4 @@
package com.simplemobiletools.gallery.pro.helpers
package org.fossify.gallery.helpers
import android.graphics.Bitmap
import android.graphics.Matrix

View file

@ -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 {

View file

@ -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 {

View file

@ -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 {

View file

@ -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 {

View file

@ -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()

View file

@ -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 {

View file

@ -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 {

View file

@ -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)

View file

@ -1,3 +1,3 @@
package com.simplemobiletools.gallery.pro.models
package org.fossify.gallery.models
data class AlbumCover(val path: String, val tmb: String)

View file

@ -1,4 +1,4 @@
package com.simplemobiletools.gallery.pro.models
package org.fossify.gallery.models
import androidx.room.ColumnInfo
import androidx.room.Entity

View file

@ -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(

View file

@ -1,4 +1,4 @@
package com.simplemobiletools.gallery.pro.models
package org.fossify.gallery.models
import androidx.room.ColumnInfo
import androidx.room.Entity

View file

@ -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

View file

@ -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 -> ""
}

Some files were not shown because too many files have changed in this diff Show more