Remove in-app email shortcut

This commit is contained in:
darken
2022-08-24 11:40:16 +02:00
parent a3495a8218
commit 5bae3d9931
3 changed files with 0 additions and 38 deletions
@@ -28,17 +28,12 @@ class SupportFragment : PreferenceFragment2() {
@Inject lateinit var clipboardHelper: ClipboardHelper
private val installIdPref by lazy { findPreference<Preference>("support.installid")!! }
private val supportMailPref by lazy { findPreference<Preference>("support.email.darken")!! }
override fun onPreferencesCreated() {
installIdPref.setOnPreferenceClickListener {
vm.copyInstallID()
true
}
supportMailPref.setOnPreferenceClickListener {
vm.sendSupportMail()
true
}
super.onPreferencesCreated()
}
@@ -52,8 +47,6 @@ class SupportFragment : PreferenceFragment2() {
.show()
}
vm.emailEvent.observe2(this) { startActivity(it) }
super.onViewCreated(view, savedInstanceState)
}
}
@@ -1,11 +1,7 @@
package eu.darken.capod.main.ui.settings.support
import android.content.Intent
import android.os.Build
import androidx.lifecycle.SavedStateHandle
import dagger.hilt.android.lifecycle.HiltViewModel
import eu.darken.capod.common.BuildConfigWrap
import eu.darken.capod.common.EmailTool
import eu.darken.capod.common.InstallId
import eu.darken.capod.common.coroutine.DispatcherProvider
import eu.darken.capod.common.livedata.SingleLiveEvent
@@ -16,33 +12,11 @@ import javax.inject.Inject
class SupportFragmentVM @Inject constructor(
private val handle: SavedStateHandle,
private val dispatcherProvider: DispatcherProvider,
private val emailTool: EmailTool,
private val installId: InstallId,
) : ViewModel3(dispatcherProvider) {
val emailEvent = SingleLiveEvent<Intent>()
val clipboardEvent = SingleLiveEvent<String>()
fun sendSupportMail() = launch {
val bodyInfo = StringBuilder("\n\n\n")
bodyInfo.append("--- Infos for the developer ---\n")
bodyInfo.append("App version: ").append(BuildConfigWrap.VERSION_DESCRIPTION_LONG).append("\n")
bodyInfo.append("Device: ").append(Build.FINGERPRINT).append("\n")
bodyInfo.append("Install ID: ").append(installId.id).append("\n")
val email = EmailTool.Email(
receipients = listOf("support@darken.eu"),
subject = "[CAPod] Question/Suggestion/Request\n",
body = bodyInfo.toString()
)
emailEvent.postValue(emailTool.build(email))
}
fun copyInstallID() = launch {
clipboardEvent.postValue(installId.id)
}
@@ -17,11 +17,6 @@
android:action="android.intent.action.VIEW"
android:data="https://github.com/d4rken-org/capod/issues" />
</Preference>
<Preference
android:icon="@drawable/ic_email_onsurface"
android:key="support.email.darken"
android:summary="@string/settings_support_email_developer_description"
android:title="@string/settings_support_email_developer_label" />
<PreferenceCategory app:title="@string/settings_category_other_label">
<Preference