Update Theme.kt
Add menu button on Main-screen
This commit is contained in:
32
.idea/inspectionProfiles/Project_Default.xml
generated
Normal file
32
.idea/inspectionProfiles/Project_Default.xml
generated
Normal file
@@ -0,0 +1,32 @@
|
|||||||
|
<component name="InspectionProjectProfileManager">
|
||||||
|
<profile version="1.0">
|
||||||
|
<option name="myName" value="Project Default" />
|
||||||
|
<inspection_tool class="PreviewAnnotationInFunctionWithParameters" enabled="true" level="ERROR" enabled_by_default="true">
|
||||||
|
<option name="composableFile" value="true" />
|
||||||
|
</inspection_tool>
|
||||||
|
<inspection_tool class="PreviewApiLevelMustBeValid" enabled="true" level="ERROR" enabled_by_default="true">
|
||||||
|
<option name="composableFile" value="true" />
|
||||||
|
</inspection_tool>
|
||||||
|
<inspection_tool class="PreviewDimensionRespectsLimit" enabled="true" level="WARNING" enabled_by_default="true">
|
||||||
|
<option name="composableFile" value="true" />
|
||||||
|
</inspection_tool>
|
||||||
|
<inspection_tool class="PreviewFontScaleMustBeGreaterThanZero" enabled="true" level="ERROR" enabled_by_default="true">
|
||||||
|
<option name="composableFile" value="true" />
|
||||||
|
</inspection_tool>
|
||||||
|
<inspection_tool class="PreviewMultipleParameterProviders" enabled="true" level="ERROR" enabled_by_default="true">
|
||||||
|
<option name="composableFile" value="true" />
|
||||||
|
</inspection_tool>
|
||||||
|
<inspection_tool class="PreviewMustBeTopLevelFunction" enabled="true" level="ERROR" enabled_by_default="true">
|
||||||
|
<option name="composableFile" value="true" />
|
||||||
|
</inspection_tool>
|
||||||
|
<inspection_tool class="PreviewNeedsComposableAnnotation" enabled="true" level="ERROR" enabled_by_default="true">
|
||||||
|
<option name="composableFile" value="true" />
|
||||||
|
</inspection_tool>
|
||||||
|
<inspection_tool class="PreviewNotSupportedInUnitTestFiles" enabled="true" level="ERROR" enabled_by_default="true">
|
||||||
|
<option name="composableFile" value="true" />
|
||||||
|
</inspection_tool>
|
||||||
|
<inspection_tool class="PreviewPickerAnnotation" enabled="true" level="ERROR" enabled_by_default="true">
|
||||||
|
<option name="composableFile" value="true" />
|
||||||
|
</inspection_tool>
|
||||||
|
</profile>
|
||||||
|
</component>
|
||||||
@@ -10,12 +10,19 @@ import androidx.compose.foundation.layout.fillMaxSize
|
|||||||
import androidx.compose.foundation.layout.fillMaxWidth
|
import androidx.compose.foundation.layout.fillMaxWidth
|
||||||
import androidx.compose.foundation.layout.height
|
import androidx.compose.foundation.layout.height
|
||||||
import androidx.compose.foundation.layout.padding
|
import androidx.compose.foundation.layout.padding
|
||||||
|
import androidx.compose.foundation.layout.size
|
||||||
|
import androidx.compose.foundation.magnifier
|
||||||
import androidx.compose.foundation.rememberScrollState
|
import androidx.compose.foundation.rememberScrollState
|
||||||
import androidx.compose.foundation.shape.RoundedCornerShape
|
import androidx.compose.foundation.shape.RoundedCornerShape
|
||||||
import androidx.compose.foundation.verticalScroll
|
import androidx.compose.foundation.verticalScroll
|
||||||
|
import androidx.compose.material.icons.Icons
|
||||||
|
import androidx.compose.material.icons.filled.ArrowBack
|
||||||
|
import androidx.compose.material.icons.filled.Menu
|
||||||
import androidx.compose.material3.Button
|
import androidx.compose.material3.Button
|
||||||
import androidx.compose.material3.ButtonDefaults
|
import androidx.compose.material3.ButtonDefaults
|
||||||
import androidx.compose.material3.ExperimentalMaterial3Api
|
import androidx.compose.material3.ExperimentalMaterial3Api
|
||||||
|
import androidx.compose.material3.Icon
|
||||||
|
import androidx.compose.material3.IconButton
|
||||||
import androidx.compose.material3.MaterialTheme
|
import androidx.compose.material3.MaterialTheme
|
||||||
import androidx.compose.material3.Surface
|
import androidx.compose.material3.Surface
|
||||||
import androidx.compose.material3.Text
|
import androidx.compose.material3.Text
|
||||||
@@ -52,25 +59,30 @@ class MainActivity : ComponentActivity() {
|
|||||||
@Composable
|
@Composable
|
||||||
fun MainContent(){
|
fun MainContent(){
|
||||||
val context = LocalContext.current
|
val context = LocalContext.current
|
||||||
Column() {
|
Column{
|
||||||
TopAppBar(
|
TopAppBar(
|
||||||
colors = TopAppBarDefaults.centerAlignedTopAppBarColors(MaterialTheme.colorScheme.background),
|
colors = TopAppBarDefaults.centerAlignedTopAppBarColors(containerColor = MaterialTheme.colorScheme.primaryContainer),
|
||||||
title = {
|
title = {
|
||||||
Text(text = "CleverClass",
|
Text(text = "CleverClass",
|
||||||
fontFamily = FontFamily(Font(R.font.arlrdbd, FontWeight.Normal)))
|
fontFamily = FontFamily(Font(R.font.arlrdbd, FontWeight.Normal)),
|
||||||
|
color = MaterialTheme.colorScheme.onPrimary)
|
||||||
|
},
|
||||||
|
actions = {
|
||||||
|
IconButton(onClick = { /*TODO: menu*/ }) {
|
||||||
|
Icon(imageVector = Icons.Filled.Menu,
|
||||||
|
contentDescription = null,
|
||||||
|
modifier = Modifier.size(32.dp))
|
||||||
|
}
|
||||||
},
|
},
|
||||||
modifier = Modifier.fillMaxWidth()
|
modifier = Modifier.fillMaxWidth()
|
||||||
)
|
)
|
||||||
|
|
||||||
Column(modifier = Modifier.verticalScroll(rememberScrollState())) {
|
Column(modifier = Modifier.verticalScroll(rememberScrollState())) {
|
||||||
MainButton(onClick = { switchToActivity(context, PSEActivity::class.java) }, color = Color(0xFFFF8A80), text = "Periodensystem")
|
MainButton(onClick = { /*TODO: Stundenplan activity*/ }, color = Color(0xFFFF4081), text = "Stundenplan")
|
||||||
MainButton(onClick = { /*TODO*/ }, color = Color(0xFF8C9EFF), text = "Stundenplan")
|
MainButton(onClick = { /*TODO: Noten activity*/ }, color = Color(0xFFFFAB40), text = "Noten")
|
||||||
MainButton(onClick = { /*TODO*/ }, color = Color(0xFFEA80FC), text = "Noten")
|
MainButton(onClick = { switchToActivity(context, PSEActivity::class.java) }, color = Color(0xFF536DFE), text = "Periodensystem")
|
||||||
MainButton(onClick = { /*TODO*/ }, color = Color(0xFF40C4FF), text = "Mebis")
|
MainButton(onClick = { /*TODO: Mebis activity*/ }, color = Color(0xFFE040FB), text = "Mebis")
|
||||||
MainButton(onClick = { /*TODO*/ }, color = Color(0xFFB2FF59), text = "DSBmobile")
|
MainButton(onClick = { /*TODO: DSBmobile activity*/ }, color = Color(0xFFFF6E40), text = "DSBmobile")
|
||||||
MainButton(onClick = { /*TODO*/ }, color = Color(0xFF69F0AE), text = "...")
|
|
||||||
MainButton(onClick = { /*TODO*/ }, color = Color(0xFFFFD740), text = "...")
|
|
||||||
MainButton(onClick = { /*TODO*/ }, color = Color(0xFFE040FB), text = "...")
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -6,6 +6,7 @@ import androidx.activity.compose.setContent
|
|||||||
import androidx.compose.foundation.layout.Column
|
import androidx.compose.foundation.layout.Column
|
||||||
import androidx.compose.foundation.layout.fillMaxSize
|
import androidx.compose.foundation.layout.fillMaxSize
|
||||||
import androidx.compose.foundation.layout.fillMaxWidth
|
import androidx.compose.foundation.layout.fillMaxWidth
|
||||||
|
import androidx.compose.foundation.layout.size
|
||||||
import androidx.compose.material.icons.Icons
|
import androidx.compose.material.icons.Icons
|
||||||
import androidx.compose.material.icons.filled.ArrowBack
|
import androidx.compose.material.icons.filled.ArrowBack
|
||||||
import androidx.compose.material3.ExperimentalMaterial3Api
|
import androidx.compose.material3.ExperimentalMaterial3Api
|
||||||
@@ -21,6 +22,7 @@ import androidx.compose.ui.Modifier
|
|||||||
import androidx.compose.ui.text.font.Font
|
import androidx.compose.ui.text.font.Font
|
||||||
import androidx.compose.ui.text.font.FontFamily
|
import androidx.compose.ui.text.font.FontFamily
|
||||||
import androidx.compose.ui.text.font.FontWeight
|
import androidx.compose.ui.text.font.FontWeight
|
||||||
|
import androidx.compose.ui.unit.dp
|
||||||
import com.schoolapp.cleverclass.ui.theme.CleverClassTheme
|
import com.schoolapp.cleverclass.ui.theme.CleverClassTheme
|
||||||
|
|
||||||
class PSEActivity : ComponentActivity() {
|
class PSEActivity : ComponentActivity() {
|
||||||
@@ -43,7 +45,7 @@ class PSEActivity : ComponentActivity() {
|
|||||||
fun PSEContent(activity: ComponentActivity){
|
fun PSEContent(activity: ComponentActivity){
|
||||||
Column() {
|
Column() {
|
||||||
TopAppBar(
|
TopAppBar(
|
||||||
colors = TopAppBarDefaults.centerAlignedTopAppBarColors(MaterialTheme.colorScheme.background),
|
colors = TopAppBarDefaults.centerAlignedTopAppBarColors(MaterialTheme.colorScheme.primaryContainer),
|
||||||
title = {
|
title = {
|
||||||
Text(text = "Periodensystem",
|
Text(text = "Periodensystem",
|
||||||
fontFamily = FontFamily(Font(R.font.arlrdbd, FontWeight.Normal))
|
fontFamily = FontFamily(Font(R.font.arlrdbd, FontWeight.Normal))
|
||||||
@@ -53,7 +55,8 @@ fun PSEContent(activity: ComponentActivity){
|
|||||||
IconButton(onClick = { activity.finish() }) {
|
IconButton(onClick = { activity.finish() }) {
|
||||||
Icon(
|
Icon(
|
||||||
imageVector = Icons.Filled.ArrowBack,
|
imageVector = Icons.Filled.ArrowBack,
|
||||||
contentDescription = null
|
contentDescription = null,
|
||||||
|
modifier = Modifier.size(28.dp)
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
|||||||
@@ -2,10 +2,10 @@ package com.schoolapp.cleverclass.ui.theme
|
|||||||
|
|
||||||
import androidx.compose.ui.graphics.Color
|
import androidx.compose.ui.graphics.Color
|
||||||
|
|
||||||
val Purple80 = Color(0xFFD0BCFF)
|
val Black100 = Color(0xFF000000)
|
||||||
val PurpleGrey80 = Color(0xFFCCC2DC)
|
val Black90 = Color(0xFF141414)
|
||||||
val Pink80 = Color(0xFFEFB8C8)
|
val Black70 = Color(0xFF1F1F1F)
|
||||||
|
|
||||||
val Purple40 = Color(0xFF6650a4)
|
val White100 = Color(0xFFFFFFFF)
|
||||||
val PurpleGrey40 = Color(0xFF625b71)
|
val White90 = Color(0xFFEBEBEB)
|
||||||
val Pink40 = Color(0xFF7D5260)
|
val White70 = Color(0xFFE0E0E0)
|
||||||
@@ -16,32 +16,22 @@ import androidx.compose.ui.platform.LocalView
|
|||||||
import androidx.core.view.WindowCompat
|
import androidx.core.view.WindowCompat
|
||||||
|
|
||||||
private val DarkColorScheme = darkColorScheme(
|
private val DarkColorScheme = darkColorScheme(
|
||||||
primary = Purple80,
|
background = Black90,
|
||||||
secondary = PurpleGrey80,
|
primaryContainer = Black70,
|
||||||
tertiary = Pink80
|
onPrimary = White100
|
||||||
)
|
)
|
||||||
|
|
||||||
private val LightColorScheme = lightColorScheme(
|
private val LightColorScheme = lightColorScheme(
|
||||||
primary = Purple40,
|
background = White90,
|
||||||
secondary = PurpleGrey40,
|
primaryContainer = White70,
|
||||||
tertiary = Pink40
|
onPrimary = Black100
|
||||||
|
|
||||||
/* Other default colors to override
|
|
||||||
background = Color(0xFFFFFBFE),
|
|
||||||
surface = Color(0xFFFFFBFE),
|
|
||||||
onPrimary = Color.White,
|
|
||||||
onSecondary = Color.White,
|
|
||||||
onTertiary = Color.White,
|
|
||||||
onBackground = Color(0xFF1C1B1F),
|
|
||||||
onSurface = Color(0xFF1C1B1F),
|
|
||||||
*/
|
|
||||||
)
|
)
|
||||||
|
|
||||||
@Composable
|
@Composable
|
||||||
fun CleverClassTheme(
|
fun CleverClassTheme(
|
||||||
darkTheme: Boolean = isSystemInDarkTheme(),
|
darkTheme: Boolean = isSystemInDarkTheme(),
|
||||||
// Dynamic color is available on Android 12+
|
// Dynamic color is available on Android 12+
|
||||||
dynamicColor: Boolean = true,
|
dynamicColor: Boolean = false,
|
||||||
content: @Composable () -> Unit
|
content: @Composable () -> Unit
|
||||||
) {
|
) {
|
||||||
val colorScheme = when {
|
val colorScheme = when {
|
||||||
|
|||||||
Reference in New Issue
Block a user