Skip to content

Commit

Permalink
Merge pull request #463 from qdsfdhvh/version_1.7.6
Browse files Browse the repository at this point in the history
Version 1.7.6
  • Loading branch information
qdsfdhvh authored Feb 21, 2024
2 parents 030a9e3 + 8c1be43 commit 1a5ced6
Show file tree
Hide file tree
Showing 50 changed files with 665 additions and 376 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/Check.yml
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,7 @@ jobs:
run: ./gradlew test --stacktrace

- name: Upload build reports
uses: actions/upload-artifact@v3
uses: actions/upload-artifact@v4
with:
name: build-reports
path: '**/build/reports'
Expand Down
8 changes: 4 additions & 4 deletions .github/workflows/CompareScreenshot.yml
Original file line number Diff line number Diff line change
Expand Up @@ -46,23 +46,23 @@ jobs:
id: compare-screenshot-test
run: ./gradlew compareRoborazzi --stacktrace --info

- uses: actions/upload-artifact@v3
- uses: actions/upload-artifact@v4
if: ${{ always() }}
with:
name: screenshot-diff
path: |
**/build/outputs/roborazzi
retention-days: 30

- uses: actions/upload-artifact@v3
- uses: actions/upload-artifact@v4
if: ${{ always() }}
with:
name: screenshot-diff-reports
path: |
**/build/reports
retention-days: 30

- uses: actions/upload-artifact@v3
- uses: actions/upload-artifact@v4
if: ${{ always() }}
with:
name: screenshot-diff-test-results
Expand All @@ -75,7 +75,7 @@ jobs:
run: |
mkdir -p ./pr
echo ${{ github.event.number }} > ./pr/NR
- uses: actions/upload-artifact@v3
- uses: actions/upload-artifact@v4
with:
name: pr
path: pr/
6 changes: 3 additions & 3 deletions .github/workflows/StoreScreenshot.yml
Original file line number Diff line number Diff line change
Expand Up @@ -41,23 +41,23 @@ jobs:
id: record-test
run: ./gradlew recordRoborazzi --stacktrace

- uses: actions/upload-artifact@v3
- uses: actions/upload-artifact@v4
if: ${{ always() }}
with:
name: screenshot
path: |
**/build/outputs/roborazzi
retention-days: 30

- uses: actions/upload-artifact@v3
- uses: actions/upload-artifact@v4
if: ${{ always() }}
with:
name: screenshot-reports
path: |
**/build/reports
retention-days: 30

- uses: actions/upload-artifact@v3
- uses: actions/upload-artifact@v4
if: ${{ always() }}
with:
name: screenshot-test-results
Expand Down
3 changes: 1 addition & 2 deletions .idea/codeStyles/Project.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

