|
|
|
@ -18,7 +18,6 @@ import androidx.compose.runtime.livedata.observeAsState |
|
|
|
|
import androidx.compose.runtime.rememberCoroutineScope |
|
|
|
|
import androidx.compose.ui.Alignment |
|
|
|
|
import androidx.compose.ui.Modifier |
|
|
|
|
import androidx.compose.ui.draw.rotate |
|
|
|
|
import androidx.compose.ui.graphics.Color |
|
|
|
|
import androidx.compose.ui.layout.ContentScale |
|
|
|
|
import androidx.compose.ui.platform.LocalFocusManager |
|
|
|
@ -78,38 +77,69 @@ fun Body() { |
|
|
|
|
if(snackBarMsg!=""){ |
|
|
|
|
val scope= rememberCoroutineScope() |
|
|
|
|
scope.launch { |
|
|
|
|
val result=scaffoldState.snackbarHostState.showSnackbar( |
|
|
|
|
scaffoldState.snackbarHostState.showSnackbar( |
|
|
|
|
message = snackBarMsg |
|
|
|
|
) |
|
|
|
|
model.reset() |
|
|
|
|
} |
|
|
|
|
// scope.launch { |
|
|
|
|
// delay(1000) |
|
|
|
|
// scaffoldState.snackbarHostState.currentSnackbarData?.dismiss() |
|
|
|
|
// } |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
composable(MainMenu.Center.name) { |
|
|
|
|
Box(modifier = Modifier.fillMaxSize()) { |
|
|
|
|
Column(Modifier.rotate(180F)) { |
|
|
|
|
MainBottomAppBar(MainMenu.Center, navController, Modifier.rotate(180F)) |
|
|
|
|
Row( |
|
|
|
|
modifier = Modifier |
|
|
|
|
.fillMaxSize() |
|
|
|
|
.rotate(180F), |
|
|
|
|
horizontalArrangement = Arrangement.Center, |
|
|
|
|
verticalAlignment = Alignment.CenterVertically |
|
|
|
|
) { |
|
|
|
|
AnimationText(text = "个人中心") |
|
|
|
|
Center(navController = navController) |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
/** |
|
|
|
|
* 个人中心 |
|
|
|
|
* |
|
|
|
|
*/ |
|
|
|
|
@Composable |
|
|
|
|
fun Center(navController: NavController){ |
|
|
|
|
MainFrame(background = { CenterBackground() }, mainMenu = MainMenu.Center, nav = navController) { |
|
|
|
|
Column(modifier = Modifier |
|
|
|
|
.weight(0.33F) |
|
|
|
|
.fillMaxWidth(),verticalArrangement = Arrangement.Bottom) { |
|
|
|
|
Card(backgroundColor = Color.White) { |
|
|
|
|
Row(modifier = Modifier.fillMaxWidth(),verticalAlignment = Alignment.CenterVertically) { |
|
|
|
|
Spacer(modifier = Modifier.weight(0.33F)) |
|
|
|
|
Row(modifier = Modifier.weight(0.33F),horizontalArrangement = Arrangement.Center) { |
|
|
|
|
Text(text = "我的社团") |
|
|
|
|
} |
|
|
|
|
Row(modifier = Modifier.weight(0.33F),horizontalArrangement = Arrangement.End) { |
|
|
|
|
Icon( |
|
|
|
|
painter = painterResource(id = R.drawable.ic_arrow_right), |
|
|
|
|
contentDescription = null, |
|
|
|
|
modifier = Modifier.size(50.dp) |
|
|
|
|
) |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
Spacer(modifier = Modifier |
|
|
|
|
.weight(0.66F) |
|
|
|
|
.fillMaxWidth()) |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
/** |
|
|
|
|
* 个人中心背景 |
|
|
|
|
* |
|
|
|
|
*/ |
|
|
|
|
@Composable |
|
|
|
|
fun CenterBackground(){ |
|
|
|
|
Image( |
|
|
|
|
painter = painterResource(id = R.drawable.mb_bg_fb_28), |
|
|
|
|
contentDescription = null, |
|
|
|
|
contentScale = ContentScale.FillHeight, |
|
|
|
|
alpha = 0.5F, |
|
|
|
|
modifier = Modifier.fillMaxSize() |
|
|
|
|
) |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
/** |
|
|
|
|
* 主界面 |
|
|
|
@ -479,7 +509,7 @@ fun DefaultPreview() { |
|
|
|
|
CSAMSTheme { |
|
|
|
|
// CommunitySearch(model = ListViewModel()) |
|
|
|
|
|
|
|
|
|
CommunityListBody(model = ListViewModel()) |
|
|
|
|
Text(text = "234234") |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|