Skip to content

Commit

Permalink
fix
Browse files Browse the repository at this point in the history
Jordan Akinpelu (akinpelud) committed Apr 4, 2023
1 parent e3d983a commit ec574f3
Showing 2 changed files with 68 additions and 0 deletions.
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
package com.example.powerof10

data class MenuItems(
val id:Int,
val title: String,
val route:String
)
61 changes: 61 additions & 0 deletions PowerOf10/app/src/main/java/com/example/powerof10/NavDrawer.kt
Original file line number Diff line number Diff line change
@@ -0,0 +1,61 @@
package com.example.powerof10

import android.os.Bundle
import androidx.activity.ComponentActivity
import androidx.activity.compose.setContent
import androidx.compose.foundation.background
import androidx.compose.foundation.clickable
import androidx.compose.foundation.layout.*
import androidx.compose.foundation.lazy.LazyColumn
import androidx.compose.foundation.lazy.items
import androidx.compose.material.MaterialTheme
import androidx.compose.material.Surface
import androidx.compose.material.Text
import androidx.compose.runtime.Composable
import androidx.compose.ui.Modifier
import androidx.compose.ui.graphics.Color
import androidx.compose.ui.tooling.preview.Preview
import androidx.compose.ui.unit.dp
import androidx.compose.ui.unit.sp
import com.example.powerof10.ui.theme.PowerOf10Theme

class NavDrawer : ComponentActivity() {
override fun onCreate(savedInstanceState: Bundle?) {
super.onCreate(savedInstanceState)
setContent {
PowerOf10Theme {
// A surface container using the 'background' color from the theme
Surface(
modifier = Modifier.fillMaxSize(),
color = MaterialTheme.colors.background
) {

}
}
}
}
}


@Composable
fun NavDrawerBody(items:List<MenuItems>,onItemClick: (MenuItems)->Unit) {

LazyColumn(modifier = Modifier.fillMaxSize().background(Color(0xFFE5383B))){
items(items){item ->
Row(modifier = Modifier
.clickable { onItemClick(item) }
.padding(20.dp)) {
Text(text = item.title, fontSize = 24.sp, color = Color.White)
Spacer(modifier = Modifier.fillMaxWidth())
}
}
}
}


@Composable
fun DefaultPreview2() {
PowerOf10Theme {

}
}

0 comments on commit ec574f3

Please sign in to comment.