Skip to content

Commit

Permalink
Update support options to link to new support accounts
Browse files Browse the repository at this point in the history
  • Loading branch information
rubengees committed Jan 24, 2021
1 parent 337e019 commit 57613e1
Show file tree
Hide file tree
Showing 2 changed files with 30 additions and 13 deletions.
37 changes: 26 additions & 11 deletions src/main/kotlin/me/proxer/app/settings/AboutFragment.kt
Original file line number Diff line number Diff line change
@@ -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
Expand All @@ -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
Expand All @@ -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 = "[email protected]"
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()
Expand Down Expand Up @@ -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)
}
Expand All @@ -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()
)

Expand Down
6 changes: 4 additions & 2 deletions src/main/res/values/strings.xml
Original file line number Diff line number Diff line change
Expand Up @@ -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
</string>
<string name="about_support_forum_title">Forum</string>
<string name="about_support_forum_description">Berichte Fehler oder mache Verbesserungsvorschläge im Forum</string>
<string name="about_support_message_title">Nachricht</string>
<string name="about_support_message_description">Berichte Fehler oder mache Verbesserungsvorschläge per PN</string>
<string name="about_support_mail_title">E-Mail</string>
<string name="about_support_mail_description">Berichte Fehler oder mache Verbesserungsvorschläge per Mail</string>
<string name="about_support_mail_subject">Proxer.Me Android App Support</string>
<string name="about_developer_title">Entwickler</string>
<string name="about_developer_github_title">GitHub</string>
<string name="about_developer_proxer_title">Proxer</string>
<string name="about_error_mail_no_activity">Es ist keine E-Mail App installiert</string>

<string name="introduction_welcome_title">Willkommen!</string>
<string name="introduction_welcome_description">Ein paar Einstellungen und es geht los</string>
Expand Down

0 comments on commit 57613e1

Please sign in to comment.