52 changes: 36 additions & 16 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -17,17 +17,17 @@ kotlin {
sourceSets {
val commonMain by getting {
dependencies {
+ api("io.github.qdsfdhvh:image-loader:1.7.5")
+ api("io.github.qdsfdhvh:image-loader:1.7.6")
// optional - Moko Resources Decoder
+ api("io.github.qdsfdhvh:image-loader-extension-moko-resources:1.7.5")
+ api("io.github.qdsfdhvh:image-loader-extension-moko-resources:1.7.6")
// optional - Blur Interceptor (only support bitmap)
+ api("io.github.qdsfdhvh:image-loader-extension-blur:1.7.5")
+ api("io.github.qdsfdhvh:image-loader-extension-blur:1.7.6")
}
}
val jvmMain by getting {
dependencies {
// optional - ImageIO Decoder
+ api("io.github.qdsfdhvh:image-loader-extension-imageio:1.7.5")
+ api("io.github.qdsfdhvh:image-loader-extension-imageio:1.7.6")
}
}
}
Expand Down Expand Up @@ -101,12 +101,18 @@ fun generateImageLoader(): ImageLoader {
setupDefaultComponents()
}
interceptor {
// cache 100 success image result, without bitmap
defaultImageResultMemoryCache()
memoryCacheConfig {
// Set the max size to 25% of the app's available memory.
// cache 25% memory bitmap
bitmapMemoryCacheConfig {
maxSizePercent(context, 0.25)
}
// cache 50 image
imageMemoryCacheConfig {
maxSize(50)
}
// cache 50 painter
painterMemoryCacheConfig {
maxSize(50)
}
diskCacheConfig {
directory(context.cacheDir.resolve("image_cache").toOkioPath())
maxSizeBytes(512L * 1024 * 1024) // 512MB
Expand All @@ -125,10 +131,17 @@ fun generateImageLoader(): ImageLoader {
setupDefaultComponents()
}
interceptor {
// cache 100 success image result, without bitmap
defaultImageResultMemoryCache()
memoryCacheConfig {
maxSizeBytes(32 * 1024 * 1024) // 32MB
// cache 32MB bitmap
bitmapMemoryCacheConfig {
maxSize(32 * 1024 * 1024) // 32MB
}
// cache 50 image
imageMemoryCacheConfig {
maxSize(50)
}
// cache 50 painter
painterMemoryCacheConfig {
maxSize(50)
}
diskCacheConfig {
directory(getCacheDir().toOkioPath().resolve("image_cache"))
Expand Down Expand Up @@ -156,10 +169,17 @@ fun generateImageLoader(): ImageLoader {
setupDefaultComponents()
}
interceptor {
// cache 100 success image result, without bitmap
defaultImageResultMemoryCache()
memoryCacheConfig {
maxSizeBytes(32 * 1024 * 1024) // 32MB
// cache 32MB bitmap
bitmapMemoryCacheConfig {
maxSize(32 * 1024 * 1024) // 32MB
}
// cache 50 image
imageMemoryCacheConfig {
maxSize(50)
}
// cache 50 painter
painterMemoryCacheConfig {
maxSize(50)
}
diskCacheConfig {
directory(getCacheDir().toPath().resolve("image_cache"))
Expand Down
5 changes: 0 additions & 5 deletions app/android/benchmark/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -11,11 +11,6 @@ android {
defaultConfig {
minSdk = 23
testInstrumentationRunner = "androidx.test.runner.AndroidJUnitRunner"

// TODO temporary until AGP 8.2, which no longer requires this.
// This is because when we update baseline profiles, we do them on emulators but they
// run all tests.
testInstrumentationRunnerArguments["androidx.benchmark.suppressErrors"] = "EMULATOR"
}
buildTypes {
// This benchmark buildType is used for benchmarking, and should function like your
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,24 +27,32 @@ class MainActivity : ComponentActivity() {
takeFrom(ImageLoader.createDefaultAndroid(applicationContext))
commonConfig()
}
// return ImageLoader {
// commonConfig()
// options {
// androidContext(applicationContext)
// }
// components {
// setupDefaultComponents()
// }
// interceptor {
// memoryCacheConfig {
// // Set the max size to 25% of the app's available memory.
// maxSizePercent(applicationContext, 0.25)
// return ImageLoader {
// commonConfig()
// options {
// androidContext(applicationContext)
// }
// components {
// setupDefaultComponents()
// }
// diskCacheConfig {
// directory(cacheDir.resolve("image_cache").toOkioPath())
// maxSizeBytes(512L * 1024 * 1024) // 512MB
// interceptor {
// // cache 25% memory bitmap
// bitmapMemoryCacheConfig {
// maxSizePercent(context, 0.25)
// }
// // cache 50 image
// imageMemoryCacheConfig {
// maxSize(50)
// }
// // cache 50 painter
// painterMemoryCacheConfig {
// maxSize(50)
// }
// diskCacheConfig {
// directory(cacheDir.resolve("image_cache").toOkioPath())
// maxSizeBytes(512L * 1024 * 1024) // 512MB
// }
// }
// }
// }
}
}

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,10 @@ import androidx.compose.ui.layout.ContentScale
import androidx.compose.ui.unit.dp
import com.seiko.imageloader.demo.MR
import com.seiko.imageloader.model.ninePatch
import io.github.qdsfdhvh.common.generated.resources.car_black
import io.github.qdsfdhvh.common.generated.resources.cat
import io.github.qdsfdhvh.common.generated.resources.chat_from_bg_normal_9
import io.github.qdsfdhvh.common.generated.resources.collection_logo

@Composable
fun LocalResourceScene(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@ import com.seiko.imageloader.demo.MR
import com.seiko.imageloader.demo.util.JSON
import com.seiko.imageloader.demo.util.httpEngine
import com.seiko.imageloader.ui.AutoSizeImage
import io.github.qdsfdhvh.common.generated.resources.cat
import io.ktor.client.HttpClient
import io.ktor.client.call.body
import io.ktor.client.plugins.contentnegotiation.ContentNegotiation
Expand Down
13 changes: 11 additions & 2 deletions app/common/src/iosMain/kotlin/com/seiko/imageloader/demo/Main.kt
Original file line number Diff line number Diff line change
Expand Up @@ -29,8 +29,17 @@ private fun generateImageLoader(): ImageLoader {
// setupDefaultComponents()
// }
// interceptor {
// memoryCacheConfig {
// maxSizeBytes(32 * 1024 * 1024) // 32MB
// // cache 32MB bitmap
// bitmapMemoryCacheConfig {
// maxSize(32 * 1024 * 1024) // 32MB
// }
// // cache 50 image
// imageMemoryCacheConfig {
// maxSize(50)
// }
// // cache 50 painter
// painterMemoryCacheConfig {
// maxSize(50)
// }
// diskCacheConfig {
// directory(getCacheDir().toPath().resolve("image_cache"))
Expand Down
16 changes: 14 additions & 2 deletions app/desktop/src/jvmMain/kotlin/com/seiko/imageloader/demo/Main.kt
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,9 @@ import com.seiko.imageloader.ImageLoader
import com.seiko.imageloader.LocalImageLoader
import com.seiko.imageloader.component.setupDefaultComponents
import com.seiko.imageloader.demo.util.commonConfig
import com.seiko.imageloader.intercept.bitmapMemoryCacheConfig
import com.seiko.imageloader.intercept.imageMemoryCacheConfig
import com.seiko.imageloader.intercept.painterMemoryCacheConfig
import okio.Path.Companion.toOkioPath
import java.io.File

Expand Down Expand Up @@ -36,8 +39,17 @@ private fun generateImageLoader(): ImageLoader {
setupDefaultComponents()
}
interceptor {
memoryCacheConfig {
maxSizeBytes(32 * 1024 * 1024) // 32MB
// cache 32MB bitmap
bitmapMemoryCacheConfig {
maxSize(32 * 1024 * 1024) // 32MB
}
// cache 50 image
imageMemoryCacheConfig {
maxSize(50)
}
// cache 50 painter
painterMemoryCacheConfig {
maxSize(50)
}
diskCacheConfig {
directory(getCacheDir().toOkioPath().resolve("image_cache"))
Expand Down
2 changes: 1 addition & 1 deletion app/intellij-plugin/build.gradle.kts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
plugins {
id("org.jetbrains.intellij") version "1.17.1"
id("org.jetbrains.intellij") version "1.17.2"
java
id("app.kotlin.jvm")
id("app.compose.multiplatform")
Expand Down
Loading

0 comments on commit 1a5ced6

Please sign in to comment.