Skip to content
This repository has been archived by the owner on Jan 10, 2025. It is now read-only.

Commit

Permalink
Add button that routes to donation info page
Browse files Browse the repository at this point in the history
Info icon button is added to navigation bar on the Home page, which I reused from the Login page
  • Loading branch information
Hanan Osman committed Dec 4, 2023
1 parent c3567e2 commit 1fb0d17
Show file tree
Hide file tree
Showing 2 changed files with 47 additions and 3 deletions.
35 changes: 32 additions & 3 deletions app/src/main/java/com/example/belindas_closet/screen/Home.kt
Original file line number Diff line number Diff line change
Expand Up @@ -12,10 +12,15 @@ import androidx.compose.foundation.layout.size
import androidx.compose.foundation.layout.wrapContentSize
import androidx.compose.foundation.lazy.LazyColumn
import androidx.compose.foundation.lazy.items
import androidx.compose.material.icons.Icons
import androidx.compose.material.icons.filled.Menu
import androidx.compose.material3.Button
import androidx.compose.material3.Card
import androidx.compose.material3.ExperimentalMaterial3Api
import androidx.compose.material3.Icon
import androidx.compose.material3.IconButton
import androidx.compose.material3.Text
import androidx.compose.material3.TextButton
import androidx.compose.material3.TopAppBar
import androidx.compose.runtime.Composable
import androidx.compose.ui.Alignment
import androidx.compose.ui.Modifier
Expand All @@ -36,12 +41,36 @@ import com.example.belindas_closet.model.Product
import com.example.belindas_closet.model.ProductType


@OptIn(ExperimentalMaterial3Api::class)
@Composable
fun HomePage(navController: NavController) {
TopAppBar(
title = { Text("") },
actions = {
IconButton(
onClick = {
navController.navigate(Routes.DonationInfo.route)
}
) {
Icon(
painter = painterResource(R.drawable.info_icon),
contentDescription = "Donation Info page",
modifier = Modifier.padding(10.dp)
)
}
IconButton(
onClick = {
}
) {
Icon(imageVector = Icons.Default.Menu, contentDescription = "Menu")
}
}

)
Row(
modifier = Modifier
.size(125.dp)
.padding(top = 10.dp, start = 10.dp),
.size(75.dp)
.padding(top = 20.dp, start = 10.dp),
verticalAlignment = Alignment.Top,
horizontalArrangement = Arrangement.Start
) {
Expand Down
15 changes: 15 additions & 0 deletions app/src/main/res/drawable/info_icon.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
<vector xmlns:android="http://schemas.android.com/apk/res/android"
android:width="27.964dp"
android:height="27.964dp"
android:viewportWidth="27.964"
android:viewportHeight="27.964">
<path
android:pathData="M13.982,0.001C6.259,0.001 0,6.259 0,13.984c0,7.721 6.259,13.98 13.982,13.98c7.722,0 13.982,-6.26 13.982,-13.98C27.965,6.259 21.704,0.001 13.982,0.001zM13.982,26.533c-6.933,0 -12.551,-5.619 -12.551,-12.549c0,-6.935 5.618,-12.552 12.551,-12.552c6.931,0 12.55,5.617 12.55,12.552C26.532,20.914 20.913,26.533 13.982,26.533z"
android:fillColor="#000000"/>
<path
android:pathData="M12.004,10.551h3.931v12.649h-3.931z"
android:fillColor="#000000"/>
<path
android:pathData="M13.995,5.072c-1.265,0 -2.095,0.852 -2.095,1.963c0,1.087 0.802,1.964 2.044,1.964c1.317,0 2.119,-0.877 2.119,-1.964C16.037,5.924 15.262,5.072 13.995,5.072z"
android:fillColor="#000000"/>
</vector>

0 comments on commit 1fb0d17

Please sign in to comment.