diff --git a/.gitignore b/.gitignore
index 69096df..3967f8a 100644
--- a/.gitignore
+++ b/.gitignore
@@ -21,6 +21,11 @@ gradle-app.setting
# Local configuration
local.properties
+keystore.properties
+
+# Signing
+*.jks
+*.keystore
# IDE
.idea/
diff --git a/app/build.gradle.kts b/app/build.gradle.kts
index 57c2118..64c17d9 100644
--- a/app/build.gradle.kts
+++ b/app/build.gradle.kts
@@ -1,3 +1,5 @@
+import java.util.Properties
+
plugins {
alias(libs.plugins.android.application)
alias(libs.plugins.kotlin.android)
@@ -18,10 +20,24 @@ android {
versionName = "1.0"
}
+ signingConfigs {
+ create("release") {
+ val propsFile = rootProject.file("keystore.properties")
+ if (propsFile.exists()) {
+ val props = Properties().apply { load(propsFile.inputStream()) }
+ storeFile = file(props.getProperty("storeFile"))
+ storePassword = props.getProperty("storePassword")
+ keyAlias = props.getProperty("keyAlias")
+ keyPassword = props.getProperty("keyPassword")
+ }
+ }
+ }
+
buildTypes {
release {
isMinifyEnabled = true
isShrinkResources = true
+ signingConfig = signingConfigs.getByName("release")
proguardFiles(
getDefaultProguardFile("proguard-android-optimize.txt"),
"proguard-rules.pro"
diff --git a/app/proguard-rules.pro b/app/proguard-rules.pro
index da48936..6d67a9f 100644
--- a/app/proguard-rules.pro
+++ b/app/proguard-rules.pro
@@ -1,5 +1,6 @@
# commons-suncalc
-keep class org.shredzone.commons.suncalc.** { *; }
+-dontwarn edu.umd.cs.findbugs.annotations.**
# Room
-keep class * extends androidx.room.RoomDatabase
diff --git a/app/src/main/java/com/sunzones/ui/main/components/SunCard.kt b/app/src/main/java/com/sunzones/ui/main/components/SunCard.kt
index b023f86..bc434db 100644
--- a/app/src/main/java/com/sunzones/ui/main/components/SunCard.kt
+++ b/app/src/main/java/com/sunzones/ui/main/components/SunCard.kt
@@ -32,11 +32,14 @@ import androidx.compose.material.icons.rounded.KeyboardArrowDown
import androidx.compose.material.icons.rounded.MyLocation
import androidx.compose.material.icons.rounded.WbSunny
import androidx.compose.material.icons.rounded.WbTwilight
+import androidx.compose.foundation.shape.RoundedCornerShape
import androidx.compose.material3.AlertDialog
import androidx.compose.material3.Icon
import androidx.compose.material3.MaterialTheme
import androidx.compose.material3.Text
import androidx.compose.material3.TextButton
+import androidx.compose.ui.window.Dialog
+import androidx.compose.ui.window.DialogProperties
import androidx.compose.runtime.Composable
import androidx.compose.runtime.derivedStateOf
import androidx.compose.runtime.getValue
@@ -289,14 +292,9 @@ fun SunCard(
modifier = Modifier.padding(top = 8.dp)
)
- // Space for navigation bar + page indicator (80dp offset + 8dp height) + FAB
- Spacer(
- modifier = Modifier
- .navigationBarsPadding()
- .height(112.dp)
- )
+ Spacer(modifier = Modifier.height(24.dp))
- // Subtle about button at the very bottom
+ // Subtle about button
Box(
modifier = Modifier.fillMaxWidth(),
contentAlignment = Alignment.Center
@@ -310,6 +308,13 @@ fun SunCard(
.padding(vertical = 12.dp, horizontal = 24.dp)
)
}
+
+ // Space for navigation bar + page indicator + FAB
+ Spacer(
+ modifier = Modifier
+ .navigationBarsPadding()
+ .height(88.dp)
+ )
}
}
}
@@ -338,30 +343,47 @@ fun SunCard(
if (showAboutDialog) {
val context = LocalContext.current
val email = stringResource(R.string.about_email)
- AlertDialog(
+ Dialog(
onDismissRequest = { showAboutDialog = false },
- title = { Text(stringResource(R.string.app_name)) },
- text = {
- Column {
- Text(stringResource(R.string.about_made_in))
- Spacer(modifier = Modifier.height(8.dp))
- Text(
- text = email,
- color = MaterialTheme.colorScheme.primary,
- modifier = Modifier.clickable {
- context.startActivity(
- Intent(Intent.ACTION_SENDTO, Uri.parse("mailto:$email"))
- )
- }
+ properties = DialogProperties(usePlatformDefaultWidth = false)
+ ) {
+ Box(
+ modifier = Modifier
+ .padding(horizontal = 48.dp)
+ .background(
+ color = Color.Black.copy(alpha = 0.7f),
+ shape = RoundedCornerShape(28.dp)
)
- }
- },
- confirmButton = {
- TextButton(onClick = { showAboutDialog = false }) {
- Text(stringResource(R.string.ok))
+ .padding(vertical = 32.dp, horizontal = 24.dp),
+ contentAlignment = Alignment.Center
+ ) {
+ Column(
+ horizontalAlignment = Alignment.CenterHorizontally
+ ) {
+ Text(
+ text = "\u2600\uFE0F",
+ style = MaterialTheme.typography.displayLarge
+ )
+ Spacer(modifier = Modifier.height(16.dp))
+ Text(
+ text = stringResource(R.string.about_made_in),
+ style = MaterialTheme.typography.bodyLarge,
+ color = Color.White
+ )
+ Spacer(modifier = Modifier.height(16.dp))
+ TextButton(onClick = {
+ context.startActivity(
+ Intent(Intent.ACTION_SENDTO, Uri.parse("mailto:$email"))
+ )
+ }) {
+ Text(
+ text = stringResource(R.string.about_contact),
+ color = SunGold
+ )
+ }
}
}
- )
+ }
}
}
diff --git a/app/src/main/res/values-pl/strings.xml b/app/src/main/res/values-pl/strings.xml
index 169e086..2e242ef 100644
--- a/app/src/main/res/values-pl/strings.xml
+++ b/app/src/main/res/values-pl/strings.xml
@@ -14,8 +14,7 @@
Anuluj
Daylight w roku
O aplikacji
- Zrobione w Warszawie przez Pawła Orzecha
- pawel@orzech.me
+ Napisz do mnie
OK
Długość nocy
Wschód za %1$s
diff --git a/app/src/main/res/values/strings.xml b/app/src/main/res/values/strings.xml
index 889d560..926a861 100644
--- a/app/src/main/res/values/strings.xml
+++ b/app/src/main/res/values/strings.xml
@@ -14,8 +14,9 @@
Cancel
Yearly daylight
About
- Made in Warsaw by Paweł Orzech
- pawel@orzech.me
+ Made with love in Warsaw, Poland
+ Contact me
+ pawel@orzech.me
OK
Night length
Sunrise in %1$s