Skip to content
Snippets Groups Projects
Commit 3f4706b5 authored by Taras's avatar Taras
Browse files

Add menu share option

parent 3304c1a4
No related branches found
No related tags found
No related merge requests found
......@@ -129,8 +129,8 @@ class DMTimelineDialogFragment :
override fun onReply(eventId: String) {
}
override fun onShare(content: PostContent, view: View) {
viewModel.sharePostContent(content, view)
override fun onShare(content: PostContent) {
viewModel.sharePostContent(content)
}
override fun onRemove(eventId: String) {
......
......@@ -49,9 +49,9 @@ class DMTimelineViewModel @Inject constructor(
val saveToDeviceLiveData = SingleEventLiveData<Unit>()
val unSendReactionLiveData = SingleEventLiveData<Response<Cancelable?>>()
fun sharePostContent(content: PostContent, view: View) {
fun sharePostContent(content: PostContent) {
launchBg {
postOptionsDataSource.getShareableContent(content, view)
postOptionsDataSource.getShareableContent(content, null)
?.let { shareLiveData.postValue(it) }
}
}
......
package org.futo.circles.feature.direct.timeline.listeners
import android.view.View
import org.futo.circles.core.model.PostContent
interface DmOptionsListener {
fun onShowMenuClicked(eventId: String)
fun onShare(content: PostContent, view: View)
fun onShare(content: PostContent)
fun onReply(eventId: String)
fun onShowPreview(eventId: String)
fun onShowEmoji(eventId: String, onAddEmoji: (String) -> Unit)
......
......@@ -68,6 +68,14 @@ class DmMenuBottomSheet : TransparentBackgroundBottomSheetDialogFragment() {
}
}
}
tvShare.apply {
setOnClickListener {
viewModel.getPostContent()?.let {
menuListener?.onShare(it)
dismiss()
}
}
}
tvSaveToDevice.apply {
setIsVisible(viewModel.isMediaPost())
setOnClickListener {
......
......@@ -53,6 +53,13 @@
app:optionIcon="@drawable/ic_edit"
app:optionName="@string/edit" />
<org.futo.circles.core.view.SettingsMenuItemView
android:id="@+id/tvShare"
android:layout_width="match_parent"
android:layout_height="wrap_content"
app:optionIcon="@drawable/ic_share"
app:optionName="@string/share" />
<org.futo.circles.core.view.SettingsMenuItemView
android:id="@+id/tvSaveToDevice"
android:layout_width="match_parent"
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment