Handle public instances #126
@ -114,10 +114,16 @@ class HomeActivity : AppCompatActivity(), SearchView.OnQueryTextListener, DIAwar
|
||||
}
|
||||
}
|
||||
|
||||
val swipeDirs = if (appSettingsService.getPublicAccess()) {
|
||||
0
|
||||
} else {
|
||||
ItemTouchHelper.LEFT or ItemTouchHelper.RIGHT
|
||||
}
|
||||
|
||||
val simpleItemTouchCallback =
|
||||
object : ItemTouchHelper.SimpleCallback(
|
||||
0,
|
||||
ItemTouchHelper.LEFT or ItemTouchHelper.RIGHT
|
||||
swipeDirs
|
||||
) {
|
||||
override fun getSwipeDirs(
|
||||
recyclerView: RecyclerView,
|
||||
@ -510,6 +516,10 @@ class HomeActivity : AppCompatActivity(), SearchView.OnQueryTextListener, DIAwar
|
||||
override fun onCreateOptionsMenu(menu: Menu): Boolean {
|
||||
val inflater = menuInflater
|
||||
inflater.inflate(R.menu.home_menu, menu)
|
||||
if (appSettingsService.getPublicAccess()) {
|
||||
menu.removeItem(R.id.readAll)
|
||||
menu.removeItem(R.id.action_sources)
|
||||
}
|
||||
|
||||
val searchItem = menu.findItem(R.id.action_search)
|
||||
val searchView = searchItem.getActionView() as SearchView
|
||||
|
Loading…
Reference in New Issue
Block a user