From 0c0ebded5ad6982ee5672cb5a7f7244e9003424b Mon Sep 17 00:00:00 2001 From: shabinder Date: Mon, 4 Jan 2021 17:25:13 +0530 Subject: [PATCH] Use of proper logo. --- .../com/shabinder/spotiflyer/MainActivity.kt | 32 ------------- .../spotiflyer/ui/home/MainScreen.kt | 43 ++++++++++++++++- .../shabinder/spotiflyer/ui/splash/Splash.kt | 2 +- .../main/res/drawable/ic_spotiflyer_logo.xml | 47 +++++++++++++++++++ 4 files changed, 90 insertions(+), 34 deletions(-) create mode 100644 app/src/main/res/drawable/ic_spotiflyer_logo.xml diff --git a/app/src/main/java/com/shabinder/spotiflyer/MainActivity.kt b/app/src/main/java/com/shabinder/spotiflyer/MainActivity.kt index d48af196..f178b62e 100644 --- a/app/src/main/java/com/shabinder/spotiflyer/MainActivity.kt +++ b/app/src/main/java/com/shabinder/spotiflyer/MainActivity.kt @@ -272,38 +272,6 @@ class MainActivity: AppCompatActivity(), PaymentResultListener { } -@Composable -fun AppBar( - backgroundColor: Color, - modifier: Modifier = Modifier -) { - TopAppBar( - backgroundColor = backgroundColor, - title = { - Row(verticalAlignment = Alignment.CenterVertically) { - Image( - imageVector = vectorResource(R.drawable.ic_launcher_foreground) - ) - Text( - text = "SpotiFlyer", - style = appNameStyle - ) - } - }, - /*actions = { - Providers(AmbientContentAlpha provides ContentAlpha.medium) { - IconButton( - onClick = { *//* TODO: Open Preferences*//* } - ) { - Icon(Icons.Filled.Settings, tint = Color.Gray) - } - } - },*/ - modifier = modifier, - elevation = 0.dp - ) -} - enum class SplashState { Shown, Completed } private val splashAlphaKey = FloatPropKey("Splash alpha") diff --git a/app/src/main/java/com/shabinder/spotiflyer/ui/home/MainScreen.kt b/app/src/main/java/com/shabinder/spotiflyer/ui/home/MainScreen.kt index c2387cf8..8ba35d86 100644 --- a/app/src/main/java/com/shabinder/spotiflyer/ui/home/MainScreen.kt +++ b/app/src/main/java/com/shabinder/spotiflyer/ui/home/MainScreen.kt @@ -16,19 +16,26 @@ package com.shabinder.spotiflyer.ui.home +import androidx.compose.foundation.Image import androidx.compose.foundation.background import androidx.compose.foundation.layout.* import androidx.compose.material.MaterialTheme +import androidx.compose.material.Text +import androidx.compose.material.TopAppBar import androidx.compose.runtime.Composable +import androidx.compose.ui.Alignment import androidx.compose.ui.Modifier +import androidx.compose.ui.graphics.Color +import androidx.compose.ui.res.vectorResource import androidx.compose.ui.unit.Dp import androidx.compose.ui.unit.dp import androidx.navigation.NavHostController import com.example.jetcaster.util.verticalGradientScrim -import com.shabinder.spotiflyer.AppBar import com.shabinder.spotiflyer.MainActivity +import com.shabinder.spotiflyer.R import com.shabinder.spotiflyer.SharedViewModel import com.shabinder.spotiflyer.navigation.ComposeNavigation +import com.shabinder.spotiflyer.ui.appNameStyle import dev.chrisbanes.accompanist.insets.statusBarsHeight @Composable @@ -68,3 +75,37 @@ fun MainScreen( ) } } + +@Composable +fun AppBar( + backgroundColor: Color, + modifier: Modifier = Modifier +) { + TopAppBar( + backgroundColor = backgroundColor, + title = { + Row(verticalAlignment = Alignment.CenterVertically) { + Image( + imageVector = vectorResource(R.drawable.ic_spotiflyer_logo), + Modifier.preferredSize(32.dp) + ) + Spacer(Modifier.padding(horizontal = 4.dp)) + Text( + text = "SpotiFlyer", + style = appNameStyle + ) + } + }, + /*actions = { + Providers(AmbientContentAlpha provides ContentAlpha.medium) { + IconButton( + onClick = { *//* TODO: Open Preferences*//* } + ) { + Icon(Icons.Filled.Settings, tint = Color.Gray) + } + } + },*/ + modifier = modifier, + elevation = 0.dp + ) +} diff --git a/app/src/main/java/com/shabinder/spotiflyer/ui/splash/Splash.kt b/app/src/main/java/com/shabinder/spotiflyer/ui/splash/Splash.kt index 9304d6c4..99d06f0b 100644 --- a/app/src/main/java/com/shabinder/spotiflyer/ui/splash/Splash.kt +++ b/app/src/main/java/com/shabinder/spotiflyer/ui/splash/Splash.kt @@ -49,7 +49,7 @@ fun Splash(modifier: Modifier = Modifier, onTimeout: () -> Unit) { delay(SplashWaitTime) currentOnTimeout() } - Image(imageVector = vectorResource(id = R.drawable.ic_launcher_foreground),Modifier.preferredSize(300.dp)) + Image(imageVector = vectorResource(id = R.drawable.ic_spotiflyer_logo)) MadeInIndia(Modifier.align(Alignment.BottomCenter)) } } diff --git a/app/src/main/res/drawable/ic_spotiflyer_logo.xml b/app/src/main/res/drawable/ic_spotiflyer_logo.xml new file mode 100644 index 00000000..bc68c3c7 --- /dev/null +++ b/app/src/main/res/drawable/ic_spotiflyer_logo.xml @@ -0,0 +1,47 @@ + + + + + + + + + + + + + + + + + + + + + + + + +