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

206 Commits

Author SHA1 Message Date
dependabot-preview[bot]
3870b01bba Bump junit-vintage-engine from 5.7.0 to 5.7.1
Bumps [junit-vintage-engine](https://github.com/junit-team/junit5) from 5.7.0 to 5.7.1.
- [Release notes](https://github.com/junit-team/junit5/releases)
- [Commits](https://github.com/junit-team/junit5/compare/r5.7.0...r5.7.1)

Signed-off-by: dependabot-preview[bot] <support@dependabot.com>
2021-02-10 11:34:17 -05:00
dependabot-preview[bot]
eb7087c0d7 Bump robolectric from 4.5 to 4.5.1
Bumps [robolectric](https://github.com/robolectric/robolectric) from 4.5 to 4.5.1.
- [Release notes](https://github.com/robolectric/robolectric/releases)
- [Commits](https://github.com/robolectric/robolectric/compare/robolectric-4.5...robolectric-4.5.1)

Signed-off-by: dependabot-preview[bot] <support@dependabot.com>
2021-02-10 11:34:17 -05:00
dependabot-preview[bot]
e5a3b0a9ed Bump robolectric from 4.4 to 4.5
Bumps [robolectric](https://github.com/robolectric/robolectric) from 4.4 to 4.5.
- [Release notes](https://github.com/robolectric/robolectric/releases)
- [Commits](https://github.com/robolectric/robolectric/compare/robolectric-4.4...robolectric-4.5)

Signed-off-by: dependabot-preview[bot] <support@dependabot.com>
2021-02-10 11:34:17 -05:00
Mike Hardy
20900641d9
Update URL of API module upload tutorial 2020-12-20 14:01:32 -05:00
Mike Hardy
4bd36354d2
Fix javadoc parameter names in AddContentApi method
They all had trailing ':' on them, easy fix
2020-12-20 13:59:37 -05:00
Mike Hardy
037a61dba4
Fix javadoc compile classpath for API module 2020-12-20 13:58:39 -05:00
Mike Hardy
f5d4d9d0f9
Bump API version code to match version 2020-12-20 13:52:34 -05:00
Danny
d12cb05934 Bump API to 1.1.0 2020-12-20 13:50:21 -05:00
Mike Hardy
a656c7fc1f Bump API compileSdkVersion to 30 2020-12-20 13:22:29 -05:00
Arthur Milchior
480d3bf092 NF: remove redundant variable warning 2020-12-13 08:28:05 -05:00
Arthur Milchior
5128cc2c75 NF: init capacity of list, map and set 2020-12-09 11:27:39 -05:00
Arthur Milchior
5e7768fe1d NF: same for getDeckName (never called actually) 2020-10-28 22:46:26 -05:00
Arthur Milchior
3e4824db5f NF: simplify getModelName
This return null if data absent. It's always call with `long`
2020-10-28 22:46:26 -05:00
Arthur Milchior
84f1d231ad NF: Quicker split field
The function split is optimized for splitting around a char. We never used it because instead we used unicode encoding
in regexp. This small change will save plenty of time for all batch processing.
2020-10-23 13:38:06 -05:00
dependabot-preview[bot]
b16ac83de2 Bump junit-vintage-engine from 5.6.2 to 5.7.0
Bumps [junit-vintage-engine](https://github.com/junit-team/junit5) from 5.6.2 to 5.7.0.
- [Release notes](https://github.com/junit-team/junit5/releases)
- [Commits](https://github.com/junit-team/junit5/compare/r5.6.2...r5.7.0)

Signed-off-by: dependabot-preview[bot] <support@dependabot.com>
2020-10-04 17:19:10 -05:00
Mike Hardy
c602fd36be Update Robolectric to 4.4 / API to 29 in API project
This transitively required a bump to minSdkVersion 14 from 8
2020-10-04 17:19:10 -05:00
Kieran Brannigan
4d2cf42b05
Add media file insert to AnkiDroid API (#6641)
* Add AnkiMedia class to FlashCardsContract.java

* Add MEDIA uri to ContentProvider

* Insert MEDIA adds media file and returns Uri fname

* addMediaFromUri returns proper formatted String

This formatted string can be returned and inserted straight into the
field of a card.

* Replace assert call

Assert doesn't work in java, but if it ever gets fixed it could cause crashes. Best not to use it.

* Change StackTrace to specific Timber warning

* Refactor insert MEDIA case into a function call

* Improve documentation

* Add Nullable and NotNull annotations

* Extract internalizeUri to FileUtil.java

* Add example to javadoc

* Convert Timber.e to Timber.w

* Use temp-media cache dir instead of media.dir()

* Change annotations to androidx

UnitTest was throwing linting error because we were using jetbrains
annotations.

* Apply suggestions from code review

Co-authored-by: Mike Hardy <github@mikehardy.net>
2020-10-04 14:14:50 -05:00
Arthur Milchior
516bb9c1fa NF: remove C-style array 2020-09-30 22:55:33 +01:00
Arthur Milchior
a079a61fc0 NF: suppress warning of redundant escape when it does not seems redundant 2020-09-28 08:29:08 -05:00
Arthur Milchior
975a902915 NF: Remove warning about useless type in generic class constructors 2020-09-24 09:30:56 -05:00
Arthur Milchior
1f785c1b8c NF: Remove warning about parameter that could be final 2020-09-23 11:08:06 -05:00
David Allison
6d3342d6a7 DOCS: Fix JavaDoc compile errors
<pre> doesn't seem to be happy in a <p> (checked in validator)
2020-09-21 09:01:50 -05:00
Arthur Milchior
f4857037ce NF: supress warning for charset object
Because actually, it can't be used with our lowest version of the API supported
2020-09-21 07:16:02 -05:00
lukstbit
018c1db71f Update severity for time related lint violations 2020-08-30 18:24:56 -05:00
lukstbit
de3f38ee37 Add lint checks for new time api 2020-08-25 10:04:26 +02:00
David Allison
447647b84e LINT api: consistent noinspection OldTargetApi
Matches AnkiDroid folder
2020-06-04 20:52:55 -05:00
David Allison
99430e49b1 Upgrade API to Java 1.8 to allow JDK 14 compilation
Fixes #5955
2020-06-04 20:52:55 -05:00
Mike Hardy
4265acb367 Turn on most lint checks but filter by current baseline
If this is correct then future lint errors should break the build,
while existing ones will pass.

This should put a cap on the accretion of new lint while we start
to whittle down the existing pile
2020-05-15 12:00:07 -05:00
dependabot-preview[bot]
57e06706f3 Bump junit-vintage-engine from 5.6.1 to 5.6.2
Bumps [junit-vintage-engine](https://github.com/junit-team/junit5) from 5.6.1 to 5.6.2.
- [Release notes](https://github.com/junit-team/junit5/releases)
- [Commits](https://github.com/junit-team/junit5/compare/r5.6.1...r5.6.2)

Signed-off-by: dependabot-preview[bot] <support@dependabot.com>
2020-04-30 14:45:21 -05:00
Mike Hardy
cb49fb552e Upgrade to robolectric 4.3.1 with new Looper mode
This involved handling some timer differences, and accessing Context differently

The only troubling part was in AbstractFlashcardViewerTest - there's a thorny timing
issue there which I solved by coarsely hacking in a sleep
2020-04-13 14:48:58 -05:00
Mike Hardy
f2a0fcd743
Dependency updates 20200331
* Bump mockito-core from 3.3.1 to 3.3.3

Bumps [mockito-core](https://github.com/mockito/mockito) from 3.3.1 to 3.3.3.
- [Release notes](https://github.com/mockito/mockito/releases)
- [Commits](https://github.com/mockito/mockito/compare/v3.3.1...v3.3.3)

Signed-off-by: dependabot-preview[bot] <support@dependabot.com>

* Bump powermock-core from 2.0.5 to 2.0.6

Bumps [powermock-core](https://github.com/powermock/powermock) from 2.0.5 to 2.0.6.
- [Release notes](https://github.com/powermock/powermock/releases)
- [Changelog](https://github.com/powermock/powermock/blob/release/2.x/docs/changelog.txt)
- [Commits](https://github.com/powermock/powermock/compare/powermock-2.0.5...powermock-2.0.6)

Signed-off-by: dependabot-preview[bot] <support@dependabot.com>

* Bump okhttp from 3.12.8 to 3.12.10

Bumps [okhttp](https://github.com/square/okhttp) from 3.12.8 to 3.12.10.
- [Release notes](https://github.com/square/okhttp/releases)
- [Changelog](https://github.com/square/okhttp/blob/master/docs/changelog_3x.md)
- [Commits](https://github.com/square/okhttp/compare/parent-3.12.8...parent-3.12.10)

Signed-off-by: dependabot-preview[bot] <support@dependabot.com>

* Bump powermock-module-junit4 from 2.0.5 to 2.0.6

Bumps [powermock-module-junit4](https://github.com/powermock/powermock) from 2.0.5 to 2.0.6.
- [Release notes](https://github.com/powermock/powermock/releases)
- [Changelog](https://github.com/powermock/powermock/blob/release/2.x/docs/changelog.txt)
- [Commits](https://github.com/powermock/powermock/compare/powermock-2.0.5...powermock-2.0.6)

Signed-off-by: dependabot-preview[bot] <support@dependabot.com>

* Bump jsoup from 1.12.2 to 1.13.1

Bumps [jsoup](https://github.com/jhy/jsoup) from 1.12.2 to 1.13.1.
- [Release notes](https://github.com/jhy/jsoup/releases)
- [Changelog](https://github.com/jhy/jsoup/blob/master/CHANGES)
- [Commits](https://github.com/jhy/jsoup/compare/1.12.2...jsoup-1.13.1)

Signed-off-by: dependabot-preview[bot] <support@dependabot.com>

* Bump com.github.triplet.play from 2.7.2 to 2.7.3

Bumps com.github.triplet.play from 2.7.2 to 2.7.3.

Signed-off-by: dependabot-preview[bot] <support@dependabot.com>

* Bump junit-vintage-engine from 5.6.0 to 5.6.1

Bumps [junit-vintage-engine](https://github.com/junit-team/junit5) from 5.6.0 to 5.6.1.
- [Release notes](https://github.com/junit-team/junit5/releases)
- [Commits](https://github.com/junit-team/junit5/compare/r5.6.0...r5.6.1)

Signed-off-by: dependabot-preview[bot] <support@dependabot.com>

* Bump powermock-api-mockito2 from 2.0.5 to 2.0.6

Bumps [powermock-api-mockito2](https://github.com/powermock/powermock) from 2.0.5 to 2.0.6.
- [Release notes](https://github.com/powermock/powermock/releases)
- [Changelog](https://github.com/powermock/powermock/blob/release/2.x/docs/changelog.txt)
- [Commits](https://github.com/powermock/powermock/compare/powermock-2.0.5...powermock-2.0.6)

Signed-off-by: dependabot-preview[bot] <support@dependabot.com>

* Bump powermock-core from 2.0.6 to 2.0.7

Bumps [powermock-core](https://github.com/powermock/powermock) from 2.0.6 to 2.0.7.
- [Release notes](https://github.com/powermock/powermock/releases)
- [Changelog](https://github.com/powermock/powermock/blob/release/2.x/docs/changelog.txt)
- [Commits](https://github.com/powermock/powermock/compare/powermock-2.0.6...powermock-2.0.7)

Signed-off-by: dependabot-preview[bot] <support@dependabot.com>

* Bump powermock-api-mockito2 from 2.0.6 to 2.0.7

Bumps [powermock-api-mockito2](https://github.com/powermock/powermock) from 2.0.6 to 2.0.7.
- [Release notes](https://github.com/powermock/powermock/releases)
- [Changelog](https://github.com/powermock/powermock/blob/release/2.x/docs/changelog.txt)
- [Commits](https://github.com/powermock/powermock/compare/powermock-2.0.6...powermock-2.0.7)

Signed-off-by: dependabot-preview[bot] <support@dependabot.com>

* Bump powermock-module-junit4 from 2.0.6 to 2.0.7

Bumps [powermock-module-junit4](https://github.com/powermock/powermock) from 2.0.6 to 2.0.7.
- [Release notes](https://github.com/powermock/powermock/releases)
- [Changelog](https://github.com/powermock/powermock/blob/release/2.x/docs/changelog.txt)
- [Commits](https://github.com/powermock/powermock/compare/powermock-2.0.6...powermock-2.0.7)

Signed-off-by: dependabot-preview[bot] <support@dependabot.com>

Co-authored-by: dependabot-preview[bot] <27856297+dependabot-preview[bot]@users.noreply.github.com>
2020-03-31 15:46:07 -05:00
dependabot-preview[bot]
9c1db92899 Bump junit-vintage-engine from 5.5.2 to 5.6.0
Bumps [junit-vintage-engine](https://github.com/junit-team/junit5) from 5.5.2 to 5.6.0.
- [Release notes](https://github.com/junit-team/junit5/releases)
- [Commits](https://github.com/junit-team/junit5/compare/r5.5.2...r5.6.0)

Signed-off-by: dependabot-preview[bot] <support@dependabot.com>
2020-01-23 09:52:03 -05:00
Arthur Milchior
e2bc91ca20 wrong word 2019-11-03 12:11:42 -05:00
dependabot-preview[bot]
6c043960d8 Bump junit-vintage-engine from 5.5.1 to 5.5.2
Bumps [junit-vintage-engine](https://github.com/junit-team/junit5) from 5.5.1 to 5.5.2.
- [Release notes](https://github.com/junit-team/junit5/releases)
- [Commits](https://github.com/junit-team/junit5/compare/r5.5.1...r5.5.2)

Signed-off-by: dependabot-preview[bot] <support@dependabot.com>
2019-10-02 12:30:41 +09:00
dependabot-preview[bot]
683b73f20a Bump junit-vintage-engine from 5.5.0 to 5.5.1
Bumps [junit-vintage-engine](https://github.com/junit-team/junit5) from 5.5.0 to 5.5.1.
- [Release notes](https://github.com/junit-team/junit5/releases)
- [Commits](https://github.com/junit-team/junit5/compare/r5.5.0...r5.5.1)

Signed-off-by: dependabot-preview[bot] <support@dependabot.com>
2019-08-13 15:52:32 -05:00
Mike Hardy
247947c317
20190703 Dependency updates (#5361)
* Bump appcompat from 1.1.0-beta01 to 1.1.0-rc01

Bumps appcompat from 1.1.0-beta01 to 1.1.0-rc01.

Signed-off-by: dependabot-preview[bot] <support@dependabot.com>

* Bump junit-vintage-engine from 5.4.2 to 5.5.0

Bumps [junit-vintage-engine](https://github.com/junit-team/junit5) from 5.4.2 to 5.5.0.
- [Release notes](https://github.com/junit-team/junit5/releases)
- [Commits](https://github.com/junit-team/junit5/compare/r5.4.2...r5.5.0)

Signed-off-by: dependabot-preview[bot] <support@dependabot.com>
2019-07-03 08:15:43 -05:00
Max
fb6993c159 Adds missing quotes to generated html (#5358)
To question and answer class tags. Removing the closing quote from the following id tag.
To Basic (Basic2) template cards' id tags

Fixes #5356
2019-07-01 21:23:51 +09:00
Mike Hardy
30c31fca92
Alter auto-service dep / travis emulators / bump versions
#5271 part 2 based on https://github.com/ACRA/acra/issues/738#issuecomment-477389692
mockito-core from 2.25.1 to 2.26.0
bump junit-vintage-engine from 5.4.1 to 5.4.2
fix Travis a bit more after The Great Emulator Regression
2019-04-08 17:34:38 -05:00
Mike Hardy
3f38f204df
20190319 Dependency updates (#5263)
Just a bunch of minor non-noteworthy updates.
No code changes needed to adapt this time.
Dependabot + Travis helping us with the unglamorous chores...
2019-03-21 22:31:58 -05:00
dependabot[bot]
95200ed0f6 Bump robolectric from 4.1 to 4.2
Bumps [robolectric](https://github.com/robolectric/robolectric) from 4.1 to 4.2.
- [Release notes](https://github.com/robolectric/robolectric/releases)
- [Commits](https://github.com/robolectric/robolectric/compare/robolectric-4.1...robolectric-4.2)

Signed-off-by: dependabot[bot] <support@dependabot.com>
2019-02-20 09:45:41 +09:00
Mike Hardy
0bf3b4aa8d Bump junit to 5.4.0 in api module
This was missed in the previous commit but dependabot never forgets...
2019-02-10 10:39:54 -05:00
Mike Hardy
b1e8546726 Update Robolectric in api module to 4.1 2019-01-28 14:57:37 -05:00
dependabot[bot]
1d88c0ce62 Bump junit-vintage-engine from 5.3.1 to 5.3.2
Bumps [junit-vintage-engine](https://github.com/junit-team/junit5) from 5.3.1 to 5.3.2.
- [Release notes](https://github.com/junit-team/junit5/releases)
- [Commits](https://github.com/junit-team/junit5/compare/r5.3.1...r5.3.2)

Signed-off-by: dependabot[bot] <support@dependabot.com>
2018-11-28 10:10:36 -05:00
Mike Hardy
2524c19b4c Implement standard gradle build/test optimizations
- de-couple api + AnkiDroid by making sure all evaulation may be done separately
- fork and incremental compile
- scale concurrent tests by CPU count, mindful of containerization

All of these are intended to have no impact on CI or small machines
But if you have a lot of cores and RAM and run tests a lot (my case) you feel this

There was one optimization that didn't pan out - setting the heap big enough to
dex in process - but other than this is the full suite of recommended gradle optimizations
2018-11-24 16:19:09 -05:00
Mike Hardy
a348ae5ddd
Dependency updates (powermock, robolectric, okhttp) (#5121)
* Bump robolectric from 4.0.1 to 4.0.2

Bumps [robolectric](https://github.com/robolectric/robolectric) from 4.0.1 to 4.0.2.
- [Release notes](https://github.com/robolectric/robolectric/releases)
- [Commits](https://github.com/robolectric/robolectric/compare/robolectric-4.0.1...robolectric-4.0.2)

Signed-off-by: dependabot[bot] <support@dependabot.com>

* Bump okhttp from 3.11.0 to 3.12.0

Bumps [okhttp](https://github.com/square/okhttp) from 3.11.0 to 3.12.0.
- [Release notes](https://github.com/square/okhttp/releases)
- [Changelog](https://github.com/square/okhttp/blob/master/CHANGELOG.md)
- [Commits](https://github.com/square/okhttp/compare/parent-3.11.0...parent-3.12.0)

Signed-off-by: dependabot[bot] <support@dependabot.com>

* Bump powermock-core from 2.0.0-RC.3 to 2.0.0-RC.4

Bumps [powermock-core](https://github.com/powermock/powermock) from 2.0.0-RC.3 to 2.0.0-RC.4.
- [Release notes](https://github.com/powermock/powermock/releases)
- [Changelog](https://github.com/powermock/powermock/blob/release/2.x/docs/changelog.txt)
- [Commits](https://github.com/powermock/powermock/compare/powermock-2.0.0-RC.3...powermock-2.0.0-RC.4)

Signed-off-by: dependabot[bot] <support@dependabot.com>

* Bump powermock-api-mockito2 from 2.0.0-RC.3 to 2.0.0-RC.4

Bumps [powermock-api-mockito2](https://github.com/powermock/powermock) from 2.0.0-RC.3 to 2.0.0-RC.4.
- [Release notes](https://github.com/powermock/powermock/releases)
- [Changelog](https://github.com/powermock/powermock/blob/release/2.x/docs/changelog.txt)
- [Commits](https://github.com/powermock/powermock/compare/powermock-2.0.0-RC.3...powermock-2.0.0-RC.4)

Signed-off-by: dependabot[bot] <support@dependabot.com>

* Bump powermock-module-junit4 from 2.0.0-RC.3 to 2.0.0-RC.4

Bumps [powermock-module-junit4](https://github.com/powermock/powermock) from 2.0.0-RC.3 to 2.0.0-RC.4.
- [Release notes](https://github.com/powermock/powermock/releases)
- [Changelog](https://github.com/powermock/powermock/blob/release/2.x/docs/changelog.txt)
- [Commits](https://github.com/powermock/powermock/compare/powermock-2.0.0-RC.3...powermock-2.0.0-RC.4)

Signed-off-by: dependabot[bot] <support@dependabot.com>
2018-11-19 08:51:54 -05:00
Mike Hardy
7f7fd03aec Upgrade api module to Android 28, fix deprecation 2018-11-03 15:02:51 -05:00
Mike Hardy
3e85740032 Update robolectric dependency to 4.0.1 2018-11-02 09:45:13 +07:00
Mike Hardy
e2b91064bf Allow higher minSdk test library, in test only 2018-11-02 09:45:13 +07:00
Mike Hardy
f10b6d44f3 Update robolectric and junit dependencies 2018-10-27 12:24:45 +11:00
Mike Hardy
60659f1b98 Unit test for API Utils, working on master now
This version uses Robolectric so android.content.TextUtils works vs
the previous method of implementing the TextUtils logic in our codebase
just for testability
2018-10-17 07:22:27 +09:00
Rodrigo Bresan
e2d4f48cae WIP: Unit Tests added into the Utils.java class (api Module).
- Add dependency on support-annotations (in order to use @VisibleForTesting);
	- Add dependnecy on JUnit in order to allow unit tests;
2018-10-17 07:22:27 +09:00
Mike Hardy
4b5508fcf0 Display all compile problems, error on warnings 2018-10-07 01:48:25 -05:00
lucwastiaux
c9b0f56917 Add API support for burying and suspending (#4993)
with tests and javadoc. added API test for updating tags
2018-10-03 07:06:11 +09:00
Mike Hardy
a6f7d42611 Bump SDK for API so it may be published 2018-09-18 22:02:06 -05:00
Mike Hardy
56773418d9 Expose deprecation details, examine+suppress one 2018-06-18 22:01:38 +09:00
Mike Hardy
944a587e72 Update two javadocs to indicate there may be errors 2018-06-18 22:01:38 +09:00
Mike Hardy
a42492795a Safely use HTML 5 for Java10; use google repos first (#4862) 2018-06-08 12:42:25 +09:00
Timothy Rae
a1f22682c1 Fix inconsistent version number in API 2018-05-30 05:46:25 +09:00
Timothy Rae
64d68ef885 Remove html5 option from API build
This led to a build error
2018-05-30 05:45:51 +09:00
Mike Hardy
ef4993232d Update API to 1.1.0alpha6 (#4858) 2018-05-30 05:27:52 +09:00
Mike Hardy
76b18e06ef Upgrade gradle and gradle plugin, w/migrations, travis speedups (#4851)
- fix api gradle deprecation, add warn comment in gradle wrapper
- buildtools 27.0.3 needs to be added w/license accepted
- install SDK API 16 to match emulator API 16, remove extra tools
- tools components entry twice per Travis docs
- only including build-tools 26.0.2 as it is default per my read
- only including one android API for the build
- removing non-existent extra-android-support
- changing from API-22 emulator to API-16 per performance documentation on web
- removing "no-skin" emulator argument as it is not supported
- upgrade to gradle 4.5.1 / gradle plugin 3.1.2
- alter gradle dependencies to modern fine-grained declarations
- move api build targetSdk to match main build targetSdk
2018-05-19 11:55:10 +09:00
Mike Hardy
15153b5efc Updating versions for buildtools and gson dependency (#4792) 2018-03-08 17:38:32 +09:00
Timothy Rae
3e78697111 Update compileSdkVersion and libraries to 26
Also updated to gradle 4
2017-12-15 13:51:05 +09:00
Timothy Rae
bc04e92e5d Update API build tools version to 25.0.1 2017-07-17 09:39:37 +09:00
Houssam Salem
a55a8a38b1 Update build tools and support libraries 2016-10-21 16:33:17 +11:00
elkmovie
269fd178e0 Fix duplicate checking bug
Duplicate checking code does not pad checksum with leading zeroes as main AnkiDroid code does, causing fields with checksums starting with 0 to fail to match correctly.
2016-09-26 15:03:49 -04:00
Houssam Salem
eee8b4afd0 Update build tools and support libraries 2016-07-28 13:39:02 +10:00
Houssam Salem
7da2be7878 Update support libs and SDK versions 2016-06-27 14:55:48 +10:00
Rabin Vincent
b2cde8fa44 Handle null from ContentResolver insert in API
We need to check for modelUri being null before passing it to
Uri.withAppendedPath().
2016-05-18 20:44:44 +02:00
Houssam Salem
156ee6b91f Explicitly supply locale in string formatting calls 2016-05-07 20:52:55 +10:00
Mark Carter
18b918bed5 add append field (to end of fields) support to provider 2016-04-19 11:24:34 +08:00
Mark Carter
b418ac0eae back to adding count columns to existing cursors. This time using libanki where possible 2016-04-14 21:38:32 +08:00
Mark Carter
96672551ba add model/counts, deck/counts and model/*/template/counts 2016-04-14 15:24:15 +08:00
timrae
1797d9c045 A few adjustments to the ContentProvider
* Throw exception if filtered deck specified as deck in insert(), update()
* Throw exception if deck insert for a name that already exists
* Use query() instead of rawQuery() in the notes database
* Change DECK_DYN to Boolean
* Add javadoc for missing fields in FlashCardsContract
2016-03-25 05:38:41 +09:00
timrae
f04b4f70b7 Some bug fixes for duplicate checking code
* Compat V1 was only adding first duplicate to output array
* Compat V2 now clones NoteInfo objects before adding to multiple positions
* Made NoteInfo final to prevent subclasses breaking encapsulation
* Made NoteInfo constructor private so that it's only used as a container
* Also improved the javadoc and comments in some places
2016-03-25 02:19:03 +09:00
Timothy Rae
31fb5beb20 Fix lint warnings in API 2016-03-24 19:07:04 +09:00
Timothy Rae
a36c12a37a Bump API version to 1.1alpha4 2016-03-24 18:36:23 +09:00
Timothy Rae
7e0158424a Remove some repeated code in duplicate checking methods 2016-03-24 18:26:01 +09:00
timrae
71dde60d2d Allow tags to be null in addNote() 2016-03-24 15:32:36 +09:00
timrae
0d111ef07e Strip API down to essentials 2016-03-24 14:09:54 +09:00
Tim Rae
a6cf77d6ec Merge pull request #4169 from timrae/separate-sql-uri
Add a new URI for direct SQL querying of notes table
2016-03-23 22:36:48 +09:00
timrae
10880cfceb Add a new URI for direct SQL querying of notes table
Decouple the URIs for libanki style querying vs. direct SQL querying.
This has the advantage of being more intuitive, and less susceptible to SQL injection attacks
2016-03-23 22:24:15 +09:00
Mark Carter
ca49c4e3ff Consistent handling of ContentResolver.query() returning null 2016-03-23 18:54:44 +08:00
timrae
5f32f1a311 Rename findExistingNotes() to findDuplicateNotes(), return SparseArray 2016-03-23 18:33:29 +09:00
Mark Carter
8675055130 Add support for sortf field when adding new model 2016-03-23 00:18:31 +08:00
Mark Carter
e520bcd2c7 Fixed getNoteCount() bug - was not working on provider spec v1 2016-03-22 15:02:04 +08:00
Mark Carter
94c50c891f fixed silly bug in getNote() 2016-03-18 17:17:47 +08:00
Mark Carter
fd11a81b55 added default deck id constant 2016-03-17 17:51:57 +08:00
Mark Carter
785df025d8 previewNewNote() no longer uses deprecated addNewNote() 2016-03-17 16:47:52 +08:00
Mark Carter
5a9d4708eb remove duplicate checking from addNotes() and tidy up generally 2016-03-17 16:47:52 +08:00
Mark Carter
21678f461e deprecated checkRequiredPermission() 2016-03-17 15:32:18 +08:00
Mark Carter
568ce2b7a6 Tidy up getters and setters for note tags/fields 2016-03-16 15:54:12 +08:00
Tim Rae
ae8f70702f Merge pull request #4140 from marcardar/tidyup-noteinfo-class
Tidy up NoteInfo class
2016-03-16 16:01:49 +09:00
Mark Carter
d911b9339c Tidy up api host spec version 2016-03-16 14:27:38 +08:00
Mark Carter
ac064eb1cc Tidied up NoteInfo class 2016-03-16 14:07:23 +08:00
Mark Carter
2ff78ae514 fixed findModelIdByName() 2016-03-16 01:21:12 +08:00
Mark Carter
abddd2e6a2 enforce permissions on update/delete in provider 2016-03-15 11:48:20 +08:00
Timothy Rae
01a82fb5ec Remove update code from addNotes() and make separate API calls for updating 2016-03-10 20:20:52 +09:00
Timothy Rae
9e0ab0b15c Add support for selection args in the notes table in ContentProvider
and bring API duplicate checking in-line with Anki Desktop
2016-03-10 03:21:55 +09:00
Mark Carter
7d110c5367 Added content provider support for bulkInsert() or multiple notes into a single deck. This is done by including a new deckId query parameter in the uri.
For example: content://com.ichi2.anki.flashcards/notes?deckId=1234567890123
AddContentApi supports this with a new addNotes() method. The Api does the duplicate checking to make sure no duplicates are passed to bulkInsert().
These implementations check whether the provider supports these new features using a spec version code defined as a meta-data key of the provider in the manifest.
The new bulkInsert support for notes is 2000% faster (based on inserting 2100+ notes) than inserting notes one-by-one (as in the old way).
2016-03-08 22:10:13 +08:00
Mark Carter
c59e19ec1e joinFields now uses TextUtils#join for maximum readability 2016-03-02 09:55:04 +08:00
Houssam Salem
f8f3ab6ec2 Update to newer support libraries and build tools 2016-02-28 22:42:54 +11:00
timrae
44eabb0493 Improve efficiency splitting fields in libanki
d139048 was not very efficient or readable
2015-10-19 23:02:14 +09:00
timrae
a8bdaf7a3c Update material dialogs version
and drop targetSdkVersion to v22
2015-09-25 19:42:59 +09:00
timrae
bb6144d1da Small update to API
remove unnecessary ref to context in some methods
add check for duplicates method
add a build script to make zip for jcenter
2015-09-11 16:27:17 +09:00
timrae
93b5e4dd08 Create API for easier integration with 3rd party apps 2015-09-11 05:08:18 +09:00