diff --git a/changelog.d/5647.feature b/changelog.d/5647.feature new file mode 100644 index 0000000000..e4192300a1 --- /dev/null +++ b/changelog.d/5647.feature @@ -0,0 +1 @@ +Users will be able to provide feedback for threads \ No newline at end of file diff --git a/library/ui-styles/src/main/res/drawable/bg_shadow_divider.xml b/library/ui-styles/src/main/res/drawable/bg_shadow_divider.xml new file mode 100644 index 0000000000..9d0ef632ec --- /dev/null +++ b/library/ui-styles/src/main/res/drawable/bg_shadow_divider.xml @@ -0,0 +1,9 @@ + + + + \ No newline at end of file diff --git a/vector-config/src/main/res/values/config-features.xml b/vector-config/src/main/res/values/config-features.xml new file mode 100755 index 0000000000..1a1a62446f --- /dev/null +++ b/vector-config/src/main/res/values/config-features.xml @@ -0,0 +1,11 @@ + + + + + + true + + diff --git a/vector/src/main/java/im/vector/app/features/home/room/threads/list/views/ThreadListFragment.kt b/vector/src/main/java/im/vector/app/features/home/room/threads/list/views/ThreadListFragment.kt index 9814e89dea..16555ef03c 100644 --- a/vector/src/main/java/im/vector/app/features/home/room/threads/list/views/ThreadListFragment.kt +++ b/vector/src/main/java/im/vector/app/features/home/room/threads/list/views/ThreadListFragment.kt @@ -40,6 +40,8 @@ import im.vector.app.features.home.room.threads.arguments.ThreadTimelineArgs import im.vector.app.features.home.room.threads.list.viewmodel.ThreadListController import im.vector.app.features.home.room.threads.list.viewmodel.ThreadListViewModel import im.vector.app.features.home.room.threads.list.viewmodel.ThreadListViewState +import im.vector.app.features.rageshake.BugReporter +import im.vector.app.features.rageshake.ReportType import org.matrix.android.sdk.api.session.room.threads.model.ThreadSummary import org.matrix.android.sdk.api.session.room.timeline.TimelineEvent import org.matrix.android.sdk.api.util.MatrixItem @@ -47,6 +49,7 @@ import javax.inject.Inject class ThreadListFragment @Inject constructor( private val avatarRenderer: AvatarRenderer, + private val bugReporter: BugReporter, private val threadListController: ThreadListController, val threadListViewModelFactory: ThreadListViewModel.Factory ) : VectorBaseFragment(), @@ -90,6 +93,7 @@ class ThreadListFragment @Inject constructor( super.onViewCreated(view, savedInstanceState) initToolbar() initTextConstants() + initBetaFeedback() views.threadListRecyclerView.configureWith(threadListController, TimelineItemAnimator(), hasFixedSize = false) threadListController.listener = this } @@ -111,6 +115,13 @@ class ThreadListFragment @Inject constructor( resources.getString(R.string.reply_in_thread)) } + private fun initBetaFeedback() { + views.threadsFeedBackConstraintLayout.isVisible = resources.getBoolean(R.bool.feature_threads_beta_feedback_enabled) + views.threadFeedbackDivider.isVisible = resources.getBoolean(R.bool.feature_threads_beta_feedback_enabled) + views.threadsFeedBackConstraintLayout.debouncedClicks { + bugReporter.openBugReportScreen(requireActivity(), reportType = ReportType.THREADS_BETA_FEEDBACK) + } + } override fun invalidate() = withState(threadListViewModel) { state -> invalidateOptionsMenu() renderEmptyStateIfNeeded(state) diff --git a/vector/src/main/java/im/vector/app/features/rageshake/BugReportActivity.kt b/vector/src/main/java/im/vector/app/features/rageshake/BugReportActivity.kt index 2d4bc704a4..701d04f3c9 100755 --- a/vector/src/main/java/im/vector/app/features/rageshake/BugReportActivity.kt +++ b/vector/src/main/java/im/vector/app/features/rageshake/BugReportActivity.kt @@ -85,6 +85,15 @@ class BugReportActivity : VectorBaseActivity() { hideBugReportOptions() } + ReportType.THREADS_BETA_FEEDBACK -> { + supportActionBar?.setTitle(R.string.send_feedback_threads_title) + + views.bugReportFirstText.setText(R.string.send_feedback_threads_info) + views.bugReportTextInputLayout.hint = getString(R.string.feedback) + views.bugReportButtonContactMe.isVisible = true + + hideBugReportOptions() + } else -> { // other types not supported here } diff --git a/vector/src/main/java/im/vector/app/features/rageshake/BugReporter.kt b/vector/src/main/java/im/vector/app/features/rageshake/BugReporter.kt index 6434ba60f2..bf007ea1b0 100755 --- a/vector/src/main/java/im/vector/app/features/rageshake/BugReporter.kt +++ b/vector/src/main/java/im/vector/app/features/rageshake/BugReporter.kt @@ -255,11 +255,12 @@ class BugReporter @Inject constructor( if (!mIsCancelled) { val text = when (reportType) { - ReportType.BUG_REPORT -> "[Element] $bugDescription" - ReportType.SUGGESTION -> "[Element] [Suggestion] $bugDescription" - ReportType.SPACE_BETA_FEEDBACK -> "[Element] [spaces-feedback] $bugDescription" + ReportType.BUG_REPORT -> "[Element] $bugDescription" + ReportType.SUGGESTION -> "[Element] [Suggestion] $bugDescription" + ReportType.SPACE_BETA_FEEDBACK -> "[Element] [spaces-feedback] $bugDescription" + ReportType.THREADS_BETA_FEEDBACK -> "[Element] [threads-feedback] $bugDescription" ReportType.AUTO_UISI_SENDER, - ReportType.AUTO_UISI -> bugDescription + ReportType.AUTO_UISI -> bugDescription } // build the multi part request @@ -335,17 +336,18 @@ class BugReporter @Inject constructor( builder.addFormDataPart("label", "[Element]") when (reportType) { - ReportType.BUG_REPORT -> { + ReportType.BUG_REPORT -> { /* nop */ } - ReportType.SUGGESTION -> builder.addFormDataPart("label", "[Suggestion]") - ReportType.SPACE_BETA_FEEDBACK -> builder.addFormDataPart("label", "spaces-feedback") - ReportType.AUTO_UISI -> { + ReportType.SUGGESTION -> builder.addFormDataPart("label", "[Suggestion]") + ReportType.SPACE_BETA_FEEDBACK -> builder.addFormDataPart("label", "spaces-feedback") + ReportType.THREADS_BETA_FEEDBACK -> builder.addFormDataPart("label", "threads-feedback") + ReportType.AUTO_UISI -> { builder.addFormDataPart("label", "Z-UISI") builder.addFormDataPart("label", "android") builder.addFormDataPart("label", "uisi-recipient") } - ReportType.AUTO_UISI_SENDER -> { + ReportType.AUTO_UISI_SENDER -> { builder.addFormDataPart("label", "Z-UISI") builder.addFormDataPart("label", "android") builder.addFormDataPart("label", "uisi-sender") diff --git a/vector/src/main/java/im/vector/app/features/rageshake/ReportType.kt b/vector/src/main/java/im/vector/app/features/rageshake/ReportType.kt index f9dc628914..f75420ea55 100644 --- a/vector/src/main/java/im/vector/app/features/rageshake/ReportType.kt +++ b/vector/src/main/java/im/vector/app/features/rageshake/ReportType.kt @@ -1,5 +1,5 @@ /* - * Copyright (c) 2021 New Vector Ltd + * Copyright (c) 2022 New Vector Ltd * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -20,6 +20,7 @@ enum class ReportType { BUG_REPORT, SUGGESTION, SPACE_BETA_FEEDBACK, + THREADS_BETA_FEEDBACK, AUTO_UISI, AUTO_UISI_SENDER, } diff --git a/vector/src/main/res/layout/fragment_thread_list.xml b/vector/src/main/res/layout/fragment_thread_list.xml index 7918aaf178..000b9014d9 100644 --- a/vector/src/main/res/layout/fragment_thread_list.xml +++ b/vector/src/main/res/layout/fragment_thread_list.xml @@ -30,7 +30,7 @@ android:layout_width="0dp" android:layout_height="0dp" android:background="?android:colorBackground" - app:layout_constraintBottom_toBottomOf="parent" + app:layout_constraintBottom_toTopOf="@id/threadsFeedBackConstraintLayout" app:layout_constraintEnd_toEndOf="parent" app:layout_constraintStart_toStartOf="parent" app:layout_constraintTop_toBottomOf="@id/threadListAppBarLayout" @@ -127,4 +127,59 @@ + + + + + + + + \ No newline at end of file diff --git a/vector/src/main/res/values/strings.xml b/vector/src/main/res/values/strings.xml index 5e32ec9c2c..e61d3f9753 100644 --- a/vector/src/main/res/values/strings.xml +++ b/vector/src/main/res/values/strings.xml @@ -1650,6 +1650,10 @@ Thanks, your feedback has been successfully sent The feedback failed to be sent (%s) Give Feedback + Give Feedback + Threads Beta feedback + Threads are a work in progress with new, exciting upcoming features, such as improved notifications. We’d love to hear your feedback! + BETA Show hidden events in timeline "Show complete history in encrypted rooms"