11package me.proxer.app.settings
22
3+ import android.content.ActivityNotFoundException
34import android.content.ClipData
45import android.content.ClipboardManager
56import android.content.Context
7+ import android.content.Intent
8+ import android.net.Uri
69import android.os.Bundle
710import androidx.core.content.ContextCompat
811import androidx.core.content.getSystemService
@@ -27,7 +30,6 @@ import me.proxer.app.chat.prv.Participant
2730import me.proxer.app.chat.prv.PrvMessengerActivity
2831import me.proxer.app.chat.prv.create.CreateConferenceActivity
2932import me.proxer.app.chat.prv.sync.MessengerDao
30- import me.proxer.app.forum.TopicActivity
3133import me.proxer.app.profile.ProfileActivity
3234import me.proxer.app.settings.status.ServerStatusActivity
3335import me.proxer.app.util.extension.androidUri
@@ -54,12 +56,12 @@ class AboutFragment : MaterialAboutFragment(), CustomTabsAware {
5456 private val discordLink = " https://discord.gg/XwrEDmA" .toPrefixedHttpUrl()
5557 private val repositoryLink = " https://github.com/proxer/ProxerAndroid" .toPrefixedHttpUrl()
5658
57- private const val supportId = " 374605 "
58- private const val supportCategory = " anwendungen "
59+ private const val supportProxerMail = " [email protected] " 60+ private const val supportProxerName = " Support "
5961
62+ private const val developerGithubName = " rubengees"
6063 private const val developerProxerName = " RubyGee"
6164 private const val developerProxerId = " 121658"
62- private const val developerGithubName = " rubengees"
6365
6466 fun newInstance () = AboutFragment ().apply {
6567 arguments = bundleOf()
@@ -235,19 +237,19 @@ class AboutFragment : MaterialAboutFragment(), CustomTabsAware {
235237 .text(R .string.about_support_message_title)
236238 .subText(R .string.about_support_message_description)
237239 .icon(
238- IconicsDrawable (context, CommunityMaterial .Icon .cmd_email ).apply {
240+ IconicsDrawable (context, CommunityMaterial .Icon2 .cmd_forum ).apply {
239241 colorInt = context.resolveColor(R .attr.colorIcon)
240242 }
241243 )
242244 .setOnClickAction {
243245 Completable
244246 .fromAction {
245- messengerDao.findConferenceForUser(developerProxerName ).let { existingConference ->
247+ messengerDao.findConferenceForUser(supportProxerName ).let { existingConference ->
246248 when (existingConference) {
247249 null -> CreateConferenceActivity .navigateTo(
248250 requireActivity(),
249251 false ,
250- Participant (developerProxerName )
252+ Participant (supportProxerName )
251253 )
252254 else -> PrvMessengerActivity .navigateTo(requireActivity(), existingConference)
253255 }
@@ -257,14 +259,27 @@ class AboutFragment : MaterialAboutFragment(), CustomTabsAware {
257259 .subscribeAndLogErrors()
258260 }.build(),
259261 MaterialAboutActionItem .Builder ()
260- .text(R .string.about_support_forum_title )
261- .subText(R .string.about_support_forum_description )
262+ .text(R .string.about_support_mail_title )
263+ .subText(R .string.about_support_mail_description )
262264 .icon(
263- IconicsDrawable (context, CommunityMaterial .Icon2 .cmd_forum ).apply {
265+ IconicsDrawable (context, CommunityMaterial .Icon .cmd_email ).apply {
264266 colorInt = context.resolveColor(R .attr.colorIcon)
265267 }
266268 )
267- .setOnClickAction { TopicActivity .navigateTo(requireActivity(), supportId, supportCategory) }
269+ .setOnClickAction {
270+ val intent = Intent (Intent .ACTION_SENDTO ).apply {
271+ data = Uri .parse(" mailto:" )
272+
273+ putExtra(Intent .EXTRA_EMAIL , arrayOf(supportProxerMail))
274+ putExtra(Intent .EXTRA_SUBJECT , getString(R .string.about_support_mail_subject))
275+ }
276+
277+ try {
278+ startActivity(intent)
279+ } catch (error: ActivityNotFoundException ) {
280+ requireContext().toast(R .string.about_error_mail_no_activity)
281+ }
282+ }
268283 .build()
269284 )
270285
0 commit comments