#18 add edit profile button
This commit is contained in:
		
							parent
							
								
									f82e83867c
								
							
						
					
					
						commit
						3900e3c18a
					
				
					 4 changed files with 49 additions and 4 deletions
				
			
		| 
						 | 
				
			
			@ -1,5 +1,9 @@
 | 
			
		|||
package be.ugent.sel.studeez.screens.home
 | 
			
		||||
 | 
			
		||||
import androidx.compose.material.Icon
 | 
			
		||||
import androidx.compose.material.IconButton
 | 
			
		||||
import androidx.compose.material.icons.Icons
 | 
			
		||||
import androidx.compose.material.icons.filled.Person
 | 
			
		||||
import androidx.compose.runtime.Composable
 | 
			
		||||
import androidx.compose.ui.Modifier
 | 
			
		||||
import androidx.hilt.navigation.compose.hiltViewModel
 | 
			
		||||
| 
						 | 
				
			
			@ -18,10 +22,21 @@ fun HomeScreen(
 | 
			
		|||
    PrimaryScreenTemplate(
 | 
			
		||||
        title = resources().getString(R.string.home),
 | 
			
		||||
        open = open,
 | 
			
		||||
        openAndPopUp = openAndPopUp
 | 
			
		||||
        openAndPopUp = openAndPopUp,
 | 
			
		||||
        action = { FriendsAction() }
 | 
			
		||||
    ) {
 | 
			
		||||
        BasicButton(R.string.start_session, Modifier.basicButton()) {
 | 
			
		||||
            viewModel.onStartSessionClick(open)
 | 
			
		||||
        }
 | 
			
		||||
    }
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
@Composable
 | 
			
		||||
fun FriendsAction () {
 | 
			
		||||
    IconButton(onClick = { /*TODO*/ }) {
 | 
			
		||||
        Icon(
 | 
			
		||||
            imageVector = Icons.Default.Person,
 | 
			
		||||
            contentDescription = resources().getString(R.string.friends)
 | 
			
		||||
        )
 | 
			
		||||
    }
 | 
			
		||||
}
 | 
			
		||||
| 
						 | 
				
			
			@ -1,5 +1,9 @@
 | 
			
		|||
package be.ugent.sel.studeez.screens.profile
 | 
			
		||||
 | 
			
		||||
import androidx.compose.material.Icon
 | 
			
		||||
import androidx.compose.material.IconButton
 | 
			
		||||
import androidx.compose.material.icons.Icons
 | 
			
		||||
import androidx.compose.material.icons.filled.Edit
 | 
			
		||||
import androidx.compose.runtime.*
 | 
			
		||||
import androidx.hilt.navigation.compose.hiltViewModel
 | 
			
		||||
import be.ugent.sel.studeez.R
 | 
			
		||||
| 
						 | 
				
			
			@ -22,8 +26,20 @@ fun ProfileScreen(
 | 
			
		|||
    PrimaryScreenTemplate(
 | 
			
		||||
        title = resources().getString(AppText.profile),
 | 
			
		||||
        open = open,
 | 
			
		||||
        openAndPopUp = openAndPopUp
 | 
			
		||||
        openAndPopUp = openAndPopUp,
 | 
			
		||||
        action = { EditAction() }
 | 
			
		||||
    ) {
 | 
			
		||||
        Headline(text = (username ?: resources().getString(R.string.no_username)))
 | 
			
		||||
    }
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
@Composable
 | 
			
		||||
fun EditAction() {
 | 
			
		||||
    IconButton(onClick = { /*TODO*/ }) {
 | 
			
		||||
        Icon(
 | 
			
		||||
            imageVector = Icons.Default.Edit,
 | 
			
		||||
            contentDescription = resources().getString(AppText.edit_profile)
 | 
			
		||||
        )
 | 
			
		||||
 | 
			
		||||
    }
 | 
			
		||||
}
 | 
			
		||||
		Reference in a new issue