Skip to content

Commit

Permalink
Merge pull request #39 from musicorum-app/dev
Browse files Browse the repository at this point in the history
update libraries, fix search crash and friends view crash
  • Loading branch information
MysteryMS authored Jan 5, 2024
2 parents 3c5def6 + 4e1fea6 commit f66055d
Show file tree
Hide file tree
Showing 4 changed files with 31 additions and 23 deletions.
24 changes: 12 additions & 12 deletions app/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -47,8 +47,8 @@ android {
applicationId "io.musicorum.mobile"
minSdk 28
targetSdk 34
versionCode 70
versionName "2.0"
versionCode 71
versionName "2.0.1"
//compileSdkPreview = "UpsideDownCake"

testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
Expand Down Expand Up @@ -117,7 +117,7 @@ play {
dependencies {
implementation 'org.reflections:reflections:0.10.2'
implementation 'com.github.skydoves:balloon-compose:1.5.2'
implementation 'androidx.work:work-runtime-ktx:2.9.0-rc01'
implementation 'androidx.work:work-runtime-ktx:2.9.0'
implementation "androidx.paging:paging-compose:3.3.0-alpha02"
implementation 'com.github.crowdin.mobile-sdk-android:sdk:1.5.7'
implementation platform('androidx.compose:compose-bom:2022.11.00')
Expand All @@ -128,18 +128,18 @@ dependencies {
implementation 'io.sentry:sentry-android:6.27.0'
implementation 'io.sentry:sentry-compose-android:6.27.0'

def room_version = "2.6.0"
def room_version = "2.6.1"
implementation "androidx.room:room-runtime:$room_version"
implementation "androidx.room:room-ktx:$room_version"
annotationProcessor "androidx.room:room-compiler:$room_version"
ksp "androidx.room:room-compiler:$room_version"

implementation "com.google.dagger:hilt-android:2.47"
implementation 'androidx.core:core-ktx:1.10.0'
implementation "com.google.dagger:hilt-android:2.48"
implementation 'androidx.core:core-ktx:1.12.0'
kapt "com.google.dagger:hilt-compiler:2.48"
implementation 'androidx.hilt:hilt-navigation-compose:1.1.0'

implementation 'com.google.firebase:firebase-messaging-ktx:23.3.1'
implementation 'com.google.firebase:firebase-messaging-ktx:23.4.0'
implementation "androidx.constraintlayout:constraintlayout-compose:1.0.1"
implementation 'app.rive:rive-android:4.0.0'
implementation "androidx.startup:startup-runtime:1.1.1"
Expand All @@ -156,10 +156,10 @@ dependencies {
implementation "io.ktor:ktor-client-content-negotiation:$ktor_version"
implementation "io.ktor:ktor-serialization-kotlinx-xml:$ktor_version"
implementation 'com.google.accompanist:accompanist-systemuicontroller:0.26.5-rc'
implementation 'androidx.navigation:navigation-compose:2.7.5'
implementation 'androidx.navigation:navigation-compose:2.7.6'
implementation "androidx.compose.material:material-icons-extended"
implementation 'org.jetbrains.kotlinx:kotlinx-serialization-json:1.4.1'
implementation 'androidx.lifecycle:lifecycle-viewmodel-ktx:2.6.1'
implementation 'androidx.lifecycle:lifecycle-viewmodel-ktx:2.6.2'
implementation "io.ktor:ktor-client-logging:$ktor_version"
implementation "androidx.compose.runtime:runtime-livedata"
implementation 'androidx.palette:palette-ktx:1.0.0'
Expand All @@ -168,10 +168,10 @@ dependencies {
implementation 'org.jetbrains.kotlinx:kotlinx-coroutines-android:1.7.2'


implementation 'androidx.core:core-ktx:1.10.0'
implementation 'androidx.lifecycle:lifecycle-runtime-ktx:2.6.1'
implementation 'androidx.core:core-ktx:1.12.0'
implementation 'androidx.lifecycle:lifecycle-runtime-ktx:2.6.2'
implementation 'androidx.activity:activity-compose:1.8.2'
implementation 'androidx.core:core-splashscreen:1.0.0'
implementation 'androidx.core:core-splashscreen:1.0.1'
implementation "androidx.compose.ui:ui"
implementation "androidx.compose.ui:ui-tooling-preview"
implementation 'androidx.compose.material3:material3:1.2.0-beta01'
Expand Down
18 changes: 16 additions & 2 deletions app/src/main/java/io/musicorum/mobile/views/Discover.kt
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,11 @@ package io.musicorum.mobile.views

import androidx.compose.foundation.background
import androidx.compose.foundation.clickable
import androidx.compose.foundation.layout.Box
import androidx.compose.foundation.layout.Column
import androidx.compose.foundation.layout.IntrinsicSize
import androidx.compose.foundation.layout.fillMaxSize
import androidx.compose.foundation.layout.height
import androidx.compose.foundation.layout.padding
import androidx.compose.foundation.layout.size
import androidx.compose.foundation.rememberScrollState
Expand All @@ -27,11 +30,13 @@ import androidx.compose.runtime.getValue
import androidx.compose.runtime.livedata.observeAsState
import androidx.compose.runtime.mutableStateOf
import androidx.compose.runtime.saveable.rememberSaveable
import androidx.compose.ui.Alignment
import androidx.compose.ui.Alignment.Companion.CenterHorizontally
import androidx.compose.ui.Modifier
import androidx.compose.ui.draw.clip
import androidx.compose.ui.graphics.Color
import androidx.compose.ui.graphics.vector.ImageVector
import androidx.compose.ui.platform.LocalSoftwareKeyboardController
import androidx.compose.ui.res.pluralStringResource
import androidx.compose.ui.res.stringResource
import androidx.compose.ui.unit.dp
Expand Down Expand Up @@ -67,6 +72,7 @@ fun Discover(viewModel: DiscoverVm = viewModel()) {
)
val busy = viewModel.busy.observeAsState(false).value
val nav = LocalNavigation.current
val keyboard = LocalSoftwareKeyboardController.current


Scaffold(bottomBar = { BottomNavBar() }) { pv ->
Expand All @@ -88,6 +94,7 @@ fun Discover(viewModel: DiscoverVm = viewModel()) {
query = query,
onQueryChange = { viewModel.updateQuery(it) },
onSearch = {
keyboard?.hide()
viewModel.search()
presentResults.value = true
},
Expand All @@ -104,8 +111,15 @@ fun Discover(viewModel: DiscoverVm = viewModel()) {
if (!presentResults.value) return@Column

if (busy) {
CenteredLoadingSpinner()
return@Column
Box(
modifier = Modifier
.height(IntrinsicSize.Max)
.padding(top = 0.dp),
contentAlignment = Alignment.Center
) {
CenteredLoadingSpinner()
}
return@Scaffold
}

Header(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,8 @@ class FriendActivityViewModel(application: Application) : AndroidViewModel(appli
val state = MutableStateFlow(FriendActivityState())
val app = application

fun fetchActivity(username: String) {
if (state.value.track != null) return
fun fetchActivity(username: String) = runCatching {
if (state.value.track != null) return@runCatching
viewModelScope.launch {
state.update {
it.copy(loading = true)
Expand Down Expand Up @@ -48,10 +48,4 @@ class FriendActivityViewModel(application: Application) : AndroidViewModel(appli
}
}
}

fun launchWebProfile(username: String) {
val uri = Uri.parse("https://last.fm/user/$username")
val intent = Intent(Intent.ACTION_VIEW, uri)
app.startActivity(intent)
}
}
2 changes: 1 addition & 1 deletion build.gradle
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
buildscript {
ext {
compose_version = '1.6.0-alpha07'
compose_version = '1.6.0-beta03'
ktor_version = '2.3.4'
kotlin_version = '1.9.10'
}
Expand Down

0 comments on commit f66055d

Please sign in to comment.