-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #87 from stslex/dev
update libs, refactor images
- Loading branch information
Showing
12 changed files
with
76 additions
and
44 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -10,7 +10,7 @@ jobs: | |
build: | ||
|
||
runs-on: ubuntu-latest | ||
timeout-minutes: 15 | ||
timeout-minutes: 30 | ||
|
||
steps: | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -12,3 +12,4 @@ local.properties | |
play_config.* | ||
keystore.* | ||
Gemfile.lock | ||
build |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
plugins { | ||
alias(libs.plugins.convention.library) | ||
alias(libs.plugins.convention.library.compose) | ||
} | ||
|
||
dependencies { | ||
implementation(project(":core:core")) | ||
|
||
implementation(libs.bundles.ktor) | ||
implementation(libs.bundles.okhttp) | ||
implementation(libs.coil.ktor) | ||
} |
32 changes: 32 additions & 0 deletions
32
core/image/src/main/kotlin/st/slex/scplashscreen/core/image/AppImageRequest.kt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
package st.slex.scplashscreen.core.image | ||
|
||
import android.content.Context | ||
import androidx.compose.runtime.Composable | ||
import androidx.compose.runtime.remember | ||
import androidx.compose.ui.platform.LocalContext | ||
import coil3.request.CachePolicy | ||
import coil3.request.ImageRequest | ||
|
||
object AppImageRequest { | ||
|
||
@Composable | ||
fun createImageRequestBuilder(url: String): ImageRequest.Builder { | ||
val context = LocalContext.current | ||
return remember { | ||
createImageRequestBuilder(context, url) | ||
.placeholderMemoryCacheKey(url) | ||
} | ||
} | ||
|
||
fun createImageRequestBuilder( | ||
context: Context, | ||
url: String | ||
): ImageRequest.Builder = ImageRequest | ||
.Builder(context) | ||
.data(url) | ||
.networkCachePolicy(CachePolicy.ENABLED) | ||
.diskCachePolicy(CachePolicy.ENABLED) | ||
.memoryCachePolicy(CachePolicy.ENABLED) | ||
.diskCacheKey(url) | ||
.memoryCacheKey(url) | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters