Skip to content

Commit

Permalink
Order build.gradle + update Material3
Browse files Browse the repository at this point in the history
Signed-off-by: iTaysonLab <[email protected]>
  • Loading branch information
iTaysonLab committed Jun 6, 2022
1 parent 0df5299 commit 6a25782
Show file tree
Hide file tree
Showing 14 changed files with 260 additions and 116 deletions.
72 changes: 37 additions & 35 deletions app/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -8,12 +8,12 @@ plugins {
}

android {
compileSdk 31
compileSdk 32

defaultConfig {
applicationId "bruhcollective.itaysonlab.jetispot"
minSdk 23
targetSdk 31
targetSdk 32
versionCode 5
versionName "poc_v8"
resConfigs "en"
Expand Down Expand Up @@ -81,62 +81,64 @@ moshi {
}

dependencies {
implementation 'org.jetbrains.kotlinx:kotlinx-coroutines-guava:1.6.1'

implementation 'androidx.core:core-ktx:1.8.0'

implementation "androidx.datastore:datastore:1.0.0"
implementation "com.google.protobuf:protobuf-java:3.21.1"
// AndroidX
implementation "androidx.core:core-ktx:1.8.0"
implementation "androidx.palette:palette-ktx:1.0.0"
implementation "androidx.lifecycle:lifecycle-runtime-ktx:2.4.1"

// Compose
implementation "androidx.navigation:navigation-compose:2.4.2"
implementation 'androidx.activity:activity-compose:1.4.0'
implementation "androidx.compose.ui:ui:$compose_version"
implementation "androidx.compose.material:material:$compose_version"
implementation "androidx.compose.material:material:1.2.0-beta02"
implementation "androidx.compose.ui:ui-tooling-preview:$compose_version"
implementation "androidx.compose.material3:material3:$compose_m3_version"
implementation "androidx.navigation:navigation-compose:2.4.2"
implementation "androidx.palette:palette-ktx:1.0.0"
implementation "androidx.compose.material:material-icons-extended:$compose_version"
implementation "androidx.compose.ui:ui-util:$compose_version"

debugImplementation "androidx.compose.ui:ui-tooling:$compose_version"
debugImplementation "androidx.customview:customview:1.2.0-alpha01"
debugImplementation "androidx.customview:customview-poolingcontainer:1.0.0-beta02"

implementation "io.coil-kt:coil-compose:2.0.0-rc03"
implementation 'com.google.accompanist:accompanist-systemuicontroller:0.24.6-alpha'
implementation 'com.google.accompanist:accompanist-pager:0.24.7-alpha'

implementation 'androidx.lifecycle:lifecycle-runtime-ktx:2.4.1'
implementation 'androidx.activity:activity-compose:1.4.0'

implementation('com.github.iTaysonLab.librespot-java:librespot-player:e95c4f0529:thin') {
exclude group: 'xyz.gianlu.librespot', module: 'librespot-sink'
exclude group: 'com.lmax', module: 'disruptor'
exclude group: 'org.apache.logging.log4j'
//exclude group: 'com.google.protobuf'
}

// implementation 'uk.uuid.slf4j:slf4j-android:1.7.30-0'
implementation 'com.gitlab.mvysny.slf4j:slf4j-handroid:1.7.30'
// Compose - Additions
implementation "com.google.accompanist:accompanist-navigation-material:$accompanist_version"
implementation "com.google.accompanist:accompanist-systemuicontroller:$accompanist_version"
implementation "com.google.accompanist:accompanist-pager:$accompanist_version"

implementation("com.squareup.moshi:moshi-kotlin:1.13.0")
// Images
implementation "io.coil-kt:coil-compose:2.0.0-rc03"

implementation("androidx.hilt:hilt-navigation-compose:1.0.0")
// DI
implementation "androidx.hilt:hilt-navigation-compose:1.0.0"
implementation "com.google.dagger:hilt-android:2.41"
kapt "com.google.dagger:hilt-compiler:2.41"

// Playback
implementation "org.jetbrains.kotlinx:kotlinx-coroutines-guava:1.6.1"
implementation "com.gitlab.mvysny.slf4j:slf4j-handroid:1.7.30"
implementation "androidx.media2:media2-session:$media2_version"
implementation "androidx.media2:media2-player:$media2_version"
implementation ("com.github.iTaysonLab.librespot-java:librespot-player:e95c4f0529:thin") {
exclude group: 'xyz.gianlu.librespot', module: 'librespot-sink'
exclude group: 'com.lmax', module: 'disruptor'
exclude group: 'org.apache.logging.log4j'
}

// Data - Network
implementation "com.squareup.retrofit2:retrofit:2.9.0"
implementation "com.squareup.retrofit2:converter-moshi:2.9.0"
implementation "com.squareup.retrofit2:converter-protobuf:2.9.0"
implementation "com.squareup.moshi:moshi-kotlin:1.13.0"

implementation("androidx.room:room-runtime:$roomVersion")
implementation("androidx.room:room-ktx:$roomVersion")
implementation("androidx.room:room-paging:2.5.0-alpha01")
kapt "androidx.room:room-compiler:$roomVersion"
// Data - SQL
implementation "androidx.room:room-runtime:$room_version"
implementation "androidx.room:room-ktx:$room_version"
implementation "androidx.room:room-paging:2.5.0-alpha01"
kapt "androidx.room:room-compiler:$room_version"

implementation 'com.tencent:mmkv:1.2.13'
// Data - Proto
implementation "androidx.datastore:datastore:1.0.0"
implementation "com.google.protobuf:protobuf-java:3.21.1"
implementation "com.tencent:mmkv:1.2.13"
}

protobuf {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -170,8 +170,7 @@ class MainActivity : ComponentActivity() {
},
scaffoldState = bsState,
sheetPeekHeight = bsPeek,
backgroundColor = MaterialTheme.colorScheme.surface,
modifier = Modifier
backgroundColor = MaterialTheme.colorScheme.surface
) { innerScaffoldPadding ->
AppNavigation(navController = navController, provideLambdaController = lambdaNavController, sessionManager = sessionManager, authManager = authManager, modifier = Modifier
.padding(innerScaffoldPadding)
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
package bruhcollective.itaysonlab.jetispot.ui.ext

import androidx.compose.animation.rememberSplineBasedDecay
import androidx.compose.material3.*
import androidx.compose.runtime.Composable
import androidx.compose.runtime.remember

@OptIn(ExperimentalMaterial3Api::class)
@Composable
fun rememberEUCScrollBehavior(): TopAppBarScrollBehavior {
val sbd = rememberSplineBasedDecay<Float>()
val state = rememberTopAppBarScrollState()
return remember { TopAppBarDefaults.exitUntilCollapsedScrollBehavior(sbd, state) }
}
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@ import bruhcollective.itaysonlab.jetispot.ui.LambdaNavigationController
import bruhcollective.itaysonlab.jetispot.proto.AppConfig
import bruhcollective.itaysonlab.jetispot.core.SpConfigurationManager
import bruhcollective.itaysonlab.jetispot.ui.ext.compositeSurfaceElevation
import bruhcollective.itaysonlab.jetispot.ui.ext.rememberEUCScrollBehavior
import kotlinx.coroutines.flow.first
import kotlinx.coroutines.launch

Expand All @@ -49,8 +50,7 @@ fun BaseConfigScreen(
navController: LambdaNavigationController,
viewModel: ConfigViewModel
) {
val sbd = rememberSplineBasedDecay<Float>()
val scrollBehavior = remember { TopAppBarDefaults.exitUntilCollapsedScrollBehavior(sbd) }
val scrollBehavior = rememberEUCScrollBehavior()

val scope = rememberCoroutineScope()
val dsConfigState = viewModel.provideDataStore().data.collectAsState(initial = SpConfigurationManager.DEFAULT)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,14 +3,12 @@ package bruhcollective.itaysonlab.jetispot.ui.screens.config
import android.content.Context
import android.text.format.Formatter
import androidx.annotation.StringRes
import androidx.compose.animation.rememberSplineBasedDecay
import androidx.compose.foundation.Canvas
import androidx.compose.foundation.background
import androidx.compose.foundation.layout.*
import androidx.compose.foundation.lazy.LazyColumn
import androidx.compose.foundation.lazy.items
import androidx.compose.foundation.shape.CircleShape
import androidx.compose.foundation.shape.RoundedCornerShape
import androidx.compose.material.icons.Icons
import androidx.compose.material.icons.rounded.*
import androidx.compose.material3.*
Expand All @@ -27,8 +25,6 @@ import androidx.compose.ui.platform.LocalContext
import androidx.compose.ui.platform.LocalDensity
import androidx.compose.ui.res.stringResource
import androidx.compose.ui.text.font.FontWeight
import androidx.compose.ui.text.style.BaselineShift
import androidx.compose.ui.text.style.TextAlign
import androidx.compose.ui.unit.dp
import androidx.compose.ui.unit.sp
import androidx.hilt.navigation.compose.hiltViewModel
Expand All @@ -37,18 +33,15 @@ import bruhcollective.itaysonlab.jetispot.R
import bruhcollective.itaysonlab.jetispot.core.SpSessionManager
import bruhcollective.itaysonlab.jetispot.core.metadata_db.SpMetadataDb
import bruhcollective.itaysonlab.jetispot.core.util.Device
import bruhcollective.itaysonlab.jetispot.core.util.Log
import bruhcollective.itaysonlab.jetispot.ui.LambdaNavigationController
import bruhcollective.itaysonlab.jetispot.ui.ext.blendWith
import bruhcollective.itaysonlab.jetispot.ui.ext.compositeSurfaceElevation
import bruhcollective.itaysonlab.jetispot.ui.ext.findActivity
import bruhcollective.itaysonlab.jetispot.ui.hub.HubBinder
import bruhcollective.itaysonlab.jetispot.ui.screens.history.HistoryViewModel
import bruhcollective.itaysonlab.jetispot.ui.ext.rememberEUCScrollBehavior
import bruhcollective.itaysonlab.jetispot.ui.shared.PagingLoadingPage
import bruhcollective.itaysonlab.jetispot.ui.shared.evo.LargeTopAppBar
import coil.annotation.ExperimentalCoilApi
import coil.imageLoader
import coil.util.CoilUtils
import dagger.hilt.android.lifecycle.HiltViewModel
import kotlinx.coroutines.*
import java.io.File
Expand All @@ -63,8 +56,7 @@ fun StorageScreen(
val scope = rememberCoroutineScope()
val ctx = LocalContext.current

val sbd = rememberSplineBasedDecay<Float>()
val scrollBehavior = remember { TopAppBarDefaults.exitUntilCollapsedScrollBehavior(sbd) }
val scrollBehavior = rememberEUCScrollBehavior()

LaunchedEffect(Unit) {
viewModel.load(ctx)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,8 @@ fun DacRendererScreen(
viewModel: DacViewModel = hiltViewModel()
) {
val sbd = rememberSplineBasedDecay<Float>()
val scrollBehavior = remember { if (fullscreen) TopAppBarDefaults.pinnedScrollBehavior() else TopAppBarDefaults.exitUntilCollapsedScrollBehavior(sbd) }
val topBarState = rememberTopAppBarScrollState()
val scrollBehavior = remember { if (fullscreen) TopAppBarDefaults.pinnedScrollBehavior(topBarState) else TopAppBarDefaults.exitUntilCollapsedScrollBehavior(sbd, topBarState) }
val scope = rememberCoroutineScope()

LaunchedEffect(Unit) {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
package bruhcollective.itaysonlab.jetispot.ui.screens.history

import androidx.compose.animation.rememberSplineBasedDecay
import androidx.compose.foundation.layout.*
import androidx.compose.foundation.lazy.LazyColumn
import androidx.compose.foundation.lazy.items
Expand All @@ -21,6 +20,7 @@ import bruhcollective.itaysonlab.jetispot.core.SpPlayerServiceManager
import bruhcollective.itaysonlab.jetispot.core.api.SpInternalApi
import bruhcollective.itaysonlab.jetispot.core.objs.hub.HubResponse
import bruhcollective.itaysonlab.jetispot.core.objs.player.PlayFromContextData
import bruhcollective.itaysonlab.jetispot.ui.ext.rememberEUCScrollBehavior
import bruhcollective.itaysonlab.jetispot.ui.hub.HubBinder
import bruhcollective.itaysonlab.jetispot.ui.hub.HubScreenDelegate
import bruhcollective.itaysonlab.jetispot.ui.shared.PagingErrorPage
Expand All @@ -37,8 +37,7 @@ fun ListeningHistoryScreen(
navController: LambdaNavigationController,
viewModel: HistoryViewModel = hiltViewModel()
) {
val sbd = rememberSplineBasedDecay<Float>()
val scrollBehavior = remember { TopAppBarDefaults.exitUntilCollapsedScrollBehavior(sbd) }
val scrollBehavior = rememberEUCScrollBehavior()
val scope = rememberCoroutineScope()
val loadFunc: suspend CoroutineScope.() -> Unit = remember {{
viewModel.load {
Expand All @@ -53,7 +52,7 @@ fun ListeningHistoryScreen(
when (viewModel.state) {
is HistoryViewModel.State.Loaded -> {
Scaffold(topBar = {
LargeTopAppBar(title = {
LargeTopAppBar(title = {
Text(stringResource(id = R.string.listening_history))
}, navigationIcon = {
IconButton(onClick = { navController.popBackStack() }) {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
package bruhcollective.itaysonlab.jetispot.ui.screens.hub

import androidx.compose.animation.rememberSplineBasedDecay
import androidx.compose.foundation.layout.*
import androidx.compose.material.icons.Icons
import androidx.compose.material.icons.rounded.ArrowBack
Expand All @@ -11,15 +10,15 @@ import androidx.compose.ui.input.nestedscroll.nestedScroll
import androidx.compose.ui.platform.LocalDensity
import androidx.compose.ui.text.style.TextOverflow
import bruhcollective.itaysonlab.jetispot.ui.LambdaNavigationController
import bruhcollective.itaysonlab.jetispot.ui.ext.rememberEUCScrollBehavior
import bruhcollective.itaysonlab.jetispot.ui.shared.evo.LargeTopAppBar

@OptIn(ExperimentalMaterial3Api::class)
@Composable
fun BrowseRadioScreen(
navController: LambdaNavigationController
) {
val sbd = rememberSplineBasedDecay<Float>()
val scrollBehavior = remember { TopAppBarDefaults.exitUntilCollapsedScrollBehavior(sbd) }
val scrollBehavior = rememberEUCScrollBehavior()
var appBarTitle by remember { mutableStateOf("") }

Scaffold(topBar = {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
package bruhcollective.itaysonlab.jetispot.ui.screens.hub

import androidx.compose.animation.rememberSplineBasedDecay
import androidx.compose.foundation.layout.*
import androidx.compose.material.icons.Icons
import androidx.compose.material.icons.rounded.ArrowBack
Expand All @@ -11,6 +10,7 @@ import androidx.compose.ui.input.nestedscroll.nestedScroll
import androidx.compose.ui.platform.LocalDensity
import androidx.compose.ui.text.style.TextOverflow
import bruhcollective.itaysonlab.jetispot.ui.LambdaNavigationController
import bruhcollective.itaysonlab.jetispot.ui.ext.rememberEUCScrollBehavior
import bruhcollective.itaysonlab.jetispot.ui.shared.evo.LargeTopAppBar

@OptIn(ExperimentalMaterial3Api::class)
Expand All @@ -19,8 +19,7 @@ fun BrowseScreen(
navController: LambdaNavigationController,
id: String
) {
val sbd = rememberSplineBasedDecay<Float>()
val scrollBehavior = remember { TopAppBarDefaults.exitUntilCollapsedScrollBehavior(sbd) }
val scrollBehavior = rememberEUCScrollBehavior()
var appBarTitle by remember { mutableStateOf("") }

Scaffold(topBar = {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,8 @@ fun HubScaffold(
) {
val scope = rememberCoroutineScope()
val sbd = rememberSplineBasedDecay<Float>()
val scrollBehavior = remember { if (toolbarOptions.alwaysVisible) TopAppBarDefaults.exitUntilCollapsedScrollBehavior(sbd) else TopAppBarDefaults.pinnedScrollBehavior() }
val topBarState = rememberTopAppBarScrollState()
val scrollBehavior = remember { if (toolbarOptions.alwaysVisible) TopAppBarDefaults.exitUntilCollapsedScrollBehavior(sbd, topBarState) else TopAppBarDefaults.pinnedScrollBehavior(topBarState) }

when (state) {
is HubState.Loaded -> {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ import androidx.hilt.navigation.compose.hiltViewModel
import androidx.lifecycle.ViewModel
import bruhcollective.itaysonlab.jetispot.ui.LambdaNavigationController
import bruhcollective.itaysonlab.jetispot.core.collection.SpCollectionManager
import bruhcollective.itaysonlab.jetispot.ui.ext.rememberEUCScrollBehavior
import dagger.hilt.android.lifecycle.HiltViewModel
import kotlinx.coroutines.launch
import javax.inject.Inject
Expand All @@ -31,8 +32,7 @@ fun YourLibraryDebugScreen(
navController: LambdaNavigationController,
viewModel: YourLibraryDebugScreenViewModel = hiltViewModel()
) {
val sbd = rememberSplineBasedDecay<Float>()
val scrollBehavior = remember { TopAppBarDefaults.exitUntilCollapsedScrollBehavior(sbd) }
val scrollBehavior = rememberEUCScrollBehavior()
val scope = rememberCoroutineScope()

val items = listOf(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,6 @@ import androidx.compose.foundation.lazy.items
import androidx.compose.foundation.lazy.rememberLazyListState
import androidx.compose.material.icons.Icons
import androidx.compose.material.icons.rounded.AccountCircle
import androidx.compose.material.icons.rounded.BugReport
import androidx.compose.material.icons.rounded.Check
import androidx.compose.material.icons.rounded.Search
import androidx.compose.material3.*
Expand All @@ -25,7 +24,6 @@ import bruhcollective.itaysonlab.jetispot.core.collection.db.model2.CollectionEn
import bruhcollective.itaysonlab.jetispot.core.collection.db.model2.PredefCeType
import bruhcollective.itaysonlab.jetispot.ui.shared.PagingLoadingPage
import bruhcollective.itaysonlab.jetispot.ui.shared.evo.SmallTopAppBar
import com.google.accompanist.pager.ExperimentalPagerApi
import dagger.hilt.android.lifecycle.HiltViewModel
import kotlinx.coroutines.delay
import kotlinx.coroutines.launch
Expand Down
Loading

0 comments on commit 6a25782

Please sign in to comment.