Skip to content

Commit

Permalink
public v103 + refactor code load ImageCompareSlider
Browse files Browse the repository at this point in the history
  • Loading branch information
chinhdl891 committed Sep 1, 2024
1 parent c5fcfb0 commit a5fea4f
Show file tree
Hide file tree
Showing 4 changed files with 10 additions and 8 deletions.
4 changes: 2 additions & 2 deletions app/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -45,8 +45,8 @@ dependencies {
testImplementation(libs.junit)
androidTestImplementation(libs.androidx.junit)
androidTestImplementation(libs.androidx.espresso.core)
implementation("com.github.chinhdl891:Image-Compare:102")
// implementation("com.github.chinhdl891:Image-Compare:102")

// implementation(project(":mylibrary"))
implementation(project(":mylibrary"))
// implementation("com.github.chinhdl891:ImageSildeCompare:v1.0.2")
}
2 changes: 1 addition & 1 deletion mylibrary/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ publishing {
register<MavenPublication>("release") {
groupId = "com.github.chinhdl891"
artifactId = "ImageSildeCompare"
version = "1.0.2"
version = "1.0.3"

afterEvaluate {
from(components["release"])
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -83,13 +83,15 @@ class ImageCompareSlider @JvmOverloads constructor(
}


fun setUpSlideCompare(backgroundData: Any) {
fun setUpSlideCompare(backgroundData: Bitmap) {

val backgroundBitmap = backgroundData as Bitmap
val resizedBackgroundBitmap = resizeBitmapToFitScreenWidth(backgroundBitmap)
val resizedBackgroundBitmap = resizeBitmapToFitScreenWidth(backgroundData)
binding.backgroundImage.setImageBitmap(resizedBackgroundBitmap)

val foregroundBitmap = createTransparentBitmap(backgroundBitmap.width, backgroundBitmap.height)
val foregroundBitmap = createTransparentBitmap(
backgroundData.width,
backgroundData.height
)
val resizedForegroundBitmap = resizeBitmapToFitScreenWidth(foregroundBitmap)
binding.foregroundImage.setImageBitmap(resizedForegroundBitmap)

Expand Down
2 changes: 1 addition & 1 deletion settings.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,6 @@ dependencyResolutionManagement {
}


rootProject.name = "My Application"
rootProject.name = "Image Compare"
include(":app")
include(":mylibrary")

0 comments on commit a5fea4f

Please sign in to comment.