Loading build.gradle +2 −2 Original line number Diff line number Diff line Loading @@ -7,8 +7,8 @@ buildscript { propMinSdkVersion = 21 propTargetSdkVersion = propCompileSdkVersion propVersionCode = 1 propVersionName = '5.2.15' kotlin_version = '1.2.71' propVersionName = '5.3.11' kotlin_version = '1.3.0' } repositories { Loading commons/src/main/kotlin/com/simplemobiletools/commons/activities/AboutActivity.kt +11 −0 Original line number Diff line number Diff line Loading @@ -37,6 +37,7 @@ class AboutActivity : BaseSimpleActivity() { setupWebsite() setupEmail() setupFAQ() setupUpgradeToPro() setupMoreApps() setupRateUs() setupInvite() Loading Loading @@ -93,6 +94,16 @@ class AboutActivity : BaseSimpleActivity() { about_faq.underlineText() } private fun setupUpgradeToPro() { about_upgrade_to_pro.beVisibleIf(getCanAppBeUpgraded()) about_upgrade_to_pro.setOnClickListener { launchUpgradeToProIntent() } about_upgrade_to_pro.setTextColor(linkColor) about_upgrade_to_pro.underlineText() } private fun openFAQ(faqItems: ArrayList<FAQItem>) { Intent(applicationContext, FAQActivity::class.java).apply { putExtra(APP_ICON_IDS, getAppIconIDs()) Loading commons/src/main/kotlin/com/simplemobiletools/commons/activities/BaseSimpleActivity.kt +18 −6 Original line number Diff line number Diff line Loading @@ -257,11 +257,12 @@ abstract class BaseSimpleActivity : AppCompatActivity() { val updatedFiles = ArrayList<FileDirItem>(fileDirItems.size * 2) val destinationFolder = File(destination) for (oldFileDirItem in fileDirItems) { val newFile = File(destinationFolder, oldFileDirItem.name) var newFile = File(destinationFolder, oldFileDirItem.name) if (newFile.exists()) { if (getConflictResolution(it, newFile.absolutePath) == CONFLICT_SKIP) { fileCountToCopy-- } else { when { getConflictResolution(it, newFile.absolutePath) == CONFLICT_SKIP -> fileCountToCopy-- getConflictResolution(it, newFile.absolutePath) == CONFLICT_KEEP_BOTH -> newFile = getAlternativeFile(newFile) else -> // this file is guaranteed to be on the internal storage, so just delete it this way newFile.delete() } Loading Loading @@ -294,6 +295,17 @@ abstract class BaseSimpleActivity : AppCompatActivity() { } } fun getAlternativeFile(file: File): File { var fileIndex = 1 var newFile: File? do { val newName = String.format("%s(%d).%s", file.nameWithoutExtension, fileIndex, file.extension) newFile = File(file.parent, newName) fileIndex++ } while (getDoesFilePathExist(newFile!!.absolutePath)) return newFile } private fun startCopyMove(files: ArrayList<FileDirItem>, destinationPath: String, isCopyOperation: Boolean, copyPhotoVideoOnly: Boolean, copyHidden: Boolean) { checkConflicts(files, destinationPath, 0, LinkedHashMap()) { toast(if (isCopyOperation) R.string.copying else R.string.moving) Loading commons/src/main/kotlin/com/simplemobiletools/commons/activities/BaseSplashActivity.kt +1 −1 Original line number Diff line number Diff line Loading @@ -12,7 +12,7 @@ abstract class BaseSplashActivity : AppCompatActivity() { override fun onCreate(savedInstanceState: Bundle?) { super.onCreate(savedInstanceState) if ((baseConfig.appRunCount == 0 || !baseConfig.wasSharedThemeAfterUpdateChecked) && isThankYouInstalled()) { if (isThankYouInstalled() && (baseConfig.appRunCount == 0 || !baseConfig.wasSharedThemeAfterUpdateChecked)) { baseConfig.wasSharedThemeAfterUpdateChecked = true getSharedTheme { if (it != null) { Loading commons/src/main/kotlin/com/simplemobiletools/commons/asynctasks/CopyMoveTask.kt +4 −1 Original line number Diff line number Diff line Loading @@ -80,7 +80,7 @@ class CopyMoveTask(val activity: BaseSimpleActivity, val copyOnly: Boolean = fal for (file in mFiles) { try { val newPath = "$mDestinationPath/${file.name}" val newFileDirItem = FileDirItem(newPath, newPath.getFilenameFromPath(), file.isDirectory) var newFileDirItem = FileDirItem(newPath, newPath.getFilenameFromPath(), file.isDirectory) if (activity.getDoesFilePathExist(newPath)) { val resolution = getConflictResolution(conflictResolutions, newPath) if (resolution == CONFLICT_SKIP) { Loading @@ -89,6 +89,9 @@ class CopyMoveTask(val activity: BaseSimpleActivity, val copyOnly: Boolean = fal } else if (resolution == CONFLICT_OVERWRITE) { newFileDirItem.isDirectory = if (File(newPath).exists()) File(newPath).isDirectory else activity.getSomeDocumentFile(newPath)!!.isDirectory activity.deleteFileBg(newFileDirItem, true) } else if (resolution == CONFLICT_KEEP_BOTH) { val newFile = activity.getAlternativeFile(File(newFileDirItem.path)) newFileDirItem = FileDirItem(newFile.path, newFile.name, newFile.isDirectory) } } Loading Loading
build.gradle +2 −2 Original line number Diff line number Diff line Loading @@ -7,8 +7,8 @@ buildscript { propMinSdkVersion = 21 propTargetSdkVersion = propCompileSdkVersion propVersionCode = 1 propVersionName = '5.2.15' kotlin_version = '1.2.71' propVersionName = '5.3.11' kotlin_version = '1.3.0' } repositories { Loading
commons/src/main/kotlin/com/simplemobiletools/commons/activities/AboutActivity.kt +11 −0 Original line number Diff line number Diff line Loading @@ -37,6 +37,7 @@ class AboutActivity : BaseSimpleActivity() { setupWebsite() setupEmail() setupFAQ() setupUpgradeToPro() setupMoreApps() setupRateUs() setupInvite() Loading Loading @@ -93,6 +94,16 @@ class AboutActivity : BaseSimpleActivity() { about_faq.underlineText() } private fun setupUpgradeToPro() { about_upgrade_to_pro.beVisibleIf(getCanAppBeUpgraded()) about_upgrade_to_pro.setOnClickListener { launchUpgradeToProIntent() } about_upgrade_to_pro.setTextColor(linkColor) about_upgrade_to_pro.underlineText() } private fun openFAQ(faqItems: ArrayList<FAQItem>) { Intent(applicationContext, FAQActivity::class.java).apply { putExtra(APP_ICON_IDS, getAppIconIDs()) Loading
commons/src/main/kotlin/com/simplemobiletools/commons/activities/BaseSimpleActivity.kt +18 −6 Original line number Diff line number Diff line Loading @@ -257,11 +257,12 @@ abstract class BaseSimpleActivity : AppCompatActivity() { val updatedFiles = ArrayList<FileDirItem>(fileDirItems.size * 2) val destinationFolder = File(destination) for (oldFileDirItem in fileDirItems) { val newFile = File(destinationFolder, oldFileDirItem.name) var newFile = File(destinationFolder, oldFileDirItem.name) if (newFile.exists()) { if (getConflictResolution(it, newFile.absolutePath) == CONFLICT_SKIP) { fileCountToCopy-- } else { when { getConflictResolution(it, newFile.absolutePath) == CONFLICT_SKIP -> fileCountToCopy-- getConflictResolution(it, newFile.absolutePath) == CONFLICT_KEEP_BOTH -> newFile = getAlternativeFile(newFile) else -> // this file is guaranteed to be on the internal storage, so just delete it this way newFile.delete() } Loading Loading @@ -294,6 +295,17 @@ abstract class BaseSimpleActivity : AppCompatActivity() { } } fun getAlternativeFile(file: File): File { var fileIndex = 1 var newFile: File? do { val newName = String.format("%s(%d).%s", file.nameWithoutExtension, fileIndex, file.extension) newFile = File(file.parent, newName) fileIndex++ } while (getDoesFilePathExist(newFile!!.absolutePath)) return newFile } private fun startCopyMove(files: ArrayList<FileDirItem>, destinationPath: String, isCopyOperation: Boolean, copyPhotoVideoOnly: Boolean, copyHidden: Boolean) { checkConflicts(files, destinationPath, 0, LinkedHashMap()) { toast(if (isCopyOperation) R.string.copying else R.string.moving) Loading
commons/src/main/kotlin/com/simplemobiletools/commons/activities/BaseSplashActivity.kt +1 −1 Original line number Diff line number Diff line Loading @@ -12,7 +12,7 @@ abstract class BaseSplashActivity : AppCompatActivity() { override fun onCreate(savedInstanceState: Bundle?) { super.onCreate(savedInstanceState) if ((baseConfig.appRunCount == 0 || !baseConfig.wasSharedThemeAfterUpdateChecked) && isThankYouInstalled()) { if (isThankYouInstalled() && (baseConfig.appRunCount == 0 || !baseConfig.wasSharedThemeAfterUpdateChecked)) { baseConfig.wasSharedThemeAfterUpdateChecked = true getSharedTheme { if (it != null) { Loading
commons/src/main/kotlin/com/simplemobiletools/commons/asynctasks/CopyMoveTask.kt +4 −1 Original line number Diff line number Diff line Loading @@ -80,7 +80,7 @@ class CopyMoveTask(val activity: BaseSimpleActivity, val copyOnly: Boolean = fal for (file in mFiles) { try { val newPath = "$mDestinationPath/${file.name}" val newFileDirItem = FileDirItem(newPath, newPath.getFilenameFromPath(), file.isDirectory) var newFileDirItem = FileDirItem(newPath, newPath.getFilenameFromPath(), file.isDirectory) if (activity.getDoesFilePathExist(newPath)) { val resolution = getConflictResolution(conflictResolutions, newPath) if (resolution == CONFLICT_SKIP) { Loading @@ -89,6 +89,9 @@ class CopyMoveTask(val activity: BaseSimpleActivity, val copyOnly: Boolean = fal } else if (resolution == CONFLICT_OVERWRITE) { newFileDirItem.isDirectory = if (File(newPath).exists()) File(newPath).isDirectory else activity.getSomeDocumentFile(newPath)!!.isDirectory activity.deleteFileBg(newFileDirItem, true) } else if (resolution == CONFLICT_KEEP_BOTH) { val newFile = activity.getAlternativeFile(File(newFileDirItem.path)) newFileDirItem = FileDirItem(newFile.path, newFile.name, newFile.isDirectory) } } Loading