Skip to content

Commit

Permalink
Merge pull request #59 from prasidhanchan/dev
Browse files Browse the repository at this point in the history
v1.0.2
  • Loading branch information
prasidhanchan authored Dec 6, 2024
2 parents 5f1620b + f909a0a commit b92016e
Show file tree
Hide file tree
Showing 4 changed files with 25 additions and 7 deletions.
4 changes: 2 additions & 2 deletions app/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -34,8 +34,8 @@ android {
applicationId = "com.mca.codemonk"
minSdk = MIN_SDK
targetSdk = TARGET_SDK
versionCode = 14
versionName = "1.0.1"
versionCode = 15
versionName = "1.0.2"

testInstrumentationRunner = "com.mca.codemonk.HiltRunner"
vectorDrawables {
Expand Down
4 changes: 2 additions & 2 deletions buildSrc/src/main/java/AndroidConfig.kt
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,8 @@ import org.gradle.api.JavaVersion

object AndroidConfig {
const val MIN_SDK = 28
const val TARGET_SDK = 34
const val COMPILE_SDK = 34
const val TARGET_SDK = 35
const val COMPILE_SDK = 35
val JAVA_VERSION = JavaVersion.VERSION_21
const val JVM_TARGET = "21"
}
22 changes: 20 additions & 2 deletions core/util/src/main/java/com/mca/util/constant/UtilFunctions.kt
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,25 @@ enum class PostType {
data class ImageData(
val image: ByteArray?,
val mimeType: String
)
) {
override fun equals(other: Any?): Boolean {
if (this === other) return true
if (javaClass != other?.javaClass) return false

other as ImageData

if (image != null) {
if (other.image == null) return false
if (!image.contentEquals(other.image)) return false
} else if (other.image != null) return false

return true
}

override fun hashCode(): Int {
return image?.contentHashCode() ?: 0
}
}

/**
* Function to converts a list of likes to a string of liked by.
Expand Down Expand Up @@ -224,7 +242,7 @@ fun Post.convertToMap(): HashMap<String, Any> {
/**
* Function to get the current version of the app.
*/
fun Context.getCurrentVersion(): String {
fun Context.getCurrentVersion(): String? {
return if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.TIRAMISU) {
packageManager.getPackageInfo(
packageName,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -91,7 +91,7 @@ internal fun AboutScreen(
AboutCard(
text = stringResource(
id = R.string.current_version,
context.getCurrentVersion(),
context.getCurrentVersion().orEmpty(),
UPDATE_CHANNEL
),
icon = painterResource(id = R.drawable.version),
Expand Down

0 comments on commit b92016e

Please sign in to comment.