Commit 80366ee9 authored by Valere's avatar Valere
Browse files

Code review

parent 31b6d984
...@@ -90,7 +90,6 @@ internal class RoomSummaryMapper @Inject constructor(private val timelineEventMa ...@@ -90,7 +90,6 @@ internal class RoomSummaryMapper @Inject constructor(private val timelineEventMa
autoJoin = it.autoJoin ?: false, autoJoin = it.autoJoin ?: false,
viaServers = it.viaServers.toList(), viaServers = it.viaServers.toList(),
parentRoomId = roomSummaryEntity.roomId, parentRoomId = roomSummaryEntity.roomId,
// What to do here?
suggested = it.suggested suggested = it.suggested
) )
}, },
......
...@@ -23,7 +23,9 @@ import android.view.View ...@@ -23,7 +23,9 @@ import android.view.View
import android.view.inputmethod.EditorInfo import android.view.inputmethod.EditorInfo
import android.widget.EditText import android.widget.EditText
import androidx.annotation.DrawableRes import androidx.annotation.DrawableRes
import com.google.android.material.textfield.TextInputEditText
import im.vector.app.R import im.vector.app.R
import im.vector.app.core.epoxy.VectorEpoxyHolder
import im.vector.app.core.platform.SimpleTextWatcher import im.vector.app.core.platform.SimpleTextWatcher
fun EditText.setupAsSearch(@DrawableRes searchIconRes: Int = R.drawable.ic_search, fun EditText.setupAsSearch(@DrawableRes searchIconRes: Int = R.drawable.ic_search,
...@@ -57,3 +59,17 @@ fun EditText.setupAsSearch(@DrawableRes searchIconRes: Int = R.drawable.ic_searc ...@@ -57,3 +59,17 @@ fun EditText.setupAsSearch(@DrawableRes searchIconRes: Int = R.drawable.ic_searc
return@OnTouchListener false return@OnTouchListener false
}) })
} }
/**
* Set the initial value of the textEdit.
* Avoids issue with two way bindings, the value is only set the first time
*/
fun TextInputEditText.setValueOnce(value: String?, holder: VectorEpoxyHolder) {
if (holder.view.isAttachedToWindow) {
// the view is attached to the window
// So it is a rebind of new data and you could ignore it assuming this is text that was already inputted into the view.
// Downside is if you ever wanted to programmatically change the content of the edit text while it is on screen you would not be able to
} else {
setText(value)
}
}
...@@ -27,6 +27,7 @@ import com.google.android.material.textfield.TextInputLayout ...@@ -27,6 +27,7 @@ import com.google.android.material.textfield.TextInputLayout
import im.vector.app.R import im.vector.app.R
import im.vector.app.core.epoxy.VectorEpoxyHolder import im.vector.app.core.epoxy.VectorEpoxyHolder
import im.vector.app.core.epoxy.VectorEpoxyModel import im.vector.app.core.epoxy.VectorEpoxyModel
import im.vector.app.core.extensions.setValueOnce
import im.vector.app.core.platform.SimpleTextWatcher import im.vector.app.core.platform.SimpleTextWatcher
@EpoxyModelClass(layout = R.layout.item_form_text_input) @EpoxyModelClass(layout = R.layout.item_form_text_input)
...@@ -75,13 +76,8 @@ abstract class FormEditTextItem : VectorEpoxyModel<FormEditTextItem.Holder>() { ...@@ -75,13 +76,8 @@ abstract class FormEditTextItem : VectorEpoxyModel<FormEditTextItem.Holder>() {
holder.textInputLayout.error = errorMessage holder.textInputLayout.error = errorMessage
holder.textInputLayout.endIconMode = endIconMode ?: TextInputLayout.END_ICON_NONE holder.textInputLayout.endIconMode = endIconMode ?: TextInputLayout.END_ICON_NONE
if (holder.view.isAttachedToWindow) { holder.textInputEditText.setValueOnce(value, holder)
// the view is attached to the window
// So it is a rebind of new data and you could ignore it assuming this is text that was already inputted into the view.
// Downside is if you ever wanted to programmatically change the content of the edit text while it is on screen you would not be able to
} else {
holder.textInputEditText.setText(value)
}
holder.textInputEditText.isEnabled = enabled holder.textInputEditText.isEnabled = enabled
inputType?.let { holder.textInputEditText.inputType = it } inputType?.let { holder.textInputEditText.inputType = it }
holder.textInputEditText.isSingleLine = singleLine ?: false holder.textInputEditText.isSingleLine = singleLine ?: false
......
...@@ -26,6 +26,7 @@ import com.google.android.material.textfield.TextInputLayout ...@@ -26,6 +26,7 @@ import com.google.android.material.textfield.TextInputLayout
import im.vector.app.R import im.vector.app.R
import im.vector.app.core.epoxy.VectorEpoxyHolder import im.vector.app.core.epoxy.VectorEpoxyHolder
import im.vector.app.core.epoxy.VectorEpoxyModel import im.vector.app.core.epoxy.VectorEpoxyModel
import im.vector.app.core.extensions.setValueOnce
import im.vector.app.core.platform.SimpleTextWatcher import im.vector.app.core.platform.SimpleTextWatcher
@EpoxyModelClass(layout = R.layout.item_form_text_input_with_button) @EpoxyModelClass(layout = R.layout.item_form_text_input_with_button)
...@@ -60,12 +61,8 @@ abstract class FormEditTextWithButtonItem : VectorEpoxyModel<FormEditTextWithBut ...@@ -60,12 +61,8 @@ abstract class FormEditTextWithButtonItem : VectorEpoxyModel<FormEditTextWithBut
holder.textInputLayout.isEnabled = enabled holder.textInputLayout.isEnabled = enabled
holder.textInputLayout.hint = hint holder.textInputLayout.hint = hint
if (holder.view.isAttachedToWindow) { holder.textInputEditText.setValueOnce(value, holder)
// the view is attached to the window
// So it is a rebind of new data and you could ignore it assuming this is text that was already inputted into the view.
} else {
holder.textInputEditText.setText(value)
}
holder.textInputEditText.isEnabled = enabled holder.textInputEditText.isEnabled = enabled
holder.textInputEditText.addTextChangedListener(onTextChangeListener) holder.textInputEditText.addTextChangedListener(onTextChangeListener)
......
...@@ -27,6 +27,7 @@ import com.google.android.material.textfield.TextInputLayout ...@@ -27,6 +27,7 @@ import com.google.android.material.textfield.TextInputLayout
import im.vector.app.R import im.vector.app.R
import im.vector.app.core.epoxy.VectorEpoxyHolder import im.vector.app.core.epoxy.VectorEpoxyHolder
import im.vector.app.core.epoxy.VectorEpoxyModel import im.vector.app.core.epoxy.VectorEpoxyModel
import im.vector.app.core.extensions.setValueOnce
import im.vector.app.core.platform.SimpleTextWatcher import im.vector.app.core.platform.SimpleTextWatcher
@EpoxyModelClass(layout = R.layout.item_form_multiline_text_input) @EpoxyModelClass(layout = R.layout.item_form_multiline_text_input)
...@@ -75,13 +76,8 @@ abstract class FormMultiLineEditTextItem : VectorEpoxyModel<FormMultiLineEditTex ...@@ -75,13 +76,8 @@ abstract class FormMultiLineEditTextItem : VectorEpoxyModel<FormMultiLineEditTex
holder.textInputEditText.textSize = textSizeSp?.toFloat() ?: 14f holder.textInputEditText.textSize = textSizeSp?.toFloat() ?: 14f
holder.textInputEditText.minLines = minLines holder.textInputEditText.minLines = minLines
// Update only if text is different and value is not null holder.textInputEditText.setValueOnce(value, holder)
if (holder.view.isAttachedToWindow) {
// the view is attached to the window
// So it is a rebind of new data and you could ignore it assuming this is text that was already inputted into the view.
} else {
holder.textInputEditText.setText(value)
}
holder.textInputEditText.isEnabled = enabled holder.textInputEditText.isEnabled = enabled
holder.textInputEditText.addTextChangedListener(onTextChangeListener) holder.textInputEditText.addTextChangedListener(onTextChangeListener)
......
...@@ -27,6 +27,7 @@ import com.google.android.material.textfield.TextInputLayout ...@@ -27,6 +27,7 @@ import com.google.android.material.textfield.TextInputLayout
import im.vector.app.R import im.vector.app.R
import im.vector.app.core.epoxy.VectorEpoxyHolder import im.vector.app.core.epoxy.VectorEpoxyHolder
import im.vector.app.core.epoxy.VectorEpoxyModel import im.vector.app.core.epoxy.VectorEpoxyModel
import im.vector.app.core.extensions.setValueOnce
import im.vector.app.core.platform.SimpleTextWatcher import im.vector.app.core.platform.SimpleTextWatcher
@EpoxyModelClass(layout = R.layout.item_room_alias_text_input) @EpoxyModelClass(layout = R.layout.item_room_alias_text_input)
...@@ -61,12 +62,7 @@ abstract class RoomAliasEditItem : VectorEpoxyModel<RoomAliasEditItem.Holder>() ...@@ -61,12 +62,7 @@ abstract class RoomAliasEditItem : VectorEpoxyModel<RoomAliasEditItem.Holder>()
holder.textInputLayout.isEnabled = enabled holder.textInputLayout.isEnabled = enabled
holder.textInputLayout.error = errorMessage holder.textInputLayout.error = errorMessage
if (holder.view.isAttachedToWindow) { holder.textInputEditText.setValueOnce(value, holder)
// the view is attached to the window
// So it is a rebind of new data and you could ignore it assuming this is text that was already inputted into the view.
} else {
holder.textInputEditText.setText(value)
}
holder.textInputEditText.isEnabled = enabled holder.textInputEditText.isEnabled = enabled
holder.textInputEditText.addTextChangedListener(onTextChangeListener) holder.textInputEditText.addTextChangedListener(onTextChangeListener)
holder.homeServerText.text = homeServer holder.homeServerText.text = homeServer
......
...@@ -27,7 +27,6 @@ import im.vector.app.features.form.formEditableAvatarItem ...@@ -27,7 +27,6 @@ import im.vector.app.features.form.formEditableAvatarItem
import im.vector.app.features.form.formSwitchItem import im.vector.app.features.form.formSwitchItem
import im.vector.app.features.home.AvatarRenderer import im.vector.app.features.home.AvatarRenderer
import im.vector.app.features.home.room.detail.timeline.format.RoomHistoryVisibilityFormatter import im.vector.app.features.home.room.detail.timeline.format.RoomHistoryVisibilityFormatter
import im.vector.app.features.roomprofile.settings.RoomSettingsViewState.Companion.getJoinRuleWording
import im.vector.app.features.settings.VectorPreferences import im.vector.app.features.settings.VectorPreferences
import org.matrix.android.sdk.api.session.room.model.GuestAccess import org.matrix.android.sdk.api.session.room.model.GuestAccess
import org.matrix.android.sdk.api.session.room.model.RoomJoinRules import org.matrix.android.sdk.api.session.room.model.RoomJoinRules
......
...@@ -70,26 +70,24 @@ data class RoomSettingsViewState( ...@@ -70,26 +70,24 @@ data class RoomSettingsViewState(
) { ) {
fun hasChanged() = newJoinRules != null || newGuestAccess != null fun hasChanged() = newJoinRules != null || newGuestAccess != null
} }
}
companion object { fun RoomSettingsViewState.getJoinRuleWording(stringProvider: StringProvider): String {
fun RoomSettingsViewState.getJoinRuleWording(stringProvider: StringProvider): String { return when (val joinRule = newRoomJoinRules.newJoinRules ?: currentRoomJoinRules) {
return when (val joinRule = newRoomJoinRules.newJoinRules ?: currentRoomJoinRules) { RoomJoinRules.INVITE -> {
RoomJoinRules.INVITE -> { stringProvider.getString(R.string.room_settings_room_access_private_title)
stringProvider.getString(R.string.room_settings_room_access_private_title) }
} RoomJoinRules.PUBLIC -> {
RoomJoinRules.PUBLIC -> { stringProvider.getString(R.string.room_settings_room_access_public_title)
stringProvider.getString(R.string.room_settings_room_access_public_title) }
} RoomJoinRules.KNOCK -> {
RoomJoinRules.KNOCK -> { stringProvider.getString(R.string.room_settings_room_access_entry_knock)
stringProvider.getString(R.string.room_settings_room_access_entry_knock) }
} RoomJoinRules.RESTRICTED -> {
RoomJoinRules.RESTRICTED -> { stringProvider.getString(R.string.room_settings_room_access_restricted_title)
stringProvider.getString(R.string.room_settings_room_access_restricted_title) }
} else -> {
else -> { stringProvider.getString(R.string.room_settings_room_access_entry_unknown, joinRule.value)
stringProvider.getString(R.string.room_settings_room_access_entry_unknown, joinRule.value)
}
}
} }
} }
} }
/*
* Copyright (c) 2021 New Vector Ltd
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package im.vector.app.features.spaces.manage
import io.reactivex.functions.Predicate
import org.matrix.android.sdk.api.extensions.orFalse
import org.matrix.android.sdk.api.session.room.model.SpaceChildInfo
class SpaceChildInfoMatchFilter : Predicate<SpaceChildInfo> {
var filter: String = ""
override fun test(spaceChildInfo: SpaceChildInfo): Boolean {
if (filter.isEmpty()) {
// No filter
return true
}
// if filter is "Jo Do", it should match "John Doe"
return filter.split(" ").all {
spaceChildInfo.name?.contains(it, ignoreCase = true).orFalse()
|| spaceChildInfo.topic?.contains(it, ignoreCase = true).orFalse()
}
}
}
...@@ -111,17 +111,19 @@ class SpaceManageActivity : VectorBaseActivity<ActivitySimpleLoadingBinding>(), ...@@ -111,17 +111,19 @@ class SpaceManageActivity : VectorBaseActivity<ActivitySimpleLoadingBinding>(),
} }
ManageType.Settings -> { ManageType.Settings -> {
val simpleName = SpaceSettingsFragment::class.java.simpleName val simpleName = SpaceSettingsFragment::class.java.simpleName
if (supportFragmentManager.findFragmentByTag(simpleName) == null) { if (supportFragmentManager.findFragmentByTag(simpleName) == null && args?.spaceId != null) {
supportFragmentManager.commitTransaction { supportFragmentManager.commitTransaction {
replace(R.id.simpleFragmentContainer, replace(R.id.simpleFragmentContainer,
SpaceSettingsFragment::class.java, SpaceSettingsFragment::class.java,
Bundle().apply { this.putParcelable(MvRx.KEY_ARG, RoomProfileArgs(args?.spaceId ?: "")) }, Bundle().apply { this.putParcelable(MvRx.KEY_ARG, RoomProfileArgs(args.spaceId)) },
simpleName simpleName
) )
} }
} }
} }
ManageType.ManageRooms -> TODO() ManageType.ManageRooms -> {
// no direct access for now
}
} }
} }
} }
...@@ -145,11 +147,13 @@ class SpaceManageActivity : VectorBaseActivity<ActivitySimpleLoadingBinding>(), ...@@ -145,11 +147,13 @@ class SpaceManageActivity : VectorBaseActivity<ActivitySimpleLoadingBinding>(),
) )
} }
SpaceManagedSharedViewEvents.NavigateToManageRooms -> { SpaceManagedSharedViewEvents.NavigateToManageRooms -> {
addFragmentToBackstack( args?.spaceId?.let { spaceId ->
R.id.simpleFragmentContainer, addFragmentToBackstack(
SpaceManageRoomsFragment::class.java, R.id.simpleFragmentContainer,
SpaceManageArgs(args?.spaceId ?: "", ManageType.ManageRooms) SpaceManageRoomsFragment::class.java,
) SpaceManageArgs(spaceId, ManageType.ManageRooms)
)
}
} }
} }
} }
......
...@@ -19,6 +19,6 @@ package im.vector.app.features.spaces.manage ...@@ -19,6 +19,6 @@ package im.vector.app.features.spaces.manage
import im.vector.app.core.platform.VectorViewEvents import im.vector.app.core.platform.VectorViewEvents
sealed class SpaceManageRoomViewEvents : VectorViewEvents { sealed class SpaceManageRoomViewEvents : VectorViewEvents {
object BulkActionSuccess: SpaceManageRoomViewEvents() // object BulkActionSuccess: SpaceManageRoomViewEvents()
data class BulkActionFailure(val errorList: List<String>) : SpaceManageRoomViewEvents() data class BulkActionFailure(val errorList: List<Throwable>) : SpaceManageRoomViewEvents()
} }
...@@ -24,8 +24,6 @@ import im.vector.app.core.epoxy.loadingItem ...@@ -24,8 +24,6 @@ import im.vector.app.core.epoxy.loadingItem
import im.vector.app.core.error.ErrorFormatter import im.vector.app.core.error.ErrorFormatter
import im.vector.app.core.utils.DebouncedClickListener import im.vector.app.core.utils.DebouncedClickListener
import im.vector.app.features.home.AvatarRenderer import im.vector.app.features.home.AvatarRenderer
import io.reactivex.functions.Predicate
import org.matrix.android.sdk.api.extensions.orFalse
import org.matrix.android.sdk.api.session.room.model.RoomType import org.matrix.android.sdk.api.session.room.model.RoomType
import org.matrix.android.sdk.api.session.room.model.SpaceChildInfo import org.matrix.android.sdk.api.session.room.model.SpaceChildInfo
import org.matrix.android.sdk.api.util.toMatrixItem import org.matrix.android.sdk.api.util.toMatrixItem
...@@ -83,19 +81,3 @@ class SpaceManageRoomsController @Inject constructor( ...@@ -83,19 +81,3 @@ class SpaceManageRoomsController @Inject constructor(
} }
} }
} }
class SpaceChildInfoMatchFilter : Predicate<SpaceChildInfo> {
var filter: String = ""
override fun test(spaceChildInfo: SpaceChildInfo): Boolean {
if (filter.isEmpty()) {
// No filter
return true
}
// if filter is "Jo Do", it should match "John Doe"
return filter.split(" ").all {
spaceChildInfo.name?.contains(it, ignoreCase = true).orFalse()
|| spaceChildInfo.topic?.contains(it, ignoreCase = true).orFalse()
}
}
}
...@@ -91,12 +91,7 @@ class SpaceManageRoomsFragment @Inject constructor( ...@@ -91,12 +91,7 @@ class SpaceManageRoomsFragment @Inject constructor(
viewModel.observeViewEvents { viewModel.observeViewEvents {
when (it) { when (it) {
is SpaceManageRoomViewEvents.BulkActionFailure -> { is SpaceManageRoomViewEvents.BulkActionFailure -> {
it.errorList.forEach { vectorBaseActivity.toast(errorFormatter.toHumanReadable(it.errorList.firstOrNull()))
vectorBaseActivity.toast(it)
}
}
SpaceManageRoomViewEvents.BulkActionSuccess -> {
//
} }
} }
} }
......
...@@ -27,7 +27,6 @@ import com.airbnb.mvrx.ViewModelContext ...@@ -27,7 +27,6 @@ import com.airbnb.mvrx.ViewModelContext
import dagger.assisted.Assisted import dagger.assisted.Assisted
import dagger.assisted.AssistedFactory import dagger.assisted.AssistedFactory
import dagger.assisted.AssistedInject import dagger.assisted.AssistedInject
import im.vector.app.core.error.ErrorFormatter
import im.vector.app.core.mvrx.runCatchingToAsync import im.vector.app.core.mvrx.runCatchingToAsync
import im.vector.app.core.platform.VectorViewModel import im.vector.app.core.platform.VectorViewModel
import im.vector.app.features.session.coroutineScope import im.vector.app.features.session.coroutineScope
...@@ -37,8 +36,7 @@ import org.matrix.android.sdk.api.session.Session ...@@ -37,8 +36,7 @@ import org.matrix.android.sdk.api.session.Session
class SpaceManageRoomsViewModel @AssistedInject constructor( class SpaceManageRoomsViewModel @AssistedInject constructor(
@Assisted val initialState: SpaceManageRoomViewState, @Assisted val initialState: SpaceManageRoomViewState,
private val session: Session, private val session: Session
private val errorFormatter: ErrorFormatter
) : VectorViewModel<SpaceManageRoomViewState, SpaceManageRoomViewAction, SpaceManageRoomViewEvents>(initialState) { ) : VectorViewModel<SpaceManageRoomViewState, SpaceManageRoomViewAction, SpaceManageRoomViewEvents>(initialState) {
init { init {
...@@ -79,20 +77,20 @@ class SpaceManageRoomsViewModel @AssistedInject constructor( ...@@ -79,20 +77,20 @@ class SpaceManageRoomsViewModel @AssistedInject constructor(
override fun handle(action: SpaceManageRoomViewAction) { override fun handle(action: SpaceManageRoomViewAction) {
when (action) { when (action) {
is SpaceManageRoomViewAction.ToggleSelection -> handleToggleSelection(action) is SpaceManageRoomViewAction.ToggleSelection -> handleToggleSelection(action)
is SpaceManageRoomViewAction.UpdateFilter -> { is SpaceManageRoomViewAction.UpdateFilter -> {
setState { copy(currentFilter = action.filter) } setState { copy(currentFilter = action.filter) }
} }
SpaceManageRoomViewAction.ClearSelection -> { SpaceManageRoomViewAction.ClearSelection -> {
setState { copy(selectedRooms = emptyList()) } setState { copy(selectedRooms = emptyList()) }
} }
SpaceManageRoomViewAction.BulkRemove -> { SpaceManageRoomViewAction.BulkRemove -> {
handleBulkRemove() handleBulkRemove()
} }
is SpaceManageRoomViewAction.MarkAllAsSuggested -> { is SpaceManageRoomViewAction.MarkAllAsSuggested -> {
handleBulkMarkAsSuggested(action.suggested) handleBulkMarkAsSuggested(action.suggested)
} }
SpaceManageRoomViewAction.RefreshFromServer -> { SpaceManageRoomViewAction.RefreshFromServer -> {
refreshSummaryAPI() refreshSummaryAPI()
} }
} }
...@@ -112,10 +110,10 @@ class SpaceManageRoomsViewModel @AssistedInject constructor( ...@@ -112,10 +110,10 @@ class SpaceManageRoomsViewModel @AssistedInject constructor(
} }
if (errorList.isEmpty()) { if (errorList.isEmpty()) {
// success // success
_viewEvents.post(SpaceManageRoomViewEvents.BulkActionSuccess)
} else { } else {
_viewEvents.post(SpaceManageRoomViewEvents.BulkActionFailure(errorList.map { errorFormatter.toHumanReadable(it) })) _viewEvents.post(SpaceManageRoomViewEvents.BulkActionFailure(errorList))
} }
refreshSummaryAPI()
setState { copy(actionState = Uninitialized) } setState { copy(actionState = Uninitialized) }
} }
} }
...@@ -142,11 +140,10 @@ class SpaceManageRoomsViewModel @AssistedInject constructor( ...@@ -142,11 +140,10 @@ class SpaceManageRoomsViewModel @AssistedInject constructor(
} }
if (errorList.isEmpty()) { if (errorList.isEmpty()) {
// success // success
_viewEvents.post(SpaceManageRoomViewEvents.BulkActionSuccess)
refreshSummaryAPI()
} else { } else {
_viewEvents.post(SpaceManageRoomViewEvents.BulkActionFailure(errorList.map { errorFormatter.toHumanReadable(it) })) _viewEvents.post(SpaceManageRoomViewEvents.BulkActionFailure(errorList))
} }
refreshSummaryAPI()
setState { copy(actionState = Uninitialized) } setState { copy(actionState = Uninitialized) }
} }
} }
......
...@@ -28,7 +28,7 @@ import im.vector.app.features.form.formMultiLineEditTextItem ...@@ -28,7 +28,7 @@ import im.vector.app.features.form.formMultiLineEditTextItem
import im.vector.app.features.form.formSwitchItem import im.vector.app.features.form.formSwitchItem
import im.vector.app.features.home.AvatarRenderer import im.vector.app.features.home.AvatarRenderer
import im.vector.app.features.roomprofile.settings.RoomSettingsViewState import im.vector.app.features.roomprofile.settings.RoomSettingsViewState
import im.vector.app.features.roomprofile.settings.RoomSettingsViewState.Companion.getJoinRuleWording import im.vector.app.features.roomprofile.settings.getJoinRuleWording
import im.vector.app.features.settings.VectorPreferences import im.vector.app.features.settings.VectorPreferences
import org.matrix.android.sdk.api.session.room.model.RoomJoinRules import org.matrix.android.sdk.api.session.room.model.RoomJoinRules
import org.matrix.android.sdk.api.util.toMatrixItem import org.matrix.android.sdk.api.util.toMatrixItem
......
...@@ -195,7 +195,9 @@ class SpaceSettingsFragment @Inject constructor( ...@@ -195,7 +195,9 @@ class SpaceSettingsFragment @Inject constructor(
viewModel.handle(RoomSettingsAction.SetRoomTopic(topic)) viewModel.handle(RoomSettingsAction.SetRoomTopic(topic))
} }
override fun onHistoryVisibilityClicked() {} override fun onHistoryVisibilityClicked() {
// N/A for space settings screen
}
override fun onJoinRuleClicked() = withState(viewModel) { state -> override fun onJoinRuleClicked() = withState(viewModel) { state ->
val currentJoinRule = state.newRoomJoinRules.newJoinRules ?: state.currentRoomJoinRules val currentJoinRule = state.newRoomJoinRules.newJoinRules ?: state.currentRoomJoinRules
......
...@@ -11,7 +11,7 @@ ...@@ -11,7 +11,7 @@
<item name="android:background">?riotx_background</item> <item name="android:background">?riotx_background</item>
</style> </style>
<style name="ActionModeTheme" parent="Base.Widget.AppCompat.ActionMode"> <style name="ActionModeTheme" parent="Widget.AppCompat.ActionMode">
<item name="background">?riotx_background</item> <item name="background">?riotx_background</item>
<item name="titleTextStyle">@style/Vector.Toolbar.Title</item> <item name="titleTextStyle">@style/Vector.Toolbar.Title</item>
<item name="subtitleTextStyle">@style/Vector.Toolbar.SubTitle</item> <item name="subtitleTextStyle">@style/Vector.Toolbar.SubTitle</item>
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
<