├── yuannews ├── .gitignore ├── src │ ├── main │ │ ├── res │ │ │ ├── mipmap-hdpi │ │ │ │ ├── zan.png │ │ │ │ ├── ic_news.png │ │ │ │ ├── loading.png │ │ │ │ ├── loaderror.png │ │ │ │ ├── normalzan.png │ │ │ │ ├── superzan.png │ │ │ │ ├── user_head.png │ │ │ │ ├── detail_moren.png │ │ │ │ ├── ic_launcher.png │ │ │ │ └── ic_news_no.jpg │ │ │ ├── drawable-hdpi │ │ │ │ ├── ic_label.png │ │ │ │ ├── ic_loyalty.png │ │ │ │ ├── ic_equalizer.png │ │ │ │ ├── ic_language.png │ │ │ │ ├── ic_action_heart.png │ │ │ │ ├── ic_action_user.png │ │ │ │ ├── ic_info_outline.png │ │ │ │ ├── ic_label_outline.png │ │ │ │ └── ic_action_arrow_left.png │ │ │ ├── drawable-mdpi │ │ │ │ ├── ic_label.png │ │ │ │ ├── ic_loyalty.png │ │ │ │ ├── ic_equalizer.png │ │ │ │ ├── ic_language.png │ │ │ │ ├── ic_action_heart.png │ │ │ │ ├── ic_action_user.png │ │ │ │ ├── ic_info_outline.png │ │ │ │ ├── ic_label_outline.png │ │ │ │ └── ic_action_arrow_left.png │ │ │ ├── drawable-xhdpi │ │ │ │ ├── ic_label.png │ │ │ │ ├── ic_language.png │ │ │ │ ├── ic_loyalty.png │ │ │ │ ├── ic_action_user.png │ │ │ │ ├── ic_equalizer.png │ │ │ │ ├── ic_action_heart.png │ │ │ │ ├── ic_info_outline.png │ │ │ │ ├── ic_label_outline.png │ │ │ │ └── ic_action_arrow_left.png │ │ │ ├── drawable-xxhdpi │ │ │ │ ├── ic_label.png │ │ │ │ ├── ic_loyalty.png │ │ │ │ ├── ic_equalizer.png │ │ │ │ ├── ic_language.png │ │ │ │ ├── ic_action_heart.png │ │ │ │ ├── ic_action_user.png │ │ │ │ ├── ic_info_outline.png │ │ │ │ ├── ic_label_outline.png │ │ │ │ └── ic_action_arrow_left.png │ │ │ ├── mipmap-mdpi │ │ │ │ └── ic_launcher.png │ │ │ ├── mipmap-xhdpi │ │ │ │ └── ic_launcher.png │ │ │ ├── drawable-ldpi │ │ │ │ ├── ic_equalizer.png │ │ │ │ └── ic_action_arrow_left.png │ │ │ ├── drawable-xxxhdpi │ │ │ │ ├── ic_label.png │ │ │ │ ├── ic_equalizer.png │ │ │ │ ├── ic_language.png │ │ │ │ ├── ic_loyalty.png │ │ │ │ ├── ic_action_user.png │ │ │ │ ├── ic_action_heart.png │ │ │ │ ├── ic_info_outline.png │ │ │ │ ├── ic_label_outline.png │ │ │ │ └── ic_action_arrow_left.png │ │ │ ├── mipmap-xxhdpi │ │ │ │ └── ic_launcher.png │ │ │ ├── mipmap-xxxhdpi │ │ │ │ └── ic_launcher.png │ │ │ ├── menu │ │ │ │ ├── detail.xml │ │ │ │ └── drawer.xml │ │ │ ├── values │ │ │ │ ├── dimens.xml │ │ │ │ ├── colors.xml │ │ │ │ ├── styles.xml │ │ │ │ └── strings.xml │ │ │ ├── drawable │ │ │ │ ├── tv_background.xml │ │ │ │ ├── ic_add.xml │ │ │ │ ├── label_background.xml │ │ │ │ └── ic_menu.xml │ │ │ ├── values-w820dp │ │ │ │ └── dimens.xml │ │ │ ├── drawable-anydpi │ │ │ │ ├── btn_background.xml │ │ │ │ └── ic_av_timer.xml │ │ │ ├── layout │ │ │ │ ├── news_detail_fragment_grid_item.xml │ │ │ │ ├── wlecome_activity.xml │ │ │ │ ├── main_fragment.xml │ │ │ │ ├── normal_base_main.xml │ │ │ │ ├── navigation_header.xml │ │ │ │ ├── labels_fragment.xml │ │ │ │ ├── about_activity.xml │ │ │ │ ├── base_main_float_dialog.xml │ │ │ │ ├── news_fragment.xml │ │ │ │ ├── comments_fragment_item.xml │ │ │ │ ├── label_fragment_item.xml │ │ │ │ ├── label_fragment.xml │ │ │ │ └── commens_fragment.xml │ │ │ ├── values-v21 │ │ │ │ └── styles.xml │ │ │ └── values-v19 │ │ │ │ └── styles.xml │ │ ├── java │ │ │ └── cn │ │ │ │ └── edu │ │ │ │ └── hpu │ │ │ │ └── yuan │ │ │ │ └── yuannews │ │ │ │ ├── main │ │ │ │ ├── base │ │ │ │ │ ├── BasePresenter.java │ │ │ │ │ ├── BaseView.java │ │ │ │ │ ├── NorbalBackFragment.java │ │ │ │ │ ├── NormalBackActivity.java │ │ │ │ │ ├── NormalBaseActivity.java │ │ │ │ │ └── BaseFragment.java │ │ │ │ ├── scope │ │ │ │ │ └── PerActivity.java │ │ │ │ ├── data │ │ │ │ │ ├── model │ │ │ │ │ │ ├── basevo │ │ │ │ │ │ │ ├── CateVo.java │ │ │ │ │ │ │ ├── CommentVo.java │ │ │ │ │ │ │ ├── SourceVo.java │ │ │ │ │ │ │ ├── UserVo.java │ │ │ │ │ │ │ ├── NewsVo.java │ │ │ │ │ │ │ ├── LikedVo.java │ │ │ │ │ │ │ ├── TasteVo.java │ │ │ │ │ │ │ └── CommentJo.java │ │ │ │ │ │ ├── news │ │ │ │ │ │ │ ├── NewsVo.java │ │ │ │ │ │ │ ├── TuijianModel.java │ │ │ │ │ │ │ ├── CSCustom.java │ │ │ │ │ │ │ └── NewsCustom.java │ │ │ │ │ │ ├── DataBean.java │ │ │ │ │ │ └── base │ │ │ │ │ │ │ ├── Liked.java │ │ │ │ │ │ │ ├── Cate.java │ │ │ │ │ │ │ ├── Source.java │ │ │ │ │ │ │ ├── Taste.java │ │ │ │ │ │ │ ├── Comment.java │ │ │ │ │ │ │ ├── News.java │ │ │ │ │ │ │ └── User.java │ │ │ │ │ ├── NewsAPI.java │ │ │ │ │ ├── remote │ │ │ │ │ │ └── NewsImageLoader.java │ │ │ │ │ ├── NewsAPIMapUtil.java │ │ │ │ │ ├── NewsAPIModule.java │ │ │ │ │ └── Local │ │ │ │ │ │ └── NewsAPIShared.java │ │ │ │ ├── app │ │ │ │ │ ├── ApplicationComponent.java │ │ │ │ │ ├── ApplicationModule.java │ │ │ │ │ └── BaseApplication.java │ │ │ │ └── util │ │ │ │ │ ├── LollipopUtils.java │ │ │ │ │ └── NotificationUtil.java │ │ │ │ ├── user │ │ │ │ ├── label │ │ │ │ │ ├── LabelComponent.java │ │ │ │ │ ├── LabelContancts.java │ │ │ │ │ ├── LabelModule.java │ │ │ │ │ ├── LabelActivity.java │ │ │ │ │ └── adapter │ │ │ │ │ │ └── LabelIfoAdapter.java │ │ │ │ ├── login │ │ │ │ │ ├── LoginComponent.java │ │ │ │ │ ├── LoginContract.java │ │ │ │ │ ├── LoginModule.java │ │ │ │ │ ├── LoginActivity.java │ │ │ │ │ └── LoginPresenter.java │ │ │ │ ├── center │ │ │ │ │ ├── CenterComponent.java │ │ │ │ │ ├── CenterContancts.java │ │ │ │ │ ├── CenterModule.java │ │ │ │ │ ├── CenterActivity.java │ │ │ │ │ └── CenterPersenter.java │ │ │ │ ├── userIfo │ │ │ │ │ ├── UserifoComponent.java │ │ │ │ │ ├── UserIfoContrancts.java │ │ │ │ │ ├── UserIfoModule.java │ │ │ │ │ ├── UserIfoFragment.java │ │ │ │ │ ├── UserIfoPresenter.java │ │ │ │ │ └── UserifoActivity.java │ │ │ │ └── register │ │ │ │ │ ├── RegisterComponent.java │ │ │ │ │ ├── RegisterContancts.java │ │ │ │ │ ├── RegisterModule.java │ │ │ │ │ ├── RegisterActivity.java │ │ │ │ │ └── RegisterPresenter.java │ │ │ │ └── news │ │ │ │ ├── labels │ │ │ │ ├── LabelsComponent.java │ │ │ │ ├── LabelsContancts.java │ │ │ │ ├── LabelsModule.java │ │ │ │ ├── LabelsActivity.java │ │ │ │ ├── adapter │ │ │ │ │ └── LabelsAdapter.java │ │ │ │ └── LabelsPresenter.java │ │ │ │ ├── comment │ │ │ │ ├── CommentComponent.java │ │ │ │ ├── CommenContancts.java │ │ │ │ ├── CommentModule.java │ │ │ │ ├── CommenActivity.java │ │ │ │ └── adapter │ │ │ │ │ └── CommentRecyclerAdapter.java │ │ │ │ ├── tuijian │ │ │ │ ├── TuijianComponent.java │ │ │ │ ├── TuijianContancts.java │ │ │ │ ├── TuijianModule.java │ │ │ │ ├── TuijianActivity.java │ │ │ │ └── TuijianPresenter.java │ │ │ │ ├── other │ │ │ │ ├── GuideActivity.java │ │ │ │ ├── AboutFragment.java │ │ │ │ ├── AboutActivity.java │ │ │ │ └── WelcomeActivity.java │ │ │ │ ├── newsdetail │ │ │ │ ├── NewsDetailComponent.java │ │ │ │ ├── NewsDetailContancts.java │ │ │ │ ├── NewsDetailModule.java │ │ │ │ ├── NewsDetailActivity.java │ │ │ │ └── adapter │ │ │ │ │ └── NewsDetailGridViewAdapter.java │ │ │ │ ├── newslist │ │ │ │ ├── NewsComponent.java │ │ │ │ ├── NewsContract.java │ │ │ │ ├── NewsActivity.java │ │ │ │ ├── NewsModule.java │ │ │ │ └── MewsPresenter.java │ │ │ │ └── main │ │ │ │ ├── MainComponent.java │ │ │ │ ├── MainContract.java │ │ │ │ ├── adapter │ │ │ │ └── MainViewPagerAdapter.java │ │ │ │ ├── MainModule.java │ │ │ │ ├── MainActivity.java │ │ │ │ └── MainPresenter.java │ │ └── AndroidManifest.xml │ └── androidTest │ │ └── java │ │ └── cn │ │ └── edu │ │ └── hpu │ │ └── yuan │ │ └── yuannews │ │ └── ApplicationTest.java ├── proguard-rules.pro └── build.gradle ├── settings.gradle ├── yuancore ├── .gitignore ├── src │ ├── main │ │ ├── res │ │ │ ├── values │ │ │ │ ├── strings.xml │ │ │ │ ├── attrs.xml │ │ │ │ ├── colors.xml │ │ │ │ └── styles.xml │ │ │ ├── mipmap │ │ │ │ ├── ic_help.png │ │ │ │ ├── ic_info.png │ │ │ │ ├── ic_wrong.png │ │ │ │ ├── ic_success.png │ │ │ │ └── icon_warning.png │ │ │ └── drawable │ │ │ │ ├── shape_corners_bottom.xml │ │ │ │ ├── shape_corners_bottom_normal.xml │ │ │ │ ├── shape_top.xml │ │ │ │ ├── shape_left_bottom.xml │ │ │ │ ├── shape_right_bottom.xml │ │ │ │ ├── shape_left_bottom_normal.xml │ │ │ │ ├── shape_right_bottom_normal.xml │ │ │ │ ├── sel_def_gray_left.xml │ │ │ │ ├── sel_def_gray_right.xml │ │ │ │ ├── sel_def_gray.xml │ │ │ │ ├── sel_btn.xml │ │ │ │ ├── sel_btn_info.xml │ │ │ │ ├── sel_btn_help.xml │ │ │ │ ├── sel_btn_wrong.xml │ │ │ │ ├── sel_btn_success.xml │ │ │ │ └── sel_btn_warning.xml │ │ ├── AndroidManifest.xml │ │ └── java │ │ │ └── cn │ │ │ └── edu │ │ │ └── hpu │ │ │ └── yuan │ │ │ └── yuancore │ │ │ ├── util │ │ │ └── DisplayUtil.java │ │ │ └── ui │ │ │ └── dialog │ │ │ └── AnimationLoader.java │ └── androidTest │ │ └── java │ │ └── cn │ │ └── edu │ │ └── hpu │ │ └── yuan │ │ └── yuancore │ │ └── ApplicationTest.java ├── build.gradle ├── proguard-rules.pro └── REDECORE.md ├── .gitignore ├── gradle.properties ├── README.md └── gradlew.bat /yuannews/.gitignore: -------------------------------------------------------------------------------- 1 | /build 2 | yuannews.iml -------------------------------------------------------------------------------- /settings.gradle: -------------------------------------------------------------------------------- 1 | include ':yuannews',":yuancore" -------------------------------------------------------------------------------- /yuancore/.gitignore: -------------------------------------------------------------------------------- 1 | /build 2 | yuancore.iml 3 | -------------------------------------------------------------------------------- /yuancore/src/main/res/values/strings.xml: -------------------------------------------------------------------------------- 1 | 2 | ColorDialog 3 | 4 | -------------------------------------------------------------------------------- /yuancore/src/main/res/mipmap/ic_help.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/LABELNET/YuanNewsForAndroid/HEAD/yuancore/src/main/res/mipmap/ic_help.png -------------------------------------------------------------------------------- /yuancore/src/main/res/mipmap/ic_info.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/LABELNET/YuanNewsForAndroid/HEAD/yuancore/src/main/res/mipmap/ic_info.png -------------------------------------------------------------------------------- /yuancore/src/main/res/mipmap/ic_wrong.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/LABELNET/YuanNewsForAndroid/HEAD/yuancore/src/main/res/mipmap/ic_wrong.png -------------------------------------------------------------------------------- /yuannews/src/main/res/mipmap-hdpi/zan.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/LABELNET/YuanNewsForAndroid/HEAD/yuannews/src/main/res/mipmap-hdpi/zan.png -------------------------------------------------------------------------------- /yuancore/src/main/res/mipmap/ic_success.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/LABELNET/YuanNewsForAndroid/HEAD/yuancore/src/main/res/mipmap/ic_success.png -------------------------------------------------------------------------------- /yuancore/src/main/res/mipmap/icon_warning.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/LABELNET/YuanNewsForAndroid/HEAD/yuancore/src/main/res/mipmap/icon_warning.png -------------------------------------------------------------------------------- /yuannews/src/main/res/mipmap-hdpi/ic_news.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/LABELNET/YuanNewsForAndroid/HEAD/yuannews/src/main/res/mipmap-hdpi/ic_news.png -------------------------------------------------------------------------------- /yuannews/src/main/res/mipmap-hdpi/loading.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/LABELNET/YuanNewsForAndroid/HEAD/yuannews/src/main/res/mipmap-hdpi/loading.png -------------------------------------------------------------------------------- /yuannews/src/main/res/mipmap-hdpi/loaderror.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/LABELNET/YuanNewsForAndroid/HEAD/yuannews/src/main/res/mipmap-hdpi/loaderror.png -------------------------------------------------------------------------------- /yuannews/src/main/res/mipmap-hdpi/normalzan.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/LABELNET/YuanNewsForAndroid/HEAD/yuannews/src/main/res/mipmap-hdpi/normalzan.png -------------------------------------------------------------------------------- /yuannews/src/main/res/mipmap-hdpi/superzan.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/LABELNET/YuanNewsForAndroid/HEAD/yuannews/src/main/res/mipmap-hdpi/superzan.png -------------------------------------------------------------------------------- /yuannews/src/main/res/mipmap-hdpi/user_head.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/LABELNET/YuanNewsForAndroid/HEAD/yuannews/src/main/res/mipmap-hdpi/user_head.png -------------------------------------------------------------------------------- /yuannews/src/main/res/drawable-hdpi/ic_label.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/LABELNET/YuanNewsForAndroid/HEAD/yuannews/src/main/res/drawable-hdpi/ic_label.png -------------------------------------------------------------------------------- /yuannews/src/main/res/drawable-hdpi/ic_loyalty.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/LABELNET/YuanNewsForAndroid/HEAD/yuannews/src/main/res/drawable-hdpi/ic_loyalty.png -------------------------------------------------------------------------------- /yuannews/src/main/res/drawable-mdpi/ic_label.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/LABELNET/YuanNewsForAndroid/HEAD/yuannews/src/main/res/drawable-mdpi/ic_label.png -------------------------------------------------------------------------------- /yuannews/src/main/res/drawable-mdpi/ic_loyalty.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/LABELNET/YuanNewsForAndroid/HEAD/yuannews/src/main/res/drawable-mdpi/ic_loyalty.png -------------------------------------------------------------------------------- /yuannews/src/main/res/drawable-xhdpi/ic_label.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/LABELNET/YuanNewsForAndroid/HEAD/yuannews/src/main/res/drawable-xhdpi/ic_label.png -------------------------------------------------------------------------------- /yuannews/src/main/res/drawable-xxhdpi/ic_label.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/LABELNET/YuanNewsForAndroid/HEAD/yuannews/src/main/res/drawable-xxhdpi/ic_label.png -------------------------------------------------------------------------------- /yuannews/src/main/res/mipmap-hdpi/detail_moren.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/LABELNET/YuanNewsForAndroid/HEAD/yuannews/src/main/res/mipmap-hdpi/detail_moren.png -------------------------------------------------------------------------------- /yuannews/src/main/res/mipmap-hdpi/ic_launcher.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/LABELNET/YuanNewsForAndroid/HEAD/yuannews/src/main/res/mipmap-hdpi/ic_launcher.png -------------------------------------------------------------------------------- /yuannews/src/main/res/mipmap-hdpi/ic_news_no.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/LABELNET/YuanNewsForAndroid/HEAD/yuannews/src/main/res/mipmap-hdpi/ic_news_no.jpg -------------------------------------------------------------------------------- /yuannews/src/main/res/mipmap-mdpi/ic_launcher.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/LABELNET/YuanNewsForAndroid/HEAD/yuannews/src/main/res/mipmap-mdpi/ic_launcher.png -------------------------------------------------------------------------------- /yuannews/src/main/res/mipmap-xhdpi/ic_launcher.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/LABELNET/YuanNewsForAndroid/HEAD/yuannews/src/main/res/mipmap-xhdpi/ic_launcher.png -------------------------------------------------------------------------------- /yuannews/src/main/res/drawable-hdpi/ic_equalizer.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/LABELNET/YuanNewsForAndroid/HEAD/yuannews/src/main/res/drawable-hdpi/ic_equalizer.png -------------------------------------------------------------------------------- /yuannews/src/main/res/drawable-hdpi/ic_language.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/LABELNET/YuanNewsForAndroid/HEAD/yuannews/src/main/res/drawable-hdpi/ic_language.png -------------------------------------------------------------------------------- /yuannews/src/main/res/drawable-ldpi/ic_equalizer.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/LABELNET/YuanNewsForAndroid/HEAD/yuannews/src/main/res/drawable-ldpi/ic_equalizer.png -------------------------------------------------------------------------------- /yuannews/src/main/res/drawable-mdpi/ic_equalizer.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/LABELNET/YuanNewsForAndroid/HEAD/yuannews/src/main/res/drawable-mdpi/ic_equalizer.png -------------------------------------------------------------------------------- /yuannews/src/main/res/drawable-mdpi/ic_language.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/LABELNET/YuanNewsForAndroid/HEAD/yuannews/src/main/res/drawable-mdpi/ic_language.png -------------------------------------------------------------------------------- /yuannews/src/main/res/drawable-xhdpi/ic_language.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/LABELNET/YuanNewsForAndroid/HEAD/yuannews/src/main/res/drawable-xhdpi/ic_language.png -------------------------------------------------------------------------------- /yuannews/src/main/res/drawable-xhdpi/ic_loyalty.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/LABELNET/YuanNewsForAndroid/HEAD/yuannews/src/main/res/drawable-xhdpi/ic_loyalty.png -------------------------------------------------------------------------------- /yuannews/src/main/res/drawable-xxhdpi/ic_loyalty.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/LABELNET/YuanNewsForAndroid/HEAD/yuannews/src/main/res/drawable-xxhdpi/ic_loyalty.png -------------------------------------------------------------------------------- /yuannews/src/main/res/drawable-xxxhdpi/ic_label.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/LABELNET/YuanNewsForAndroid/HEAD/yuannews/src/main/res/drawable-xxxhdpi/ic_label.png -------------------------------------------------------------------------------- /yuannews/src/main/res/mipmap-xxhdpi/ic_launcher.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/LABELNET/YuanNewsForAndroid/HEAD/yuannews/src/main/res/mipmap-xxhdpi/ic_launcher.png -------------------------------------------------------------------------------- /yuannews/src/main/res/mipmap-xxxhdpi/ic_launcher.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/LABELNET/YuanNewsForAndroid/HEAD/yuannews/src/main/res/mipmap-xxxhdpi/ic_launcher.png -------------------------------------------------------------------------------- /yuannews/src/main/res/drawable-hdpi/ic_action_heart.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/LABELNET/YuanNewsForAndroid/HEAD/yuannews/src/main/res/drawable-hdpi/ic_action_heart.png -------------------------------------------------------------------------------- /yuannews/src/main/res/drawable-hdpi/ic_action_user.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/LABELNET/YuanNewsForAndroid/HEAD/yuannews/src/main/res/drawable-hdpi/ic_action_user.png -------------------------------------------------------------------------------- /yuannews/src/main/res/drawable-hdpi/ic_info_outline.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/LABELNET/YuanNewsForAndroid/HEAD/yuannews/src/main/res/drawable-hdpi/ic_info_outline.png -------------------------------------------------------------------------------- /yuannews/src/main/res/drawable-mdpi/ic_action_heart.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/LABELNET/YuanNewsForAndroid/HEAD/yuannews/src/main/res/drawable-mdpi/ic_action_heart.png -------------------------------------------------------------------------------- /yuannews/src/main/res/drawable-mdpi/ic_action_user.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/LABELNET/YuanNewsForAndroid/HEAD/yuannews/src/main/res/drawable-mdpi/ic_action_user.png -------------------------------------------------------------------------------- /yuannews/src/main/res/drawable-mdpi/ic_info_outline.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/LABELNET/YuanNewsForAndroid/HEAD/yuannews/src/main/res/drawable-mdpi/ic_info_outline.png -------------------------------------------------------------------------------- /yuannews/src/main/res/drawable-xhdpi/ic_action_user.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/LABELNET/YuanNewsForAndroid/HEAD/yuannews/src/main/res/drawable-xhdpi/ic_action_user.png -------------------------------------------------------------------------------- /yuannews/src/main/res/drawable-xhdpi/ic_equalizer.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/LABELNET/YuanNewsForAndroid/HEAD/yuannews/src/main/res/drawable-xhdpi/ic_equalizer.png -------------------------------------------------------------------------------- /yuannews/src/main/res/drawable-xxhdpi/ic_equalizer.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/LABELNET/YuanNewsForAndroid/HEAD/yuannews/src/main/res/drawable-xxhdpi/ic_equalizer.png -------------------------------------------------------------------------------- /yuannews/src/main/res/drawable-xxhdpi/ic_language.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/LABELNET/YuanNewsForAndroid/HEAD/yuannews/src/main/res/drawable-xxhdpi/ic_language.png -------------------------------------------------------------------------------- /yuannews/src/main/res/drawable-xxxhdpi/ic_equalizer.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/LABELNET/YuanNewsForAndroid/HEAD/yuannews/src/main/res/drawable-xxxhdpi/ic_equalizer.png -------------------------------------------------------------------------------- /yuannews/src/main/res/drawable-xxxhdpi/ic_language.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/LABELNET/YuanNewsForAndroid/HEAD/yuannews/src/main/res/drawable-xxxhdpi/ic_language.png -------------------------------------------------------------------------------- /yuannews/src/main/res/drawable-xxxhdpi/ic_loyalty.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/LABELNET/YuanNewsForAndroid/HEAD/yuannews/src/main/res/drawable-xxxhdpi/ic_loyalty.png -------------------------------------------------------------------------------- /yuannews/src/main/res/drawable-hdpi/ic_label_outline.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/LABELNET/YuanNewsForAndroid/HEAD/yuannews/src/main/res/drawable-hdpi/ic_label_outline.png -------------------------------------------------------------------------------- /yuannews/src/main/res/drawable-mdpi/ic_label_outline.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/LABELNET/YuanNewsForAndroid/HEAD/yuannews/src/main/res/drawable-mdpi/ic_label_outline.png -------------------------------------------------------------------------------- /yuannews/src/main/res/drawable-xhdpi/ic_action_heart.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/LABELNET/YuanNewsForAndroid/HEAD/yuannews/src/main/res/drawable-xhdpi/ic_action_heart.png -------------------------------------------------------------------------------- /yuannews/src/main/res/drawable-xhdpi/ic_info_outline.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/LABELNET/YuanNewsForAndroid/HEAD/yuannews/src/main/res/drawable-xhdpi/ic_info_outline.png -------------------------------------------------------------------------------- /yuannews/src/main/res/drawable-xhdpi/ic_label_outline.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/LABELNET/YuanNewsForAndroid/HEAD/yuannews/src/main/res/drawable-xhdpi/ic_label_outline.png -------------------------------------------------------------------------------- /yuannews/src/main/res/drawable-xxhdpi/ic_action_heart.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/LABELNET/YuanNewsForAndroid/HEAD/yuannews/src/main/res/drawable-xxhdpi/ic_action_heart.png -------------------------------------------------------------------------------- /yuannews/src/main/res/drawable-xxhdpi/ic_action_user.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/LABELNET/YuanNewsForAndroid/HEAD/yuannews/src/main/res/drawable-xxhdpi/ic_action_user.png -------------------------------------------------------------------------------- /yuannews/src/main/res/drawable-xxhdpi/ic_info_outline.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/LABELNET/YuanNewsForAndroid/HEAD/yuannews/src/main/res/drawable-xxhdpi/ic_info_outline.png -------------------------------------------------------------------------------- /yuannews/src/main/res/drawable-xxxhdpi/ic_action_user.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/LABELNET/YuanNewsForAndroid/HEAD/yuannews/src/main/res/drawable-xxxhdpi/ic_action_user.png -------------------------------------------------------------------------------- /yuannews/src/main/res/drawable-hdpi/ic_action_arrow_left.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/LABELNET/YuanNewsForAndroid/HEAD/yuannews/src/main/res/drawable-hdpi/ic_action_arrow_left.png -------------------------------------------------------------------------------- /yuannews/src/main/res/drawable-ldpi/ic_action_arrow_left.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/LABELNET/YuanNewsForAndroid/HEAD/yuannews/src/main/res/drawable-ldpi/ic_action_arrow_left.png -------------------------------------------------------------------------------- /yuannews/src/main/res/drawable-mdpi/ic_action_arrow_left.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/LABELNET/YuanNewsForAndroid/HEAD/yuannews/src/main/res/drawable-mdpi/ic_action_arrow_left.png -------------------------------------------------------------------------------- /yuannews/src/main/res/drawable-xxhdpi/ic_label_outline.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/LABELNET/YuanNewsForAndroid/HEAD/yuannews/src/main/res/drawable-xxhdpi/ic_label_outline.png -------------------------------------------------------------------------------- /yuannews/src/main/res/drawable-xxxhdpi/ic_action_heart.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/LABELNET/YuanNewsForAndroid/HEAD/yuannews/src/main/res/drawable-xxxhdpi/ic_action_heart.png -------------------------------------------------------------------------------- /yuannews/src/main/res/drawable-xxxhdpi/ic_info_outline.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/LABELNET/YuanNewsForAndroid/HEAD/yuannews/src/main/res/drawable-xxxhdpi/ic_info_outline.png -------------------------------------------------------------------------------- /yuannews/src/main/res/drawable-xxxhdpi/ic_label_outline.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/LABELNET/YuanNewsForAndroid/HEAD/yuannews/src/main/res/drawable-xxxhdpi/ic_label_outline.png -------------------------------------------------------------------------------- /yuannews/src/main/res/drawable-xhdpi/ic_action_arrow_left.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/LABELNET/YuanNewsForAndroid/HEAD/yuannews/src/main/res/drawable-xhdpi/ic_action_arrow_left.png -------------------------------------------------------------------------------- /yuannews/src/main/res/drawable-xxhdpi/ic_action_arrow_left.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/LABELNET/YuanNewsForAndroid/HEAD/yuannews/src/main/res/drawable-xxhdpi/ic_action_arrow_left.png -------------------------------------------------------------------------------- /yuannews/src/main/res/drawable-xxxhdpi/ic_action_arrow_left.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/LABELNET/YuanNewsForAndroid/HEAD/yuannews/src/main/res/drawable-xxxhdpi/ic_action_arrow_left.png -------------------------------------------------------------------------------- /yuancore/src/main/res/values/attrs.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | -------------------------------------------------------------------------------- /yuannews/src/main/res/menu/detail.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 7 | 8 | -------------------------------------------------------------------------------- /yuannews/src/main/java/cn/edu/hpu/yuan/yuannews/main/base/BasePresenter.java: -------------------------------------------------------------------------------- 1 | package cn.edu.hpu.yuan.yuannews.main.base; 2 | 3 | /** 4 | * Created by yuan on 16-5-9. 5 | * presenter基类 6 | * 1.抽取公共的接口方法 7 | */ 8 | public interface BasePresenter { 9 | } 10 | -------------------------------------------------------------------------------- /yuannews/src/main/java/cn/edu/hpu/yuan/yuannews/main/base/BaseView.java: -------------------------------------------------------------------------------- 1 | package cn.edu.hpu.yuan.yuannews.main.base; 2 | 3 | /** 4 | * Created by yuan on 16-5-9. 5 | * BaseView接口 6 | * 1.提取view接口,公共类 7 | */ 8 | public interface BaseView { 9 | 10 | void setPresenter(T presenter ); 11 | 12 | } 13 | -------------------------------------------------------------------------------- /yuannews/src/main/res/values/dimens.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 16dp 4 | 16dp 5 | 16dp 6 | 7 | -------------------------------------------------------------------------------- /yuancore/src/main/AndroidManifest.xml: -------------------------------------------------------------------------------- 1 | 3 | 4 | 8 | 9 | 10 | 11 | 12 | -------------------------------------------------------------------------------- /yuancore/src/main/res/drawable/shape_corners_bottom.xml: -------------------------------------------------------------------------------- 1 | 2 | 4 | 5 | 6 | 9 | 10 | -------------------------------------------------------------------------------- /yuancore/src/main/res/drawable/shape_corners_bottom_normal.xml: -------------------------------------------------------------------------------- 1 | 2 | 4 | 5 | 6 | 9 | 10 | -------------------------------------------------------------------------------- /yuannews/src/main/res/drawable/tv_background.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | -------------------------------------------------------------------------------- /yuannews/src/main/res/values-w820dp/dimens.xml: -------------------------------------------------------------------------------- 1 | 2 | 5 | 64dp 6 | 7 | -------------------------------------------------------------------------------- /yuannews/src/main/res/drawable-anydpi/btn_background.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | -------------------------------------------------------------------------------- /yuannews/src/main/res/drawable/ic_add.xml: -------------------------------------------------------------------------------- 1 | 2 | 7 | 10 | -------------------------------------------------------------------------------- /yuannews/src/main/java/cn/edu/hpu/yuan/yuannews/main/scope/PerActivity.java: -------------------------------------------------------------------------------- 1 | package cn.edu.hpu.yuan.yuannews.main.scope; 2 | 3 | import java.lang.annotation.Retention; 4 | import java.lang.annotation.RetentionPolicy; 5 | 6 | import javax.inject.Scope; 7 | 8 | /** 9 | * Created by yuan on 16-5-9. 10 | * Scope ,指定注解范围 11 | */ 12 | @Scope 13 | @Retention(RetentionPolicy.RUNTIME) 14 | public @interface PerActivity { 15 | } 16 | -------------------------------------------------------------------------------- /yuannews/src/main/res/drawable/label_background.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 10 | -------------------------------------------------------------------------------- /yuannews/src/main/res/drawable/ic_menu.xml: -------------------------------------------------------------------------------- 1 | 2 | 7 | 10 | -------------------------------------------------------------------------------- /yuannews/src/main/java/cn/edu/hpu/yuan/yuannews/main/data/model/basevo/CateVo.java: -------------------------------------------------------------------------------- 1 | package cn.edu.hpu.yuan.yuannews.main.data.model.basevo; 2 | 3 | 4 | import cn.edu.hpu.yuan.yuannews.main.data.model.base.Cate; 5 | 6 | /** 7 | * Created by yuan on 16-4-1. 8 | * 分类拓展类 9 | */ 10 | public class CateVo extends Cate { 11 | 12 | @Override 13 | public String toString() { 14 | return super.toString(); 15 | } 16 | } 17 | -------------------------------------------------------------------------------- /yuancore/src/main/res/drawable/shape_top.xml: -------------------------------------------------------------------------------- 1 | 2 | 4 | 5 | 10 | -------------------------------------------------------------------------------- /yuannews/src/main/java/cn/edu/hpu/yuan/yuannews/main/data/model/basevo/CommentVo.java: -------------------------------------------------------------------------------- 1 | package cn.edu.hpu.yuan.yuannews.main.data.model.basevo; 2 | 3 | 4 | import cn.edu.hpu.yuan.yuannews.main.data.model.base.Comment; 5 | 6 | /** 7 | * Created by yuan on 16-4-3. 8 | * 留言拓展类 9 | */ 10 | public class CommentVo extends Comment { 11 | 12 | @Override 13 | public String toString() { 14 | return super.toString(); 15 | } 16 | } 17 | -------------------------------------------------------------------------------- /yuannews/src/main/java/cn/edu/hpu/yuan/yuannews/main/data/model/basevo/SourceVo.java: -------------------------------------------------------------------------------- 1 | package cn.edu.hpu.yuan.yuannews.main.data.model.basevo; 2 | 3 | 4 | import cn.edu.hpu.yuan.yuannews.main.data.model.base.Source; 5 | 6 | /** 7 | * Created by yuan on 16-4-1. 8 | * 来源数据 拓展对象 9 | */ 10 | public class SourceVo extends Source { 11 | 12 | @Override 13 | public String toString() { 14 | return super.toString(); 15 | } 16 | } 17 | -------------------------------------------------------------------------------- /yuannews/src/main/java/cn/edu/hpu/yuan/yuannews/user/label/LabelComponent.java: -------------------------------------------------------------------------------- 1 | package cn.edu.hpu.yuan.yuannews.user.label; 2 | 3 | import dagger.Component; 4 | 5 | /** 6 | * Created by yuan on 16-5-12. 7 | */ 8 | @Component(modules = LabelModule.class) 9 | public interface LabelComponent { 10 | 11 | void injectLabelActivity(LabelActivity labelActivity); 12 | 13 | void injectLabelFragment(LabelFragment labelFragment); 14 | 15 | } 16 | -------------------------------------------------------------------------------- /yuannews/src/main/java/cn/edu/hpu/yuan/yuannews/user/login/LoginComponent.java: -------------------------------------------------------------------------------- 1 | package cn.edu.hpu.yuan.yuannews.user.login; 2 | 3 | import dagger.Component; 4 | 5 | /** 6 | * Created by yuan on 16-5-12. 7 | */ 8 | @Component(modules = LoginModule.class) 9 | public interface LoginComponent { 10 | 11 | void injectLoginActivity(LoginActivity loginActivity); 12 | 13 | void injectLoginFragment(LoginFragment loginFragment); 14 | 15 | } 16 | -------------------------------------------------------------------------------- /yuannews/src/main/java/cn/edu/hpu/yuan/yuannews/news/labels/LabelsComponent.java: -------------------------------------------------------------------------------- 1 | package cn.edu.hpu.yuan.yuannews.news.labels; 2 | 3 | import dagger.Component; 4 | 5 | /** 6 | * Created by yuan on 16-5-13. 7 | */ 8 | @Component(modules = LabelsModule.class) 9 | public interface LabelsComponent { 10 | 11 | void injectLabelsActivity(LabelsActivity labelsActivity); 12 | 13 | void injectLabelsFragment(LabelsFragment labelsFragment); 14 | } 15 | -------------------------------------------------------------------------------- /yuannews/src/main/java/cn/edu/hpu/yuan/yuannews/user/center/CenterComponent.java: -------------------------------------------------------------------------------- 1 | package cn.edu.hpu.yuan.yuannews.user.center; 2 | 3 | import dagger.Component; 4 | 5 | /** 6 | * Created by yuan on 16-5-12. 7 | */ 8 | @Component(modules = CenterModule.class) 9 | public interface CenterComponent { 10 | 11 | void injectCenterActivity(CenterActivity centerActivity); 12 | 13 | void injectCenterFragment(CenterFragment centerFragment); 14 | 15 | } 16 | -------------------------------------------------------------------------------- /yuancore/src/main/res/drawable/shape_left_bottom.xml: -------------------------------------------------------------------------------- 1 | 2 | 4 | 5 | 6 | 11 | 12 | -------------------------------------------------------------------------------- /yuancore/src/main/res/drawable/shape_right_bottom.xml: -------------------------------------------------------------------------------- 1 | 2 | 4 | 5 | 6 | 11 | 12 | -------------------------------------------------------------------------------- /yuancore/src/main/res/drawable/shape_left_bottom_normal.xml: -------------------------------------------------------------------------------- 1 | 2 | 4 | 5 | 6 | 11 | 12 | -------------------------------------------------------------------------------- /yuancore/src/main/res/drawable/shape_right_bottom_normal.xml: -------------------------------------------------------------------------------- 1 | 2 | 4 | 5 | 6 | 11 | 12 | -------------------------------------------------------------------------------- /yuannews/src/main/java/cn/edu/hpu/yuan/yuannews/news/comment/CommentComponent.java: -------------------------------------------------------------------------------- 1 | package cn.edu.hpu.yuan.yuannews.news.comment; 2 | 3 | import dagger.Component; 4 | 5 | /** 6 | * Created by yuan on 16-5-13. 7 | */ 8 | @Component(modules = CommentModule.class) 9 | public interface CommentComponent { 10 | 11 | void injectCommentActivity(CommenActivity commenActivity); 12 | 13 | void injectCommentFragment(CommentFragment commentFragment); 14 | 15 | } 16 | -------------------------------------------------------------------------------- /yuannews/src/main/java/cn/edu/hpu/yuan/yuannews/news/tuijian/TuijianComponent.java: -------------------------------------------------------------------------------- 1 | package cn.edu.hpu.yuan.yuannews.news.tuijian; 2 | 3 | import dagger.Component; 4 | 5 | /** 6 | * Created by yuan on 16-5-13. 7 | */ 8 | @Component(modules = TuijianModule.class) 9 | public interface TuijianComponent { 10 | 11 | void injectTuijianActivity(TuijianActivity tuijianActivity); 12 | 13 | void injectTuijianFragment(TuijianFragment tuijianFragment); 14 | 15 | } 16 | -------------------------------------------------------------------------------- /yuannews/src/main/java/cn/edu/hpu/yuan/yuannews/user/userIfo/UserifoComponent.java: -------------------------------------------------------------------------------- 1 | package cn.edu.hpu.yuan.yuannews.user.userIfo; 2 | 3 | import dagger.Component; 4 | 5 | /** 6 | * Created by yuan on 16-5-12. 7 | */ 8 | @Component(modules = UserIfoModule.class) 9 | public interface UserifoComponent { 10 | 11 | void injectUserIfoActivity(UserifoActivity userifoActivity); 12 | 13 | void injectUserIfoFragment(UserIfoFragment userIfoFragment); 14 | 15 | } 16 | -------------------------------------------------------------------------------- /yuancore/src/androidTest/java/cn/edu/hpu/yuan/yuancore/ApplicationTest.java: -------------------------------------------------------------------------------- 1 | package cn.edu.hpu.yuan.yuancore; 2 | 3 | import android.app.Application; 4 | import android.test.ApplicationTestCase; 5 | 6 | /** 7 | * Testing Fundamentals 8 | */ 9 | public class ApplicationTest extends ApplicationTestCase { 10 | public ApplicationTest() { 11 | super(Application.class); 12 | } 13 | } -------------------------------------------------------------------------------- /yuannews/src/androidTest/java/cn/edu/hpu/yuan/yuannews/ApplicationTest.java: -------------------------------------------------------------------------------- 1 | package cn.edu.hpu.yuan.yuannews; 2 | 3 | import android.app.Application; 4 | import android.test.ApplicationTestCase; 5 | 6 | /** 7 | * Testing Fundamentals 8 | */ 9 | public class ApplicationTest extends ApplicationTestCase { 10 | public ApplicationTest() { 11 | super(Application.class); 12 | } 13 | } -------------------------------------------------------------------------------- /yuannews/src/main/java/cn/edu/hpu/yuan/yuannews/user/register/RegisterComponent.java: -------------------------------------------------------------------------------- 1 | package cn.edu.hpu.yuan.yuannews.user.register; 2 | 3 | import dagger.Component; 4 | 5 | /** 6 | * Created by yuan on 16-5-12. 7 | */ 8 | 9 | @Component(modules = RegisterModule.class) 10 | public interface RegisterComponent { 11 | 12 | void injectRegisterActivity(RegisterActivity registerActivity); 13 | 14 | void injectRegisterFragment(RegisterFragment registerFragment); 15 | 16 | } 17 | -------------------------------------------------------------------------------- /yuancore/src/main/res/drawable/sel_def_gray_left.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | -------------------------------------------------------------------------------- /yuancore/src/main/res/drawable/sel_def_gray_right.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | -------------------------------------------------------------------------------- /yuannews/src/main/java/cn/edu/hpu/yuan/yuannews/news/other/GuideActivity.java: -------------------------------------------------------------------------------- 1 | package cn.edu.hpu.yuan.yuannews.news.other; 2 | 3 | import android.os.Bundle; 4 | import android.support.v7.app.AppCompatActivity; 5 | 6 | /** 7 | * Created by yuan on 16-5-13. 8 | * 引导页 9 | */ 10 | public class GuideActivity extends AppCompatActivity{ 11 | 12 | 13 | @Override 14 | public void onCreate(Bundle savedInstanceState) { 15 | super.onCreate(savedInstanceState); 16 | 17 | } 18 | } 19 | -------------------------------------------------------------------------------- /yuannews/src/main/java/cn/edu/hpu/yuan/yuannews/main/data/model/basevo/UserVo.java: -------------------------------------------------------------------------------- 1 | package cn.edu.hpu.yuan.yuannews.main.data.model.basevo; 2 | 3 | 4 | import java.io.Serializable; 5 | 6 | import cn.edu.hpu.yuan.yuannews.main.data.model.base.User; 7 | 8 | /** 9 | * Created by yuan on 16-3-30. 10 | * 用户拓展实体类 11 | */ 12 | public class UserVo extends User implements Serializable{ 13 | 14 | @Override 15 | public String toString() { 16 | return super.toString(); 17 | } 18 | } 19 | -------------------------------------------------------------------------------- /yuannews/src/main/java/cn/edu/hpu/yuan/yuannews/news/newsdetail/NewsDetailComponent.java: -------------------------------------------------------------------------------- 1 | package cn.edu.hpu.yuan.yuannews.news.newsdetail; 2 | 3 | import dagger.Component; 4 | 5 | /** 6 | * Created by yuan on 16-5-11. 7 | */ 8 | @Component(modules = NewsDetailModule.class) 9 | public interface NewsDetailComponent { 10 | 11 | void injectNewsDetailActivity(NewsDetailActivity newsDetailActivity); 12 | 13 | void injectNewsDetailFragment(NewsDetailFragment newsDetailFragment); 14 | 15 | } 16 | -------------------------------------------------------------------------------- /yuancore/src/main/res/drawable/sel_def_gray.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | -------------------------------------------------------------------------------- /yuannews/src/main/res/values/colors.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | #19a97b 4 | #EDEDED 5 | #800080 6 | #fff 7 | 8 | #fff 9 | #88000000 10 | 11 | #00C853 12 | 13 | #2E2E2E 14 | 15 | -------------------------------------------------------------------------------- /yuannews/src/main/java/cn/edu/hpu/yuan/yuannews/news/newslist/NewsComponent.java: -------------------------------------------------------------------------------- 1 | package cn.edu.hpu.yuan.yuannews.news.newslist; 2 | 3 | import cn.edu.hpu.yuan.yuannews.main.scope.PerActivity; 4 | import dagger.Component; 5 | 6 | /** 7 | * Created by yuan on 16-5-9. 8 | * 新闻列表注入类 9 | */ 10 | @PerActivity 11 | @Component(modules = NewsModule.class) 12 | public interface NewsComponent { 13 | 14 | void injectNewsActivity(NewsActivity newsActivity); 15 | 16 | void injectNewsFragment(NewsFragment newsFragment); 17 | 18 | } 19 | -------------------------------------------------------------------------------- /yuannews/src/main/java/cn/edu/hpu/yuan/yuannews/user/register/RegisterContancts.java: -------------------------------------------------------------------------------- 1 | package cn.edu.hpu.yuan.yuannews.user.register; 2 | 3 | /** 4 | * Created by yuan on 16-5-12. 5 | */ 6 | public interface RegisterContancts { 7 | 8 | interface RegisterContanctsPresenter{ 9 | 10 | void postUserRegister(String nick,String num,String pass); 11 | 12 | } 13 | 14 | interface RegisterCOntanctsView{ 15 | void showDialog(); 16 | void showError(String msg); 17 | void showSuccess(); 18 | } 19 | 20 | } 21 | -------------------------------------------------------------------------------- /yuannews/src/main/java/cn/edu/hpu/yuan/yuannews/news/main/MainComponent.java: -------------------------------------------------------------------------------- 1 | package cn.edu.hpu.yuan.yuannews.news.main; 2 | 3 | import cn.edu.hpu.yuan.yuannews.main.scope.PerActivity; 4 | import dagger.Component; 5 | 6 | /** 7 | * Created by yuan on 16-5-10. 8 | * 注入器,两个地方:Activity和Fragment注入实例 9 | */ 10 | @PerActivity 11 | @Component(modules = MainModule.class) 12 | public interface MainComponent { 13 | 14 | void injectMainActivity(MainActivity mainActivity); 15 | 16 | void injectMainFragment(MainFragment mainFragment); 17 | 18 | } 19 | -------------------------------------------------------------------------------- /yuannews/src/main/java/cn/edu/hpu/yuan/yuannews/user/login/LoginContract.java: -------------------------------------------------------------------------------- 1 | package cn.edu.hpu.yuan.yuannews.user.login; 2 | 3 | /** 4 | * Created by yuan on 16-5-12. 5 | */ 6 | public interface LoginContract { 7 | 8 | 9 | interface LoginContractPresenter{ 10 | 11 | void postUserLogin(String num,String pass); 12 | 13 | } 14 | 15 | interface LoginContractView{ 16 | 17 | void showDialog(); 18 | 19 | void success(); 20 | 21 | void error(String msg); 22 | 23 | void dmissDialog(); 24 | } 25 | 26 | } 27 | -------------------------------------------------------------------------------- /yuannews/src/main/res/layout/news_detail_fragment_grid_item.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 13 | -------------------------------------------------------------------------------- /yuancore/src/main/res/values/colors.xml: -------------------------------------------------------------------------------- 1 | 2 | #ededf3 3 | #ed7861 4 | #303030 5 | #343434 6 | 7 | #79b3e4 8 | #e8bd4b 9 | #ed7861 10 | #e8bd4b 11 | #90b06e 12 | 13 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | # Built application files 2 | *.apk 3 | *.ap_ 4 | 5 | # Files for the Dalvik VM 6 | *.dex 7 | 8 | # Java class files 9 | *.class 10 | 11 | # Generated files 12 | bin/ 13 | gen/ 14 | 15 | # Gradle files 16 | .gradle/ 17 | build/ 18 | 19 | # Local configuration file (sdk path, etc) 20 | local.properties 21 | 22 | # Proguard folder generated by Eclipse 23 | proguard/ 24 | 25 | # Log Files 26 | *.log 27 | 28 | # Android Studio Navigation editor temp files 29 | .navigation/ 30 | 31 | # Android Studio captures folder 32 | captures/ 33 | YuanNewsForAndroid.iml 34 | .idea 35 | gradle 36 | *.iml 37 | -------------------------------------------------------------------------------- /yuancore/src/main/res/drawable/sel_btn.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | -------------------------------------------------------------------------------- /yuancore/src/main/res/drawable/sel_btn_info.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | -------------------------------------------------------------------------------- /yuancore/src/main/res/drawable/sel_btn_help.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | -------------------------------------------------------------------------------- /yuancore/src/main/res/drawable/sel_btn_wrong.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | -------------------------------------------------------------------------------- /yuannews/src/main/java/cn/edu/hpu/yuan/yuannews/main/data/NewsAPI.java: -------------------------------------------------------------------------------- 1 | package cn.edu.hpu.yuan.yuannews.main.data; 2 | 3 | import java.lang.annotation.Retention; 4 | import java.lang.annotation.RetentionPolicy; 5 | 6 | import javax.inject.Scope; 7 | 8 | /** 9 | * Created by yuan on 16-5-9. 10 | * 数据获取总类 11 | */ 12 | 13 | @Scope 14 | @Retention(RetentionPolicy.RUNTIME) 15 | public @interface NewsAPI { 16 | 17 | // TODO 每次修改IP 地址进行数据请求 18 | String BASE_IP="10.42.0.1"; 19 | 20 | String BASE_URL="http://"+BASE_IP+":8088/yuannews/api/"; 21 | 22 | String BASE_IMAGE_URL="http://"+BASE_IP+":8088"; 23 | 24 | } 25 | -------------------------------------------------------------------------------- /yuancore/src/main/res/drawable/sel_btn_success.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | -------------------------------------------------------------------------------- /yuancore/src/main/res/drawable/sel_btn_warning.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | -------------------------------------------------------------------------------- /yuannews/src/main/java/cn/edu/hpu/yuan/yuannews/user/userIfo/UserIfoContrancts.java: -------------------------------------------------------------------------------- 1 | package cn.edu.hpu.yuan.yuannews.user.userIfo; 2 | 3 | /** 4 | * Created by yuan on 16-5-12. 5 | */ 6 | public interface UserIfoContrancts { 7 | 8 | interface UserIfoContranctsPresenter{ 9 | 10 | void postUpdateUserNick(String nick); 11 | 12 | void postUpdateUserSex(Integer sex); 13 | 14 | void postUpdateUserPass(String pass); 15 | 16 | void postUpdateUserHead(); 17 | 18 | } 19 | 20 | interface UserIfoContranctsView{ 21 | 22 | void showDialog(); 23 | void showMsg(String msg); 24 | 25 | } 26 | 27 | } 28 | -------------------------------------------------------------------------------- /yuannews/src/main/java/cn/edu/hpu/yuan/yuannews/main/app/ApplicationComponent.java: -------------------------------------------------------------------------------- 1 | package cn.edu.hpu.yuan.yuannews.main.app; 2 | 3 | import android.content.Context; 4 | import javax.inject.Singleton; 5 | import cn.edu.hpu.yuan.yuannews.main.data.NewsAPIModule; 6 | import dagger.Component; 7 | 8 | /** 9 | * Created by yuan on 16-5-9. 10 | */ 11 | @Singleton 12 | @Component(modules = {ApplicationModule.class,NewsAPIModule.class}) 13 | public interface ApplicationComponent { 14 | 15 | //Application的Context 16 | Context getContext(); 17 | 18 | //对BaseApplication进行注入 19 | void injectBaseApplication(BaseApplication baseApplication); 20 | 21 | } 22 | -------------------------------------------------------------------------------- /yuannews/src/main/java/cn/edu/hpu/yuan/yuannews/news/labels/LabelsContancts.java: -------------------------------------------------------------------------------- 1 | package cn.edu.hpu.yuan.yuannews.news.labels; 2 | 3 | import java.util.List; 4 | 5 | /** 6 | * Created by yuan on 16-5-13. 7 | */ 8 | public interface LabelsContancts { 9 | 10 | interface LabelsContanctsPresenter{ 11 | void initgetTasteData(); 12 | void nextgetTasteData(); 13 | 14 | void userAddTaste(String label); 15 | } 16 | 17 | interface LabelsContanctsView{ 18 | void showDialog(); 19 | void showLabelsData(List tastes); 20 | void showErrorMsg(String msg); 21 | void addTasteSuccess(); 22 | } 23 | 24 | } 25 | -------------------------------------------------------------------------------- /yuancore/build.gradle: -------------------------------------------------------------------------------- 1 | apply plugin: 'com.android.library' 2 | 3 | android { 4 | compileSdkVersion 23 5 | buildToolsVersion "24.0.0 rc3" 6 | 7 | defaultConfig { 8 | minSdkVersion 14 9 | targetSdkVersion 23 10 | versionCode 1 11 | versionName "1.0" 12 | } 13 | buildTypes { 14 | release { 15 | minifyEnabled false 16 | proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro' 17 | } 18 | } 19 | } 20 | 21 | dependencies { 22 | compile fileTree(dir: 'libs', include: ['*.jar']) 23 | testCompile 'junit:junit:4.12' 24 | compile 'com.android.support:appcompat-v7:23.3.0' 25 | } 26 | -------------------------------------------------------------------------------- /yuancore/src/main/res/values/styles.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 13 | 14 | -------------------------------------------------------------------------------- /yuannews/src/main/res/layout/wlecome_activity.xml: -------------------------------------------------------------------------------- 1 | 2 | 7 | 8 | 12 | 13 | 19 | 20 | -------------------------------------------------------------------------------- /yuancore/proguard-rules.pro: -------------------------------------------------------------------------------- 1 | # Add project specific ProGuard rules here. 2 | # By default, the flags in this file are appended to flags specified 3 | # in /mnt/win/android-sdk-linux/tools/proguard/proguard-android.txt 4 | # You can edit the include path and order by changing the proguardFiles 5 | # directive in build.gradle. 6 | # 7 | # For more details, see 8 | # http://developer.android.com/guide/developing/tools/proguard.html 9 | 10 | # Add any project specific keep options here: 11 | 12 | # If your project uses WebView with JS, uncomment the following 13 | # and specify the fully qualified class name to the JavaScript interface 14 | # class: 15 | #-keepclassmembers class fqcn.of.javascript.interface.for.webview { 16 | # public *; 17 | #} 18 | -------------------------------------------------------------------------------- /yuannews/proguard-rules.pro: -------------------------------------------------------------------------------- 1 | # Add project specific ProGuard rules here. 2 | # By default, the flags in this file are appended to flags specified 3 | # in /mnt/win/android-sdk-linux/tools/proguard/proguard-android.txt 4 | # You can edit the include path and order by changing the proguardFiles 5 | # directive in build.gradle. 6 | # 7 | # For more details, see 8 | # http://developer.android.com/guide/developing/tools/proguard.html 9 | 10 | # Add any project specific keep options here: 11 | 12 | # If your project uses WebView with JS, uncomment the following 13 | # and specify the fully qualified class name to the JavaScript interface 14 | # class: 15 | #-keepclassmembers class fqcn.of.javascript.interface.for.webview { 16 | # public *; 17 | #} 18 | -------------------------------------------------------------------------------- /yuannews/src/main/java/cn/edu/hpu/yuan/yuannews/main/base/NorbalBackFragment.java: -------------------------------------------------------------------------------- 1 | package cn.edu.hpu.yuan.yuannews.main.base; 2 | 3 | import android.os.Bundle; 4 | import android.support.annotation.Nullable; 5 | import android.view.View; 6 | 7 | /** 8 | * Created by yuan on 16-5-11. 9 | */ 10 | public abstract class NorbalBackFragment extends BaseFragment{ 11 | 12 | @Override 13 | public void onViewCreated(View view, @Nullable Bundle savedInstanceState) { 14 | super.onViewCreated(view, savedInstanceState); 15 | initView(view,savedInstanceState); 16 | onloadData(); 17 | } 18 | 19 | protected void onloadData(){} 20 | 21 | protected abstract void initView(View view, Bundle savedInstanceState); 22 | } 23 | -------------------------------------------------------------------------------- /yuannews/src/main/java/cn/edu/hpu/yuan/yuannews/main/data/remote/NewsImageLoader.java: -------------------------------------------------------------------------------- 1 | package cn.edu.hpu.yuan.yuannews.main.data.remote; 2 | 3 | import android.content.Context; 4 | import android.widget.ImageView; 5 | 6 | import com.bumptech.glide.Glide; 7 | 8 | /** 9 | * Created by yuan on 16-5-11. 10 | * 图片加载类:使用Glide进行封装 11 | */ 12 | public class NewsImageLoader { 13 | 14 | 15 | public static void load(Context context, String url, ImageView imageView){ 16 | 17 | // Glide 18 | // .with(myFragment) 19 | // .load(url) 20 | // .centerCrop() 21 | // .placeholder(R.drawable.loading_spinner) 22 | // .crossFade() 23 | // .into(myImageView); 24 | 25 | } 26 | 27 | } 28 | -------------------------------------------------------------------------------- /yuannews/src/main/java/cn/edu/hpu/yuan/yuannews/news/tuijian/TuijianContancts.java: -------------------------------------------------------------------------------- 1 | package cn.edu.hpu.yuan.yuannews.news.tuijian; 2 | 3 | import java.util.ArrayList; 4 | import cn.edu.hpu.yuan.yuannews.main.data.model.news.NewsCustom; 5 | 6 | /** 7 | * Created by yuan on 16-5-13. 8 | */ 9 | public interface TuijianContancts { 10 | 11 | interface TuijianContanctsPresenter{ 12 | 13 | void initNewsListData(int type); 14 | 15 | void nextNewsListData(int type); 16 | 17 | } 18 | 19 | interface TuijianContanctsView{ 20 | 21 | void showDialog(); 22 | 23 | void showErrorMsg(String msg); 24 | 25 | void showNewsData(ArrayList newsCustoms); 26 | 27 | void showNoData(); 28 | 29 | } 30 | 31 | } 32 | -------------------------------------------------------------------------------- /yuannews/src/main/res/drawable-anydpi/ic_av_timer.xml: -------------------------------------------------------------------------------- 1 | 6 | 9 | 10 | -------------------------------------------------------------------------------- /yuannews/src/main/java/cn/edu/hpu/yuan/yuannews/main/data/NewsAPIMapUtil.java: -------------------------------------------------------------------------------- 1 | package cn.edu.hpu.yuan.yuannews.main.data; 2 | 3 | import java.util.HashMap; 4 | import java.util.Map; 5 | 6 | /** 7 | * Created by yuan on 16-5-9. 8 | * 请求参数封装为map 9 | */ 10 | public class NewsAPIMapUtil { 11 | 12 | private static final Integer PAGE_NUM=20; 13 | 14 | public static Map getNewsListMap(String title,Integer type,Integer p,Integer nType){ 15 | Map maps=new HashMap<>(); 16 | maps.put("type",String.valueOf(type)); 17 | maps.put("p",String.valueOf(p)); 18 | maps.put("nType",String.valueOf(nType)); 19 | maps.put("title",title); 20 | maps.put("num",PAGE_NUM+""); 21 | return maps; 22 | } 23 | 24 | } 25 | -------------------------------------------------------------------------------- /yuannews/src/main/java/cn/edu/hpu/yuan/yuannews/main/data/model/news/NewsVo.java: -------------------------------------------------------------------------------- 1 | package cn.edu.hpu.yuan.yuannews.main.data.model.news; 2 | 3 | 4 | import cn.edu.hpu.yuan.yuannews.main.data.model.base.News; 5 | 6 | /** 7 | * Created by yuan on 16-3-30. 8 | * 客户实体类 9 | */ 10 | public class NewsVo extends News { 11 | 12 | private Integer cid; 13 | private Integer sid; 14 | 15 | public Integer getCid() { 16 | return cid; 17 | } 18 | 19 | public void setCid(Integer cid) { 20 | this.cid = cid; 21 | } 22 | 23 | public Integer getSid() { 24 | return sid; 25 | } 26 | 27 | public void setSid(Integer sid) { 28 | this.sid = sid; 29 | } 30 | 31 | @Override 32 | public String toString() { 33 | return super.toString(); 34 | } 35 | } 36 | -------------------------------------------------------------------------------- /yuannews/src/main/java/cn/edu/hpu/yuan/yuannews/user/center/CenterContancts.java: -------------------------------------------------------------------------------- 1 | package cn.edu.hpu.yuan.yuannews.user.center; 2 | 3 | import java.util.List; 4 | 5 | import cn.edu.hpu.yuan.yuannews.main.data.model.basevo.TasteVo; 6 | import cn.edu.hpu.yuan.yuannews.main.data.model.basevo.UserVo; 7 | 8 | /** 9 | * Created by yuan on 16-5-12. 10 | */ 11 | public interface CenterContancts { 12 | 13 | interface CenterContanctsPresenter{ 14 | 15 | void getUserDetailData(); 16 | 17 | void getUserAllLabels(); 18 | 19 | } 20 | 21 | interface CenterContanctsView{ 22 | 23 | void showDialog(); 24 | 25 | void showError(String msg); 26 | 27 | void showUserDetail(UserVo userVo); 28 | 29 | void showAllLabels(List tasteVo); 30 | } 31 | 32 | } 33 | -------------------------------------------------------------------------------- /yuannews/src/main/java/cn/edu/hpu/yuan/yuannews/user/label/LabelContancts.java: -------------------------------------------------------------------------------- 1 | package cn.edu.hpu.yuan.yuannews.user.label; 2 | 3 | import java.util.List; 4 | 5 | import cn.edu.hpu.yuan.yuannews.main.data.model.basevo.TasteVo; 6 | 7 | /** 8 | * Created by yuan on 16-5-12. 9 | */ 10 | public interface LabelContancts { 11 | 12 | interface LabelContanctsPresenter{ 13 | 14 | void postDeleteLabel(Integer tid); 15 | 16 | void postAddLabel(String label); 17 | 18 | void postAllLabel(); 19 | 20 | } 21 | 22 | interface LabelContanctsView{ 23 | 24 | void showDialog(); 25 | 26 | void showMsg(String msg); 27 | 28 | void deleteSuccess(); 29 | 30 | void addSuccess(); 31 | 32 | void showAlldata(List tasteVos); 33 | 34 | } 35 | 36 | } 37 | -------------------------------------------------------------------------------- /yuannews/src/main/java/cn/edu/hpu/yuan/yuannews/main/data/model/basevo/NewsVo.java: -------------------------------------------------------------------------------- 1 | package cn.edu.hpu.yuan.yuannews.main.data.model.basevo; 2 | 3 | 4 | import cn.edu.hpu.yuan.yuannews.main.data.model.base.News; 5 | 6 | /** 7 | * Created by yuan on 16-3-30. 8 | * 客户实体类 9 | */ 10 | public class NewsVo extends News { 11 | 12 | private Integer cid; 13 | private Integer sid; 14 | 15 | public Integer getCid() { 16 | return cid; 17 | } 18 | 19 | public void setCid(Integer cid) { 20 | this.cid = cid; 21 | } 22 | 23 | public Integer getSid() { 24 | return sid; 25 | } 26 | 27 | public void setSid(Integer sid) { 28 | this.sid = sid; 29 | } 30 | 31 | @Override 32 | public String toString() { 33 | return super.toString(); 34 | } 35 | } 36 | -------------------------------------------------------------------------------- /yuannews/src/main/java/cn/edu/hpu/yuan/yuannews/main/data/model/news/TuijianModel.java: -------------------------------------------------------------------------------- 1 | package cn.edu.hpu.yuan.yuannews.main.data.model.news; 2 | 3 | 4 | /** 5 | * ================================================== 6 | *

