Skip to content

Commit

Permalink
Added some fonts and fixed Gyro Scaffold
Browse files Browse the repository at this point in the history
  • Loading branch information
h0ker committed May 16, 2024
1 parent c748527 commit b4b0a13
Show file tree
Hide file tree
Showing 7 changed files with 33 additions and 9 deletions.
10 changes: 5 additions & 5 deletions app/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,8 @@ android {
applicationId = "com.carbidecowboy.supraexample"
minSdk = 28
targetSdk = 34
versionCode = 2
versionName = "0.0.3"
versionCode = 4
versionName = "0.0.4"

testInstrumentationRunner = "androidx.test.runner.AndroidJUnitRunner"
vectorDrawables {
Expand All @@ -32,11 +32,11 @@ android {
}
}
compileOptions {
sourceCompatibility = JavaVersion.VERSION_1_8
targetCompatibility = JavaVersion.VERSION_1_8
sourceCompatibility = JavaVersion.VERSION_17
targetCompatibility = JavaVersion.VERSION_17
}
kotlinOptions {
jvmTarget = "1.8"
jvmTarget = "17"
}
buildFeatures {
compose = true
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,8 +25,11 @@ import androidx.compose.material3.Text
import androidx.compose.runtime.Composable
import androidx.compose.ui.Modifier
import androidx.compose.ui.graphics.Color
import androidx.compose.ui.text.font.Font
import androidx.compose.ui.text.font.FontFamily
import androidx.compose.ui.tooling.preview.Preview
import androidx.compose.ui.unit.dp
import androidx.compose.ui.unit.sp
import androidx.navigation.compose.NavHost
import androidx.navigation.compose.composable
import androidx.navigation.compose.rememberNavController
Expand All @@ -36,6 +39,7 @@ import com.carbidecowboy.supra.presentation.cards.TextureType
import com.carbidecowboy.supra.presentation.list_items.SupraTextureListItem
import com.carbidecowboy.supra.presentation.scaffolds.SupraGyroScaffold
import com.carbidecowboy.supra.presentation.scaffolds.SupraScaffold
import com.carbidecowboy.supraexample.R
import com.carbidecowboy.supraexample.domain.models.NavRoutes
import com.carbidecowboy.supraexample.presentation.theme.SupraExampleTheme
import dagger.hilt.android.AndroidEntryPoint
Expand All @@ -45,8 +49,26 @@ class MainActivity : ComponentActivity() {
override fun onCreate(savedInstanceState: Bundle?) {
super.onCreate(savedInstanceState)
setContent {

val titleFont = FontFamily(Font(com.carbidecowboy.supra.R.font.univers_light))

SupraExampleTheme {
SupraScaffold(borderColor = Color.LightGray, backgroundColor = Color.DarkGray) {
SupraGyroScaffold(
borderColor = Color.LightGray,
backgroundColor = Color.DarkGray,
topBar = {
Row(
modifier = Modifier.padding(horizontal = 16.dp, vertical = 4.dp)
) {
Text(
text = "SUPRA",
fontFamily = titleFont,
fontSize = 32.sp,
color = Color.Black
)
}
}
) {

val navController = rememberNavController()

Expand Down
2 changes: 1 addition & 1 deletion supra/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,7 @@ afterEvaluate {
from(components["release"])
groupId = "com.github.CarbideCowboy"
artifactId = "Supra"
version = "0.0.3"
version = "0.0.4"
}
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,8 @@ import androidx.hilt.navigation.compose.hiltViewModel
fun SupraGyroScaffold(
topBar: (@Composable () -> Unit)? = null,
bottomBar: (@Composable () -> Unit)? = null,
borderColor: Color,
backgroundColor: Color,
content: @Composable (modifier: Modifier) -> Unit
) {
val viewModel: GyroScaffoldViewModel = hiltViewModel()
Expand All @@ -41,7 +43,7 @@ fun SupraGyroScaffold(
bottomBar = {
bottomBar?.invoke()
},
containerColor = Color.LightGray
containerColor = borderColor
) { paddingValues ->
Box(
modifier = Modifier.padding(paddingValues),
Expand All @@ -58,7 +60,7 @@ fun SupraGyroScaffold(
.padding(vertical = 16.dp, horizontal = 8.dp)
.shadow(elevation = 3.dp, shape = RoundedCornerShape(16.dp))
.clip(RoundedCornerShape(16.dp)),
color = Color.DarkGray
color = backgroundColor
) {
content(
Modifier
Expand Down
Binary file added supra/src/main/res/font/univers_bold.ttf
Binary file not shown.
Binary file added supra/src/main/res/font/univers_light.ttf
Binary file not shown.
Binary file added supra/src/main/res/font/univers_regular.ttf
Binary file not shown.

0 comments on commit b4b0a13

Please sign in to comment.