Revert "remove our custom Back and X icons from the top left menu"

This reverts commit 0063624ceb.
This commit is contained in:
tibbi 2021-11-05 16:00:23 +01:00
parent 40cbf47ade
commit eab78101dc
3 changed files with 12 additions and 8 deletions

View file

@ -180,7 +180,7 @@ abstract class BaseSimpleActivity : AppCompatActivity() {
}
}
fun updateMenuItemColors(menu: Menu?, baseColor: Int = baseConfig.primaryColor) {
fun updateMenuItemColors(menu: Menu?, useCrossAsBack: Boolean = false, baseColor: Int = baseConfig.primaryColor) {
if (menu == null) {
return
}
@ -192,6 +192,10 @@ abstract class BaseSimpleActivity : AppCompatActivity() {
} catch (ignored: Exception) {
}
}
val drawableId = if (useCrossAsBack) R.drawable.ic_cross_vector else R.drawable.ic_arrow_left_vector
val icon = resources.getColoredDrawableWithColor(drawableId, color)
supportActionBar?.setHomeAsUpIndicator(icon)
}
private fun getCurrentAppIconColorIndex(): Int {

View file

@ -103,7 +103,7 @@ class CustomizationActivity : BaseSimpleActivity() {
override fun onCreateOptionsMenu(menu: Menu): Boolean {
menuInflater.inflate(R.menu.menu_customization, menu)
menu.findItem(R.id.save).isVisible = hasUnsavedChanges
updateMenuItemColors(menu, curPrimaryColor)
updateMenuItemColors(menu, true, curPrimaryColor)
this.menu = menu
return true
}
@ -216,7 +216,7 @@ class CustomizationActivity : BaseSimpleActivity() {
curNavigationBarColor = baseConfig.customNavigationBarColor
curAppIconColor = baseConfig.customAppIconColor
setTheme(getThemeId(curPrimaryColor))
updateMenuItemColors(menu, curPrimaryColor)
updateMenuItemColors(menu, true, curPrimaryColor)
setupColorsPickers()
} else {
baseConfig.customPrimaryColor = curPrimaryColor
@ -238,7 +238,7 @@ class CustomizationActivity : BaseSimpleActivity() {
}
setTheme(getThemeId(curPrimaryColor))
setupColorsPickers()
updateMenuItemColors(menu, curPrimaryColor)
updateMenuItemColors(menu, true, curPrimaryColor)
}
} else {
val theme = predefinedThemes[curSelectedThemeId]!!
@ -254,7 +254,7 @@ class CustomizationActivity : BaseSimpleActivity() {
curNavigationBarColor = getThemeNavigationColor(curSelectedThemeId)
setTheme(getThemeId(curPrimaryColor))
colorChanged()
updateMenuItemColors(menu, curPrimaryColor)
updateMenuItemColors(menu, true, curPrimaryColor)
}
}
@ -513,11 +513,11 @@ class CustomizationActivity : BaseSimpleActivity() {
updateColorTheme(getUpdatedTheme())
setTheme(getThemeId(color))
}
updateMenuItemColors(menu, color)
updateMenuItemColors(menu, true, color)
} else {
updateActionbarColor(curPrimaryColor)
setTheme(getThemeId(curPrimaryColor))
updateMenuItemColors(menu, curPrimaryColor)
updateMenuItemColors(menu, true, curPrimaryColor)
}
}
}

View file

@ -76,7 +76,7 @@ class LineColorPickerDialog(val activity: BaseSimpleActivity, val color: Int, va
if (isPrimaryColorPicker) {
activity.updateActionbarColor(color)
activity.setTheme(activity.getThemeId(color))
activity.updateMenuItemColors(menu, color)
activity.updateMenuItemColors(menu, true, color)
if (!wasDimmedBackgroundRemoved) {
dialog?.window?.clearFlags(WindowManager.LayoutParams.FLAG_DIM_BEHIND)