├── app ├── .gitignore ├── src │ ├── main │ │ ├── res │ │ │ ├── drawable │ │ │ │ ├── head.jpg │ │ │ │ ├── about_us.png │ │ │ │ ├── author.jpg │ │ │ │ ├── contact.png │ │ │ │ ├── iv_down.png │ │ │ │ ├── iv_imag.png │ │ │ │ ├── iv_left.png │ │ │ │ ├── iv_like.png │ │ │ │ ├── rb_self.png │ │ │ │ ├── rb_share.png │ │ │ │ ├── red_bg.9.png │ │ │ │ ├── setting.png │ │ │ │ ├── user_sub.png │ │ │ │ ├── back_login.png │ │ │ │ ├── iv_cancle.png │ │ │ │ ├── iv_comment.png │ │ │ │ ├── rb_choice.png │ │ │ │ ├── rb_message.png │ │ │ │ ├── rb_search.png │ │ │ │ ├── reset_pwd.png │ │ │ │ ├── ic_item_like.png │ │ │ │ ├── ic_item_liked.png │ │ │ │ ├── ic_msg_like.png │ │ │ │ ├── iv_collection.png │ │ │ │ ├── mini_search.png │ │ │ │ ├── user_collect.png │ │ │ │ ├── default_avatar.png │ │ │ │ ├── ic_item_comment.png │ │ │ │ ├── ic_msg_comment.png │ │ │ │ ├── ic_msg_subcribe.png │ │ │ │ ├── rb_self_select.png │ │ │ │ ├── ic_action_delete.png │ │ │ │ ├── ic_add_white_24dp.png │ │ │ │ ├── ic_done_white_24dp.png │ │ │ │ ├── ic_home_theme_24dp.png │ │ │ │ ├── ic_menu_white_24dp.png │ │ │ │ ├── ic_msg_attention.png │ │ │ │ ├── main_nav_header_bg.png │ │ │ │ ├── rb_choice_select.png │ │ │ │ ├── rb_message_select.png │ │ │ │ ├── rb_search_select.png │ │ │ │ ├── ic_close_white_24dp.png │ │ │ │ ├── ic_delete_white_24dp.png │ │ │ │ ├── ic_home_grey600_24dp.png │ │ │ │ ├── ic_search_white_24dp.png │ │ │ │ ├── ic_share_white_24dp.png │ │ │ │ ├── ic_comment_grey600_18dp.png │ │ │ │ ├── ic_comment_grey600_24dp.png │ │ │ │ ├── ic_favorite_grey_24dp.png │ │ │ │ ├── ic_favorite_theme_24dp.png │ │ │ │ ├── ic_refresh_white_24dp.png │ │ │ │ ├── ic_subject_grey600_24dp.png │ │ │ │ ├── ic_subject_theme_24dp.png │ │ │ │ ├── ic_arrow_back_white_24dp.png │ │ │ │ ├── ic_description_theme_24dp.png │ │ │ │ ├── ic_favorite_grey600_24dp.png │ │ │ │ ├── ic_thumb_up_grey600_18dp.png │ │ │ │ ├── abc_ic_menu_share_mtrl_alpha.png │ │ │ │ ├── ic_description_grey600_24dp.png │ │ │ │ ├── main_nav_ic_feedback_grey_24dp.png │ │ │ │ ├── main_nav_ic_setting_grey_24dp.png │ │ │ │ ├── abc_ic_menu_moreoverflow_mtrl_alpha.png │ │ │ │ ├── ic_assignment_turned_in_theme_24dp.png │ │ │ │ ├── ic_assignment_turned_in_grey600_24dp.png │ │ │ │ ├── btn_grid_nopress.xml │ │ │ │ ├── btn_grid_press.xml │ │ │ │ ├── ic_banner_bottom_bg.xml │ │ │ │ ├── ic_nav_header_bg.xml │ │ │ │ ├── selector_red.xml │ │ │ │ ├── ic_banner_indicator_selected.xml │ │ │ │ ├── ic_banner_indicator_unselected.xml │ │ │ │ ├── side_nav_bar.xml │ │ │ │ ├── spacer_medium.xml │ │ │ │ ├── search_bar_bg.xml │ │ │ │ ├── ic_circle_red.xml │ │ │ │ ├── ic_begin_search.xml │ │ │ │ ├── like_selector.xml │ │ │ │ ├── collect_selector.xml │ │ │ │ ├── btn_gridview.xml │ │ │ │ ├── ic_delete.xml │ │ │ │ ├── ic_arrow_back_black_24dp.xml │ │ │ │ ├── web_progress_bar.xml │ │ │ │ ├── bg_launch.xml │ │ │ │ ├── ic_iv_white_left.xml │ │ │ │ ├── tab_author.xml │ │ │ │ ├── ic_mini_collect.xml │ │ │ │ ├── ic_mini_collect_press.xml │ │ │ │ ├── ic_mini_left.xml │ │ │ │ ├── ic_go.xml │ │ │ │ ├── ic_iv_like_press.xml │ │ │ │ ├── ic_follow_press.xml │ │ │ │ ├── ic_dowm.xml │ │ │ │ ├── ic_turndown.xml │ │ │ │ ├── ic_download_24dp.xml │ │ │ │ ├── circleblue.xml │ │ │ │ ├── circlegreen.xml │ │ │ │ ├── circlered.xml │ │ │ │ ├── circleyellow.xml │ │ │ │ ├── ic_iv_dingyue.xml │ │ │ │ ├── ic_mini_like.xml │ │ │ │ ├── ic_mini_like_press.xml │ │ │ │ ├── ic_mini_comment.xml │ │ │ │ ├── ic_iv_like.xml │ │ │ │ └── ic_hot_article.xml │ │ │ ├── drawable-v24 │ │ │ │ ├── it.jpg │ │ │ │ ├── default_avatar.png │ │ │ │ ├── ic_add_white_24dp.png │ │ │ │ ├── ic_menu_white_24dp.png │ │ │ │ ├── main_nav_header_bg.png │ │ │ │ ├── ic_home_grey600_24dp.png │ │ │ │ ├── ic_search_white_24dp.png │ │ │ │ ├── ic_favorite_grey600_24dp.png │ │ │ │ ├── ic_subject_grey600_24dp.png │ │ │ │ ├── ic_description_grey600_24dp.png │ │ │ │ ├── main_nav_ic_setting_grey_24dp.png │ │ │ │ ├── main_nav_ic_feedback_grey_24dp.png │ │ │ │ ├── abc_ic_menu_moreoverflow_mtrl_alpha.png │ │ │ │ ├── ic_assignment_turned_in_grey600_24dp.png │ │ │ │ ├── btn_grid_nopress.xml │ │ │ │ ├── btn_grid_press.xml │ │ │ │ ├── ic_nav_header_bg.xml │ │ │ │ ├── btn_gridview.xml │ │ │ │ └── ic_launcher_foreground.xml │ │ │ ├── mipmap-hdpi │ │ │ │ ├── head_img.jpg │ │ │ │ └── ic_launcher_round.png │ │ │ ├── mipmap-mdpi │ │ │ │ └── ic_launcher_round.png │ │ │ ├── mipmap-xhdpi │ │ │ │ └── ic_launcher_round.png │ │ │ ├── mipmap-xxhdpi │ │ │ │ └── ic_launcher_round.png │ │ │ ├── mipmap-xxxhdpi │ │ │ │ └── ic_launcher_round.png │ │ │ ├── mipmap-anydpi-v26 │ │ │ │ ├── icon_help_blue_small.png │ │ │ │ ├── ic_launcher.xml │ │ │ │ └── ic_launcher_round.xml │ │ │ ├── layout │ │ │ │ ├── msg_fans_item.xml │ │ │ │ ├── msg_notice.xml │ │ │ │ ├── view_home_banner.xml │ │ │ │ ├── fragment_tab_user.xml │ │ │ │ ├── fragment_tab_article.xml │ │ │ │ ├── common_titlebar.xml │ │ │ │ ├── home_user_details.xml │ │ │ │ ├── activity_main.xml │ │ │ │ ├── view_banner_item.xml │ │ │ │ ├── fragment_home_choice.xml │ │ │ │ ├── activity_my_collect.xml │ │ │ │ ├── activity_my_fans.xml │ │ │ │ ├── activity_my_follow.xml │ │ │ │ ├── activity_my_article.xml │ │ │ │ ├── activity_msg_likes.xml │ │ │ │ ├── activity_msg_collect.xml │ │ │ │ ├── activity_msg_comment.xml │ │ │ │ ├── msg_comment_item.xml │ │ │ │ ├── comment_list_item.xml │ │ │ │ ├── activity_commment.xml │ │ │ │ ├── activity_search.xml │ │ │ │ ├── activity_post_comment.xml │ │ │ │ ├── activity_upate_pwd.xml │ │ │ │ └── my_follow_list.xml │ │ │ ├── values │ │ │ │ ├── dimens.xml │ │ │ │ ├── strings.xml │ │ │ │ ├── styles.xml │ │ │ │ └── colors.xml │ │ │ └── menu │ │ │ │ └── activity_main_drawer.xml │ │ ├── assets │ │ │ └── Montserrat-Medium.ttf │ │ ├── java │ │ │ └── com │ │ │ │ └── nuc │ │ │ │ └── calvin │ │ │ │ └── headline │ │ │ │ ├── activity │ │ │ │ ├── UpatePwdActivity.java │ │ │ │ ├── MyFansActivity.java │ │ │ │ ├── MsgLikesActivity.java │ │ │ │ ├── MsgCollectActivity.java │ │ │ │ ├── BaseActivity.java │ │ │ │ ├── ArticleDetailActivity.java │ │ │ │ └── SearchActivity.java │ │ │ │ ├── json │ │ │ │ ├── RegisterJs.java │ │ │ │ ├── OkJs.java │ │ │ │ ├── LoginJs.java │ │ │ │ ├── BannerJs.java │ │ │ │ ├── CollectJs.java │ │ │ │ ├── UserJs.java │ │ │ │ └── CommentJs.java │ │ │ │ ├── adapter │ │ │ │ ├── MyFragmentAdapter.java │ │ │ │ ├── SearchAdapter.java │ │ │ │ ├── HomeAdapter.java │ │ │ │ ├── MsgCommentAdapter.java │ │ │ │ ├── MyFollowAdapter.java │ │ │ │ ├── CommentAdapter.java │ │ │ │ ├── FindUserAdapter.java │ │ │ │ ├── MyArticleAdapter.java │ │ │ │ ├── FindArticleAdapter.java │ │ │ │ └── MyCollectAdapter.java │ │ │ │ ├── bean │ │ │ │ ├── ui │ │ │ │ │ └── Details.java │ │ │ │ ├── Relation.java │ │ │ │ ├── Collect.java │ │ │ │ ├── CollectCustom.java │ │ │ │ ├── Likes.java │ │ │ │ ├── Article.java │ │ │ │ ├── LikesCustom.java │ │ │ │ ├── Banner.java │ │ │ │ ├── Comment.java │ │ │ │ ├── ReplyCustom.java │ │ │ │ ├── UserCustom.java │ │ │ │ ├── Reply.java │ │ │ │ ├── User.java │ │ │ │ ├── ArticleCustom.java │ │ │ │ └── CommentCustom.java │ │ │ │ ├── view │ │ │ │ └── PointImageView.java │ │ │ │ ├── fragment │ │ │ │ ├── HomeMessageFragment.java │ │ │ │ └── BaseFragment.java │ │ │ │ └── utils │ │ │ │ ├── SerializableUtil.java │ │ │ │ ├── ShareUtils.java │ │ │ │ └── StaticClass.java │ │ └── AndroidManifest.xml │ ├── test │ │ └── java │ │ │ └── com │ │ │ └── nuc │ │ │ └── calvin │ │ │ └── headline │ │ │ └── ExampleUnitTest.java │ └── androidTest │ │ └── java │ │ └── com │ │ └── nuc │ │ └── calvin │ │ └── headline │ │ └── ExampleInstrumentedTest.java ├── proguard-rules.pro └── build.gradle ├── settings.gradle ├── gradle └── wrapper │ ├── gradle-wrapper.jar │ └── gradle-wrapper.properties ├── README.md ├── .idea ├── encodings.xml ├── vcs.xml ├── misc.xml ├── inspectionProfiles │ └── Project_Default.xml ├── runConfigurations.xml └── gradle.xml ├── .gitignore ├── gradle.properties └── gradlew.bat /app/.gitignore: -------------------------------------------------------------------------------- 1 | /build 2 | -------------------------------------------------------------------------------- /settings.gradle: -------------------------------------------------------------------------------- 1 | include ':app' 2 | -------------------------------------------------------------------------------- /gradle/wrapper/gradle-wrapper.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/chenzhibin66/HeadLine/HEAD/gradle/wrapper/gradle-wrapper.jar -------------------------------------------------------------------------------- /app/src/main/res/drawable/head.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/chenzhibin66/HeadLine/HEAD/app/src/main/res/drawable/head.jpg -------------------------------------------------------------------------------- /app/src/main/res/drawable-v24/it.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/chenzhibin66/HeadLine/HEAD/app/src/main/res/drawable-v24/it.jpg -------------------------------------------------------------------------------- /app/src/main/res/drawable/about_us.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/chenzhibin66/HeadLine/HEAD/app/src/main/res/drawable/about_us.png -------------------------------------------------------------------------------- /app/src/main/res/drawable/author.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/chenzhibin66/HeadLine/HEAD/app/src/main/res/drawable/author.jpg -------------------------------------------------------------------------------- /app/src/main/res/drawable/contact.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/chenzhibin66/HeadLine/HEAD/app/src/main/res/drawable/contact.png -------------------------------------------------------------------------------- /app/src/main/res/drawable/iv_down.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/chenzhibin66/HeadLine/HEAD/app/src/main/res/drawable/iv_down.png -------------------------------------------------------------------------------- /app/src/main/res/drawable/iv_imag.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/chenzhibin66/HeadLine/HEAD/app/src/main/res/drawable/iv_imag.png -------------------------------------------------------------------------------- /app/src/main/res/drawable/iv_left.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/chenzhibin66/HeadLine/HEAD/app/src/main/res/drawable/iv_left.png -------------------------------------------------------------------------------- /app/src/main/res/drawable/iv_like.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/chenzhibin66/HeadLine/HEAD/app/src/main/res/drawable/iv_like.png -------------------------------------------------------------------------------- /app/src/main/res/drawable/rb_self.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/chenzhibin66/HeadLine/HEAD/app/src/main/res/drawable/rb_self.png -------------------------------------------------------------------------------- /app/src/main/res/drawable/rb_share.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/chenzhibin66/HeadLine/HEAD/app/src/main/res/drawable/rb_share.png -------------------------------------------------------------------------------- /app/src/main/res/drawable/red_bg.9.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/chenzhibin66/HeadLine/HEAD/app/src/main/res/drawable/red_bg.9.png -------------------------------------------------------------------------------- /app/src/main/res/drawable/setting.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/chenzhibin66/HeadLine/HEAD/app/src/main/res/drawable/setting.png -------------------------------------------------------------------------------- /app/src/main/res/drawable/user_sub.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/chenzhibin66/HeadLine/HEAD/app/src/main/res/drawable/user_sub.png -------------------------------------------------------------------------------- /app/src/main/res/drawable/back_login.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/chenzhibin66/HeadLine/HEAD/app/src/main/res/drawable/back_login.png -------------------------------------------------------------------------------- /app/src/main/res/drawable/iv_cancle.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/chenzhibin66/HeadLine/HEAD/app/src/main/res/drawable/iv_cancle.png -------------------------------------------------------------------------------- /app/src/main/res/drawable/iv_comment.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/chenzhibin66/HeadLine/HEAD/app/src/main/res/drawable/iv_comment.png -------------------------------------------------------------------------------- /app/src/main/res/drawable/rb_choice.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/chenzhibin66/HeadLine/HEAD/app/src/main/res/drawable/rb_choice.png -------------------------------------------------------------------------------- /app/src/main/res/drawable/rb_message.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/chenzhibin66/HeadLine/HEAD/app/src/main/res/drawable/rb_message.png -------------------------------------------------------------------------------- /app/src/main/res/drawable/rb_search.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/chenzhibin66/HeadLine/HEAD/app/src/main/res/drawable/rb_search.png -------------------------------------------------------------------------------- /app/src/main/res/drawable/reset_pwd.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/chenzhibin66/HeadLine/HEAD/app/src/main/res/drawable/reset_pwd.png -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # 高仿开发者头条--------取名IT头条 2 | 3 | 废话不多说,先上效果图 4 | 5 | ![](http://ww1.sinaimg.cn/large/005WjvZYly1g4s6m6bo2vg30ab0lwnpe.gif) 6 | 7 | -------------------------------------------------------------------------------- /app/src/main/assets/Montserrat-Medium.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/chenzhibin66/HeadLine/HEAD/app/src/main/assets/Montserrat-Medium.ttf -------------------------------------------------------------------------------- /app/src/main/res/drawable/ic_item_like.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/chenzhibin66/HeadLine/HEAD/app/src/main/res/drawable/ic_item_like.png -------------------------------------------------------------------------------- /app/src/main/res/drawable/ic_item_liked.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/chenzhibin66/HeadLine/HEAD/app/src/main/res/drawable/ic_item_liked.png -------------------------------------------------------------------------------- /app/src/main/res/drawable/ic_msg_like.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/chenzhibin66/HeadLine/HEAD/app/src/main/res/drawable/ic_msg_like.png -------------------------------------------------------------------------------- /app/src/main/res/drawable/iv_collection.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/chenzhibin66/HeadLine/HEAD/app/src/main/res/drawable/iv_collection.png -------------------------------------------------------------------------------- /app/src/main/res/drawable/mini_search.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/chenzhibin66/HeadLine/HEAD/app/src/main/res/drawable/mini_search.png -------------------------------------------------------------------------------- /app/src/main/res/drawable/user_collect.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/chenzhibin66/HeadLine/HEAD/app/src/main/res/drawable/user_collect.png -------------------------------------------------------------------------------- /app/src/main/res/mipmap-hdpi/head_img.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/chenzhibin66/HeadLine/HEAD/app/src/main/res/mipmap-hdpi/head_img.jpg -------------------------------------------------------------------------------- /app/src/main/res/drawable/default_avatar.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/chenzhibin66/HeadLine/HEAD/app/src/main/res/drawable/default_avatar.png -------------------------------------------------------------------------------- /app/src/main/res/drawable/ic_item_comment.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/chenzhibin66/HeadLine/HEAD/app/src/main/res/drawable/ic_item_comment.png -------------------------------------------------------------------------------- /app/src/main/res/drawable/ic_msg_comment.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/chenzhibin66/HeadLine/HEAD/app/src/main/res/drawable/ic_msg_comment.png -------------------------------------------------------------------------------- /app/src/main/res/drawable/ic_msg_subcribe.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/chenzhibin66/HeadLine/HEAD/app/src/main/res/drawable/ic_msg_subcribe.png -------------------------------------------------------------------------------- /app/src/main/res/drawable/rb_self_select.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/chenzhibin66/HeadLine/HEAD/app/src/main/res/drawable/rb_self_select.png -------------------------------------------------------------------------------- /app/src/main/res/drawable-v24/default_avatar.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/chenzhibin66/HeadLine/HEAD/app/src/main/res/drawable-v24/default_avatar.png -------------------------------------------------------------------------------- /app/src/main/res/drawable/ic_action_delete.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/chenzhibin66/HeadLine/HEAD/app/src/main/res/drawable/ic_action_delete.png -------------------------------------------------------------------------------- /app/src/main/res/drawable/ic_add_white_24dp.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/chenzhibin66/HeadLine/HEAD/app/src/main/res/drawable/ic_add_white_24dp.png -------------------------------------------------------------------------------- /app/src/main/res/drawable/ic_done_white_24dp.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/chenzhibin66/HeadLine/HEAD/app/src/main/res/drawable/ic_done_white_24dp.png -------------------------------------------------------------------------------- /app/src/main/res/drawable/ic_home_theme_24dp.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/chenzhibin66/HeadLine/HEAD/app/src/main/res/drawable/ic_home_theme_24dp.png -------------------------------------------------------------------------------- /app/src/main/res/drawable/ic_menu_white_24dp.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/chenzhibin66/HeadLine/HEAD/app/src/main/res/drawable/ic_menu_white_24dp.png -------------------------------------------------------------------------------- /app/src/main/res/drawable/ic_msg_attention.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/chenzhibin66/HeadLine/HEAD/app/src/main/res/drawable/ic_msg_attention.png -------------------------------------------------------------------------------- /app/src/main/res/drawable/main_nav_header_bg.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/chenzhibin66/HeadLine/HEAD/app/src/main/res/drawable/main_nav_header_bg.png -------------------------------------------------------------------------------- /app/src/main/res/drawable/rb_choice_select.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/chenzhibin66/HeadLine/HEAD/app/src/main/res/drawable/rb_choice_select.png -------------------------------------------------------------------------------- /app/src/main/res/drawable/rb_message_select.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/chenzhibin66/HeadLine/HEAD/app/src/main/res/drawable/rb_message_select.png -------------------------------------------------------------------------------- /app/src/main/res/drawable/rb_search_select.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/chenzhibin66/HeadLine/HEAD/app/src/main/res/drawable/rb_search_select.png -------------------------------------------------------------------------------- /app/src/main/res/drawable/ic_close_white_24dp.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/chenzhibin66/HeadLine/HEAD/app/src/main/res/drawable/ic_close_white_24dp.png -------------------------------------------------------------------------------- /app/src/main/res/drawable/ic_delete_white_24dp.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/chenzhibin66/HeadLine/HEAD/app/src/main/res/drawable/ic_delete_white_24dp.png -------------------------------------------------------------------------------- /app/src/main/res/drawable/ic_home_grey600_24dp.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/chenzhibin66/HeadLine/HEAD/app/src/main/res/drawable/ic_home_grey600_24dp.png -------------------------------------------------------------------------------- /app/src/main/res/drawable/ic_search_white_24dp.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/chenzhibin66/HeadLine/HEAD/app/src/main/res/drawable/ic_search_white_24dp.png -------------------------------------------------------------------------------- /app/src/main/res/drawable/ic_share_white_24dp.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/chenzhibin66/HeadLine/HEAD/app/src/main/res/drawable/ic_share_white_24dp.png -------------------------------------------------------------------------------- /app/src/main/res/mipmap-hdpi/ic_launcher_round.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/chenzhibin66/HeadLine/HEAD/app/src/main/res/mipmap-hdpi/ic_launcher_round.png -------------------------------------------------------------------------------- /app/src/main/res/mipmap-mdpi/ic_launcher_round.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/chenzhibin66/HeadLine/HEAD/app/src/main/res/mipmap-mdpi/ic_launcher_round.png -------------------------------------------------------------------------------- /app/src/main/res/drawable-v24/ic_add_white_24dp.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/chenzhibin66/HeadLine/HEAD/app/src/main/res/drawable-v24/ic_add_white_24dp.png -------------------------------------------------------------------------------- /app/src/main/res/drawable-v24/ic_menu_white_24dp.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/chenzhibin66/HeadLine/HEAD/app/src/main/res/drawable-v24/ic_menu_white_24dp.png -------------------------------------------------------------------------------- /app/src/main/res/drawable-v24/main_nav_header_bg.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/chenzhibin66/HeadLine/HEAD/app/src/main/res/drawable-v24/main_nav_header_bg.png -------------------------------------------------------------------------------- /app/src/main/res/drawable/ic_comment_grey600_18dp.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/chenzhibin66/HeadLine/HEAD/app/src/main/res/drawable/ic_comment_grey600_18dp.png -------------------------------------------------------------------------------- /app/src/main/res/drawable/ic_comment_grey600_24dp.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/chenzhibin66/HeadLine/HEAD/app/src/main/res/drawable/ic_comment_grey600_24dp.png -------------------------------------------------------------------------------- /app/src/main/res/drawable/ic_favorite_grey_24dp.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/chenzhibin66/HeadLine/HEAD/app/src/main/res/drawable/ic_favorite_grey_24dp.png -------------------------------------------------------------------------------- /app/src/main/res/drawable/ic_favorite_theme_24dp.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/chenzhibin66/HeadLine/HEAD/app/src/main/res/drawable/ic_favorite_theme_24dp.png -------------------------------------------------------------------------------- /app/src/main/res/drawable/ic_refresh_white_24dp.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/chenzhibin66/HeadLine/HEAD/app/src/main/res/drawable/ic_refresh_white_24dp.png -------------------------------------------------------------------------------- /app/src/main/res/drawable/ic_subject_grey600_24dp.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/chenzhibin66/HeadLine/HEAD/app/src/main/res/drawable/ic_subject_grey600_24dp.png -------------------------------------------------------------------------------- /app/src/main/res/drawable/ic_subject_theme_24dp.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/chenzhibin66/HeadLine/HEAD/app/src/main/res/drawable/ic_subject_theme_24dp.png -------------------------------------------------------------------------------- /app/src/main/res/mipmap-xhdpi/ic_launcher_round.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/chenzhibin66/HeadLine/HEAD/app/src/main/res/mipmap-xhdpi/ic_launcher_round.png -------------------------------------------------------------------------------- /app/src/main/res/mipmap-xxhdpi/ic_launcher_round.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/chenzhibin66/HeadLine/HEAD/app/src/main/res/mipmap-xxhdpi/ic_launcher_round.png -------------------------------------------------------------------------------- /app/src/main/res/mipmap-xxxhdpi/ic_launcher_round.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/chenzhibin66/HeadLine/HEAD/app/src/main/res/mipmap-xxxhdpi/ic_launcher_round.png -------------------------------------------------------------------------------- /.idea/encodings.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | -------------------------------------------------------------------------------- /app/src/main/res/drawable-v24/ic_home_grey600_24dp.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/chenzhibin66/HeadLine/HEAD/app/src/main/res/drawable-v24/ic_home_grey600_24dp.png -------------------------------------------------------------------------------- /app/src/main/res/drawable-v24/ic_search_white_24dp.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/chenzhibin66/HeadLine/HEAD/app/src/main/res/drawable-v24/ic_search_white_24dp.png -------------------------------------------------------------------------------- /app/src/main/res/drawable/ic_arrow_back_white_24dp.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/chenzhibin66/HeadLine/HEAD/app/src/main/res/drawable/ic_arrow_back_white_24dp.png -------------------------------------------------------------------------------- /app/src/main/res/drawable/ic_description_theme_24dp.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/chenzhibin66/HeadLine/HEAD/app/src/main/res/drawable/ic_description_theme_24dp.png -------------------------------------------------------------------------------- /app/src/main/res/drawable/ic_favorite_grey600_24dp.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/chenzhibin66/HeadLine/HEAD/app/src/main/res/drawable/ic_favorite_grey600_24dp.png -------------------------------------------------------------------------------- /app/src/main/res/drawable/ic_thumb_up_grey600_18dp.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/chenzhibin66/HeadLine/HEAD/app/src/main/res/drawable/ic_thumb_up_grey600_18dp.png -------------------------------------------------------------------------------- /app/src/main/res/drawable-v24/ic_favorite_grey600_24dp.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/chenzhibin66/HeadLine/HEAD/app/src/main/res/drawable-v24/ic_favorite_grey600_24dp.png -------------------------------------------------------------------------------- /app/src/main/res/drawable-v24/ic_subject_grey600_24dp.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/chenzhibin66/HeadLine/HEAD/app/src/main/res/drawable-v24/ic_subject_grey600_24dp.png -------------------------------------------------------------------------------- /app/src/main/res/drawable/abc_ic_menu_share_mtrl_alpha.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/chenzhibin66/HeadLine/HEAD/app/src/main/res/drawable/abc_ic_menu_share_mtrl_alpha.png -------------------------------------------------------------------------------- /app/src/main/res/drawable/ic_description_grey600_24dp.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/chenzhibin66/HeadLine/HEAD/app/src/main/res/drawable/ic_description_grey600_24dp.png -------------------------------------------------------------------------------- /app/src/main/res/drawable/main_nav_ic_feedback_grey_24dp.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/chenzhibin66/HeadLine/HEAD/app/src/main/res/drawable/main_nav_ic_feedback_grey_24dp.png -------------------------------------------------------------------------------- /app/src/main/res/drawable/main_nav_ic_setting_grey_24dp.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/chenzhibin66/HeadLine/HEAD/app/src/main/res/drawable/main_nav_ic_setting_grey_24dp.png -------------------------------------------------------------------------------- /app/src/main/res/mipmap-anydpi-v26/icon_help_blue_small.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/chenzhibin66/HeadLine/HEAD/app/src/main/res/mipmap-anydpi-v26/icon_help_blue_small.png -------------------------------------------------------------------------------- /app/src/main/res/drawable-v24/ic_description_grey600_24dp.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/chenzhibin66/HeadLine/HEAD/app/src/main/res/drawable-v24/ic_description_grey600_24dp.png -------------------------------------------------------------------------------- /app/src/main/res/drawable-v24/main_nav_ic_setting_grey_24dp.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/chenzhibin66/HeadLine/HEAD/app/src/main/res/drawable-v24/main_nav_ic_setting_grey_24dp.png -------------------------------------------------------------------------------- /app/src/main/res/drawable-v24/main_nav_ic_feedback_grey_24dp.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/chenzhibin66/HeadLine/HEAD/app/src/main/res/drawable-v24/main_nav_ic_feedback_grey_24dp.png -------------------------------------------------------------------------------- /app/src/main/res/drawable/abc_ic_menu_moreoverflow_mtrl_alpha.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/chenzhibin66/HeadLine/HEAD/app/src/main/res/drawable/abc_ic_menu_moreoverflow_mtrl_alpha.png -------------------------------------------------------------------------------- /app/src/main/res/drawable/ic_assignment_turned_in_theme_24dp.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/chenzhibin66/HeadLine/HEAD/app/src/main/res/drawable/ic_assignment_turned_in_theme_24dp.png -------------------------------------------------------------------------------- /app/src/main/res/drawable/ic_assignment_turned_in_grey600_24dp.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/chenzhibin66/HeadLine/HEAD/app/src/main/res/drawable/ic_assignment_turned_in_grey600_24dp.png -------------------------------------------------------------------------------- /app/src/main/res/drawable-v24/abc_ic_menu_moreoverflow_mtrl_alpha.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/chenzhibin66/HeadLine/HEAD/app/src/main/res/drawable-v24/abc_ic_menu_moreoverflow_mtrl_alpha.png -------------------------------------------------------------------------------- /app/src/main/res/drawable-v24/ic_assignment_turned_in_grey600_24dp.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/chenzhibin66/HeadLine/HEAD/app/src/main/res/drawable-v24/ic_assignment_turned_in_grey600_24dp.png -------------------------------------------------------------------------------- /.idea/vcs.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | -------------------------------------------------------------------------------- /app/src/main/res/drawable/btn_grid_nopress.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | -------------------------------------------------------------------------------- /app/src/main/res/drawable-v24/btn_grid_nopress.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | -------------------------------------------------------------------------------- /app/src/main/res/drawable-v24/btn_grid_press.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | -------------------------------------------------------------------------------- /app/src/main/res/drawable/btn_grid_press.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | *.iml 2 | .gradle 3 | /local.properties 4 | /.idea/caches 5 | /.idea/libraries 6 | /.idea/modules.xml 7 | /.idea/workspace.xml 8 | /.idea/navEditor.xml 9 | /.idea/assetWizardSettings.xml 10 | .DS_Store 11 | /build 12 | /captures 13 | .externalNativeBuild 14 | -------------------------------------------------------------------------------- /gradle/wrapper/gradle-wrapper.properties: -------------------------------------------------------------------------------- 1 | #Mon Jun 03 13:29:08 CST 2019 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-5.1.1-all.zip 7 | -------------------------------------------------------------------------------- /app/src/main/res/drawable-v24/ic_nav_header_bg.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | -------------------------------------------------------------------------------- /app/src/main/res/drawable/ic_banner_bottom_bg.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 7 | -------------------------------------------------------------------------------- /app/src/main/res/drawable/ic_nav_header_bg.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | -------------------------------------------------------------------------------- /app/src/main/res/drawable/selector_red.xml: -------------------------------------------------------------------------------- 1 | 2 | 4 | 5 | 6 | 7 | -------------------------------------------------------------------------------- /app/src/main/res/layout/msg_fans_item.xml: -------------------------------------------------------------------------------- 1 | 2 | 6 | 7 | 8 | 9 | -------------------------------------------------------------------------------- /app/src/main/res/mipmap-anydpi-v26/ic_launcher.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | -------------------------------------------------------------------------------- /app/src/main/res/mipmap-anydpi-v26/ic_launcher_round.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | -------------------------------------------------------------------------------- /app/src/main/res/drawable/ic_banner_indicator_selected.xml: -------------------------------------------------------------------------------- 1 | 2 | 4 | 5 | 8 | -------------------------------------------------------------------------------- /app/src/main/res/drawable/ic_banner_indicator_unselected.xml: -------------------------------------------------------------------------------- 1 | 2 | 4 | 5 | 8 | -------------------------------------------------------------------------------- /app/src/main/res/drawable/side_nav_bar.xml: -------------------------------------------------------------------------------- 1 | 3 | 9 | -------------------------------------------------------------------------------- /app/src/main/res/drawable/spacer_medium.xml: -------------------------------------------------------------------------------- 1 | 2 | 4 | 5 | 8 | 9 | 10 | 11 | -------------------------------------------------------------------------------- /app/src/main/res/drawable/search_bar_bg.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | -------------------------------------------------------------------------------- /app/src/main/res/drawable/ic_circle_red.xml: -------------------------------------------------------------------------------- 1 | 3 | 4 | 5 | -------------------------------------------------------------------------------- /app/src/main/res/drawable/ic_begin_search.xml: -------------------------------------------------------------------------------- 1 | 3 | 4 | 5 | -------------------------------------------------------------------------------- /app/src/main/res/layout/msg_notice.xml: -------------------------------------------------------------------------------- 1 | 2 | -------------------------------------------------------------------------------- /app/src/main/res/drawable/like_selector.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | -------------------------------------------------------------------------------- /.idea/misc.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 9 | -------------------------------------------------------------------------------- /app/src/main/res/drawable/collect_selector.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | -------------------------------------------------------------------------------- /app/src/main/res/drawable/btn_gridview.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | -------------------------------------------------------------------------------- /app/src/main/res/drawable-v24/btn_gridview.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | -------------------------------------------------------------------------------- /app/src/main/res/layout/view_home_banner.xml: -------------------------------------------------------------------------------- 1 | 2 | -------------------------------------------------------------------------------- /app/src/main/res/drawable/ic_delete.xml: -------------------------------------------------------------------------------- 1 | 3 | 4 | 5 | -------------------------------------------------------------------------------- /app/src/main/res/drawable/ic_arrow_back_black_24dp.xml: -------------------------------------------------------------------------------- 1 | 7 | 10 | 11 | -------------------------------------------------------------------------------- /app/src/main/res/drawable/web_progress_bar.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | -------------------------------------------------------------------------------- /.idea/inspectionProfiles/Project_Default.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 9 | -------------------------------------------------------------------------------- /app/src/main/res/drawable/bg_launch.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 12 | 13 | -------------------------------------------------------------------------------- /app/src/test/java/com/nuc/calvin/headline/ExampleUnitTest.java: -------------------------------------------------------------------------------- 1 | package com.nuc.calvin.headline; 2 | 3 | import org.junit.Test; 4 | 5 | import static org.junit.Assert.*; 6 | 7 | /** 8 | * Example local unit test, which will execute on the development machine (host). 9 | * 10 | * @see Testing documentation 11 | */ 12 | public class ExampleUnitTest { 13 | @Test 14 | public void addition_isCorrect() { 15 | assertEquals(4, 2 + 2); 16 | } 17 | } -------------------------------------------------------------------------------- /app/src/main/java/com/nuc/calvin/headline/activity/UpatePwdActivity.java: -------------------------------------------------------------------------------- 1 | package com.nuc.calvin.headline.activity; 2 | 3 | import android.support.v7.app.AppCompatActivity; 4 | import android.os.Bundle; 5 | 6 | import com.nuc.calvin.headline.R; 7 | 8 | public class UpatePwdActivity extends AppCompatActivity { 9 | 10 | @Override 11 | protected void onCreate(Bundle savedInstanceState) { 12 | super.onCreate(savedInstanceState); 13 | setContentView(R.layout.activity_upate_pwd); 14 | } 15 | } 16 | -------------------------------------------------------------------------------- /app/src/main/res/layout/fragment_tab_user.xml: -------------------------------------------------------------------------------- 1 | 5 | 6 | 10 | 11 | 12 | 13 | -------------------------------------------------------------------------------- /app/src/main/res/drawable/ic_iv_white_left.xml: -------------------------------------------------------------------------------- 1 | 3 | 4 | 5 | -------------------------------------------------------------------------------- /app/src/main/res/values/dimens.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 16dp 4 | 210dp 5 | 6 | 16dp 7 | 16dp 8 | 16dp 9 | 70dp 10 | 11 | -------------------------------------------------------------------------------- /app/src/main/res/drawable/tab_author.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | -------------------------------------------------------------------------------- /app/src/main/java/com/nuc/calvin/headline/json/RegisterJs.java: -------------------------------------------------------------------------------- 1 | package com.nuc.calvin.headline.json; 2 | 3 | public class RegisterJs { 4 | /** 5 | * code : 1 6 | * msg : 注册成功 7 | */ 8 | 9 | private int code; 10 | private String msg; 11 | 12 | public int getCode() { 13 | return code; 14 | } 15 | 16 | public void setCode(int code) { 17 | this.code = code; 18 | } 19 | 20 | public String getMsg() { 21 | return msg; 22 | } 23 | 24 | public void setMsg(String msg) { 25 | this.msg = msg; 26 | } 27 | } 28 | -------------------------------------------------------------------------------- /app/src/main/res/drawable/ic_mini_collect.xml: -------------------------------------------------------------------------------- 1 | 3 | 4 | 5 | -------------------------------------------------------------------------------- /app/src/main/res/drawable/ic_mini_collect_press.xml: -------------------------------------------------------------------------------- 1 | 3 | 4 | 5 | -------------------------------------------------------------------------------- /.idea/runConfigurations.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 11 | 12 | -------------------------------------------------------------------------------- /app/src/main/java/com/nuc/calvin/headline/json/OkJs.java: -------------------------------------------------------------------------------- 1 | package com.nuc.calvin.headline.json; 2 | 3 | public class OkJs { 4 | 5 | private int code; 6 | private String msg; 7 | 8 | public OkJs(int code, String msg) { 9 | this.code = code; 10 | this.msg = msg; 11 | } 12 | 13 | public int getCode() { 14 | return code; 15 | } 16 | 17 | public void setCode(int code) { 18 | this.code = code; 19 | } 20 | 21 | public String getMsg() { 22 | return msg; 23 | } 24 | 25 | public void setMsg(String msg) { 26 | this.msg = msg; 27 | } 28 | } 29 | -------------------------------------------------------------------------------- /app/src/main/res/drawable/ic_mini_left.xml: -------------------------------------------------------------------------------- 1 | 3 | 4 | 5 | -------------------------------------------------------------------------------- /app/src/main/res/layout/fragment_tab_article.xml: -------------------------------------------------------------------------------- 1 | 7 | 8 | 12 | 13 | 14 | 15 | -------------------------------------------------------------------------------- /.idea/gradle.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 14 | 15 | -------------------------------------------------------------------------------- /app/src/main/res/drawable/ic_go.xml: -------------------------------------------------------------------------------- 1 | 3 | 4 | 5 | 6 | -------------------------------------------------------------------------------- /app/src/main/res/drawable/ic_iv_like_press.xml: -------------------------------------------------------------------------------- 1 | 3 | 4 | 5 | -------------------------------------------------------------------------------- /app/src/main/res/layout/common_titlebar.xml: -------------------------------------------------------------------------------- 1 | 2 | 7 | 8 | 14 | 15 | -------------------------------------------------------------------------------- /app/src/main/res/drawable/ic_follow_press.xml: -------------------------------------------------------------------------------- 1 | 3 | 4 | 5 | -------------------------------------------------------------------------------- /gradle.properties: -------------------------------------------------------------------------------- 1 | # Project-wide Gradle settings. 2 | # IDE (e.g. Android Studio) users: 3 | # Gradle settings configured through the IDE *will override* 4 | # any settings specified in this file. 5 | # For more details on how to configure your build environment visit 6 | # http://www.gradle.org/docs/current/userguide/build_environment.html 7 | # Specifies the JVM arguments used for the daemon process. 8 | # The setting is particularly useful for tweaking memory settings. 9 | org.gradle.jvmargs=-Xmx1536m 10 | # When configured, Gradle will run in incubating parallel mode. 11 | # This option should only be used with decoupled projects. More details, visit 12 | # http://www.gradle.org/docs/current/userguide/multi_project_builds.html#sec:decoupled_projects 13 | # org.gradle.parallel=true 14 | 15 | 16 | -------------------------------------------------------------------------------- /app/src/main/java/com/nuc/calvin/headline/adapter/MyFragmentAdapter.java: -------------------------------------------------------------------------------- 1 | package com.nuc.calvin.headline.adapter; 2 | 3 | import android.support.v4.app.Fragment; 4 | import android.support.v4.app.FragmentManager; 5 | import android.support.v4.app.FragmentPagerAdapter; 6 | 7 | import java.util.ArrayList; 8 | 9 | public class MyFragmentAdapter extends FragmentPagerAdapter { 10 | 11 | ArrayList listFragment = new ArrayList<>(); 12 | 13 | public MyFragmentAdapter(FragmentManager fm, ArrayList listFragment) { 14 | super(fm); 15 | this.listFragment = listFragment; 16 | } 17 | 18 | @Override 19 | public Fragment getItem(int i) { 20 | return listFragment.get(i); 21 | } 22 | 23 | @Override 24 | public int getCount() { 25 | return listFragment.size(); 26 | } 27 | } 28 | -------------------------------------------------------------------------------- /app/proguard-rules.pro: -------------------------------------------------------------------------------- 1 | # Add project specific ProGuard rules here. 2 | # You can control the set of applied configuration files using the 3 | # proguardFiles setting in build.gradle. 4 | # 5 | # For more details, see 6 | # http://developer.android.com/guide/developing/tools/proguard.html 7 | 8 | # If your project uses WebView with JS, uncomment the following 9 | # and specify the fully qualified class name to the JavaScript interface 10 | # class: 11 | #-keepclassmembers class fqcn.of.javascript.interface.for.webview { 12 | # public *; 13 | #} 14 | 15 | # Uncomment this to preserve the line number information for 16 | # debugging stack traces. 17 | #-keepattributes SourceFile,LineNumberTable 18 | 19 | # If you keep the line number information, uncomment this to 20 | # hide the original source file name. 21 | #-renamesourcefileattribute SourceFile 22 | -------------------------------------------------------------------------------- /app/src/main/java/com/nuc/calvin/headline/bean/ui/Details.java: -------------------------------------------------------------------------------- 1 | package com.nuc.calvin.headline.bean.ui; 2 | 3 | public class Details { 4 | 5 | private int detailImgId; 6 | private String details_title; 7 | 8 | 9 | public Details() { 10 | } 11 | 12 | public Details(int detailImgId, String details_title) { 13 | this.detailImgId = detailImgId; 14 | this.details_title = details_title; 15 | } 16 | 17 | public int getDetailImgId() { 18 | return detailImgId; 19 | } 20 | 21 | public void setDetailImgId(int detailImgId) { 22 | this.detailImgId = detailImgId; 23 | } 24 | 25 | public String getDetails_title() { 26 | return details_title; 27 | } 28 | 29 | public void setDetails_title(String details_title) { 30 | this.details_title = details_title; 31 | } 32 | } 33 | -------------------------------------------------------------------------------- /app/src/main/java/com/nuc/calvin/headline/view/PointImageView.java: -------------------------------------------------------------------------------- 1 | package com.nuc.calvin.headline.view; 2 | 3 | import android.annotation.SuppressLint; 4 | import android.content.Context; 5 | import android.util.AttributeSet; 6 | import android.widget.ImageView; 7 | 8 | @SuppressLint("AppCompatCustomView") 9 | public class PointImageView extends ImageView { 10 | 11 | /** 12 | * 默认模式 13 | */ 14 | private int pointMode = NO_POINT; 15 | 16 | // 1.不显示红点 17 | public static final int NO_POINT = 1; 18 | // 2.只显示一个红点,表示有新消息 19 | public static final int ONLY_POINT = 2; 20 | // 3.显示一个红点,红点中间还有消息的数量 21 | public static final int NUMBER_POINT = 3; 22 | public PointImageView(Context context) { 23 | super(context); 24 | } 25 | 26 | public PointImageView(Context context, AttributeSet attrs) { 27 | super(context, attrs); 28 | } 29 | } 30 | -------------------------------------------------------------------------------- /app/src/androidTest/java/com/nuc/calvin/headline/ExampleInstrumentedTest.java: -------------------------------------------------------------------------------- 1 | package com.nuc.calvin.headline; 2 | 3 | import android.content.Context; 4 | import android.support.test.InstrumentationRegistry; 5 | import android.support.test.runner.AndroidJUnit4; 6 | 7 | import org.junit.Test; 8 | import org.junit.runner.RunWith; 9 | 10 | import static org.junit.Assert.*; 11 | 12 | /** 13 | * Instrumented test, which will execute on an Android device. 14 | * 15 | * @see Testing documentation 16 | */ 17 | @RunWith(AndroidJUnit4.class) 18 | public class ExampleInstrumentedTest { 19 | @Test 20 | public void useAppContext() { 21 | // Context of the app under test. 22 | Context appContext = InstrumentationRegistry.getTargetContext(); 23 | 24 | assertEquals("com.nuc.calvin.headline", appContext.getPackageName()); 25 | } 26 | } 27 | -------------------------------------------------------------------------------- /app/src/main/res/drawable/ic_dowm.xml: -------------------------------------------------------------------------------- 1 | 3 | 4 | 5 | -------------------------------------------------------------------------------- /app/src/main/res/drawable/ic_turndown.xml: -------------------------------------------------------------------------------- 1 | 3 | 4 | 5 | -------------------------------------------------------------------------------- /app/src/main/res/layout/home_user_details.xml: -------------------------------------------------------------------------------- 1 | 2 | 6 | 7 | 12 | 13 | 22 | -------------------------------------------------------------------------------- /app/src/main/res/drawable/ic_download_24dp.xml: -------------------------------------------------------------------------------- 1 | 7 | 10 | 11 | -------------------------------------------------------------------------------- /app/src/main/res/drawable/circleblue.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | /** 5 | *按钮颜色 6 | */ 7 | 11 | /** 12 | *圆角设置 13 | */ 14 | 21 | 22 | /** 23 | *和边缘的距离 24 | */ 25 | 32 | -------------------------------------------------------------------------------- /app/src/main/res/drawable/circlegreen.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | /** 5 | *按钮颜色 6 | */ 7 | 11 | /** 12 | *圆角设置 13 | */ 14 | 21 | 22 | /** 23 | *和边缘的距离 24 | */ 25 | 32 | -------------------------------------------------------------------------------- /app/src/main/res/drawable/circlered.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | /** 5 | *按钮颜色 6 | */ 7 | 11 | /** 12 | *圆角设置 13 | */ 14 | 21 | 22 | /** 23 | *和边缘的距离 24 | */ 25 | 32 | -------------------------------------------------------------------------------- /app/src/main/res/drawable/circleyellow.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | /** 5 | *按钮颜色 6 | */ 7 | 11 | /** 12 | *圆角设置 13 | */ 14 | 21 | 22 | /** 23 | *和边缘的距离 24 | */ 25 | 32 | -------------------------------------------------------------------------------- /app/src/main/res/drawable/ic_iv_dingyue.xml: -------------------------------------------------------------------------------- 1 | 3 | 4 | 5 | -------------------------------------------------------------------------------- /app/src/main/java/com/nuc/calvin/headline/json/LoginJs.java: -------------------------------------------------------------------------------- 1 | package com.nuc.calvin.headline.json; 2 | 3 | import com.nuc.calvin.headline.bean.UserCustom; 4 | 5 | import java.io.Serializable; 6 | 7 | public class LoginJs implements Serializable { 8 | private int code; 9 | private String msg; 10 | private UserCustom user; 11 | 12 | public int getCode() { 13 | return code; 14 | } 15 | 16 | public void setCode(int code) { 17 | this.code = code; 18 | } 19 | 20 | public String getMsg() { 21 | return msg; 22 | } 23 | 24 | public void setMsg(String msg) { 25 | this.msg = msg; 26 | } 27 | 28 | public UserCustom getUser() { 29 | return user; 30 | } 31 | 32 | public void setUser(UserCustom user) { 33 | this.user = user; 34 | } 35 | 36 | @Override 37 | public String toString() { 38 | return "LoginJs{" + 39 | "code=" + code + 40 | ", msg='" + msg + '\'' + 41 | ", user=" + user + 42 | '}'; 43 | } 44 | } 45 | -------------------------------------------------------------------------------- /app/src/main/java/com/nuc/calvin/headline/activity/MyFansActivity.java: -------------------------------------------------------------------------------- 1 | package com.nuc.calvin.headline.activity; 2 | 3 | import android.content.Intent; 4 | import android.support.v7.app.AppCompatActivity; 5 | import android.os.Bundle; 6 | import android.view.View; 7 | import android.widget.ImageView; 8 | 9 | import com.nuc.calvin.headline.R; 10 | 11 | public class MyFansActivity extends BaseActivity { 12 | 13 | private ImageView my_fans_left; 14 | 15 | 16 | @Override 17 | protected void initView(Bundle savedInstanceState) { 18 | my_fans_left = findViewById(R.id.my_fans_left); 19 | my_fans_left.setOnClickListener(new View.OnClickListener() { 20 | @Override 21 | public void onClick(View v) { 22 | Intent intent = new Intent(MyFansActivity.this, MainActivity.class); 23 | intent.putExtra("id", 3); 24 | startActivity(intent); 25 | } 26 | }); 27 | } 28 | 29 | @Override 30 | protected int getContentView() { 31 | return R.layout.activity_my_fans; 32 | } 33 | } 34 | -------------------------------------------------------------------------------- /app/src/main/java/com/nuc/calvin/headline/adapter/SearchAdapter.java: -------------------------------------------------------------------------------- 1 | package com.nuc.calvin.headline.adapter; 2 | 3 | import android.support.annotation.Nullable; 4 | import android.support.v4.app.Fragment; 5 | import android.support.v4.app.FragmentManager; 6 | import android.support.v4.app.FragmentPagerAdapter; 7 | 8 | import java.util.ArrayList; 9 | import java.util.List; 10 | 11 | public class SearchAdapter extends FragmentPagerAdapter { 12 | 13 | private List fragments=new ArrayList<>(); 14 | private List list =new ArrayList<>(); 15 | 16 | public SearchAdapter(FragmentManager fm, List fragments, List list) { 17 | super(fm); 18 | this.fragments = fragments; 19 | this.list = list; 20 | } 21 | 22 | @Override 23 | public Fragment getItem(int i) { 24 | return fragments.get(i); 25 | } 26 | 27 | @Override 28 | public int getCount() { 29 | return fragments.size(); 30 | } 31 | 32 | @Nullable 33 | @Override 34 | public CharSequence getPageTitle(int position) { 35 | return list.get(position); 36 | } 37 | } 38 | -------------------------------------------------------------------------------- /app/src/main/res/drawable/ic_mini_like.xml: -------------------------------------------------------------------------------- 1 | 3 | 4 | 5 | -------------------------------------------------------------------------------- /app/src/main/res/drawable/ic_mini_like_press.xml: -------------------------------------------------------------------------------- 1 | 3 | 4 | 5 | -------------------------------------------------------------------------------- /app/src/main/java/com/nuc/calvin/headline/bean/Relation.java: -------------------------------------------------------------------------------- 1 | package com.nuc.calvin.headline.bean; 2 | 3 | public class Relation { 4 | /** 5 | * 相关id 6 | */ 7 | private Integer relationId; 8 | /** 9 | * 用户id 10 | */ 11 | private Integer userId; 12 | /** 13 | *关注的用户的id 14 | */ 15 | private Integer followId; 16 | /** 17 | * 18 | */ 19 | private Integer state; 20 | 21 | public Integer getRelationId() { 22 | return relationId; 23 | } 24 | 25 | public void setRelationId(Integer relationId) { 26 | this.relationId = relationId; 27 | } 28 | 29 | public Integer getUserId() { 30 | return userId; 31 | } 32 | 33 | public void setUserId(Integer userId) { 34 | this.userId = userId; 35 | } 36 | 37 | public Integer getFollowId() { 38 | return followId; 39 | } 40 | 41 | public void setFollowId(Integer followId) { 42 | this.followId = followId; 43 | } 44 | 45 | public Integer getState() { 46 | return state; 47 | } 48 | 49 | public void setState(Integer state) { 50 | this.state = state; 51 | } 52 | } 53 | -------------------------------------------------------------------------------- /app/src/main/res/layout/activity_main.xml: -------------------------------------------------------------------------------- 1 | 2 | 9 | 10 | 15 | 16 | 22 | 23 | 29 | 30 | 31 | -------------------------------------------------------------------------------- /app/src/main/res/drawable/ic_mini_comment.xml: -------------------------------------------------------------------------------- 1 | 3 | 4 | 5 | 6 | -------------------------------------------------------------------------------- /app/src/main/java/com/nuc/calvin/headline/bean/Collect.java: -------------------------------------------------------------------------------- 1 | package com.nuc.calvin.headline.bean; 2 | 3 | import java.util.Date; 4 | 5 | public class Collect { 6 | 7 | /** 8 | * 收藏id 9 | */ 10 | private Integer collectId; 11 | /** 12 | * 文章id 13 | */ 14 | private Integer ArticleId; 15 | /** 16 | * 用户id 17 | */ 18 | private Integer userId; 19 | /** 20 | * 收藏时间 21 | */ 22 | private Date collectTime; 23 | 24 | public Integer getCollectId() { 25 | return collectId; 26 | } 27 | 28 | public void setCollectId(Integer collectId) { 29 | this.collectId = collectId; 30 | } 31 | 32 | public Integer getArticleId() { 33 | return ArticleId; 34 | } 35 | 36 | public void setArticleId(Integer articleId) { 37 | ArticleId = articleId; 38 | } 39 | 40 | public Integer getUserId() { 41 | return userId; 42 | } 43 | 44 | public void setUserId(Integer userId) { 45 | this.userId = userId; 46 | } 47 | 48 | public Date getCollectTime() { 49 | return collectTime; 50 | } 51 | 52 | public void setCollectTime(Date collectTime) { 53 | this.collectTime = collectTime; 54 | } 55 | } 56 | -------------------------------------------------------------------------------- /app/src/main/java/com/nuc/calvin/headline/bean/CollectCustom.java: -------------------------------------------------------------------------------- 1 | package com.nuc.calvin.headline.bean; 2 | 3 | public class CollectCustom extends Collect { 4 | 5 | private String date; 6 | private String username; 7 | private String userImg; 8 | 9 | private UserCustom user; 10 | private ArticleCustom article; 11 | 12 | public String getDate() { 13 | return date; 14 | } 15 | 16 | public void setDate(String date) { 17 | this.date = date; 18 | } 19 | 20 | public String getUsername() { 21 | return username; 22 | } 23 | 24 | public void setUsername(String username) { 25 | this.username = username; 26 | } 27 | 28 | public String getUserImg() { 29 | return userImg; 30 | } 31 | 32 | public void setUserImg(String userImg) { 33 | this.userImg = userImg; 34 | } 35 | 36 | public UserCustom getUser() { 37 | return user; 38 | } 39 | 40 | public void setUser(UserCustom user) { 41 | this.user = user; 42 | } 43 | 44 | public ArticleCustom getArticle() { 45 | return article; 46 | } 47 | 48 | public void setArticle(ArticleCustom article) { 49 | this.article = article; 50 | } 51 | } 52 | -------------------------------------------------------------------------------- /app/src/main/java/com/nuc/calvin/headline/bean/Likes.java: -------------------------------------------------------------------------------- 1 | package com.nuc.calvin.headline.bean; 2 | 3 | import java.util.Date; 4 | 5 | public class Likes { 6 | /** 7 | * 点赞id 8 | */ 9 | private Integer likesId; 10 | /** 11 | * 点赞用户的id 12 | */ 13 | private Integer userId; 14 | /** 15 | * 被点赞的文章 16 | */ 17 | private Integer articleId; 18 | /** 19 | * 点赞的时间 20 | */ 21 | private Date likesTime; 22 | 23 | 24 | 25 | public Integer getLikesId() { 26 | return likesId; 27 | } 28 | 29 | public void setLikesId(Integer likesId) { 30 | this.likesId = likesId; 31 | } 32 | 33 | public Integer getUserId() { 34 | return userId; 35 | } 36 | 37 | public void setUserId(Integer userId) { 38 | this.userId = userId; 39 | } 40 | 41 | public Integer getArticleId() { 42 | return articleId; 43 | } 44 | 45 | public void setArticleId(Integer articleId) { 46 | this.articleId = articleId; 47 | } 48 | 49 | public Date getLikesTime() { 50 | return likesTime; 51 | } 52 | 53 | public void setLikeTime(Date likeTime) { 54 | this.likesTime = likeTime; 55 | } 56 | 57 | 58 | 59 | } 60 | -------------------------------------------------------------------------------- /app/src/main/java/com/nuc/calvin/headline/bean/Article.java: -------------------------------------------------------------------------------- 1 | package com.nuc.calvin.headline.bean; 2 | 3 | 4 | 5 | public class Article { 6 | /** 7 | * 文章id 8 | */ 9 | private Integer articleId; 10 | /** 11 | * 作者id 12 | */ 13 | private Integer userId; 14 | /** 15 | * 文章标题 16 | */ 17 | private String articleTitle; 18 | /** 19 | * 文章url 20 | */ 21 | private String articleUrl; 22 | 23 | 24 | public Integer getArticleId() { 25 | return articleId; 26 | } 27 | 28 | public void setArticleId(Integer articleId) { 29 | this.articleId = articleId; 30 | } 31 | 32 | public Integer getUserId() { 33 | return userId; 34 | } 35 | 36 | public void setUserId(Integer userId) { 37 | this.userId = userId; 38 | } 39 | 40 | public String getArticleTitle() { 41 | return articleTitle; 42 | } 43 | 44 | public void setArticleTitle(String articleTitle) { 45 | this.articleTitle = articleTitle; 46 | } 47 | 48 | public String getArticleUrl() { 49 | return articleUrl; 50 | } 51 | 52 | public void setArticleUrl(String articleUrl) { 53 | this.articleUrl = articleUrl; 54 | } 55 | 56 | } 57 | -------------------------------------------------------------------------------- /app/src/main/res/layout/view_banner_item.xml: -------------------------------------------------------------------------------- 1 | 2 | 8 | 9 | 14 | 15 | 20 | 21 | 29 | 30 | -------------------------------------------------------------------------------- /app/src/main/java/com/nuc/calvin/headline/activity/MsgLikesActivity.java: -------------------------------------------------------------------------------- 1 | package com.nuc.calvin.headline.activity; 2 | 3 | import android.content.Intent; 4 | import android.support.v7.app.AppCompatActivity; 5 | import android.os.Bundle; 6 | import android.support.v7.widget.RecyclerView; 7 | import android.view.View; 8 | import android.widget.ImageView; 9 | 10 | import com.nuc.calvin.headline.R; 11 | 12 | public class MsgLikesActivity extends BaseActivity { 13 | 14 | private RecyclerView like_recy; 15 | private ImageView like_left; 16 | 17 | @Override 18 | protected void initView(Bundle savedInstanceState) { 19 | like_recy = findViewById(R.id.msg_like_recy); 20 | like_left = findViewById(R.id.msg_like_left); 21 | 22 | like_left.setOnClickListener(new View.OnClickListener() { 23 | @Override 24 | public void onClick(View v) { 25 | Intent intent = new Intent(MsgLikesActivity.this, MainActivity.class); 26 | intent.putExtra("id", 1); 27 | startActivity(intent); 28 | finish(); 29 | } 30 | }); 31 | } 32 | 33 | @Override 34 | protected int getContentView() { 35 | return R.layout.activity_msg_likes; 36 | } 37 | } 38 | -------------------------------------------------------------------------------- /app/src/main/java/com/nuc/calvin/headline/activity/MsgCollectActivity.java: -------------------------------------------------------------------------------- 1 | package com.nuc.calvin.headline.activity; 2 | 3 | import android.content.Intent; 4 | import android.support.v7.app.AppCompatActivity; 5 | import android.os.Bundle; 6 | import android.support.v7.widget.RecyclerView; 7 | import android.view.View; 8 | import android.widget.ImageView; 9 | 10 | import com.nuc.calvin.headline.R; 11 | 12 | public class MsgCollectActivity extends BaseActivity { 13 | 14 | private RecyclerView recyclerView; 15 | private ImageView left; 16 | 17 | @Override 18 | protected void initView(Bundle savedInstanceState) { 19 | recyclerView = findViewById(R.id.msg_fans_recy); 20 | left = findViewById(R.id.msg_fans_left); 21 | 22 | 23 | left.setOnClickListener(new View.OnClickListener() { 24 | @Override 25 | public void onClick(View v) { 26 | Intent intent = new Intent(MsgCollectActivity.this, MainActivity.class); 27 | intent.putExtra("id", 1); 28 | startActivity(intent); 29 | finish(); 30 | } 31 | }); 32 | } 33 | 34 | @Override 35 | protected int getContentView() { 36 | return R.layout.activity_msg_collect; 37 | } 38 | } 39 | -------------------------------------------------------------------------------- /app/src/main/java/com/nuc/calvin/headline/bean/LikesCustom.java: -------------------------------------------------------------------------------- 1 | package com.nuc.calvin.headline.bean; 2 | 3 | public class LikesCustom extends Likes { 4 | /** 5 | * 扩展自定义的date String类型 6 | */ 7 | private String date; 8 | 9 | private String username; 10 | private String userImg; 11 | private ArticleCustom article; 12 | private UserCustom user; 13 | 14 | public String getDate() { 15 | return date; 16 | } 17 | 18 | public void setDate(String date) { 19 | this.date = date; 20 | } 21 | 22 | public String getUsername() { 23 | return username; 24 | } 25 | 26 | public void setUsername(String username) { 27 | this.username = username; 28 | } 29 | 30 | public String getUserImg() { 31 | return userImg; 32 | } 33 | 34 | public void setUserImg(String userImg) { 35 | this.userImg = userImg; 36 | } 37 | 38 | public ArticleCustom getArticle() { 39 | return article; 40 | } 41 | 42 | public void setArticle(ArticleCustom article) { 43 | this.article = article; 44 | } 45 | 46 | public UserCustom getUser() { 47 | return user; 48 | } 49 | 50 | public void setUser(UserCustom user) { 51 | this.user = user; 52 | } 53 | } 54 | -------------------------------------------------------------------------------- /app/src/main/res/drawable/ic_iv_like.xml: -------------------------------------------------------------------------------- 1 | 3 | 4 | 5 | -------------------------------------------------------------------------------- /app/src/main/res/layout/fragment_home_choice.xml: -------------------------------------------------------------------------------- 1 | 2 | 7 | 8 | 12 | 13 | 18 | 19 | 20 | 21 | 33 | 34 | 35 | -------------------------------------------------------------------------------- /app/src/main/java/com/nuc/calvin/headline/bean/Banner.java: -------------------------------------------------------------------------------- 1 | package com.nuc.calvin.headline.bean; 2 | 3 | public class Banner { 4 | /** 5 | * 广告id 6 | */ 7 | private int bannerId; 8 | /** 9 | * 文章id 10 | */ 11 | private int articleId; 12 | /** 13 | * 广告标题 14 | */ 15 | private String bannerTitle; 16 | /** 17 | * 广告图片 18 | */ 19 | private String bannerImage; 20 | 21 | /** 22 | * 广告所属的文章 一对一关系 23 | */ 24 | private Article article; 25 | 26 | public int getBannerId() { 27 | return bannerId; 28 | } 29 | 30 | public void setBannerId(int bannerId) { 31 | this.bannerId = bannerId; 32 | } 33 | 34 | public int getArticleId() { 35 | return articleId; 36 | } 37 | 38 | public void setArticleId(int articleId) { 39 | this.articleId = articleId; 40 | } 41 | 42 | public String getBannerTitle() { 43 | return bannerTitle; 44 | } 45 | 46 | public void setBannerTitle(String bannerTitle) { 47 | this.bannerTitle = bannerTitle; 48 | } 49 | 50 | public String getBannerImage() { 51 | return bannerImage; 52 | } 53 | 54 | public void setBannerImage(String bannerImage) { 55 | this.bannerImage = bannerImage; 56 | } 57 | 58 | public Article getArticle() { 59 | return article; 60 | } 61 | 62 | public void setArticle(Article article) { 63 | this.article = article; 64 | } 65 | } 66 | -------------------------------------------------------------------------------- /app/src/main/java/com/nuc/calvin/headline/bean/Comment.java: -------------------------------------------------------------------------------- 1 | package com.nuc.calvin.headline.bean; 2 | 3 | import java.io.Serializable; 4 | import java.util.Date; 5 | import java.util.List; 6 | 7 | public class Comment implements Serializable { 8 | /** 9 | * 评论id 10 | */ 11 | private Integer commentId; 12 | /** 13 | * 用户id 14 | */ 15 | private Integer userId; 16 | /** 17 | * 文章id 18 | */ 19 | private Integer articleId; 20 | /** 21 | * 评论内容 22 | */ 23 | private String commentContent; 24 | /** 25 | * 评论时间 26 | */ 27 | private Date commentTime; 28 | 29 | 30 | public Integer getCommentId() { 31 | return commentId; 32 | } 33 | 34 | public void setCommentId(Integer commentId) { 35 | this.commentId = commentId; 36 | } 37 | 38 | public Integer getUserId() { 39 | return userId; 40 | } 41 | 42 | public void setUserId(Integer userId) { 43 | this.userId = userId; 44 | } 45 | 46 | public Integer getArticleId() { 47 | return articleId; 48 | } 49 | 50 | public void setArticleId(Integer articleId) { 51 | this.articleId = articleId; 52 | } 53 | 54 | public String getCommentContent() { 55 | return commentContent; 56 | } 57 | 58 | public void setCommentContent(String commentContent) { 59 | this.commentContent = commentContent; 60 | } 61 | 62 | public Date getCommentTime() { 63 | return commentTime; 64 | } 65 | 66 | public void setCommentTime(Date commentTime) { 67 | this.commentTime = commentTime; 68 | } 69 | } 70 | -------------------------------------------------------------------------------- /app/src/main/java/com/nuc/calvin/headline/bean/ReplyCustom.java: -------------------------------------------------------------------------------- 1 | package com.nuc.calvin.headline.bean; 2 | 3 | public class ReplyCustom extends Reply { 4 | /** 5 | * from 昵称 6 | */ 7 | private String fromName; 8 | /** 9 | * to 昵称 10 | */ 11 | private String toName; 12 | /** 13 | * 头像 14 | */ 15 | private String fromImg; 16 | private String toImg; 17 | /** 18 | * 源文章 19 | */ 20 | private Article article; 21 | 22 | /** 23 | * 回复时间 sql扩展 24 | */ 25 | private String rtime; 26 | 27 | public String getFromName() { 28 | return fromName; 29 | } 30 | 31 | public void setFromName(String fromName) { 32 | this.fromName = fromName; 33 | } 34 | 35 | public String getToName() { 36 | return toName; 37 | } 38 | 39 | public void setToName(String toName) { 40 | this.toName = toName; 41 | } 42 | 43 | public String getFromImg() { 44 | return fromImg; 45 | } 46 | 47 | public void setFromImg(String fromImg) { 48 | this.fromImg = fromImg; 49 | } 50 | 51 | public String getToImg() { 52 | return toImg; 53 | } 54 | 55 | public void setToImg(String toImg) { 56 | this.toImg = toImg; 57 | } 58 | 59 | public Article getArticle() { 60 | return article; 61 | } 62 | 63 | public void setArticle(Article article) { 64 | this.article = article; 65 | } 66 | 67 | public String getRtime() { 68 | return rtime; 69 | } 70 | 71 | public void setRtime(String rtime) { 72 | this.rtime = rtime; 73 | } 74 | } 75 | -------------------------------------------------------------------------------- /app/src/main/java/com/nuc/calvin/headline/adapter/HomeAdapter.java: -------------------------------------------------------------------------------- 1 | package com.nuc.calvin.headline.adapter; 2 | 3 | import android.support.annotation.NonNull; 4 | import android.support.annotation.Nullable; 5 | import android.support.v4.app.Fragment; 6 | import android.support.v4.app.FragmentManager; 7 | import android.support.v4.app.FragmentPagerAdapter; 8 | 9 | import com.nuc.calvin.headline.fragment.BaseFragment; 10 | 11 | import java.util.ArrayList; 12 | import java.util.List; 13 | 14 | public class HomeAdapter extends FragmentPagerAdapter { 15 | private List mFragmentList = new ArrayList<>(); 16 | private List mTitleList = new ArrayList<>(); 17 | 18 | public HomeAdapter(FragmentManager fm) { 19 | super(fm); 20 | } 21 | 22 | 23 | public void addDataList(List fragments, List titles) { 24 | if (fragments != null && titles != null) { 25 | mFragmentList.clear(); 26 | mTitleList.clear(); 27 | 28 | mFragmentList.addAll(fragments); 29 | mTitleList.addAll(titles); 30 | } 31 | notifyDataSetChanged(); 32 | } 33 | 34 | @Override 35 | 36 | public Fragment getItem(int i) { 37 | return mFragmentList.get(i); 38 | } 39 | 40 | @Override 41 | public int getCount() { 42 | return mTitleList.size(); 43 | } 44 | 45 | @Nullable 46 | @Override 47 | public CharSequence getPageTitle(int position) { 48 | return mTitleList.get(position); 49 | } 50 | 51 | @Override 52 | public int getItemPosition(@NonNull Object object) { 53 | return POSITION_NONE; 54 | } 55 | } 56 | -------------------------------------------------------------------------------- /app/src/main/java/com/nuc/calvin/headline/bean/UserCustom.java: -------------------------------------------------------------------------------- 1 | package com.nuc.calvin.headline.bean; 2 | 3 | import java.io.Serializable; 4 | import java.util.Date; 5 | 6 | public class UserCustom extends User implements Serializable { 7 | /** 8 | * 用户关系 0——未关注 1——已关注 2——相互关注 9 | */ 10 | private Relation relation; 11 | 12 | /** 13 | * 文章数 14 | */ 15 | private int articleCount; 16 | /** 17 | * 关注数 18 | */ 19 | private int followCount; 20 | /** 21 | * 粉丝数 22 | */ 23 | private int fansCount; 24 | 25 | public Relation getRelation() { 26 | return relation; 27 | } 28 | 29 | public void setRelation(Relation relation) { 30 | this.relation = relation; 31 | } 32 | 33 | public int getArticleCount() { 34 | return articleCount; 35 | } 36 | 37 | public void setArticleCount(int articleCount) { 38 | this.articleCount = articleCount; 39 | } 40 | 41 | public int getFollowCount() { 42 | return followCount; 43 | } 44 | 45 | public void setFollowCount(int followCount) { 46 | this.followCount = followCount; 47 | } 48 | 49 | public int getFansCount() { 50 | return fansCount; 51 | } 52 | 53 | public void setFansCount(int fansCount) { 54 | this.fansCount = fansCount; 55 | } 56 | 57 | @Override 58 | public String toString() { 59 | return "UserCustom{" + 60 | "relation=" + relation + 61 | ", articleCount=" + articleCount + 62 | ", followCount=" + followCount + 63 | ", fansCount=" + fansCount + 64 | '}'; 65 | } 66 | } 67 | -------------------------------------------------------------------------------- /app/src/main/java/com/nuc/calvin/headline/activity/BaseActivity.java: -------------------------------------------------------------------------------- 1 | package com.nuc.calvin.headline.activity; 2 | 3 | import android.net.Uri; 4 | import android.os.Bundle; 5 | import android.os.Handler; 6 | import android.support.annotation.Nullable; 7 | import android.support.v7.app.AppCompatActivity; 8 | import android.support.v7.widget.Toolbar; 9 | import android.view.MenuItem; 10 | 11 | 12 | import com.facebook.drawee.backends.pipeline.Fresco; 13 | import com.nuc.calvin.headline.R; 14 | import com.nuc.calvin.headline.fragment.BaseFragment; 15 | 16 | import butterknife.Bind; 17 | import butterknife.ButterKnife; 18 | 19 | 20 | public abstract class BaseActivity extends AppCompatActivity implements BaseFragment.OnFragmentInteractionListener { 21 | 22 | @Override 23 | protected void onCreate(@Nullable Bundle savedInstanceState) { 24 | super.onCreate(savedInstanceState); 25 | setContentView(getContentView()); 26 | ButterKnife.bind(this); 27 | initView(savedInstanceState); 28 | Fresco.initialize(getApplicationContext()); 29 | } 30 | 31 | 32 | /* protected abstract Handler initHandle();*/ 33 | 34 | /** 35 | * 初始化UI 36 | * 37 | * @param 38 | */ 39 | protected abstract void initView(Bundle savedInstanceState); 40 | 41 | 42 | /** 43 | * 销毁activity 44 | */ 45 | @Override 46 | protected void onDestroy() { 47 | super.onDestroy(); 48 | } 49 | 50 | 51 | /** 52 | * 获得一个activity中的layout 53 | * 54 | * @return 55 | */ 56 | protected abstract int getContentView(); 57 | 58 | 59 | @Override 60 | public void onFragmentInteraction(Uri uri) { 61 | 62 | } 63 | 64 | } 65 | -------------------------------------------------------------------------------- /app/src/main/java/com/nuc/calvin/headline/json/BannerJs.java: -------------------------------------------------------------------------------- 1 | package com.nuc.calvin.headline.json; 2 | 3 | import com.nuc.calvin.headline.bean.Article; 4 | import com.nuc.calvin.headline.bean.User; 5 | 6 | 7 | public class BannerJs { 8 | 9 | private Integer BannerId; 10 | private Integer articleId; 11 | private String bannerImage; 12 | private Article article; 13 | private User user; 14 | 15 | public Integer getBannerId() { 16 | return BannerId; 17 | } 18 | 19 | public void setBannerId(Integer bannerId) { 20 | BannerId = bannerId; 21 | } 22 | 23 | public Integer getArticleId() { 24 | return articleId; 25 | } 26 | 27 | public void setArticleId(Integer articleId) { 28 | this.articleId = articleId; 29 | } 30 | 31 | public String getBannerImage() { 32 | return bannerImage; 33 | } 34 | 35 | public void setBannerImage(String bannerImage) { 36 | this.bannerImage = bannerImage; 37 | } 38 | 39 | public Article getArticle() { 40 | return article; 41 | } 42 | 43 | public void setArticle(Article article) { 44 | this.article = article; 45 | } 46 | 47 | public User getUser() { 48 | return user; 49 | } 50 | 51 | public void setUser(User user) { 52 | this.user = user; 53 | } 54 | 55 | @Override 56 | public String toString() { 57 | return "BannerJs{" + 58 | "BannerId=" + BannerId + 59 | ", articleId=" + articleId + 60 | ", bannerImage='" + bannerImage + '\'' + 61 | ", article=" + article + 62 | ", user=" + user + 63 | '}'; 64 | } 65 | } 66 | -------------------------------------------------------------------------------- /app/src/main/java/com/nuc/calvin/headline/bean/Reply.java: -------------------------------------------------------------------------------- 1 | package com.nuc.calvin.headline.bean; 2 | 3 | import java.util.Date; 4 | 5 | public class Reply { 6 | /** 7 | * 回复id 8 | */ 9 | private Integer replyId; 10 | /** 11 | * 评论id 12 | */ 13 | private Integer commentId; 14 | /** 15 | * from 哪个user 16 | */ 17 | private Integer fromId; 18 | /** 19 | * to哪个user 20 | */ 21 | private Integer toId; 22 | /** 23 | * 评论内容 24 | */ 25 | private String replyContent; 26 | 27 | /** 28 | * 回复时间 29 | */ 30 | private Date replyTime; 31 | 32 | public Integer getReplyId() { 33 | return replyId; 34 | } 35 | 36 | public void setReplyId(Integer replyId) { 37 | this.replyId = replyId; 38 | } 39 | 40 | public Integer getCommentId() { 41 | return commentId; 42 | } 43 | 44 | public void setCommentId(Integer commentId) { 45 | this.commentId = commentId; 46 | } 47 | 48 | public Integer getFromId() { 49 | return fromId; 50 | } 51 | 52 | public void setFromId(Integer fromId) { 53 | this.fromId = fromId; 54 | } 55 | 56 | public Integer getToId() { 57 | return toId; 58 | } 59 | 60 | public void setToId(Integer toId) { 61 | this.toId = toId; 62 | } 63 | 64 | public String getReplyContent() { 65 | return replyContent; 66 | } 67 | 68 | public void setReplyContent(String replyContent) { 69 | this.replyContent = replyContent; 70 | } 71 | 72 | public Date getReplyTime() { 73 | return replyTime; 74 | } 75 | 76 | public void setReplyTime(Date replyTime) { 77 | this.replyTime = replyTime; 78 | } 79 | } 80 | -------------------------------------------------------------------------------- /app/src/main/res/layout/activity_my_collect.xml: -------------------------------------------------------------------------------- 1 | 2 | 9 | 10 | 11 | 16 | 17 | 21 | 22 | 30 | 31 | 32 | 33 | 41 | 42 | 43 | 44 | 48 | 49 | -------------------------------------------------------------------------------- /app/src/main/res/layout/activity_my_fans.xml: -------------------------------------------------------------------------------- 1 | 2 | 9 | 10 | 11 | 16 | 17 | 22 | 23 | 31 | 32 | 33 | 34 | 42 | 43 | 44 | 45 | 49 | 50 | 51 | -------------------------------------------------------------------------------- /app/src/main/res/layout/activity_my_follow.xml: -------------------------------------------------------------------------------- 1 | 2 | 9 | 10 | 11 | 16 | 17 | 22 | 23 | 31 | 32 | 33 | 34 | 42 | 43 | 44 | 45 | 49 | 50 | 51 | -------------------------------------------------------------------------------- /app/src/main/res/layout/activity_my_article.xml: -------------------------------------------------------------------------------- 1 | 2 | 9 | 10 | 11 | 16 | 17 | 22 | 23 | 31 | 32 | 33 | 34 | 42 | 43 | 44 | 45 | 49 | 50 | 51 | -------------------------------------------------------------------------------- /app/src/main/res/values/strings.xml: -------------------------------------------------------------------------------- 1 | 2 | IT头条 3 | Open navigation drawer 4 | Close navigation drawer 5 | Settings 6 | Hello blank fragment 7 | 8 | 首页 9 | 我的分享 10 | 我创建的主题 11 | 我订阅的主题 12 | 我的收藏 13 | 意见反馈 14 | 设置 15 | 详情 16 | "选择 韩海龙\n龚勇峰 创建 | 作者 抛物线" 17 | "韩海龙" 18 | "韩海龙龚勇峰" 19 | "联系我们" 20 | "商务合作" 21 | "我们以开放的心态寻求合作" 22 | "通知" 23 | "接受消息推送" 24 | "及时为您推荐精选文章" 25 | "分享" 26 | "监听剪切板" 27 | "发现url格式将自动打开分享页面" 28 | "其他" 29 | "检查更新" 30 | "清除缓存" 31 | "推荐App给好友" 32 | "为应用评分" 33 | "关于" 34 | BaseActivity 35 | 36 | -------------------------------------------------------------------------------- /app/src/main/java/com/nuc/calvin/headline/bean/User.java: -------------------------------------------------------------------------------- 1 | package com.nuc.calvin.headline.bean; 2 | 3 | import java.util.Date; 4 | 5 | public class User { 6 | /** 7 | * 用户id 8 | */ 9 | private Integer userId; 10 | /** 11 | * 用户昵称 12 | */ 13 | private String username; 14 | /** 15 | * 注册邮箱 16 | */ 17 | private String email; 18 | /** 19 | * 用户密码 20 | */ 21 | private String password; 22 | /** 23 | * 用户头像 24 | */ 25 | private String headImg; 26 | /** 27 | * 用户个性签名 28 | */ 29 | private String signature; 30 | /** 31 | * 用户性别 0--男 1--女 32 | */ 33 | private Integer sex; 34 | 35 | 36 | public Integer getUserId() { 37 | return userId; 38 | } 39 | 40 | public void setUserId(Integer userId) { 41 | this.userId = userId; 42 | } 43 | 44 | public String getUsername() { 45 | return username; 46 | } 47 | 48 | public void setUsername(String username) { 49 | this.username = username; 50 | } 51 | 52 | public String getEmail() { 53 | return email; 54 | } 55 | 56 | public void setEmail(String email) { 57 | this.email = email; 58 | } 59 | 60 | public String getPassword() { 61 | return password; 62 | } 63 | 64 | public void setPassword(String password) { 65 | this.password = password; 66 | } 67 | 68 | public String getHeadImg() { 69 | return headImg; 70 | } 71 | 72 | public void setHeadImg(String headImg) { 73 | this.headImg = headImg; 74 | } 75 | 76 | public String getSignature() { 77 | return signature; 78 | } 79 | 80 | public void setSignature(String signature) { 81 | this.signature = signature; 82 | } 83 | 84 | public Integer getSex() { 85 | return sex; 86 | } 87 | 88 | public void setSex(Integer sex) { 89 | this.sex = sex; 90 | } 91 | } 92 | -------------------------------------------------------------------------------- /app/src/main/res/layout/activity_msg_likes.xml: -------------------------------------------------------------------------------- 1 | 2 | 9 | 10 | 11 | 16 | 17 | 22 | 23 | 30 | 31 | 32 | 33 | 41 | 42 | 43 | 44 | 48 | 49 | 50 | 51 | 52 | -------------------------------------------------------------------------------- /app/src/main/res/layout/activity_msg_collect.xml: -------------------------------------------------------------------------------- 1 | 2 | 9 | 10 | 11 | 16 | 17 | 22 | 23 | 30 | 31 | 32 | 33 | 41 | 42 | 43 | 44 | 48 | 49 | 50 | 51 | 52 | -------------------------------------------------------------------------------- /app/src/main/res/layout/activity_msg_comment.xml: -------------------------------------------------------------------------------- 1 | 2 | 9 | 10 | 11 | 16 | 17 | 22 | 23 | 30 | 31 | 32 | 33 | 41 | 42 | 43 | 44 | 48 | 49 | 50 | 51 | 52 | -------------------------------------------------------------------------------- /app/src/main/res/drawable-v24/ic_launcher_foreground.xml: -------------------------------------------------------------------------------- 1 | 7 | 12 | 13 | 19 | 22 | 25 | 26 | 27 | 28 | 34 | 35 | -------------------------------------------------------------------------------- /app/src/main/java/com/nuc/calvin/headline/bean/ArticleCustom.java: -------------------------------------------------------------------------------- 1 | package com.nuc.calvin.headline.bean; 2 | 3 | public class ArticleCustom extends Article { 4 | 5 | /** 6 | * 扩展user 7 | */ 8 | private User user; 9 | /** 10 | * 广告文章 11 | */ 12 | private ArticleCustom bannerArtcile; 13 | /** 14 | * 是否广告 1-是 0-否 15 | */ 16 | private int isAdvertorial; 17 | 18 | /** 19 | * 赞 0-否 1-是 20 | */ 21 | private int likes; 22 | /** 23 | * 收藏 0-否 1-是 24 | */ 25 | private int collect; 26 | /** 27 | * 被评论次数 28 | */ 29 | private int commentCount; 30 | /** 31 | * 被点赞数 32 | */ 33 | private int likeCount; 34 | 35 | public User getUser() { 36 | return user; 37 | } 38 | 39 | public void setUser(User user) { 40 | this.user = user; 41 | } 42 | 43 | public ArticleCustom getBannerArtcile() { 44 | return bannerArtcile; 45 | } 46 | 47 | public void setBannerArtcile(ArticleCustom bannerArtcile) { 48 | this.bannerArtcile = bannerArtcile; 49 | } 50 | 51 | public int getIsAdvertorial() { 52 | return isAdvertorial; 53 | } 54 | 55 | public void setIsAdvertorial(int isAdvertorial) { 56 | this.isAdvertorial = isAdvertorial; 57 | } 58 | 59 | public int getLikes() { 60 | return likes; 61 | } 62 | 63 | public void setLikes(int likes) { 64 | this.likes = likes; 65 | } 66 | 67 | public int getCollect() { 68 | return collect; 69 | } 70 | 71 | public void setCollect(int collect) { 72 | this.collect = collect; 73 | } 74 | 75 | public int getCommentCount() { 76 | return commentCount; 77 | } 78 | 79 | public void setCommentCount(int commentCount) { 80 | this.commentCount = commentCount; 81 | } 82 | 83 | public int getLikeCount() { 84 | return likeCount; 85 | } 86 | 87 | public void setLikeCount(int likeCount) { 88 | this.likeCount = likeCount; 89 | } 90 | } 91 | -------------------------------------------------------------------------------- /app/src/main/res/values/styles.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 10 | 11 | 15 | 16 | 19 | 20 | 32 | 40 | 41 | 48 | 49 | 50 | -------------------------------------------------------------------------------- /app/src/main/java/com/nuc/calvin/headline/bean/CommentCustom.java: -------------------------------------------------------------------------------- 1 | package com.nuc.calvin.headline.bean; 2 | 3 | import java.util.List; 4 | 5 | public class CommentCustom extends Comment { 6 | 7 | private User user; 8 | private Article article; 9 | 10 | /** 11 | * 被评论文章作者昵称 12 | */ 13 | private String username; 14 | /** 15 | * json评论时间 16 | */ 17 | private String time; 18 | /** 19 | * 评论回复数 20 | */ 21 | private int countReply; 22 | 23 | /** 24 | * 回复列表 25 | */ 26 | private List replyList; 27 | 28 | public User getUser() { 29 | return user; 30 | } 31 | 32 | public void setUser(User user) { 33 | this.user = user; 34 | } 35 | 36 | public String getUsername() { 37 | return username; 38 | } 39 | 40 | public void setUsername(String username) { 41 | this.username = username; 42 | } 43 | 44 | public String getTime() { 45 | return time; 46 | } 47 | 48 | public void setTime(String time) { 49 | this.time = time; 50 | } 51 | 52 | public int getCountReply() { 53 | return countReply; 54 | } 55 | 56 | public void setCountReply(int countReply) { 57 | this.countReply = countReply; 58 | } 59 | 60 | public List getReplyList() { 61 | return replyList; 62 | } 63 | 64 | public void setReplyList(List replyList) { 65 | this.replyList = replyList; 66 | } 67 | 68 | public Article getArticle() { 69 | return article; 70 | } 71 | 72 | public void setArticle(Article article) { 73 | this.article = article; 74 | } 75 | 76 | @Override 77 | public String toString() { 78 | return "CommentCustom{" + 79 | "user=" + user + 80 | ", article=" + article + 81 | ", username='" + username + '\'' + 82 | ", time='" + time + '\'' + 83 | ", countReply=" + countReply + 84 | ", replyList=" + replyList + 85 | '}'; 86 | } 87 | } 88 | -------------------------------------------------------------------------------- /app/src/main/res/menu/activity_main_drawer.xml: -------------------------------------------------------------------------------- 1 | 2 | 4 | 5 | 8 | 13 | 14 | 15 | 18 | 23 | 28 | 33 | 38 | 39 | 40 | 43 | 47 | 51 | 52 | 53 | -------------------------------------------------------------------------------- /app/src/main/java/com/nuc/calvin/headline/activity/ArticleDetailActivity.java: -------------------------------------------------------------------------------- 1 | package com.nuc.calvin.headline.activity; 2 | 3 | import android.content.Intent; 4 | import android.support.v7.app.AppCompatActivity; 5 | import android.os.Bundle; 6 | import android.view.View; 7 | import android.webkit.WebView; 8 | import android.webkit.WebViewClient; 9 | import android.widget.ImageView; 10 | import android.widget.TextView; 11 | 12 | import com.git.navmenu.NavMenuLayout; 13 | import com.nuc.calvin.headline.R; 14 | 15 | public class ArticleDetailActivity extends BaseActivity { 16 | 17 | private TextView detailTitle; 18 | private TextView author_name; 19 | private WebView webView; 20 | private ImageView iv_left; 21 | private ImageView iv_like; 22 | private ImageView iv_comment; 23 | private ImageView iv_collect; 24 | 25 | @Override 26 | protected void initView(Bundle savedInstanceState) { 27 | iv_left = findViewById(R.id.iv_detail_left); 28 | iv_like = findViewById(R.id.iv_detail_like); 29 | iv_comment = findViewById(R.id.iv_detail_comment); 30 | iv_collect = findViewById(R.id.iv_detail_collect); 31 | detailTitle = findViewById(R.id.detail_title); 32 | author_name = findViewById(R.id.name_author); 33 | webView = findViewById(R.id.web_view); 34 | webView.getSettings().setJavaScriptEnabled(true); 35 | webView.setWebViewClient(new WebViewClient()); 36 | Intent i = getIntent(); 37 | String title = i.getStringExtra("title"); 38 | String url = i.getStringExtra("url"); 39 | String authorname = i.getStringExtra("authorName"); 40 | detailTitle.setText(title); 41 | author_name.setText(authorname); 42 | webView.loadUrl(url); 43 | 44 | iv_left.setOnClickListener(new View.OnClickListener() { 45 | @Override 46 | public void onClick(View v) { 47 | Intent intent = new Intent(ArticleDetailActivity.this, MainActivity.class); 48 | intent.putExtra("id", 0); 49 | startActivity(intent); 50 | } 51 | }); 52 | } 53 | 54 | @Override 55 | protected int getContentView() { 56 | return R.layout.article_detail; 57 | } 58 | } 59 | -------------------------------------------------------------------------------- /app/src/main/java/com/nuc/calvin/headline/json/CollectJs.java: -------------------------------------------------------------------------------- 1 | package com.nuc.calvin.headline.json; 2 | 3 | import com.nuc.calvin.headline.bean.ArticleCustom; 4 | import com.nuc.calvin.headline.bean.User; 5 | import com.nuc.calvin.headline.bean.UserCustom; 6 | 7 | import java.util.Date; 8 | 9 | public class CollectJs { 10 | private Integer collectId; 11 | private Integer userId; 12 | private Date collectTime; 13 | private String date; 14 | private String username; 15 | private String userImg; 16 | 17 | private UserCustom user; 18 | private ArticleCustom article; 19 | private Integer articleId; 20 | 21 | public Integer getCollectId() { 22 | return collectId; 23 | } 24 | 25 | public void setCollectId(Integer collectId) { 26 | this.collectId = collectId; 27 | } 28 | 29 | public Integer getUserId() { 30 | return userId; 31 | } 32 | 33 | public void setUserId(Integer userId) { 34 | this.userId = userId; 35 | } 36 | 37 | public Date getCollectTime() { 38 | return collectTime; 39 | } 40 | 41 | public void setCollectTime(Date collectTime) { 42 | this.collectTime = collectTime; 43 | } 44 | 45 | public String getDate() { 46 | return date; 47 | } 48 | 49 | public void setDate(String date) { 50 | this.date = date; 51 | } 52 | 53 | public String getUsername() { 54 | return username; 55 | } 56 | 57 | public void setUsername(String username) { 58 | this.username = username; 59 | } 60 | 61 | public String getUserImg() { 62 | return userImg; 63 | } 64 | 65 | public void setUserImg(String userImg) { 66 | this.userImg = userImg; 67 | } 68 | 69 | public UserCustom getUser() { 70 | return user; 71 | } 72 | 73 | public void setUser(UserCustom user) { 74 | this.user = user; 75 | } 76 | 77 | public ArticleCustom getArticle() { 78 | return article; 79 | } 80 | 81 | public void setArticle(ArticleCustom article) { 82 | this.article = article; 83 | } 84 | 85 | public Integer getArticleId() { 86 | return articleId; 87 | } 88 | 89 | public void setArticleId(Integer articleId) { 90 | this.articleId = articleId; 91 | } 92 | } 93 | -------------------------------------------------------------------------------- /app/src/main/res/layout/msg_comment_item.xml: -------------------------------------------------------------------------------- 1 | 2 | 6 | 7 | 12 | 13 | 18 | 19 | 25 | 26 | 34 | 35 | 39 | 40 | 46 | 47 | 48 | 49 | 56 | 61 | 62 | 63 | 64 | 65 | 66 | -------------------------------------------------------------------------------- /gradlew.bat: -------------------------------------------------------------------------------- 1 | @if "%DEBUG%" == "" @echo off 2 | @rem ########################################################################## 3 | @rem 4 | @rem Gradle startup script for Windows 5 | @rem 6 | @rem ########################################################################## 7 | 8 | @rem Set local scope for the variables with windows NT shell 9 | if "%OS%"=="Windows_NT" setlocal 10 | 11 | set DIRNAME=%~dp0 12 | if "%DIRNAME%" == "" set DIRNAME=. 13 | set APP_BASE_NAME=%~n0 14 | set APP_HOME=%DIRNAME% 15 | 16 | @rem Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script. 17 | set DEFAULT_JVM_OPTS= 18 | 19 | @rem Find java.exe 20 | if defined JAVA_HOME goto findJavaFromJavaHome 21 | 22 | set JAVA_EXE=java.exe 23 | %JAVA_EXE% -version >NUL 2>&1 24 | if "%ERRORLEVEL%" == "0" goto init 25 | 26 | echo. 27 | echo ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH. 28 | echo. 29 | echo Please set the JAVA_HOME variable in your environment to match the 30 | echo location of your Java installation. 31 | 32 | goto fail 33 | 34 | :findJavaFromJavaHome 35 | set JAVA_HOME=%JAVA_HOME:"=% 36 | set JAVA_EXE=%JAVA_HOME%/bin/java.exe 37 | 38 | if exist "%JAVA_EXE%" goto init 39 | 40 | echo. 41 | echo ERROR: JAVA_HOME is set to an invalid directory: %JAVA_HOME% 42 | echo. 43 | echo Please set the JAVA_HOME variable in your environment to match the 44 | echo location of your Java installation. 45 | 46 | goto fail 47 | 48 | :init 49 | @rem Get command-line arguments, handling Windows variants 50 | 51 | if not "%OS%" == "Windows_NT" goto win9xME_args 52 | 53 | :win9xME_args 54 | @rem Slurp the command line arguments. 55 | set CMD_LINE_ARGS= 56 | set _SKIP=2 57 | 58 | :win9xME_args_slurp 59 | if "x%~1" == "x" goto execute 60 | 61 | set CMD_LINE_ARGS=%* 62 | 63 | :execute 64 | @rem Setup the command line 65 | 66 | set CLASSPATH=%APP_HOME%\gradle\wrapper\gradle-wrapper.jar 67 | 68 | @rem Execute Gradle 69 | "%JAVA_EXE%" %DEFAULT_JVM_OPTS% %JAVA_OPTS% %GRADLE_OPTS% "-Dorg.gradle.appname=%APP_BASE_NAME%" -classpath "%CLASSPATH%" org.gradle.wrapper.GradleWrapperMain %CMD_LINE_ARGS% 70 | 71 | :end 72 | @rem End local scope for the variables with windows NT shell 73 | if "%ERRORLEVEL%"=="0" goto mainEnd 74 | 75 | :fail 76 | rem Set variable GRADLE_EXIT_CONSOLE if you need the _script_ return code instead of 77 | rem the _cmd.exe /c_ return code! 78 | if not "" == "%GRADLE_EXIT_CONSOLE%" exit 1 79 | exit /b 1 80 | 81 | :mainEnd 82 | if "%OS%"=="Windows_NT" endlocal 83 | 84 | :omega 85 | -------------------------------------------------------------------------------- /app/src/main/res/layout/comment_list_item.xml: -------------------------------------------------------------------------------- 1 | 2 | 7 | 11 | 12 | 16 | 17 | 18 | 23 | 24 | 30 | 31 | 37 | 38 | 39 | 48 | 49 | 53 | 54 | 61 | 62 | 63 | -------------------------------------------------------------------------------- /app/build.gradle: -------------------------------------------------------------------------------- 1 | apply plugin: 'com.android.application' 2 | android { 3 | compileSdkVersion 28 4 | defaultConfig { 5 | applicationId "com.nuc.calvin.headline" 6 | minSdkVersion 21 7 | targetSdkVersion 28 8 | versionCode 1 9 | versionName "1.0" 10 | testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner" 11 | javaCompileOptions { annotationProcessorOptions { includeCompileClasspath = true } } 12 | } 13 | buildTypes { 14 | release { 15 | minifyEnabled false 16 | proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-rules.pro' 17 | } 18 | } 19 | } 20 | //1,增加这个东西 21 | allprojects { 22 | repositories { 23 | maven { url "https://jitpack.io" } 24 | maven { url "https://maven.google.com" } 25 | flatDir { 26 | dirs 'libs' 27 | } 28 | } 29 | } 30 | 31 | dependencies { 32 | implementation fileTree(dir: 'libs', include: ['*.jar']) 33 | implementation 'com.android.support:appcompat-v7:28.0.0' 34 | implementation 'com.android.support:support-v4:28.0.0' 35 | implementation 'com.android.support:design:28.0.0' 36 | implementation 'com.android.support.constraint:constraint-layout:1.1.3' 37 | implementation 'com.github.iwgang:familiarrecyclerview:1.3.4' 38 | //轮播图 39 | implementation "com.bigkoo:convenientbanner:2.0.5" 40 | //loginDemo:Robin 41 | implementation 'com.sirvar:robin:0.0.1' 42 | testImplementation 'junit:junit:4.12' 43 | androidTestImplementation 'com.android.support.test:runner:1.0.2' 44 | androidTestImplementation 'com.android.support.test.espresso:espresso-core:3.0.2' 45 | //fresco图片加载 46 | implementation 'com.facebook.fresco:fresco:0.14.1' 47 | //5,图片缓存库 48 | implementation 'com.nostra13.universalimageloader:universal-image-loader:1.9.4' 49 | 50 | implementation 'com.baoyz.pullrefreshlayout:library:1.2.0' 51 | implementation 'com.jakewharton:butterknife:7.0.1' 52 | //glide图片库 53 | implementation 'com.github.bumptech.glide:glide:3.7.0' 54 | implementation 'jp.wasabeef:glide-transformations:2.0.1' 55 | //底部导航栏消息红点 56 | implementation 'com.github.smashinggit:Android-NavMenuLayout:v1.0.0' 57 | //精选界面+号按钮 58 | implementation 'com.melnykov:floatingactionbutton:1.3.0' 59 | implementation 'com.squareup.okhttp3:okhttp:3.10.0' 60 | implementation 'com.google.code.gson:gson:2.8.4' 61 | implementation 'com.wx.goodview:goodview:1.0.0' 62 | 63 | implementation 'com.yanzhenjie.recyclerview:support:1.3.2' 64 | } 65 | -------------------------------------------------------------------------------- /app/src/main/res/values/colors.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | #ff27b5ee 4 | #ff159cd1 5 | #ff0288d1 6 | #8f27b5ee 7 | #1296db 8 | #FF0000 9 | #FF6666 10 | #000000 11 | #555555 12 | #808080 13 | #aaaaaa 14 | #f4f4f4 15 | #d3d3d3 16 | #ff0000 17 | #ffffff 18 | #f2f2f2 19 | #ffeef1f3 20 | #f24949 21 | #e8e8e8 22 | 23 | #fcfcfc 24 | #050505 25 | #e8e8e8 26 | 27 | 28 | #aae1f9 29 | #9e9e9e 30 | #323232 31 | #8a8a8a 32 | #7e7e7e 33 | #e9e9e9 34 | 35 | 36 | #f4f4f4 37 | #aaaaaa 38 | #848484 39 | #ededed 40 | #fa9a01 41 | #a4a4a4 42 | #767676 43 | 44 | 45 | #27b5ee 46 | #ffffff 47 | 48 | 49 | #d4f0fc 50 | #a6d1e2 51 | #f4f4f4 52 | #dddddd 53 | #212121 54 | #757575 55 | #00d4d4d4 56 | #f62e00 57 | #279bee 58 | 59 | -------------------------------------------------------------------------------- /app/src/main/res/layout/activity_commment.xml: -------------------------------------------------------------------------------- 1 | 2 | 6 | 7 | 8 | 13 | 14 | 19 | 20 | 27 | 28 | 39 | 40 | 41 | 42 | 43 | 47 | 48 | 49 | 56 | 63 | 64 | 65 | 66 | -------------------------------------------------------------------------------- /app/src/main/java/com/nuc/calvin/headline/fragment/HomeMessageFragment.java: -------------------------------------------------------------------------------- 1 | package com.nuc.calvin.headline.fragment; 2 | 3 | 4 | import android.content.Intent; 5 | import android.os.Handler; 6 | import android.view.View; 7 | import android.widget.ImageView; 8 | import android.widget.LinearLayout; 9 | 10 | import com.baoyz.widget.PullRefreshLayout; 11 | import com.nuc.calvin.headline.R; 12 | import com.nuc.calvin.headline.activity.MsgCollectActivity; 13 | import com.nuc.calvin.headline.activity.MsgCommentActivity; 14 | import com.nuc.calvin.headline.activity.MsgLikesActivity; 15 | 16 | 17 | public class HomeMessageFragment extends BaseFragment { 18 | 19 | 20 | private PullRefreshLayout layout; 21 | 22 | 23 | private LinearLayout commentLayout; 24 | private LinearLayout collectLayout; 25 | private LinearLayout likeLayout; 26 | 27 | @Override 28 | 29 | protected void initView(View view) { 30 | init(view); 31 | layout.setOnRefreshListener(new PullRefreshLayout.OnRefreshListener() { 32 | @Override 33 | public void onRefresh() { 34 | new Handler().postDelayed(new Runnable() { 35 | @Override 36 | public void run() { 37 | layout.setRefreshing(false); 38 | } 39 | }, 2000); 40 | } 41 | }); 42 | 43 | commentLayout.setOnClickListener(new View.OnClickListener() { 44 | @Override 45 | public void onClick(View v) { 46 | Intent intent = new Intent(getContext(), MsgCommentActivity.class); 47 | startActivity(intent); 48 | } 49 | }); 50 | 51 | 52 | collectLayout.setOnClickListener(new View.OnClickListener() { 53 | @Override 54 | public void onClick(View v) { 55 | Intent intent = new Intent(getContext(), MsgCollectActivity.class); 56 | startActivity(intent); 57 | } 58 | }); 59 | 60 | 61 | likeLayout.setOnClickListener(new View.OnClickListener() { 62 | @Override 63 | public void onClick(View v) { 64 | Intent intent = new Intent(getContext(), MsgLikesActivity.class); 65 | startActivity(intent); 66 | } 67 | }); 68 | 69 | } 70 | 71 | 72 | @Override 73 | protected int getContentView() { 74 | return R.layout.fragment_message; 75 | } 76 | 77 | 78 | private void init(View view) { 79 | commentLayout = view.findViewById(R.id.msg_comment_layout); 80 | collectLayout = view.findViewById(R.id.msg_collect_layout); 81 | likeLayout = view.findViewById(R.id.msg_like_layout); 82 | layout = view.findViewById(R.id.msg_refreshLayout); 83 | } 84 | 85 | 86 | } 87 | -------------------------------------------------------------------------------- /app/src/main/java/com/nuc/calvin/headline/adapter/MsgCommentAdapter.java: -------------------------------------------------------------------------------- 1 | package com.nuc.calvin.headline.adapter; 2 | 3 | import android.content.Context; 4 | import android.support.annotation.NonNull; 5 | import android.support.v7.widget.RecyclerView; 6 | import android.view.LayoutInflater; 7 | import android.view.View; 8 | import android.view.ViewGroup; 9 | import android.widget.TextView; 10 | 11 | import com.facebook.drawee.view.SimpleDraweeView; 12 | import com.nuc.calvin.headline.R; 13 | import com.nuc.calvin.headline.json.CommentJs; 14 | 15 | import java.util.ArrayList; 16 | import java.util.List; 17 | 18 | public class MsgCommentAdapter extends RecyclerView.Adapter { 19 | 20 | Context context; 21 | private List commentJsList = new ArrayList<>(); 22 | 23 | public MsgCommentAdapter(Context context, List commentJsList) { 24 | this.context = context; 25 | this.commentJsList = commentJsList; 26 | } 27 | 28 | @NonNull 29 | @Override 30 | public CommentHolder onCreateViewHolder(@NonNull ViewGroup viewGroup, int i) { 31 | 32 | View view = LayoutInflater.from(context).inflate(R.layout.msg_comment_item, viewGroup, false); 33 | return new CommentHolder(view); 34 | } 35 | 36 | @Override 37 | public void onBindViewHolder(@NonNull CommentHolder commentHolder, int i) { 38 | CommentJs commentJs = commentJsList.get(i); 39 | commentHolder.bindData(commentJs); 40 | } 41 | 42 | @Override 43 | public int getItemCount() { 44 | return commentJsList == null ? 0 : commentJsList.size(); 45 | } 46 | 47 | public class CommentHolder extends RecyclerView.ViewHolder { 48 | 49 | SimpleDraweeView commentor_head; 50 | TextView commentorName; 51 | TextView commentTime; 52 | TextView content; 53 | TextView comment_title; 54 | 55 | public CommentHolder(@NonNull View itemView) { 56 | super(itemView); 57 | 58 | commentor_head = itemView.findViewById(R.id.commentor_img); 59 | commentorName = itemView.findViewById(R.id.commentor_name); 60 | commentTime = itemView.findViewById(R.id.msg_comment_time); 61 | content = itemView.findViewById(R.id.msg_comment_content); 62 | comment_title = itemView.findViewById(R.id.msg_article_title); 63 | } 64 | 65 | private void bindData(CommentJs commentJs) { 66 | commentor_head.setImageURI(commentJs.getUser().getHeadImg()); 67 | commentorName.setText(commentJs.getUser().getUsername()); 68 | commentTime.setText(commentJs.getTime()); 69 | content.setText(commentJs.getCommentContent()); 70 | comment_title.setText(commentJs.getArticle().getArticleTitle()); 71 | } 72 | } 73 | } 74 | -------------------------------------------------------------------------------- /app/src/main/java/com/nuc/calvin/headline/adapter/MyFollowAdapter.java: -------------------------------------------------------------------------------- 1 | package com.nuc.calvin.headline.adapter; 2 | 3 | import android.content.Context; 4 | import android.support.annotation.NonNull; 5 | import android.support.v7.widget.RecyclerView; 6 | import android.view.LayoutInflater; 7 | import android.view.View; 8 | import android.view.ViewGroup; 9 | import android.widget.ImageView; 10 | import android.widget.TextView; 11 | 12 | import com.facebook.drawee.view.SimpleDraweeView; 13 | import com.nuc.calvin.headline.R; 14 | import com.nuc.calvin.headline.bean.UserCustom; 15 | import com.nuc.calvin.headline.json.UserJs; 16 | 17 | import java.util.List; 18 | 19 | public class MyFollowAdapter extends RecyclerView.Adapter { 20 | 21 | Context context; 22 | private List userCustomList; 23 | 24 | public MyFollowAdapter(Context context, List userCustomList) { 25 | this.context = context; 26 | this.userCustomList = userCustomList; 27 | } 28 | 29 | @NonNull 30 | @Override 31 | public FollowHolder onCreateViewHolder(@NonNull ViewGroup viewGroup, int i) { 32 | 33 | View view = LayoutInflater.from(context).inflate(R.layout.my_follow_list, viewGroup, false); 34 | return new FollowHolder(view); 35 | } 36 | 37 | @Override 38 | public void onBindViewHolder(@NonNull FollowHolder followHolder, int i) { 39 | UserJs userJs = userCustomList.get(i); 40 | followHolder.bindUser(userJs); 41 | } 42 | 43 | @Override 44 | public int getItemCount() { 45 | return userCustomList == null ? 0 : userCustomList.size(); 46 | } 47 | 48 | public class FollowHolder extends RecyclerView.ViewHolder { 49 | 50 | SimpleDraweeView user_head; 51 | TextView account_name; 52 | TextView signature; 53 | TextView share_count; 54 | TextView readme_count; 55 | ImageView subscriber; 56 | 57 | public FollowHolder(@NonNull View itemView) { 58 | super(itemView); 59 | user_head = itemView.findViewById(R.id.user_head); 60 | account_name = itemView.findViewById(R.id.account_name); 61 | signature = itemView.findViewById(R.id.signature); 62 | share_count = itemView.findViewById(R.id.share_count); 63 | readme_count = itemView.findViewById(R.id.readme_count); 64 | subscriber = itemView.findViewById(R.id.iv_subscriber); 65 | } 66 | 67 | public void bindUser(UserJs user) { 68 | user_head.setImageURI(user.getHeadImg()); 69 | account_name.setText(user.getUsername()); 70 | signature.setText(user.getSignature()); 71 | share_count.setText(String.valueOf(user.getArticleCount())); 72 | readme_count.setText(String.valueOf(user.getFansCount())); 73 | } 74 | } 75 | } 76 | -------------------------------------------------------------------------------- /app/src/main/java/com/nuc/calvin/headline/adapter/CommentAdapter.java: -------------------------------------------------------------------------------- 1 | package com.nuc.calvin.headline.adapter; 2 | 3 | import android.content.Context; 4 | import android.support.annotation.NonNull; 5 | import android.support.v7.widget.RecyclerView; 6 | import android.view.LayoutInflater; 7 | import android.view.View; 8 | import android.view.ViewGroup; 9 | import android.widget.TextView; 10 | 11 | import com.facebook.drawee.view.SimpleDraweeView; 12 | import com.nuc.calvin.headline.R; 13 | import com.nuc.calvin.headline.bean.Comment; 14 | import com.nuc.calvin.headline.bean.CommentCustom; 15 | import com.nuc.calvin.headline.bean.User; 16 | import com.nuc.calvin.headline.bean.UserCustom; 17 | import com.nuc.calvin.headline.json.CommentJs; 18 | 19 | import java.util.ArrayList; 20 | import java.util.List; 21 | 22 | public class CommentAdapter extends RecyclerView.Adapter { 23 | 24 | Context context; 25 | private List list=new ArrayList<>(); 26 | 27 | public CommentAdapter(Context context) { 28 | this.context = context; 29 | } 30 | 31 | public void addData(List commentJsList) { 32 | list.addAll(commentJsList); 33 | } 34 | 35 | @NonNull 36 | @Override 37 | public CommentAdapter.CommentHolder onCreateViewHolder(@NonNull ViewGroup viewGroup, int i) { 38 | View view = LayoutInflater.from(context).inflate(R.layout.comment_list_item, viewGroup, false); 39 | CommentHolder commentHolder = new CommentHolder(view); 40 | return commentHolder; 41 | } 42 | 43 | @Override 44 | public void onBindViewHolder(@NonNull CommentAdapter.CommentHolder commentHolder, int i) { 45 | CommentJs commentCustom = list.get(i); 46 | commentHolder.bindData(commentCustom); 47 | 48 | } 49 | 50 | @Override 51 | public int getItemCount() { 52 | return list == null ? 0 : list.size(); 53 | } 54 | 55 | public class CommentHolder extends RecyclerView.ViewHolder { 56 | SimpleDraweeView commentor_head; 57 | TextView commentorName; 58 | TextView commentContent; 59 | TextView time; 60 | 61 | 62 | public CommentHolder(@NonNull View itemView) { 63 | super(itemView); 64 | commentor_head = itemView.findViewById(R.id.comment_head); 65 | commentorName = itemView.findViewById(R.id.comment_name); 66 | commentContent = itemView.findViewById(R.id.commentContents); 67 | time = itemView.findViewById(R.id.comment_time); 68 | } 69 | 70 | private void bindData(CommentJs comment) { 71 | User user = comment.getUser(); 72 | commentor_head.setImageURI(user.getHeadImg()); 73 | commentorName.setText(user.getUsername()); 74 | commentContent.setText(comment.getCommentContent()); 75 | time.setText(comment.getTime()); 76 | 77 | 78 | } 79 | } 80 | } 81 | -------------------------------------------------------------------------------- /app/src/main/java/com/nuc/calvin/headline/adapter/FindUserAdapter.java: -------------------------------------------------------------------------------- 1 | package com.nuc.calvin.headline.adapter; 2 | 3 | import android.content.Context; 4 | import android.support.annotation.NonNull; 5 | import android.support.v7.widget.RecyclerView; 6 | import android.view.LayoutInflater; 7 | import android.view.View; 8 | import android.view.ViewGroup; 9 | import android.widget.ImageView; 10 | import android.widget.TextView; 11 | 12 | import com.facebook.drawee.view.SimpleDraweeView; 13 | import com.nuc.calvin.headline.R; 14 | import com.nuc.calvin.headline.bean.UserCustom; 15 | 16 | import java.util.ArrayList; 17 | import java.util.List; 18 | 19 | public class FindUserAdapter extends RecyclerView.Adapter{ 20 | 21 | Context context; 22 | private List userList = new ArrayList<>(); 23 | 24 | public FindUserAdapter(Context context, List userList) { 25 | this.context = context; 26 | this.userList = userList; 27 | } 28 | 29 | @NonNull 30 | @Override 31 | public UserHolder onCreateViewHolder(@NonNull ViewGroup viewGroup, int i) { 32 | View view = LayoutInflater.from(context).inflate(R.layout.hot_user_item, viewGroup, false); 33 | UserHolder userHolder = new UserHolder(view); 34 | return userHolder; 35 | } 36 | 37 | @Override 38 | public void onBindViewHolder(@NonNull UserHolder userHolder, int i) { 39 | UserCustom userCustom = userList.get(i); 40 | userHolder.bindData(userCustom); 41 | 42 | } 43 | 44 | @Override 45 | public int getItemCount() { 46 | return userList == null ? 0 : userList.size(); 47 | } 48 | 49 | public class UserHolder extends RecyclerView.ViewHolder { 50 | SimpleDraweeView userImg; 51 | TextView userName; 52 | TextView user_signature; 53 | TextView user_share_count; 54 | TextView followCount; 55 | ImageView iv_collect; 56 | 57 | public UserHolder(@NonNull View itemView) { 58 | super(itemView); 59 | userImg = itemView.findViewById(R.id.user_head); 60 | userName = itemView.findViewById(R.id.account_name); 61 | user_signature = itemView.findViewById(R.id.signature); 62 | user_share_count = itemView.findViewById(R.id.share_count); 63 | followCount = itemView.findViewById(R.id.readme_count); 64 | iv_collect = itemView.findViewById(R.id.iv_subscriber); 65 | } 66 | 67 | private void bindData(UserCustom userCustom) { 68 | userImg.setImageURI(userCustom.getHeadImg()); 69 | userName.setText(userCustom.getUsername()); 70 | user_signature.setText(userCustom.getSignature()); 71 | user_share_count.setText(String.valueOf(userCustom.getArticleCount())); 72 | followCount.setText(String.valueOf(userCustom.getFollowCount())); 73 | 74 | } 75 | } 76 | 77 | 78 | } 79 | -------------------------------------------------------------------------------- /app/src/main/res/layout/activity_search.xml: -------------------------------------------------------------------------------- 1 | 7 | 12 | 21 | 22 | 27 | 28 | 37 | 38 | 45 | 46 | 57 | 58 | 59 | 64 | 65 | 66 | 71 | -------------------------------------------------------------------------------- /app/src/main/java/com/nuc/calvin/headline/adapter/MyArticleAdapter.java: -------------------------------------------------------------------------------- 1 | package com.nuc.calvin.headline.adapter; 2 | 3 | import android.content.Context; 4 | import android.support.annotation.NonNull; 5 | import android.support.v7.widget.RecyclerView; 6 | import android.util.Log; 7 | import android.view.LayoutInflater; 8 | import android.view.View; 9 | import android.view.ViewGroup; 10 | 11 | import android.widget.TextView; 12 | import android.widget.Toast; 13 | 14 | import com.nuc.calvin.headline.R; 15 | import com.nuc.calvin.headline.json.ArticleJs; 16 | 17 | 18 | import java.util.ArrayList; 19 | import java.util.List; 20 | 21 | import static android.support.constraint.Constraints.TAG; 22 | 23 | public class MyArticleAdapter extends RecyclerView.Adapter { 24 | 25 | private Context context; 26 | private List articleJsList = new ArrayList<>(); 27 | private LayoutInflater layoutInflater; 28 | 29 | public MyArticleAdapter(Context context) { 30 | this.context = context; 31 | layoutInflater = LayoutInflater.from(context); 32 | } 33 | 34 | public void setList(List list) { 35 | articleJsList.clear(); 36 | articleJsList.addAll(list); 37 | } 38 | 39 | @NonNull 40 | @Override 41 | public MyArticleAdapter.MyHolder onCreateViewHolder(@NonNull ViewGroup viewGroup, int i) { 42 | View view = layoutInflater.inflate(R.layout.my_article_item, viewGroup, false); 43 | return new MyHolder(view); 44 | } 45 | 46 | @Override 47 | public void onBindViewHolder(@NonNull MyArticleAdapter.MyHolder myHolder, final int i) { 48 | ArticleJs articleJs = articleJsList.get(i); 49 | Log.d(TAG, "onBindViewHolder: " + articleJs.toString()); 50 | myHolder.likeCount.setText(String.valueOf(articleJs.getLikeCount())); 51 | myHolder.collectCount.setText(String.valueOf(articleJs.getCollectCount())); 52 | myHolder.commentCount.setText(String.valueOf(articleJs.getCommentCount())); 53 | myHolder.myName.setText(articleJs.getUser().getUsername()); 54 | myHolder.myTitle.setText(articleJs.getArticleTitle()); 55 | } 56 | 57 | @Override 58 | public int getItemCount() { 59 | return articleJsList == null ? 0 : articleJsList.size(); 60 | } 61 | 62 | 63 | class MyHolder extends RecyclerView.ViewHolder { 64 | 65 | TextView likeCount; 66 | TextView collectCount; 67 | TextView commentCount; 68 | TextView myName; 69 | TextView myTitle; 70 | 71 | 72 | public MyHolder(@NonNull View itemView) { 73 | super(itemView); 74 | myTitle = itemView.findViewById(R.id.my_article_title); 75 | myName = itemView.findViewById(R.id.my_name); 76 | likeCount = itemView.findViewById(R.id.my_article_like_count); 77 | collectCount = itemView.findViewById(R.id.my_article_collect_count); 78 | commentCount = itemView.findViewById(R.id.my_article_comment_count); 79 | } 80 | } 81 | } 82 | -------------------------------------------------------------------------------- /app/src/main/res/drawable/ic_hot_article.xml: -------------------------------------------------------------------------------- 1 | 3 | 4 | 5 | 6 | -------------------------------------------------------------------------------- /app/src/main/java/com/nuc/calvin/headline/utils/SerializableUtil.java: -------------------------------------------------------------------------------- 1 | package com.nuc.calvin.headline.utils; 2 | 3 | import android.util.Base64; 4 | 5 | import java.io.ByteArrayInputStream; 6 | import java.io.ByteArrayOutputStream; 7 | import java.io.IOException; 8 | import java.io.ObjectInputStream; 9 | import java.io.ObjectOutputStream; 10 | import java.io.StreamCorruptedException; 11 | import java.util.List; 12 | 13 | public class SerializableUtil { 14 | 15 | public static String list2String(List list) throws IOException { 16 | //实例化一个ByteArrayOutputStream对象,用来装载压缩后的字节文件 17 | ByteArrayOutputStream baos = new ByteArrayOutputStream(); 18 | //然后将得到的字符数据装载到ObjectOutputStream 19 | ObjectOutputStream oos = new ObjectOutputStream(baos); 20 | //writeObject 方法负责写入特定类的对象的状态,以便相应的readObject可以还原它 21 | oos.writeObject(list); 22 | //最后,用Base64.encode将字节文件转换成Base64编码,并以String形式保存 23 | String listString = new String(Base64.encode(baos.toByteArray(),Base64.DEFAULT)); 24 | //关闭oos 25 | oos.close(); 26 | return listString; 27 | } 28 | 29 | public static String obj2Str(Object obj)throws IOException 30 | { 31 | if(obj == null) { 32 | return ""; 33 | } 34 | //实例化一个ByteArrayOutputStream对象,用来装载压缩后的字节文件 35 | ByteArrayOutputStream baos = new ByteArrayOutputStream(); 36 | //然后将得到的字符数据装载到ObjectOutputStream 37 | ObjectOutputStream oos = new ObjectOutputStream(baos); 38 | //writeObject 方法负责写入特定类的对象的状态,以便相应的readObject可以还原它 39 | oos.writeObject(obj); 40 | //最后,用Base64.encode将字节文件转换成Base64编码,并以String形式保存 41 | String listString = new String(Base64.encode(baos.toByteArray(),Base64.DEFAULT)); 42 | //关闭oos 43 | oos.close(); 44 | return listString; 45 | } 46 | 47 | 48 | //将序列化的数据还原成Object 49 | public static Object str2Obj(String str) throws StreamCorruptedException,IOException{ 50 | byte[] mByte = Base64.decode(str.getBytes(),Base64.DEFAULT); 51 | ByteArrayInputStream bais = new ByteArrayInputStream(mByte); 52 | ObjectInputStream ois = new ObjectInputStream(bais); 53 | 54 | try { 55 | return ois.readObject(); 56 | } catch (ClassNotFoundException e) { 57 | // TODO Auto-generated catch block 58 | e.printStackTrace(); 59 | } 60 | return null; 61 | 62 | } 63 | public static List string2List(String str) throws StreamCorruptedException,IOException{ 64 | byte[] mByte = Base64.decode(str.getBytes(),Base64.DEFAULT); 65 | ByteArrayInputStream bais = new ByteArrayInputStream(mByte); 66 | ObjectInputStream ois = new ObjectInputStream(bais); 67 | List stringList = null; 68 | try { 69 | stringList = (List) ois.readObject(); 70 | } catch (ClassNotFoundException e) { 71 | // TODO Auto-generated catch block 72 | e.printStackTrace(); 73 | } 74 | return stringList; 75 | } 76 | 77 | 78 | } 79 | -------------------------------------------------------------------------------- /app/src/main/AndroidManifest.xml: -------------------------------------------------------------------------------- 1 | 2 | 5 | 6 | 7 | 8 | 9 | 16 | 18 | 21 | 24 | 27 | 30 | 33 | 36 | 39 | 42 | 45 | 46 | 49 | 53 | 57 | 58 | 59 | 60 | 61 | 62 | 63 | 64 | 65 | 66 | -------------------------------------------------------------------------------- /app/src/main/java/com/nuc/calvin/headline/utils/ShareUtils.java: -------------------------------------------------------------------------------- 1 | package com.nuc.calvin.headline.utils; 2 | 3 | import android.annotation.SuppressLint; 4 | import android.content.Context; 5 | import android.content.SharedPreferences; 6 | 7 | import com.nuc.calvin.headline.bean.UserCustom; 8 | import com.nuc.calvin.headline.json.LoginJs; 9 | 10 | import java.io.IOException; 11 | import java.io.StreamCorruptedException; 12 | 13 | public class ShareUtils { 14 | 15 | // 用户名key 16 | public final static String KEY_NAME = "KEY_NAME"; 17 | 18 | public final static String KEY_LEVEL = "KEY_LEVEL"; 19 | 20 | private static ShareUtils shareUtils; 21 | 22 | private static UserCustom login_user = null; 23 | 24 | private SharedPreferences msp; 25 | 26 | @SuppressLint("WrongConstant") 27 | public ShareUtils(Context context) { 28 | msp = context.getSharedPreferences("ShareUtils", Context.MODE_PRIVATE | Context.MODE_APPEND); 29 | } 30 | 31 | // 初始化,一般在应用启动之后就要初始化 32 | public static synchronized void initSharedPreference(Context context) { 33 | if (shareUtils == null) { 34 | shareUtils = new ShareUtils(context); 35 | } 36 | } 37 | 38 | 39 | /** 40 | * 获取唯一的instance 41 | * 42 | * @return 43 | */ 44 | public static synchronized ShareUtils getInstance() { 45 | return shareUtils; 46 | } 47 | 48 | public SharedPreferences getSharedPref() { 49 | return msp; 50 | } 51 | 52 | public synchronized void putUser(UserCustom user) { 53 | 54 | SharedPreferences.Editor editor = msp.edit(); 55 | 56 | String str = ""; 57 | try { 58 | str = SerializableUtil.obj2Str(user); 59 | } catch (IOException e) { 60 | e.printStackTrace(); 61 | } 62 | editor.putString(KEY_NAME, str); 63 | editor.commit(); 64 | 65 | login_user = user; 66 | } 67 | 68 | 69 | public synchronized UserCustom getUser() { 70 | 71 | if (login_user == null) { 72 | login_user = new UserCustom(); 73 | 74 | 75 | //获取序列化的数据 76 | String str = msp.getString(ShareUtils.KEY_NAME, ""); 77 | 78 | try { 79 | Object obj = SerializableUtil.str2Obj(str); 80 | if (obj != null) { 81 | login_user = (UserCustom) obj; 82 | } 83 | 84 | } catch (StreamCorruptedException e) { 85 | // TODO Auto-generated catch block 86 | e.printStackTrace(); 87 | } catch (IOException e) { 88 | // TODO Auto-generated catch block 89 | e.printStackTrace(); 90 | } 91 | } 92 | 93 | return login_user; 94 | } 95 | 96 | 97 | public synchronized void DeleteUser() 98 | { 99 | SharedPreferences.Editor editor = msp.edit(); 100 | editor.putString(KEY_NAME,""); 101 | 102 | editor.commit(); 103 | login_user = null; 104 | } 105 | } 106 | -------------------------------------------------------------------------------- /app/src/main/java/com/nuc/calvin/headline/utils/StaticClass.java: -------------------------------------------------------------------------------- 1 | package com.nuc.calvin.headline.utils; 2 | 3 | import com.nuc.calvin.headline.adapter.FindArticleAdapter; 4 | import com.nuc.calvin.headline.adapter.FindUserAdapter; 5 | import com.nuc.calvin.headline.bean.UserCustom; 6 | import com.nuc.calvin.headline.json.ArticleJs; 7 | 8 | import java.util.ArrayList; 9 | import java.util.List; 10 | 11 | public class StaticClass { 12 | 13 | private static String ip = "10.0.116.108"; 14 | 15 | 16 | //登录url 17 | public static String loginUrl = "http://" + ip + ":8080/headline/user/loginUser"; 18 | 19 | //注册url 20 | public static String registerUrl = "http://" + ip + ":8080/headline/user/userRegister"; 21 | 22 | //文章url 23 | public static String articleUrl = "http://" + ip + ":8080/headline/article/getAllArticle"; 24 | 25 | //发布文章 26 | public static String shareUrl = "http://" + ip + ":8080/headline/article/postArticle"; 27 | 28 | //点赞 29 | public static String likeUrl = "http://" + ip + ":8080/headline/likes/like"; 30 | 31 | 32 | //发布评论 33 | public static String commentUrl = "http://" + ip + ":8080/headline/comment/commentArticle"; 34 | 35 | //收藏 36 | public static String collectUrl = "http://" + ip + ":8080/headline/collection/collect"; 37 | 38 | //查询我的文章 39 | public static String myArticleUrl = "http://" + ip + ":8080/headline/article/getMyArticle"; 40 | //删除文章 41 | public static String deleteArticleUrl = "http://" + ip + ":8080/headline/article/deleteArticle"; 42 | 43 | public static String hotArticleUrl = "http://" + ip + ":8080/headline/article/queryHotArticle"; 44 | 45 | public static String hotUserUrl = "http://" + ip + ":8080/headline/user/queryUserExSelf"; 46 | 47 | public static String queryArticleByWordUrl = "http://" + ip + ":8080/headline/article/queryArticleByWord"; 48 | 49 | public static String queryUserByWordUrl = "http://" + ip + ":8080/headline/user/queryUserByWord"; 50 | 51 | public static String queryComment = "http://" + ip + ":8080/headline/comment/commentList"; 52 | 53 | 54 | public static String unFollowUrl = "http://" + ip + ":8080/headline/relation/unFollow"; 55 | public static String followUrl = "http://" + ip + ":8080/headline/relation/follow"; 56 | //取消收藏 57 | public static String unCollectUrl = "http://" + ip + ":8080/headline/collection/unCollect"; 58 | 59 | //收藏列表 60 | public static String collectListUrl = "http://" + ip + ":8080/headline/collection/queryAllCollection"; 61 | 62 | public static String bannerUrl = "http://" + ip + ":8080/headline/banner/queryAllBanner"; 63 | 64 | public static String msgCommentUrl = "http://" + ip + ":8080/headline/comment/queryCommentByUserId"; 65 | 66 | public static String followListUrl = "http://" + ip + ":8080/headline/relation/listFollow"; 67 | 68 | 69 | public static int code; 70 | public static List articleJsList; 71 | public static List userList; 72 | 73 | 74 | public static FindUserAdapter findUserAdapter; 75 | public static FindArticleAdapter findArticleAdapter; 76 | 77 | } 78 | -------------------------------------------------------------------------------- /app/src/main/java/com/nuc/calvin/headline/fragment/BaseFragment.java: -------------------------------------------------------------------------------- 1 | package com.nuc.calvin.headline.fragment; 2 | 3 | import android.content.Context; 4 | import android.net.Uri; 5 | import android.os.Bundle; 6 | import android.os.Handler; 7 | import android.support.annotation.NonNull; 8 | import android.support.annotation.Nullable; 9 | import android.support.v4.app.Fragment; 10 | import android.support.v4.app.FragmentActivity; 11 | import android.view.LayoutInflater; 12 | import android.view.View; 13 | import android.view.ViewGroup; 14 | import android.widget.TextView; 15 | 16 | import com.facebook.drawee.backends.pipeline.Fresco; 17 | 18 | import butterknife.ButterKnife; 19 | 20 | 21 | public abstract class BaseFragment extends Fragment { 22 | private FragmentActivity fragmentActivity; 23 | 24 | public View getMyView() { 25 | return myView; 26 | } 27 | 28 | public View myView; 29 | //可用来Fragment与Activity之间传送数据 30 | protected OnFragmentInteractionListener mListener; 31 | protected Handler handler; 32 | 33 | 34 | public BaseFragment() { 35 | // Required empty public constructor 36 | } 37 | 38 | @Override 39 | public View onCreateView(LayoutInflater inflater, ViewGroup container, 40 | Bundle savedInstanceState) { 41 | myView = inflater.inflate(getContentView(), container, false); 42 | ButterKnife.bind(this, myView); 43 | fragmentActivity = getSupportActivity(); 44 | Fresco.initialize(getContext()); 45 | initView(myView); 46 | return myView; 47 | } 48 | 49 | @Override 50 | public void onViewCreated(@NonNull View view, @Nullable Bundle savedInstanceState) { 51 | super.onViewCreated(view, savedInstanceState); 52 | // initView(myView); 53 | /* handler = initHandle();*/ 54 | } 55 | 56 | 57 | /* protected abstract Handler initHandle();*/ 58 | 59 | /** 60 | * 初始化UI 61 | *

