|
|
@ -18,7 +18,6 @@ import androidx.compose.runtime.livedata.observeAsState |
|
|
|
import androidx.compose.runtime.rememberCoroutineScope |
|
|
|
import androidx.compose.runtime.rememberCoroutineScope |
|
|
|
import androidx.compose.ui.Alignment |
|
|
|
import androidx.compose.ui.Alignment |
|
|
|
import androidx.compose.ui.Modifier |
|
|
|
import androidx.compose.ui.Modifier |
|
|
|
import androidx.compose.ui.draw.rotate |
|
|
|
|
|
|
|
import androidx.compose.ui.graphics.Color |
|
|
|
import androidx.compose.ui.graphics.Color |
|
|
|
import androidx.compose.ui.layout.ContentScale |
|
|
|
import androidx.compose.ui.layout.ContentScale |
|
|
|
import androidx.compose.ui.platform.LocalFocusManager |
|
|
|
import androidx.compose.ui.platform.LocalFocusManager |
|
|
@ -78,37 +77,68 @@ fun Body() { |
|
|
|
if(snackBarMsg!=""){ |
|
|
|
if(snackBarMsg!=""){ |
|
|
|
val scope= rememberCoroutineScope() |
|
|
|
val scope= rememberCoroutineScope() |
|
|
|
scope.launch { |
|
|
|
scope.launch { |
|
|
|
val result=scaffoldState.snackbarHostState.showSnackbar( |
|
|
|
scaffoldState.snackbarHostState.showSnackbar( |
|
|
|
message = snackBarMsg |
|
|
|
message = snackBarMsg |
|
|
|
) |
|
|
|
) |
|
|
|
model.reset() |
|
|
|
model.reset() |
|
|
|
} |
|
|
|
} |
|
|
|
// scope.launch { |
|
|
|
|
|
|
|
// delay(1000) |
|
|
|
|
|
|
|
// scaffoldState.snackbarHostState.currentSnackbarData?.dismiss() |
|
|
|
|
|
|
|
// } |
|
|
|
|
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
composable(MainMenu.Center.name) { |
|
|
|
composable(MainMenu.Center.name) { |
|
|
|
Box(modifier = Modifier.fillMaxSize()) { |
|
|
|
Center(navController = navController) |
|
|
|
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 = "个人中心") |
|
|
|
|
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/** |
|
|
|
|
|
|
|
* 个人中心 |
|
|
|
|
|
|
|
* |
|
|
|
|
|
|
|
*/ |
|
|
|
|
|
|
|
@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 { |
|
|
|
CSAMSTheme { |
|
|
|
// CommunitySearch(model = ListViewModel()) |
|
|
|
// CommunitySearch(model = ListViewModel()) |
|
|
|
|
|
|
|
|
|
|
|
CommunityListBody(model = ListViewModel()) |
|
|
|
Text(text = "234234") |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|