7 | * 通知推荐的model , 显示数量和 第一条新的新闻 8 | *

9 | * ================================================== 10 | */ 11 | public class TuijianModel { 12 | 13 | private Integer count; 14 | 15 | private NewsCustom newsCustom; 16 | 17 | public Integer getCount() { 18 | return count; 19 | } 20 | 21 | public void setCount(Integer count) { 22 | this.count = count; 23 | } 24 | 25 | public NewsCustom getNewsCustom() { 26 | return newsCustom; 27 | } 28 | 29 | public void setNewsCustom(NewsCustom newsCustom) { 30 | this.newsCustom = newsCustom; 31 | } 32 | } 33 | -------------------------------------------------------------------------------- /yuannews/src/main/java/cn/edu/hpu/yuan/yuannews/news/comment/CommenContancts.java: -------------------------------------------------------------------------------- 1 | package cn.edu.hpu.yuan.yuannews.news.comment; 2 | 3 | import java.util.ArrayList; 4 | 5 | import cn.edu.hpu.yuan.yuannews.main.data.model.basevo.CommentJo; 6 | 7 | /** 8 | * Created by yuan on 16-5-13. 9 | */ 10 | public interface CommenContancts { 11 | 12 | interface CommenContanctsPresenter{ 13 | 14 | void initLoadCommentData(int nid); 15 | 16 | void nextLoadCommentData(int nid); 17 | 18 | //用户评论 19 | void userCommenData(String content,Integer nid); 20 | } 21 | 22 | interface CommenContanctsView{ 23 | void showDialog(); 24 | 25 | void showComentData(ArrayList comments); 26 | 27 | void showErrorMsg(String msg); 28 | 29 | void showSuccess(); 30 | } 31 | 32 | } 33 | -------------------------------------------------------------------------------- /yuannews/src/main/java/cn/edu/hpu/yuan/yuannews/user/login/LoginModule.java: -------------------------------------------------------------------------------- 1 | package cn.edu.hpu.yuan.yuannews.user.login; 2 | 3 | import dagger.Module; 4 | import dagger.Provides; 5 | 6 | /** 7 | * Created by yuan on 16-5-12. 8 | */ 9 | @Module 10 | public class LoginModule { 11 | 12 | 13 | protected LoginContract.LoginContractView loginContractView; 14 | 15 | public LoginModule() { 16 | } 17 | 18 | public LoginModule(LoginContract.LoginContractView loginContractView) { 19 | this.loginContractView = loginContractView; 20 | } 21 | 22 | @Provides 23 | LoginFragment provideLoginFragment(){ 24 | return new LoginFragment(); 25 | } 26 | 27 | @Provides 28 | LoginContract.LoginContractPresenter provideLoginContractPresenter(){ 29 | return new LoginPresenter(loginContractView); 30 | } 31 | 32 | } 33 | -------------------------------------------------------------------------------- /yuannews/src/main/java/cn/edu/hpu/yuan/yuannews/user/userIfo/UserIfoModule.java: -------------------------------------------------------------------------------- 1 | package cn.edu.hpu.yuan.yuannews.user.userIfo; 2 | 3 | import dagger.Module; 4 | import dagger.Provides; 5 | 6 | /** 7 | * Created by yuan on 16-5-12. 8 | */ 9 | @Module 10 | public class UserIfoModule { 11 | 12 | public UserIfoModule(){} 13 | 14 | protected UserIfoContrancts.UserIfoContranctsView userIfoContranctsView; 15 | 16 | public UserIfoModule(UserIfoContrancts.UserIfoContranctsView userIfoContranctsView) { 17 | this.userIfoContranctsView = userIfoContranctsView; 18 | } 19 | 20 | @Provides 21 | UserIfoFragment provideUserIfoFragment(){ 22 | return new UserIfoFragment(); 23 | } 24 | 25 | @Provides 26 | UserIfoContrancts.UserIfoContranctsPresenter provideUserContranctsPresenter(){ 27 | return new UserIfoPresenter(userIfoContranctsView); 28 | } 29 | 30 | } 31 | -------------------------------------------------------------------------------- /yuannews/src/main/java/cn/edu/hpu/yuan/yuannews/main/data/model/basevo/LikedVo.java: -------------------------------------------------------------------------------- 1 | package cn.edu.hpu.yuan.yuannews.main.data.model.basevo; 2 | 3 | import cn.edu.hpu.yuan.yuannews.main.data.model.base.Liked; 4 | 5 | /** 6 | * Created by yuan on 16-4-3. 7 | * 留言拓展类 8 | */ 9 | public class LikedVo extends Liked { 10 | 11 | private Integer uid; 12 | private String head; 13 | private String nick; 14 | 15 | public Integer getUid() { 16 | return uid; 17 | } 18 | 19 | public void setUid(Integer uid) { 20 | this.uid = uid; 21 | } 22 | 23 | public String getHead() { 24 | return head; 25 | } 26 | 27 | public void setHead(String head) { 28 | this.head = head; 29 | } 30 | 31 | public String getNick() { 32 | return nick; 33 | } 34 | 35 | public void setNick(String nick) { 36 | this.nick = nick; 37 | } 38 | } 39 | -------------------------------------------------------------------------------- /yuannews/src/main/java/cn/edu/hpu/yuan/yuannews/news/main/MainContract.java: -------------------------------------------------------------------------------- 1 | package cn.edu.hpu.yuan.yuannews.news.main; 2 | 3 | import android.support.v4.app.Fragment; 4 | 5 | import java.util.List; 6 | 7 | import cn.edu.hpu.yuan.yuannews.main.base.BasePresenter; 8 | import cn.edu.hpu.yuan.yuannews.main.base.BaseView; 9 | 10 | /** 11 | * Created by yuan on 16-5-10. 12 | * 包括Presenter和View接口 13 | */ 14 | public interface MainContract { 15 | 16 | 17 | interface MainPresenter extends BasePresenter{ 18 | 19 | void loadDataRequest(); 20 | } 21 | 22 | interface MainView extends BaseView{ 23 | 24 | void showLoadDialog(); //加载数据 25 | 26 | void showLoadData(List fragments,List titles);//返回数据到主界面 27 | 28 | void finishLoadDialog(); //停止加载 29 | 30 | void loadError(); 31 | 32 | void loadMsg(String msg); 33 | } 34 | 35 | } 36 | -------------------------------------------------------------------------------- /gradle.properties: -------------------------------------------------------------------------------- 1 | # Project-wide Gradle settings. 2 | 3 | # IDE (e.g. Android Studio) users: 4 | # Gradle settings configured through the IDE *will override* 5 | # any settings specified in this file. 6 | 7 | # For more details on how to configure your build environment visit 8 | # http://www.gradle.org/docs/current/userguide/build_environment.html 9 | 10 | # Specifies the JVM arguments used for the daemon process. 11 | # The setting is particularly useful for tweaking memory settings. 12 | # Default value: -Xmx10248m -XX:MaxPermSize=256m 13 | # org.gradle.jvmargs=-Xmx2048m -XX:MaxPermSize=512m -XX:+HeapDumpOnOutOfMemoryError -Dfile.encoding=UTF-8 14 | 15 | # When configured, Gradle will run in incubating parallel mode. 16 | # This option should only be used with decoupled projects. More details, visit 17 | # http://www.gradle.org/docs/current/userguide/multi_project_builds.html#sec:decoupled_projects 18 | # org.gradle.parallel=true -------------------------------------------------------------------------------- /yuannews/src/main/java/cn/edu/hpu/yuan/yuannews/user/register/RegisterModule.java: -------------------------------------------------------------------------------- 1 | package cn.edu.hpu.yuan.yuannews.user.register; 2 | 3 | import dagger.Module; 4 | import dagger.Provides; 5 | 6 | /** 7 | * Created by yuan on 16-5-12. 8 | */ 9 | 10 | @Module 11 | public class RegisterModule { 12 | 13 | 14 | protected RegisterContancts.RegisterCOntanctsView registerCOntanctsView; 15 | 16 | public RegisterModule(RegisterContancts.RegisterCOntanctsView registerCOntanctsView) { 17 | this.registerCOntanctsView = registerCOntanctsView; 18 | } 19 | 20 | public RegisterModule() { 21 | } 22 | 23 | @Provides 24 | RegisterFragment provideRegisterFragment(){ 25 | return new RegisterFragment(); 26 | } 27 | 28 | @Provides 29 | RegisterContancts.RegisterContanctsPresenter provideRegsiterPresenter(){ 30 | return new RegisterPresenter(registerCOntanctsView); 31 | } 32 | 33 | 34 | 35 | } 36 | -------------------------------------------------------------------------------- /yuannews/src/main/java/cn/edu/hpu/yuan/yuannews/main/data/model/basevo/TasteVo.java: -------------------------------------------------------------------------------- 1 | package cn.edu.hpu.yuan.yuannews.main.data.model.basevo; 2 | 3 | 4 | 5 | import cn.edu.hpu.yuan.yuannews.main.data.model.base.Taste; 6 | 7 | /** 8 | * Created by yuan on 16-4-1. 9 | * 兴趣拓展类 10 | */ 11 | public class TasteVo extends Taste { 12 | 13 | private Integer uid; 14 | private String nick; 15 | 16 | public Integer getUid() { 17 | return uid; 18 | } 19 | 20 | public void setUid(Integer uid) { 21 | this.uid = uid; 22 | } 23 | 24 | public String getNick() { 25 | return nick; 26 | } 27 | 28 | public void setNick(String nick) { 29 | this.nick = nick; 30 | } 31 | 32 | @Override 33 | public String toString() { 34 | return super.toString()+"TasteVo{" + 35 | "uid=" + uid + 36 | ", nick='" + nick + '\'' + 37 | '}'; 38 | } 39 | } 40 | -------------------------------------------------------------------------------- /yuannews/src/main/java/cn/edu/hpu/yuan/yuannews/news/other/AboutFragment.java: -------------------------------------------------------------------------------- 1 | package cn.edu.hpu.yuan.yuannews.news.other; 2 | 3 | import android.os.Bundle; 4 | import android.support.annotation.Nullable; 5 | import android.view.LayoutInflater; 6 | import android.view.View; 7 | import android.view.ViewGroup; 8 | 9 | import cn.edu.hpu.yuan.yuannews.R; 10 | import cn.edu.hpu.yuan.yuannews.main.base.NorbalBackFragment; 11 | 12 | /** 13 | * Created by yuan on 16-5-13. 14 | */ 15 | public class AboutFragment extends NorbalBackFragment{ 16 | 17 | @Nullable 18 | @Override 19 | public View onCreateView(LayoutInflater inflater, @Nullable ViewGroup container, @Nullable Bundle savedInstanceState) { 20 | return inflater.inflate(R.layout.about_activity,container,false); 21 | } 22 | 23 | @Override 24 | protected void initView(View view, Bundle savedInstanceState) { 25 | 26 | } 27 | 28 | @Override 29 | protected void initComponent() { 30 | 31 | } 32 | } 33 | -------------------------------------------------------------------------------- /yuannews/src/main/java/cn/edu/hpu/yuan/yuannews/user/userIfo/UserIfoFragment.java: -------------------------------------------------------------------------------- 1 | package cn.edu.hpu.yuan.yuannews.user.userIfo; 2 | 3 | import android.os.Bundle; 4 | import android.view.View; 5 | 6 | import cn.edu.hpu.yuan.yuannews.main.base.NorbalBackFragment; 7 | 8 | /** 9 | * Created by yuan on 16-5-12. 10 | */ 11 | public class UserIfoFragment extends NorbalBackFragment implements UserIfoContrancts.UserIfoContranctsView{ 12 | 13 | 14 | @Override 15 | protected void initView(View view, Bundle savedInstanceState) { 16 | 17 | } 18 | 19 | @Override 20 | protected void initComponent() { 21 | 22 | DaggerUserifoComponent 23 | .builder() 24 | .userIfoModule(new UserIfoModule(this)) 25 | .build() 26 | .injectUserIfoFragment(this); 27 | 28 | } 29 | 30 | @Override 31 | public void showDialog() { 32 | 33 | } 34 | 35 | @Override 36 | public void showMsg(String msg) { 37 | 38 | } 39 | } 40 | -------------------------------------------------------------------------------- /yuannews/src/main/java/cn/edu/hpu/yuan/yuannews/main/base/NormalBackActivity.java: -------------------------------------------------------------------------------- 1 | package cn.edu.hpu.yuan.yuannews.main.base; 2 | 3 | import android.support.design.widget.FloatingActionButton; 4 | import android.support.v7.widget.Toolbar; 5 | import android.view.View; 6 | 7 | import cn.edu.hpu.yuan.yuannews.R; 8 | 9 | /** 10 | * Created by yuan on 16-5-11. 11 | */ 12 | public abstract class NormalBackActivity extends BaseActivity{ 13 | 14 | 15 | @Override 16 | protected void initToolbar(Toolbar toolbar, FloatingActionButton floatingActionButton) { 17 | super.initToolbar(toolbar,floatingActionButton); 18 | floatingActionButton.setVisibility(View.GONE); 19 | toolbar.setNavigationIcon(R.drawable.ic_action_arrow_left); 20 | toolbar.setTitle("新闻详情"); 21 | toolbar.setNavigationOnClickListener(new View.OnClickListener() { 22 | @Override 23 | public void onClick(View v) { 24 | onBackPressed(); 25 | } 26 | }); 27 | } 28 | } 29 | -------------------------------------------------------------------------------- /yuannews/src/main/java/cn/edu/hpu/yuan/yuannews/user/userIfo/UserIfoPresenter.java: -------------------------------------------------------------------------------- 1 | package cn.edu.hpu.yuan.yuannews.user.userIfo; 2 | 3 | import cn.edu.hpu.yuan.yuannews.main.app.BaseApplication; 4 | 5 | /** 6 | * Created by yuan on 16-5-12. 7 | */ 8 | public class UserIfoPresenter implements UserIfoContrancts.UserIfoContranctsPresenter{ 9 | 10 | private int uid; 11 | private UserIfoContrancts.UserIfoContranctsView userIfoContranctsView; 12 | public UserIfoPresenter(UserIfoContrancts.UserIfoContranctsView userIfoContranctsView) { 13 | this.userIfoContranctsView = userIfoContranctsView; 14 | uid= BaseApplication.newsAPIShared.getSharedUserID(); 15 | } 16 | 17 | @Override 18 | public void postUpdateUserNick(String nick) { 19 | 20 | } 21 | 22 | @Override 23 | public void postUpdateUserSex(Integer sex) { 24 | 25 | } 26 | 27 | @Override 28 | public void postUpdateUserPass(String pass) { 29 | 30 | } 31 | 32 | @Override 33 | public void postUpdateUserHead() { 34 | 35 | } 36 | } 37 | -------------------------------------------------------------------------------- /yuannews/src/main/res/layout/main_fragment.xml: -------------------------------------------------------------------------------- 1 | 2 | 8 | 9 | 17 | 18 | 23 | 24 | 25 | 26 | 27 | -------------------------------------------------------------------------------- /yuannews/src/main/java/cn/edu/hpu/yuan/yuannews/news/newslist/NewsContract.java: -------------------------------------------------------------------------------- 1 | package cn.edu.hpu.yuan.yuannews.news.newslist; 2 | 3 | import java.util.ArrayList; 4 | 5 | import cn.edu.hpu.yuan.yuannews.main.base.BasePresenter; 6 | import cn.edu.hpu.yuan.yuannews.main.base.BaseView; 7 | import cn.edu.hpu.yuan.yuannews.main.data.model.news.NewsCustom; 8 | 9 | /** 10 | * Created by yuan on 16-5-9. 11 | * 新闻列表类 12 | * 1.Presenter接口 13 | * 2.View接口 14 | */ 15 | public interface NewsContract { 16 | 17 | interface Presenter extends BasePresenter { 18 | 19 | //初始化 20 | void initNewsListData(String title,int type,int nType); 21 | 22 | //下一页 23 | void nextNewsListData(String title,int type,int nType); 24 | 25 | } 26 | 27 | interface View extends BaseView { 28 | 29 | void showDialog(); 30 | 31 | void showNewsList(ArrayList newsCustoms); 32 | 33 | void showInitNewsList(); //第一页 34 | 35 | void dismssDiolog(); 36 | 37 | void showNotData();//完成 38 | 39 | void showSnackBar(String msg); 40 | } 41 | 42 | } 43 | -------------------------------------------------------------------------------- /yuannews/src/main/java/cn/edu/hpu/yuan/yuannews/main/data/model/DataBean.java: -------------------------------------------------------------------------------- 1 | package cn.edu.hpu.yuan.yuannews.main.data.model; 2 | 3 | /** 4 | * ================================================== 5 | *

6 | * 版权: 软件工程.net12-1 原明卓 7 | *

8 | * 项目: 基于用户兴趣标签的新闻推荐系统 9 | *

10 | * 作者: 原明卓 11 | *

12 | * 版本: 1.0 13 | *

14 | * 创建日期: 16-5-5 下午3:45 15 | *

16 | * 功能描述: 数据封装bean:返回有状态码,响应信息,和数据的bean 17 | *

18 | *

19 | * 功能更新历史: 20 | *

21 | * ================================================== 22 | */ 23 | public class DataBean { 24 | 25 | private int code; 26 | private String msg="成功"; 27 | private T data; 28 | 29 | public int getCode() { 30 | return code; 31 | } 32 | 33 | public void setCode(int code) { 34 | this.code = code; 35 | } 36 | 37 | public String getMsg() { 38 | return msg; 39 | } 40 | 41 | public void setMsg(String msg) { 42 | this.msg = msg; 43 | } 44 | 45 | public T getData() { 46 | return data; 47 | } 48 | 49 | public void setData(T data) { 50 | this.data = data; 51 | } 52 | 53 | } 54 | -------------------------------------------------------------------------------- /yuannews/src/main/java/cn/edu/hpu/yuan/yuannews/news/newsdetail/NewsDetailContancts.java: -------------------------------------------------------------------------------- 1 | package cn.edu.hpu.yuan.yuannews.news.newsdetail; 2 | 3 | import java.util.List; 4 | 5 | import cn.edu.hpu.yuan.yuannews.main.data.model.basevo.LikedVo; 6 | import cn.edu.hpu.yuan.yuannews.main.data.model.news.NewsCustom; 7 | 8 | /** 9 | * Created by yuan on 16-5-11. 10 | * Presenter 11 | */ 12 | public interface NewsDetailContancts { 13 | 14 | 15 | interface NewsDetailPresenter{ 16 | 17 | void getNewsDetailData(int nid); 18 | 19 | void updateNewsZan(int nid,int status); 20 | 21 | void getNewsZansHeadData(int nid); 22 | 23 | void getNewsZanStatus(int nid); 24 | } 25 | 26 | interface NewsDetailView{ 27 | 28 | void showDialog(); 29 | 30 | void getNewsDetail(NewsCustom newsCustom); 31 | 32 | void loadError(); 33 | 34 | void dimssDialog(); 35 | 36 | void updateZanSuccess(); 37 | 38 | void updateZanError(); 39 | 40 | void getZansHead(List likedVos); 41 | 42 | void getZansHeadError(); 43 | 44 | void getZanStatus(int status); 45 | } 46 | 47 | } 48 | -------------------------------------------------------------------------------- /yuannews/src/main/res/menu/drawer.xml: -------------------------------------------------------------------------------- 1 | 2 |

5 | 6 | 10 | 14 | 18 | 19 | 23 | 24 | 28 | 29 | 30 | -------------------------------------------------------------------------------- /yuannews/src/main/java/cn/edu/hpu/yuan/yuannews/news/other/AboutActivity.java: -------------------------------------------------------------------------------- 1 | package cn.edu.hpu.yuan.yuannews.news.other; 2 | 3 | import android.support.v7.widget.Toolbar; 4 | import android.view.View; 5 | 6 | import cn.edu.hpu.yuan.yuannews.R; 7 | import cn.edu.hpu.yuan.yuannews.main.base.BaseFragment; 8 | import cn.edu.hpu.yuan.yuannews.main.base.NormalBaseActivity; 9 | 10 | /** 11 | * Created by yuan on 16-5-13. 12 | */ 13 | public class AboutActivity extends NormalBaseActivity{ 14 | 15 | @Override 16 | protected void initView() { 17 | } 18 | 19 | @Override 20 | protected void setComponet() { 21 | 22 | } 23 | 24 | @Override 25 | protected void initToolbar(Toolbar toolbar) { 26 | setTitle("关于"); 27 | toolbar.setNavigationIcon(R.drawable.ic_action_arrow_left); 28 | toolbar.setNavigationOnClickListener(new View.OnClickListener() { 29 | @Override 30 | public void onClick(View v) { 31 | onBackPressed(); 32 | } 33 | }); 34 | } 35 | 36 | @Override 37 | protected BaseFragment initFragment() { 38 | return new AboutFragment(); 39 | } 40 | } 41 | -------------------------------------------------------------------------------- /yuannews/src/main/java/cn/edu/hpu/yuan/yuannews/user/label/LabelModule.java: -------------------------------------------------------------------------------- 1 | package cn.edu.hpu.yuan.yuannews.user.label; 2 | 3 | import android.content.Context; 4 | 5 | import cn.edu.hpu.yuan.yuannews.user.label.adapter.LabelIfoAdapter; 6 | import dagger.Module; 7 | import dagger.Provides; 8 | 9 | /** 10 | * Created by yuan on 16-5-12. 11 | */ 12 | @Module 13 | public class LabelModule { 14 | 15 | public LabelModule(){} 16 | 17 | LabelContancts.LabelContanctsView labelContanctsView; 18 | private Context context; 19 | 20 | public LabelModule(LabelContancts.LabelContanctsView labelContanctsView, Context context) { 21 | this.labelContanctsView = labelContanctsView; 22 | this.context=context; 23 | } 24 | 25 | @Provides 26 | LabelFragment provideLabelFragment(){ 27 | return new LabelFragment(); 28 | } 29 | 30 | 31 | @Provides 32 | LabelContancts.LabelContanctsPresenter provideLabelContractsPresenter(){ 33 | return new LabelPresenter(labelContanctsView); 34 | } 35 | 36 | @Provides 37 | LabelIfoAdapter provideLabelIfoAdapter(){ 38 | return new LabelIfoAdapter(context); 39 | } 40 | 41 | } 42 | -------------------------------------------------------------------------------- /yuannews/src/main/java/cn/edu/hpu/yuan/yuannews/main/app/ApplicationModule.java: -------------------------------------------------------------------------------- 1 | package cn.edu.hpu.yuan.yuannews.main.app; 2 | 3 | 4 | 5 | import android.content.Context; 6 | 7 | import javax.inject.Singleton; 8 | 9 | import cn.edu.hpu.yuan.yuancore.util.CrashHandler; 10 | import cn.edu.hpu.yuan.yuannews.main.util.NotificationUtil; 11 | import dagger.Module; 12 | import dagger.Provides; 13 | 14 | /** 15 | * Created by yuan on 16-5-9. 16 | * 为BaseApplication提供实例 17 | * 1.提供Application的Context 18 | * 2.提供CrashHandler类 19 | * 3.等等 数据API等 20 | * 4.提供通知util 工具类 21 | */ 22 | 23 | @Module 24 | public class ApplicationModule { 25 | 26 | protected Context context; 27 | 28 | public ApplicationModule(Context context) { 29 | this.context = context; 30 | } 31 | 32 | @Provides @Singleton 33 | public Context provideContext(){ 34 | return context; 35 | } 36 | 37 | @Provides @Singleton 38 | public CrashHandler provideCrashHandler(){ 39 | return CrashHandler.getInstance(); 40 | } 41 | 42 | @Provides @Singleton 43 | public NotificationUtil provideNotification(){ 44 | return NotificationUtil.newInstance(context); 45 | } 46 | 47 | 48 | 49 | //等等 50 | 51 | } 52 | -------------------------------------------------------------------------------- /yuannews/src/main/java/cn/edu/hpu/yuan/yuannews/main/data/model/news/CSCustom.java: -------------------------------------------------------------------------------- 1 | package cn.edu.hpu.yuan.yuannews.main.data.model.news; 2 | 3 | 4 | import java.util.List; 5 | 6 | import cn.edu.hpu.yuan.yuannews.main.data.model.basevo.CateVo; 7 | import cn.edu.hpu.yuan.yuannews.main.data.model.basevo.SourceVo; 8 | 9 | /** 10 | * ================================================== 11 | *

12 | * 版权: 软件工程.net12-1 原明卓 13 | *

14 | * 项目: 基于用户兴趣标签的新闻推荐系统 15 | *

16 | * 作者: 原明卓 17 | *

18 | * 版本: 1.0 19 | *

20 | * 创建日期: 16-4-25 下午5:20 21 | *

22 | * 功能描述:分类信息和来源信息,用来显示菜单使用 23 | *

24 | *

25 | * 功能更新历史: 26 | *

27 | * ================================================== 28 | */ 29 | public class CSCustom { 30 | 31 | private List cateVos; 32 | private List sourceVos; 33 | 34 | public List getCateVos() { 35 | return cateVos; 36 | } 37 | 38 | public void setCateVos(List cateVos) { 39 | this.cateVos = cateVos; 40 | } 41 | 42 | public List getSourceVos() { 43 | return sourceVos; 44 | } 45 | 46 | public void setSourceVos(List sourceVos) { 47 | this.sourceVos = sourceVos; 48 | } 49 | } 50 | -------------------------------------------------------------------------------- /yuannews/src/main/java/cn/edu/hpu/yuan/yuannews/main/data/model/basevo/CommentJo.java: -------------------------------------------------------------------------------- 1 | package cn.edu.hpu.yuan.yuannews.main.data.model.basevo; 2 | import cn.edu.hpu.yuan.yuannews.main.data.model.base.Comment; 3 | 4 | /** 5 | * ================================================== 6 | *

7 | * 版权: 软件工程.net12-1 原明卓 8 | *

9 | * 项目: 基于用户兴趣标签的新闻推荐系统 10 | *

11 | * 作者: 原明卓 12 | *

13 | * 版本: 1.0 14 | *

15 | * 创建日期: 16-5-2 下午8:40 16 | *

17 | * 功能描述:用户端新闻评论的实体对象 18 | *

19 | *

20 | * 功能更新历史: 21 | *

22 | * ================================================== 23 | */ 24 | public class CommentJo extends Comment { 25 | 26 | private Integer uid; 27 | private String nick;//昵称 28 | private String head;//头像 29 | 30 | public Integer getUid() { 31 | return uid; 32 | } 33 | 34 | public void setUid(Integer uid) { 35 | this.uid = uid; 36 | } 37 | 38 | public String getNick() { 39 | return nick; 40 | } 41 | 42 | public void setNick(String nick) { 43 | this.nick = nick; 44 | } 45 | 46 | public String getHead() { 47 | return head; 48 | } 49 | 50 | public void setHead(String head) { 51 | this.head = head; 52 | } 53 | } 54 | -------------------------------------------------------------------------------- /yuannews/src/main/java/cn/edu/hpu/yuan/yuannews/news/comment/CommentModule.java: -------------------------------------------------------------------------------- 1 | package cn.edu.hpu.yuan.yuannews.news.comment; 2 | 3 | import android.content.Context; 4 | 5 | import cn.edu.hpu.yuan.yuannews.news.comment.adapter.CommentRecyclerAdapter; 6 | import dagger.Module; 7 | import dagger.Provides; 8 | 9 | /** 10 | * Created by yuan on 16-5-13. 11 | */ 12 | 13 | @Module 14 | public class CommentModule { 15 | 16 | 17 | public CommentModule(){} 18 | 19 | private CommenContancts.CommenContanctsView commenContanctsView; 20 | private Context context; 21 | 22 | public CommentModule(CommenContancts.CommenContanctsView commenContanctsView,Context context) { 23 | this.commenContanctsView = commenContanctsView; 24 | this.context=context; 25 | } 26 | 27 | 28 | @Provides 29 | CommentFragment provideCommentFragment(){ 30 | return new CommentFragment(); 31 | } 32 | 33 | @Provides 34 | CommenContancts.CommenContanctsPresenter provideCommenContanctsPresenter(){ 35 | return new CommemPresenter(commenContanctsView); 36 | } 37 | 38 | @Provides 39 | CommentRecyclerAdapter provideCommentRecyclerAdapter(){ 40 | return new CommentRecyclerAdapter(context); 41 | } 42 | 43 | } 44 | -------------------------------------------------------------------------------- /yuannews/src/main/res/values/styles.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 15 | 16 | 19 | 25 | 26 | 27 | 28 | -------------------------------------------------------------------------------- /yuannews/src/main/java/cn/edu/hpu/yuan/yuannews/news/tuijian/TuijianModule.java: -------------------------------------------------------------------------------- 1 | package cn.edu.hpu.yuan.yuannews.news.tuijian; 2 | 3 | import android.content.Context; 4 | 5 | import cn.edu.hpu.yuan.yuannews.news.newslist.adapter.CustomRecyclerViewAdapter; 6 | import dagger.Module; 7 | import dagger.Provides; 8 | 9 | /** 10 | * Created by yuan on 16-5-13. 11 | */ 12 | @Module 13 | public class TuijianModule { 14 | 15 | 16 | public TuijianModule(){} 17 | 18 | private TuijianContancts.TuijianContanctsView tuijianContanctsView; 19 | private Context context; 20 | 21 | public TuijianModule(TuijianContancts.TuijianContanctsView tuijianContanctsView,Context context) { 22 | this.context=context; 23 | this.tuijianContanctsView = tuijianContanctsView; 24 | } 25 | 26 | @Provides 27 | TuijianFragment provideTuijianFragment(){ 28 | return new TuijianFragment(); 29 | } 30 | 31 | @Provides 32 | TuijianContancts.TuijianContanctsPresenter provideTuijianContanctsPresenter(){ 33 | return new TuijianPresenter(tuijianContanctsView); 34 | } 35 | 36 | @Provides 37 | CustomRecyclerViewAdapter provideCustomRecyclerViewAdapter(){ 38 | return new CustomRecyclerViewAdapter(context); 39 | } 40 | 41 | } 42 | -------------------------------------------------------------------------------- /yuannews/src/main/java/cn/edu/hpu/yuan/yuannews/news/labels/LabelsModule.java: -------------------------------------------------------------------------------- 1 | package cn.edu.hpu.yuan.yuannews.news.labels; 2 | 3 | import android.content.Context; 4 | 5 | import cn.edu.hpu.yuan.yuannews.news.labels.adapter.LabelsAdapter; 6 | import cn.edu.hpu.yuan.yuannews.user.label.adapter.LabelIfoAdapter; 7 | import dagger.Module; 8 | import dagger.Provides; 9 | 10 | /** 11 | * Created by yuan on 16-5-13. 12 | */ 13 | @Module 14 | public class LabelsModule { 15 | 16 | 17 | public LabelsModule(){} 18 | 19 | private LabelsContancts.LabelsContanctsView labelsContanctsView; 20 | private Context context; 21 | 22 | public LabelsModule(LabelsContancts.LabelsContanctsView labelsContanctsView, Context context) { 23 | this.labelsContanctsView = labelsContanctsView; 24 | this.context=context; 25 | } 26 | 27 | @Provides 28 | LabelsFragment provideLabelsFragment(){ 29 | return new LabelsFragment(); 30 | } 31 | 32 | @Provides 33 | LabelsContancts.LabelsContanctsPresenter provideLabelsContanctsPresenter(){ 34 | return new LabelsPresenter(labelsContanctsView); 35 | } 36 | 37 | @Provides 38 | LabelsAdapter provideLabelsIfoAdapter(){ 39 | return new LabelsAdapter(context); 40 | } 41 | 42 | } 43 | -------------------------------------------------------------------------------- /yuannews/src/main/res/values-v21/styles.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 16 | 17 | 23 | 24 | -------------------------------------------------------------------------------- /yuancore/src/main/java/cn/edu/hpu/yuan/yuancore/util/DisplayUtil.java: -------------------------------------------------------------------------------- 1 | package cn.edu.hpu.yuan.yuancore.util; 2 | 3 | import android.content.Context; 4 | import android.graphics.Point; 5 | import android.view.WindowManager; 6 | 7 | /** 8 | * 作者 : andy 9 | * 日期 : 15/11/8 20:42 10 | * 邮箱 : andyxialm@gmail.com 11 | * 描述 : 换算工具类 12 | */ 13 | public class DisplayUtil { 14 | 15 | /** 16 | * 根据分辨率从 dp 的单位 转成为 px(像素) 17 | */ 18 | public static int dp2px(Context context, float dpValue) { 19 | final float scale = context.getResources().getDisplayMetrics().density; 20 | return (int) (dpValue * scale + 0.5f); 21 | } 22 | 23 | /** 24 | * 根据分辨率从 px(像素) 的单位 转成为 dp 25 | */ 26 | public static int px2dp(Context context, float pxValue) { 27 | final float scale = context.getResources().getDisplayMetrics().density; 28 | return (int) (pxValue / scale + 0.5f); 29 | } 30 | 31 | /** 32 | * 获得屏幕尺寸 33 | * @param context 34 | * @return 35 | */ 36 | public static Point getScreenSize(Context context) { 37 | Point point = new Point(); 38 | WindowManager wm = (WindowManager) context.getSystemService(Context.WINDOW_SERVICE); 39 | wm.getDefaultDisplay().getSize(point); 40 | return point; 41 | } 42 | } -------------------------------------------------------------------------------- /yuannews/src/main/java/cn/edu/hpu/yuan/yuannews/news/newslist/NewsActivity.java: -------------------------------------------------------------------------------- 1 | package cn.edu.hpu.yuan.yuannews.news.newslist; 2 | 3 | import android.content.Context; 4 | import android.os.Bundle; 5 | import android.support.v7.widget.Toolbar; 6 | import android.view.View; 7 | 8 | import javax.inject.Inject; 9 | 10 | import cn.edu.hpu.yuan.yuannews.main.base.BaseActivity; 11 | import cn.edu.hpu.yuan.yuannews.main.base.BaseFragment; 12 | 13 | 14 | /** 15 | * Created by yuan on 16-5-9. 16 | * 新闻列表Activity 17 | */ 18 | public class NewsActivity extends BaseActivity { 19 | 20 | 21 | 22 | @Inject 23 | protected NewsFragment fragment; 24 | 25 | @Override 26 | protected void initView(Bundle savedInstanceState,Toolbar toolbar) { 27 | toolbar.setVisibility(View.GONE); 28 | } 29 | 30 | @Override 31 | protected BaseFragment initFragment() { 32 | return new NewsFragment(); 33 | } 34 | 35 | @Override 36 | protected void setComponent() { 37 | 38 | DaggerNewsComponent.builder() 39 | .newsModule(new NewsModule()) 40 | .build() 41 | .injectNewsActivity(this); 42 | } 43 | 44 | @Override 45 | protected Context getChildContext() { 46 | return NewsActivity.this; 47 | } 48 | } 49 | -------------------------------------------------------------------------------- /yuannews/src/main/java/cn/edu/hpu/yuan/yuannews/news/other/WelcomeActivity.java: -------------------------------------------------------------------------------- 1 | package cn.edu.hpu.yuan.yuannews.news.other; 2 | 3 | import android.content.Intent; 4 | import android.os.Bundle; 5 | import android.os.Handler; 6 | import android.support.v7.app.AppCompatActivity; 7 | import android.view.Window; 8 | import android.view.WindowManager; 9 | 10 | import cn.edu.hpu.yuan.yuannews.R; 11 | import cn.edu.hpu.yuan.yuannews.news.main.MainActivity; 12 | 13 | /** 14 | * Created by yuan on 16-5-13. 15 | * 欢迎页面 16 | */ 17 | public class WelcomeActivity extends AppCompatActivity{ 18 | 19 | 20 | Handler handler= new Handler(); 21 | 22 | @Override 23 | public void onCreate(Bundle savedInstanceState) { 24 | super.onCreate(savedInstanceState); 25 | this.requestWindowFeature(Window.FEATURE_NO_TITLE);//去掉标题栏 26 | this.getWindow().setFlags(WindowManager.LayoutParams.FLAG_FULLSCREEN, WindowManager.LayoutParams.FLAG_FULLSCREEN);//去掉信息栏 27 | setContentView(R.layout.wlecome_activity); 28 | handler.postDelayed(new Runnable() { 29 | @Override 30 | public void run() { 31 | startActivity(new Intent(WelcomeActivity.this, MainActivity.class)); 32 | finish(); 33 | } 34 | },3000); 35 | } 36 | 37 | } 38 | -------------------------------------------------------------------------------- /yuannews/src/main/res/layout/normal_base_main.xml: -------------------------------------------------------------------------------- 1 | 2 | 8 | 9 | 12 | 13 | 22 | 23 | 24 | 29 | 30 | -------------------------------------------------------------------------------- /yuannews/src/main/res/layout/navigation_header.xml: -------------------------------------------------------------------------------- 1 | 2 | 11 | 12 | 20 | 21 | 31 | 32 | -------------------------------------------------------------------------------- /yuannews/src/main/java/cn/edu/hpu/yuan/yuannews/main/data/model/base/Liked.java: -------------------------------------------------------------------------------- 1 | package cn.edu.hpu.yuan.yuannews.main.data.model.base; 2 | 3 | 4 | /** 5 | * Created by yuan on 16-4-3. 6 | */ 7 | public class Liked { 8 | private int id; 9 | private int status; 10 | 11 | public int getId() { 12 | return id; 13 | } 14 | 15 | public void setId(int id) { 16 | this.id = id; 17 | } 18 | 19 | public int getStatus() { 20 | return status; 21 | } 22 | 23 | public void setStatus(int status) { 24 | this.status = status; 25 | } 26 | 27 | @Override 28 | public boolean equals(Object o) { 29 | if (this == o) return true; 30 | if (o == null || getClass() != o.getClass()) return false; 31 | 32 | Liked liked = (Liked) o; 33 | 34 | if (id != liked.id) return false; 35 | if (status != liked.status) return false; 36 | 37 | return true; 38 | } 39 | 40 | @Override 41 | public int hashCode() { 42 | int result = id; 43 | result = 31 * result + status; 44 | return result; 45 | } 46 | 47 | @Override 48 | public String toString() { 49 | return "Liked{" + 50 | "id=" + id + 51 | ", status=" + status + 52 | '}'; 53 | } 54 | } 55 | -------------------------------------------------------------------------------- /yuannews/src/main/java/cn/edu/hpu/yuan/yuannews/user/center/CenterModule.java: -------------------------------------------------------------------------------- 1 | package cn.edu.hpu.yuan.yuannews.user.center; 2 | 3 | import android.view.ViewGroup; 4 | import android.widget.LinearLayout; 5 | 6 | import dagger.Module; 7 | import dagger.Provides; 8 | import retrofit2.http.POST; 9 | 10 | /** 11 | * Created by yuan on 16-5-12. 12 | */ 13 | @Module 14 | public class CenterModule { 15 | 16 | 17 | public CenterModule(){} 18 | 19 | private CenterContancts.CenterContanctsView centerContanctsView; 20 | 21 | public CenterModule(CenterContancts.CenterContanctsView centerContanctsView) { 22 | this.centerContanctsView = centerContanctsView; 23 | } 24 | 25 | 26 | @Provides 27 | CenterFragment provideCenterFragment(){ 28 | return new CenterFragment(); 29 | } 30 | 31 | 32 | @Provides 33 | CenterContancts.CenterContanctsPresenter provideCenterPersenter(){ 34 | return new CenterPersenter(centerContanctsView); 35 | } 36 | 37 | @Provides 38 | ViewGroup.MarginLayoutParams provideLayoutParams(){ 39 | ViewGroup.MarginLayoutParams layoutParams = new LinearLayout.LayoutParams(LinearLayout.LayoutParams.WRAP_CONTENT, LinearLayout.LayoutParams.WRAP_CONTENT); 40 | layoutParams.setMargins(10,10,0,0); 41 | return layoutParams; 42 | } 43 | 44 | } 45 | -------------------------------------------------------------------------------- /yuannews/src/main/java/cn/edu/hpu/yuan/yuannews/news/newsdetail/NewsDetailModule.java: -------------------------------------------------------------------------------- 1 | package cn.edu.hpu.yuan.yuannews.news.newsdetail; 2 | 3 | import android.content.Context; 4 | 5 | import cn.edu.hpu.yuan.yuannews.news.newsdetail.adapter.NewsDetailGridViewAdapter; 6 | import dagger.Module; 7 | import dagger.Provides; 8 | 9 | /** 10 | * Created by yuan on 16-5-11. 11 | * 提供类:activity和fragment 12 | */ 13 | 14 | @Module 15 | public class NewsDetailModule { 16 | 17 | 18 | 19 | private NewsDetailContancts.NewsDetailView newsDetailView; 20 | private Context context; 21 | 22 | 23 | public NewsDetailModule() { 24 | 25 | } 26 | 27 | public NewsDetailModule(NewsDetailContancts.NewsDetailView newsDetailView,Context context) { 28 | this.newsDetailView = newsDetailView; 29 | this.context=context; 30 | } 31 | 32 | @Provides 33 | NewsDetailFragment provideNewsDetaulFragment(){ 34 | return NewsDetailFragment.getInstance(); 35 | } 36 | 37 | 38 | @Provides 39 | NewsDetailContancts.NewsDetailPresenter provideNewsDetailPresenter(){ 40 | return new NewsDetailPresenter(newsDetailView); 41 | } 42 | 43 | @Provides 44 | NewsDetailGridViewAdapter provideNewsDetailGridViewAdapter(){ 45 | return new NewsDetailGridViewAdapter(context); 46 | } 47 | 48 | } 49 | -------------------------------------------------------------------------------- /yuannews/src/main/res/layout/labels_fragment.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 7 | 8 | 13 | 14 | 19 | 20 | 21 | 22 | 31 | 32 | 33 | 34 | 35 | 36 | -------------------------------------------------------------------------------- /yuannews/src/main/java/cn/edu/hpu/yuan/yuannews/main/data/model/base/Cate.java: -------------------------------------------------------------------------------- 1 | package cn.edu.hpu.yuan.yuannews.main.data.model.base; 2 | 3 | /** 4 | * Created by yuan on 16-4-1. 5 | */ 6 | public class Cate { 7 | private int id; 8 | private String content; 9 | 10 | public int getId() { 11 | return id; 12 | } 13 | 14 | public void setId(int id) { 15 | this.id = id; 16 | } 17 | 18 | 19 | public String getContent() { 20 | return content; 21 | } 22 | 23 | public void setContent(String content) { 24 | this.content = content; 25 | } 26 | 27 | @Override 28 | public boolean equals(Object o) { 29 | if (this == o) return true; 30 | if (o == null || getClass() != o.getClass()) return false; 31 | 32 | Cate cate = (Cate) o; 33 | 34 | if (id != cate.id) return false; 35 | if (content != null ? !content.equals(cate.content) : cate.content != null) return false; 36 | 37 | return true; 38 | } 39 | 40 | @Override 41 | public int hashCode() { 42 | int result = id; 43 | result = 31 * result + (content != null ? content.hashCode() : 0); 44 | return result; 45 | } 46 | 47 | @Override 48 | public String toString() { 49 | return "Cate{" + 50 | "id=" + id + 51 | ", content='" + content + '\'' + 52 | '}'; 53 | } 54 | } 55 | -------------------------------------------------------------------------------- /yuannews/src/main/res/layout/about_activity.xml: -------------------------------------------------------------------------------- 1 | 2 | 6 | 7 | 8 | 14 | 15 | 21 | 22 | 30 | 31 | 38 | 39 | -------------------------------------------------------------------------------- /yuannews/src/main/java/cn/edu/hpu/yuan/yuannews/main/data/model/base/Source.java: -------------------------------------------------------------------------------- 1 | package cn.edu.hpu.yuan.yuannews.main.data.model.base; 2 | 3 | 4 | /** 5 | * Created by yuan on 16-4-1. 6 | */ 7 | 8 | public class Source { 9 | private int id; 10 | private String source; 11 | 12 | public int getId() { 13 | return id; 14 | } 15 | 16 | public void setId(int id) { 17 | this.id = id; 18 | } 19 | 20 | 21 | public String getSource() { 22 | return source; 23 | } 24 | 25 | public void setSource(String source) { 26 | this.source = source; 27 | } 28 | 29 | @Override 30 | public boolean equals(Object o) { 31 | if (this == o) return true; 32 | if (o == null || getClass() != o.getClass()) return false; 33 | 34 | Source source1 = (Source) o; 35 | 36 | if (id != source1.id) return false; 37 | if (source != null ? !source.equals(source1.source) : source1.source != null) return false; 38 | 39 | return true; 40 | } 41 | 42 | @Override 43 | public int hashCode() { 44 | int result = id; 45 | result = 31 * result + (source != null ? source.hashCode() : 0); 46 | return result; 47 | } 48 | 49 | @Override 50 | public String toString() { 51 | return "Source{" + 52 | "id=" + id + 53 | ", source='" + source + '\'' + 54 | '}'; 55 | } 56 | } 57 | -------------------------------------------------------------------------------- /yuannews/src/main/java/cn/edu/hpu/yuan/yuannews/main/util/LollipopUtils.java: -------------------------------------------------------------------------------- 1 | package cn.edu.hpu.yuan.yuannews.main.util; 2 | 3 | import android.app.Activity; 4 | import android.content.Context; 5 | import android.os.Build; 6 | import android.util.Log; 7 | import android.view.View; 8 | import android.view.Window; 9 | import android.view.WindowManager; 10 | 11 | public class LollipopUtils { 12 | 13 | public static int getStatusBarHeight(Context context) { 14 | Context appContext = context.getApplicationContext(); 15 | int result = 0; 16 | int resourceId = 17 | appContext.getResources().getIdentifier("status_bar_height", "dimen", "android"); 18 | if (resourceId > 0) { 19 | result = appContext.getResources().getDimensionPixelSize(resourceId); 20 | } 21 | Log.d("ScreenUtils", result + ""); 22 | return result; 23 | } 24 | 25 | public static void setStatusbarColor(Activity activity, View view) { 26 | 27 | //对于Lollipop 的设备,只需要在style.xml中设置colorPrimaryDark即可 28 | 29 | //对于4.4的设备,如下设置padding即可,颜色同样在style.xml中配置 30 | Window w = activity.getWindow(); 31 | if (Build.VERSION.SDK_INT == Build.VERSION_CODES.KITKAT) { 32 | w.setFlags(WindowManager.LayoutParams.FLAG_TRANSLUCENT_STATUS, 33 | WindowManager.LayoutParams.FLAG_TRANSLUCENT_STATUS); 34 | int statusBarHeight = getStatusBarHeight(activity); 35 | view.setPadding(0, statusBarHeight, 0, 0); 36 | return; 37 | } 38 | } 39 | } -------------------------------------------------------------------------------- /yuannews/src/main/java/cn/edu/hpu/yuan/yuannews/news/newslist/NewsModule.java: -------------------------------------------------------------------------------- 1 | package cn.edu.hpu.yuan.yuannews.news.newslist; 2 | 3 | import android.content.Context; 4 | 5 | import cn.edu.hpu.yuan.yuannews.news.newslist.adapter.CustomRecyclerViewAdapter; 6 | import dagger.Module; 7 | import dagger.Provides; 8 | 9 | /** 10 | * Created by yuan on 16-5-9. 11 | * 新闻modlue类 12 | */ 13 | @Module 14 | public class NewsModule { 15 | 16 | 17 | private NewsContract.View newsView; 18 | public NewsModule(){} 19 | 20 | private Context context; 21 | private CustomRecyclerViewAdapter.NewsListItemClick newsListItemClick; 22 | 23 | 24 | public NewsModule(NewsContract.View newsView, Context context,CustomRecyclerViewAdapter.NewsListItemClick newsListItemClick) { 25 | this.newsView = newsView; 26 | this.context=context; 27 | this.newsListItemClick=newsListItemClick; 28 | } 29 | 30 | @Provides 31 | NewsFragment provideNewsFragment(){ 32 | return new NewsFragment(); 33 | } 34 | 35 | @Provides 36 | NewsContract.View provideNewsView(){ 37 | return newsView; 38 | } 39 | 40 | @Provides 41 | NewsContract.Presenter provideNewsPresenter(){ 42 | return new MewsPresenter(newsView); 43 | } 44 | 45 | @Provides 46 | CustomRecyclerViewAdapter provideCustomRecyclerViewAdapter(){ 47 | return new CustomRecyclerViewAdapter(context,newsListItemClick); 48 | } 49 | 50 | 51 | } 52 | -------------------------------------------------------------------------------- /yuannews/src/main/java/cn/edu/hpu/yuan/yuannews/user/login/LoginActivity.java: -------------------------------------------------------------------------------- 1 | package cn.edu.hpu.yuan.yuannews.user.login; 2 | 3 | import android.support.v7.widget.Toolbar; 4 | import android.view.View; 5 | import javax.inject.Inject; 6 | import cn.edu.hpu.yuan.yuannews.R; 7 | import cn.edu.hpu.yuan.yuannews.main.base.BaseFragment; 8 | import cn.edu.hpu.yuan.yuannews.main.base.NormalBaseActivity; 9 | 10 | /** 11 | * Created by yuan on 16-5-12. 12 | * 用户登陆页面 13 | */ 14 | public class LoginActivity extends NormalBaseActivity { 15 | 16 | @Inject 17 | protected LoginFragment loginFragment; 18 | 19 | @Override 20 | protected void initView() { 21 | } 22 | @Override 23 | protected void setComponet() { 24 | DaggerLoginComponent 25 | .builder() 26 | .loginModule(new LoginModule()) 27 | .build() 28 | .injectLoginActivity(this); 29 | } 30 | 31 | @Override 32 | protected void initToolbar(Toolbar toolbar) { 33 | setTitle("用户登陆"); 34 | toolbar.setNavigationIcon(R.drawable.ic_action_arrow_left); 35 | toolbar.setNavigationOnClickListener(new View.OnClickListener() { 36 | @Override 37 | public void onClick(View v) { 38 | onBackPressed(); 39 | } 40 | }); 41 | } 42 | 43 | @Override 44 | protected BaseFragment initFragment() { 45 | return loginFragment; 46 | } 47 | 48 | 49 | } 50 | -------------------------------------------------------------------------------- /yuannews/src/main/java/cn/edu/hpu/yuan/yuannews/main/data/model/base/Taste.java: -------------------------------------------------------------------------------- 1 | package cn.edu.hpu.yuan.yuannews.main.data.model.base; 2 | 3 | 4 | import java.io.Serializable; 5 | 6 | /** 7 | * Created by yuan on 16-4-1. 8 | */ 9 | public class Taste implements Serializable{ 10 | private int id; 11 | private String label; 12 | 13 | 14 | public int getId() { 15 | return id; 16 | } 17 | 18 | public void setId(int id) { 19 | this.id = id; 20 | } 21 | 22 | public String getLabel() { 23 | return label; 24 | } 25 | 26 | public void setLabel(String label) { 27 | this.label = label; 28 | } 29 | 30 | @Override 31 | public boolean equals(Object o) { 32 | if (this == o) return true; 33 | if (o == null || getClass() != o.getClass()) return false; 34 | 35 | Taste taste = (Taste) o; 36 | 37 | if (id != taste.id) return false; 38 | if (label != null ? !label.equals(taste.label) : taste.label != null) return false; 39 | 40 | return true; 41 | } 42 | 43 | @Override 44 | public int hashCode() { 45 | int result = id; 46 | result = 31 * result + (label != null ? label.hashCode() : 0); 47 | return result; 48 | } 49 | 50 | @Override 51 | public String toString() { 52 | return "Taste{" + 53 | "id=" + id + 54 | ", label='" + label + '\'' + 55 | '}'; 56 | } 57 | } 58 | -------------------------------------------------------------------------------- /yuannews/src/main/res/values/strings.xml: -------------------------------------------------------------------------------- 1 | 2 | 新闻推荐 3 | 4 | 5 | 6 | 打开 7 | 关闭 8 | 9 | 10 | %1$d次阅读 11 | 分类: 12 | 来源: 13 | 14 | 15 | %1$d次阅读 %2$d次评论 %3$d人点赞 16 | 查看评论 %1$d 17 | 点赞 %1$d 18 | 19 | ID : 20 | 21 | 22 | 普通用户 23 | 管理员 24 | | 25 | 26 | 27 | 基于用户兴趣标签的新闻推荐系统是集新闻数据网络爬虫,新闻数据后台管理,网页版新闻展示和Android客户端新闻展示于一体的实现。整个系统运行主要实现流程分为三步:首先,网络爬虫爬取新闻数据,并对新闻数据进行去脏,去重操作,然后将新闻数据存储在Mysql数据库中。其次,实现系统后台管理,对新闻数据,用户数据,兴趣标签等进行优化操作。最后,系统后台实现的新闻推荐策略与用户兴趣标签管理,为用户实现网页版新闻信息展示和Android客户端新闻信息展示 28 | 29 | 北方有个自从出生就不认识菱角的人,在南方做官,(一次)他在酒席上吃菱角,(那个人)连角壳一起放进嘴里吃。有的人说:“吃菱角必须去掉壳再吃。”那人为了掩饰自己的缺点,(护住自己的短处),说:“我并不是不知道,连壳一起吃进去的原因,而是想要清热解毒。”问的人说:“北方也有这种东西吗?”他回答说:“前面的山后面的山,哪块地没有呢?”菱角生长在水中,却说是在土里生长的,这是因为他勉强地把不知道的当作知道的。 30 | 31 | -------------------------------------------------------------------------------- /yuannews/src/main/java/cn/edu/hpu/yuan/yuannews/news/labels/LabelsActivity.java: -------------------------------------------------------------------------------- 1 | package cn.edu.hpu.yuan.yuannews.news.labels; 2 | 3 | import android.support.v7.widget.Toolbar; 4 | import android.view.View; 5 | 6 | import javax.inject.Inject; 7 | 8 | import cn.edu.hpu.yuan.yuannews.R; 9 | import cn.edu.hpu.yuan.yuannews.main.base.BaseFragment; 10 | import cn.edu.hpu.yuan.yuannews.main.base.NormalBaseActivity; 11 | 12 | /** 13 | * Created by yuan on 16-5-13. 14 | * 所有标签页,分页加载实现 15 | */ 16 | public class LabelsActivity extends NormalBaseActivity{ 17 | 18 | @Inject 19 | protected LabelsFragment labelsFragment; 20 | 21 | @Override 22 | protected void initView() { 23 | } 24 | 25 | @Override 26 | protected void setComponet() { 27 | DaggerLabelsComponent 28 | .builder() 29 | .labelsModule(new LabelsModule()) 30 | .build() 31 | .injectLabelsActivity(this); 32 | } 33 | 34 | @Override 35 | protected void initToolbar(Toolbar toolbar) { 36 | setTitle("关注兴趣标签"); 37 | toolbar.setNavigationIcon(R.drawable.ic_action_arrow_left); 38 | toolbar.setNavigationOnClickListener(new View.OnClickListener() { 39 | @Override 40 | public void onClick(View v) { 41 | onBackPressed(); 42 | } 43 | }); 44 | } 45 | 46 | @Override 47 | protected BaseFragment initFragment() { 48 | return labelsFragment; 49 | } 50 | 51 | } 52 | -------------------------------------------------------------------------------- /yuannews/src/main/java/cn/edu/hpu/yuan/yuannews/news/tuijian/TuijianActivity.java: -------------------------------------------------------------------------------- 1 | package cn.edu.hpu.yuan.yuannews.news.tuijian; 2 | 3 | import android.support.v7.widget.Toolbar; 4 | import android.view.View; 5 | 6 | import javax.inject.Inject; 7 | 8 | import cn.edu.hpu.yuan.yuannews.R; 9 | import cn.edu.hpu.yuan.yuannews.main.base.BaseFragment; 10 | import cn.edu.hpu.yuan.yuannews.main.base.NormalBaseActivity; 11 | 12 | /** 13 | * Created by yuan on 16-5-13. 14 | */ 15 | public class TuijianActivity extends NormalBaseActivity{ 16 | 17 | @Inject 18 | protected TuijianFragment tuijianFragment; 19 | 20 | @Override 21 | protected void initView() { 22 | 23 | } 24 | 25 | @Override 26 | protected void setComponet() { 27 | DaggerTuijianComponent 28 | .builder() 29 | .tuijianModule(new TuijianModule()) 30 | .build() 31 | .injectTuijianActivity(this); 32 | } 33 | 34 | @Override 35 | protected void initToolbar(Toolbar toolbar) { 36 | setTitle("推荐新闻"); 37 | toolbar.setNavigationIcon(R.drawable.ic_action_arrow_left); 38 | toolbar.setNavigationOnClickListener(new View.OnClickListener() { 39 | @Override 40 | public void onClick(View v) { 41 | onBackPressed(); 42 | } 43 | }); 44 | } 45 | 46 | @Override 47 | protected BaseFragment initFragment() { 48 | return tuijianFragment; 49 | } 50 | 51 | 52 | } 53 | -------------------------------------------------------------------------------- /yuannews/src/main/java/cn/edu/hpu/yuan/yuannews/user/register/RegisterActivity.java: -------------------------------------------------------------------------------- 1 | package cn.edu.hpu.yuan.yuannews.user.register; 2 | 3 | import android.support.v7.widget.Toolbar; 4 | import android.view.View; 5 | 6 | import javax.inject.Inject; 7 | 8 | import cn.edu.hpu.yuan.yuannews.R; 9 | import cn.edu.hpu.yuan.yuannews.main.base.BaseFragment; 10 | import cn.edu.hpu.yuan.yuannews.main.base.NormalBaseActivity; 11 | 12 | /** 13 | * Created by yuan on 16-5-12. 14 | */ 15 | public class RegisterActivity extends NormalBaseActivity{ 16 | 17 | @Inject 18 | protected RegisterFragment registerFragment; 19 | 20 | @Override 21 | protected void initView() { 22 | 23 | } 24 | @Override 25 | protected void setComponet() { 26 | 27 | DaggerRegisterComponent 28 | .builder() 29 | .registerModule(new RegisterModule()) 30 | .build() 31 | .injectRegisterActivity(this); 32 | 33 | } 34 | @Override 35 | protected void initToolbar(Toolbar toolbar) { 36 | setTitle("用户注册"); 37 | toolbar.setNavigationIcon(R.drawable.ic_action_arrow_left); 38 | toolbar.setNavigationOnClickListener(new View.OnClickListener() { 39 | @Override 40 | public void onClick(View v) { 41 | onBackPressed(); 42 | } 43 | }); 44 | } 45 | 46 | @Override 47 | protected BaseFragment initFragment() { 48 | return registerFragment; 49 | } 50 | } 51 | -------------------------------------------------------------------------------- /yuannews/src/main/java/cn/edu/hpu/yuan/yuannews/user/userIfo/UserifoActivity.java: -------------------------------------------------------------------------------- 1 | package cn.edu.hpu.yuan.yuannews.user.userIfo; 2 | 3 | import android.support.v7.widget.Toolbar; 4 | import android.view.View; 5 | 6 | import javax.inject.Inject; 7 | 8 | import cn.edu.hpu.yuan.yuannews.R; 9 | import cn.edu.hpu.yuan.yuannews.main.base.BaseFragment; 10 | import cn.edu.hpu.yuan.yuannews.main.base.NormalBaseActivity; 11 | 12 | /** 13 | * Created by yuan on 16-5-12. 14 | */ 15 | public class UserifoActivity extends NormalBaseActivity{ 16 | 17 | 18 | @Inject 19 | protected UserIfoFragment userIfoFragment; 20 | 21 | @Override 22 | protected void initView() { 23 | 24 | } 25 | 26 | @Override 27 | protected void setComponet() { 28 | DaggerUserifoComponent 29 | .builder() 30 | .userIfoModule(new UserIfoModule()) 31 | .build() 32 | .injectUserIfoActivity(this); 33 | 34 | } 35 | 36 | @Override 37 | protected void initToolbar(Toolbar toolbar) { 38 | setTitle("用户信息编辑"); 39 | toolbar.setNavigationIcon(R.drawable.ic_action_arrow_left); 40 | toolbar.setNavigationOnClickListener(new View.OnClickListener() { 41 | @Override 42 | public void onClick(View v) { 43 | onBackPressed(); 44 | } 45 | }); 46 | } 47 | 48 | @Override 49 | protected BaseFragment initFragment() { 50 | return userIfoFragment; 51 | } 52 | } 53 | -------------------------------------------------------------------------------- /yuannews/src/main/java/cn/edu/hpu/yuan/yuannews/main/data/NewsAPIModule.java: -------------------------------------------------------------------------------- 1 | package cn.edu.hpu.yuan.yuannews.main.data; 2 | 3 | import android.content.Context; 4 | 5 | import cn.edu.hpu.yuan.yuannews.main.data.Local.NewsAPIShared; 6 | import cn.edu.hpu.yuan.yuannews.main.data.remote.NewsAPIService; 7 | import dagger.Module; 8 | import dagger.Provides; 9 | import retrofit2.Retrofit; 10 | import retrofit2.converter.gson.GsonConverterFactory; 11 | 12 | /** 13 | * Created by yuan on 16-5-9. 14 | * 新闻API Module, 只能在Application中进行初始化操作 15 | * 1.数据访问类 Retrofit 16 | * 2.图片访问Glide 17 | */ 18 | @Module 19 | public class NewsAPIModule { 20 | 21 | protected String baseUrl; 22 | 23 | protected Retrofit retrofit; 24 | 25 | protected Context context; 26 | 27 | public NewsAPIModule(String baseUrl,Context context) { 28 | this.baseUrl = baseUrl; 29 | this.context=context; 30 | } 31 | 32 | 33 | @Provides 34 | Retrofit provideRetrofit(){ 35 | retrofit = new Retrofit.Builder() 36 | .baseUrl(baseUrl) 37 | .addConverterFactory(GsonConverterFactory.create()) 38 | .build(); 39 | return retrofit; 40 | } 41 | 42 | @Provides 43 | NewsAPIService proviceNewsAPIService(){ 44 | provideRetrofit(); 45 | return retrofit.create(NewsAPIService.class); 46 | } 47 | 48 | @Provides 49 | NewsAPIShared provideNewsAPIShared(){ 50 | return new NewsAPIShared(context); 51 | } 52 | 53 | 54 | } 55 | -------------------------------------------------------------------------------- /yuannews/src/main/res/values-v19/styles.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 20 | 21 | 27 | 28 | 29 | -------------------------------------------------------------------------------- /yuannews/src/main/java/cn/edu/hpu/yuan/yuannews/main/data/model/news/NewsCustom.java: -------------------------------------------------------------------------------- 1 | package cn.edu.hpu.yuan.yuannews.main.data.model.news; 2 | 3 | 4 | import cn.edu.hpu.yuan.yuannews.main.data.model.news.NewsVo; 5 | 6 | /** 7 | * ================================================== 8 | *

9 | * 版权: 软件工程.net12-1 原明卓 10 | *

11 | * 项目: 基于用户兴趣标签的新闻推荐系统 12 | *

13 | * 作者: 原明卓 14 | *

15 | * 版本: 1.0 16 | *

17 | * 创建日期: 16-4-13 下午3:53 18 | *

19 | * 功能描述: 新闻item实体类 20 | *

21 | *

22 | * 功能更新历史: 23 | * 客户端:主界面新闻展示的数据 包括阅读数量,分类信息,新闻信息 24 | *

25 | * ================================================== 26 | */ 27 | public class NewsCustom extends NewsVo { 28 | 29 | private Integer cnum;//评论总数 30 | 31 | private String ccont;//分类信息 32 | 33 | private Integer znum;//点赞总数 34 | 35 | private String scont; 36 | 37 | public Integer getCnum() { 38 | return cnum; 39 | } 40 | 41 | public void setCnum(Integer cnum) { 42 | this.cnum = cnum; 43 | } 44 | 45 | public String getCcont() { 46 | return ccont; 47 | } 48 | 49 | public void setCcont(String ccont) { 50 | this.ccont = ccont; 51 | } 52 | 53 | public Integer getZnum() { 54 | return znum; 55 | } 56 | 57 | public void setZnum(Integer znum) { 58 | this.znum = znum; 59 | } 60 | 61 | public String getScont() { 62 | return scont; 63 | } 64 | 65 | public void setScont(String scont) { 66 | this.scont = scont; 67 | } 68 | } 69 | -------------------------------------------------------------------------------- /yuannews/src/main/java/cn/edu/hpu/yuan/yuannews/news/main/adapter/MainViewPagerAdapter.java: -------------------------------------------------------------------------------- 1 | package cn.edu.hpu.yuan.yuannews.news.main.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 | import java.util.List; 9 | 10 | import cn.edu.hpu.yuan.yuannews.news.newslist.NewsFragment; 11 | 12 | /** 13 | * Created by yuan on 16-5-10. 14 | * 主页的ViewPager的Adapter 15 | */ 16 | public class MainViewPagerAdapter extends FragmentPagerAdapter{ 17 | 18 | private final List list_fragment=new ArrayList<>(); 19 | private final List list_Title=new ArrayList<>(); 20 | 21 | public void initAdapter(List fragments, List listTitle){ 22 | list_fragment.addAll(fragments); 23 | list_Title.addAll(listTitle); 24 | } 25 | 26 | public MainViewPagerAdapter(FragmentManager fm) { 27 | super(fm); 28 | //默认的nType=6 29 | list_fragment.add(NewsFragment.getNewsFragmentInstance("首页",6)); 30 | list_Title.add("首页"); 31 | } 32 | 33 | @Override 34 | public Fragment getItem(int position) { 35 | return list_fragment.get(position); 36 | } 37 | 38 | @Override 39 | public int getCount() { 40 | return list_Title.size(); 41 | } 42 | 43 | //此方法用来显示tab上的名字 44 | @Override 45 | public CharSequence getPageTitle(int position) { 46 | return list_Title.get(position); 47 | } 48 | 49 | } 50 | -------------------------------------------------------------------------------- /yuannews/src/main/java/cn/edu/hpu/yuan/yuannews/news/main/MainModule.java: -------------------------------------------------------------------------------- 1 | package cn.edu.hpu.yuan.yuannews.news.main; 2 | 3 | import android.support.v4.app.Fragment; 4 | import android.support.v4.app.FragmentManager; 5 | 6 | import java.util.List; 7 | 8 | import javax.inject.Singleton; 9 | 10 | import cn.edu.hpu.yuan.yuannews.news.main.adapter.MainViewPagerAdapter; 11 | import dagger.Module; 12 | import dagger.Provides; 13 | 14 | /** 15 | * Created by yuan on 16-5-10. 16 | * Module包括两个功能: 17 | * 1.给MainAvtivity提供Fragment 18 | * 2.给Fragment提供其他实例化的对象 19 | * 所以存在两个构造函数; 20 | */ 21 | @Module 22 | public class MainModule { 23 | 24 | 25 | private MainContract.MainView mainView; 26 | private FragmentManager fragmentManager; 27 | 28 | 29 | //Activity 实例化 30 | public MainModule() { 31 | } 32 | 33 | //fragment实例化 34 | public MainModule(MainContract.MainView mainView,FragmentManager fragmentManager) { 35 | this.mainView = mainView; 36 | this.fragmentManager=fragmentManager; 37 | } 38 | 39 | //给mainActivity 给他Fragment 40 | @Provides 41 | MainFragment provideMainFragment(){ 42 | return new MainFragment(); 43 | } 44 | 45 | //给mainFragment提供MainPresenter 46 | @Provides 47 | MainContract.MainPresenter provideMainPresenter(){ 48 | return new MainPresenter(mainView); 49 | } 50 | 51 | //给MainFragment提供adapter 52 | @Provides 53 | MainViewPagerAdapter provideMainViewPagerAdapter(){ 54 | return new MainViewPagerAdapter(fragmentManager); 55 | } 56 | 57 | 58 | } 59 | -------------------------------------------------------------------------------- /yuannews/src/main/java/cn/edu/hpu/yuan/yuannews/user/label/LabelActivity.java: -------------------------------------------------------------------------------- 1 | package cn.edu.hpu.yuan.yuannews.user.label; 2 | 3 | import android.os.Bundle; 4 | import android.support.v7.widget.Toolbar; 5 | import android.view.View; 6 | 7 | import javax.inject.Inject; 8 | 9 | import cn.edu.hpu.yuan.yuannews.R; 10 | import cn.edu.hpu.yuan.yuannews.main.base.BaseFragment; 11 | import cn.edu.hpu.yuan.yuannews.main.base.NormalBaseActivity; 12 | 13 | /** 14 | * Created by yuan on 16-5-12. 15 | */ 16 | public class LabelActivity extends NormalBaseActivity{ 17 | 18 | @Inject 19 | protected LabelFragment labelFragment; 20 | 21 | @Override 22 | protected void initView() { 23 | } 24 | @Override 25 | protected void setComponet() { 26 | DaggerLabelComponent 27 | .builder() 28 | .labelModule(new LabelModule()) 29 | .build() 30 | .injectLabelActivity(this); 31 | } 32 | 33 | @Override 34 | protected void initToolbar(Toolbar toolbar) { 35 | setTitle("兴趣标签管理"); 36 | toolbar.setNavigationIcon(R.drawable.ic_action_arrow_left); 37 | toolbar.setNavigationOnClickListener(new View.OnClickListener() { 38 | @Override 39 | public void onClick(View v) { 40 | onBackPressed(); 41 | } 42 | }); 43 | } 44 | 45 | 46 | @Override 47 | protected BaseFragment initFragment() { 48 | Bundle tasteVos = getIntent().getExtras(); 49 | labelFragment.setArguments(tasteVos); 50 | return labelFragment; 51 | } 52 | 53 | } 54 | -------------------------------------------------------------------------------- /yuannews/src/main/java/cn/edu/hpu/yuan/yuannews/news/newsdetail/NewsDetailActivity.java: -------------------------------------------------------------------------------- 1 | package cn.edu.hpu.yuan.yuannews.news.newsdetail; 2 | 3 | import android.content.Context; 4 | import android.os.Bundle; 5 | import android.support.v7.widget.Toolbar; 6 | 7 | import javax.inject.Inject; 8 | 9 | import cn.edu.hpu.yuan.yuancore.util.LogUtil; 10 | import cn.edu.hpu.yuan.yuannews.main.base.BaseFragment; 11 | import cn.edu.hpu.yuan.yuannews.main.base.NormalBackActivity; 12 | 13 | /** 14 | * Created by yuan on 16-5-11. 15 | * 新闻详情页Activity 16 | */ 17 | public class NewsDetailActivity extends NormalBackActivity{ 18 | 19 | 20 | 21 | private static final String NEWSDETAIL_FRAGMENT_NID_KEY="news_detail_nid_key"; 22 | 23 | @Inject 24 | protected NewsDetailFragment newsDetailFragment; 25 | 26 | @Override 27 | protected void initView(Bundle savedInstanceState, Toolbar toolbar) { 28 | } 29 | 30 | @Override 31 | protected BaseFragment initFragment() { 32 | Bundle bundle=new Bundle(); 33 | bundle.putInt(NEWSDETAIL_FRAGMENT_NID_KEY,getIntent().getIntExtra("nid",400)); 34 | newsDetailFragment.setArguments(bundle); 35 | return newsDetailFragment; 36 | } 37 | 38 | @Override 39 | protected void setComponent() { 40 | DaggerNewsDetailComponent 41 | .builder() 42 | .newsDetailModule(new NewsDetailModule()) 43 | .build() 44 | .injectNewsDetailActivity(this); 45 | } 46 | 47 | 48 | @Override 49 | protected Context getChildContext() { 50 | return NewsDetailActivity.this; 51 | } 52 | } 53 | -------------------------------------------------------------------------------- /yuannews/src/main/java/cn/edu/hpu/yuan/yuannews/news/comment/CommenActivity.java: -------------------------------------------------------------------------------- 1 | package cn.edu.hpu.yuan.yuannews.news.comment; 2 | 3 | import android.os.Bundle; 4 | import android.support.v7.widget.Toolbar; 5 | import android.view.View; 6 | 7 | import javax.inject.Inject; 8 | 9 | import cn.edu.hpu.yuan.yuannews.R; 10 | import cn.edu.hpu.yuan.yuannews.main.base.BaseFragment; 11 | import cn.edu.hpu.yuan.yuannews.main.base.NormalBaseActivity; 12 | 13 | /** 14 | * Created by yuan on 16-5-13. 15 | */ 16 | public class CommenActivity extends NormalBaseActivity{ 17 | 18 | @Inject 19 | protected CommentFragment commentFragment; 20 | 21 | @Override 22 | protected void initView() { 23 | 24 | } 25 | 26 | @Override 27 | protected void setComponet() { 28 | DaggerCommentComponent 29 | .builder() 30 | .commentModule(new CommentModule()) 31 | .build() 32 | .injectCommentActivity(this); 33 | } 34 | 35 | @Override 36 | protected void initToolbar(Toolbar toolbar) { 37 | setTitle("新闻评论列表"); 38 | toolbar.setNavigationIcon(R.drawable.ic_action_arrow_left); 39 | toolbar.setNavigationOnClickListener(new View.OnClickListener() { 40 | @Override 41 | public void onClick(View v) { 42 | onBackPressed(); 43 | } 44 | }); 45 | } 46 | 47 | @Override 48 | protected BaseFragment initFragment() { 49 | Bundle bundle=new Bundle(); 50 | bundle.putInt("nid",getIntent().getIntExtra("nid",0)); 51 | commentFragment.setArguments(bundle); 52 | return commentFragment; 53 | } 54 | } 55 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # YuanNewsForAndroid 2 | 新闻推荐系统-Android客户端 3 | * 历史遗留 - 用户没有推荐兴趣,关注标签后,推荐的新闻没有生成(服务端和客户端联合测试) 4 | * 没有兴趣标签的解决方案是什么? 5 | 6 | 7 | 8 | # 2016.05.18 9 | * 换图标,浅灰色底,绿色图标显示实现 10 | * 注册成功的提示信息(后台,在进行添加标签的时候,也需要进行新闻推荐) 11 | * RecyclerView 判断没有数据的时候,提醒没有更多数据,不能太频繁;(思路: 有数据,设置为true;没数据设置为false) 12 | 13 | 14 | # 2016.05.14 15 | * 已实现新闻推荐列表(见历史遗留) 16 | * 剩下两个内容:1.伪推送:推荐新闻通知实现;2.用户修改信息实现; 17 | 18 | # 2016.05.13 19 | * 接口:1.获取当前新闻当前用户的新闻状态,2.分页查询所有的新闻标签 20 | * 优先:1.接口实现 2.新闻详情跑通(评论及点赞)3.新闻推荐 4.信息修改 5.引导页,启动页,关于页 21 | * 优化 22 | 23 | # 2016.05.12 24 | * 用户登陆 :账户/密码 25 | * 用户注册 :账户/密码/昵称; 26 | * 兴趣标签管理 27 | * 新闻推荐实现 28 | * 用户详情页标签布局实现: 29 | * https://github.com/lankton/android-flowlayout 30 | * 修改的字体颜色有: 31 | 32 | # 2016.05.11 33 | * 新闻列表请求,包括分类,来源等请求,浮动按钮进行排序请求 34 | * 新闻详情页实现,包括评论,点赞,详情显示 35 | * 分页加载及封装 36 | 37 | # 2016.05.10 38 | * 新闻主界面实现 39 | 40 | # 2016.05.09 41 | * 架构基本实现 42 | * 主页,详情页布局采用开源 : 43 | * https://github.com/ksoichiro/Android-ObservableScrollView 44 | 45 | * Dialog 46 | * https://github.com/andyxialm/ColorDialog 47 | * 排序规则 : https://github.com/konifar/fab-transformation 48 | 49 | * 新闻界面实现思路: 50 | * 列表实现,head 分类和来源 ,默认显示正常情况 51 | * 默认显示正常情况:下面四种情况菜单-》推荐(需要登录),热度,评论,点赞; 52 | 53 | * 引导页 54 | * https://github.com/PaoloRotolo/AppIntro 55 | * 透明高亮指示层 56 | * https://github.com/hongyangAndroid/Highlight 57 | 58 | # 2016.05.06 59 | * Android 基本架构 60 | * dagger2 + mvp + Retrofit + data Binding 61 | 62 | # 2016.04.29 63 | * 添加 yuancore 模块 64 | * LogUtil : 日志打印类 65 | * DensityUtil : 获取屏幕的宽度等 66 | * DateUtils : 日期处理类,几分钟以前等 67 | * CrashHandler : 异常捕捉类 68 | * 添加网络 yuannet 模块 69 | * 图片请求及其封装 glide -------------------------------------------------------------------------------- /yuancore/REDECORE.md: -------------------------------------------------------------------------------- 1 | # 1.ui/dialog 2 | 方式1: 3 | ColorDialog dialog = new ColorDialog(this); 4 | dialog.setTitle(getString(R.string.operation)); 5 | dialog.setContentText(getString(R.string.content_text)); 6 | dialog.setContentImage(getResources().getDrawable(R.mipmap.sample_img)); 7 | dialog.setPositiveListener(getString(R.string.delete), new ColorDialog.OnPositiveListener() { 8 | @Override 9 | public void onClick(ColorDialog dialog) { 10 | Toast.makeText(MainActivity.this, dialog.getPositiveText().toString(), Toast.LENGTH_SHORT).show(); 11 | } 12 | }) 13 | .setNegativeListener(getString(R.string.cancel), new ColorDialog.OnNegativeListener() { 14 | @Override 15 | public void onClick(ColorDialog dialog) { 16 | Toast.makeText(MainActivity.this, dialog.getNegativeText().toString(), Toast.LENGTH_SHORT).show(); 17 | dialog.dismiss(); 18 | } 19 | }).show(); 20 | 21 | 方式2: 22 | new PromptDialog(this).setDialogType(PromptDialog.DIALOG_TYPE_SUCCESS) 23 | .setTitleText("Success").setContentText("Your info text goes here. Loremipsum dolor sit amet, consecteturn adipisicing elit, sed do eiusmod.") 24 | .setPositiveListener("OK", new PromptDialog.OnPositiveListener() { 25 | @Override 26 | public void onClick(PromptDialog dialog) { 27 | dialog.dismiss(); 28 | } 29 | }).show(); 30 | 31 | 还需要进一步封装实现; 32 | 33 | 34 | -------------------------------------------------------------------------------- /yuannews/src/main/java/cn/edu/hpu/yuan/yuannews/main/data/model/base/Comment.java: -------------------------------------------------------------------------------- 1 | package cn.edu.hpu.yuan.yuannews.main.data.model.base; 2 | 3 | 4 | /** 5 | * Created by yuan on 16-4-3. 6 | */ 7 | public class Comment { 8 | private int id; 9 | private String content; 10 | private int status; 11 | 12 | 13 | public int getId() { 14 | return id; 15 | } 16 | 17 | public void setId(int id) { 18 | this.id = id; 19 | } 20 | 21 | public String getContent() { 22 | return content; 23 | } 24 | 25 | public void setContent(String content) { 26 | this.content = content; 27 | } 28 | 29 | public int getStatus() { 30 | return status; 31 | } 32 | 33 | public void setStatus(int status) { 34 | this.status = status; 35 | } 36 | 37 | @Override 38 | public boolean equals(Object o) { 39 | if (this == o) return true; 40 | if (o == null || getClass() != o.getClass()) return false; 41 | 42 | Comment comment = (Comment) o; 43 | 44 | if (id != comment.id) return false; 45 | if (status != comment.status) return false; 46 | if (content != null ? !content.equals(comment.content) : comment.content != null) return false; 47 | 48 | return true; 49 | } 50 | 51 | @Override 52 | public int hashCode() { 53 | int result = id; 54 | result = 31 * result + (content != null ? content.hashCode() : 0); 55 | result = 31 * result + status; 56 | return result; 57 | } 58 | 59 | @Override 60 | public String toString() { 61 | return "Comment{" + 62 | "id=" + id + 63 | ", content='" + content + '\'' + 64 | ", status=" + status + 65 | '}'; 66 | } 67 | } 68 | -------------------------------------------------------------------------------- /yuannews/src/main/java/cn/edu/hpu/yuan/yuannews/user/center/CenterActivity.java: -------------------------------------------------------------------------------- 1 | package cn.edu.hpu.yuan.yuannews.user.center; 2 | 3 | import android.support.v7.widget.Toolbar; 4 | import android.view.View; 5 | 6 | import javax.inject.Inject; 7 | 8 | import cn.edu.hpu.yuan.yuannews.R; 9 | import cn.edu.hpu.yuan.yuannews.main.app.BaseApplication; 10 | import cn.edu.hpu.yuan.yuannews.main.base.BaseFragment; 11 | import cn.edu.hpu.yuan.yuannews.main.base.NormalBaseActivity; 12 | 13 | /** 14 | * Created by yuan on 16-5-12. 15 | */ 16 | public class CenterActivity extends NormalBaseActivity{ 17 | 18 | 19 | private final String SHRAED_MOREN_USER_IFNO="No Data"; 20 | 21 | @Inject 22 | protected CenterFragment centerFragment; 23 | 24 | @Override 25 | protected void initView() { 26 | 27 | } 28 | 29 | @Override 30 | protected void setComponet() { 31 | DaggerCenterComponent.builder() 32 | .centerModule(new CenterModule()) 33 | .build() 34 | .injectCenterActivity(this); 35 | } 36 | 37 | @Override 38 | protected void initToolbar(Toolbar toolbar) { 39 | String userNick = BaseApplication.newsAPIShared.getSharedUserNick(); 40 | if(SHRAED_MOREN_USER_IFNO.equals(userNick)){ 41 | setTitle("个人中心"); 42 | }else{ 43 | setTitle(userNick); 44 | } 45 | toolbar.setNavigationIcon(R.drawable.ic_action_arrow_left); 46 | toolbar.setNavigationOnClickListener(new View.OnClickListener() { 47 | @Override 48 | public void onClick(View v) { 49 | onBackPressed(); 50 | } 51 | }); 52 | } 53 | 54 | @Override 55 | protected BaseFragment initFragment() { 56 | return centerFragment; 57 | } 58 | 59 | } 60 | -------------------------------------------------------------------------------- /yuannews/src/main/java/cn/edu/hpu/yuan/yuannews/user/register/RegisterPresenter.java: -------------------------------------------------------------------------------- 1 | package cn.edu.hpu.yuan.yuannews.user.register; 2 | 3 | import cn.edu.hpu.yuan.yuannews.main.app.BaseApplication; 4 | import cn.edu.hpu.yuan.yuannews.main.data.model.DataBean; 5 | import cn.edu.hpu.yuan.yuannews.user.register.RegisterContancts.RegisterContanctsPresenter; 6 | import retrofit2.Call; 7 | import retrofit2.Callback; 8 | import retrofit2.Response; 9 | 10 | /** 11 | * Created by yuan on 16-5-12. 12 | */ 13 | public class RegisterPresenter implements RegisterContanctsPresenter{ 14 | 15 | private RegisterContancts.RegisterCOntanctsView registerCOntanctsView; 16 | 17 | public RegisterPresenter(RegisterContancts.RegisterCOntanctsView registerCOntanctsView) { 18 | this.registerCOntanctsView = registerCOntanctsView; 19 | } 20 | 21 | @Override 22 | public void postUserRegister(String nick, String num, String pass) { 23 | registerCOntanctsView.showDialog(); 24 | BaseApplication.newsAPIService.postUserRegister(num,pass,nick).enqueue(new Callback() { 25 | @Override 26 | public void onResponse(Call call, Response response) { 27 | 28 | if(response.isSuccessful()){ 29 | if(response.body().getCode()==0){ 30 | registerCOntanctsView.showSuccess(); 31 | }else{ 32 | registerCOntanctsView.showError(response.body().getMsg()); 33 | } 34 | }else { 35 | registerCOntanctsView.showError("网络不稳定"); 36 | } 37 | } 38 | @Override 39 | public void onFailure(Call call, Throwable t) { 40 | registerCOntanctsView.showError("网络不稳定"); 41 | } 42 | }); 43 | } 44 | } 45 | -------------------------------------------------------------------------------- /yuannews/build.gradle: -------------------------------------------------------------------------------- 1 | apply plugin: 'com.android.application' 2 | apply plugin:'com.neenbedankt.android-apt' 3 | 4 | android { 5 | compileSdkVersion 23 6 | buildToolsVersion "23.0.2" 7 | 8 | dataBinding { 9 | enabled true //data binding 10 | } 11 | 12 | defaultConfig { 13 | applicationId "cn.edu.hpu.yuan.yuannews" 14 | minSdkVersion 14 15 | targetSdkVersion 23 16 | versionCode 2 17 | versionName "2.0" 18 | } 19 | buildTypes { 20 | release { 21 | minifyEnabled false //代码混淆关闭 22 | proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro' 23 | } 24 | } 25 | } 26 | 27 | 28 | 29 | dependencies { 30 | compile fileTree(dir: 'libs', include: ['*.jar']) 31 | testCompile 'junit:junit:4.12' 32 | compile 'com.android.support:appcompat-v7:23.3.0' 33 | compile 'com.android.support:design:23.3.0' 34 | compile 'com.android.support:recyclerview-v7:23.3.0' //RecyclerView 35 | compile 'com.android.support:cardview-v7:23.3.0' //cardView 36 | compile 'com.balysv:material-ripple:1.0.2' //点击波纹效果 37 | 38 | //dagger2 39 | apt'com.google.dagger:dagger-compiler:2.0.2'//指定注解处理器 40 | compile'com.google.dagger:dagger:2.0.2'//dagger公用api 41 | provided'org.glassfish:javax.annotation:10.0-b28'//添加android缺失的部分javax注解 42 | 43 | //retrofit 2.0 44 | compile 'com.squareup.retrofit2:retrofit:2.0.2' 45 | 46 | //Gson 47 | compile 'com.squareup.retrofit2:converter-gson:2.0.2' 48 | 49 | //Glide 图片加载 50 | compile 'com.github.bumptech.glide:glide:3.7.0' 51 | 52 | //圆形头像 53 | compile 'de.hdodenhof:circleimageview:2.0.0' 54 | 55 | //进度条 56 | compile 'com.pnikosis:materialish-progress:1.7' 57 | 58 | //fastJson 59 | compile 'com.alibaba:fastjson:1.1.15' 60 | 61 | compile project(path: ':yuancore') 62 | } 63 | -------------------------------------------------------------------------------- /yuannews/src/main/java/cn/edu/hpu/yuan/yuannews/news/main/MainActivity.java: -------------------------------------------------------------------------------- 1 | package cn.edu.hpu.yuan.yuannews.news.main; 2 | 3 | import android.content.Context; 4 | import android.content.Intent; 5 | import android.os.Bundle; 6 | import android.support.v7.app.ActionBar; 7 | import android.support.v7.widget.Toolbar; 8 | import android.view.View; 9 | import android.widget.TextView; 10 | 11 | import com.bumptech.glide.Glide; 12 | 13 | import javax.inject.Inject; 14 | 15 | import cn.edu.hpu.yuan.yuancore.util.LogUtil; 16 | import cn.edu.hpu.yuan.yuannews.R; 17 | import cn.edu.hpu.yuan.yuannews.main.app.BaseApplication; 18 | import cn.edu.hpu.yuan.yuannews.main.base.BaseActivity; 19 | import cn.edu.hpu.yuan.yuannews.main.base.BaseFragment; 20 | import cn.edu.hpu.yuan.yuannews.user.center.CenterActivity; 21 | import cn.edu.hpu.yuan.yuannews.user.login.LoginActivity; 22 | import de.hdodenhof.circleimageview.CircleImageView; 23 | 24 | /** 25 | * Created by yuan on 16-5-10. 26 | * 1.主界面 27 | * 2.功能:初始化界面,包括分类和来源 28 | */ 29 | public class MainActivity extends BaseActivity{ 30 | 31 | 32 | 33 | @Inject 34 | protected MainFragment mainFragment; 35 | 36 | @Override 37 | protected void initView(Bundle savedInstanceState, Toolbar toolbar) { 38 | ActionBar ab = getSupportActionBar(); 39 | ab.setHomeAsUpIndicator(R.drawable.ic_menu); 40 | ab.setDisplayHomeAsUpEnabled(true); 41 | } 42 | 43 | @Override 44 | protected BaseFragment initFragment() { 45 | return mainFragment; 46 | } 47 | 48 | @Override 49 | protected void setComponent() { 50 | DaggerMainComponent.builder() 51 | .mainModule(new MainModule()) 52 | .build() 53 | .injectMainActivity(this); 54 | } 55 | 56 | @Override 57 | protected Context getChildContext() { 58 | return MainActivity.this; 59 | } 60 | 61 | 62 | } 63 | -------------------------------------------------------------------------------- /yuannews/src/main/AndroidManifest.xml: -------------------------------------------------------------------------------- 1 | 2 | 4 | 5 | 6 | 7 | 8 | 9 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | 33 | 34 | 35 | 36 | 37 | 38 | 39 | -------------------------------------------------------------------------------- /yuannews/src/main/res/layout/base_main_float_dialog.xml: -------------------------------------------------------------------------------- 1 | 2 | 7 | 8 | 15 | 16 | 24 | 25 | 33 | 34 | 42 | 43 | 51 | 52 | -------------------------------------------------------------------------------- /yuannews/src/main/res/layout/news_fragment.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 8 | 9 | 15 | 20 | 21 | 22 | 23 | 24 | 25 | 33 | 34 | 38 | 39 |