├── appframework ├── .gitignore ├── src │ ├── main │ │ ├── res │ │ │ ├── values │ │ │ │ ├── color.xml │ │ │ │ ├── dimens.xml │ │ │ │ └── strings.xml │ │ │ └── values-w820dp │ │ │ │ └── dimens.xml │ │ ├── java │ │ │ └── com │ │ │ │ └── moon │ │ │ │ └── appframework │ │ │ │ ├── Test.java │ │ │ │ ├── event │ │ │ │ └── XEvent.java │ │ │ │ ├── action │ │ │ │ ├── XAction.java │ │ │ │ ├── ActionType.java │ │ │ │ ├── EventAction.java │ │ │ │ └── NetWorkAction.java │ │ │ │ ├── common │ │ │ │ ├── log │ │ │ │ │ └── LogLevel.java │ │ │ │ ├── properties │ │ │ │ │ └── Property.java │ │ │ │ ├── util │ │ │ │ │ ├── StringUtils.java │ │ │ │ │ ├── CollectionUtils.java │ │ │ │ │ └── SafeAsyncTask.java │ │ │ │ ├── business │ │ │ │ │ └── XBusiness.java │ │ │ │ └── router │ │ │ │ │ ├── UrlParser.java │ │ │ │ │ └── XRouter.java │ │ │ │ ├── util │ │ │ │ └── LruImageCache.java │ │ │ │ └── core │ │ │ │ ├── XActivity.java │ │ │ │ └── XDispatcher.java │ │ └── AndroidManifest.xml │ └── androidTest │ │ └── java │ │ └── com │ │ └── moon │ │ └── appframework │ │ └── ApplicationTest.java ├── proguard-rules.pro └── build.gradle ├── settings.gradle ├── app ├── libs │ ├── gson-2.5.jar │ ├── libammsdk.jar │ └── BmobSDK_V3.4.5_1111.jar ├── src │ ├── main │ │ ├── res │ │ │ ├── drawable │ │ │ │ ├── logo.png │ │ │ │ ├── ic_add.png │ │ │ │ ├── ic_check.png │ │ │ │ ├── ic_close.png │ │ │ │ ├── ic_empty.png │ │ │ │ ├── ic_favor.png │ │ │ │ ├── loaddb.png │ │ │ │ ├── ic_wx_logo.png │ │ │ │ ├── image_bg.9.png │ │ │ │ ├── normal_bg.jpg │ │ │ │ ├── ic_launcher.png │ │ │ │ ├── ic_rss_logo.png │ │ │ │ ├── ic_share_more.png │ │ │ │ ├── ic_sina_logo.png │ │ │ │ ├── ic_wx_collect.png │ │ │ │ ├── ic_wx_moments.png │ │ │ │ ├── iconfont_user.png │ │ │ │ ├── shadow_left.png │ │ │ │ ├── update_fail.png │ │ │ │ ├── bg_empty_logo.9.png │ │ │ │ ├── xsearch_loading.png │ │ │ │ ├── bg_empty_image.9.png │ │ │ │ ├── default_ptr_rotate.png │ │ │ │ ├── bmob_update_wifi_disable.png │ │ │ │ ├── xsearch_msg_pull_arrow_down.png │ │ │ │ ├── pull_to_refresh_header_arrow_1.png │ │ │ │ ├── pull_to_refresh_header_refresh.png │ │ │ │ ├── font_round.xml │ │ │ │ ├── button_corners.xml │ │ │ │ ├── corners.xml │ │ │ │ ├── edit_corners.xml │ │ │ │ ├── button_corners_unable.xml │ │ │ │ ├── bmob_update_dialog_bg.xml │ │ │ │ ├── activity_shadow.xml │ │ │ │ ├── selectable_background.xml │ │ │ │ ├── square_background.xml │ │ │ │ ├── bmob_update_button_ok_bg_tap.xml │ │ │ │ ├── bmob_update_button_cancel_bg_tap.xml │ │ │ │ ├── bmob_update_button_cancel_bg_focused.xml │ │ │ │ ├── bmob_update_button_ok_bg_focused.xml │ │ │ │ ├── bmob_update_button_ok_bg_normal.xml │ │ │ │ ├── bmob_update_button_cancel_bg_normal.xml │ │ │ │ ├── square_with_buttom_line.xml │ │ │ │ ├── activated_background.xml │ │ │ │ ├── bmob_update_button_close_bg_selector.xml │ │ │ │ ├── left_drawer_list.xml │ │ │ │ ├── bmob_update_button_ok_bg_selector.xml │ │ │ │ ├── bmob_update_button_cancel_bg_selector.xml │ │ │ │ ├── sub_btn_background.xml │ │ │ │ ├── feed_list_item.xml │ │ │ │ ├── btn_normal.xml │ │ │ │ └── bmob_update_button_check_selector.xml │ │ │ ├── drawable-hdpi │ │ │ │ ├── sayhi.png │ │ │ │ ├── ic_addfeed.png │ │ │ │ ├── ic_refresh.png │ │ │ │ ├── bmob_update_close_bg_tap.png │ │ │ │ ├── bmob_update_close_bg_normal.png │ │ │ │ ├── bmob_update_btn_check_on_holo_light.png │ │ │ │ ├── bmob_update_btn_check_off_holo_light.png │ │ │ │ ├── bmob_update_btn_check_on_focused_holo_light.png │ │ │ │ ├── bmob_update_btn_check_on_pressed_holo_light.png │ │ │ │ ├── bmob_update_btn_check_off_focused_holo_light.png │ │ │ │ ├── bmob_update_btn_check_off_pressed_holo_light.png │ │ │ │ └── left_tips_corners.xml │ │ │ ├── mipmap-hdpi │ │ │ │ └── ic_launcher.png │ │ │ ├── mipmap-mdpi │ │ │ │ └── ic_launcher.png │ │ │ ├── mipmap-xhdpi │ │ │ │ └── ic_launcher.png │ │ │ ├── mipmap-xxhdpi │ │ │ │ └── ic_launcher.png │ │ │ ├── values │ │ │ │ ├── ids.xml │ │ │ │ ├── attrs.xml │ │ │ │ ├── bmob_update_string.xml │ │ │ │ ├── bmob_common_strings.xml │ │ │ │ ├── colors.xml │ │ │ │ ├── picture_dimens.xml │ │ │ │ ├── pull_refresh_strings.xml │ │ │ │ ├── color-theme.xml │ │ │ │ └── dimens.xml │ │ │ ├── anim │ │ │ │ ├── push_bottom_in.xml │ │ │ │ ├── push_bottom_out.xml │ │ │ │ ├── base_slide_remain.xml │ │ │ │ ├── base_slide_right_in.xml │ │ │ │ ├── base_slide_right_out.xml │ │ │ │ ├── update_loading_progressbar_anim.xml │ │ │ │ ├── pull_arrow_down.xml │ │ │ │ ├── pull_arrow_up.xml │ │ │ │ ├── image_slide_in.xml │ │ │ │ ├── image_slide_out.xml │ │ │ │ └── toast_out.xml │ │ │ ├── layout │ │ │ │ ├── common_divider.xml │ │ │ │ ├── activity_base.xml │ │ │ │ ├── common_divider_with_more_space.xml │ │ │ │ ├── common_tool_bar.xml │ │ │ │ ├── fragment_user_login_out.xml │ │ │ │ ├── activity_setting.xml │ │ │ │ ├── notice.xml │ │ │ │ ├── fragment_theme_picker.xml │ │ │ │ ├── activity_article_web.xml │ │ │ │ ├── tasty_toast_layout.xml │ │ │ │ ├── gv_color_item.xml │ │ │ │ ├── gv_share_item.xml │ │ │ │ ├── activity_image_browser.xml │ │ │ │ ├── fragment_image_detail.xml │ │ │ │ ├── lv_article_divider_header.xml │ │ │ │ ├── fragment_loading.xml │ │ │ │ ├── pull_to_load_footer.xml │ │ │ │ ├── fragment_recommend_list.xml │ │ │ │ ├── activity_feed.xml │ │ │ │ ├── activity_article.xml │ │ │ │ ├── menu_singer_article.xml │ │ │ │ ├── widget_empty_feed.xml │ │ │ │ ├── fragment_share.xml │ │ │ │ ├── dialog_sub.xml │ │ │ │ ├── fragment_add_sub_sec.xml │ │ │ │ ├── fragment_about_me.xml │ │ │ │ ├── article_bottom_bar.xml │ │ │ │ ├── left_drawer_list_item.xml │ │ │ │ ├── activity_view_article.xml │ │ │ │ └── menu_singer_feed.xml │ │ │ ├── values-v21 │ │ │ │ └── styles.xml │ │ │ ├── values-w820dp │ │ │ │ └── dimens.xml │ │ │ └── menu │ │ │ │ ├── menu_channel.xml │ │ │ │ ├── menu_main.xml │ │ │ │ └── menu_web.xml │ │ └── java │ │ │ └── com │ │ │ └── moon │ │ │ └── myreadapp │ │ │ ├── common │ │ │ ├── components │ │ │ │ ├── rss │ │ │ │ │ ├── FeedReadException.java │ │ │ │ │ ├── FeedlyResult.java │ │ │ │ │ ├── DateUtil.java │ │ │ │ │ ├── RssHelper.java │ │ │ │ │ ├── FeedParser.java │ │ │ │ │ └── FeedReader.java │ │ │ │ ├── webview │ │ │ │ │ └── ILoad.java │ │ │ │ ├── pulltorefresh │ │ │ │ │ ├── EmptyLayout.java │ │ │ │ │ ├── PullToRefreshPSListView.java │ │ │ │ │ ├── impl │ │ │ │ │ │ └── FeedPTPRecyclerView.java │ │ │ │ │ ├── PullToRefreshWebView.java │ │ │ │ │ ├── ILoadingLayout.java │ │ │ │ │ ├── PullToRefreshScrollView.java │ │ │ │ │ └── IPullToRefresh.java │ │ │ │ ├── photoview │ │ │ │ │ ├── gestures │ │ │ │ │ │ ├── GestureDetector.java │ │ │ │ │ │ ├── OnGestureListener.java │ │ │ │ │ │ └── VersionedGestureDetector.java │ │ │ │ │ ├── scrollerproxy │ │ │ │ │ │ ├── IcsScroller.java │ │ │ │ │ │ ├── ScrollerProxy.java │ │ │ │ │ │ ├── PreGingerScroller.java │ │ │ │ │ │ └── GingerScroller.java │ │ │ │ │ ├── log │ │ │ │ │ │ ├── LogManager.java │ │ │ │ │ │ └── LoggerDefault.java │ │ │ │ │ └── Compat.java │ │ │ │ ├── scroll │ │ │ │ │ ├── ScrollState.java │ │ │ │ │ └── ObservableScrollViewCallbacks.java │ │ │ │ ├── scrollview │ │ │ │ │ ├── ScrollState.java │ │ │ │ │ ├── ObservableScrollViewCallbacks.java │ │ │ │ │ └── Scrollable.java │ │ │ │ ├── dialog │ │ │ │ │ ├── TextFont.java │ │ │ │ │ ├── AboutMeDialog.java │ │ │ │ │ └── BaseButtomDialog.java │ │ │ │ ├── toast │ │ │ │ │ └── ToastHelper.java │ │ │ │ └── cutebuttombar │ │ │ │ │ └── AutoButtomBar.java │ │ │ ├── event │ │ │ │ ├── UpdateFeedListEvent.java │ │ │ │ ├── UpdateArticleEvent.java │ │ │ │ ├── UpdateUserEvent.java │ │ │ │ ├── UpdateUIEvent.java │ │ │ │ ├── SynchronizeStateEvent.java │ │ │ │ └── UpdateFeedEvent.java │ │ │ └── adapter │ │ │ │ ├── AddSubViewPagerAdapter.java │ │ │ │ ├── base │ │ │ │ ├── FeedAdapterHelper.java │ │ │ │ └── BaseListAdapter.java │ │ │ │ └── DrawerAdapter.java │ │ │ ├── mvvm │ │ │ ├── viewmodels │ │ │ │ └── BaseViewModel.java │ │ │ └── models │ │ │ │ ├── SyncState.java │ │ │ │ ├── RequestFeed.java │ │ │ │ ├── ShareItem.java │ │ │ │ ├── ModelHelper.java │ │ │ │ └── dao │ │ │ │ ├── User.java │ │ │ │ └── DaoSession.java │ │ │ ├── util │ │ │ ├── VibratorHelper.java │ │ │ ├── ImageHelper.java │ │ │ ├── BuiltConfig.java │ │ │ ├── HtmlHelper.java │ │ │ ├── ViewUtils.java │ │ │ └── ThemeUtils.java │ │ │ ├── ui │ │ │ ├── SettingActivity.java │ │ │ └── AddFeedActivity.java │ │ │ └── constants │ │ │ └── Constants.java │ └── androidTest │ │ └── java │ │ └── com │ │ └── moon │ │ └── myreadapp │ │ └── ApplicationTest.java ├── .gitignore ├── proguard-rules.pro └── build.gradle ├── gradle └── wrapper │ ├── gradle-wrapper.jar │ └── gradle-wrapper.properties ├── .gitignore ├── gradle.properties └── README.md /appframework/.gitignore: -------------------------------------------------------------------------------- 1 | /build 2 | -------------------------------------------------------------------------------- /settings.gradle: -------------------------------------------------------------------------------- 1 | include ':app', ':appframework' 2 | -------------------------------------------------------------------------------- /app/libs/gson-2.5.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/moonChenHaohui/ANDROID-MVVM-RSS/HEAD/app/libs/gson-2.5.jar -------------------------------------------------------------------------------- /app/libs/libammsdk.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/moonChenHaohui/ANDROID-MVVM-RSS/HEAD/app/libs/libammsdk.jar -------------------------------------------------------------------------------- /appframework/src/main/res/values/color.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | -------------------------------------------------------------------------------- /app/libs/BmobSDK_V3.4.5_1111.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/moonChenHaohui/ANDROID-MVVM-RSS/HEAD/app/libs/BmobSDK_V3.4.5_1111.jar -------------------------------------------------------------------------------- /gradle/wrapper/gradle-wrapper.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/moonChenHaohui/ANDROID-MVVM-RSS/HEAD/gradle/wrapper/gradle-wrapper.jar -------------------------------------------------------------------------------- /app/src/main/res/drawable/logo.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/moonChenHaohui/ANDROID-MVVM-RSS/HEAD/app/src/main/res/drawable/logo.png -------------------------------------------------------------------------------- /app/src/main/res/drawable/ic_add.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/moonChenHaohui/ANDROID-MVVM-RSS/HEAD/app/src/main/res/drawable/ic_add.png -------------------------------------------------------------------------------- /app/src/main/res/drawable/ic_check.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/moonChenHaohui/ANDROID-MVVM-RSS/HEAD/app/src/main/res/drawable/ic_check.png -------------------------------------------------------------------------------- /app/src/main/res/drawable/ic_close.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/moonChenHaohui/ANDROID-MVVM-RSS/HEAD/app/src/main/res/drawable/ic_close.png -------------------------------------------------------------------------------- /app/src/main/res/drawable/ic_empty.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/moonChenHaohui/ANDROID-MVVM-RSS/HEAD/app/src/main/res/drawable/ic_empty.png -------------------------------------------------------------------------------- /app/src/main/res/drawable/ic_favor.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/moonChenHaohui/ANDROID-MVVM-RSS/HEAD/app/src/main/res/drawable/ic_favor.png -------------------------------------------------------------------------------- /app/src/main/res/drawable/loaddb.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/moonChenHaohui/ANDROID-MVVM-RSS/HEAD/app/src/main/res/drawable/loaddb.png -------------------------------------------------------------------------------- /app/src/main/res/drawable-hdpi/sayhi.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/moonChenHaohui/ANDROID-MVVM-RSS/HEAD/app/src/main/res/drawable-hdpi/sayhi.png -------------------------------------------------------------------------------- /app/src/main/res/drawable/ic_wx_logo.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/moonChenHaohui/ANDROID-MVVM-RSS/HEAD/app/src/main/res/drawable/ic_wx_logo.png -------------------------------------------------------------------------------- /app/src/main/res/drawable/image_bg.9.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/moonChenHaohui/ANDROID-MVVM-RSS/HEAD/app/src/main/res/drawable/image_bg.9.png -------------------------------------------------------------------------------- /app/src/main/res/drawable/normal_bg.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/moonChenHaohui/ANDROID-MVVM-RSS/HEAD/app/src/main/res/drawable/normal_bg.jpg -------------------------------------------------------------------------------- /app/src/main/res/drawable/ic_launcher.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/moonChenHaohui/ANDROID-MVVM-RSS/HEAD/app/src/main/res/drawable/ic_launcher.png -------------------------------------------------------------------------------- /app/src/main/res/drawable/ic_rss_logo.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/moonChenHaohui/ANDROID-MVVM-RSS/HEAD/app/src/main/res/drawable/ic_rss_logo.png -------------------------------------------------------------------------------- /app/src/main/res/drawable/ic_share_more.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/moonChenHaohui/ANDROID-MVVM-RSS/HEAD/app/src/main/res/drawable/ic_share_more.png -------------------------------------------------------------------------------- /app/src/main/res/drawable/ic_sina_logo.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/moonChenHaohui/ANDROID-MVVM-RSS/HEAD/app/src/main/res/drawable/ic_sina_logo.png -------------------------------------------------------------------------------- /app/src/main/res/drawable/ic_wx_collect.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/moonChenHaohui/ANDROID-MVVM-RSS/HEAD/app/src/main/res/drawable/ic_wx_collect.png -------------------------------------------------------------------------------- /app/src/main/res/drawable/ic_wx_moments.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/moonChenHaohui/ANDROID-MVVM-RSS/HEAD/app/src/main/res/drawable/ic_wx_moments.png -------------------------------------------------------------------------------- /app/src/main/res/drawable/iconfont_user.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/moonChenHaohui/ANDROID-MVVM-RSS/HEAD/app/src/main/res/drawable/iconfont_user.png -------------------------------------------------------------------------------- /app/src/main/res/drawable/shadow_left.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/moonChenHaohui/ANDROID-MVVM-RSS/HEAD/app/src/main/res/drawable/shadow_left.png -------------------------------------------------------------------------------- /app/src/main/res/drawable/update_fail.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/moonChenHaohui/ANDROID-MVVM-RSS/HEAD/app/src/main/res/drawable/update_fail.png -------------------------------------------------------------------------------- /app/src/main/res/drawable-hdpi/ic_addfeed.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/moonChenHaohui/ANDROID-MVVM-RSS/HEAD/app/src/main/res/drawable-hdpi/ic_addfeed.png -------------------------------------------------------------------------------- /app/src/main/res/drawable-hdpi/ic_refresh.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/moonChenHaohui/ANDROID-MVVM-RSS/HEAD/app/src/main/res/drawable-hdpi/ic_refresh.png -------------------------------------------------------------------------------- /app/src/main/res/drawable/bg_empty_logo.9.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/moonChenHaohui/ANDROID-MVVM-RSS/HEAD/app/src/main/res/drawable/bg_empty_logo.9.png -------------------------------------------------------------------------------- /app/src/main/res/drawable/xsearch_loading.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/moonChenHaohui/ANDROID-MVVM-RSS/HEAD/app/src/main/res/drawable/xsearch_loading.png -------------------------------------------------------------------------------- /app/src/main/res/mipmap-hdpi/ic_launcher.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/moonChenHaohui/ANDROID-MVVM-RSS/HEAD/app/src/main/res/mipmap-hdpi/ic_launcher.png -------------------------------------------------------------------------------- /app/src/main/res/mipmap-mdpi/ic_launcher.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/moonChenHaohui/ANDROID-MVVM-RSS/HEAD/app/src/main/res/mipmap-mdpi/ic_launcher.png -------------------------------------------------------------------------------- /app/src/main/res/mipmap-xhdpi/ic_launcher.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/moonChenHaohui/ANDROID-MVVM-RSS/HEAD/app/src/main/res/mipmap-xhdpi/ic_launcher.png -------------------------------------------------------------------------------- /app/src/main/res/drawable/bg_empty_image.9.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/moonChenHaohui/ANDROID-MVVM-RSS/HEAD/app/src/main/res/drawable/bg_empty_image.9.png -------------------------------------------------------------------------------- /app/src/main/res/drawable/default_ptr_rotate.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/moonChenHaohui/ANDROID-MVVM-RSS/HEAD/app/src/main/res/drawable/default_ptr_rotate.png -------------------------------------------------------------------------------- /app/src/main/res/mipmap-xxhdpi/ic_launcher.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/moonChenHaohui/ANDROID-MVVM-RSS/HEAD/app/src/main/res/mipmap-xxhdpi/ic_launcher.png -------------------------------------------------------------------------------- /app/src/main/res/drawable/bmob_update_wifi_disable.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/moonChenHaohui/ANDROID-MVVM-RSS/HEAD/app/src/main/res/drawable/bmob_update_wifi_disable.png -------------------------------------------------------------------------------- /app/src/main/res/drawable/xsearch_msg_pull_arrow_down.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/moonChenHaohui/ANDROID-MVVM-RSS/HEAD/app/src/main/res/drawable/xsearch_msg_pull_arrow_down.png -------------------------------------------------------------------------------- /appframework/src/main/java/com/moon/appframework/Test.java: -------------------------------------------------------------------------------- 1 | package com.moon.appframework; 2 | 3 | /** 4 | * Created by moon on 15/10/1. 5 | */ 6 | public class Test { 7 | } 8 | -------------------------------------------------------------------------------- /app/src/main/res/drawable-hdpi/bmob_update_close_bg_tap.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/moonChenHaohui/ANDROID-MVVM-RSS/HEAD/app/src/main/res/drawable-hdpi/bmob_update_close_bg_tap.png -------------------------------------------------------------------------------- /app/src/main/res/drawable/pull_to_refresh_header_arrow_1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/moonChenHaohui/ANDROID-MVVM-RSS/HEAD/app/src/main/res/drawable/pull_to_refresh_header_arrow_1.png -------------------------------------------------------------------------------- /app/src/main/res/drawable/pull_to_refresh_header_refresh.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/moonChenHaohui/ANDROID-MVVM-RSS/HEAD/app/src/main/res/drawable/pull_to_refresh_header_refresh.png -------------------------------------------------------------------------------- /app/src/main/res/drawable-hdpi/bmob_update_close_bg_normal.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/moonChenHaohui/ANDROID-MVVM-RSS/HEAD/app/src/main/res/drawable-hdpi/bmob_update_close_bg_normal.png -------------------------------------------------------------------------------- /app/src/main/res/drawable-hdpi/bmob_update_btn_check_on_holo_light.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/moonChenHaohui/ANDROID-MVVM-RSS/HEAD/app/src/main/res/drawable-hdpi/bmob_update_btn_check_on_holo_light.png -------------------------------------------------------------------------------- /appframework/src/main/java/com/moon/appframework/event/XEvent.java: -------------------------------------------------------------------------------- 1 | package com.moon.appframework.event; 2 | 3 | /** 4 | * Created by kidcrazequ on 15/8/24. 5 | */ 6 | public interface XEvent { 7 | } 8 | -------------------------------------------------------------------------------- /app/src/main/res/drawable-hdpi/bmob_update_btn_check_off_holo_light.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/moonChenHaohui/ANDROID-MVVM-RSS/HEAD/app/src/main/res/drawable-hdpi/bmob_update_btn_check_off_holo_light.png -------------------------------------------------------------------------------- /app/src/main/res/values/ids.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | -------------------------------------------------------------------------------- /app/src/main/res/drawable-hdpi/bmob_update_btn_check_on_focused_holo_light.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/moonChenHaohui/ANDROID-MVVM-RSS/HEAD/app/src/main/res/drawable-hdpi/bmob_update_btn_check_on_focused_holo_light.png -------------------------------------------------------------------------------- /app/src/main/res/drawable-hdpi/bmob_update_btn_check_on_pressed_holo_light.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/moonChenHaohui/ANDROID-MVVM-RSS/HEAD/app/src/main/res/drawable-hdpi/bmob_update_btn_check_on_pressed_holo_light.png -------------------------------------------------------------------------------- /app/src/main/res/drawable-hdpi/bmob_update_btn_check_off_focused_holo_light.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/moonChenHaohui/ANDROID-MVVM-RSS/HEAD/app/src/main/res/drawable-hdpi/bmob_update_btn_check_off_focused_holo_light.png -------------------------------------------------------------------------------- /app/src/main/res/drawable-hdpi/bmob_update_btn_check_off_pressed_holo_light.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/moonChenHaohui/ANDROID-MVVM-RSS/HEAD/app/src/main/res/drawable-hdpi/bmob_update_btn_check_off_pressed_holo_light.png -------------------------------------------------------------------------------- /appframework/src/main/java/com/moon/appframework/action/XAction.java: -------------------------------------------------------------------------------- 1 | package com.moon.appframework.action; 2 | 3 | /** 4 | * Created by kidcrazequ on 15/8/24. 5 | */ 6 | public class XAction { 7 | public ActionType type; 8 | } 9 | -------------------------------------------------------------------------------- /app/src/main/res/drawable/font_round.xml: -------------------------------------------------------------------------------- 1 | 5 | 6 | -------------------------------------------------------------------------------- /app/src/main/res/drawable/button_corners.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | -------------------------------------------------------------------------------- /app/src/main/res/drawable/corners.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | -------------------------------------------------------------------------------- /app/src/main/res/drawable/edit_corners.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | -------------------------------------------------------------------------------- /app/src/main/res/drawable-hdpi/left_tips_corners.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | -------------------------------------------------------------------------------- /app/src/main/res/drawable/button_corners_unable.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | -------------------------------------------------------------------------------- /appframework/src/main/java/com/moon/appframework/action/ActionType.java: -------------------------------------------------------------------------------- 1 | package com.moon.appframework.action; 2 | 3 | /** 4 | * Created by kidcrazequ on 15/8/24. 5 | */ 6 | public enum ActionType { 7 | NETWORK, 8 | EVENT, 9 | ROUTER 10 | } 11 | -------------------------------------------------------------------------------- /appframework/src/main/res/values/dimens.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 16dp 4 | 16dp 5 | 6 | -------------------------------------------------------------------------------- /app/src/main/res/drawable/bmob_update_dialog_bg.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | -------------------------------------------------------------------------------- /gradle/wrapper/gradle-wrapper.properties: -------------------------------------------------------------------------------- 1 | #Wed Apr 06 23:19:33 CST 2016 2 | distributionBase=GRADLE_USER_HOME 3 | distributionPath=wrapper/dists 4 | zipStoreBase=GRADLE_USER_HOME 5 | zipStorePath=wrapper/dists 6 | distributionUrl=https\://services.gradle.org/distributions/gradle-2.10-all.zip 7 | -------------------------------------------------------------------------------- /app/src/main/res/anim/push_bottom_in.xml: -------------------------------------------------------------------------------- 1 | 2 | -------------------------------------------------------------------------------- /app/src/main/res/layout/common_divider.xml: -------------------------------------------------------------------------------- 1 | 2 | 7 | -------------------------------------------------------------------------------- /app/src/main/res/anim/push_bottom_out.xml: -------------------------------------------------------------------------------- 1 | 2 | -------------------------------------------------------------------------------- /app/src/main/res/drawable/activity_shadow.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 8 | -------------------------------------------------------------------------------- /appframework/src/main/java/com/moon/appframework/common/log/LogLevel.java: -------------------------------------------------------------------------------- 1 | package com.moon.appframework.common.log; 2 | 3 | /** 4 | * @author kidcrazequ 5 | */ 6 | public enum LogLevel { 7 | /** 8 | * 不打印日志 9 | */ 10 | NONE, 11 | 12 | /** 13 | * 打印全部日志 14 | */ 15 | FULL 16 | } 17 | -------------------------------------------------------------------------------- /app/src/main/res/drawable/selectable_background.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | -------------------------------------------------------------------------------- /app/src/main/res/drawable/square_background.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | -------------------------------------------------------------------------------- /app/src/main/res/drawable/bmob_update_button_ok_bg_tap.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | -------------------------------------------------------------------------------- /app/src/main/res/drawable/bmob_update_button_cancel_bg_tap.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | -------------------------------------------------------------------------------- /appframework/src/main/AndroidManifest.xml: -------------------------------------------------------------------------------- 1 | 2 | 4 | 5 | 8 | 9 | 10 | -------------------------------------------------------------------------------- /app/src/main/res/anim/base_slide_remain.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 8 | -------------------------------------------------------------------------------- /app/src/main/res/anim/base_slide_right_in.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 8 | 9 | -------------------------------------------------------------------------------- /app/src/main/res/anim/base_slide_right_out.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 9 | -------------------------------------------------------------------------------- /app/src/main/res/anim/update_loading_progressbar_anim.xml: -------------------------------------------------------------------------------- 1 | 2 | -------------------------------------------------------------------------------- /app/src/main/res/drawable/bmob_update_button_cancel_bg_focused.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | -------------------------------------------------------------------------------- /app/src/main/res/drawable/bmob_update_button_ok_bg_focused.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | -------------------------------------------------------------------------------- /app/src/main/java/com/moon/myreadapp/common/components/rss/FeedReadException.java: -------------------------------------------------------------------------------- 1 | package com.moon.myreadapp.common.components.rss; 2 | 3 | /** 4 | * @description: 5 | * @author: Match 6 | * @date: 8/29/15 7 | */ 8 | public class FeedReadException extends Exception { 9 | 10 | public FeedReadException(int status, String message) { 11 | super(message); 12 | } 13 | } 14 | -------------------------------------------------------------------------------- /app/src/main/res/drawable/bmob_update_button_ok_bg_normal.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | -------------------------------------------------------------------------------- /app/src/main/res/drawable/bmob_update_button_cancel_bg_normal.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | -------------------------------------------------------------------------------- /app/src/main/java/com/moon/myreadapp/common/event/UpdateFeedListEvent.java: -------------------------------------------------------------------------------- 1 | package com.moon.myreadapp.common.event; 2 | 3 | import com.moon.appframework.event.XEvent; 4 | import com.moon.myreadapp.mvvm.models.dao.Feed; 5 | 6 | /** 7 | * Created by moon on 15/11/13. 8 | */ 9 | public class UpdateFeedListEvent implements XEvent { 10 | 11 | public UpdateFeedListEvent() { 12 | 13 | } 14 | } 15 | -------------------------------------------------------------------------------- /app/src/main/java/com/moon/myreadapp/mvvm/viewmodels/BaseViewModel.java: -------------------------------------------------------------------------------- 1 | package com.moon.myreadapp.mvvm.viewmodels; 2 | 3 | import android.databinding.BaseObservable; 4 | 5 | public abstract class BaseViewModel extends BaseObservable{ 6 | 7 | 8 | 9 | public abstract void initViews(); 10 | 11 | public abstract void initEvents(); 12 | public abstract void clear(); 13 | 14 | 15 | 16 | } 17 | -------------------------------------------------------------------------------- /app/src/main/res/layout/activity_base.xml: -------------------------------------------------------------------------------- 1 | 7 | -------------------------------------------------------------------------------- /app/src/main/res/values-v21/styles.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 9 | 10 | -------------------------------------------------------------------------------- /app/src/main/res/values-w820dp/dimens.xml: -------------------------------------------------------------------------------- 1 | 2 | 5 | 64dp 6 | 7 | -------------------------------------------------------------------------------- /app/src/main/res/layout/common_divider_with_more_space.xml: -------------------------------------------------------------------------------- 1 | 2 | 7 | 8 | 9 | -------------------------------------------------------------------------------- /appframework/src/main/res/values-w820dp/dimens.xml: -------------------------------------------------------------------------------- 1 | 2 | 5 | 64dp 6 | 7 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | # built application files 2 | *.ap_ 3 | 4 | # files for the dex VM 5 | *.dex 6 | *.iml 7 | 8 | # Java class files 9 | *.class 10 | 11 | # generated files 12 | bin/ 13 | gen/ 14 | *target/ 15 | *build/ 16 | .gradle/ 17 | .idea/ 18 | gen-external-apklibs/ 19 | 20 | # Local configuration file (sdk path, etc) 21 | local.properties 22 | 23 | # Eclipse project files 24 | .classpath 25 | .project 26 | 27 | # Mac os 28 | .DS_Store -------------------------------------------------------------------------------- /app/src/main/res/anim/pull_arrow_down.xml: -------------------------------------------------------------------------------- 1 | 2 | 4 | 5 | 12 | 13 | -------------------------------------------------------------------------------- /app/src/main/res/anim/pull_arrow_up.xml: -------------------------------------------------------------------------------- 1 | 2 | 4 | 5 | 12 | 13 | -------------------------------------------------------------------------------- /app/.gitignore: -------------------------------------------------------------------------------- 1 | /build 2 | *.iml 3 | # Built application files 4 | *.apk 5 | *.ap_ 6 | 7 | # Files for the Dalvik VM 8 | *.dex 9 | 10 | # Java class files 11 | *.class 12 | 13 | # Generated files 14 | bin/ 15 | gen/ 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 -------------------------------------------------------------------------------- /app/src/main/res/layout/common_tool_bar.xml: -------------------------------------------------------------------------------- 1 | 2 | -------------------------------------------------------------------------------- /appframework/src/main/java/com/moon/appframework/action/EventAction.java: -------------------------------------------------------------------------------- 1 | package com.moon.appframework.action; 2 | 3 | 4 | import com.moon.appframework.event.XEvent; 5 | 6 | /** 7 | * Created by kidcrazequ on 15/8/24. 8 | */ 9 | public class EventAction extends XAction{ 10 | 11 | public XEvent event; 12 | 13 | public EventAction(XEvent event){ 14 | this.event = event; 15 | this.type = ActionType.EVENT; 16 | } 17 | } 18 | -------------------------------------------------------------------------------- /appframework/src/androidTest/java/com/moon/appframework/ApplicationTest.java: -------------------------------------------------------------------------------- 1 | package com.moon.appframework; 2 | 3 | import android.app.Application; 4 | import android.test.ApplicationTestCase; 5 | 6 | /** 7 | * Testing Fundamentals 8 | */ 9 | public class ApplicationTest extends ApplicationTestCase { 10 | public ApplicationTest() { 11 | super(Application.class); 12 | } 13 | } -------------------------------------------------------------------------------- /app/src/main/res/menu/menu_channel.xml: -------------------------------------------------------------------------------- 1 | 4 | 9 | 10 | 11 | -------------------------------------------------------------------------------- /app/src/main/res/menu/menu_main.xml: -------------------------------------------------------------------------------- 1 | 4 | 9 | 10 | 11 | -------------------------------------------------------------------------------- /app/src/androidTest/java/com/moon/myreadapp/ApplicationTest.java: -------------------------------------------------------------------------------- 1 | package com.moon.myreadapp; 2 | 3 | import android.app.Application; 4 | import android.test.ApplicationTestCase; 5 | 6 | /** 7 | * Testing Fundamentals 8 | */ 9 | public class ApplicationTest extends ApplicationTestCase { 10 | public ApplicationTest() { 11 | super(Application.class); 12 | } 13 | } -------------------------------------------------------------------------------- /app/src/main/java/com/moon/myreadapp/common/components/webview/ILoad.java: -------------------------------------------------------------------------------- 1 | package com.moon.myreadapp.common.components.webview; 2 | 3 | import android.graphics.Bitmap; 4 | import android.webkit.WebView; 5 | 6 | /** 7 | * Created by moon on 15/10/24. 8 | */ 9 | public interface ILoad { 10 | void start(WebView view, String url); 11 | void success(WebView view, String url); 12 | void error(WebView view, int errorCode, 13 | String description, String failingUrl); 14 | } 15 | -------------------------------------------------------------------------------- /app/src/main/res/drawable/square_with_buttom_line.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | -------------------------------------------------------------------------------- /appframework/src/main/res/values/strings.xml: -------------------------------------------------------------------------------- 1 | 2 | AppFrameWork 3 | 4 | Hello world! 5 | Settings 6 | 7 | 8 | 9 | 10 | set_theme 11 | 12 | 13 | 14 | 服务器正在开小差. 15 | 当前没有网络接入. 16 | 请求异常 17 | 18 | -------------------------------------------------------------------------------- /appframework/src/main/java/com/moon/appframework/common/properties/Property.java: -------------------------------------------------------------------------------- 1 | package com.moon.appframework.common.properties; 2 | 3 | import java.lang.annotation.ElementType; 4 | import java.lang.annotation.Retention; 5 | import java.lang.annotation.RetentionPolicy; 6 | import java.lang.annotation.Target; 7 | 8 | /** 9 | * @author kidcrazequ 10 | * 11 | */ 12 | @Retention(RetentionPolicy.RUNTIME) 13 | @Target(ElementType.FIELD) 14 | public @interface Property { 15 | String value() default ""; 16 | } 17 | -------------------------------------------------------------------------------- /appframework/src/main/java/com/moon/appframework/action/NetWorkAction.java: -------------------------------------------------------------------------------- 1 | package com.moon.appframework.action; 2 | 3 | import com.moon.appframework.event.XEvent; 4 | 5 | /** 6 | * Created by kidcrazequ on 15/8/24. 7 | */ 8 | public class NetWorkAction extends XAction{ 9 | 10 | public String key; 11 | public XEvent event; 12 | 13 | public NetWorkAction(String key, XEvent event){ 14 | this.key = key; 15 | this.event = event; 16 | this.type = ActionType.NETWORK; 17 | } 18 | } 19 | -------------------------------------------------------------------------------- /app/src/main/res/drawable/activated_background.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | -------------------------------------------------------------------------------- /app/src/main/res/drawable/bmob_update_button_close_bg_selector.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 6 | 8 | 10 | 11 | -------------------------------------------------------------------------------- /app/src/main/java/com/moon/myreadapp/common/event/UpdateArticleEvent.java: -------------------------------------------------------------------------------- 1 | package com.moon.myreadapp.common.event; 2 | 3 | import com.moon.appframework.event.XEvent; 4 | import com.moon.myreadapp.mvvm.models.dao.Feed; 5 | 6 | /** 7 | * Created by moon on 16/1/4. 8 | */ 9 | public class UpdateArticleEvent implements XEvent { 10 | 11 | private int fontSize; 12 | 13 | 14 | public UpdateArticleEvent(int size){ 15 | fontSize = size; 16 | } 17 | 18 | public int getFontSize() { 19 | return fontSize; 20 | } 21 | } 22 | -------------------------------------------------------------------------------- /app/src/main/res/layout/fragment_user_login_out.xml: -------------------------------------------------------------------------------- 1 | 2 | 11 | 12 | 13 | -------------------------------------------------------------------------------- /app/src/main/res/drawable/left_drawer_list.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | -------------------------------------------------------------------------------- /app/src/main/res/values/attrs.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | -------------------------------------------------------------------------------- /app/src/main/java/com/moon/myreadapp/common/event/UpdateUserEvent.java: -------------------------------------------------------------------------------- 1 | package com.moon.myreadapp.common.event; 2 | 3 | import com.moon.appframework.event.XEvent; 4 | import com.moon.myreadapp.mvvm.models.dao.Feed; 5 | import com.moon.myreadapp.mvvm.models.dao.User; 6 | 7 | /** 8 | * Created by moon on 16/01/06. 9 | */ 10 | public class UpdateUserEvent implements XEvent { 11 | 12 | private User user; 13 | 14 | public UpdateUserEvent(User user) { 15 | this.user = user; 16 | } 17 | 18 | public User getUser() { 19 | return user; 20 | } 21 | } 22 | -------------------------------------------------------------------------------- /app/src/main/res/drawable/bmob_update_button_ok_bg_selector.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 6 | 8 | 10 | 11 | -------------------------------------------------------------------------------- /app/src/main/res/drawable/bmob_update_button_cancel_bg_selector.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 6 | 8 | 10 | 11 | -------------------------------------------------------------------------------- /app/src/main/res/anim/image_slide_in.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 15 | -------------------------------------------------------------------------------- /app/src/main/res/anim/image_slide_out.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 15 | -------------------------------------------------------------------------------- /app/src/main/res/drawable/sub_btn_background.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 17 | 18 | 19 | -------------------------------------------------------------------------------- /app/src/main/res/layout/activity_setting.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 9 | 10 | 11 | 12 | 17 | 18 | 19 | 20 | -------------------------------------------------------------------------------- /appframework/src/main/java/com/moon/appframework/common/util/StringUtils.java: -------------------------------------------------------------------------------- 1 | package com.moon.appframework.common.util; 2 | 3 | /** 4 | * @author kidcrazequ 5 | * 6 | */ 7 | public class StringUtils { 8 | 9 | public static boolean isEmpty(final CharSequence cs) { 10 | return cs == null || cs.length() == 0; 11 | } 12 | 13 | public static boolean isNotEmpty(final CharSequence cs) { 14 | return !StringUtils.isEmpty(cs); 15 | } 16 | 17 | public static boolean isNull(String s){ 18 | return s==null || "null".equals(s); 19 | } 20 | 21 | 22 | public static String nullToString(String s){ 23 | return isNull(s)?"":s; 24 | } 25 | 26 | } 27 | -------------------------------------------------------------------------------- /app/src/main/res/layout/notice.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 18 | 19 | 20 | -------------------------------------------------------------------------------- /app/src/main/java/com/moon/myreadapp/common/event/UpdateUIEvent.java: -------------------------------------------------------------------------------- 1 | package com.moon.myreadapp.common.event; 2 | 3 | import com.moon.appframework.event.XEvent; 4 | import com.moon.myreadapp.mvvm.models.dao.Feed; 5 | 6 | /** 7 | * Created by moon on 15/12/16. 8 | */ 9 | public class UpdateUIEvent implements XEvent { 10 | 11 | 12 | /** 主题更改*/ 13 | public static int THEME_CHANGE = 1<<10; 14 | /** 15 | * 文章数量 修改 16 | */ 17 | public static int ARTIVIE_COUNT_CHANGE = 1<<11; 18 | 19 | private int status; 20 | public UpdateUIEvent(int status) { 21 | this.status = status; 22 | } 23 | 24 | public int getStatus() { 25 | return status; 26 | } 27 | } 28 | -------------------------------------------------------------------------------- /app/src/main/res/layout/fragment_theme_picker.xml: -------------------------------------------------------------------------------- 1 | 2 | 13 | -------------------------------------------------------------------------------- /appframework/src/main/java/com/moon/appframework/common/util/CollectionUtils.java: -------------------------------------------------------------------------------- 1 | package com.moon.appframework.common.util; 2 | 3 | import java.util.List; 4 | import java.util.Map; 5 | 6 | public class CollectionUtils { 7 | 8 | public static boolean isEmptyList(final List list) { 9 | return list == null || list.isEmpty(); 10 | } 11 | 12 | public static boolean isNotEmptyList(final List list) { 13 | return !isEmptyList(list); 14 | } 15 | 16 | public static boolean isEmpty(final Map map) { 17 | return map == null || map.isEmpty(); 18 | } 19 | 20 | public static boolean isNotEmpty(final Map map) { 21 | return !isEmpty(map); 22 | } 23 | 24 | } 25 | -------------------------------------------------------------------------------- /app/proguard-rules.pro: -------------------------------------------------------------------------------- 1 | # Add project specific ProGuard rules here. 2 | # By default, the flags in this file are appended to flags specified 3 | # in /Users/moon/Library/Android/sdk/tools/proguard/proguard-android.txt 4 | # You can edit the include path and order by changing the proguardFiles 5 | # directive in build.gradle. 6 | # 7 | # For more details, see 8 | # http://developer.android.com/guide/developing/tools/proguard.html 9 | 10 | # Add any project specific keep options here: 11 | 12 | # If your project uses WebView with JS, uncomment the following 13 | # and specify the fully qualified class name to the JavaScript interface 14 | # class: 15 | #-keepclassmembers class fqcn.of.javascript.interface.for.webview { 16 | # public *; 17 | #} 18 | -------------------------------------------------------------------------------- /app/src/main/res/layout/activity_article_web.xml: -------------------------------------------------------------------------------- 1 | 2 | 4 | 5 | 6 | 7 | 10 | 11 | 12 | 13 | 18 | 19 | -------------------------------------------------------------------------------- /app/src/main/res/anim/toast_out.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 14 | 16 | -------------------------------------------------------------------------------- /appframework/proguard-rules.pro: -------------------------------------------------------------------------------- 1 | # Add project specific ProGuard rules here. 2 | # By default, the flags in this file are appended to flags specified 3 | # in /Users/moon/Library/Android/sdk/tools/proguard/proguard-android.txt 4 | # You can edit the include path and order by changing the proguardFiles 5 | # directive in build.gradle. 6 | # 7 | # For more details, see 8 | # http://developer.android.com/guide/developing/tools/proguard.html 9 | 10 | # Add any project specific keep options here: 11 | 12 | # If your project uses WebView with JS, uncomment the following 13 | # and specify the fully qualified class name to the JavaScript interface 14 | # class: 15 | #-keepclassmembers class fqcn.of.javascript.interface.for.webview { 16 | # public *; 17 | #} 18 | -------------------------------------------------------------------------------- /app/src/main/java/com/moon/myreadapp/common/event/SynchronizeStateEvent.java: -------------------------------------------------------------------------------- 1 | package com.moon.myreadapp.common.event; 2 | 3 | import com.moon.appframework.event.XEvent; 4 | import com.moon.myreadapp.mvvm.models.SyncState; 5 | 6 | /** 7 | * Created by moon on 16/1/19. 8 | */ 9 | public class SynchronizeStateEvent implements XEvent { 10 | 11 | private static SyncState syncState; 12 | 13 | public static SyncState getInstance(){ 14 | if (syncState == null){ 15 | syncState = new SyncState(); 16 | } 17 | return syncState; 18 | } 19 | 20 | public SynchronizeStateEvent() { 21 | syncState = getInstance(); 22 | } 23 | 24 | public SyncState getSyncState() { 25 | return syncState; 26 | } 27 | 28 | } 29 | -------------------------------------------------------------------------------- /app/src/main/res/drawable/feed_list_item.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 15 | 16 | 17 | -------------------------------------------------------------------------------- /app/src/main/res/values/bmob_update_string.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 未联网 4 | 发现新版本 5 | 最新版本: 6 | 更新内容 7 | 仅需要下载: 8 | 新版本大小: 9 | (提示:非WIFI环境) 10 | 立即更新 11 | 应用更新 12 | 以后再说 13 | 忽略该版 14 | 正在更新中.... 15 | 最新版本已下载,是否安装? 16 | v3.1.4Beta 17 | 18 | -------------------------------------------------------------------------------- /app/src/main/java/com/moon/myreadapp/mvvm/models/SyncState.java: -------------------------------------------------------------------------------- 1 | package com.moon.myreadapp.mvvm.models; 2 | 3 | import android.support.annotation.StringRes; 4 | 5 | import com.moon.myreadapp.util.Globals; 6 | 7 | /** 8 | * Created by moon on 16/1/18. 9 | * 同步状态 10 | */ 11 | public class SyncState { 12 | private boolean isSpin; 13 | private String notice; 14 | 15 | public String getNotice() { 16 | return notice; 17 | } 18 | 19 | public void setNotice(String notice) { 20 | this.notice = notice; 21 | } 22 | public void setNotice(@StringRes int notice) { 23 | this.notice = Globals.getApplication().getString(notice); 24 | } 25 | 26 | public boolean isSpin() { 27 | return isSpin; 28 | } 29 | 30 | public void setIsSpin(boolean isSpin) { 31 | this.isSpin = isSpin; 32 | } 33 | } 34 | -------------------------------------------------------------------------------- /app/src/main/res/layout/tasty_toast_layout.xml: -------------------------------------------------------------------------------- 1 | 2 | 10 | 20 | 21 | -------------------------------------------------------------------------------- /app/src/main/java/com/moon/myreadapp/util/VibratorHelper.java: -------------------------------------------------------------------------------- 1 | package com.moon.myreadapp.util; 2 | 3 | import android.content.Context; 4 | import android.os.Vibrator; 5 | 6 | /** 7 | * Created by moon on 15/12/6. 8 | */ 9 | public class VibratorHelper { 10 | 11 | public enum TIME{ 12 | SHORT(100), 13 | NORMAL(200), 14 | LONG(400); 15 | 16 | long time; 17 | TIME(long t){ 18 | this.time = t; 19 | } 20 | } 21 | private static Vibrator vibrator; 22 | 23 | private static Vibrator getInstance(){ 24 | if (vibrator == null){ 25 | 26 | vibrator = (Vibrator) Globals.getApplication().getSystemService(Context.VIBRATOR_SERVICE); 27 | } 28 | return vibrator; 29 | } 30 | public synchronized static void shock(TIME time){ 31 | getInstance().vibrate(time.time); 32 | } 33 | } 34 | -------------------------------------------------------------------------------- /app/src/main/res/layout/gv_color_item.xml: -------------------------------------------------------------------------------- 1 | 2 | 8 | 14 | 19 | -------------------------------------------------------------------------------- /app/src/main/java/com/moon/myreadapp/common/components/pulltorefresh/EmptyLayout.java: -------------------------------------------------------------------------------- 1 | package com.moon.myreadapp.common.components.pulltorefresh; 2 | 3 | import android.content.Context; 4 | import android.view.Gravity; 5 | import android.view.View; 6 | import android.view.ViewGroup; 7 | import android.widget.FrameLayout; 8 | import android.widget.TextView; 9 | 10 | /** 11 | * Created by moon on 15/11/7. 12 | * 这个类封装了一个基本的empty view 13 | */ 14 | public class EmptyLayout extends FrameLayout { 15 | 16 | private TextView emptyView; 17 | 18 | public EmptyLayout(Context context) { 19 | super(context); 20 | emptyView = new TextView(context); 21 | emptyView.setLayoutParams(new ViewGroup.LayoutParams(ViewGroup.LayoutParams.MATCH_PARENT, ViewGroup.LayoutParams.MATCH_PARENT)); 22 | emptyView.setText("网络开小差了,请点击刷新"); 23 | emptyView.setGravity(Gravity.CENTER); 24 | addView(emptyView); 25 | } 26 | } 27 | -------------------------------------------------------------------------------- /app/src/main/res/layout/gv_share_item.xml: -------------------------------------------------------------------------------- 1 | 8 | 13 | 21 | -------------------------------------------------------------------------------- /app/src/main/res/layout/activity_image_browser.xml: -------------------------------------------------------------------------------- 1 | 2 | 5 | 6 | 11 | 12 | 22 | 23 | -------------------------------------------------------------------------------- /app/src/main/res/layout/fragment_image_detail.xml: -------------------------------------------------------------------------------- 1 | 2 | 6 | 7 | 15 | 16 | 23 | 24 | -------------------------------------------------------------------------------- /app/src/main/res/layout/lv_article_divider_header.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 7 | 8 | 16 | 17 | 23 | 24 | -------------------------------------------------------------------------------- /gradle.properties: -------------------------------------------------------------------------------- 1 | # Project-wide Gradle settings. 2 | 3 | # IDE (e.g. Android Studio) users: 4 | # Gradle settings configured through the IDE *will override* 5 | # any settings specified in this file. 6 | 7 | # For more details on how to configure your build environment visit 8 | # http://www.gradle.org/docs/current/userguide/build_environment.html 9 | 10 | # Specifies the JVM arguments used for the daemon process. 11 | # The setting is particularly useful for tweaking memory settings. 12 | # Default value: -Xmx10248m -XX:MaxPermSize=256m 13 | # org.gradle.jvmargs=-Xmx2048m -XX:MaxPermSize=512m -XX:+HeapDumpOnOutOfMemoryError -Dfile.encoding=UTF-8 14 | 15 | # When configured, Gradle will run in incubating parallel mode. 16 | # This option should only be used with decoupled projects. More details, visit 17 | # http://www.gradle.org/docs/current/userguide/multi_project_builds.html#sec:decoupled_projects 18 | # org.gradle.parallel=true 19 | org.gradle.parallel=true 20 | org.gradle.daemon=true 21 | org.gradle.jvmargs=-Xms256m -Xmx1024m -------------------------------------------------------------------------------- /app/src/main/res/menu/menu_web.xml: -------------------------------------------------------------------------------- 1 | 4 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | -------------------------------------------------------------------------------- /appframework/build.gradle: -------------------------------------------------------------------------------- 1 | apply plugin: 'com.android.library' 2 | 3 | android { 4 | 5 | compileSdkVersion 23 6 | buildToolsVersion '24.0.0-rc1' 7 | 8 | defaultConfig { 9 | minSdkVersion 18 10 | targetSdkVersion 21 11 | versionCode 1 12 | versionName "1.0" 13 | multiDexEnabled true 14 | } 15 | buildTypes { 16 | release { 17 | minifyEnabled false 18 | proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro' 19 | } 20 | } 21 | 22 | } 23 | 24 | dependencies { 25 | compile fileTree(include: ['*.jar'], dir: 'libs') 26 | compile 'com.android.support:appcompat-v7:23.0.1' 27 | compile 'de.halfbit:tinybus:3.0.2' 28 | compile 'de.halfbit:tinybus-extensions:3.0.2' 29 | compile 'com.jakewharton:butterknife:7.0.1' 30 | compile 'com.facebook.fresco:fresco:0.8.1+' 31 | compile 'com.joanzapata.iconify:android-iconify-fontawesome:2.1.0' 32 | // (v4.4) 33 | compile 'com.mcxiaoke.volley:library:1.0.19' 34 | } 35 | -------------------------------------------------------------------------------- /app/src/main/java/com/moon/myreadapp/mvvm/models/RequestFeed.java: -------------------------------------------------------------------------------- 1 | package com.moon.myreadapp.mvvm.models; 2 | 3 | /** 4 | * Created by chenhaohui on 16/6/5. 5 | */ 6 | public class RequestFeed { 7 | public String[] deliciousTags; 8 | public String feedId; 9 | public String language; 10 | public String title; 11 | public float velocity; 12 | public int subscribers; 13 | public long lastUpdated; 14 | public String website; 15 | public float score; 16 | public float coverage; 17 | public float coverageScore; 18 | public int estimatedEngagement; 19 | public String hint; 20 | public String scheme; 21 | public String description; 22 | public String contentType; 23 | public String coverUrl; 24 | public String iconUrl; 25 | public String partial; 26 | public String twitterScreenName; 27 | public String visualUrl; 28 | public String coverColor; 29 | public int twitterFollowers; 30 | public String facebookUsername; 31 | public int facebookLikes; 32 | public float art; 33 | } 34 | -------------------------------------------------------------------------------- /app/src/main/res/values/bmob_common_strings.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 正在下载中. 4 | 下载出错啦,请检查网络后继续。 5 | 暂停 6 | 继续 7 | 取消 8 | 正在下载: 9 | 暂停: 10 | 正在下载应用 11 | 正在更新安装包 12 | 请连接网络后再尝试! 13 | 下载失败 14 | 下载完成,请点击安装 15 | 更新完成,请点击安装 16 | 新版本已经准备好,请点击安装 17 | 18 | -------------------------------------------------------------------------------- /appframework/src/main/java/com/moon/appframework/common/util/SafeAsyncTask.java: -------------------------------------------------------------------------------- 1 | package com.moon.appframework.common.util; 2 | 3 | import android.os.AsyncTask; 4 | 5 | import java.util.Objects; 6 | 7 | public abstract class SafeAsyncTask extends AsyncTask{ 8 | 9 | @Override 10 | protected Result doInBackground(Object... params) { 11 | return null; 12 | } 13 | 14 | 15 | @Override 16 | protected void onPostExecute(Result result) { 17 | if(!isCancelled() && result != null){ 18 | onSafePostExecute(result); 19 | } 20 | } 21 | 22 | @Override 23 | protected void onCancelled(Result result) { 24 | onCancelled(); 25 | } 26 | 27 | 28 | /** 29 | * 更安全的方式在主线程执行,防止Activity,Fragment销毁时,task进程还在运行,导致空指针错误 30 | * @param result 31 | */ 32 | protected void onSafePostExecute(Result result){ 33 | 34 | } 35 | 36 | /* 37 | * (non-Javadoc) 38 | * @see android.os.AsyncTask#onCancelled() 39 | */ 40 | protected void onCancelled() { 41 | } 42 | 43 | public void destory(){ 44 | cancel(true); 45 | } 46 | 47 | } 48 | -------------------------------------------------------------------------------- /app/src/main/java/com/moon/myreadapp/common/components/rss/FeedlyResult.java: -------------------------------------------------------------------------------- 1 | package com.moon.myreadapp.common.components.rss; 2 | 3 | /** 4 | * @description: 5 | * @author: Match 6 | * @date: 11/18/15 7 | */ 8 | public class FeedlyResult { 9 | public String[] deliciousTags; 10 | public String feedId; 11 | public String language; 12 | public String title; 13 | public float velocity; 14 | public int subscribers; 15 | public long lastUpdated; 16 | public String website; 17 | public float score; 18 | public float coverage; 19 | public float coverageScore; 20 | public int estimatedEngagement; 21 | public String hint; 22 | public String scheme; 23 | public String description; 24 | public String contentType; 25 | public String coverUrl; 26 | public String iconUrl; 27 | public String partial; 28 | public String twitterScreenName; 29 | public String visualUrl; 30 | public String coverColor; 31 | public int twitterFollowers; 32 | public String facebookUsername; 33 | public int facebookLikes; 34 | public float art; 35 | } 36 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # 简读RSS 2 | ![image](https://github.com/moonChenHaohui/blog/blob/gh-pages/image/rss-logo.png) 3 | 4 | 5 | 使用Google Data Binding技术以MVVM模式来实现的一款Material Design风格的RSS阅读器。 6 | 7 | ## 效果图 8 | ![image](http://oidnhvewg.bkt.clouddn.com/Screenshot-1.jpg) 9 | 10 | ## 依赖 11 | * Android Data Binding,1.0-rc4 : [data binding home page](http://developer.android.com/tools/data-binding/guide.html) 12 | * design:23.1.1、recyclerview-v7:23.1.1、cardview-v7:23.1.1 13 | * GreenDao,V2.0.0 14 | * Bmob Sdk,V3.4.5:[http://www.bmob.cn](http://www.bmob.cn) 15 | * Gson,V2.5 16 | * TinyBus,V3.0.2 :[https://github.com/beworker/tinybus](https://github.com/beworker/tinybus) 17 | * Fresco,+ : [http://www.fresco-cn.org](http://www.fresco-cn.org) 18 | * materialdialog、materialedittext 19 | * iconfy, V2.1.0 :[https://github.com/JoanZapata/android-iconify](https://github.com/JoanZapata/android-iconify) 20 | * Volley,V1.0.19 21 | * WeChatSDK 22 | 23 | 24 | 25 | ## Log 26 | Click here [Log](https://github.com/moonChenHaohui/easy-Read-for-RSS/blob/master/LOG.md "Log") . 27 | 28 | ## 欢迎联系我 29 | Moon,Java程序猿,moon4chen@163.com 30 | >初入Android坑,求大神带飞; 31 | -------------------------------------------------------------------------------- /app/src/main/java/com/moon/myreadapp/common/adapter/AddSubViewPagerAdapter.java: -------------------------------------------------------------------------------- 1 | package com.moon.myreadapp.common.adapter; 2 | 3 | 4 | import android.support.v4.app.Fragment; 5 | import android.support.v4.app.FragmentManager; 6 | import android.support.v4.app.FragmentStatePagerAdapter; 7 | 8 | import java.util.List; 9 | 10 | /** 11 | * Created by moon on 15/12/17. 12 | */ 13 | public class AddSubViewPagerAdapter extends FragmentStatePagerAdapter { 14 | 15 | private String[] mTitles; 16 | private List mFragments; 17 | 18 | public AddSubViewPagerAdapter(FragmentManager fm, String[] mTitles, List mFragments) { 19 | super(fm); 20 | this.mTitles = mTitles; 21 | this.mFragments = mFragments; 22 | } 23 | 24 | @Override 25 | public CharSequence getPageTitle(int position) { 26 | return mTitles[position]; 27 | } 28 | 29 | @Override 30 | public Fragment getItem(int position) { 31 | return mFragments.get(position); 32 | } 33 | 34 | @Override 35 | public int getCount() { 36 | return mFragments.size(); 37 | } 38 | } 39 | -------------------------------------------------------------------------------- /app/src/main/java/com/moon/myreadapp/common/adapter/base/FeedAdapterHelper.java: -------------------------------------------------------------------------------- 1 | package com.moon.myreadapp.common.adapter.base; 2 | 3 | import android.support.annotation.StringRes; 4 | 5 | import com.moon.myreadapp.R; 6 | import com.moon.myreadapp.util.BuiltConfig; 7 | import com.moon.myreadapp.util.Globals; 8 | 9 | /** 10 | * Created by moon on 15/10/23. 11 | */ 12 | public class FeedAdapterHelper { 13 | 14 | 15 | public enum TimeType { 16 | TODATY(1,R.string.time_today), 17 | YESTORY(2,R.string.time_yesterday), 18 | BEFORE_YESTORY(3,R.string.time_before_yesterday), 19 | BBEFORE_YESTORY(4,R.string.time_bbefore_yesterday), 20 | MORE_BEFORE(5,R.string.time_more_before); 21 | 22 | private final int id; 23 | private final String type; 24 | 25 | TimeType(int id,@StringRes int resId){ 26 | this.id = id; 27 | this.type = BuiltConfig.getString(resId); 28 | } 29 | 30 | public int getId() { 31 | return id; 32 | } 33 | 34 | 35 | public String getType() { 36 | return type; 37 | } 38 | 39 | } 40 | 41 | } 42 | -------------------------------------------------------------------------------- /app/src/main/res/drawable/btn_normal.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | -------------------------------------------------------------------------------- /app/src/main/res/layout/fragment_loading.xml: -------------------------------------------------------------------------------- 1 | 2 | 8 | 16 | 24 | -------------------------------------------------------------------------------- /app/src/main/java/com/moon/myreadapp/common/components/photoview/gestures/GestureDetector.java: -------------------------------------------------------------------------------- 1 | /******************************************************************************* 2 | * Copyright 2011, 2012 Chris Banes. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | *******************************************************************************/ 16 | package com.moon.myreadapp.common.components.photoview.gestures; 17 | 18 | import android.view.MotionEvent; 19 | 20 | public interface GestureDetector { 21 | 22 | boolean onTouchEvent(MotionEvent ev); 23 | 24 | boolean isScaling(); 25 | 26 | void setOnGestureListener(OnGestureListener listener); 27 | 28 | } 29 | -------------------------------------------------------------------------------- /app/src/main/java/com/moon/myreadapp/common/components/photoview/gestures/OnGestureListener.java: -------------------------------------------------------------------------------- 1 | /******************************************************************************* 2 | * Copyright 2011, 2012 Chris Banes. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | *******************************************************************************/ 16 | package com.moon.myreadapp.common.components.photoview.gestures; 17 | 18 | public interface OnGestureListener { 19 | 20 | void onDrag(float dx, float dy); 21 | 22 | void onFling(float startX, float startY, float velocityX, 23 | float velocityY); 24 | 25 | void onScale(float scaleFactor, float focusX, float focusY); 26 | 27 | } -------------------------------------------------------------------------------- /app/src/main/java/com/moon/myreadapp/util/ImageHelper.java: -------------------------------------------------------------------------------- 1 | package com.moon.myreadapp.util; 2 | 3 | import android.net.Uri; 4 | 5 | import com.facebook.drawee.drawable.ScalingUtils; 6 | import com.facebook.drawee.generic.GenericDraweeHierarchy; 7 | import com.facebook.drawee.generic.GenericDraweeHierarchyBuilder; 8 | import com.facebook.drawee.view.SimpleDraweeView; 9 | import com.moon.myreadapp.R; 10 | 11 | /** 12 | * Created by moon on 15/12/5. 13 | */ 14 | public class ImageHelper { 15 | 16 | 17 | private static GenericDraweeHierarchyBuilder builder; 18 | 19 | private static GenericDraweeHierarchyBuilder getInstance(){ 20 | if (null == builder){ 21 | builder = 22 | new GenericDraweeHierarchyBuilder(Globals.getApplication().getResources()); 23 | } 24 | return builder; 25 | } 26 | 27 | public static void initImage(SimpleDraweeView simpleDraweeView){ 28 | GenericDraweeHierarchy hierarchy = getInstance().build(); 29 | //设置占位图 30 | hierarchy.setPlaceholderImage(R.drawable.image_bg); 31 | //中心缩放 32 | hierarchy.setActualImageScaleType(ScalingUtils.ScaleType.FOCUS_CROP); 33 | 34 | simpleDraweeView.setHierarchy(hierarchy); 35 | 36 | } 37 | } 38 | -------------------------------------------------------------------------------- /app/src/main/java/com/moon/myreadapp/common/components/scroll/ScrollState.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2014 Soichiro Kashima 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | package com.moon.myreadapp.common.components.scroll; 18 | 19 | /** 20 | * Constants that indicates the scroll state of the Scrollable widgets. 21 | */ 22 | public enum ScrollState { 23 | /** 24 | * Widget is stopped. 25 | * This state does not always mean that this widget_empty_home have never been scrolled. 26 | */ 27 | STOP, 28 | 29 | /** 30 | * Widget is scrolled up by swiping it down. 31 | */ 32 | UP, 33 | 34 | /** 35 | * Widget is scrolled down by swiping it up. 36 | */ 37 | DOWN, 38 | } 39 | -------------------------------------------------------------------------------- /app/src/main/java/com/moon/myreadapp/common/components/scrollview/ScrollState.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2014 Soichiro Kashima 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | package com.moon.myreadapp.common.components.scrollview; 18 | 19 | /** 20 | * Constants that indicates the scroll state of the Scrollable widgets. 21 | */ 22 | public enum ScrollState { 23 | /** 24 | * Widget is stopped. 25 | * This state does not always mean that this widget_empty_home have never been scrolled. 26 | */ 27 | STOP, 28 | 29 | /** 30 | * Widget is scrolled up by swiping it down. 31 | */ 32 | UP, 33 | 34 | /** 35 | * Widget is scrolled down by swiping it up. 36 | */ 37 | DOWN, 38 | } 39 | -------------------------------------------------------------------------------- /appframework/src/main/java/com/moon/appframework/common/business/XBusiness.java: -------------------------------------------------------------------------------- 1 | package com.moon.appframework.common.business; 2 | 3 | import android.app.Application; 4 | import android.content.Context; 5 | 6 | import com.android.volley.AuthFailureError; 7 | import com.android.volley.Request; 8 | import com.android.volley.RequestQueue; 9 | import com.android.volley.Response; 10 | import com.android.volley.VolleyError; 11 | import com.android.volley.toolbox.JsonObjectRequest; 12 | import com.android.volley.toolbox.StringRequest; 13 | import com.android.volley.toolbox.Volley; 14 | 15 | import org.json.JSONObject; 16 | 17 | import java.util.HashMap; 18 | import java.util.Map; 19 | 20 | /** 21 | * Created by moon on 15/10/4. 22 | */ 23 | public class XBusiness { 24 | 25 | public static void load (Context context,String url,final Map params,Response.Listener listener,Response.ErrorListener errorListener,final int method){ 26 | RequestQueue mQueue = Volley.newRequestQueue(context); 27 | JSONObject jsonObject = params ==null ? null : new JSONObject(params); 28 | JsonObjectRequest jsonObjectRequest = new JsonObjectRequest(method,url, jsonObject, 29 | listener,errorListener); 30 | mQueue.add(jsonObjectRequest); 31 | } 32 | } 33 | -------------------------------------------------------------------------------- /app/src/main/java/com/moon/myreadapp/util/BuiltConfig.java: -------------------------------------------------------------------------------- 1 | package com.moon.myreadapp.util; 2 | 3 | /** 4 | * Created by barry on 15/9/10. 5 | */ 6 | public class BuiltConfig { 7 | 8 | //禁止实例化 9 | private BuiltConfig() { 10 | 11 | } 12 | 13 | /** 14 | * 获取配置项的布尔值。如果配置项中写的字符串是“0”即判断为false,否则为true。 15 | * @param configResId 配置项的资源id 16 | * @return 某个配置功能是否打开 17 | */ 18 | public static boolean getBoolean(int configResId) { 19 | String configString = Globals.getApplication().getString(configResId); 20 | return !("0".equals(configString)); 21 | } 22 | 23 | /** 24 | * 获取配置项的整数值。 25 | * @param configResId 配置项的资源id 26 | * @return 某个配置项的整数值 27 | */ 28 | public static int getInt(int configResId) { 29 | return Integer.parseInt(Globals.getApplication().getString(configResId)); 30 | } 31 | 32 | /** 33 | * 获取配置项的字符串。 34 | * @param configResId 配置项的资源id 35 | * @return 某个配置项的字符串 36 | */ 37 | public static String getString(int configResId) { 38 | return Globals.getApplication().getString(configResId); 39 | } 40 | public static String getString(int configResId, Object... formatArgs) { 41 | return Globals.getApplication().getString(configResId,formatArgs); 42 | } 43 | } 44 | -------------------------------------------------------------------------------- /app/src/main/java/com/moon/myreadapp/common/components/dialog/TextFont.java: -------------------------------------------------------------------------------- 1 | package com.moon.myreadapp.common.components.dialog; 2 | 3 | /** 4 | * Created by moon on 16/1/4. 5 | */ 6 | 7 | import android.support.annotation.DimenRes; 8 | 9 | import com.moon.myreadapp.R; 10 | import com.moon.myreadapp.util.Globals; 11 | 12 | public enum TextFont{ 13 | H1(R.dimen.text_h1,5), 14 | H2(R.dimen.text_h2,4), 15 | H3(R.dimen.text_h3,3), 16 | H4(R.dimen.text_h4,2), 17 | H5(R.dimen.text_h5,1); 18 | 19 | @DimenRes 20 | public int size; 21 | public int level; 22 | TextFont(@DimenRes int s,int l){ 23 | size = s; 24 | level = l; 25 | } 26 | public static TextFont findByLevel(int l){ 27 | TextFont[] fonts = values(); 28 | for (int i = 0;i < fonts.length;i++){ 29 | if (fonts[i].level == l){ 30 | return fonts[i]; 31 | } 32 | } 33 | return H3; 34 | } 35 | public static TextFont findBySize(int size){ 36 | TextFont[] fonts = values(); 37 | for (int i = 0;i < fonts.length;i++){ 38 | if (Globals.getApplication().getResources().getDimension(fonts[i].size) == size){ 39 | return fonts[i]; 40 | } 41 | } 42 | return H3; 43 | } 44 | } -------------------------------------------------------------------------------- /app/src/main/res/values/colors.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | #000000 5 | #3D3D3D 6 | #999999 7 | #666666 8 | #8f8f8f 9 | 10 | #dcdcdc 11 | #dcdcdc 12 | #ffffff 13 | #0e508e 14 | #e8e8e8 15 | #00000000 16 | 17 | #CECECE 18 | #666 19 | 20 | #666 21 | #11aa11 22 | 23 | #f7f6f4 24 | #dcdcdc 25 | 26 | 27 | #2ecc71 28 | #e74c3c 29 | #3498db 30 | 31 | #c41411 32 | #f69988 33 | 34 | #66000000 35 | 36 | -------------------------------------------------------------------------------- /app/src/main/res/layout/pull_to_load_footer.xml: -------------------------------------------------------------------------------- 1 | 2 | 6 | 7 | 13 | 14 | 15 | 23 | 24 | 31 | 32 | 33 | 34 | -------------------------------------------------------------------------------- /app/src/main/java/com/moon/myreadapp/common/components/photoview/scrollerproxy/IcsScroller.java: -------------------------------------------------------------------------------- 1 | /******************************************************************************* 2 | * Copyright 2011, 2012 Chris Banes. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | *******************************************************************************/ 16 | package com.moon.myreadapp.common.components.photoview.scrollerproxy; 17 | 18 | import android.annotation.TargetApi; 19 | import android.content.Context; 20 | 21 | @TargetApi(14) 22 | public class IcsScroller extends GingerScroller { 23 | 24 | public IcsScroller(Context context) { 25 | super(context); 26 | } 27 | 28 | @Override 29 | public boolean computeScrollOffset() { 30 | return mScroller.computeScrollOffset(); 31 | } 32 | 33 | } 34 | -------------------------------------------------------------------------------- /app/src/main/java/com/moon/myreadapp/common/components/photoview/log/LogManager.java: -------------------------------------------------------------------------------- 1 | /******************************************************************************* 2 | * Copyright 2011, 2012 Chris Banes. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | *******************************************************************************/ 16 | package com.moon.myreadapp.common.components.photoview.log; 17 | 18 | import android.util.Log; 19 | 20 | /** 21 | * class that holds the {@link Logger} for this library, defaults to {@link LoggerDefault} to send logs to android {@link Log} 22 | */ 23 | public final class LogManager { 24 | 25 | private static Logger logger = new LoggerDefault(); 26 | 27 | public static void setLogger(Logger newLogger) { 28 | logger = newLogger; 29 | } 30 | 31 | public static Logger getLogger() { 32 | return logger; 33 | } 34 | 35 | } 36 | -------------------------------------------------------------------------------- /appframework/src/main/java/com/moon/appframework/util/LruImageCache.java: -------------------------------------------------------------------------------- 1 | package com.moon.appframework.util; 2 | 3 | import android.graphics.Bitmap; 4 | import android.util.LruCache; 5 | 6 | import com.android.volley.toolbox.ImageLoader; 7 | 8 | /** 9 | * Created by chenhaohui on 16/6/4. 10 | */ 11 | public class LruImageCache implements ImageLoader.ImageCache{ 12 | 13 | private static LruCache mMemoryCache; 14 | 15 | private static LruImageCache lruImageCache; 16 | 17 | private LruImageCache(){ 18 | // Get the Max available memory 19 | int maxMemory = (int) Runtime.getRuntime().maxMemory(); 20 | int cacheSize = maxMemory / 8; 21 | mMemoryCache = new LruCache(cacheSize){ 22 | @Override 23 | protected int sizeOf(String key, Bitmap bitmap){ 24 | return bitmap.getRowBytes() * bitmap.getHeight(); 25 | } 26 | }; 27 | } 28 | 29 | public static LruImageCache instance(){ 30 | if(lruImageCache == null){ 31 | lruImageCache = new LruImageCache(); 32 | } 33 | return lruImageCache; 34 | } 35 | 36 | @Override 37 | public Bitmap getBitmap(String arg0) { 38 | return mMemoryCache.get(arg0); 39 | } 40 | 41 | @Override 42 | public void putBitmap(String arg0, Bitmap arg1) { 43 | if(getBitmap(arg0) == null){ 44 | mMemoryCache.put(arg0, arg1); 45 | } 46 | } 47 | 48 | } -------------------------------------------------------------------------------- /app/src/main/res/layout/fragment_recommend_list.xml: -------------------------------------------------------------------------------- 1 | 2 | 4 | 5 | 6 | 9 | 10 | 11 | 14 | 15 | 24 | 32 | 33 | 34 | 35 | -------------------------------------------------------------------------------- /appframework/src/main/java/com/moon/appframework/core/XActivity.java: -------------------------------------------------------------------------------- 1 | package com.moon.appframework.core; 2 | 3 | import android.app.Activity; 4 | import android.content.pm.ActivityInfo; 5 | import android.os.Bundle; 6 | import android.support.annotation.IdRes; 7 | import android.support.v7.app.AppCompatActivity; 8 | import android.view.View; 9 | 10 | import butterknife.ButterKnife; 11 | 12 | /** 13 | * Created by kidcrazequ on 15/8/24. 14 | */ 15 | public class XActivity extends AppCompatActivity { 16 | 17 | private static XActivity activity; 18 | 19 | public static XActivity getInstance(){ 20 | return activity; 21 | } 22 | 23 | @Override 24 | public void onCreate(Bundle savedInstanceState){ 25 | super.onCreate(savedInstanceState); 26 | //禁止横屏 27 | setRequestedOrientation(ActivityInfo.SCREEN_ORIENTATION_PORTRAIT); 28 | activity = this; 29 | } 30 | 31 | @SuppressWarnings("unchecked") 32 | public T getView(int id) { 33 | T result = (T)findViewById(id); 34 | if (result == null) { 35 | throw new IllegalArgumentException("view 0x" + Integer.toHexString(id) 36 | + " doesn't exist"); 37 | } 38 | return result; 39 | } 40 | 41 | protected void setFragmentLayoutId(@IdRes int resId){ 42 | XFragmentManager.setLayoutId(resId); 43 | } 44 | 45 | protected void injectView(Activity target){ 46 | ButterKnife.bind(target); 47 | } 48 | 49 | } 50 | -------------------------------------------------------------------------------- /app/src/main/res/layout/activity_feed.xml: -------------------------------------------------------------------------------- 1 | 2 | 4 | 5 | 8 | 9 | 10 | 11 | 15 | 21 | 22 | 23 | 24 | 33 | 34 | 35 | 36 | 37 | -------------------------------------------------------------------------------- /app/src/main/res/layout/activity_article.xml: -------------------------------------------------------------------------------- 1 | 2 | 4 | 5 | 6 | 7 | 10 | 11 | 12 | 17 | 18 | 23 | 29 | 30 | 31 | 35 | 36 | 37 | -------------------------------------------------------------------------------- /app/src/main/java/com/moon/myreadapp/ui/SettingActivity.java: -------------------------------------------------------------------------------- 1 | package com.moon.myreadapp.ui; 2 | 3 | import android.databinding.DataBindingUtil; 4 | import android.os.Bundle; 5 | import android.support.design.widget.FloatingActionButton; 6 | import android.support.design.widget.Snackbar; 7 | import android.support.v7.app.AppCompatActivity; 8 | import android.support.v7.widget.Toolbar; 9 | import android.view.View; 10 | 11 | import com.moon.myreadapp.R; 12 | import com.moon.myreadapp.databinding.ActivitySettingBinding; 13 | import com.moon.myreadapp.ui.base.BaseActivity; 14 | import com.moon.myreadapp.ui.fragments.PrefFragment; 15 | 16 | public class SettingActivity extends BaseActivity { 17 | 18 | 19 | private ActivitySettingBinding binding; 20 | 21 | private Toolbar toolbar; 22 | @Override 23 | public void onCreate(Bundle savedInstanceState) { 24 | super.onCreate(savedInstanceState); 25 | toolbar = (Toolbar)findViewById(R.id.toolbar); 26 | initToolBar(toolbar); 27 | PrefFragment prefFragment = new PrefFragment(); 28 | getFragmentManager().beginTransaction().replace(R.id.setting_content, prefFragment).commit(); 29 | } 30 | 31 | @Override 32 | protected Toolbar getToolBar() { 33 | return null; 34 | } 35 | 36 | @Override 37 | protected int getLayoutView() { 38 | return R.layout.activity_setting; 39 | } 40 | 41 | @Override 42 | public void setContentViewAndBindVm(Bundle savedInstanceState) { 43 | this.binding = DataBindingUtil.setContentView(this,getLayoutView()); 44 | } 45 | } 46 | -------------------------------------------------------------------------------- /app/src/main/java/com/moon/myreadapp/common/components/pulltorefresh/PullToRefreshPSListView.java: -------------------------------------------------------------------------------- 1 | package com.moon.myreadapp.common.components.pulltorefresh; 2 | 3 | import android.content.Context; 4 | import android.util.AttributeSet; 5 | import android.view.View; 6 | import android.widget.AbsListView; 7 | import android.widget.AbsListView.OnScrollListener; 8 | import android.widget.Adapter; 9 | import android.widget.ListView; 10 | 11 | import com.moon.myreadapp.common.components.pinnedsectionlistView.PinnedSectionListView; 12 | import com.moon.myreadapp.common.components.pulltorefresh.ILoadingLayout.State; 13 | 14 | /** 15 | * 这个类实现了ListView下拉刷新,上加载更多和滑到底部自动加载 16 | * 17 | * @author Li Hong 18 | * @since 2013-8-15 19 | */ 20 | public class PullToRefreshPSListView extends PullToRefreshListView{ 21 | 22 | 23 | public PullToRefreshPSListView(Context context) { 24 | super(context); 25 | } 26 | 27 | public PullToRefreshPSListView(Context context, AttributeSet attrs) { 28 | super(context, attrs); 29 | } 30 | 31 | public PullToRefreshPSListView(Context context, AttributeSet attrs, int defStyle) { 32 | super(context, attrs, defStyle); 33 | } 34 | 35 | @Override 36 | protected ListView createRefreshableView(Context context, AttributeSet attrs) { 37 | ListView listView = new PinnedSectionListView(context,attrs); 38 | mListView = listView; 39 | mListView.setOnScrollListener(this); 40 | //mRecyclerView.setFooterDividersEnabled(false); 41 | mListView.setDivider(null); 42 | return listView; 43 | } 44 | } 45 | -------------------------------------------------------------------------------- /app/src/main/java/com/moon/myreadapp/common/components/rss/DateUtil.java: -------------------------------------------------------------------------------- 1 | package com.moon.myreadapp.common.components.rss; 2 | 3 | import java.text.ParseException; 4 | import java.text.SimpleDateFormat; 5 | import java.util.Calendar; 6 | import java.util.Date; 7 | 8 | 9 | /** 10 | * @description: 11 | * @author: Match 12 | * @date: 15-7-8 13 | */ 14 | public class DateUtil { 15 | private static final SimpleDateFormat TIME_FORMAT = new SimpleDateFormat("HH:mm"); 16 | /** 17 | * @see RFC 822 18 | */ 19 | private static final SimpleDateFormat RFC822 = new SimpleDateFormat( 20 | "EEE, dd MMM yyyy HH:mm:ss Z", java.util.Locale.ENGLISH); 21 | 22 | /* Hide constructor */ 23 | private DateUtil() {} 24 | 25 | public static CharSequence formatTime(Date date) { 26 | return TIME_FORMAT.format(date); 27 | } 28 | 29 | public static boolean isSameDay(Date date1, Date date2) { 30 | Calendar cal1 = Calendar.getInstance(); 31 | Calendar cal2 = Calendar.getInstance(); 32 | cal1.setTime(date1); 33 | cal2.setTime(date2); 34 | return cal1.get(Calendar.YEAR) == cal2.get(Calendar.YEAR) && 35 | cal1.get(Calendar.DAY_OF_YEAR) == cal2.get(Calendar.DAY_OF_YEAR); 36 | } 37 | 38 | /** 39 | * Parses string as an RFC 822 date/time. 40 | * 41 | */ 42 | public static Date parseRfc822(String date) { 43 | try { 44 | return RFC822.parse(date); 45 | } catch (ParseException e) { 46 | return new Date(); 47 | } 48 | } 49 | } 50 | -------------------------------------------------------------------------------- /app/src/main/java/com/moon/myreadapp/common/components/rss/RssHelper.java: -------------------------------------------------------------------------------- 1 | package com.moon.myreadapp.common.components.rss; 2 | 3 | import java.util.regex.Matcher; 4 | import java.util.regex.Pattern; 5 | 6 | /** 7 | * Created by chenhaohui on 16/6/22. 8 | */ 9 | public class RssHelper { 10 | public static boolean isURL(String str) { 11 | if (str == null) return false; 12 | //转换为小写 13 | str = str.replace(" ", ""); 14 | str = str.toLowerCase(); 15 | String regex = "^((https|http|ftp|rtsp|mms)?://)" 16 | + "?(([0-9a-z_!~*'().&=+$%-]+: )?[0-9a-z_!~*'().&=+$%-]+@)?" //ftp的user@ 17 | + "(([0-9]{1,3}\\.){3}[0-9]{1,3}" // IP形式的URL- 199.194.52.184 18 | + "|" // 允许IP和DOMAIN(域名) 19 | + "([0-9a-z_!~*'()-]+\\.)*" // 域名- www. 20 | + "([0-9a-z][0-9a-z-]{0,61})?[0-9a-z]\\." // 二级域名 21 | + "[a-z]{2,6})" // first level domain- .com or .museum 22 | + "(:[0-9]{1,4})?" // 端口- :80 23 | + "((/?)|" // a slash isn't required if there is no file name 24 | + "(/[0-9a-z_!~*'().;?:@&=+$,%#-]+)+/?)$"; 25 | Pattern pattern = Pattern.compile(regex); 26 | Matcher matcher = pattern.matcher(str); 27 | return matcher.matches(); 28 | } 29 | 30 | public static String adapterURL(String url) { 31 | String urls = url.replace(" ", "").replace("\n|\r", "").toLowerCase(); 32 | if (!urls.startsWith("http://") && !urls.startsWith("https://")) { 33 | urls = "http://" + urls; 34 | } 35 | return urls; 36 | } 37 | 38 | } 39 | -------------------------------------------------------------------------------- /app/build.gradle: -------------------------------------------------------------------------------- 1 | apply plugin: 'com.android.application' 2 | apply plugin: 'com.android.databinding' 3 | android { 4 | compileSdkVersion 23 5 | buildToolsVersion '24.0.0-rc1' 6 | 7 | defaultConfig { 8 | applicationId "com.moon.myreadapp" 9 | minSdkVersion 18 10 | targetSdkVersion 21 11 | versionCode 1 12 | versionName "1.0" 13 | multiDexEnabled true 14 | } 15 | buildTypes { 16 | release { 17 | minifyEnabled false 18 | proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro' 19 | } 20 | } 21 | packagingOptions { 22 | exclude 'META-INF/LICENSE.txt' 23 | } 24 | } 25 | 26 | dependencies { 27 | compile fileTree(include: ['*.jar'], dir: 'libs') 28 | compile project(':appframework') 29 | //recyclerview 30 | //green dao 31 | //compile 'com.android.support:appcompat-v7:23.1.1' 32 | //compile 'com.android.support:support-v4:23.1.1' 33 | compile 'com.android.support:design:23.1.1' 34 | 35 | //compile 'com.github.navasmdc:MaterialDesign:1.5@aar' navasmdc 这个库和v4包里面的一个rippleColor重名 36 | compile 'com.github.rey5137:material:1.2.2' 37 | 38 | compile 'me.drakeet.materialdialog:library:1.2.2' 39 | compile 'com.rengwuxian.materialedittext:library:2.1.4' 40 | //compile 'com.marshalchen.ultimaterecyclerview:library:0.3.18' 41 | compile 'de.greenrobot:greendao:2.0.0' 42 | compile 'com.android.support:recyclerview-v7:23.1.1' 43 | compile 'com.android.support:cardview-v7:23.1.1' 44 | compile 'com.github.moonChenHaohui:android_richtext:2.3' 45 | 46 | } 47 | -------------------------------------------------------------------------------- /app/src/main/res/values/picture_dimens.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 80dp 4 | 5 | 0dp 6 | 48dp 7 | 8 | 16dp 9 | 10 | 12dp 11 | 12 | 12dp 13 | 14 | 8dp 15 | 9dp 16 | 6dp 17 | 5dp 18 | 10dp 19 | 30dp 20 | 21 | 18dp 22 | 23 | 8dp 24 | 25 | 12dp 26 | 27 | 14dp 28 | 10dp 29 | 6dp 30 | 40dp 31 | 32 | -------------------------------------------------------------------------------- /app/src/main/java/com/moon/myreadapp/mvvm/models/ShareItem.java: -------------------------------------------------------------------------------- 1 | package com.moon.myreadapp.mvvm.models; 2 | 3 | import android.content.Context; 4 | import android.graphics.drawable.Drawable; 5 | import android.support.annotation.DrawableRes; 6 | import android.support.annotation.StringRes; 7 | import android.support.v4.content.ContextCompat; 8 | 9 | /** 10 | * Created by moon on 16/1/1. 11 | */ 12 | public class ShareItem { 13 | 14 | private Builder mBuilder; 15 | 16 | private ShareItem(Builder builder) { 17 | mBuilder = builder; 18 | } 19 | 20 | public 21 | @DrawableRes 22 | int getIcon() { 23 | return mBuilder.mIconRes; 24 | } 25 | 26 | public CharSequence getContent() { 27 | return mBuilder.mContent; 28 | } 29 | 30 | public static class Builder { 31 | 32 | private Context mContext; 33 | protected 34 | @DrawableRes 35 | int mIconRes; 36 | protected CharSequence mContent; 37 | 38 | public Builder(Context context) { 39 | mContext = context; 40 | } 41 | 42 | 43 | public Builder icon(@DrawableRes int iconRes) { 44 | mIconRes = iconRes; 45 | return this; 46 | } 47 | 48 | public Builder content(CharSequence content) { 49 | this.mContent = content; 50 | return this; 51 | } 52 | 53 | public Builder content(@StringRes int contentRes) { 54 | return content(mContext.getString(contentRes)); 55 | } 56 | 57 | public ShareItem build() { 58 | return new ShareItem(this); 59 | } 60 | } 61 | 62 | } 63 | -------------------------------------------------------------------------------- /appframework/src/main/java/com/moon/appframework/common/router/UrlParser.java: -------------------------------------------------------------------------------- 1 | package com.moon.appframework.common.router; 2 | 3 | import java.io.UnsupportedEncodingException; 4 | import java.net.URLDecoder; 5 | import java.util.HashMap; 6 | import java.util.Map; 7 | 8 | /** 9 | * @author kidcrazequ 10 | * 11 | */ 12 | public class UrlParser { 13 | 14 | /** 15 | * 解析url query参数 16 | * @param query query参数 17 | * @return Map.如{scanType=sao, isActivity=true, activityId=11, tips=中国国歌} 18 | */ 19 | public Map parse(String query){ 20 | Map query_pairs = new HashMap(); 21 | try { 22 | query_pairs = splitQuery(query); 23 | } catch (Exception e) { 24 | e.printStackTrace(); 25 | } 26 | return query_pairs; 27 | } 28 | 29 | /** 30 | * query转换map 31 | * @param query 32 | * @return 33 | * @throws UnsupportedEncodingException 34 | */ 35 | private Map splitQuery(String query) throws UnsupportedEncodingException { 36 | final Map query_pairs = new HashMap(); 37 | final String[] pairs = query.split("&"); 38 | for (String pair : pairs) { 39 | final int idx = pair.indexOf("="); 40 | final String key = idx > 0 ? URLDecoder.decode(pair.substring(0, idx), "UTF-8") : pair; 41 | final Object value = idx > 0 && pair.length() > idx + 1 ? URLDecoder.decode(pair.substring(idx + 1), "UTF-8") : null; 42 | query_pairs.put(key, value); 43 | } 44 | return query_pairs; 45 | } 46 | 47 | 48 | } 49 | -------------------------------------------------------------------------------- /app/src/main/java/com/moon/myreadapp/common/components/toast/ToastHelper.java: -------------------------------------------------------------------------------- 1 | package com.moon.myreadapp.common.components.toast; 2 | 3 | import android.app.Activity; 4 | import android.support.annotation.StringRes; 5 | import android.view.Gravity; 6 | import android.view.View; 7 | import android.view.ViewGroup; 8 | import android.view.animation.AnimationUtils; 9 | import android.widget.Toast; 10 | 11 | import com.moon.myreadapp.R; 12 | import com.moon.myreadapp.application.ReadApplication; 13 | import com.moon.myreadapp.util.BuiltConfig; 14 | import com.moon.myreadapp.util.Globals; 15 | import com.moon.myreadapp.util.ScreenUtils; 16 | 17 | /** 18 | * Created by moon on 15/12/24. 19 | */ 20 | public class ToastHelper { 21 | 22 | public static void showToast(String str) { 23 | Toast toast = Toast.makeText(ReadApplication.getInstance(), str, Toast.LENGTH_SHORT); 24 | toast.setGravity(Gravity.BOTTOM,0,0); 25 | toast.setMargin(0,0.1f); 26 | toast.show(); 27 | } 28 | 29 | public static void showToast(@StringRes int strid) { 30 | showToast(Globals.getApplication().getString(strid)); 31 | } 32 | public static void showToast(@StringRes int strid,Object ... objs) { 33 | showToast(Globals.getApplication().getString(strid,objs)); 34 | } 35 | 36 | public static TastyToast showNotice(Activity view, String txt, TastyToast.Style style) { 37 | TastyToast toast = TastyToast.makeText(view, txt, style).enableSwipeDismiss().setLayoutBelow(view.findViewById(R.id.toolbar)); 38 | toast.setOutAnimation(AnimationUtils.loadAnimation(view, R.anim.toast_out)); 39 | toast.show(); 40 | return toast; 41 | } 42 | } 43 | -------------------------------------------------------------------------------- /app/src/main/java/com/moon/myreadapp/mvvm/models/ModelHelper.java: -------------------------------------------------------------------------------- 1 | package com.moon.myreadapp.mvvm.models; 2 | 3 | import com.moon.myreadapp.mvvm.models.dao.Article; 4 | import com.moon.myreadapp.util.DBHelper; 5 | 6 | import java.util.ArrayList; 7 | import java.util.Date; 8 | import java.util.List; 9 | 10 | /** 11 | * Created by moon on 15/12/15. 12 | */ 13 | public class ModelHelper { 14 | 15 | 16 | /** 17 | * 从获取的文章中找出新更新的 18 | * @param feedId 19 | * @param articles 20 | * @return 21 | */ 22 | public static ArrayList
getUpDateArticlesByFeedId (long feedId,List
articles){ 23 | if(articles == null ||articles.size() ==0){ 24 | return null; 25 | } 26 | Article recentArticle = DBHelper.Query.getRecentArticleOnFeedByFeedId(feedId); 27 | ArrayList
result = new ArrayList
(); 28 | //如果没有找出,则把所有添加进去. 29 | if (recentArticle == null){ 30 | for (int i = 0; i < articles.size(); i++) { 31 | articles.get(i).setFeed_id(feedId); 32 | result.add(articles.get(i)); 33 | } 34 | } else { 35 | Date date = recentArticle.getPublishtime(); 36 | Date temp; 37 | for (int i = 0; i < articles.size(); i++) { 38 | articles.get(i).setFeed_id(feedId); 39 | temp = articles.get(i).getPublishtime(); 40 | //如果数据中没有日期,则直接加入;如果有,则加入日期之后的 41 | if (date == null || (temp != null && temp.after(date))) { 42 | result.add(articles.get(i)); 43 | } 44 | } 45 | } 46 | 47 | return result; 48 | } 49 | } 50 | -------------------------------------------------------------------------------- /app/src/main/java/com/moon/myreadapp/mvvm/models/dao/User.java: -------------------------------------------------------------------------------- 1 | package com.moon.myreadapp.mvvm.models.dao; 2 | 3 | // THIS CODE IS GENERATED BY greenDAO, DO NOT EDIT. Enable "keep" sections if you want to edit. 4 | 5 | import cn.bmob.v3.BmobObject; 6 | 7 | /** 8 | * Entity mapped to table "USER". 9 | */ 10 | public class User extends BmobObject { 11 | 12 | private Long id; 13 | /** Not-null value. */ 14 | private String account; 15 | private String password; 16 | private String nickname; 17 | 18 | public User() { 19 | } 20 | 21 | public User(Long id) { 22 | this.id = id; 23 | } 24 | 25 | public User(Long id, String account, String password, String nickname) { 26 | this.id = id; 27 | this.account = account; 28 | this.password = password; 29 | this.nickname = nickname; 30 | } 31 | 32 | public Long getId() { 33 | return id; 34 | } 35 | 36 | public void setId(Long id) { 37 | this.id = id; 38 | } 39 | 40 | /** Not-null value. */ 41 | public String getAccount() { 42 | return account; 43 | } 44 | 45 | /** Not-null value; ensure this value is available before it is saved to the database. */ 46 | public void setAccount(String account) { 47 | this.account = account; 48 | } 49 | 50 | public String getPassword() { 51 | return password; 52 | } 53 | 54 | public void setPassword(String password) { 55 | this.password = password; 56 | } 57 | 58 | public String getNickname() { 59 | return nickname; 60 | } 61 | 62 | public void setNickname(String nickname) { 63 | this.nickname = nickname; 64 | } 65 | 66 | } 67 | -------------------------------------------------------------------------------- /app/src/main/java/com/moon/myreadapp/common/components/dialog/AboutMeDialog.java: -------------------------------------------------------------------------------- 1 | package com.moon.myreadapp.common.components.dialog; 2 | 3 | import android.app.Activity; 4 | import android.content.Context; 5 | import android.databinding.DataBindingUtil; 6 | import android.os.Bundle; 7 | import android.text.Html; 8 | import android.text.method.LinkMovementMethod; 9 | import android.view.LayoutInflater; 10 | import android.view.MotionEvent; 11 | import android.view.View; 12 | 13 | import com.moon.appframework.core.XApplication; 14 | import com.moon.myreadapp.R; 15 | import com.moon.myreadapp.common.event.UpdateFeedEvent; 16 | import com.moon.myreadapp.constants.Constants; 17 | import com.moon.myreadapp.databinding.FragmentAboutMeBinding; 18 | import com.moon.myreadapp.databinding.FragmentFeedSetBinding; 19 | import com.moon.myreadapp.util.PreferenceUtils; 20 | import com.rey.material.app.Dialog; 21 | import com.rey.material.widget.Switch; 22 | 23 | /** 24 | * Created by moon on 16/01/07. 25 | */ 26 | public class AboutMeDialog extends Dialog { 27 | 28 | private FragmentAboutMeBinding binding; 29 | 30 | public AboutMeDialog(Context context) { 31 | super(context); 32 | 33 | } 34 | 35 | @Override 36 | protected void onCreate(Bundle savedInstanceState) { 37 | super.onCreate(savedInstanceState); 38 | layoutParams(-1, -2); 39 | canceledOnTouchOutside(false); 40 | binding = DataBindingUtil.inflate(getLayoutInflater(), R.layout.fragment_about_me, null, false); 41 | setContentView(binding.getRoot()); 42 | binding.aboutMeLink.setText(Html.fromHtml(getContext().getString(R.string.about_me_link))); 43 | binding.aboutMeLink.setMovementMethod(LinkMovementMethod.getInstance()); 44 | } 45 | } 46 | -------------------------------------------------------------------------------- /app/src/main/res/drawable/bmob_update_button_check_selector.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 6 | 9 | 10 | 13 | 16 | 17 | 20 | 23 | 24 | 27 | 30 | 31 | -------------------------------------------------------------------------------- /app/src/main/java/com/moon/myreadapp/common/adapter/base/BaseListAdapter.java: -------------------------------------------------------------------------------- 1 | package com.moon.myreadapp.common.adapter.base; 2 | 3 | import android.view.LayoutInflater; 4 | import android.view.View; 5 | import android.view.ViewGroup; 6 | import android.widget.BaseAdapter; 7 | 8 | import com.moon.myreadapp.util.Globals; 9 | 10 | import java.util.List; 11 | 12 | /** 13 | * Created by moon on 15/10/19. 14 | * 15 | */ 16 | public abstract class BaseListAdapter extends BaseAdapter { 17 | 18 | 19 | private List mData; 20 | protected LayoutInflater mInflater; 21 | 22 | public BaseListAdapter(List data) { 23 | mInflater = LayoutInflater.from(Globals.getApplication()); 24 | mData = data; 25 | } 26 | 27 | 28 | @Override 29 | public int getCount() { 30 | return mData.size(); 31 | } 32 | 33 | @Override 34 | public E getItem(int position) { 35 | return mData.get(position); 36 | } 37 | 38 | @Override 39 | public long getItemId(int position) { 40 | return mData.get(position).getClass().hashCode(); 41 | } 42 | 43 | public List getmData() { 44 | return mData; 45 | } 46 | 47 | public void setmData(List mData) { 48 | this.mData = mData; 49 | notifyDataSetChanged(); 50 | } 51 | 52 | public void add(E e) { 53 | this.mData.add(e); 54 | notifyDataSetChanged(); 55 | } 56 | 57 | public void addAll(List list) { 58 | this.mData.addAll(list); 59 | notifyDataSetChanged(); 60 | } 61 | 62 | public void remove(int position) { 63 | this.mData.remove(position); 64 | notifyDataSetChanged(); 65 | } 66 | public abstract View getView(int position, View convertView, ViewGroup parent); 67 | 68 | } -------------------------------------------------------------------------------- /appframework/src/main/java/com/moon/appframework/common/router/XRouter.java: -------------------------------------------------------------------------------- 1 | package com.moon.appframework.common.router; 2 | 3 | import android.content.Context; 4 | import android.content.Intent; 5 | import android.net.Uri; 6 | import android.os.Bundle; 7 | 8 | import com.moon.appframework.action.RouterAction; 9 | import com.moon.appframework.common.properties.RuleProperties; 10 | import com.moon.appframework.core.XApplication; 11 | import com.moon.appframework.core.XFragment; 12 | import com.moon.appframework.core.XFragmentManager; 13 | 14 | import java.util.HashMap; 15 | import java.util.Map; 16 | 17 | /** 18 | * @author kidcrazequ 19 | * 20 | */ 21 | public class XRouter { 22 | 23 | private static Map queryParames = new HashMap(); 24 | 25 | private XRouter(){ 26 | } 27 | 28 | public static void forward(Context context, RouterAction action){ 29 | // parser uri params 30 | Uri uri = Uri.parse(action.url); 31 | queryParames = new UrlParser().parse(uri.getQuery()); 32 | // rule 33 | RuleProperties ruleProperties = new RuleProperties(XApplication.getInstance()); 34 | ZRuler.createRule(ruleProperties).rule(context, action, action.url, queryParames); 35 | } 36 | 37 | public static void forward(Class clazz, Bundle args){ 38 | XFragmentManager.add((Class) clazz, args); 39 | } 40 | 41 | public static void forward(Context context, Class clazz, Bundle args){ 42 | Intent intent = new Intent(context, clazz); 43 | intent.putExtras(args); 44 | context.startActivity(intent); 45 | 46 | } 47 | 48 | private static Object getQueryParameters(String key){ 49 | return queryParames.get(key); 50 | } 51 | 52 | 53 | 54 | 55 | } 56 | -------------------------------------------------------------------------------- /app/src/main/java/com/moon/myreadapp/common/components/pulltorefresh/impl/FeedPTPRecyclerView.java: -------------------------------------------------------------------------------- 1 | package com.moon.myreadapp.common.components.pulltorefresh.impl; 2 | 3 | import android.content.Context; 4 | import android.databinding.DataBindingUtil; 5 | import android.util.AttributeSet; 6 | import android.view.LayoutInflater; 7 | import android.view.View; 8 | 9 | import com.moon.myreadapp.R; 10 | import com.moon.myreadapp.common.components.pulltorefresh.PullToRefreshRecyclerView; 11 | import com.moon.myreadapp.databinding.WidgetEmptyFeedBinding; 12 | import com.moon.myreadapp.databinding.WidgetEmptyHomeBinding; 13 | 14 | /** 15 | * Created by moon on 16/1/9. 16 | * 主页 使用的 下拉刷新控件 17 | */ 18 | public class FeedPTPRecyclerView extends PullToRefreshRecyclerView{ 19 | 20 | private WidgetEmptyFeedBinding emptyHomeBinding; 21 | 22 | public FeedPTPRecyclerView(Context context) { 23 | super(context); 24 | } 25 | 26 | public FeedPTPRecyclerView(Context context, AttributeSet attrs) { 27 | super(context, attrs); 28 | } 29 | 30 | public FeedPTPRecyclerView(Context context, AttributeSet attrs, int defStyle) { 31 | super(context, attrs, defStyle); 32 | } 33 | 34 | 35 | @Override 36 | protected View createEmptyLayout(Context context, AttributeSet attrs) { 37 | emptyHomeBinding = DataBindingUtil.inflate(LayoutInflater.from(context), R.layout.widget_empty_feed,null,false); 38 | emptyHomeBinding.refresh.setOnClickListener(new OnClickListener() { 39 | @Override 40 | public void onClick(View v) { 41 | setShowEmptyLayout(false); 42 | //刷新 43 | doPullRefreshing(true,300); 44 | 45 | } 46 | }); 47 | return emptyHomeBinding.getRoot(); 48 | } 49 | } 50 | -------------------------------------------------------------------------------- /app/src/main/java/com/moon/myreadapp/common/components/photoview/gestures/VersionedGestureDetector.java: -------------------------------------------------------------------------------- 1 | package com.moon.myreadapp.common.components.photoview.gestures; 2 | 3 | /******************************************************************************* 4 | * Copyright 2011, 2012 Chris Banes. 5 | * 6 | * Licensed under the Apache License, Version 2.0 (the "License"); 7 | * you may not use this file except in compliance with the License. 8 | * You may obtain a copy of the License at 9 | * 10 | * http://www.apache.org/licenses/LICENSE-2.0 11 | * 12 | * Unless required by applicable law or agreed to in writing, software 13 | * distributed under the License is distributed on an "AS IS" BASIS, 14 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 15 | * See the License for the specific language governing permissions and 16 | * limitations under the License. 17 | *******************************************************************************/ 18 | 19 | import android.content.Context; 20 | import android.os.Build; 21 | 22 | public final class VersionedGestureDetector { 23 | 24 | public static GestureDetector newInstance(Context context, 25 | OnGestureListener listener) { 26 | final int sdkVersion = Build.VERSION.SDK_INT; 27 | GestureDetector detector; 28 | 29 | if (sdkVersion < Build.VERSION_CODES.ECLAIR) { 30 | detector = new CupcakeGestureDetector(context); 31 | } else if (sdkVersion < Build.VERSION_CODES.FROYO) { 32 | detector = new EclairGestureDetector(context); 33 | } else { 34 | detector = new FroyoGestureDetector(context); 35 | } 36 | 37 | detector.setOnGestureListener(listener); 38 | 39 | return detector; 40 | } 41 | 42 | } -------------------------------------------------------------------------------- /app/src/main/res/layout/menu_singer_article.xml: -------------------------------------------------------------------------------- 1 | 2 | 6 | 16 | 17 | 27 | 28 | 38 | -------------------------------------------------------------------------------- /app/src/main/res/values/pull_refresh_strings.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 已经到底啦 5 | 松开加载更多 6 | 下拉可以刷新 7 | 松开获取更多 8 | 最后更新时间 : 9 | 正在加载中 10 | 正在加载中… 11 | 12 | 13 | 点击屏幕,重新加载 14 | 15 | 正在加载… 16 | 17 | 18 | @string/pushmsg_center_pull_down_text 19 | 上拉可以刷新 20 | 松开后刷新 21 | @string/pushmsg_center_load_more_ongoing_text 22 | @string/pushmsg_center_pull_down_update_time 23 | 松开载入更多 24 | @string/pull_to_refresh_header_hint_loading 25 | @string/pushmsg_center_no_more_msg 26 | 网络不给力,请检查网络 27 | 28 | 29 | 图片已保存到相册 30 | 保存图片失败 31 | 下一组: 32 | 上一组: 33 | 34 | -------------------------------------------------------------------------------- /app/src/main/java/com/moon/myreadapp/common/components/pulltorefresh/PullToRefreshWebView.java: -------------------------------------------------------------------------------- 1 | package com.moon.myreadapp.common.components.pulltorefresh; 2 | 3 | import android.content.Context; 4 | import android.util.AttributeSet; 5 | import android.webkit.WebView; 6 | 7 | /** 8 | * 封装了WebView的下拉刷新 9 | * 10 | * @author Li Hong 11 | * @since 2013-8-22 12 | */ 13 | public class PullToRefreshWebView extends PullToRefreshBase { 14 | /** 15 | * 构造方法 16 | * 17 | * @param context context 18 | */ 19 | public PullToRefreshWebView(Context context) { 20 | this(context, null); 21 | } 22 | 23 | /** 24 | * 构造方法 25 | * 26 | * @param context context 27 | * @param attrs attrs 28 | */ 29 | public PullToRefreshWebView(Context context, AttributeSet attrs) { 30 | this(context, attrs, 0); 31 | } 32 | 33 | /** 34 | * 构造方法 35 | * 36 | * @param context context 37 | * @param attrs attrs 38 | * @param defStyle defStyle 39 | */ 40 | public PullToRefreshWebView(Context context, AttributeSet attrs, int defStyle) { 41 | super(context, attrs, defStyle); 42 | } 43 | 44 | 45 | @Override 46 | protected WebView createRefreshableView(Context context, AttributeSet attrs) { 47 | WebView webView = new WebView(context); 48 | return webView; 49 | } 50 | 51 | 52 | @Override 53 | protected boolean isReadyForPullDown() { 54 | return mRefreshableView.getScrollY() == 0; 55 | } 56 | 57 | 58 | @Override 59 | protected boolean isReadyForPullUp() { 60 | double exactContentHeight = Math.floor((double)(mRefreshableView.getContentHeight() * mRefreshableView.getScale())); 61 | return mRefreshableView.getScrollY() >= (exactContentHeight - mRefreshableView.getHeight()); 62 | } 63 | } 64 | -------------------------------------------------------------------------------- /app/src/main/res/layout/widget_empty_feed.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 15 | 16 | 23 | 24 | 34 | 35 | 45 | 46 | -------------------------------------------------------------------------------- /app/src/main/java/com/moon/myreadapp/common/components/scroll/ObservableScrollViewCallbacks.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2014 Soichiro Kashima 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | package com.moon.myreadapp.common.components.scroll; 18 | 19 | /** 20 | * Callbacks for Scrollable widgets. 21 | */ 22 | public interface ObservableScrollViewCallbacks { 23 | /** 24 | * Called when the scroll change events occurred. 25 | *

This won't be called just after the view is laid out, so if you'd like to 26 | * initialize the position of your views with this method, you should call this manually 27 | * or invoke scroll as appropriate.

28 | * 29 | * @param scrollY Scroll position in Y axis. 30 | * @param firstScroll True when this is called for the first time in the consecutive motion events. 31 | * @param dragging True when the view is dragged and false when the view is scrolled in the inertia. 32 | */ 33 | void onScrollChanged(int scrollY, boolean firstScroll, boolean dragging); 34 | 35 | /** 36 | * Called when the down motion event occurred. 37 | */ 38 | void onDownMotionEvent(); 39 | 40 | /** 41 | * Called when the dragging ended or canceled. 42 | * 43 | * @param scrollState State to indicate the scroll direction. 44 | */ 45 | void onUpOrCancelMotionEvent(ScrollState scrollState); 46 | } 47 | -------------------------------------------------------------------------------- /app/src/main/java/com/moon/myreadapp/common/components/scrollview/ObservableScrollViewCallbacks.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2014 Soichiro Kashima 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | package com.moon.myreadapp.common.components.scrollview; 18 | 19 | /** 20 | * Callbacks for Scrollable widgets. 21 | */ 22 | public interface ObservableScrollViewCallbacks { 23 | /** 24 | * Called when the scroll change events occurred. 25 | * This won't be called just after the view is laid out, so if you'd like to 26 | * initialize the position of your views with this method, you should call this manually 27 | * or invoke scroll as appropriate. 28 | * 29 | * @param scrollY scroll position in Y axis 30 | * @param firstScroll true when this is called for the first time in the consecutive motion events 31 | * @param dragging true when the view is dragged and false when the view is scrolled in the inertia 32 | */ 33 | void onScrollChanged(int scrollY, boolean firstScroll, boolean dragging); 34 | 35 | /** 36 | * Called when the down motion event occurred. 37 | */ 38 | void onDownMotionEvent(); 39 | 40 | /** 41 | * Called when the dragging ended or canceled. 42 | * 43 | * @param scrollState state to indicate the scroll direction 44 | */ 45 | void onUpOrCancelMotionEvent(ScrollState scrollState); 46 | } 47 | -------------------------------------------------------------------------------- /app/src/main/res/layout/fragment_share.xml: -------------------------------------------------------------------------------- 1 | 2 | 5 | 6 | 7 | 8 | 9 | 10 | 17 | 25 | 26 | 34 | 35 |