0
0
mirror of https://github.com/ankidroid/Anki-Android.git synced 2024-09-20 20:03:05 +02:00
Commit Graph

12020 Commits

Author SHA1 Message Date
Arthur Milchior
42afcfc270 Mathjax output SVG instead of css
This should hopefully solves #7848, i.e. on samsung tablets, formulas are not correctly displayed.
The downsides are mentionned in http://docs.mathjax.org/en/latest/output/svg.html :
* it copy as image and not as text
* change in numbering of tags of equation (normally, cards are small enough that's not a problem)
2020-12-17 17:10:16 -05:00
Mike Hardy
fa3c20167b Bumped version to 2.15alpha16
@branch-specific
2020-12-14 14:45:17 +00:00
David Allison
a2825d6185 DiffEngine: Escape fewer characters
Moving from getCompat().detagged(str) to Html.escapeHtml meant that
unicode characters were escaped using HTML entities.

The problem with this is that some WebViews did not display ὐ
but they did display the unicode

So we move back to only escaping the dangerous HTML

https://stackoverflow.com/questions/35104032/whats-the-difference-between-androids-html-escapehtml-and-textutils-htmlencode

Aside: This means that quotes are now escaped in the input/output.
This should not be an issue as " / ' should be supported.

Fixes 7896
2020-12-14 09:30:34 -05:00
David Allison
bf73ba5375 DiffEngine: Refactor and Test
Mostly adding regression cover for the HTML escaping that used to occur in
13c27a6a1f from CompatV15.detagged

We moved to Html.escapeHtml, but this also escapes some characters such as
Polytonic Greek, which some browsers cannot display as HTML entities
(but Unicode works)

This also adds a failing test for us to fix in a follow-up commit
2020-12-14 09:30:34 -05:00
Henrik Giesel
10cd2c8b7c Put card outside of scope of MathJax callback 2020-12-14 09:16:38 -05:00
Arthur Milchior
b2fb9422a0 NF: remove useless semicolons 2020-12-14 09:15:36 -05:00
Arthur Milchior
2bd41e0ca6 NF: ignore a useless cast warning 2020-12-14 09:13:51 -05:00
David Allison
59fcc7ca5f BugFix: Import displays import dialog
showImportDialog's call to ImportDialog.newInstance was removed in 24443a3

Also adds basic tests to exercise functionality

Fixes 7898
2020-12-14 09:09:27 +01:00
David Allison
53944a2113 Revert "NF: showImportDialog takes no useless parameters"
This reverts commit 4bedb0f5
2020-12-14 09:09:27 +01:00
Mike Hardy
1c99901902 Bumped version to 2.15alpha15
@branch-specific
2020-12-13 14:02:58 +00:00
Mike Hardy
b787aa1c9d
Fix build break from #7878
This bears closer inspection
2020-12-13 08:51:46 -05:00
AnkiDroid Translations
104fb037d4 Updated strings from Crowdin 2020-12-13 08:51:39 -05:00
Arthur Milchior
369aa3dce4 NF: Uses java style array 2020-12-13 08:34:22 -05:00
Arthur Milchior
854d3254e4 NF: remove warning about useless array creation 2020-12-13 08:33:40 -05:00
Arthur Milchior
2ea1836074 NF: remove useless this/super 2020-12-13 08:33:07 -05:00
Arthur Milchior
34c87ba75f NF: remove useless casts, and related warning 2020-12-13 08:30:34 -05:00
Arthur Milchior
dfbd491b3d NF: remove unused label 2020-12-13 08:29:42 -05:00
Arthur Milchior
8bd4b69964 NF: remove unused exceptions throwing type 2020-12-13 08:28:51 -05:00
Arthur Milchior
480d3bf092 NF: remove redundant variable warning 2020-12-13 08:28:05 -05:00
Arthur Milchior
ba82d103b2 NF: remove redundant type introduction
The `T` is already introduced in the class above
2020-12-13 08:27:22 -05:00
Arthur Milchior
67d636de3f NF: remove redundant if warning 2020-12-13 08:25:34 -05:00
Arthur Milchior
867a68b88c NF: remove @VisibleForTesting
I have no idea why I added it, clearly, this CardQueue is expected to be used in real code
2020-12-13 08:24:10 -05:00
Arthur Milchior
6f565d2a3b NF: doProgress takes a single parameter
This also moves the warning about unchecked from all doProgress to the definition of doProgress
2020-12-13 08:23:32 -05:00
Arthur Milchior
a468ee58be NF: avoid function returning null, moving them to specific classes 2020-12-13 08:09:49 -05:00
Arthur Milchior
4699dbcb97 NF: Uses specific server type when the type is known 2020-12-13 08:09:49 -05:00
Arthur Milchior
b24b370558 NF: add typing for updatedecklistlistener 2020-12-13 08:06:34 -05:00
Arthur Milchior
3696153741 NF: add type parameter to card queue
Remove a warning about unchecked type
2020-12-13 08:05:56 -05:00
Arthur Milchior
da44e472f0 NF: return pair in correct order 2020-12-13 08:05:27 -05:00
Arthur Milchior
9e34babb11 NF: add brackets to pairs
There remain two pairs without bracket, but it's because there are wrong
2020-12-13 08:05:27 -05:00
Arthur Milchior
ab2c2425d4 NF: remove unused parameter in initFieldEditText 2020-12-13 08:03:39 -05:00
Arthur Milchior
4bedb0f502 NF: showImportDialog takes no useless parameters 2020-12-13 08:03:39 -05:00
Arthur Milchior
9692a2e4c7 NF: remove unused variable context in getTimeTaken 2020-12-13 08:03:39 -05:00
Arthur Milchior
61c5e5b0f5 NF: set some variable to final
I only changed the variables that I know. There are a lot other that can be made final, that gives warning in android
studio, but I don't know
2020-12-13 08:41:31 +00:00
Arthur Milchior
d64d77550f NF: remove m starting a method parameter 2020-12-13 07:45:20 +00:00
Mike Hardy
a55bcd502c Bumped version to 2.15alpha14
@branch-specific
2020-12-12 22:25:40 +00:00
Manav Sehgal
8311d47fc2
Remove legacy Whiteboard settings (#7858)
* Remove legacy whiteboard settings from prefs
* Remove black strokes setting from UI
* Remove monochrome refs
* Hide pen color based on night mode
* Fix typo
* Update Whiteboard Foreground test
* Add missing annotation import

Co-authored-by: Mike Hardy <github@mikehardy.net>
2020-12-12 17:14:13 -05:00
Arthur Milchior
c3587daefc NF: download return ConnectionResultType instead of pair
The pair was useless as second element was always null
2020-12-12 16:45:35 -05:00
Arthur Milchior
1a63ff82c8 NF: remove a method that is never used 2020-12-12 16:37:13 -05:00
Arthur Milchior
df252c1eb5 Equality check the correct value
I don't know why this is the only if case that was not properly changed in 38ab1ea7ad
In this case, it would mean the media db corruption was not catched
2020-12-12 16:35:53 -05:00
Arthur Milchior
dc528a6c1f MediaSyncer's sync second element is a string
It was never anything else, so no need to use type `Object`
2020-12-12 16:35:53 -05:00
Arthur Milchior
43cab6d355 NF: indicate that payload's data is NonNull 2020-12-12 16:34:05 -05:00
Arthur Milchior
ce53a4b8db Add a method returnGenericError to factorize code
Each time in Connection a generic error is returned, it is quite similar.
Furthermore, 38ab1ea7ad moved result to resultType, which was mostly correct. However, for
the sake of consistency, it should have left a 0-length array in result. This repair it
2020-12-12 16:19:09 -05:00
Arthur Milchior
1e4840929d NF: Add good type parameter to AbstractDeckTreeNode 2020-12-12 16:17:14 -05:00
Arthur Milchior
5d5a25740c DeckPicker's sync listener's onPostExecute uses resultType
It was correctly done in f8512af52fcae210a92f34c360f9ecb4db33c8ac, however rebasing over
47dd6596f3 seems to have fail. This is regretful because using sync actually helped made
the change simpler.
2020-12-12 15:45:25 -05:00
Arthur Milchior
4946fc7912 NF: remove a always true condition 2020-12-12 15:45:25 -05:00
Arthur Milchior
eeac3cff18 NF: remove useless cast 2020-12-12 15:45:25 -05:00
Arthur Milchior
d9d30432fb Adding empty array in result 2020-12-12 15:45:25 -05:00
Arthur Milchior
447a07d855 Adding back test for null array
In 38ab1ea7ad the test for null was removed. It should be useless normally, but it does
not hurt to add it back either
2020-12-12 15:45:25 -05:00
Arthur Milchior
33e5688ec5 Correct custom_sync_server_url
I do not know why this was added in 38ab1ea7ad. Even looking at history, it does not seems
like something that was recently removed.
2020-12-12 15:45:25 -05:00
Arthur Milchior
930bd70272 NF: correct typing of tasks
The very wrong line was
```java
private static class UpdateCardHandler<Result extends BooleanGetter> extends
ListenerWithProgressBarCloseOnFalse<Pair<Card, String>, Result> {
```

`UpdateCardHandler` should not have taken a parameter, and especially, no variable of this type should have been
declared without parameters. This stopped typechecking to work, and lead to #7862.

The remaining changes are the one detected by the correction of this first line.

The irony is that the whole point of using Task was to ensure type safety
2020-12-12 14:14:20 +01:00