Skip to content

DROID-3446 Vault | New space or chat creation flow, ui fix #2532

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 5 commits into from
Jun 13, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@ import androidx.activity.result.contract.ActivityResultContracts
import androidx.compose.foundation.background
import androidx.compose.foundation.layout.Box
import androidx.compose.foundation.layout.Column
import androidx.compose.foundation.layout.Row
import androidx.compose.foundation.layout.Spacer
import androidx.compose.foundation.layout.WindowInsets
import androidx.compose.foundation.layout.fillMaxSize
Expand All @@ -13,7 +12,6 @@ import androidx.compose.foundation.layout.height
import androidx.compose.foundation.layout.imePadding
import androidx.compose.foundation.layout.navigationBars
import androidx.compose.foundation.layout.padding
import androidx.compose.foundation.layout.width
import androidx.compose.foundation.layout.windowInsetsPadding
import androidx.compose.foundation.layout.wrapContentSize
import androidx.compose.foundation.rememberScrollState
Expand All @@ -24,12 +22,9 @@ import androidx.compose.material.DropdownMenuItem
import androidx.compose.material.Text
import androidx.compose.material3.DropdownMenu
import androidx.compose.material3.OutlinedTextField
import androidx.compose.material3.Switch
import androidx.compose.material3.SwitchDefaults
import androidx.compose.material3.TextFieldDefaults
import androidx.compose.runtime.Composable
import androidx.compose.runtime.LaunchedEffect
import androidx.compose.runtime.MutableState
import androidx.compose.runtime.State
import androidx.compose.runtime.getValue
import androidx.compose.runtime.mutableStateOf
Expand Down Expand Up @@ -202,36 +197,6 @@ fun CreateSpaceScreen(
}
}

@Composable
private fun DebugCreateSpaceLevelChatToggle(isChatToggleChecked: MutableState<Boolean>) {
Row(
verticalAlignment = Alignment.CenterVertically,
modifier = Modifier
.fillMaxWidth()
.padding(horizontal = 16.dp)
.height(52.dp)
) {
Switch(
checked = isChatToggleChecked.value,
onCheckedChange = {
isChatToggleChecked.value = it
},
colors = SwitchDefaults.colors().copy(
checkedBorderColor = Color.Transparent,
uncheckedBorderColor = Color.Transparent,
checkedTrackColor = colorResource(R.color.palette_system_amber_50),
uncheckedTrackColor = colorResource(R.color.shape_secondary)
)
)
Spacer(modifier = Modifier.width(8.dp))
Text(
text = "Enable space-level chat (dev mode)",
color = colorResource(id = R.color.text_primary),
style = BodyRegular
)
}
}

@Composable
fun Header(isChatSpace: Boolean = false) {
Box(
Expand Down Expand Up @@ -353,8 +318,6 @@ fun UseCase() {
}
}

typealias IsSpaceLevelChatSwitchChecked = Boolean

@DefaultPreviews
@Composable
fun CreateSpaceScreenPreview() {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,10 @@ fun ChooseSpaceTypeScreen(
modifier = Modifier
.fillMaxWidth()
.padding(horizontal = 8.dp)
.background(shape = RoundedCornerShape(16.dp), color = colorResource(id = R.color.widget_background))
.background(
shape = RoundedCornerShape(16.dp),
color = colorResource(id = R.color.background_secondary)
)
) {
Dragger(modifier = Modifier
.align(Alignment.CenterHorizontally)
Expand Down
25 changes: 9 additions & 16 deletions app/src/main/java/com/anytypeio/anytype/ui/vault/VaultScreen.kt
Original file line number Diff line number Diff line change
Expand Up @@ -66,12 +66,13 @@ import com.anytypeio.anytype.core_ui.foundation.noRippleClickable
import com.anytypeio.anytype.core_ui.foundation.util.DraggableItem
import com.anytypeio.anytype.core_ui.foundation.util.dragContainer
import com.anytypeio.anytype.core_ui.foundation.util.rememberDragDropState
import com.anytypeio.anytype.core_ui.views.AvatarTitle
import com.anytypeio.anytype.core_ui.views.Caption1Regular
import com.anytypeio.anytype.core_ui.views.HeadlineTitle
import com.anytypeio.anytype.core_ui.views.Title1
import com.anytypeio.anytype.core_ui.views.animations.conditionalBackground
import com.anytypeio.anytype.core_ui.widgets.ListWidgetObjectIcon
import com.anytypeio.anytype.core_utils.insets.EDGE_TO_EDGE_MIN_SDK
import com.anytypeio.anytype.presentation.objects.ObjectIcon
import com.anytypeio.anytype.presentation.profile.AccountProfile
import com.anytypeio.anytype.presentation.profile.ProfileIconView
import com.anytypeio.anytype.presentation.spaces.SelectSpaceViewModel
Expand Down Expand Up @@ -428,21 +429,13 @@ fun VaultScreenToolbar(
} else {
profile.name.first().uppercaseChar().toString()
}
Box(
modifier = Modifier
.fillMaxSize()
.clip(CircleShape)
.background(colorResource(id = R.color.glyph_active))
) {
Text(
text = nameFirstChar,
style = AvatarTitle.copy(
fontSize = 20.sp
),
color = colorResource(id = R.color.text_white),
modifier = Modifier.align(Alignment.Center)
)
}
ListWidgetObjectIcon(
modifier = Modifier.fillMaxSize(),
icon = ObjectIcon.Profile.Avatar(
name = nameFirstChar
),
iconSize = 28.dp
)
}
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -198,7 +198,7 @@ fun ProfileSettingsScreen(
item {
ActionWithProgressBar(
name = stringResource(R.string.log_out),
color = colorResource(R.color.palette_dark_red),
color = colorResource(R.color.palette_system_red),
onClick = onLogoutClicked,
isInProgress = isLogoutInProgress
)
Expand Down
2 changes: 1 addition & 1 deletion localization/src/main/res/values/strings.xml
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@
<string name="space_debug">Space debug</string>
<string name="data">Data</string>
<string name="mode">Mode</string>
<string name="log_out">Logout</string>
<string name="log_out">Log out</string>
<string name="pin_code">Pin code</string>
<string name="access">Access</string>
<string name="wallpaper">Wallpaper</string>
Expand Down