From 15785674dcb870e47ff2e32486ad8fcd0ed1f92d Mon Sep 17 00:00:00 2001 From: Narinder Rana Date: Thu, 31 Mar 2022 13:31:47 +0530 Subject: [PATCH 1/3] remove invite friends option --- .../java/com/moez/QKSMS/common/Navigator.kt | 28 +------ .../feature/settings/about/AboutController.kt | 7 +- .../feature/settings/about/AboutPresenter.kt | 73 ++++++++++++++++--- .../src/main/res/layout/about_controller.xml | 54 ++++++++------ 4 files changed, 103 insertions(+), 59 deletions(-) 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 30556ef3d..d6e6e1f76 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 7385a29c9..260865e69 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 a3373a7cf..26d6f506d 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 @@ -1,3 +1,56 @@ +///* +// * Copyright (C) 2017 Moez Bhatti +// * +// * This file is part of QKSMS. +// * +// * QKSMS is free software: you can redistribute it and/or modify +// * it under the terms of the GNU General Public License as published by +// * the Free Software Foundation, either version 3 of the License, or +// * (at your option) any later version. +// * +// * QKSMS is distributed in the hope that it will be useful, +// * but WITHOUT ANY WARRANTY; without even the implied warranty of +// * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// * GNU General Public License for more details. +// * +// * You should have received a copy of the GNU General Public License +// * along with QKSMS. If not, see . +// */ +//package com.moez.QKSMS.feature.settings.about +// +//import com.moez.QKSMS.R +//import com.moez.QKSMS.common.Navigator +//import com.moez.QKSMS.common.base.QkPresenter +//import com.uber.autodispose.android.lifecycle.scope +//import com.uber.autodispose.autoDisposable +//import javax.inject.Inject +// +//class AboutPresenter @Inject constructor( +// private val navigator: Navigator +//) : QkPresenter(Unit) { +// +// 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() +// } +// } +// } +// +//} + /* * Copyright (C) 2017 Moez Bhatti * @@ -18,6 +71,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 @@ -36,17 +90,16 @@ class AboutPresenter @Inject constructor( .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 22e9fe0d5..dc241cd15 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 + -- GitLab From 9760f79d51069113d3792b9958b2f5d1539edcab Mon Sep 17 00:00:00 2001 From: Narinder Rana Date: Thu, 31 Mar 2022 13:34:08 +0530 Subject: [PATCH 2/3] update About page --- .../java/com/moez/QKSMS/feature/settings/about/AboutPresenter.kt | 1 + 1 file changed, 1 insertion(+) 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 26d6f506d..70a38e11e 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 @@ -86,6 +86,7 @@ class AboutPresenter @Inject constructor( override fun bindIntents(view: AboutView) { super.bindIntents(view) + view.preferenceClicks() .autoDisposable(view.scope()) .subscribe { preference -> -- GitLab From 9d1b98727d0d11c8c25a044fa5888d9f4945881c Mon Sep 17 00:00:00 2001 From: Narinder Rana Date: Thu, 31 Mar 2022 13:43:41 +0530 Subject: [PATCH 3/3] code refine --- .../feature/settings/about/AboutPresenter.kt | 53 ------------------- 1 file changed, 53 deletions(-) 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 70a38e11e..012baf8ad 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 @@ -1,56 +1,3 @@ -///* -// * Copyright (C) 2017 Moez Bhatti -// * -// * This file is part of QKSMS. -// * -// * QKSMS is free software: you can redistribute it and/or modify -// * it under the terms of the GNU General Public License as published by -// * the Free Software Foundation, either version 3 of the License, or -// * (at your option) any later version. -// * -// * QKSMS is distributed in the hope that it will be useful, -// * but WITHOUT ANY WARRANTY; without even the implied warranty of -// * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -// * GNU General Public License for more details. -// * -// * You should have received a copy of the GNU General Public License -// * along with QKSMS. If not, see . -// */ -//package com.moez.QKSMS.feature.settings.about -// -//import com.moez.QKSMS.R -//import com.moez.QKSMS.common.Navigator -//import com.moez.QKSMS.common.base.QkPresenter -//import com.uber.autodispose.android.lifecycle.scope -//import com.uber.autodispose.autoDisposable -//import javax.inject.Inject -// -//class AboutPresenter @Inject constructor( -// private val navigator: Navigator -//) : QkPresenter(Unit) { -// -// 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() -// } -// } -// } -// -//} - /* * Copyright (C) 2017 Moez Bhatti * -- GitLab