Skip to content

Commit f8d519e

Browse files
authored
Migrated filepicker from Java to Kotlin (commons-app#5997)
* Rename .java to .kt * Migrated filepicker module from Java to Kotlin * Rename .java to .kt * Migrated filepicker module from Java to Kotlin * fix: test cases
1 parent 3777f18 commit f8d519e

21 files changed

+970
-929
lines changed

app/src/main/java/fr/free/nrw/commons/filepicker/Constants.java

Lines changed: 0 additions & 23 deletions
This file was deleted.
Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
package fr.free.nrw.commons.filepicker
2+
3+
interface Constants {
4+
companion object {
5+
const val DEFAULT_FOLDER_NAME = "CommonsContributions"
6+
}
7+
8+
/**
9+
* Provides the request codes for permission handling
10+
*/
11+
interface RequestCodes {
12+
companion object {
13+
const val LOCATION = 1
14+
const val STORAGE = 2
15+
}
16+
}
17+
18+
/**
19+
* Provides locations as string for corresponding operations
20+
*/
21+
interface BundleKeys {
22+
companion object {
23+
const val FOLDER_NAME = "fr.free.nrw.commons.folder_name"
24+
const val ALLOW_MULTIPLE = "fr.free.nrw.commons.allow_multiple"
25+
const val COPY_TAKEN_PHOTOS = "fr.free.nrw.commons.copy_taken_photos"
26+
const val COPY_PICKED_IMAGES = "fr.free.nrw.commons.copy_picked_images"
27+
}
28+
}
29+
}

app/src/main/java/fr/free/nrw/commons/filepicker/DefaultCallback.java

Lines changed: 0 additions & 16 deletions
This file was deleted.
Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
package fr.free.nrw.commons.filepicker
2+
3+
/**
4+
* Provides abstract methods which are overridden while handling Contribution Results
5+
* inside the ContributionsController
6+
*/
7+
abstract class DefaultCallback: FilePicker.Callbacks {
8+
9+
override fun onImagePickerError(e: Exception, source: FilePicker.ImageSource, type: Int) {}
10+
11+
override fun onCanceled(source: FilePicker.ImageSource, type: Int) {}
12+
}

app/src/main/java/fr/free/nrw/commons/filepicker/ExtendedFileProvider.java

Lines changed: 0 additions & 7 deletions
This file was deleted.
Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
package fr.free.nrw.commons.filepicker
2+
3+
import androidx.core.content.FileProvider
4+
5+
class ExtendedFileProvider: FileProvider() {}

0 commit comments

Comments
 (0)