Handle public access in the article reader screen
Remove the favourite button from the article reader if accessing a public instance
This commit is contained in:
parent
ece1e5cbe6
commit
993a630d88
@ -137,12 +137,17 @@ class ReaderActivity : AppCompatActivity(), DIAware {
|
|||||||
inflater.inflate(R.menu.reader_menu, menu)
|
inflater.inflate(R.menu.reader_menu, menu)
|
||||||
toolbarMenu = menu
|
toolbarMenu = menu
|
||||||
|
|
||||||
|
alignmentMenu()
|
||||||
|
|
||||||
|
if (appSettingsService.getPublicAccess()) {
|
||||||
|
menu.removeItem(R.id.star)
|
||||||
|
} else {
|
||||||
if (allItems.isNotEmpty() && allItems[currentItem].starred) {
|
if (allItems.isNotEmpty() && allItems[currentItem].starred) {
|
||||||
canRemoveFromFavorite()
|
canRemoveFromFavorite()
|
||||||
} else {
|
} else {
|
||||||
canFavorite()
|
canFavorite()
|
||||||
}
|
}
|
||||||
alignmentMenu()
|
|
||||||
|
|
||||||
binding.pager.registerOnPageChangeCallback(
|
binding.pager.registerOnPageChangeCallback(
|
||||||
object : ViewPager2.OnPageChangeCallback() {
|
object : ViewPager2.OnPageChangeCallback() {
|
||||||
@ -159,6 +164,7 @@ class ReaderActivity : AppCompatActivity(), DIAware {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
)
|
)
|
||||||
|
}
|
||||||
|
|
||||||
return true
|
return true
|
||||||
}
|
}
|
||||||
@ -177,7 +183,7 @@ class ReaderActivity : AppCompatActivity(), DIAware {
|
|||||||
|
|
||||||
when (item.itemId) {
|
when (item.itemId) {
|
||||||
android.R.id.home -> {
|
android.R.id.home -> {
|
||||||
onBackPressed()
|
onBackPressedDispatcher.onBackPressed()
|
||||||
return true
|
return true
|
||||||
}
|
}
|
||||||
R.id.star -> {
|
R.id.star -> {
|
||||||
|
Loading…
Reference in New Issue
Block a user