Change gradle version.

This commit is contained in:
Thomas Andres Gomez 2022-01-21 10:02:59 +01:00
parent 82aa5ec62a
commit 9074b78046
4 changed files with 25 additions and 1 deletions

View file

@ -1,5 +1,6 @@
package com.pixelized.biblib.ui.composable.pages package com.pixelized.biblib.ui.composable.pages
import android.widget.Toast
import androidx.compose.animation.ExperimentalAnimationApi import androidx.compose.animation.ExperimentalAnimationApi
import androidx.compose.foundation.background import androidx.compose.foundation.background
import androidx.compose.foundation.clickable import androidx.compose.foundation.clickable
@ -60,6 +61,11 @@ fun DetailPage(
.fillMaxHeight(), .fillMaxHeight(),
elevation = 4.dp elevation = 4.dp
) { ) {
val toast = Toast.makeText(
LocalContext.current,
stringResource(id = R.string.not_implemented_yet),
Toast.LENGTH_SHORT,
)
val coroutineScope = rememberCoroutineScope() val coroutineScope = rememberCoroutineScope()
val sheetState = rememberModalBottomSheetState(ModalBottomSheetValue.Hidden) val sheetState = rememberModalBottomSheetState(ModalBottomSheetValue.Hidden)
@ -80,6 +86,8 @@ fun DetailPage(
book?.let { book?.let {
DetailPage( DetailPage(
book = it, book = it,
onEpubClick = { toast.show() },
onMobiClick = { toast.show() },
onSendClick = { onSendClick = {
val emailCount = user?.amazonEmails?.size ?: 0 val emailCount = user?.amazonEmails?.size ?: 0
when { when {

View file

@ -1,13 +1,17 @@
package com.pixelized.biblib.ui.composable.screen package com.pixelized.biblib.ui.composable.screen
import android.widget.Toast
import androidx.compose.animation.* import androidx.compose.animation.*
import androidx.compose.animation.core.tween import androidx.compose.animation.core.tween
import androidx.compose.material.Scaffold import androidx.compose.material.Scaffold
import androidx.compose.material.rememberScaffoldState import androidx.compose.material.rememberScaffoldState
import androidx.compose.runtime.* import androidx.compose.runtime.*
import androidx.compose.runtime.livedata.observeAsState import androidx.compose.runtime.livedata.observeAsState
import androidx.compose.ui.platform.LocalContext
import androidx.compose.ui.res.stringResource
import androidx.compose.ui.tooling.preview.Preview import androidx.compose.ui.tooling.preview.Preview
import androidx.lifecycle.viewmodel.compose.viewModel import androidx.lifecycle.viewmodel.compose.viewModel
import com.pixelized.biblib.R
import com.pixelized.biblib.ui.composable.common.BibLibDrawer import com.pixelized.biblib.ui.composable.common.BibLibDrawer
import com.pixelized.biblib.ui.composable.common.BibLibToolbar import com.pixelized.biblib.ui.composable.common.BibLibToolbar
import com.pixelized.biblib.ui.composable.pages.DetailPage import com.pixelized.biblib.ui.composable.pages.DetailPage
@ -31,6 +35,11 @@ fun HomeScreen(
booksViewModel: IBooksViewModel = viewModel<BooksViewModel>(), booksViewModel: IBooksViewModel = viewModel<BooksViewModel>(),
userViewModel: IUserViewModel = viewModel<UserViewModel>() userViewModel: IUserViewModel = viewModel<UserViewModel>()
) { ) {
val toast = Toast.makeText(
LocalContext.current,
stringResource(id = R.string.not_implemented_yet),
Toast.LENGTH_SHORT,
)
// navigation // navigation
val page by navigationViewModel.page.observeAsState() val page by navigationViewModel.page.observeAsState()
// coroutine // coroutine
@ -61,18 +70,23 @@ fun HomeScreen(
BibLibDrawer( BibLibDrawer(
userViewModel = userViewModel, userViewModel = userViewModel,
onNewClick = { onNewClick = {
toast.show()
coroutineScope.launch { scaffoldState.drawerState.close() } coroutineScope.launch { scaffoldState.drawerState.close() }
}, },
onBookClick = { onBookClick = {
toast.show()
coroutineScope.launch { scaffoldState.drawerState.close() } coroutineScope.launch { scaffoldState.drawerState.close() }
}, },
onSeriesClick = { onSeriesClick = {
toast.show()
coroutineScope.launch { scaffoldState.drawerState.close() } coroutineScope.launch { scaffoldState.drawerState.close() }
}, },
onAuthorClick = { onAuthorClick = {
toast.show()
coroutineScope.launch { scaffoldState.drawerState.close() } coroutineScope.launch { scaffoldState.drawerState.close() }
}, },
onTagClick = { onTagClick = {
toast.show()
coroutineScope.launch { scaffoldState.drawerState.close() } coroutineScope.launch { scaffoldState.drawerState.close() }
}, },
) )

View file

@ -37,4 +37,6 @@
<string name="detail_release">Release</string> <string name="detail_release">Release</string>
<string name="detail_genre">Genre</string> <string name="detail_genre">Genre</string>
<string name="detail_series">Series</string> <string name="detail_series">Series</string>
<string name="not_implemented_yet">Not implemented yet.</string>
</resources> </resources>

View file

@ -5,7 +5,7 @@ buildscript {
mavenCentral() mavenCentral()
} }
dependencies { dependencies {
classpath 'com.android.tools.build:gradle:7.0.3' classpath 'com.android.tools.build:gradle:7.0.4'
classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:1.5.10" classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:1.5.10"
// NOTE: Do not place your application dependencies here; they belong // NOTE: Do not place your application dependencies here; they belong