Merge branch 'main' of https://github.com/vitorpamplona/amethyst
This commit is contained in:
+6
-1
@@ -86,6 +86,7 @@ import com.vitorpamplona.amethyst.ui.screen.loggedIn.profile.gallery.dal.UserPro
|
|||||||
import com.vitorpamplona.amethyst.ui.screen.loggedIn.profile.hashtags.FollowedTagsTabHeader
|
import com.vitorpamplona.amethyst.ui.screen.loggedIn.profile.hashtags.FollowedTagsTabHeader
|
||||||
import com.vitorpamplona.amethyst.ui.screen.loggedIn.profile.hashtags.TabFollowedTags
|
import com.vitorpamplona.amethyst.ui.screen.loggedIn.profile.hashtags.TabFollowedTags
|
||||||
import com.vitorpamplona.amethyst.ui.screen.loggedIn.profile.header.ProfileHeader
|
import com.vitorpamplona.amethyst.ui.screen.loggedIn.profile.header.ProfileHeader
|
||||||
|
import com.vitorpamplona.amethyst.ui.screen.loggedIn.profile.header.ProfileTopBar
|
||||||
import com.vitorpamplona.amethyst.ui.screen.loggedIn.profile.header.apps.UserAppRecommendationsFeedViewModel
|
import com.vitorpamplona.amethyst.ui.screen.loggedIn.profile.header.apps.UserAppRecommendationsFeedViewModel
|
||||||
import com.vitorpamplona.amethyst.ui.screen.loggedIn.profile.header.identity.UserExternalIdentitiesViewModel
|
import com.vitorpamplona.amethyst.ui.screen.loggedIn.profile.header.identity.UserExternalIdentitiesViewModel
|
||||||
import com.vitorpamplona.amethyst.ui.screen.loggedIn.profile.mutual.TabMutualConversations
|
import com.vitorpamplona.amethyst.ui.screen.loggedIn.profile.mutual.TabMutualConversations
|
||||||
@@ -300,6 +301,10 @@ fun ProfileScreen(
|
|||||||
val coroutineScope = rememberCoroutineScope()
|
val coroutineScope = rememberCoroutineScope()
|
||||||
|
|
||||||
Scaffold(
|
Scaffold(
|
||||||
|
topBar = {
|
||||||
|
ProfileTopBar(baseUser, accountViewModel, nav)
|
||||||
|
},
|
||||||
|
contentWindowInsets = WindowInsets(0),
|
||||||
bottomBar = {
|
bottomBar = {
|
||||||
AppBottomBar(
|
AppBottomBar(
|
||||||
Route.Profile(accountViewModel.userProfile().pubkeyHex),
|
Route.Profile(accountViewModel.userProfile().pubkeyHex),
|
||||||
@@ -314,7 +319,7 @@ fun ProfileScreen(
|
|||||||
}
|
}
|
||||||
},
|
},
|
||||||
) { padding ->
|
) { padding ->
|
||||||
Box(modifier = Modifier.padding(padding)) {
|
Box(modifier = Modifier.padding(bottom = padding.calculateBottomPadding())) {
|
||||||
RenderSurface(scrollState) { tabRowModifier: Modifier, pagerModifier: Modifier ->
|
RenderSurface(scrollState) { tabRowModifier: Modifier, pagerModifier: Modifier ->
|
||||||
RenderScreen(
|
RenderScreen(
|
||||||
baseUser,
|
baseUser,
|
||||||
|
|||||||
-72
@@ -31,10 +31,7 @@ import androidx.compose.foundation.layout.fillMaxWidth
|
|||||||
import androidx.compose.foundation.layout.height
|
import androidx.compose.foundation.layout.height
|
||||||
import androidx.compose.foundation.layout.padding
|
import androidx.compose.foundation.layout.padding
|
||||||
import androidx.compose.foundation.layout.size
|
import androidx.compose.foundation.layout.size
|
||||||
import androidx.compose.foundation.layout.statusBarsPadding
|
|
||||||
import androidx.compose.foundation.shape.CircleShape
|
import androidx.compose.foundation.shape.CircleShape
|
||||||
import androidx.compose.material3.Button
|
|
||||||
import androidx.compose.material3.ButtonDefaults
|
|
||||||
import androidx.compose.material3.HorizontalDivider
|
import androidx.compose.material3.HorizontalDivider
|
||||||
import androidx.compose.material3.MaterialTheme
|
import androidx.compose.material3.MaterialTheme
|
||||||
import androidx.compose.runtime.Composable
|
import androidx.compose.runtime.Composable
|
||||||
@@ -67,17 +64,13 @@ import com.vitorpamplona.amethyst.ui.actions.uploads.GallerySelectSingle
|
|||||||
import com.vitorpamplona.amethyst.ui.components.LoadingAnimation
|
import com.vitorpamplona.amethyst.ui.components.LoadingAnimation
|
||||||
import com.vitorpamplona.amethyst.ui.components.ZoomableImageDialog
|
import com.vitorpamplona.amethyst.ui.components.ZoomableImageDialog
|
||||||
import com.vitorpamplona.amethyst.ui.navigation.navs.INav
|
import com.vitorpamplona.amethyst.ui.navigation.navs.INav
|
||||||
import com.vitorpamplona.amethyst.ui.note.ArrowBackIcon
|
|
||||||
import com.vitorpamplona.amethyst.ui.note.ClickableUserPicture
|
import com.vitorpamplona.amethyst.ui.note.ClickableUserPicture
|
||||||
import com.vitorpamplona.amethyst.ui.screen.loggedIn.AccountViewModel
|
import com.vitorpamplona.amethyst.ui.screen.loggedIn.AccountViewModel
|
||||||
import com.vitorpamplona.amethyst.ui.screen.loggedIn.profile.header.apps.UserAppRecommendationsFeedViewModel
|
import com.vitorpamplona.amethyst.ui.screen.loggedIn.profile.header.apps.UserAppRecommendationsFeedViewModel
|
||||||
import com.vitorpamplona.amethyst.ui.screen.loggedIn.profile.header.identity.UserExternalIdentitiesViewModel
|
import com.vitorpamplona.amethyst.ui.screen.loggedIn.profile.header.identity.UserExternalIdentitiesViewModel
|
||||||
import com.vitorpamplona.amethyst.ui.stringRes
|
import com.vitorpamplona.amethyst.ui.stringRes
|
||||||
import com.vitorpamplona.amethyst.ui.theme.ButtonBorder
|
|
||||||
import com.vitorpamplona.amethyst.ui.theme.Size100dp
|
import com.vitorpamplona.amethyst.ui.theme.Size100dp
|
||||||
import com.vitorpamplona.amethyst.ui.theme.Size35dp
|
import com.vitorpamplona.amethyst.ui.theme.Size35dp
|
||||||
import com.vitorpamplona.amethyst.ui.theme.ZeroPadding
|
|
||||||
import com.vitorpamplona.amethyst.ui.theme.placeholderText
|
|
||||||
import com.vitorpamplona.amethyst.ui.theme.userProfileBorderModifier
|
import com.vitorpamplona.amethyst.ui.theme.userProfileBorderModifier
|
||||||
import kotlinx.coroutines.launch
|
import kotlinx.coroutines.launch
|
||||||
|
|
||||||
@@ -89,74 +82,9 @@ fun ProfileHeader(
|
|||||||
nav: INav,
|
nav: INav,
|
||||||
accountViewModel: AccountViewModel,
|
accountViewModel: AccountViewModel,
|
||||||
) {
|
) {
|
||||||
var popupExpanded by remember { mutableStateOf(false) }
|
|
||||||
|
|
||||||
Box {
|
Box {
|
||||||
DrawBanner(baseUser, accountViewModel)
|
DrawBanner(baseUser, accountViewModel)
|
||||||
|
|
||||||
if (nav.canPop()) {
|
|
||||||
Box(
|
|
||||||
modifier =
|
|
||||||
Modifier
|
|
||||||
.statusBarsPadding()
|
|
||||||
.padding(start = 10.dp, end = 10.dp, top = 10.dp)
|
|
||||||
.size(40.dp)
|
|
||||||
.align(Alignment.TopStart),
|
|
||||||
) {
|
|
||||||
Button(
|
|
||||||
modifier =
|
|
||||||
Modifier
|
|
||||||
.size(30.dp)
|
|
||||||
.align(Alignment.Center),
|
|
||||||
onClick = nav::popBack,
|
|
||||||
shape = ButtonBorder,
|
|
||||||
colors =
|
|
||||||
ButtonDefaults.buttonColors(
|
|
||||||
containerColor = MaterialTheme.colorScheme.background,
|
|
||||||
),
|
|
||||||
contentPadding = ZeroPadding,
|
|
||||||
) {
|
|
||||||
ArrowBackIcon(tint = MaterialTheme.colorScheme.placeholderText)
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
Box(
|
|
||||||
modifier =
|
|
||||||
Modifier
|
|
||||||
.statusBarsPadding()
|
|
||||||
.padding(start = 10.dp, end = 10.dp, top = 10.dp)
|
|
||||||
.size(40.dp)
|
|
||||||
.align(Alignment.TopEnd),
|
|
||||||
) {
|
|
||||||
Button(
|
|
||||||
modifier =
|
|
||||||
Modifier
|
|
||||||
.size(30.dp)
|
|
||||||
.align(Alignment.Center),
|
|
||||||
onClick = { popupExpanded = true },
|
|
||||||
shape = ButtonBorder,
|
|
||||||
colors =
|
|
||||||
ButtonDefaults.buttonColors(
|
|
||||||
containerColor = MaterialTheme.colorScheme.background,
|
|
||||||
),
|
|
||||||
contentPadding = ZeroPadding,
|
|
||||||
) {
|
|
||||||
Icon(
|
|
||||||
tint = MaterialTheme.colorScheme.placeholderText,
|
|
||||||
symbol = MaterialSymbols.MoreVert,
|
|
||||||
contentDescription = stringRes(R.string.more_options),
|
|
||||||
)
|
|
||||||
|
|
||||||
UserProfileDropDownMenu(
|
|
||||||
baseUser,
|
|
||||||
popupExpanded,
|
|
||||||
{ popupExpanded = false },
|
|
||||||
accountViewModel,
|
|
||||||
)
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
Column(
|
Column(
|
||||||
modifier =
|
modifier =
|
||||||
Modifier
|
Modifier
|
||||||
|
|||||||
+109
@@ -0,0 +1,109 @@
|
|||||||
|
/*
|
||||||
|
* Copyright (c) 2025 Vitor Pamplona
|
||||||
|
*
|
||||||
|
* Permission is hereby granted, free of charge, to any person obtaining a copy of
|
||||||
|
* this software and associated documentation files (the "Software"), to deal in
|
||||||
|
* the Software without restriction, including without limitation the rights to use,
|
||||||
|
* copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the
|
||||||
|
* Software, and to permit persons to whom the Software is furnished to do so,
|
||||||
|
* subject to the following conditions:
|
||||||
|
*
|
||||||
|
* The above copyright notice and this permission notice shall be included in all
|
||||||
|
* copies or substantial portions of the Software.
|
||||||
|
*
|
||||||
|
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||||
|
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS
|
||||||
|
* FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR
|
||||||
|
* COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN
|
||||||
|
* AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
|
||||||
|
* WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
||||||
|
*/
|
||||||
|
package com.vitorpamplona.amethyst.ui.screen.loggedIn.profile.header
|
||||||
|
|
||||||
|
import androidx.compose.foundation.layout.padding
|
||||||
|
import androidx.compose.foundation.layout.size
|
||||||
|
import androidx.compose.material3.Button
|
||||||
|
import androidx.compose.material3.ButtonDefaults
|
||||||
|
import androidx.compose.material3.ExperimentalMaterial3Api
|
||||||
|
import androidx.compose.material3.MaterialTheme
|
||||||
|
import androidx.compose.material3.TopAppBarDefaults
|
||||||
|
import androidx.compose.runtime.Composable
|
||||||
|
import androidx.compose.runtime.getValue
|
||||||
|
import androidx.compose.runtime.mutableStateOf
|
||||||
|
import androidx.compose.runtime.remember
|
||||||
|
import androidx.compose.runtime.setValue
|
||||||
|
import androidx.compose.ui.Modifier
|
||||||
|
import androidx.compose.ui.graphics.Color
|
||||||
|
import androidx.compose.ui.unit.dp
|
||||||
|
import com.vitorpamplona.amethyst.R
|
||||||
|
import com.vitorpamplona.amethyst.commons.icons.symbols.Icon
|
||||||
|
import com.vitorpamplona.amethyst.commons.icons.symbols.MaterialSymbols
|
||||||
|
import com.vitorpamplona.amethyst.model.User
|
||||||
|
import com.vitorpamplona.amethyst.ui.navigation.navs.INav
|
||||||
|
import com.vitorpamplona.amethyst.ui.navigation.topbars.ShorterTopAppBar
|
||||||
|
import com.vitorpamplona.amethyst.ui.note.ArrowBackIcon
|
||||||
|
import com.vitorpamplona.amethyst.ui.screen.loggedIn.AccountViewModel
|
||||||
|
import com.vitorpamplona.amethyst.ui.stringRes
|
||||||
|
import com.vitorpamplona.amethyst.ui.theme.ButtonBorder
|
||||||
|
import com.vitorpamplona.amethyst.ui.theme.ZeroPadding
|
||||||
|
import com.vitorpamplona.amethyst.ui.theme.placeholderText
|
||||||
|
|
||||||
|
@OptIn(ExperimentalMaterial3Api::class)
|
||||||
|
@Composable
|
||||||
|
fun ProfileTopBar(
|
||||||
|
baseUser: User,
|
||||||
|
accountViewModel: AccountViewModel,
|
||||||
|
nav: INav,
|
||||||
|
) {
|
||||||
|
ShorterTopAppBar(
|
||||||
|
title = {},
|
||||||
|
colors =
|
||||||
|
TopAppBarDefaults.topAppBarColors(
|
||||||
|
containerColor = Color.Transparent,
|
||||||
|
scrolledContainerColor = Color.Transparent,
|
||||||
|
),
|
||||||
|
navigationIcon = {
|
||||||
|
if (nav.canPop()) {
|
||||||
|
Button(
|
||||||
|
modifier = Modifier.padding(start = 10.dp).size(30.dp),
|
||||||
|
onClick = nav::popBack,
|
||||||
|
shape = ButtonBorder,
|
||||||
|
colors =
|
||||||
|
ButtonDefaults.buttonColors(
|
||||||
|
containerColor = MaterialTheme.colorScheme.background,
|
||||||
|
),
|
||||||
|
contentPadding = ZeroPadding,
|
||||||
|
) {
|
||||||
|
ArrowBackIcon(tint = MaterialTheme.colorScheme.placeholderText)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
},
|
||||||
|
actions = {
|
||||||
|
var popupExpanded by remember { mutableStateOf(false) }
|
||||||
|
|
||||||
|
Button(
|
||||||
|
modifier = Modifier.padding(end = 10.dp).size(30.dp),
|
||||||
|
onClick = { popupExpanded = true },
|
||||||
|
shape = ButtonBorder,
|
||||||
|
colors =
|
||||||
|
ButtonDefaults.buttonColors(
|
||||||
|
containerColor = MaterialTheme.colorScheme.background,
|
||||||
|
),
|
||||||
|
contentPadding = ZeroPadding,
|
||||||
|
) {
|
||||||
|
Icon(
|
||||||
|
tint = MaterialTheme.colorScheme.placeholderText,
|
||||||
|
symbol = MaterialSymbols.MoreVert,
|
||||||
|
contentDescription = stringRes(R.string.more_options),
|
||||||
|
)
|
||||||
|
|
||||||
|
UserProfileDropDownMenu(
|
||||||
|
baseUser,
|
||||||
|
popupExpanded,
|
||||||
|
{ popupExpanded = false },
|
||||||
|
accountViewModel,
|
||||||
|
)
|
||||||
|
}
|
||||||
|
},
|
||||||
|
)
|
||||||
|
}
|
||||||
@@ -459,10 +459,26 @@
|
|||||||
<string name="follow_packs">关注包</string>
|
<string name="follow_packs">关注包</string>
|
||||||
<string name="live_streams">直播</string>
|
<string name="live_streams">直播</string>
|
||||||
<string name="nests">音频室</string>
|
<string name="nests">音频室</string>
|
||||||
|
<string name="meeting_room_in_space">在 %1$s</string>
|
||||||
|
<string name="meeting_room_in_space_unknown">一个鸟巢</string>
|
||||||
<string name="nest_stage">阶段</string>
|
<string name="nest_stage">阶段</string>
|
||||||
<string name="nest_audience">观众</string>
|
<string name="nest_audience">观众</string>
|
||||||
<string name="nest_raise_hand">举手</string>
|
<string name="nest_raise_hand">举手</string>
|
||||||
<string name="nest_lower_hand">放下手</string>
|
<string name="nest_lower_hand">放下手</string>
|
||||||
|
<string name="nest_connect">连接音频</string>
|
||||||
|
<string name="nest_disconnect">断开连接</string>
|
||||||
|
<string name="nest_mute">静音</string>
|
||||||
|
<string name="nest_unmute">取消静音</string>
|
||||||
|
<string name="nest_connecting">正在连接...</string>
|
||||||
|
<string name="nest_connecting_resolving">正在解析房间</string>
|
||||||
|
<string name="nest_connecting_transport">正在打开传输</string>
|
||||||
|
<string name="nest_connecting_handshake">正在协商音频</string>
|
||||||
|
<string name="nest_connected">音频已连接</string>
|
||||||
|
<string name="nest_reconnecting">重新连接中…</string>
|
||||||
|
<string name="nest_listen_to_recording">听录音</string>
|
||||||
|
<string name="nest_chat_send_failed_title">无法发送信息</string>
|
||||||
|
<string name="nest_no_app_to_open_link">没有安装打开此链接的应用。</string>
|
||||||
|
<string name="nest_close_room_confirm_title">关闭这个聊天室吗?</string>
|
||||||
<string name="longs">视频</string>
|
<string name="longs">视频</string>
|
||||||
<string name="articles">文章</string>
|
<string name="articles">文章</string>
|
||||||
<string name="private_bookmarks">私人书签</string>
|
<string name="private_bookmarks">私人书签</string>
|
||||||
|
|||||||
Reference in New Issue
Block a user