From 1eed611f4e72e6f0c7bf62134146ab650e32eff6 Mon Sep 17 00:00:00 2001 From: SpiritCroc Date: Tue, 17 May 2022 10:11:50 +0200 Subject: [PATCH] Allow shorter bug report messages for internal / debug builds Change-Id: I0dd84bcca6d28ce9615ae40c06020a65d2401eea --- .../app/features/rageshake/BugReportActivity.kt | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) 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 4d7294f4fb..b3f5ea34da 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 @@ -26,6 +26,7 @@ import androidx.core.widget.doOnTextChanged import com.airbnb.mvrx.viewModel import com.airbnb.mvrx.withState import dagger.hilt.android.AndroidEntryPoint +import im.vector.app.BuildConfig import im.vector.app.R import im.vector.app.core.platform.VectorBaseActivity import im.vector.app.databinding.ActivityBugReportBinding @@ -131,10 +132,18 @@ class BugReportActivity : VectorBaseActivity() { return super.onPrepareOptionsMenu(menu) } + private fun minBugReportLength(): Int { + return if (BuildConfig.DEBUG || BuildConfig.GIT_BRANCH_NAME == "sm_fdroid") { + 2 + } else { + 10 + } + } + override fun onOptionsItemSelected(item: MenuItem): Boolean { when (item.itemId) { R.id.ic_action_send_bug_report -> { - if (views.bugReportEditText.text.toString().trim().length >= 10) { + if (views.bugReportEditText.text.toString().trim().length >= minBugReportLength()) { sendBugReport() } else { views.bugReportTextInputLayout.error = getString(R.string.bug_report_error_too_short)