mirror of
https://github.com/SimpleMobileTools/Simple-Launcher.git
synced 2025-01-28 22:49:54 +01:00
show a darker navigation bar if some fragment is pulled up
This commit is contained in:
parent
1465497601
commit
c5953928bd
@ -33,7 +33,6 @@ import com.simplemobiletools.launcher.interfaces.FlingListener
|
|||||||
import com.simplemobiletools.launcher.models.HomeScreenGridItem
|
import com.simplemobiletools.launcher.models.HomeScreenGridItem
|
||||||
import kotlinx.android.synthetic.main.activity_main.*
|
import kotlinx.android.synthetic.main.activity_main.*
|
||||||
|
|
||||||
|
|
||||||
class MainActivity : SimpleActivity(), FlingListener {
|
class MainActivity : SimpleActivity(), FlingListener {
|
||||||
private val ANIMATION_DURATION = 150L
|
private val ANIMATION_DURATION = 150L
|
||||||
|
|
||||||
@ -122,7 +121,7 @@ class MainActivity : SimpleActivity(), FlingListener {
|
|||||||
if (!mIgnoreUpEvent) {
|
if (!mIgnoreUpEvent) {
|
||||||
if (all_apps_fragment.y < mScreenHeight * 0.7) {
|
if (all_apps_fragment.y < mScreenHeight * 0.7) {
|
||||||
showFragment(all_apps_fragment)
|
showFragment(all_apps_fragment)
|
||||||
} else {
|
} else if (all_apps_fragment.y != realScreenSize.y.toFloat()) {
|
||||||
hideFragment(all_apps_fragment)
|
hideFragment(all_apps_fragment)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -144,6 +143,8 @@ class MainActivity : SimpleActivity(), FlingListener {
|
|||||||
interpolator = DecelerateInterpolator()
|
interpolator = DecelerateInterpolator()
|
||||||
start()
|
start()
|
||||||
}
|
}
|
||||||
|
|
||||||
|
window.navigationBarColor = resources.getColor(R.color.semitransparent_navigation)
|
||||||
}
|
}
|
||||||
|
|
||||||
private fun hideFragment(fragment: View) {
|
private fun hideFragment(fragment: View) {
|
||||||
@ -152,6 +153,8 @@ class MainActivity : SimpleActivity(), FlingListener {
|
|||||||
interpolator = DecelerateInterpolator()
|
interpolator = DecelerateInterpolator()
|
||||||
start()
|
start()
|
||||||
}
|
}
|
||||||
|
|
||||||
|
window.navigationBarColor = Color.TRANSPARENT
|
||||||
}
|
}
|
||||||
|
|
||||||
fun homeScreenLongPressed(x: Float, y: Float) {
|
fun homeScreenLongPressed(x: Float, y: Float) {
|
||||||
@ -192,9 +195,7 @@ class MainActivity : SimpleActivity(), FlingListener {
|
|||||||
inflate(R.menu.menu_home_screen)
|
inflate(R.menu.menu_home_screen)
|
||||||
setOnMenuItemClickListener { item ->
|
setOnMenuItemClickListener { item ->
|
||||||
when (item.itemId) {
|
when (item.itemId) {
|
||||||
R.id.widgets -> {
|
R.id.widgets -> showWidgetsFragment()
|
||||||
showWidgetsFragment()
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
true
|
true
|
||||||
}
|
}
|
||||||
|
4
app/src/main/res/values/colors.xml
Normal file
4
app/src/main/res/values/colors.xml
Normal file
@ -0,0 +1,4 @@
|
|||||||
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
|
<resources>
|
||||||
|
<color name="semitransparent_navigation">#33000000</color>
|
||||||
|
</resources>
|
Loading…
x
Reference in New Issue
Block a user