mirror of
https://github.com/SchildiChat/SchildiChat-android.git
synced 2025-02-05 13:37:36 +01:00
Adds SpacesBottomSheet
This commit is contained in:
parent
d116d98080
commit
ab4eda18bf
@ -44,6 +44,7 @@ import im.vector.app.features.home.room.list.RoomSummaryPagedController
|
||||
import im.vector.app.features.home.room.list.actions.RoomListQuickActionsBottomSheet
|
||||
import im.vector.app.features.home.room.list.actions.RoomListQuickActionsSharedAction
|
||||
import im.vector.app.features.home.room.list.actions.RoomListQuickActionsSharedActionViewModel
|
||||
import im.vector.app.features.spaces.SpacesBottomSheet
|
||||
import kotlinx.coroutines.flow.launchIn
|
||||
import kotlinx.coroutines.flow.onEach
|
||||
import org.matrix.android.sdk.api.session.room.model.RoomSummary
|
||||
@ -119,6 +120,7 @@ class HomeRoomListFragment @Inject constructor(
|
||||
|
||||
views.newLayoutOpenSpacesButton.setOnClickListener {
|
||||
// Click action for open spaces modal goes here
|
||||
SpacesBottomSheet().show(requireActivity().supportFragmentManager, SpacesBottomSheet.TAG)
|
||||
}
|
||||
|
||||
// Hide FABs when list is scrolling
|
||||
|
@ -0,0 +1,46 @@
|
||||
/*
|
||||
* Copyright (c) 2022 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
|
||||
|
||||
import android.os.Bundle
|
||||
import android.view.LayoutInflater
|
||||
import android.view.View
|
||||
import android.view.ViewGroup
|
||||
import com.google.android.material.bottomsheet.BottomSheetDialogFragment
|
||||
import im.vector.app.R
|
||||
import im.vector.app.core.extensions.replaceChildFragment
|
||||
import im.vector.app.databinding.FragmentSpacesBottomSheetBinding
|
||||
|
||||
class SpacesBottomSheet : BottomSheetDialogFragment() {
|
||||
|
||||
private lateinit var binding: FragmentSpacesBottomSheetBinding
|
||||
|
||||
override fun onCreateView(inflater: LayoutInflater, container: ViewGroup?, savedInstanceState: Bundle?): View {
|
||||
binding = FragmentSpacesBottomSheetBinding.inflate(inflater, container, false)
|
||||
return binding.root
|
||||
}
|
||||
|
||||
override fun onViewCreated(view: View, savedInstanceState: Bundle?) {
|
||||
if (savedInstanceState == null) {
|
||||
replaceChildFragment(R.id.space_list, SpaceListFragment::class.java)
|
||||
}
|
||||
}
|
||||
|
||||
companion object {
|
||||
const val TAG = "SpacesBottomSheet"
|
||||
}
|
||||
}
|
11
vector/src/main/res/layout/fragment_spaces_bottom_sheet.xml
Normal file
11
vector/src/main/res/layout/fragment_spaces_bottom_sheet.xml
Normal file
@ -0,0 +1,11 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<FrameLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content">
|
||||
|
||||
<androidx.fragment.app.FragmentContainerView
|
||||
android:id="@+id/space_list"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content" />
|
||||
|
||||
</FrameLayout>
|
Loading…
x
Reference in New Issue
Block a user