chore: upgrade target SDK and refactor function signatures to resolve build issues

This commit is contained in:
Rohit Verma 2025-08-03 12:18:51 +05:30
parent 8de57304bf
commit e193360ba3
No known key found for this signature in database
GPG key ID: D64E53E770687D0E
3 changed files with 17 additions and 13 deletions

View file

@ -18,12 +18,12 @@ if (isRunningOnTravisAndIsNotPRBuild) {
android {
namespace = "fr.free.nrw.commons"
compileSdk = 34
compileSdk = 35
defaultConfig {
applicationId = "fr.free.nrw.commons"
minSdk = 21
targetSdk = 34
targetSdk = 35
versionCode = 1055
versionName = "5.6.1"

View file

@ -12,7 +12,7 @@ object ConfigUtils {
val isBetaFlavour: Boolean = BuildConfig.FLAVOR == "beta"
@JvmStatic
private fun Context.getVersionName(): String =
private fun Context.getVersionName(): String? =
try {
packageManager.getPackageInfo(packageName, 0).versionName
} catch (e: PackageManager.NameNotFoundException) {

View file

@ -24,6 +24,7 @@ import io.reactivex.android.schedulers.AndroidSchedulers
import io.reactivex.disposables.CompositeDisposable
import io.reactivex.schedulers.Schedulers
import timber.log.Timber
import androidx.core.graphics.createBitmap
/**
* Created by blueSir9 on 3/10/17.
@ -307,17 +308,20 @@ object ImageUtils {
* * @return
*/
@JvmStatic
fun addRedBorder(bitmap: Bitmap, borderSize: Int, context: Context): Bitmap {
val bmpWithBorder = Bitmap.createBitmap(
bitmap.width + borderSize * 2,
bitmap.height + borderSize * 2,
bitmap.config
fun addRedBorder(bitmap: Bitmap, borderSize: Int, context: Context): Bitmap? {
return bitmap.config?.let { config ->
val bmpWithBorder =
createBitmap(
width = bitmap.width + borderSize * 2,
height = bitmap.height + borderSize * 2,
config = config
)
val canvas = Canvas(bmpWithBorder)
canvas.drawColor(ContextCompat.getColor(context, R.color.deleteRed))
canvas.drawBitmap(bitmap, borderSize.toFloat(), borderSize.toFloat(), null)
return bmpWithBorder
}
}
/**
* Result variable is a result of an or operation of all possible problems. Ie. if result