Skip to content
This repository was archived by the owner on Mar 16, 2025. It is now read-only.

Commit cc837bc

Browse files
committed
- Added more spotDL dependencies and added largeHeap property to the app
- Disabled spotDL updates
1 parent 6e46bad commit cc837bc

File tree

8 files changed

+103
-44
lines changed

8 files changed

+103
-44
lines changed

.idea/compiler.xml

Lines changed: 5 additions & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

app/build.gradle.kts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@ sealed class Version(
4444
val currentVersion: Version = Version.Stable(
4545
versionMajor = 1,
4646
versionMinor = 3,
47-
versionPatch = 1,
47+
versionPatch = 3,
4848
)
4949

5050
val keystorePropertiesFile = rootProject.file("keystore.properties")

app/src/main/AndroidManifest.xml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -37,8 +37,8 @@
3737
android:localeConfig="@xml/locales_config"
3838
android:requestLegacyExternalStorage="true"
3939
android:supportsRtl="true"
40-
tools:targetApi="tiramisu">
41-
<!-- android:largeHeap="true" -->
40+
tools:targetApi="tiramisu"
41+
android:largeHeap="true">
4242

4343
<activity
4444
android:name=".MainActivity"
Lines changed: 66 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,66 @@
1+
package com.bobbyesp.spowlo.ui.components
2+
3+
import androidx.compose.foundation.layout.Column
4+
import androidx.compose.foundation.layout.Row
5+
import androidx.compose.foundation.layout.fillMaxWidth
6+
import androidx.compose.foundation.layout.padding
7+
import androidx.compose.material.icons.Icons
8+
import androidx.compose.material.icons.filled.WarningAmber
9+
import androidx.compose.material3.CardDefaults
10+
import androidx.compose.material3.Icon
11+
import androidx.compose.material3.MaterialTheme
12+
import androidx.compose.material3.OutlinedCard
13+
import androidx.compose.material3.Text
14+
import androidx.compose.runtime.Composable
15+
import androidx.compose.ui.Alignment
16+
import androidx.compose.ui.Modifier
17+
import androidx.compose.ui.text.font.FontWeight
18+
import androidx.compose.ui.text.style.TextAlign
19+
import androidx.compose.ui.unit.dp
20+
21+
@Composable
22+
fun WarningCard(
23+
modifier: Modifier = Modifier,
24+
title: String,
25+
warningText : String,
26+
) {
27+
OutlinedCard(
28+
modifier = modifier,
29+
shape = MaterialTheme.shapes.small,
30+
colors = CardDefaults.outlinedCardColors(
31+
containerColor = MaterialTheme.colorScheme.primaryContainer,
32+
)
33+
) {
34+
Row(
35+
modifier = Modifier
36+
.fillMaxWidth(),
37+
verticalAlignment = Alignment.CenterVertically,
38+
) {
39+
Icon(
40+
modifier = Modifier.weight(0.175f),
41+
imageVector = Icons.Default.WarningAmber,
42+
tint = MaterialTheme.colorScheme.onPrimaryContainer,
43+
contentDescription = "Warning icon"
44+
)
45+
Column(
46+
modifier = Modifier
47+
.fillMaxWidth()
48+
.padding(6.dp)
49+
.weight(1f),
50+
) {
51+
Text(
52+
text = title,
53+
style = MaterialTheme.typography.bodyLarge,
54+
fontWeight = FontWeight.Bold
55+
)
56+
Text(
57+
text = warningText,
58+
style = MaterialTheme.typography.bodySmall,
59+
color = MaterialTheme.colorScheme.onPrimaryContainer.copy(alpha = 0.6f),
60+
fontWeight = FontWeight.Normal,
61+
textAlign = TextAlign.Justify
62+
)
63+
}
64+
}
65+
}
66+
}

app/src/main/java/com/bobbyesp/spowlo/ui/pages/InitialEntry.kt

Lines changed: 14 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,6 @@ import androidx.navigation.navArgument
5555
import androidx.navigation.navDeepLink
5656
import androidx.navigation.navOptions
5757
import androidx.navigation.navigation
58-
import com.bobbyesp.library.SpotDL
5958
import com.bobbyesp.spowlo.App
6059
import com.bobbyesp.spowlo.MainActivity
6160
import com.bobbyesp.spowlo.R
@@ -100,8 +99,6 @@ import com.bobbyesp.spowlo.ui.pages.settings.general.GeneralSettingsPage
10099
import com.bobbyesp.spowlo.ui.pages.settings.spotify.SpotifySettingsPage
101100
import com.bobbyesp.spowlo.ui.pages.settings.updater.UpdaterPage
102101
import com.bobbyesp.spowlo.utils.PreferencesUtil
103-
import com.bobbyesp.spowlo.utils.PreferencesUtil.getString
104-
import com.bobbyesp.spowlo.utils.SPOTDL
105102
import com.bobbyesp.spowlo.utils.ToastUtil
106103
import com.bobbyesp.spowlo.utils.UpdateUtil
107104
import com.google.accompanist.navigation.animation.AnimatedNavHost
@@ -116,7 +113,6 @@ import com.google.accompanist.permissions.rememberPermissionState
116113
import kotlinx.coroutines.Dispatchers
117114
import kotlinx.coroutines.Job
118115
import kotlinx.coroutines.launch
119-
import kotlinx.coroutines.withContext
120116

121117
private const val TAG = "InitialEntry"
122118

@@ -623,20 +619,20 @@ fun InitialEntry(
623619
}
624620
}
625621

