This shouldn't be here
// Some devices don't let you modify android.R.attr.navigationBarColor
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.O) {
val navigationBar = resolveThemeColor(android.R.attr.windowBackground)
window.navigationBarColor = navigationBar
window.navigationBarDividerColor = navigationBar
}
I've tried set to window.navigationBarDividerColor the same color as window.navigationBarColor has, but then the following crash occurs. It looks like there's something messed up within API 28 because also others complaining about it on StackOverflow.
2018-10-27 23:29:56.387 5607-5607/com.moez.QKSMS E/AndroidRuntime: FATAL EXCEPTION: main
Process: com.moez.QKSMS, PID: 5607
java.lang.NoSuchMethodError: No virtual method setNavigationBarDividerColor(I)V in class Landroid/view/Window; or its super classes (declaration of 'android.view.Window' appears in /system/framework/framework.jar!classes2.dex)
at com.moez.QKSMS.common.base.QkThemedActivity.onCreate(QkThemedActivity.kt:94)
at com.moez.QKSMS.feature.main.MainActivity.onCreate(MainActivity.kt:118)
The are high chances that this view might be the one mistaken as navigationBarDivider, can somebody confirm?
@GeoZac that's definitely it. The only reason I haven't gone ahead and spent the 2 seconds to remove it is because that divider _is_ actually needed when the syncing or permissions UI is disabled - so there's slightly more thought / work involved
I'm no expert in UI, but since the sync or permission snackbars can be considered as standalone layer can they be made distinguishable by applying an elevation to respective views?
I think so! I'm generally hesitant to use Android's built-in elevation stuff though, since it seems to behave unpredictably between different devices. That being said, this case is pretty simple so it really shouldn't be too much of an issue to just add the line to those views manually