Fixed the migrations warning under Kotlin header #13282 (#6060)

* Fixed  Migration warnings under Kotlin header

* suppresses Lint

---------

Co-authored-by: Nicolas Raoul <nicolas.raoul@gmail.com>
This commit is contained in:
Sonal Yadav 2024-12-22 19:44:20 +05:30 committed by GitHub
parent f1e8e48769
commit b55c61ddb8
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
13 changed files with 28 additions and 20 deletions

View file

@ -2,6 +2,8 @@ package fr.free.nrw.commons.wikidata
import android.annotation.SuppressLint
import android.content.Context
import android.os.Build
import androidx.annotation.RequiresApi
import com.google.gson.Gson
import fr.free.nrw.commons.R
import fr.free.nrw.commons.contributions.Contribution
@ -111,12 +113,14 @@ class WikidataEditService @Inject constructor(
.blockingFirst()
}
@SuppressLint("StringFormatInvalid")
private fun showSuccessToast(wikiItemName: String) {
val successStringTemplate = context.getString(R.string.successful_wikidata_edit)
val successMessage = String.format(Locale.getDefault(), successStringTemplate, wikiItemName)
showLongToast(context, successMessage)
}
@RequiresApi(Build.VERSION_CODES.N)
@SuppressLint("CheckResult")
private fun addCaption(
fileEntityId: Long, languageCode: String,
@ -176,7 +180,7 @@ class WikidataEditService @Inject constructor(
SnakPartial(
"value",
MEDIA_LEGENDS.propertyName, MonoLingualText(
WikiBaseMonolingualTextValue(value!!, key!!)
WikiBaseMonolingualTextValue(value, key)
)
)
)