Skip to content

Commit fa2505e

Browse files
committed
Before software can be reusable it first has to be usable. - Ralph Johnson
adding Dev Text , Change List To Grid ,...
1 parent a3a9c46 commit fa2505e

File tree

4 files changed

+57
-138
lines changed

4 files changed

+57
-138
lines changed

composeApp/build.gradle.kts

Lines changed: 3 additions & 101 deletions
Original file line numberDiff line numberDiff line change
@@ -1,103 +1,3 @@
1-
//import org.jetbrains.compose.desktop.application.dsl.TargetFormat
2-
//
3-
//plugins {
4-
// alias(libs.plugins.kotlinMultiplatform)
5-
// alias(libs.plugins.jetbrainsCompose)
6-
// id("org.jetbrains.kotlin.plugin.serialization") version "1.9.0"
7-
// id ("org.openjfx.javafxplugin") version "0.0.13"
8-
//}
9-
//
10-
//repositories {
11-
// mavenCentral()
12-
// google()
13-
// maven("https://maven.pkg.jetbrains.space/public/p/compose/dev")
14-
// maven("https://jitpack.io")
15-
//}
16-
//
17-
//kotlin {
18-
// jvm("desktop") {
19-
// compilations.all {
20-
// kotlinOptions.jvmTarget = "17"
21-
// }
22-
// }
23-
//
24-
// sourceSets {
25-
// val desktopMain by getting {
26-
// dependencies {
27-
// implementation(compose.desktop.currentOs)
28-
// implementation("ch.qos.logback:logback-classic:1.4.11")
29-
// implementation("org.slf4j:slf4j-api:2.0.9")
30-
// implementation("io.ktor:ktor-client-core:2.3.7")
31-
// implementation("io.ktor:ktor-client-cio:2.3.7")
32-
// implementation("io.ktor:ktor-client-content-negotiation:2.3.7")
33-
// implementation("io.ktor:ktor-serialization-kotlinx-json:2.3.7")
34-
// implementation("org.jetbrains.kotlinx:kotlinx-serialization-json:1.6.0")
35-
// implementation("org.slf4j:slf4j-simple:2.0.9")
36-
// }
37-
// }
38-
// val koin_version = "4.0.3"
39-
//
40-
// commonMain.dependencies {
41-
// implementation(compose.runtime)
42-
// implementation(compose.foundation)
43-
// implementation(compose.material)
44-
// implementation(compose.ui)
45-
// implementation(compose.components.resources)
46-
// implementation(compose.components.uiToolingPreview)
47-
// implementation("com.darkrockstudios:mpfilepicker:3.1.0")
48-
//
49-
// // Koin
50-
// implementation(platform("io.insert-koin:koin-bom:$koin_version"))
51-
// implementation("io.insert-koin:koin-core")
52-
// implementation("io.insert-koin:koin-core-coroutines")
53-
// implementation("io.insert-koin:koin-compose")
54-
// implementation("io.insert-koin:koin-compose-viewmodel")
55-
// implementation("io.insert-koin:koin-logger-slf4j")
56-
//
57-
// // Ktor for HTTP requests
58-
// implementation("io.ktor:ktor-client-core:2.3.8")
59-
// implementation("io.ktor:ktor-client-cio:2.3.8")
60-
// implementation("io.ktor:ktor-client-content-negotiation:2.3.8")
61-
// implementation("io.ktor:ktor-serialization-kotlinx-json:2.3.8")
62-
//
63-
// // Kotlinx Serialization
64-
// implementation("org.jetbrains.kotlinx:kotlinx-serialization-json:1.6.0")
65-
//
66-
// api("io.github.qdsfdhvh:image-loader:1.7.8")
67-
// api("io.github.qdsfdhvh:image-loader-extension-moko-resources:1.7.8")
68-
// }
69-
// }
70-
//}
71-
//
72-
//compose.desktop {
73-
// application {
74-
// mainClass = "main.MainKt"
75-
// jvmArgs += listOf("-Xmx2G")
76-
// buildTypes {
77-
// release {
78-
// proguard {
79-
// configurationFiles.from("compose-desktop.pro")
80-
// }
81-
// }
82-
// }
83-
// nativeDistributions {
84-
// targetFormats(TargetFormat.Exe)
85-
// packageName = "RadioBrowser"
86-
// packageVersion = "1.0.1"
87-
// windows {
88-
// iconFile.set(project.file("src/commonMain/composeResources/drawable/icon.ico"))
89-
// }
90-
// }
91-
// }
92-
//}
93-
//
94-
//tasks.withType<org.jetbrains.kotlin.gradle.tasks.KotlinCompile> {
95-
// kotlinOptions {
96-
// jvmTarget = "17"
97-
// freeCompilerArgs = listOf("-Xjsr305=strict")
98-
// }
99-
//}
100-
1011
import org.jetbrains.compose.desktop.application.dsl.TargetFormat
1022

1033
plugins {
@@ -166,11 +66,13 @@ compose.desktop {
16666
windows {
16767
iconFile.set(project.file("src/commonMain/composeResources/drawable/icon.ico"))
16868
shortcut = true
69+
copyright ="Copyright 2025 Aria Danesh"
70+
description="A modern desktop application for browsing and streaming radio stations, built with Kotlin Multiplatform and Compose Desktop."
16971
}
17072
appResourcesRootDir.set(project.layout.projectDirectory.dir("resources"))
17173
includeAllModules = true
17274
packageName = "RadioBrowser"
173-
packageVersion = "1.0.3"
75+
packageVersion = "1.0.4"
17476
}
17577
}
17678
}

