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.layout.Arrangement
|
||||
import androidx.compose.foundation.layout.Box
|
||||
import androidx.compose.foundation.layout.Column
|
||||
import androidx.compose.foundation.layout.Row
|
||||
import androidx.compose.foundation.layout.Spacer
|
||||
@@ -48,10 +49,19 @@ fun ErrorCollectorScope.MainScreen(
|
||||
openCreateResume: () -> Unit,
|
||||
viewModel: MainScreenViewModel = koinViewModel()
|
||||
) {
|
||||
Scaffold(
|
||||
modifier = modifier,
|
||||
floatingActionButton = {
|
||||
Box (modifier = modifier){
|
||||
val items = viewModel.resumeList.collectAsLazyPagingItems()
|
||||
|
||||
MainScreenContent(
|
||||
items = items,
|
||||
openCreateResume = openCreateResume,
|
||||
openResumeDetails = openResumeDetails
|
||||
)
|
||||
|
||||
ExtendedFloatingActionButton(
|
||||
modifier = Modifier
|
||||
.align(Alignment.BottomCenter)
|
||||
.padding(bottom = Paddings.large),
|
||||
onClick = {
|
||||
openCreateResume()
|
||||
},
|
||||
@@ -63,15 +73,6 @@ fun ErrorCollectorScope.MainScreen(
|
||||
},
|
||||
text = { Text(text = "Добавить резюме") },
|
||||
)
|
||||
}, floatingActionButtonPosition = FabPosition.Center
|
||||
) {
|
||||
val items = viewModel.resumeList.collectAsLazyPagingItems()
|
||||
|
||||
MainScreenContent(
|
||||
items = items,
|
||||
openCreateResume = openCreateResume,
|
||||
openResumeDetails = openResumeDetails
|
||||
)
|
||||
}
|
||||
}
|
||||
|
||||
@@ -161,6 +162,10 @@ private fun MainScreenContent(
|
||||
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 androidx.compose.foundation.layout.Arrangement
|
||||
import androidx.compose.foundation.layout.Box
|
||||
import androidx.compose.foundation.layout.Column
|
||||
import androidx.compose.foundation.layout.ColumnScope
|
||||
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.WorkExperience
|
||||
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.theme.Paddings
|
||||
import com.prodhack.moscow2025.presentation.utils.ErrorCollectorScope
|
||||
@@ -55,6 +55,8 @@ import org.koin.core.parameter.parametersOf
|
||||
@Composable
|
||||
fun ErrorCollectorScope.ResumeDetailsScreen(
|
||||
navBackStackEntry: NavBackStackEntry,
|
||||
onEditResume: (String) -> Unit,
|
||||
onHistory: () -> Unit,
|
||||
viewModel: ResumeDetailsViewModel = koinViewModel {
|
||||
parametersOf(
|
||||
navBackStackEntry.arguments?.getString(AppDestination.ResumeDetails.ARG_ID, "") ?: ""
|
||||
@@ -83,19 +85,31 @@ fun ErrorCollectorScope.ResumeDetailsScreen(
|
||||
}
|
||||
}
|
||||
) { resume ->
|
||||
Scaffold(floatingActionButton = {
|
||||
ExtendedFloatingActionButton(
|
||||
onClick = { },
|
||||
icon = { Icon(painter = painterResource(R.drawable.ic_pen), "Extended floating action button.") },
|
||||
text = { Text(text = "Редактировать резюме") },
|
||||
)
|
||||
}, floatingActionButtonPosition = FabPosition.Center) {
|
||||
Box {
|
||||
ResumeDetailsContent(
|
||||
resume = resume,
|
||||
onBack = { navController.popBackStack() },
|
||||
onHistory = {
|
||||
Toast.makeText(context, "История появится позже", Toast.LENGTH_SHORT).show()
|
||||
}
|
||||
onHistory = onHistory
|
||||
)
|
||||
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