Skip to content

Commit 7ce66da

Browse files
david-allisonmikehardy
authored andcommitted
docs(image-occlusion): more KDocs
1 parent feb62d5 commit 7ce66da

File tree

2 files changed

+21
-2
lines changed

2 files changed

+21
-2
lines changed

AnkiDroid/src/main/java/com/ichi2/anki/pages/ImageOcclusion.kt

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -44,6 +44,20 @@ import com.ichi2.anki.startDeckSelection
4444
import kotlinx.coroutines.launch
4545
import timber.log.Timber
4646

47+
/**
48+
* Page provided by the backend, for a user to add or edit an image occlusion (IO) note
49+
*
50+
* IO: Like an image-based cloze: hide parts of an image, revealed on the back
51+
* ([docs](https://docs.ankiweb.net/editing.html#image-occlusion) and
52+
* [source](https://github.com/ankitects/anki/blob/main/proto/anki/image_occlusion.proto)).
53+
*
54+
* **Paths**
55+
* `/image-occlusion/$PATH`
56+
* `/image-occlusion/$NOTE_ID`
57+
*
58+
* @see ImageOcclusionViewModel
59+
* @see ImageOcclusion.getIntent
60+
*/
4761
class ImageOcclusion :
4862
PageFragment(R.layout.image_occlusion),
4963
DeckSelectionDialog.DeckSelectionListener {

AnkiDroid/src/main/java/com/ichi2/anki/pages/viewmodel/ImageOcclusionViewModel.kt

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -52,8 +52,10 @@ class ImageOcclusionViewModel(
5252
val oldDeckId: Long
5353

5454
/**
55-
* A [JSONObject] containing options for initializing the WebView. This includes
56-
* the type of operation ("add" or "edit"), and relevant IDs and paths.
55+
* A [JSONObject] containing options for loading the [image occlusion page][ImageOcclusion].
56+
* This includes the type of operation ("add" or "edit"), and relevant IDs and paths.
57+
*
58+
* Defined in https://github.com/ankitects/anki/blob/main/ts/routes/image-occlusion/lib.ts
5759
*/
5860
val webViewOptions: JSONObject
5961

@@ -86,6 +88,9 @@ class ImageOcclusionViewModel(
8688
return true
8789
}
8890

91+
/**
92+
* Executed when the 'save' operation is completed, before the UI receives the response
93+
*/
8994
fun onSaveOperationCompleted() {
9095
Timber.i("save operation completed")
9196
if (oldDeckId == selectedDeckId) return

0 commit comments

Comments
 (0)