diff --git a/presentation/src/main/java/com/moez/QKSMS/common/Navigator.kt b/presentation/src/main/java/com/moez/QKSMS/common/Navigator.kt index 30556ef3d490cd6bc3b58532239e688204c373cf..d6e6e1f767902776e3f25e2919f718aad0ffbec7 100644 --- a/presentation/src/main/java/com/moez/QKSMS/common/Navigator.kt +++ b/presentation/src/main/java/com/moez/QKSMS/common/Navigator.kt @@ -141,25 +141,17 @@ class Navigator @Inject constructor( startActivity(intent) } - fun showDeveloper() { - val intent = Intent(Intent.ACTION_VIEW, Uri.parse("https://github.com/moezbhatti")) - startActivityExternal(intent) + fun openUri(uri: Uri) { + val intent = Intent(Intent.ACTION_VIEW, uri) + startActivity(intent) } - fun showSourceCode() { - val intent = Intent(Intent.ACTION_VIEW, Uri.parse("https://github.com/moezbhatti/qksms")) - startActivityExternal(intent) - } fun showChangelog() { val intent = Intent(Intent.ACTION_VIEW, Uri.parse("https://github.com/moezbhatti/qksms/releases")) startActivityExternal(intent) } - fun showLicense() { - val intent = Intent(Intent.ACTION_VIEW, Uri.parse("https://github.com/moezbhatti/qksms/blob/master/LICENSE")) - startActivityExternal(intent) - } fun showBlockedConversations() { val intent = Intent(context, BlockingActivity::class.java) @@ -177,19 +169,7 @@ class Navigator @Inject constructor( startActivityExternal(intent) } - fun showRating() { - val intent = Intent(Intent.ACTION_VIEW, Uri.parse("market://details?id=com.moez.QKSMS")) - .addFlags(Intent.FLAG_ACTIVITY_NO_HISTORY - or Intent.FLAG_ACTIVITY_NEW_DOCUMENT - or Intent.FLAG_ACTIVITY_MULTIPLE_TASK) - - try { - startActivityExternal(intent) - } catch (e: ActivityNotFoundException) { - val url = "http://play.google.com/store/apps/details?id=com.moez.QKSMS" - startActivityExternal(Intent(Intent.ACTION_VIEW, Uri.parse(url))) - } - } + /** * Launch the Play Store and display the Call Blocker listing diff --git a/presentation/src/main/java/com/moez/QKSMS/feature/settings/about/AboutController.kt b/presentation/src/main/java/com/moez/QKSMS/feature/settings/about/AboutController.kt index 7385a29c91db11d1b3997a925a8419ca859dc21c..260865e69968cdc7b5cb1d5cdf7309c475694194 100644 --- a/presentation/src/main/java/com/moez/QKSMS/feature/settings/about/AboutController.kt +++ b/presentation/src/main/java/com/moez/QKSMS/feature/settings/about/AboutController.kt @@ -31,7 +31,8 @@ import javax.inject.Inject class AboutController : QkController(), AboutView { - @Inject override lateinit var presenter: AboutPresenter + @Inject + override lateinit var presenter: AboutPresenter init { appComponent.inject(this) @@ -39,7 +40,7 @@ class AboutController : QkController(), AboutVi } override fun onViewCreated() { - version.summary = BuildConfig.VERSION_NAME + app_version.summary = BuildConfig.VERSION_NAME } override fun onAttach(view: View) { @@ -59,4 +60,4 @@ class AboutController : QkController(), AboutVi // No special rendering required } -} \ No newline at end of file +} diff --git a/presentation/src/main/java/com/moez/QKSMS/feature/settings/about/AboutPresenter.kt b/presentation/src/main/java/com/moez/QKSMS/feature/settings/about/AboutPresenter.kt index a3373a7cfbb19f0ba780cb72ea3ef80dbe041306..012baf8ad7b07274a4eca81782d90681c891e369 100644 --- a/presentation/src/main/java/com/moez/QKSMS/feature/settings/about/AboutPresenter.kt +++ b/presentation/src/main/java/com/moez/QKSMS/feature/settings/about/AboutPresenter.kt @@ -18,6 +18,7 @@ */ package com.moez.QKSMS.feature.settings.about +import android.net.Uri import com.moez.QKSMS.R import com.moez.QKSMS.common.Navigator import com.moez.QKSMS.common.base.QkPresenter @@ -32,21 +33,21 @@ class AboutPresenter @Inject constructor( override fun bindIntents(view: AboutView) { super.bindIntents(view) + view.preferenceClicks() .autoDisposable(view.scope()) .subscribe { preference -> when (preference.id) { - R.id.developer -> navigator.showDeveloper() - - R.id.source -> navigator.showSourceCode() - - R.id.changelog -> navigator.showChangelog() - - R.id.contact -> navigator.showSupport() - - R.id.license -> navigator.showLicense() + R.id.fork -> navigator.openUri(Uri.parse("https://github.com/moezbhatti/qksms")) + R.id.source -> navigator.openUri(Uri.parse("https://gitlab.e.foundation/e/apps/message")) + R.id.copyright -> navigator.openUri(Uri.parse("https://gitlab.e.foundation/e/apps/Message/-/blob/master/AUTHORS")) + R.id.license -> navigator.openUri(Uri.parse("https://gitlab.e.foundation/e/apps/Message/-/blob/master/LICENSE")) + R.id.author -> navigator.openUri(Uri.parse("https://gitlab.e.foundation/e/apps/Message/-/blob/master/AUTHORS")) + R.id.privacy -> navigator.openUri(Uri.parse("https://e.foundation/legal-notice-privacy/")) + R.id.service_terms -> navigator.openUri(Uri.parse("https://e.foundation/legal-notice-privacy/")) + R.id.app_version -> navigator.openUri(Uri.parse("https://gitlab.e.foundation/e/apps/Message/-/releases")) } } } -} \ No newline at end of file +} diff --git a/presentation/src/main/res/layout/about_controller.xml b/presentation/src/main/res/layout/about_controller.xml index 22e9fe0d57cb754f8610a30f392ec0b9a9f9c70d..dc241cd15e954b9f1f39644f1eb85ca3fc63c901 100644 --- a/presentation/src/main/res/layout/about_controller.xml +++ b/presentation/src/main/res/layout/about_controller.xml @@ -1,5 +1,4 @@ - - @@ -34,46 +32,58 @@ android:paddingBottom="8dp"> + app:summary="@string/app_info" + app:title="@string/app_info_title" /> + app:title="@string/app_version_title" /> + + app:title="@string/about_fork_title" /> + app:summary="@string/about_license" + app:title="@string/about_license_title" /> + app:summary="@string/about_author" + app:title="@string/about_author_title" /> + app:summary="@string/about_source" + app:title="@string/about_source_title" /> + + + + + - \ No newline at end of file +