0
0
mirror of https://github.com/ankidroid/Anki-Android.git synced 2024-09-19 19:42:17 +02:00
Commit Graph

19583 Commits

Author SHA1 Message Date
Brayan Oliveira
712f9fa752 feat(new reviewer): ignore display cutout
https://developer.android.com/develop/ui/views/layout/edge-to-edge#cutout-insets
2024-07-18 15:11:41 +00:00
Brayan Oliveira
a4bd5d0395 feat(new reviewer): immersive mode
https://developer.android.com/develop/ui/views/layout/immersive

magic numbers are used for the preferences values because they can be reported in analytics
2024-07-18 15:11:41 +00:00
Brayan Oliveira
0a0b2dd6a9 feat: new reviewer settings page
dev-only
2024-07-18 15:11:41 +00:00
lukstbit
f73708acd4 Change conflicts workflow to allow more PRs to be checked
The workflow was fetching the opened pull requests in the repository
but the returned results were per page with the default page value(30)
being used. This meant that the worflow would check only the oldest 30
opened pull requests. The per page value was changed to the maximum
value of 100.

See https://octokit.github.io/rest.js/v20#pulls-list

This still means the workflow doesn't handle over 100 opened pull
requests, but we shouldn't get there anyway.
2024-07-18 15:05:34 +00:00
David Allison
94f614900b refactor(note-editor): improve nullability
for `startMultimediaFieldEditor`

Kotlin Cleanup - parameter should not have been nullable

Split out from a review comment
2024-07-18 14:31:26 +00:00
andriusezerskis
e74abb7bc8 Adding commit of wildcards removal in ignore-revs 2024-07-18 13:18:01 +00:00
AnkiDroid Translations
3db9fedbdf Updated strings from Crowdin 2024-07-18 07:26:56 +00:00
lukstbit
fae022aa0d Show progress for the initial part of importing a collection
Adds a withProgress call for the initial part of importing a collection
(where the file to import is copied). This was done on a background
thread so the UI wasn't blocked but the user also didn't know that
something was happening related to the import he just initiated.
2024-07-18 05:31:58 +00:00
lukstbit
c7cbea0b53 Move exported file saving to a background thread
This avoids the UI being "blocked" while saving the exported collection or
apkg, issue which becomes "visible" to the user when dealing with bigger
collections.
2024-07-18 05:31:58 +00:00
lukstbit
a73f17330e Remove StdModels related code
Used only in tests.

The initializer functions code used to create the models in StdModels
were refactored as standalone functions to be used by interested tests.

Note: StdModels were both used in unit and instrumented tests. As
there's only one usage in an instrumented test I duplicated the code
to avoid the use of the testlib.

The strings for the model names were removed because we don't need
translations for strings used in tests. The "front" and "back" names
are used in CardTemplateEditor, should probably be moved to one of
the other files to not have a strings file with just two strings in
it.
2024-07-18 05:31:41 +00:00
AnkiDroid Translations
1f7fc288d8 Updated strings from Crowdin 2024-07-18 04:17:20 +00:00
andriusezerskis
c63e93a09f Remove wildcard from imports 2024-07-17 09:16:28 +00:00
andriusezerskis
1a3c1a1ab0 Removed rule that allowed wildcard imports 2024-07-17 09:16:28 +00:00
Ashish Yadav
4bdef4764c refactor: use prefill value in integer dialog 2024-07-17 07:38:12 +00:00
Arthur Milchior
dbf737a647 Fixes null pointer exception
After reproducing #16702, I discovered that actually, the part of the
code where the NPE occurred should not have been reached.

newModel and oldModel are two distinct objects representing the same
note type. And JSonObject's equality is defined as pointer
equality. Using id instead of actual note type repair the bug.

Since, in AnkiDroid, editing the note type through the reviewer, can't
lead to adding or removing field, this is safe to consider that if the
id is equal, the objects are equal as far as the list of field is concerned.

I fear I don't see how to test it easily. It seems it require
AndroidTest and not unit tests, and I can't find example of note editor
test. Furthermore note editor will be replaced soon, so I don't expect
it's such a big deal.

