├── app
├── .gitignore
├── src
│ ├── main
│ │ ├── assets
│ │ │ └── fonts
│ │ │ │ ├── Lobster-1.4.otf
│ │ │ │ ├── Futura-CondensedMedium.ttf
│ │ │ │ ├── FZLanTingHeiS-L-GB-Regular.TTF
│ │ │ │ └── FZLanTingHeiS-DB1-GB-Regular.TTF
│ │ ├── res
│ │ │ ├── drawable-hdpi
│ │ │ │ ├── ic_love.png
│ │ │ │ ├── ic_share.png
│ │ │ │ ├── ic_comment.png
│ │ │ │ ├── ic_back_arrow.png
│ │ │ │ ├── ic_down_arrow.png
│ │ │ │ ├── ic_create_write.png
│ │ │ │ ├── ic_info_outline.png
│ │ │ │ └── ic_drawer_settings.png
│ │ │ ├── drawable-xxhdpi
│ │ │ │ ├── ic_bg.jpg
│ │ │ │ └── comment_empty.png
│ │ │ ├── drawable
│ │ │ │ ├── shadow_left.png
│ │ │ │ ├── shadow_right.png
│ │ │ │ ├── shadow_bottom.png
│ │ │ │ ├── black_bg.xml
│ │ │ │ ├── shape_dots_select.xml
│ │ │ │ ├── shape_dots_default.xml
│ │ │ │ ├── shadow_gradient.xml
│ │ │ │ ├── shadow_gradient_reserve.xml
│ │ │ │ └── corner_btn.xml
│ │ │ ├── drawable-xhdpi
│ │ │ │ ├── home_pic.png
│ │ │ │ ├── account_avatar.png
│ │ │ │ ├── default_splash.jpg
│ │ │ │ ├── ic_action_back.png
│ │ │ │ ├── ic_eye_black_error.png
│ │ │ │ ├── ic_tab_strip_icon_feed_selected.png
│ │ │ │ ├── ic_tab_strip_icon_follow_selected.png
│ │ │ │ ├── ic_tab_strip_icon_category_selected.png
│ │ │ │ └── ic_tab_strip_icon_profile_selected.png
│ │ │ ├── mipmap-hdpi
│ │ │ │ └── ic_launcher.png
│ │ │ ├── mipmap-mdpi
│ │ │ │ └── ic_launcher.png
│ │ │ ├── mipmap-xhdpi
│ │ │ │ └── ic_launcher.png
│ │ │ ├── mipmap-xxhdpi
│ │ │ │ └── ic_launcher.png
│ │ │ ├── mipmap-xxxhdpi
│ │ │ │ └── ic_launcher.png
│ │ │ ├── values
│ │ │ │ ├── ids.xml
│ │ │ │ ├── dimens.xml
│ │ │ │ ├── strings.xml
│ │ │ │ ├── colors.xml
│ │ │ │ ├── styles.xml
│ │ │ │ └── attr.xml
│ │ │ ├── layout
│ │ │ │ ├── fragment_short_comment.xml
│ │ │ │ ├── recycle_head_layout.xml
│ │ │ │ ├── fragment_sections.xml
│ │ │ │ ├── layout_loading.xml
│ │ │ │ ├── fragment_themes_daily.xml
│ │ │ │ ├── item_themes_details_editors.xml
│ │ │ │ ├── fragment_daily_list.xml
│ │ │ │ ├── layout_empty_comment.xml
│ │ │ │ ├── activity_editor_info.xml
│ │ │ │ ├── fragment_long_comment.xml
│ │ │ │ ├── item_daily_list_time.xml
│ │ │ │ ├── activity_theme_daily_details.xml
│ │ │ │ ├── activity_splash.xml
│ │ │ │ ├── toolbar_layout.xml
│ │ │ │ ├── activity_sections_details.xml
│ │ │ │ ├── layout_custom_banner.xml
│ │ │ │ ├── item_themes_stories.xml
│ │ │ │ ├── activity_daily_comment.xml
│ │ │ │ ├── item_themes_daily.xml
│ │ │ │ ├── item_sections.xml
│ │ │ │ ├── activity_hotbitmapgg.xml
│ │ │ │ ├── activity_main.xml
│ │ │ │ ├── item_daily_list.xml
│ │ │ │ ├── item_sections_details.xml
│ │ │ │ ├── layout_themes_details_head.xml
│ │ │ │ ├── item_comment.xml
│ │ │ │ ├── activity_feedback.xml
│ │ │ │ └── activity_about.xml
│ │ │ ├── values-w820dp
│ │ │ │ └── dimens.xml
│ │ │ ├── values-v19
│ │ │ │ └── styles.xml
│ │ │ └── values-v21
│ │ │ │ └── styles.xml
│ │ ├── java
│ │ │ └── com
│ │ │ │ └── hotbitmapgg
│ │ │ │ └── leisureread
│ │ │ │ ├── mvp
│ │ │ │ ├── BasePresenter.java
│ │ │ │ ├── BaseView.java
│ │ │ │ ├── scope
│ │ │ │ │ ├── ActivityScope.java
│ │ │ │ │ └── FragmentScope.java
│ │ │ │ ├── model
│ │ │ │ │ ├── entity
│ │ │ │ │ │ ├── DailyExtraMessageInfo.java
│ │ │ │ │ │ ├── FeedBackInfo.java
│ │ │ │ │ │ ├── SectionsInfo.java
│ │ │ │ │ │ ├── DailyCommentInfo.java
│ │ │ │ │ │ ├── DailyDetailsInfo.java
│ │ │ │ │ │ └── SectionsDetailsInfo.java
│ │ │ │ │ └── component
│ │ │ │ │ │ └── SectionsComponent.java
│ │ │ │ ├── view
│ │ │ │ │ └── SectionsContract.java
│ │ │ │ └── presenter
│ │ │ │ │ ├── sections
│ │ │ │ │ └── SectionsPresenterMoudle.java
│ │ │ │ │ └── SectionsPresenter.java
│ │ │ │ ├── widget
│ │ │ │ ├── banner
│ │ │ │ │ ├── BannerEntity.java
│ │ │ │ │ └── BannerAdapter.java
│ │ │ │ ├── EmptyView.java
│ │ │ │ ├── recycler
│ │ │ │ │ ├── listeners
│ │ │ │ │ │ ├── AutoLoadOnScrollListener.java
│ │ │ │ │ │ └── EndlessRecyclerOnScrollListener.java
│ │ │ │ │ └── base
│ │ │ │ │ │ └── AbsRecyclerViewAdapter.java
│ │ │ │ ├── MultiSwipeRefreshLayout.java
│ │ │ │ └── SpringScrollView.java
│ │ │ │ ├── app
│ │ │ │ ├── AppComponent.java
│ │ │ │ ├── AppModule.java
│ │ │ │ ├── AppConstant.java
│ │ │ │ └── setting
│ │ │ │ │ └── GlideModuleSetting.java
│ │ │ │ ├── rx
│ │ │ │ ├── Rxutils.java
│ │ │ │ └── RxBus.java
│ │ │ │ ├── utils
│ │ │ │ ├── DateUtil.java
│ │ │ │ ├── WeekUtil.java
│ │ │ │ ├── SystemUiVisibilityUtil.java
│ │ │ │ ├── DisplayUtil.java
│ │ │ │ ├── LogUtil.java
│ │ │ │ ├── NetWorkUtil.java
│ │ │ │ ├── HtmlUtil.java
│ │ │ │ └── PreferenceUtils.java
│ │ │ │ ├── ui
│ │ │ │ ├── activity
│ │ │ │ │ ├── HotBitmapGGInfoActivity.java
│ │ │ │ │ ├── base
│ │ │ │ │ │ ├── BaseAppCompatActivity.java
│ │ │ │ │ │ └── BaseSwipeBackActivity.java
│ │ │ │ │ ├── AppAboutActivity.java
│ │ │ │ │ ├── SplashActivity.java
│ │ │ │ │ ├── FeedBackActivity.java
│ │ │ │ │ ├── DailyCommentActivity.java
│ │ │ │ │ ├── EditorInfoActivity.java
│ │ │ │ │ ├── MainActivity.java
│ │ │ │ │ └── SectionsDetailsActivity.java
│ │ │ │ ├── fragment
│ │ │ │ │ ├── base
│ │ │ │ │ │ └── BaseFragment.java
│ │ │ │ │ ├── UserInfoFragment.java
│ │ │ │ │ ├── ShortCommentFragment.java
│ │ │ │ │ ├── SectionsFragment.java
│ │ │ │ │ ├── LongCommentFragment.java
│ │ │ │ │ └── ThemesDailyFragment.java
│ │ │ │ └── adapter
│ │ │ │ │ ├── ThemeDetailsEditorsAdapter.java
│ │ │ │ │ ├── SectionsAdapter.java
│ │ │ │ │ ├── ThemeDailyAdapter.java
│ │ │ │ │ ├── ThemeDetailsStoriesAdapter.java
│ │ │ │ │ ├── SectionsDetailsAdapter.java
│ │ │ │ │ └── CommentAdapter.java
│ │ │ │ ├── LeisureReadApp.java
│ │ │ │ └── network
│ │ │ │ └── api
│ │ │ │ └── ApiService.java
│ │ └── AndroidManifest.xml
│ └── androidTest
│ │ └── java
│ │ └── com
│ │ └── hotbitmapgg
│ │ └── rxzhihu
│ │ └── ApplicationTest.java
├── proguard-rules.pro
└── build.gradle
├── settings.gradle
├── gradle
└── wrapper
│ ├── gradle-wrapper.jar
│ └── gradle-wrapper.properties
├── .gitignore
├── LeisureRead.iml
├── README.md
├── gradle.properties
└── gradlew.bat
/app/.gitignore:
--------------------------------------------------------------------------------
1 | /build
2 |
--------------------------------------------------------------------------------
/settings.gradle:
--------------------------------------------------------------------------------
1 | include ':app'
2 |
3 |
--------------------------------------------------------------------------------
/gradle/wrapper/gradle-wrapper.jar:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/HotBitmapGG/LeisureRead/HEAD/gradle/wrapper/gradle-wrapper.jar
--------------------------------------------------------------------------------
/app/src/main/assets/fonts/Lobster-1.4.otf:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/HotBitmapGG/LeisureRead/HEAD/app/src/main/assets/fonts/Lobster-1.4.otf
--------------------------------------------------------------------------------
/app/src/main/res/drawable-hdpi/ic_love.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/HotBitmapGG/LeisureRead/HEAD/app/src/main/res/drawable-hdpi/ic_love.png
--------------------------------------------------------------------------------
/app/src/main/res/drawable-xxhdpi/ic_bg.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/HotBitmapGG/LeisureRead/HEAD/app/src/main/res/drawable-xxhdpi/ic_bg.jpg
--------------------------------------------------------------------------------
/app/src/main/res/drawable/shadow_left.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/HotBitmapGG/LeisureRead/HEAD/app/src/main/res/drawable/shadow_left.png
--------------------------------------------------------------------------------
/app/src/main/res/drawable/shadow_right.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/HotBitmapGG/LeisureRead/HEAD/app/src/main/res/drawable/shadow_right.png
--------------------------------------------------------------------------------
/app/src/main/res/drawable-hdpi/ic_share.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/HotBitmapGG/LeisureRead/HEAD/app/src/main/res/drawable-hdpi/ic_share.png
--------------------------------------------------------------------------------
/app/src/main/res/drawable-xhdpi/home_pic.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/HotBitmapGG/LeisureRead/HEAD/app/src/main/res/drawable-xhdpi/home_pic.png
--------------------------------------------------------------------------------
/app/src/main/res/drawable/shadow_bottom.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/HotBitmapGG/LeisureRead/HEAD/app/src/main/res/drawable/shadow_bottom.png
--------------------------------------------------------------------------------
/app/src/main/res/mipmap-hdpi/ic_launcher.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/HotBitmapGG/LeisureRead/HEAD/app/src/main/res/mipmap-hdpi/ic_launcher.png
--------------------------------------------------------------------------------
/app/src/main/res/mipmap-mdpi/ic_launcher.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/HotBitmapGG/LeisureRead/HEAD/app/src/main/res/mipmap-mdpi/ic_launcher.png
--------------------------------------------------------------------------------
/app/src/main/res/drawable-hdpi/ic_comment.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/HotBitmapGG/LeisureRead/HEAD/app/src/main/res/drawable-hdpi/ic_comment.png
--------------------------------------------------------------------------------
/app/src/main/res/mipmap-xhdpi/ic_launcher.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/HotBitmapGG/LeisureRead/HEAD/app/src/main/res/mipmap-xhdpi/ic_launcher.png
--------------------------------------------------------------------------------
/app/src/main/res/mipmap-xxhdpi/ic_launcher.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/HotBitmapGG/LeisureRead/HEAD/app/src/main/res/mipmap-xxhdpi/ic_launcher.png
--------------------------------------------------------------------------------
/app/src/main/res/mipmap-xxxhdpi/ic_launcher.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/HotBitmapGG/LeisureRead/HEAD/app/src/main/res/mipmap-xxxhdpi/ic_launcher.png
--------------------------------------------------------------------------------
/app/src/main/res/drawable-hdpi/ic_back_arrow.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/HotBitmapGG/LeisureRead/HEAD/app/src/main/res/drawable-hdpi/ic_back_arrow.png
--------------------------------------------------------------------------------
/app/src/main/res/drawable-hdpi/ic_down_arrow.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/HotBitmapGG/LeisureRead/HEAD/app/src/main/res/drawable-hdpi/ic_down_arrow.png
--------------------------------------------------------------------------------
/app/src/main/assets/fonts/Futura-CondensedMedium.ttf:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/HotBitmapGG/LeisureRead/HEAD/app/src/main/assets/fonts/Futura-CondensedMedium.ttf
--------------------------------------------------------------------------------
/app/src/main/res/drawable-hdpi/ic_create_write.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/HotBitmapGG/LeisureRead/HEAD/app/src/main/res/drawable-hdpi/ic_create_write.png
--------------------------------------------------------------------------------
/app/src/main/res/drawable-hdpi/ic_info_outline.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/HotBitmapGG/LeisureRead/HEAD/app/src/main/res/drawable-hdpi/ic_info_outline.png
--------------------------------------------------------------------------------
/app/src/main/res/drawable-xhdpi/account_avatar.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/HotBitmapGG/LeisureRead/HEAD/app/src/main/res/drawable-xhdpi/account_avatar.png
--------------------------------------------------------------------------------
/app/src/main/res/drawable-xhdpi/default_splash.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/HotBitmapGG/LeisureRead/HEAD/app/src/main/res/drawable-xhdpi/default_splash.jpg
--------------------------------------------------------------------------------
/app/src/main/res/drawable-xhdpi/ic_action_back.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/HotBitmapGG/LeisureRead/HEAD/app/src/main/res/drawable-xhdpi/ic_action_back.png
--------------------------------------------------------------------------------
/app/src/main/res/drawable-xxhdpi/comment_empty.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/HotBitmapGG/LeisureRead/HEAD/app/src/main/res/drawable-xxhdpi/comment_empty.png
--------------------------------------------------------------------------------
/app/src/main/res/drawable-hdpi/ic_drawer_settings.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/HotBitmapGG/LeisureRead/HEAD/app/src/main/res/drawable-hdpi/ic_drawer_settings.png
--------------------------------------------------------------------------------
/app/src/main/res/drawable-xhdpi/ic_eye_black_error.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/HotBitmapGG/LeisureRead/HEAD/app/src/main/res/drawable-xhdpi/ic_eye_black_error.png
--------------------------------------------------------------------------------
/app/src/main/assets/fonts/FZLanTingHeiS-L-GB-Regular.TTF:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/HotBitmapGG/LeisureRead/HEAD/app/src/main/assets/fonts/FZLanTingHeiS-L-GB-Regular.TTF
--------------------------------------------------------------------------------
/app/src/main/assets/fonts/FZLanTingHeiS-DB1-GB-Regular.TTF:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/HotBitmapGG/LeisureRead/HEAD/app/src/main/assets/fonts/FZLanTingHeiS-DB1-GB-Regular.TTF
--------------------------------------------------------------------------------
/app/src/main/res/drawable-xhdpi/ic_tab_strip_icon_feed_selected.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/HotBitmapGG/LeisureRead/HEAD/app/src/main/res/drawable-xhdpi/ic_tab_strip_icon_feed_selected.png
--------------------------------------------------------------------------------
/app/src/main/res/drawable-xhdpi/ic_tab_strip_icon_follow_selected.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/HotBitmapGG/LeisureRead/HEAD/app/src/main/res/drawable-xhdpi/ic_tab_strip_icon_follow_selected.png
--------------------------------------------------------------------------------
/app/src/main/res/drawable-xhdpi/ic_tab_strip_icon_category_selected.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/HotBitmapGG/LeisureRead/HEAD/app/src/main/res/drawable-xhdpi/ic_tab_strip_icon_category_selected.png
--------------------------------------------------------------------------------
/app/src/main/res/drawable-xhdpi/ic_tab_strip_icon_profile_selected.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/HotBitmapGG/LeisureRead/HEAD/app/src/main/res/drawable-xhdpi/ic_tab_strip_icon_profile_selected.png
--------------------------------------------------------------------------------
/app/src/main/res/values/ids.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
--------------------------------------------------------------------------------
/gradle/wrapper/gradle-wrapper.properties:
--------------------------------------------------------------------------------
1 | #Tue Aug 23 22:35:11 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.14.1-all.zip
7 |
--------------------------------------------------------------------------------
/app/src/main/res/drawable/black_bg.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
8 |
9 |
--------------------------------------------------------------------------------
/app/src/main/java/com/hotbitmapgg/leisureread/mvp/BasePresenter.java:
--------------------------------------------------------------------------------
1 | package com.hotbitmapgg.leisureread.mvp;
2 |
3 | /**
4 | * Created by hcc on 2016/12/28 13:35
5 | * 100332338@qq.com
6 | * LeisureRead
7 | *
8 | * @HotBitmapGG MVP架构->Presenter层基类
9 | */
10 |
11 | public interface BasePresenter {
12 |
13 | void start();
14 | }
15 |
--------------------------------------------------------------------------------
/app/src/main/res/drawable/shape_dots_select.xml:
--------------------------------------------------------------------------------
1 |
2 |
4 |
5 |
6 |
7 |
10 |
11 |
--------------------------------------------------------------------------------
/app/src/main/java/com/hotbitmapgg/leisureread/mvp/BaseView.java:
--------------------------------------------------------------------------------
1 | package com.hotbitmapgg.leisureread.mvp;
2 |
3 | /**
4 | * Created by hcc on 2016/12/28 13:35
5 | * 100332338@qq.com
6 | * LeisureRead
7 | *
8 | * @HotBitmapGG MVP架构->View层基类
9 | */
10 |
11 | public interface BaseView {
12 |
13 | void setPresenter(T presenter);
14 | }
15 |
--------------------------------------------------------------------------------
/app/src/main/res/drawable/shape_dots_default.xml:
--------------------------------------------------------------------------------
1 |
2 |
4 |
5 |
6 |
7 |
10 |
11 |
--------------------------------------------------------------------------------
/app/src/main/res/drawable/shadow_gradient.xml:
--------------------------------------------------------------------------------
1 |
2 |
4 |
5 |
10 |
11 |
--------------------------------------------------------------------------------
/app/src/main/res/layout/fragment_short_comment.xml:
--------------------------------------------------------------------------------
1 |
2 |
--------------------------------------------------------------------------------
/app/src/main/res/drawable/shadow_gradient_reserve.xml:
--------------------------------------------------------------------------------
1 |
2 |
4 |
5 |
10 |
11 |
--------------------------------------------------------------------------------
/app/src/main/res/values-w820dp/dimens.xml:
--------------------------------------------------------------------------------
1 |
2 |
5 | 64dp
6 |
7 |
--------------------------------------------------------------------------------
/app/src/androidTest/java/com/hotbitmapgg/rxzhihu/ApplicationTest.java:
--------------------------------------------------------------------------------
1 | package com.hotbitmapgg.rxzhihu;
2 |
3 | import android.app.Application;
4 | import android.test.ApplicationTestCase;
5 |
6 | /**
7 | * Testing Fundamentals
8 | */
9 | public class ApplicationTest extends ApplicationTestCase
10 | {
11 | public ApplicationTest()
12 | {
13 | super(Application.class);
14 | }
15 | }
--------------------------------------------------------------------------------
/app/src/main/res/layout/recycle_head_layout.xml:
--------------------------------------------------------------------------------
1 |
2 |
5 |
6 |
10 |
11 |
12 |
13 |
14 |
--------------------------------------------------------------------------------
/app/src/main/java/com/hotbitmapgg/leisureread/mvp/scope/ActivityScope.java:
--------------------------------------------------------------------------------
1 | package com.hotbitmapgg.leisureread.mvp.scope;
2 |
3 | import static java.lang.annotation.RetentionPolicy.RUNTIME;
4 |
5 | import java.lang.annotation.Retention;
6 | import javax.inject.Scope;
7 |
8 | /**
9 | * A scoping annotation to permit objects whose lifetime should
10 | * conform to the life of the activity to be memorized in the
11 | * correct component.
12 | */
13 | @Scope
14 | @Retention(RUNTIME)
15 | public @interface ActivityScope {
16 |
17 | }
18 |
--------------------------------------------------------------------------------
/app/src/main/java/com/hotbitmapgg/leisureread/mvp/scope/FragmentScope.java:
--------------------------------------------------------------------------------
1 | package com.hotbitmapgg.leisureread.mvp.scope;
2 |
3 | import static java.lang.annotation.RetentionPolicy.RUNTIME;
4 |
5 | import java.lang.annotation.Retention;
6 | import javax.inject.Scope;
7 |
8 | /**
9 | * A scoping annotation to permit objects whose lifetime should
10 | * conform to the life of the activity to be memorized in the
11 | * correct component.
12 | */
13 | @Scope
14 | @Retention(RUNTIME)
15 | public @interface FragmentScope {
16 |
17 | }
18 |
--------------------------------------------------------------------------------
/app/src/main/res/values/dimens.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 | 16dp
4 | 16dp
5 |
6 | 56dp
7 | 4dp
8 | 256dp
9 | 206dp
10 |
11 |
--------------------------------------------------------------------------------
/app/src/main/java/com/hotbitmapgg/leisureread/widget/banner/BannerEntity.java:
--------------------------------------------------------------------------------
1 | package com.hotbitmapgg.leisureread.widget.banner;
2 |
3 | /**
4 | * Created by hcc on 2016/12/28 13:35
5 | * 100332338@qq.com
6 | * LeisureRead
7 | *
8 | * @HotBitmapGG Banner模型类
9 | */
10 | public class BannerEntity {
11 |
12 | public BannerEntity(int id, String title, String img) {
13 |
14 | this.id = id;
15 | this.title = title;
16 | this.img = img;
17 | }
18 |
19 |
20 | public String title;
21 |
22 | public String img;
23 |
24 | public int id;
25 | }
26 |
--------------------------------------------------------------------------------
/app/src/main/res/values-v19/styles.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
7 |
8 |
11 |
12 |
15 |
16 |
17 |
--------------------------------------------------------------------------------
/app/src/main/java/com/hotbitmapgg/leisureread/app/AppComponent.java:
--------------------------------------------------------------------------------
1 | package com.hotbitmapgg.leisureread.app;
2 |
3 | import com.hotbitmapgg.leisureread.LeisureReadApp;
4 | import dagger.Component;
5 | import javax.inject.Singleton;
6 |
7 | import android.content.Context;
8 |
9 | /**
10 | * Created by hcc on 2016/12/28 13:35
11 | * 100332338@qq.com
12 | * LeisureRead
13 | *
14 | * @HotBitmapGG AppComponent
15 | */
16 | @Singleton
17 | @Component(modules = AppModule.class)
18 | public interface AppComponent {
19 |
20 | Context context();
21 |
22 | void inject(LeisureReadApp mApplication);
23 | }
24 |
--------------------------------------------------------------------------------
/app/src/main/res/values/strings.xml:
--------------------------------------------------------------------------------
1 |
2 | LeisureRead
3 | 不急不躁,不紧不慢,就这样闲读.
4 | 分享
5 | 来自「LeisureRead」的分享:
6 | 1.0
7 | HotBitmapGG
8 | 查看我的个人主页
9 | 意见反馈
10 | 通用设置
11 | 关于App
12 |
13 |
14 |
--------------------------------------------------------------------------------
/app/src/main/res/layout/fragment_sections.xml:
--------------------------------------------------------------------------------
1 |
2 |
5 |
6 |
7 |
8 |
9 |
10 |
16 |
17 |
--------------------------------------------------------------------------------
/app/src/main/java/com/hotbitmapgg/leisureread/mvp/model/entity/DailyExtraMessageInfo.java:
--------------------------------------------------------------------------------
1 | package com.hotbitmapgg.leisureread.mvp.model.entity;
2 |
3 | import com.google.gson.annotations.SerializedName;
4 |
5 | /**
6 | * Created by hcc on 2016/12/28 13:35
7 | * 100332338@qq.com
8 | * LeisureRead
9 | *
10 | * @HotBitmapGG 日报额外数据模型类
11 | */
12 | public class DailyExtraMessageInfo {
13 |
14 | public int comments;
15 |
16 | @SerializedName("long_comments")
17 | public int longComments;
18 |
19 | public int popularity;
20 |
21 | @SerializedName("short_comments")
22 | public int shortComments;
23 | }
24 |
--------------------------------------------------------------------------------
/app/src/main/res/layout/layout_loading.xml:
--------------------------------------------------------------------------------
1 |
2 |
11 |
12 |
--------------------------------------------------------------------------------
/app/src/main/res/layout/fragment_themes_daily.xml:
--------------------------------------------------------------------------------
1 |
2 |
5 |
6 |
7 |
8 |
9 |
10 |
16 |
17 |
--------------------------------------------------------------------------------
/app/src/main/res/layout/item_themes_details_editors.xml:
--------------------------------------------------------------------------------
1 |
2 |
6 |
7 |
14 |
15 |
--------------------------------------------------------------------------------
/app/src/main/java/com/hotbitmapgg/leisureread/rx/Rxutils.java:
--------------------------------------------------------------------------------
1 | package com.hotbitmapgg.leisureread.rx;
2 |
3 | import rx.Observable;
4 | import rx.android.schedulers.AndroidSchedulers;
5 | import rx.schedulers.Schedulers;
6 |
7 | /**
8 | * Created by hcc on 2017/1/3 15:12
9 | * 100332338@qq.com
10 | * LeisureRead
11 | *
12 | * @HotBitmapGG Rxjava工具类
13 | */
14 |
15 | public class Rxutils {
16 |
17 | /**
18 | * rxjava线程切换工具类
19 | */
20 | public static Observable.Transformer normalSchedulers() {
21 | return tObservable -> tObservable.subscribeOn(Schedulers.io())
22 | .observeOn(AndroidSchedulers.mainThread());
23 | }
24 |
25 |
26 |
27 | }
28 |
--------------------------------------------------------------------------------
/app/src/main/res/layout/fragment_daily_list.xml:
--------------------------------------------------------------------------------
1 |
2 |
6 |
7 |
8 |
14 |
15 |
16 |
17 |
18 |
19 |
--------------------------------------------------------------------------------
/.gitignore:
--------------------------------------------------------------------------------
1 | .gradle
2 | /local.properties
3 | /.idea/workspace.xml
4 | /.idea/libraries
5 | .DS_Store
6 | /build
7 | /captures
8 |
9 | .idea/compiler.xml
10 |
11 | .idea/copyright/profiles_settings.xml
12 |
13 | .idea/encodings.xml
14 |
15 | .idea/gradle.xml
16 |
17 | .idea/misc.xml
18 |
19 | .idea/modules.xml
20 |
21 | app/app.iml
22 |
23 | .idea/runConfigurations.xml
24 |
25 | .idea/vcs.xml
26 |
27 | projectFilesBackup/.idea/workspace.xml
28 |
29 | .idea/dictionaries/hcc.xml
30 |
31 | .idea/inspectionProfiles/profiles_settings.xml
32 |
33 | .idea/inspectionProfiles/Project_Default.xml
34 |
35 | .idea/codeStyleSettings.xml
36 |
37 | .idea/codeStyleSettings.xml
38 |
39 | .idea/codeStyleSettings.xml
40 |
--------------------------------------------------------------------------------
/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 D:\eclipse_32\adt-bundle-windows-x86-20140702\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/hotbitmapgg/leisureread/app/AppModule.java:
--------------------------------------------------------------------------------
1 | package com.hotbitmapgg.leisureread.app;
2 |
3 | import com.hotbitmapgg.leisureread.LeisureReadApp;
4 | import dagger.Module;
5 | import dagger.Provides;
6 | import javax.inject.Singleton;
7 |
8 | import android.content.Context;
9 |
10 | /**
11 | * Created by hcc on 2016/12/28 13:35
12 | * 100332338@qq.com
13 | * LeisureRead
14 | *
15 | * @HotBitmapGG AppModule
16 | */
17 | @Module
18 | public class AppModule {
19 |
20 | private final LeisureReadApp mApplication;
21 |
22 |
23 | public AppModule(LeisureReadApp mApplication) {
24 |
25 | this.mApplication = mApplication;
26 | }
27 |
28 |
29 | @Provides
30 | @Singleton
31 | Context provideApplicationContext() {
32 |
33 | return mApplication;
34 | }
35 | }
36 |
--------------------------------------------------------------------------------
/app/src/main/java/com/hotbitmapgg/leisureread/mvp/view/SectionsContract.java:
--------------------------------------------------------------------------------
1 | package com.hotbitmapgg.leisureread.mvp.view;
2 |
3 | import com.hotbitmapgg.leisureread.mvp.BasePresenter;
4 | import com.hotbitmapgg.leisureread.mvp.BaseView;
5 | import com.hotbitmapgg.leisureread.mvp.model.entity.SectionsInfo;
6 |
7 | import java.util.List;
8 |
9 | /**
10 | * Created by hcc on 2016/12/28 13:35
11 | * 100332338@qq.com
12 | * LeisureRead
13 | *
14 | * @HotBitmapGG
15 | */
16 |
17 | public interface SectionsContract {
18 |
19 | interface View extends BaseView {
20 |
21 | void showError();
22 |
23 | void showData(List sectionsDetailsInfos);
24 | }
25 |
26 | interface Presenter extends BasePresenter {
27 |
28 | void loadData();
29 | }
30 | }
31 |
--------------------------------------------------------------------------------
/app/src/main/java/com/hotbitmapgg/leisureread/mvp/model/component/SectionsComponent.java:
--------------------------------------------------------------------------------
1 | package com.hotbitmapgg.leisureread.mvp.model.component;
2 |
3 | import com.hotbitmapgg.leisureread.app.AppComponent;
4 | import com.hotbitmapgg.leisureread.mvp.presenter.sections.SectionsPresenterMoudle;
5 | import com.hotbitmapgg.leisureread.mvp.scope.ActivityScope;
6 | import com.hotbitmapgg.leisureread.ui.activity.MainActivity;
7 |
8 | import dagger.Component;
9 |
10 | /**
11 | * Created by hcc on 2016/12/28 13:35
12 | * 100332338@qq.com
13 | * LeisureRead
14 | *
15 | * @HotBitmapGG
16 | */
17 | @ActivityScope
18 | @Component(dependencies = AppComponent.class, modules = { SectionsPresenterMoudle.class })
19 | public interface SectionsComponent {
20 |
21 | void inject(MainActivity mainActivity);
22 | }
23 |
--------------------------------------------------------------------------------
/app/src/main/res/layout/layout_empty_comment.xml:
--------------------------------------------------------------------------------
1 |
2 |
7 |
8 |
9 |
13 |
14 |
21 |
22 |
--------------------------------------------------------------------------------
/app/src/main/res/layout/activity_editor_info.xml:
--------------------------------------------------------------------------------
1 |
2 |
7 |
8 |
9 |
10 |
13 |
14 |
18 |
19 |
20 |
21 |
22 |
23 |
24 |
--------------------------------------------------------------------------------
/app/src/main/res/layout/fragment_long_comment.xml:
--------------------------------------------------------------------------------
1 |
2 |
6 |
7 |
13 |
14 |
15 |
21 |
22 |
23 |
24 |
--------------------------------------------------------------------------------
/app/src/main/java/com/hotbitmapgg/leisureread/mvp/presenter/sections/SectionsPresenterMoudle.java:
--------------------------------------------------------------------------------
1 | package com.hotbitmapgg.leisureread.mvp.presenter.sections;
2 |
3 | import com.hotbitmapgg.leisureread.mvp.view.SectionsContract;
4 | import com.hotbitmapgg.leisureread.mvp.scope.ActivityScope;
5 |
6 | import dagger.Module;
7 | import dagger.Provides;
8 |
9 | /**
10 | * Created by hcc on 2016/12/28 13:35
11 | * 100332338@qq.com
12 | * LeisureRead
13 | *
14 | * @HotBitmapGG
15 | */
16 |
17 | @Module
18 | public class SectionsPresenterMoudle {
19 |
20 | private final SectionsContract.View mView;
21 |
22 |
23 | public SectionsPresenterMoudle(SectionsContract.View mView) {
24 |
25 | this.mView = mView;
26 | }
27 |
28 |
29 | @Provides
30 | @ActivityScope
31 | SectionsContract.View view() {
32 |
33 | return this.mView;
34 | }
35 | }
36 |
--------------------------------------------------------------------------------
/app/src/main/res/layout/item_daily_list_time.xml:
--------------------------------------------------------------------------------
1 |
2 |
7 |
8 |
19 |
20 |
21 |
22 |
--------------------------------------------------------------------------------
/app/src/main/res/layout/activity_theme_daily_details.xml:
--------------------------------------------------------------------------------
1 |
2 |
7 |
8 |
9 |
10 |
13 |
14 |
20 |
21 |
22 |
23 |
24 |
25 |
--------------------------------------------------------------------------------
/LeisureRead.iml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
16 |
17 |
18 |
19 |
--------------------------------------------------------------------------------
/README.md:
--------------------------------------------------------------------------------
1 | # 闲读App
2 |
3 |
4 |
5 |
6 |
7 | ## About me
8 |
9 | [](http://weibo.com/3223089177/profile?topnav=1&wvr=6&is_all=1)
10 |
11 | An android developer in Wuhan.
12 |
13 | If you want to make friends with me, You can focus on my weibo.
14 |
15 |
16 | ## License
17 |
18 | Copyright 2017 HotBitmapGG
19 |
20 | Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at
21 |
22 | http://www.apache.org/licenses/LICENSE-2.0
23 |
24 | Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.
25 |
26 |
27 |
28 |
29 |
--------------------------------------------------------------------------------
/app/src/main/java/com/hotbitmapgg/leisureread/utils/DateUtil.java:
--------------------------------------------------------------------------------
1 | package com.hotbitmapgg.leisureread.utils;
2 |
3 | import java.text.SimpleDateFormat;
4 |
5 | import android.annotation.SuppressLint;
6 |
7 | /**
8 | * Created by hcc on 2016/12/28 13:35
9 | * 100332338@qq.com
10 | * LeisureRead
11 | *
12 | * @HotBitmapGG 时间工具类
13 | */
14 | public class DateUtil {
15 |
16 | private DateUtil() {
17 |
18 | }
19 |
20 |
21 | public static String formatDate(String date) {
22 |
23 | String dateFormat = null;
24 | try {
25 | dateFormat = date.substring(4, 6) + "月" + date.substring(6, 8) + "日";
26 | } catch (Exception e) {
27 | e.printStackTrace();
28 | }
29 | return dateFormat;
30 | }
31 |
32 |
33 | @SuppressLint("SimpleDateFormat")
34 | public static String getTime(long date) {
35 | SimpleDateFormat format = new SimpleDateFormat("MM-dd HH:mm:ss");
36 | return format.format(date);
37 | }
38 | }
39 |
--------------------------------------------------------------------------------
/app/src/main/java/com/hotbitmapgg/leisureread/widget/EmptyView.java:
--------------------------------------------------------------------------------
1 | package com.hotbitmapgg.leisureread.widget;
2 |
3 | import com.hotbitmapgg.rxzhihu.R;
4 |
5 | import android.content.Context;
6 | import android.util.AttributeSet;
7 | import android.view.LayoutInflater;
8 | import android.view.View;
9 | import android.widget.LinearLayout;
10 |
11 | /**
12 | * Created by hcc on 2016/12/28 13:35
13 | * 100332338@qq.com
14 | * LeisureRead
15 | *
16 | * @HotBitmapGG emptyView
17 | */
18 | public class EmptyView extends LinearLayout {
19 |
20 | public EmptyView(Context context) {
21 |
22 | this(context, null);
23 | }
24 |
25 |
26 | public EmptyView(Context context, AttributeSet attrs) {
27 |
28 | super(context, attrs);
29 | init();
30 | }
31 |
32 |
33 | private void init() {
34 |
35 | View view = LayoutInflater.from(getContext()).inflate(R.layout.layout_empty_comment, null);
36 | addView(view);
37 | }
38 | }
39 |
--------------------------------------------------------------------------------
/app/src/main/res/layout/activity_splash.xml:
--------------------------------------------------------------------------------
1 |
2 |
5 |
6 |
12 |
13 |
22 |
--------------------------------------------------------------------------------
/app/src/main/res/layout/toolbar_layout.xml:
--------------------------------------------------------------------------------
1 |
7 |
8 |
18 |
19 |
20 |
--------------------------------------------------------------------------------
/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.daemon=true
20 | org.gradle.jvmargs=-Xmx2048m
--------------------------------------------------------------------------------
/app/src/main/java/com/hotbitmapgg/leisureread/mvp/model/entity/FeedBackInfo.java:
--------------------------------------------------------------------------------
1 | package com.hotbitmapgg.leisureread.mvp.model.entity;
2 |
3 | import cn.bmob.v3.BmobObject;
4 |
5 | /**
6 | * Created by hcc on 2016/12/28 13:35
7 | * 100332338@qq.com
8 | * LeisureRead
9 | *
10 | * @HotBitmapGG
11 | */
12 | public class FeedBackInfo extends BmobObject {
13 |
14 | private String content;
15 |
16 |
17 | public FeedBackInfo(String content) {
18 |
19 | super();
20 | this.content = content;
21 | }
22 |
23 |
24 | public FeedBackInfo() {
25 |
26 | super();
27 | // TODO Auto-generated constructor stub
28 | }
29 |
30 |
31 | public String getContent() {
32 |
33 | return content;
34 | }
35 |
36 |
37 | public void setContent(String content) {
38 |
39 | this.content = content;
40 | }
41 |
42 |
43 | @Override
44 | public String toString() {
45 |
46 | return "FeekBckBean [content=" + content + "]";
47 | }
48 | }
49 |
--------------------------------------------------------------------------------
/app/src/main/res/values/colors.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 | #FFFFFF
4 | #010101
5 | #010101
6 | #FFFFFF
7 | #9E9E9E
8 | #000000
9 | #dd000000
10 | #FFFFFF
11 | #555555
12 | #AEAEAE
13 | #FEFEFE
14 | #888888
15 | #e6e6e6
16 | #D3D3D3
17 | #656565
18 | #71000000
19 | #dcdcdc
20 |
21 |
--------------------------------------------------------------------------------
/app/src/main/java/com/hotbitmapgg/leisureread/app/AppConstant.java:
--------------------------------------------------------------------------------
1 | package com.hotbitmapgg.leisureread.app;
2 |
3 | /**
4 | * Created by hcc on 2016/12/28 13:15
5 | * 100332338@qq.com
6 | * LeisureRead
7 | *
8 | * @HotBitmapGG 常量工具类
9 | */
10 |
11 | public class AppConstant {
12 |
13 | public static final float SCALE_END = 1.13F;
14 |
15 | public static final int ANIMATION_DURATION = 2000;
16 |
17 | public static final String EXTRA_ID = "extra_id";
18 |
19 | public static final String EXTRA_NAME = "extra_name";
20 |
21 | public static final String EXTRA_TYPE = "extra_type";
22 |
23 | public static final String EXTRA_COMMENT_ID = "comment_id";
24 |
25 | public static final String EXTRA_COMMENT_NUM = "comment_num";
26 |
27 | public static final String EXTRA_LONG_COMMENT_NUM = "long_comment_num";
28 |
29 | public static final String EXTRA_SHORT_COMMENT_NUM = "short_comment_num";
30 |
31 | public static final String EXTRA_LONG_COMMENT_ID = "long_comment_id";
32 |
33 | public static final String EXTRA_SHORT_COMMENT_ID = "short_comment_id";
34 | }
35 |
--------------------------------------------------------------------------------
/app/src/main/res/layout/activity_sections_details.xml:
--------------------------------------------------------------------------------
1 |
2 |
8 |
9 |
10 |
11 |
15 |
16 |
17 |
25 |
26 |
27 |
28 |
--------------------------------------------------------------------------------
/app/src/main/res/drawable/corner_btn.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 | -
5 |
6 |
8 |
9 |
10 |
11 |
12 |
13 |
14 | -
15 |
16 |
18 |
19 |
20 |
21 |
22 |
23 |
24 | -
25 |
26 |
28 |
29 |
30 |
31 |
32 |
33 |
34 |
35 |
--------------------------------------------------------------------------------
/app/src/main/java/com/hotbitmapgg/leisureread/ui/activity/HotBitmapGGInfoActivity.java:
--------------------------------------------------------------------------------
1 | package com.hotbitmapgg.leisureread.ui.activity;
2 |
3 | import butterknife.Bind;
4 | import com.hotbitmapgg.leisureread.ui.activity.base.BaseAppCompatActivity;
5 | import com.hotbitmapgg.rxzhihu.R;
6 |
7 | import android.os.Bundle;
8 | import android.support.v7.widget.Toolbar;
9 |
10 | /**
11 | * Created by hcc on 2016/12/28 13:35
12 | * 100332338@qq.com
13 | * LeisureRead
14 | *
15 | * @HotBitmapGG 关于我界面
16 | */
17 | public class HotBitmapGGInfoActivity extends BaseAppCompatActivity {
18 |
19 | @Bind(R.id.toolbar)
20 | Toolbar mToolbar;
21 |
22 |
23 | @Override
24 | public int getLayoutId() {
25 |
26 | return R.layout.activity_hotbitmapgg;
27 | }
28 |
29 |
30 | @Override
31 | public void initViews(Bundle savedInstanceState) {
32 |
33 | }
34 |
35 |
36 | @Override
37 | public void initToolBar() {
38 |
39 | mToolbar.setTitleTextColor(getResources().getColor(R.color.black_90));
40 | mToolbar.setTitle("关于我");
41 | mToolbar.setNavigationIcon(R.drawable.ic_action_back);
42 | mToolbar.setNavigationOnClickListener(view -> onBackPressed());
43 | }
44 | }
45 |
--------------------------------------------------------------------------------
/app/src/main/java/com/hotbitmapgg/leisureread/ui/activity/base/BaseAppCompatActivity.java:
--------------------------------------------------------------------------------
1 | package com.hotbitmapgg.leisureread.ui.activity.base;
2 |
3 | import butterknife.ButterKnife;
4 | import com.trello.rxlifecycle.components.support.RxAppCompatActivity;
5 |
6 | import android.os.Bundle;
7 |
8 | /**
9 | * Created by hcc on 2016/12/28 13:35
10 | * 100332338@qq.com
11 | * LeisureRead
12 | *
13 | * @HotBitmapGG BaseAppCompatActivity基类
14 | */
15 | public abstract class BaseAppCompatActivity extends RxAppCompatActivity {
16 |
17 | @Override
18 | protected void onCreate(Bundle savedInstanceState) {
19 |
20 | super.onCreate(savedInstanceState);
21 | //设置布局内容
22 | setContentView(getLayoutId());
23 | //初始化黄油刀控件绑定框架
24 | ButterKnife.bind(this);
25 | //初始化控件
26 | initViews(savedInstanceState);
27 | //初始化ToolBar
28 | initToolBar();
29 | }
30 |
31 |
32 | @Override
33 | protected void onDestroy() {
34 |
35 | super.onDestroy();
36 | ButterKnife.unbind(this);
37 | }
38 |
39 |
40 | public abstract int getLayoutId();
41 |
42 | public abstract void initViews(Bundle savedInstanceState);
43 |
44 | public abstract void initToolBar();
45 | }
46 |
--------------------------------------------------------------------------------
/app/src/main/java/com/hotbitmapgg/leisureread/mvp/presenter/SectionsPresenter.java:
--------------------------------------------------------------------------------
1 | package com.hotbitmapgg.leisureread.mvp.presenter;
2 |
3 | import com.hotbitmapgg.leisureread.mvp.view.SectionsContract;
4 | import com.hotbitmapgg.leisureread.network.RetrofitHelper;
5 | import com.hotbitmapgg.leisureread.rx.Rxutils;
6 | import java.util.concurrent.TimeUnit;
7 | import javax.inject.Inject;
8 |
9 | /**
10 | * Created by hcc on 2016/12/28 13:35
11 | * 100332338@qq.com
12 | * LeisureRead
13 | *
14 | * @HotBitmapGG
15 | */
16 |
17 | public class SectionsPresenter implements SectionsContract.Presenter {
18 |
19 | private final SectionsContract.View mView;
20 |
21 |
22 | @Inject
23 | public SectionsPresenter(SectionsContract.View mView) {
24 |
25 | this.mView = mView;
26 | mView.setPresenter(this);
27 | }
28 |
29 |
30 | @Override
31 | public void start() {
32 |
33 | loadData();
34 | }
35 |
36 |
37 | @Override
38 | public void loadData() {
39 |
40 | RetrofitHelper.getLastZhiHuApi().getZhiHuSections()
41 | .delay(1000, TimeUnit.MILLISECONDS)
42 | .compose(Rxutils.normalSchedulers())
43 | .subscribe(dailySections -> {
44 | mView.showData(dailySections.getData());
45 | }, throwable -> {
46 | mView.showError();
47 | });
48 | }
49 | }
50 |
--------------------------------------------------------------------------------
/app/src/main/java/com/hotbitmapgg/leisureread/ui/activity/base/BaseSwipeBackActivity.java:
--------------------------------------------------------------------------------
1 | package com.hotbitmapgg.leisureread.ui.activity.base;
2 |
3 | import butterknife.ButterKnife;
4 | import me.imid.swipebacklayout.lib.SwipeBackLayout;
5 | import me.imid.swipebacklayout.lib.app.SwipeBackActivity;
6 |
7 | import android.os.Bundle;
8 |
9 | /**
10 | * Created by hcc on 2016/12/28 13:35
11 | * 100332338@qq.com
12 | * LeisureRead
13 | *
14 | * @HotBitmapGG BaseSwipeBackActivity基类
15 | */
16 | public abstract class BaseSwipeBackActivity extends SwipeBackActivity {
17 |
18 | public SwipeBackLayout mSwipeBackLayout;
19 |
20 |
21 | @Override
22 | protected void onCreate(Bundle savedInstanceState) {
23 | super.onCreate(savedInstanceState);
24 | //设置布局内容
25 | setContentView(getLayoutId());
26 | //初始化黄油刀控件绑定框架
27 | ButterKnife.bind(this);
28 | //初始化侧滑返回layout
29 | mSwipeBackLayout = getSwipeBackLayout();
30 | mSwipeBackLayout.setEdgeTrackingEnabled(SwipeBackLayout.EDGE_LEFT);
31 | //初始化控件
32 | initViews(savedInstanceState);
33 | }
34 |
35 |
36 | @Override
37 | protected void onDestroy() {
38 | super.onDestroy();
39 | ButterKnife.unbind(this);
40 | }
41 |
42 |
43 | public abstract int getLayoutId();
44 |
45 | public abstract void initViews(Bundle savedInstanceState);
46 | }
47 |
--------------------------------------------------------------------------------
/app/src/main/java/com/hotbitmapgg/leisureread/utils/WeekUtil.java:
--------------------------------------------------------------------------------
1 | package com.hotbitmapgg.leisureread.utils;
2 |
3 | import java.util.Calendar;
4 |
5 | /**
6 | * Created by hcc on 2016/12/28 13:35
7 | * 100332338@qq.com
8 | * LeisureRead
9 | *
10 | * @HotBitmapGG 星期工具类
11 | */
12 | public class WeekUtil {
13 |
14 | public static String getWeek(String date) {
15 |
16 | LogUtil.all(date);
17 | int year = Integer.parseInt(date.substring(0, 4));
18 | int month = Integer.parseInt(date.substring(4, 6));
19 | int day = Integer.parseInt(date.substring(6, 8));
20 | Calendar calendar = Calendar.getInstance();//获得一个日历
21 | calendar.set(year, month - 1, day);//设置当前时间,月份是从0月开始计算
22 | int number = calendar.get(Calendar.DAY_OF_WEEK);//星期表示1-7,是从星期日开始,
23 | return getWeekDay(number);
24 | }
25 |
26 |
27 | private static String getWeekDay(int dayForWeek) {
28 |
29 | if (dayForWeek == 1) {
30 | return "星期日";
31 | } else if (dayForWeek == 2) {
32 | return "星期一";
33 | } else if (dayForWeek == 3) {
34 | return "星期二";
35 | } else if (dayForWeek == 4) {
36 | return "星期三";
37 | } else if (dayForWeek == 5) {
38 | return "星期四";
39 | } else if (dayForWeek == 6) {
40 | return "星期五";
41 | } else if (dayForWeek == 7) {
42 | return "星期六";
43 | } else {
44 | return "";
45 | }
46 | }
47 | }
48 |
--------------------------------------------------------------------------------
/app/src/main/java/com/hotbitmapgg/leisureread/mvp/model/entity/SectionsInfo.java:
--------------------------------------------------------------------------------
1 | package com.hotbitmapgg.leisureread.mvp.model.entity;
2 |
3 | import java.util.List;
4 |
5 | /**
6 | * Created by hcc on 2016/12/28 13:35
7 | * 100332338@qq.com
8 | * LeisureRead
9 | *
10 | * @HotBitmapGG 专栏列表模型类
11 | */
12 | public class SectionsInfo {
13 |
14 | private List data;
15 |
16 | public List getData() { return data;}
17 |
18 |
19 | public void setData(List data) { this.data = data;}
20 |
21 |
22 | public static class DataBean {
23 | /**
24 | * description : 看别人的经历,理解自己的生活
25 | * id : 1
26 | * name : 深夜惊奇
27 | * thumbnail : http://pic3.zhimg.com/91125c9aebcab1c84f58ce4f8779551e.jpg
28 | */
29 |
30 | private String description;
31 | private int id;
32 | private String name;
33 | private String thumbnail;
34 |
35 |
36 | public String getDescription() { return description;}
37 |
38 |
39 | public void setDescription(String description) { this.description = description;}
40 |
41 |
42 | public int getId() { return id;}
43 |
44 |
45 | public void setId(int id) { this.id = id;}
46 |
47 |
48 | public String getName() { return name;}
49 |
50 |
51 | public void setName(String name) { this.name = name;}
52 |
53 |
54 | public String getThumbnail() { return thumbnail;}
55 |
56 |
57 | public void setThumbnail(String thumbnail) { this.thumbnail = thumbnail;}
58 | }
59 | }
60 |
--------------------------------------------------------------------------------
/app/src/main/java/com/hotbitmapgg/leisureread/utils/SystemUiVisibilityUtil.java:
--------------------------------------------------------------------------------
1 | package com.hotbitmapgg.leisureread.utils;
2 |
3 | import android.view.View;
4 | import android.view.Window;
5 | import android.view.WindowManager;
6 |
7 | /**
8 | * Created by hcc on 2016/12/28 13:35
9 | * 100332338@qq.com
10 | * LeisureRead
11 | *
12 | * @HotBitmapGG StatusBar隐藏显示工具类
13 | */
14 | public class SystemUiVisibilityUtil {
15 |
16 | public static void addFlags(View view, int flags) {
17 |
18 | view.setSystemUiVisibility(view.getSystemUiVisibility() | flags);
19 | }
20 |
21 |
22 | public static void clearFlags(View view, int flags) {
23 |
24 | view.setSystemUiVisibility(view.getSystemUiVisibility() & ~flags);
25 | }
26 |
27 |
28 | public static boolean hasFlags(View view, int flags) {
29 |
30 | return (view.getSystemUiVisibility() & flags) == flags;
31 | }
32 |
33 |
34 | /**
35 | * * 显示或隐藏StatusBar
36 | *
37 | * @param enable false 显示,true 隐藏
38 | */
39 | public static void hideStatusBar(Window window, boolean enable) {
40 |
41 | WindowManager.LayoutParams p = window.getAttributes();
42 | if (enable)
43 | //|=:或等于,取其一
44 | {
45 | p.flags |= WindowManager.LayoutParams.FLAG_FULLSCREEN;
46 | } else
47 | //&=:与等于,取其二同时满足, ~ : 取反
48 | {
49 | p.flags &= (~WindowManager.LayoutParams.FLAG_FULLSCREEN);
50 | }
51 |
52 | window.setAttributes(p);
53 | window.addFlags(WindowManager.LayoutParams.FLAG_LAYOUT_NO_LIMITS);
54 | }
55 | }
56 |
--------------------------------------------------------------------------------
/app/src/main/java/com/hotbitmapgg/leisureread/rx/RxBus.java:
--------------------------------------------------------------------------------
1 | package com.hotbitmapgg.leisureread.rx;
2 |
3 | import rx.Observable;
4 | import rx.subjects.PublishSubject;
5 | import rx.subjects.SerializedSubject;
6 | import rx.subjects.Subject;
7 |
8 | /**
9 | * Created by hcc on 2017/1/3 15:12
10 | * 100332338@qq.com
11 | * LeisureRead
12 | *
13 | * @HotBitmapGG RxBus
14 | *
15 | * Subject同时充当了Observer和Observable的角色,Subject是非线程安全的,
16 | * 要避免该问题,需要将 Subject转换为一个 SerializedSubject ,
17 | * 上述RxBus类中把线程非安全的PublishSubject包装成线程安全的Subject。
18 | * PublishSubject只会把在订阅发生的时间点之后来自原始Observable的数据发射给观察者
19 | * ofType操作符只发射指定类型的数据,其内部就是filter+cast
20 | */
21 |
22 | public class RxBus {
23 |
24 | private static volatile RxBus mInstance;
25 |
26 | private final Subject