composeApp/config.data

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
{
2+
"playerPath": "C:\\Program Files (x86)\\K-Lite Codec Pack\\MPC-HC64\\mpc-hc64.exe"
3+
}

composeApp/src/desktopMain/kotlin/main/presentation/App.kt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ import main.presentation.compose.LoadingPage
2121
fun App() {
2222
val radioViewModel: RadioViewModel = koinInject()
2323
val playerViewModel: PlayerViewModel = koinInject()
24-
val playerState by playerViewModel.playerState.collectAsState()
24+
// val playerState by playerViewModel.playerState.collectAsState()
2525
var isSetupComplete by remember { mutableStateOf(false) }
2626

2727
MaterialTheme(

composeApp/src/desktopMain/kotlin/radio/presentation/compose/RadioList.kt

Lines changed: 50 additions & 36 deletions
Original file line numberDiff line numberDiff line change
@@ -2,11 +2,15 @@ package radio.presentation.compose
22

33
import androidx.compose.foundation.layout.*
44
import androidx.compose.foundation.lazy.LazyColumn
5+
import androidx.compose.foundation.lazy.grid.GridCells
6+
import androidx.compose.foundation.lazy.grid.LazyVerticalGrid
7+
import androidx.compose.foundation.lazy.grid.items
58
import androidx.compose.foundation.lazy.items
69
import androidx.compose.material.*
710
import androidx.compose.runtime.Composable
811
import androidx.compose.ui.Alignment
912
import androidx.compose.ui.Modifier
13+
import androidx.compose.ui.text.style.TextAlign
1014
import androidx.compose.ui.unit.dp
1115
import radio.data.api.RadioStation
1216

@@ -17,48 +21,58 @@ fun RadioList(
1721
error: String?,
1822
onPlayClick: (RadioStation) -> Unit
1923
) {
20-
Box(modifier = Modifier.fillMaxSize()) {
21-
when {
22-
isLoading -> {
23-
CircularProgressIndicator(
24-
modifier = Modifier.align(Alignment.Center)
25-
)
26-
}
27-
error != null -> {
28-
Column(
29-
modifier = Modifier
30-
.align(Alignment.Center)
31-
.padding(16.dp),
32-
horizontalAlignment = Alignment.CenterHorizontally
33-
) {
34-
Text(
35-
text = error,
36-
style = MaterialTheme.typography.body1,
37-
color = MaterialTheme.colors.error
24+
Column(Modifier.fillMaxSize(), Arrangement.Center,Alignment.CenterHorizontally) {
25+
Box(modifier = Modifier.fillMaxSize()) {
26+
27+
when {
28+
isLoading -> {
29+
CircularProgressIndicator(
30+
modifier = Modifier.align(Alignment.Center)
3831
)
3932
}
40-
}
41-
stations.isEmpty() -> {
42-
Text(
43-
text = "No stations found",
44-
modifier = Modifier.align(Alignment.Center),
45-
style = MaterialTheme.typography.body1
46-
)
47-
}
48-
else -> {
49-
LazyColumn(
50-
modifier = Modifier.fillMaxSize(),
51-
contentPadding = PaddingValues(8.dp),
52-
verticalArrangement = Arrangement.spacedBy(8.dp)
53-
) {
54-
items(stations) { station ->
55-
RadioItemView(
56-
station = station,
57-
onClick = { onPlayClick(station) }
33+
34+
error != null -> {
35+
Column(
36+
modifier = Modifier
37+
.align(Alignment.Center)
38+
.padding(16.dp),
39+
horizontalAlignment = Alignment.CenterHorizontally
40+
) {
41+
Text(
42+
text = error,
43+
style = MaterialTheme.typography.body1,
44+
color = MaterialTheme.colors.error
5845
)
5946
}
6047
}
48+
49+
stations.isEmpty() -> {
50+
Text(
51+
text = "No stations found",
52+
modifier = Modifier.align(Alignment.Center),
53+
style = MaterialTheme.typography.body1
54+
)
55+
}
56+
57+
else -> {
58+
LazyVerticalGrid(
59+
columns = GridCells.FixedSize(200.dp),
60+
modifier = Modifier.fillMaxSize(),
61+
contentPadding = PaddingValues(8.dp),
62+
// verticalArrangement = Arrangement.spacedBy(8.dp)
63+
) {
64+
items(stations) { station ->
65+
RadioItemView(
66+
station = station,
67+
onClick = { onPlayClick(station) }
68+
)
69+
}
70+
}
71+
}
6172
}
6273
}
74+
Spacer(Modifier.height(16.dp))
75+
Text("Created with ❤\uFE0F by Aria Danesh",Modifier.wrapContentSize(),textAlign = TextAlign.Center, style = MaterialTheme.typography.body1,color = MaterialTheme.colors.onBackground)
76+
Spacer(Modifier.height(16.dp))
6377
}
6478
}

0 commit comments

Comments
 (0)