mirror of
https://github.com/Helium314/HeliBoard.git
synced 2025-06-08 07:37:41 +00:00
remove or add info to some todos
This commit is contained in:
parent
8eb8a2368a
commit
4645e425e6
12 changed files with 13 additions and 22 deletions
|
@ -46,7 +46,6 @@ import java.util.WeakHashMap;
|
||||||
* This is an extended {@link KeyboardView} class that hosts an emoji page keyboard.
|
* This is an extended {@link KeyboardView} class that hosts an emoji page keyboard.
|
||||||
* Multi-touch unsupported. No gesture support.
|
* Multi-touch unsupported. No gesture support.
|
||||||
*/
|
*/
|
||||||
// TODO: Implement key popup preview.
|
|
||||||
public final class EmojiPageKeyboardView extends KeyboardView implements
|
public final class EmojiPageKeyboardView extends KeyboardView implements
|
||||||
MoreKeysPanel.Controller {
|
MoreKeysPanel.Controller {
|
||||||
private static final String TAG = "EmojiPageKeyboardView";
|
private static final String TAG = "EmojiPageKeyboardView";
|
||||||
|
|
|
@ -47,8 +47,6 @@ public final class KeyVisualAttributes {
|
||||||
public final float mLabelOffCenterRatio;
|
public final float mLabelOffCenterRatio;
|
||||||
public final float mHintLabelOffCenterRatio;
|
public final float mHintLabelOffCenterRatio;
|
||||||
|
|
||||||
// todo: replace the remaining colors with something from new colors instead of theme
|
|
||||||
// but first check which colors are actually used
|
|
||||||
private static final int[] VISUAL_ATTRIBUTE_IDS = {
|
private static final int[] VISUAL_ATTRIBUTE_IDS = {
|
||||||
R.styleable.Keyboard_Key_keyTypeface,
|
R.styleable.Keyboard_Key_keyTypeface,
|
||||||
R.styleable.Keyboard_Key_keyLetterSize,
|
R.styleable.Keyboard_Key_keyLetterSize,
|
||||||
|
@ -115,15 +113,20 @@ public final class KeyVisualAttributes {
|
||||||
mPreviewTextRatio = ResourceUtils.getFraction(keyAttr,
|
mPreviewTextRatio = ResourceUtils.getFraction(keyAttr,
|
||||||
R.styleable.Keyboard_Key_keyPreviewTextRatio);
|
R.styleable.Keyboard_Key_keyPreviewTextRatio);
|
||||||
|
|
||||||
|
// todo: check what colors do, and if irrelevant and no plan to use -> remove here and from attr
|
||||||
final Colors colors = Settings.getInstance().getCurrent().mColors;
|
final Colors colors = Settings.getInstance().getCurrent().mColors;
|
||||||
mTextColor = colors.get(ColorType.KEY_TEXT);
|
mTextColor = colors.get(ColorType.KEY_TEXT);
|
||||||
|
// when? -> isShiftedLetterActivated, which is a label flag
|
||||||
mTextInactivatedColor = keyAttr.getColor(R.styleable.Keyboard_Key_keyTextInactivatedColor, 0);
|
mTextInactivatedColor = keyAttr.getColor(R.styleable.Keyboard_Key_keyTextInactivatedColor, 0);
|
||||||
|
// when? -> mKeyTextShadowRadius > 0, but it's always set to -1 (in theme) -> maybe play with this?
|
||||||
mTextShadowColor = keyAttr.getColor(R.styleable.Keyboard_Key_keyTextShadowColor, 0);
|
mTextShadowColor = keyAttr.getColor(R.styleable.Keyboard_Key_keyTextShadowColor, 0);
|
||||||
mFunctionalTextColor = colors.get(ColorType.FUNCTIONAL_KEY_TEXT);
|
mFunctionalTextColor = colors.get(ColorType.FUNCTIONAL_KEY_TEXT);
|
||||||
mHintLetterColor = colors.get(ColorType.KEY_HINT_TEXT);
|
mHintLetterColor = colors.get(ColorType.KEY_HINT_TEXT);
|
||||||
mHintLabelColor = colors.get(ColorType.KEY_TEXT);
|
mHintLabelColor = colors.get(ColorType.KEY_TEXT);
|
||||||
|
// when? -> hasShiftedLetterHint and not isShiftedLetterActivated -> both are label flags
|
||||||
mShiftedLetterHintInactivatedColor = keyAttr.getColor(
|
mShiftedLetterHintInactivatedColor = keyAttr.getColor(
|
||||||
R.styleable.Keyboard_Key_keyShiftedLetterHintInactivatedColor, 0);
|
R.styleable.Keyboard_Key_keyShiftedLetterHintInactivatedColor, 0);
|
||||||
|
// when? -> hasShiftedLetterHint and isShiftedLetterActivated -> both are label flags
|
||||||
mShiftedLetterHintActivatedColor = keyAttr.getColor(
|
mShiftedLetterHintActivatedColor = keyAttr.getColor(
|
||||||
R.styleable.Keyboard_Key_keyShiftedLetterHintActivatedColor, 0);
|
R.styleable.Keyboard_Key_keyShiftedLetterHintActivatedColor, 0);
|
||||||
mPreviewTextColor = colors.get(ColorType.KEY_TEXT);
|
mPreviewTextColor = colors.get(ColorType.KEY_TEXT);
|
||||||
|
|
|
@ -651,7 +651,7 @@ abstract class KeyboardParser(private val params: KeyboardParams, private val co
|
||||||
if (params.mIconsSet.getIconDrawable(KeyboardIconsSet.getIconId(this)) != null) return this
|
if (params.mIconsSet.getIconDrawable(KeyboardIconsSet.getIconId(this)) != null) return this
|
||||||
if (params.mId.mWidth == AndroidSpellCheckerService.SPELLCHECKER_DUMMY_KEYBOARD_WIDTH
|
if (params.mId.mWidth == AndroidSpellCheckerService.SPELLCHECKER_DUMMY_KEYBOARD_WIDTH
|
||||||
&& params.mId.mHeight == AndroidSpellCheckerService.SPELLCHECKER_DUMMY_KEYBOARD_HEIGHT
|
&& params.mId.mHeight == AndroidSpellCheckerService.SPELLCHECKER_DUMMY_KEYBOARD_HEIGHT
|
||||||
&& !params.mId.mSubtype.rawSubtype.extraValue.contains(Constants.Subtype.ExtraValue.EMOJI_CAPABLE)
|
&& !params.mId.mSubtype.hasExtraValue(Constants.Subtype.ExtraValue.EMOJI_CAPABLE)
|
||||||
)
|
)
|
||||||
// fake keyboard that is used by spell checker (for key coordinates), but not shown to the user
|
// fake keyboard that is used by spell checker (for key coordinates), but not shown to the user
|
||||||
// often this doesn't have any icons loaded, and there is no need to bother with this
|
// often this doesn't have any icons loaded, and there is no need to bother with this
|
||||||
|
|
|
@ -58,7 +58,6 @@ import java.util.concurrent.TimeUnit;
|
||||||
* a client for interacting with dictionaries.
|
* a client for interacting with dictionaries.
|
||||||
*/
|
*/
|
||||||
public class DictionaryFacilitatorImpl implements DictionaryFacilitator {
|
public class DictionaryFacilitatorImpl implements DictionaryFacilitator {
|
||||||
// TODO: Consolidate dictionaries in native code.
|
|
||||||
public static final String TAG = DictionaryFacilitatorImpl.class.getSimpleName();
|
public static final String TAG = DictionaryFacilitatorImpl.class.getSimpleName();
|
||||||
|
|
||||||
// HACK: This threshold is being used when adding a capitalized entry in the User History
|
// HACK: This threshold is being used when adding a capitalized entry in the User History
|
||||||
|
@ -333,7 +332,6 @@ public class DictionaryFacilitatorImpl implements DictionaryFacilitator {
|
||||||
final String dictNamePrefix,
|
final String dictNamePrefix,
|
||||||
@Nullable final DictionaryInitializationListener listener) {
|
@Nullable final DictionaryInitializationListener listener) {
|
||||||
final HashMap<Locale, ArrayList<String>> existingDictionariesToCleanup = new HashMap<>();
|
final HashMap<Locale, ArrayList<String>> existingDictionariesToCleanup = new HashMap<>();
|
||||||
// TODO: Make subDictTypesToUse configurable by resource or a static final list.
|
|
||||||
final HashSet<String> subDictTypesToUse = new HashSet<>();
|
final HashSet<String> subDictTypesToUse = new HashSet<>();
|
||||||
subDictTypesToUse.add(Dictionary.TYPE_USER);
|
subDictTypesToUse.add(Dictionary.TYPE_USER);
|
||||||
final List<Locale> allLocales = new ArrayList<>() {{
|
final List<Locale> allLocales = new ArrayList<>() {{
|
||||||
|
|
|
@ -95,9 +95,6 @@ public final class DictionaryPackInstallBroadcastReceiver extends BroadcastRecei
|
||||||
// If we are replacing the package, we will receive ADDED right away so no need to
|
// If we are replacing the package, we will receive ADDED right away so no need to
|
||||||
// remove the dictionary at the moment, since we will do it when we receive the
|
// remove the dictionary at the moment, since we will do it when we receive the
|
||||||
// ADDED broadcast.
|
// ADDED broadcast.
|
||||||
|
|
||||||
// TODO: Only reload dictionary on REMOVED when the removed package is the one we
|
|
||||||
// read dictionary from?
|
|
||||||
mService.resetSuggestMainDict();
|
mService.resetSuggestMainDict();
|
||||||
} else if (DictionaryPackConstants.NEW_DICTIONARY_INTENT_ACTION.equals(action)) {
|
} else if (DictionaryPackConstants.NEW_DICTIONARY_INTENT_ACTION.equals(action)) {
|
||||||
if (null == mService) {
|
if (null == mService) {
|
||||||
|
|
|
@ -1995,8 +1995,7 @@ public class LatinIME extends InputMethodService implements KeyboardActionListen
|
||||||
p.println(" Keyboard mode = " + keyboardMode);
|
p.println(" Keyboard mode = " + keyboardMode);
|
||||||
final SettingsValues settingsValues = mSettings.getCurrent();
|
final SettingsValues settingsValues = mSettings.getCurrent();
|
||||||
p.println(settingsValues.dump());
|
p.println(settingsValues.dump());
|
||||||
p.println(mDictionaryFacilitator.dump(this /* context */));
|
p.println(mDictionaryFacilitator.dump(this));
|
||||||
// TODO: Dump all settings values
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// slightly modified from Simple Keyboard: https://github.com/rkkr/simple-keyboard/blob/master/app/src/main/java/rkr/simplekeyboard/inputmethod/latin/LatinIME.java
|
// slightly modified from Simple Keyboard: https://github.com/rkkr/simple-keyboard/blob/master/app/src/main/java/rkr/simplekeyboard/inputmethod/latin/LatinIME.java
|
||||||
|
|
|
@ -51,6 +51,10 @@ public class RichInputMethodSubtype {
|
||||||
return mSubtype.getExtraValueOf(key);
|
return mSubtype.getExtraValueOf(key);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public boolean hasExtraValue(@NonNull final String key) {
|
||||||
|
return mSubtype.containsExtraValueKey(key);
|
||||||
|
}
|
||||||
|
|
||||||
// The mode is also determined by the primary subtype.
|
// The mode is also determined by the primary subtype.
|
||||||
public String getMode() {
|
public String getMode() {
|
||||||
return mSubtype.getMode();
|
return mSubtype.getMode();
|
||||||
|
|
|
@ -38,8 +38,6 @@ class DictionaryHeader(
|
||||||
|
|
||||||
val description: String?
|
val description: String?
|
||||||
// Helper method to get the description
|
// Helper method to get the description
|
||||||
// TODO: Right now each dictionary file comes with a description in its own language.
|
|
||||||
// It will display as is no matter the device's locale. It should be internationalized.
|
|
||||||
get() = mDictionaryOptions.mAttributes[DICTIONARY_DESCRIPTION_KEY]
|
get() = mDictionaryOptions.mAttributes[DICTIONARY_DESCRIPTION_KEY]
|
||||||
|
|
||||||
fun info(locale: Locale): String {
|
fun info(locale: Locale): String {
|
||||||
|
@ -52,8 +50,6 @@ class DictionaryHeader(
|
||||||
companion object {
|
companion object {
|
||||||
// Note that these are corresponding definitions in native code in latinime::HeaderPolicy
|
// Note that these are corresponding definitions in native code in latinime::HeaderPolicy
|
||||||
// and latinime::HeaderReadWriteUtils.
|
// and latinime::HeaderReadWriteUtils.
|
||||||
// TODO: Standardize the key names and bump up the format version, taking care not to
|
|
||||||
// break format version 2 dictionaries.
|
|
||||||
const val DICTIONARY_VERSION_KEY = "version"
|
const val DICTIONARY_VERSION_KEY = "version"
|
||||||
const val DICTIONARY_LOCALE_KEY = "locale"
|
const val DICTIONARY_LOCALE_KEY = "locale"
|
||||||
const val DICTIONARY_ID_KEY = "dictionary"
|
const val DICTIONARY_ID_KEY = "dictionary"
|
||||||
|
|
|
@ -37,7 +37,6 @@ import helium314.keyboard.latin.utils.UncachedInputMethodManagerUtils;
|
||||||
|
|
||||||
import java.util.ArrayList;
|
import java.util.ArrayList;
|
||||||
|
|
||||||
// TODO: Use Fragment to implement welcome screen and setup steps.
|
|
||||||
public final class SetupWizardActivity extends AppCompatActivity implements View.OnClickListener {
|
public final class SetupWizardActivity extends AppCompatActivity implements View.OnClickListener {
|
||||||
// For debugging purpose.
|
// For debugging purpose.
|
||||||
private static final boolean FORCE_TO_SHOW_WELCOME_SCREEN = false;
|
private static final boolean FORCE_TO_SHOW_WELCOME_SCREEN = false;
|
||||||
|
|
|
@ -252,6 +252,7 @@ public final class MoreSuggestions extends Keyboard {
|
||||||
// KeyboardIconsSet and alpha are unused. Use the icon that has been passed to the
|
// KeyboardIconsSet and alpha are unused. Use the icon that has been passed to the
|
||||||
// constructor.
|
// constructor.
|
||||||
// TODO: Drawable itself should have an alpha value.
|
// TODO: Drawable itself should have an alpha value.
|
||||||
|
// todo: replace with shape or vector, or maybe remove it completely
|
||||||
mIcon.setAlpha(128);
|
mIcon.setAlpha(128);
|
||||||
return mIcon;
|
return mIcon;
|
||||||
}
|
}
|
||||||
|
|
|
@ -25,7 +25,6 @@ public final class AutoCorrectionUtils {
|
||||||
if (suggestion.isKindOf(SuggestedWordInfo.KIND_WHITELIST)) {
|
if (suggestion.isKindOf(SuggestedWordInfo.KIND_WHITELIST)) {
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
// TODO: return suggestion.isAppropriateForAutoCorrection();
|
|
||||||
if (!suggestion.isAppropriateForAutoCorrection()) {
|
if (!suggestion.isAppropriateForAutoCorrection()) {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
|
@ -242,15 +242,12 @@ public final class SubtypeLocaleUtils {
|
||||||
private static String getSubtypeDisplayNameInternal(@NonNull final InputMethodSubtype subtype,
|
private static String getSubtypeDisplayNameInternal(@NonNull final InputMethodSubtype subtype,
|
||||||
@NonNull final Locale displayLocale) {
|
@NonNull final Locale displayLocale) {
|
||||||
final String replacementString = getReplacementString(subtype, displayLocale);
|
final String replacementString = getReplacementString(subtype, displayLocale);
|
||||||
// TODO: rework this for multi-lingual subtypes
|
|
||||||
final int nameResId = subtype.getNameResId();
|
final int nameResId = subtype.getNameResId();
|
||||||
return RunInLocaleKt.runInLocale(sResources, displayLocale,
|
return RunInLocaleKt.runInLocale(sResources, displayLocale,
|
||||||
res -> {
|
res -> {
|
||||||
try {
|
try {
|
||||||
return StringUtils.capitalizeFirstCodePoint(res.getString(nameResId, replacementString), displayLocale);
|
return StringUtils.capitalizeFirstCodePoint(res.getString(nameResId, replacementString), displayLocale);
|
||||||
} catch (Resources.NotFoundException e) {
|
} catch (Resources.NotFoundException e) {
|
||||||
// TODO: Remove this catch when InputMethodManager.getCurrentInputMethodSubtype
|
|
||||||
// is fixed.
|
|
||||||
Log.w(TAG, "Unknown subtype: mode=" + subtype.getMode()
|
Log.w(TAG, "Unknown subtype: mode=" + subtype.getMode()
|
||||||
+ " nameResId=" + subtype.getNameResId()
|
+ " nameResId=" + subtype.getNameResId()
|
||||||
+ " locale=" + subtype.getLocale()
|
+ " locale=" + subtype.getLocale()
|
||||||
|
@ -280,8 +277,7 @@ public final class SubtypeLocaleUtils {
|
||||||
if (keyboardLayoutSet == null && subtype.isAsciiCapable()) {
|
if (keyboardLayoutSet == null && subtype.isAsciiCapable()) {
|
||||||
keyboardLayoutSet = QWERTY;
|
keyboardLayoutSet = QWERTY;
|
||||||
}
|
}
|
||||||
// TODO: Remove this null check when InputMethodManager.getCurrentInputMethodSubtype is fixed.
|
if (keyboardLayoutSet == null) { // we could search for a subtype with the correct script, but this is a bug anyway...
|
||||||
if (keyboardLayoutSet == null) {
|
|
||||||
Log.w(TAG, "KeyboardLayoutSet not found, use QWERTY: " +
|
Log.w(TAG, "KeyboardLayoutSet not found, use QWERTY: " +
|
||||||
"locale=" + subtype.getLocale() + " extraValue=" + subtype.getExtraValue());
|
"locale=" + subtype.getLocale() + " extraValue=" + subtype.getExtraValue());
|
||||||
return QWERTY;
|
return QWERTY;
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue