File tree Expand file tree Collapse file tree 2 files changed +20
-0
lines changed
java/com/infomaniak/mail/ui/newMessage Expand file tree Collapse file tree 2 files changed +20
-0
lines changed Original file line number Diff line number Diff line change @@ -41,6 +41,7 @@ import androidx.core.view.isGone
41
41
import androidx.core.view.isVisible
42
42
import androidx.fragment.app.Fragment
43
43
import androidx.fragment.app.activityViewModels
44
+ import androidx.lifecycle.lifecycleScope
44
45
import androidx.navigation.fragment.findNavController
45
46
import com.infomaniak.lib.core.utils.FilePicker
46
47
import com.infomaniak.lib.core.utils.SnackbarUtils.showSnackbar
@@ -78,6 +79,9 @@ import com.infomaniak.mail.utils.extensions.AttachmentExtensions.openAttachment
78
79
import dagger.hilt.android.AndroidEntryPoint
79
80
import io.sentry.Sentry
80
81
import io.sentry.SentryLevel
82
+ import kotlinx.coroutines.flow.filterNotNull
83
+ import kotlinx.coroutines.flow.launchIn
84
+ import kotlinx.coroutines.flow.onEach
81
85
import javax.inject.Inject
82
86
83
87
@AndroidEntryPoint
@@ -308,6 +312,11 @@ class NewMessageFragment : Fragment() {
308
312
if (context.isNightModeEnabled()) editor.addCss(context.readRawResource(R .raw.custom_dark_mode))
309
313
310
314
addCss(context.readRawResource(R .raw.style))
315
+
316
+ isEmptyFlow
317
+ .filterNotNull()
318
+ .onEach { isEditorEmpty -> newMessagePlaceholder.isVisible = isEditorEmpty }
319
+ .launchIn(lifecycleScope)
311
320
}
312
321
313
322
setupSendButton()
Original file line number Diff line number Diff line change 297
297
android : layout_width =" match_parent"
298
298
android : layout_height =" wrap_content" />
299
299
300
+ <TextView
301
+ android : id =" @+id/newMessagePlaceholder"
302
+ android : layout_width =" wrap_content"
303
+ android : layout_height =" wrap_content"
304
+ android : layout_gravity =" center_vertical"
305
+ android : layout_marginStart =" @dimen/marginStandardMedium"
306
+ android : text =" @string/newMessagePlaceholderTitle"
307
+ android : textColor =" @color/tertiaryTextColor"
308
+ android : visibility =" gone"
309
+ tools : visibility =" visible" />
310
+
300
311
</FrameLayout >
301
312
302
313
<LinearLayout
You can’t perform that action at this time.
0 commit comments