Skip to content

Commit

Permalink
Update demo codes
Browse files Browse the repository at this point in the history
  • Loading branch information
skydoves committed Oct 7, 2022
1 parent 859c4f6 commit a082bcb
Show file tree
Hide file tree
Showing 7 changed files with 36 additions and 38 deletions.
12 changes: 6 additions & 6 deletions app/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -4,12 +4,12 @@ plugins {
}

android {
compileSdk 31
compileSdk 33

defaultConfig {
applicationId "io.getstream.androiddeveloperroadmap"
minSdk 21
targetSdk 31
targetSdk 33
versionCode 1
versionName "1.0"
}
Expand All @@ -28,7 +28,7 @@ android {
}

composeOptions {
kotlinCompilerExtensionVersion compose_version
kotlinCompilerExtensionVersion compose_compiler_version
}

packagingOptions {
Expand All @@ -39,7 +39,6 @@ android {
}

dependencies {
implementation "androidx.core:core-ktx:1.7.0"
implementation "androidx.compose.ui:ui:$compose_version"
implementation "androidx.compose.material:material:$compose_version"
implementation "androidx.compose.ui:ui-tooling-preview:$compose_version"
Expand All @@ -48,7 +47,8 @@ dependencies {
implementation "androidx.compose.foundation:foundation-layout:$compose_version"
implementation "androidx.activity:activity-compose:$compose_activity_version"

implementation "com.mxalbert.zoomable:zoomable:$zoomable_version"
implementation "com.github.skydoves:landscapist-coil:$landscapist_version"
implementation "com.github.skydoves:landscapist-placeholder:$landscapist_version"

implementation("io.coil-kt:coil-compose:1.4.0")
implementation "com.mxalbert.zoomable:zoomable:$zoomable_version"
}
Original file line number Diff line number Diff line change
Expand Up @@ -19,17 +19,20 @@ package io.getstream.androiddeveloperroadmap
import android.os.Bundle
import androidx.activity.ComponentActivity
import androidx.activity.compose.setContent
import androidx.compose.foundation.Image
import androidx.compose.foundation.layout.fillMaxSize
import androidx.compose.material.MaterialTheme
import androidx.compose.material.Surface
import androidx.compose.runtime.Composable
import androidx.compose.ui.Modifier
import androidx.compose.ui.layout.ContentScale
import androidx.compose.ui.tooling.preview.Preview
import coil.compose.rememberImagePainter
import com.mxalbert.zoomable.Zoomable
import com.skydoves.landscapist.ImageOptions
import com.skydoves.landscapist.coil.CoilImage
import com.skydoves.landscapist.components.rememberImageComponent
import com.skydoves.landscapist.placeholder.shimmer.ShimmerPlugin
import io.getstream.androiddeveloperroadmap.ui.theme.AndroidDeveloperRoadmapTheme
import io.getstream.androiddeveloperroadmap.ui.theme.shimmerHighLight

class MainActivity : ComponentActivity() {
override fun onCreate(savedInstanceState: Bundle?) {
Expand All @@ -40,28 +43,29 @@ class MainActivity : ComponentActivity() {
Surface(
color = MaterialTheme.colors.background
) {
Roadmap()
AndroidRoadmap()
}
}
}
}
}

@Composable
private fun Roadmap() {
private fun AndroidRoadmap() {
Zoomable(
modifier = Modifier.fillMaxSize(),
) {
Image(
painter = rememberImagePainter(
"https://user-images.githubusercontent.com/24237865/144350753-5a52e6e5-3517-476c-8e5c-adad919abe8e.png",
builder = {
placeholder(R.drawable.roadmap_preview)
}
),
modifier = Modifier.fillMaxSize(),
contentScale = ContentScale.Fit,
contentDescription = null
val background = MaterialTheme.colors.background
CoilImage(
imageModel = "https://user-images.githubusercontent.com/24237865/144350753-5a52e6e5-3517-476c-8e5c-adad919abe8e.png",
component = rememberImageComponent {
// shows a shimmering effect when loading an image.
+ShimmerPlugin(
baseColor = background,
highlightColor = shimmerHighLight
)
},
imageOptions = ImageOptions(contentScale = ContentScale.Fit)
)
}
}
Expand All @@ -70,6 +74,6 @@ private fun Roadmap() {
@Composable
private fun DefaultPreview() {
AndroidDeveloperRoadmapTheme {
Roadmap()
AndroidRoadmap()
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -22,3 +22,5 @@ val Purple200 = Color(0xFFBB86FC)
val Purple500 = Color(0xFF6200EE)
val Purple700 = Color(0xFF3700B3)
val Teal200 = Color(0xFF03DAC5)
val background800 = Color(0xFF424242)
val shimmerHighLight = Color(0xA3C2C2C2)
Original file line number Diff line number Diff line change
Expand Up @@ -32,15 +32,6 @@ private val LightColorPalette = lightColors(
primary = Purple500,
primaryVariant = Purple700,
secondary = Teal200

/* Other default colors to override
background = Color.White,
surface = Color.White,
onPrimary = Color.White,
onSecondary = Color.Black,
onBackground = Color.Black,
onSurface = Color.Black,
*/
)

@Composable
Expand Down
9 changes: 5 additions & 4 deletions build.gradle
Original file line number Diff line number Diff line change
@@ -1,14 +1,15 @@
buildscript {
ext {
compose_version = '1.1.0-beta03'
compose_version = '1.3.0-rc01'
compose_compiler_version = '1.3.2'
compose_activity_version = '1.4.0'
landscapist_version = '1.4.3'
zoomable_version = '1.2.0'
landscapist_version = '2.0.0'
zoomable_version = '1.5.1'
}
}

plugins {
id "com.diffplug.spotless" version "5.15.0"
id "com.diffplug.spotless" version "6.3.0"
}

subprojects {
Expand Down
2 changes: 1 addition & 1 deletion gradle/wrapper/gradle-wrapper.properties
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
#Wed Dec 01 10:04:43 KST 2021
distributionBase=GRADLE_USER_HOME
distributionUrl=https\://services.gradle.org/distributions/gradle-7.2-bin.zip
distributionUrl=https\://services.gradle.org/distributions/gradle-7.5.1-bin.zip
distributionPath=wrapper/dists
zipStorePath=wrapper/dists
zipStoreBase=GRADLE_USER_HOME
6 changes: 3 additions & 3 deletions settings.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,9 @@ pluginManagement {
mavenCentral()
}
plugins {
id 'com.android.application' version '7.1.0-beta03'
id 'com.android.library' version '7.1.0-beta03'
id 'org.jetbrains.kotlin.android' version '1.5.31'
id 'com.android.application' version '7.3.0'
id 'com.android.library' version '7.3.0'
id 'org.jetbrains.kotlin.android' version '1.7.20'
}
}
dependencyResolutionManagement {
Expand Down

0 comments on commit a082bcb

Please sign in to comment.