626-
LaunchedEffect(Unit) {
627-
if (SPOTDL.getString().isNotEmpty()) return@LaunchedEffect
628-
kotlin.runCatching {
629-
withContext(Dispatchers.IO) {
630-
val result = UpdateUtil.updateSpotDL()
631-
if (result == SpotDL.UpdateStatus.DONE) {
632-
ToastUtil.makeToastSuspend(
633-
App.context.getString(R.string.spotdl_update_success)
634-
.format(SPOTDL.getString())
635-
)
636-
}
637-
}
638-
}
639-
}
622+
// LaunchedEffect(Unit) {
623+
// if (SPOTDL.getString().isNotEmpty()) return@LaunchedEffect
624+
// kotlin.runCatching {
625+
// withContext(Dispatchers.IO) {
626+
// val result = UpdateUtil.updateSpotDL()
627+
// if (result == SpotDL.UpdateStatus.DONE) {
628+
// ToastUtil.makeToastSuspend(
629+
// App.context.getString(R.string.spotdl_update_success)
630+
// .format(SPOTDL.getString())
631+
// )
632+
// }
633+
// }
634+
// }
635+
// }
640636

641637
if (showUpdateDialog) {
642638
UpdaterBottomDrawer(latestRelease = latestRelease)

app/src/main/java/com/bobbyesp/spowlo/ui/pages/settings/general/GeneralSettingsPage.kt

Lines changed: 12 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -38,6 +38,7 @@ import com.bobbyesp.spowlo.ui.common.booleanState
3838
import com.bobbyesp.spowlo.ui.components.BackButton
3939
import com.bobbyesp.spowlo.ui.components.LargeTopAppBar
4040
import com.bobbyesp.spowlo.ui.components.PreferenceSubtitle
41+
import com.bobbyesp.spowlo.ui.components.WarningCard
4142
import com.bobbyesp.spowlo.ui.components.settings.ElevatedSettingsCard
4243
import com.bobbyesp.spowlo.ui.components.settings.SettingsItemNew
4344
import com.bobbyesp.spowlo.ui.components.settings.SettingsSwitch
@@ -46,10 +47,6 @@ import com.bobbyesp.spowlo.utils.CONFIGURE
4647
import com.bobbyesp.spowlo.utils.DEBUG
4748
import com.bobbyesp.spowlo.utils.NOTIFICATION
4849
import com.bobbyesp.spowlo.utils.PreferencesUtil
49-
import com.bobbyesp.spowlo.utils.PreferencesUtil.getString
50-
import com.bobbyesp.spowlo.utils.SPOTDL
51-
import com.bobbyesp.spowlo.utils.ToastUtil
52-
import com.bobbyesp.spowlo.utils.UpdateUtil
5350
import kotlinx.coroutines.DelicateCoroutinesApi
5451
import kotlinx.coroutines.Dispatchers
5552
import kotlinx.coroutines.GlobalScope
@@ -126,33 +123,27 @@ fun GeneralSettingsPage(
126123
.padding(it)
127124
.padding(horizontal = 20.dp, vertical = 10.dp)
128125
) {
126+
item {
127+
WarningCard(
128+
modifier = Modifier.padding(vertical = 10.dp),
129+
title = stringResource(id = R.string.updates_blocked),
130+
warningText = stringResource(
131+
id = R.string.updates_blocked_description
132+
)
133+
)
134+
}
129135
item {
130136
ElevatedSettingsCard {
131137
SettingsItemNew(
132-
onClick = {
133-
scope.launch {
134-
runCatching {
135-
isUpdatingLib = true
136-
UpdateUtil.updateSpotDL()
137-
spotDLVersion = SPOTDL.getString()
138-
}.onFailure {
139-
ToastUtil.makeToastSuspend(App.context.getString(R.string.spotdl_update_failed))
140-
}.onSuccess {
141-
ToastUtil.makeToastSuspend(
142-
App.context.getString(R.string.spotdl_update_success)
143-
.format(spotDLVersion)
144-
)
145-
}
146-
}
147-
},
148138
title = {
149139
Text(
150140
text = stringResource(id = R.string.spotdl_version),
151141
fontWeight = FontWeight.Bold
152142
)
153143
},
154144
icon = Icons.Outlined.Info,
155-
description = { Text(text = spotDLVersion) })
145+
description = { Text(text = spotDLVersion) }
146+
)
156147

157148
SettingsSwitch(
158149
onCheckedChange = {

app/src/main/res/values/strings.xml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -327,4 +327,6 @@
327327
<string name="metadata_viewer">Metadata viewer</string>
328328
<string name="albums">Albums</string>
329329
<string name="see_album">See album</string>
330+
<string name="updates_blocked">SpotDL updates blocked</string>
331+
<string name="updates_blocked_description">We have blocked the SpotDL updates. This is because we can be focused on the next version of Spowlo, the 2.0.0 (will come with big changes)!</string>
330332
</resources>

gradle/libs.versions.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ androidxHiltNavigationCompose = "1.0.0"
2121

2222
androidxTestExt = "1.1.5"
2323

24-
spotdlAndroidVersion = "0.1.10"
24+
spotdlAndroidVersion = "4e49ca9ba5"
2525
spotifyApiKotlinVersion = "3.8.8"
2626

2727
shimmerLibrary = "1.0.4"

0 commit comments

Comments
 (0)