Minor actions tab 3 dot menu bug
This commit is contained in:
parent
0e559eff84
commit
e70821f3d0
4 changed files with 17 additions and 2 deletions
|
@ -7,6 +7,7 @@ import android.os.Bundle
|
|||
import android.os.PersistableBundle
|
||||
import android.text.SpannableString
|
||||
import android.text.method.LinkMovementMethod
|
||||
import android.text.style.ForegroundColorSpan
|
||||
import android.text.util.Linkify
|
||||
import android.util.TypedValue
|
||||
import android.view.Menu
|
||||
|
@ -116,6 +117,7 @@ class MainActivity : NoSplashAppCompatActivity() {
|
|||
override fun onPageSelected(position: Int) {
|
||||
setPluginPreferenceMenuName()
|
||||
checkPluginPreferences(binding.mainPager)
|
||||
setDisabledMenuItemColorPluginPreferences()
|
||||
}
|
||||
})
|
||||
|
||||
|
@ -256,6 +258,14 @@ class MainActivity : NoSplashAppCompatActivity() {
|
|||
return super.dispatchTouchEvent(event)
|
||||
}
|
||||
|
||||
private fun setDisabledMenuItemColorPluginPreferences() {
|
||||
if( pluginPreferencesMenuItem?.isEnabled == false){
|
||||
val spanString = SpannableString(this.menu?.findItem(R.id.nav_plugin_preferences)?.title.toString())
|
||||
spanString.setSpan(ForegroundColorSpan(rh.gac(R.attr.disabledTextColor)), 0, spanString.length, 0)
|
||||
this.menu?.findItem(R.id.nav_plugin_preferences)?.title = spanString
|
||||
}
|
||||
}
|
||||
|
||||
private fun setPluginPreferenceMenuName() {
|
||||
if (binding.mainPager.currentItem >= 0) {
|
||||
val plugin = (binding.mainPager.adapter as TabPageAdapter).getPluginAt(binding.mainPager.currentItem)
|
||||
|
@ -284,6 +294,7 @@ class MainActivity : NoSplashAppCompatActivity() {
|
|||
pluginPreferencesMenuItem = menu.findItem(R.id.nav_plugin_preferences)
|
||||
setPluginPreferenceMenuName()
|
||||
checkPluginPreferences(binding.mainPager)
|
||||
setDisabledMenuItemColorPluginPreferences()
|
||||
return true
|
||||
}
|
||||
|
||||
|
|
|
@ -109,6 +109,8 @@
|
|||
<item name="materialAlertDialogTheme">@style/DialogTheme</item>
|
||||
<item name="android:alertDialogTheme">@style/DialogTheme</item>
|
||||
<item name="alertDialogTheme">@style/DialogTheme</item>
|
||||
<!---Disabled Text Color -->
|
||||
<item name="disabledTextColor">@color/sandGray</item>
|
||||
</style>
|
||||
|
||||
<style name="Theme.MaterialComponents.DayNight.DarkActionBar" parent="Theme.MaterialComponents.DayNight.Bridge"/>
|
||||
|
|
|
@ -84,5 +84,7 @@
|
|||
<attr name="notificationAnnouncement" format="reference|color" />
|
||||
<!---Splash Background -->
|
||||
<attr name="splashBackgroundColor" format="reference|color" />
|
||||
<!---Disabled Text Color -->
|
||||
<attr name="disabledTextColor" format="reference|color" />
|
||||
|
||||
</resources>
|
|
@ -108,8 +108,8 @@
|
|||
<item name="materialAlertDialogTheme">@style/DialogTheme</item>
|
||||
<item name="android:alertDialogTheme">@style/DialogTheme</item>
|
||||
<item name="alertDialogTheme">@style/DialogTheme</item>
|
||||
<item name="windowActionBar">false</item>
|
||||
<item name="windowNoTitle">true</item>
|
||||
<!---Disabled Text Color -->
|
||||
<item name="disabledTextColor">@color/sandGray</item>
|
||||
</style>
|
||||
|
||||
<style name="Theme.MaterialComponents.DayNight.DarkActionBar" parent="Theme.MaterialComponents.DayNight.Bridge"/>
|
||||
|
|
Loading…
Reference in a new issue