-
Notifications
You must be signed in to change notification settings - Fork 756
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Setup tab layout when landing on the room polls screen
- Loading branch information
Showing
9 changed files
with
128 additions
and
13 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
2 changes: 1 addition & 1 deletion
2
vector/src/main/java/im/vector/app/features/roomprofile/polls/RoomPollsAction.kt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
36 changes: 36 additions & 0 deletions
36
vector/src/main/java/im/vector/app/features/roomprofile/polls/RoomPollsPagerAdapter.kt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,36 @@ | ||
/* | ||
* 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.roomprofile.polls | ||
|
||
import androidx.fragment.app.Fragment | ||
import androidx.viewpager2.adapter.FragmentStateAdapter | ||
import im.vector.app.features.roomprofile.polls.active.RoomActivePollsFragment | ||
|
||
class RoomPollsPagerAdapter( | ||
private val fragment: Fragment | ||
) : FragmentStateAdapter(fragment) { | ||
|
||
override fun getItemCount() = 1 | ||
|
||
override fun createFragment(position: Int): Fragment { | ||
return instantiateFragment(RoomActivePollsFragment::class.java.name) | ||
} | ||
|
||
private fun instantiateFragment(fragmentName: String): Fragment { | ||
return fragment.childFragmentManager.fragmentFactory.instantiate(fragment.requireContext().classLoader, fragmentName) | ||
} | ||
} |
2 changes: 1 addition & 1 deletion
2
vector/src/main/java/im/vector/app/features/roomprofile/polls/RoomPollsViewEvent.kt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
2 changes: 1 addition & 1 deletion
2
vector/src/main/java/im/vector/app/features/roomprofile/polls/RoomPollsViewModel.kt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
35 changes: 35 additions & 0 deletions
35
.../src/main/java/im/vector/app/features/roomprofile/polls/active/RoomActivePollsFragment.kt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,35 @@ | ||
/* | ||
* 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.roomprofile.polls.active | ||
|
||
import android.view.LayoutInflater | ||
import android.view.ViewGroup | ||
import com.airbnb.mvrx.parentFragmentViewModel | ||
import dagger.hilt.android.AndroidEntryPoint | ||
import im.vector.app.core.platform.VectorBaseFragment | ||
import im.vector.app.databinding.FragmentRoomPollsListBinding | ||
import im.vector.app.features.roomprofile.polls.RoomPollsViewModel | ||
|
||
@AndroidEntryPoint | ||
class RoomActivePollsFragment : VectorBaseFragment<FragmentRoomPollsListBinding>() { | ||
|
||
private val viewModel: RoomPollsViewModel by parentFragmentViewModel(RoomPollsViewModel::class) | ||
|
||
override fun getBinding(inflater: LayoutInflater, container: ViewGroup?): FragmentRoomPollsListBinding { | ||
return FragmentRoomPollsListBinding.inflate(inflater, container, false) | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
<?xml version="1.0" encoding="utf-8"?> | ||
<androidx.constraintlayout.widget.ConstraintLayout xmlns:android="http://schemas.android.com/apk/res/android" | ||
android:layout_width="match_parent" | ||
android:layout_height="match_parent"> | ||
|
||
|
||
</androidx.constraintlayout.widget.ConstraintLayout> |