Show Toast using JavaScript function in WebView#6386
Show Toast using JavaScript function in WebView#6386mikehardy merged 4 commits intoankidroid:masterfrom
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. |
david-allison
left a comment
There was a problem hiding this comment.
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: |
david-allison
left a comment
There was a problem hiding this comment.
One last change, then good to go!
AnkiDroid/src/main/java/com/ichi2/anki/AbstractFlashcardViewer.java
Outdated
Show resolved
Hide resolved
|
Is it okay to be merged? |
mikehardy
left a comment
There was a problem hiding this comment.
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.
ifstatements)