From 57613e150c5581a49da595412f03355424193162 Mon Sep 17 00:00:00 2001 From: Ruben Gees Date: Sun, 24 Jan 2021 19:49:20 +0100 Subject: [PATCH] Update support options to link to new support accounts --- .../me/proxer/app/settings/AboutFragment.kt | 37 +++++++++++++------ src/main/res/values/strings.xml | 6 ++- 2 files changed, 30 insertions(+), 13 deletions(-) diff --git a/src/main/kotlin/me/proxer/app/settings/AboutFragment.kt b/src/main/kotlin/me/proxer/app/settings/AboutFragment.kt index e5bd488d..744d5ca4 100644 --- a/src/main/kotlin/me/proxer/app/settings/AboutFragment.kt +++ b/src/main/kotlin/me/proxer/app/settings/AboutFragment.kt @@ -1,8 +1,11 @@ package me.proxer.app.settings +import android.content.ActivityNotFoundException import android.content.ClipData import android.content.ClipboardManager import android.content.Context +import android.content.Intent +import android.net.Uri import android.os.Bundle import androidx.core.content.ContextCompat import androidx.core.content.getSystemService @@ -27,7 +30,6 @@ import me.proxer.app.chat.prv.Participant import me.proxer.app.chat.prv.PrvMessengerActivity import me.proxer.app.chat.prv.create.CreateConferenceActivity import me.proxer.app.chat.prv.sync.MessengerDao -import me.proxer.app.forum.TopicActivity import me.proxer.app.profile.ProfileActivity import me.proxer.app.settings.status.ServerStatusActivity import me.proxer.app.util.extension.androidUri @@ -54,12 +56,12 @@ class AboutFragment : MaterialAboutFragment(), CustomTabsAware { private val discordLink = "https://discord.gg/XwrEDmA".toPrefixedHttpUrl() private val repositoryLink = "https://github.com/proxer/ProxerAndroid".toPrefixedHttpUrl() - private const val supportId = "374605" - private const val supportCategory = "anwendungen" + private const val supportProxerMail = "support@proxer.de" + private const val supportProxerName = "Support" + private const val developerGithubName = "rubengees" private const val developerProxerName = "RubyGee" private const val developerProxerId = "121658" - private const val developerGithubName = "rubengees" fun newInstance() = AboutFragment().apply { arguments = bundleOf() @@ -235,19 +237,19 @@ class AboutFragment : MaterialAboutFragment(), CustomTabsAware { .text(R.string.about_support_message_title) .subText(R.string.about_support_message_description) .icon( - IconicsDrawable(context, CommunityMaterial.Icon.cmd_email).apply { + IconicsDrawable(context, CommunityMaterial.Icon2.cmd_forum).apply { colorInt = context.resolveColor(R.attr.colorIcon) } ) .setOnClickAction { Completable .fromAction { - messengerDao.findConferenceForUser(developerProxerName).let { existingConference -> + messengerDao.findConferenceForUser(supportProxerName).let { existingConference -> when (existingConference) { null -> CreateConferenceActivity.navigateTo( requireActivity(), false, - Participant(developerProxerName) + Participant(supportProxerName) ) else -> PrvMessengerActivity.navigateTo(requireActivity(), existingConference) } @@ -257,14 +259,27 @@ class AboutFragment : MaterialAboutFragment(), CustomTabsAware { .subscribeAndLogErrors() }.build(), MaterialAboutActionItem.Builder() - .text(R.string.about_support_forum_title) - .subText(R.string.about_support_forum_description) + .text(R.string.about_support_mail_title) + .subText(R.string.about_support_mail_description) .icon( - IconicsDrawable(context, CommunityMaterial.Icon2.cmd_forum).apply { + IconicsDrawable(context, CommunityMaterial.Icon.cmd_email).apply { colorInt = context.resolveColor(R.attr.colorIcon) } ) - .setOnClickAction { TopicActivity.navigateTo(requireActivity(), supportId, supportCategory) } + .setOnClickAction { + val intent = Intent(Intent.ACTION_SENDTO).apply { + data = Uri.parse("mailto:") + + putExtra(Intent.EXTRA_EMAIL, arrayOf(supportProxerMail)) + putExtra(Intent.EXTRA_SUBJECT, getString(R.string.about_support_mail_subject)) + } + + try { + startActivity(intent) + } catch (error: ActivityNotFoundException) { + requireContext().toast(R.string.about_error_mail_no_activity) + } + } .build() ) diff --git a/src/main/res/values/strings.xml b/src/main/res/values/strings.xml index 70c916a0..31a49024 100755 --- a/src/main/res/values/strings.xml +++ b/src/main/res/values/strings.xml @@ -887,13 +887,15 @@ Bitte prüfe den Serverstatus bevor du einen Fehler meldest. Wenn es sich nicht um ein technisches Problem handelt, wende dich bitte an das zutreffende Team - Forum - Berichte Fehler oder mache Verbesserungsvorschläge im Forum Nachricht Berichte Fehler oder mache Verbesserungsvorschläge per PN + E-Mail + Berichte Fehler oder mache Verbesserungsvorschläge per Mail + Proxer.Me Android App Support Entwickler GitHub Proxer + Es ist keine E-Mail App installiert Willkommen! Ein paar Einstellungen und es geht los