Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -257,6 +257,29 @@ internal fun AppearanceLayoutScreen(
)
},
)
SegmentedListItem(
onClick = {
state.update(
AppearanceKeys.PostActionFixedWidth,
!timelineAppearance.postActionFixedWidth,
)
},
shapes = ListItemDefaults.item(),
content = {
Text(text = stringResource(id = R.string.settings_post_action_fixed_width))
},
supportingContent = {
Text(text = stringResource(id = R.string.settings_post_action_fixed_width_description))
},
trailingContent = {
Switch(
checked = timelineAppearance.postActionFixedWidth,
onCheckedChange = {
state.update(AppearanceKeys.PostActionFixedWidth, it)
},
)
},
)
SegmentedListItem(
onClick = toPostActionLayout,
shapes = ListItemDefaults.last(),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -178,6 +178,31 @@ internal fun AppearanceMediaScreen(onBack: () -> Unit) {
},
)
}
AnimatedVisibility(timelineAppearance.showMedia) {
SegmentedListItem(
onClick = {
state.update(
AppearanceKeys.LimitMediaGridToNine,
!timelineAppearance.limitMediaGridToNine,
)
},
shapes = ListItemDefaults.item(),
content = {
Text(text = stringResource(id = R.string.settings_appearance_limit_media_grid_to_nine))
},
supportingContent = {
Text(text = stringResource(id = R.string.settings_appearance_limit_media_grid_to_nine_description))
},
trailingContent = {
Switch(
checked = timelineAppearance.limitMediaGridToNine,
onCheckedChange = {
state.update(AppearanceKeys.LimitMediaGridToNine, it)
},
)
},
)
}
AnimatedVisibility(timelineAppearance.showMedia) {
SegmentedListItem(
onClick = {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -88,6 +88,7 @@ internal fun TimelinePresentationEditor(
appearancePatch.contains(AppearanceKeys.TimelineDisplayMode) ||
appearancePatch.contains(AppearanceKeys.FullWidthPost) ||
appearancePatch.contains(AppearanceKeys.PostActionStyle) ||
appearancePatch.contains(AppearanceKeys.PostActionFixedWidth) ||
appearancePatch.contains(AppearanceKeys.ShowNumbers)
val displayOverridesEnabled =
appearancePatch.contains(AppearanceKeys.AbsoluteTimestamp) ||
Expand All @@ -99,6 +100,7 @@ internal fun TimelinePresentationEditor(
appearancePatch.contains(AppearanceKeys.ShowSensitiveContent) ||
appearancePatch.contains(AppearanceKeys.ExpandContentWarning) ||
appearancePatch.contains(AppearanceKeys.ExpandMediaSize) ||
appearancePatch.contains(AppearanceKeys.LimitMediaGridToNine) ||
appearancePatch.contains(AppearanceKeys.VideoAutoplay)
val themeOverridesEnabled = appearancePatch.contains(AppearanceKeys.AvatarShape)
var showFilterDialog by remember { mutableStateOf(false) }
Expand Down Expand Up @@ -217,11 +219,16 @@ internal fun TimelinePresentationEditor(
AppearanceKeys.PostActionStyle,
timelineAppearance.postActionStyle,
).set(AppearanceKeys.ShowNumbers, timelineAppearance.showNumbers)
.set(
AppearanceKeys.PostActionFixedWidth,
timelineAppearance.postActionFixedWidth,
)
} else {
appearancePatch.clearAll(
AppearanceKeys.TimelineDisplayMode,
AppearanceKeys.FullWidthPost,
AppearanceKeys.PostActionStyle,
AppearanceKeys.PostActionFixedWidth,
AppearanceKeys.ShowNumbers,
)
},
Expand Down Expand Up @@ -306,6 +313,20 @@ internal fun TimelinePresentationEditor(
),
)
},
shapes = ListItemDefaults.item(),
)
SwitchSettingsItem(
title = stringResource(id = R.string.settings_post_action_fixed_width),
description = stringResource(id = R.string.settings_post_action_fixed_width_description),
checked = timelineAppearance.postActionFixedWidth,
onCheckedChange = {
onAppearancePatchChange(
appearancePatch.set(
AppearanceKeys.PostActionFixedWidth,
it,
),
)
},
shapes = ListItemDefaults.last(),
)
}
Expand Down Expand Up @@ -421,13 +442,17 @@ internal fun TimelinePresentationEditor(
).set(
AppearanceKeys.ExpandMediaSize,
timelineAppearance.expandMediaSize,
).set(
AppearanceKeys.LimitMediaGridToNine,
timelineAppearance.limitMediaGridToNine,
).set(AppearanceKeys.VideoAutoplay, timelineAppearance.videoAutoplay)
} else {
appearancePatch.clearAll(
AppearanceKeys.ShowMedia,
AppearanceKeys.ShowSensitiveContent,
AppearanceKeys.ExpandContentWarning,
AppearanceKeys.ExpandMediaSize,
AppearanceKeys.LimitMediaGridToNine,
AppearanceKeys.VideoAutoplay,
)
},
Expand Down Expand Up @@ -480,6 +505,20 @@ internal fun TimelinePresentationEditor(
},
shapes = ListItemDefaults.item(),
)
SwitchSettingsItem(
title = stringResource(id = R.string.settings_appearance_limit_media_grid_to_nine),
description = stringResource(id = R.string.settings_appearance_limit_media_grid_to_nine_description),
checked = timelineAppearance.limitMediaGridToNine,
onCheckedChange = {
onAppearancePatchChange(
appearancePatch.set(
AppearanceKeys.LimitMediaGridToNine,
it,
),
)
},
shapes = ListItemDefaults.item(),
)
SwitchSettingsItem(
title = stringResource(id = R.string.settings_appearance_expand_media),
description = stringResource(id = R.string.settings_appearance_expand_media_description),
Expand Down
4 changes: 4 additions & 0 deletions app/src/main/res/values-zh-rCN/strings.xml
Original file line number Diff line number Diff line change
Expand Up @@ -259,6 +259,8 @@
<string name="settings_post_action_layout_title">动态操作</string>
<string name="settings_post_action_layout_enable">自定义操作</string>
<string name="settings_post_action_layout_enable_description">选择哪些操作显示在按钮行、更多菜单或保持隐藏</string>
<string name="settings_post_action_fixed_width">按钮固定宽度</string>
<string name="settings_post_action_fixed_width_description">让带数字的操作按钮保持统一宽度</string>
<string name="settings_post_action_layout_button_row">按钮行</string>
<string name="settings_post_action_layout_more_menu">更多菜单</string>
<string name="settings_post_action_layout_hidden">隐藏</string>
Expand Down Expand Up @@ -293,6 +295,8 @@
<string name="settings_appearance_expand_content_warning_description">总是显示内容警告隐藏的帖子内容</string>
<string name="settings_appearance_expand_media">保留媒体比例</string>
<string name="settings_appearance_expand_media_description">在时间轴中以原始宽高比显示媒体</string>
<string name="settings_appearance_limit_media_grid_to_nine">媒体网格最多显示 9 项</string>
<string name="settings_appearance_limit_media_grid_to_nine_description">每条时间轴动态最多显示 9 项媒体</string>
<string name="settings_appearance_video_autoplay">视频自动播放</string>
<string name="settings_appearance_video_autoplay_description">自动播放动态中的视频</string>
<string name="settings_appearance_video_autoplay_wifi">仅限 Wi-Fi</string>
Expand Down
4 changes: 4 additions & 0 deletions app/src/main/res/values/strings.xml
Original file line number Diff line number Diff line change
Expand Up @@ -304,6 +304,8 @@
<string name="settings_post_action_layout_title">Post actions</string>
<string name="settings_post_action_layout_enable">Customize actions</string>
<string name="settings_post_action_layout_enable_description">Choose which actions appear in the row, More menu, or stay hidden</string>
<string name="settings_post_action_fixed_width">Fixed button width</string>
<string name="settings_post_action_fixed_width_description">Keep action buttons with counts at a consistent width</string>
<string name="settings_post_action_layout_button_row">Button row</string>
<string name="settings_post_action_layout_more_menu">More menu</string>
<string name="settings_post_action_layout_hidden">Hidden</string>
Expand Down Expand Up @@ -334,6 +336,8 @@
<string name="settings_appearance_expand_content_warning_description">Always reveal post content hidden by content warnings</string>
<string name="settings_appearance_expand_media">Preserve media aspect ratio</string>
<string name="settings_appearance_expand_media_description">Show media at its original aspect ratio in timelines</string>
<string name="settings_appearance_limit_media_grid_to_nine">Limit media grids to 9 items</string>
<string name="settings_appearance_limit_media_grid_to_nine_description">Show at most 9 media items in each timeline post</string>
<string name="gallery_detail_tab_info">Info</string>
<string name="gallery_detail_tab_comments">Comments</string>
<string name="gallery_detail_tab_recommend">Recommend</string>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -560,12 +560,14 @@ private extension TimelineAppearance {
showSensitiveContent: showSensitiveContent,
expandContentWarning: true,
expandMediaSize: false,
limitMediaGridToNine: limitMediaGridToNine,
videoAutoplay: .never,
showLinkPreview: false,
compatLinkPreview: compatLinkPreview,
showNumbers: showNumbers,
postActionStyle: .hidden,
postActionLayout: postActionLayout,
postActionFixedWidth: postActionFixedWidth,
fullWidthPost: fullWidthPost,
absoluteTimestamp: absoluteTimestamp,
showPlatformLogo: showPlatformLogo,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -136,6 +136,14 @@ public struct AppearanceLayoutSettingsSection<PostActionLayoutLink: View>: View
Text("appearance_show_numbers", bundle: FlareAppleUILocalization.bundle)
Text("appearance_show_numbers_description", bundle: FlareAppleUILocalization.bundle)
}
Toggle(isOn: Binding(get: {
appearance.postActionFixedWidth
}, set: { newValue in
presenter.state.updatePostActionFixedWidth(value: newValue)
})) {
Text("post_action_fixed_width", bundle: FlareAppleUILocalization.bundle)
Text("post_action_fixed_width_description", bundle: FlareAppleUILocalization.bundle)
}
}
postActionLayoutLink()
}
Expand Down Expand Up @@ -384,6 +392,14 @@ public struct AppearanceMediaSettingsSection: View {
Text("appearance_expand_media_size", bundle: FlareAppleUILocalization.bundle)
Text("appearance_expand_media_size_description", bundle: FlareAppleUILocalization.bundle)
}
Toggle(isOn: Binding(get: {
appearance.limitMediaGridToNine
}, set: { newValue in
presenter.state.updateLimitMediaGridToNine(value: newValue)
})) {
Text("appearance_limit_media_grid_to_nine", bundle: FlareAppleUILocalization.bundle)
Text("appearance_limit_media_grid_to_nine_description", bundle: FlareAppleUILocalization.bundle)
}
Toggle(isOn: Binding(get: {
appearance.showSensitiveContent
}, set: { newValue in
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -195,12 +195,14 @@ public extension TimelineAppearance {
showSensitiveContent: showSensitiveContent,
expandContentWarning: expandContentWarning,
expandMediaSize: expandMediaSize,
limitMediaGridToNine: limitMediaGridToNine,
videoAutoplay: videoAutoplay,
showLinkPreview: showLinkPreview,
compatLinkPreview: compatLinkPreview,
showNumbers: showNumbers,
postActionStyle: postActionStyle,
postActionLayout: config,
postActionFixedWidth: postActionFixedWidth,
fullWidthPost: fullWidthPost,
absoluteTimestamp: absoluteTimestamp,
showPlatformLogo: showPlatformLogo,
Expand Down
Loading
Loading