-
-
Notifications
You must be signed in to change notification settings - Fork 2.2k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Show Toast using JavaScript function in WebView #6386
Conversation
AbstractFlashcardViewer.java
This is not much required as using CSS it can be made. But it will be good if there because using one line by passing message can show toast in native way. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Could you take a look at how the typeans
functions handle this, and abstract out/copy their way of handing unicode. It was a little more complex than it initially appeared, I don't think this currently handles Mandarin for example.
AnkiDroid/src/main/java/com/ichi2/anki/AbstractFlashcardViewer.java
Outdated
Show resolved
Hide resolved
AnkiDroid/src/main/java/com/ichi2/anki/AbstractFlashcardViewer.java
Outdated
Show resolved
Hide resolved
I will update it for other language also. |
I believe this will break if you enter a single percentage: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
One last change, then good to go!
AnkiDroid/src/main/java/com/ichi2/anki/AbstractFlashcardViewer.java
Outdated
Show resolved
Hide resolved
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good to me. Thanks!
Is it okay to be merged? |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM as well - thanks @infinyte7
Pull Request template
Purpose / Description
As sometime it needed to toast in AnkiDroid. This will create native toast of message passed by card developer
This is continuation of #6307
Fixes
Fixes Link to the issues.
Approach
Added signal for calling function
In card.js
How Has This Been Tested?
Tested on emulator,
The function accept string for showing toast message
In front side of card template add it in
<script>
tagLearning (optional, can help others)
https://developer.android.com/guide/topics/ui/notifiers/toasts
Checklist
Please, go through these checks before submitting the PR.
if
statements)