fixed the command keys not working in invisible mode
This commit is contained in:
parent
1ee0a4485f
commit
9cddbb5969
7 changed files with 28 additions and 9 deletions
|
|
@ -83,6 +83,10 @@ abstract class BaseMainLayout {
|
|||
|
||||
void resetHeight() {}
|
||||
|
||||
abstract void showCommandPalette();
|
||||
abstract void hideCommandPalette();
|
||||
abstract boolean isCommandPaletteShown();
|
||||
|
||||
/**
|
||||
* render
|
||||
* Do all the necessary stuff to display the View.
|
||||
|
|
|
|||
|
|
@ -77,6 +77,11 @@ class MainLayoutNumpad extends BaseMainLayout {
|
|||
}
|
||||
|
||||
|
||||
@Override void showCommandPalette() {}
|
||||
@Override void hideCommandPalette() {}
|
||||
@Override boolean isCommandPaletteShown() { return false; }
|
||||
|
||||
|
||||
/**
|
||||
* Uses the key height from the settings, but if it takes up too much of the screen, it will
|
||||
* be adjusted so that the entire Main View would take up around 50% of the screen in landscape mode
|
||||
|
|
|
|||
|
|
@ -37,6 +37,12 @@ class MainLayoutSmall extends MainLayoutTray {
|
|||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
void hideCommandPalette() {
|
||||
super.hideCommandPalette();
|
||||
view.findViewById(R.id.main_soft_keys).setVisibility(LinearLayout.VISIBLE);
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void enableClickHandlers() {
|
||||
super.enableClickHandlers();
|
||||
|
|
|
|||
|
|
@ -4,7 +4,12 @@ import io.github.sspanak.tt9.R;
|
|||
import io.github.sspanak.tt9.ime.TraditionalT9;
|
||||
|
||||
class MainLayoutStealth extends BaseMainLayout {
|
||||
private boolean isCommandPaletteShown = false;
|
||||
|
||||
MainLayoutStealth(TraditionalT9 tt9) { super(tt9, R.layout.main_stealth); }
|
||||
|
||||
@Override void showCommandPalette() { isCommandPaletteShown = true; }
|
||||
@Override void hideCommandPalette() { isCommandPaletteShown = false; }
|
||||
@Override boolean isCommandPaletteShown() { return isCommandPaletteShown; }
|
||||
@Override void render() {}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -43,9 +43,6 @@ class MainLayoutTray extends BaseMainLayout {
|
|||
|
||||
void hideCommandPalette() {
|
||||
view.findViewById(R.id.main_command_keys).setVisibility(LinearLayout.GONE);
|
||||
if (this instanceof MainLayoutSmall) {
|
||||
view.findViewById(R.id.main_soft_keys).setVisibility(LinearLayout.VISIBLE);
|
||||
}
|
||||
}
|
||||
|
||||
boolean isCommandPaletteShown() {
|
||||
|
|
|
|||
|
|
@ -58,18 +58,18 @@ public class MainView {
|
|||
}
|
||||
|
||||
public void showCommandPalette() {
|
||||
if (main instanceof MainLayoutTray) {
|
||||
((MainLayoutTray) main).showCommandPalette();
|
||||
if (main != null) {
|
||||
main.showCommandPalette();
|
||||
}
|
||||
}
|
||||
|
||||
public void hideCommandPalette() {
|
||||
if (main instanceof MainLayoutTray) {
|
||||
((MainLayoutTray) main).hideCommandPalette();
|
||||
if (main != null) {
|
||||
main.hideCommandPalette();
|
||||
}
|
||||
}
|
||||
|
||||
public boolean isCommandPaletteShown() {
|
||||
return main != null && main instanceof MainLayoutTray && ((MainLayoutTray) main).isCommandPaletteShown();
|
||||
return main != null && main.isCommandPaletteShown();
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -32,7 +32,9 @@ public class StatusBar {
|
|||
|
||||
|
||||
public void setText(int stringResourceId) {
|
||||
setText(statusView.getContext().getString(stringResourceId));
|
||||
if (statusView != null) {
|
||||
setText(statusView.getContext().getString(stringResourceId));
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue