[优化] 重写订阅阅读页面,可能有bug喵

This commit is contained in:
HapeLee committed 2026-04-20 02:14:59 +08:00
1 parent 195a76de67
commit ca70dcaec9
44 files changed
+2291 -2447

No files matched your search

@@ -1,92 +0,0 @@
<?xml version="1.0" encoding="utf-8"?>
<androidx.coordinatorlayout.widget.CoordinatorLayout
xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="match_parent">
<com.google.android.material.appbar.AppBarLayout
android:id="@+id/title_bar"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:background="@android:color/transparent"
android:fitsSystemWindows="true"
app:liftOnScroll="false"
android:stateListAnimator="@null">
<com.google.android.material.appbar.CollapsingToolbarLayout
android:id="@+id/ctl_bar"
android:layout_width="match_parent"
android:layout_height="?attr/collapsingToolbarLayoutMediumSize"
style="?attr/collapsingToolbarLayoutMediumStyle"
app:collapsedTitleTextAppearance="?attr/textAppearanceTitleLarge"
app:expandedTitleTextAppearance="?attr/textAppearanceHeadlineLarge"
app:titleCollapseMode="scale"
app:layout_scrollFlags="scroll|exitUntilCollapsed|snap">
<com.google.android.material.appbar.MaterialToolbar
android:theme="@style/ThemeOverlay.Material3.Toolbar.CircleNavigationButton"
android:id="@+id/top_bar"
android:layout_width="match_parent"
android:layout_height="?attr/actionBarSize"
app:navigationIcon="@drawable/ic_arrow_back"
app:title="@string/rss"
app:layout_collapseMode="pin" />
</com.google.android.material.appbar.CollapsingToolbarLayout>
<LinearLayout
android:id="@+id/ll_tab"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="horizontal"
android:gravity="center_vertical"
android:paddingStart="16dp"
android:paddingEnd="10dp">
<FrameLayout
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_weight="1"
android:clipToPadding="false"
android:clipChildren="false">
<com.google.android.material.tabs.TabLayout
android:id="@+id/tab_layout"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:background="@android:color/transparent"
app:tabMode="scrollable"
android:scrollbars="none" />
<View
android:id="@+id/tab_right_fade"
android:layout_width="40dp"
android:layout_height="match_parent"
android:layout_gravity="end"
android:background="@drawable/tab_right_fade" />
</FrameLayout>
<com.google.android.material.button.MaterialButton
android:id="@+id/btn_expand_tabs"
android:layout_width="40dp"
android:layout_height="40dp"
android:checkable="true"
app:iconGravity="textStart"
style="@style/Widget.Material3Expressive.Button.IconButton.Outlined"
app:icon="@drawable/m3_split_button_chevron_avd" />
</LinearLayout>
</com.google.android.material.appbar.AppBarLayout>
<androidx.viewpager2.widget.ViewPager2
android:id="@+id/view_pager"
android:layout_width="match_parent"
android:layout_height="match_parent"
app:layout_behavior="@string/appbar_scrolling_view_behavior"
tools:ignore="SpeakableTextPresentCheck" />
</androidx.coordinatorlayout.widget.CoordinatorLayout>
@@ -1,41 +0,0 @@
<?xml version="1.0" encoding="utf-8"?>
<FrameLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="match_parent"
xmlns:app="http://schemas.android.com/apk/res-auto"
android:orientation="vertical">
<androidx.constraintlayout.widget.ConstraintLayout
android:id="@+id/ll_view"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="vertical">
<io.legado.app.ui.widget.TitleBar
android:id="@+id/title_bar"
android:layout_width="match_parent"
android:layout_height="wrap_content"
app:layout_constraintTop_toTopOf="parent" />
<io.legado.app.ui.rss.read.VisibleWebView
android:id="@+id/web_view"
android:layout_width="match_parent"
android:layout_height="0dp"
app:layout_constraintTop_toBottomOf="@+id/title_bar"
app:layout_constraintBottom_toBottomOf="parent" />
<com.google.android.material.progressindicator.LinearProgressIndicator
android:id="@+id/progress_bar"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:progress="100"
app:layout_constraintTop_toTopOf="@id/web_view" />
</androidx.constraintlayout.widget.ConstraintLayout>
<FrameLayout
android:id="@+id/custom_web_view"
android:layout_width="match_parent"
android:layout_height="match_parent" />
</FrameLayout>
@@ -1,104 +0,0 @@
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
xmlns:app="http://schemas.android.com/apk/res-auto"
android:id="@+id/vw_bg"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_gravity="center"
android:orientation="vertical"
tools:ignore="UselessParent">
<androidx.appcompat.widget.Toolbar
android:id="@+id/tool_bar"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:theme="?attr/actionBarStyle"
app:title="@string/favorite" />
<androidx.core.widget.NestedScrollView
android:layout_width="match_parent"
android:layout_height="0dp"
android:layout_weight="1"
android:overScrollMode="ifContentScrolls">
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="vertical"
android:padding="16dp">
<io.legado.app.ui.widget.text.TextInputLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:paddingTop="3dp">
<io.legado.app.lib.theme.view.ThemeEditText
android:id="@+id/edit_title"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:hint="@string/title"
tools:ignore="SpeakableTextPresentCheck,TouchTargetSizeCheck" />
</io.legado.app.ui.widget.text.TextInputLayout>
<io.legado.app.ui.widget.text.TextInputLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:paddingTop="3dp">
<io.legado.app.lib.theme.view.ThemeEditText
android:id="@+id/edit_group"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:hint="@string/group_name"
tools:ignore="SpeakableTextPresentCheck,TouchTargetSizeCheck" />
</io.legado.app.ui.widget.text.TextInputLayout>
</LinearLayout>
</androidx.core.widget.NestedScrollView>
<com.google.android.flexbox.FlexboxLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:paddingLeft="12dp"
android:paddingRight="12dp"
app:flexWrap="wrap"
app:justifyContent="space_between">
<com.google.android.material.button.MaterialButton
android:id="@+id/tv_footer_left"
style="@style/Widget.Material3.Button.OutlinedButton"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="@string/delete"
tools:ignore="RtlHardcoded" />
<LinearLayout
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:orientation="horizontal">
<com.google.android.material.button.MaterialButton
android:id="@+id/tv_cancel"
style="@style/Widget.Material3.Button.TonalButton"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginEnd="8dp"
android:text="@string/cancel"
tools:ignore="RtlHardcoded" />
<com.google.android.material.button.MaterialButton
android:id="@+id/tv_ok"
style="@style/Widget.Material3.Button"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="@string/ok"
tools:ignore="RtlHardcoded" />
</LinearLayout>
</com.google.android.flexbox.FlexboxLayout>
</LinearLayout>
@@ -1,14 +0,0 @@
<?xml version="1.0" encoding="utf-8"?>
<androidx.swiperefreshlayout.widget.SwipeRefreshLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:id="@+id/refresh_layout"
android:layout_width="match_parent"
android:layout_height="match_parent">
<io.legado.app.ui.widget.recycler.RecyclerViewAtPager2
android:id="@+id/recycler_view"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:padding="4dp"
android:clipToPadding="false" />
</androidx.swiperefreshlayout.widget.SwipeRefreshLayout>
@@ -1,57 +0,0 @@
<?xml version="1.0" encoding="utf-8"?>
<com.google.android.material.card.MaterialCardView xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
xmlns:tools="http://schemas.android.com/tools"
android:layout_marginVertical="8dp"
android:layout_marginHorizontal="8dp"
android:layout_width="match_parent"
android:layout_height="wrap_content"
app:strokeWidth="0dp"
app:cardBackgroundColor="?attr/colorSurfaceContainer">
<androidx.constraintlayout.widget.ConstraintLayout
android:padding="8dp"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:background="?attr/selectableItemBackground">
<TextView
android:id="@+id/tv_title"
android:layout_width="0dp"
android:layout_height="wrap_content"
style="@style/ChapterNameText"
android:ellipsize="end"
android:text="@string/app_name"
app:layout_constraintBottom_toTopOf="@+id/tv_pub_date"
app:layout_constraintLeft_toLeftOf="parent"
app:layout_constraintRight_toLeftOf="@+id/image_view"
app:layout_constraintTop_toTopOf="parent" />
<TextView
android:id="@+id/tv_pub_date"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_gravity="center"
android:layout_marginTop="8dp"
android:text="@string/app_name"
android:textSize="12sp"
android:textStyle="italic"
android:maxLines="1"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintLeft_toLeftOf="parent"
app:layout_constraintRight_toLeftOf="@+id/image_view" />
<ImageView
android:id="@+id/image_view"
android:layout_width="110dp"
android:layout_height="68dp"
android:contentDescription="@string/img_cover"
android:paddingLeft="16dp"
android:visibility="gone"
android:scaleType="centerCrop"
android:src="@drawable/image_rss_article"
app:layout_constraintRight_toRightOf="parent"
app:layout_constraintTop_toTopOf="parent"
tools:ignore="RtlHardcoded,RtlSymmetry" />
</androidx.constraintlayout.widget.ConstraintLayout>
</com.google.android.material.card.MaterialCardView>
@@ -1,56 +0,0 @@
<?xml version="1.0" encoding="utf-8"?>
<com.google.android.material.card.MaterialCardView xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
xmlns:tools="http://schemas.android.com/tools"
android:layout_margin="4dp"
android:layout_width="match_parent"
android:layout_height="wrap_content"
app:strokeWidth="0dp"
app:cardBackgroundColor="?attr/colorSurfaceContainer">
<androidx.constraintlayout.widget.ConstraintLayout
android:padding="8dp"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:background="?attr/selectableItemBackground">
<ImageView
android:id="@+id/image_view"
android:layout_width="0dp"
android:layout_height="220dp"
android:contentDescription="@string/loading"
android:visibility="visible"
android:scaleType="centerCrop"
app:layout_constraintTop_toTopOf="parent"
app:layout_constraintLeft_toLeftOf="parent"
app:layout_constraintRight_toRightOf="parent"
tools:ignore="RtlHardcoded,RtlSymmetry" />
<TextView
android:id="@+id/tv_title"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_marginVertical="4dp"
android:maxLines="2"
android:ellipsize="end"
android:text="@string/app_name"
android:textSize="15sp"
android:textStyle="bold"
app:layout_constraintTop_toBottomOf="@+id/image_view"
app:layout_constraintLeft_toLeftOf="parent"
app:layout_constraintRight_toRightOf="parent" />
<TextView
android:id="@+id/tv_pub_date"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_gravity="center"
android:text="@string/app_name"
android:textSize="11sp"
android:maxLines="1"
app:layout_constraintTop_toBottomOf="@+id/tv_title"
app:layout_constraintLeft_toLeftOf="parent"
app:layout_constraintRight_toRightOf="parent"
tools:ignore="SmallSp" />
</androidx.constraintlayout.widget.ConstraintLayout>
</com.google.android.material.card.MaterialCardView>
@@ -1,58 +0,0 @@
<?xml version="1.0" encoding="utf-8"?>
<com.google.android.material.card.MaterialCardView xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
xmlns:tools="http://schemas.android.com/tools"
android:layout_margin="4dp"
android:layout_width="match_parent"
android:layout_height="wrap_content"
app:strokeWidth="0dp"
android:background="?attr/selectableItemBackground">
<androidx.constraintlayout.widget.ConstraintLayout
android:padding="8dp"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:background="?attr/colorSurfaceContainer">
<ImageView
android:id="@+id/image_view"
android:layout_width="0dp"
android:layout_height="240dp"
android:contentDescription="@string/loading"
android:visibility="visible"
android:scaleType="centerCrop"
android:background="@drawable/bg_img_border"
app:layout_constraintTop_toTopOf="parent"
app:layout_constraintLeft_toLeftOf="parent"
app:layout_constraintRight_toRightOf="parent"
tools:ignore="RtlHardcoded,RtlSymmetry" />
<TextView
android:id="@+id/tv_title"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:maxLines="2"
android:ellipsize="end"
android:text="@string/app_name"
android:textSize="13sp"
android:paddingTop="8dp"
app:layout_constraintTop_toBottomOf="@+id/image_view"
app:layout_constraintLeft_toLeftOf="parent"
app:layout_constraintRight_toRightOf="parent" />
<TextView
android:id="@+id/tv_pub_date"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_gravity="center"
android:text="@string/app_name"
android:textSize="11sp"
android:maxLines="1"
android:paddingTop="4dp"
android:paddingBottom="2dp"
app:layout_constraintTop_toBottomOf="@+id/tv_title"
app:layout_constraintLeft_toLeftOf="parent"
app:layout_constraintRight_toRightOf="parent"
tools:ignore="SmallSp" />
</androidx.constraintlayout.widget.ConstraintLayout>
</com.google.android.material.card.MaterialCardView>
@@ -1,65 +0,0 @@
<?xml version="1.0" encoding="utf-8"?>
<com.google.android.material.card.MaterialCardView xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
xmlns:tools="http://schemas.android.com/tools"
android:layout_margin="4dp"
android:layout_width="match_parent"
android:layout_height="wrap_content"
app:strokeColor="?attr/colorSurfaceContainer"
app:cardBackgroundColor="?attr/colorSurfaceContainer">
<androidx.constraintlayout.widget.ConstraintLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:background="?attr/selectableItemBackground">
<com.google.android.material.card.MaterialCardView
android:id="@+id/cd_img"
android:layout_width="match_parent"
android:layout_height="wrap_content"
app:cardCornerRadius="0dp"
app:strokeColor="?attr/colorSurfaceContainer"
app:layout_constraintTop_toTopOf="parent"
app:layout_constraintLeft_toLeftOf="parent"
app:layout_constraintRight_toRightOf="parent">
<ImageView
android:id="@+id/image_view"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:minHeight="80dp"
android:backgroundTint="?attr/colorSurfaceContainer"
android:contentDescription="@string/loading"
android:visibility="visible"
/>
</com.google.android.material.card.MaterialCardView>
<TextView
android:id="@+id/tv_title"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:maxLines="3"
android:ellipsize="end"
android:text="@string/app_name"
android:textSize="14sp"
android:textStyle="bold"
android:layout_marginHorizontal="8dp"
android:paddingTop="4dp"
app:layout_constraintTop_toBottomOf="@+id/cd_img"
app:layout_constraintLeft_toLeftOf="parent"
app:layout_constraintRight_toRightOf="parent" />
<TextView
android:id="@+id/tv_pub_date"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:text="@string/app_name"
android:textSize="11sp"
android:paddingTop="4dp"
android:paddingBottom="10dp"
android:layout_marginHorizontal="8dp"
app:layout_constraintTop_toBottomOf="@+id/tv_title"
app:layout_constraintLeft_toLeftOf="parent"
app:layout_constraintRight_toRightOf="parent"
tools:ignore="SmallSp" />
</androidx.constraintlayout.widget.ConstraintLayout>
</com.google.android.material.card.MaterialCardView>
@@ -1,23 +0,0 @@
<?xml version="1.0" encoding="utf-8"?>
<menu xmlns:android="http://schemas.android.com/apk/res/android">
<group android:checkableBehavior="single">
<item
android:id="@+id/menu_redirect_allow_all"
android:title="@string/redirect_allow_all" />
<item
android:id="@+id/menu_redirect_ask_always"
android:title="@string/redirect_ask_always" />
<item
android:id="@+id/menu_redirect_ask_cross_origin"
android:title="@string/redirect_ask_cross_origin" />
<item
android:id="@+id/menu_redirect_ask_same_domain_block_cross"
android:title="@string/redirect_ask_same_domain_block_cross" />
<item
android:id="@+id/menu_redirect_block_cross_origin"
android:title="@string/redirect_block_cross_origin" />
<item
android:id="@+id/menu_redirect_block_all"
android:title="@string/redirect_block_all" />
</group>
</menu>
-45
View File
@@ -1,45 +0,0 @@
<?xml version="1.0" encoding="utf-8"?>
<menu xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto">
<item
android:id="@+id/menu_login"
android:title="@string/login"
app:showAsAction="never" />
<item
android:id="@+id/menu_refresh_sort"
android:title="@string/refresh_sort"
app:showAsAction="never" />
<item
android:id="@+id/menu_set_source_variable"
android:title="@string/set_source_variable"
app:showAsAction="never" />
<item
android:id="@+id/menu_edit_source"
android:title="@string/edit_source"
app:showAsAction="never" />
<item
android:id="@+id/menu_switch_layout"
android:title="@string/switchLayout"
app:showAsAction="never" />
<item
android:id="@+id/menu_read_record"
android:title="@string/read_record"
app:showAsAction="never" />
<item
android:id="@+id/menu_clear"
android:title="@string/clear"
app:showAsAction="never" />
<item
android:id="@+id/menu_redirect_policy"
android:title="@string/redirect_policy"
app:showAsAction="never" />
</menu>
-51
View File
@@ -1,51 +0,0 @@
<?xml version="1.0" encoding="utf-8"?>
<menu xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
xmlns:tools="http://schemas.android.com/tools">
<item
android:id="@+id/menu_rss_refresh"
android:title="@string/refresh"
android:icon="@drawable/ic_refresh"
app:showAsAction="always" />
<item
android:id="@+id/menu_rss_star"
android:title="@string/favorite"
android:icon="@drawable/ic_star"
app:showAsAction="always" />
<item
android:id="@+id/menu_full_screen"
android:icon="@drawable/ic_fullscreen"
android:title="@string/full_screen"
app:showAsAction="always"
tools:ignore="AlwaysShowAction" />
<item
android:id="@+id/menu_share_it"
android:title="@string/share"
android:icon="@drawable/ic_share"
app:showAsAction="ifRoom" />
<item
android:id="@+id/menu_aloud"
android:title="@string/read_aloud"
android:icon="@drawable/ic_volume_up"
app:showAsAction="ifRoom" />
<item
android:id="@+id/menu_login"
android:title="@string/login"
app:showAsAction="never" />
<item
android:id="@+id/menu_redirect_policy"
android:title="@string/redirect_policy"
app:showAsAction="never" />
<item
android:id="@+id/menu_browser_open"
android:title="@string/open_in_browser"
app:showAsAction="never" />
</menu>
-12
View File
@@ -1,12 +0,0 @@
<?xml version="1.0" encoding="utf-8"?>
<menu xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
xmlns:tools="http://schemas.android.com/tools"
tools:ignore="AlwaysShowAction">
<item
android:id="@+id/menu_clear"
android:title="@string/clear"
app:showAsAction="always" />
</menu>