Skip to content

Commit

Permalink
Merge pull request #7 from javierpe/task/upgrade-versions
Browse files Browse the repository at this point in the history
Minor changes
  • Loading branch information
javierpe authored Feb 4, 2023
2 parents 98589ee + 5d65ca5 commit 9f9de87
Show file tree
Hide file tree
Showing 58 changed files with 219 additions and 336 deletions.
12 changes: 6 additions & 6 deletions app/benchmark/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ plugins {
}

android {
compileSdk 32
compileSdk 33
targetProjectPath = ":app"
experimentalProperties["android.experimental.self-instrumenting"] = true

Expand All @@ -19,7 +19,7 @@ android {

defaultConfig {
minSdk 26
targetSdk 32
targetSdk 33

testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
}
Expand Down Expand Up @@ -49,11 +49,11 @@ androidComponents {
}

dependencies {
implementation "androidx.profileinstaller:profileinstaller:1.2.0"
implementation 'androidx.test.ext:junit:1.1.3'
implementation 'androidx.test.espresso:espresso-core:3.4.0'
implementation "androidx.profileinstaller:profileinstaller:1.2.2"
implementation 'androidx.test.ext:junit:1.1.5'
implementation 'androidx.test.espresso:espresso-core:3.5.1'
implementation 'androidx.test.uiautomator:uiautomator:2.2.0'
implementation 'androidx.benchmark:benchmark-macro-junit4:1.1.0'
implementation 'androidx.benchmark:benchmark-macro-junit4:1.1.1'
}

androidComponents {
Expand Down
62 changes: 34 additions & 28 deletions app/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ plugins {
id 'org.jetbrains.kotlin.android'
id 'kotlin-kapt'
id 'dagger.hilt.android.plugin'
id 'com.google.devtools.ksp' version '1.7.10-1.0.6'
id 'com.google.devtools.ksp' version '1.7.22-1.0.8'
}

android {
Expand All @@ -21,8 +21,8 @@ android {
applicationId "com.nucu.dynamiclistcompose"
minSdk 26
targetSdk 33
versionCode 6
versionName "1.1.0"
versionCode 7
versionName "1.1.1"

testInstrumentationRunner = "com.nucu.dynamiclistcompose.HiltTestRunner"
vectorDrawables {
Expand Down Expand Up @@ -108,8 +108,11 @@ dependencies {
implementation "com.google.accompanist:accompanist-pager:0.26.2-beta"
implementation "com.google.accompanist:accompanist-pager-indicators:0.19.0"

// Coil (Bad performance)
implementation("io.coil-kt:coil-compose:2.2.2")
// Coil (Bad performance in debug mode)
implementation "io.coil-kt:coil-compose:2.2.2"

// Glide
//implementation "com.github.bumptech.glide:compose:1.0.0-alpha.1"

// Gson
implementation "com.squareup.retrofit2:converter-gson:2.9.0"
Expand All @@ -118,15 +121,15 @@ dependencies {
ksp 'com.squareup.moshi:moshi-kotlin-codegen:1.14.0'

// Hilt
implementation("com.google.dagger:hilt-android:2.43.2")
implementation "com.google.dagger:hilt-android:$hilt_version"
implementation 'androidx.constraintlayout:constraintlayout-core:1.0.4'
kapt("com.google.dagger:hilt-android-compiler:2.43.2")
kapt("com.google.dagger:hilt-android-compiler:$hilt_version")

// Navigation
implementation("androidx.hilt:hilt-navigation-compose:1.0.0")
implementation 'io.github.raamcosta.compose-destinations:core:1.7.22-beta'
implementation 'io.github.raamcosta.compose-destinations:animations-core:1.7.22-beta'
ksp 'io.github.raamcosta.compose-destinations:ksp:1.7.22-beta'
implementation "androidx.hilt:hilt-navigation-compose:1.0.0"
implementation "io.github.raamcosta.compose-destinations:core:$compose_destinations_version"
implementation "io.github.raamcosta.compose-destinations:animations-core:$compose_destinations_version"
ksp "io.github.raamcosta.compose-destinations:ksp:$compose_destinations_version"

// Lottie
implementation "com.airbnb.android:lottie-compose:5.2.0"
Expand All @@ -135,22 +138,25 @@ dependencies {
implementation "androidx.datastore:datastore-preferences:1.0.0"

// Alpha
implementation "androidx.compose.material3:material3-window-size-class:1.0.0-rc01"
implementation "androidx.compose.material3:material3:1.0.0-rc01"
implementation "androidx.compose.material3:material3-window-size-class:1.0.1"
implementation "androidx.compose.material3:material3:1.0.1"

// Pagination:
//implementation "androidx.paging:paging-compose:1.0.0-alpha16"

// System UI Controller
implementation "com.google.accompanist:accompanist-systemuicontroller:0.29.1-alpha"

// Room
implementation "androidx.room:room-rxjava3:2.4.3"
implementation "androidx.room:room-ktx:2.4.3"
kapt "androidx.room:room-compiler:2.4.3"
implementation "androidx.room:room-rxjava3:2.5.0"
implementation "androidx.room:room-ktx:2.5.0"
kapt "androidx.room:room-compiler:2.5.0"

// Compose
implementation "androidx.compose.ui:ui:$compose_version"
implementation "androidx.compose.material:material:1.3.0-rc01"
implementation "androidx.compose.material:material:1.3.1"
implementation "androidx.compose.ui:ui-tooling-preview:$compose_version"
implementation 'androidx.activity:activity-compose:1.6.0'
implementation 'androidx.activity:activity-compose:1.6.1'
implementation "androidx.constraintlayout:constraintlayout-compose:1.0.1"
implementation "androidx.lifecycle:lifecycle-viewmodel-compose:$compose_lifecycle_version"
implementation "androidx.lifecycle:lifecycle-runtime-compose:$compose_lifecycle_version"
Expand All @@ -159,26 +165,26 @@ dependencies {

// Test
testImplementation 'app.cash.turbine:turbine:0.9.0'
testImplementation 'org.mockito.kotlin:mockito-kotlin:4.0.0'
testImplementation 'org.mockito:mockito-inline:4.6.1'
testImplementation 'org.mockito.kotlin:mockito-kotlin:4.1.0'
testImplementation 'org.mockito:mockito-inline:4.11.0'
testImplementation "org.jetbrains.kotlinx:kotlinx-coroutines-test:1.6.4"
testImplementation 'junit:junit:4.13.2'
testImplementation 'org.json:json:20210307'

kaptAndroidTest 'com.google.dagger:hilt-android-compiler:2.43.2'
kaptAndroidTest "com.google.dagger:hilt-android-compiler:$hilt_version"

// Performance
debugImplementation 'com.squareup.leakcanary:leakcanary-android:2.9.1'
debugImplementation 'com.squareup.leakcanary:leakcanary-android:2.10'
implementation "androidx.metrics:metrics-performance:1.0.0-alpha03"

// Android Test
androidTestImplementation 'app.cash.turbine:turbine:0.9.0'
androidTestImplementation 'com.google.dagger:hilt-android-testing:2.43.2'
androidTestImplementation 'org.mockito.kotlin:mockito-kotlin:4.0.0'
androidTestImplementation "com.google.dagger:hilt-android-testing:$hilt_version"
androidTestImplementation 'org.mockito.kotlin:mockito-kotlin:4.1.0'
androidTestImplementation 'org.mockito:mockito-android:4.0.0'
androidTestImplementation 'androidx.test.ext:junit:1.1.3'
androidTestImplementation 'androidx.test.espresso:espresso-core:3.4.0'
androidTestImplementation "androidx.compose.ui:ui-test-junit4:$compose_version"
debugImplementation "androidx.compose.ui:ui-tooling:$compose_version"
androidTestImplementation 'androidx.test.ext:junit:1.1.5'
androidTestImplementation 'androidx.test.espresso:espresso-core:3.5.1'
androidTestImplementation "androidx.compose.ui:ui-test-junit4:1.3.3"
debugImplementation "androidx.compose.ui:ui-tooling:1.3.3"
debugImplementation "androidx.compose.ui:ui-test-manifest:$compose_version"
}
2 changes: 2 additions & 0 deletions app/proguard-rules.pro
Original file line number Diff line number Diff line change
Expand Up @@ -21,3 +21,5 @@
#-renamesourcefileattribute SourceFile

-keep class com.nucu.dynamiclistcompose.presentation.components.** { *; }
-keep class com.nucu.dynamiclistcompose.data.** { *; }
-keep class com.dynamic.** { *; }
Binary file added app/src/main/ic_launcher-playstore.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
9 changes: 7 additions & 2 deletions app/src/main/java/com/nucu/dynamiclistcompose/MainActivity.kt
Original file line number Diff line number Diff line change
Expand Up @@ -9,21 +9,25 @@ import androidx.compose.animation.ExperimentalAnimationApi
import androidx.compose.animation.core.tween
import androidx.compose.animation.fadeIn
import androidx.compose.animation.fadeOut
import androidx.compose.foundation.isSystemInDarkTheme
import androidx.compose.foundation.layout.fillMaxSize
import androidx.compose.material.MaterialTheme
import androidx.compose.material.Surface
import androidx.compose.material3.windowsizeclass.ExperimentalMaterial3WindowSizeClassApi
import androidx.compose.material3.windowsizeclass.WindowWidthSizeClass
import androidx.compose.material3.windowsizeclass.calculateWindowSizeClass
import androidx.compose.runtime.Composable
import androidx.compose.runtime.DisposableEffect
import androidx.compose.ui.Alignment
import androidx.compose.ui.ExperimentalComposeUiApi
import androidx.compose.ui.Modifier
import androidx.compose.ui.graphics.Color
import androidx.compose.ui.res.colorResource
import androidx.compose.ui.semantics.semantics
import androidx.compose.ui.semantics.testTagsAsResourceId
import androidx.hilt.navigation.compose.hiltViewModel
import androidx.metrics.performance.JankStats
import com.google.accompanist.navigation.material.ExperimentalMaterialNavigationApi
import com.google.accompanist.systemuicontroller.rememberSystemUiController
import com.javier.api.NavigationController
import com.javier.api.models.Route
import com.nucu.dynamiclistcompose.presentation.ui.base.ContextView
Expand Down Expand Up @@ -68,8 +72,9 @@ class MainActivity : ComponentActivity() {
.semantics {
testTagsAsResourceId = true
},
color = MaterialTheme.colors.background
color = colorResource(id = R.color.ic_launcher_background)
) {

val navHostEngine = rememberAnimatedNavHostEngine(
navHostContentAlignment = Alignment.TopCenter,
rootDefaultAnimations = RootNavGraphDefaultAnimations(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,6 @@ import androidx.compose.runtime.rememberCoroutineScope
import androidx.compose.ui.Modifier
import androidx.compose.ui.unit.dp
import androidx.datastore.preferences.core.booleanPreferencesKey
import androidx.lifecycle.compose.ExperimentalLifecycleComposeApi
import androidx.lifecycle.compose.collectAsStateWithLifecycle
import com.javi.render.processor.data.enums.RenderType
import com.nucu.dynamiclistcompose.data.actions.ScrollAction
Expand All @@ -35,7 +34,6 @@ import kotlinx.coroutines.launch
import kotlinx.coroutines.withContext
import java.util.*

@OptIn(ExperimentalLifecycleComposeApi::class)
abstract class DynamicListComposeController {

abstract val delegates: MutableSet<@JvmSuppressWildcards DynamicListFactory>
Expand Down Expand Up @@ -221,4 +219,4 @@ abstract class DynamicListComposeController {
private const val SHOW_CASE_START_DELAY: Long = 100
private const val SHOW_CASE_END_DELAY: Long = 500
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -69,15 +69,15 @@ class BannerCarouselFactory @Inject constructor(
.clip(RoundedCornerShape(16.dp))
.wrapContentWidth()
.height(100.dp)
.background(MaterialTheme.colors.onPrimary)
.background(MaterialTheme.colors.primary)
)

Box(
modifier = Modifier
.clip(RoundedCornerShape(16.dp))
.wrapContentWidth()
.height(100.dp)
.background(MaterialTheme.colors.onPrimary)
.background(MaterialTheme.colors.primary)
)
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ class BannerFactory @Inject constructor(
.clip(RoundedCornerShape(16.dp))
.fillMaxWidth()
.height(150.dp)
.background(MaterialTheme.colors.onPrimary)
.background(MaterialTheme.colors.primary)
)
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -65,15 +65,15 @@ class CardsFactory @Inject constructor(): DynamicListFactory {
.clip(RoundedCornerShape(10.dp))
.width(200.dp)
.height(100.dp)
.background(MaterialTheme.colors.onPrimary)
.background(MaterialTheme.colors.primary)
)

Box(
modifier = Modifier
.clip(RoundedCornerShape(10.dp))
.width(200.dp)
.height(100.dp)
.background(MaterialTheme.colors.onPrimary)
.background(MaterialTheme.colors.primary)
)
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -64,6 +64,7 @@ class FacesFactory @Inject constructor(

@Composable
override fun CreateSkeleton() {

Row(
modifier = Modifier
.testTag("skeleton")
Expand Down Expand Up @@ -95,15 +96,15 @@ fun FacesSkeletonItem() {
modifier = Modifier
.size(size)
.clip(CircleShape)
.background(MaterialTheme.colors.onPrimary)
.background(MaterialTheme.colors.primary)
)

Box(
modifier = Modifier
.width(size)
.height(heightText)
.clip(RoundedCornerShape(roundedText))
.background(MaterialTheme.colors.onPrimary)
.background(MaterialTheme.colors.primary)
)
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -74,39 +74,39 @@ class FiltersFactory @Inject constructor(): DynamicListFactory {
Box(
modifier = Modifier
.clip(RoundedCornerShape(15.dp))
.background(MaterialTheme.colors.onPrimary)
.background(MaterialTheme.colors.primary)
.width(width)
.height(height)
)

Box(
modifier = Modifier
.clip(RoundedCornerShape(15.dp))
.background(MaterialTheme.colors.onPrimary)
.background(MaterialTheme.colors.primary)
.width(width)
.height(height)
)

Box(
modifier = Modifier
.clip(RoundedCornerShape(15.dp))
.background(MaterialTheme.colors.onPrimary)
.background(MaterialTheme.colors.primary)
.width(width)
.height(height)
)

Box(
modifier = Modifier
.clip(RoundedCornerShape(15.dp))
.background(MaterialTheme.colors.onPrimary)
.background(MaterialTheme.colors.primary)
.width(width)
.height(height)
)

Box(
modifier = Modifier
.clip(RoundedCornerShape(15.dp))
.background(MaterialTheme.colors.onPrimary)
.background(MaterialTheme.colors.primary)
.width(width)
.height(height)
)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ class MessageFactory @Inject constructor(): DynamicListFactory {
.clip(RoundedCornerShape(10.dp))
.fillMaxWidth()
.height(70.dp)
.background(MaterialTheme.colors.onPrimary)
.background(MaterialTheme.colors.primary)
)
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ class PosterFactory @Inject constructor(): DynamicListFactory {
.fillMaxWidth()
.testTag("skeleton")
.clip(RoundedCornerShape(10.dp))
.background(MaterialTheme.colors.onPrimary)
.background(MaterialTheme.colors.primary)
)
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ class ProfileFactory @Inject constructor(
modifier = Modifier
.testTag("skeleton")
.height(profileHeight)
.background(MaterialTheme.colors.onPrimary)
.background(MaterialTheme.colors.primary)
)
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ class TextFactory @Inject constructor(): DynamicListFactory {
.clip(RoundedCornerShape(7.dp))
.fillMaxWidth()
.height(30.dp)
.background(MaterialTheme.colors.onPrimary)
.background(MaterialTheme.colors.primary)
)
}
}
Loading

0 comments on commit 9f9de87

Please sign in to comment.