├── app
├── .gitignore
├── libs
│ └── rhino-1.7.9.jar
├── src
│ └── main
│ │ ├── java
│ │ └── cn
│ │ │ └── lightink
│ │ │ └── reader
│ │ │ ├── ktx
│ │ │ ├── CollectionExtensions.kt
│ │ │ ├── ResponseExtensions.kt
│ │ │ ├── FragmentExtensions.kt
│ │ │ ├── PointExtensions.kt
│ │ │ ├── ColorExtensions.kt
│ │ │ ├── ByteArrayExtensions.kt
│ │ │ ├── RecyclerViewExtensions.kt
│ │ │ ├── AnyExtensios.kt
│ │ │ ├── ActivityExtensions.kt
│ │ │ └── ElementExtensions.kt
│ │ │ ├── ui
│ │ │ ├── base
│ │ │ │ ├── LifecycleFragment.kt
│ │ │ │ ├── WarningMessageDialog.kt
│ │ │ │ └── SimpleDialog.kt
│ │ │ ├── book
│ │ │ │ └── BookDeleteDialog.kt
│ │ │ ├── discover
│ │ │ │ └── help
│ │ │ │ │ ├── FeedHelpFragment.kt
│ │ │ │ │ └── BookshelfHelpFragment.kt
│ │ │ └── booksource
│ │ │ │ ├── BookSourceScoreDialog.kt
│ │ │ │ └── BookSourcePurifyActivity.kt
│ │ │ ├── module
│ │ │ ├── SessionModule.kt
│ │ │ ├── NetworkModule.kt
│ │ │ ├── SearchModule.kt
│ │ │ ├── UIModule.kt
│ │ │ └── GlobalModule.kt
│ │ │ ├── widget
│ │ │ ├── LightinkWebView.kt
│ │ │ ├── BoldTextView.kt
│ │ │ ├── FlexSeekBar.kt
│ │ │ ├── ImeEditText.kt
│ │ │ └── StateImageView.kt
│ │ │ ├── transcode
│ │ │ ├── entity
│ │ │ │ └── TranscodeException.kt
│ │ │ ├── ktx
│ │ │ │ └── Extensions.kt
│ │ │ ├── Console.kt
│ │ │ └── DependenciesManager.kt
│ │ │ └── model
│ │ │ ├── ResultModel.kt
│ │ │ ├── OtherModel.kt
│ │ │ ├── ChannelModel.kt
│ │ │ ├── TXTConvertModel.kt
│ │ │ ├── StorageModel.kt
│ │ │ └── BookRankModel.kt
│ │ ├── res
│ │ ├── values
│ │ │ ├── ids.xml
│ │ │ ├── string-profile.xml
│ │ │ ├── string-bookshelf.xml
│ │ │ ├── string-booksource.xml
│ │ │ ├── string-read.xml
│ │ │ ├── styles.xml
│ │ │ ├── colors.xml
│ │ │ ├── styles-widget.xml
│ │ │ └── string-feed.xml
│ │ ├── drawable
│ │ │ ├── help1.png
│ │ │ ├── help2.png
│ │ │ ├── selected_background_borderless_none.xml
│ │ │ ├── bg_circle.xml
│ │ │ ├── selected_background_borderless.xml
│ │ │ ├── selected_background_borderless_action.xml
│ │ │ ├── bg_book_state_checked.xml
│ │ │ ├── ic_input_cursor.xml
│ │ │ ├── bg_dialog_round.xml
│ │ │ ├── bg_popup_menu.xml
│ │ │ ├── bg_card_view.xml
│ │ │ ├── bg_card_round.xml
│ │ │ ├── bg_card.xml
│ │ │ ├── ic_book_check.xml
│ │ │ ├── bg_divider_item_decoration.xml
│ │ │ ├── btn_stroke.xml
│ │ │ ├── ic_check_love_box.xml
│ │ │ ├── btn_stroke_round.xml
│ │ │ ├── dialog_material_background.xml
│ │ │ ├── ic_sort_descending.xml
│ │ │ ├── bg_seek_text.xml
│ │ │ ├── bg_bottom_sheet.xml
│ │ │ ├── bg_refresh_header.xml
│ │ │ ├── bg_book_state_update.xml
│ │ │ ├── selected_background_fill.xml
│ │ │ ├── bg_tag_stroke.xml
│ │ │ ├── btn_stroke_disable_round.xml
│ │ │ ├── btn_stroke_enable_round.xml
│ │ │ ├── ic_memory_font.xml
│ │ │ ├── selected_background.xml
│ │ │ ├── bg_selectable_item_transparent.xml
│ │ │ ├── ic_check.xml
│ │ │ ├── ic_reader_font.xml
│ │ │ ├── selected_background_menu.xml
│ │ │ ├── selected_background_borderless_fill.xml
│ │ │ ├── ic_reader_setting_title.xml
│ │ │ ├── ic_check_box.xml
│ │ │ ├── ic_reader_location.xml
│ │ │ ├── selected_foreground.xml
│ │ │ ├── ic_arrow_right.xml
│ │ │ ├── ic_back.xml
│ │ │ ├── ic_check_line.xml
│ │ │ ├── ic_feed_group.xml
│ │ │ ├── ic_feed_menu.xml
│ │ │ ├── ic_reader_line.xml
│ │ │ ├── ic_arrow_down.xml
│ │ │ ├── ic_memory_book.xml
│ │ │ ├── ic_submit.xml
│ │ │ ├── ic_notification_stop.xml
│ │ │ ├── selected_foreground_round.xml
│ │ │ ├── ic_download.xml
│ │ │ ├── ic_check_download.xml
│ │ │ ├── ic_pushpin_cancel.xml
│ │ │ ├── ic_reader_cache.xml
│ │ │ ├── ic_checkbox_blank.xml
│ │ │ ├── ic_color_picker_reset.xml
│ │ │ ├── ic_listen_voice.xml
│ │ │ ├── ic_reader_first_line_indent.xml
│ │ │ ├── ic_memory_image.xml
│ │ │ ├── ic_notification_play.xml
│ │ │ ├── ic_dashboard_bookshelf_drawer.xml
│ │ │ ├── ic_reader_font_size.xml
│ │ │ ├── ic_memory_so.xml
│ │ │ ├── ic_reader_setting_time.xml
│ │ │ ├── selected_btn_sign.xml
│ │ │ ├── ic_delete.xml
│ │ │ ├── bg_fast_scroll.xml
│ │ │ ├── ic_web.xml
│ │ │ ├── ic_move.xml
│ │ │ ├── launch_screen.xml
│ │ │ ├── ic_reader_turn_vertical.xml
│ │ │ ├── bg_switch_thumb.xml
│ │ │ ├── ic_reader_book_source.xml
│ │ │ ├── ic_reader_font_bold.xml
│ │ │ ├── ic_edit.xml
│ │ │ ├── ic_reader_purify.xml
│ │ │ ├── ic_more.xml
│ │ │ ├── ic_reader_mipmap_follow.xml
│ │ │ ├── ic_reader_pull_bookmark.xml
│ │ │ ├── ic_settings.xml
│ │ │ ├── ic_action_add.xml
│ │ │ ├── ic_dashboard_bookshelf_drawer_opened.xml
│ │ │ ├── ic_reader_long_clickable.xml
│ │ │ ├── ic_memory_database.xml
│ │ │ ├── ic_forward.xml
│ │ │ ├── ic_reader_next_only.xml
│ │ │ ├── ic_login.xml
│ │ │ ├── ic_reader_dormant.xml
│ │ │ ├── ic_color_picker_tag.xml
│ │ │ ├── ic_check_loved.xml
│ │ │ ├── ic_loved.xml
│ │ │ ├── ic_flow_loved.xml
│ │ │ ├── ic_love.xml
│ │ │ ├── ic_check_love.xml
│ │ │ ├── ic_score.xml
│ │ │ ├── btn_stroke_control.xml
│ │ │ ├── ic_notification_timer.xml
│ │ │ ├── drawable_banner_point.xml
│ │ │ ├── ic_action_more.xml
│ │ │ ├── ic_reader_status_bar.xml
│ │ │ ├── ic_purify.xml
│ │ │ ├── ic_reader_navigation_bar.xml
│ │ │ ├── ic_reader_theme.xml
│ │ │ ├── ic_ticket_all.xml
│ │ │ ├── ic_pushpin.xml
│ │ │ ├── ic_reader_notch_bar.xml
│ │ │ ├── ic_sort_ascending.xml
│ │ │ ├── ic_sort_descending_enable.xml
│ │ │ ├── ic_search_line.xml
│ │ │ ├── ic_sort_descending_disable.xml
│ │ │ ├── ic_reader_turn_volume.xml
│ │ │ ├── ic_check_checked.xml
│ │ │ ├── ic_check_box_checked.xml
│ │ │ ├── ic_reader_brightness.xml
│ │ │ ├── ic_bookmark_pull.xml
│ │ │ ├── ic_check_box_checked_disable.xml
│ │ │ ├── btn_stroke_secondary.xml
│ │ │ ├── ic_response_speed_1.xml
│ │ │ ├── ic_response_speed_2.xml
│ │ │ ├── ic_response_speed_3.xml
│ │ │ ├── ic_tips_close.xml
│ │ │ ├── ic_check_box_normal.xml
│ │ │ ├── ic_check_normal.xml
│ │ │ ├── ic_ticket_single.xml
│ │ │ ├── bg_switch_background.xml
│ │ │ ├── ic_book_rank_touch.xml
│ │ │ ├── ic_shutdown.xml
│ │ │ ├── ic_list_settings.xml
│ │ │ ├── bg_seek_progress.xml
│ │ │ ├── ic_option_image.xml
│ │ │ ├── ic_discover_booksource.xml
│ │ │ ├── ic_book_uncheck.xml
│ │ │ ├── ic_action_create.xml
│ │ │ ├── ic_bookmark.xml
│ │ │ ├── ic_action_send.xml
│ │ │ ├── ic_unsubscirbe.xml
│ │ │ ├── ic_reader_night.xml
│ │ │ ├── ic_action_search.xml
│ │ │ ├── ic_battery_charging.xml
│ │ │ ├── ic_notification_pause.xml
│ │ │ ├── ic_option_search.xml
│ │ │ ├── ic_battery_100.xml
│ │ │ ├── ic_battery_20.xml
│ │ │ ├── ic_battery_40.xml
│ │ │ ├── ic_battery_60.xml
│ │ │ ├── ic_battery_80.xml
│ │ │ ├── ic_refresh_header_arrow.xml
│ │ │ ├── ic_battery_0.xml
│ │ │ ├── ic_book_checked.xml
│ │ │ ├── ic_reader_click_animate.xml
│ │ │ ├── ic_reader_listen.xml
│ │ │ ├── ic_discover_forum.xml
│ │ │ ├── ic_book_summary_settings.xml
│ │ │ ├── ic_chapter_on_cloud.xml
│ │ │ ├── ic_discover_rss.xml
│ │ │ ├── ic_discover_rank.xml
│ │ │ ├── ic_menu_edit.xml
│ │ │ ├── ic_reader_day.xml
│ │ │ └── ic_action_user_logon.xml
│ │ ├── drawable-xhdpi
│ │ │ └── rss_none.jpg
│ │ ├── mipmap-hdpi
│ │ │ └── ic_launcher.png
│ │ ├── mipmap-ldpi
│ │ │ └── ic_launcher.png
│ │ ├── mipmap-mdpi
│ │ │ └── ic_launcher.png
│ │ ├── mipmap-xhdpi
│ │ │ ├── ic_launcher.png
│ │ │ └── ic_notification.webp
│ │ ├── mipmap-xxhdpi
│ │ │ └── ic_launcher.png
│ │ ├── mipmap-xxxhdpi
│ │ │ └── ic_launcher.png
│ │ ├── mipmap-night-xxxhdpi
│ │ │ └── favicon.webp
│ │ ├── values-sw390dp
│ │ │ └── dimens.xml
│ │ ├── anim
│ │ │ ├── popup_hide.xml
│ │ │ └── popup_show.xml
│ │ ├── color
│ │ │ ├── color_check_box.xml
│ │ │ ├── color_tab_text.xml
│ │ │ ├── color_toggle_text.xml
│ │ │ ├── color_indicator.xml
│ │ │ ├── color_toggle.xml
│ │ │ ├── color_enable.xml
│ │ │ └── color_read.xml
│ │ ├── transition
│ │ │ ├── slide_hide_bottom.xml
│ │ │ └── slide_show_bottom.xml
│ │ ├── layout
│ │ │ ├── item_page_article_vertical.xml
│ │ │ ├── view_progress_bar.xml
│ │ │ ├── activity_flow.xml
│ │ │ ├── item_page_booklet.xml
│ │ │ ├── item_book_cover.xml
│ │ │ ├── activity_main.xml
│ │ │ ├── item_page_illustration.xml
│ │ │ ├── activity_book_source_auth.xml
│ │ │ ├── fragment_feed.xml
│ │ │ ├── fragment_reader_more.xml
│ │ │ ├── item_bottom_selector.xml
│ │ │ ├── item_book_detail_chapter.xml
│ │ │ ├── item_local_book.xml
│ │ │ ├── item_popup.xml
│ │ │ ├── item_search_history.xml
│ │ │ ├── item_feed_group.xml
│ │ │ ├── activity_book_rank_settings.xml
│ │ │ ├── item_chapter_checkable.xml
│ │ │ ├── item_dashboard_book.xml
│ │ │ ├── activity_feed_management.xml
│ │ │ ├── item_book_rank_group.xml
│ │ │ ├── layout_tab_item.xml
│ │ │ ├── activity_open_source.xml
│ │ │ ├── layout_tab_item2.xml
│ │ │ ├── popup_reader_preview.xml
│ │ │ ├── activity_book_source_purify.xml
│ │ │ ├── item_catalog_chapter.xml
│ │ │ ├── item_feed_management.xml
│ │ │ ├── item_action.xml
│ │ │ ├── item_book_manager.xml
│ │ │ ├── activity_reader_change_book_source.xml
│ │ │ ├── item_open_source.xml
│ │ │ ├── activity_book_cover.xml
│ │ │ ├── item_bookmark.xml
│ │ │ ├── item_banner.xml
│ │ │ ├── dialog_reader_theme.xml
│ │ │ ├── item_purify.xml
│ │ │ ├── item_book_detail_source.xml
│ │ │ ├── item_theme_action.xml
│ │ │ ├── activity_book_summary.xml
│ │ │ ├── layout_bookmark_header.xml
│ │ │ ├── dialog_reader_book_source.xml
│ │ │ └── activity_help.xml
│ │ ├── menu
│ │ │ ├── web.xml
│ │ │ ├── add.xml
│ │ │ ├── manage.xml
│ │ │ ├── more.xml
│ │ │ ├── list_settings.xml
│ │ │ ├── forum.xml
│ │ │ └── sort.xml
│ │ ├── drawable-night
│ │ │ └── launch_screen.xml
│ │ ├── xml-v25
│ │ │ └── shortcuts.xml
│ │ └── values-night
│ │ │ ├── styles.xml
│ │ │ └── colors.xml
│ │ └── assets
│ │ ├── web
│ │ ├── favicon.ico
│ │ ├── img
│ │ │ └── logo.2e067ce0.png
│ │ ├── fonts
│ │ │ ├── element-icons.732389de.ttf
│ │ │ └── element-icons.535877f5.woff
│ │ └── index.html
│ │ └── fonts
│ │ ├── SourceHanSans.ttf
│ │ ├── SourceHanSerif.ttf
│ │ └── YangRenDongZhuShi.ttf
└── release
│ └── output-metadata.json
├── settings.gradle
├── key.jks
├── gradle
└── wrapper
│ ├── gradle-wrapper.jar
│ └── gradle-wrapper.properties
├── README.md
├── .gitignore
└── gradle.properties
/app/.gitignore:
--------------------------------------------------------------------------------
1 | /build
2 |
--------------------------------------------------------------------------------
/settings.gradle:
--------------------------------------------------------------------------------
1 | include ':app'
2 |
--------------------------------------------------------------------------------
/key.jks:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/wizos/lightink/HEAD/key.jks
--------------------------------------------------------------------------------
/app/libs/rhino-1.7.9.jar:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/wizos/lightink/HEAD/app/libs/rhino-1.7.9.jar
--------------------------------------------------------------------------------
/app/src/main/java/cn/lightink/reader/ktx/CollectionExtensions.kt:
--------------------------------------------------------------------------------
1 | package cn.lightink.reader.ktx
2 |
3 |
--------------------------------------------------------------------------------
/app/src/main/res/values/ids.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
--------------------------------------------------------------------------------
/gradle/wrapper/gradle-wrapper.jar:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/wizos/lightink/HEAD/gradle/wrapper/gradle-wrapper.jar
--------------------------------------------------------------------------------
/app/src/main/assets/web/favicon.ico:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/wizos/lightink/HEAD/app/src/main/assets/web/favicon.ico
--------------------------------------------------------------------------------
/app/src/main/res/drawable/help1.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/wizos/lightink/HEAD/app/src/main/res/drawable/help1.png
--------------------------------------------------------------------------------
/app/src/main/res/drawable/help2.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/wizos/lightink/HEAD/app/src/main/res/drawable/help2.png
--------------------------------------------------------------------------------
/app/src/main/assets/fonts/SourceHanSans.ttf:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/wizos/lightink/HEAD/app/src/main/assets/fonts/SourceHanSans.ttf
--------------------------------------------------------------------------------
/app/src/main/assets/fonts/SourceHanSerif.ttf:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/wizos/lightink/HEAD/app/src/main/assets/fonts/SourceHanSerif.ttf
--------------------------------------------------------------------------------
/app/src/main/res/drawable-xhdpi/rss_none.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/wizos/lightink/HEAD/app/src/main/res/drawable-xhdpi/rss_none.jpg
--------------------------------------------------------------------------------
/app/src/main/res/mipmap-hdpi/ic_launcher.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/wizos/lightink/HEAD/app/src/main/res/mipmap-hdpi/ic_launcher.png
--------------------------------------------------------------------------------
/app/src/main/res/mipmap-ldpi/ic_launcher.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/wizos/lightink/HEAD/app/src/main/res/mipmap-ldpi/ic_launcher.png
--------------------------------------------------------------------------------
/app/src/main/res/mipmap-mdpi/ic_launcher.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/wizos/lightink/HEAD/app/src/main/res/mipmap-mdpi/ic_launcher.png
--------------------------------------------------------------------------------
/app/src/main/res/values/string-profile.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
--------------------------------------------------------------------------------
/app/src/main/assets/web/img/logo.2e067ce0.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/wizos/lightink/HEAD/app/src/main/assets/web/img/logo.2e067ce0.png
--------------------------------------------------------------------------------
/app/src/main/res/mipmap-xhdpi/ic_launcher.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/wizos/lightink/HEAD/app/src/main/res/mipmap-xhdpi/ic_launcher.png
--------------------------------------------------------------------------------
/app/src/main/res/mipmap-xxhdpi/ic_launcher.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/wizos/lightink/HEAD/app/src/main/res/mipmap-xxhdpi/ic_launcher.png
--------------------------------------------------------------------------------
/app/src/main/assets/fonts/YangRenDongZhuShi.ttf:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/wizos/lightink/HEAD/app/src/main/assets/fonts/YangRenDongZhuShi.ttf
--------------------------------------------------------------------------------
/app/src/main/res/mipmap-xxxhdpi/ic_launcher.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/wizos/lightink/HEAD/app/src/main/res/mipmap-xxxhdpi/ic_launcher.png
--------------------------------------------------------------------------------
/app/src/main/res/mipmap-night-xxxhdpi/favicon.webp:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/wizos/lightink/HEAD/app/src/main/res/mipmap-night-xxxhdpi/favicon.webp
--------------------------------------------------------------------------------
/app/src/main/res/mipmap-xhdpi/ic_notification.webp:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/wizos/lightink/HEAD/app/src/main/res/mipmap-xhdpi/ic_notification.webp
--------------------------------------------------------------------------------
/app/src/main/assets/web/fonts/element-icons.732389de.ttf:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/wizos/lightink/HEAD/app/src/main/assets/web/fonts/element-icons.732389de.ttf
--------------------------------------------------------------------------------
/app/src/main/assets/web/fonts/element-icons.535877f5.woff:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/wizos/lightink/HEAD/app/src/main/assets/web/fonts/element-icons.535877f5.woff
--------------------------------------------------------------------------------
/app/src/main/res/values-sw390dp/dimens.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 | 24dp
4 |
--------------------------------------------------------------------------------
/app/src/main/java/cn/lightink/reader/ui/base/LifecycleFragment.kt:
--------------------------------------------------------------------------------
1 | package cn.lightink.reader.ui.base
2 |
3 | import androidx.fragment.app.Fragment
4 |
5 | abstract class LifecycleFragment : Fragment()
--------------------------------------------------------------------------------
/app/src/main/java/cn/lightink/reader/ktx/ResponseExtensions.kt:
--------------------------------------------------------------------------------
1 | package cn.lightink.reader.ktx
2 |
3 | import okhttp3.Response
4 |
5 | //请求地址
6 | val Response.url: String
7 | get() = request.url.toString()
--------------------------------------------------------------------------------
/app/src/main/res/drawable/selected_background_borderless_none.xml:
--------------------------------------------------------------------------------
1 |
2 |
--------------------------------------------------------------------------------
/app/src/main/res/drawable/bg_circle.xml:
--------------------------------------------------------------------------------
1 |
2 |
4 |
5 |
--------------------------------------------------------------------------------
/app/src/main/res/drawable/selected_background_borderless.xml:
--------------------------------------------------------------------------------
1 |
2 |
--------------------------------------------------------------------------------
/app/src/main/java/cn/lightink/reader/module/SessionModule.kt:
--------------------------------------------------------------------------------
1 | package cn.lightink.reader.module
2 |
3 | import cn.lightink.reader.ktx.md5
4 |
5 | object Session {
6 |
7 | fun uuid() = Preferences.get(Preferences.Key.UUID, EMPTY).md5()
8 |
9 | }
--------------------------------------------------------------------------------
/app/src/main/res/drawable/selected_background_borderless_action.xml:
--------------------------------------------------------------------------------
1 |
2 |
--------------------------------------------------------------------------------
/app/src/main/res/drawable/bg_book_state_checked.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
--------------------------------------------------------------------------------
/app/src/main/res/drawable/ic_input_cursor.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
--------------------------------------------------------------------------------
/app/src/main/res/drawable/bg_dialog_round.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
--------------------------------------------------------------------------------
/app/src/main/res/drawable/bg_popup_menu.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
--------------------------------------------------------------------------------
/app/src/main/res/drawable/bg_card_view.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
--------------------------------------------------------------------------------
/app/src/main/java/cn/lightink/reader/ktx/FragmentExtensions.kt:
--------------------------------------------------------------------------------
1 | package cn.lightink.reader.ktx
2 |
3 | import androidx.fragment.app.Fragment
4 | import kotlin.reflect.KClass
5 |
6 | fun Fragment.startActivity(target: KClass<*>) {
7 | activity?.startActivity(target)
8 | }
--------------------------------------------------------------------------------
/app/src/main/res/anim/popup_hide.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
7 |
--------------------------------------------------------------------------------
/app/src/main/res/anim/popup_show.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
7 |
--------------------------------------------------------------------------------
/app/src/main/res/drawable/bg_card_round.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
--------------------------------------------------------------------------------
/app/src/main/res/drawable/bg_card.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
--------------------------------------------------------------------------------
/app/src/main/res/drawable/ic_book_check.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
--------------------------------------------------------------------------------
/app/src/main/res/drawable/bg_divider_item_decoration.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
--------------------------------------------------------------------------------
/app/src/main/res/drawable/btn_stroke.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
--------------------------------------------------------------------------------
/app/src/main/res/drawable/ic_check_love_box.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
--------------------------------------------------------------------------------
/gradle/wrapper/gradle-wrapper.properties:
--------------------------------------------------------------------------------
1 | #Mon Apr 25 00:55:31 CST 2022
2 | distributionBase=GRADLE_USER_HOME
3 | distributionUrl=https\://services.gradle.org/distributions/gradle-7.2-bin.zip
4 | distributionPath=wrapper/dists
5 | zipStorePath=wrapper/dists
6 | zipStoreBase=GRADLE_USER_HOME
7 |
--------------------------------------------------------------------------------
/app/src/main/res/color/color_check_box.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
--------------------------------------------------------------------------------
/app/src/main/res/color/color_tab_text.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
--------------------------------------------------------------------------------
/app/src/main/res/drawable/btn_stroke_round.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
--------------------------------------------------------------------------------
/app/src/main/res/drawable/dialog_material_background.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
--------------------------------------------------------------------------------
/app/src/main/res/transition/slide_hide_bottom.xml:
--------------------------------------------------------------------------------
1 |
2 |
--------------------------------------------------------------------------------
/app/src/main/res/transition/slide_show_bottom.xml:
--------------------------------------------------------------------------------
1 |
2 |
--------------------------------------------------------------------------------
/app/src/main/res/color/color_toggle_text.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
--------------------------------------------------------------------------------
/app/src/main/res/color/color_indicator.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
--------------------------------------------------------------------------------
/app/src/main/res/drawable/ic_sort_descending.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
--------------------------------------------------------------------------------
/app/src/main/res/color/color_toggle.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
--------------------------------------------------------------------------------
/app/src/main/res/drawable/bg_seek_text.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
6 |
7 |
--------------------------------------------------------------------------------
/app/src/main/res/drawable/bg_bottom_sheet.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
7 |
--------------------------------------------------------------------------------
/app/src/main/java/cn/lightink/reader/widget/LightinkWebView.kt:
--------------------------------------------------------------------------------
1 | package cn.lightink.reader.widget
2 |
3 | import android.content.Context
4 | import android.util.AttributeSet
5 | import android.webkit.WebView
6 |
7 | class LightinkWebView @JvmOverloads constructor(context: Context, attrs: AttributeSet? = null) : WebView(context, attrs)
--------------------------------------------------------------------------------
/app/src/main/res/drawable/bg_refresh_header.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
7 |
--------------------------------------------------------------------------------
/app/src/main/res/layout/item_page_article_vertical.xml:
--------------------------------------------------------------------------------
1 |
2 |
--------------------------------------------------------------------------------
/app/src/main/res/menu/web.xml:
--------------------------------------------------------------------------------
1 |
2 |
--------------------------------------------------------------------------------
/app/src/main/java/cn/lightink/reader/ktx/PointExtensions.kt:
--------------------------------------------------------------------------------
1 | package cn.lightink.reader.ktx
2 |
3 | import android.graphics.PointF
4 | import kotlin.math.abs
5 |
6 | /**
7 | * 判断2个点是否不同
8 | */
9 | fun PointF.equal(x: Float, y: Float, basis: Int) : Boolean {
10 | return abs(this.x - x) < basis && abs(this.y - y) < basis
11 | }
--------------------------------------------------------------------------------
/app/src/main/res/layout/view_progress_bar.xml:
--------------------------------------------------------------------------------
1 |
2 |
--------------------------------------------------------------------------------
/app/src/main/res/drawable/bg_book_state_update.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
7 |
8 |
--------------------------------------------------------------------------------
/app/src/main/res/menu/add.xml:
--------------------------------------------------------------------------------
1 |
2 |
--------------------------------------------------------------------------------
/app/src/main/res/menu/manage.xml:
--------------------------------------------------------------------------------
1 |
2 |
--------------------------------------------------------------------------------
/app/src/main/res/menu/more.xml:
--------------------------------------------------------------------------------
1 |
2 |
--------------------------------------------------------------------------------
/app/src/main/res/drawable/selected_background_fill.xml:
--------------------------------------------------------------------------------
1 |
2 |
4 | -
5 |
6 |
7 |
8 |
9 |
--------------------------------------------------------------------------------
/app/src/main/res/menu/list_settings.xml:
--------------------------------------------------------------------------------
1 |
2 |
--------------------------------------------------------------------------------
/app/src/main/res/menu/forum.xml:
--------------------------------------------------------------------------------
1 |
2 |
--------------------------------------------------------------------------------
/app/src/main/res/drawable/bg_tag_stroke.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
7 |
8 |
--------------------------------------------------------------------------------
/app/src/main/res/drawable/btn_stroke_disable_round.xml:
--------------------------------------------------------------------------------
1 |
3 | -
4 |
5 |
6 |
7 |
8 |
9 |
--------------------------------------------------------------------------------
/app/src/main/res/drawable/btn_stroke_enable_round.xml:
--------------------------------------------------------------------------------
1 |
3 | -
4 |
5 |
6 |
7 |
8 |
9 |
--------------------------------------------------------------------------------
/app/src/main/res/drawable/ic_memory_font.xml:
--------------------------------------------------------------------------------
1 |
3 |
4 |
5 |
--------------------------------------------------------------------------------
/app/src/main/res/drawable/selected_background.xml:
--------------------------------------------------------------------------------
1 |
2 |
4 |
5 |
8 |
--------------------------------------------------------------------------------
/app/src/main/res/drawable/bg_selectable_item_transparent.xml:
--------------------------------------------------------------------------------
1 |
2 |
4 |
5 |
8 |
--------------------------------------------------------------------------------
/app/src/main/res/drawable/ic_check.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
--------------------------------------------------------------------------------
/app/src/main/res/drawable/ic_reader_font.xml:
--------------------------------------------------------------------------------
1 |
6 |
9 |
10 |
--------------------------------------------------------------------------------
/app/src/main/res/color/color_enable.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
--------------------------------------------------------------------------------
/app/src/main/res/color/color_read.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
--------------------------------------------------------------------------------
/app/src/main/res/drawable/selected_background_menu.xml:
--------------------------------------------------------------------------------
1 |
2 |
4 | -
5 |
6 |
7 |
8 |
9 |
--------------------------------------------------------------------------------
/app/src/main/res/layout/activity_flow.xml:
--------------------------------------------------------------------------------
1 |
2 |
--------------------------------------------------------------------------------
/app/src/main/java/cn/lightink/reader/ktx/ColorExtensions.kt:
--------------------------------------------------------------------------------
1 | package cn.lightink.reader.ktx
2 |
3 | import android.content.res.ColorStateList
4 | import android.graphics.Color
5 |
6 | /**
7 | * 颜色透明度
8 | */
9 | fun Int.alpha(alpha: Int) = Color.argb(alpha, Color.red(this), Color.green(this), Color.blue(this))
10 |
11 | fun Int.toColorStateList() = ColorStateList.valueOf(this)
--------------------------------------------------------------------------------
/app/src/main/java/cn/lightink/reader/transcode/entity/TranscodeException.kt:
--------------------------------------------------------------------------------
1 | package cn.lightink.reader.transcode.entity
2 |
3 | import kotlinx.serialization.Serializable
4 |
5 | /**
6 | * 错误信息
7 | * @property code 错误号
8 | * @property message 消息
9 | */
10 | @Serializable
11 | data class TranscodeException(val code: Int, override val message: String) : kotlin.Exception(message)
--------------------------------------------------------------------------------
/app/src/main/res/drawable/selected_background_borderless_fill.xml:
--------------------------------------------------------------------------------
1 |
2 |
4 | -
5 |
6 |
7 |
8 |
9 |
--------------------------------------------------------------------------------
/app/src/main/res/drawable/ic_reader_setting_title.xml:
--------------------------------------------------------------------------------
1 |
6 |
9 |
10 |
--------------------------------------------------------------------------------
/app/src/main/res/drawable/ic_check_box.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
--------------------------------------------------------------------------------
/app/src/main/res/drawable/ic_reader_location.xml:
--------------------------------------------------------------------------------
1 |
3 |
4 |
5 |
--------------------------------------------------------------------------------
/app/src/main/java/cn/lightink/reader/model/ResultModel.kt:
--------------------------------------------------------------------------------
1 | package cn.lightink.reader.model
2 |
3 | /**
4 | * Http Client 请求结果
5 | */
6 | data class Result(val code: Int, val data: T?, val message: String) {
7 |
8 | val isSuccessful: Boolean
9 | get() = code in 200..299
10 |
11 | }
12 |
13 | /**
14 | * 设置
15 | */
16 | data class SettingsResponse(val version: Long, val config: String)
--------------------------------------------------------------------------------
/app/src/main/res/drawable/selected_foreground.xml:
--------------------------------------------------------------------------------
1 |
2 |
4 |
5 | -
6 |
7 |
8 |
9 |
10 |
11 |
--------------------------------------------------------------------------------
/app/src/main/res/drawable/ic_arrow_right.xml:
--------------------------------------------------------------------------------
1 |
6 |
9 |
10 |
--------------------------------------------------------------------------------
/app/src/main/res/drawable/ic_back.xml:
--------------------------------------------------------------------------------
1 |
6 |
9 |
10 |
--------------------------------------------------------------------------------
/app/src/main/res/drawable/ic_check_line.xml:
--------------------------------------------------------------------------------
1 |
6 |
9 |
10 |
--------------------------------------------------------------------------------
/app/src/main/res/drawable/ic_feed_group.xml:
--------------------------------------------------------------------------------
1 |
6 |
9 |
10 |
--------------------------------------------------------------------------------
/app/src/main/res/drawable/ic_feed_menu.xml:
--------------------------------------------------------------------------------
1 |
6 |
9 |
10 |
--------------------------------------------------------------------------------
/app/src/main/res/drawable/ic_reader_line.xml:
--------------------------------------------------------------------------------
1 |
3 |
4 |
5 |
--------------------------------------------------------------------------------
/app/src/main/res/drawable/ic_arrow_down.xml:
--------------------------------------------------------------------------------
1 |
6 |
9 |
10 |
--------------------------------------------------------------------------------
/app/src/main/res/drawable/ic_memory_book.xml:
--------------------------------------------------------------------------------
1 |
3 |
4 |
5 |
--------------------------------------------------------------------------------
/app/src/main/res/drawable/ic_submit.xml:
--------------------------------------------------------------------------------
1 |
6 |
9 |
--------------------------------------------------------------------------------
/app/src/main/res/drawable/ic_notification_stop.xml:
--------------------------------------------------------------------------------
1 |
6 |
9 |
10 |
--------------------------------------------------------------------------------
/app/src/main/res/drawable/selected_foreground_round.xml:
--------------------------------------------------------------------------------
1 |
2 |
4 |
5 | -
6 |
7 |
8 |
9 |
10 |
11 |
--------------------------------------------------------------------------------
/app/src/main/res/layout/item_page_booklet.xml:
--------------------------------------------------------------------------------
1 |
2 |
--------------------------------------------------------------------------------
/app/src/main/res/values/string-bookshelf.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 | 删除「%s」书架及书架中的全部图书
4 | 不能删除全部书架
5 | 书架已删除
6 |
7 | 书架列表
8 | 选中 %d 项
9 |
--------------------------------------------------------------------------------
/app/src/main/res/drawable/ic_download.xml:
--------------------------------------------------------------------------------
1 |
6 |
9 |
10 |
--------------------------------------------------------------------------------
/app/src/main/java/cn/lightink/reader/model/OtherModel.kt:
--------------------------------------------------------------------------------
1 | package cn.lightink.reader.model
2 |
3 | import cn.lightink.reader.module.EMPTY
4 |
5 | /**
6 | * 开源库声明
7 | * @property name 名字
8 | * @property link 链接
9 | * @property license 协议
10 | */
11 | data class OpenSource(val name: String, val link: String, val license: String)
12 |
13 | /**
14 | * 封面
15 | */
16 | data class Cover(val url: String, val author: String = EMPTY)
--------------------------------------------------------------------------------
/app/src/main/res/drawable/ic_check_download.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
--------------------------------------------------------------------------------
/app/src/main/res/drawable/ic_pushpin_cancel.xml:
--------------------------------------------------------------------------------
1 |
6 |
9 |
10 |
--------------------------------------------------------------------------------
/app/src/main/res/drawable/ic_reader_cache.xml:
--------------------------------------------------------------------------------
1 |
6 |
9 |
10 |
--------------------------------------------------------------------------------
/app/src/main/res/drawable/ic_checkbox_blank.xml:
--------------------------------------------------------------------------------
1 |
6 |
9 |
10 |
--------------------------------------------------------------------------------
/app/src/main/res/drawable/ic_color_picker_reset.xml:
--------------------------------------------------------------------------------
1 |
3 |
4 |
5 |
--------------------------------------------------------------------------------
/app/src/main/res/drawable/ic_listen_voice.xml:
--------------------------------------------------------------------------------
1 |
6 |
9 |
10 |
--------------------------------------------------------------------------------
/app/src/main/res/drawable/ic_reader_first_line_indent.xml:
--------------------------------------------------------------------------------
1 |
6 |
9 |
10 |
--------------------------------------------------------------------------------
/app/src/main/res/drawable/ic_memory_image.xml:
--------------------------------------------------------------------------------
1 |
3 |
4 |
5 |
--------------------------------------------------------------------------------
/app/src/main/res/layout/item_book_cover.xml:
--------------------------------------------------------------------------------
1 |
2 |
5 |
6 |
10 |
--------------------------------------------------------------------------------
/app/src/main/res/drawable/ic_notification_play.xml:
--------------------------------------------------------------------------------
1 |
6 |
9 |
10 |
--------------------------------------------------------------------------------
/app/src/main/res/drawable/ic_dashboard_bookshelf_drawer.xml:
--------------------------------------------------------------------------------
1 |
6 |
9 |
10 |
--------------------------------------------------------------------------------
/app/src/main/res/drawable/ic_reader_font_size.xml:
--------------------------------------------------------------------------------
1 |
3 |
4 |
5 |
--------------------------------------------------------------------------------
/app/src/main/res/drawable/ic_memory_so.xml:
--------------------------------------------------------------------------------
1 |
3 |
4 |
5 |
--------------------------------------------------------------------------------
/app/src/main/res/drawable/ic_reader_setting_time.xml:
--------------------------------------------------------------------------------
1 |
6 |
9 |
10 |
--------------------------------------------------------------------------------
/app/src/main/res/drawable/selected_btn_sign.xml:
--------------------------------------------------------------------------------
1 |
2 |
4 | -
5 |
6 |
7 |
10 |
11 |
12 |
--------------------------------------------------------------------------------
/app/release/output-metadata.json:
--------------------------------------------------------------------------------
1 | {
2 | "version": 3,
3 | "artifactType": {
4 | "type": "APK",
5 | "kind": "Directory"
6 | },
7 | "applicationId": "cn.lightink.reader",
8 | "variantName": "release",
9 | "elements": [
10 | {
11 | "type": "SINGLE",
12 | "filters": [],
13 | "attributes": [],
14 | "versionCode": 32,
15 | "versionName": "1.3.0",
16 | "outputFile": "app-release.apk"
17 | }
18 | ],
19 | "elementType": "File"
20 | }
--------------------------------------------------------------------------------
/app/src/main/res/drawable/ic_delete.xml:
--------------------------------------------------------------------------------
1 |
6 |
9 |
10 |
--------------------------------------------------------------------------------
/app/src/main/res/drawable/bg_fast_scroll.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
9 |
12 |
--------------------------------------------------------------------------------
/app/src/main/res/drawable/ic_web.xml:
--------------------------------------------------------------------------------
1 |
6 |
9 |
10 |
--------------------------------------------------------------------------------
/app/src/main/res/values/string-booksource.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 | 验证网络书源
5 | 验证完成
6 | 书源仓库网址
7 | 已安装的书源搜索无结果
8 | %d次使用
9 |
10 | 网址导入
11 |
12 |
--------------------------------------------------------------------------------
/app/src/main/res/drawable-night/launch_screen.xml:
--------------------------------------------------------------------------------
1 |
2 |
4 |
5 |
6 |
7 | -
8 |
11 |
12 |
--------------------------------------------------------------------------------
/app/src/main/res/drawable/ic_move.xml:
--------------------------------------------------------------------------------
1 |
6 |
9 |
10 |
--------------------------------------------------------------------------------
/app/src/main/res/drawable/launch_screen.xml:
--------------------------------------------------------------------------------
1 |
2 |
4 |
5 |
6 |
7 | -
8 |
11 |
12 |
--------------------------------------------------------------------------------
/app/src/main/res/drawable/ic_reader_turn_vertical.xml:
--------------------------------------------------------------------------------
1 |
6 |
9 |
10 |
--------------------------------------------------------------------------------
/app/src/main/res/layout/activity_main.xml:
--------------------------------------------------------------------------------
1 |
2 |
5 |
6 |
11 |
12 |
--------------------------------------------------------------------------------
/app/src/main/res/drawable/bg_switch_thumb.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 | -
4 |
5 |
6 |
7 |
8 | -
9 |
10 |
11 |
12 |
13 |
--------------------------------------------------------------------------------
/app/src/main/res/drawable/ic_reader_book_source.xml:
--------------------------------------------------------------------------------
1 |
6 |
9 |
10 |
--------------------------------------------------------------------------------
/app/src/main/res/drawable/ic_reader_font_bold.xml:
--------------------------------------------------------------------------------
1 |
6 |
9 |
10 |
--------------------------------------------------------------------------------
/app/src/main/java/cn/lightink/reader/model/ChannelModel.kt:
--------------------------------------------------------------------------------
1 | package cn.lightink.reader.model
2 |
3 | import android.app.NotificationManager
4 | import cn.lightink.reader.R
5 |
6 | enum class Channel(val id: String, val title: Int, val description: Int, val importance: Int) {
7 | BOOKS("BOOKS", R.string.channel_books_title, R.string.channel_books_description, NotificationManager.IMPORTANCE_LOW),
8 | MEDIA("MEDIA", R.string.channel_media_title, R.string.channel_media_description, NotificationManager.IMPORTANCE_LOW)
9 | }
--------------------------------------------------------------------------------
/app/src/main/res/drawable/ic_edit.xml:
--------------------------------------------------------------------------------
1 |
6 |
9 |
10 |
--------------------------------------------------------------------------------
/app/src/main/res/drawable/ic_reader_purify.xml:
--------------------------------------------------------------------------------
1 |
6 |
9 |
10 |
--------------------------------------------------------------------------------
/app/src/main/res/drawable/ic_more.xml:
--------------------------------------------------------------------------------
1 |
6 |
9 |
10 |
--------------------------------------------------------------------------------
/app/src/main/res/drawable/ic_reader_mipmap_follow.xml:
--------------------------------------------------------------------------------
1 |
6 |
9 |
10 |
--------------------------------------------------------------------------------
/app/src/main/res/drawable/ic_reader_pull_bookmark.xml:
--------------------------------------------------------------------------------
1 |
6 |
9 |
10 |
--------------------------------------------------------------------------------
/app/src/main/res/layout/item_page_illustration.xml:
--------------------------------------------------------------------------------
1 |
2 |
5 |
6 |
11 |
--------------------------------------------------------------------------------
/app/src/main/res/drawable/ic_settings.xml:
--------------------------------------------------------------------------------
1 |
6 |
9 |
10 |
--------------------------------------------------------------------------------
/app/src/main/res/drawable/ic_action_add.xml:
--------------------------------------------------------------------------------
1 |
6 |
9 |
12 |
13 |
--------------------------------------------------------------------------------
/app/src/main/res/drawable/ic_dashboard_bookshelf_drawer_opened.xml:
--------------------------------------------------------------------------------
1 |
6 |
9 |
10 |
--------------------------------------------------------------------------------
/app/src/main/res/drawable/ic_reader_long_clickable.xml:
--------------------------------------------------------------------------------
1 |
6 |
9 |
10 |
--------------------------------------------------------------------------------
/app/src/main/res/drawable/ic_memory_database.xml:
--------------------------------------------------------------------------------
1 |
3 |
4 |
5 |
--------------------------------------------------------------------------------
/app/src/main/res/drawable/ic_forward.xml:
--------------------------------------------------------------------------------
1 |
6 |
9 |
10 |
--------------------------------------------------------------------------------
/app/src/main/res/drawable/ic_reader_next_only.xml:
--------------------------------------------------------------------------------
1 |
3 |
4 |
5 |
--------------------------------------------------------------------------------
/app/src/main/res/layout/activity_book_source_auth.xml:
--------------------------------------------------------------------------------
1 |
2 |
8 |
9 |
13 |
14 |
--------------------------------------------------------------------------------
/app/src/main/java/cn/lightink/reader/widget/BoldTextView.kt:
--------------------------------------------------------------------------------
1 | package cn.lightink.reader.widget
2 |
3 | import android.content.Context
4 | import android.util.AttributeSet
5 | import androidx.appcompat.widget.AppCompatTextView
6 |
7 | /**
8 | * @class BoldTextView
9 | *
10 | * 画笔加粗
11 | */
12 | class BoldTextView @JvmOverloads constructor(context: Context, attrs: AttributeSet? = null, defStyleAttr: Int = 0) : AppCompatTextView(context, attrs, defStyleAttr) {
13 | init {
14 | paint.isFakeBoldText = true
15 | includeFontPadding = false
16 | }
17 | }
--------------------------------------------------------------------------------
/app/src/main/res/drawable/ic_login.xml:
--------------------------------------------------------------------------------
1 |
6 |
9 |
10 |
--------------------------------------------------------------------------------
/app/src/main/java/cn/lightink/reader/ktx/ByteArrayExtensions.kt:
--------------------------------------------------------------------------------
1 | package cn.lightink.reader.ktx
2 |
3 | import cn.lightink.reader.module.EMPTY
4 | import org.mozilla.universalchardet.UniversalDetector
5 | import java.nio.charset.Charset
6 |
7 | /**
8 | * 字节数组转字符串
9 | */
10 | fun ByteArray?.string() = if (this != null) String(this) else EMPTY
11 |
12 | /**
13 | * 字节数组字符集
14 | */
15 | fun ByteArray.charset() = UniversalDetector(null).apply {
16 | handleData(this@charset, 0, this@charset.size)
17 | dataEnd()
18 | }.detectedCharset?.let { Charset.forName(it) }
19 |
20 |
--------------------------------------------------------------------------------
/app/src/main/res/drawable/ic_reader_dormant.xml:
--------------------------------------------------------------------------------
1 |
6 |
9 |
10 |
--------------------------------------------------------------------------------
/README.md:
--------------------------------------------------------------------------------
1 | # 轻墨
2 | ### 基于厚墨v1.3复刻
3 | ### 项目基于kotlin/协程/mvvm开发, 页面模仿自厚墨, 纯属共享学习kotlin/android开发之用.
4 | ### 该软件所产生的文档/资源等请勿传播,请勿用于学习外的其他用途
5 |
6 | ----
7 |
8 | #### 推荐一个好用的本地阅读器 「阅微」, 简单纯粹无广告
9 |
10 |
11 |
12 | ----
13 |
14 | #### 应用简介
15 |
16 | 极简设计,纯粹阅读。支持网络在线阅读,拥有优秀的阅读体验。
17 |
18 |
19 | #### 特此声明
20 |
21 | 本软件仅为开源学习之用, 界面模仿自厚墨v1.3, 与厚墨原版无关
22 |
23 |
24 | ## Stargazers over time
25 |
26 | [](https://starchart.cc/Face-scroll-keyboard/lightink)
27 |
--------------------------------------------------------------------------------
/app/src/main/res/drawable/ic_color_picker_tag.xml:
--------------------------------------------------------------------------------
1 |
6 |
9 |
10 |
--------------------------------------------------------------------------------
/app/src/main/res/drawable/ic_check_loved.xml:
--------------------------------------------------------------------------------
1 |
6 |
9 |
10 |
--------------------------------------------------------------------------------
/app/src/main/res/drawable/ic_loved.xml:
--------------------------------------------------------------------------------
1 |
6 |
9 |
10 |
--------------------------------------------------------------------------------
/app/src/main/res/drawable/ic_flow_loved.xml:
--------------------------------------------------------------------------------
1 |
6 |
9 |
10 |
--------------------------------------------------------------------------------
/app/src/main/java/cn/lightink/reader/ktx/RecyclerViewExtensions.kt:
--------------------------------------------------------------------------------
1 | package cn.lightink.reader.ktx
2 |
3 | import androidx.recyclerview.widget.RecyclerView
4 |
5 | fun RecyclerView.notifyItemAllChanged() {
6 | adapter?.notifyItemRangeChanged(0, adapter!!.itemCount)
7 | }
8 |
9 | //清除动画
10 | fun RecyclerView.clearAnimator() {
11 | itemAnimator?.addDuration = 0
12 | itemAnimator?.changeDuration = 0
13 | itemAnimator?.moveDuration = 0
14 | itemAnimator?.removeDuration = 0
15 | (itemAnimator as androidx.recyclerview.widget.SimpleItemAnimator).supportsChangeAnimations = false
16 | }
--------------------------------------------------------------------------------
/app/src/main/res/drawable/ic_love.xml:
--------------------------------------------------------------------------------
1 |
6 |
9 |
10 |
--------------------------------------------------------------------------------
/app/src/main/res/layout/fragment_feed.xml:
--------------------------------------------------------------------------------
1 |
2 |
6 |
7 |
12 |
13 |
--------------------------------------------------------------------------------
/app/src/main/java/cn/lightink/reader/widget/FlexSeekBar.kt:
--------------------------------------------------------------------------------
1 | package cn.lightink.reader.widget
2 |
3 | import android.annotation.SuppressLint
4 | import android.content.Context
5 | import android.util.AttributeSet
6 | import android.view.MotionEvent
7 | import androidx.appcompat.widget.AppCompatSeekBar
8 |
9 | class FlexSeekBar @JvmOverloads constructor(context: Context, attrs: AttributeSet? = null, defStyleAttr: Int = 0) : AppCompatSeekBar(context, attrs, defStyleAttr) {
10 |
11 | @SuppressLint("ClickableViewAccessibility")
12 | override fun onTouchEvent(event: MotionEvent?) = false
13 |
14 | }
--------------------------------------------------------------------------------
/app/src/main/res/drawable/ic_check_love.xml:
--------------------------------------------------------------------------------
1 |
6 |
9 |
10 |
--------------------------------------------------------------------------------
/app/src/main/res/drawable/ic_score.xml:
--------------------------------------------------------------------------------
1 |
6 |
9 |
10 |
--------------------------------------------------------------------------------
/app/src/main/res/drawable/btn_stroke_control.xml:
--------------------------------------------------------------------------------
1 |
2 |
4 | -
5 |
6 |
-
7 |
8 |
9 |
12 |
13 |
14 |
15 |
16 |
17 |
--------------------------------------------------------------------------------
/app/src/main/res/drawable/ic_notification_timer.xml:
--------------------------------------------------------------------------------
1 |
6 |
12 |
13 |
--------------------------------------------------------------------------------
/app/src/main/res/drawable/drawable_banner_point.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 | -
4 |
5 |
6 |
7 |
8 |
9 | -
10 |
11 |
12 |
13 |
14 |
15 |
--------------------------------------------------------------------------------
/app/src/main/res/drawable/ic_action_more.xml:
--------------------------------------------------------------------------------
1 |
6 |
9 |
10 |
--------------------------------------------------------------------------------
/app/src/main/res/drawable/ic_reader_status_bar.xml:
--------------------------------------------------------------------------------
1 |
6 |
12 |
13 |
--------------------------------------------------------------------------------
/app/src/main/res/xml-v25/shortcuts.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
7 |
12 |
13 |
14 |
--------------------------------------------------------------------------------
/app/src/main/java/cn/lightink/reader/module/NetworkModule.kt:
--------------------------------------------------------------------------------
1 | package cn.lightink.reader.module
2 |
3 | import android.net.ConnectivityManager
4 | import android.net.Network
5 |
6 | /**
7 | * 网络监听
8 | */
9 | object NetworkCallback : ConnectivityManager.NetworkCallback() {
10 |
11 | private var isAvailable = true
12 |
13 | override fun onLost(network: Network) {
14 | super.onLost(network)
15 | isAvailable = false
16 | }
17 |
18 | override fun onAvailable(network: Network) {
19 | super.onAvailable(network)
20 | if (isAvailable) return
21 | isAvailable = true
22 | }
23 |
24 | }
--------------------------------------------------------------------------------
/app/src/main/res/drawable/ic_purify.xml:
--------------------------------------------------------------------------------
1 |
6 |
9 |
10 |
--------------------------------------------------------------------------------
/app/src/main/res/drawable/ic_reader_navigation_bar.xml:
--------------------------------------------------------------------------------
1 |
6 |
12 |
13 |
--------------------------------------------------------------------------------
/app/src/main/res/drawable/ic_reader_theme.xml:
--------------------------------------------------------------------------------
1 |
6 |
9 |
10 |
--------------------------------------------------------------------------------
/app/src/main/res/drawable/ic_ticket_all.xml:
--------------------------------------------------------------------------------
1 |
6 |
9 |
10 |
--------------------------------------------------------------------------------
/app/src/main/res/layout/fragment_reader_more.xml:
--------------------------------------------------------------------------------
1 |
2 |
6 |
7 |
14 |
15 |
--------------------------------------------------------------------------------
/app/src/main/java/cn/lightink/reader/model/TXTConvertModel.kt:
--------------------------------------------------------------------------------
1 | package cn.lightink.reader.model
2 |
3 | import cn.lightink.reader.ktx.encode
4 | import cn.lightink.reader.ktx.md5
5 | import cn.lightink.reader.module.EMPTY
6 |
7 | /**
8 | * TXT章节
9 | * @property index 索引
10 | * @property title 标题
11 | */
12 | data class StateChapter(val index: Int, val title: String, var isChecked: Boolean = true, var href: String = EMPTY, var isCached: Boolean = false) {
13 | val encodeHref: String
14 | get() = href.encode().let { if (it.length < 0xFF) it else it.md5() }
15 | }
16 |
17 | data class CacheChapter(val index: Int, val book: String)
--------------------------------------------------------------------------------
/app/src/main/res/drawable/ic_pushpin.xml:
--------------------------------------------------------------------------------
1 |
6 |
9 |
10 |
--------------------------------------------------------------------------------
/app/src/main/res/drawable/ic_reader_notch_bar.xml:
--------------------------------------------------------------------------------
1 |
3 |
6 |
7 |
--------------------------------------------------------------------------------
/app/src/main/res/menu/sort.xml:
--------------------------------------------------------------------------------
1 |
2 |
--------------------------------------------------------------------------------
/app/src/main/res/layout/item_bottom_selector.xml:
--------------------------------------------------------------------------------
1 |
2 |
--------------------------------------------------------------------------------
/app/src/main/res/drawable/ic_sort_ascending.xml:
--------------------------------------------------------------------------------
1 |
6 |
9 |
10 |
--------------------------------------------------------------------------------
/app/src/main/res/drawable/ic_sort_descending_enable.xml:
--------------------------------------------------------------------------------
1 |
6 |
9 |
10 |
--------------------------------------------------------------------------------
/app/src/main/res/drawable/ic_search_line.xml:
--------------------------------------------------------------------------------
1 |
6 |
9 |
--------------------------------------------------------------------------------
/app/src/main/res/drawable/ic_sort_descending_disable.xml:
--------------------------------------------------------------------------------
1 |
6 |
9 |
10 |
--------------------------------------------------------------------------------
/app/src/main/res/drawable/ic_reader_turn_volume.xml:
--------------------------------------------------------------------------------
1 |
6 |
9 |
10 |
--------------------------------------------------------------------------------
/app/src/main/res/layout/item_book_detail_chapter.xml:
--------------------------------------------------------------------------------
1 |
2 |
--------------------------------------------------------------------------------
/app/src/main/res/drawable/ic_check_checked.xml:
--------------------------------------------------------------------------------
1 |
6 |
9 |
10 |
--------------------------------------------------------------------------------
/app/src/main/res/layout/item_local_book.xml:
--------------------------------------------------------------------------------
1 |
2 |
8 |
9 |
15 |
16 |
--------------------------------------------------------------------------------
/app/src/main/res/drawable/ic_check_box_checked.xml:
--------------------------------------------------------------------------------
1 |
6 |
9 |
10 |
--------------------------------------------------------------------------------
/app/src/main/res/drawable/ic_reader_brightness.xml:
--------------------------------------------------------------------------------
1 |
6 |
9 |
10 |
--------------------------------------------------------------------------------
/app/src/main/res/drawable/ic_bookmark_pull.xml:
--------------------------------------------------------------------------------
1 |
6 |
9 |
12 |
15 |
--------------------------------------------------------------------------------
/app/src/main/res/drawable/ic_check_box_checked_disable.xml:
--------------------------------------------------------------------------------
1 |
6 |
9 |
10 |
--------------------------------------------------------------------------------
/app/src/main/res/values-night/styles.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
9 |
10 |
14 |
15 |
--------------------------------------------------------------------------------
/app/src/main/res/drawable/btn_stroke_secondary.xml:
--------------------------------------------------------------------------------
1 |
2 |
4 | -
5 |
6 |
-
7 |
8 |
9 |
10 |
13 |
14 |
15 |
16 |
17 |
18 |
--------------------------------------------------------------------------------
/app/src/main/res/drawable/ic_response_speed_1.xml:
--------------------------------------------------------------------------------
1 |
6 |
9 |
12 |
15 |
16 |
--------------------------------------------------------------------------------
/app/src/main/res/layout/item_popup.xml:
--------------------------------------------------------------------------------
1 |
2 |
--------------------------------------------------------------------------------
/app/src/main/res/drawable/ic_response_speed_2.xml:
--------------------------------------------------------------------------------
1 |
6 |
9 |
12 |
15 |
16 |
--------------------------------------------------------------------------------
/app/src/main/res/drawable/ic_response_speed_3.xml:
--------------------------------------------------------------------------------
1 |
6 |
9 |
12 |
15 |
16 |
--------------------------------------------------------------------------------
/app/src/main/res/drawable/ic_tips_close.xml:
--------------------------------------------------------------------------------
1 |
6 |
9 |
10 |
--------------------------------------------------------------------------------
/app/src/main/java/cn/lightink/reader/module/SearchModule.kt:
--------------------------------------------------------------------------------
1 | package cn.lightink.reader.module
2 |
3 | import androidx.lifecycle.LifecycleOwner
4 | import androidx.lifecycle.MutableLiveData
5 | import androidx.lifecycle.Observer
6 | import cn.lightink.reader.model.SearchBook
7 |
8 | object SearchObserver {
9 |
10 | private val liveData = MutableLiveData>()
11 |
12 | fun observer(owner: LifecycleOwner, callback: (List) -> Unit) {
13 | liveData.observe(owner, Observer { callback.invoke(it) })
14 | }
15 |
16 | fun postValue(value: List) {
17 | liveData.postValue(value)
18 | }
19 |
20 | fun findValue(publishId: String?) = liveData.value?.firstOrNull { it.objectId() == publishId }
21 |
22 | }
--------------------------------------------------------------------------------
/app/src/main/res/drawable/ic_check_box_normal.xml:
--------------------------------------------------------------------------------
1 |
6 |
9 |
10 |
--------------------------------------------------------------------------------
/app/src/main/res/drawable/ic_check_normal.xml:
--------------------------------------------------------------------------------
1 |
6 |
9 |
10 |
--------------------------------------------------------------------------------
/app/src/main/res/drawable/ic_ticket_single.xml:
--------------------------------------------------------------------------------
1 |
6 |
9 |
10 |
--------------------------------------------------------------------------------
/app/src/main/res/drawable/bg_switch_background.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 | -
4 |
5 |
6 |
7 |
8 |
9 | -
10 |
11 |
12 |
13 |
14 |
15 | -
16 |
17 |
18 |
19 |
20 |
21 |
--------------------------------------------------------------------------------
/app/src/main/res/drawable/ic_book_rank_touch.xml:
--------------------------------------------------------------------------------
1 |
6 |
9 |
10 |
--------------------------------------------------------------------------------
/app/src/main/res/drawable/ic_shutdown.xml:
--------------------------------------------------------------------------------
1 |
3 |
4 |
5 |
--------------------------------------------------------------------------------
/app/src/main/res/values-night/colors.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 | #000000
6 | #101010
7 | #266bfd
8 |
9 |
10 | #D1D1D1
11 | #656565
12 | #565656
13 | #3A3A3A
14 | #101010
15 |
16 |
17 | #101010
18 | #959595
19 | #101010
20 | #959595
21 |
22 |
23 |
--------------------------------------------------------------------------------
/app/src/main/java/cn/lightink/reader/transcode/ktx/Extensions.kt:
--------------------------------------------------------------------------------
1 | package cn.lightink.reader.transcode.ktx
2 |
3 | import kotlinx.serialization.decodeFromString
4 | import kotlinx.serialization.json.Json
5 |
6 | val json = Json {
7 | //非空属性强制设置默认值
8 | coerceInputValues = true
9 | //忽略未知属性
10 | ignoreUnknownKeys = true
11 | //设置默认值
12 | encodeDefaults = true
13 | //格式限定宽泛
14 | isLenient = true
15 | }
16 |
17 | /**
18 | * Json字符串转实体
19 | */
20 | inline fun String.decodeJson(): T {
21 | return Json {
22 | //非空属性强制设置默认值
23 | coerceInputValues = true
24 | //忽略未知属性
25 | ignoreUnknownKeys = true
26 | //设置默认值
27 | encodeDefaults = true
28 | //格式限定宽泛
29 | isLenient = true
30 | }.decodeFromString(this)
31 | }
--------------------------------------------------------------------------------
/app/src/main/res/drawable/ic_list_settings.xml:
--------------------------------------------------------------------------------
1 |
6 |
9 |
10 |
--------------------------------------------------------------------------------
/app/src/main/res/layout/item_search_history.xml:
--------------------------------------------------------------------------------
1 |
2 |
--------------------------------------------------------------------------------
/app/src/main/res/layout/item_feed_group.xml:
--------------------------------------------------------------------------------
1 |
2 |
--------------------------------------------------------------------------------
/app/src/main/res/drawable/bg_seek_progress.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 | -
4 |
5 |
8 |
9 |
10 |
11 | -
12 |
13 |
14 |
17 |
18 |
19 |
20 |
21 |
--------------------------------------------------------------------------------
/app/src/main/res/drawable/ic_option_image.xml:
--------------------------------------------------------------------------------
1 |
6 |
9 |
12 |
13 |
--------------------------------------------------------------------------------
/app/src/main/res/layout/activity_book_rank_settings.xml:
--------------------------------------------------------------------------------
1 |
2 |
6 |
7 |
12 |
13 |
19 |
20 |
--------------------------------------------------------------------------------
/app/src/main/res/drawable/ic_discover_booksource.xml:
--------------------------------------------------------------------------------
1 |
6 |
9 |
12 |
13 |
--------------------------------------------------------------------------------
/app/src/main/res/layout/item_chapter_checkable.xml:
--------------------------------------------------------------------------------
1 |
2 |
8 |
9 |
18 |
19 |
--------------------------------------------------------------------------------
/app/src/main/res/layout/item_dashboard_book.xml:
--------------------------------------------------------------------------------
1 |
2 |
6 |
7 |
12 |
13 |
20 |
21 |
--------------------------------------------------------------------------------
/app/src/main/res/drawable/ic_book_uncheck.xml:
--------------------------------------------------------------------------------
1 |
6 |
10 |
11 |
--------------------------------------------------------------------------------
/app/src/main/res/drawable/ic_action_create.xml:
--------------------------------------------------------------------------------
1 |
6 |
9 |
10 |
--------------------------------------------------------------------------------
/app/src/main/res/values/string-read.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 | 累计阅读%d分钟|平均%d字/分钟
4 | 共%d章|已读%d章
5 | 预览中
6 | 未完待续
7 | 已读完
8 | 未读完
9 |
10 | 书源内置规则
11 | 用户自设规则
12 | 阅读时长按新建规则
13 | 新建屏蔽规则
14 | 替换词(选填)
15 | 建议在充分理解正则表达式的前提下使用
16 | 正则表达式(必填)
17 |
--------------------------------------------------------------------------------
/app/src/main/res/values/styles.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
10 |
11 |
15 |
16 |
19 |
20 |
--------------------------------------------------------------------------------
/app/src/main/res/drawable/ic_bookmark.xml:
--------------------------------------------------------------------------------
1 |
6 |
9 |
12 |
13 |
--------------------------------------------------------------------------------
/app/src/main/java/cn/lightink/reader/ui/base/WarningMessageDialog.kt:
--------------------------------------------------------------------------------
1 | package cn.lightink.reader.ui.base
2 |
3 | import android.app.Dialog
4 | import android.content.Context
5 | import android.graphics.Color
6 | import android.graphics.drawable.ColorDrawable
7 | import cn.lightink.reader.R
8 | import kotlinx.android.synthetic.main.dialog_warning_message.*
9 |
10 | class WarningMessageDialog(context: Context, message: String) : Dialog(context) {
11 |
12 | init {
13 | setContentView(R.layout.dialog_warning_message)
14 | mWarningMessageContent.text = message
15 | mWarningMessageCancel.setOnClickListener { dismiss() }
16 | }
17 |
18 | override fun onStart() {
19 | super.onStart()
20 | window?.setBackgroundDrawable(ColorDrawable(Color.TRANSPARENT))
21 | window?.setLayout(-1, -2)
22 | window?.setDimAmount(0.6F)
23 | }
24 |
25 | }
--------------------------------------------------------------------------------
/app/src/main/res/drawable/ic_action_send.xml:
--------------------------------------------------------------------------------
1 |
3 |
4 |
5 |
--------------------------------------------------------------------------------
/app/src/main/res/layout/activity_feed_management.xml:
--------------------------------------------------------------------------------
1 |
2 |
7 |
8 |
14 |
15 |
20 |
21 |
--------------------------------------------------------------------------------
/app/src/main/java/cn/lightink/reader/ktx/AnyExtensios.kt:
--------------------------------------------------------------------------------
1 | package cn.lightink.reader.ktx
2 |
3 | import android.graphics.drawable.Drawable
4 | import androidx.core.graphics.drawable.toBitmap
5 | import androidx.palette.graphics.Palette
6 | import com.google.gson.GsonBuilder
7 |
8 | /**
9 | * 利用Gson将实体类转化为Json字符串
10 | */
11 | fun Any.toJson(isPretty: Boolean = false) = GsonBuilder().disableHtmlEscaping().apply {
12 | if (isPretty) setPrettyPrinting()
13 | }.create().toJson(this).orEmpty()
14 |
15 | /**
16 | * 利用Gson将Json字符串转化为实体类
17 | */
18 | inline fun String.fromJson() = GsonBuilder().disableHtmlEscaping().create().fromJson(this, T::class.java)!!
19 |
20 | /**
21 | * 取色
22 | */
23 | fun Drawable.dominant(callback: (Palette.Swatch) -> Unit) {
24 | Palette.from(toBitmap()).generate { palette ->
25 | palette?.dominantSwatch?.run { callback.invoke(this) }
26 | }
27 | }
--------------------------------------------------------------------------------
/app/src/main/java/cn/lightink/reader/transcode/Console.kt:
--------------------------------------------------------------------------------
1 | package cn.lightink.reader.transcode
2 |
3 | import android.util.Log
4 |
5 | object Console {
6 |
7 | var callback: ((String, Type) -> Unit)? = this::printlnImpl
8 |
9 | private fun printlnImpl(message: String, type: Console.Type = Console.Type.Log) {
10 | when (type) {
11 | Console.Type.Build -> Log.i("Console Build", message)
12 | Console.Type.Headers -> Log.i("Console Headers", message)
13 | Console.Type.Response -> Log.i("Console Response", message)
14 | Console.Type.Log -> {
15 | Log.i("Console Log", message)
16 | }
17 | }
18 | }
19 |
20 | fun println(message: String, type: Type = Type.Log) {
21 | callback?.invoke(message, type)
22 | }
23 |
24 | enum class Type {
25 | Log, Build, Headers, Response,
26 | }
27 |
28 | }
--------------------------------------------------------------------------------
/app/src/main/res/layout/item_book_rank_group.xml:
--------------------------------------------------------------------------------
1 |
2 |
7 |
8 |
21 |
--------------------------------------------------------------------------------
/app/src/main/res/drawable/ic_unsubscirbe.xml:
--------------------------------------------------------------------------------
1 |
6 |
9 |
10 |
--------------------------------------------------------------------------------
/app/src/main/res/drawable/ic_reader_night.xml:
--------------------------------------------------------------------------------
1 |
6 |
12 |
13 |
--------------------------------------------------------------------------------
/app/src/main/res/drawable/ic_action_search.xml:
--------------------------------------------------------------------------------
1 |
6 |
9 |
10 |
--------------------------------------------------------------------------------
/app/src/main/res/drawable/ic_battery_charging.xml:
--------------------------------------------------------------------------------
1 |
3 |
4 |
5 |
6 |
--------------------------------------------------------------------------------
/app/src/main/res/drawable/ic_notification_pause.xml:
--------------------------------------------------------------------------------
1 |
6 |
12 |
18 |
24 |
25 |
--------------------------------------------------------------------------------
/app/src/main/java/cn/lightink/reader/ui/book/BookDeleteDialog.kt:
--------------------------------------------------------------------------------
1 | package cn.lightink.reader.ui.book
2 |
3 | import android.app.Dialog
4 | import android.graphics.Color
5 | import android.graphics.drawable.ColorDrawable
6 | import androidx.fragment.app.FragmentActivity
7 | import cn.lightink.reader.R
8 | import kotlinx.android.synthetic.main.dialog_book_delete.*
9 |
10 | class BookDeleteDialog(val activity: FragmentActivity, val callback: (Boolean) -> Unit) : Dialog(activity) {
11 |
12 | init {
13 | setContentView(R.layout.dialog_book_delete)
14 | mBookDeleteSubmit.setOnClickListener {
15 | callback.invoke(mBookDeleteCheck.isChecked)
16 | dismiss()
17 | }
18 | }
19 |
20 | override fun onStart() {
21 | super.onStart()
22 | window?.setBackgroundDrawable(ColorDrawable(Color.TRANSPARENT))
23 | window?.setLayout(-1, -2)
24 | window?.setDimAmount(0.6F)
25 | }
26 | }
--------------------------------------------------------------------------------
/app/src/main/res/drawable/ic_option_search.xml:
--------------------------------------------------------------------------------
1 |
3 |
6 |
9 |
10 |
--------------------------------------------------------------------------------
/app/src/main/res/drawable/ic_battery_100.xml:
--------------------------------------------------------------------------------
1 |
3 |
4 |
5 |
6 |
--------------------------------------------------------------------------------
/app/src/main/res/drawable/ic_battery_20.xml:
--------------------------------------------------------------------------------
1 |
3 |
4 |
5 |
6 |
--------------------------------------------------------------------------------
/app/src/main/res/drawable/ic_battery_40.xml:
--------------------------------------------------------------------------------
1 |
3 |
4 |
5 |
6 |
--------------------------------------------------------------------------------
/app/src/main/res/drawable/ic_battery_60.xml:
--------------------------------------------------------------------------------
1 |
3 |
4 |
5 |
6 |
--------------------------------------------------------------------------------
/app/src/main/res/drawable/ic_battery_80.xml:
--------------------------------------------------------------------------------
1 |
3 |
4 |
5 |
6 |
--------------------------------------------------------------------------------
/app/src/main/java/cn/lightink/reader/model/StorageModel.kt:
--------------------------------------------------------------------------------
1 | package cn.lightink.reader.model
2 |
3 | import android.net.Uri
4 | import androidx.lifecycle.LiveData
5 | import androidx.room.*
6 | import cn.lightink.reader.module.EMPTY
7 |
8 | /********************************************************************************************************************************
9 | * 存储类 授权文件夹
10 | *******************************************************************************************************************************/
11 | @Entity
12 | data class Folder(@PrimaryKey val uri: String) {
13 |
14 | @Ignore
15 | val name = Uri.parse(uri).path?.replace("tree/primary:", EMPTY).orEmpty()
16 | }
17 |
18 | @Dao
19 | interface FolderDao {
20 |
21 | @Query("SELECT * FROM folder")
22 | fun getAll(): LiveData>
23 |
24 | @Insert(onConflict = OnConflictStrategy.REPLACE)
25 | fun insert(folder: Folder)
26 |
27 | @Delete
28 | fun delete(folder: Folder)
29 |
30 | }
31 |
32 |
--------------------------------------------------------------------------------
/app/src/main/res/drawable/ic_refresh_header_arrow.xml:
--------------------------------------------------------------------------------
1 |
6 |
11 |
12 |
--------------------------------------------------------------------------------
/app/src/main/res/layout/layout_tab_item.xml:
--------------------------------------------------------------------------------
1 |
2 |
8 |
9 |
19 |
20 |
25 |
26 |
--------------------------------------------------------------------------------
/app/src/main/res/drawable/ic_battery_0.xml:
--------------------------------------------------------------------------------
1 |
6 |
9 |
12 |
13 |
--------------------------------------------------------------------------------
/app/src/main/java/cn/lightink/reader/widget/ImeEditText.kt:
--------------------------------------------------------------------------------
1 | package cn.lightink.reader.widget
2 |
3 | import android.content.Context
4 | import android.util.AttributeSet
5 | import android.view.Gravity
6 | import android.view.KeyEvent
7 | import androidx.appcompat.widget.AppCompatEditText
8 |
9 | /**
10 | * @class ImeEditText
11 | *
12 | * 当输入框获取焦点显示软键盘时可通过onKeyImeCallback获得OnKeyDown事件
13 | */
14 | class ImeEditText @JvmOverloads constructor(context: Context, attrs: AttributeSet? = null, defStyleAttr: Int = 0) : AppCompatEditText(context, attrs, defStyleAttr) {
15 |
16 | private var onKeyImeCallback: ((Int, KeyEvent?) -> Boolean)? = null
17 |
18 | init {
19 | isFocusable = true
20 | isFocusableInTouchMode = true
21 | gravity = Gravity.CENTER_VERTICAL
22 | }
23 |
24 | override fun onKeyPreIme(keyCode: Int, event: KeyEvent?): Boolean {
25 | return if (onKeyImeCallback != null) onKeyImeCallback!!.invoke(keyCode, event) else super.onKeyPreIme(keyCode, event)
26 | }
27 | }
--------------------------------------------------------------------------------
/app/src/main/res/drawable/ic_book_checked.xml:
--------------------------------------------------------------------------------
1 |
6 |
9 |
12 |
13 |
--------------------------------------------------------------------------------
/app/src/main/java/cn/lightink/reader/ui/discover/help/FeedHelpFragment.kt:
--------------------------------------------------------------------------------
1 | package cn.lightink.reader.ui.discover.help
2 |
3 | import android.os.Bundle
4 | import android.view.LayoutInflater
5 | import android.view.View
6 | import android.view.ViewGroup
7 | import cn.lightink.reader.R
8 | import cn.lightink.reader.ktx.startActivity
9 | import cn.lightink.reader.ui.base.LifecycleFragment
10 | import cn.lightink.reader.ui.feed.FeedVerifyActivity
11 | import kotlinx.android.synthetic.main.fragment_help_feed.*
12 |
13 | class FeedHelpFragment : LifecycleFragment() {
14 |
15 | override fun onCreateView(inflater: LayoutInflater, container: ViewGroup?, savedInstanceState: Bundle?): View? {
16 | return inflater.inflate(R.layout.fragment_help_feed, container, false)
17 | }
18 |
19 | override fun onViewCreated(view: View, savedInstanceState: Bundle?) {
20 | super.onViewCreated(view, savedInstanceState)
21 | mHelpFeedVerify.setOnClickListener { startActivity(FeedVerifyActivity::class) }
22 | }
23 | }
--------------------------------------------------------------------------------
/app/src/main/res/layout/activity_open_source.xml:
--------------------------------------------------------------------------------
1 |
2 |
6 |
7 |
11 |
12 |
16 |
17 |
22 |
23 |
24 |
25 |
--------------------------------------------------------------------------------
/app/src/main/java/cn/lightink/reader/ui/discover/help/BookshelfHelpFragment.kt:
--------------------------------------------------------------------------------
1 | package cn.lightink.reader.ui.discover.help
2 |
3 | import android.os.Bundle
4 | import android.view.LayoutInflater
5 | import android.view.View
6 | import android.view.ViewGroup
7 | import cn.lightink.reader.R
8 | import cn.lightink.reader.ktx.startActivity
9 | import cn.lightink.reader.ui.base.LifecycleFragment
10 | import cn.lightink.reader.ui.booksource.BookSourceActivity
11 | import kotlinx.android.synthetic.main.fragment_help_bookshelf.*
12 |
13 | class BookshelfHelpFragment : LifecycleFragment() {
14 |
15 | override fun onCreateView(inflater: LayoutInflater, container: ViewGroup?, savedInstanceState: Bundle?): View? {
16 | return inflater.inflate(R.layout.fragment_help_bookshelf, container, false)
17 | }
18 |
19 | override fun onViewCreated(view: View, savedInstanceState: Bundle?) {
20 | super.onViewCreated(view, savedInstanceState)
21 | mHelpBookSource.setOnClickListener { startActivity(BookSourceActivity::class) }
22 | }
23 | }
--------------------------------------------------------------------------------
/app/src/main/res/layout/layout_tab_item2.xml:
--------------------------------------------------------------------------------
1 |
2 |
8 |
9 |
19 |
20 |
26 |
27 |
--------------------------------------------------------------------------------
/app/src/main/res/values/colors.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 | #FFFFFF
6 | #F6F6F6
7 | #1980FF
8 |
9 |
10 | #222A2C
11 | #888A8C
12 | #AFAFAF
13 | #DFDFDF
14 | #ECECEC
15 |
16 |
17 | #F3AD3B
18 | #19D9CE
19 |
20 |
21 | #FD602D
22 |
23 |
24 | #FFF7F5
25 | #FF605B
26 | #F0F9FF
27 | #15C781
28 | #FD8469
29 |
30 |
--------------------------------------------------------------------------------
/app/src/main/res/layout/popup_reader_preview.xml:
--------------------------------------------------------------------------------
1 |
2 |
5 |
6 |
24 |
25 |
--------------------------------------------------------------------------------
/app/src/main/java/cn/lightink/reader/ui/base/SimpleDialog.kt:
--------------------------------------------------------------------------------
1 | package cn.lightink.reader.ui.base
2 |
3 | import android.app.Dialog
4 | import android.graphics.Color
5 | import android.graphics.drawable.ColorDrawable
6 | import androidx.fragment.app.FragmentActivity
7 | import cn.lightink.reader.R
8 | import kotlinx.android.synthetic.main.dialog_simple.*
9 |
10 | class SimpleDialog(val activity: FragmentActivity, val content: String, val callback: (Boolean) -> Unit) : Dialog(activity) {
11 |
12 | init {
13 | setContentView(R.layout.dialog_simple)
14 | mSimpleContent.text = content
15 | mSimpleSubmit.setOnClickListener { callback.invoke(true).run { dismiss() } }
16 | mSimpleCancel.setOnClickListener { callback.invoke(false).run { dismiss() } }
17 | setOnCancelListener { callback.invoke(false) }
18 | }
19 |
20 | override fun onStart() {
21 | super.onStart()
22 | window?.setBackgroundDrawable(ColorDrawable(Color.TRANSPARENT))
23 | window?.setLayout(-1, -2)
24 | window?.setDimAmount(0.6F)
25 | }
26 | }
--------------------------------------------------------------------------------
/app/src/main/res/drawable/ic_reader_click_animate.xml:
--------------------------------------------------------------------------------
1 |
6 |
9 |
10 |
--------------------------------------------------------------------------------
/app/src/main/res/layout/activity_book_source_purify.xml:
--------------------------------------------------------------------------------
1 |
2 |
6 |
7 |
11 |
12 |
16 |
17 |
24 |
25 |
26 |
27 |
--------------------------------------------------------------------------------
/app/src/main/res/drawable/ic_reader_listen.xml:
--------------------------------------------------------------------------------
1 |
6 |
12 |
13 |
--------------------------------------------------------------------------------
/app/src/main/assets/web/index.html:
--------------------------------------------------------------------------------
1 | lightink-web
--------------------------------------------------------------------------------
/app/src/main/res/layout/item_catalog_chapter.xml:
--------------------------------------------------------------------------------
1 |
2 |
7 |
8 |
25 |
26 |
--------------------------------------------------------------------------------
/app/src/main/res/layout/item_feed_management.xml:
--------------------------------------------------------------------------------
1 |
2 |
8 |
9 |
25 |
26 |
--------------------------------------------------------------------------------
/app/src/main/res/drawable/ic_discover_forum.xml:
--------------------------------------------------------------------------------
1 |
6 |
9 |
10 |
--------------------------------------------------------------------------------
/app/src/main/res/layout/item_action.xml:
--------------------------------------------------------------------------------
1 |
2 |
10 |
11 |
19 |
20 |
28 |
29 |
--------------------------------------------------------------------------------
/app/src/main/java/cn/lightink/reader/ktx/ActivityExtensions.kt:
--------------------------------------------------------------------------------
1 | package cn.lightink.reader.ktx
2 |
3 | import android.app.Activity
4 | import android.content.Intent
5 | import android.graphics.Color
6 | import android.view.View
7 | import kotlin.reflect.KClass
8 |
9 | fun Activity.openFullscreen() {
10 | window.decorView.systemUiVisibility = window.decorView.systemUiVisibility or View.SYSTEM_UI_FLAG_LAYOUT_FULLSCREEN or View.SYSTEM_UI_FLAG_LAYOUT_HIDE_NAVIGATION
11 | window.statusBarColor = Color.TRANSPARENT
12 | window.navigationBarColor = Color.TRANSPARENT
13 | }
14 |
15 | //亮度
16 | var Activity.windowBrightness
17 | get() = window.attributes.screenBrightness
18 | set(brightness) {
19 | window.attributes = window.attributes.apply {
20 | screenBrightness = if (brightness > 1.0 || brightness < 0) -1.0F else brightness
21 | }
22 | }
23 |
24 | /**
25 | * 启动页面
26 | */
27 | fun Activity.startActivity(target: KClass<*>) = startActivity(Intent(this, target.java))
28 |
29 | fun Activity.startActivityForResult(target: KClass<*>) {
30 | startActivityForResult(Intent(this, target.java), Activity.RESULT_FIRST_USER)
31 | }
32 |
33 |
--------------------------------------------------------------------------------
/.gitignore:
--------------------------------------------------------------------------------
1 | ### Android template
2 | # Built application files
3 | *.apk
4 | *.ap_
5 |
6 | # Files for the ART/Dalvik VM
7 | *.dex
8 |
9 | # Java class files
10 | *.class
11 |
12 | # Generated files
13 | bin/
14 | gen/
15 | out/
16 |
17 | # Gradle files
18 | .gradle/
19 | build/
20 |
21 | # Local configuration file (sdk path, etc)
22 | local.properties
23 |
24 | # Proguard folder generated by Eclipse
25 | proguard/
26 |
27 | # Log Files
28 | *.log
29 |
30 | # Android Studio Navigation editor temp files
31 | .navigation/
32 |
33 | # Android Studio captures folder
34 | captures/
35 |
36 | # IntelliJ
37 | *.iml
38 | .idea/
39 |
40 | # Keystore files
41 | # Uncomment the following line if you do not want to check your keystore files in.
42 | #*.jks
43 |
44 | # External native build folder generated in Android Studio 2.2 and later
45 | .externalNativeBuild
46 |
47 | # Google Services (e.g. APIs or Firebase)
48 | google-services.json
49 |
50 | # Freeline
51 | freeline.py
52 | freeline/
53 | freeline_project_description.json
54 |
55 | # fastlane
56 | fastlane/report.xml
57 | fastlane/Preview.html
58 | fastlane/screenshots
59 | fastlane/test_output
60 | fastlane/readme.md
61 |
62 |
--------------------------------------------------------------------------------
/app/src/main/res/layout/item_book_manager.xml:
--------------------------------------------------------------------------------
1 |
2 |
5 |
6 |
10 |
11 |
17 |
18 |
28 |
29 |
--------------------------------------------------------------------------------
/app/src/main/res/layout/activity_reader_change_book_source.xml:
--------------------------------------------------------------------------------
1 |
2 |
7 |
8 |
14 |
15 |
19 |
20 |
25 |
26 |
27 |
28 |
--------------------------------------------------------------------------------
/app/src/main/res/layout/item_open_source.xml:
--------------------------------------------------------------------------------
1 |
2 |
8 |
9 |
16 |
17 |
26 |
27 |
--------------------------------------------------------------------------------
/app/src/main/res/drawable/ic_book_summary_settings.xml:
--------------------------------------------------------------------------------
1 |
6 |
9 |
10 |
--------------------------------------------------------------------------------
/app/src/main/res/drawable/ic_chapter_on_cloud.xml:
--------------------------------------------------------------------------------
1 |
6 |
9 |
10 |
--------------------------------------------------------------------------------
/app/src/main/res/layout/activity_book_cover.xml:
--------------------------------------------------------------------------------
1 |
2 |
7 |
8 |
15 |
16 |
20 |
21 |
27 |
28 |
29 |
--------------------------------------------------------------------------------
/app/src/main/res/layout/item_bookmark.xml:
--------------------------------------------------------------------------------
1 |
2 |
11 |
12 |
18 |
19 |
29 |
--------------------------------------------------------------------------------
/app/src/main/res/layout/item_banner.xml:
--------------------------------------------------------------------------------
1 |
2 |
5 |
6 |
11 |
12 |
16 |
17 |
31 |
32 |
--------------------------------------------------------------------------------
/app/src/main/java/cn/lightink/reader/transcode/DependenciesManager.kt:
--------------------------------------------------------------------------------
1 | package cn.lightink.reader.transcode
2 |
3 | import android.content.Context
4 | import android.content.res.AssetManager
5 | import androidx.startup.Initializer
6 | import java.io.File
7 |
8 | object DependenciesManager {
9 |
10 | private lateinit var asset: AssetManager
11 | private lateinit var cache: File
12 |
13 | fun initialize(context: Context): DependenciesManager {
14 | asset = context.applicationContext.assets
15 | cache = context.cacheDir
16 | return this
17 | }
18 |
19 | fun load(dependency: String) = when (dependency) {
20 | CRYPTO_JS -> asset.open("crypto-js.min.js").reader().readText()
21 | else -> ""
22 | }
23 |
24 | fun buildZipFile(filename: String): File {
25 | return File(cache, filename)
26 | }
27 |
28 | const val CRYPTO_JS = "crypto-js"
29 |
30 | }
31 |
32 | class DependenciesManagerInitializer : Initializer {
33 |
34 | override fun create(context: Context): DependenciesManager {
35 | return DependenciesManager.initialize(context)
36 | }
37 |
38 | override fun dependencies(): List>> {
39 | return emptyList()
40 | }
41 |
42 | }
--------------------------------------------------------------------------------
/app/src/main/res/drawable/ic_discover_rss.xml:
--------------------------------------------------------------------------------
1 |
6 |
9 |
12 |
15 |
16 |
--------------------------------------------------------------------------------
/app/src/main/res/layout/dialog_reader_theme.xml:
--------------------------------------------------------------------------------
1 |
2 |
8 |
9 |
17 |
18 |
23 |
24 |
31 |
32 |
--------------------------------------------------------------------------------
/app/src/main/res/drawable/ic_discover_rank.xml:
--------------------------------------------------------------------------------
1 |
6 |
9 |
10 |
--------------------------------------------------------------------------------
/gradle.properties:
--------------------------------------------------------------------------------
1 | # Project-wide Gradle settings.
2 | # IDE (e.g. Android Studio) users:
3 | # Gradle settings configured through the IDE *will override*
4 | # any settings specified in this file.
5 | # For more details on how to configure your build environment visit
6 | # http://www.gradle.org/docs/current/userguide/build_environment.html
7 | # Specifies the JVM arguments used for the daemon process.
8 | # The setting is particularly useful for tweaking memory settings.
9 | org.gradle.jvmargs=-Xmx1536m
10 | # When configured, Gradle will run in incubating parallel mode.
11 | # This option should only be used with decoupled projects. More details, visit
12 | # http://www.gradle.org/docs/current/userguide/multi_project_builds.html#sec:decoupled_projects
13 | # org.gradle.parallel=true
14 | # Kotlin code style for this project: "official" or "obsolete":
15 | kotlin.code.style=official
16 | # When set to true, the Android plugin uses the appropriate AndroidX library instead of a Support Library.
17 | # The flag is false by default if it is not specified.
18 | android.useAndroidX=true
19 | # When set to true, the Android plugin automatically migrates existing third-party libraries to use AndroidX by rewriting their binaries.
20 | # The flag is false by default if it is not specified.
21 | android.enableJetifier=true
--------------------------------------------------------------------------------
/app/src/main/res/values/styles-widget.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
8 |
9 |
10 |
13 |
14 |
18 |
19 |
20 |
26 |
27 |
30 |
31 |
--------------------------------------------------------------------------------
/app/src/main/java/cn/lightink/reader/ui/booksource/BookSourceScoreDialog.kt:
--------------------------------------------------------------------------------
1 | package cn.lightink.reader.ui.booksource
2 |
3 | import android.app.Dialog
4 | import android.content.Context
5 | import android.graphics.Color
6 | import android.graphics.drawable.ColorDrawable
7 | import cn.lightink.reader.R
8 | import cn.lightink.reader.model.BookSource
9 | import kotlinx.android.synthetic.main.dialog_booksource_score.*
10 |
11 | class BookSourceScoreDialog(context: Context, val bookSource: BookSource) : Dialog(context) {
12 |
13 | private var callback: ((Float) -> Unit)? = null
14 |
15 | init {
16 | setContentView(R.layout.dialog_booksource_score)
17 | mBookSourceScoreRating.setOnRatingBarChangeListener { _, rating, _ -> mBookSourceScoreSubmit.isEnabled = rating > 0F }
18 | mBookSourceScoreSubmit.setOnClickListener {
19 | callback?.invoke(mBookSourceScoreRating.rating)
20 | dismiss()
21 | }
22 | }
23 |
24 | fun callback(callback: (Float) -> Unit): BookSourceScoreDialog {
25 | this.callback = callback
26 | return this
27 | }
28 |
29 | override fun onStart() {
30 | super.onStart()
31 | window?.setBackgroundDrawable(ColorDrawable(Color.TRANSPARENT))
32 | window?.setLayout(-1, -2)
33 | window?.setDimAmount(0.6F)
34 | }
35 |
36 | }
--------------------------------------------------------------------------------
/app/src/main/res/drawable/ic_menu_edit.xml:
--------------------------------------------------------------------------------
1 |
6 |
9 |
10 |
--------------------------------------------------------------------------------
/app/src/main/res/drawable/ic_reader_day.xml:
--------------------------------------------------------------------------------
1 |
6 |
12 |
13 |
--------------------------------------------------------------------------------
/app/src/main/java/cn/lightink/reader/module/UIModule.kt:
--------------------------------------------------------------------------------
1 | package cn.lightink.reader.module
2 |
3 | import android.content.Context
4 | import android.graphics.drawable.Drawable
5 | import cn.lightink.reader.MIPMAP_PATH
6 | import cn.lightink.reader.R
7 | import cn.lightink.reader.model.THEME_LIGHT
8 | import cn.lightink.reader.model.THEME_NIGHT
9 | import cn.lightink.reader.model.Theme
10 | import java.io.File
11 |
12 | object UIModule {
13 |
14 | /***
15 | * 深色模式 通过识别某个色值
16 | */
17 | fun isNightMode(context: Context) = context.getColor(R.color.colorStroke) == 0xFF101010.toInt()
18 |
19 | /**
20 | * 获取配置中的主题
21 | */
22 | fun getConfiguredTheme(context: Context) = if (isNightMode(context)) getNightTheme() else getLightTheme()
23 |
24 |
25 | /**
26 | * 获取配置中的亮色主题
27 | */
28 | private fun getLightTheme() = Room.theme().get(Preferences.get(Preferences.Key.THEME_LIGHT_ID, THEME_LIGHT.id)) ?: THEME_LIGHT
29 |
30 | /**
31 | * 获取配置中的暗色主题
32 | */
33 | private fun getNightTheme() = Room.theme().get(Preferences.get(Preferences.Key.THEME_NIGHT_ID, THEME_NIGHT.id)) ?: THEME_NIGHT
34 |
35 | /**
36 | * 获取主题的纹理图
37 | */
38 | fun getMipmapByTheme(theme: Theme) = Drawable.createFromPath(getMipmapPath(theme))
39 |
40 | /**
41 | * 获取主题的纹理图路径
42 | */
43 | fun getMipmapPath(theme: Theme) = File(MIPMAP_PATH, theme.mipmap).absolutePath
44 |
45 | }
--------------------------------------------------------------------------------
/app/src/main/java/cn/lightink/reader/widget/StateImageView.kt:
--------------------------------------------------------------------------------
1 | package cn.lightink.reader.widget
2 |
3 | import android.content.Context
4 | import android.util.AttributeSet
5 | import android.widget.Checkable
6 | import androidx.appcompat.widget.AppCompatImageView
7 |
8 | class StateImageView : AppCompatImageView, Checkable {
9 |
10 | private var checked = false
11 |
12 | constructor(context: Context, attrs: AttributeSet? = null) : this(context, attrs, 0)
13 |
14 | constructor(context: Context, attrs: AttributeSet? = null, defStyleAttr: Int = 0) : super(context, attrs, defStyleAttr) {
15 | checked = attrs?.getAttributeBooleanValue("http://schemas.android.com/apk/res/android", "checked", false) ?: false
16 | }
17 |
18 | override fun isChecked(): Boolean {
19 | return checked
20 | }
21 |
22 | override fun setChecked(checked: Boolean) {
23 | this.checked = checked
24 | refreshDrawableState()
25 | }
26 |
27 | override fun toggle() {
28 | this.checked = !this.checked
29 | }
30 |
31 | override fun onCreateDrawableState(extraSpace: Int): IntArray {
32 | val drawableState = super.onCreateDrawableState(extraSpace + 1)
33 | if (checked) mergeDrawableStates(drawableState, CHECKED_STATE_SET)
34 | return drawableState
35 | }
36 |
37 | companion object {
38 | private val CHECKED_STATE_SET = intArrayOf(android.R.attr.state_checked)
39 | }
40 | }
--------------------------------------------------------------------------------
/app/src/main/java/cn/lightink/reader/model/BookRankModel.kt:
--------------------------------------------------------------------------------
1 | package cn.lightink.reader.model
2 |
3 | import android.os.Parcelable
4 | import androidx.room.*
5 | import cn.lightink.reader.module.EMPTY
6 | import kotlinx.android.parcel.Parcelize
7 |
8 | /********************************************************************************************************************************
9 | * 存储类 排行榜
10 | ********************************************************************************************************************************
11 | */
12 | @Entity(foreignKeys = [ForeignKey(entity = BookSource::class, parentColumns = ["url"], childColumns = ["url"], onDelete = ForeignKey.CASCADE)])
13 | @Parcelize
14 | data class BookRank(@PrimaryKey val url: String, val name: String, var preferred: Int = 0, var category: String = EMPTY, var visible: Boolean = true, var timestamp: Long = System.currentTimeMillis()) : Parcelable
15 |
16 | @Dao
17 | interface BookRankDao {
18 |
19 | @Query("SELECT * FROM bookrank ORDER BY timestamp")
20 | fun getAllImmediately(): List
21 |
22 | @Query("SELECT * FROM bookrank WHERE visible = 1 ORDER BY timestamp")
23 | fun getVisibleImmediately(): List
24 |
25 | @Query("SELECT COUNT(url) FROM bookrank WHERE url=:url LIMIT 1")
26 | fun isExist(url: String): Boolean
27 |
28 | @Insert
29 | fun insert(rank: BookRank)
30 |
31 | @Update
32 | fun update(vararg ranks: BookRank)
33 |
34 | }
35 |
36 |
--------------------------------------------------------------------------------
/app/src/main/res/layout/item_purify.xml:
--------------------------------------------------------------------------------
1 |
2 |
8 |
9 |
24 |
25 |
34 |
35 |
--------------------------------------------------------------------------------
/app/src/main/res/layout/item_book_detail_source.xml:
--------------------------------------------------------------------------------
1 |
2 |
12 |
13 |
24 |
25 |
34 |
35 |
--------------------------------------------------------------------------------
/app/src/main/res/layout/item_theme_action.xml:
--------------------------------------------------------------------------------
1 |
2 |
10 |
11 |
15 |
16 |
26 |
27 |
28 |
29 |
37 |
38 |
--------------------------------------------------------------------------------
/app/src/main/res/drawable/ic_action_user_logon.xml:
--------------------------------------------------------------------------------
1 |
6 |
9 |
10 |
--------------------------------------------------------------------------------
/app/src/main/res/values/string-feed.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 | 已读清理完成
4 | 订阅频道
5 | 例如 https://sspai.com/feed
6 | 选择分组
7 | 新建分组
8 | 推荐「%s」分组
9 | 新建「%s」分组
10 | 已存在同名分组
11 | 无法创建内置同名分组
12 | 订阅成功
13 | 订阅失败,频道无内容
14 | 订阅
15 | 取消订阅
16 | 频道管理
17 |
18 | 清理当前分组
19 | 清理全部分组
20 | 收藏
21 | 取消收藏
22 |
23 | 添加到指定书架
24 | 取消添加到书架
25 | 添加成功
26 | 单个书架最多添加1个分组
27 |
28 | 打开原网页
29 | 用浏览器打开原网页
30 |
31 |
--------------------------------------------------------------------------------
/app/src/main/res/layout/activity_book_summary.xml:
--------------------------------------------------------------------------------
1 |
2 |
7 |
8 |
12 |
13 |
26 |
27 |
28 |
29 |
34 |
35 |
--------------------------------------------------------------------------------
/app/src/main/java/cn/lightink/reader/ui/booksource/BookSourcePurifyActivity.kt:
--------------------------------------------------------------------------------
1 | package cn.lightink.reader.ui.booksource
2 |
3 | import android.os.Bundle
4 | import cn.lightink.reader.R
5 | import cn.lightink.reader.module.INTENT_BOOK_SOURCE
6 | import cn.lightink.reader.module.RVLinearLayoutManager
7 | import cn.lightink.reader.ui.base.LifecycleActivity
8 | import kotlinx.android.synthetic.main.activity_book_source_purify.*
9 |
10 | class BookSourcePurifyActivity : LifecycleActivity() {
11 |
12 | private val source by lazy { intent.getStringExtra(INTENT_BOOK_SOURCE).orEmpty().split("#") }
13 | // private val adapter by lazy { buildAdapter() }
14 |
15 | override fun onCreate(savedInstanceState: Bundle?) {
16 | super.onCreate(savedInstanceState)
17 | setContentView(R.layout.activity_book_source_purify)
18 | mTopbar.text = source.firstOrNull().orEmpty()
19 | mPurifyRecycler.layoutManager = RVLinearLayoutManager(this)
20 | // mPurifyRecycler.adapter = adapter
21 | // Room.purify().getAllLive(source.lastOrNull().orEmpty()).observe(this, Observer { adapter.submitList(it) })
22 | }
23 | //
24 | // private fun buildAdapter() = ListAdapter(R.layout.item_book_source_purify) { item, purify ->
25 | // item.view.mPurifyWord.text = purify.content
26 | // item.view.setOnClickListener { remove(purify) }
27 | // }
28 | //
29 | // private fun remove(purify: Purify) {
30 | // dialog("移除对「${purify.content}」的净化?") {
31 | // Room.purify().remove(purify)
32 | // }
33 | // }
34 |
35 | }
--------------------------------------------------------------------------------
/app/src/main/java/cn/lightink/reader/module/GlobalModule.kt:
--------------------------------------------------------------------------------
1 | package cn.lightink.reader.module
2 |
3 | import android.app.Activity
4 | import android.app.Application
5 | import android.content.Context
6 | import android.os.Bundle
7 | import androidx.core.content.pm.PackageInfoCompat
8 | import cn.lightink.reader.ui.main.MainActivity
9 | import java.lang.ref.SoftReference
10 |
11 | object GL : Application.ActivityLifecycleCallbacks {
12 |
13 | private var APP_ON_PAUSED = false
14 |
15 | var CONTEXT: SoftReference? = null
16 | var VERSION = EMPTY
17 |
18 | override fun onActivityCreated(activity: Activity, savedInstanceState: Bundle?) {
19 | activity.run {
20 | if (VERSION.isBlank()) {
21 | VERSION = PackageInfoCompat.getLongVersionCode(packageManager.getPackageInfo(packageName, 0)).toString()
22 | }
23 | CONTEXT = SoftReference(this)
24 | Notify.register(this)
25 | }
26 | }
27 |
28 | override fun onActivityPaused(activity: Activity) {
29 | APP_ON_PAUSED = activity is MainActivity
30 | }
31 |
32 | override fun onActivityResumed(activity: Activity) {
33 |
34 | }
35 |
36 | override fun onActivityStarted(activity: Activity) {
37 | }
38 |
39 | override fun onActivityDestroyed(activity: Activity) {
40 | activity.run { Notify.unregister(this) }
41 | }
42 |
43 | override fun onActivitySaveInstanceState(activity: Activity, outState: Bundle) {
44 | }
45 |
46 | override fun onActivityStopped(activity: Activity) {
47 | }
48 |
49 |
50 | }
--------------------------------------------------------------------------------
/app/src/main/res/layout/layout_bookmark_header.xml:
--------------------------------------------------------------------------------
1 |
2 |
6 |
7 |
20 |
21 |
28 |
29 |
35 |
36 |
37 |
38 |
--------------------------------------------------------------------------------
/app/src/main/java/cn/lightink/reader/ktx/ElementExtensions.kt:
--------------------------------------------------------------------------------
1 | package cn.lightink.reader.ktx
2 |
3 | import android.net.Uri
4 | import cn.lightink.reader.module.EMPTY
5 | import org.jsoup.nodes.Element
6 | import org.jsoup.nodes.Node
7 | import org.jsoup.select.Elements
8 |
9 | /**
10 | * 安全调用select
11 | */
12 | fun Element.query(cssQuery: String?): Elements {
13 | return if (cssQuery.isNullOrBlank()) Elements() else select(cssQuery)
14 | }
15 |
16 | /**
17 | * 智能补全超链接
18 | */
19 | fun Element?.href(url: String) = url(this?.attr("href").orEmpty(), url)
20 |
21 | /**
22 | * 智能补全超链接
23 | */
24 | fun Node?.src(url: String) = url(this?.attr("src").orEmpty(), url)
25 |
26 | fun Node?.href(): String = when {
27 | this?.hasAttr("href") == true -> attr("href")
28 | this?.hasAttr("src") == true -> attr("src")
29 | else -> ""
30 | }
31 |
32 | /**
33 | * 智能补全超链接
34 | */
35 | private fun url(href: String, url: String): String {
36 | val uri = Uri.parse(url) ?: return href
37 | return when {
38 | href.isBlank() -> EMPTY
39 | href.startsWith("https:") || href.startsWith("http:") -> href
40 | href.startsWith("//") -> "${uri.scheme.orEmpty()}:$href"
41 | href.startsWith("/") -> "${uri.scheme.orEmpty()}://${uri.authority.orEmpty()}$href"
42 | href.startsWith("#") || href.startsWith("?") -> "$url$href"
43 | else -> "${uri.scheme.orEmpty()}://${uri.authority.orEmpty()}${uri.path.orEmpty().let {
44 | val index = it.lastIndexOf("/")
45 | if (index >= 0) it.substring(0, index + 1) else it
46 | }}$href"
47 | }
48 | }
--------------------------------------------------------------------------------
/app/src/main/res/layout/dialog_reader_book_source.xml:
--------------------------------------------------------------------------------
1 |
2 |
8 |
9 |
17 |
18 |
23 |
24 |
30 |
31 |
32 |
33 |
38 |
39 |
--------------------------------------------------------------------------------
/app/src/main/res/layout/activity_help.xml:
--------------------------------------------------------------------------------
1 |
2 |
7 |
8 |
13 |
14 |
30 |
31 |
36 |
37 |
--------------------------------------------------------------------------------