* Fixed #16702
2024-07-17 05:29:36 +00:00
jainv4156
93c2f68429 Fix Android Studio warnings in several files 2024-07-17 05:12:54 +00:00
Robozinho
7f1317245d restrict deck option links 2024-07-16 05:51:39 +00:00
Arthur Milchior
8ad0a63caa NotType related code cleaning
While searching for other uses of == instead of comparing id of note
type, I did some code cleaning.
* renaming some `m` to `notetype`
* deleting a unused constructor
* correcting a wrong documentation
* remove `deepcopy` (as it's the same result as `deepClone`)
2024-07-15 12:46:50 +00:00
AnkiDroid Translations
ec2792792a Updated strings from Crowdin 2024-07-14 10:22:07 +00:00
Mike Hardy
703e6487ae
release: manual bump to 2.19alpha9
required me to build release with production signing key locally
for upload vs on CI so I could manually work through foreground
service justification process on Play Console
2024-07-13 17:31:02 -06:00
Arthur Milchior
d771d752a9 NF: NoteEditor onKeyUp return true
I don't expect it was causing a bug, but `onKeyUp` almost always
returned false, even when the key press was handled.

This is now corrected.

I had trouble understanding the `selectFieldIndex` part. I hope I
improved it. Also added a unit test, given the simplicity of this part
of the code.

I wanted to test the remaining of KeyUtils, but got error messages,
telling me

java.lang.RuntimeException: Method getUnicodeChar in android.view.KeyEvent not mocked. See https://developer.android.com/r/studio-ui/build/not-mocked for details.
	at android.view.KeyEvent.getUnicodeChar(KeyEvent.java)
	at com.ichi2.utils.KeyUtils.getDigit(KeyUtils.kt:30)

I'd be interested in help if it's quick to do. But otherwise, it's not
worth losing time on it.
2024-07-13 22:22:25 +00:00
Robozinho
848e0dcfc9 improve SliderPreference value display 2024-07-13 21:01:43 +00:00
Rishav Kumar
2c959dcfdf
Fixed keyboard done button during creation or renaming of deck (#16704)
* added on done click listener

* defined singleline is true and maxLine is 1 for Text input field

* added on done click listener
2024-07-12 16:06:34 -03:00
lukstbit
390a7cd3ac Remove unused calls to updateValuesForDeck()
The calls that were deleted weren't using the method's return type and
as the method just queries for state removing the calls should be safe.
2024-07-12 18:49:42 +00:00
leobugeja
d3c427b746 fix: card preview autoplay audio 2024-07-11 11:26:46 +00:00
Mike Hardy
869f8d8af3
Dependency updates 20240710 (#16718)
* build(deps): bump org.junit.jupiter:junit-jupiter from 5.10.2 to 5.10.3

Bumps [org.junit.jupiter:junit-jupiter](https://github.com/junit-team/junit5) from 5.10.2 to 5.10.3.
- [Release notes](https://github.com/junit-team/junit5/releases)
- [Commits](https://github.com/junit-team/junit5/compare/r5.10.2...r5.10.3)

---
updated-dependencies:
- dependency-name: org.junit.jupiter:junit-jupiter
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

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

* build(deps): bump org.junit.vintage:junit-vintage-engine

Bumps [org.junit.vintage:junit-vintage-engine](https://github.com/junit-team/junit5) from 5.10.2 to 5.10.3.
- [Release notes](https://github.com/junit-team/junit5/releases)
- [Commits](https://github.com/junit-team/junit5/compare/r5.10.2...r5.10.3)

---
updated-dependencies:
- dependency-name: org.junit.vintage:junit-vintage-engine
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

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

* build(deps): bump org.junit.jupiter:junit-jupiter-params

Bumps [org.junit.jupiter:junit-jupiter-params](https://github.com/junit-team/junit5) from 5.10.2 to 5.10.3.
- [Release notes](https://github.com/junit-team/junit5/releases)
- [Commits](https://github.com/junit-team/junit5/compare/r5.10.2...r5.10.3)

---
updated-dependencies:
- dependency-name: org.junit.jupiter:junit-jupiter-params
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

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

* build(deps): bump org.robolectric:robolectric from 4.12.2 to 4.13 (#16703)

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

---
updated-dependencies:
- dependency-name: org.robolectric:robolectric
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>

* build(deps): bump org.mockito.kotlin:mockito-kotlin from 5.3.1 to 5.4.0 (#16710)

Bumps [org.mockito.kotlin:mockito-kotlin](https://github.com/mockito/mockito-kotlin) from 5.3.1 to 5.4.0.
- [Release notes](https://github.com/mockito/mockito-kotlin/releases)
- [Commits](https://github.com/mockito/mockito-kotlin/compare/5.3.1...5.4.0)

---
updated-dependencies:
- dependency-name: org.mockito.kotlin:mockito-kotlin
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>

* build(deps): bump org.jsoup:jsoup from 1.17.2 to 1.18.1

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

---
updated-dependencies:
- dependency-name: org.jsoup:jsoup
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

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

---------

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-07-10 21:49:06 -06:00
Mike Hardy
82dea2af95 feat: bump targetSdk to 34 2024-07-11 02:45:12 +00:00
David Allison
1de4391fdf fix(broadcast-receivers): specify export behavior (API 34)
In API 34, `registerReceiver` needs to either accept
`RECEIVER_EXPORTED` or `RECEIVER_NOT_EXPORTED`,
otherwise an exception is thrown

So, introduce `Context.registerReceiverCompat` to avoid code
churn, and use it

Issue 16713

https://developer.android.com/about/versions/14/behavior-changes-14#runtime-receivers-exported
2024-07-11 02:45:12 +00:00
AnkiDroid Translations
16de500e9a Updated strings from Crowdin 2024-07-08 15:43:55 +00:00
SanjaySargam
f17e059498 simplify deckpicker with unified menu 2024-07-08 13:53:37 +00:00
SanjaySargam
50832f9816 hide fragment when collection is empty 2024-07-08 13:53:37 +00:00
AnkiDroid Translations
e6eaa5c22e Updated strings from Crowdin 2024-07-08 13:30:57 +00:00
AnkiDroid Translations
1125658c23 Updated strings from Crowdin 2024-07-08 04:54:15 +00:00
Arthur Milchior
016330188f Clarify note type ui model
I found the code slightly unclear and tried to improve it.

* NotetypeBasicUiModel was not related to basic note types
* isStandard and useCount did not seem to me to have a clear meaning in anki lexicon, so must be document
* toUiModel can't be appled to a standard entry as far as I understand it, and is in any case never applied to a standard note type currently, so we can remove the argument.
2024-07-08 03:25:56 +00:00
Arthur Milchior
34263d1c87 NF: delete tools/crashes-data-mining
This folder has not been updated once in 14 years, refers to a
data source that does not exists anymore, and would be used to provide
analytics we can probably get somewhere else.

I don't expect it's worth anyone time to try repairing it.

Closes #16695. Also simplify sligthly bug #16692.
2024-07-07 18:02:14 +00:00
Arthur Milchior
d71d315d4d NF: add Sargam to usernames
This way it won't be shown as typo by Intelli-J
2024-07-07 16:57:58 +00:00
AnkiDroid Translations
5d3960521a Updated strings from Crowdin 2024-07-05 14:29:30 +00:00
Ashish Yadav
74a02eec9a enhancement: show discard change dialog
* fix: share the updated text to note editor
* fix: cloze number to increment only in increment mode

Co-authored-by: David Allison <62114487+david-allison@users.noreply.github.com>
2024-07-05 13:43:07 +00:00
AnkiDroid Translations
e47cc2fe7f Updated strings from Crowdin 2024-07-04 17:53:18 +00:00
Voczi
f02c91c3f2 Update keeper plugin to 0.16.1 2024-06-29 16:36:32 +00:00
Brayan Oliveira
666c8ae135 feat(new reviewer): next times 2024-06-29 10:45:56 +00:00
Brayan Oliveira
0a90271cdb refactor: add a @LibAnkiAlias 2024-06-29 10:45:56 +00:00
Mike Hardy
a9fd2c5cca Bumped version to 2.19alpha8 2024-06-27 21:45:10 +00:00
Sachin Kumar Singh
1ad67a9ac9 No Flag Icon not showing on light theme, Fixed #16622 2024-06-27 20:29:10 +00:00
Mike Hardy
674d93b92a
Dependency updates 20240627 (#16666)
* build(deps): bump com.google.protobuf:protobuf-kotlin-lite

Bumps com.google.protobuf:protobuf-kotlin-lite from 4.27.1 to 4.27.2.

---
updated-dependencies:
- dependency-name: com.google.protobuf:protobuf-kotlin-lite
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

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

* build(deps): bump org.jetbrains.kotlinx:kotlinx-serialization-json

Bumps [org.jetbrains.kotlinx:kotlinx-serialization-json](https://github.com/Kotlin/kotlinx.serialization) from 1.7.0 to 1.7.1.
- [Release notes](https://github.com/Kotlin/kotlinx.serialization/releases)
- [Changelog](https://github.com/Kotlin/kotlinx.serialization/blob/master/CHANGELOG.md)
- [Commits](https://github.com/Kotlin/kotlinx.serialization/compare/v1.7.0...v1.7.1)

---
updated-dependencies:
- dependency-name: org.jetbrains.kotlinx:kotlinx-serialization-json
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

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

* build(deps): bump androidx.test:runner from 1.5.2 to 1.6.0

Bumps androidx.test:runner from 1.5.2 to 1.6.0.

---
updated-dependencies:
- dependency-name: androidx.test:runner
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

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

* build(deps): bump com.github.triplet.play from 3.10.0 to 3.10.1

Bumps com.github.triplet.play from 3.10.0 to 3.10.1.

---
updated-dependencies:
- dependency-name: com.github.triplet.play
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

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

* build(deps): bump androidx.test:runner from 1.6.0 to 1.6.1

Bumps androidx.test:runner from 1.6.0 to 1.6.1.

---
updated-dependencies:
- dependency-name: androidx.test:runner
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

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

* build(deps): bump androidx.test.ext:junit from 1.1.5 to 1.2.1

Bumps androidx.test.ext:junit from 1.1.5 to 1.2.1.

---
updated-dependencies:
- dependency-name: androidx.test.ext:junit
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

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

* build(deps): bump androidxTextCore from 1.5.0 to 1.6.1

Bumps `androidxTextCore` from 1.5.0 to 1.6.1.

Updates `androidx.test:rules` from 1.5.0 to 1.6.1

Updates `androidx.test:core` from 1.5.0 to 1.6.1

---
updated-dependencies:
- dependency-name: androidx.test:rules
  dependency-type: direct:production
  update-type: version-update:semver-minor
- dependency-name: androidx.test:core
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

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

* build(deps): bump androidxFragmentKtx from 1.8.0 to 1.8.1

Bumps `androidxFragmentKtx` from 1.8.0 to 1.8.1.

Updates `androidx.fragment:fragment-ktx` from 1.8.0 to 1.8.1

Updates `androidx.fragment:fragment-testing` from 1.8.0 to 1.8.1

Updates `androidx.fragment:fragment-testing-manifest` from 1.8.0 to 1.8.1

---
updated-dependencies:
- dependency-name: androidx.fragment:fragment-ktx
  dependency-type: direct:production
  update-type: version-update:semver-patch
- dependency-name: androidx.fragment:fragment-testing
  dependency-type: direct:production
  update-type: version-update:semver-patch
- dependency-name: androidx.fragment:fragment-testing-manifest
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

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

* build(deps): bump espresso from 3.5.1 to 3.6.1

Bumps `espresso` from 3.5.1 to 3.6.1.

Updates `androidx.test.espresso:espresso-contrib` from 3.5.1 to 3.6.1

Updates `androidx.test.espresso:espresso-core` from 3.5.1 to 3.6.1

---
updated-dependencies:
- dependency-name: androidx.test.espresso:espresso-contrib
  dependency-type: direct:production
  update-type: version-update:semver-minor
- dependency-name: androidx.test.espresso:espresso-core
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

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

---------

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-06-27 15:29:32 -05:00
lukstbit
d8831cf24a Fix adding a notetype when using the name of a standard notetype
This fixes a bug where the user couldn't add a notetype with the name
of one of the standard notetypes(even if it didn't existed), because
the code checked the new name against the existing notetypes names +
the standard notetypes names so it behaved like the name already
existed.

The change makes the code look only at the existing notetypes names.
2024-06-27 18:57:34 +00:00
AnkiDroid Translations
969c0e8f05 Updated strings from Crowdin 2024-06-27 18:52:36 +00:00
Brayan Oliveira
d20d8c3e42 feat(new reviewer): auto advance
This differs from the legacy reviewer in four things:

1. It implements `Show reminder` as an action (it is a tooltip in Anki, so I made it a snackbar here)
2. It doesn't follow the global switch in settings, as Anki desktop doesn't have one and users complained about finding the global setting unexpected
3. There is now a `Question action` setting
4. The legacy reviewer has an issue where the same configuration is carried through all cards in the review session. So if a card with a different deck config shows up, the config won't be respected. This is fixed in the new reviewer
2024-06-27 18:52:05 +00:00
Voczi
edd15ee8f8 Add support for custom certificate
(9e3a34f17f)
2024-06-27 17:55:17 +00:00
AnkiDroid Translations
b064f4965f Updated strings from Crowdin 2024-06-27 17:44:18 +00:00