Merge branch 'main' into test/2819-add-campaigns-api-tests

This commit is contained in:
Nicolas Raoul 2025-10-19 22:42:28 +09:00 committed by GitHub
commit abbf5b6698
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
7 changed files with 15 additions and 8 deletions

View file

@ -324,7 +324,7 @@ after opening the app.
) )
.subscribeOn(Schedulers.io()) .subscribeOn(Schedulers.io())
.blockingGet() .blockingGet()
Timber.d("Resuming " + stuckUploads.size + " uploads...") Timber.d("Resuming %d uploads...", stuckUploads.size)
if (!stuckUploads.isEmpty()) { if (!stuckUploads.isEmpty()) {
for (contribution in stuckUploads) { for (contribution in stuckUploads) {
contribution.state = Contribution.STATE_QUEUED contribution.state = Contribution.STATE_QUEUED

View file

@ -9,7 +9,6 @@ import android.view.LayoutInflater
import android.view.View import android.view.View
import android.view.ViewGroup import android.view.ViewGroup
import android.widget.ProgressBar import android.widget.ProgressBar
import android.widget.Switch
import androidx.appcompat.app.AlertDialog import androidx.appcompat.app.AlertDialog
import androidx.constraintlayout.widget.ConstraintLayout import androidx.constraintlayout.widget.ConstraintLayout
import androidx.core.view.isVisible import androidx.core.view.isVisible
@ -20,6 +19,7 @@ import androidx.lifecycle.lifecycleScope
import androidx.lifecycle.repeatOnLifecycle import androidx.lifecycle.repeatOnLifecycle
import androidx.recyclerview.widget.GridLayoutManager import androidx.recyclerview.widget.GridLayoutManager
import androidx.recyclerview.widget.RecyclerView import androidx.recyclerview.widget.RecyclerView
import com.google.android.material.switchmaterial.SwitchMaterial
import fr.free.nrw.commons.contributions.Contribution import fr.free.nrw.commons.contributions.Contribution
import fr.free.nrw.commons.contributions.ContributionDao import fr.free.nrw.commons.contributions.ContributionDao
import fr.free.nrw.commons.customselector.database.NotForUploadStatusDao import fr.free.nrw.commons.customselector.database.NotForUploadStatusDao
@ -82,7 +82,7 @@ class ImageFragment :
*/ */
private var selectorRV: RecyclerView? = null private var selectorRV: RecyclerView? = null
private var loader: ProgressBar? = null private var loader: ProgressBar? = null
private var switch: Switch? = null private var switch: SwitchMaterial? = null
lateinit var filteredImages: ArrayList<Image> lateinit var filteredImages: ArrayList<Image>
/** /**

View file

@ -112,8 +112,8 @@ class WikidataItemDetailsActivity : BaseActivity(), MediaDetailProvider, Categor
viewPagerAdapter!!.setTabs( viewPagerAdapter!!.setTabs(
R.string.title_for_media to depictionImagesListFragment!!, R.string.title_for_media to depictionImagesListFragment!!,
R.string.title_for_subcategories to childDepictionsFragment, R.string.title_for_child_classes to childDepictionsFragment,
R.string.title_for_parent_categories to parentDepictionsFragment R.string.title_for_parent_classes to parentDepictionsFragment
) )
binding!!.viewPager.offscreenPageLimit = 2 binding!!.viewPager.offscreenPageLimit = 2
viewPagerAdapter!!.notifyDataSetChanged() viewPagerAdapter!!.notifyDataSetChanged()

View file

@ -27,6 +27,7 @@ import java.io.File
import java.io.FileOutputStream import java.io.FileOutputStream
import java.util.Locale import java.util.Locale
import javax.inject.Inject import javax.inject.Inject
import timber.log.Timber
/** /**
* This activity will set two tabs, achievements and * This activity will set two tabs, achievements and
@ -122,7 +123,7 @@ class ProfileActivity : BaseActivity() {
val rootView = window.decorView.findViewById<View>(android.R.id.content) val rootView = window.decorView.findViewById<View>(android.R.id.content)
val screenShot = getScreenShot(rootView) val screenShot = getScreenShot(rootView)
if (screenShot == null) { if (screenShot == null) {
Log.e("ERROR", "ScreenShot is null") Timber.e("ScreenShot is null")
return false return false
} }
showAlert(screenShot) showAlert(screenShot)

View file

@ -1,6 +1,7 @@
package fr.free.nrw.commons.settings package fr.free.nrw.commons.settings
import android.Manifest.permission import android.Manifest.permission
import android.annotation.SuppressLint
import android.app.Activity import android.app.Activity
import android.app.Dialog import android.app.Dialog
import android.content.Context.MODE_PRIVATE import android.content.Context.MODE_PRIVATE
@ -303,6 +304,11 @@ class SettingsFragment : PreferenceFragmentCompat() {
) )
} }
// Remove the space for icons in the settings menu.
// This uses an internal API that shouldn't be used in app code,
// but it appears to be the most robust way to do this at the moment,
// disable the warning.
@SuppressLint("RestrictedApi")
override fun onCreateAdapter(preferenceScreen: PreferenceScreen): Adapter<PreferenceViewHolder> override fun onCreateAdapter(preferenceScreen: PreferenceScreen): Adapter<PreferenceViewHolder>
{ {
return object : PreferenceGroupAdapter(preferenceScreen) { return object : PreferenceGroupAdapter(preferenceScreen) {

View file

@ -37,7 +37,7 @@ object LocationUtils {
latLng = LatLng(latLngArray[1].trim().toDouble(), latLng = LatLng(latLngArray[1].trim().toDouble(),
latLngArray[0].trim().toDouble(), 1f) latLngArray[0].trim().toDouble(), 1f)
} catch (e: Exception) { } catch (e: Exception) {
Timber.e("Error while parsing user entered lat long: %s", e) Timber.e(e, "Error while parsing user entered lat long")
} }
return latLng return latLng

View file

@ -6,7 +6,7 @@
xmlns:app="http://schemas.android.com/apk/res-auto" xmlns:app="http://schemas.android.com/apk/res-auto"
android:background="?attr/mainBackground"> android:background="?attr/mainBackground">
<Switch <com.google.android.material.switchmaterial.SwitchMaterial
android:id="@+id/switchWidget" android:id="@+id/switchWidget"
android:layout_width="wrap_content" android:layout_width="wrap_content"
android:layout_height="wrap_content" android:layout_height="wrap_content"