mirror of
https://github.com/Helium314/HeliBoard.git
synced 2025-06-04 05:40:17 +00:00
rename more keys to popup keys
user-facing name is already popup keys, now internal rename is done to avoid confusion and for consistency
This commit is contained in:
parent
e708c026bc
commit
26809444bd
237 changed files with 1291 additions and 1305 deletions
|
@ -167,12 +167,12 @@ public final class MoreSuggestions extends Keyboard {
|
|||
}
|
||||
|
||||
public static final class Builder extends KeyboardBuilder<MoreSuggestionsParam> {
|
||||
private final MoreSuggestionsView mPaneView;
|
||||
private final PopupSuggestionsView mPaneView;
|
||||
private SuggestedWords mSuggestedWords;
|
||||
private int mFromIndex;
|
||||
private int mToIndex;
|
||||
|
||||
public Builder(final Context context, final MoreSuggestionsView paneView) {
|
||||
public Builder(final Context context, final PopupSuggestionsView paneView) {
|
||||
super(context, new MoreSuggestionsParam());
|
||||
mPaneView = paneView;
|
||||
}
|
||||
|
|
|
@ -15,7 +15,7 @@ import androidx.annotation.NonNull;
|
|||
import helium314.keyboard.keyboard.Key;
|
||||
import helium314.keyboard.keyboard.Keyboard;
|
||||
import helium314.keyboard.keyboard.KeyboardActionListener;
|
||||
import helium314.keyboard.keyboard.MoreKeysKeyboardView;
|
||||
import helium314.keyboard.keyboard.PopupKeysKeyboardView;
|
||||
import helium314.keyboard.latin.R;
|
||||
import helium314.keyboard.latin.SuggestedWords;
|
||||
import helium314.keyboard.latin.SuggestedWords.SuggestedWordInfo;
|
||||
|
@ -25,8 +25,8 @@ import helium314.keyboard.latin.suggestions.MoreSuggestions.MoreSuggestionKey;
|
|||
* A view that renders a virtual {@link MoreSuggestions}. It handles rendering of keys and detecting
|
||||
* key presses and touch movements.
|
||||
*/
|
||||
public final class MoreSuggestionsView extends MoreKeysKeyboardView {
|
||||
private static final String TAG = MoreSuggestionsView.class.getSimpleName();
|
||||
public final class PopupSuggestionsView extends PopupKeysKeyboardView {
|
||||
private static final String TAG = PopupSuggestionsView.class.getSimpleName();
|
||||
|
||||
public static abstract class MoreSuggestionsListener extends KeyboardActionListener.Adapter {
|
||||
public abstract void onSuggestionSelected(final SuggestedWordInfo info);
|
||||
|
@ -34,12 +34,12 @@ public final class MoreSuggestionsView extends MoreKeysKeyboardView {
|
|||
|
||||
private boolean mIsInModalMode;
|
||||
|
||||
public MoreSuggestionsView(final Context context, final AttributeSet attrs) {
|
||||
this(context, attrs, R.attr.moreKeysKeyboardViewStyle);
|
||||
public PopupSuggestionsView(final Context context, final AttributeSet attrs) {
|
||||
this(context, attrs, R.attr.popupKeysKeyboardViewStyle);
|
||||
}
|
||||
|
||||
public MoreSuggestionsView(final Context context, final AttributeSet attrs,
|
||||
final int defStyle) {
|
||||
public PopupSuggestionsView(final Context context, final AttributeSet attrs,
|
||||
final int defStyle) {
|
||||
super(context, attrs, defStyle);
|
||||
}
|
||||
|
||||
|
@ -49,10 +49,10 @@ public final class MoreSuggestionsView extends MoreKeysKeyboardView {
|
|||
super.setKeyboard(keyboard);
|
||||
mIsInModalMode = false;
|
||||
// With accessibility mode off, {@link #mAccessibilityDelegate} is set to null at the
|
||||
// above {@link MoreKeysKeyboardView#setKeyboard(Keyboard)} call.
|
||||
// above {@link PopupKeysKeyboardView#setKeyboard(Keyboard)} call.
|
||||
// With accessibility mode on, {@link #mAccessibilityDelegate} is set to a
|
||||
// {@link MoreKeysKeyboardAccessibilityDelegate} object at the above
|
||||
// {@link MoreKeysKeyboardView#setKeyboard(Keyboard)} call.
|
||||
// {@link PopupKeysKeyboardAccessibilityDelegate} object at the above
|
||||
// {@link PopupKeysKeyboardView#setKeyboard(Keyboard)} call.
|
||||
if (mAccessibilityDelegate != null) {
|
||||
mAccessibilityDelegate.setOpenAnnounce(R.string.spoken_open_more_suggestions);
|
||||
mAccessibilityDelegate.setCloseAnnounce(R.string.spoken_close_more_suggestions);
|
||||
|
@ -71,8 +71,8 @@ public final class MoreSuggestionsView extends MoreKeysKeyboardView {
|
|||
|
||||
public void setModalMode() {
|
||||
mIsInModalMode = true;
|
||||
// Set vertical correction to zero (Reset more keys keyboard sliding allowance
|
||||
// {@link R#dimen.config_more_keys_keyboard_slide_allowance}).
|
||||
// Set vertical correction to zero (Reset popup keys keyboard sliding allowance
|
||||
// {@link R#dimen.config_popup_keys_keyboard_slide_allowance}).
|
||||
mKeyDetector.setKeyboard(getKeyboard(), -getPaddingLeft(), -getPaddingTop());
|
||||
}
|
||||
|
|
@ -44,7 +44,7 @@ import android.widget.TextView;
|
|||
import helium314.keyboard.accessibility.AccessibilityUtils;
|
||||
import helium314.keyboard.keyboard.Keyboard;
|
||||
import helium314.keyboard.keyboard.MainKeyboardView;
|
||||
import helium314.keyboard.keyboard.MoreKeysPanel;
|
||||
import helium314.keyboard.keyboard.PopupKeysPanel;
|
||||
import helium314.keyboard.latin.AudioAndHapticFeedbackManager;
|
||||
import helium314.keyboard.latin.Dictionary;
|
||||
import helium314.keyboard.latin.R;
|
||||
|
@ -57,7 +57,7 @@ import helium314.keyboard.latin.define.DebugFlags;
|
|||
import helium314.keyboard.latin.settings.DebugSettings;
|
||||
import helium314.keyboard.latin.settings.Settings;
|
||||
import helium314.keyboard.latin.settings.SettingsValues;
|
||||
import helium314.keyboard.latin.suggestions.MoreSuggestionsView.MoreSuggestionsListener;
|
||||
import helium314.keyboard.latin.suggestions.PopupSuggestionsView.MoreSuggestionsListener;
|
||||
import helium314.keyboard.latin.utils.DeviceProtectedUtils;
|
||||
import helium314.keyboard.latin.utils.DialogUtilsKt;
|
||||
import helium314.keyboard.latin.utils.Log;
|
||||
|
@ -98,7 +98,7 @@ public final class SuggestionStripView extends RelativeLayout implements OnClick
|
|||
MainKeyboardView mMainKeyboardView;
|
||||
|
||||
private final View mMoreSuggestionsContainer;
|
||||
private final MoreSuggestionsView mMoreSuggestionsView;
|
||||
private final PopupSuggestionsView mMoreSuggestionsView;
|
||||
private final MoreSuggestions.Builder mMoreSuggestionsBuilder;
|
||||
|
||||
private final ArrayList<TextView> mWordViews = new ArrayList<>();
|
||||
|
@ -331,20 +331,20 @@ public final class SuggestionStripView extends RelativeLayout implements OnClick
|
|||
}
|
||||
};
|
||||
|
||||
private final MoreKeysPanel.Controller mMoreSuggestionsController =
|
||||
new MoreKeysPanel.Controller() {
|
||||
private final PopupKeysPanel.Controller mMoreSuggestionsController =
|
||||
new PopupKeysPanel.Controller() {
|
||||
@Override
|
||||
public void onDismissMoreKeysPanel() {
|
||||
mMainKeyboardView.onDismissMoreKeysPanel();
|
||||
public void onDismissPopupKeysPanel() {
|
||||
mMainKeyboardView.onDismissPopupKeysPanel();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onShowMoreKeysPanel(final MoreKeysPanel panel) {
|
||||
mMainKeyboardView.onShowMoreKeysPanel(panel);
|
||||
public void onShowPopupKeysPanel(final PopupKeysPanel panel) {
|
||||
mMainKeyboardView.onShowPopupKeysPanel(panel);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onCancelMoreKeysPanel() {
|
||||
public void onCancelPopupKeysPanel() {
|
||||
dismissMoreSuggestionsPanel();
|
||||
}
|
||||
};
|
||||
|
@ -354,7 +354,7 @@ public final class SuggestionStripView extends RelativeLayout implements OnClick
|
|||
}
|
||||
|
||||
public void dismissMoreSuggestionsPanel() {
|
||||
mMoreSuggestionsView.dismissMoreKeysPanel();
|
||||
mMoreSuggestionsView.dismissPopupKeysPanel();
|
||||
}
|
||||
|
||||
@Override
|
||||
|
@ -466,7 +466,7 @@ public final class SuggestionStripView extends RelativeLayout implements OnClick
|
|||
private void removeSuggestion(TextView wordView) {
|
||||
final String word = wordView.getText().toString();
|
||||
mListener.removeSuggestion(word);
|
||||
mMoreSuggestionsView.dismissMoreKeysPanel();
|
||||
mMoreSuggestionsView.dismissPopupKeysPanel();
|
||||
// show suggestions, but without the removed word
|
||||
final ArrayList<SuggestedWordInfo> sw = new ArrayList<>();
|
||||
for (int i = 0; i < mSuggestedWords.size(); i ++) {
|
||||
|
@ -516,7 +516,7 @@ public final class SuggestionStripView extends RelativeLayout implements OnClick
|
|||
|
||||
final int pointX = stripWidth / 2;
|
||||
final int pointY = -layoutHelper.mMoreSuggestionsBottomGap;
|
||||
mMoreSuggestionsView.showMoreKeysPanel(this, mMoreSuggestionsController, pointX, pointY,
|
||||
mMoreSuggestionsView.showPopupKeysPanel(this, mMoreSuggestionsController, pointX, pointY,
|
||||
mMoreSuggestionsListener);
|
||||
mOriginX = mLastX;
|
||||
mOriginY = mLastY;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue