mirror of
https://github.com/vector-im/element-android.git
synced 2024-11-16 02:05:06 +08:00
Room settings: rename stuff for genericity
This commit is contained in:
parent
eee6969b02
commit
56b140fcb4
@ -29,7 +29,7 @@ import im.vector.riotx.core.extensions.configureWith
|
|||||||
import im.vector.riotx.core.platform.VectorBaseFragment
|
import im.vector.riotx.core.platform.VectorBaseFragment
|
||||||
import im.vector.riotx.features.home.AvatarRenderer
|
import im.vector.riotx.features.home.AvatarRenderer
|
||||||
import im.vector.riotx.features.roomprofile.RoomProfileArgs
|
import im.vector.riotx.features.roomprofile.RoomProfileArgs
|
||||||
import kotlinx.android.synthetic.main.fragment_room_member_list.*
|
import kotlinx.android.synthetic.main.fragment_room_setting_generic.*
|
||||||
import javax.inject.Inject
|
import javax.inject.Inject
|
||||||
|
|
||||||
class RoomMemberListFragment @Inject constructor(
|
class RoomMemberListFragment @Inject constructor(
|
||||||
@ -41,12 +41,12 @@ class RoomMemberListFragment @Inject constructor(
|
|||||||
private val viewModel: RoomMemberListViewModel by fragmentViewModel()
|
private val viewModel: RoomMemberListViewModel by fragmentViewModel()
|
||||||
private val roomProfileArgs: RoomProfileArgs by args()
|
private val roomProfileArgs: RoomProfileArgs by args()
|
||||||
|
|
||||||
override fun getLayoutResId() = R.layout.fragment_room_member_list
|
override fun getLayoutResId() = R.layout.fragment_room_setting_generic
|
||||||
|
|
||||||
override fun onViewCreated(view: View, savedInstanceState: Bundle?) {
|
override fun onViewCreated(view: View, savedInstanceState: Bundle?) {
|
||||||
super.onViewCreated(view, savedInstanceState)
|
super.onViewCreated(view, savedInstanceState)
|
||||||
roomMemberListController.callback = this
|
roomMemberListController.callback = this
|
||||||
setupToolbar(roomMemberListToolbar)
|
setupToolbar(roomSettingsToolbar)
|
||||||
recyclerView.configureWith(roomMemberListController, hasFixedSize = true)
|
recyclerView.configureWith(roomMemberListController, hasFixedSize = true)
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -66,8 +66,8 @@ class RoomMemberListFragment @Inject constructor(
|
|||||||
|
|
||||||
private fun renderRoomSummary(state: RoomMemberListViewState) {
|
private fun renderRoomSummary(state: RoomMemberListViewState) {
|
||||||
state.roomSummary()?.let {
|
state.roomSummary()?.let {
|
||||||
roomMemberListToolbarTitleView.text = it.displayName
|
roomSettingsToolbarTitleView.text = it.displayName
|
||||||
avatarRenderer.render(it.toMatrixItem(), roomMemberListToolbarAvatarImageView)
|
avatarRenderer.render(it.toMatrixItem(), roomSettingsToolbarAvatarImageView)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -31,7 +31,7 @@ import im.vector.riotx.core.extensions.observeEvent
|
|||||||
import im.vector.riotx.core.platform.VectorBaseFragment
|
import im.vector.riotx.core.platform.VectorBaseFragment
|
||||||
import im.vector.riotx.features.home.AvatarRenderer
|
import im.vector.riotx.features.home.AvatarRenderer
|
||||||
import im.vector.riotx.features.roomprofile.RoomProfileArgs
|
import im.vector.riotx.features.roomprofile.RoomProfileArgs
|
||||||
import kotlinx.android.synthetic.main.fragment_room_member_list.*
|
import kotlinx.android.synthetic.main.fragment_room_setting_generic.*
|
||||||
import kotlinx.android.synthetic.main.merge_overlay_waiting_view.*
|
import kotlinx.android.synthetic.main.merge_overlay_waiting_view.*
|
||||||
import javax.inject.Inject
|
import javax.inject.Inject
|
||||||
|
|
||||||
@ -44,12 +44,12 @@ class RoomSettingsFragment @Inject constructor(
|
|||||||
private val viewModel: RoomSettingsViewModel by fragmentViewModel()
|
private val viewModel: RoomSettingsViewModel by fragmentViewModel()
|
||||||
private val roomProfileArgs: RoomProfileArgs by args()
|
private val roomProfileArgs: RoomProfileArgs by args()
|
||||||
|
|
||||||
override fun getLayoutResId() = R.layout.fragment_room_member_list
|
override fun getLayoutResId() = R.layout.fragment_room_setting_generic
|
||||||
|
|
||||||
override fun onViewCreated(view: View, savedInstanceState: Bundle?) {
|
override fun onViewCreated(view: View, savedInstanceState: Bundle?) {
|
||||||
super.onViewCreated(view, savedInstanceState)
|
super.onViewCreated(view, savedInstanceState)
|
||||||
controller.callback = this
|
controller.callback = this
|
||||||
setupToolbar(roomMemberListToolbar)
|
setupToolbar(roomSettingsToolbar)
|
||||||
recyclerView.configureWith(controller, hasFixedSize = true)
|
recyclerView.configureWith(controller, hasFixedSize = true)
|
||||||
waiting_view_status_text.setText(R.string.please_wait)
|
waiting_view_status_text.setText(R.string.please_wait)
|
||||||
waiting_view_status_text.isVisible = true
|
waiting_view_status_text.isVisible = true
|
||||||
@ -77,8 +77,8 @@ class RoomSettingsFragment @Inject constructor(
|
|||||||
waiting_view.isVisible = state.currentRequest is Loading
|
waiting_view.isVisible = state.currentRequest is Loading
|
||||||
|
|
||||||
state.roomSummary()?.let {
|
state.roomSummary()?.let {
|
||||||
roomMemberListToolbarTitleView.text = it.displayName
|
roomSettingsToolbarTitleView.text = it.displayName
|
||||||
avatarRenderer.render(it.toMatrixItem(), roomMemberListToolbarAvatarImageView)
|
avatarRenderer.render(it.toMatrixItem(), roomSettingsToolbarAvatarImageView)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -8,7 +8,7 @@
|
|||||||
android:background="?riotx_header_panel_background">
|
android:background="?riotx_header_panel_background">
|
||||||
|
|
||||||
<androidx.appcompat.widget.Toolbar
|
<androidx.appcompat.widget.Toolbar
|
||||||
android:id="@+id/roomMemberListToolbar"
|
android:id="@+id/roomSettingsToolbar"
|
||||||
style="@style/VectorToolbarStyle"
|
style="@style/VectorToolbarStyle"
|
||||||
android:layout_width="0dp"
|
android:layout_width="0dp"
|
||||||
android:layout_height="?actionBarSize"
|
android:layout_height="?actionBarSize"
|
||||||
@ -18,12 +18,12 @@
|
|||||||
app:layout_constraintTop_toTopOf="parent">
|
app:layout_constraintTop_toTopOf="parent">
|
||||||
|
|
||||||
<androidx.constraintlayout.widget.ConstraintLayout
|
<androidx.constraintlayout.widget.ConstraintLayout
|
||||||
android:id="@+id/roomMemberListToolbarContentView"
|
android:id="@+id/roomSettingsToolbarContentView"
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="match_parent">
|
android:layout_height="match_parent">
|
||||||
|
|
||||||
<ImageView
|
<ImageView
|
||||||
android:id="@+id/roomMemberListToolbarAvatarImageView"
|
android:id="@+id/roomSettingsToolbarAvatarImageView"
|
||||||
android:layout_width="40dp"
|
android:layout_width="40dp"
|
||||||
android:layout_height="40dp"
|
android:layout_height="40dp"
|
||||||
android:layout_marginTop="8dp"
|
android:layout_marginTop="8dp"
|
||||||
@ -34,7 +34,7 @@
|
|||||||
tools:src="@tools:sample/avatars" />
|
tools:src="@tools:sample/avatars" />
|
||||||
|
|
||||||
<TextView
|
<TextView
|
||||||
android:id="@+id/roomMemberListToolbarTitleView"
|
android:id="@+id/roomSettingsToolbarTitleView"
|
||||||
android:layout_width="0dp"
|
android:layout_width="0dp"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
android:layout_marginStart="8dp"
|
android:layout_marginStart="8dp"
|
||||||
@ -45,7 +45,7 @@
|
|||||||
android:textSize="18sp"
|
android:textSize="18sp"
|
||||||
app:layout_constraintBottom_toBottomOf="parent"
|
app:layout_constraintBottom_toBottomOf="parent"
|
||||||
app:layout_constraintEnd_toEndOf="parent"
|
app:layout_constraintEnd_toEndOf="parent"
|
||||||
app:layout_constraintStart_toEndOf="@+id/roomMemberListToolbarAvatarImageView"
|
app:layout_constraintStart_toEndOf="@+id/roomSettingsToolbarAvatarImageView"
|
||||||
app:layout_constraintTop_toTopOf="parent"
|
app:layout_constraintTop_toTopOf="parent"
|
||||||
tools:text="@sample/matrix.json/data/roomName" />
|
tools:text="@sample/matrix.json/data/roomName" />
|
||||||
|
|
||||||
@ -61,8 +61,8 @@
|
|||||||
app:layout_constraintBottom_toBottomOf="parent"
|
app:layout_constraintBottom_toBottomOf="parent"
|
||||||
app:layout_constraintEnd_toEndOf="parent"
|
app:layout_constraintEnd_toEndOf="parent"
|
||||||
app:layout_constraintStart_toStartOf="parent"
|
app:layout_constraintStart_toStartOf="parent"
|
||||||
app:layout_constraintTop_toBottomOf="@+id/roomMemberListToolbar"
|
app:layout_constraintTop_toBottomOf="@+id/roomSettingsToolbar"
|
||||||
tools:listitem="@layout/item_autocomplete_matrix_item" />
|
tools:listitem="@layout/item_profile_action" />
|
||||||
|
|
||||||
<include layout="@layout/merge_overlay_waiting_view" />
|
<include layout="@layout/merge_overlay_waiting_view" />
|
||||||
|
|
Loading…
Reference in New Issue
Block a user