mirror of
https://github.com/Helium314/HeliBoard.git
synced 2025-05-14 14:02:44 +00:00
lint
This commit is contained in:
parent
2f5e3230d0
commit
983897e96e
50 changed files with 74 additions and 80 deletions
|
@ -208,7 +208,6 @@ public final class KeyboardLayoutSet {
|
|||
|
||||
public static final class Builder {
|
||||
private final Context mContext;
|
||||
private final String mPackageName;
|
||||
private final Resources mResources;
|
||||
|
||||
private final Params mParams = new Params();
|
||||
|
@ -217,7 +216,6 @@ public final class KeyboardLayoutSet {
|
|||
|
||||
public Builder(final Context context, @Nullable final EditorInfo ei) {
|
||||
mContext = context;
|
||||
mPackageName = context.getPackageName();
|
||||
mResources = context.getResources();
|
||||
final Params params = mParams;
|
||||
|
||||
|
|
|
@ -88,7 +88,7 @@ final class EmojiCategory {
|
|||
|
||||
private static final int[] sAccessibilityDescriptionResourceIdsForCategories = {
|
||||
R.string.spoken_descrption_emoji_category_recents,
|
||||
R.string.spoken_descrption_emoji_category_eight_smiley_people,
|
||||
R.string.spoken_descrption_emoji_category_eight_smiley_people, // todo: actually this is smiley only... and duplicate string
|
||||
R.string.spoken_descrption_emoji_category_eight_smiley_people,
|
||||
R.string.spoken_descrption_emoji_category_eight_animals_nature,
|
||||
R.string.spoken_descrption_emoji_category_eight_food_drink,
|
||||
|
|
|
@ -6,6 +6,7 @@
|
|||
|
||||
package org.dslul.openboard.inputmethod.keyboard.emoji;
|
||||
|
||||
import android.annotation.SuppressLint;
|
||||
import android.content.Context;
|
||||
import android.content.res.Resources;
|
||||
import android.content.res.TypedArray;
|
||||
|
@ -61,6 +62,7 @@ public final class EmojiPalettesView extends LinearLayout
|
|||
private boolean initialized = false;
|
||||
private final int mFunctionalKeyBackgroundId;
|
||||
private final Drawable mSpacebarBackground;
|
||||
// keep the indicator in case emoji view is changed to tabs / viewpager
|
||||
private final boolean mCategoryIndicatorEnabled;
|
||||
private final int mCategoryIndicatorDrawableResId;
|
||||
private final int mCategoryIndicatorBackgroundResId;
|
||||
|
@ -157,6 +159,7 @@ public final class EmojiPalettesView extends LinearLayout
|
|||
iconView.setOnClickListener(this);
|
||||
}
|
||||
|
||||
@SuppressLint("ClickableViewAccessibility")
|
||||
public void initialize() { // needs to be delayed for access to EmojiTabStrip, which is not a child of this view
|
||||
if (initialized) return;
|
||||
mEmojiCategory.initialize();
|
||||
|
@ -426,6 +429,7 @@ public final class EmojiPalettesView extends LinearLayout
|
|||
mKeyboardActionListener = listener;
|
||||
}
|
||||
|
||||
@SuppressLint("ClickableViewAccessibility")
|
||||
@Override
|
||||
public boolean onTouch(final View v, final MotionEvent event) {
|
||||
switch (event.getActionMasked()) {
|
||||
|
|
|
@ -10,7 +10,6 @@ import kotlinx.serialization.encodeToString
|
|||
import kotlinx.serialization.json.Json
|
||||
import org.dslul.openboard.inputmethod.compat.ClipboardManagerCompat
|
||||
import org.dslul.openboard.inputmethod.latin.settings.Settings
|
||||
import org.dslul.openboard.inputmethod.latin.utils.DeviceProtectedUtils
|
||||
import kotlin.collections.ArrayList
|
||||
|
||||
class ClipboardHistoryManager(
|
||||
|
|
|
@ -64,7 +64,7 @@ public class DictionaryFacilitatorImpl implements DictionaryFacilitator {
|
|||
// dictionary.
|
||||
private static final int CAPITALIZED_FORM_MAX_PROBABILITY_FOR_INSERT = 140;
|
||||
|
||||
private ArrayList<DictionaryGroup> mDictionaryGroups = new ArrayList<DictionaryGroup>() {{ add(new DictionaryGroup()); }};
|
||||
private ArrayList<DictionaryGroup> mDictionaryGroups = new ArrayList<>() {{ add(new DictionaryGroup()); }};
|
||||
private volatile CountDownLatch mLatchForWaitingLoadingMainDictionaries = new CountDownLatch(0);
|
||||
// To synchronize assigning mDictionaryGroup to ensure closing dictionaries.
|
||||
private final Object mLock = new Object();
|
||||
|
@ -1028,9 +1028,10 @@ public class DictionaryFacilitatorImpl implements DictionaryFacilitator {
|
|||
return maxFreq;
|
||||
}
|
||||
|
||||
private boolean clearSubDictionary(final String dictName) {
|
||||
@Override
|
||||
public boolean clearUserHistoryDictionary(final Context context) {
|
||||
for (DictionaryGroup dictionaryGroup : mDictionaryGroups) {
|
||||
final ExpandableBinaryDictionary dictionary = dictionaryGroup.getSubDict(dictName);
|
||||
final ExpandableBinaryDictionary dictionary = dictionaryGroup.getSubDict(Dictionary.TYPE_USER_HISTORY);
|
||||
if (dictionary == null) {
|
||||
return false; // should only ever happen for primary dictionary, so this is safe
|
||||
}
|
||||
|
@ -1039,11 +1040,6 @@ public class DictionaryFacilitatorImpl implements DictionaryFacilitator {
|
|||
return true;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean clearUserHistoryDictionary(final Context context) {
|
||||
return clearSubDictionary(Dictionary.TYPE_USER_HISTORY);
|
||||
}
|
||||
|
||||
@Override
|
||||
public String localesAndConfidences() {
|
||||
if (mDictionaryGroups.size() < 2) return null;
|
||||
|
|
|
@ -6,7 +6,6 @@
|
|||
package org.dslul.openboard.inputmethod.latin.common
|
||||
|
||||
import android.content.Context
|
||||
import android.os.Build
|
||||
import org.dslul.openboard.inputmethod.compat.locale
|
||||
import org.dslul.openboard.inputmethod.latin.R
|
||||
import org.dslul.openboard.inputmethod.latin.utils.ScriptUtils.script
|
||||
|
|
|
@ -4,7 +4,6 @@ package org.dslul.openboard.inputmethod.latin.settings
|
|||
import android.content.Context
|
||||
import android.content.Intent
|
||||
import android.net.Uri
|
||||
import android.os.Build
|
||||
import android.text.method.LinkMovementMethod
|
||||
import android.util.TypedValue
|
||||
import android.view.LayoutInflater
|
||||
|
|
|
@ -68,8 +68,8 @@ public final class AndroidSpellCheckerService extends SpellCheckerService
|
|||
private final SettingsValuesForSuggestion mSettingsValuesForSuggestion =
|
||||
new SettingsValuesForSuggestion(true, false);
|
||||
|
||||
public static final String SINGLE_QUOTE = "\u0027";
|
||||
public static final String APOSTROPHE = "\u2019";
|
||||
public static final String SINGLE_QUOTE = "'";
|
||||
public static final String APOSTROPHE = "’";
|
||||
|
||||
public AndroidSpellCheckerService() {
|
||||
super();
|
||||
|
|
|
@ -20,7 +20,6 @@ import org.dslul.openboard.inputmethod.latin.define.DebugFlags
|
|||
import org.dslul.openboard.inputmethod.latin.settings.Settings
|
||||
import org.dslul.openboard.inputmethod.latin.utils.ScriptUtils.script
|
||||
import org.xmlpull.v1.XmlPullParser
|
||||
import java.io.File
|
||||
import java.util.*
|
||||
|
||||
/** @return enabled subtypes. If no subtypes are enabled, but a contextForFallback is provided,
|
||||
|
@ -52,7 +51,7 @@ fun getMatchingLayoutSetNameForLocale(locale: Locale): String {
|
|||
ScriptUtils.SCRIPT_GEORGIAN -> "georgian"
|
||||
ScriptUtils.SCRIPT_BENGALI -> "bengali_unijoy"
|
||||
else -> throw RuntimeException("Wrong script supplied: ${locale.script()}")
|
||||
};
|
||||
}
|
||||
}
|
||||
|
||||
fun addEnabledSubtype(prefs: SharedPreferences, newSubtype: InputMethodSubtype) {
|
||||
|
@ -221,7 +220,7 @@ private fun loadResourceSubtypes(resources: Resources) {
|
|||
if (subtypeId != 0)
|
||||
b.setSubtypeId(subtypeId)
|
||||
b.setSubtypeLocale(localeString)
|
||||
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.N && languageTag != null)
|
||||
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.N)
|
||||
b.setLanguageTag(languageTag)
|
||||
b.setSubtypeMode(imeSubtypeMode)
|
||||
b.setSubtypeExtraValue(imeSubtypeExtraValue)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue