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

Commit 0d09225e authored by tibbi's avatar tibbi
Browse files

add a helper function for setting translucent navigation bar

parent bc454a59
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -7,7 +7,7 @@ buildscript {
        propMinSdkVersion = 16
        propTargetSdkVersion = propCompileSdkVersion
        propVersionCode = 1
        propVersionName = '3.0.16'
        propVersionName = '3.0.17'
        kotlin_version = '1.2.0'
        support_libs = '27.0.2'
    }
+8 −1
Original line number Diff line number Diff line
@@ -15,6 +15,7 @@ import android.support.v4.util.Pair
import android.support.v7.app.AppCompatActivity
import android.text.Html
import android.view.MenuItem
import android.view.WindowManager
import com.simplemobiletools.commons.R
import com.simplemobiletools.commons.asynctasks.CopyMoveTask
import com.simplemobiletools.commons.dialogs.ConfirmationDialog
@@ -95,11 +96,17 @@ open class BaseSimpleActivity : AppCompatActivity() {
    }

    fun updateStatusbarColor(color: Int) {
        if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.LOLLIPOP) {
        if (isLollipopPlus()) {
            window.statusBarColor = color.darkenColor()
        }
    }

    fun setTranslucentNavigation() {
        if (isKitkatPlus()) {
            window.setFlags(WindowManager.LayoutParams.FLAG_TRANSLUCENT_NAVIGATION, WindowManager.LayoutParams.FLAG_TRANSLUCENT_NAVIGATION)
        }
    }

    override fun onActivityResult(requestCode: Int, resultCode: Int, resultData: Intent?) {
        super.onActivityResult(requestCode, resultCode, resultData)
        if (requestCode == OPEN_DOCUMENT_TREE && resultCode == Activity.RESULT_OK && resultData != null) {
+2 −2
Original line number Diff line number Diff line
@@ -85,9 +85,9 @@ class FilePickerDialog(val activity: BaseSimpleActivity,
        }

        if (!pickFile) {
            mDialog.getButton(AlertDialog.BUTTON_POSITIVE).setOnClickListener({
            mDialog.getButton(AlertDialog.BUTTON_POSITIVE).setOnClickListener {
                verifyPath()
            })
            }
        }
    }