Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Unverified Commit bf83c4d9 authored by solokot's avatar solokot Committed by GitHub
Browse files

Merge pull request #47 from SimpleMobileTools/master

upd
parents d56d3e1f 108cdc4b
Loading
Loading
Loading
Loading
+2 −2
Original line number Diff line number Diff line
@@ -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 {
+11 −0
Original line number Diff line number Diff line
@@ -37,6 +37,7 @@ class AboutActivity : BaseSimpleActivity() {
        setupWebsite()
        setupEmail()
        setupFAQ()
        setupUpgradeToPro()
        setupMoreApps()
        setupRateUs()
        setupInvite()
@@ -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())
+18 −6
Original line number Diff line number Diff line
@@ -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()
                                    }
@@ -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)
+1 −1
Original line number Diff line number Diff line
@@ -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) {
+4 −1
Original line number Diff line number Diff line
@@ -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) {
@@ -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