Add FAQ link (#611)

This commit is contained in:
Mikołaj Pich 2019-12-07 22:06:15 +01:00 committed by Rafał Borcz
parent 2a7a472d90
commit f570acbed6
14 changed files with 65 additions and 30 deletions

View File

@ -47,6 +47,11 @@ class AboutFragment : BaseFragment(), AboutView, MainView.TitledView {
Triple(getString(R.string.about_feedback), getString(R.string.about_feedback_summary), getCompatDrawable(R.drawable.ic_about_feedback))
}
override val faqRes: Triple<String, String, Drawable?>?
get() = context?.run {
Triple(getString(R.string.about_faq), getString(R.string.about_faq_summary), getCompatDrawable(R.drawable.ic_about_faq))
}
override val discordRes: Triple<String, String, Drawable?>?
get() = context?.run {
Triple(getString(R.string.about_discord), getString(R.string.about_discord_summary), getCompatDrawable(R.drawable.ic_about_discord))
@ -130,6 +135,10 @@ class AboutFragment : BaseFragment(), AboutView, MainView.TitledView {
}
}
override fun openFaqPage() {
context?.openInternetBrowser("https://wulkanowy.github.io/czesto-zadawane-pytania", ::showMessage)
}
override fun openLicenses() {
(activity as? MainActivity)?.pushView(LicenseFragment.newInstance())
}

View File

@ -28,10 +28,15 @@ class AboutPresenter @Inject constructor(
view?.run {
when (item.title) {
feedbackRes?.first -> {
Timber.i("Opening email client ")
Timber.i("Opening email client")
openEmailClient()
analytics.logEvent("about_open", "name" to "feedback")
}
faqRes?.first -> {
Timber.i("Opening faq page")
openFaqPage()
analytics.logEvent("about_open", "name" to "faq")
}
discordRes?.first -> {
Timber.i("Opening discord")
openDiscordInvite()
@ -61,6 +66,7 @@ class AboutPresenter @Inject constructor(
updateData(AboutScrollableHeader(), listOfNotNull(
versionRes?.let { (title, summary, image) -> AboutItem(title, summary, image) },
feedbackRes?.let { (title, summary, image) -> AboutItem(title, summary, image) },
faqRes?.let { (title, summary, image) -> AboutItem(title, summary, image) },
discordRes?.let { (title, summary, image) -> AboutItem(title, summary, image) },
homepageRes?.let { (title, summary, image) -> AboutItem(title, summary, image) },
licensesRes?.let { (title, summary, image) -> AboutItem(title, summary, image) },

View File

@ -9,6 +9,8 @@ interface AboutView : BaseView {
val feedbackRes: Triple<String, String, Drawable?>?
val faqRes: Triple<String, String, Drawable?>?
val discordRes: Triple<String, String, Drawable?>?
val homepageRes: Triple<String, String, Drawable?>?
@ -25,6 +27,8 @@ interface AboutView : BaseView {
fun openEmailClient()
fun openFaqPage()
fun openHomepage()
fun openLicenses()

View File

@ -62,7 +62,7 @@ class LoginFormFragment : BaseFragment(), LoginFormView {
loginFormHost.setOnItemClickListener { _, _, _, _ -> presenter.onHostSelected() }
loginFormSignIn.setOnClickListener { presenter.onSignInClick() }
loginFormPrivacyLink.setOnClickListener { presenter.onPrivacyLinkClick() }
loginFormContactDiscord.setOnClickListener { presenter.onDiscordClick() }
loginFormFaq.setOnClickListener { presenter.onFaqClick() }
loginFormContactEmail.setOnClickListener { presenter.onEmailClick() }
loginFormPass.setOnEditorActionListener { _, id, _ ->
@ -161,8 +161,8 @@ class LoginFormFragment : BaseFragment(), LoginFormView {
presenter.onDetachView()
}
override fun openDiscordInvite() {
context?.openInternetBrowser("https://discord.gg/vccAQBr", ::showMessage)
override fun openFaqPage() {
context?.openInternetBrowser("https://wulkanowy.github.io/czesto-zadawane-pytania/dlaczego-nie-moge-sie-zalogowac", ::showMessage)
}
override fun openEmail() {

View File

@ -91,8 +91,8 @@ class LoginFormPresenter @Inject constructor(
}))
}
fun onDiscordClick() {
view?.openDiscordInvite()
fun onFaqClick() {
view?.openFaqPage()
}
fun onEmailClick() {

View File

@ -45,7 +45,7 @@ interface LoginFormView : BaseView {
fun showContact(show: Boolean)
fun openDiscordInvite()
fun openFaqPage()
fun openEmail()
}

View File

@ -50,7 +50,7 @@ class LoginSymbolFragment : BaseFragment(), LoginSymbolView {
override fun initView() {
loginSymbolSignIn.setOnClickListener { presenter.attemptLogin(loginSymbolName.text.toString()) }
loginSymbolContactDiscord.setOnClickListener { presenter.onDiscordClick() }
loginSymbolFaq.setOnClickListener { presenter.onFaqClick() }
loginSymbolContactEmail.setOnClickListener { presenter.onEmailClick() }
loginSymbolName.doOnTextChanged { _, _, _, _ -> presenter.onSymbolTextChanged() }
@ -126,8 +126,8 @@ class LoginSymbolFragment : BaseFragment(), LoginSymbolView {
presenter.onDetachView()
}
override fun openDiscordInvite() {
context?.openInternetBrowser("https://discord.gg/vccAQBr", ::showMessage)
override fun openFaqPage() {
context?.openInternetBrowser("https://wulkanowy.github.io/czesto-zadawane-pytania/co-to-jest-symbol", ::showMessage)
}
override fun openEmail() {

View File

@ -89,8 +89,8 @@ class LoginSymbolPresenter @Inject constructor(
}
}
fun onDiscordClick() {
view?.openDiscordInvite()
fun onFaqClick() {
view?.openFaqPage()
}
fun onEmailClick() {

View File

@ -29,7 +29,7 @@ interface LoginSymbolView : BaseView {
fun showContact(show: Boolean)
fun openDiscordInvite()
fun openFaqPage()
fun openEmail()
}

View File

@ -0,0 +1,9 @@
<vector xmlns:android="http://schemas.android.com/apk/res/android"
android:width="24dp"
android:height="24dp"
android:viewportWidth="24"
android:viewportHeight="24">
<path
android:fillColor="#FFF"
android:pathData="M11,18H13V16H11V18M12,2A10,10 0,0 0,2 12A10,10 0,0 0,12 22A10,10 0,0 0,22 12A10,10 0,0 0,12 2M12,20C7.59,20 4,16.41 4,12C4,7.59 7.59,4 12,4C16.41,4 20,7.59 20,12C20,16.41 16.41,20 12,20M12,6A4,4 0,0 0,8 10H10A2,2 0,0 1,12 8A2,2 0,0 1,14 10C14,12 11,11.75 11,15H13C13,12.75 16,12.5 16,10A4,4 0,0 0,12 6Z" />
</vector>

View File

@ -2,7 +2,8 @@
xmlns:app="http://schemas.android.com/apk/res-auto"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="match_parent">
android:layout_height="match_parent"
tools:context=".ui.modules.login.form.LoginFormFragment">
<me.zhanghai.android.materialprogressbar.MaterialProgressBar
android:id="@+id/loginFormProgress"
@ -71,15 +72,15 @@
app:icon="@drawable/ic_more_messages" />
<com.google.android.material.button.MaterialButton
android:id="@+id/loginFormContactDiscord"
android:id="@+id/loginFormFaq"
style="@style/Widget.MaterialComponents.Button.OutlinedButton"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_marginStart="8dp"
android:layout_marginLeft="8dp"
android:layout_weight="1"
android:text="@string/login_contact_discord"
app:icon="@drawable/ic_about_discord" />
android:text="@string/about_faq"
app:icon="@drawable/ic_about_faq" />
</LinearLayout>
<View

View File

@ -2,7 +2,8 @@
xmlns:app="http://schemas.android.com/apk/res-auto"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="match_parent">
android:layout_height="match_parent"
tools:context=".ui.modules.login.symbol.LoginSymbolFragment">
<me.zhanghai.android.materialprogressbar.MaterialProgressBar
android:id="@+id/loginSymbolProgress"
@ -29,10 +30,10 @@
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="vertical"
android:visibility="gone"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="parent"
android:visibility="gone"
tools:visibility="visible">
<View
@ -47,9 +48,9 @@
android:layout_height="wrap_content"
android:layout_marginStart="32dp"
android:layout_marginLeft="32dp"
android:layout_marginTop="16dp"
android:layout_marginEnd="32dp"
android:layout_marginRight="32dp"
android:layout_marginTop="16dp"
android:layout_marginBottom="16dp"
android:gravity="center_horizontal"
android:text="@string/login_contact_header"
@ -60,30 +61,31 @@
android:id="@+id/loginSymbolContactButtons"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="horizontal"
android:layout_marginLeft="16dp"
android:layout_marginRight="16dp">
android:layout_marginRight="16dp"
android:orientation="horizontal">
<com.google.android.material.button.MaterialButton
style="@style/Widget.MaterialComponents.Button.OutlinedButton"
android:id="@+id/loginSymbolContactEmail"
style="@style/Widget.MaterialComponents.Button.OutlinedButton"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_weight="1"
android:layout_marginRight="8dp"
android:layout_marginEnd="8dp"
android:layout_marginRight="8dp"
android:layout_weight="1"
android:text="@string/login_contact_email"
app:icon="@drawable/ic_more_messages" />
<com.google.android.material.button.MaterialButton
android:id="@+id/loginSymbolFaq"
style="@style/Widget.MaterialComponents.Button.OutlinedButton"
android:id="@+id/loginSymbolContactDiscord"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_weight="1"
android:layout_marginLeft="8dp"
android:layout_marginStart="8dp"
android:text="@string/login_contact_discord"
app:icon="@drawable/ic_about_discord" />
android:layout_marginLeft="8dp"
android:layout_weight="1"
android:text="@string/about_faq"
app:icon="@drawable/ic_about_faq" />
</LinearLayout>
<View

View File

@ -259,6 +259,8 @@
<string name="about_version">Wersja aplikacji</string>
<string name="about_feedback">Zgłoś błąd</string>
<string name="about_feedback_summary">Wyślij zgłoszenie o błędzie poprzez e-maila</string>
<string name="about_faq">FAQ</string>
<string name="about_faq_summary">Zobacz Najczęściej Zadawane Pytania</string>
<string name="about_discord">Serwer discord</string>
<string name="about_discord_summary">Dołącz do społeczności wulkanowego</string>
<string name="about_privacy">Polityka prywatności</string>

View File

@ -240,6 +240,8 @@
<string name="about_version">App version</string>
<string name="about_feedback">Report a bug</string>
<string name="about_feedback_summary">Send a bug report via e-mail</string>
<string name="about_faq">FAQ</string>
<string name="about_faq_summary">Read Frequently Asked Questions</string>
<string name="about_discord">Discord server</string>
<string name="about_discord_summary">Join the wulkanowy community</string>
<string name="about_privacy">Privacy policy</string>