From 9c34187391a7fee20614c03c9ba2a6613d1b3260 Mon Sep 17 00:00:00 2001 From: Benoit Marty Date: Tue, 9 Jun 2020 12:22:47 +0200 Subject: [PATCH 1/6] Move "integration" setting above "advanced" section --- .../main/res/xml/vector_settings_general.xml | 40 +++++++++---------- 1 file changed, 20 insertions(+), 20 deletions(-) diff --git a/vector/src/main/res/xml/vector_settings_general.xml b/vector/src/main/res/xml/vector_settings_general.xml index 846380465e..7248280e37 100644 --- a/vector/src/main/res/xml/vector_settings_general.xml +++ b/vector/src/main/res/xml/vector_settings_general.xml @@ -68,6 +68,26 @@ + + + + + + + + + + - - - - - - - - - - Date: Wed, 17 Jun 2020 15:30:56 +0200 Subject: [PATCH 2/6] Add airplane mode icon --- .../main/res/drawable/ic_airplane_16dp.xml | 13 ++++++++++++ .../src/main/res/layout/view_sync_state.xml | 21 ++++++++++++++----- 2 files changed, 29 insertions(+), 5 deletions(-) create mode 100644 vector/src/main/res/drawable/ic_airplane_16dp.xml diff --git a/vector/src/main/res/drawable/ic_airplane_16dp.xml b/vector/src/main/res/drawable/ic_airplane_16dp.xml new file mode 100644 index 0000000000..fa2387ebf0 --- /dev/null +++ b/vector/src/main/res/drawable/ic_airplane_16dp.xml @@ -0,0 +1,13 @@ + + + diff --git a/vector/src/main/res/layout/view_sync_state.xml b/vector/src/main/res/layout/view_sync_state.xml index 0e7ddabc21..49b3bb3857 100644 --- a/vector/src/main/res/layout/view_sync_state.xml +++ b/vector/src/main/res/layout/view_sync_state.xml @@ -1,5 +1,6 @@ - + tools:visibility="visible"> + + + + \ No newline at end of file From fa204eca3b7ad644818190bebf832a5d9e390818 Mon Sep 17 00:00:00 2001 From: Benoit Marty Date: Wed, 17 Jun 2020 15:37:35 +0200 Subject: [PATCH 3/6] Add link to Widget doc --- .../matrix/android/api/session/widgets/model/WidgetContent.kt | 3 +++ .../matrix/android/api/session/widgets/model/WidgetType.kt | 3 +++ 2 files changed, 6 insertions(+) diff --git a/matrix-sdk-android/src/main/java/im/vector/matrix/android/api/session/widgets/model/WidgetContent.kt b/matrix-sdk-android/src/main/java/im/vector/matrix/android/api/session/widgets/model/WidgetContent.kt index 7e045f25c7..af70400622 100644 --- a/matrix-sdk-android/src/main/java/im/vector/matrix/android/api/session/widgets/model/WidgetContent.kt +++ b/matrix-sdk-android/src/main/java/im/vector/matrix/android/api/session/widgets/model/WidgetContent.kt @@ -21,6 +21,9 @@ import com.squareup.moshi.Json import com.squareup.moshi.JsonClass import im.vector.matrix.android.api.util.JsonDict +/** + * Ref: https://github.com/matrix-org/matrix-doc/issues/1236 + */ @JsonClass(generateAdapter = true) data class WidgetContent( @Json(name = "creatorUserId") val creatorUserId: String? = null, diff --git a/matrix-sdk-android/src/main/java/im/vector/matrix/android/api/session/widgets/model/WidgetType.kt b/matrix-sdk-android/src/main/java/im/vector/matrix/android/api/session/widgets/model/WidgetType.kt index 4a265d71b7..a8ef77cdc3 100644 --- a/matrix-sdk-android/src/main/java/im/vector/matrix/android/api/session/widgets/model/WidgetType.kt +++ b/matrix-sdk-android/src/main/java/im/vector/matrix/android/api/session/widgets/model/WidgetType.kt @@ -16,6 +16,9 @@ package im.vector.matrix.android.api.session.widgets.model +/** + * Ref: https://github.com/matrix-org/matrix-doc/issues/1236 + */ sealed class WidgetType(open val preferred: String, open val legacy: String = preferred) { object Jitsi : WidgetType("m.jitsi", "jitsi") object TradingView : WidgetType("m.tradingview") From 1df3b4e18fa2492be872030d342ae07fc31bce76 Mon Sep 17 00:00:00 2001 From: Benoit Marty Date: Wed, 17 Jun 2020 15:52:31 +0200 Subject: [PATCH 4/6] Fix dark theme issue on login screen (#1097) --- CHANGES.md | 2 +- vector/src/main/res/drawable/bg_login_server.xml | 2 +- vector/src/main/res/drawable/bg_login_server_checked.xml | 2 +- vector/src/main/res/layout/fragment_login.xml | 1 + vector/src/main/res/layout/fragment_login_server_selection.xml | 2 ++ vector/src/main/res/layout/fragment_login_server_url_form.xml | 3 ++- .../main/res/layout/fragment_login_signup_signin_selection.xml | 1 + 7 files changed, 9 insertions(+), 4 deletions(-) diff --git a/CHANGES.md b/CHANGES.md index 46a83b881c..abac591140 100644 --- a/CHANGES.md +++ b/CHANGES.md @@ -8,7 +8,7 @@ Improvements 🙌: - Bugfix 🐛: - - + - Fix dark theme issue on login screen (#1097) Translations 🗣: - diff --git a/vector/src/main/res/drawable/bg_login_server.xml b/vector/src/main/res/drawable/bg_login_server.xml index 5aecd26292..a2ca14f02e 100644 --- a/vector/src/main/res/drawable/bg_login_server.xml +++ b/vector/src/main/res/drawable/bg_login_server.xml @@ -7,6 +7,6 @@ android:width="1.2dp" android:color="#E7E7E7" /> - + \ No newline at end of file diff --git a/vector/src/main/res/drawable/bg_login_server_checked.xml b/vector/src/main/res/drawable/bg_login_server_checked.xml index 1aea622462..f120e62884 100644 --- a/vector/src/main/res/drawable/bg_login_server_checked.xml +++ b/vector/src/main/res/drawable/bg_login_server_checked.xml @@ -7,6 +7,6 @@ android:width="1.2dp" android:color="@color/riotx_accent" /> - + \ No newline at end of file diff --git a/vector/src/main/res/layout/fragment_login.xml b/vector/src/main/res/layout/fragment_login.xml index 894a7598c8..a35a60104d 100644 --- a/vector/src/main/res/layout/fragment_login.xml +++ b/vector/src/main/res/layout/fragment_login.xml @@ -25,6 +25,7 @@ android:id="@+id/loginServerIcon" android:layout_width="wrap_content" android:layout_height="wrap_content" + android:tint="?riotx_text_primary" tools:src="@drawable/ic_logo_matrix_org" /> + android:src="@drawable/ic_logo_modular" + android:tint="?riotx_text_primary" /> Date: Wed, 17 Jun 2020 18:13:09 +0200 Subject: [PATCH 5/6] "Add Matrix app" menu is now always visible (#1495) --- CHANGES.md | 2 +- .../home/room/detail/RoomDetailFragment.kt | 18 +++++++++++++++++- .../home/room/detail/RoomDetailViewModel.kt | 2 +- .../settings/VectorSettingsActivity.kt | 3 +++ vector/src/main/res/values/strings.xml | 3 +++ 5 files changed, 25 insertions(+), 3 deletions(-) diff --git a/CHANGES.md b/CHANGES.md index abac591140..897d6cbcde 100644 --- a/CHANGES.md +++ b/CHANGES.md @@ -5,7 +5,7 @@ Features ✨: - Improvements 🙌: - - + - "Add Matrix app" menu is now always visible (#1495) Bugfix 🐛: - Fix dark theme issue on login screen (#1097) diff --git a/vector/src/main/java/im/vector/riotx/features/home/room/detail/RoomDetailFragment.kt b/vector/src/main/java/im/vector/riotx/features/home/room/detail/RoomDetailFragment.kt index dbb26377f6..bf386d15a2 100644 --- a/vector/src/main/java/im/vector/riotx/features/home/room/detail/RoomDetailFragment.kt +++ b/vector/src/main/java/im/vector/riotx/features/home/room/detail/RoomDetailFragment.kt @@ -159,6 +159,7 @@ import im.vector.riotx.features.permalink.NavigationInterceptor import im.vector.riotx.features.permalink.PermalinkHandler import im.vector.riotx.features.reactions.EmojiReactionPickerActivity import im.vector.riotx.features.settings.VectorPreferences +import im.vector.riotx.features.settings.VectorSettingsActivity import im.vector.riotx.features.share.SharedData import im.vector.riotx.features.themes.ThemeUtils import im.vector.riotx.features.widgets.WidgetActivity @@ -469,13 +470,28 @@ class RoomDetailFragment @Inject constructor( true } R.id.open_matrix_apps -> { - navigator.openIntegrationManager(requireContext(), roomDetailArgs.roomId, null, null) + if (session.integrationManagerService().isIntegrationEnabled()) { + navigator.openIntegrationManager(requireContext(), roomDetailArgs.roomId, null, null) + } else { + displayDisabledIntegrationDialog() + } true } else -> super.onOptionsItemSelected(item) } } + private fun displayDisabledIntegrationDialog() { + AlertDialog.Builder(requireActivity()) + .setTitle(R.string.disabled_integration_dialog_title) + .setMessage(R.string.disabled_integration_dialog_content) + .setPositiveButton(R.string.settings) { _, _ -> + navigator.openSettings(requireActivity(), VectorSettingsActivity.EXTRA_DIRECT_ACCESS_GENERAL) + } + .setNegativeButton(R.string.cancel, null) + .show() + } + private fun renderRegularMode(text: String) { autoCompleter.exitSpecialMode() composerLayout.collapse() diff --git a/vector/src/main/java/im/vector/riotx/features/home/room/detail/RoomDetailViewModel.kt b/vector/src/main/java/im/vector/riotx/features/home/room/detail/RoomDetailViewModel.kt index 69a6429efb..1785151af5 100644 --- a/vector/src/main/java/im/vector/riotx/features/home/room/detail/RoomDetailViewModel.kt +++ b/vector/src/main/java/im/vector/riotx/features/home/room/detail/RoomDetailViewModel.kt @@ -371,7 +371,7 @@ class RoomDetailViewModel @AssistedInject constructor( timeline.pendingEventCount() > 0 && vectorPreferences.developerMode() R.id.resend_all -> timeline.failedToDeliverEventCount() > 0 R.id.clear_all -> timeline.failedToDeliverEventCount() > 0 - R.id.open_matrix_apps -> session.integrationManagerService().isIntegrationEnabled() + R.id.open_matrix_apps -> true else -> false } diff --git a/vector/src/main/java/im/vector/riotx/features/settings/VectorSettingsActivity.kt b/vector/src/main/java/im/vector/riotx/features/settings/VectorSettingsActivity.kt index 0c73c0f5d3..bbe6358bd9 100755 --- a/vector/src/main/java/im/vector/riotx/features/settings/VectorSettingsActivity.kt +++ b/vector/src/main/java/im/vector/riotx/features/settings/VectorSettingsActivity.kt @@ -59,6 +59,8 @@ class VectorSettingsActivity : VectorBaseActivity(), if (isFirstCreation()) { // display the fragment when (intent.getIntExtra(EXTRA_DIRECT_ACCESS, EXTRA_DIRECT_ACCESS_ROOT)) { + EXTRA_DIRECT_ACCESS_GENERAL -> + replaceFragment(R.id.vector_settings_page, VectorSettingsGeneralFragment::class.java, null, FRAGMENT_TAG) EXTRA_DIRECT_ACCESS_ADVANCED_SETTINGS -> replaceFragment(R.id.vector_settings_page, VectorSettingsAdvancedSettingsFragment::class.java, null, FRAGMENT_TAG) EXTRA_DIRECT_ACCESS_SECURITY_PRIVACY -> @@ -137,6 +139,7 @@ class VectorSettingsActivity : VectorBaseActivity(), const val EXTRA_DIRECT_ACCESS_ADVANCED_SETTINGS = 1 const val EXTRA_DIRECT_ACCESS_SECURITY_PRIVACY = 2 const val EXTRA_DIRECT_ACCESS_SECURITY_PRIVACY_MANAGE_SESSIONS = 3 + const val EXTRA_DIRECT_ACCESS_GENERAL = 4 private const val FRAGMENT_TAG = "VectorSettingsPreferencesFragment" } diff --git a/vector/src/main/res/values/strings.xml b/vector/src/main/res/values/strings.xml index 19afc120cb..931a7896eb 100644 --- a/vector/src/main/res/values/strings.xml +++ b/vector/src/main/res/values/strings.xml @@ -862,6 +862,9 @@ Allow integrations Integration Manager + Integrations are disabled + "Enable 'Allow integrations' in Settings to do this." + User interface Language Choose language From af81a527464f47c3b81748de63311d5377810a76 Mon Sep 17 00:00:00 2001 From: Benoit Marty Date: Wed, 17 Jun 2020 19:04:35 +0200 Subject: [PATCH 6/6] Use CustomChromeTab to open T&C --- .../vector/riotx/features/login/terms/LoginTermsFragment.kt | 6 +++--- .../im/vector/riotx/features/terms/ReviewTermsFragment.kt | 4 ++-- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/vector/src/main/java/im/vector/riotx/features/login/terms/LoginTermsFragment.kt b/vector/src/main/java/im/vector/riotx/features/login/terms/LoginTermsFragment.kt index 88f4fc2f5f..49abc9ba81 100755 --- a/vector/src/main/java/im/vector/riotx/features/login/terms/LoginTermsFragment.kt +++ b/vector/src/main/java/im/vector/riotx/features/login/terms/LoginTermsFragment.kt @@ -21,17 +21,17 @@ import android.os.Parcelable import android.view.View import butterknife.OnClick import com.airbnb.mvrx.args +import im.vector.matrix.android.internal.auth.registration.LocalizedFlowDataLoginTerms import im.vector.riotx.R import im.vector.riotx.core.extensions.cleanup import im.vector.riotx.core.extensions.configureWith import im.vector.riotx.core.extensions.toReducedUrl -import im.vector.riotx.core.utils.openUrlInExternalBrowser +import im.vector.riotx.core.utils.openUrlInChromeCustomTab import im.vector.riotx.features.login.AbstractLoginFragment import im.vector.riotx.features.login.LoginAction import im.vector.riotx.features.login.LoginViewState import kotlinx.android.parcel.Parcelize import kotlinx.android.synthetic.main.fragment_login_terms.* -import im.vector.matrix.android.internal.auth.registration.LocalizedFlowDataLoginTerms import javax.inject.Inject @Parcelize @@ -95,7 +95,7 @@ class LoginTermsFragment @Inject constructor( localizedFlowDataLoginTerms.localizedUrl ?.takeIf { it.isNotBlank() } ?.let { - openUrlInExternalBrowser(requireContext(), it) + openUrlInChromeCustomTab(requireContext(), null, it) } } diff --git a/vector/src/main/java/im/vector/riotx/features/terms/ReviewTermsFragment.kt b/vector/src/main/java/im/vector/riotx/features/terms/ReviewTermsFragment.kt index ecf5818300..0adfa049fe 100644 --- a/vector/src/main/java/im/vector/riotx/features/terms/ReviewTermsFragment.kt +++ b/vector/src/main/java/im/vector/riotx/features/terms/ReviewTermsFragment.kt @@ -30,7 +30,7 @@ import im.vector.riotx.core.extensions.configureWith import im.vector.riotx.core.extensions.exhaustive import im.vector.riotx.core.platform.VectorBaseActivity import im.vector.riotx.core.platform.VectorBaseFragment -import im.vector.riotx.core.utils.openUrlInExternalBrowser +import im.vector.riotx.core.utils.openUrlInChromeCustomTab import kotlinx.android.synthetic.main.fragment_review_terms.* import javax.inject.Inject @@ -106,6 +106,6 @@ class ReviewTermsFragment @Inject constructor( } override fun review(term: Term) { - openUrlInExternalBrowser(requireContext(), term.url) + openUrlInChromeCustomTab(requireContext(), null, term.url) } }