Skip to content

Commit

Permalink
[22] - Data and About screen updates
Browse files Browse the repository at this point in the history
  • Loading branch information
Aredruss committed Jan 15, 2024
1 parent ba6cc70 commit 2386735
Show file tree
Hide file tree
Showing 5 changed files with 42 additions and 51 deletions.
4 changes: 2 additions & 2 deletions app/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,8 @@ android {
applicationId = "com.aredruss.warmaster"
minSdk = 24
targetSdk = 34
versionCode = 5
versionName = "0.5"
versionCode = 7
versionName = "0.7"

testInstrumentationRunner = "androidx.test.runner.AndroidJUnitRunner"
vectorDrawables {
Expand Down
42 changes: 30 additions & 12 deletions app/src/main/java/com/aredruss/warmaster/ui/about/AboutWarmaster.kt
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ import androidx.compose.foundation.layout.fillMaxWidth
import androidx.compose.foundation.layout.height
import androidx.compose.foundation.layout.padding
import androidx.compose.foundation.layout.size
import androidx.compose.foundation.layout.width
import androidx.compose.material3.ExperimentalMaterial3Api
import androidx.compose.material3.Icon
import androidx.compose.material3.MaterialTheme
Expand Down Expand Up @@ -47,7 +48,8 @@ import org.koin.androidx.compose.getViewModel
fun AboutWarmaster(navigator: DestinationsNavigator) {

val viewModel = getViewModel<AboutViewModel>()
val url = "https://github.com/Aredruss/Warmaster"
val url = "https://play.google.com/store/apps/details?id=com.aredruss.warmaster&hl=en_US"
val githubUrl = "https://github.com/Aredruss/Warmaster"
val discordUrl = "https://discord.com/invite/8fcDRVZQ8x"

val clipboardManager: ClipboardManager = LocalClipboardManager.current
Expand Down Expand Up @@ -124,11 +126,12 @@ fun AboutWarmaster(navigator: DestinationsNavigator) {
)
.background(color = MaterialTheme.colorScheme.secondary)
.padding(all = 10.dp),
text = url,
text = url.dropLast(40).plus(""),
style = MaterialTheme.typography.labelLarge,
color = MaterialTheme.colorScheme.onSecondary,
textAlign = TextAlign.Center
)
textAlign = TextAlign.Center,

)
}
Spacer(modifier = Modifier.height(height = 20.dp))
Text(
Expand All @@ -141,22 +144,37 @@ fun AboutWarmaster(navigator: DestinationsNavigator) {
)

Row(
modifier = Modifier
.clip(shape = MaterialTheme.shapes.small)
.background(color = discordBlue)
.clickable {
uriHandler.openUri(discordUrl)
}
.padding(all = 15.dp),
modifier = Modifier,
verticalAlignment = Alignment.CenterVertically,
horizontalArrangement = Arrangement.Center
) {
Icon(
modifier = Modifier.size(size = 30.dp),
modifier = Modifier
.size(size = 60.dp)
.clip(shape = MaterialTheme.shapes.small)
.background(color = discordBlue)
.clickable {
uriHandler.openUri(discordUrl)
}
.padding(all = 10.dp),
painter = painterResource(id = R.drawable.ic_discord),
contentDescription = "",
tint = Color.White
)
Spacer(modifier = Modifier.width(width = 15.dp))
Icon(
modifier = Modifier
.size(size = 60.dp)
.clip(shape = MaterialTheme.shapes.small)
.background(color = Color.White)
.clickable {
uriHandler.openUri(githubUrl)
}
.padding(all = 10.dp),
painter = painterResource(id = R.drawable.ic_github),
contentDescription = "",
tint = Color.Black
)
}
}
},
Expand Down
36 changes: 0 additions & 36 deletions app/src/main/java/com/aredruss/warmaster/ui/theme/Theme.kt
Original file line number Diff line number Diff line change
Expand Up @@ -17,38 +17,6 @@ import androidx.compose.ui.platform.LocalContext
import androidx.compose.ui.platform.LocalView
import androidx.core.view.WindowCompat

