new icons for virtual Shift, Filter and Voice keys
This commit is contained in:
parent
60132b52dc
commit
2c16dde14a
13 changed files with 57 additions and 7 deletions
|
|
@ -234,6 +234,8 @@ public abstract class HotkeyHandler extends CommandHandler {
|
|||
mInputMode.onAcceptSuggestion(suggestionOps.acceptIncomplete());
|
||||
resetKeyRepeat();
|
||||
|
||||
mainView.render();
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
|
|
@ -269,6 +271,8 @@ public abstract class HotkeyHandler extends CommandHandler {
|
|||
.loadSuggestions(filter);
|
||||
}
|
||||
|
||||
mainView.render();
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
|
|
@ -284,6 +288,7 @@ public abstract class HotkeyHandler extends CommandHandler {
|
|||
|
||||
backward = isLanguageRTL != backward;
|
||||
scrollSuggestions(backward);
|
||||
mainView.render();
|
||||
|
||||
return true;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -78,6 +78,14 @@ abstract public class MainViewHandler extends HotkeyHandler {
|
|||
return mInputMode.supportsFiltering();
|
||||
}
|
||||
|
||||
public boolean isFilteringFuzzy() {
|
||||
return mInputMode.isStemFilterFuzzy();
|
||||
}
|
||||
|
||||
public boolean isFilteringOn() {
|
||||
String stem = mInputMode.getWordStem();
|
||||
return stem != null && !stem.isEmpty();
|
||||
}
|
||||
|
||||
public boolean isInputLimited() {
|
||||
return inputType.isLimited();
|
||||
|
|
|
|||
|
|
@ -119,6 +119,7 @@ public abstract class TypingHandler extends KeyPadHandler {
|
|||
|
||||
if (appHacks.onBackspace(settings, mInputMode)) {
|
||||
mInputMode.reset();
|
||||
mainView.render();
|
||||
return false;
|
||||
}
|
||||
|
||||
|
|
@ -151,6 +152,8 @@ public abstract class TypingHandler extends KeyPadHandler {
|
|||
statusBar.setText(mInputMode);
|
||||
}
|
||||
|
||||
mainView.render();
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -27,11 +27,21 @@ public class SoftKeyFilter extends BaseSoftKeyWithIcons {
|
|||
&& tt9.onKeyFilterSuggestions(false, getLastPressedKey() == getId());
|
||||
}
|
||||
|
||||
@Override protected int getCentralIcon() { return R.drawable.ic_fn_filter; }
|
||||
@Override protected int getHoldIcon() { return R.drawable.ic_fn_filter_off; }
|
||||
@Override protected int getCentralIcon() {
|
||||
if (tt9 != null) {
|
||||
if (tt9.isFilteringFuzzy()) return R.drawable.ic_fn_filter_fuzzy;
|
||||
if (tt9.isFilteringOn()) return R.drawable.ic_fn_filter_exact;
|
||||
}
|
||||
return R.drawable.ic_fn_filter;
|
||||
}
|
||||
|
||||
@Override protected int getHoldIcon() {
|
||||
return R.drawable.ic_fn_filter_off;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void render() {
|
||||
resetIconCache();
|
||||
if (tt9 != null) {
|
||||
setEnabled(
|
||||
tt9.isFilteringSupported()
|
||||
|
|
|
|||
|
|
@ -74,7 +74,7 @@ public class SoftKeyRF3 extends BaseSoftKeyWithIcons {
|
|||
}
|
||||
|
||||
if (isVoiceInputActive() || (isTextEditingMissing() && !isVoiceInputMissing())) {
|
||||
return R.drawable.ic_fn_voice;
|
||||
return R.drawable.ic_fn_voice_off;
|
||||
}
|
||||
|
||||
return -1;
|
||||
|
|
|
|||
|
|
@ -4,6 +4,7 @@ import android.content.Context;
|
|||
import android.util.AttributeSet;
|
||||
|
||||
import io.github.sspanak.tt9.R;
|
||||
import io.github.sspanak.tt9.ime.modes.InputMode;
|
||||
|
||||
public class SoftKeyShift extends BaseSoftKeyWithIcons {
|
||||
public SoftKeyShift(Context context) {
|
||||
|
|
@ -19,7 +20,12 @@ public class SoftKeyShift extends BaseSoftKeyWithIcons {
|
|||
}
|
||||
|
||||
@Override protected int getCentralIcon() {
|
||||
return R.drawable.ic_fn_shift;
|
||||
final int textCase = tt9 != null ? tt9.getTextCase() : InputMode.CASE_UNDEFINED;
|
||||
return switch (textCase) {
|
||||
case InputMode.CASE_CAPITALIZE -> R.drawable.ic_fn_shift_caps;
|
||||
case InputMode.CASE_UPPER -> R.drawable.ic_fn_shift_up;
|
||||
default -> R.drawable.ic_fn_shift_low;
|
||||
};
|
||||
}
|
||||
|
||||
@Override
|
||||
|
|
@ -29,6 +35,7 @@ public class SoftKeyShift extends BaseSoftKeyWithIcons {
|
|||
|
||||
@Override
|
||||
public void render() {
|
||||
resetIconCache();
|
||||
setEnabled(
|
||||
tt9 != null
|
||||
&& !tt9.isVoiceInputActive()
|
||||
|
|
|
|||
4
app/src/main/res/drawable/ic_fn_filter_exact.xml
Normal file
4
app/src/main/res/drawable/ic_fn_filter_exact.xml
Normal file
|
|
@ -0,0 +1,4 @@
|
|||
<vector xmlns:android="http://schemas.android.com/apk/res/android" android:height="24dp" android:viewportHeight="960" android:viewportWidth="960" android:width="24dp">
|
||||
<path android:fillColor="#1f1f1f" android:pathData="M400,800v-280L118,160h724L560,520v120L400,640Z"/>
|
||||
<path android:fillColor="#1f1f1f" android:pathData="M400,720h160v80h-160z"/>
|
||||
</vector>
|
||||
3
app/src/main/res/drawable/ic_fn_filter_fuzzy.xml
Normal file
3
app/src/main/res/drawable/ic_fn_filter_fuzzy.xml
Normal file
|
|
@ -0,0 +1,3 @@
|
|||
<vector xmlns:android="http://schemas.android.com/apk/res/android" android:width="24dp" android:height="24dp" android:viewportWidth="960" android:viewportHeight="960">
|
||||
<path android:pathData="M400,800v-280L118,160h724L560,520v280L400,800Z" android:fillColor="#1f1f1f"/>
|
||||
</vector>
|
||||
|
|
@ -1,3 +0,0 @@
|
|||
<vector xmlns:android="http://schemas.android.com/apk/res/android" android:height="24dp" android:tint="#000000" android:viewportHeight="960" android:viewportWidth="960" android:width="24dp">
|
||||
<path android:fillColor="@android:color/white" android:pathData="M320,800L320,520L204,520Q178,520 167.5,497.5Q157,475 173,455L449,118Q461,103 480,103Q499,103 511,118L787,455Q803,475 792.5,497.5Q782,520 756,520L640,520L640,800Q640,817 628.5,828.5Q617,840 600,840L360,840Q343,840 331.5,828.5Q320,817 320,800ZM400,760L560,760L560,440L671,440L480,206L289,440L400,440L400,760ZM480,440L480,440L480,440L480,440L480,440L480,440L480,440Z"/>
|
||||
</vector>
|
||||
3
app/src/main/res/drawable/ic_fn_shift_caps.xml
Normal file
3
app/src/main/res/drawable/ic_fn_shift_caps.xml
Normal file
|
|
@ -0,0 +1,3 @@
|
|||
<vector xmlns:android="http://schemas.android.com/apk/res/android" android:width="24dp" android:height="24dp" android:viewportWidth="960" android:viewportHeight="960">
|
||||
<path android:pathData="M320,840v-320L120,520l360,-440 360,440L640,520v320L320,840Z" android:fillColor="#1f1f1f"/>
|
||||
</vector>
|
||||
3
app/src/main/res/drawable/ic_fn_shift_low.xml
Normal file
3
app/src/main/res/drawable/ic_fn_shift_low.xml
Normal file
|
|
@ -0,0 +1,3 @@
|
|||
<vector xmlns:android="http://schemas.android.com/apk/res/android" android:width="24dp" android:height="24dp" android:viewportWidth="960" android:viewportHeight="960">
|
||||
<path android:pathData="M320,840v-320L120,520l360,-440 360,440L640,520v320L320,840ZM400,760h160v-320h111L480,206 289,440h111v320ZM480,440Z" android:fillColor="#1f1f1f"/>
|
||||
</vector>
|
||||
4
app/src/main/res/drawable/ic_fn_shift_up.xml
Normal file
4
app/src/main/res/drawable/ic_fn_shift_up.xml
Normal file
|
|
@ -0,0 +1,4 @@
|
|||
<vector xmlns:android="http://schemas.android.com/apk/res/android" android:width="24dp" android:height="24dp" android:viewportWidth="960" android:viewportHeight="960">
|
||||
<path android:pathData="M320,840v-320L120,520l360,-440 360,440L640,520v160L320,680Z" android:fillColor="#1f1f1f"/>
|
||||
<path android:pathData="M320,760h320v80h-320z" android:fillColor="#1f1f1f"/>
|
||||
</vector>
|
||||
3
app/src/main/res/drawable/ic_fn_voice_off.xml
Normal file
3
app/src/main/res/drawable/ic_fn_voice_off.xml
Normal file
|
|
@ -0,0 +1,3 @@
|
|||
<vector xmlns:android="http://schemas.android.com/apk/res/android" android:width="24dp" android:height="24dp" android:viewportWidth="960" android:viewportHeight="960">
|
||||
<path android:pathData="m710,598 l-58,-58q14,-23 21,-48t7,-52h80q0,44 -13,83.5T710,598ZM592,478 L360,246v-46q0,-50 35,-85t85,-35q50,0 85,35t35,85v240q0,11 -2.5,20t-5.5,18ZM440,840v-124q-104,-14 -172,-92.5T200,440h80q0,83 58.5,141.5T480,640q34,0 64.5,-10.5T600,600l57,57q-29,23 -63.5,38.5T520,716v124h-80ZM792,904L56,168l56,-56 736,736 -56,56Z" android:fillColor="#1f1f1f"/>
|
||||
</vector>
|
||||
Loading…
Add table
Add a link
Reference in a new issue