mirror of
https://github.com/Helium314/HeliBoard.git
synced 2025-06-09 16:17:44 +00:00
consider that voice input key visibility should depend on the text field
This commit is contained in:
parent
7499c38e13
commit
0a961a68db
2 changed files with 9 additions and 4 deletions
|
@ -1028,6 +1028,8 @@ public class LatinIME extends InputMethodService implements
|
|||
!currentSettingsValues.hasSameOrientation(getResources().getConfiguration())) {
|
||||
loadSettings();
|
||||
currentSettingsValues = mSettings.getCurrent();
|
||||
if (hasSuggestionStripView())
|
||||
mSuggestionStripView.updateVoiceKey();
|
||||
}
|
||||
// ALERT: settings have not been reloaded and there is a chance they may be stale.
|
||||
// In the practice, if it is, we should have gotten onConfigurationChanged so it should
|
||||
|
|
|
@ -470,12 +470,15 @@ class SuggestionStripView(context: Context, attrs: AttributeSet?, defStyle: Int)
|
|||
}
|
||||
}
|
||||
|
||||
fun updateVoiceKey() {
|
||||
val show = Settings.getValues().mShowsVoiceInputKey
|
||||
toolbar.findViewWithTag<View>(ToolbarKey.VOICE)?.isVisible = show
|
||||
pinnedKeys.findViewWithTag<View>(ToolbarKey.VOICE)?.isVisible = show
|
||||
}
|
||||
|
||||
private fun updateKeys() {
|
||||
updateVoiceKey()
|
||||
val settingsValues = Settings.getValues()
|
||||
val toolbarVoiceKey = toolbar.findViewWithTag<View>(ToolbarKey.VOICE)
|
||||
if (toolbarVoiceKey != null) toolbarVoiceKey.isVisible = settingsValues.mShowsVoiceInputKey
|
||||
val pinnedVoiceKey = pinnedKeys.findViewWithTag<View>(ToolbarKey.VOICE)
|
||||
if (pinnedVoiceKey != null) pinnedVoiceKey.isVisible = settingsValues.mShowsVoiceInputKey
|
||||
|
||||
val toolbarIsExpandable = settingsValues.mToolbarMode == ToolbarMode.EXPANDABLE
|
||||
if (settingsValues.mIncognitoModeEnabled) {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue