[#34] Add contact button and play store button to about page.
All checks were successful
continuous-integration/drone/tag Build is passing
All checks were successful
continuous-integration/drone/tag Build is passing
closes [#34]
This commit is contained in:
@@ -2,17 +2,16 @@ package me.zobrist.tichucounter.ui.about
|
|||||||
|
|
||||||
import android.content.res.Configuration
|
import android.content.res.Configuration
|
||||||
import androidx.compose.foundation.Image
|
import androidx.compose.foundation.Image
|
||||||
import androidx.compose.foundation.layout.Column
|
import androidx.compose.foundation.layout.*
|
||||||
import androidx.compose.foundation.layout.Row
|
import androidx.compose.material.icons.Icons
|
||||||
import androidx.compose.foundation.layout.height
|
import androidx.compose.material.icons.outlined.Mail
|
||||||
import androidx.compose.foundation.layout.padding
|
import androidx.compose.material.icons.outlined.Shop
|
||||||
import androidx.compose.material3.MaterialTheme
|
import androidx.compose.material3.*
|
||||||
import androidx.compose.material3.Surface
|
|
||||||
import androidx.compose.material3.Text
|
|
||||||
import androidx.compose.runtime.Composable
|
import androidx.compose.runtime.Composable
|
||||||
import androidx.compose.ui.Alignment.Companion.Top
|
import androidx.compose.ui.Alignment.Companion.Top
|
||||||
import androidx.compose.ui.Modifier
|
import androidx.compose.ui.Modifier
|
||||||
import androidx.compose.ui.layout.ContentScale
|
import androidx.compose.ui.layout.ContentScale
|
||||||
|
import androidx.compose.ui.platform.LocalUriHandler
|
||||||
import androidx.compose.ui.res.painterResource
|
import androidx.compose.ui.res.painterResource
|
||||||
import androidx.compose.ui.res.stringResource
|
import androidx.compose.ui.res.stringResource
|
||||||
import androidx.compose.ui.tooling.preview.Preview
|
import androidx.compose.ui.tooling.preview.Preview
|
||||||
@@ -24,24 +23,62 @@ import me.zobrist.tichucounter.ui.AppTheme
|
|||||||
|
|
||||||
@Composable
|
@Composable
|
||||||
fun AboutView() {
|
fun AboutView() {
|
||||||
Row(Modifier.padding(20.dp)) {
|
|
||||||
Image(
|
|
||||||
modifier = Modifier
|
|
||||||
.height(80.dp)
|
|
||||||
.padding(end = 10.dp)
|
|
||||||
.align(Top),
|
|
||||||
painter = painterResource(R.drawable.app_logo),
|
|
||||||
contentDescription = null,
|
|
||||||
contentScale = ContentScale.Fit
|
|
||||||
)
|
|
||||||
|
|
||||||
Column {
|
val uriHandler = LocalUriHandler.current
|
||||||
Text(
|
|
||||||
text = stringResource(id = R.string.app_name),
|
Column(
|
||||||
style = MaterialTheme.typography.headlineMedium
|
modifier = Modifier
|
||||||
|
.padding(
|
||||||
|
top = 20.dp,
|
||||||
|
start = 20.dp,
|
||||||
|
end = 20.dp,
|
||||||
|
bottom = 40.dp
|
||||||
|
),
|
||||||
|
|
||||||
|
) {
|
||||||
|
|
||||||
|
Row() {
|
||||||
|
Image(
|
||||||
|
modifier = Modifier
|
||||||
|
.height(80.dp)
|
||||||
|
.padding(end = 10.dp)
|
||||||
|
.align(Top),
|
||||||
|
painter = painterResource(R.drawable.app_logo),
|
||||||
|
contentDescription = null,
|
||||||
|
contentScale = ContentScale.Fit
|
||||||
)
|
)
|
||||||
Text(text = "V" + BuildConfig.VERSION_NAME)
|
|
||||||
|
Column {
|
||||||
|
Text(
|
||||||
|
text = stringResource(id = R.string.app_name),
|
||||||
|
style = MaterialTheme.typography.headlineMedium
|
||||||
|
)
|
||||||
|
Text(text = "V" + BuildConfig.VERSION_NAME)
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
Button(
|
||||||
|
modifier = Modifier
|
||||||
|
.fillMaxWidth()
|
||||||
|
.padding(top = 30.dp),
|
||||||
|
onClick = { uriHandler.openUri("market://details?id=me.zobrist.tichucounter") }
|
||||||
|
) {
|
||||||
|
Icon(imageVector = Icons.Outlined.Shop, contentDescription = null)
|
||||||
|
Text(stringResource(id = R.string.play_store))
|
||||||
|
}
|
||||||
|
|
||||||
|
Button(
|
||||||
|
modifier = Modifier
|
||||||
|
.fillMaxWidth()
|
||||||
|
.padding(top = 30.dp),
|
||||||
|
onClick = { uriHandler.openUri("mailto:app@zobrist.me") }
|
||||||
|
) {
|
||||||
|
Icon(imageVector = Icons.Outlined.Mail, contentDescription = null)
|
||||||
|
Text(stringResource(id = R.string.contact_us))
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -23,5 +23,6 @@
|
|||||||
<string name="inactive">Vergangene Spiele</string>
|
<string name="inactive">Vergangene Spiele</string>
|
||||||
<string name="menu_counter">Counter</string>
|
<string name="menu_counter">Counter</string>
|
||||||
<string name="menu_about">About</string>
|
<string name="menu_about">About</string>
|
||||||
|
<string name="contact_us">Schreib uns</string>
|
||||||
|
|
||||||
</resources>
|
</resources>
|
||||||
@@ -26,4 +26,6 @@
|
|||||||
<string name="inactive">Old Games</string>
|
<string name="inactive">Old Games</string>
|
||||||
<string name="menu_counter">Counter</string>
|
<string name="menu_counter">Counter</string>
|
||||||
<string name="menu_about">About</string>
|
<string name="menu_about">About</string>
|
||||||
|
<string name="contact_us">Contact us</string>
|
||||||
|
<string name="play_store" translatable="false">Play Store</string>
|
||||||
</resources>
|
</resources>
|
||||||
Reference in New Issue
Block a user