mirror of
https://github.com/Helium314/HeliBoard.git
synced 2025-05-21 17:24:14 +00:00
Add toast notification when copying from clipboard (#752)
and use the toast for showing dictionary on double-long-press word: switch from one ugly workaround (popup menu) to another (hiding more suggestions panel) Co-authored-by: codokie <@> Co-authored-by: Helium314 <helium314@mailbox.org>
This commit is contained in:
parent
df6af1f07e
commit
e357f84572
11 changed files with 101 additions and 7 deletions
|
@ -41,6 +41,7 @@ import android.widget.TextView;
|
|||
|
||||
import helium314.keyboard.accessibility.AccessibilityUtils;
|
||||
import helium314.keyboard.keyboard.Keyboard;
|
||||
import helium314.keyboard.keyboard.KeyboardSwitcher;
|
||||
import helium314.keyboard.keyboard.MainKeyboardView;
|
||||
import helium314.keyboard.keyboard.PopupKeysPanel;
|
||||
import helium314.keyboard.keyboard.internal.keyboard_parser.floris.KeyCode;
|
||||
|
@ -445,12 +446,10 @@ public final class SuggestionStripView extends RelativeLayout implements OnClick
|
|||
final SuggestedWordInfo info = mSuggestedWords.getInfo(index);
|
||||
if (!info.getWord().equals(word)) return;
|
||||
final String text = info.mSourceDict.mDictType + ":" + info.mSourceDict.mLocale;
|
||||
// apparently toast is not working on some Android versions, probably
|
||||
// Android 13 with the notification permission
|
||||
// Toast.makeText(getContext(), text, Toast.LENGTH_LONG).show();
|
||||
final PopupMenu uglyWorkaround = new PopupMenu(DialogUtilsKt.getPlatformDialogThemeContext(getContext()), wordView);
|
||||
uglyWorkaround.getMenu().add(Menu.NONE, 1, Menu.NONE, text);
|
||||
uglyWorkaround.show();
|
||||
if (isShowingMoreSuggestionPanel()) {
|
||||
mMoreSuggestionsView.dismissPopupKeysPanel();
|
||||
}
|
||||
KeyboardSwitcher.getInstance().showToast(text, true);
|
||||
}
|
||||
|
||||
private void removeSuggestion(TextView wordView) {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue