add a helper function for setting translucent navigation bar
This commit is contained in:
parent
bc454a59f2
commit
0d09225efb
3 changed files with 11 additions and 4 deletions
|
@ -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'
|
||||
}
|
||||
|
|
|
@ -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) {
|
||||
|
|
|
@ -85,9 +85,9 @@ class FilePickerDialog(val activity: BaseSimpleActivity,
|
|||
}
|
||||
|
||||
if (!pickFile) {
|
||||
mDialog.getButton(AlertDialog.BUTTON_POSITIVE).setOnClickListener({
|
||||
mDialog.getButton(AlertDialog.BUTTON_POSITIVE).setOnClickListener {
|
||||
verifyPath()
|
||||
})
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue