pref: 未登录时隐藏需要登录才可访问的项目
This commit is contained in:
parent
54765a02df
commit
83a855b2d4
|
|
@ -121,11 +121,11 @@ private fun StatCard(
|
||||||
|
|
||||||
@Composable
|
@Composable
|
||||||
private fun InfoCard(
|
private fun InfoCard(
|
||||||
|
modifier: Modifier = Modifier,
|
||||||
userName: String = "",
|
userName: String = "",
|
||||||
userIntro: String = "",
|
userIntro: String = "",
|
||||||
avatar: String? = null,
|
avatar: String? = null,
|
||||||
isPlaceholder: Boolean = false,
|
isPlaceholder: Boolean = false
|
||||||
modifier: Modifier = Modifier
|
|
||||||
) {
|
) {
|
||||||
Row(
|
Row(
|
||||||
modifier = modifier,
|
modifier = modifier,
|
||||||
|
|
@ -264,9 +264,6 @@ fun UserPage(
|
||||||
) {
|
) {
|
||||||
if (account != null) {
|
if (account != null) {
|
||||||
InfoCard(
|
InfoCard(
|
||||||
userName = account!!.nameShow ?: account!!.name,
|
|
||||||
userIntro = account!!.intro ?: stringResource(id = R.string.tip_no_intro),
|
|
||||||
avatar = StringUtil.getAvatarUrl(account!!.portrait),
|
|
||||||
modifier = Modifier
|
modifier = Modifier
|
||||||
.padding(top = 8.dp)
|
.padding(top = 8.dp)
|
||||||
.clickable {
|
.clickable {
|
||||||
|
|
@ -277,6 +274,9 @@ fun UserPage(
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
.padding(horizontal = 16.dp, vertical = 16.dp),
|
.padding(horizontal = 16.dp, vertical = 16.dp),
|
||||||
|
userName = account!!.nameShow ?: account!!.name,
|
||||||
|
userIntro = account!!.intro ?: stringResource(id = R.string.tip_no_intro),
|
||||||
|
avatar = StringUtil.getAvatarUrl(account!!.portrait),
|
||||||
)
|
)
|
||||||
StatCard(
|
StatCard(
|
||||||
account = account!!,
|
account = account!!,
|
||||||
|
|
@ -288,10 +288,10 @@ fun UserPage(
|
||||||
)
|
)
|
||||||
} else if (isLoading) {
|
} else if (isLoading) {
|
||||||
InfoCard(
|
InfoCard(
|
||||||
isPlaceholder = true,
|
|
||||||
modifier = Modifier
|
modifier = Modifier
|
||||||
.padding(horizontal = 16.dp, vertical = 16.dp)
|
.padding(horizontal = 16.dp, vertical = 16.dp)
|
||||||
.padding(top = 8.dp),
|
.padding(top = 8.dp),
|
||||||
|
isPlaceholder = true,
|
||||||
)
|
)
|
||||||
StatCardPlaceholder(
|
StatCardPlaceholder(
|
||||||
modifier = Modifier
|
modifier = Modifier
|
||||||
|
|
@ -308,13 +308,15 @@ fun UserPage(
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
val navigator = LocalNavigator.current
|
val navigator = LocalNavigator.current
|
||||||
ListMenuItem(
|
if (account != null) {
|
||||||
icon = ImageVector.vectorResource(id = R.drawable.ic_favorite),
|
ListMenuItem(
|
||||||
text = stringResource(id = R.string.title_my_collect),
|
icon = ImageVector.vectorResource(id = R.drawable.ic_favorite),
|
||||||
onClick = {
|
text = stringResource(id = R.string.title_my_collect),
|
||||||
navigator.navigate(ThreadStorePageDestination)
|
onClick = {
|
||||||
}
|
navigator.navigate(ThreadStorePageDestination)
|
||||||
)
|
}
|
||||||
|
)
|
||||||
|
}
|
||||||
ListMenuItem(
|
ListMenuItem(
|
||||||
icon = ImageVector.vectorResource(id = R.drawable.ic_outline_watch_later_24),
|
icon = ImageVector.vectorResource(id = R.drawable.ic_outline_watch_later_24),
|
||||||
text = stringResource(id = R.string.title_history),
|
text = stringResource(id = R.string.title_history),
|
||||||
|
|
@ -340,16 +342,18 @@ fun UserPage(
|
||||||
onCheckedChange = { ThemeUtil.switchNightMode() }
|
onCheckedChange = { ThemeUtil.switchNightMode() }
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
ListMenuItem(
|
if (account != null) {
|
||||||
icon = ImageVector.vectorResource(id = R.drawable.ic_help_outline_black_24),
|
ListMenuItem(
|
||||||
text = stringResource(id = R.string.my_info_service_center),
|
icon = ImageVector.vectorResource(id = R.drawable.ic_help_outline_black_24),
|
||||||
onClick = {
|
text = stringResource(id = R.string.my_info_service_center),
|
||||||
WebViewActivity.launch(
|
onClick = {
|
||||||
context,
|
WebViewActivity.launch(
|
||||||
"https://tieba.baidu.com/mo/q/hybrid-main-service/uegServiceCenter?cuid=${CuidUtils.getNewCuid()}&cuid_galaxy2=${CuidUtils.getNewCuid()}&cuid_gid=×tamp=${System.currentTimeMillis()}&_client_version=11.10.8.6&nohead=1"
|
context,
|
||||||
)
|
"https://tieba.baidu.com/mo/q/hybrid-main-service/uegServiceCenter?cuid=${CuidUtils.getNewCuid()}&cuid_galaxy2=${CuidUtils.getNewCuid()}&cuid_gid=×tamp=${System.currentTimeMillis()}&_client_version=11.10.8.6&nohead=1"
|
||||||
},
|
)
|
||||||
)
|
},
|
||||||
|
)
|
||||||
|
}
|
||||||
VerticalDivider(
|
VerticalDivider(
|
||||||
modifier = Modifier.padding(vertical = 8.dp, horizontal = 16.dp)
|
modifier = Modifier.padding(vertical = 8.dp, horizontal = 16.dp)
|
||||||
)
|
)
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue