Adds empty space and subspace splashes
This commit is contained in:
parent
1bca6f83ee
commit
f3720d2dce
@ -25,6 +25,7 @@ import androidx.recyclerview.widget.LinearLayoutManager
|
||||
import com.airbnb.mvrx.fragmentViewModel
|
||||
import com.airbnb.mvrx.withState
|
||||
import dagger.hilt.android.AndroidEntryPoint
|
||||
import im.vector.app.R
|
||||
import im.vector.app.core.platform.VectorBaseFragment
|
||||
import im.vector.app.databinding.FragmentSpaceListModalBinding
|
||||
import im.vector.app.features.spaces.SpaceListAction
|
||||
@ -83,12 +84,20 @@ class SpaceListModalFragment : VectorBaseFragment<FragmentSpaceListModalBinding>
|
||||
viewModel.setSpace(it)
|
||||
binding.headerText.isVisible = it == null
|
||||
binding.headerTextLayout.isVisible = it == null
|
||||
if (it == null) {
|
||||
binding.noSpacesYetText.text = getString(R.string.no_spaces_yet)
|
||||
binding.noSpacesYetMessage.text = getString(R.string.no_spaces_yet_message)
|
||||
} else {
|
||||
binding.noSpacesYetText.text = getString(R.string.no_subspaces_yet)
|
||||
binding.noSpacesYetMessage.text = getString(R.string.no_subspaces_yet_message)
|
||||
}
|
||||
}
|
||||
|
||||
override fun invalidate() {
|
||||
withState(viewModel) { state ->
|
||||
state.rootSpacesOrdered?.let {
|
||||
(binding.roomList.adapter as SpaceListAdapter).replaceList(it + it)
|
||||
(binding.roomList.adapter as SpaceListAdapter).replaceList(it)
|
||||
binding.noSpacesYetGroup.isVisible = it.isEmpty()
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -38,8 +38,42 @@
|
||||
app:layout_constraintTop_toBottomOf="@id/header_text_layout"
|
||||
app:layout_constraintBottom_toTopOf="@id/add_space_layout"
|
||||
tools:itemCount="3"
|
||||
tools:visibility="visible"
|
||||
tools:listitem="@layout/item_modal_space" />
|
||||
|
||||
<androidx.constraintlayout.widget.Group
|
||||
android:id="@+id/no_spaces_yet_group"
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="0dp"
|
||||
android:visibility="gone"
|
||||
app:constraint_referenced_ids="no_spaces_yet_text, no_spaces_yet_message" />
|
||||
|
||||
<TextView
|
||||
android:id="@+id/no_spaces_yet_text"
|
||||
style="@style/Widget.Vector.TextView.Title.Medium"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:text="@string/no_spaces_yet"
|
||||
android:textSize="16sp"
|
||||
app:layout_constraintTop_toBottomOf="@id/header_text_layout"
|
||||
app:layout_constraintBottom_toTopOf="@id/no_spaces_yet_message"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintVertical_chainStyle="packed"
|
||||
app:layout_constraintEnd_toEndOf="parent" />
|
||||
|
||||
<TextView
|
||||
android:id="@+id/no_spaces_yet_message"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:textSize="14sp"
|
||||
android:layout_marginTop="12dp"
|
||||
android:text="@string/no_spaces_yet_message"
|
||||
android:textColor="?attr/vctr_content_tertiary"
|
||||
app:layout_constraintTop_toBottomOf="@id/no_spaces_yet_text"
|
||||
app:layout_constraintBottom_toTopOf="@id/add_space_layout"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintEnd_toEndOf="parent" />
|
||||
|
||||
<View
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="4dp"
|
||||
|
@ -3040,4 +3040,8 @@
|
||||
<string name="all_chats">All Chats</string>
|
||||
<string name="choose_a_space">Spaces</string>
|
||||
<string name="chats">Chats</string>
|
||||
<string name="no_spaces_yet">No spaces yet</string>
|
||||
<string name="no_spaces_yet_message">Add spaces to group your chats</string>
|
||||
<string name="no_subspaces_yet">No subspaces yet</string>
|
||||
<string name="no_subspaces_yet_message">Add subspaces to group your chats</string>
|
||||
</resources>
|
||||
|
Loading…
Reference in New Issue
Block a user