Skip to content

Commit

Permalink
Update version 0.9.6
Browse files Browse the repository at this point in the history
  • Loading branch information
Ashinch committed Jan 1, 2023
1 parent 19924e5 commit 826e56b
Show file tree
Hide file tree
Showing 9 changed files with 98 additions and 36 deletions.
4 changes: 2 additions & 2 deletions app/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -21,8 +21,8 @@ android {
applicationId "me.ash.reader"
minSdk 26
targetSdk 32
versionCode 16
versionName "0.9.5"
versionCode 17
versionName "0.9.6"

testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
vectorDrawables {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -42,8 +42,10 @@ abstract class AbstractRssRepository constructor(
private val dispatcherDefault: CoroutineDispatcher,
) {

open val subscribe = true
open val move = true
open val subscribe: Boolean = true
open val move: Boolean = true
open val delete: Boolean = true
open val update: Boolean = true

open suspend fun validCredentials(): Boolean = true

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -53,8 +53,10 @@ class FeverRssRepository @Inject constructor(
feedDao, workManager, rssHelper, notificationHelper, ioDispatcher, defaultDispatcher
) {

override val subscribe = false
override val subscribe: Boolean = false
override val move: Boolean = false
override val delete: Boolean = false
override val update: Boolean = false

private suspend fun getFeverAPI() =
FeverSecurityKey(accountDao.queryById(context.currentAccountId)!!.securityKey).run {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,8 @@ fun FeedOptionView(
selectedParseFullContentPreset: Boolean = false,
isMoveToGroup: Boolean = false,
showGroup:Boolean = true,
showUnsubscribe: Boolean = false,
showUnsubscribe:Boolean = true,
notSubscribeMode: Boolean = false,
selectedGroupId: String = "",
allowNotificationPresetOnClick: () -> Unit = {},
parseFullContentPresetOnClick: () -> Unit = {},
Expand Down Expand Up @@ -68,6 +69,7 @@ fun FeedOptionView(
selectedAllowNotificationPreset = selectedAllowNotificationPreset,
selectedParseFullContentPreset = selectedParseFullContentPreset,
showUnsubscribe = showUnsubscribe,
notSubscribeMode = notSubscribeMode,
allowNotificationPresetOnClick = allowNotificationPresetOnClick,
parseFullContentPresetOnClick = parseFullContentPresetOnClick,
clearArticlesOnClick = clearArticlesOnClick,
Expand Down Expand Up @@ -120,7 +122,8 @@ private fun EditableUrl(
private fun Preset(
selectedAllowNotificationPreset: Boolean = false,
selectedParseFullContentPreset: Boolean = false,
showUnsubscribe: Boolean = false,
showUnsubscribe: Boolean = true,
notSubscribeMode: Boolean = false,
allowNotificationPresetOnClick: () -> Unit = {},
parseFullContentPresetOnClick: () -> Unit = {},
clearArticlesOnClick: () -> Unit = {},
Expand Down Expand Up @@ -168,20 +171,22 @@ private fun Preset(
) {
parseFullContentPresetOnClick()
}
if (showUnsubscribe) {
if (notSubscribeMode) {
RYSelectionChip(
modifier = Modifier.animateContentSize(),
content = stringResource(R.string.clear_articles),
selected = false,
) {
clearArticlesOnClick()
}
RYSelectionChip(
modifier = Modifier.animateContentSize(),
content = stringResource(R.string.unsubscribe),
selected = false,
) {
unsubscribeOnClick()
if (showUnsubscribe) {
RYSelectionChip(
modifier = Modifier.animateContentSize(),
content = stringResource(R.string.unsubscribe),
selected = false,
) {
unsubscribeOnClick()
}
}
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,9 @@ fun FeedOptionDrawer(
Spacer(modifier = Modifier.height(16.dp))
Text(
modifier = Modifier.roundClick {
feedOptionViewModel.showRenameDialog()
if (feedOptionViewModel.rssRepository.get().update) {
feedOptionViewModel.showRenameDialog()
}
},
text = feed?.name ?: stringResource(R.string.unknown),
style = MaterialTheme.typography.headlineSmall,
Expand All @@ -87,7 +89,8 @@ fun FeedOptionDrawer(
selectedParseFullContentPreset = feedOptionUiState.feed?.isFullContent ?: false,
isMoveToGroup = true,
showGroup = feedOptionViewModel.rssRepository.get().move,
showUnsubscribe = true,
showUnsubscribe = feedOptionViewModel.rssRepository.get().delete,
notSubscribeMode = true,
selectedGroupId = feedOptionUiState.feed?.groupId ?: "",
allowNotificationPresetOnClick = {
feedOptionViewModel.changeAllowNotificationPreset()
Expand All @@ -111,8 +114,10 @@ fun FeedOptionDrawer(
context.openURL(feed?.url)
},
onFeedUrlLongClick = {
view.performHapticFeedback(HapticFeedbackConstants.KEYBOARD_TAP)
feedOptionViewModel.showFeedUrlDialog()
if (feedOptionViewModel.rssRepository.get().update) {
view.performHapticFeedback(HapticFeedbackConstants.KEYBOARD_TAP)
feedOptionViewModel.showFeedUrlDialog()
}
}
)
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -41,12 +41,12 @@ import me.ash.reader.ui.ext.*
@OptIn(ExperimentalMaterialApi::class)
@Composable
fun GroupOptionDrawer(
groupOptionViewModel: GroupOptionViewModel = hiltViewModel(),
viewModel: GroupOptionViewModel = hiltViewModel(),
content: @Composable () -> Unit = {},
) {
val context = LocalContext.current
val scope = rememberCoroutineScope()
val groupOptionUiState = groupOptionViewModel.groupOptionUiState.collectAsStateValue()
val groupOptionUiState = viewModel.groupOptionUiState.collectAsStateValue()
val group = groupOptionUiState.group
val toastString = stringResource(R.string.rename_toast, groupOptionUiState.newName)

Expand All @@ -73,7 +73,9 @@ fun GroupOptionDrawer(
Spacer(modifier = Modifier.height(16.dp))
Text(
modifier = Modifier.roundClick {
groupOptionViewModel.showRenameDialog()
if (viewModel.rssRepository.get().update) {
viewModel.showRenameDialog()
}
},
text = group?.name ?: stringResource(R.string.unknown),
style = MaterialTheme.typography.headlineSmall,
Expand Down Expand Up @@ -102,17 +104,17 @@ fun GroupOptionDrawer(
Subtitle(text = stringResource(R.string.preset))

Spacer(modifier = Modifier.height(10.dp))
Preset(groupOptionViewModel, group, context)
Preset(viewModel, group, context)

if (groupOptionUiState.groups.size != 1) {
if (viewModel.rssRepository.get().move && groupOptionUiState.groups.size != 1) {
Spacer(modifier = Modifier.height(26.dp))
Subtitle(text = stringResource(R.string.move_to_group))
Spacer(modifier = Modifier.height(10.dp))

if (groupOptionUiState.groups.size > 6) {
LazyRowGroups(groupOptionUiState, group, groupOptionViewModel)
LazyRowGroups(groupOptionUiState, group, viewModel)
} else {
FlowRowGroups(groupOptionUiState, group, groupOptionViewModel)
FlowRowGroups(groupOptionUiState, group, viewModel)
}
}

Expand All @@ -133,22 +135,22 @@ fun GroupOptionDrawer(
visible = groupOptionUiState.renameDialogVisible,
value = groupOptionUiState.newName,
onValueChange = {
groupOptionViewModel.inputNewName(it)
viewModel.inputNewName(it)
},
onDismissRequest = {
groupOptionViewModel.hideRenameDialog()
viewModel.hideRenameDialog()
},
onConfirm = {
groupOptionViewModel.rename()
groupOptionViewModel.hideDrawer(scope)
viewModel.rename()
viewModel.hideDrawer(scope)
context.showToast(toastString)
}
)
}

@Composable
private fun Preset(
groupOptionViewModel: GroupOptionViewModel,
viewModel: GroupOptionViewModel,
group: Group?,
context: Context,
) {
Expand All @@ -172,7 +174,7 @@ private fun Preset(
)
},
) {
groupOptionViewModel.showAllAllowNotificationDialog()
viewModel.showAllAllowNotificationDialog()
}
RYSelectionChip(
modifier = Modifier.animateContentSize(),
Expand All @@ -188,22 +190,22 @@ private fun Preset(
)
},
) {
groupOptionViewModel.showAllParseFullContentDialog()
viewModel.showAllParseFullContentDialog()
}
RYSelectionChip(
modifier = Modifier.animateContentSize(),
content = stringResource(R.string.clear_articles),
selected = false,
) {
groupOptionViewModel.showClearDialog()
viewModel.showClearDialog()
}
if (group?.id != context.currentAccountId.getDefaultGroupId()) {
if (viewModel.rssRepository.get().delete && group?.id != context.currentAccountId.getDefaultGroupId()) {
RYSelectionChip(
modifier = Modifier.animateContentSize(),
content = stringResource(R.string.delete_group),
selected = false,
) {
groupOptionViewModel.showDeleteDialog()
viewModel.showDeleteDialog()
}
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ import javax.inject.Inject
@OptIn(ExperimentalMaterialApi::class)
@HiltViewModel
class GroupOptionViewModel @Inject constructor(
private val rssRepository: RssRepository,
val rssRepository: RssRepository,
@MainDispatcher
private val mainDispatcher: CoroutineDispatcher,
@IODispatcher
Expand Down
23 changes: 23 additions & 0 deletions fastlane/metadata/android/en-US/changelogs/17.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
## 0.9.6

1. Support Fever API (beta)

2. Improve translation (thanks to all)

3. Fix the bug of being in sync all the time when switching accounts

4. Fix the bug that you can't modify other account settings

Fever is an outdated API, which is not fully compatible with modern readers.
But as the first third-party service API supported by Read You, it's a good opportunity to get started.

There will be a supplemental update in the near future for bug fixes and additional translations.


### Known bugs

1. Fever account can only pull the full amount of articles on the server during each sync

2. Notification feature of Fever account is not working

3. Full content parsing preset switch of Fever account is reset after each sync
23 changes: 23 additions & 0 deletions fastlane/metadata/android/zh-CN/changelogs/17.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
## 0.9.6

1. 支持 Fever API (beta)

2. 改进翻译(感谢所有人)

3. 修复切换账户时一直处于同步状态的问题

4. 修复无法修改其他账户设置的问题

Fever 是一个已经过时的 API,它对现代阅读器的功能并不完全兼容。
但作为 Read You 所支持的第一个第三方服务 API,是一个很好的起步机会。

近期将会有一个补充更新,用于修复 bug 和补充翻译。


### 已知问题

1. Fever 账户在每次同步时只能全量拉取服务器上的文章

2. Fever 账户的通知功能失效

3. Fever 账户的全文解析预设开关在每次同步后被重置

0 comments on commit 826e56b

Please sign in to comment.