diff --git a/app/src/main/java/io/github/wulkanowy/ui/modules/about/AboutFragment.kt b/app/src/main/java/io/github/wulkanowy/ui/modules/about/AboutFragment.kt index b491dfc7c..1bf5c7ad9 100644 --- a/app/src/main/java/io/github/wulkanowy/ui/modules/about/AboutFragment.kt +++ b/app/src/main/java/io/github/wulkanowy/ui/modules/about/AboutFragment.kt @@ -93,6 +93,15 @@ class AboutFragment : BaseFragment(R.layout.fragment_about ) } + override val twitterRes: Triple? + get() = context?.run { + Triple( + getString(R.string.about_twitter), + getString(R.string.about_twitter_summary), + getCompatDrawable(R.drawable.ic_about_twitter) + ) + } + override val homepageRes: Triple? get() = context?.run { Triple( @@ -164,6 +173,10 @@ class AboutFragment : BaseFragment(R.layout.fragment_about context?.openInternetBrowser("https://www.facebook.com/wulkanowy", ::showMessage) } + override fun openTwitterPage() { + context?.openInternetBrowser("https://twitter.com/wulkanowy", ::showMessage) + } + override fun openHomepage() { context?.openInternetBrowser("https://wulkanowy.github.io/", ::showMessage) } diff --git a/app/src/main/java/io/github/wulkanowy/ui/modules/about/AboutPresenter.kt b/app/src/main/java/io/github/wulkanowy/ui/modules/about/AboutPresenter.kt index 22be8d41d..6bcf5f77b 100644 --- a/app/src/main/java/io/github/wulkanowy/ui/modules/about/AboutPresenter.kt +++ b/app/src/main/java/io/github/wulkanowy/ui/modules/about/AboutPresenter.kt @@ -51,6 +51,11 @@ class AboutPresenter @Inject constructor( openFacebookPage() analytics.logEvent("about_open", "name" to "facebook") } + twitterRes?.first -> { + Timber.i("Opening twitter") + openTwitterPage() + analytics.logEvent("about_open", "name" to "twitter") + } homepageRes?.first -> { Timber.i("Opening homepage") openHomepage() @@ -84,6 +89,7 @@ class AboutPresenter @Inject constructor( faqRes, discordRes, facebookRes, + twitterRes, homepageRes, licensesRes, privacyRes diff --git a/app/src/main/java/io/github/wulkanowy/ui/modules/about/AboutView.kt b/app/src/main/java/io/github/wulkanowy/ui/modules/about/AboutView.kt index 7c7c0663b..5c286828b 100644 --- a/app/src/main/java/io/github/wulkanowy/ui/modules/about/AboutView.kt +++ b/app/src/main/java/io/github/wulkanowy/ui/modules/about/AboutView.kt @@ -15,6 +15,8 @@ interface AboutView : BaseView { val discordRes: Triple? + val twitterRes: Triple? + val facebookRes: Triple? val homepageRes: Triple? @@ -35,6 +37,8 @@ interface AboutView : BaseView { fun openFacebookPage() + fun openTwitterPage() + fun openEmailClient() fun openFaqPage() diff --git a/app/src/main/res/drawable/ic_about_twitter.xml b/app/src/main/res/drawable/ic_about_twitter.xml new file mode 100644 index 000000000..7b7cf6d5c --- /dev/null +++ b/app/src/main/res/drawable/ic_about_twitter.xml @@ -0,0 +1,7 @@ + + + + diff --git a/app/src/main/res/values/strings.xml b/app/src/main/res/values/strings.xml index 3b42a7e77..1a006fdeb 100644 --- a/app/src/main/res/values/strings.xml +++ b/app/src/main/res/values/strings.xml @@ -414,6 +414,8 @@ Discord server Join the Wulkanowy community Facebook fanpage + Twitter page + Follow us on twitter Like our facebook fanpage Privacy policy Rules for collecting personal data