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

19510 Commits

Author SHA1 Message Date
Brayan Oliveira
4af8ad3a8b feat: Hide 'Hard' and 'Easy' buttons setting
It is a frequently requested feature, helps a big number of users that
only use two buttons, and it is quite simple to implement
2024-08-16 03:28:49 +00:00
Ashish Yadav
c85da52161 test: unit test to ensure MultimediaBottomSheet is shown 2024-08-16 02:59:47 +00:00
David Allison
fe52f06d85 docs: dependencies - changelogs (AGP) 2024-08-16 02:55:15 +00:00
David Allison
9a949ae90c test: fix hangs on Linux
In PR 16620, I encountered the following error on
ubuntu CI

After research, `CppAssetManager2` errors are  typically due to memory leaks, often by not calling close on Scenarios

```
TagsDialogTest > test_SearchTag_spaceWillBeFilteredCorrectly FAILED
    java.lang.OutOfMemoryError: Java heap space
        at org.robolectric.res.android.ResourceTypes$ResTable_typeSpec.getSpecFlags(ResourceTypes.java:1095)
        at org.robolectric.res.android.LoadedArsc$TypeSpec.GetFlagsForEntryIndex(LoadedArsc.java:116)
        at org.robolectric.res.android.CppAssetManager2.FindEntry(CppAssetManager2.java:699)
        at org.robolectric.res.android.CppAssetManager2.GetResource(CppAssetManager2.java:869)
        at org.robolectric.res.android.CppAssetManager2.ResolveReference(CppAssetManager2.java:935)
        at org.robolectric.res.android.AttributeResolution10.ApplyStyle(AttributeResolution10.java:414)
        at org.robolectric.shadows.ShadowArscAssetManager10.nativeApplyStyle_measured(ShadowArscAssetManager10.java:1414)
        at org.robolectric.shadows.ShadowArscAssetManager10.lambda$nativeApplyStyle$1(ShadowArscAssetManager10.java:1374)
        at org.robolectric.shadows.ShadowArscAssetManager10$$Lambda/0x00007f40d092a740.run(Unknown Source)
        at org.robolectric.util.PerfStatsCollector.measure(PerfStatsCollector.java:82)
        at org.robolectric.shadows.ShadowArscAssetManager10.nativeApplyStyle(ShadowArscAssetManager10.java:1371)
        at java.base/java.lang.invoke.LambdaForm$DMH/0x00007f40d0946800.invokeStatic(LambdaForm$DMH)
        at java.base/java.lang.invoke.LambdaForm$MH/0x00007f40d0948800.guardWithCatch(LambdaForm$MH)
        at java.base/java.lang.invoke.LambdaForm$MH/0x00007f40d0ab3400.delegate(LambdaForm$MH)
        at java.base/java.lang.invoke.LambdaForm$MH/0x00007f40d094ac00.guard(LambdaForm$MH)
        at java.base/java.lang.invoke.LambdaForm$MH/0x00007f40d094b000.linkToCallSite(LambdaForm$MH)
        at android.content.res.AssetManager.nativeApplyStyle(AssetManager.java)
        at android.content.res.AssetManager.applyStyle(AssetManager.java:1147)
        at java.base/java.lang.invoke.LambdaForm$DMH/0x00007f40d0941400.invokeSpecial(LambdaForm$DMH)
        at java.base/java.lang.invoke.LambdaForm$MH/0x00007f40d0943c00.guardWithCatch(LambdaForm$MH)
        at java.base/java.lang.invoke.LambdaForm$MH/0x00007f40d0ab3000.delegate(LambdaForm$MH)
        at java.base/java.lang.invoke.LambdaForm$MH/0x00007f40d0946000.guard(LambdaForm$MH)
        at java.base/java.lang.invoke.LambdaForm$MH/0x00007f40d0946400.linkToCallSite(LambdaForm$MH)
        at android.content.res.AssetManager.applyStyle(AssetManager.java)
        at android.content.res.ResourcesImpl$ThemeImpl.obtainStyledAttributes(ResourcesImpl.java:1394)
        at java.base/java.lang.invoke.LambdaForm$DMH/0x00007f40d035d400.invokeSpecial(LambdaForm$DMH)
        at java.base/java.lang.invoke.LambdaForm$MH/0x00007f40d093fc00.guardWithCatch(LambdaForm$MH)
        at java.base/java.lang.invoke.LambdaForm$MH/0x00007f40d035dc00.delegate(LambdaForm$MH)
        at java.base/java.lang.invoke.LambdaForm$MH/0x00007f40d0940c00.guard(LambdaForm$MH)
        at java.base/java.lang.invoke.LambdaForm$MH/0x00007f40d0941000.linkToCallSite(LambdaForm$MH)
        at android.content.res.ResourcesImpl$ThemeImpl.obtainStyledAttributes(ResourcesImpl.java)
        at android.content.res.Resources$Theme.obtainStyledAttributes(Resources.java:1692)
```
2024-08-16 02:43:04 +00:00
David Allison
b4ba390061 chore: allow optionally displaying a ListPreference
This exists as we want a dialog to show either a List or an EditText,
and both the framework classes require inheritance

For Issue 3114
2024-08-16 02:19:34 +00:00
David Allison
0d46ac3523 chore: guard against null getExternalFilesDirs
I know `getExternalFilesDir(null)!!` can throw, I'm unsure
if the array can throw, but it's best to be safe here
2024-08-16 02:19:34 +00:00
David Allison
9175d9ec29 chore: 'DialogFragmentProvider' - make optional
If a call to super is requested, `null` may be returned
In this case, `super` would be called

This is useful if you would optionally want to inherit from
a class (say `EditTextPreference`), but also allow conditionally
return a different fragment
2024-08-16 02:19:34 +00:00
David Allison
6ab15ec3ea feat(tool): format issue/PR links in Discord
Links to the repo are unpleasant to see:

* Link previews are too large & distracting
* Links without a preview give no context

I want something which both gives context, and is compact

`macos-clipboard-to-discord` converts an issue link:
https://github.com/ankidroid/Anki-Android/pull/16804

into:
* A link with text: "#16804: refactor/docs: `libs.versions.toml` changelogs/renames"
* Without a preview
* Redirecting to the correct PR

`./format-for-discord` performs this formatting: accepting a PR/Issue number: 16804
and outputting the above to stdout
2024-08-15 20:01:16 -06:00
Mike Hardy
977fd5685e
Dependency updates 20240815 (#16877)
* build(deps): bump androidxFragmentKtx from 1.8.1 to 1.8.2 (#16780)

Bumps `androidxFragmentKtx` from 1.8.1 to 1.8.2.

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

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

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

---
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>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>

* build(deps): bump androidx.annotation:annotation from 1.8.0 to 1.8.1 (#16782)

Bumps androidx.annotation:annotation from 1.8.0 to 1.8.1.

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

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

* build(deps): bump hamcrest from 2.2 to 3.0 (#16802)

Bumps `hamcrest` from 2.2 to 3.0.

Updates `org.hamcrest:hamcrest` from 2.2 to 3.0
- [Release notes](https://github.com/hamcrest/JavaHamcrest/releases)
- [Changelog](https://github.com/hamcrest/JavaHamcrest/blob/master/CHANGES.md)
- [Commits](https://github.com/hamcrest/JavaHamcrest/compare/v2.2...v3.0)

Updates `org.hamcrest:hamcrest-library` from 2.2 to 3.0
- [Release notes](https://github.com/hamcrest/JavaHamcrest/releases)
- [Changelog](https://github.com/hamcrest/JavaHamcrest/blob/master/CHANGES.md)
- [Commits](https://github.com/hamcrest/JavaHamcrest/compare/v2.2...v3.0)

---
updated-dependencies:
- dependency-name: org.hamcrest:hamcrest
  dependency-type: direct:production
  update-type: version-update:semver-major
- dependency-name: org.hamcrest:hamcrest-library
  dependency-type: direct:production
  update-type: version-update:semver-major
...

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

* build(deps): bump com.google.protobuf:protobuf-kotlin-lite (#16801)

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

---
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>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>

* build(deps): bump androidx.activity:activity from 1.9.0 to 1.9.1 (#16781)

Bumps androidx.activity:activity from 1.9.0 to 1.9.1.

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

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

* build(deps): bump kotlinTest from 2.0.0 to 2.0.10 (#16835)

Bumps `kotlinTest` from 2.0.0 to 2.0.10.

Updates `org.jetbrains.kotlin:kotlin-test` from 2.0.0 to 2.0.10
- [Release notes](https://github.com/JetBrains/kotlin/releases)
- [Changelog](https://github.com/JetBrains/kotlin/blob/master/ChangeLog.md)
- [Commits](https://github.com/JetBrains/kotlin/commits)

Updates `org.jetbrains.kotlin:kotlin-test-junit` from 2.0.0 to 2.0.10
- [Release notes](https://github.com/JetBrains/kotlin/releases)
- [Changelog](https://github.com/JetBrains/kotlin/blob/master/ChangeLog.md)
- [Commits](https://github.com/JetBrains/kotlin/commits)

Updates `org.jetbrains.kotlin:kotlin-test-junit5` from 2.0.0 to 2.0.10
- [Release notes](https://github.com/JetBrains/kotlin/releases)
- [Changelog](https://github.com/JetBrains/kotlin/blob/master/ChangeLog.md)
- [Commits](https://github.com/JetBrains/kotlin/commits)

---
updated-dependencies:
- dependency-name: org.jetbrains.kotlin:kotlin-test
  dependency-type: direct:production
  update-type: version-update:semver-patch
- dependency-name: org.jetbrains.kotlin:kotlin-test-junit
  dependency-type: direct:production
  update-type: version-update:semver-patch
- dependency-name: org.jetbrains.kotlin:kotlin-test-junit5
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

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

* build(deps): bump kotlin from 2.0.0 to 2.0.10 (#16834)

Bumps `kotlin` from 2.0.0 to 2.0.10.

Updates `org.jetbrains.kotlin:kotlin-stdlib` from 2.0.0 to 2.0.10
- [Release notes](https://github.com/JetBrains/kotlin/releases)
- [Changelog](https://github.com/JetBrains/kotlin/blob/master/ChangeLog.md)
- [Commits](https://github.com/JetBrains/kotlin/commits)

Updates `org.jetbrains.kotlin.android` from 2.0.0 to 2.0.10
- [Release notes](https://github.com/JetBrains/kotlin/releases)
- [Changelog](https://github.com/JetBrains/kotlin/blob/master/ChangeLog.md)
- [Commits](https://github.com/JetBrains/kotlin/commits)

Updates `org.jetbrains.kotlin.plugin.parcelize` from 2.0.0 to 2.0.10
- [Release notes](https://github.com/JetBrains/kotlin/releases)
- [Changelog](https://github.com/JetBrains/kotlin/blob/master/ChangeLog.md)
- [Commits](https://github.com/JetBrains/kotlin/commits)

Updates `org.jetbrains.kotlin.jvm` from 2.0.0 to 2.0.10
- [Release notes](https://github.com/JetBrains/kotlin/releases)
- [Changelog](https://github.com/JetBrains/kotlin/blob/master/ChangeLog.md)
- [Commits](https://github.com/JetBrains/kotlin/commits)

Updates `org.jetbrains.kotlin.plugin.serialization` from 2.0.0 to 2.0.10
- [Release notes](https://github.com/JetBrains/kotlin/releases)
- [Changelog](https://github.com/JetBrains/kotlin/blob/master/ChangeLog.md)
- [Commits](https://github.com/JetBrains/kotlin/commits)

---
updated-dependencies:
- dependency-name: org.jetbrains.kotlin:kotlin-stdlib
  dependency-type: direct:production
  update-type: version-update:semver-patch
- dependency-name: org.jetbrains.kotlin.android
  dependency-type: direct:production
  update-type: version-update:semver-patch
- dependency-name: org.jetbrains.kotlin.plugin.parcelize
  dependency-type: direct:production
  update-type: version-update:semver-patch
- dependency-name: org.jetbrains.kotlin.jvm
  dependency-type: direct:production
  update-type: version-update:semver-patch
- dependency-name: org.jetbrains.kotlin.plugin.serialization
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

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

* build(deps): bump org.jetbrains.kotlin:kotlin-reflect (#16833)

Bumps [org.jetbrains.kotlin:kotlin-reflect](https://github.com/JetBrains/kotlin) from 2.0.0 to 2.0.10.
- [Release notes](https://github.com/JetBrains/kotlin/releases)
- [Changelog](https://github.com/JetBrains/kotlin/blob/master/ChangeLog.md)
- [Commits](https://github.com/JetBrains/kotlin/commits)

---
updated-dependencies:
- dependency-name: org.jetbrains.kotlin:kotlin-reflect
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

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

* chore(deps): bump androidx.annotation:annotation from 1.8.1 to 1.8.2 (#16846)

Bumps androidx.annotation:annotation from 1.8.1 to 1.8.2.

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

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

* chore(deps): bump workRuntimeKtx from 2.9.0 to 2.9.1 (#16845)

Bumps `workRuntimeKtx` from 2.9.0 to 2.9.1.

Updates `androidx.work:work-runtime-ktx` from 2.9.0 to 2.9.1

Updates `androidx.work:work-testing` from 2.9.0 to 2.9.1

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

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

* chore(deps): bump org.apache.commons:commons-compress (#16852)

Bumps org.apache.commons:commons-compress from 1.26.2 to 1.27.0.

---
updated-dependencies:
- dependency-name: org.apache.commons:commons-compress
  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>

* chore(deps): bump lint from 31.5.1 to 31.5.2 (#16854)

Bumps `lint` from 31.5.1 to 31.5.2.

Updates `com.android.tools.lint:lint-api` from 31.5.1 to 31.5.2

Updates `com.android.tools.lint:lint` from 31.5.1 to 31.5.2

Updates `com.android.tools.lint:lint-tests` from 31.5.1 to 31.5.2

---
updated-dependencies:
- dependency-name: com.android.tools.lint:lint-api
  dependency-type: direct:production
  update-type: version-update:semver-patch
- dependency-name: com.android.tools.lint:lint
  dependency-type: direct:production
  update-type: version-update:semver-patch
- dependency-name: com.android.tools.lint:lint-tests
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

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

* chore(deps): bump androidGradlePlugin from 8.5.1 to 8.5.2 (#16853)

Bumps `androidGradlePlugin` from 8.5.1 to 8.5.2.

Updates `com.android.application` from 8.5.1 to 8.5.2

Updates `com.android.library` from 8.5.1 to 8.5.2

---
updated-dependencies:
- dependency-name: com.android.application
  dependency-type: direct:production
  update-type: version-update:semver-patch
- dependency-name: com.android.library
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

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

* Update Gradle Wrapper from 8.9 to 8.10

(this was applied automatically but I inadvertently clobbered it while
untangling some git rebase conflicts since it went in between rebase
start and push)

* style(lint): fix lint errors from previous refactors

it appears lint is not run on checkin or CI here

* build(deps): update to / forward port to eslint v9+

* style(lint): result of `yarn format`

it appears this is not checked in CI

* test(ci): check localization lint + formatting in CI

* build(deps): `yarn upgrade-interactive` in tools/localization

all of these updates are minors, should be fine but will
need an i18n sync in production to verify

* build(deps): bump androidxMedia3 from 1.3.1 to 1.4.0

Bumps `androidxMedia3` from 1.3.1 to 1.4.0.

Updates `androidx.media3:media3-ui` from 1.3.1 to 1.4.0
- [Release notes](https://github.com/androidx/media/releases)
- [Changelog](https://github.com/androidx/media/blob/release/RELEASENOTES.md)
- [Commits](https://github.com/androidx/media/compare/1.3.1...1.4.0)

Updates `androidx.media3:media3-exoplayer-dash` from 1.3.1 to 1.4.0
- [Release notes](https://github.com/androidx/media/releases)
- [Changelog](https://github.com/androidx/media/blob/release/RELEASENOTES.md)
- [Commits](https://github.com/androidx/media/compare/1.3.1...1.4.0)

Updates `androidx.media3:media3-exoplayer` from 1.3.1 to 1.4.0
- [Release notes](https://github.com/androidx/media/releases)
- [Changelog](https://github.com/androidx/media/blob/release/RELEASENOTES.md)
- [Commits](https://github.com/androidx/media/compare/1.3.1...1.4.0)

---
updated-dependencies:
- dependency-name: androidx.media3:media3-ui
  dependency-type: direct:production
  update-type: version-update:semver-minor
- dependency-name: androidx.media3:media3-exoplayer-dash
  dependency-type: direct:production
  update-type: version-update:semver-minor
- dependency-name: androidx.media3:media3-exoplayer
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

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

* build(deps): junit-jupiter moves as a locked-version set, consolidate it

* chore(deps): bump org.junit.jupiter:junit-jupiter

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

---
updated-dependencies:
- dependency-name: org.junit.jupiter:junit-jupiter-params
  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-08-15 20:45:59 -05:00
AnkiDroid Translations
38272302d5 Updated strings from Crowdin 2024-08-15 22:51:56 +00:00
SanjaySargam
292d662d0b note-editor: drop files
This commit ensures that we can drop files (photos, videos, and audio) in NoteEditor (FixedEditText).

Fix: Handle minSdkVersion conflict with DropHelper and enable file drop in NoteEditor
Added DropHelperCompat to handle the incompatibility issue with DropHelper and minSdkVersion 23. The manifest merger failed with the following error:

> Manifest merger failed: uses-sdk:minSdkVersion 23 cannot be smaller than version 24 declared in library [androidx.draganddrop:draganddrop:1.0.0] /Users/davidallison/.gradle/cache> s/8.8/transforms/0a1688833d368c1b9b07d2054911030e/transformed/draganddrop-1.0.0/AndroidManifest.xml as the library might be using APIs not available in 23
> Suggestion: use a compatible library with a minSdk of at most 23,
>     or increase this project's minSdk version to at least 24,
>     or use tools:overrideLibrary="androidx.draganddrop" to force usage
>     (may lead to runtime failures)

To resolve this, the DropHelperCompat class is used to conditionally configure the view for drag and drop operations only when the SDK version is 24 or higher.
2024-08-15 18:49:35 +00:00
SanjaySargam
9d036f61e8 rename 'image' to 'media'
In preparation for 'Drag & Drop' work,
which will allow importing of media
2024-08-15 18:49:35 +00:00
David Allison
06e8ac2ef3 remove Kotlin's "Context Receiver" feature
Context Receivers are an experimental Kotlin feature
. They will be removed and replaced with Context Parameters.
It is unlikely that there will be any overlap period, so we need
to remove our Context Receiver code, with the intention of replacing it
at a later date

> * **2.0.20**: A warning is introduced for declarations that use
> context receivers.
> The warning should mention that the design of context receivers
> is about to change, according to the new design (add a link to the KEEP/YT).
> The safest workaround is to migrate your code to extensions.
>  * **2.1.20**: The implementation of context receivers is removed from the compiler.
> Effectively, this warning is turned into an error.
> Note that this part is most likely inevitable as the implementation
> of context parameters requires  quite extensive refactoring in the compiler,
> and there are significant chances that we won't have either
> context receivers or context parameters at that time.
>  [There is a slight chance that we'll have an early prototype of context parameters,
> but we are not counting on that.]
> * **2.2.0**: Context parameters are introduced under a new compiler flag.

https://youtrack.jetbrains.com/issue/KT-67119/Migration-warning-from-context-receivers-to-context-parameters

> **Phased removal of context receivers feature**
> In Kotlin 1.6.20, we introduced context receivers as an
> Experimental feature. After listening to community
> feedback, we've decided not to continue with it. Instead,
> we plan to introduce a replacement in future Kotlin
> releases: context parameters. You can find the proposal
> for context parameters in the KEEP.

https://kotlinlang.org/docs/whatsnew-eap.html#phased-removal-of-context-receivers-feature

Deprecated:
https://redirect.github.com/Kotlin/KEEP/blob/context-parameters/proposals/context-receivers.md
* https://redirect.github.com/Kotlin/KEEP/issues/259

To be replaced by:
https://redirect.github.com/Kotlin/KEEP/blob/context-parameters/proposals/context-parameters.md
* https://redirect.github.com/Kotlin/KEEP/issues/367

Fixes 16863

Reverts: 672b075a54
Reverts: 1c01e4cb6f
2024-08-14 22:40:48 +00:00
SanjaySargam
35cfd4de33 load fragment after one second of text change
refresh fragment after one second of text changed. And hide preview icon if fragmented as there is no point of having this option because the fragment will auto-refresh the content.
2024-08-11 19:56:14 +00:00
SanjaySargam
b1a94f5ec5 UI improvements
This commit updates the UI to ensure that the previewer theme matches the card template editor theme.

CardTemplateEditor
- Set navigation bar color to use alternative background color
- Update background color attribute

TemplatePreviewerFragment
- Apply style to TabLayout for consistent appearance
2024-08-11 19:56:14 +00:00
SanjaySargam
a98bdd5f54 Change in card type gets reflected in the previewer
This commit ensures that if we change card on leading side then the previewer fragment will load and shows same card on trailing side
2024-08-11 19:56:14 +00:00
SanjaySargam
502ce7f4eb load fragment when performing action on cards
This commit updates the previewer when addition, deletion, renaming of cards.
2024-08-11 19:56:14 +00:00
SanjaySargam
a256d952bf Merge the previewer's menu into the editor's when the view is fragmented
This commit switch the previewer menu from MateralToolbar to toolbar so that it has the same menu has the editor.
It introduces setupCommonMenu and handleCommonMenuItemSelected that add the previewer's menu entry and handle them. They are called from the editor's menu if the view is fragmented, and from the previewer's own menu otherwise.
2024-08-11 19:56:14 +00:00
SanjaySargam
c0405e5fb3 Merge previewer's back button into the editor's one when the view is fragmented.
This commit adds a fragmented variable to TemplatePreviewerArguments, to
let the previewer knows whether it belongs to a fragmented view. If so,
the previewer's back button is removed, hence only the editor's back
button remain.
2024-08-11 19:56:14 +00:00
SanjaySargam
edb562a3bc Attach TemplatePreviewerFragment to CardTemplateEditor
On xlarge screen, display the previewer on the trailing side of the card template editor

This commit introduces a new view, card_template_editor.xml, that contains the card template editor (implemented in card_template_editor_activity.xml) and potentially the previewer on xlarge screen.

CardTemplateEditor.kt simply set the content view to card_template_editor instead of card_template_editor_activity, and add the previewer if needed.
2024-08-11 19:56:14 +00:00
Shruti Gitte
7512a8e545 Fix:Status bar color 2024-08-11 00:18:24 +00:00
Rohanraj123
f5eedc8ba5 test: Added test case for requireLong() method at BundleUtils.kt 2024-08-10 16:54:46 +00:00
David Allison
773e74e0e7 docs: dependencies - changelogs (Apache Commons) 2024-08-09 17:10:08 +00:00
AnkiDroid Translations
f29722d2d6 Updated strings from Crowdin 2024-08-08 20:38:45 +00:00
David Allison
394462950e docs: dependencies - changelogs (androidx-work) 2024-08-08 18:27:47 +00:00
SanjaySargam
436d84b030 shortcut E: edit note 2024-08-08 18:13:55 +00:00
AnkiDroid Translations
463cec1239 Updated strings from Crowdin 2024-08-08 17:50:01 +00:00
AnkiDroid Translations
97275199a3 Updated strings from Crowdin 2024-08-08 15:00:52 +00:00
Ashish Yadav
6a8ede0916 enhancement: add drawing option to multimedia fragment
* refactor: compress camera clicked pictures
* refactor: add camera permission check
2024-08-07 13:26:45 +00:00
Ashish Yadav
541ef81697 enhancement: add audio recorder option in multimedia editor 2024-08-07 13:26:45 +00:00
Ashish Yadav
1c878bbe25 refactor: arguments in show error dialog in multimedia fragment 2024-08-07 13:26:45 +00:00
Ashish Yadav
f0a319379a chore: remove old multimedia editor code 2024-08-07 13:26:45 +00:00
Ashish Yadav
01a6c0e6f6 chore: make new multimedia editor public 2024-08-07 13:26:45 +00:00
David Allison
54cd95b479 refactor(libanki): rename legacy methods & fix camelCase
It was agreed we use camelCase consistently and
 that snake_case was to be applied by `@LibAnkiAlias`

A few legacy methods would have conflicted

rename:
* addField -> addFieldLegacy
* renameField -> renameFieldLegacy
* remField -> remFieldLegacy
* moveField -> moveFieldLegacy

implementation:
search for `fun.*_` inside `libAnki`

Fixes 11582
2024-08-04 10:58:50 +00:00
David Allison
d1c63b12de refactor(libanki): rename methods/params to camelCase
It was agreed we use camelCase consistently and
 that snake_case was to be applied by `@LibAnkiAlias`

implementation:
search for `fun.*_` inside `libAnki`

inline:
* _addTemplate
* _addField

A few legacy methods in `Notetypes.kt` weren't handled

Fixes 11582
2024-08-04 10:58:50 +00:00
David Allison
ef88a1cd06 refactor: Hungarian Notation rename 2024-08-04 09:21:16 +00:00
peyman79
edfe9b7125 fix(instant-editor): punctuation handling
* Add Apostrophe and Parentheses to the cloze regex
* Add tests
2024-08-03 17:33:33 +00:00
Ashish Yadav
796e58b91f refactor: move audio package to multimedia package 2024-08-03 16:38:37 +00:00
David Allison
5f5745b093 docs: dependencies - changelogs
For when Dependabot doesn't link through
2024-08-02 15:34:48 +00:00
David Allison
f14d60ed4e refactor(deps): rename/refactor
* androidxText -> androidxTest
* androidxRunner -> androidxTest
* remove 'core' - unused
* androidxImageCropper -> imageCropper (not AndroidX)
* androidxMedia3 is combined from the following
    * media3Exoplayer
    * media3ExoplayerDash
    * media3Ui

** Renames **
* androidxSqliteFramework -> androidxSqlite
* androidxSwiperefreshlayout -> androidxSwipeRefreshLayout
* androidxUiautomator -> androidxTestUiAutomator
2024-08-02 15:34:48 +00:00
SanjaySargam
e6127154c8 deckpicker: keyboard shortcuts
Implemented keyboard shortcuts to enhance the user experience by providing quick access to commonly used functionalitie. The following shortcuts have been added:

T: Opens Statistics.
D: Creates a Deck
C: Check database
F: Creates a Filtered Deck.
Del: Deletes the currently focused Deck (on large screen only) with
confirmation dialog.
Shift+Del: Deletes deck without confirmation dialog (on large screen
only)
R: Renames the Deck (on large screen only)
P: Opens Settings.
M: Checks Media.
Ctrl+ E: triggers the Export Collection dialog.
Ctrl + Shift + I: Opens the Import dialog.
Ctrl + Shift + N: Opens Manage Note Types.
Ctrl+B: Restore from backup
2024-08-01 22:53:45 +00:00
AnkiDroid Translations
8863de71a0 Updated strings from Crowdin 2024-08-01 17:59:07 +00:00
Ashish Yadav
ce1b7780a0 Refactor: vibration methods to use Duration
Co-authored-by: David Allison <62114487+david-allison@users.noreply.github.com>
2024-08-01 11:55:26 +00:00
Ashish Yadav
7d82d127ca enhacement: add Audio and Video multimedia options
* refactor: viewModel to use generic media terms and livedata
* refactor: use reselect string instead of restart
* refactor: extract MenuProvider class
* refactor: show multimedia bottomsheet in case result is cancelled
2024-07-31 14:54:09 +00:00
AnkiDroid Translations
de309bb1ea Updated strings from Crowdin 2024-07-30 12:31:06 +00:00
SanjaySargam
76eea74a2b Implement Right-Click Support for Long Click Listeners
-Added right-click support for all existing long click listeners.
-Created an OnContextAndLongClickListener interface to handle both context click and long click events consistently.
 -This interface includes an onAction method to define the common action (context and long click).
 -The interface ensures that both listeners are set without duplicating code.
-Applied the OnContextAndLongClickListener interface to handle right-click and long-click events uniformly.
2024-07-28 14:15:41 +00:00
SanjaySargam
87e2a79b67 card-template-editor: keyboard shortcuts
- Implemented keyboard shortcuts:
  - Ctrl+P: Perform Preview
  - Ctrl+1: Navigate to Front Edit
  - Ctrl+2: Navigate to Back Edit
  - Ctrl+3: Navigate to Styling Edit
  - Ctrl+S: Save Note
  - Ctrl+R: Rename template
  - Ctrl+I: Show Insert Field Dialog
  - Ctrl+A: Add template
  - Ctrl+B: Open Browser Appearance
  - Ctrl+D: Delete template
  - Ctrl+O: Display Deck Override Dialog
  - Ctrl+M: Copy Markdown Template to Clipboard
2024-07-28 14:13:38 +00:00
Ashish Yadav
f52b6276da fix: cloze number incorrect on undo
* refactor: update the viewmodel tests
2024-07-28 11:39:14 +00:00
anoop
f7d1b97b25 Introducing AnalyticsWidgetProvider as ancestor of all widget classes.
This will ensure any widgets Timber and send analytics on enabling, disabling and updating.
2024-07-26 05:48:51 +00:00
SanjaySargam
d76e69586d refactor: rename pager
Renaming these two pager ids so that android-studio should know both are different pager
2024-07-26 02:26:35 +00:00