private val LightColors = lightColorScheme(
primary = md_theme_light_primary,
onPrimary = md_theme_light_onPrimary,
primaryContainer = md_theme_light_primaryContainer,
onPrimaryContainer = md_theme_light_onPrimaryContainer,
secondary = md_theme_light_secondary,
onSecondary = md_theme_light_onSecondary,
secondaryContainer = md_theme_light_secondaryContainer,
onSecondaryContainer = md_theme_light_onSecondaryContainer,
tertiary = md_theme_light_tertiary,
onTertiary = md_theme_light_onTertiary,
tertiaryContainer = md_theme_light_tertiaryContainer,
onTertiaryContainer = md_theme_light_onTertiaryContainer,
error = md_theme_light_error,
errorContainer = md_theme_light_errorContainer,
onError = md_theme_light_onError,
onErrorContainer = md_theme_light_onErrorContainer,
background = md_theme_light_background,
onBackground = md_theme_light_onBackground,
surface = md_theme_light_surface,
onSurface = md_theme_light_onSurface,
surfaceVariant = md_theme_light_surfaceVariant,
onSurfaceVariant = md_theme_light_onSurfaceVariant,
outline = md_theme_light_outline,
inverseOnSurface = md_theme_light_inverseOnSurface,
inverseSurface = md_theme_light_inverseSurface,
inversePrimary = md_theme_light_inversePrimary,
surfaceTint = md_theme_light_surfaceTint,
outlineVariant = md_theme_light_outlineVariant,
scrim = md_theme_light_scrim,
)

private val DarkColors = darkColorScheme(
primary = md_theme_dark_primary,
onPrimary = md_theme_dark_onPrimary,
Expand Down Expand Up @@ -87,10 +55,6 @@ fun WarmasterTheme(
dynamicColor: Boolean = true,
content: @Composable () -> Unit
) {
val colorScheme = when {
darkTheme -> DarkColors
else -> LightColors
}
val view = LocalView.current
if (!view.isInEditMode) {
SideEffect {
Expand Down
9 changes: 9 additions & 0 deletions app/src/main/res/drawable/ic_github.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
<vector xmlns:android="http://schemas.android.com/apk/res/android"
android:width="24dp"
android:height="24dp"
android:viewportWidth="24"
android:viewportHeight="24">
<path
android:pathData="M12,2.247C9.625,2.247 7.328,3.092 5.52,4.63C3.711,6.169 2.51,8.301 2.129,10.645C1.749,12.989 2.215,15.392 3.444,17.423C4.673,19.455 6.585,20.983 8.838,21.734C9.338,21.822 9.525,21.522 9.525,21.259C9.525,21.022 9.513,20.234 9.513,19.397C7,19.859 6.35,18.784 6.15,18.222C5.928,17.674 5.576,17.19 5.125,16.809C4.775,16.622 4.275,16.159 5.113,16.147C5.432,16.181 5.739,16.293 6.007,16.471C6.274,16.649 6.495,16.89 6.65,17.172C6.787,17.417 6.971,17.634 7.191,17.808C7.412,17.983 7.665,18.112 7.935,18.188C8.206,18.265 8.489,18.288 8.768,18.255C9.047,18.222 9.317,18.134 9.563,17.997C9.606,17.488 9.832,17.013 10.2,16.659C7.975,16.409 5.65,15.547 5.65,11.722C5.636,10.728 6.003,9.766 6.675,9.034C6.369,8.17 6.405,7.222 6.775,6.384C6.775,6.384 7.613,6.122 9.525,7.409C11.161,6.959 12.889,6.959 14.525,7.409C16.438,6.109 17.275,6.384 17.275,6.384C17.645,7.222 17.681,8.17 17.375,9.034C18.049,9.765 18.416,10.727 18.4,11.722C18.4,15.559 16.063,16.409 13.837,16.659C14.076,16.901 14.26,17.191 14.376,17.511C14.493,17.83 14.539,18.17 14.512,18.509C14.512,19.847 14.5,20.922 14.5,21.259C14.5,21.522 14.688,21.834 15.188,21.734C17.436,20.977 19.343,19.445 20.566,17.413C21.79,15.38 22.252,12.978 21.869,10.637C21.486,8.295 20.283,6.166 18.476,4.629C16.668,3.092 14.373,2.248 12,2.247Z"
android:fillColor="#000000"/>
</vector>
2 changes: 1 addition & 1 deletion app/src/main/res/values/strings.xml
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@
<string name="rules_tab_name">Quick reference</string>
<string name="army_builder_tab_name">Army builder</string>
<string name="or_get_the_link">or just copy the link below</string>
<string name="and_join_the_official_discord">And join the official discord!</string>
<string name="and_join_the_official_discord">Join the official discord and checkout this project on GitHub!</string>
<string name="detachments">Detachments</string>
<string name="enhancements">Enhancements</string>
<string name="strategems">Strategems</string>
Expand Down

0 comments on commit 2386735

Please sign in to comment.