62 | * //@param savedInstanceState 63 | */ 64 | protected abstract void initView(View view); 65 | 66 | /** 67 | * @return 68 | */ 69 | protected abstract int getContentView(); 70 | 71 | public FragmentActivity getSupportActivity() { 72 | return super.getActivity(); 73 | } 74 | 75 | public void onButtonPressed(Uri uri) { 76 | if (mListener != null) { 77 | mListener.onFragmentInteraction(uri); 78 | } 79 | } 80 | 81 | @Override 82 | public void onAttach(Context context) { 83 | super.onAttach(context); 84 | if (context instanceof OnFragmentInteractionListener) { 85 | mListener = (OnFragmentInteractionListener) context; 86 | } else { 87 | throw new RuntimeException(context.toString() 88 | + " must implement OnFragmentInteractionListener"); 89 | } 90 | } 91 | 92 | @Override 93 | public void onDetach() { 94 | super.onDetach(); 95 | mListener = null; 96 | } 97 | 98 | public interface OnFragmentInteractionListener { 99 | void onFragmentInteraction(Uri uri); 100 | } 101 | 102 | 103 | @Override 104 | public void onDestroyView() { 105 | super.onDestroyView(); 106 | } 107 | } 108 | -------------------------------------------------------------------------------- /app/src/main/java/com/nuc/calvin/headline/json/UserJs.java: -------------------------------------------------------------------------------- 1 | package com.nuc.calvin.headline.json; 2 | 3 | import com.nuc.calvin.headline.bean.Relation; 4 | 5 | public class UserJs { 6 | private Integer userId; 7 | private String username; 8 | private String email; 9 | private String password; 10 | private String headImg; 11 | private String signature; 12 | private String sex; 13 | private Relation relation; 14 | private int articleCount; 15 | private int followCount; 16 | private int fansCount; 17 | 18 | public Integer getUserId() { 19 | return userId; 20 | } 21 | 22 | public void setUserId(Integer userId) { 23 | this.userId = userId; 24 | } 25 | 26 | public String getUsername() { 27 | return username; 28 | } 29 | 30 | public void setUsername(String username) { 31 | this.username = username; 32 | } 33 | 34 | public String getEmail() { 35 | return email; 36 | } 37 | 38 | public void setEmail(String email) { 39 | this.email = email; 40 | } 41 | 42 | public String getPassword() { 43 | return password; 44 | } 45 | 46 | public void setPassword(String password) { 47 | this.password = password; 48 | } 49 | 50 | public String getHeadImg() { 51 | return headImg; 52 | } 53 | 54 | public void setHeadImg(String headImg) { 55 | this.headImg = headImg; 56 | } 57 | 58 | public String getSignature() { 59 | return signature; 60 | } 61 | 62 | public void setSignature(String signature) { 63 | this.signature = signature; 64 | } 65 | 66 | public String getSex() { 67 | return sex; 68 | } 69 | 70 | public void setSex(String sex) { 71 | this.sex = sex; 72 | } 73 | 74 | public Relation getRelation() { 75 | return relation; 76 | } 77 | 78 | public void setRelation(Relation relation) { 79 | this.relation = relation; 80 | } 81 | 82 | public int getArticleCount() { 83 | return articleCount; 84 | } 85 | 86 | public void setArticleCount(int articleCount) { 87 | this.articleCount = articleCount; 88 | } 89 | 90 | public int getFollowCount() { 91 | return followCount; 92 | } 93 | 94 | public void setFollowCount(int followCount) { 95 | this.followCount = followCount; 96 | } 97 | 98 | public int getFansCount() { 99 | return fansCount; 100 | } 101 | 102 | public void setFansCount(int fansCount) { 103 | this.fansCount = fansCount; 104 | } 105 | 106 | @Override 107 | public String toString() { 108 | return "UserJs{" + 109 | "userId=" + userId + 110 | ", username='" + username + '\'' + 111 | ", email='" + email + '\'' + 112 | ", password='" + password + '\'' + 113 | ", headImg='" + headImg + '\'' + 114 | ", signature='" + signature + '\'' + 115 | ", sex='" + sex + '\'' + 116 | ", relation=" + relation + 117 | ", articleCount=" + articleCount + 118 | ", followCount=" + followCount + 119 | ", fansCount=" + fansCount + 120 | '}'; 121 | } 122 | } 123 | -------------------------------------------------------------------------------- /app/src/main/java/com/nuc/calvin/headline/adapter/FindArticleAdapter.java: -------------------------------------------------------------------------------- 1 | package com.nuc.calvin.headline.adapter; 2 | 3 | import android.content.Context; 4 | import android.support.annotation.NonNull; 5 | import android.support.v7.widget.RecyclerView; 6 | import android.view.LayoutInflater; 7 | import android.view.View; 8 | import android.view.ViewGroup; 9 | import android.widget.ImageView; 10 | import android.widget.TextView; 11 | 12 | import com.facebook.drawee.view.SimpleDraweeView; 13 | import com.nuc.calvin.headline.R; 14 | import com.nuc.calvin.headline.json.ArticleJs; 15 | 16 | import java.util.ArrayList; 17 | import java.util.List; 18 | 19 | public class FindArticleAdapter extends RecyclerView.Adapter { 20 | 21 | Context context; 22 | List list = new ArrayList<>(); 23 | 24 | public FindArticleAdapter(Context context, List list) { 25 | this.context = context; 26 | this.list = list; 27 | } 28 | 29 | @NonNull 30 | @Override 31 | public ArticleViewHolder onCreateViewHolder(@NonNull ViewGroup viewGroup, int i) { 32 | View view = LayoutInflater.from(viewGroup.getContext()).inflate(R.layout.view_home_choice_item, viewGroup, false); 33 | ArticleViewHolder myHolder = new ArticleViewHolder(view); 34 | return myHolder; 35 | } 36 | 37 | @Override 38 | public void onBindViewHolder(@NonNull ArticleViewHolder articleViewHolder, int i) { 39 | ArticleJs articleJs = list.get(i); 40 | if (articleViewHolder instanceof ArticleViewHolder) { 41 | articleViewHolder.bindArticle(articleJs); 42 | } 43 | } 44 | 45 | @Override 46 | public int getItemCount() { 47 | return list == null ? 0 : list.size(); 48 | } 49 | 50 | class ArticleViewHolder extends RecyclerView.ViewHolder { 51 | TextView likeCount; 52 | TextView commentCount; 53 | TextView collectCount; 54 | TextView mTitleTv; 55 | TextView mWhereTv; 56 | ImageView mCommentIv; 57 | ImageView mLikeIv; 58 | ImageView mCollectIv; 59 | SimpleDraweeView authorImg; 60 | 61 | public ArticleViewHolder(@NonNull View itemView) { 62 | super(itemView); 63 | mTitleTv = itemView.findViewById(R.id.item_title); 64 | mWhereTv = itemView.findViewById(R.id.tv_where); 65 | mLikeIv = itemView.findViewById(R.id.iv_like); 66 | mCommentIv = itemView.findViewById(R.id.iv_comment); 67 | mCollectIv = itemView.findViewById(R.id.iv_collect); 68 | authorImg = itemView.findViewById(R.id.sdv_avatar); 69 | likeCount = itemView.findViewById(R.id.like_count); 70 | commentCount = itemView.findViewById(R.id.comment_count); 71 | collectCount = itemView.findViewById(R.id.collect_count); 72 | } 73 | 74 | public void bindArticle(ArticleJs article) { 75 | mTitleTv.setText(article.getArticleTitle()); 76 | mWhereTv.setText(article.getUser().getUsername()); 77 | authorImg.setImageURI(article.getUser().getHeadImg()); 78 | likeCount.setText(String.valueOf(article.getLikeCount())); 79 | commentCount.setText(String.valueOf(article.getCommentCount())); 80 | collectCount.setText(String.valueOf(article.getCollectCount())); 81 | } 82 | } 83 | } 84 | -------------------------------------------------------------------------------- /app/src/main/java/com/nuc/calvin/headline/adapter/MyCollectAdapter.java: -------------------------------------------------------------------------------- 1 | package com.nuc.calvin.headline.adapter; 2 | 3 | import android.content.Context; 4 | import android.support.annotation.NonNull; 5 | import android.support.v7.widget.RecyclerView; 6 | import android.view.LayoutInflater; 7 | import android.view.View; 8 | import android.view.ViewGroup; 9 | import android.widget.ImageView; 10 | import android.widget.TextView; 11 | 12 | import com.facebook.drawee.view.SimpleDraweeView; 13 | import com.nuc.calvin.headline.R; 14 | import com.nuc.calvin.headline.json.CollectJs; 15 | 16 | import java.util.ArrayList; 17 | import java.util.List; 18 | 19 | public class MyCollectAdapter extends RecyclerView.Adapter { 20 | private Context context; 21 | private List collectJsList = new ArrayList<>(); 22 | private LayoutInflater layoutInflater; 23 | 24 | public MyCollectAdapter(Context context) { 25 | this.context = context; 26 | layoutInflater = LayoutInflater.from(context); 27 | } 28 | 29 | public void setList(List list) { 30 | collectJsList.clear(); 31 | collectJsList.addAll(list); 32 | } 33 | 34 | @NonNull 35 | @Override 36 | public MyCollectAdapter.CollectHolder onCreateViewHolder(@NonNull ViewGroup viewGroup, int i) { 37 | View view = layoutInflater.inflate(R.layout.view_home_choice_item, viewGroup, false); 38 | return new CollectHolder(view); 39 | } 40 | 41 | @Override 42 | public void onBindViewHolder(@NonNull MyCollectAdapter.CollectHolder collectHolder, int i) { 43 | final CollectJs collectJs = collectJsList.get(i); 44 | collectHolder.bindData(collectJs); 45 | } 46 | 47 | @Override 48 | public int getItemCount() { 49 | return collectJsList == null ? 0 : collectJsList.size(); 50 | } 51 | 52 | public class CollectHolder extends RecyclerView.ViewHolder { 53 | TextView likeCount; 54 | TextView commentCount; 55 | TextView collectCount; 56 | TextView mTitleTv; 57 | TextView mWhereTv; 58 | ImageView mCommentIv; 59 | ImageView mLikeIv; 60 | ImageView mCollectIv; 61 | SimpleDraweeView authorImg; 62 | 63 | public CollectHolder(@NonNull View itemView) { 64 | super(itemView); 65 | mTitleTv = itemView.findViewById(R.id.item_title); 66 | mWhereTv = itemView.findViewById(R.id.tv_where); 67 | mLikeIv = itemView.findViewById(R.id.iv_like); 68 | mCommentIv = itemView.findViewById(R.id.iv_comment); 69 | mCollectIv = itemView.findViewById(R.id.iv_collect); 70 | authorImg = itemView.findViewById(R.id.sdv_avatar); 71 | likeCount = itemView.findViewById(R.id.like_count); 72 | commentCount = itemView.findViewById(R.id.comment_count); 73 | collectCount = itemView.findViewById(R.id.collect_count); 74 | } 75 | 76 | public void bindData(CollectJs collectJs) { 77 | mTitleTv.setText(collectJs.getArticle().getArticleTitle()); 78 | mWhereTv.setText(collectJs.getUsername()); 79 | authorImg.setImageURI(collectJs.getUser().getHeadImg()); 80 | likeCount.setText(String.valueOf(collectJs.getArticle().getLikeCount())); 81 | commentCount.setText(String.valueOf(collectJs.getArticle().getCommentCount())); 82 | /* collectCount.setText(String.valueOf(collectJs.getArticle().));*/ 83 | 84 | } 85 | } 86 | } 87 | -------------------------------------------------------------------------------- /app/src/main/res/layout/activity_post_comment.xml: -------------------------------------------------------------------------------- 1 | 2 | 9 | 10 | 11 | 16 | 17 | 22 | 23 | 31 | 32 | 33 | 34 | 43 | 44 | 51 | 52 | 60 | 61 | 71 | 72 | 73 | 74 | 75 | 79 | 86 | 87 | 88 | 89 | -------------------------------------------------------------------------------- /app/src/main/java/com/nuc/calvin/headline/json/CommentJs.java: -------------------------------------------------------------------------------- 1 | package com.nuc.calvin.headline.json; 2 | 3 | import com.nuc.calvin.headline.bean.Article; 4 | import com.nuc.calvin.headline.bean.Reply; 5 | import com.nuc.calvin.headline.bean.User; 6 | 7 | import java.util.Date; 8 | import java.util.List; 9 | 10 | public class CommentJs { 11 | 12 | private Integer commentId; 13 | private Integer userId; 14 | private Integer articleId; 15 | private String commentContent; 16 | private Date commentTime; 17 | private User user; 18 | private Article article; 19 | private String username; 20 | private String time; 21 | private int countReply; 22 | private List replyList; 23 | 24 | public Integer getCommentId() { 25 | return commentId; 26 | } 27 | 28 | public void setCommentId(Integer commentId) { 29 | this.commentId = commentId; 30 | } 31 | 32 | public Integer getUserId() { 33 | return userId; 34 | } 35 | 36 | public void setUserId(Integer userId) { 37 | this.userId = userId; 38 | } 39 | 40 | public Integer getArticleId() { 41 | return articleId; 42 | } 43 | 44 | public void setArticleId(Integer articleId) { 45 | this.articleId = articleId; 46 | } 47 | 48 | public String getCommentContent() { 49 | return commentContent; 50 | } 51 | 52 | public void setCommentContent(String commentContent) { 53 | this.commentContent = commentContent; 54 | } 55 | 56 | public Date getCommentTime() { 57 | return commentTime; 58 | } 59 | 60 | public void setCommentTime(Date commentTime) { 61 | this.commentTime = commentTime; 62 | } 63 | 64 | public User getUser() { 65 | return user; 66 | } 67 | 68 | public void setUser(User user) { 69 | this.user = user; 70 | } 71 | 72 | public Article getArticle() { 73 | return article; 74 | } 75 | 76 | public void setArticle(Article article) { 77 | this.article = article; 78 | } 79 | 80 | public String getUsername() { 81 | return username; 82 | } 83 | 84 | public void setUsername(String username) { 85 | this.username = username; 86 | } 87 | 88 | public String getTime() { 89 | return time; 90 | } 91 | 92 | public void setTime(String time) { 93 | this.time = time; 94 | } 95 | 96 | public int getCountReply() { 97 | return countReply; 98 | } 99 | 100 | public void setCountReply(int countReply) { 101 | this.countReply = countReply; 102 | } 103 | 104 | public List getReplyList() { 105 | return replyList; 106 | } 107 | 108 | public void setReplyList(List replyList) { 109 | this.replyList = replyList; 110 | } 111 | 112 | @Override 113 | public String toString() { 114 | return "CommentJs{" + 115 | "commentId=" + commentId + 116 | ", userId=" + userId + 117 | ", articleId=" + articleId + 118 | ", commentContent='" + commentContent + '\'' + 119 | ", commentTime=" + commentTime + 120 | ", user=" + user + 121 | ", article=" + article + 122 | ", username='" + username + '\'' + 123 | ", time='" + time + '\'' + 124 | ", countReply=" + countReply + 125 | ", replyList=" + replyList + 126 | '}'; 127 | } 128 | } 129 | -------------------------------------------------------------------------------- /app/src/main/res/layout/activity_upate_pwd.xml: -------------------------------------------------------------------------------- 1 | 2 | 6 | 7 | 8 | 13 | 14 | 19 | 20 | 28 | 29 | 30 | 31 | 40 | 41 | 48 | 49 | 57 | 58 | 68 | 69 | 70 | 71 | 72 | 76 | 77 | 85 | 92 | 93 | 94 | 95 | -------------------------------------------------------------------------------- /app/src/main/java/com/nuc/calvin/headline/activity/SearchActivity.java: -------------------------------------------------------------------------------- 1 | package com.nuc.calvin.headline.activity; 2 | 3 | import android.content.Intent; 4 | import android.support.design.widget.TabLayout; 5 | import android.support.v4.app.Fragment; 6 | import android.support.v4.view.ViewPager; 7 | import android.support.v7.app.AppCompatActivity; 8 | import android.os.Bundle; 9 | import android.util.Log; 10 | import android.view.View; 11 | import android.widget.EditText; 12 | import android.widget.ImageView; 13 | import android.widget.TextView; 14 | import android.widget.Toast; 15 | 16 | import com.google.gson.Gson; 17 | import com.google.gson.reflect.TypeToken; 18 | import com.nuc.calvin.headline.R; 19 | import com.nuc.calvin.headline.adapter.FindArticleAdapter; 20 | import com.nuc.calvin.headline.adapter.FindUserAdapter; 21 | import com.nuc.calvin.headline.adapter.SearchAdapter; 22 | import com.nuc.calvin.headline.bean.UserCustom; 23 | import com.nuc.calvin.headline.fragment.FindArticleFragment; 24 | import com.nuc.calvin.headline.fragment.FindUserFragment; 25 | import com.nuc.calvin.headline.json.ArticleJs; 26 | import com.nuc.calvin.headline.utils.StaticClass; 27 | 28 | import java.io.IOException; 29 | import java.io.Serializable; 30 | import java.util.ArrayList; 31 | import java.util.List; 32 | 33 | import okhttp3.Call; 34 | import okhttp3.Callback; 35 | import okhttp3.OkHttpClient; 36 | import okhttp3.Request; 37 | import okhttp3.Response; 38 | 39 | public class SearchActivity extends BaseActivity { 40 | private static final String TAG = "SearchActivity"; 41 | private TabLayout tabLayout; 42 | private ViewPager search_page; 43 | private List list = new ArrayList<>(); 44 | private List fragments = new ArrayList<>(); 45 | private EditText keyWord; 46 | private TextView cancle; 47 | private ImageView beginSearch; 48 | private List articleJsList = new ArrayList<>(); 49 | private List userCustomList = new ArrayList<>(); 50 | 51 | @Override 52 | protected void initView(Bundle savedInstanceState) { 53 | beginSearch = findViewById(R.id.begin_search); 54 | keyWord = findViewById(R.id.key_word); 55 | cancle = findViewById(R.id.tv_cancel); 56 | tabLayout = findViewById(R.id.tab); 57 | search_page = findViewById(R.id.pager); 58 | final FindArticleFragment findArticleFragment = new FindArticleFragment(); 59 | final FindUserFragment findUserFragment = new FindUserFragment(); 60 | fragments.add(findArticleFragment); 61 | fragments.add(findUserFragment); 62 | list.add("文章"); 63 | list.add("用户"); 64 | tabLayout.setupWithViewPager(search_page); 65 | search_page.setAdapter(new SearchAdapter(getSupportFragmentManager(), fragments, list)); 66 | cancle.setOnClickListener(new View.OnClickListener() { 67 | @Override 68 | public void onClick(View v) { 69 | Intent intent = new Intent(SearchActivity.this, MainActivity.class); 70 | intent.putExtra("id", 2); 71 | startActivity(intent); 72 | finish(); 73 | } 74 | }); 75 | 76 | beginSearch.setOnClickListener(new View.OnClickListener() { 77 | @Override 78 | public void onClick(View v) { 79 | String word = keyWord.getText().toString(); 80 | findArticleFragment.refredata(word); 81 | findUserFragment.refreshData(word); 82 | StaticClass.findUserAdapter = new FindUserAdapter(getApplicationContext(), StaticClass.userList); 83 | StaticClass.findArticleAdapter = new FindArticleAdapter(getApplicationContext(), StaticClass.articleJsList); 84 | } 85 | }); 86 | 87 | } 88 | 89 | @Override 90 | protected int getContentView() { 91 | return R.layout.activity_search; 92 | } 93 | 94 | 95 | } 96 | -------------------------------------------------------------------------------- /app/src/main/res/layout/my_follow_list.xml: -------------------------------------------------------------------------------- 1 | 2 | 7 | 8 | 12 | 13 | 17 | 18 | 19 | 24 | 25 | 31 | 32 | 38 | 39 | 40 | 49 | 50 | 54 | 55 | 62 | 63 | 71 | 72 | 79 | 80 | 87 | 88 | 89 | 90 | 96 | 97 | 102 | 103 | --------------------------------------------------------------------------------