Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
circles-android
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Deploy
Releases
Package Registry
Model registry
Operate
Terraform modules
Analyze
Contributor analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Circles
circles-android
Commits
14c95c2c
Commit
14c95c2c
authored
1 year ago
by
Taras
Browse files
Options
Downloads
Patches
Plain Diff
Add menu on Circles tab
parent
48b84d69
No related branches found
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
app/src/main/java/org/futo/circles/feature/circles/CirclesFragment.kt
+22
-1
22 additions, 1 deletion
.../java/org/futo/circles/feature/circles/CirclesFragment.kt
with
22 additions
and
1 deletion
app/src/main/java/org/futo/circles/feature/circles/CirclesFragment.kt
+
22
−
1
View file @
14c95c2c
package
org.futo.circles.feature.circles
package
org.futo.circles.feature.circles
import
android.annotation.SuppressLint
import
android.os.Bundle
import
android.os.Bundle
import
android.view.Menu
import
android.view.MenuInflater
import
android.view.MenuItem
import
android.view.View
import
android.view.View
import
androidx.appcompat.view.menu.MenuBuilder
import
androidx.core.view.MenuProvider
import
androidx.fragment.app.Fragment
import
androidx.fragment.app.Fragment
import
androidx.fragment.app.viewModels
import
androidx.fragment.app.viewModels
import
androidx.navigation.fragment.findNavController
import
androidx.navigation.fragment.findNavController
...
@@ -25,7 +31,7 @@ import org.futo.circles.feature.circles.list.CirclesListAdapter
...
@@ -25,7 +31,7 @@ import org.futo.circles.feature.circles.list.CirclesListAdapter
import
org.futo.circles.model.CircleListItem
import
org.futo.circles.model.CircleListItem
@AndroidEntryPoint
@AndroidEntryPoint
class
CirclesFragment
:
Fragment
(
org
.
futo
.
circles
.
core
.
R
.
layout
.
fragment_rooms
)
{
class
CirclesFragment
:
Fragment
(
org
.
futo
.
circles
.
core
.
R
.
layout
.
fragment_rooms
)
,
MenuProvider
{
private
val
viewModel
by
viewModels
<
CirclesViewModel
>()
private
val
viewModel
by
viewModels
<
CirclesViewModel
>()
private
val
binding
by
viewBinding
(
FragmentRoomsBinding
::
bind
)
private
val
binding
by
viewBinding
(
FragmentRoomsBinding
::
bind
)
...
@@ -37,6 +43,7 @@ class CirclesFragment : Fragment(org.futo.circles.core.R.layout.fragment_rooms)
...
@@ -37,6 +43,7 @@ class CirclesFragment : Fragment(org.futo.circles.core.R.layout.fragment_rooms)
super
.
onViewCreated
(
view
,
savedInstanceState
)
super
.
onViewCreated
(
view
,
savedInstanceState
)
setupViews
()
setupViews
()
setupObservers
()
setupObservers
()
activity
?.
addMenuProvider
(
this
,
viewLifecycleOwner
)
}
}
override
fun
onCreate
(
savedInstanceState
:
Bundle
?)
{
override
fun
onCreate
(
savedInstanceState
:
Bundle
?)
{
...
@@ -50,6 +57,20 @@ class CirclesFragment : Fragment(org.futo.circles.core.R.layout.fragment_rooms)
...
@@ -50,6 +57,20 @@ class CirclesFragment : Fragment(org.futo.circles.core.R.layout.fragment_rooms)
listAdapter
=
null
listAdapter
=
null
}
}
@SuppressLint
(
"RestrictedApi"
)
override
fun
onCreateMenu
(
menu
:
Menu
,
inflater
:
MenuInflater
)
{
(
menu
as
?
MenuBuilder
)
?.
setOptionalIconsVisible
(
true
)
menu
.
clear
()
inflater
.
inflate
(
R
.
menu
.
circles_tab_menu
,
menu
)
}
override
fun
onMenuItemSelected
(
item
:
MenuItem
):
Boolean
{
when
(
item
.
itemId
)
{
R
.
id
.
help
->
CirclesExplanationDialog
(
requireContext
(),
CircleRoomTypeArg
.
Circle
).
show
()
}
return
true
}
private
fun
setupViews
()
{
private
fun
setupViews
()
{
binding
.
rvRooms
.
apply
{
binding
.
rvRooms
.
apply
{
setEmptyView
(
EmptyTabPlaceholderView
(
requireContext
()).
apply
{
setEmptyView
(
EmptyTabPlaceholderView
(
requireContext
()).
apply
{
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment