Loading presentation/src/main/java/com/moez/QKSMS/common/Navigator.kt +4 −24 Original line number Diff line number Diff line Loading @@ -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) Loading @@ -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 Loading presentation/src/main/java/com/moez/QKSMS/feature/settings/about/AboutController.kt +4 −3 Original line number Diff line number Diff line Loading @@ -31,7 +31,8 @@ import javax.inject.Inject class AboutController : QkController<AboutView, Unit, AboutPresenter>(), AboutView { @Inject override lateinit var presenter: AboutPresenter @Inject override lateinit var presenter: AboutPresenter init { appComponent.inject(this) Loading @@ -39,7 +40,7 @@ class AboutController : QkController<AboutView, Unit, AboutPresenter>(), AboutVi } override fun onViewCreated() { version.summary = BuildConfig.VERSION_NAME app_version.summary = BuildConfig.VERSION_NAME } override fun onAttach(view: View) { Loading presentation/src/main/java/com/moez/QKSMS/feature/settings/about/AboutPresenter.kt +63 −10 Original line number Diff line number Diff line ///* // * Copyright (C) 2017 Moez Bhatti <moez.bhatti@gmail.com> // * // * 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 <http://www.gnu.org/licenses/>. // */ //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<AboutView, Unit>(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 <moez.bhatti@gmail.com> * Loading @@ -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 Loading @@ -36,15 +90,14 @@ 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")) } } } Loading presentation/src/main/res/layout/about_controller.xml +32 −22 Original line number Diff line number Diff line <?xml version="1.0" encoding="utf-8"?> <!-- <?xml version="1.0" encoding="utf-8"?><!-- ~ Copyright (C) 2019 Moez Bhatti <moez.bhatti@gmail.com> ~ ~ This file is part of QKSMS. Loading @@ -19,7 +18,6 @@ --> <ScrollView xmlns:android="http://schemas.android.com/apk/res/android" 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:background="?android:attr/windowBackground"> Loading @@ -34,46 +32,58 @@ android:paddingBottom="8dp"> <com.moez.QKSMS.common.widget.PreferenceView android:id="@+id/version" android:id="@+id/app_info" android:layout_width="match_parent" android:layout_height="wrap_content" app:title="@string/about_version_title" tools:summary="3.0.8" /> app:summary="@string/app_info" app:title="@string/app_info_title" /> <com.moez.QKSMS.common.widget.PreferenceView android:id="@+id/developer" android:id="@+id/app_version" android:layout_width="match_parent" android:layout_height="wrap_content" app:summary="@string/about_developer" app:title="@string/about_developer_title" /> app:title="@string/app_version_title" /> <com.moez.QKSMS.common.widget.PreferenceView android:id="@+id/source" android:id="@+id/fork" android:layout_width="match_parent" android:layout_height="wrap_content" app:summary="@string/about_source" app:title="@string/about_source_title" /> app:title="@string/about_fork_title" /> <com.moez.QKSMS.common.widget.PreferenceView android:id="@+id/changelog" android:id="@+id/license" android:layout_width="match_parent" android:layout_height="wrap_content" app:summary="@string/about_changelog" app:title="@string/about_changelog_title" /> app:summary="@string/about_license" app:title="@string/about_license_title" /> <com.moez.QKSMS.common.widget.PreferenceView android:id="@+id/contact" android:id="@+id/author" android:layout_width="match_parent" android:layout_height="wrap_content" app:summary="@string/about_contact" app:title="@string/about_contact_title" /> app:summary="@string/about_author" app:title="@string/about_author_title" /> <com.moez.QKSMS.common.widget.PreferenceView android:id="@+id/license" android:id="@+id/source" android:layout_width="match_parent" android:layout_height="wrap_content" app:summary="@string/about_license" app:title="@string/about_license_title" /> app:summary="@string/about_source" app:title="@string/about_source_title" /> <com.moez.QKSMS.common.widget.PreferenceView android:id="@+id/privacy" android:layout_width="match_parent" android:layout_height="wrap_content" app:title="@string/about_privacy_title" /> <com.moez.QKSMS.common.widget.PreferenceView android:id="@+id/service_terms" android:layout_width="match_parent" android:layout_height="wrap_content" app:title="@string/about_terms_title" /> <com.moez.QKSMS.common.widget.PreferenceView android:id="@+id/copyright" Loading Loading
presentation/src/main/java/com/moez/QKSMS/common/Navigator.kt +4 −24 Original line number Diff line number Diff line Loading @@ -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) Loading @@ -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 Loading
presentation/src/main/java/com/moez/QKSMS/feature/settings/about/AboutController.kt +4 −3 Original line number Diff line number Diff line Loading @@ -31,7 +31,8 @@ import javax.inject.Inject class AboutController : QkController<AboutView, Unit, AboutPresenter>(), AboutView { @Inject override lateinit var presenter: AboutPresenter @Inject override lateinit var presenter: AboutPresenter init { appComponent.inject(this) Loading @@ -39,7 +40,7 @@ class AboutController : QkController<AboutView, Unit, AboutPresenter>(), AboutVi } override fun onViewCreated() { version.summary = BuildConfig.VERSION_NAME app_version.summary = BuildConfig.VERSION_NAME } override fun onAttach(view: View) { Loading
presentation/src/main/java/com/moez/QKSMS/feature/settings/about/AboutPresenter.kt +63 −10 Original line number Diff line number Diff line ///* // * Copyright (C) 2017 Moez Bhatti <moez.bhatti@gmail.com> // * // * 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 <http://www.gnu.org/licenses/>. // */ //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<AboutView, Unit>(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 <moez.bhatti@gmail.com> * Loading @@ -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 Loading @@ -36,15 +90,14 @@ 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")) } } } Loading
presentation/src/main/res/layout/about_controller.xml +32 −22 Original line number Diff line number Diff line <?xml version="1.0" encoding="utf-8"?> <!-- <?xml version="1.0" encoding="utf-8"?><!-- ~ Copyright (C) 2019 Moez Bhatti <moez.bhatti@gmail.com> ~ ~ This file is part of QKSMS. Loading @@ -19,7 +18,6 @@ --> <ScrollView xmlns:android="http://schemas.android.com/apk/res/android" 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:background="?android:attr/windowBackground"> Loading @@ -34,46 +32,58 @@ android:paddingBottom="8dp"> <com.moez.QKSMS.common.widget.PreferenceView android:id="@+id/version" android:id="@+id/app_info" android:layout_width="match_parent" android:layout_height="wrap_content" app:title="@string/about_version_title" tools:summary="3.0.8" /> app:summary="@string/app_info" app:title="@string/app_info_title" /> <com.moez.QKSMS.common.widget.PreferenceView android:id="@+id/developer" android:id="@+id/app_version" android:layout_width="match_parent" android:layout_height="wrap_content" app:summary="@string/about_developer" app:title="@string/about_developer_title" /> app:title="@string/app_version_title" /> <com.moez.QKSMS.common.widget.PreferenceView android:id="@+id/source" android:id="@+id/fork" android:layout_width="match_parent" android:layout_height="wrap_content" app:summary="@string/about_source" app:title="@string/about_source_title" /> app:title="@string/about_fork_title" /> <com.moez.QKSMS.common.widget.PreferenceView android:id="@+id/changelog" android:id="@+id/license" android:layout_width="match_parent" android:layout_height="wrap_content" app:summary="@string/about_changelog" app:title="@string/about_changelog_title" /> app:summary="@string/about_license" app:title="@string/about_license_title" /> <com.moez.QKSMS.common.widget.PreferenceView android:id="@+id/contact" android:id="@+id/author" android:layout_width="match_parent" android:layout_height="wrap_content" app:summary="@string/about_contact" app:title="@string/about_contact_title" /> app:summary="@string/about_author" app:title="@string/about_author_title" /> <com.moez.QKSMS.common.widget.PreferenceView android:id="@+id/license" android:id="@+id/source" android:layout_width="match_parent" android:layout_height="wrap_content" app:summary="@string/about_license" app:title="@string/about_license_title" /> app:summary="@string/about_source" app:title="@string/about_source_title" /> <com.moez.QKSMS.common.widget.PreferenceView android:id="@+id/privacy" android:layout_width="match_parent" android:layout_height="wrap_content" app:title="@string/about_privacy_title" /> <com.moez.QKSMS.common.widget.PreferenceView android:id="@+id/service_terms" android:layout_width="match_parent" android:layout_height="wrap_content" app:title="@string/about_terms_title" /> <com.moez.QKSMS.common.widget.PreferenceView android:id="@+id/copyright" Loading