mirror of
https://github.com/Helium314/HeliBoard.git
synced 2025-06-08 07:37:41 +00:00
Fixed 'min sdk' emoji attribute check for 'more keys' emojis
This commit is contained in:
parent
c43e139989
commit
26b51fa105
1 changed files with 8 additions and 2 deletions
|
@ -16,6 +16,8 @@
|
||||||
|
|
||||||
package org.dslul.openboard.inputmethod.keyboard.internal;
|
package org.dslul.openboard.inputmethod.keyboard.internal;
|
||||||
|
|
||||||
|
import android.os.Build;
|
||||||
|
import android.text.TextUtils;
|
||||||
import org.dslul.openboard.inputmethod.latin.common.StringUtils;
|
import org.dslul.openboard.inputmethod.latin.common.StringUtils;
|
||||||
|
|
||||||
import javax.annotation.Nullable;
|
import javax.annotation.Nullable;
|
||||||
|
@ -39,12 +41,16 @@ public final class MoreCodesArrayParser {
|
||||||
}
|
}
|
||||||
|
|
||||||
public static String parseKeySpecs(@Nullable String codeArraySpecs) {
|
public static String parseKeySpecs(@Nullable String codeArraySpecs) {
|
||||||
if (codeArraySpecs == null) {
|
if (codeArraySpecs == null || TextUtils.isEmpty(codeArraySpecs)) {
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
|
|
||||||
final StringBuilder sb = new StringBuilder();
|
final StringBuilder sb = new StringBuilder();
|
||||||
for (final String codeArraySpec : codeArraySpecs.split(SEMICOLON_REGEX)) {
|
for (final String codeArraySpec : codeArraySpecs.split(SEMICOLON_REGEX)) {
|
||||||
|
final int supportedMinSdkVersion = CodesArrayParser.getMinSupportSdkVersion(codeArraySpec);
|
||||||
|
if (Build.VERSION.SDK_INT < supportedMinSdkVersion) {
|
||||||
|
continue;
|
||||||
|
}
|
||||||
final String label = CodesArrayParser.parseLabel(codeArraySpec);
|
final String label = CodesArrayParser.parseLabel(codeArraySpec);
|
||||||
final String outputText = CodesArrayParser.parseOutputText(codeArraySpec);
|
final String outputText = CodesArrayParser.parseOutputText(codeArraySpec);
|
||||||
|
|
||||||
|
@ -55,6 +61,6 @@ public final class MoreCodesArrayParser {
|
||||||
// Remove last comma
|
// Remove last comma
|
||||||
if (sb.length() > 0) sb.deleteCharAt(sb.length() - 1);
|
if (sb.length() > 0) sb.deleteCharAt(sb.length() - 1);
|
||||||
|
|
||||||
return sb.toString();
|
return sb.length() > 0 ? sb.toString() : null;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue