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

27 Commits

Author SHA1 Message Date
shaiguelman
54c8426f8c
Fix crash during deck filtering (#11880)
Fixes a `ConcurrentModificationException`: the wrong list was modified

* Create copy of list when filtering

* Optimize containsFilterString

* Add error catching

* Remove whitespace

* Add comment and better naming

* Rename usage of childrenCopy variable I forgot to rename

* Change to more efficient solution

* Remove unecessary comment

* Add unit tests for DeckFilter

* Remove unused imports

* Add copywrite

* Remove whitespace

* Format fixes

* Add last name to dictionary

* Flipped actual and expected in assert statement

* Removed try/catch block in publishResults()

* Remove unused import

* Added null check

* Revert "Optimize containsFilterString"

This reverts commit 5b617b03f6.

* Reverting to using !! operator on results

* Rename test method
2022-07-21 12:36:37 +01:00
David Allison
d115336264
lint: Note Editor (#11632)
* lint: note editor warnings

* Redundant SAM-constructor
* onActivityResult overrides deprecated member but not marked as deprecated itself.
* 'getCurrentMultimediaEditableNote' always returns non-null type
* Explicitly given type is redundant here
* Function "getFieldByIndex" is never used
* Function "previewNextClozeDeletion" is never used
* Class "Field" is never used
* Unnecessary non-null assertion (!!) on a non-null receiver

* lint: note editor 'infos'

* Boolean literal argument without a parameter name
* Cascade 'if' should be replaced with 'when'

* lint: note editor 'weak warnings' and 'typos'

* Use of setter method instead of property access syntax
* Replace negated 'isEmpty' with 'isNotEmpty'
* Should be replaced with Kotlin function
* Can be joined with assignment
* Local variable names should not contain underscores
* Size check can be replaced with 'isNotEmpty()'
* Size zero check can be replaced with 'isEmpty()'
* Replaceable with operator-assignment
2022-06-16 13:41:05 +05:30
David Allison
a42802d7e1 refactor: Fix lint weak warnings
one remains: Format string '`studyoptions_congrats_undo`' is not a valid format string
so it should not be passed to `String.format`
2022-05-03 21:06:00 -05:00
David Allison
b6c6b8a19f chore: use recommended Kotlin code style settings
Android Studio Bumblebee | 2021.1.1 Patch 3

From an IDE message:

Update your Kotlin code style settings to the recommended ones?
2022-04-29 08:22:35 -05:00
David Allison
846cd470a5 Add RetryableException
Allows an operation to be retried
2022-04-17 13:18:08 -05:00
David Allison
67bb993785 feat: Lock database
We can't lock the database via file locking on macOS under Robolectric
So instead, we lock the database in code.

This is better than locking via `CollectionHelper` as it's not opt in

So, we use `Storage`, where the Collection is created

Throws `SQLiteDatabaseLockedException` if an attempt to access the DB
is made when the database is locked.
2022-04-14 13:43:17 -05:00
David Allison
1a453679e6 refactor: fix typos
And add non-typos to dictionaries
2022-04-13 10:42:47 -05:00
David Allison
5da9561a29 refactor: typos & related KotlinCleanup 2022-04-07 10:27:03 -05:00
David Allison
a2d2c162fb lint: Add user dictionaries to reduce typos
This adds 4 user dictionaries:

* anki.xml - Anki Desktop specific terminology: 'did'
* android.xml - Android and dependencies: 'miui.securitycenter'
* usernames.xml - Usernames in copyright declarations
* davidallison.xml - Anything else.
  * Each user has their own dictionary to avoid merge conflicts
  * But this is shared within the project

https://www.jetbrains.com/help/idea/spellchecking.html
https://stackoverflow.com/a/36256338

Fixes 10713
2022-04-05 17:11:56 -05:00
dorrin-sot
f995c189b2 reverted codestyle xml file to normal and added license for dialog xml 2021-08-04 22:09:38 -05:00
dorrin-sot
4829abea8e moved the media check dialog's body to a seperate xml 2021-08-04 22:09:38 -05:00
David Allison
717417950c Project Formatting: default to 'm' prefix
https://github.com/ankidroid/Anki-Android/wiki/Code-style#non-public-non-static-field-names-should-start-with-m
2021-04-14 12:43:52 -05:00
Anadi Kashyap
f083e205a5 fixed some automatic changes made by android studio 2020-10-23 09:06:05 -05:00
Anadi Kashyap
7cbb33c7bb added logic to return exact match for a deck if it exists before a wildcard leads to a regex search in Finder.java 2020-10-23 09:06:05 -05:00
Mike Hardy
00dadedf84 Ingest kotlin-plugin changes w/plugin 1.40+ 2020-08-19 18:27:30 -05:00
Mike Hardy
4391361374 Commit auto-altered codestyle from Android Studio 3.5.x 2019-10-10 16:51:38 +13:00
Mike Hardy
525f4e40e9 Remove Objective-C style section (AndroidStudio 3.4.x change) 2019-04-28 09:20:38 -05:00
Mike Hardy
d7bf29784e Update codestyle, small addition auto-added by AndroidStudio 2018-06-17 11:12:44 +09:00
Mike Hardy
c4377db1e3 Allow Android Studio formatting settings in git as exception
code style itself was imported to Android Studio via Checkstyle plugin
using the file docs/code_conventions/eclipse/ankidroid.checkstyle.xml,
with the only alterations being to implement blank line rules from
/docs/code_conventions/AnkiDroid_code_conventions.html
2018-06-15 06:09:28 +09:00
Tim Rae
c4c6af20af Bumped version to
@branch-specific
2016-12-13 20:43:22 +09:00
ospalh
9c41a6b58d Use the project encoding UTF-8. It is already used in some files, and not just in comments. 2015-07-06 12:09:53 +02:00
timrae
b00f6629cd ignore all .idea files 2015-03-31 12:21:38 +09:00
nobnago
d089a775be Merge branch 'develop' of https://github.com/ankidroid/Anki-Android into develop
Conflicts:
	AnkiDroid/src/main/java/com/ichi2/anki/DeckPicker.java
	AnkiDroid/src/main/res/layout/deck_item.xml
2015-03-30 11:32:00 +02:00
timrae
f44d928a4f Clean up Compat code
Remove redundant code which was only done on Eclair
Change to Java 7 as recommended by Android Studio
Don't show Hebrew preference on Jellybean and above
Get rid of lint warnings in Preferences
2015-03-28 20:49:07 +09:00
timrae
af91023e57 Update project configuration for Android Studio 1.0 stable 2014-12-09 11:11:40 +09:00
timrae
2f4e5c6943 Don't include iml files in repository
Add crowdin and chrome stuff to gitignore
2014-11-10 13:13:42 +09:00
timrae
1fbf16e693 Migrate to new Android Studio project structure 2014-11-10 02:02:29 +09:00