mirror of
https://github.com/anyproto/anytype-kotlin.git
synced 2025-06-08 05:47:05 +09:00
DROID-3096 Chats | Enhancement | Support basic keyboard markup in bubbles + allow opening image attachment in bubbles in fullscreen mode (#1896)
This commit is contained in:
parent
5740d7d213
commit
88ab8c67d7
6 changed files with 24 additions and 1 deletions
|
@ -80,6 +80,9 @@ class DiscussionFragment : BaseComposeFragment() {
|
|||
},
|
||||
onMarkupLinkClicked = {
|
||||
|
||||
},
|
||||
onRequestOpenFullScreenImage = {
|
||||
// TODO
|
||||
}
|
||||
)
|
||||
|
||||
|
|
|
@ -24,6 +24,8 @@ class FullScreenPictureFragment : BaseFragment<FragmentFullScreenPictureBinding>
|
|||
)
|
||||
}
|
||||
|
||||
fun args(url: String) : Bundle = bundleOf(ARG_URL_KEY to url)
|
||||
|
||||
const val ARG_URL_KEY = "arg.full_screen_picture.url"
|
||||
const val ARG_TARGET_KEY = "arg.full_screen_picture.target"
|
||||
}
|
||||
|
|
|
@ -66,6 +66,7 @@ import com.anytypeio.anytype.presentation.widgets.DropDownMenuAction
|
|||
import com.anytypeio.anytype.presentation.widgets.WidgetView
|
||||
import com.anytypeio.anytype.ui.base.navigation
|
||||
import com.anytypeio.anytype.ui.editor.EditorFragment
|
||||
import com.anytypeio.anytype.ui.editor.gallery.FullScreenPictureFragment
|
||||
import com.anytypeio.anytype.ui.gallery.GalleryInstallationFragment
|
||||
import com.anytypeio.anytype.ui.multiplayer.RequestJoinSpaceFragment
|
||||
import com.anytypeio.anytype.ui.multiplayer.ShareSpaceFragment
|
||||
|
@ -186,6 +187,14 @@ class HomeScreenFragment : BaseComposeFragment(),
|
|||
},
|
||||
onMarkupLinkClicked = {
|
||||
proceedWithAction(SystemAction.OpenUrl(it))
|
||||
},
|
||||
onRequestOpenFullScreenImage = { url ->
|
||||
findNavController().navigate(
|
||||
R.id.fullScreenImageFragment,
|
||||
FullScreenPictureFragment.args(
|
||||
url = url
|
||||
)
|
||||
)
|
||||
}
|
||||
)
|
||||
}
|
||||
|
|
|
@ -4,6 +4,7 @@ import com.anytypeio.anytype.core_models.Block
|
|||
import com.anytypeio.anytype.core_models.Hash
|
||||
import com.anytypeio.anytype.core_models.Id
|
||||
import com.anytypeio.anytype.core_models.ObjectWrapper
|
||||
import com.anytypeio.anytype.core_models.Url
|
||||
import com.anytypeio.anytype.presentation.objects.ObjectIcon
|
||||
import com.anytypeio.anytype.presentation.search.GlobalSearchItemView
|
||||
|
||||
|
@ -31,6 +32,7 @@ sealed interface DiscussionView {
|
|||
val isStrike = styles.any { it.type == Block.Content.Text.Mark.Type.STRIKETHROUGH }
|
||||
val underline = styles.any { it.type == Block.Content.Text.Mark.Type.UNDERLINE }
|
||||
val link = styles.find { it.type == Block.Content.Text.Mark.Type.LINK }
|
||||
val isCode = styles.any { it.type == Block.Content.Text.Mark.Type.KEYBOARD }
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -442,7 +442,11 @@ class DiscussionViewModel @Inject constructor(
|
|||
viewModelScope.launch {
|
||||
when(attachment) {
|
||||
is DiscussionView.Message.Attachment.Image -> {
|
||||
// Do nothing.
|
||||
commands.emit(
|
||||
UXCommand.OpenFullScreenImage(
|
||||
url = urlBuilder.original(attachment.target)
|
||||
)
|
||||
)
|
||||
}
|
||||
is DiscussionView.Message.Attachment.Link -> {
|
||||
val wrapper = attachment.wrapper
|
||||
|
@ -483,6 +487,7 @@ class DiscussionViewModel @Inject constructor(
|
|||
sealed class UXCommand {
|
||||
data object JumpToBottom : UXCommand()
|
||||
data class SetChatBoxInput(val input: String) : UXCommand()
|
||||
data class OpenFullScreenImage(val url: String) : UXCommand()
|
||||
}
|
||||
|
||||
sealed class ChatBoxMode {
|
||||
|
|
|
@ -98,6 +98,7 @@ import androidx.compose.ui.text.withStyle
|
|||
import androidx.compose.ui.tooling.preview.Preview
|
||||
import androidx.compose.ui.unit.DpOffset
|
||||
import androidx.compose.ui.unit.dp
|
||||
import androidx.compose.ui.unit.em
|
||||
import androidx.compose.ui.unit.sp
|
||||
import androidx.navigation.compose.NavHost
|
||||
import androidx.navigation.compose.composable
|
||||
|
@ -120,6 +121,7 @@ import com.anytypeio.anytype.core_ui.views.PreviewTitle2Medium
|
|||
import com.anytypeio.anytype.core_ui.views.PreviewTitle2Regular
|
||||
import com.anytypeio.anytype.core_ui.views.Relations2
|
||||
import com.anytypeio.anytype.core_ui.views.Relations3
|
||||
import com.anytypeio.anytype.core_ui.views.fontIBM
|
||||
import com.anytypeio.anytype.core_ui.widgets.ListWidgetObjectIcon
|
||||
import com.anytypeio.anytype.core_utils.const.DateConst.TIME_H24
|
||||
import com.anytypeio.anytype.core_utils.ext.formatTimeInMillis
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue