You've already forked RekomenciMobile
fixed fabs
This commit is contained in:
@@ -2,6 +2,7 @@ package com.prodhack.moscow2025.presentation.screens.main
|
|||||||
|
|
||||||
import androidx.compose.foundation.background
|
import androidx.compose.foundation.background
|
||||||
import androidx.compose.foundation.layout.Arrangement
|
import androidx.compose.foundation.layout.Arrangement
|
||||||
|
import androidx.compose.foundation.layout.Box
|
||||||
import androidx.compose.foundation.layout.Column
|
import androidx.compose.foundation.layout.Column
|
||||||
import androidx.compose.foundation.layout.Row
|
import androidx.compose.foundation.layout.Row
|
||||||
import androidx.compose.foundation.layout.Spacer
|
import androidx.compose.foundation.layout.Spacer
|
||||||
@@ -48,23 +49,7 @@ fun ErrorCollectorScope.MainScreen(
|
|||||||
openCreateResume: () -> Unit,
|
openCreateResume: () -> Unit,
|
||||||
viewModel: MainScreenViewModel = koinViewModel()
|
viewModel: MainScreenViewModel = koinViewModel()
|
||||||
) {
|
) {
|
||||||
Scaffold(
|
Box (modifier = modifier){
|
||||||
modifier = modifier,
|
|
||||||
floatingActionButton = {
|
|
||||||
ExtendedFloatingActionButton(
|
|
||||||
onClick = {
|
|
||||||
openCreateResume()
|
|
||||||
},
|
|
||||||
icon = {
|
|
||||||
Icon(
|
|
||||||
painter = painterResource(R.drawable.ic_plus),
|
|
||||||
"Extended floating action button."
|
|
||||||
)
|
|
||||||
},
|
|
||||||
text = { Text(text = "Добавить резюме") },
|
|
||||||
)
|
|
||||||
}, floatingActionButtonPosition = FabPosition.Center
|
|
||||||
) {
|
|
||||||
val items = viewModel.resumeList.collectAsLazyPagingItems()
|
val items = viewModel.resumeList.collectAsLazyPagingItems()
|
||||||
|
|
||||||
MainScreenContent(
|
MainScreenContent(
|
||||||
@@ -72,6 +57,22 @@ fun ErrorCollectorScope.MainScreen(
|
|||||||
openCreateResume = openCreateResume,
|
openCreateResume = openCreateResume,
|
||||||
openResumeDetails = openResumeDetails
|
openResumeDetails = openResumeDetails
|
||||||
)
|
)
|
||||||
|
|
||||||
|
ExtendedFloatingActionButton(
|
||||||
|
modifier = Modifier
|
||||||
|
.align(Alignment.BottomCenter)
|
||||||
|
.padding(bottom = Paddings.large),
|
||||||
|
onClick = {
|
||||||
|
openCreateResume()
|
||||||
|
},
|
||||||
|
icon = {
|
||||||
|
Icon(
|
||||||
|
painter = painterResource(R.drawable.ic_plus),
|
||||||
|
"Extended floating action button."
|
||||||
|
)
|
||||||
|
},
|
||||||
|
text = { Text(text = "Добавить резюме") },
|
||||||
|
)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -161,6 +162,10 @@ private fun MainScreenContent(
|
|||||||
CircularProgressIndicator()
|
CircularProgressIndicator()
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
item {
|
||||||
|
Spacer(modifier = Modifier.height(Paddings.large*4.5f))
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
+26
-12
@@ -2,6 +2,7 @@ package com.prodhack.moscow2025.presentation.screens.resumeDetails
|
|||||||
|
|
||||||
import android.widget.Toast
|
import android.widget.Toast
|
||||||
import androidx.compose.foundation.layout.Arrangement
|
import androidx.compose.foundation.layout.Arrangement
|
||||||
|
import androidx.compose.foundation.layout.Box
|
||||||
import androidx.compose.foundation.layout.Column
|
import androidx.compose.foundation.layout.Column
|
||||||
import androidx.compose.foundation.layout.ColumnScope
|
import androidx.compose.foundation.layout.ColumnScope
|
||||||
import androidx.compose.foundation.layout.FlowRow
|
import androidx.compose.foundation.layout.FlowRow
|
||||||
@@ -40,7 +41,6 @@ import com.prodhack.moscow2025.domain.models.Project
|
|||||||
import com.prodhack.moscow2025.domain.models.ResumeModel
|
import com.prodhack.moscow2025.domain.models.ResumeModel
|
||||||
import com.prodhack.moscow2025.domain.models.WorkExperience
|
import com.prodhack.moscow2025.domain.models.WorkExperience
|
||||||
import com.prodhack.moscow2025.presentation.components.standart.TBubble
|
import com.prodhack.moscow2025.presentation.components.standart.TBubble
|
||||||
import com.prodhack.moscow2025.presentation.components.standart.TTFloatingActionButton
|
|
||||||
import com.prodhack.moscow2025.presentation.navigation.AppDestination
|
import com.prodhack.moscow2025.presentation.navigation.AppDestination
|
||||||
import com.prodhack.moscow2025.presentation.theme.Paddings
|
import com.prodhack.moscow2025.presentation.theme.Paddings
|
||||||
import com.prodhack.moscow2025.presentation.utils.ErrorCollectorScope
|
import com.prodhack.moscow2025.presentation.utils.ErrorCollectorScope
|
||||||
@@ -55,6 +55,8 @@ import org.koin.core.parameter.parametersOf
|
|||||||
@Composable
|
@Composable
|
||||||
fun ErrorCollectorScope.ResumeDetailsScreen(
|
fun ErrorCollectorScope.ResumeDetailsScreen(
|
||||||
navBackStackEntry: NavBackStackEntry,
|
navBackStackEntry: NavBackStackEntry,
|
||||||
|
onEditResume: (String) -> Unit,
|
||||||
|
onHistory: () -> Unit,
|
||||||
viewModel: ResumeDetailsViewModel = koinViewModel {
|
viewModel: ResumeDetailsViewModel = koinViewModel {
|
||||||
parametersOf(
|
parametersOf(
|
||||||
navBackStackEntry.arguments?.getString(AppDestination.ResumeDetails.ARG_ID, "") ?: ""
|
navBackStackEntry.arguments?.getString(AppDestination.ResumeDetails.ARG_ID, "") ?: ""
|
||||||
@@ -83,19 +85,31 @@ fun ErrorCollectorScope.ResumeDetailsScreen(
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
) { resume ->
|
) { resume ->
|
||||||
Scaffold(floatingActionButton = {
|
Box {
|
||||||
ExtendedFloatingActionButton(
|
|
||||||
onClick = { },
|
|
||||||
icon = { Icon(painter = painterResource(R.drawable.ic_pen), "Extended floating action button.") },
|
|
||||||
text = { Text(text = "Редактировать резюме") },
|
|
||||||
)
|
|
||||||
}, floatingActionButtonPosition = FabPosition.Center) {
|
|
||||||
ResumeDetailsContent(
|
ResumeDetailsContent(
|
||||||
resume = resume,
|
resume = resume,
|
||||||
onBack = { navController.popBackStack() },
|
onBack = { navController.popBackStack() },
|
||||||
onHistory = {
|
onHistory = onHistory
|
||||||
Toast.makeText(context, "История появится позже", Toast.LENGTH_SHORT).show()
|
)
|
||||||
}
|
ExtendedFloatingActionButton(
|
||||||
|
modifier = Modifier
|
||||||
|
.align(Alignment.BottomCenter)
|
||||||
|
.padding(bottom = Paddings.large),
|
||||||
|
onClick = {
|
||||||
|
onEditResume(
|
||||||
|
navBackStackEntry.arguments?.getString(
|
||||||
|
AppDestination.ResumeDetails.ARG_ID,
|
||||||
|
""
|
||||||
|
) ?: ""
|
||||||
|
)
|
||||||
|
},
|
||||||
|
icon = {
|
||||||
|
Icon(
|
||||||
|
painter = painterResource(R.drawable.ic_pen),
|
||||||
|
"Extended floating action button."
|
||||||
|
)
|
||||||
|
},
|
||||||
|
text = { Text(text = "Редактировать резюме") },
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -264,7 +278,7 @@ private fun ResumeDetailsContent(
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
Spacer(modifier = Modifier.height(Paddings.large))
|
Spacer(modifier = Modifier.height(Paddings.large * 4.5f))
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user