Add twitter page link to about fragment (#1411)

This commit is contained in:
MRmlik12
2021-07-30 19:13:06 +02:00
committed by GitHub
parent 3422951e47
commit c8c9001277
5 changed files with 32 additions and 0 deletions

View File

@ -93,6 +93,15 @@ class AboutFragment : BaseFragment<FragmentAboutBinding>(R.layout.fragment_about
)
}
override val twitterRes: Triple<String, String, Drawable?>?
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<String, String, Drawable?>?
get() = context?.run {
Triple(
@ -164,6 +173,10 @@ class AboutFragment : BaseFragment<FragmentAboutBinding>(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)
}

View File

@ -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

View File

@ -15,6 +15,8 @@ interface AboutView : BaseView {
val discordRes: Triple<String, String, Drawable?>?
val twitterRes: Triple<String, String, Drawable?>?
val facebookRes: Triple<String, String, Drawable?>?
val homepageRes: Triple<String, String, Drawable?>?
@ -35,6 +37,8 @@ interface AboutView : BaseView {
fun openFacebookPage()
fun openTwitterPage()
fun openEmailClient()
fun openFaqPage()