Skip to content

Commit

Permalink
Merge pull request #34 from musicorum-app/dev
Browse files Browse the repository at this point in the history
Version 1.23-release
  • Loading branch information
MysteryMS authored Nov 20, 2023
2 parents c23d4df + acee636 commit 2776b48
Show file tree
Hide file tree
Showing 26 changed files with 404 additions and 158 deletions.
22 changes: 11 additions & 11 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 67
versionName "1.22-release"
versionCode 68
versionName "1.23-release"
//compileSdkPreview = "UpsideDownCake"

testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
Expand Down Expand Up @@ -116,7 +116,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.7.1'
implementation 'androidx.work:work-runtime-ktx:2.9.0-rc01'
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 @@ -127,18 +127,18 @@ dependencies {
implementation 'io.sentry:sentry-android:6.27.0'
implementation 'io.sentry:sentry-compose-android:6.27.0'

def room_version = "2.5.2"
def room_version = "2.6.0"
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.44.2"
implementation "com.google.dagger:hilt-android:2.47"
implementation 'androidx.core:core-ktx:1.10.0'
kapt "com.google.dagger:hilt-compiler:2.48"
implementation 'androidx.hilt:hilt-navigation-compose:1.0.0'
implementation 'androidx.hilt:hilt-navigation-compose:1.1.0'

implementation 'com.google.firebase:firebase-messaging-ktx:23.2.1'
implementation 'com.google.firebase:firebase-messaging-ktx:23.3.1'
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 @@ -147,15 +147,15 @@ dependencies {
implementation 'com.google.firebase:firebase-analytics-ktx'
implementation 'com.google.firebase:firebase-config-ktx'
implementation platform('com.google.firebase:firebase-bom:31.0.2')
implementation 'androidx.browser:browser:1.6.0'
implementation 'androidx.browser:browser:1.7.0'
implementation "io.ktor:ktor-client-core:$ktor_version"
implementation "io.ktor:ktor-client-android:$ktor_version"
implementation "io.ktor:ktor-client-cio:$ktor_version"
implementation "io.ktor:ktor-serialization-kotlinx-json:$ktor_version"
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.1'
implementation 'androidx.navigation:navigation-compose:2.7.5'
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'
Expand All @@ -164,15 +164,15 @@ dependencies {
implementation 'androidx.palette:palette-ktx:1.0.0'
implementation 'com.github.ajalt.colormath:colormath:3.2.1'
implementation 'com.github.ajalt.colormath.extensions:colormath-ext-jetpack-compose:3.2.1'
implementation 'org.jetbrains.kotlinx:kotlinx-coroutines-android:1.6.4'
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.activity:activity-compose:1.8.0-rc01'
implementation "androidx.compose.ui:ui"
implementation "androidx.compose.ui:ui-tooling-preview"
implementation 'androidx.compose.material3:material3:1.2.0-alpha09'
implementation 'androidx.compose.material3:material3:1.2.0-alpha11'
implementation 'com.google.accompanist:accompanist-placeholder-material:0.26.5-rc'
implementation 'io.coil-kt:coil-compose:2.4.0'
implementation 'androidx.datastore:datastore-preferences:1.0.0'
Expand Down
9 changes: 3 additions & 6 deletions app/src/main/java/io/musicorum/mobile/MainActivity.kt
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,6 @@ import androidx.compose.animation.slideOutVertically
import androidx.compose.foundation.isSystemInDarkTheme
import androidx.compose.foundation.layout.fillMaxSize
import androidx.compose.foundation.layout.padding
import androidx.compose.material3.ExperimentalMaterial3Api
import androidx.compose.material3.Scaffold
import androidx.compose.material3.SnackbarHost
import androidx.compose.material3.SnackbarHostState
Expand All @@ -40,7 +39,6 @@ import androidx.datastore.core.DataStore
import androidx.datastore.preferences.core.Preferences
import androidx.datastore.preferences.core.stringPreferencesKey
import androidx.datastore.preferences.preferencesDataStore
import androidx.lifecycle.viewmodel.compose.viewModel
import androidx.navigation.NavHostController
import androidx.navigation.NavType
import androidx.navigation.compose.NavHost
Expand Down Expand Up @@ -75,7 +73,6 @@ import io.musicorum.mobile.utils.CrowdinUtils
import io.musicorum.mobile.utils.LocalSnackbar
import io.musicorum.mobile.utils.LocalSnackbarContext
import io.musicorum.mobile.utils.MessagingService
import io.musicorum.mobile.viewmodels.MostListenedViewModel
import io.musicorum.mobile.views.Account
import io.musicorum.mobile.views.Collage
import io.musicorum.mobile.views.Discover
Expand All @@ -93,6 +90,7 @@ import io.musicorum.mobile.views.individual.Track
import io.musicorum.mobile.views.individual.User
import io.musicorum.mobile.views.login.loginGraph
import io.musicorum.mobile.views.mostListened.MostListened
import io.musicorum.mobile.views.settings.PendingScrobbles
import io.musicorum.mobile.views.settings.ScrobbleSettings
import io.musicorum.mobile.views.settings.Settings
import io.sentry.android.core.SentryAndroid
Expand Down Expand Up @@ -129,7 +127,6 @@ class MainActivity : ComponentActivity() {
super.attachBaseContext(Crowdin.wrapContext(newBase))
}

@OptIn(ExperimentalMaterial3Api::class)
override fun onCreate(savedInstanceState: Bundle?) {
enableEdgeToEdge()
super.onCreate(savedInstanceState)
Expand Down Expand Up @@ -210,7 +207,6 @@ class MainActivity : ComponentActivity() {
val useDarkIcons = !isSystemInDarkTheme()
navController = rememberNavController().withSentryObservableEffect()

val mostListenedViewModel: MostListenedViewModel = viewModel()
val ctx = LocalContext.current
val snackHostState = remember { SnackbarHostState() }
val systemUiController = rememberSystemUiController()
Expand Down Expand Up @@ -349,7 +345,7 @@ class MainActivity : ComponentActivity() {
}

composable("mostListened") {
MostListened(viewModel = mostListenedViewModel)
MostListened()
}

composable(
Expand Down Expand Up @@ -411,6 +407,7 @@ class MainActivity : ComponentActivity() {

composable("settings") { Settings() }
composable("settings/scrobble") { ScrobbleSettings() }
composable("settings/pendingScrobbles") { PendingScrobbles() }

composable(
"tag/{tagName}",
Expand Down
Original file line number Diff line number Diff line change
@@ -1,10 +1,15 @@
package io.musicorum.mobile.components

import androidx.compose.foundation.layout.*
import androidx.compose.foundation.layout.RowScope
import androidx.compose.material.icons.Icons
import androidx.compose.material.icons.rounded.ArrowBack
import androidx.compose.material3.*
import androidx.compose.material.icons.automirrored.rounded.ArrowBack
import androidx.compose.material3.ExperimentalMaterial3Api
import androidx.compose.material3.Icon
import androidx.compose.material3.IconButton
import androidx.compose.material3.Text
import androidx.compose.material3.TopAppBar
import androidx.compose.material3.TopAppBarDefaults.topAppBarColors
import androidx.compose.material3.TopAppBarScrollBehavior
import androidx.compose.runtime.Composable
import androidx.compose.ui.Modifier
import androidx.compose.ui.draw.alpha
Expand Down Expand Up @@ -46,7 +51,7 @@ fun MusicorumTopBar(
analytics.logEvent("topbar_back_pressed", null)
},
) {
Icon(Icons.Rounded.ArrowBack, contentDescription = "")
Icon(Icons.AutoMirrored.Rounded.ArrowBack, contentDescription = "")
}
},
scrollBehavior = scrollBehavior,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,10 +20,10 @@ import androidx.compose.foundation.layout.width
import androidx.compose.foundation.layout.windowInsetsBottomHeight
import androidx.compose.foundation.shape.RoundedCornerShape
import androidx.compose.material.icons.Icons
import androidx.compose.material.icons.automirrored.rounded.OpenInNew
import androidx.compose.material.icons.rounded.Album
import androidx.compose.material.icons.rounded.Favorite
import androidx.compose.material.icons.rounded.FavoriteBorder
import androidx.compose.material.icons.rounded.OpenInNew
import androidx.compose.material.icons.rounded.Share
import androidx.compose.material.icons.rounded.Star
import androidx.compose.material3.ExperimentalMaterial3Api
Expand Down Expand Up @@ -217,7 +217,7 @@ fun TrackSheet(
ctx.startActivity(intent)
},
headlineContent = { Text(text = "Open on Last.fm") },
leadingContent = { Icon(Icons.Rounded.OpenInNew, null) },
leadingContent = { Icon(Icons.AutoMirrored.Rounded.OpenInNew, null) },
colors = listColors
)
ListItem(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ object ArtistEndpoint {
parameter("method", "artist.getInfo")
parameter("name", artist)
parameter("artist", artist)
parameter("usernameArg", username)
parameter("username", username)
}
return if (res.status.isSuccess()) {
return res.body<InnerArtist>()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ object TrackEndpoint {
val autoCorrectValue = if (autoCorrect == true) 1 else 0
parameter("track", trackName)
parameter("method", "track.getInfo")
parameter("usernameArg", username)
parameter("username", username)
parameter("artist", artist)
parameter("autocorrect", autoCorrectValue)
}
Expand Down
Original file line number Diff line number Diff line change
@@ -1,9 +1,11 @@
package io.musicorum.mobile.ktor.endpoints

import io.ktor.client.call.body
import io.ktor.client.plugins.ClientRequestException
import io.ktor.client.request.get
import io.ktor.client.request.parameter
import io.ktor.client.request.post
import io.ktor.client.statement.bodyAsText
import io.ktor.http.HttpStatusCode
import io.ktor.http.isSuccess
import io.musicorum.mobile.ktor.KtorConfiguration
Expand Down Expand Up @@ -87,7 +89,7 @@ object UserEndpoint {

}

suspend fun getFriends(user: String, limit: Int?): FriendsResponse? {
suspend fun getFriends(user: String, limit: Int?): FriendsResponse? {
val result = kotlin.runCatching {
val res = KtorConfiguration.lastFmClient.get {
parameter("method", "user.getFriends")
Expand All @@ -104,17 +106,17 @@ object UserEndpoint {
}

suspend fun getTopTracks(user: String, period: FetchPeriod?, limit: Int?): TopTracks? {
val res = KtorConfiguration.lastFmClient.get {
parameter("method", "user.getTopTracks")
parameter("user", user)
parameter("period", period?.value)
parameter("limit", limit)
}
return if (res.status.isSuccess()) {
res.body<TopTracks>()
} else {
null
}
val res = KtorConfiguration.lastFmClient.get {
parameter("method", "user.getTopTracks")
parameter("user", user)
parameter("period", period?.value)
parameter("limit", limit)
}
return if (res.status.isSuccess()) {
res.body<TopTracks>()
} else {
null
}
}

suspend fun getTopAlbums(user: String, period: FetchPeriod?, limit: Int?): TopAlbumsResponse? {
Expand Down Expand Up @@ -169,6 +171,10 @@ object UserEndpoint {
parameter("method", "track.scrobble")
parameter("timestamp", timestamp)
}

if (!req.status.isSuccess()) {
throw ClientRequestException(req, req.bodyAsText())
}
return req.status
}
}
1 change: 1 addition & 0 deletions app/src/main/java/io/musicorum/mobile/router/Routes.kt
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@ object Routes {
const val settings = "settings"
const val login = "login"
const val scrobbleSettings = "settings/scrobble"
const val pendingScrobbles = "settings/pendingScrobbles"
fun albumTracklist(data: String) = "album/$data"
const val scrobbling = "scrobbling"
const val profile = "profile"
Expand Down
Loading

0 comments on commit 2776b48

Please sign in to comment.