mirror of
https://github.com/Helium314/HeliBoard.git
synced 2025-04-25 09:06:22 +00:00
update logging
This commit is contained in:
parent
136b45880e
commit
28ba8a7a72
2 changed files with 17 additions and 17 deletions
|
@ -9,6 +9,7 @@ package helium314.keyboard.keyboard.internal;
|
||||||
import android.text.TextUtils;
|
import android.text.TextUtils;
|
||||||
|
|
||||||
import helium314.keyboard.keyboard.internal.keyboard_parser.floris.KeyCode;
|
import helium314.keyboard.keyboard.internal.keyboard_parser.floris.KeyCode;
|
||||||
|
import helium314.keyboard.latin.define.DebugFlags;
|
||||||
import helium314.keyboard.latin.utils.Log;
|
import helium314.keyboard.latin.utils.Log;
|
||||||
|
|
||||||
import androidx.annotation.NonNull;
|
import androidx.annotation.NonNull;
|
||||||
|
@ -34,7 +35,6 @@ import helium314.keyboard.latin.utils.RecapitalizeStatus;
|
||||||
public final class KeyboardState {
|
public final class KeyboardState {
|
||||||
private static final String TAG = KeyboardState.class.getSimpleName();
|
private static final String TAG = KeyboardState.class.getSimpleName();
|
||||||
private static final boolean DEBUG_EVENT = false;
|
private static final boolean DEBUG_EVENT = false;
|
||||||
private static final boolean DEBUG_INTERNAL_ACTION = false;
|
|
||||||
|
|
||||||
public interface SwitchActions {
|
public interface SwitchActions {
|
||||||
boolean DEBUG_ACTION = false;
|
boolean DEBUG_ACTION = false;
|
||||||
|
@ -220,9 +220,6 @@ public final class KeyboardState {
|
||||||
}
|
}
|
||||||
|
|
||||||
private void setShifted(final int shiftMode) {
|
private void setShifted(final int shiftMode) {
|
||||||
if (DEBUG_INTERNAL_ACTION) {
|
|
||||||
Log.d(TAG, "setShifted: shiftMode=" + shiftModeToString(shiftMode) + " " + this);
|
|
||||||
}
|
|
||||||
if (mMode != MODE_ALPHABET) return;
|
if (mMode != MODE_ALPHABET) return;
|
||||||
final int prevShiftMode;
|
final int prevShiftMode;
|
||||||
if (mAlphabetShiftState.isAutomaticShifted()) {
|
if (mAlphabetShiftState.isAutomaticShifted()) {
|
||||||
|
@ -232,6 +229,9 @@ public final class KeyboardState {
|
||||||
} else {
|
} else {
|
||||||
prevShiftMode = UNSHIFT;
|
prevShiftMode = UNSHIFT;
|
||||||
}
|
}
|
||||||
|
if (DebugFlags.DEBUG_ENABLED && shiftMode != prevShiftMode) {
|
||||||
|
Log.d(TAG, "setShifted: shiftMode=" + shiftModeToString(shiftMode) + " " + this);
|
||||||
|
}
|
||||||
switch (shiftMode) {
|
switch (shiftMode) {
|
||||||
case AUTOMATIC_SHIFT:
|
case AUTOMATIC_SHIFT:
|
||||||
mAlphabetShiftState.setAutomaticShifted();
|
mAlphabetShiftState.setAutomaticShifted();
|
||||||
|
@ -259,7 +259,7 @@ public final class KeyboardState {
|
||||||
}
|
}
|
||||||
|
|
||||||
private void setShiftLocked(final boolean shiftLocked) {
|
private void setShiftLocked(final boolean shiftLocked) {
|
||||||
if (DEBUG_INTERNAL_ACTION) {
|
if (DebugFlags.DEBUG_ENABLED) {
|
||||||
Log.d(TAG, "setShiftLocked: shiftLocked=" + shiftLocked + " " + this);
|
Log.d(TAG, "setShiftLocked: shiftLocked=" + shiftLocked + " " + this);
|
||||||
}
|
}
|
||||||
if (mMode != MODE_ALPHABET) return;
|
if (mMode != MODE_ALPHABET) return;
|
||||||
|
@ -274,7 +274,7 @@ public final class KeyboardState {
|
||||||
}
|
}
|
||||||
|
|
||||||
private void toggleAlphabetAndSymbols(final int autoCapsFlags, final int recapitalizeMode) {
|
private void toggleAlphabetAndSymbols(final int autoCapsFlags, final int recapitalizeMode) {
|
||||||
if (DEBUG_INTERNAL_ACTION) {
|
if (DebugFlags.DEBUG_ENABLED) {
|
||||||
Log.d(TAG, "toggleAlphabetAndSymbols: "
|
Log.d(TAG, "toggleAlphabetAndSymbols: "
|
||||||
+ stateToString(autoCapsFlags, recapitalizeMode));
|
+ stateToString(autoCapsFlags, recapitalizeMode));
|
||||||
}
|
}
|
||||||
|
@ -299,7 +299,7 @@ public final class KeyboardState {
|
||||||
// TODO: Remove this method. Come up with a more comprehensive way to reset the keyboard layout
|
// TODO: Remove this method. Come up with a more comprehensive way to reset the keyboard layout
|
||||||
// when a keyboard layout set doesn't get reloaded in LatinIME.onStartInputViewInternal().
|
// when a keyboard layout set doesn't get reloaded in LatinIME.onStartInputViewInternal().
|
||||||
private void resetKeyboardStateToAlphabet(final int autoCapsFlags, final int recapitalizeMode) {
|
private void resetKeyboardStateToAlphabet(final int autoCapsFlags, final int recapitalizeMode) {
|
||||||
if (DEBUG_INTERNAL_ACTION) {
|
if (DebugFlags.DEBUG_ENABLED) {
|
||||||
Log.d(TAG, "resetKeyboardStateToAlphabet: "
|
Log.d(TAG, "resetKeyboardStateToAlphabet: "
|
||||||
+ stateToString(autoCapsFlags, recapitalizeMode));
|
+ stateToString(autoCapsFlags, recapitalizeMode));
|
||||||
}
|
}
|
||||||
|
@ -322,7 +322,7 @@ public final class KeyboardState {
|
||||||
}
|
}
|
||||||
|
|
||||||
private void setAlphabetKeyboard(final int autoCapsFlags, final int recapitalizeMode) {
|
private void setAlphabetKeyboard(final int autoCapsFlags, final int recapitalizeMode) {
|
||||||
if (DEBUG_INTERNAL_ACTION) {
|
if (DebugFlags.DEBUG_ENABLED) {
|
||||||
Log.d(TAG, "setAlphabetKeyboard: " + stateToString(autoCapsFlags, recapitalizeMode));
|
Log.d(TAG, "setAlphabetKeyboard: " + stateToString(autoCapsFlags, recapitalizeMode));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -335,7 +335,7 @@ public final class KeyboardState {
|
||||||
}
|
}
|
||||||
|
|
||||||
private void setSymbolsKeyboard() {
|
private void setSymbolsKeyboard() {
|
||||||
if (DEBUG_INTERNAL_ACTION) {
|
if (DebugFlags.DEBUG_ENABLED) {
|
||||||
Log.d(TAG, "setSymbolsKeyboard");
|
Log.d(TAG, "setSymbolsKeyboard");
|
||||||
}
|
}
|
||||||
mSwitchActions.setSymbolsKeyboard();
|
mSwitchActions.setSymbolsKeyboard();
|
||||||
|
@ -348,7 +348,7 @@ public final class KeyboardState {
|
||||||
}
|
}
|
||||||
|
|
||||||
private void setSymbolsShiftedKeyboard() {
|
private void setSymbolsShiftedKeyboard() {
|
||||||
if (DEBUG_INTERNAL_ACTION) {
|
if (DebugFlags.DEBUG_ENABLED) {
|
||||||
Log.d(TAG, "setSymbolsShiftedKeyboard");
|
Log.d(TAG, "setSymbolsShiftedKeyboard");
|
||||||
}
|
}
|
||||||
mSwitchActions.setSymbolsShiftedKeyboard();
|
mSwitchActions.setSymbolsShiftedKeyboard();
|
||||||
|
@ -361,7 +361,7 @@ public final class KeyboardState {
|
||||||
}
|
}
|
||||||
|
|
||||||
private void setEmojiKeyboard() {
|
private void setEmojiKeyboard() {
|
||||||
if (DEBUG_INTERNAL_ACTION) {
|
if (DebugFlags.DEBUG_ENABLED) {
|
||||||
Log.d(TAG, "setEmojiKeyboard");
|
Log.d(TAG, "setEmojiKeyboard");
|
||||||
}
|
}
|
||||||
mMode = MODE_EMOJI;
|
mMode = MODE_EMOJI;
|
||||||
|
@ -373,7 +373,7 @@ public final class KeyboardState {
|
||||||
}
|
}
|
||||||
|
|
||||||
private void setClipboardKeyboard() {
|
private void setClipboardKeyboard() {
|
||||||
if (DEBUG_INTERNAL_ACTION) {
|
if (DebugFlags.DEBUG_ENABLED) {
|
||||||
Log.d(TAG, "setClipboardKeyboard");
|
Log.d(TAG, "setClipboardKeyboard");
|
||||||
}
|
}
|
||||||
mMode = MODE_CLIPBOARD;
|
mMode = MODE_CLIPBOARD;
|
||||||
|
@ -386,7 +386,7 @@ public final class KeyboardState {
|
||||||
|
|
||||||
private void setNumpadKeyboard(final boolean withSliding, final boolean forceReturnToAlpha,
|
private void setNumpadKeyboard(final boolean withSliding, final boolean forceReturnToAlpha,
|
||||||
final boolean rememberState) {
|
final boolean rememberState) {
|
||||||
if (DEBUG_INTERNAL_ACTION) {
|
if (DebugFlags.DEBUG_ENABLED) {
|
||||||
Log.d(TAG, "setNumpadKeyboard");
|
Log.d(TAG, "setNumpadKeyboard");
|
||||||
}
|
}
|
||||||
if (rememberState) {
|
if (rememberState) {
|
||||||
|
@ -408,7 +408,7 @@ public final class KeyboardState {
|
||||||
|
|
||||||
public void toggleNumpad(final boolean withSliding, final int autoCapsFlags, final int recapitalizeMode,
|
public void toggleNumpad(final boolean withSliding, final int autoCapsFlags, final int recapitalizeMode,
|
||||||
final boolean forceReturnToAlpha, final boolean rememberState) {
|
final boolean forceReturnToAlpha, final boolean rememberState) {
|
||||||
if (DEBUG_INTERNAL_ACTION) {
|
if (DebugFlags.DEBUG_ENABLED) {
|
||||||
Log.d(TAG, "toggleNumpad");
|
Log.d(TAG, "toggleNumpad");
|
||||||
}
|
}
|
||||||
if (mMode != MODE_NUMPAD) setNumpadKeyboard(withSliding, forceReturnToAlpha, rememberState);
|
if (mMode != MODE_NUMPAD) setNumpadKeyboard(withSliding, forceReturnToAlpha, rememberState);
|
||||||
|
@ -438,14 +438,14 @@ public final class KeyboardState {
|
||||||
}
|
}
|
||||||
|
|
||||||
private void setOneHandedModeEnabled(boolean enabled) {
|
private void setOneHandedModeEnabled(boolean enabled) {
|
||||||
if (DEBUG_INTERNAL_ACTION) {
|
if (DebugFlags.DEBUG_ENABLED) {
|
||||||
Log.d(TAG, "setOneHandedModeEnabled");
|
Log.d(TAG, "setOneHandedModeEnabled");
|
||||||
}
|
}
|
||||||
mSwitchActions.setOneHandedModeEnabled(enabled);
|
mSwitchActions.setOneHandedModeEnabled(enabled);
|
||||||
}
|
}
|
||||||
|
|
||||||
private void switchOneHandedMode() {
|
private void switchOneHandedMode() {
|
||||||
if (DEBUG_INTERNAL_ACTION) {
|
if (DebugFlags.DEBUG_ENABLED) {
|
||||||
Log.d(TAG, "switchOneHandedMode");
|
Log.d(TAG, "switchOneHandedMode");
|
||||||
}
|
}
|
||||||
mSwitchActions.switchOneHandedMode();
|
mSwitchActions.switchOneHandedMode();
|
||||||
|
|
|
@ -926,7 +926,7 @@ public class LatinIME extends InputMethodService implements
|
||||||
+ ", word caps = "
|
+ ", word caps = "
|
||||||
+ ((editorInfo.inputType & InputType.TYPE_TEXT_FLAG_CAP_WORDS) != 0));
|
+ ((editorInfo.inputType & InputType.TYPE_TEXT_FLAG_CAP_WORDS) != 0));
|
||||||
}
|
}
|
||||||
Log.i(TAG, "Starting input. Cursor position = " + editorInfo.initialSelStart + "," + editorInfo.initialSelEnd);
|
Log.i(TAG, (restarting ? "Res" : "S") +"tarting input. Cursor position = " + editorInfo.initialSelStart + "," + editorInfo.initialSelEnd);
|
||||||
|
|
||||||
// In landscape mode, this method gets called without the input view being created.
|
// In landscape mode, this method gets called without the input view being created.
|
||||||
if (mainKeyboardView == null) {
|
if (mainKeyboardView == null) {
|
||||||
|
|
Loading…
Add table
Reference in a new issue