diff --git a/android/.gitignore b/android/.gitignore index 6f568019..be3943c9 100644 --- a/android/.gitignore +++ b/android/.gitignore @@ -5,9 +5,10 @@ gradle-wrapper.jar /gradlew.bat /local.properties GeneratedPluginRegistrant.java +.cxx/ # Remember to never publicly share your keystore. -# See https://flutter.dev/docs/deployment/android#reference-the-keystore-from-the-app +# See https://flutter.dev/to/reference-keystore key.properties **/*.keystore **/*.jks diff --git a/android/app/build.gradle b/android/app/build.gradle deleted file mode 100644 index 5051f5a3..00000000 --- a/android/app/build.gradle +++ /dev/null @@ -1,139 +0,0 @@ -plugins { - id "com.android.application" - id "kotlin-android" - id "dev.flutter.flutter-gradle-plugin" -} - -def localProperties = new Properties() -def localPropertiesFile = rootProject.file('local.properties') -if (localPropertiesFile.exists()) { - localPropertiesFile.withReader('UTF-8') { reader -> - localProperties.load(reader) - } -} - -def flutterVersionCode = localProperties.getProperty('flutter.versionCode') -if (flutterVersionCode == null) { - flutterVersionCode = '1' -} - -def flutterVersionName = localProperties.getProperty('flutter.versionName') -if (flutterVersionName == null) { - flutterVersionName = '1.0' -} - -def keystoreProperties = new Properties() -def keystorePropertiesFile = rootProject.file('key.properties') -if (keystorePropertiesFile.exists()) { - keystoreProperties.load(new FileInputStream(keystorePropertiesFile)) -} - -def composeVersion = "1.4.8" - -android { - namespace "oss.krtirtho.spotube" - - compileSdkVersion 35 - - ndkVersion = "27.0.12077973" - - compileOptions { - coreLibraryDesugaringEnabled true - sourceCompatibility JavaVersion.VERSION_1_8 - targetCompatibility JavaVersion.VERSION_1_8 - } - - kotlinOptions { - jvmTarget = '1.8' - } - - sourceSets { - main.java.srcDirs += 'src/main/kotlin' - } - - buildFeatures { - compose true - } - - composeOptions { - kotlinCompilerExtensionVersion "$composeVersion" // Correlates with org.jetbrains.kotlin.android plugin in settings.gradle - } - - defaultConfig { - applicationId "oss.krtirtho.spotube" - minSdkVersion 24 - targetSdkVersion 35 - versionCode flutterVersionCode.toInteger() - versionName flutterVersionName - multiDexEnabled true - } - - signingConfigs { - release { - keyAlias keystoreProperties['keyAlias'] - keyPassword keystoreProperties['keyPassword'] - storeFile keystoreProperties['storeFile'] ? file(keystoreProperties['storeFile']) : null - storePassword keystoreProperties['storePassword'] - } - } - - buildTypes { - release { - signingConfig signingConfigs.release - } - debug { - signingConfig signingConfigs.release - } - } - - flavorDimensions "default" - - productFlavors { - nightly { - dimension "default" - resValue "string", "app_name_en", "Spotube Nightly" - applicationIdSuffix ".nightly" - versionNameSuffix "-nightly" - signingConfig signingConfigs.release - } - dev { - dimension "default" - resValue "string", "app_name_en", "Spotube Dev" - applicationIdSuffix ".dev" - versionNameSuffix "-dev" - signingConfig signingConfigs.release - } - stable { - dimension "default" - resValue "string", "app_name_en", "Spotube" - signingConfig signingConfigs.release - } - } - - packagingOptions { - resources.excludes += "DebugProbesKt.bin" - } -} - -flutter { - source '../..' -} - -def glanceVersion = "1.1.1" -dependencies { - coreLibraryDesugaring 'com.android.tools:desugar_jdk_libs:2.1.4' - - implementation 'androidx.lifecycle:lifecycle-viewmodel-ktx:2.5.1' - // other deps so just ignore - implementation 'com.android.support:multidex:2.0.1' - - implementation "androidx.glance:glance-appwidget:$glanceVersion" - implementation "androidx.glance:glance-appwidget-preview:$glanceVersion" - implementation "androidx.glance:glance-preview:$glanceVersion" - implementation "androidx.glance:glance-material3:$glanceVersion" - implementation "androidx.glance:glance-material:$glanceVersion" - implementation "androidx.work:work-runtime-ktx:2.8.1" - - implementation "org.jetbrains.kotlinx:kotlinx-serialization-json:1.7.3" - implementation 'com.google.code.gson:gson:2.11.0' -} \ No newline at end of file diff --git a/android/app/build.gradle.kts b/android/app/build.gradle.kts new file mode 100644 index 00000000..51a28ff1 --- /dev/null +++ b/android/app/build.gradle.kts @@ -0,0 +1,44 @@ +plugins { + id("com.android.application") + id("kotlin-android") + // The Flutter Gradle Plugin must be applied after the Android and Kotlin Gradle plugins. + id("dev.flutter.flutter-gradle-plugin") +} + +android { + namespace = "com.example.spotube" + compileSdk = flutter.compileSdkVersion + ndkVersion = flutter.ndkVersion + + compileOptions { + sourceCompatibility = JavaVersion.VERSION_11 + targetCompatibility = JavaVersion.VERSION_11 + } + + kotlinOptions { + jvmTarget = JavaVersion.VERSION_11.toString() + } + + defaultConfig { + // TODO: Specify your own unique Application ID (https://developer.android.com/studio/build/application-id.html). + applicationId = "com.example.spotube" + // You can update the following values to match your application needs. + // For more information, see: https://flutter.dev/to/review-gradle-config. + minSdk = flutter.minSdkVersion + targetSdk = flutter.targetSdkVersion + versionCode = flutter.versionCode + versionName = flutter.versionName + } + + buildTypes { + release { + // TODO: Add your own signing config for the release build. + // Signing with the debug keys for now, so `flutter run --release` works. + signingConfig = signingConfigs.getByName("debug") + } + } +} + +flutter { + source = "../.." +} diff --git a/android/app/proguard-rules.pro b/android/app/proguard-rules.pro deleted file mode 100644 index 700901e8..00000000 --- a/android/app/proguard-rules.pro +++ /dev/null @@ -1,21 +0,0 @@ --keep class androidx.lifecycle.DefaultLifecycleObserver - --keepnames class kotlinx.serialization.** { *; } --keepnames class oss.krtirtho.spotube.glance.models.** { *; } --keep @kotlinx.serialization.Serializable class * --keepclassmembers class ** { - @kotlinx.serialization.* ; -} - -## We don't need beans --dontwarn java.beans.BeanDescriptor --dontwarn java.beans.BeanInfo --dontwarn java.beans.IntrospectionException --dontwarn java.beans.Introspector --dontwarn java.beans.PropertyDescriptor - -## Rules for NewPipeExtractor --keep class org.schabi.newpipe.extractor.timeago.patterns.** { *; } --keep class org.mozilla.javascript.** { *; } --keep class org.mozilla.classfile.ClassFileWriter --dontwarn org.mozilla.javascript.tools.** \ No newline at end of file diff --git a/android/app/src/debug/AndroidManifest.xml b/android/app/src/debug/AndroidManifest.xml index a32d12af..399f6981 100644 --- a/android/app/src/debug/AndroidManifest.xml +++ b/android/app/src/debug/AndroidManifest.xml @@ -1,6 +1,7 @@ - - - \ No newline at end of file + + diff --git a/android/app/src/main/AndroidManifest.xml b/android/app/src/main/AndroidManifest.xml index 0effefe2..675244a1 100644 --- a/android/app/src/main/AndroidManifest.xml +++ b/android/app/src/main/AndroidManifest.xml @@ -1,141 +1,45 @@ + + + + + + + + + + + + + - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - \ No newline at end of file + In particular, this is used by the Flutter engine in io.flutter.plugin.text.ProcessTextPlugin. --> + + + + + + + diff --git a/android/app/src/main/java/io/flutter/app/FlutterMultiDexApplication.java b/android/app/src/main/java/io/flutter/app/FlutterMultiDexApplication.java deleted file mode 100644 index 752fc185..00000000 --- a/android/app/src/main/java/io/flutter/app/FlutterMultiDexApplication.java +++ /dev/null @@ -1,25 +0,0 @@ -// Generated file. -// -// If you wish to remove Flutter's multidex support, delete this entire file. -// -// Modifications to this file should be done in a copy under a different name -// as this file may be regenerated. - -package io.flutter.app; - -import android.app.Application; -import android.content.Context; -import androidx.annotation.CallSuper; -import androidx.multidex.MultiDex; - -/** - * Extension of {@link android.app.Application}, adding multidex support. - */ -public class FlutterMultiDexApplication extends Application { - @Override - @CallSuper - protected void attachBaseContext(Context base) { - super.attachBaseContext(base); - MultiDex.install(this); - } -} diff --git a/android/app/src/main/kotlin/com/example/spotube/MainActivity.kt b/android/app/src/main/kotlin/com/example/spotube/MainActivity.kt new file mode 100644 index 00000000..d593b415 --- /dev/null +++ b/android/app/src/main/kotlin/com/example/spotube/MainActivity.kt @@ -0,0 +1,5 @@ +package com.example.spotube + +import io.flutter.embedding.android.FlutterActivity + +class MainActivity : FlutterActivity() diff --git a/android/app/src/main/kotlin/oss/krtirtho/spotube/MainActivity.kt b/android/app/src/main/kotlin/oss/krtirtho/spotube/MainActivity.kt deleted file mode 100644 index 90debb71..00000000 --- a/android/app/src/main/kotlin/oss/krtirtho/spotube/MainActivity.kt +++ /dev/null @@ -1,6 +0,0 @@ -package oss.krtirtho.spotube - -import io.flutter.embedding.android.FlutterActivity - -class MainActivity: FlutterActivity() { -} diff --git a/android/app/src/main/kotlin/oss/krtirtho/spotube/glance/HomePlayerWidget.kt b/android/app/src/main/kotlin/oss/krtirtho/spotube/glance/HomePlayerWidget.kt deleted file mode 100644 index a20af959..00000000 --- a/android/app/src/main/kotlin/oss/krtirtho/spotube/glance/HomePlayerWidget.kt +++ /dev/null @@ -1,207 +0,0 @@ -package oss.krtirtho.spotube.glance - -import HomeWidgetGlanceState -import HomeWidgetGlanceStateDefinition -import android.R -import android.content.Context -import android.graphics.drawable.Icon -import android.net.Uri -import android.util.Log -import androidx.compose.runtime.Composable -import androidx.compose.ui.unit.DpSize -import androidx.compose.ui.unit.dp -import androidx.glance.GlanceId -import androidx.glance.GlanceModifier -import androidx.glance.GlanceTheme -import androidx.glance.Image -import androidx.glance.ImageProvider -import androidx.glance.LocalSize -import androidx.glance.action.ActionParameters -import androidx.glance.action.actionParametersOf -import androidx.glance.action.clickable -import androidx.glance.background -import androidx.glance.appwidget.GlanceAppWidget -import androidx.glance.appwidget.SizeMode -import androidx.glance.appwidget.action.ActionCallback -import androidx.glance.appwidget.action.actionRunCallback -import androidx.glance.appwidget.background -import androidx.glance.appwidget.components.CircleIconButton -import androidx.glance.appwidget.components.Scaffold -import androidx.glance.appwidget.cornerRadius -import androidx.glance.appwidget.provideContent -import androidx.glance.background -import androidx.glance.currentState -import androidx.glance.layout.Alignment -import androidx.glance.layout.Box -import androidx.glance.layout.Column -import androidx.glance.layout.ContentScale -import androidx.glance.layout.Row -import androidx.glance.layout.Spacer -import androidx.glance.layout.fillMaxSize -import androidx.glance.layout.fillMaxWidth -import androidx.glance.layout.padding -import androidx.glance.layout.size -import androidx.glance.preview.ExperimentalGlancePreviewApi -import androidx.glance.preview.Preview -import androidx.glance.state.GlanceStateDefinition -import com.google.gson.Gson -import es.antonborri.home_widget.HomeWidgetBackgroundIntent -import es.antonborri.home_widget.actionStartActivity -import oss.krtirtho.spotube.MainActivity -import oss.krtirtho.spotube.glance.models.Track -import oss.krtirtho.spotube.glance.widgets.FlutterAssetImageProvider -import oss.krtirtho.spotube.glance.widgets.TrackDetailsView -import oss.krtirtho.spotube.glance.widgets.TrackProgress - -val gson = Gson() -val serverAddressKey = ActionParameters.Key("serverAddress") - -class Breakpoints { - companion object { - val SMALL_SQUARE = DpSize(100.dp, 100.dp) - val HORIZONTAL_RECTANGLE = DpSize(250.dp, 100.dp) - val BIG_SQUARE = DpSize(250.dp, 250.dp) - } -} - -class HomePlayerWidget : GlanceAppWidget() { - - override val sizeMode = SizeMode.Responsive( - setOf( - Breakpoints.SMALL_SQUARE, - Breakpoints.HORIZONTAL_RECTANGLE, - Breakpoints.BIG_SQUARE - ) - ) - - override val stateDefinition: GlanceStateDefinition<*>? - get() = HomeWidgetGlanceStateDefinition() - - override suspend fun provideGlance(context: Context, id: GlanceId) { - provideContent { - GlanceContent(context, currentState()) - } - } - - - @OptIn(ExperimentalGlancePreviewApi::class) - @Preview(widthDp = 100, heightDp = 100) - @Composable - private fun GlanceContent(context: Context, currentState: HomeWidgetGlanceState) { - val prefs = currentState.preferences - val size = LocalSize.current - - val activeTrackStr = prefs.getString("activeTrack", null) - - val isPlaying = prefs.getBoolean("isPlaying", false) - val playbackServerAddress = prefs.getString("playbackServerAddress", null) ?: "" - - var activeTrack: Track? = null - if (activeTrackStr != null) { - activeTrack = gson.fromJson(activeTrackStr, Track::class.java) - } - - - val playIcon = Icon.createWithResource(context, R.drawable.ic_media_play); - val pauseIcon = Icon.createWithResource(context, R.drawable.ic_media_pause); - val previousIcon = Icon.createWithResource(context, R.drawable.ic_media_previous); - val nextIcon = Icon.createWithResource(context, R.drawable.ic_media_next); - - GlanceTheme { - Box( - modifier = GlanceModifier - .fillMaxSize() - .cornerRadius(8.dp) - .background( - color = GlanceTheme.colors.surface.getColor(context) - ) - .clickable { - actionStartActivity(context) - } - , - ) { - Box( - modifier = GlanceModifier - .background( - color = - GlanceTheme.colors.surface.getColor(context) - .copy(alpha = 0.5f), - ) - .fillMaxSize(), - ) {} - Column( - modifier = GlanceModifier.padding(top = 10.dp, start = 10.dp, end = 10.dp) - ) { - Row(verticalAlignment = Alignment.Vertical.CenterVertically) { - TrackDetailsView(activeTrack) - } - Spacer(modifier = GlanceModifier.size(6.dp)) - if (size != Breakpoints.SMALL_SQUARE) { - TrackProgress(prefs) - } - Spacer(modifier = GlanceModifier.size(6.dp)) - Row( - modifier = GlanceModifier.fillMaxWidth(), - horizontalAlignment = Alignment.Horizontal.CenterHorizontally - ) { - CircleIconButton( - imageProvider = ImageProvider(previousIcon), - contentDescription = "Previous", - onClick = actionRunCallback( - parameters = actionParametersOf(serverAddressKey to playbackServerAddress) - ) - ) - Spacer(modifier = GlanceModifier.size(6.dp)) - CircleIconButton( - imageProvider = - if (isPlaying) ImageProvider(pauseIcon) - else ImageProvider(playIcon), - contentDescription = "Play/Pause", - onClick = actionRunCallback( - parameters = actionParametersOf(serverAddressKey to playbackServerAddress) - ) - ) - Spacer(modifier = GlanceModifier.size(6.dp)) - CircleIconButton( - imageProvider = ImageProvider(nextIcon), - contentDescription = "Previous", - onClick = actionRunCallback( - parameters = actionParametersOf( - serverAddressKey to playbackServerAddress - ) - ) - ) - } - } - } - } - } -} - -class PlayPauseAction : InteractiveAction("toggle-playback") -class NextAction : InteractiveAction("next") -class PreviousAction : InteractiveAction("previous") - - -abstract class InteractiveAction(val command: String) : ActionCallback { - override suspend fun onAction( - context: Context, - glanceId: GlanceId, - parameters: ActionParameters - ) { - val serverAddress = parameters[serverAddressKey] ?: "" - - Log.d("HomePlayerWidget", "Sending command $command to $serverAddress") - - if (serverAddress == null || serverAddress.isEmpty()) { - return - } - - - val backgroundIntent = HomeWidgetBackgroundIntent.getBroadcast( - context, - Uri.parse("spotube://playback/$command?serverAddress=$serverAddress") - ) - backgroundIntent.send() - } -} diff --git a/android/app/src/main/kotlin/oss/krtirtho/spotube/glance/HomePlayerWidgetReceiver.kt b/android/app/src/main/kotlin/oss/krtirtho/spotube/glance/HomePlayerWidgetReceiver.kt deleted file mode 100644 index 2d23c64f..00000000 --- a/android/app/src/main/kotlin/oss/krtirtho/spotube/glance/HomePlayerWidgetReceiver.kt +++ /dev/null @@ -1,7 +0,0 @@ -package oss.krtirtho.spotube.glance - -import HomeWidgetGlanceWidgetReceiver - -class HomePlayerWidgetReceiver : HomeWidgetGlanceWidgetReceiver() { - override val glanceAppWidget = HomePlayerWidget() -} diff --git a/android/app/src/main/kotlin/oss/krtirtho/spotube/glance/models/AlbumSimple.kt b/android/app/src/main/kotlin/oss/krtirtho/spotube/glance/models/AlbumSimple.kt deleted file mode 100644 index 4edd69f6..00000000 --- a/android/app/src/main/kotlin/oss/krtirtho/spotube/glance/models/AlbumSimple.kt +++ /dev/null @@ -1,40 +0,0 @@ -package oss.krtirtho.spotube.glance.models - -import com.google.gson.annotations.SerializedName -import kotlinx.serialization.Serializable - -@Serializable -data class AlbumSimple( - @SerializedName("album_type") - val albumType: AlbumType?, - - @SerializedName("available_markets") - val availableMarkets: List?, - - val href: String?, - val id: String?, - val images: List?, - val name: String?, - - @SerializedName("release_date") - val releaseDate: String?, - - @SerializedName("release_date_precision") - val releaseDatePrecision: DatePrecision?, - - val type: String?, - val uri: String?, -) - -@Serializable -enum class AlbumType { - album, - single, - compilation -} - -enum class DatePrecision { - year, - month, - day -} \ No newline at end of file diff --git a/android/app/src/main/kotlin/oss/krtirtho/spotube/glance/models/Artist.kt b/android/app/src/main/kotlin/oss/krtirtho/spotube/glance/models/Artist.kt deleted file mode 100644 index ef43ecc8..00000000 --- a/android/app/src/main/kotlin/oss/krtirtho/spotube/glance/models/Artist.kt +++ /dev/null @@ -1,25 +0,0 @@ -package oss.krtirtho.spotube.glance.models - -import com.google.gson.annotations.SerializedName -import kotlinx.serialization.Serializable - -@Serializable -data class Artist( - val href: String?, - val id: String?, - val name: String?, - val type: String?, - val uri: String?, - - val followers: Followers?, - val genres: List?, - val images: List?, - - @SerializedName("popularity") - val popularity: Int? -) - -@Serializable -data class Followers( - val total: Int? -) diff --git a/android/app/src/main/kotlin/oss/krtirtho/spotube/glance/models/Image.kt b/android/app/src/main/kotlin/oss/krtirtho/spotube/glance/models/Image.kt deleted file mode 100644 index de7d5521..00000000 --- a/android/app/src/main/kotlin/oss/krtirtho/spotube/glance/models/Image.kt +++ /dev/null @@ -1,10 +0,0 @@ -package oss.krtirtho.spotube.glance.models - -import kotlinx.serialization.Serializable - -@Serializable -data class Image( - val height: Int?, - val width: Int?, - val path: String, -) \ No newline at end of file diff --git a/android/app/src/main/kotlin/oss/krtirtho/spotube/glance/models/Track.kt b/android/app/src/main/kotlin/oss/krtirtho/spotube/glance/models/Track.kt deleted file mode 100644 index 717b790f..00000000 --- a/android/app/src/main/kotlin/oss/krtirtho/spotube/glance/models/Track.kt +++ /dev/null @@ -1,37 +0,0 @@ -package oss.krtirtho.spotube.glance.models - -import com.google.gson.annotations.SerializedName -import kotlinx.serialization.Serializable -import kotlin.time.Duration.Companion.milliseconds - -@Serializable -data class Track( - val album: AlbumSimple?, val artists: List?, - - @SerializedName("available_markets") val availableMarkets: List?, - - @SerializedName("disc_number") val discNumber: Int?, - - @SerializedName("duration_ms") val durationMs: Int, - - val explicit: Boolean?, val href: String?, val id: String?, - - @SerializedName("is_playable") val isPlayable: Boolean?, - - val name: String?, - - @SerializedName("popularity") val popularity: Int?, - - @SerializedName("preview_url") val previewUrl: String?, - - @SerializedName("track_number") val trackNumber: Int?, - - val type: String?, val uri: String? -) { - val duration: kotlin.time.Duration - get() = durationMs.toLong().milliseconds -} - -enum class Market { - AD, AE, AF, AG, AI, AL, AM, AO, AQ, AR, AS, AT, AU, AW, AX, AZ, BA, BB, BD, BE, BF, BG, BH, BI, BJ, BL, BM, BN, BO, BQ, BR, BS, BT, BV, BW, BY, BZ, CA, CC, CD, CF, CG, CH, CI, CK, CL, CM, CN, CO, CR, CU, CV, CW, CX, CY, CZ, DE, DJ, DK, DM, DO, DZ, EC, EE, EG, EH, ER, ES, ET, FI, FJ, FK, FM, FO, FR, GA, GB, GD, GE, GF, GG, GH, GI, GL, GM, GN, GP, GQ, GR, GS, GT, GU, GW, GY, HK, HM, HN, HR, HT, HU, ID, IE, IL, IM, IN, IO, IQ, IR, IS, IT, JE, JM, JO, JP, KE, KG, KH, KI, KM, KN, KP, KR, KW, KY, KZ, LA, LB, LC, LI, LK, LR, LS, LT, LU, LV, LY, MA, MC, MD, ME, MF, MG, MH, MK, ML, MM, MN, MO, MP, MQ, MR, MS, MT, MU, MV, MW, MX, MY, MZ, NA, NC, NE, NF, NG, NI, NL, NO, NP, NR, NU, NZ, OM, PA, PE, PF, PG, PH, PK, PL, PM, PN, PR, PS, PT, PW, PY, QA, RE, RO, RS, RU, RW, SA, SB, SC, SD, SE, SG, SH, SI, SJ, SK, SL, SM, SN, SO, SR, SS, ST, SV, SX, SY, SZ, TC, TD, TF, TG, TH, TJ, TK, TL, TM, TN, TO, TR, TT, TV, TW, TZ, UA, UG, UM, US, UY, UZ, VA, VC, VE, VG, VI, VN, VU, WF, WS, XK, YE, YT, ZA, ZM, ZW, -} diff --git a/android/app/src/main/kotlin/oss/krtirtho/spotube/glance/widgets/Base64ImageProvider.kt b/android/app/src/main/kotlin/oss/krtirtho/spotube/glance/widgets/Base64ImageProvider.kt deleted file mode 100644 index 79339cea..00000000 --- a/android/app/src/main/kotlin/oss/krtirtho/spotube/glance/widgets/Base64ImageProvider.kt +++ /dev/null @@ -1,14 +0,0 @@ -package oss.krtirtho.spotube.glance.widgets - -import android.graphics.BitmapFactory -import android.util.Base64 -import androidx.glance.ImageProvider - -@Suppress("FunctionName") -fun Base64ImageProvider(base64: String): ImageProvider { - var bytes = Base64.decode(base64, Base64.DEFAULT); - - var bitmap = BitmapFactory.decodeByteArray(bytes, 0, bytes.size); - - return ImageProvider(bitmap) -} \ No newline at end of file diff --git a/android/app/src/main/kotlin/oss/krtirtho/spotube/glance/widgets/FlutterAssetImageProvider.kt b/android/app/src/main/kotlin/oss/krtirtho/spotube/glance/widgets/FlutterAssetImageProvider.kt deleted file mode 100644 index ad51ca3c..00000000 --- a/android/app/src/main/kotlin/oss/krtirtho/spotube/glance/widgets/FlutterAssetImageProvider.kt +++ /dev/null @@ -1,14 +0,0 @@ -package oss.krtirtho.spotube.glance.widgets - -import android.content.Context -import android.graphics.BitmapFactory -import androidx.glance.ImageProvider - -@Suppress("FunctionName") -fun FlutterAssetImageProvider(context: Context, path: String): ImageProvider { - var inputStream = context.assets.open("flutter_assets/$path") - - return ImageProvider( - BitmapFactory.decodeStream(inputStream) - ) -} \ No newline at end of file diff --git a/android/app/src/main/kotlin/oss/krtirtho/spotube/glance/widgets/TrackDetailsView.kt b/android/app/src/main/kotlin/oss/krtirtho/spotube/glance/widgets/TrackDetailsView.kt deleted file mode 100644 index fdfe8e4b..00000000 --- a/android/app/src/main/kotlin/oss/krtirtho/spotube/glance/widgets/TrackDetailsView.kt +++ /dev/null @@ -1,78 +0,0 @@ -package oss.krtirtho.spotube.glance.widgets - -import android.graphics.BitmapFactory -import android.net.Uri -import android.util.Log -import androidx.compose.runtime.Composable -import androidx.compose.ui.unit.dp -import androidx.compose.ui.unit.sp -import androidx.glance.GlanceModifier -import androidx.glance.GlanceTheme -import androidx.glance.Image -import androidx.glance.ImageProvider -import androidx.glance.LocalContext -import androidx.glance.LocalSize -import androidx.glance.appwidget.cornerRadius -import androidx.glance.layout.Alignment -import androidx.glance.layout.Row -import androidx.glance.layout.Column -import androidx.glance.layout.ContentScale -import androidx.glance.layout.Spacer -import androidx.glance.layout.size -import androidx.glance.text.FontWeight -import androidx.glance.text.Text -import androidx.glance.text.TextStyle -import oss.krtirtho.spotube.glance.Breakpoints -import oss.krtirtho.spotube.glance.models.Track - -@Composable -fun TrackDetailsView(activeTrack: Track?) { - val context = LocalContext.current - - val size = LocalSize.current - - val artistStr = activeTrack?.artists?.map { it.name }?.joinToString(", ") ?: "" - val imgLocalPath = activeTrack?.album?.images?.get(0)?.path; - val title = activeTrack?.name ?: "" - - - Image( - provider = - if (imgLocalPath == null) - ImageProvider( - BitmapFactory.decodeResource( - context.resources, - android.R.drawable.ic_delete - ) - ) - else ImageProvider(BitmapFactory.decodeFile(imgLocalPath)), - contentDescription = "Album Art", - modifier = GlanceModifier.cornerRadius(8.dp) - .size( - if (size.height < 200.dp) 50.dp - else 100.dp - ), - contentScale = ContentScale.Fit - ) - Spacer(modifier = GlanceModifier.size(6.dp)) - Column { - Text( - text = title, - style = TextStyle( - fontSize = 16.sp, - fontWeight = FontWeight.Bold, - color = GlanceTheme.colors.onBackground - ), - ) - if (size != Breakpoints.SMALL_SQUARE) { - Spacer(modifier = GlanceModifier.size(6.dp)) - Text( - text = artistStr, - style = TextStyle( - fontSize = 14.sp, - color = GlanceTheme.colors.onBackground - ), - ) - } - } -} \ No newline at end of file diff --git a/android/app/src/main/kotlin/oss/krtirtho/spotube/glance/widgets/TrackProgress.kt b/android/app/src/main/kotlin/oss/krtirtho/spotube/glance/widgets/TrackProgress.kt deleted file mode 100644 index b54059b1..00000000 --- a/android/app/src/main/kotlin/oss/krtirtho/spotube/glance/widgets/TrackProgress.kt +++ /dev/null @@ -1,77 +0,0 @@ -package oss.krtirtho.spotube.glance.widgets - -import android.content.SharedPreferences -import androidx.compose.runtime.Composable -import androidx.compose.ui.unit.dp -import androidx.glance.GlanceModifier -import androidx.glance.GlanceTheme -import androidx.glance.LocalSize -import androidx.glance.appwidget.LinearProgressIndicator -import androidx.glance.layout.Column -import androidx.glance.layout.Row -import androidx.glance.layout.Spacer -import androidx.glance.layout.fillMaxWidth -import androidx.glance.layout.size -import androidx.glance.text.Text -import androidx.glance.text.TextStyle -import kotlin.math.max -import kotlin.time.Duration -import kotlin.time.Duration.Companion.seconds -import oss.krtirtho.spotube.glance.Breakpoints - -fun Duration.format(): String { - return this.toComponents { hour, minutes, seconds, nanoseconds -> - var paddedSeconds = seconds.toString().padStart(2, '0') - var paddedMinutes = minutes.toString().padStart(2, '0') - var paddedHour = hour.toString().padStart(2, '0') - if (hour == 0L) { - "$paddedMinutes:$paddedSeconds" - } else { - "$paddedHour:$paddedMinutes:$paddedSeconds" - } - } -} - -@Composable -fun TrackProgress(prefs: SharedPreferences) { - val size = LocalSize.current - val position = prefs.getInt("position", 0).seconds - var duration = prefs.getInt("duration", 0).seconds - - var progress = position.inWholeSeconds.toFloat() / max(duration.inWholeSeconds.toFloat(), 1.0f) - - var textStyle = - TextStyle( - color = GlanceTheme.colors.onBackground, - ) - - if (size == Breakpoints.HORIZONTAL_RECTANGLE) { - Row(modifier = GlanceModifier.fillMaxWidth()) { - Text(text = position.format(), style = textStyle) - Spacer(modifier = GlanceModifier.size(6.dp)) - LinearProgressIndicator( - progress = progress, - modifier = GlanceModifier.defaultWeight(), - color = GlanceTheme.colors.primary, - backgroundColor = GlanceTheme.colors.primaryContainer, - ) - Spacer(modifier = GlanceModifier.size(6.dp)) - Text(text = duration.format(), style = textStyle) - } - } else { - Column(modifier = GlanceModifier.fillMaxWidth()) { - LinearProgressIndicator( - progress = progress, - modifier = GlanceModifier.fillMaxWidth(), - color = GlanceTheme.colors.primary, - backgroundColor = GlanceTheme.colors.primaryContainer, - ) - Spacer(modifier = GlanceModifier.size(6.dp)) - Row(modifier = GlanceModifier.fillMaxWidth()) { - Text(text = position.format(), style = textStyle) - Spacer(modifier = GlanceModifier.defaultWeight()) - Text(text = duration.format(), style = textStyle) - } - } - } -} diff --git a/android/app/src/main/res/drawable-hdpi-v31/android12branding.png b/android/app/src/main/res/drawable-hdpi-v31/android12branding.png deleted file mode 100644 index fff3f148..00000000 Binary files a/android/app/src/main/res/drawable-hdpi-v31/android12branding.png and /dev/null differ diff --git a/android/app/src/main/res/drawable-hdpi/android12splash.png b/android/app/src/main/res/drawable-hdpi/android12splash.png deleted file mode 100644 index 0d4e1c68..00000000 Binary files a/android/app/src/main/res/drawable-hdpi/android12splash.png and /dev/null differ diff --git a/android/app/src/main/res/drawable-hdpi/branding.png b/android/app/src/main/res/drawable-hdpi/branding.png deleted file mode 100644 index fff3f148..00000000 Binary files a/android/app/src/main/res/drawable-hdpi/branding.png and /dev/null differ diff --git a/android/app/src/main/res/drawable-hdpi/ic_launcher_background.png b/android/app/src/main/res/drawable-hdpi/ic_launcher_background.png deleted file mode 100644 index 696717ef..00000000 Binary files a/android/app/src/main/res/drawable-hdpi/ic_launcher_background.png and /dev/null differ diff --git a/android/app/src/main/res/drawable-hdpi/ic_launcher_foreground.png b/android/app/src/main/res/drawable-hdpi/ic_launcher_foreground.png deleted file mode 100644 index a65caa1b..00000000 Binary files a/android/app/src/main/res/drawable-hdpi/ic_launcher_foreground.png and /dev/null differ diff --git a/android/app/src/main/res/drawable-hdpi/splash.png b/android/app/src/main/res/drawable-hdpi/splash.png deleted file mode 100644 index 0979b5e4..00000000 Binary files a/android/app/src/main/res/drawable-hdpi/splash.png and /dev/null differ diff --git a/android/app/src/main/res/drawable-mdpi-v31/android12branding.png b/android/app/src/main/res/drawable-mdpi-v31/android12branding.png deleted file mode 100644 index 5a197da3..00000000 Binary files a/android/app/src/main/res/drawable-mdpi-v31/android12branding.png and /dev/null differ diff --git a/android/app/src/main/res/drawable-mdpi/android12splash.png b/android/app/src/main/res/drawable-mdpi/android12splash.png deleted file mode 100644 index 5d9760d4..00000000 Binary files a/android/app/src/main/res/drawable-mdpi/android12splash.png and /dev/null differ diff --git a/android/app/src/main/res/drawable-mdpi/branding.png b/android/app/src/main/res/drawable-mdpi/branding.png deleted file mode 100644 index 5a197da3..00000000 Binary files a/android/app/src/main/res/drawable-mdpi/branding.png and /dev/null differ diff --git a/android/app/src/main/res/drawable-mdpi/ic_launcher_background.png b/android/app/src/main/res/drawable-mdpi/ic_launcher_background.png deleted file mode 100644 index d2bb407f..00000000 Binary files a/android/app/src/main/res/drawable-mdpi/ic_launcher_background.png and /dev/null differ diff --git a/android/app/src/main/res/drawable-mdpi/ic_launcher_foreground.png b/android/app/src/main/res/drawable-mdpi/ic_launcher_foreground.png deleted file mode 100644 index 3ad0f47e..00000000 Binary files a/android/app/src/main/res/drawable-mdpi/ic_launcher_foreground.png and /dev/null differ diff --git a/android/app/src/main/res/drawable-mdpi/splash.png b/android/app/src/main/res/drawable-mdpi/splash.png deleted file mode 100644 index c5e4aca0..00000000 Binary files a/android/app/src/main/res/drawable-mdpi/splash.png and /dev/null differ diff --git a/android/app/src/main/res/drawable-night-hdpi-v31/android12branding.png b/android/app/src/main/res/drawable-night-hdpi-v31/android12branding.png deleted file mode 100644 index fff3f148..00000000 Binary files a/android/app/src/main/res/drawable-night-hdpi-v31/android12branding.png and /dev/null differ diff --git a/android/app/src/main/res/drawable-night-hdpi/android12splash.png b/android/app/src/main/res/drawable-night-hdpi/android12splash.png deleted file mode 100644 index 0d4e1c68..00000000 Binary files a/android/app/src/main/res/drawable-night-hdpi/android12splash.png and /dev/null differ diff --git a/android/app/src/main/res/drawable-night-mdpi-v31/android12branding.png b/android/app/src/main/res/drawable-night-mdpi-v31/android12branding.png deleted file mode 100644 index 5a197da3..00000000 Binary files a/android/app/src/main/res/drawable-night-mdpi-v31/android12branding.png and /dev/null differ diff --git a/android/app/src/main/res/drawable-night-mdpi/android12splash.png b/android/app/src/main/res/drawable-night-mdpi/android12splash.png deleted file mode 100644 index 5d9760d4..00000000 Binary files a/android/app/src/main/res/drawable-night-mdpi/android12splash.png and /dev/null differ diff --git a/android/app/src/main/res/drawable-night-xhdpi-v31/android12branding.png b/android/app/src/main/res/drawable-night-xhdpi-v31/android12branding.png deleted file mode 100644 index efc7e6c8..00000000 Binary files a/android/app/src/main/res/drawable-night-xhdpi-v31/android12branding.png and /dev/null differ diff --git a/android/app/src/main/res/drawable-night-xhdpi/android12splash.png b/android/app/src/main/res/drawable-night-xhdpi/android12splash.png deleted file mode 100644 index 8e5ceb0a..00000000 Binary files a/android/app/src/main/res/drawable-night-xhdpi/android12splash.png and /dev/null differ diff --git a/android/app/src/main/res/drawable-night-xxhdpi-v31/android12branding.png b/android/app/src/main/res/drawable-night-xxhdpi-v31/android12branding.png deleted file mode 100644 index 593877e0..00000000 Binary files a/android/app/src/main/res/drawable-night-xxhdpi-v31/android12branding.png and /dev/null differ diff --git a/android/app/src/main/res/drawable-night-xxhdpi/android12splash.png b/android/app/src/main/res/drawable-night-xxhdpi/android12splash.png deleted file mode 100644 index fb89da37..00000000 Binary files a/android/app/src/main/res/drawable-night-xxhdpi/android12splash.png and /dev/null differ diff --git a/android/app/src/main/res/drawable-night-xxxhdpi-v31/android12branding.png b/android/app/src/main/res/drawable-night-xxxhdpi-v31/android12branding.png deleted file mode 100644 index 9d233302..00000000 Binary files a/android/app/src/main/res/drawable-night-xxxhdpi-v31/android12branding.png and /dev/null differ diff --git a/android/app/src/main/res/drawable-night-xxxhdpi/android12splash.png b/android/app/src/main/res/drawable-night-xxxhdpi/android12splash.png deleted file mode 100644 index 38e4a12c..00000000 Binary files a/android/app/src/main/res/drawable-night-xxxhdpi/android12splash.png and /dev/null differ diff --git a/android/app/src/main/res/drawable-v21/background.png b/android/app/src/main/res/drawable-v21/background.png deleted file mode 100644 index 203fc77a..00000000 Binary files a/android/app/src/main/res/drawable-v21/background.png and /dev/null differ diff --git a/android/app/src/main/res/drawable-v21/launch_background.xml b/android/app/src/main/res/drawable-v21/launch_background.xml index 52e8749e..ff7cf00c 100644 --- a/android/app/src/main/res/drawable-v21/launch_background.xml +++ b/android/app/src/main/res/drawable-v21/launch_background.xml @@ -1,12 +1,12 @@ + - - - - - - - - - + + + + diff --git a/android/app/src/main/res/drawable-xhdpi-v31/android12branding.png b/android/app/src/main/res/drawable-xhdpi-v31/android12branding.png deleted file mode 100644 index efc7e6c8..00000000 Binary files a/android/app/src/main/res/drawable-xhdpi-v31/android12branding.png and /dev/null differ diff --git a/android/app/src/main/res/drawable-xhdpi/android12splash.png b/android/app/src/main/res/drawable-xhdpi/android12splash.png deleted file mode 100644 index 8e5ceb0a..00000000 Binary files a/android/app/src/main/res/drawable-xhdpi/android12splash.png and /dev/null differ diff --git a/android/app/src/main/res/drawable-xhdpi/branding.png b/android/app/src/main/res/drawable-xhdpi/branding.png deleted file mode 100644 index efc7e6c8..00000000 Binary files a/android/app/src/main/res/drawable-xhdpi/branding.png and /dev/null differ diff --git a/android/app/src/main/res/drawable-xhdpi/ic_launcher_background.png b/android/app/src/main/res/drawable-xhdpi/ic_launcher_background.png deleted file mode 100644 index 534e957f..00000000 Binary files a/android/app/src/main/res/drawable-xhdpi/ic_launcher_background.png and /dev/null differ diff --git a/android/app/src/main/res/drawable-xhdpi/ic_launcher_foreground.png b/android/app/src/main/res/drawable-xhdpi/ic_launcher_foreground.png deleted file mode 100644 index 8774c0ff..00000000 Binary files a/android/app/src/main/res/drawable-xhdpi/ic_launcher_foreground.png and /dev/null differ diff --git a/android/app/src/main/res/drawable-xhdpi/splash.png b/android/app/src/main/res/drawable-xhdpi/splash.png deleted file mode 100644 index 41222c6c..00000000 Binary files a/android/app/src/main/res/drawable-xhdpi/splash.png and /dev/null differ diff --git a/android/app/src/main/res/drawable-xxhdpi-v31/android12branding.png b/android/app/src/main/res/drawable-xxhdpi-v31/android12branding.png deleted file mode 100644 index 593877e0..00000000 Binary files a/android/app/src/main/res/drawable-xxhdpi-v31/android12branding.png and /dev/null differ diff --git a/android/app/src/main/res/drawable-xxhdpi/android12splash.png b/android/app/src/main/res/drawable-xxhdpi/android12splash.png deleted file mode 100644 index fb89da37..00000000 Binary files a/android/app/src/main/res/drawable-xxhdpi/android12splash.png and /dev/null differ diff --git a/android/app/src/main/res/drawable-xxhdpi/branding.png b/android/app/src/main/res/drawable-xxhdpi/branding.png deleted file mode 100644 index 593877e0..00000000 Binary files a/android/app/src/main/res/drawable-xxhdpi/branding.png and /dev/null differ diff --git a/android/app/src/main/res/drawable-xxhdpi/ic_launcher_background.png b/android/app/src/main/res/drawable-xxhdpi/ic_launcher_background.png deleted file mode 100644 index c1eaa966..00000000 Binary files a/android/app/src/main/res/drawable-xxhdpi/ic_launcher_background.png and /dev/null differ diff --git a/android/app/src/main/res/drawable-xxhdpi/ic_launcher_foreground.png b/android/app/src/main/res/drawable-xxhdpi/ic_launcher_foreground.png deleted file mode 100644 index a379c006..00000000 Binary files a/android/app/src/main/res/drawable-xxhdpi/ic_launcher_foreground.png and /dev/null differ diff --git a/android/app/src/main/res/drawable-xxhdpi/splash.png b/android/app/src/main/res/drawable-xxhdpi/splash.png deleted file mode 100644 index 5ab19d32..00000000 Binary files a/android/app/src/main/res/drawable-xxhdpi/splash.png and /dev/null differ diff --git a/android/app/src/main/res/drawable-xxxhdpi-v31/android12branding.png b/android/app/src/main/res/drawable-xxxhdpi-v31/android12branding.png deleted file mode 100644 index 9d233302..00000000 Binary files a/android/app/src/main/res/drawable-xxxhdpi-v31/android12branding.png and /dev/null differ diff --git a/android/app/src/main/res/drawable-xxxhdpi/android12splash.png b/android/app/src/main/res/drawable-xxxhdpi/android12splash.png deleted file mode 100644 index 38e4a12c..00000000 Binary files a/android/app/src/main/res/drawable-xxxhdpi/android12splash.png and /dev/null differ diff --git a/android/app/src/main/res/drawable-xxxhdpi/branding.png b/android/app/src/main/res/drawable-xxxhdpi/branding.png deleted file mode 100644 index 9d233302..00000000 Binary files a/android/app/src/main/res/drawable-xxxhdpi/branding.png and /dev/null differ diff --git a/android/app/src/main/res/drawable-xxxhdpi/ic_launcher_background.png b/android/app/src/main/res/drawable-xxxhdpi/ic_launcher_background.png deleted file mode 100644 index 6c7c4636..00000000 Binary files a/android/app/src/main/res/drawable-xxxhdpi/ic_launcher_background.png and /dev/null differ diff --git a/android/app/src/main/res/drawable-xxxhdpi/ic_launcher_foreground.png b/android/app/src/main/res/drawable-xxxhdpi/ic_launcher_foreground.png deleted file mode 100644 index 44621df8..00000000 Binary files a/android/app/src/main/res/drawable-xxxhdpi/ic_launcher_foreground.png and /dev/null differ diff --git a/android/app/src/main/res/drawable-xxxhdpi/splash.png b/android/app/src/main/res/drawable-xxxhdpi/splash.png deleted file mode 100644 index a6d40b89..00000000 Binary files a/android/app/src/main/res/drawable-xxxhdpi/splash.png and /dev/null differ diff --git a/android/app/src/main/res/drawable/background.png b/android/app/src/main/res/drawable/background.png deleted file mode 100644 index 203fc77a..00000000 Binary files a/android/app/src/main/res/drawable/background.png and /dev/null differ diff --git a/android/app/src/main/res/drawable/ic_launcher_monochrome.xml b/android/app/src/main/res/drawable/ic_launcher_monochrome.xml deleted file mode 100644 index 8aae0e6c..00000000 --- a/android/app/src/main/res/drawable/ic_launcher_monochrome.xml +++ /dev/null @@ -1,27 +0,0 @@ - - - - - diff --git a/android/app/src/main/res/drawable/launch_background.xml b/android/app/src/main/res/drawable/launch_background.xml index 52e8749e..af6e0469 100644 --- a/android/app/src/main/res/drawable/launch_background.xml +++ b/android/app/src/main/res/drawable/launch_background.xml @@ -1,12 +1,12 @@ + - - - - - - - - - + + + + diff --git a/android/app/src/main/res/mipmap-anydpi-v26/ic_launcher.xml b/android/app/src/main/res/mipmap-anydpi-v26/ic_launcher.xml deleted file mode 100644 index f606c4d8..00000000 --- a/android/app/src/main/res/mipmap-anydpi-v26/ic_launcher.xml +++ /dev/null @@ -1,6 +0,0 @@ - - - - - - diff --git a/android/app/src/main/res/mipmap-hdpi/ic_launcher.png b/android/app/src/main/res/mipmap-hdpi/ic_launcher.png index d26a3a6e..db77bb4b 100644 Binary files a/android/app/src/main/res/mipmap-hdpi/ic_launcher.png and b/android/app/src/main/res/mipmap-hdpi/ic_launcher.png differ diff --git a/android/app/src/main/res/mipmap-mdpi/ic_launcher.png b/android/app/src/main/res/mipmap-mdpi/ic_launcher.png index 63d16c60..17987b79 100644 Binary files a/android/app/src/main/res/mipmap-mdpi/ic_launcher.png and b/android/app/src/main/res/mipmap-mdpi/ic_launcher.png differ diff --git a/android/app/src/main/res/mipmap-xhdpi/ic_launcher.png b/android/app/src/main/res/mipmap-xhdpi/ic_launcher.png index fe2957ad..09d43914 100644 Binary files a/android/app/src/main/res/mipmap-xhdpi/ic_launcher.png and b/android/app/src/main/res/mipmap-xhdpi/ic_launcher.png differ diff --git a/android/app/src/main/res/mipmap-xxhdpi/ic_launcher.png b/android/app/src/main/res/mipmap-xxhdpi/ic_launcher.png index 85c1d793..d5f1c8d3 100644 Binary files a/android/app/src/main/res/mipmap-xxhdpi/ic_launcher.png and b/android/app/src/main/res/mipmap-xxhdpi/ic_launcher.png differ diff --git a/android/app/src/main/res/mipmap-xxxhdpi/ic_launcher.png b/android/app/src/main/res/mipmap-xxxhdpi/ic_launcher.png index f22fa5cf..4d6372ee 100644 Binary files a/android/app/src/main/res/mipmap-xxxhdpi/ic_launcher.png and b/android/app/src/main/res/mipmap-xxxhdpi/ic_launcher.png differ diff --git a/android/app/src/main/res/values-night-v31/styles.xml b/android/app/src/main/res/values-night-v31/styles.xml deleted file mode 100644 index 96980835..00000000 --- a/android/app/src/main/res/values-night-v31/styles.xml +++ /dev/null @@ -1,23 +0,0 @@ - - - - - - - diff --git a/android/app/src/main/res/values-night/styles.xml b/android/app/src/main/res/values-night/styles.xml index 5eb2eda1..06952be7 100644 --- a/android/app/src/main/res/values-night/styles.xml +++ b/android/app/src/main/res/values-night/styles.xml @@ -3,12 +3,8 @@ - - - - diff --git a/android/app/src/main/res/values/colors.xml b/android/app/src/main/res/values/colors.xml deleted file mode 100644 index 88247a21..00000000 --- a/android/app/src/main/res/values/colors.xml +++ /dev/null @@ -1,4 +0,0 @@ - - - #242832 - \ No newline at end of file diff --git a/android/app/src/main/res/values/styles.xml b/android/app/src/main/res/values/styles.xml index 0fdc7036..cb1ef880 100644 --- a/android/app/src/main/res/values/styles.xml +++ b/android/app/src/main/res/values/styles.xml @@ -3,12 +3,8 @@ - - - - diff --git a/android/app/src/nightly/res/values-night/styles.xml b/android/app/src/nightly/res/values-night/styles.xml deleted file mode 100644 index dbc9ea9f..00000000 --- a/android/app/src/nightly/res/values-night/styles.xml +++ /dev/null @@ -1,22 +0,0 @@ - - - - - - - diff --git a/android/app/src/nightly/res/values-v31/styles.xml b/android/app/src/nightly/res/values-v31/styles.xml deleted file mode 100644 index 981a07a9..00000000 --- a/android/app/src/nightly/res/values-v31/styles.xml +++ /dev/null @@ -1,23 +0,0 @@ - - - - - - - diff --git a/android/app/src/nightly/res/values/colors.xml b/android/app/src/nightly/res/values/colors.xml deleted file mode 100644 index 88247a21..00000000 --- a/android/app/src/nightly/res/values/colors.xml +++ /dev/null @@ -1,4 +0,0 @@ - - - #242832 - \ No newline at end of file diff --git a/android/app/src/nightly/res/values/styles.xml b/android/app/src/nightly/res/values/styles.xml deleted file mode 100644 index 0d1fa8fc..00000000 --- a/android/app/src/nightly/res/values/styles.xml +++ /dev/null @@ -1,22 +0,0 @@ - - - - - - - diff --git a/android/app/src/profile/AndroidManifest.xml b/android/app/src/profile/AndroidManifest.xml index a32d12af..399f6981 100644 --- a/android/app/src/profile/AndroidManifest.xml +++ b/android/app/src/profile/AndroidManifest.xml @@ -1,6 +1,7 @@ - - - \ No newline at end of file + + diff --git a/android/build.gradle b/android/build.gradle deleted file mode 100644 index 8f31e8ca..00000000 --- a/android/build.gradle +++ /dev/null @@ -1,18 +0,0 @@ -allprojects { - repositories { - google() - mavenCentral() - } -} - -rootProject.buildDir = '../build' -subprojects { - project.buildDir = "${rootProject.buildDir}/${project.name}" -} -subprojects { - project.evaluationDependsOn(':app') -} - -tasks.register("clean", Delete) { - delete rootProject.buildDir -} \ No newline at end of file diff --git a/android/build.gradle.kts b/android/build.gradle.kts new file mode 100644 index 00000000..89176ef4 --- /dev/null +++ b/android/build.gradle.kts @@ -0,0 +1,21 @@ +allprojects { + repositories { + google() + mavenCentral() + } +} + +val newBuildDir: Directory = rootProject.layout.buildDirectory.dir("../../build").get() +rootProject.layout.buildDirectory.value(newBuildDir) + +subprojects { + val newSubprojectBuildDir: Directory = newBuildDir.dir(project.name) + project.layout.buildDirectory.value(newSubprojectBuildDir) +} +subprojects { + project.evaluationDependsOn(":app") +} + +tasks.register("clean") { + delete(rootProject.layout.buildDirectory) +} diff --git a/android/gradle.properties b/android/gradle.properties index ed508580..f018a618 100644 --- a/android/gradle.properties +++ b/android/gradle.properties @@ -1,3 +1,3 @@ -org.gradle.jvmargs=-Xmx4608m +org.gradle.jvmargs=-Xmx8G -XX:MaxMetaspaceSize=4G -XX:ReservedCodeCacheSize=512m -XX:+HeapDumpOnOutOfMemoryError android.useAndroidX=true android.enableJetifier=true diff --git a/android/gradle/wrapper/gradle-wrapper.properties b/android/gradle/wrapper/gradle-wrapper.properties index bf6b7385..afa1e8eb 100644 --- a/android/gradle/wrapper/gradle-wrapper.properties +++ b/android/gradle/wrapper/gradle-wrapper.properties @@ -1,6 +1,5 @@ -#Fri Dec 13 21:53:13 BDT 2024 distributionBase=GRADLE_USER_HOME distributionPath=wrapper/dists -distributionUrl=https\://services.gradle.org/distributions/gradle-8.9-bin.zip zipStoreBase=GRADLE_USER_HOME zipStorePath=wrapper/dists +distributionUrl=https\://services.gradle.org/distributions/gradle-8.10.2-all.zip diff --git a/android/settings.gradle b/android/settings.gradle deleted file mode 100644 index 1e8ffbe3..00000000 --- a/android/settings.gradle +++ /dev/null @@ -1,25 +0,0 @@ -pluginManagement { - def flutterSdkPath = { - def properties = new Properties() - file("local.properties").withInputStream { properties.load(it) } - def flutterSdkPath = properties.getProperty("flutter.sdk") - assert flutterSdkPath != null, "flutter.sdk not set in local.properties" - return flutterSdkPath - }() - - includeBuild("$flutterSdkPath/packages/flutter_tools/gradle") - - repositories { - google() - mavenCentral() - gradlePluginPortal() - } -} - -plugins { - id "dev.flutter.flutter-plugin-loader" version "1.0.0" - id "com.android.application" version '8.7.0' apply false - id "org.jetbrains.kotlin.android" version "1.8.22" apply false -} - -include ':app' \ No newline at end of file diff --git a/android/settings.gradle.kts b/android/settings.gradle.kts new file mode 100644 index 00000000..a439442c --- /dev/null +++ b/android/settings.gradle.kts @@ -0,0 +1,25 @@ +pluginManagement { + val flutterSdkPath = run { + val properties = java.util.Properties() + file("local.properties").inputStream().use { properties.load(it) } + val flutterSdkPath = properties.getProperty("flutter.sdk") + require(flutterSdkPath != null) { "flutter.sdk not set in local.properties" } + flutterSdkPath + } + + includeBuild("$flutterSdkPath/packages/flutter_tools/gradle") + + repositories { + google() + mavenCentral() + gradlePluginPortal() + } +} + +plugins { + id("dev.flutter.flutter-plugin-loader") version "1.0.0" + id("com.android.application") version "8.7.0" apply false + id("org.jetbrains.kotlin.android") version "1.8.22" apply false +} + +include(":app")