Skip to content

Commit

Permalink
AndroidX libs version update (#152)
Browse files Browse the repository at this point in the history
* fix package path

* update AndroidX libs version

* update Paging to 3.2.0-alpha02
  • Loading branch information
wiryadev authored Nov 12, 2022
1 parent 5f77c34 commit 92b0763
Show file tree
Hide file tree
Showing 15 changed files with 41 additions and 38 deletions.
3 changes: 2 additions & 1 deletion app/src/main/AndroidManifest.xml
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,8 @@
<activity
android:name=".MainActivity"
android:label="@string/app_name"
android:theme="@style/Theme.ComposeCookBook.NoActionBar">
android:theme="@style/Theme.ComposeCookBook.NoActionBar"
android:exported="true">
<intent-filter>
<action android:name="android.intent.action.MAIN" />

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@ import androidx.compose.material.icons.outlined.Home
import androidx.compose.material.icons.outlined.LibraryMusic
import androidx.compose.material.icons.outlined.ReadMore
import androidx.compose.material.icons.outlined.Search
import androidx.compose.material3.ExperimentalMaterial3Api
import androidx.compose.material3.SmallTopAppBar
import androidx.compose.runtime.Composable
import androidx.compose.runtime.mutableStateOf
Expand All @@ -51,6 +52,7 @@ fun AppBars() {
NavigationBarDemo()
}

@OptIn(ExperimentalMaterial3Api::class)
@Composable
fun TopAppBarsDemo() {
SubtitleText(subtitle = "Top App bar")
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ package com.guru.composecookbook.build.configurations
import com.guru.composecookbook.build.dependencies.Versions

object ProjectConfigs {
const val compileSdkVersion = 32
const val compileSdkVersion = 33
const val minSdkVersion = 25
const val targetSdkVersion = 30
const val applicationId = "com.guru.composecookbook"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ object Dependencies {
"androidx.constraintlayout:constraintlayout-compose:${Versions.constraintLayoutCompose}"
const val composePaging = "androidx.paging:paging-compose:${Versions.pagingCompose}"
const val composeViewModel =
"androidx.lifecycle:lifecycle-viewmodel-compose:${Versions.lifecycleViewModelCompose}"
"androidx.lifecycle:lifecycle-viewmodel-compose:${Versions.androidLifecycleGrouped}"
const val composeActivity = "androidx.activity:activity-compose:${Versions.activityCompose}"
const val composeLottie = "com.airbnb.android:lottie-compose:${Versions.lottie}"
const val composeNavigation = "androidx.navigation:navigation-compose:${Versions.navCompose}"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,25 +3,24 @@ package com.guru.composecookbook.build.dependencies
internal object Versions {
const val compose = "1.2.1"
const val composeCompiler = "1.3.0"
const val lifecycleViewModelCompose = "2.4.0-rc01"
const val activityCompose = "1.3.1"
const val pagingCompose = "1.0.0-alpha12"
const val navCompose = "2.4.0-rc01"
const val constraintLayoutCompose = "1.0.0"
const val activityCompose = "1.5.1"
const val pagingCompose = "1.0.0-alpha16"
const val navCompose = "2.5.1"
const val constraintLayoutCompose = "1.0.1"
const val fontAwesomeCompose = "1.0.0-beta02"
const val coilCompose = "1.4.0"
const val kotlin = "1.7.10"
const val coroutines = "1.5.1"
const val androidLifecycleGrouped = "2.3.1"
const val androidLifecycleGrouped = "2.5.1"
const val flinger = "1.0.5"
const val paging = "3.0.1"
const val paging = "3.2.0-alpha02"
const val lottie = "4.2.0"
const val room = "2.4.1"
const val coreKtx = "1.6.0"
const val appcompat = "1.3.1"
const val room = "2.4.3"
const val coreKtx = "1.8.0"
const val appcompat = "1.5.0"
const val paletteKtx = "1.0.0"
const val material = "1.4.0"
const val material3 = "1.0.0-alpha13"
const val material = "1.6.0"
const val material3 = "1.0.0-alpha16"
const val playServicesAds = "19.6.0"
const val googleMaps = "3.1.0-beta"
const val playServicesMaps = "17.0.1"
Expand All @@ -34,6 +33,6 @@ internal object Versions {
const val junitJupiterApi = "5.7.0"
const val junitJupiterEngine = "5.7.0"
const val truth = "1.1.3"
const val androidXJunit = "1.1.2"
const val androidXJunit = "1.1.3"
const val biometric = "1.2.0-alpha03"
}
2 changes: 1 addition & 1 deletion demos/cryptoapp/app/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ dependencies {
implementation(project(":demos:cryptoapp:data"))
implementation(project(":theme"))
implementation(project(":data"))
implementation("androidx.wear:wear:1.1.0")
implementation("androidx.wear:wear:1.2.0")

addComposeOfficialDependencies()
addComposeThirdPartyDependencies()
Expand Down
2 changes: 1 addition & 1 deletion demos/cryptoapp/app/src/main/AndroidManifest.xml
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
android:value="true" />

<activity
android:name=".ui.AndroidWearActivity"
android:name=".ui.composewear.AndroidWearActivity"
android:exported="true"
android:label="@string/title_activity_android_wear">
<intent-filter>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package com.guru.composecookbook.cryptoapp.ui
package com.guru.composecookbook.cryptoapp.ui.composewear

import android.os.Bundle
import androidx.activity.ComponentActivity
Expand All @@ -11,19 +11,15 @@ import androidx.compose.foundation.verticalScroll
import androidx.compose.runtime.Composable
import androidx.compose.ui.Alignment
import androidx.compose.ui.Modifier
import androidx.compose.ui.graphics.BlendMode.Companion.Screen
import androidx.compose.ui.graphics.Color
import androidx.compose.ui.layout.ContentScale
import androidx.compose.ui.platform.LocalContext
import androidx.compose.ui.text.font.FontWeight
import androidx.compose.ui.text.style.TextAlign
import androidx.compose.ui.tooling.preview.Preview
import androidx.compose.ui.unit.dp
import androidx.lifecycle.viewmodel.compose.viewModel
import androidx.navigation.NavType
import androidx.navigation.Navigator
import androidx.navigation.navArgument
import androidx.paging.PagingData
import androidx.paging.compose.LazyPagingItems
import androidx.paging.compose.collectAsLazyPagingItems
import androidx.wear.compose.material.*
Expand All @@ -35,11 +31,8 @@ import com.guru.composecookbook.charts.LineChart
import com.guru.composecookbook.cryptoapp.data.db.models.Crypto
import com.guru.composecookbook.cryptoapp.ui.home.CryptoHomeViewModel
import com.guru.composecookbook.cryptoapp.ui.home.CryptoHomeViewModelFactory
import com.guru.composecookbook.cryptoapp.ui.internal.extensions.roundToThreeDecimals
import com.guru.composecookbook.cryptoapp.ui.internal.extensions.roundToTwoDecimals
import com.guru.composecookbook.data.DemoDataProvider
import com.guru.composecookbook.theme.ComposeCookBookMaterial3Theme
import com.guru.composecookbook.theme.ComposeCookBookTheme
import com.guru.composecookbook.theme.gradientGreenColors
import com.guru.composecookbook.theme.gradientRedColors
import com.guru.composecookbook.theme.green500
Expand Down Expand Up @@ -89,7 +82,7 @@ class AndroidWearActivity : ComponentActivity() {
arguments = listOf(navArgument(SYMBOL_ID) { type = NavType.StringType })
) { backStackEntry ->
val symbol = backStackEntry.arguments?.getString(SYMBOL_ID) ?: "btc"
val crypto = pagingItems.snapshot().items.filter { it.symbol == symbol }.first()
val crypto = pagingItems.itemSnapshotList.items.firstOrNull { it.symbol == symbol }
crypto?.let {
StockDetailScreen(crypto = it)
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ import com.guru.composecookbook.cryptoapp.data.repositories.CryptoRepository
import kotlinx.coroutines.Dispatchers

class CryptoDetailViewModelFactory(val context: Context) : ViewModelProvider.Factory {
override fun <T : ViewModel?> create(modelClass: Class<T>): T {
override fun <T : ViewModel> create(modelClass: Class<T>): T {
return CryptoDetailViewModel(context) as T
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ import kotlinx.coroutines.Dispatchers
import kotlinx.coroutines.launch

class CryptoHomeViewModelFactory(val context: Context) : ViewModelProvider.Factory {
override fun <T : ViewModel?> create(modelClass: Class<T>): T {
override fun <T : ViewModel> create(modelClass: Class<T>): T {
return CryptoHomeViewModel(context) as T
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -112,6 +112,7 @@ fun DatingBottomBar(navType: MutableState<DatingNavType>) {
}
}

@ExperimentalMaterial3Api
@Composable
fun DatingHomeAppbar(navType: MutableState<DatingNavType>) {
val title = when (navType.value) {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,16 +1,19 @@
package com.guru.composecookbook.moviesapp.ui.details

import android.content.Context
import androidx.lifecycle.*
import androidx.lifecycle.MutableLiveData
import androidx.lifecycle.ViewModel
import androidx.lifecycle.ViewModelProvider
import androidx.lifecycle.liveData
import androidx.lifecycle.viewModelScope
import com.guru.composecookbook.moviesapp.data.MovieDIGraph
import com.guru.composecookbook.moviesapp.data.db.models.Movie
import com.guru.composecookbook.moviesapp.data.repositories.MovieRepository
import kotlinx.coroutines.Dispatchers
import kotlinx.coroutines.flow.collect
import kotlinx.coroutines.launch

class MovieDetailViewModelFactory(val context: Context) : ViewModelProvider.Factory {
override fun <T : ViewModel?> create(modelClass: Class<T>): T {
override fun <T : ViewModel> create(modelClass: Class<T>): T {
return MovieDetailViewModel(context) as T
}
}
Expand Down
Original file line number Diff line number Diff line change
@@ -1,17 +1,20 @@
package com.guru.composecookbook.moviesapp.ui.home

import android.content.Context
import androidx.lifecycle.*
import androidx.lifecycle.MutableLiveData
import androidx.lifecycle.ViewModel
import androidx.lifecycle.ViewModelProvider
import androidx.lifecycle.liveData
import androidx.lifecycle.viewModelScope
import com.guru.composecookbook.moviesapp.data.MovieDIGraph
import com.guru.composecookbook.moviesapp.data.db.models.Movie
import com.guru.composecookbook.moviesapp.data.repositories.MovieRepository
import kotlinx.coroutines.Dispatchers
import kotlinx.coroutines.flow.collect
import kotlinx.coroutines.launch

@Suppress("UNCHECKED_CAST")
class MoviesHomeViewModelFactory(val context: Context) : ViewModelProvider.Factory {
override fun <T : ViewModel?> create(modelClass: Class<T>): T {
override fun <T : ViewModel> create(modelClass: Class<T>): T {
return MoviesHomeViewModel(context) as T
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,11 +8,10 @@ import androidx.lifecycle.viewModelScope
import com.guru.composecookbook.moviesapp.data.MovieDIGraph
import com.guru.composecookbook.moviesapp.data.db.models.Movie
import com.guru.composecookbook.moviesapp.data.repositories.MoviesLanesRepository
import kotlinx.coroutines.flow.collect
import kotlinx.coroutines.launch

class TrendingViewModelFactory(val context: Context) : ViewModelProvider.Factory {
override fun <T : ViewModel?> create(modelClass: Class<T>): T {
override fun <T : ViewModel> create(modelClass: Class<T>): T {
return TrendingViewModel(context) as T
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,9 @@ interface MovieApi {

val okHttpClient = OkHttpClient.Builder()
.addInterceptor(requestInterceptor)
.addInterceptor(HttpLoggingInterceptor())
.addInterceptor(
HttpLoggingInterceptor().setLevel(HttpLoggingInterceptor.Level.BODY)
)
.build()

return Retrofit.Builder()
Expand Down

0 comments on commit 92b0763

Please sign in to comment.