Skip to content

Commit

Permalink
Migrated helper modules to kotlin (commons-app#6007)
Browse files Browse the repository at this point in the history
* Rename .java to .kt

* Migrated delete and description module to kotlin (WIP)

* Fix: Unit tests

* Fix: Unit tests

* Rename .java to .kt

* Migrated data, db, and converter module to kotlin

* Fix: Unit tests

* Fix: Unit tests

---------

Co-authored-by: Nicolas Raoul <[email protected]>
  • Loading branch information
Saifuddin53 and nicolas-raoul authored Dec 10, 2024
1 parent 7331197 commit 3030a6f
Show file tree
Hide file tree
Showing 18 changed files with 1,169 additions and 974 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -372,16 +372,18 @@ class LocationPickerActivity : BaseActivity(), LocationPermissionCallback {
*/
private fun removeLocationFromImage() {
media?.let {
compositeDisposable.add(
coordinateEditHelper.makeCoordinatesEdit(
applicationContext, it, "0.0", "0.0", "0.0f"
)
.subscribeOn(Schedulers.io())
.observeOn(AndroidSchedulers.mainThread())
.subscribe { _ ->
Timber.d("Coordinates removed from the image")
}
coordinateEditHelper.makeCoordinatesEdit(
applicationContext, it, "0.0", "0.0", "0.0f"
)
?.subscribeOn(Schedulers.io())
?.observeOn(AndroidSchedulers.mainThread())
?.subscribe { _ ->
Timber.d("Coordinates removed from the image")
}?.let { it1 ->
compositeDisposable.add(
it1
)
}
}
setResult(RESULT_OK, Intent())
finish()
Expand Down Expand Up @@ -473,19 +475,21 @@ class LocationPickerActivity : BaseActivity(), LocationPermissionCallback {
fun updateCoordinates(latitude: String, longitude: String, accuracy: String) {
media?.let {
try {
compositeDisposable.add(
coordinateEditHelper.makeCoordinatesEdit(
applicationContext,
it,
latitude,
longitude,
accuracy
).subscribeOn(Schedulers.io())
.observeOn(AndroidSchedulers.mainThread())
.subscribe { _ ->
Timber.d("Coordinates updated")
}
)
coordinateEditHelper.makeCoordinatesEdit(
applicationContext,
it,
latitude,
longitude,
accuracy
)?.subscribeOn(Schedulers.io())
?.observeOn(AndroidSchedulers.mainThread())
?.subscribe { _ ->
Timber.d("Coordinates updated")
}?.let { it1 ->
compositeDisposable.add(
it1
)
}
} catch (e: Exception) {
if (e.localizedMessage == CsrfTokenClient.ANONYMOUS_TOKEN_MESSAGE) {
val username = sessionManager.userName
Expand Down

This file was deleted.

Loading

0 comments on commit 3030a6f

Please sign in to comment.