Merge pull request #1496 from vector-im/feature/small_fixies

Small fixies
This commit is contained in:
Benoit Marty 2020-06-18 14:31:11 +02:00 committed by GitHub
commit bbdf6c6eaf
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
18 changed files with 94 additions and 37 deletions

View File

@ -5,10 +5,10 @@ Features ✨:
-
Improvements 🙌:
-
- "Add Matrix app" menu is now always visible (#1495)
Bugfix 🐛:
-
- Fix dark theme issue on login screen (#1097)
Translations 🗣:
-

View File

@ -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,

View File

@ -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")

View File

@ -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 -> {
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()

View File

@ -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
}

View File

@ -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)
}
}

View File

@ -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"
}

View File

@ -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)
}
}

View File

@ -7,6 +7,6 @@
android:width="1.2dp"
android:color="#E7E7E7" />
<solid android:color="@color/white" />
<solid android:color="?riotx_background" />
</shape>

View File

@ -7,6 +7,6 @@
android:width="1.2dp"
android:color="@color/riotx_accent" />
<solid android:color="@color/white" />
<solid android:color="?riotx_background" />
</shape>

View File

@ -0,0 +1,13 @@
<vector xmlns:android="http://schemas.android.com/apk/res/android"
android:width="14dp"
android:height="16dp"
android:viewportWidth="14"
android:viewportHeight="16">
<path
android:strokeWidth="1"
android:pathData="M13,11.1915V9.9086L8,5.6517C8,3.2856 8,1.8893 8,1.7728C8,1.2731 7.5522,0.6667 7,0.6667C6.4478,0.6667 6,1.2731 6,1.7728C6,1.9784 6,3.3376 6,5.6517L1,9.9086V11.1915L6,8.8416C6,10.3353 6,12.3168 6,13.0103L3.963,14.7439V15.3334L7,14.7508L10.037,15.3334V14.7439L8,13.0103C8,12.3168 8,10.3353 8,8.8416L13,11.1915Z"
android:strokeLineJoin="round"
android:fillColor="#00000000"
android:strokeColor="#2E2F32"
android:strokeLineCap="round"/>
</vector>

View File

@ -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" />
<TextView

View File

@ -63,6 +63,7 @@
android:layout_height="wrap_content"
android:importantForAccessibility="no"
android:src="@drawable/ic_logo_matrix_org"
android:tint="?riotx_text_primary"
app:layout_constraintBottom_toTopOf="@+id/loginServerChoiceMatrixOrgText"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="parent"
@ -103,6 +104,7 @@
android:layout_height="wrap_content"
android:importantForAccessibility="no"
android:src="@drawable/ic_logo_modular"
android:tint="?riotx_text_primary"
app:layout_constraintBottom_toTopOf="@+id/loginServerChoiceModularText"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="parent"

View File

@ -26,7 +26,8 @@
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:importantForAccessibility="no"
android:src="@drawable/ic_logo_modular" />
android:src="@drawable/ic_logo_modular"
android:tint="?riotx_text_primary" />
<TextView
android:id="@+id/loginServerUrlFormTitle"

View File

@ -23,6 +23,7 @@
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:importantForAccessibility="no"
android:tint="?riotx_text_primary"
android:visibility="gone"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="parent"

View File

@ -1,5 +1,6 @@
<?xml version="1.0" encoding="utf-8"?>
<merge 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="wrap_content"
@ -36,16 +37,26 @@
tools:layout_marginTop="10dp"
tools:visibility="visible" />
<TextView
<FrameLayout
android:id="@+id/syncStateNoNetworkAirplane"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:background="@color/notification_accent_color"
android:visibility="gone"
tools:layout_marginTop="10dp"
tools:visibility="visible">
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="center"
android:drawablePadding="4dp"
android:gravity="center"
android:text="@string/no_connectivity_to_the_server_indicator_airplane"
android:textColor="@color/white"
android:visibility="gone"
tools:layout_marginTop="10dp"
tools:visibility="visible" />
app:drawableStartCompat="@drawable/ic_airplane_16dp"
app:drawableTint="@color/white" />
</FrameLayout>
</merge>

View File

@ -862,6 +862,9 @@
<string name="settings_integration_allow">Allow integrations</string>
<string name="settings_integration_manager">Integration Manager</string>
<string name="disabled_integration_dialog_title">Integrations are disabled</string>
<string name="disabled_integration_dialog_content">"Enable 'Allow integrations' in Settings to do this."</string>
<string name="settings_user_interface">User interface</string>
<string name="settings_interface_language">Language</string>
<string name="settings_select_language">Choose language</string>

View File

@ -68,6 +68,26 @@
</im.vector.riotx.core.preference.VectorPreferenceCategory>
<im.vector.riotx.core.preference.VectorPreferenceCategory android:title="@string/settings_integrations">
<im.vector.riotx.core.preference.VectorPreference
android:focusable="false"
android:persistent="false"
android:summary="@string/settings_integrations_summary" />
<im.vector.riotx.core.preference.VectorSwitchPreference
android:key="SETTINGS_ALLOW_INTEGRATIONS_KEY"
android:persistent="false"
android:title="@string/settings_integration_allow" />
<im.vector.riotx.core.preference.VectorPreference
android:dependency="SETTINGS_ALLOW_INTEGRATIONS_KEY"
android:key="SETTINGS_INTEGRATION_MANAGER_UI_URL_KEY"
android:persistent="false"
android:title="@string/settings_integration_manager" />
</im.vector.riotx.core.preference.VectorPreferenceCategory>
<im.vector.riotx.core.preference.VectorPreferenceCategory android:title="@string/settings_advanced">
<im.vector.riotx.core.preference.VectorPreference
@ -96,26 +116,6 @@
</im.vector.riotx.core.preference.VectorPreferenceCategory>
<im.vector.riotx.core.preference.VectorPreferenceCategory android:title="@string/settings_integrations">
<im.vector.riotx.core.preference.VectorPreference
android:focusable="false"
android:persistent="false"
android:summary="@string/settings_integrations_summary" />
<im.vector.riotx.core.preference.VectorSwitchPreference
android:key="SETTINGS_ALLOW_INTEGRATIONS_KEY"
android:persistent="false"
android:title="@string/settings_integration_allow" />
<im.vector.riotx.core.preference.VectorPreference
android:dependency="SETTINGS_ALLOW_INTEGRATIONS_KEY"
android:key="SETTINGS_INTEGRATION_MANAGER_UI_URL_KEY"
android:persistent="false"
android:title="@string/settings_integration_manager" />
</im.vector.riotx.core.preference.VectorPreferenceCategory>
<im.vector.riotx.core.preference.VectorPreferenceCategory android:title="@string/action_sign_out">
<im.vector.riotx.core.preference.VectorPreference