Skip to content

Commit

Permalink
Merge pull request #19 from RLD-JL/1.0.9-a
Browse files Browse the repository at this point in the history
Update sqldelight
  • Loading branch information
RLD-JL authored Oct 10, 2024
2 parents 4dc8c2a + 6ddb31e commit e7060fe
Show file tree
Hide file tree
Showing 26 changed files with 39 additions and 31 deletions.
4 changes: 2 additions & 2 deletions androidApp/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -45,8 +45,8 @@ android {
applicationId = "com.rld.justlisten.android"
minSdk = 21
targetSdk = 34
versionCode = 25
versionName = "1.0.9"
versionCode = 26
versionName = "1.0.9-a"
vectorDrawables {
useSupportLibrary = true
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ import coil.compose.AsyncImage
import coil.request.ImageRequest
import coil.transform.RoundedCornersTransformation
import com.rld.justlisten.android.R
import com.rld.justlisten.datalayer.localdb.addplaylistscreen.AddPlaylist
import com.rld.justlisten.database.addplaylistscreen.AddPlaylist
import com.rld.justlisten.datalayer.models.PlayListModel
import com.rld.justlisten.viewmodel.Events
import com.rld.justlisten.viewmodel.screens.library.getSongWithId
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ import com.rld.justlisten.android.exoplayer.MusicServiceConnection
import com.rld.justlisten.android.ui.bottombars.playbar.components.PlayerBottomBar
import com.rld.justlisten.android.ui.bottombars.sheets.BottomSheetScreen
import com.rld.justlisten.android.ui.bottombars.sheets.SheetLayout
import com.rld.justlisten.datalayer.localdb.addplaylistscreen.AddPlaylist
import com.rld.justlisten.database.addplaylistscreen.AddPlaylist
import com.rld.justlisten.datalayer.models.SongIconList
import com.rld.justlisten.datalayer.models.UserModel
import com.rld.justlisten.viewmodel.Events
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ import com.rld.justlisten.android.ui.addplaylistscreen.components.AddPlaylistDia
import com.rld.justlisten.android.ui.addplaylistscreen.components.AddPlaylistRow
import com.rld.justlisten.android.ui.addplaylistscreen.components.PlaylistViewItem
import com.rld.justlisten.android.ui.bottombars.playbar.components.more.TopSection
import com.rld.justlisten.datalayer.localdb.addplaylistscreen.AddPlaylist
import com.rld.justlisten.database.addplaylistscreen.AddPlaylist
import com.rld.justlisten.viewmodel.Events

@Composable
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import androidx.compose.runtime.MutableState
import androidx.compose.ui.graphics.painter.Painter
import com.rld.justlisten.android.ui.bottombars.playbar.components.addplaylist.AddPlaylistOption
import com.rld.justlisten.android.ui.bottombars.playbar.components.more.PlayBarMoreAction
import com.rld.justlisten.datalayer.localdb.addplaylistscreen.AddPlaylist
import com.rld.justlisten.database.addplaylistscreen.AddPlaylist
import com.rld.justlisten.viewmodel.Events

@Composable
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -101,7 +101,7 @@ fun SettingsScreen(
horizontalArrangement = Arrangement.Center
)
{
Text(text = "App version:1.0.9")
Text(text = "App version:1.0.9-a")
}
}
}
Expand Down
1 change: 0 additions & 1 deletion build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@ buildscript {
dependencies {
classpath("org.jetbrains.kotlin:kotlin-gradle-plugin:${libs.versions.kotlinVersion.get()}")
classpath("com.android.tools.build:gradle:8.5.2")
classpath("com.squareup.sqldelight:gradle-plugin:1.5.3")
classpath ("com.google.dagger:hilt-android-gradle-plugin:2.52")
}
}
Expand Down
13 changes: 7 additions & 6 deletions shared/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ plugins {
kotlin("multiplatform")
id("com.android.library")
kotlin("plugin.serialization") version libs.versions.kotlinVersion.get()
id("com.squareup.sqldelight")
id("app.cash.sqldelight") version "2.0.2"
}

