Handle public instances #126
@ -84,7 +84,7 @@ class ReaderActivity : AppCompatActivity(), DIAware {
|
||||
}
|
||||
|
||||
private fun readItem(item: SelfossModel.Item) {
|
||||
if (appSettingsService.isMarkOnScrollEnabled()) {
|
||||
if (appSettingsService.isMarkOnScrollEnabled() and !appSettingsService.getPublicAccess()) {
|
||||
|
||||
CoroutineScope(Dispatchers.IO).launch {
|
||||
repository.markAsRead(item)
|
||||
}
|
||||
@ -137,28 +137,34 @@ class ReaderActivity : AppCompatActivity(), DIAware {
|
||||
inflater.inflate(R.menu.reader_menu, menu)
|
||||
toolbarMenu = menu
|
||||
|
||||
if (allItems.isNotEmpty() && allItems[currentItem].starred) {
|
||||
canRemoveFromFavorite()
|
||||
} else {
|
||||
canFavorite()
|
||||
}
|
||||
alignmentMenu()
|
||||
|
||||
binding.pager.registerOnPageChangeCallback(
|
||||
object : ViewPager2.OnPageChangeCallback() {
|
||||
|
||||
override fun onPageSelected(position: Int) {
|
||||
super.onPageSelected(position)
|
||||
|
||||
if (allItems[position].starred) {
|
||||
canRemoveFromFavorite()
|
||||
} else {
|
||||
canFavorite()
|
||||
}
|
||||
readItem(allItems[position])
|
||||
}
|
||||
if (appSettingsService.getPublicAccess()) {
|
||||
menu.removeItem(R.id.star)
|
||||
} else {
|
||||
if (allItems.isNotEmpty() && allItems[currentItem].starred) {
|
||||
canRemoveFromFavorite()
|
||||
} else {
|
||||
canFavorite()
|
||||
}
|
||||
)
|
||||
|
||||
|
||||
binding.pager.registerOnPageChangeCallback(
|
||||
object : ViewPager2.OnPageChangeCallback() {
|
||||
|
||||
override fun onPageSelected(position: Int) {
|
||||
super.onPageSelected(position)
|
||||
|
||||
if (allItems[position].starred) {
|
||||
canRemoveFromFavorite()
|
||||
} else {
|
||||
canFavorite()
|
||||
}
|
||||
readItem(allItems[position])
|
||||
}
|
||||
}
|
||||
)
|
||||
}
|
||||
|
||||
return true
|
||||
}
|
||||
@ -177,7 +183,7 @@ class ReaderActivity : AppCompatActivity(), DIAware {
|
||||
|
||||
when (item.itemId) {
|
||||
android.R.id.home -> {
|
||||
onBackPressed()
|
||||
onBackPressedDispatcher.onBackPressed()
|
||||
return true
|
||||
}
|
||||
R.id.star -> {
|
||||
|
Loading…
Reference in New Issue
Block a user
and
should be changed to&&
.We do not care about the value of
appSettingsService.getPublicAccess()
ifappSettingsService.isMarkOnScrollEnabled()
is false.