Skip to content

Commit

Permalink
Merge branch 'main' into recent-search
Browse files Browse the repository at this point in the history
  • Loading branch information
neeldoshii authored Dec 11, 2024
2 parents 59fe558 + 9a876fa commit 5415471
Show file tree
Hide file tree
Showing 65 changed files with 2,161 additions and 2,057 deletions.
4 changes: 2 additions & 2 deletions app/src/main/java/fr/free/nrw/commons/AboutActivity.java
Original file line number Diff line number Diff line change
Expand Up @@ -180,8 +180,8 @@ public void launchTranslate(View view) {
getString(R.string.about_translate_cancel),
positiveButtonRunnable,
() -> {},
spinner,
true);
spinner
);
}

}
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
1 change: 1 addition & 0 deletions app/src/main/java/fr/free/nrw/commons/WelcomeActivity.java
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,7 @@ public void onCreate(final Bundle savedInstanceState) {
copyrightBinding = PopupForCopyrightBinding.inflate(getLayoutInflater());
final View contactPopupView = copyrightBinding.getRoot();
dialogBuilder.setView(contactPopupView);
dialogBuilder.setCancelable(false);
dialog = dialogBuilder.create();
dialog.show();

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -319,7 +319,7 @@ class LoginActivity : AccountAuthenticatorActivity() {
isIndeterminate = true
setTitle(getString(R.string.logging_in_title))
setMessage(getString(R.string.logging_in_message))
setCanceledOnTouchOutside(false)
setCancelable(false)
}
progressDialog!!.show()
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,13 @@ class CategoriesModel

// Newly used category...
if (category == null) {
category = Category(null, item.name, item.description, item.thumbnail, Date(), 0)
category = Category(
null, item.name,
item.description,
item.thumbnail,
Date(),
0
)
}
category.incTimesUsed()
categoryDao.save(category)
Expand Down
115 changes: 0 additions & 115 deletions app/src/main/java/fr/free/nrw/commons/category/Category.java

This file was deleted.

17 changes: 17 additions & 0 deletions app/src/main/java/fr/free/nrw/commons/category/Category.kt
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
package fr.free.nrw.commons.category

import android.net.Uri
import java.util.Date

data class Category(
var contentUri: Uri? = null,
val name: String? = null,
val description: String? = null,
val thumbnail: String? = null,
val lastUsed: Date? = null,
var timesUsed: Int = 0
) {
fun incTimesUsed() {
timesUsed++
}
}

This file was deleted.

Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
package fr.free.nrw.commons.category

interface CategoryClickedListener {
fun categoryClicked(item: CategoryItem)
}
Loading

0 comments on commit 5415471

Please sign in to comment.