kotlin {
Expand Down Expand Up @@ -42,7 +42,7 @@ kotlin {
val androidMain by getting {
dependencies {
implementation("io.ktor:ktor-client-android:${libs.versions.ktorVersion.get()}")
implementation("com.squareup.sqldelight:android-driver:1.5.3")
implementation("app.cash.sqldelight:android-driver:2.0.2")
}
}
val androidUnitTest by getting {
Expand All @@ -54,17 +54,18 @@ kotlin {
val iosMain by getting {
dependencies {
implementation("io.ktor:ktor-client-ios:${libs.versions.ktorVersion.get()}")
implementation("com.squareup.sqldelight:native-driver:2.0.2")
implementation("app.cash.sqldelight:native-driver:2.0.2")
}
}
val iosTest by getting
}
}

sqldelight {
database("LocalDb") {
packageName = "myLocal.db"
sourceFolders = listOf("kotlin")
databases {
create("LocalDb") {
packageName.set("com.rld.justlisten")
}
}
}

Expand Down
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
package com.rld.justlisten.shared.viewmodel

import android.content.Context
import app.cash.sqldelight.driver.android.AndroidSqliteDriver
import com.rld.justlisten.LocalDb
import com.rld.justlisten.datalayer.Repository
import com.rld.justlisten.viewmodel.JustListenViewModel
import com.squareup.sqldelight.android.AndroidSqliteDriver
import myLocal.db.LocalDb

fun JustListenViewModel.Factory.getAndroidInstance(context : Context) : JustListenViewModel {
val sqlDriver = AndroidSqliteDriver(LocalDb.Schema, context, "Local.db")
Expand Down
Original file line number Diff line number Diff line change
@@ -1,16 +1,16 @@
package com.rld.justlisten.datalayer

import com.rld.justlisten.datalayer.localdb.addplaylistscreen.AddPlaylist
import com.rld.justlisten.datalayer.localdb.libraryscreen.Library
import com.rld.justlisten.datalayer.localdb.playlistdetail.PlaylistDetail
import app.cash.sqldelight.ColumnAdapter
import app.cash.sqldelight.db.SqlDriver
import com.rld.justlisten.datalayer.models.SongIconList
import com.rld.justlisten.datalayer.models.UserModel
import com.rld.justlisten.datalayer.webservices.ApiClient
import com.squareup.sqldelight.ColumnAdapter
import com.squareup.sqldelight.db.SqlDriver
import kotlinx.coroutines.Dispatchers
import kotlinx.coroutines.withContext
import myLocal.db.LocalDb
import com.rld.justlisten.LocalDb
import com.rld.justlisten.database.addplaylistscreen.AddPlaylist
import com.rld.justlisten.database.libraryscreen.Library
import com.rld.justlisten.database.playlistdetail.PlaylistDetail


class Repository(
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
package com.rld.justlisten.datalayer.datacalls.addplaylistscreen

import com.rld.justlisten.database.addplaylistscreen.AddPlaylist
import com.rld.justlisten.datalayer.Repository
import com.rld.justlisten.datalayer.localdb.addplaylistscreen.*

Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
package com.rld.justlisten.datalayer.datacalls.settings

import com.rld.justlisten.database.settingsscreen.SettingsInfo
import com.rld.justlisten.datalayer.Repository
import com.rld.justlisten.datalayer.localdb.settingsscreen.SettingsInfo
import com.rld.justlisten.datalayer.localdb.settingsscreen.getSettingsInfo
import com.rld.justlisten.datalayer.localdb.settingsscreen.saveSettingsInfo

Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
package com.rld.justlisten.datalayer.localdb.addplaylistscreen

import myLocal.db.LocalDb
import com.rld.justlisten.LocalDb
import com.rld.justlisten.database.addplaylistscreen.AddPlaylist

fun LocalDb.savePlaylist(
playlistName: String, playlistDescription: String?
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ package com.rld.justlisten.datalayer.localdb.libraryscreen
import com.rld.justlisten.datalayer.models.PlayListModel
import com.rld.justlisten.datalayer.models.SongIconList
import com.rld.justlisten.datalayer.models.UserModel
import myLocal.db.LocalDb
import com.rld.justlisten.LocalDb

fun LocalDb.saveSongToFavorites(
id: String, title: String, user: UserModel, songImgList: SongIconList,
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
package com.rld.justlisten.datalayer.localdb.playlistdetail

import com.rld.justlisten.LocalDb
import com.rld.justlisten.datalayer.models.PlayListModel
import myLocal.db.LocalDb

fun LocalDb.getPlaylistDetail() : List<PlayListModel> {
return playlistDetailQueries.getPlaylistDetail(mapper = ::PlayListModel).executeAsList()
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
package com.rld.justlisten.datalayer.localdb.searchscreen

import myLocal.db.LocalDb
import com.rld.justlisten.LocalDb

fun LocalDb.saveSearchInfo(searchFor: String) {
searchScreenInfoQueries.transaction {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
package com.rld.justlisten.datalayer.localdb.settingsscreen

import myLocal.db.LocalDb
import com.rld.justlisten.LocalDb
import com.rld.justlisten.database.settingsscreen.SettingsInfo


fun LocalDb.saveSettingsInfo(hasNavigationDonationOn: Boolean, isDarkThemeOn: Boolean, palletColor: String) {
settingsScreenQueries.transaction {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
package com.rld.justlisten.viewmodel.screens.addplaylist

import com.rld.justlisten.database.addplaylistscreen.AddPlaylist
import com.rld.justlisten.datalayer.datacalls.addplaylistscreen.getAddPlaylist
import com.rld.justlisten.datalayer.datacalls.addplaylistscreen.savePlaylist
import com.rld.justlisten.datalayer.datacalls.addplaylistscreen.updatePlaylistSongs
import com.rld.justlisten.datalayer.localdb.addplaylistscreen.AddPlaylist
import com.rld.justlisten.viewmodel.Events

fun Events.addPlaylist(
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
package com.rld.justlisten.viewmodel.screens.addplaylist

import com.rld.justlisten.ScreenState
import com.rld.justlisten.datalayer.localdb.addplaylistscreen.AddPlaylist
import com.rld.justlisten.database.addplaylistscreen.AddPlaylist

data class AddPlaylistState(
val isLoading: Boolean = false,
Expand Down
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
package com.rld.justlisten.viewmodel.screens.settings

import com.rld.justlisten.database.settingsscreen.SettingsInfo
import com.rld.justlisten.datalayer.datacalls.settings.getSettingsInfo
import com.rld.justlisten.datalayer.datacalls.settings.saveSettingsInfo
import com.rld.justlisten.datalayer.localdb.settingsscreen.SettingsInfo
import com.rld.justlisten.viewmodel.Events

fun Events.saveSettingsInfo(hasNavigationFundOn: Boolean, isDarkThemeOn: Boolean, palletColor: String) {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import kotlin.collections.List;
import kotlin.String;

CREATE TABLE AddPlaylist (
playlistName TEXT NOT NULL PRIMARY KEY ,
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
import com.rld.justlisten.datalayer.models.SongIconList;
import com.rld.justlisten.datalayer.models.UserModel;
import kotlin.Boolean;

CREATE TABLE Library (
id TEXT NOT NULL PRIMARY KEY,
Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
import kotlin.Boolean;

CREATE TABLE SettingsInfo (
id INTEGER PRIMARY KEY DEFAULT 1,
hasNavigationDonationOn INTEGER AS Boolean NOT NULL,
Expand Down

0 comments on commit e7060fe

Please sign in to comment.