[优化] 增加了一个页面切换过渡动画的开关 #557
This commit is contained in:
@@ -337,7 +337,7 @@ jobs:
|
|||||||
uses: softprops/action-gh-release@v2
|
uses: softprops/action-gh-release@v2
|
||||||
with:
|
with:
|
||||||
tag_name: ${{ needs.prepare.outputs.versionL }}
|
tag_name: ${{ needs.prepare.outputs.versionL }}
|
||||||
name: ${{ needs.prepare.outputs.is_release == 'true' && format('正式版 {0}', needs.prepare.outputs.versionL) || format('测试版 {0}', needs.prepare.outputs.versionL) }}
|
name: ${{ needs.prepare.outputs.is_release == 'true' && format('Release {0}', needs.prepare.outputs.versionL) || format('Pre-release {0}', needs.prepare.outputs.versionL) }}
|
||||||
body: ${{ steps.get_commits.outputs.release_body }}
|
body: ${{ steps.get_commits.outputs.release_body }}
|
||||||
prerelease: ${{ needs.prepare.outputs.is_release != 'true' }}
|
prerelease: ${{ needs.prepare.outputs.is_release != 'true' }}
|
||||||
files: |
|
files: |
|
||||||
|
|||||||
@@ -46,6 +46,7 @@ object PreferKey {
|
|||||||
const val enableReview = "enableReview"
|
const val enableReview = "enableReview"
|
||||||
const val showRss = "showRss"
|
const val showRss = "showRss"
|
||||||
const val showStatusBar = "showStatusBar"
|
const val showStatusBar = "showStatusBar"
|
||||||
|
const val swipeAnimation = "swipeAnimation"
|
||||||
const val bookshelfLayout = "bookshelfLayout"
|
const val bookshelfLayout = "bookshelfLayout"
|
||||||
const val bookshelfLayoutModePortrait = "bookshelfLayoutPortrait"
|
const val bookshelfLayoutModePortrait = "bookshelfLayoutPortrait"
|
||||||
const val bookshelfLayoutModeLandscape = "bookshelf_layout_landscape"
|
const val bookshelfLayoutModeLandscape = "bookshelf_layout_landscape"
|
||||||
|
|||||||
@@ -53,7 +53,9 @@ object AppConfig : SharedPreferences.OnSharedPreferenceChangeListener {
|
|||||||
|
|
||||||
var themeMode = appCtx.getPrefString(PreferKey.themeMode, "0")
|
var themeMode = appCtx.getPrefString(PreferKey.themeMode, "0")
|
||||||
var AppTheme = appCtx.getPrefString(PreferKey.appTheme, "0")
|
var AppTheme = appCtx.getPrefString(PreferKey.appTheme, "0")
|
||||||
var containerOpacity = appCtx.getPrefInt(PreferKey.containerOpacity, 100)
|
|
||||||
|
var swipeAnimation = appCtx.getPrefBoolean(PreferKey.swipeAnimation, true)
|
||||||
|
|
||||||
var useDefaultCover = appCtx.getPrefBoolean(PreferKey.useDefaultCover, false)
|
var useDefaultCover = appCtx.getPrefBoolean(PreferKey.useDefaultCover, false)
|
||||||
var optimizeRender = CanvasRecorderFactory.isSupport
|
var optimizeRender = CanvasRecorderFactory.isSupport
|
||||||
&& appCtx.getPrefBoolean(PreferKey.optimizeRender, false)
|
&& appCtx.getPrefBoolean(PreferKey.optimizeRender, false)
|
||||||
@@ -998,4 +1000,9 @@ object AppConfig : SharedPreferences.OnSharedPreferenceChangeListener {
|
|||||||
return str * 60 * 1000L
|
return str * 60 * 1000L
|
||||||
}
|
}
|
||||||
|
|
||||||
|
var containerOpacity: Int
|
||||||
|
get() = appCtx.getPrefInt(PreferKey.containerOpacity, 100)
|
||||||
|
set(value) {
|
||||||
|
appCtx.putPrefInt(PreferKey.containerOpacity, value)
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -181,7 +181,7 @@ class ThemeConfigFragment : PreferenceFragmentCompat(),
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
PreferKey.paletteStyle, PreferKey.pureBlack, PreferKey.enableBlur -> {
|
PreferKey.paletteStyle, PreferKey.pureBlack, PreferKey.enableBlur, PreferKey.swipeAnimation -> {
|
||||||
ThemeSyncer.syncAll()
|
ThemeSyncer.syncAll()
|
||||||
Handler(Looper.getMainLooper()).postDelayed({
|
Handler(Looper.getMainLooper()).postDelayed({
|
||||||
recreateActivities()
|
recreateActivities()
|
||||||
@@ -248,25 +248,35 @@ class ThemeConfigFragment : PreferenceFragmentCompat(),
|
|||||||
.setValue(10)
|
.setValue(10)
|
||||||
.setCustomButton((R.string.btn_default_s)) {
|
.setCustomButton((R.string.btn_default_s)) {
|
||||||
putPrefInt(PreferKey.fontScale, 0)
|
putPrefInt(PreferKey.fontScale, 0)
|
||||||
recreateActivities()
|
Handler(Looper.getMainLooper()).postDelayed({
|
||||||
|
recreateActivities()
|
||||||
|
}, 100)
|
||||||
}
|
}
|
||||||
.show {
|
.show {
|
||||||
putPrefInt(PreferKey.fontScale, it)
|
putPrefInt(PreferKey.fontScale, it)
|
||||||
recreateActivities()
|
Handler(Looper.getMainLooper()).postDelayed({
|
||||||
|
recreateActivities()
|
||||||
|
}, 100)
|
||||||
}
|
}
|
||||||
|
|
||||||
PreferKey.containerOpacity -> NumberPickerDialog(requireContext())
|
PreferKey.containerOpacity -> NumberPickerDialog(requireContext())
|
||||||
.setTitle(getString(R.string.container_opacity))
|
.setTitle(getString(R.string.container_opacity))
|
||||||
.setMaxValue(100)
|
.setMaxValue(100)
|
||||||
.setMinValue(0)
|
.setMinValue(0)
|
||||||
.setValue(100)
|
.setValue(AppConfig.containerOpacity)
|
||||||
.setCustomButton((R.string.btn_default_s)) {
|
.setCustomButton((R.string.btn_default_s)) {
|
||||||
putPrefInt(PreferKey.containerOpacity, 100)
|
AppConfig.containerOpacity = 100
|
||||||
ThemeSyncer.syncContainerOpacity()
|
Handler(Looper.getMainLooper()).postDelayed({
|
||||||
|
ThemeSyncer.syncContainerOpacity()
|
||||||
|
upPreferenceSummary(PreferKey.containerOpacity)
|
||||||
|
}, 100)
|
||||||
}
|
}
|
||||||
.show {
|
.show {
|
||||||
putPrefInt(PreferKey.containerOpacity, it)
|
AppConfig.containerOpacity = it
|
||||||
ThemeSyncer.syncContainerOpacity()
|
Handler(Looper.getMainLooper()).postDelayed({
|
||||||
|
ThemeSyncer.syncContainerOpacity()
|
||||||
|
upPreferenceSummary(PreferKey.containerOpacity)
|
||||||
|
}, 100)
|
||||||
}
|
}
|
||||||
|
|
||||||
PreferKey.bgImage -> selectBgAction(false)
|
PreferKey.bgImage -> selectBgAction(false)
|
||||||
|
|||||||
@@ -96,6 +96,7 @@ open class MainActivity : VMBaseActivity<ActivityMainBinding, MainViewModel>(),
|
|||||||
private val fragmentMap = hashMapOf<Int, Fragment>()
|
private val fragmentMap = hashMapOf<Int, Fragment>()
|
||||||
private var bottomMenuCount = 4
|
private var bottomMenuCount = 4
|
||||||
private val realPositions = arrayOf(idBookshelf, idExplore, idRss, idMy)
|
private val realPositions = arrayOf(idBookshelf, idExplore, idRss, idMy)
|
||||||
|
private val swipeAnimation = AppConfig.swipeAnimation
|
||||||
private val adapter by lazy {
|
private val adapter by lazy {
|
||||||
TabFragmentPageAdapter(this)
|
TabFragmentPageAdapter(this)
|
||||||
}
|
}
|
||||||
@@ -181,7 +182,7 @@ open class MainActivity : VMBaseActivity<ActivityMainBinding, MainViewModel>(),
|
|||||||
R.id.menu_my_config -> realPositions.indexOf(idMy)
|
R.id.menu_my_config -> realPositions.indexOf(idMy)
|
||||||
else -> 0
|
else -> 0
|
||||||
}
|
}
|
||||||
binding.viewPagerMain.setCurrentItem(index, true)
|
binding.viewPagerMain.setCurrentItem(index, swipeAnimation)
|
||||||
return true
|
return true
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -1363,12 +1363,13 @@
|
|||||||
<string name="enable_slider_vibrator">滑动进度条时震动</string>
|
<string name="enable_slider_vibrator">滑动进度条时震动</string>
|
||||||
<string name="edit_remark">编辑备注</string>
|
<string name="edit_remark">编辑备注</string>
|
||||||
<string name="book_remark">书籍备注</string>
|
<string name="book_remark">书籍备注</string>
|
||||||
<string name="auto_check_new_backup_t">自动检查新备份</string>
|
<string name="save_to_local">保存至本地</string>
|
||||||
|
<string name="select_operation">选择操作</string>
|
||||||
<string name="text_accent_color">强调</string>
|
<string name="text_accent_color">强调</string>
|
||||||
<string name="read_color">颜色样式</string>
|
<string name="read_color">颜色样式</string>
|
||||||
<string name="reverse_volume_key_page">反转音量键翻页方向</string>
|
<string name="reverse_volume_key_page">反转音量键翻页方向</string>
|
||||||
<string name="palette_style">调色板样式</string>
|
<string name="palette_style">调色板样式</string>
|
||||||
<string name="tip_compose_set">这里的选项仅可以控制使用Compose重写的界面。</string>
|
<string name="tip_compose_set">这里的选项仅可以控制使用Compose重写的界面。对于禁用的选项,会在日后实现时开放,现在仅作占位。</string>
|
||||||
<string name="is_blur_enable">启用控件模糊</string>
|
<string name="is_blur_enable">启用控件模糊</string>
|
||||||
<string name="use_underline">总是使用下划线表示强调文本</string>
|
<string name="use_underline">总是使用下划线表示强调文本</string>
|
||||||
<string name="adapt_special_style">适配特殊样式</string>
|
<string name="adapt_special_style">适配特殊样式</string>
|
||||||
@@ -1380,4 +1381,5 @@
|
|||||||
<string name="read_aloud_preload_summary">%d</string>
|
<string name="read_aloud_preload_summary">%d</string>
|
||||||
<string name="audio_cache_clean_time">音频缓存保留时间(分钟)</string>
|
<string name="audio_cache_clean_time">音频缓存保留时间(分钟)</string>
|
||||||
<string name="audio_cache_clean_time_summary">当前%d, 输入 0 代表退出即刻清理。</string>
|
<string name="audio_cache_clean_time_summary">当前%d, 输入 0 代表退出即刻清理。</string>
|
||||||
|
<string name="show_swipe_animation">启用滑动时动画</string>
|
||||||
</resources>
|
</resources>
|
||||||
@@ -1373,7 +1373,7 @@
|
|||||||
<string name="read_color">颜色样式</string>
|
<string name="read_color">颜色样式</string>
|
||||||
<string name="reverse_volume_key_page">反转音量键翻页方向</string>
|
<string name="reverse_volume_key_page">反转音量键翻页方向</string>
|
||||||
<string name="palette_style">调色板样式</string>
|
<string name="palette_style">调色板样式</string>
|
||||||
<string name="tip_compose_set">这里的选项仅可以控制使用Compose重写的界面。</string>
|
<string name="tip_compose_set">这里的选项仅可以控制使用Compose重写的界面。对于禁用的选项,会在日后实现时开放,现在仅作占位。</string>
|
||||||
<string name="is_blur_enable">启用控件模糊</string>
|
<string name="is_blur_enable">启用控件模糊</string>
|
||||||
<string name="use_underline">总是使用下划线表示强调文本</string>
|
<string name="use_underline">总是使用下划线表示强调文本</string>
|
||||||
<string name="adapt_special_style">适配特殊样式</string>
|
<string name="adapt_special_style">适配特殊样式</string>
|
||||||
@@ -1385,4 +1385,5 @@
|
|||||||
<string name="read_aloud_preload_summary">%d</string>
|
<string name="read_aloud_preload_summary">%d</string>
|
||||||
<string name="audio_cache_clean_time">音频缓存保留时间(分钟)</string>
|
<string name="audio_cache_clean_time">音频缓存保留时间(分钟)</string>
|
||||||
<string name="audio_cache_clean_time_summary">当前%d, 输入 0 代表退出即刻清理。</string>
|
<string name="audio_cache_clean_time_summary">当前%d, 输入 0 代表退出即刻清理。</string>
|
||||||
|
<string name="show_swipe_animation">启用滑动时动画</string>
|
||||||
</resources>
|
</resources>
|
||||||
|
|||||||
@@ -144,6 +144,12 @@
|
|||||||
android:title="@string/show_status"
|
android:title="@string/show_status"
|
||||||
app:iconSpaceReserved="false" />
|
app:iconSpaceReserved="false" />
|
||||||
|
|
||||||
|
<io.legado.app.lib.prefs.SwitchPreference
|
||||||
|
android:defaultValue="true"
|
||||||
|
android:key="swipeAnimation"
|
||||||
|
android:title="@string/show_swipe_animation"
|
||||||
|
app:iconSpaceReserved="false" />
|
||||||
|
|
||||||
<io.legado.app.lib.prefs.SwitchPreference
|
<io.legado.app.lib.prefs.SwitchPreference
|
||||||
android:defaultValue="true"
|
android:defaultValue="true"
|
||||||
android:key="showBottomView"
|
android:key="showBottomView"
|
||||||
|
|||||||
Reference in New Issue
Block a user