├── .gitattributes ├── .gitignore ├── .idea ├── .name ├── compiler.xml ├── copyright │ └── profiles_settings.xml ├── dictionaries │ └── Administrator.xml ├── encodings.xml ├── gradle.xml ├── libraries │ ├── adapter_rxjava_2_0_0.xml │ ├── animated_vector_drawable_23_4_0.xml │ ├── appcompat_v7_23_0_0.xml │ ├── appcompat_v7_23_4_0.xml │ ├── converter_gson_2_0_0.xml │ ├── design_23_4_0.xml │ ├── glide_3_7_0.xml │ ├── glide_transformations_2_0_1.xml │ ├── grid_view_with_header_footer_1_0_12.xml │ ├── gson_2_6_1.xml │ ├── hamcrest_core_1_3.xml │ ├── javapoet_1_1_0.xml │ ├── junit_4_12.xml │ ├── library_1_4_0.xml │ ├── okhttp_3_2_0.xml │ ├── okio_1_6_0.xml │ ├── recyclerview_v7_23_4_0.xml │ ├── retrofit_2_0_0.xml │ ├── rxandroid_1_2_0.xml │ ├── rxjava_1_1_5.xml │ ├── support_annotations_23_0_0.xml │ ├── support_annotations_23_4_0.xml │ ├── support_v4_23_0_0.xml │ ├── support_v4_23_4_0.xml │ ├── support_vector_drawable_23_4_0.xml │ ├── treasure_0_5_0.xml │ └── treasure_compiler_0_5_0.xml ├── misc.xml ├── modules.xml ├── runConfigurations.xml └── workspace.xml ├── README.md ├── app ├── .gitignore ├── build.gradle ├── proguard-rules.pro └── src │ ├── androidTest │ └── java │ │ └── zkk │ │ └── com │ │ └── mengqu │ │ └── ApplicationTest.java │ ├── main │ ├── AndroidManifest.xml │ ├── java │ │ ├── com │ │ │ └── ecloud │ │ │ │ └── pulltozoomview │ │ │ │ ├── BuildConfig.java │ │ │ │ ├── IPullToZoom.java │ │ │ │ ├── PullToZoomBase.java │ │ │ │ ├── PullToZoomListViewEx.java │ │ │ │ └── PullToZoomScrollViewEx.java │ │ └── zkk │ │ │ └── com │ │ │ └── mengqu │ │ │ ├── MainActivity.java │ │ │ ├── application │ │ │ └── App.java │ │ │ ├── base │ │ │ └── activity │ │ │ │ └── BaseActivity.java │ │ │ ├── commit │ │ │ ├── activity │ │ │ │ └── PaintActivity.java │ │ │ ├── adapter │ │ │ │ ├── LeaderboardAdapter.java │ │ │ │ ├── PaintAdapter.java │ │ │ │ ├── PaintListviewAdapter.java │ │ │ │ └── ShareAdapter.java │ │ │ ├── bean │ │ │ │ ├── PaintBean.java │ │ │ │ ├── PaintHeadBean.java │ │ │ │ ├── ReplyBean.java │ │ │ │ └── ShareBean.java │ │ │ └── fragment │ │ │ │ ├── CommitLeaderboardFragment.java │ │ │ │ ├── CommitSharesFragment.java │ │ │ │ ├── CommitVageFragment.java │ │ │ │ ├── LeaderBoardCommitItemFragment.java │ │ │ │ ├── PaintCommitFragment.java │ │ │ │ └── ShareCommitItemFragment.java │ │ │ ├── game │ │ │ ├── activity │ │ │ │ └── GameInfoItemActivity.java │ │ │ ├── adapter │ │ │ │ ├── GameInfoAdapter.java │ │ │ │ ├── GamePageAdapter.java │ │ │ │ └── GoodThemeAdapter.java │ │ │ ├── bean │ │ │ │ ├── GameInfoBean.java │ │ │ │ ├── GoodThemeBean.java │ │ │ │ ├── InfoHtmlBean.java │ │ │ │ └── InfoItemBean.java │ │ │ └── fragment │ │ │ │ ├── GameFragment.java │ │ │ │ ├── GameInfoFragment.java │ │ │ │ └── GoodThemeFragment.java │ │ │ ├── home │ │ │ ├── activity │ │ │ │ └── TabLayoutActivity.java │ │ │ ├── adapter │ │ │ │ ├── HomeAllAdapter.java │ │ │ │ ├── HomeLeaderAdapter.java │ │ │ │ └── HomeThemeAdapter.java │ │ │ ├── bean │ │ │ │ ├── HomeThemeBean.java │ │ │ │ └── HomeitemBean.java │ │ │ └── fragment │ │ │ │ ├── HomeAllFragment.java │ │ │ │ ├── HomeLeaderFragment.java │ │ │ │ └── HomeThemeFragment.java │ │ │ ├── imagslists │ │ │ ├── activity │ │ │ │ └── ImagesListsActivity.java │ │ │ ├── adapter │ │ │ │ └── ImagesListsAdapter.java │ │ │ └── bean │ │ │ │ ├── ImagsListBean.java │ │ │ │ └── PhotosBean.java │ │ │ ├── main │ │ │ └── activity │ │ │ │ └── MainActivity.java │ │ │ ├── news │ │ │ ├── adapter │ │ │ │ └── NewsAdapter.java │ │ │ ├── bean │ │ │ │ ├── NewsBean.java │ │ │ │ └── NewsItemBean.java │ │ │ └── fragment │ │ │ │ └── NewsFragment.java │ │ │ ├── retrofit2 │ │ │ ├── api │ │ │ │ └── MengquApi.java │ │ │ └── interfaces │ │ │ │ ├── ApimoejuInterface.java │ │ │ │ └── ApiwwwmoejuInterface.java │ │ │ ├── simplepreferences │ │ │ ├── SharePreferences.java │ │ │ └── SimplePreferences.java │ │ │ ├── theme │ │ │ ├── activity │ │ │ │ └── ThemeItemActivity.java │ │ │ ├── adapter │ │ │ │ └── ThemeListsAdapter.java │ │ │ └── bean │ │ │ │ └── ThemeItemBena.java │ │ │ ├── user │ │ │ └── fragment │ │ │ │ └── UserFragment.java │ │ │ ├── util │ │ │ └── Utils.java │ │ │ └── view │ │ │ ├── glide │ │ │ └── MyglideImageView.java │ │ │ ├── placeholder │ │ │ ├── CorpDrawableBuilder.java │ │ │ └── CorpSizeMatcher.java │ │ │ └── refresh │ │ │ └── LoadMoreListView.java │ └── res │ │ ├── drawable-hdpi-v4 │ │ ├── avarat_small_bg.png │ │ ├── back2x.png │ │ ├── back_white.png │ │ ├── clear.png │ │ ├── communite_nomal.png │ │ ├── communite_select.png │ │ ├── daily_comment.png │ │ ├── delete_icon.png │ │ ├── download.png │ │ ├── download_header.png │ │ ├── download_icon2x.png │ │ ├── game_nomal.png │ │ ├── game_select.png │ │ ├── guess.png │ │ ├── home_bottlom01_hover.png │ │ ├── home_bottom01.png │ │ ├── home_bottom02.png │ │ ├── home_bottom02_hover.png │ │ ├── home_bottom03.png │ │ ├── home_bottom03_hover.png │ │ ├── home_painter_selecter.png │ │ ├── home_painters.png │ │ ├── hot_event.png │ │ ├── hot_game.png │ │ ├── ic_commentator_loading.png │ │ ├── icon_comic.png │ │ ├── icon_empty_loading1.png │ │ ├── icon_empty_loading2.png │ │ ├── icon_empty_loading3.png │ │ ├── icon_empty_loading4.png │ │ ├── icon_page_empty.png │ │ ├── icon_page_error.png │ │ ├── indicator_normal.png │ │ ├── indicator_pink.png │ │ ├── indicator_selected.png │ │ ├── liked_gray2x.png │ │ ├── liked_red2x.png │ │ ├── list_gradient.png │ │ ├── login_dividing_lin.png │ │ ├── login_magin_line.png │ │ ├── no1_icon.png │ │ ├── no2_icon.png │ │ ├── no3_icon.png │ │ ├── no4_icon.png │ │ ├── pic.png │ │ ├── pic_view_bottom_shadow.9.png │ │ ├── picture_exam_code.png │ │ ├── setting_icon.png │ │ ├── setting_store.png │ │ ├── setting_type.png │ │ ├── share2x.png │ │ ├── share_white.png │ │ ├── tabbar_image_news.png │ │ ├── tabbar_image_news_selected.png │ │ ├── tag_gradient_pic.png │ │ ├── upload_icon.png │ │ └── webview_top_triangle.png │ │ ├── drawable-hdpi │ │ ├── ic_123.png │ │ └── ic_launcher.png │ │ ├── drawable-nodpi │ │ ├── list_divider_line.png │ │ ├── list_item_normal.9.png │ │ └── list_item_pressed.9.png │ │ ├── drawable │ │ ├── btn_dhqb_bg.xml │ │ ├── btn_white_bg.xml │ │ ├── costum_progress_bar.xml │ │ ├── divider_item.xml │ │ ├── item_simple_ico.xml │ │ ├── list_item_selector.xml │ │ ├── listview_selector.xml │ │ ├── page_loading.xml │ │ ├── selector_btn_daily.xml │ │ ├── selector_btn_paint.xml │ │ ├── selector_btn_picture.xml │ │ ├── selector_home_btn3.xml │ │ ├── selector_indicator.xml │ │ ├── selector_info.xml │ │ ├── selector_info_btn.xml │ │ ├── selector_info_right.xml │ │ ├── selector_like_btn.xml │ │ ├── selector_tag.xml │ │ ├── shape_comic_like.xml │ │ ├── shape_gray_solid_green_stroke.xml │ │ ├── shape_reddot.xml │ │ ├── shape_reg_btn.xml │ │ ├── shape_research_item_tag.xml │ │ ├── shape_user_register_code.xml │ │ ├── style_order_list_top_menu_left.xml │ │ ├── style_order_list_top_menu_left_checked.xml │ │ ├── style_order_list_top_menu_left_checked_orange.xml │ │ ├── style_order_list_top_menu_left_unchecked_orange.xml │ │ ├── style_order_list_top_menu_right.xml │ │ ├── style_order_list_top_menu_right_checked.xml │ │ ├── style_order_list_top_menu_right_checked_orange.xml │ │ ├── style_order_list_top_menu_right_unchecked_orange.xml │ │ └── text_color_blue_to_white.xml │ │ ├── layout │ │ ├── activity_base_empty_loading_view.xml │ │ ├── activity_base_empty_view.xml │ │ ├── activity_base_view.xml │ │ ├── activity_download.xml │ │ ├── activity_gameinfo_all.xml │ │ ├── activity_grid.xml │ │ ├── activity_home.xml │ │ ├── activity_info_detail.xml │ │ ├── activity_main.xml │ │ ├── activity_paint.xml │ │ ├── activity_photos.xml │ │ ├── activity_pull_to_zoom_scroll_view.xml │ │ ├── fragmeng_theme_content.xml │ │ ├── fragment_commit.xml │ │ ├── fragment_commit_leader_item.xml │ │ ├── fragment_commit_leaderboard.xml │ │ ├── fragment_commit_share.xml │ │ ├── fragment_commit_share_item.xml │ │ ├── fragment_game.xml │ │ ├── fragment_gameinfo.xml │ │ ├── fragment_goodtheme.xml │ │ ├── fragment_home.xml │ │ ├── fragment_leaderhome.xml │ │ ├── fragment_news.xml │ │ ├── fragment_user.xml │ │ ├── image_detail.xml │ │ ├── imagelist_item.xml │ │ ├── imglist_header.xml │ │ ├── item_comicer_user.xml │ │ ├── item_comment.xml │ │ ├── item_comment_reply.xml │ │ ├── item_commic_daily.xml │ │ ├── item_forgetpwd.xml │ │ ├── item_game_theme.xml │ │ ├── item_game_top.xml │ │ ├── item_header_news.xml │ │ ├── item_home.xml │ │ ├── item_info.xml │ │ ├── item_info_top.xml │ │ ├── item_paint.xml │ │ ├── item_paintitem.xml │ │ ├── item_theme.xml │ │ ├── item_themelist.xml │ │ ├── item_user_info.xml │ │ ├── item_user_setting.xml │ │ ├── load_more_footer2.xml │ │ ├── poi_photo_pager_item.xml │ │ ├── pop_beautypics.xml │ │ └── profile_zoom_view.xml │ │ ├── mipmap-hdpi │ │ └── ic_launcher.png │ │ ├── mipmap-mdpi │ │ └── ic_launcher.png │ │ ├── mipmap-xhdpi │ │ └── ic_launcher.png │ │ ├── mipmap-xxhdpi │ │ └── ic_launcher.png │ │ ├── mipmap-xxxhdpi │ │ └── ic_launcher.png │ │ ├── values-w820dp │ │ └── dimens.xml │ │ └── values │ │ ├── colors.xml │ │ ├── dimens.xml │ │ ├── strings.xml │ │ ├── styles.xml │ │ └── values.xml │ └── test │ └── java │ └── zkk │ └── com │ └── mengqu │ └── ExampleUnitTest.java ├── build.gradle ├── gradle.properties ├── gradle └── wrapper │ ├── gradle-wrapper.jar │ └── gradle-wrapper.properties ├── gradlew ├── gradlew.bat ├── library ├── .gitignore ├── build.gradle ├── proguard-rules.pro └── src │ ├── androidTest │ └── java │ │ └── com │ │ └── aspsine │ │ └── multithreaddownload │ │ └── ApplicationTest.java │ └── main │ ├── AndroidManifest.xml │ ├── java │ └── com │ │ └── aspsine │ │ └── multithreaddownload │ │ ├── CallBack.java │ │ ├── Constants.java │ │ ├── DownloadConfiguration.java │ │ ├── DownloadException.java │ │ ├── DownloadInfo.java │ │ ├── DownloadManager.java │ │ ├── DownloadRequest.java │ │ ├── architecture │ │ ├── ConnectTask.java │ │ ├── DownloadResponse.java │ │ ├── DownloadStatus.java │ │ ├── DownloadStatusDelivery.java │ │ ├── DownloadTask.java │ │ └── Downloader.java │ │ ├── core │ │ ├── ConnectTaskImpl.java │ │ ├── DownloadResponseImpl.java │ │ ├── DownloadStatusDeliveryImpl.java │ │ ├── DownloadTaskImpl.java │ │ ├── DownloaderImpl.java │ │ ├── MultiDownloadTask.java │ │ └── SingleDownloadTask.java │ │ ├── db │ │ ├── AbstractDao.java │ │ ├── DBOpenHelper.java │ │ ├── DataBaseManager.java │ │ ├── ThreadInfo.java │ │ └── ThreadInfoDao.java │ │ └── util │ │ ├── FileUtils.java │ │ ├── IOCloseUtils.java │ │ ├── L.java │ │ └── ListUtils.java │ └── res │ └── values │ └── strings.xml ├── readme ├── Screenshot_2016-07-10-22-17-15_zkk.com.mengqu.png ├── Screenshot_2016-07-10-22-17-27_zkk.com.mengqu.png ├── Screenshot_2016-07-10-22-17-41_zkk.com.mengqu.png ├── Screenshot_2016-07-10-22-17-52_zkk.com.mengqu.png ├── Screenshot_2016-07-10-22-17-56_zkk.com.mengqu.png ├── Screenshot_2016-07-10-22-18-03_zkk.com.mengqu.png ├── Screenshot_2016-07-10-22-18-10_zkk.com.mengqu.png ├── Screenshot_2016-07-10-22-18-14_zkk.com.mengqu.png ├── Screenshot_2016-07-10-22-18-23_zkk.com.mengqu.png ├── Screenshot_2016-07-10-22-18-32_zkk.com.mengqu.png ├── Screenshot_2016-07-10-22-18-41_zkk.com.mengqu.png ├── Screenshot_2016-07-10-22-18-48_zkk.com.mengqu.png ├── Screenshot_2016-07-10-22-19-04_zkk.com.mengqu.png ├── Screenshot_2016-07-10-22-19-22_zkk.com.mengqu.png ├── Screenshot_2016-07-10-22-19-28_zkk.com.mengqu.png └── Screenshot_2016-07-10-22-21-05_zkk.com.mengqu.png └── settings.gradle /.gitattributes: -------------------------------------------------------------------------------- 1 | # Auto detect text files and perform LF normalization 2 | * text=auto 3 | 4 | # Custom for Visual Studio 5 | *.cs diff=csharp 6 | 7 | # Standard to msysgit 8 | *.doc diff=astextplain 9 | *.DOC diff=astextplain 10 | *.docx diff=astextplain 11 | *.DOCX diff=astextplain 12 | *.dot diff=astextplain 13 | *.DOT diff=astextplain 14 | *.pdf diff=astextplain 15 | *.PDF diff=astextplain 16 | *.rtf diff=astextplain 17 | *.RTF diff=astextplain 18 | -------------------------------------------------------------------------------- /.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 | out/ 15 | 16 | # Gradle files 17 | .gradle/ 18 | build/ 19 | 20 | # Local configuration file (sdk path, etc) 21 | local.properties 22 | 23 | # Proguard folder generated by Eclipse 24 | proguard/ 25 | 26 | # Log Files 27 | *.log 28 | 29 | # Android Studio Navigation editor temp files 30 | .navigation/ 31 | 32 | # Android Studio captures folder 33 | captures/ 34 | 35 | # Intellij 36 | *.iml 37 | 38 | # Keystore files 39 | *.jks 40 | 41 | # ========================= 42 | # Operating System Files 43 | # ========================= 44 | 45 | # OSX 46 | # ========================= 47 | 48 | .DS_Store 49 | .AppleDouble 50 | .LSOverride 51 | 52 | # Thumbnails 53 | ._* 54 | 55 | # Files that might appear in the root of a volume 56 | .DocumentRevisions-V100 57 | .fseventsd 58 | .Spotlight-V100 59 | .TemporaryItems 60 | .Trashes 61 | .VolumeIcon.icns 62 | 63 | # Directories potentially created on remote AFP share 64 | .AppleDB 65 | .AppleDesktop 66 | Network Trash Folder 67 | Temporary Items 68 | .apdisk 69 | 70 | # Windows 71 | # ========================= 72 | 73 | # Windows image file caches 74 | Thumbs.db 75 | ehthumbs.db 76 | 77 | # Folder config file 78 | Desktop.ini 79 | 80 | # Recycle Bin used on file shares 81 | $RECYCLE.BIN/ 82 | 83 | # Windows Installer files 84 | *.cab 85 | *.msi 86 | *.msm 87 | *.msp 88 | 89 | # Windows shortcuts 90 | *.lnk 91 | -------------------------------------------------------------------------------- /.idea/.name: -------------------------------------------------------------------------------- 1 | Mengqu -------------------------------------------------------------------------------- /.idea/compiler.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | -------------------------------------------------------------------------------- /.idea/copyright/profiles_settings.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | -------------------------------------------------------------------------------- /.idea/dictionaries/Administrator.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | -------------------------------------------------------------------------------- /.idea/encodings.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | -------------------------------------------------------------------------------- /.idea/gradle.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 24 | 25 | -------------------------------------------------------------------------------- /.idea/libraries/adapter_rxjava_2_0_0.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | -------------------------------------------------------------------------------- /.idea/libraries/animated_vector_drawable_23_4_0.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | -------------------------------------------------------------------------------- /.idea/libraries/appcompat_v7_23_0_0.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | -------------------------------------------------------------------------------- /.idea/libraries/appcompat_v7_23_4_0.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | -------------------------------------------------------------------------------- /.idea/libraries/converter_gson_2_0_0.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | -------------------------------------------------------------------------------- /.idea/libraries/design_23_4_0.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | -------------------------------------------------------------------------------- /.idea/libraries/glide_3_7_0.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | -------------------------------------------------------------------------------- /.idea/libraries/glide_transformations_2_0_1.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | -------------------------------------------------------------------------------- /.idea/libraries/grid_view_with_header_footer_1_0_12.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | -------------------------------------------------------------------------------- /.idea/libraries/gson_2_6_1.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | -------------------------------------------------------------------------------- /.idea/libraries/hamcrest_core_1_3.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | -------------------------------------------------------------------------------- /.idea/libraries/javapoet_1_1_0.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | -------------------------------------------------------------------------------- /.idea/libraries/junit_4_12.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | -------------------------------------------------------------------------------- /.idea/libraries/library_1_4_0.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | -------------------------------------------------------------------------------- /.idea/libraries/okhttp_3_2_0.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | -------------------------------------------------------------------------------- /.idea/libraries/okio_1_6_0.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | -------------------------------------------------------------------------------- /.idea/libraries/recyclerview_v7_23_4_0.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | -------------------------------------------------------------------------------- /.idea/libraries/retrofit_2_0_0.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | -------------------------------------------------------------------------------- /.idea/libraries/rxandroid_1_2_0.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | -------------------------------------------------------------------------------- /.idea/libraries/rxjava_1_1_5.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | -------------------------------------------------------------------------------- /.idea/libraries/support_annotations_23_0_0.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | -------------------------------------------------------------------------------- /.idea/libraries/support_annotations_23_4_0.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | -------------------------------------------------------------------------------- /.idea/libraries/support_v4_23_0_0.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | -------------------------------------------------------------------------------- /.idea/libraries/support_v4_23_4_0.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | -------------------------------------------------------------------------------- /.idea/libraries/support_vector_drawable_23_4_0.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | -------------------------------------------------------------------------------- /.idea/libraries/treasure_0_5_0.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | -------------------------------------------------------------------------------- /.idea/libraries/treasure_compiler_0_5_0.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | -------------------------------------------------------------------------------- /.idea/modules.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | -------------------------------------------------------------------------------- /.idea/runConfigurations.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 11 | 12 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # mengqu 2 | 3 | 萌聚官方说法:由于广警局查水表,被请喝茶了,限制的地方太多,别说奶子,泳衣,欧白太大,动作太挑逗都不行,我们不堪鸭梨,撑不住最后公司还是决定下架了。! 4 | 5 | 所以现在所有的接口获取不到数据了!!!很尴尬!!! 6 | 7 | 高仿萌聚app 8 | 最近下了个叫做“萌趣”的app,内容简直是宅男福利啊! 9 | 10 | 11 | 12 | 有时间把它的一些界面和功能实现了下,具体的页面如下: 13 | App下载地址: 14 | http://fir.im/pu3x 15 | 16 | 17 | 18 | 19 | 20 | 使用到的技术: 21 | 22 | 1、retrofit2+RxAndroid 23 | 24 | Git 地址 https://github.com/square/retrofit 25 | https://github.com/ReactiveX/RxAndroid 26 | 27 | 讲解地址 http://www.jianshu.com/p/c1a3a881a144 28 | 2、glide 图片加载库 29 | 30 | git 地址 https://github.com/bumptech/glide 31 | 讲解地址 http://blog.csdn.net/fancylovejava/article/details/44747759 32 | 33 | 3、圆形ImageView 34 | 35 | git 地址 https://github.com/wasabeef/glide-transformations 36 | 4、支持 header footer的 gridview 37 | 38 | git 地址 https://github.com/liaohuqiu/android-GridViewWithHeaderAndFooter 39 | 5、可放大缩小imageview的Photoview 40 | 41 | git 地址 https://github.com/bm-x/PhotoView 42 | 6、下拉图片变大的imageview 43 | 44 | git 地址 https://github.com/Frank-Zhu/PullZoomView/ 45 | 46 | 还有些没有完成的功能: 47 | 48 | 1、下载没有进行优化,下载后不能直接从app中看。 49 | 50 | 2、不少图片按钮事件没有加,比如分享、下载、关闭等 51 | 52 | 有时间把这个再这个app完善。 53 | 54 | 接口都是自己抓得,若是有侵权请告知。 55 | 56 | 这个只是个人的练手作品,本人也是菜鸟一个。请大家不要用作商用,请大家多给几个 star。 57 | 如果发现不能使用或者有其他的问题,请直接在这或者git上提出。 58 | -------------------------------------------------------------------------------- /app/.gitignore: -------------------------------------------------------------------------------- 1 | /build 2 | -------------------------------------------------------------------------------- /app/build.gradle: -------------------------------------------------------------------------------- 1 | apply plugin: 'com.android.application' 2 | 3 | android { 4 | compileSdkVersion 23 5 | buildToolsVersion "24.0.0 rc4" 6 | 7 | defaultConfig { 8 | applicationId "zkk.com.mengqu" 9 | minSdkVersion 16 10 | targetSdkVersion 23 11 | versionCode 1 12 | versionName "1.0" 13 | } 14 | buildTypes { 15 | release { 16 | minifyEnabled false 17 | proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro' 18 | } 19 | } 20 | } 21 | 22 | dependencies { 23 | compile fileTree(dir: 'libs', include: ['*.jar']) 24 | testCompile 'junit:junit:4.12' 25 | compile 'com.android.support:appcompat-v7:23.4.0' 26 | compile 'com.android.support:design:23+' 27 | 28 | /*retrofit2 的依赖 http库(动态代理) 29 | * 讲解 http://www.jianshu.com/p/c1a3a881a144 30 | * 31 | *git 地址 https://github.com/square/retrofit 32 | * */ 33 | compile 'com.squareup.okhttp3:okhttp:3.2.0' 34 | compile 'com.squareup.retrofit2:retrofit:2.0.0' 35 | compile 'com.squareup.retrofit2:converter-gson:2.0.0' 36 | compile 'com.squareup.retrofit2:adapter-rxjava:2.0.0' 37 | 38 | 39 | /*RxAndroid 的依赖(异步) 40 | * 讲解 http://gank.io/post/560e15be2dca930e00da1083 41 | *git 地址 https://github.com/ReactiveX/RxAndroid 42 | * */ 43 | compile 'io.reactivex:rxandroid:1.2.0' 44 | compile 'io.reactivex:rxjava:1.1.5' 45 | 46 | /* glide 的依赖 图片加载库 47 | * 讲解http://blog.csdn.net/fancylovejava/article/details/44747759 48 | * git https://github.com/bumptech/glide 49 | */ 50 | compile 'com.github.bumptech.glide:glide:3.7.0' 51 | 52 | /*roundedimageview (不支持glide) 53 | * git 地址 https://github.com/vinc3m1/RoundedImageView 54 | *//* 55 | compile 'com.makeramen:roundedimageview:2.2.1'*/ 56 | 57 | 58 | /*圆形ImageView 59 | * git 地址 https://github.com/hdodenhof/CircleImageView 60 | */ 61 | // compile 'de.hdodenhof:circleimageview:2.0.0' 62 | 63 | /*圆形ImageView 64 | * git 地址 https://github.com/wasabeef/glide-transformations 65 | */ 66 | compile 'jp.wasabeef:glide-transformations:2.0.1' 67 | 68 | /*支持 header footer的 gridview 69 | * git 地址 https://github.com/liaohuqiu/android-GridViewWithHeaderAndFooter 70 | */ 71 | 72 | compile 'in.srain.cube:grid-view-with-header-footer:1.0.12' 73 | 74 | /* 75 | *Photoview 76 | * Git 地址 https://github.com/bm-x/PhotoView 77 | */ 78 | compile 'com.bm.photoview:library:1.4.0' 79 | 80 | /* 下拉图片变大 81 | *git地址 ;https://github.com/Frank-Zhu/PullZoomView/ 82 | */ 83 | /* compile 'com.github.frank-zhu:pullzoomview:1.0.0'*/ 84 | 85 | compile project(':library') 86 | 87 | /* 88 | * git 地址 https://github.com/baoyongzhang/Treasure 89 | */ 90 | 91 | compile 'com.baoyz.treasure:treasure:0.5.0' 92 | provided 'com.baoyz.treasure:treasure-compiler:0.5.0' 93 | } 94 | -------------------------------------------------------------------------------- /app/proguard-rules.pro: -------------------------------------------------------------------------------- 1 | # Add project specific ProGuard rules here. 2 | # By default, the flags in this file are appended to flags specified 3 | # in D:\androiddevelop\adt-bundle-windows-x86_64-20140321\sdk/tools/proguard/proguard-android.txt 4 | # You can edit the include path and order by changing the proguardFiles 5 | # directive in build.gradle. 6 | # 7 | # For more details, see 8 | # http://developer.android.com/guide/developing/tools/proguard.html 9 | 10 | # Add any project specific keep options here: 11 | 12 | # If your project uses WebView with JS, uncomment the following 13 | # and specify the fully qualified class name to the JavaScript interface 14 | # class: 15 | #-keepclassmembers class fqcn.of.javascript.interface.for.webview { 16 | # public *; 17 | #} 18 | -------------------------------------------------------------------------------- /app/src/androidTest/java/zkk/com/mengqu/ApplicationTest.java: -------------------------------------------------------------------------------- 1 | package zkk.com.mengqu; 2 | 3 | import android.app.Application; 4 | import android.test.ApplicationTestCase; 5 | 6 | /** 7 | * Testing Fundamentals 8 | */ 9 | public class ApplicationTest extends ApplicationTestCase { 10 | public ApplicationTest() { 11 | super(Application.class); 12 | } 13 | } -------------------------------------------------------------------------------- /app/src/main/AndroidManifest.xml: -------------------------------------------------------------------------------- 1 | 2 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | 39 | 40 | 41 | 42 | 43 | 44 | 45 | 46 | 47 | 48 | 49 | 50 | 51 | 52 | 53 | 54 | 55 | -------------------------------------------------------------------------------- /app/src/main/java/com/ecloud/pulltozoomview/BuildConfig.java: -------------------------------------------------------------------------------- 1 | // 2 | // Source code recreated from a .class file by IntelliJ IDEA 3 | // (powered by Fernflower decompiler) 4 | // 5 | 6 | package com.ecloud.pulltozoomview; 7 | 8 | public final class BuildConfig { 9 | public static final boolean DEBUG = false; 10 | public static final String APPLICATION_ID = "com.ecloud.pulltozoomview"; 11 | public static final String BUILD_TYPE = "release"; 12 | public static final String FLAVOR = ""; 13 | public static final int VERSION_CODE = 100; 14 | public static final String VERSION_NAME = "1.0.0"; 15 | 16 | public BuildConfig() { 17 | } 18 | } 19 | -------------------------------------------------------------------------------- /app/src/main/java/com/ecloud/pulltozoomview/IPullToZoom.java: -------------------------------------------------------------------------------- 1 | package com.ecloud.pulltozoomview; 2 | 3 | /** 4 | * Author: ZhuWenWu 5 | * Version V1.0 6 | * Date: 2014/11/7 14:21. 7 | * Description: 8 | * Modification History: 9 | * Date Author Version Description 10 | * ----------------------------------------------------------------------------------- 11 | * 2014/11/7 ZhuWenWu 1.0 1.0 12 | * Why & What is modified: 13 | */ 14 | 15 | import android.content.res.TypedArray; 16 | import android.view.View; 17 | 18 | public interface IPullToZoom { 19 | /** 20 | * Get the Wrapped Zoom View. Anything returned here has already been 21 | * added to the content view. 22 | * 23 | * @return The View which is currently wrapped 24 | */ 25 | public View getZoomView(); 26 | 27 | public View getHeaderView(); 28 | 29 | /** 30 | * Get the Wrapped root View. 31 | * 32 | * @return The View which is currently wrapped 33 | */ 34 | public T getPullRootView(); 35 | 36 | /** 37 | * Whether Pull-to-Refresh is enabled 38 | * 39 | * @return enabled 40 | */ 41 | public boolean isPullToZoomEnabled(); 42 | 43 | /** 44 | * Returns whether the Widget is currently in the Zooming state 45 | * 46 | * @return true if the Widget is currently zooming 47 | */ 48 | public boolean isZooming(); 49 | 50 | /** 51 | * Returns whether the Widget is currently in the Zooming anim type 52 | * 53 | * @return true if the anim is parallax 54 | */ 55 | public boolean isParallax(); 56 | 57 | public boolean isHideHeader(); 58 | 59 | public void handleStyledAttributes(TypedArray a); 60 | } 61 | -------------------------------------------------------------------------------- /app/src/main/java/zkk/com/mengqu/MainActivity.java: -------------------------------------------------------------------------------- 1 | package zkk.com.mengqu; 2 | 3 | import android.support.v7.app.AppCompatActivity; 4 | import android.os.Bundle; 5 | 6 | public class MainActivity extends AppCompatActivity { 7 | 8 | @Override 9 | protected void onCreate(Bundle savedInstanceState) { 10 | super.onCreate(savedInstanceState); 11 | setContentView(R.layout.activity_main); 12 | } 13 | } 14 | -------------------------------------------------------------------------------- /app/src/main/java/zkk/com/mengqu/application/App.java: -------------------------------------------------------------------------------- 1 | package zkk.com.mengqu.application; 2 | 3 | import android.app.Application; 4 | import android.content.Context; 5 | 6 | import com.aspsine.multithreaddownload.DownloadConfiguration; 7 | import com.aspsine.multithreaddownload.DownloadManager; 8 | 9 | /** 10 | * Created by Aspsine on 2015/4/20. 11 | */ 12 | public class App extends Application { 13 | private static Context sContext; 14 | 15 | @Override 16 | public void onCreate() { 17 | super.onCreate(); 18 | sContext = getApplicationContext(); 19 | initDownloader(); 20 | } 21 | 22 | private void initDownloader() { 23 | DownloadConfiguration configuration = new DownloadConfiguration(); 24 | configuration.setMaxThreadNum(100); 25 | configuration.setThreadNum(10); 26 | DownloadManager.getInstance().init(getApplicationContext(), configuration); 27 | } 28 | 29 | public static Context getContext() { 30 | return sContext; 31 | } 32 | 33 | 34 | } 35 | -------------------------------------------------------------------------------- /app/src/main/java/zkk/com/mengqu/commit/fragment/CommitLeaderboardFragment.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Created by ttdevs at 16-4-14 下午3:52. 3 | * E-mail:ttdevs@gmail.com 4 | * https://github.com/ttdevs 5 | * Copyright (c) 2016 ttdevs 6 | */ 7 | 8 | package zkk.com.mengqu.commit.fragment; 9 | 10 | import android.os.Bundle; 11 | import android.support.design.widget.TabLayout; 12 | import android.support.v4.app.Fragment; 13 | import android.support.v4.app.FragmentManager; 14 | import android.support.v4.app.FragmentPagerAdapter; 15 | import android.support.v4.view.ViewPager; 16 | import android.view.LayoutInflater; 17 | import android.view.View; 18 | import android.view.ViewGroup; 19 | 20 | import java.util.ArrayList; 21 | import java.util.List; 22 | 23 | import zkk.com.mengqu.R; 24 | 25 | public class CommitLeaderboardFragment extends Fragment { 26 | 27 | private List mFragmentList = new ArrayList<>(); 28 | 29 | private TabLayout tableLayout; 30 | private ViewPager viewPager; 31 | private ApnFragmentAdapter mAdapter; 32 | 33 | @Override 34 | public View onCreateView(LayoutInflater inflater, ViewGroup container, 35 | Bundle savedInstanceState) { 36 | // TODO Auto-generated method stub 37 | View view=inflater.inflate(R.layout.fragment_commit_leaderboard, container,false); 38 | mFragmentList.add(LeaderBoardCommitItemFragment.newInstance(1)); 39 | mFragmentList.add(LeaderBoardCommitItemFragment.newInstance(2)); 40 | mFragmentList.add(LeaderBoardCommitItemFragment.newInstance(3)); 41 | 42 | tableLayout = (TabLayout)view.findViewById(R.id.commit_tableLayout_leaderboard); 43 | viewPager = (ViewPager)view.findViewById(R.id.commit_viewPager_leaderboard); 44 | 45 | mAdapter = new ApnFragmentAdapter(getChildFragmentManager()); 46 | viewPager.setAdapter(mAdapter); 47 | tableLayout.setupWithViewPager(viewPager); 48 | tableLayout.setTabMode(TabLayout.MODE_FIXED); 49 | 50 | return view; 51 | } 52 | 53 | private class ApnFragmentAdapter extends FragmentPagerAdapter { 54 | CharSequence[] TITLE = new CharSequence[]{"日排行","周排行","月排行"}; 55 | 56 | public ApnFragmentAdapter(FragmentManager fm) { 57 | super(fm); 58 | } 59 | 60 | @Override 61 | public Fragment getItem(int position) { 62 | return mFragmentList.get(position); 63 | } 64 | 65 | @Override 66 | public int getCount() { 67 | return TITLE.length; 68 | } 69 | 70 | @Override 71 | public CharSequence getPageTitle(int position) { 72 | return TITLE[position]; 73 | } 74 | } 75 | } 76 | -------------------------------------------------------------------------------- /app/src/main/java/zkk/com/mengqu/commit/fragment/CommitSharesFragment.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Created by ttdevs at 16-4-14 下午3:52. 3 | * E-mail:ttdevs@gmail.com 4 | * https://github.com/ttdevs 5 | * Copyright (c) 2016 ttdevs 6 | */ 7 | 8 | package zkk.com.mengqu.commit.fragment; 9 | 10 | import android.os.Bundle; 11 | import android.support.design.widget.TabLayout; 12 | import android.support.v4.app.Fragment; 13 | import android.support.v4.app.FragmentManager; 14 | import android.support.v4.app.FragmentPagerAdapter; 15 | import android.support.v4.view.ViewPager; 16 | import android.view.LayoutInflater; 17 | import android.view.View; 18 | import android.view.ViewGroup; 19 | 20 | import java.util.ArrayList; 21 | import java.util.List; 22 | 23 | import zkk.com.mengqu.R; 24 | 25 | public class CommitSharesFragment extends Fragment { 26 | 27 | private List mFragmentList = new ArrayList<>(); 28 | 29 | private TabLayout tableLayout; 30 | private ViewPager viewPager; 31 | private ApnFragmentAdapter mAdapter; 32 | 33 | @Override 34 | public View onCreateView(LayoutInflater inflater, ViewGroup container, 35 | Bundle savedInstanceState) { 36 | // TODO Auto-generated method stub 37 | View view=inflater.inflate(R.layout.fragment_commit_share, container,false); 38 | mFragmentList.add(ShareCommitItemFragment.newInstance(4)); 39 | mFragmentList.add(ShareCommitItemFragment.newInstance(5)); 40 | mFragmentList.add(ShareCommitItemFragment.newInstance(6)); 41 | mFragmentList.add(ShareCommitItemFragment.newInstance(3)); 42 | 43 | tableLayout = (TabLayout)view.findViewById(R.id.commit_tableLayout_share); 44 | viewPager = (ViewPager)view.findViewById(R.id.commit_viewPager_share); 45 | 46 | mAdapter = new ApnFragmentAdapter(getFragmentManager()); 47 | viewPager.setAdapter(mAdapter); 48 | tableLayout.setupWithViewPager(viewPager); 49 | tableLayout.setTabMode(TabLayout.MODE_FIXED); 50 | 51 | return view; 52 | } 53 | 54 | private class ApnFragmentAdapter extends FragmentPagerAdapter { 55 | CharSequence[] TITLE = new CharSequence[]{"日常","吐槽","番剧","COS"}; 56 | 57 | public ApnFragmentAdapter(FragmentManager fm) { 58 | super(fm); 59 | } 60 | 61 | @Override 62 | public Fragment getItem(int position) { 63 | return mFragmentList.get(position); 64 | } 65 | 66 | @Override 67 | public int getCount() { 68 | return TITLE.length; 69 | } 70 | 71 | @Override 72 | public CharSequence getPageTitle(int position) { 73 | return TITLE[position]; 74 | } 75 | } 76 | } 77 | -------------------------------------------------------------------------------- /app/src/main/java/zkk/com/mengqu/commit/fragment/CommitVageFragment.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Created by ttdevs at 16-4-14 下午3:52. 3 | * E-mail:ttdevs@gmail.com 4 | * https://github.com/ttdevs 5 | * Copyright (c) 2016 ttdevs 6 | */ 7 | 8 | package zkk.com.mengqu.commit.fragment; 9 | 10 | import android.os.Bundle; 11 | import android.support.design.widget.TabLayout; 12 | import android.support.v4.app.Fragment; 13 | import android.support.v4.app.FragmentManager; 14 | import android.support.v4.app.FragmentPagerAdapter; 15 | import android.support.v4.view.ViewPager; 16 | import android.view.LayoutInflater; 17 | import android.view.View; 18 | import android.view.ViewGroup; 19 | 20 | import java.util.ArrayList; 21 | import java.util.List; 22 | 23 | import zkk.com.mengqu.R; 24 | 25 | public class CommitVageFragment extends Fragment { 26 | 27 | private List mFragmentList = new ArrayList<>(); 28 | 29 | private TabLayout tableLayout; 30 | private ViewPager viewPager; 31 | private ApnFragmentAdapter mAdapter; 32 | 33 | @Override 34 | public View onCreateView(LayoutInflater inflater, ViewGroup container, 35 | Bundle savedInstanceState) { 36 | // TODO Auto-generated method stub 37 | View view=inflater.inflate(R.layout.fragment_commit, container,false); 38 | mFragmentList.add(new PaintCommitFragment()); 39 | mFragmentList.add(new CommitSharesFragment()); 40 | mFragmentList.add(new CommitLeaderboardFragment()); 41 | 42 | tableLayout = (TabLayout)view.findViewById(R.id.commit_tableLayout); 43 | viewPager = (ViewPager)view.findViewById(R.id.commit_viewPager); 44 | 45 | mAdapter = new ApnFragmentAdapter(getFragmentManager()); 46 | viewPager.setAdapter(mAdapter); 47 | tableLayout.setupWithViewPager(viewPager); 48 | tableLayout.setTabMode(TabLayout.MODE_FIXED); 49 | 50 | return view; 51 | } 52 | 53 | private class ApnFragmentAdapter extends FragmentPagerAdapter { 54 | CharSequence[] TITLE = new CharSequence[]{"画作","分享","排行榜"}; 55 | 56 | public ApnFragmentAdapter(FragmentManager fm) { 57 | super(fm); 58 | } 59 | 60 | @Override 61 | public Fragment getItem(int position) { 62 | return mFragmentList.get(position); 63 | } 64 | 65 | @Override 66 | public int getCount() { 67 | return TITLE.length; 68 | } 69 | 70 | @Override 71 | public CharSequence getPageTitle(int position) { 72 | return TITLE[position]; 73 | } 74 | } 75 | } 76 | -------------------------------------------------------------------------------- /app/src/main/java/zkk/com/mengqu/game/adapter/GamePageAdapter.java: -------------------------------------------------------------------------------- 1 | package zkk.com.mengqu.game.adapter; 2 | 3 | import android.support.v4.app.Fragment; 4 | import android.support.v4.app.FragmentManager; 5 | import android.support.v4.app.FragmentStatePagerAdapter; 6 | import android.view.ViewGroup; 7 | 8 | import zkk.com.mengqu.game.fragment.GameInfoFragment; 9 | import zkk.com.mengqu.game.fragment.GoodThemeFragment; 10 | 11 | /** 12 | * Created by Administrator on 2016/7/1 0001. 13 | */ 14 | public class GamePageAdapter extends FragmentStatePagerAdapter { 15 | 16 | GameInfoFragment gameInfoFragment; 17 | GoodThemeFragment goodThemeFragment; 18 | public GamePageAdapter(FragmentManager fm) { 19 | super(fm); 20 | } 21 | 22 | @Override 23 | public Fragment getItem(int position) { 24 | switch (position) { 25 | case 0: 26 | if (gameInfoFragment == null) { 27 | gameInfoFragment = GameInfoFragment.newInstance(); 28 | } 29 | return gameInfoFragment; 30 | case 1: 31 | if (goodThemeFragment == null) { 32 | goodThemeFragment = GoodThemeFragment.newInstance(); 33 | } 34 | return goodThemeFragment; 35 | } 36 | return null; 37 | } 38 | 39 | @Override 40 | public int getCount() { 41 | // TODO Auto-generated method stub 42 | return 2; 43 | } 44 | 45 | @Override 46 | public void destroyItem(ViewGroup container, int position, Object object) { 47 | // TODO Auto-generated method stub 48 | super.destroyItem(container, position, object); 49 | } 50 | 51 | @Override 52 | public Object instantiateItem(ViewGroup arg0, int arg1) { 53 | // TODO Auto-generated method stub 54 | return super.instantiateItem(arg0, arg1); 55 | } 56 | 57 | } 58 | -------------------------------------------------------------------------------- /app/src/main/java/zkk/com/mengqu/game/adapter/GoodThemeAdapter.java: -------------------------------------------------------------------------------- 1 | package zkk.com.mengqu.game.adapter; 2 | 3 | import android.content.Context; 4 | import android.content.Intent; 5 | import android.view.LayoutInflater; 6 | import android.view.View; 7 | import android.view.ViewGroup; 8 | import android.widget.BaseAdapter; 9 | import android.widget.ImageView; 10 | import android.widget.TextView; 11 | 12 | import java.util.ArrayList; 13 | import java.util.List; 14 | 15 | import zkk.com.mengqu.R; 16 | import zkk.com.mengqu.game.activity.GameInfoItemActivity; 17 | import zkk.com.mengqu.game.bean.GoodThemeBean; 18 | import zkk.com.mengqu.view.glide.MyglideImageView; 19 | 20 | /** 21 | * Created by Administrator on 2016/6/27 0027. 22 | */ 23 | public class GoodThemeAdapter extends BaseAdapter { 24 | 25 | List liveBeens=new ArrayList(); 26 | private Context context; 27 | 28 | public GoodThemeAdapter() { 29 | } 30 | 31 | public GoodThemeAdapter(List liveBeens, Context context) { 32 | this.liveBeens = liveBeens; 33 | this.context = context; 34 | } 35 | 36 | @Override 37 | public int getCount() { 38 | return liveBeens==null?0:liveBeens.size(); 39 | } 40 | 41 | @Override 42 | public Object getItem(int position) { 43 | return liveBeens.get(position); 44 | } 45 | 46 | @Override 47 | public long getItemId(int position) { 48 | return position; 49 | } 50 | 51 | @Override 52 | public View getView(final int position, View convertView, ViewGroup parent) { 53 | 54 | HomeHolder homeHolder; 55 | if(convertView==null){ 56 | homeHolder=new HomeHolder(); 57 | convertView= LayoutInflater.from(context).inflate(R.layout.item_game_theme,null); 58 | homeHolder.iv_tagImg=(ImageView)convertView.findViewById(R.id.img_icon); 59 | homeHolder.tv_tagName=(TextView)convertView.findViewById(R.id.tv_title); 60 | 61 | convertView.setTag(homeHolder); 62 | }else{ 63 | homeHolder=(HomeHolder)convertView.getTag(); 64 | } 65 | 66 | MyglideImageView.setImg(context,homeHolder.iv_tagImg,liveBeens.get(position).getCoverImage()); 67 | homeHolder.tv_tagName.setText(liveBeens.get(position).getTitle()); 68 | 69 | 70 | homeHolder.iv_tagImg.setOnClickListener(new View.OnClickListener() { 71 | @Override 72 | public void onClick(View v) { 73 | Intent intent=new Intent(context, GameInfoItemActivity.class); 74 | intent.putExtra("id",liveBeens.get(position).getId()+""); 75 | context.startActivity(intent); 76 | } 77 | }); 78 | 79 | 80 | return convertView; 81 | } 82 | 83 | class HomeHolder{ 84 | ImageView iv_tagImg; 85 | TextView tv_tagName; 86 | } 87 | } -------------------------------------------------------------------------------- /app/src/main/java/zkk/com/mengqu/game/bean/InfoItemBean.java: -------------------------------------------------------------------------------- 1 | package zkk.com.mengqu.game.bean; 2 | 3 | /** 4 | * Created by Administrator on 2016/7/1 0001. 5 | */ 6 | public class InfoItemBean { 7 | 8 | private int id; 9 | private String title; 10 | private String coverImage; 11 | private String category; 12 | private Integer type; //0:带时间的 1:不带时间的 13 | private String time; 14 | 15 | public InfoItemBean() { 16 | } 17 | 18 | public InfoItemBean(Integer type,int id, String title, String coverImage, String category, String time) { 19 | this.id = id; 20 | this.title = title; 21 | this.coverImage = coverImage; 22 | this.category = category; 23 | this.type = type; 24 | this.time = time; 25 | } 26 | 27 | public int getId() { 28 | return id; 29 | } 30 | 31 | public void setId(int id) { 32 | this.id = id; 33 | } 34 | 35 | public String getTitle() { 36 | return title; 37 | } 38 | 39 | public void setTitle(String title) { 40 | this.title = title; 41 | } 42 | 43 | public String getCoverImage() { 44 | return coverImage; 45 | } 46 | 47 | public void setCoverImage(String coverImage) { 48 | this.coverImage = coverImage; 49 | } 50 | 51 | public String getCategory() { 52 | return category; 53 | } 54 | 55 | public void setCategory(String category) { 56 | this.category = category; 57 | } 58 | 59 | public Integer getType() { 60 | return type; 61 | } 62 | 63 | public void setType(Integer type) { 64 | this.type = type; 65 | } 66 | 67 | public String getTime() { 68 | return time; 69 | } 70 | 71 | public void setTime(String time) { 72 | this.time = time; 73 | } 74 | } 75 | -------------------------------------------------------------------------------- /app/src/main/java/zkk/com/mengqu/home/activity/TabLayoutActivity.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Created by ttdevs at 16-4-14 下午3:52. 3 | * E-mail:ttdevs@gmail.com 4 | * https://github.com/ttdevs 5 | * Copyright (c) 2016 ttdevs 6 | */ 7 | 8 | package zkk.com.mengqu.home.activity; 9 | 10 | import android.os.Bundle; 11 | import android.support.design.widget.TabLayout; 12 | import android.support.v4.app.Fragment; 13 | import android.support.v4.app.FragmentManager; 14 | import android.support.v4.app.FragmentPagerAdapter; 15 | import android.support.v4.view.ViewPager; 16 | import android.view.LayoutInflater; 17 | import android.view.View; 18 | import android.view.ViewGroup; 19 | 20 | import java.util.ArrayList; 21 | import java.util.List; 22 | 23 | import zkk.com.mengqu.R; 24 | import zkk.com.mengqu.home.fragment.HomeAllFragment; 25 | import zkk.com.mengqu.home.fragment.HomeLeaderFragment; 26 | import zkk.com.mengqu.home.fragment.HomeThemeFragment; 27 | 28 | public class TabLayoutActivity extends Fragment { 29 | 30 | private List mFragmentList = new ArrayList<>(); 31 | 32 | private TabLayout tableLayout; 33 | private ViewPager viewPager; 34 | private ApnFragmentAdapter mAdapter; 35 | 36 | @Override 37 | public View onCreateView(LayoutInflater inflater, ViewGroup container, 38 | Bundle savedInstanceState) { 39 | // TODO Auto-generated method stub 40 | View view=inflater.inflate(R.layout.fragment_home, container,false); 41 | mFragmentList.add(new HomeAllFragment()); 42 | mFragmentList.add(new HomeThemeFragment()); 43 | mFragmentList.add(new HomeLeaderFragment()); 44 | 45 | tableLayout = (TabLayout)view.findViewById(R.id.tableLayout); 46 | viewPager = (ViewPager)view.findViewById(R.id.viewPager); 47 | 48 | mAdapter = new ApnFragmentAdapter(getFragmentManager()); 49 | viewPager.setAdapter(mAdapter); 50 | tableLayout.setupWithViewPager(viewPager); 51 | tableLayout.setTabMode(TabLayout.MODE_FIXED); 52 | 53 | return view; 54 | } 55 | 56 | private class ApnFragmentAdapter extends FragmentPagerAdapter { 57 | CharSequence[] TITLE = new CharSequence[]{"全部","主题","排行榜"}; 58 | 59 | public ApnFragmentAdapter(FragmentManager fm) { 60 | super(fm); 61 | } 62 | 63 | @Override 64 | public Fragment getItem(int position) { 65 | return mFragmentList.get(position); 66 | } 67 | 68 | @Override 69 | public int getCount() { 70 | return TITLE.length; 71 | } 72 | 73 | @Override 74 | public CharSequence getPageTitle(int position) { 75 | return TITLE[position]; 76 | } 77 | } 78 | } 79 | -------------------------------------------------------------------------------- /app/src/main/java/zkk/com/mengqu/home/adapter/HomeThemeAdapter.java: -------------------------------------------------------------------------------- 1 | package zkk.com.mengqu.home.adapter; 2 | 3 | import android.content.Context; 4 | import android.content.Intent; 5 | import android.view.LayoutInflater; 6 | import android.view.View; 7 | import android.view.ViewGroup; 8 | import android.widget.BaseAdapter; 9 | import android.widget.ImageView; 10 | import android.widget.TextView; 11 | 12 | import java.util.ArrayList; 13 | import java.util.List; 14 | 15 | import zkk.com.mengqu.R; 16 | import zkk.com.mengqu.home.bean.HomeThemeBean; 17 | import zkk.com.mengqu.theme.activity.ThemeItemActivity; 18 | import zkk.com.mengqu.view.glide.MyglideImageView; 19 | 20 | /** 21 | * Created by Administrator on 2016/6/27 0027. 22 | */ 23 | public class HomeThemeAdapter extends BaseAdapter { 24 | 25 | List liveBeens=new ArrayList(); 26 | private Context context; 27 | 28 | public HomeThemeAdapter() { 29 | } 30 | 31 | public HomeThemeAdapter(List liveBeens, Context context) { 32 | this.liveBeens = liveBeens; 33 | this.context = context; 34 | } 35 | 36 | @Override 37 | public int getCount() { 38 | return liveBeens.size(); 39 | } 40 | 41 | @Override 42 | public Object getItem(int position) { 43 | return liveBeens.get(position); 44 | } 45 | 46 | @Override 47 | public long getItemId(int position) { 48 | return position; 49 | } 50 | 51 | @Override 52 | public View getView(final int position, View convertView, ViewGroup parent) { 53 | 54 | HomeHolder homeHolder; 55 | if(convertView==null){ 56 | homeHolder=new HomeHolder(); 57 | convertView= LayoutInflater.from(context).inflate(R.layout.item_theme,null); 58 | homeHolder.iv_tagImg=(ImageView)convertView.findViewById(R.id.iv_tagImg); 59 | homeHolder.tv_tagName=(TextView)convertView.findViewById(R.id.tv_tagName); 60 | 61 | convertView.setTag(homeHolder); 62 | }else{ 63 | homeHolder=(HomeHolder)convertView.getTag(); 64 | } 65 | 66 | MyglideImageView.setImg(context,homeHolder.iv_tagImg,liveBeens.get(position).getCoverImage()); 67 | homeHolder.tv_tagName.setText(liveBeens.get(position).getName()); 68 | 69 | 70 | homeHolder.iv_tagImg.setOnClickListener(new View.OnClickListener() { 71 | @Override 72 | public void onClick(View v) { 73 | Intent intent=new Intent(context, ThemeItemActivity.class); 74 | intent.putExtra("themeId",liveBeens.get(position).getId()); 75 | context.startActivity(intent); 76 | } 77 | }); 78 | 79 | 80 | return convertView; 81 | } 82 | 83 | class HomeHolder{ 84 | ImageView iv_tagImg; 85 | TextView tv_tagName; 86 | } 87 | } -------------------------------------------------------------------------------- /app/src/main/java/zkk/com/mengqu/imagslists/adapter/ImagesListsAdapter.java: -------------------------------------------------------------------------------- 1 | package zkk.com.mengqu.imagslists.adapter; 2 | 3 | import android.content.Context; 4 | import android.view.LayoutInflater; 5 | import android.view.View; 6 | import android.view.ViewGroup; 7 | import android.widget.BaseAdapter; 8 | import android.widget.ImageView; 9 | 10 | import zkk.com.mengqu.R; 11 | import zkk.com.mengqu.imagslists.bean.ImagsListBean; 12 | import zkk.com.mengqu.view.glide.MyglideImageView; 13 | 14 | /** 15 | * Created by Administrator on 2016/6/27 0027. 16 | */ 17 | public class ImagesListsAdapter extends BaseAdapter { 18 | 19 | // List liveBeens=new ArrayList(); 20 | ImagsListBean imagsListBean =new ImagsListBean(); 21 | private Context context; 22 | private Itemclick itemclick; 23 | 24 | public ImagesListsAdapter() { 25 | } 26 | 27 | public ImagesListsAdapter(ImagsListBean liveBeen2, Context context) { 28 | this.imagsListBean = liveBeen2; 29 | this.context = context; 30 | } 31 | 32 | @Override 33 | public int getCount() { 34 | return imagsListBean.getImages()==null?0:imagsListBean.getImages().size(); 35 | } 36 | 37 | @Override 38 | public Object getItem(int position) { 39 | return imagsListBean.getImages().get(position); 40 | } 41 | 42 | @Override 43 | public long getItemId(int position) { 44 | return position; 45 | } 46 | 47 | @Override 48 | public View getView(final int position, View convertView, ViewGroup parent) { 49 | 50 | HomeHolder homeHolder; 51 | if(convertView==null){ 52 | homeHolder=new HomeHolder(); 53 | convertView= LayoutInflater.from(context).inflate(R.layout.imagelist_item,null); 54 | homeHolder.iv_img=(ImageView)convertView.findViewById(R.id.iv_img); 55 | 56 | 57 | convertView.setTag(homeHolder); 58 | }else{ 59 | homeHolder=(HomeHolder)convertView.getTag(); 60 | } 61 | 62 | MyglideImageView.setImg(context,homeHolder.iv_img,imagsListBean.getImages().get(position).toString() 63 | +"?imageView2/1/w/240/h/240"); 64 | homeHolder.iv_img.setOnClickListener(new View.OnClickListener() { 65 | @Override 66 | public void onClick(View v) { 67 | itemclick.setMyOnitemclick(position); 68 | } 69 | }); 70 | 71 | return convertView; 72 | } 73 | 74 | class HomeHolder{ 75 | ImageView iv_img; 76 | } 77 | 78 | public void setItemclick(Itemclick l){ 79 | itemclick=l; 80 | } 81 | public interface Itemclick{ 82 | void setMyOnitemclick(int poistions); 83 | } 84 | } -------------------------------------------------------------------------------- /app/src/main/java/zkk/com/mengqu/imagslists/bean/PhotosBean.java: -------------------------------------------------------------------------------- 1 | package zkk.com.mengqu.imagslists.bean; 2 | 3 | public class PhotosBean 4 | { 5 | private String id; 6 | private String url; 7 | 8 | public String getId() { 9 | return id; 10 | } 11 | 12 | public void setId(String id) { 13 | this.id = id; 14 | } 15 | 16 | public String getUrl() { 17 | return url; 18 | } 19 | 20 | public void setUrl(String url) { 21 | this.url = url; 22 | } 23 | } -------------------------------------------------------------------------------- /app/src/main/java/zkk/com/mengqu/news/bean/NewsItemBean.java: -------------------------------------------------------------------------------- 1 | package zkk.com.mengqu.news.bean; 2 | 3 | /** 4 | * Created by Administrator on 2016/7/1 0001. 5 | */ 6 | public class NewsItemBean { 7 | 8 | private int id; 9 | private String title; 10 | private String coverImage; 11 | private String category; 12 | private Integer type; //0:带时间的 1:不带时间的 13 | private String time; 14 | 15 | public NewsItemBean() { 16 | } 17 | 18 | public NewsItemBean(Integer type, int id, String title, String coverImage, String category, String time) { 19 | this.id = id; 20 | this.title = title; 21 | this.coverImage = coverImage; 22 | this.category = category; 23 | this.type = type; 24 | this.time = time; 25 | } 26 | 27 | public int getId() { 28 | return id; 29 | } 30 | 31 | public void setId(int id) { 32 | this.id = id; 33 | } 34 | 35 | public String getTitle() { 36 | return title; 37 | } 38 | 39 | public void setTitle(String title) { 40 | this.title = title; 41 | } 42 | 43 | public String getCoverImage() { 44 | return coverImage; 45 | } 46 | 47 | public void setCoverImage(String coverImage) { 48 | this.coverImage = coverImage; 49 | } 50 | 51 | public String getCategory() { 52 | return category; 53 | } 54 | 55 | public void setCategory(String category) { 56 | this.category = category; 57 | } 58 | 59 | public Integer getType() { 60 | return type; 61 | } 62 | 63 | public void setType(Integer type) { 64 | this.type = type; 65 | } 66 | 67 | public String getTime() { 68 | return time; 69 | } 70 | 71 | public void setTime(String time) { 72 | this.time = time; 73 | } 74 | } 75 | -------------------------------------------------------------------------------- /app/src/main/java/zkk/com/mengqu/retrofit2/api/MengquApi.java: -------------------------------------------------------------------------------- 1 | package zkk.com.mengqu.retrofit2.api; 2 | 3 | import okhttp3.OkHttpClient; 4 | import retrofit2.CallAdapter; 5 | import retrofit2.Converter; 6 | import retrofit2.Retrofit; 7 | import retrofit2.adapter.rxjava.RxJavaCallAdapterFactory; 8 | import retrofit2.converter.gson.GsonConverterFactory; 9 | import zkk.com.mengqu.retrofit2.interfaces.ApimoejuInterface; 10 | import zkk.com.mengqu.retrofit2.interfaces.ApiwwwmoejuInterface; 11 | 12 | /** 13 | * Created by Administrator on 2016/6/27 0027. 14 | */ 15 | public class MengquApi { 16 | 17 | public static ApimoejuInterface apimoejuInterface; 18 | public static ApiwwwmoejuInterface apiwwwmoejuInterface; 19 | 20 | private static OkHttpClient okHttpClient = new OkHttpClient(); 21 | 22 | private static Converter.Factory gsonConverterFactory = GsonConverterFactory.create(); 23 | private static CallAdapter.Factory rxJavaCallAdapterFactory = RxJavaCallAdapterFactory.create(); 24 | 25 | 26 | public static ApimoejuInterface getInstance(){ 27 | 28 | 29 | if(apimoejuInterface==null){ 30 | Retrofit retrofit = new Retrofit.Builder() 31 | .client(okHttpClient) 32 | .baseUrl("http://api.moeju.cn/") 33 | .addConverterFactory(gsonConverterFactory) 34 | .addCallAdapterFactory(rxJavaCallAdapterFactory) 35 | .build(); 36 | apimoejuInterface = retrofit.create(ApimoejuInterface.class); 37 | } 38 | return apimoejuInterface; 39 | } 40 | 41 | 42 | 43 | public static ApiwwwmoejuInterface getwwwInstance(){ 44 | 45 | if(apiwwwmoejuInterface==null){ 46 | Retrofit retrofit = new Retrofit.Builder() 47 | .client(okHttpClient) 48 | .baseUrl("http://www.moeju.cn/") 49 | .addConverterFactory(gsonConverterFactory) 50 | .addCallAdapterFactory(rxJavaCallAdapterFactory) 51 | .build(); 52 | apiwwwmoejuInterface = retrofit.create(ApiwwwmoejuInterface.class); 53 | } 54 | return apiwwwmoejuInterface; 55 | } 56 | } 57 | -------------------------------------------------------------------------------- /app/src/main/java/zkk/com/mengqu/retrofit2/interfaces/ApiwwwmoejuInterface.java: -------------------------------------------------------------------------------- 1 | package zkk.com.mengqu.retrofit2.interfaces; 2 | 3 | 4 | import retrofit2.http.GET; 5 | import retrofit2.http.Query; 6 | import rx.Observable; 7 | import zkk.com.mengqu.game.bean.GameInfoBean; 8 | import zkk.com.mengqu.game.bean.InfoHtmlBean; 9 | import zkk.com.mengqu.home.bean.HomeitemBean; 10 | import zkk.com.mengqu.news.bean.NewsBean; 11 | 12 | /** 13 | * Created by Administrator on 2016/6/27 0027. 14 | */ 15 | public interface ApiwwwmoejuInterface { 16 | 17 | 18 | //http://www.moeju.cn/api/leaderboard?dk=5ed40069e20354be&ak=~68EECA63-0FB4-1EB8-628D-CDCF663CEB41&v=2.1.0&os=a&channel=Xiaomi 19 | @GET("api/leaderboard") 20 | Observable getHomeleaderboard(@Query("dk") String dk, @Query("ak") String ak, @Query("v") String v, @Query("os") String os 21 | , @Query("channel") String channel); 22 | 23 | //http://www.moeju.cn/api//gamenews?lastTime=0&dk=5ed40069e20354be&ak=~68EECA63-0FB4-1EB8-628D-CDCF663CEB41&v=2.1.0&os=a&channel=Xiaomi 24 | // 游戏--- 最新资讯 25 | @GET("api/gamenews") 26 | Observable getgamenews(@Query("lastTime") String lastTime,@Query("dk") String dk,@Query("ak") String ak,@Query("v") String v); 27 | 28 | //http://www.moeju.cn/api//newsdetail?id=751426&dk=5ed40069e20354be&ak=~68EECA63-0FB4-1EB8-628D-CDCF663CEB41&v=2.1.0&os=a&channel=Xiaomi 29 | //点击某一项后 打开的网页 30 | @GET("api/newsdetail") 31 | Observable getnewsdetail(@Query("id") String id, @Query("dk") String dk, @Query("ak") String ak); 32 | 33 | 34 | //http://www.moeju.cn/api//news?lastTime=0&dk=5ed40069e20354be&ak=~68EECA63-0FB4-1EB8-628D-CDCF663CEB41&v=2.1.0&os=a&channel=Xiaomi 35 | //资讯 36 | @GET("api/news") 37 | Observable getnews(@Query("lastTime") String lastTime, @Query("dk") String dk, @Query("ak") String ak); 38 | 39 | 40 | } 41 | -------------------------------------------------------------------------------- /app/src/main/java/zkk/com/mengqu/simplepreferences/SimplePreferences.java: -------------------------------------------------------------------------------- 1 | package zkk.com.mengqu.simplepreferences; 2 | 3 | import com.baoyz.treasure.Preferences; 4 | 5 | import zkk.com.mengqu.home.bean.HomeitemBean; 6 | 7 | /** 8 | * Created by Administrator on 2016/7/8 0008. 9 | */ 10 | @Preferences 11 | public interface SimplePreferences { 12 | 13 | 14 | 15 | /** 16 | * 图集-全部 17 | */ 18 | HomeitemBean getHomeAll(); 19 | void setHomeAll(HomeitemBean homeall); 20 | 21 | 22 | /** 23 | * 图集-主题 24 | */ 25 | String getHomeTheme(); 26 | void setHomeTheme(String homeTheme); 27 | 28 | 29 | 30 | /** 31 | * 图集-排行榜 32 | */ 33 | String getHomeLeader(); 34 | void setHomeLeader(String homeLeader); 35 | 36 | /** 37 | * 游戏-最新资讯 38 | */ 39 | String getGameInfo(); 40 | void setGameInfo(String gameInfo); 41 | 42 | /** 43 | * 游戏-精彩专题 44 | */ 45 | String getGameTheme(); 46 | void setGameTheme(String gameTheme); 47 | 48 | 49 | /** 50 | * 社区-画作 51 | */ 52 | String getPaint(); 53 | void setPaint(String paint); 54 | 55 | /** 56 | * 社区-分享-日常 57 | */ 58 | String getShareDaily(); 59 | void setShareDaily(String shareDaily); 60 | 61 | /** 62 | * 社区-分享-吐槽 63 | */ 64 | String getShareTucao(); 65 | void setShareTucao(String shareTucao); 66 | 67 | 68 | /** 69 | * 社区-分享-番剧 70 | */ 71 | String getShareFanju(); 72 | void setShareFanju(String shareFanju); 73 | 74 | 75 | /** 76 | * 社区-分享-cos 77 | */ 78 | String getShareCos(); 79 | void setShareCos(String cos); 80 | 81 | 82 | /** 83 | * 社区-排行榜-日排行 84 | */ 85 | String getLeaderBoardDay(); 86 | void setLeaderBoardDay(String leaderBoardDay); 87 | 88 | 89 | /** 90 | * 社区-排行榜-周排行 91 | */ 92 | String getLeaderBoardWeek(); 93 | void setLeaderBoardWeek(String leaderBoardWeek); 94 | 95 | 96 | /** 97 | * 社区-排行榜-月排行 98 | */ 99 | String getLeaderBoardMonth(); 100 | void setLeaderBoardMoth(String leaderBoardWeek); 101 | 102 | 103 | /** 104 | * 资讯 105 | */ 106 | String getNews(); 107 | void setNews(String news); 108 | 109 | } 110 | -------------------------------------------------------------------------------- /app/src/main/java/zkk/com/mengqu/theme/activity/ThemeItemActivity.java: -------------------------------------------------------------------------------- 1 | package zkk.com.mengqu.theme.activity; 2 | 3 | import android.content.Context; 4 | import android.os.Bundle; 5 | import android.support.annotation.Nullable; 6 | import android.support.v7.app.AppCompatActivity; 7 | import android.util.Log; 8 | import android.widget.ListView; 9 | import android.widget.Toast; 10 | 11 | import rx.Observer; 12 | import rx.android.schedulers.AndroidSchedulers; 13 | import rx.schedulers.Schedulers; 14 | import zkk.com.mengqu.R; 15 | import zkk.com.mengqu.retrofit2.api.MengquApi; 16 | import zkk.com.mengqu.theme.adapter.ThemeListsAdapter; 17 | import zkk.com.mengqu.theme.bean.ThemeItemBena; 18 | 19 | /** 20 | * Created by Administrator on 2016/6/27 0027. 21 | */ 22 | public class ThemeItemActivity extends AppCompatActivity { 23 | 24 | private ListView listView; 25 | private ThemeListsAdapter themeListsAdapter; 26 | private Context context; 27 | private int pageNo3item=1; 28 | ThemeItemBena liveBeens=new ThemeItemBena(); 29 | 30 | Observer observer=new Observer() { 31 | @Override 32 | public void onCompleted() { 33 | 34 | } 35 | 36 | @Override 37 | public void onError(Throwable e) { 38 | Toast.makeText(context, "fail", Toast.LENGTH_SHORT).show(); 39 | Log.d("zkk---","错误-"+e); 40 | } 41 | 42 | @Override 43 | public void onNext(ThemeItemBena result) { 44 | liveBeens=result; 45 | themeListsAdapter=new ThemeListsAdapter(liveBeens,context); 46 | listView.setAdapter(themeListsAdapter); 47 | } 48 | }; 49 | 50 | 51 | @Override 52 | protected void onCreate(@Nullable Bundle savedInstanceState) { 53 | super.onCreate(savedInstanceState); 54 | setContentView(R.layout.activity_main); 55 | 56 | context=this; 57 | Bundle bundle=getIntent().getExtras(); 58 | listView=(ListView)findViewById(R.id.expandableListView); 59 | pageNo3item=bundle.getInt("themeId"); 60 | Log.d("zkk","onCreate"+pageNo3item); 61 | getAppIndexData(pageNo3item,pageNo3item); 62 | } 63 | 64 | 65 | //http://api.moeju.cn/Picture/themePicture?themeId=19&lastId=0&lastTime=0 66 | private void getAppIndexData(int dataType, int pageNo3){ 67 | MengquApi.getInstance().getthemePicture(dataType+"","0","0") 68 | .subscribeOn(Schedulers.io()) 69 | .observeOn(AndroidSchedulers.mainThread()) 70 | .subscribe(observer); 71 | } 72 | 73 | @Override 74 | public void onDestroy() { 75 | super.onDestroy(); 76 | } 77 | 78 | } -------------------------------------------------------------------------------- /app/src/main/java/zkk/com/mengqu/user/fragment/UserFragment.java: -------------------------------------------------------------------------------- 1 | package zkk.com.mengqu.user.fragment; 2 | 3 | import android.content.Context; 4 | import android.os.Bundle; 5 | import android.support.annotation.Nullable; 6 | import android.support.v4.app.Fragment; 7 | import android.view.LayoutInflater; 8 | import android.view.View; 9 | import android.view.ViewGroup; 10 | import android.widget.LinearLayout; 11 | 12 | import java.util.ArrayList; 13 | import java.util.List; 14 | 15 | import zkk.com.mengqu.R; 16 | import zkk.com.mengqu.news.adapter.NewsAdapter; 17 | import zkk.com.mengqu.news.bean.NewsItemBean; 18 | import zkk.com.mengqu.simplepreferences.SharePreferences; 19 | 20 | /** 21 | * Created by Administrator on 2016/7/1 0001. 22 | * 资讯 23 | */ 24 | public class UserFragment extends Fragment{ 25 | 26 | private View view; 27 | List newsItemBeen=new ArrayList(); 28 | private NewsAdapter newsAdapter; 29 | private Context context; 30 | private LinearLayout ll_clear; 31 | 32 | 33 | public static UserFragment newInstance(){ 34 | 35 | UserFragment gameInfoFragment=new UserFragment(); 36 | return gameInfoFragment; 37 | } 38 | 39 | @Nullable 40 | @Override 41 | public View onCreateView(LayoutInflater inflater, @Nullable ViewGroup container, @Nullable Bundle savedInstanceState) { 42 | view=inflater.inflate(R.layout.fragment_user,container,false); 43 | context=getActivity(); 44 | return view; 45 | } 46 | 47 | @Override 48 | public void onDestroy() { 49 | super.onDestroy(); 50 | } 51 | 52 | private void init(){ 53 | ll_clear=(LinearLayout)view.findViewById(R.id.ll_clear); 54 | ll_clear.setOnClickListener(new View.OnClickListener() { 55 | @Override 56 | public void onClick(View v) { 57 | SharePreferences.getInstance(context).clear(context); 58 | } 59 | }); 60 | 61 | 62 | 63 | } 64 | @Override 65 | public void onActivityCreated(@Nullable Bundle savedInstanceState) { 66 | super.onActivityCreated(savedInstanceState); 67 | init(); 68 | } 69 | } 70 | -------------------------------------------------------------------------------- /app/src/main/java/zkk/com/mengqu/view/placeholder/CorpSizeMatcher.java: -------------------------------------------------------------------------------- 1 | package zkk.com.mengqu.view.placeholder; 2 | 3 | import android.graphics.Rect; 4 | import android.graphics.drawable.Drawable; 5 | 6 | /** 7 | * 默认图片尺寸匹配器 8 | * Created by ling(quan.ling@hotmail.com) on 16/5/23. 9 | */ 10 | public interface CorpSizeMatcher { 11 | /** 12 | * 获取中心图片大小 13 | * @param bounds 控件尺寸 14 | * @return 图片Rect 15 | */ 16 | Rect getBounds(Drawable origin, Rect bounds); 17 | 18 | abstract class MatcherFactory { 19 | /** 20 | * 21 | * @param origin 原drawble 22 | * @param bounds imageview大小 23 | * @return 匹配器 24 | */ 25 | public abstract CorpSizeMatcher getMatcher(Drawable origin, Rect bounds); 26 | } 27 | } 28 | -------------------------------------------------------------------------------- /app/src/main/res/drawable-hdpi-v4/avarat_small_bg.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/panacena/mengqu/1aef82b772e4f5efdb3ddc8c26f68940e3deeb0f/app/src/main/res/drawable-hdpi-v4/avarat_small_bg.png -------------------------------------------------------------------------------- /app/src/main/res/drawable-hdpi-v4/back2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/panacena/mengqu/1aef82b772e4f5efdb3ddc8c26f68940e3deeb0f/app/src/main/res/drawable-hdpi-v4/back2x.png -------------------------------------------------------------------------------- /app/src/main/res/drawable-hdpi-v4/back_white.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/panacena/mengqu/1aef82b772e4f5efdb3ddc8c26f68940e3deeb0f/app/src/main/res/drawable-hdpi-v4/back_white.png -------------------------------------------------------------------------------- /app/src/main/res/drawable-hdpi-v4/clear.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/panacena/mengqu/1aef82b772e4f5efdb3ddc8c26f68940e3deeb0f/app/src/main/res/drawable-hdpi-v4/clear.png -------------------------------------------------------------------------------- /app/src/main/res/drawable-hdpi-v4/communite_nomal.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/panacena/mengqu/1aef82b772e4f5efdb3ddc8c26f68940e3deeb0f/app/src/main/res/drawable-hdpi-v4/communite_nomal.png -------------------------------------------------------------------------------- /app/src/main/res/drawable-hdpi-v4/communite_select.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/panacena/mengqu/1aef82b772e4f5efdb3ddc8c26f68940e3deeb0f/app/src/main/res/drawable-hdpi-v4/communite_select.png -------------------------------------------------------------------------------- /app/src/main/res/drawable-hdpi-v4/daily_comment.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/panacena/mengqu/1aef82b772e4f5efdb3ddc8c26f68940e3deeb0f/app/src/main/res/drawable-hdpi-v4/daily_comment.png -------------------------------------------------------------------------------- /app/src/main/res/drawable-hdpi-v4/delete_icon.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/panacena/mengqu/1aef82b772e4f5efdb3ddc8c26f68940e3deeb0f/app/src/main/res/drawable-hdpi-v4/delete_icon.png -------------------------------------------------------------------------------- /app/src/main/res/drawable-hdpi-v4/download.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/panacena/mengqu/1aef82b772e4f5efdb3ddc8c26f68940e3deeb0f/app/src/main/res/drawable-hdpi-v4/download.png -------------------------------------------------------------------------------- /app/src/main/res/drawable-hdpi-v4/download_header.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/panacena/mengqu/1aef82b772e4f5efdb3ddc8c26f68940e3deeb0f/app/src/main/res/drawable-hdpi-v4/download_header.png -------------------------------------------------------------------------------- /app/src/main/res/drawable-hdpi-v4/download_icon2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/panacena/mengqu/1aef82b772e4f5efdb3ddc8c26f68940e3deeb0f/app/src/main/res/drawable-hdpi-v4/download_icon2x.png -------------------------------------------------------------------------------- /app/src/main/res/drawable-hdpi-v4/game_nomal.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/panacena/mengqu/1aef82b772e4f5efdb3ddc8c26f68940e3deeb0f/app/src/main/res/drawable-hdpi-v4/game_nomal.png -------------------------------------------------------------------------------- /app/src/main/res/drawable-hdpi-v4/game_select.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/panacena/mengqu/1aef82b772e4f5efdb3ddc8c26f68940e3deeb0f/app/src/main/res/drawable-hdpi-v4/game_select.png -------------------------------------------------------------------------------- /app/src/main/res/drawable-hdpi-v4/guess.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/panacena/mengqu/1aef82b772e4f5efdb3ddc8c26f68940e3deeb0f/app/src/main/res/drawable-hdpi-v4/guess.png -------------------------------------------------------------------------------- /app/src/main/res/drawable-hdpi-v4/home_bottlom01_hover.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/panacena/mengqu/1aef82b772e4f5efdb3ddc8c26f68940e3deeb0f/app/src/main/res/drawable-hdpi-v4/home_bottlom01_hover.png -------------------------------------------------------------------------------- /app/src/main/res/drawable-hdpi-v4/home_bottom01.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/panacena/mengqu/1aef82b772e4f5efdb3ddc8c26f68940e3deeb0f/app/src/main/res/drawable-hdpi-v4/home_bottom01.png -------------------------------------------------------------------------------- /app/src/main/res/drawable-hdpi-v4/home_bottom02.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/panacena/mengqu/1aef82b772e4f5efdb3ddc8c26f68940e3deeb0f/app/src/main/res/drawable-hdpi-v4/home_bottom02.png -------------------------------------------------------------------------------- /app/src/main/res/drawable-hdpi-v4/home_bottom02_hover.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/panacena/mengqu/1aef82b772e4f5efdb3ddc8c26f68940e3deeb0f/app/src/main/res/drawable-hdpi-v4/home_bottom02_hover.png -------------------------------------------------------------------------------- /app/src/main/res/drawable-hdpi-v4/home_bottom03.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/panacena/mengqu/1aef82b772e4f5efdb3ddc8c26f68940e3deeb0f/app/src/main/res/drawable-hdpi-v4/home_bottom03.png -------------------------------------------------------------------------------- /app/src/main/res/drawable-hdpi-v4/home_bottom03_hover.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/panacena/mengqu/1aef82b772e4f5efdb3ddc8c26f68940e3deeb0f/app/src/main/res/drawable-hdpi-v4/home_bottom03_hover.png -------------------------------------------------------------------------------- /app/src/main/res/drawable-hdpi-v4/home_painter_selecter.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/panacena/mengqu/1aef82b772e4f5efdb3ddc8c26f68940e3deeb0f/app/src/main/res/drawable-hdpi-v4/home_painter_selecter.png -------------------------------------------------------------------------------- /app/src/main/res/drawable-hdpi-v4/home_painters.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/panacena/mengqu/1aef82b772e4f5efdb3ddc8c26f68940e3deeb0f/app/src/main/res/drawable-hdpi-v4/home_painters.png -------------------------------------------------------------------------------- /app/src/main/res/drawable-hdpi-v4/hot_event.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/panacena/mengqu/1aef82b772e4f5efdb3ddc8c26f68940e3deeb0f/app/src/main/res/drawable-hdpi-v4/hot_event.png -------------------------------------------------------------------------------- /app/src/main/res/drawable-hdpi-v4/hot_game.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/panacena/mengqu/1aef82b772e4f5efdb3ddc8c26f68940e3deeb0f/app/src/main/res/drawable-hdpi-v4/hot_game.png -------------------------------------------------------------------------------- /app/src/main/res/drawable-hdpi-v4/ic_commentator_loading.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/panacena/mengqu/1aef82b772e4f5efdb3ddc8c26f68940e3deeb0f/app/src/main/res/drawable-hdpi-v4/ic_commentator_loading.png -------------------------------------------------------------------------------- /app/src/main/res/drawable-hdpi-v4/icon_comic.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/panacena/mengqu/1aef82b772e4f5efdb3ddc8c26f68940e3deeb0f/app/src/main/res/drawable-hdpi-v4/icon_comic.png -------------------------------------------------------------------------------- /app/src/main/res/drawable-hdpi-v4/icon_empty_loading1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/panacena/mengqu/1aef82b772e4f5efdb3ddc8c26f68940e3deeb0f/app/src/main/res/drawable-hdpi-v4/icon_empty_loading1.png -------------------------------------------------------------------------------- /app/src/main/res/drawable-hdpi-v4/icon_empty_loading2.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/panacena/mengqu/1aef82b772e4f5efdb3ddc8c26f68940e3deeb0f/app/src/main/res/drawable-hdpi-v4/icon_empty_loading2.png -------------------------------------------------------------------------------- /app/src/main/res/drawable-hdpi-v4/icon_empty_loading3.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/panacena/mengqu/1aef82b772e4f5efdb3ddc8c26f68940e3deeb0f/app/src/main/res/drawable-hdpi-v4/icon_empty_loading3.png -------------------------------------------------------------------------------- /app/src/main/res/drawable-hdpi-v4/icon_empty_loading4.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/panacena/mengqu/1aef82b772e4f5efdb3ddc8c26f68940e3deeb0f/app/src/main/res/drawable-hdpi-v4/icon_empty_loading4.png -------------------------------------------------------------------------------- /app/src/main/res/drawable-hdpi-v4/icon_page_empty.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/panacena/mengqu/1aef82b772e4f5efdb3ddc8c26f68940e3deeb0f/app/src/main/res/drawable-hdpi-v4/icon_page_empty.png -------------------------------------------------------------------------------- /app/src/main/res/drawable-hdpi-v4/icon_page_error.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/panacena/mengqu/1aef82b772e4f5efdb3ddc8c26f68940e3deeb0f/app/src/main/res/drawable-hdpi-v4/icon_page_error.png -------------------------------------------------------------------------------- /app/src/main/res/drawable-hdpi-v4/indicator_normal.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/panacena/mengqu/1aef82b772e4f5efdb3ddc8c26f68940e3deeb0f/app/src/main/res/drawable-hdpi-v4/indicator_normal.png -------------------------------------------------------------------------------- /app/src/main/res/drawable-hdpi-v4/indicator_pink.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/panacena/mengqu/1aef82b772e4f5efdb3ddc8c26f68940e3deeb0f/app/src/main/res/drawable-hdpi-v4/indicator_pink.png -------------------------------------------------------------------------------- /app/src/main/res/drawable-hdpi-v4/indicator_selected.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/panacena/mengqu/1aef82b772e4f5efdb3ddc8c26f68940e3deeb0f/app/src/main/res/drawable-hdpi-v4/indicator_selected.png -------------------------------------------------------------------------------- /app/src/main/res/drawable-hdpi-v4/liked_gray2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/panacena/mengqu/1aef82b772e4f5efdb3ddc8c26f68940e3deeb0f/app/src/main/res/drawable-hdpi-v4/liked_gray2x.png -------------------------------------------------------------------------------- /app/src/main/res/drawable-hdpi-v4/liked_red2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/panacena/mengqu/1aef82b772e4f5efdb3ddc8c26f68940e3deeb0f/app/src/main/res/drawable-hdpi-v4/liked_red2x.png -------------------------------------------------------------------------------- /app/src/main/res/drawable-hdpi-v4/list_gradient.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/panacena/mengqu/1aef82b772e4f5efdb3ddc8c26f68940e3deeb0f/app/src/main/res/drawable-hdpi-v4/list_gradient.png -------------------------------------------------------------------------------- /app/src/main/res/drawable-hdpi-v4/login_dividing_lin.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/panacena/mengqu/1aef82b772e4f5efdb3ddc8c26f68940e3deeb0f/app/src/main/res/drawable-hdpi-v4/login_dividing_lin.png -------------------------------------------------------------------------------- /app/src/main/res/drawable-hdpi-v4/login_magin_line.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/panacena/mengqu/1aef82b772e4f5efdb3ddc8c26f68940e3deeb0f/app/src/main/res/drawable-hdpi-v4/login_magin_line.png -------------------------------------------------------------------------------- /app/src/main/res/drawable-hdpi-v4/no1_icon.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/panacena/mengqu/1aef82b772e4f5efdb3ddc8c26f68940e3deeb0f/app/src/main/res/drawable-hdpi-v4/no1_icon.png -------------------------------------------------------------------------------- /app/src/main/res/drawable-hdpi-v4/no2_icon.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/panacena/mengqu/1aef82b772e4f5efdb3ddc8c26f68940e3deeb0f/app/src/main/res/drawable-hdpi-v4/no2_icon.png -------------------------------------------------------------------------------- /app/src/main/res/drawable-hdpi-v4/no3_icon.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/panacena/mengqu/1aef82b772e4f5efdb3ddc8c26f68940e3deeb0f/app/src/main/res/drawable-hdpi-v4/no3_icon.png -------------------------------------------------------------------------------- /app/src/main/res/drawable-hdpi-v4/no4_icon.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/panacena/mengqu/1aef82b772e4f5efdb3ddc8c26f68940e3deeb0f/app/src/main/res/drawable-hdpi-v4/no4_icon.png -------------------------------------------------------------------------------- /app/src/main/res/drawable-hdpi-v4/pic.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/panacena/mengqu/1aef82b772e4f5efdb3ddc8c26f68940e3deeb0f/app/src/main/res/drawable-hdpi-v4/pic.png -------------------------------------------------------------------------------- /app/src/main/res/drawable-hdpi-v4/pic_view_bottom_shadow.9.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/panacena/mengqu/1aef82b772e4f5efdb3ddc8c26f68940e3deeb0f/app/src/main/res/drawable-hdpi-v4/pic_view_bottom_shadow.9.png -------------------------------------------------------------------------------- /app/src/main/res/drawable-hdpi-v4/picture_exam_code.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/panacena/mengqu/1aef82b772e4f5efdb3ddc8c26f68940e3deeb0f/app/src/main/res/drawable-hdpi-v4/picture_exam_code.png -------------------------------------------------------------------------------- /app/src/main/res/drawable-hdpi-v4/setting_icon.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/panacena/mengqu/1aef82b772e4f5efdb3ddc8c26f68940e3deeb0f/app/src/main/res/drawable-hdpi-v4/setting_icon.png -------------------------------------------------------------------------------- /app/src/main/res/drawable-hdpi-v4/setting_store.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/panacena/mengqu/1aef82b772e4f5efdb3ddc8c26f68940e3deeb0f/app/src/main/res/drawable-hdpi-v4/setting_store.png -------------------------------------------------------------------------------- /app/src/main/res/drawable-hdpi-v4/setting_type.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/panacena/mengqu/1aef82b772e4f5efdb3ddc8c26f68940e3deeb0f/app/src/main/res/drawable-hdpi-v4/setting_type.png -------------------------------------------------------------------------------- /app/src/main/res/drawable-hdpi-v4/share2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/panacena/mengqu/1aef82b772e4f5efdb3ddc8c26f68940e3deeb0f/app/src/main/res/drawable-hdpi-v4/share2x.png -------------------------------------------------------------------------------- /app/src/main/res/drawable-hdpi-v4/share_white.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/panacena/mengqu/1aef82b772e4f5efdb3ddc8c26f68940e3deeb0f/app/src/main/res/drawable-hdpi-v4/share_white.png -------------------------------------------------------------------------------- /app/src/main/res/drawable-hdpi-v4/tabbar_image_news.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/panacena/mengqu/1aef82b772e4f5efdb3ddc8c26f68940e3deeb0f/app/src/main/res/drawable-hdpi-v4/tabbar_image_news.png -------------------------------------------------------------------------------- /app/src/main/res/drawable-hdpi-v4/tabbar_image_news_selected.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/panacena/mengqu/1aef82b772e4f5efdb3ddc8c26f68940e3deeb0f/app/src/main/res/drawable-hdpi-v4/tabbar_image_news_selected.png -------------------------------------------------------------------------------- /app/src/main/res/drawable-hdpi-v4/tag_gradient_pic.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/panacena/mengqu/1aef82b772e4f5efdb3ddc8c26f68940e3deeb0f/app/src/main/res/drawable-hdpi-v4/tag_gradient_pic.png -------------------------------------------------------------------------------- /app/src/main/res/drawable-hdpi-v4/upload_icon.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/panacena/mengqu/1aef82b772e4f5efdb3ddc8c26f68940e3deeb0f/app/src/main/res/drawable-hdpi-v4/upload_icon.png -------------------------------------------------------------------------------- /app/src/main/res/drawable-hdpi-v4/webview_top_triangle.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/panacena/mengqu/1aef82b772e4f5efdb3ddc8c26f68940e3deeb0f/app/src/main/res/drawable-hdpi-v4/webview_top_triangle.png -------------------------------------------------------------------------------- /app/src/main/res/drawable-hdpi/ic_123.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/panacena/mengqu/1aef82b772e4f5efdb3ddc8c26f68940e3deeb0f/app/src/main/res/drawable-hdpi/ic_123.png -------------------------------------------------------------------------------- /app/src/main/res/drawable-hdpi/ic_launcher.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/panacena/mengqu/1aef82b772e4f5efdb3ddc8c26f68940e3deeb0f/app/src/main/res/drawable-hdpi/ic_launcher.png -------------------------------------------------------------------------------- /app/src/main/res/drawable-nodpi/list_divider_line.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/panacena/mengqu/1aef82b772e4f5efdb3ddc8c26f68940e3deeb0f/app/src/main/res/drawable-nodpi/list_divider_line.png -------------------------------------------------------------------------------- /app/src/main/res/drawable-nodpi/list_item_normal.9.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/panacena/mengqu/1aef82b772e4f5efdb3ddc8c26f68940e3deeb0f/app/src/main/res/drawable-nodpi/list_item_normal.9.png -------------------------------------------------------------------------------- /app/src/main/res/drawable-nodpi/list_item_pressed.9.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/panacena/mengqu/1aef82b772e4f5efdb3ddc8c26f68940e3deeb0f/app/src/main/res/drawable-nodpi/list_item_pressed.9.png -------------------------------------------------------------------------------- /app/src/main/res/drawable/btn_dhqb_bg.xml: -------------------------------------------------------------------------------- 1 | 2 | 4 | 5 | 6 | -------------------------------------------------------------------------------- /app/src/main/res/drawable/btn_white_bg.xml: -------------------------------------------------------------------------------- 1 | 2 | 4 | 5 | 6 | -------------------------------------------------------------------------------- /app/src/main/res/drawable/costum_progress_bar.xml: -------------------------------------------------------------------------------- 1 | 2 | -------------------------------------------------------------------------------- /app/src/main/res/drawable/divider_item.xml: -------------------------------------------------------------------------------- 1 | 2 | 4 | 5 | 6 | -------------------------------------------------------------------------------- /app/src/main/res/drawable/item_simple_ico.xml: -------------------------------------------------------------------------------- 1 | 2 | 4 | 5 | 6 | 7 | 8 | -------------------------------------------------------------------------------- /app/src/main/res/drawable/list_item_selector.xml: -------------------------------------------------------------------------------- 1 | 2 | 4 | 5 | 6 | 7 | 8 | 9 | -------------------------------------------------------------------------------- /app/src/main/res/drawable/listview_selector.xml: -------------------------------------------------------------------------------- 1 | 2 | 4 | 5 | 6 | 7 | 8 | -------------------------------------------------------------------------------- /app/src/main/res/drawable/page_loading.xml: -------------------------------------------------------------------------------- 1 | 2 | 4 | 5 | 6 | 7 | 8 | -------------------------------------------------------------------------------- /app/src/main/res/drawable/selector_btn_daily.xml: -------------------------------------------------------------------------------- 1 | 2 | 4 | 5 | 6 | 7 | 8 | -------------------------------------------------------------------------------- /app/src/main/res/drawable/selector_btn_paint.xml: -------------------------------------------------------------------------------- 1 | 2 | 4 | 5 | 6 | 7 | 8 | -------------------------------------------------------------------------------- /app/src/main/res/drawable/selector_btn_picture.xml: -------------------------------------------------------------------------------- 1 | 2 | 4 | 5 | 6 | 7 | 8 | -------------------------------------------------------------------------------- /app/src/main/res/drawable/selector_home_btn3.xml: -------------------------------------------------------------------------------- 1 | 2 | 4 | 5 | 6 | 7 | 8 | -------------------------------------------------------------------------------- /app/src/main/res/drawable/selector_indicator.xml: -------------------------------------------------------------------------------- 1 | 2 | 4 | 5 | 6 | -------------------------------------------------------------------------------- /app/src/main/res/drawable/selector_info.xml: -------------------------------------------------------------------------------- 1 | 2 | 4 | 5 | 6 | 7 | 8 | -------------------------------------------------------------------------------- /app/src/main/res/drawable/selector_info_btn.xml: -------------------------------------------------------------------------------- 1 | 2 | 4 | 5 | 6 | 7 | 8 | -------------------------------------------------------------------------------- /app/src/main/res/drawable/selector_info_right.xml: -------------------------------------------------------------------------------- 1 | 2 | 4 | 5 | 6 | 7 | 8 | -------------------------------------------------------------------------------- /app/src/main/res/drawable/selector_like_btn.xml: -------------------------------------------------------------------------------- 1 | 2 | 4 | 5 | 6 | 7 | 8 | -------------------------------------------------------------------------------- /app/src/main/res/drawable/selector_tag.xml: -------------------------------------------------------------------------------- 1 | 2 | 4 | 5 | 6 | 7 | 8 | -------------------------------------------------------------------------------- /app/src/main/res/drawable/shape_comic_like.xml: -------------------------------------------------------------------------------- 1 | 2 | 4 | 5 | 6 | -------------------------------------------------------------------------------- /app/src/main/res/drawable/shape_gray_solid_green_stroke.xml: -------------------------------------------------------------------------------- 1 | 2 | 4 | 5 | 6 | 7 | 8 | -------------------------------------------------------------------------------- /app/src/main/res/drawable/shape_reddot.xml: -------------------------------------------------------------------------------- 1 | 2 | 4 | 5 | 6 | -------------------------------------------------------------------------------- /app/src/main/res/drawable/shape_reg_btn.xml: -------------------------------------------------------------------------------- 1 | 2 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | -------------------------------------------------------------------------------- /app/src/main/res/drawable/shape_research_item_tag.xml: -------------------------------------------------------------------------------- 1 | 2 | 4 | 5 | 6 | -------------------------------------------------------------------------------- /app/src/main/res/drawable/shape_user_register_code.xml: -------------------------------------------------------------------------------- 1 | 2 | 4 | 5 | 6 | -------------------------------------------------------------------------------- /app/src/main/res/drawable/style_order_list_top_menu_left.xml: -------------------------------------------------------------------------------- 1 | 2 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | -------------------------------------------------------------------------------- /app/src/main/res/drawable/style_order_list_top_menu_left_checked.xml: -------------------------------------------------------------------------------- 1 | 2 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | -------------------------------------------------------------------------------- /app/src/main/res/drawable/style_order_list_top_menu_left_checked_orange.xml: -------------------------------------------------------------------------------- 1 | 2 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | -------------------------------------------------------------------------------- /app/src/main/res/drawable/style_order_list_top_menu_left_unchecked_orange.xml: -------------------------------------------------------------------------------- 1 | 2 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | -------------------------------------------------------------------------------- /app/src/main/res/drawable/style_order_list_top_menu_right.xml: -------------------------------------------------------------------------------- 1 | 2 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | -------------------------------------------------------------------------------- /app/src/main/res/drawable/style_order_list_top_menu_right_checked.xml: -------------------------------------------------------------------------------- 1 | 2 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | -------------------------------------------------------------------------------- /app/src/main/res/drawable/style_order_list_top_menu_right_checked_orange.xml: -------------------------------------------------------------------------------- 1 | 2 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | -------------------------------------------------------------------------------- /app/src/main/res/drawable/style_order_list_top_menu_right_unchecked_orange.xml: -------------------------------------------------------------------------------- 1 | 2 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | -------------------------------------------------------------------------------- /app/src/main/res/drawable/text_color_blue_to_white.xml: -------------------------------------------------------------------------------- 1 | 2 | 4 | 5 | 6 | 7 | 8 | -------------------------------------------------------------------------------- /app/src/main/res/layout/activity_base_empty_loading_view.xml: -------------------------------------------------------------------------------- 1 | 2 | 9 | 10 | 13 | 14 | 21 | 22 | -------------------------------------------------------------------------------- /app/src/main/res/layout/activity_base_empty_view.xml: -------------------------------------------------------------------------------- 1 | 2 | 8 | 9 | 15 | 16 | 21 | 22 | 31 | 32 | 42 | 43 | 44 | -------------------------------------------------------------------------------- /app/src/main/res/layout/activity_base_view.xml: -------------------------------------------------------------------------------- 1 | 2 | 7 | 8 | 9 | 15 | 16 | 22 | 23 | -------------------------------------------------------------------------------- /app/src/main/res/layout/activity_download.xml: -------------------------------------------------------------------------------- 1 | 2 | 7 | 8 | 12 | 13 | 22 | -------------------------------------------------------------------------------- /app/src/main/res/layout/activity_gameinfo_all.xml: -------------------------------------------------------------------------------- 1 | 2 | 5 | 6 | 7 | 8 | 9 | -------------------------------------------------------------------------------- /app/src/main/res/layout/activity_grid.xml: -------------------------------------------------------------------------------- 1 | 2 | 5 | 6 | 15 | 16 | -------------------------------------------------------------------------------- /app/src/main/res/layout/activity_info_detail.xml: -------------------------------------------------------------------------------- 1 | 2 | 7 | 8 | 18 | 19 | 26 | 27 | 37 | 38 | 39 | 47 | 53 | -------------------------------------------------------------------------------- /app/src/main/res/layout/activity_main.xml: -------------------------------------------------------------------------------- 1 | 2 | 5 | 6 | 7 | 13 | 14 | 19 | 20 | 21 | 22 | 23 | 39 | 40 | -------------------------------------------------------------------------------- /app/src/main/res/layout/activity_paint.xml: -------------------------------------------------------------------------------- 1 | 2 | 5 | 6 | 22 | 23 | -------------------------------------------------------------------------------- /app/src/main/res/layout/activity_pull_to_zoom_scroll_view.xml: -------------------------------------------------------------------------------- 1 | 2 | 6 | 7 | 11 | 12 | 19 | 20 | 25 | 26 | 32 | 33 | 34 | 41 | 42 | 47 | 48 | 54 | 55 | 56 | -------------------------------------------------------------------------------- /app/src/main/res/layout/fragmeng_theme_content.xml: -------------------------------------------------------------------------------- 1 | 2 | 7 | 8 | 17 | -------------------------------------------------------------------------------- /app/src/main/res/layout/fragment_commit.xml: -------------------------------------------------------------------------------- 1 | 2 | 7 | 8 | 17 | 18 | 22 | 23 | -------------------------------------------------------------------------------- /app/src/main/res/layout/fragment_commit_leader_item.xml: -------------------------------------------------------------------------------- 1 | 2 | 5 | 6 | 7 | 8 | 16 | 17 | 23 | 39 | 40 | 41 | -------------------------------------------------------------------------------- /app/src/main/res/layout/fragment_commit_leaderboard.xml: -------------------------------------------------------------------------------- 1 | 2 | 7 | 8 | 17 | 18 | 22 | 23 | -------------------------------------------------------------------------------- /app/src/main/res/layout/fragment_commit_share.xml: -------------------------------------------------------------------------------- 1 | 2 | 7 | 8 | 17 | 18 | 22 | 23 | -------------------------------------------------------------------------------- /app/src/main/res/layout/fragment_commit_share_item.xml: -------------------------------------------------------------------------------- 1 | 2 | 5 | 6 | 7 | 8 | 14 | 15 | 20 | 21 | 22 | 23 | 39 | 40 | -------------------------------------------------------------------------------- /app/src/main/res/layout/fragment_game.xml: -------------------------------------------------------------------------------- 1 | 2 | 6 | 7 | 8 | 13 | 14 | 18 | 19 | 30 | 31 | 43 | 44 | 56 | 57 | 58 | 59 | 64 | -------------------------------------------------------------------------------- /app/src/main/res/layout/fragment_gameinfo.xml: -------------------------------------------------------------------------------- 1 | 2 | 5 | 6 | 7 | 13 | 14 | 19 | 20 | 21 | 22 | 38 | 39 | -------------------------------------------------------------------------------- /app/src/main/res/layout/fragment_goodtheme.xml: -------------------------------------------------------------------------------- 1 | 2 | 5 | 6 | 15 | 16 | -------------------------------------------------------------------------------- /app/src/main/res/layout/fragment_home.xml: -------------------------------------------------------------------------------- 1 | 2 | 7 | 8 | 18 | 19 | 23 | 24 | -------------------------------------------------------------------------------- /app/src/main/res/layout/fragment_leaderhome.xml: -------------------------------------------------------------------------------- 1 | 2 | 5 | 6 | 7 | 8 | 9 | 10 | 26 | 27 | -------------------------------------------------------------------------------- /app/src/main/res/layout/fragment_news.xml: -------------------------------------------------------------------------------- 1 | 2 | 5 | 6 | 7 | 13 | 14 | 19 | 20 | 21 | 37 | 38 | -------------------------------------------------------------------------------- /app/src/main/res/layout/imagelist_item.xml: -------------------------------------------------------------------------------- 1 | 2 | 7 | 8 | 12 | -------------------------------------------------------------------------------- /app/src/main/res/layout/imglist_header.xml: -------------------------------------------------------------------------------- 1 | 2 | 6 | 7 | 11 | -------------------------------------------------------------------------------- /app/src/main/res/layout/item_comicer_user.xml: -------------------------------------------------------------------------------- 1 | 2 | 8 | 9 | 10 | 11 | 19 | 20 | 53 | 57 | 58 | -------------------------------------------------------------------------------- /app/src/main/res/layout/item_comment_reply.xml: -------------------------------------------------------------------------------- 1 | 2 | 8 | 9 | 17 | 18 | 26 | 27 | 34 | -------------------------------------------------------------------------------- /app/src/main/res/layout/item_game_theme.xml: -------------------------------------------------------------------------------- 1 | 2 | 10 | 11 | 15 | 16 | 22 | 23 | 33 | 34 | -------------------------------------------------------------------------------- /app/src/main/res/layout/item_game_top.xml: -------------------------------------------------------------------------------- 1 | 2 | 10 | 11 | 15 | 16 | 22 | 23 | 33 | 34 | -------------------------------------------------------------------------------- /app/src/main/res/layout/item_header_news.xml: -------------------------------------------------------------------------------- 1 | 2 | 7 | 8 | 17 | 18 | 27 | -------------------------------------------------------------------------------- /app/src/main/res/layout/item_info.xml: -------------------------------------------------------------------------------- 1 | 2 | 6 | 7 | 14 | 15 | 19 | 20 | 27 | 28 | 38 | 39 | 49 | 50 | 51 | -------------------------------------------------------------------------------- /app/src/main/res/layout/item_theme.xml: -------------------------------------------------------------------------------- 1 | 2 | 7 | 8 | 12 | 13 | 19 | 20 | 27 | 28 | -------------------------------------------------------------------------------- /app/src/main/res/layout/item_themelist.xml: -------------------------------------------------------------------------------- 1 | 2 | 9 | 10 | 14 | 15 | 20 | 21 | 31 | -------------------------------------------------------------------------------- /app/src/main/res/layout/load_more_footer2.xml: -------------------------------------------------------------------------------- 1 | 2 | 9 | 10 | 17 | 18 | 26 | -------------------------------------------------------------------------------- /app/src/main/res/layout/poi_photo_pager_item.xml: -------------------------------------------------------------------------------- 1 | 2 | 7 | 12 | -------------------------------------------------------------------------------- /app/src/main/res/layout/pop_beautypics.xml: -------------------------------------------------------------------------------- 1 | 2 | 7 | 8 | 13 | 14 | 46 | 47 | 48 | -------------------------------------------------------------------------------- /app/src/main/res/layout/profile_zoom_view.xml: -------------------------------------------------------------------------------- 1 | 2 | -------------------------------------------------------------------------------- /app/src/main/res/mipmap-hdpi/ic_launcher.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/panacena/mengqu/1aef82b772e4f5efdb3ddc8c26f68940e3deeb0f/app/src/main/res/mipmap-hdpi/ic_launcher.png -------------------------------------------------------------------------------- /app/src/main/res/mipmap-mdpi/ic_launcher.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/panacena/mengqu/1aef82b772e4f5efdb3ddc8c26f68940e3deeb0f/app/src/main/res/mipmap-mdpi/ic_launcher.png -------------------------------------------------------------------------------- /app/src/main/res/mipmap-xhdpi/ic_launcher.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/panacena/mengqu/1aef82b772e4f5efdb3ddc8c26f68940e3deeb0f/app/src/main/res/mipmap-xhdpi/ic_launcher.png -------------------------------------------------------------------------------- /app/src/main/res/mipmap-xxhdpi/ic_launcher.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/panacena/mengqu/1aef82b772e4f5efdb3ddc8c26f68940e3deeb0f/app/src/main/res/mipmap-xxhdpi/ic_launcher.png -------------------------------------------------------------------------------- /app/src/main/res/mipmap-xxxhdpi/ic_launcher.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/panacena/mengqu/1aef82b772e4f5efdb3ddc8c26f68940e3deeb0f/app/src/main/res/mipmap-xxxhdpi/ic_launcher.png -------------------------------------------------------------------------------- /app/src/main/res/values-w820dp/dimens.xml: -------------------------------------------------------------------------------- 1 | 2 | 5 | 64dp 6 | 7 | -------------------------------------------------------------------------------- /app/src/main/res/values/colors.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | #3F51B5 4 | #303F9F 5 | #FF4081 6 | #fff6f6f6 7 | #00000000 8 | #ffdbdbdb 9 | 10 | #ffff0000 11 | #ffffffff 12 | #ff333333 13 | #fff2f2f2 14 | 15 | #ff545454 16 | #ff9a9a9a 17 | #ff4e5151 18 | #ff0596eb 19 | 20 | #ffec8b06 21 | #ffe3e4e6 22 | 23 | 24 | #33000000 25 | #ff000000 26 | 27 | 28 | #ff000000 29 | #33000000 30 | 31 | #ffff9600 32 | #ff8f8f8f 33 | 34 | #aadadada 35 | #ff054a65 36 | #fff26c75 37 | #fff0f1f5 38 | #ffb3b3b3 39 | #ff0dbec8 40 | #ff999999 41 | #ffb9b9b9 42 | #ff787878 43 | 44 | #ff054a65 45 | #ff7b818c 46 | #ff7b818c 47 | #fff9f9f9 48 | #ff0788d4 49 | #ff0c1623 50 | #fff25850 51 | #ff242424 52 | #ff1d9cd6 53 | #ffff5252 54 | #ffffc0cb 55 | 56 | -------------------------------------------------------------------------------- /app/src/main/res/values/dimens.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 16dp 4 | 16dp 5 | 6 | 16.0sp 7 | 8 | 20.0dip 9 | 3.0dip 10 | 30dip 11 | 10.0dip 12 | 45.0dip 13 | 8.0dip 14 | 15 | 5.0dip 16 | 17 | 18 | 22.0sp 19 | 13.0sp 20 | 10.0sp 21 | 14.0sp 22 | 49.0dip 23 | 25.0dip 24 | 12.0sp 25 | 26 | 10.0dip 27 | 18.0sp 28 | 29 | 15.0dip 30 | 13.0dip 31 | 20.0dip 32 | 6.0dip 33 | 3.0dip 34 | 4.0dip 35 | 14.0sp 36 | 12.0sp 37 | 14.0sp 38 | 39 | 16.0sp 40 | 105.0dip 41 | 42 | 24.0sp 43 | 44 | -------------------------------------------------------------------------------- /app/src/main/res/values/strings.xml: -------------------------------------------------------------------------------- 1 | 2 | 萌趣 3 | 申请画师资格 4 | 已验证 5 | 上传画作 6 | 7 | -------------------------------------------------------------------------------- /app/src/main/res/values/styles.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 10 | 11 | 16 | 21 | 22 | 23 | 24 | 25 | 38 | 39 | 44 | 45 | 52 | 53 | 57 | 58 | 59 | 63 | 64 | 65 | 66 | -------------------------------------------------------------------------------- /app/src/main/res/values/values.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | -------------------------------------------------------------------------------- /app/src/test/java/zkk/com/mengqu/ExampleUnitTest.java: -------------------------------------------------------------------------------- 1 | package zkk.com.mengqu; 2 | 3 | import org.junit.Test; 4 | 5 | import static org.junit.Assert.*; 6 | 7 | /** 8 | * To work on unit tests, switch the Test Artifact in the Build Variants view. 9 | */ 10 | public class ExampleUnitTest { 11 | @Test 12 | public void addition_isCorrect() throws Exception { 13 | assertEquals(4, 2 + 2); 14 | } 15 | } -------------------------------------------------------------------------------- /build.gradle: -------------------------------------------------------------------------------- 1 | // Top-level build file where you can add configuration options common to all sub-projects/modules. 2 | 3 | buildscript { 4 | repositories { 5 | jcenter() 6 | } 7 | dependencies { 8 | classpath 'com.android.tools.build:gradle:2.0.0' 9 | 10 | // NOTE: Do not place your application dependencies here; they belong 11 | // in the individual module build.gradle files 12 | } 13 | } 14 | 15 | allprojects { 16 | repositories { 17 | jcenter() 18 | } 19 | } 20 | 21 | task clean(type: Delete) { 22 | delete rootProject.buildDir 23 | } 24 | -------------------------------------------------------------------------------- /gradle.properties: -------------------------------------------------------------------------------- 1 | # Project-wide Gradle settings. 2 | 3 | # IDE (e.g. Android Studio) users: 4 | # Gradle settings configured through the IDE *will override* 5 | # any settings specified in this file. 6 | 7 | # For more details on how to configure your build environment visit 8 | # http://www.gradle.org/docs/current/userguide/build_environment.html 9 | 10 | # Specifies the JVM arguments used for the daemon process. 11 | # The setting is particularly useful for tweaking memory settings. 12 | # Default value: -Xmx10248m -XX:MaxPermSize=256m 13 | # org.gradle.jvmargs=-Xmx2048m -XX:MaxPermSize=512m -XX:+HeapDumpOnOutOfMemoryError -Dfile.encoding=UTF-8 14 | 15 | # When configured, Gradle will run in incubating parallel mode. 16 | # This option should only be used with decoupled projects. More details, visit 17 | # http://www.gradle.org/docs/current/userguide/multi_project_builds.html#sec:decoupled_projects 18 | # org.gradle.parallel=true -------------------------------------------------------------------------------- /gradle/wrapper/gradle-wrapper.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/panacena/mengqu/1aef82b772e4f5efdb3ddc8c26f68940e3deeb0f/gradle/wrapper/gradle-wrapper.jar -------------------------------------------------------------------------------- /gradle/wrapper/gradle-wrapper.properties: -------------------------------------------------------------------------------- 1 | #Mon Dec 28 10:00:20 PST 2015 2 | distributionBase=GRADLE_USER_HOME 3 | distributionPath=wrapper/dists 4 | zipStoreBase=GRADLE_USER_HOME 5 | zipStorePath=wrapper/dists 6 | distributionUrl=https\://services.gradle.org/distributions/gradle-2.10-all.zip 7 | -------------------------------------------------------------------------------- /gradlew.bat: -------------------------------------------------------------------------------- 1 | @if "%DEBUG%" == "" @echo off 2 | @rem ########################################################################## 3 | @rem 4 | @rem Gradle startup script for Windows 5 | @rem 6 | @rem ########################################################################## 7 | 8 | @rem Set local scope for the variables with windows NT shell 9 | if "%OS%"=="Windows_NT" setlocal 10 | 11 | @rem Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script. 12 | set DEFAULT_JVM_OPTS= 13 | 14 | set DIRNAME=%~dp0 15 | if "%DIRNAME%" == "" set DIRNAME=. 16 | set APP_BASE_NAME=%~n0 17 | set APP_HOME=%DIRNAME% 18 | 19 | @rem Find java.exe 20 | if defined JAVA_HOME goto findJavaFromJavaHome 21 | 22 | set JAVA_EXE=java.exe 23 | %JAVA_EXE% -version >NUL 2>&1 24 | if "%ERRORLEVEL%" == "0" goto init 25 | 26 | echo. 27 | echo ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH. 28 | echo. 29 | echo Please set the JAVA_HOME variable in your environment to match the 30 | echo location of your Java installation. 31 | 32 | goto fail 33 | 34 | :findJavaFromJavaHome 35 | set JAVA_HOME=%JAVA_HOME:"=% 36 | set JAVA_EXE=%JAVA_HOME%/bin/java.exe 37 | 38 | if exist "%JAVA_EXE%" goto init 39 | 40 | echo. 41 | echo ERROR: JAVA_HOME is set to an invalid directory: %JAVA_HOME% 42 | echo. 43 | echo Please set the JAVA_HOME variable in your environment to match the 44 | echo location of your Java installation. 45 | 46 | goto fail 47 | 48 | :init 49 | @rem Get command-line arguments, handling Windowz variants 50 | 51 | if not "%OS%" == "Windows_NT" goto win9xME_args 52 | if "%@eval[2+2]" == "4" goto 4NT_args 53 | 54 | :win9xME_args 55 | @rem Slurp the command line arguments. 56 | set CMD_LINE_ARGS= 57 | set _SKIP=2 58 | 59 | :win9xME_args_slurp 60 | if "x%~1" == "x" goto execute 61 | 62 | set CMD_LINE_ARGS=%* 63 | goto execute 64 | 65 | :4NT_args 66 | @rem Get arguments from the 4NT Shell from JP Software 67 | set CMD_LINE_ARGS=%$ 68 | 69 | :execute 70 | @rem Setup the command line 71 | 72 | set CLASSPATH=%APP_HOME%\gradle\wrapper\gradle-wrapper.jar 73 | 74 | @rem Execute Gradle 75 | "%JAVA_EXE%" %DEFAULT_JVM_OPTS% %JAVA_OPTS% %GRADLE_OPTS% "-Dorg.gradle.appname=%APP_BASE_NAME%" -classpath "%CLASSPATH%" org.gradle.wrapper.GradleWrapperMain %CMD_LINE_ARGS% 76 | 77 | :end 78 | @rem End local scope for the variables with windows NT shell 79 | if "%ERRORLEVEL%"=="0" goto mainEnd 80 | 81 | :fail 82 | rem Set variable GRADLE_EXIT_CONSOLE if you need the _script_ return code instead of 83 | rem the _cmd.exe /c_ return code! 84 | if not "" == "%GRADLE_EXIT_CONSOLE%" exit 1 85 | exit /b 1 86 | 87 | :mainEnd 88 | if "%OS%"=="Windows_NT" endlocal 89 | 90 | :omega 91 | -------------------------------------------------------------------------------- /library/.gitignore: -------------------------------------------------------------------------------- 1 | /build 2 | -------------------------------------------------------------------------------- /library/build.gradle: -------------------------------------------------------------------------------- 1 | apply plugin: 'com.android.library' 2 | 3 | android { 4 | compileSdkVersion 23 5 | buildToolsVersion '23.0.0' 6 | 7 | defaultConfig { 8 | minSdkVersion 10 9 | targetSdkVersion 22 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(include: ['*.jar'], dir: 'libs') 23 | compile 'com.android.support:appcompat-v7:23.0.0' 24 | } 25 | -------------------------------------------------------------------------------- /library/proguard-rules.pro: -------------------------------------------------------------------------------- 1 | # Add project specific ProGuard rules here. 2 | # By default, the flags in this file are appended to flags specified 3 | # in D:\Android\sdk/tools/proguard/proguard-android.txt 4 | # You can edit the include path and order by changing the proguardFiles 5 | # directive in build.gradle. 6 | # 7 | # For more details, see 8 | # http://developer.android.com/guide/developing/tools/proguard.html 9 | 10 | # Add any project specific keep options here: 11 | 12 | # If your project uses WebView with JS, uncomment the following 13 | # and specify the fully qualified class name to the JavaScript interface 14 | # class: 15 | #-keepclassmembers class fqcn.of.javascript.interface.for.webview { 16 | # public *; 17 | #} 18 | -------------------------------------------------------------------------------- /library/src/androidTest/java/com/aspsine/multithreaddownload/ApplicationTest.java: -------------------------------------------------------------------------------- 1 | package com.aspsine.multithreaddownload; 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 | } -------------------------------------------------------------------------------- /library/src/main/AndroidManifest.xml: -------------------------------------------------------------------------------- 1 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | -------------------------------------------------------------------------------- /library/src/main/java/com/aspsine/multithreaddownload/CallBack.java: -------------------------------------------------------------------------------- 1 | package com.aspsine.multithreaddownload; 2 | 3 | import com.aspsine.multithreaddownload.core.ConnectTaskImpl; 4 | 5 | import java.net.HttpURLConnection; 6 | 7 | /** 8 | * CallBack of download status 9 | */ 10 | public interface CallBack { 11 | 12 | void onStarted(); 13 | 14 | /** 15 | *

this will be the the first method called by 16 | * {@link ConnectTaskImpl}. 17 | */ 18 | void onConnecting(); 19 | 20 | /** 21 | *

if {@link ConnectTaskImpl} is successfully 22 | * connected with the http/https server this method will be invoke. If not method 23 | * {@link #onFailed(DownloadException)} will be invoke. 24 | * 25 | * @param total The length of the file. See {@link HttpURLConnection#getContentLength()} 26 | * @param isRangeSupport indicate whether download can be resumed from pause. 27 | * See {@link ConnectTaskImpl#run()}. If the value of http header field 28 | * {@code Accept-Ranges} is {@code bytes} the value of isRangeSupport is 29 | * {@code true} else {@code false} 30 | */ 31 | void onConnected(long total, boolean isRangeSupport); 32 | 33 | /** 34 | *

progress callback. 35 | * 36 | * @param finished the downloaded length of the file 37 | * @param total the total length of the file same value with method {@link } 38 | * @param progress the percent of progress (finished/total)*100 39 | */ 40 | void onProgress(long finished, long total, int progress); 41 | 42 | /** 43 | *

download complete 44 | */ 45 | void onCompleted(); 46 | 47 | /** 48 | *

if you invoke {@link DownloadManager#pause(String)} or {@link DownloadManager#pauseAll()} 49 | * this method will be invoke if the downloading task is successfully paused. 50 | */ 51 | void onDownloadPaused(); 52 | 53 | /** 54 | *

if you invoke {@link DownloadManager#cancel(String)} or {@link DownloadManager#cancelAll()} 55 | * this method will be invoke if the downloading task is successfully canceled. 56 | */ 57 | void onDownloadCanceled(); 58 | 59 | /** 60 | *

download fail or exception callback 61 | * 62 | * @param e download exception 63 | */ 64 | void onFailed(DownloadException e); 65 | } 66 | -------------------------------------------------------------------------------- /library/src/main/java/com/aspsine/multithreaddownload/Constants.java: -------------------------------------------------------------------------------- 1 | package com.aspsine.multithreaddownload; 2 | 3 | /** 4 | * Created by Aspsine on 2015/7/14. 5 | */ 6 | public class Constants { 7 | 8 | public static final class CONFIG { 9 | public static final boolean DEBUG = false; 10 | } 11 | 12 | public static final class HTTP { 13 | public static final int CONNECT_TIME_OUT = 10 * 1000; 14 | public static final int READ_TIME_OUT = 10*1000; 15 | public static final String GET = "GET"; 16 | } 17 | } 18 | -------------------------------------------------------------------------------- /library/src/main/java/com/aspsine/multithreaddownload/DownloadConfiguration.java: -------------------------------------------------------------------------------- 1 | package com.aspsine.multithreaddownload; 2 | 3 | /** 4 | * Created by Aspsine on 2015/7/14. 5 | */ 6 | public class DownloadConfiguration { 7 | 8 | public static final int DEFAULT_MAX_THREAD_NUMBER = 10; 9 | 10 | public static final int DEFAULT_THREAD_NUMBER = 1; 11 | 12 | /** 13 | * thread number in the pool 14 | */ 15 | private int maxThreadNum; 16 | 17 | /** 18 | * thread number for each download 19 | */ 20 | private int threadNum; 21 | 22 | 23 | /** 24 | * init with default value 25 | */ 26 | public DownloadConfiguration() { 27 | maxThreadNum = DEFAULT_MAX_THREAD_NUMBER; 28 | threadNum = DEFAULT_THREAD_NUMBER; 29 | } 30 | 31 | public int getMaxThreadNum() { 32 | return maxThreadNum; 33 | } 34 | 35 | public void setMaxThreadNum(int maxThreadNum) { 36 | this.maxThreadNum = maxThreadNum; 37 | } 38 | 39 | public int getThreadNum() { 40 | return threadNum; 41 | } 42 | 43 | public void setThreadNum(int threadNum) { 44 | this.threadNum = threadNum; 45 | } 46 | } 47 | -------------------------------------------------------------------------------- /library/src/main/java/com/aspsine/multithreaddownload/DownloadException.java: -------------------------------------------------------------------------------- 1 | package com.aspsine.multithreaddownload; 2 | 3 | /** 4 | * Created by Aspsine on 2015/7/15. 5 | */ 6 | public class DownloadException extends Exception { 7 | private String errorMessage; 8 | private int errorCode; 9 | 10 | 11 | public DownloadException() { 12 | } 13 | 14 | public DownloadException(String detailMessage) { 15 | super(detailMessage); 16 | errorMessage = detailMessage; 17 | } 18 | 19 | public DownloadException(int errorCode, String detailMessage) { 20 | this(detailMessage); 21 | this.errorCode = errorCode; 22 | } 23 | 24 | public DownloadException(String detailMessage, Throwable throwable) { 25 | super(detailMessage, throwable); 26 | errorMessage = detailMessage; 27 | } 28 | 29 | public DownloadException(int errorCode, String detailMessage, Throwable throwable) { 30 | this(detailMessage, throwable); 31 | this.errorCode = errorCode; 32 | } 33 | 34 | public DownloadException(Throwable throwable) { 35 | super(throwable); 36 | } 37 | 38 | public String getErrorMessage() { 39 | return errorMessage; 40 | } 41 | 42 | public void setErrorMessage(String errorMessage) { 43 | this.errorMessage = errorMessage; 44 | } 45 | 46 | public int getErrorCode() { 47 | return errorCode; 48 | } 49 | 50 | public void setErrorCode(int errorCode) { 51 | this.errorCode = errorCode; 52 | } 53 | } 54 | -------------------------------------------------------------------------------- /library/src/main/java/com/aspsine/multithreaddownload/DownloadInfo.java: -------------------------------------------------------------------------------- 1 | package com.aspsine.multithreaddownload; 2 | 3 | import java.io.File; 4 | import java.io.Serializable; 5 | 6 | /** 7 | * Created by aspsine on 15-4-19. 8 | */ 9 | public class DownloadInfo { 10 | private String name; 11 | private String uri; 12 | private File dir; 13 | private int progress; 14 | private long length; 15 | private long finished; 16 | private boolean acceptRanges; 17 | 18 | private int status; 19 | 20 | public DownloadInfo() { 21 | } 22 | 23 | public DownloadInfo(String name, String uri, File dir) { 24 | this.name = name; 25 | this.uri = uri; 26 | this.dir = dir; 27 | } 28 | 29 | public String getName() { 30 | return name; 31 | } 32 | 33 | public void setName(String name) { 34 | this.name = name; 35 | } 36 | 37 | public String getUri() { 38 | return uri; 39 | } 40 | 41 | public void setUri(String uri) { 42 | this.uri = uri; 43 | } 44 | 45 | public File getDir() { 46 | return dir; 47 | } 48 | 49 | public void setDir(File dir) { 50 | this.dir = dir; 51 | } 52 | 53 | public int getProgress() { 54 | return progress; 55 | } 56 | 57 | public void setProgress(int progress) { 58 | this.progress = progress; 59 | } 60 | 61 | public long getLength() { 62 | return length; 63 | } 64 | 65 | public void setLength(long length) { 66 | this.length = length; 67 | } 68 | 69 | public long getFinished() { 70 | return finished; 71 | } 72 | 73 | public void setFinished(long finished) { 74 | this.finished = finished; 75 | } 76 | 77 | public boolean isAcceptRanges() { 78 | return acceptRanges; 79 | } 80 | 81 | public void setAcceptRanges(boolean acceptRanges) { 82 | this.acceptRanges = acceptRanges; 83 | } 84 | } 85 | -------------------------------------------------------------------------------- /library/src/main/java/com/aspsine/multithreaddownload/DownloadRequest.java: -------------------------------------------------------------------------------- 1 | package com.aspsine.multithreaddownload; 2 | 3 | 4 | import java.io.File; 5 | 6 | /** 7 | * Created by Aspsine on 2015/4/20. 8 | */ 9 | public class DownloadRequest { 10 | private String mUri; 11 | 12 | private File mFolder; 13 | 14 | private CharSequence mTitle; 15 | 16 | private CharSequence mDescription; 17 | 18 | private boolean mScannable; 19 | 20 | private DownloadRequest() { 21 | } 22 | 23 | private DownloadRequest(String uri, File folder, CharSequence title, CharSequence description, boolean scannable) { 24 | this.mUri = uri; 25 | this.mFolder = folder; 26 | this.mTitle = title; 27 | this.mDescription = description; 28 | this.mScannable = scannable; 29 | } 30 | 31 | public String getUri() { 32 | return mUri; 33 | } 34 | 35 | public File getFolder() { 36 | return mFolder; 37 | } 38 | 39 | public CharSequence getTitle() { 40 | return mTitle; 41 | } 42 | 43 | public CharSequence getDescription() { 44 | return mDescription; 45 | } 46 | 47 | public boolean isScannable() { 48 | return mScannable; 49 | } 50 | 51 | public static class Builder { 52 | 53 | private String mUri; 54 | 55 | private File mFolder; 56 | 57 | private CharSequence mTitle; 58 | 59 | private CharSequence mDescription; 60 | 61 | private boolean mScannable; 62 | 63 | public Builder() { 64 | } 65 | 66 | public Builder setUri(String uri) { 67 | this.mUri = uri; 68 | return this; 69 | } 70 | 71 | public Builder setFolder(File folder) { 72 | this.mFolder = folder; 73 | return this; 74 | } 75 | 76 | public Builder setTitle(CharSequence title) { 77 | this.mTitle = title; 78 | return this; 79 | } 80 | 81 | public Builder setDescription(CharSequence description) { 82 | this.mDescription = description; 83 | return this; 84 | } 85 | 86 | public Builder setScannable(boolean scannable) { 87 | this.mScannable = scannable; 88 | return this; 89 | } 90 | 91 | public DownloadRequest build() { 92 | DownloadRequest request = new DownloadRequest(mUri, mFolder, mTitle, mDescription, mScannable); 93 | return request; 94 | } 95 | } 96 | } 97 | -------------------------------------------------------------------------------- /library/src/main/java/com/aspsine/multithreaddownload/architecture/ConnectTask.java: -------------------------------------------------------------------------------- 1 | package com.aspsine.multithreaddownload.architecture; 2 | 3 | import com.aspsine.multithreaddownload.DownloadException; 4 | import com.aspsine.multithreaddownload.DownloadInfo; 5 | 6 | /** 7 | * Created by Aspsine on 2015/10/29. 8 | */ 9 | public interface ConnectTask extends Runnable { 10 | 11 | public interface OnConnectListener { 12 | void onConnecting(); 13 | 14 | void onConnected(long time, long length, boolean isAcceptRanges); 15 | 16 | void onConnectCanceled(); 17 | 18 | void onConnectFailed(DownloadException de); 19 | } 20 | 21 | void cancel(); 22 | 23 | boolean isConnecting(); 24 | 25 | boolean isConnected(); 26 | 27 | boolean isCanceled(); 28 | 29 | boolean isFailed(); 30 | 31 | @Override 32 | void run(); 33 | } 34 | -------------------------------------------------------------------------------- /library/src/main/java/com/aspsine/multithreaddownload/architecture/DownloadResponse.java: -------------------------------------------------------------------------------- 1 | package com.aspsine.multithreaddownload.architecture; 2 | 3 | import com.aspsine.multithreaddownload.DownloadException; 4 | 5 | /** 6 | * Created by Aspsine on 2015/10/28. 7 | */ 8 | public interface DownloadResponse { 9 | 10 | void onStarted(); 11 | 12 | void onConnecting(); 13 | 14 | void onConnected(long time, long length, boolean acceptRanges); 15 | 16 | void onConnectFailed(DownloadException e); 17 | 18 | void onConnectCanceled(); 19 | 20 | void onDownloadProgress(long finished, long length, int percent); 21 | 22 | void onDownloadCompleted(); 23 | 24 | void onDownloadPaused(); 25 | 26 | void onDownloadCanceled(); 27 | 28 | void onDownloadFailed(DownloadException e); 29 | } 30 | -------------------------------------------------------------------------------- /library/src/main/java/com/aspsine/multithreaddownload/architecture/DownloadStatus.java: -------------------------------------------------------------------------------- 1 | package com.aspsine.multithreaddownload.architecture; 2 | 3 | import com.aspsine.multithreaddownload.CallBack; 4 | import com.aspsine.multithreaddownload.DownloadException; 5 | 6 | /** 7 | * Created by Aspsine on 2015/7/15. 8 | */ 9 | public class DownloadStatus { 10 | public static final int STATUS_STARTED = 101; 11 | public static final int STATUS_CONNECTING = 102; 12 | public static final int STATUS_CONNECTED = 103; 13 | public static final int STATUS_PROGRESS = 104; 14 | public static final int STATUS_COMPLETED = 105; 15 | public static final int STATUS_PAUSED = 106; 16 | public static final int STATUS_CANCELED = 107; 17 | public static final int STATUS_FAILED = 108; 18 | 19 | private int status; 20 | private long time; 21 | private long length; 22 | private long finished; 23 | private int percent; 24 | private boolean acceptRanges; 25 | private DownloadException exception; 26 | 27 | private CallBack callBack; 28 | 29 | public int getStatus() { 30 | return status; 31 | } 32 | 33 | public void setStatus(int status) { 34 | this.status = status; 35 | } 36 | 37 | public long getTime() { 38 | return time; 39 | } 40 | 41 | public void setTime(long time) { 42 | this.time = time; 43 | } 44 | 45 | public long getLength() { 46 | return length; 47 | } 48 | 49 | public void setLength(long length) { 50 | this.length = length; 51 | } 52 | 53 | public long getFinished() { 54 | return finished; 55 | } 56 | 57 | public void setFinished(long finished) { 58 | this.finished = finished; 59 | } 60 | 61 | public int getPercent() { 62 | return percent; 63 | } 64 | 65 | public void setPercent(int percent) { 66 | this.percent = percent; 67 | } 68 | 69 | public boolean isAcceptRanges() { 70 | return acceptRanges; 71 | } 72 | 73 | public void setAcceptRanges(boolean acceptRanges) { 74 | this.acceptRanges = acceptRanges; 75 | } 76 | 77 | public Exception getException() { 78 | return exception; 79 | } 80 | 81 | public void setException(DownloadException exception) { 82 | this.exception = exception; 83 | } 84 | 85 | public CallBack getCallBack() { 86 | return callBack; 87 | } 88 | 89 | public void setCallBack(CallBack callBack) { 90 | this.callBack = callBack; 91 | } 92 | } 93 | -------------------------------------------------------------------------------- /library/src/main/java/com/aspsine/multithreaddownload/architecture/DownloadStatusDelivery.java: -------------------------------------------------------------------------------- 1 | package com.aspsine.multithreaddownload.architecture; 2 | 3 | /** 4 | * Created by Aspsine on 2015/7/15. 5 | */ 6 | public interface DownloadStatusDelivery { 7 | 8 | void post(DownloadStatus status); 9 | 10 | } 11 | -------------------------------------------------------------------------------- /library/src/main/java/com/aspsine/multithreaddownload/architecture/DownloadTask.java: -------------------------------------------------------------------------------- 1 | package com.aspsine.multithreaddownload.architecture; 2 | 3 | import com.aspsine.multithreaddownload.DownloadException; 4 | 5 | /** 6 | * Created by Aspsine on 2015/7/22. 7 | */ 8 | public interface DownloadTask extends Runnable { 9 | 10 | interface OnDownloadListener { 11 | void onDownloadConnecting(); 12 | 13 | void onDownloadProgress(long finished, long length); 14 | 15 | void onDownloadCompleted(); 16 | 17 | void onDownloadPaused(); 18 | 19 | void onDownloadCanceled(); 20 | 21 | void onDownloadFailed(DownloadException de); 22 | } 23 | 24 | void cancel(); 25 | 26 | void pause(); 27 | 28 | boolean isDownloading(); 29 | 30 | boolean isComplete(); 31 | 32 | boolean isPaused(); 33 | 34 | boolean isCanceled(); 35 | 36 | boolean isFailed(); 37 | 38 | @Override 39 | void run(); 40 | } 41 | -------------------------------------------------------------------------------- /library/src/main/java/com/aspsine/multithreaddownload/architecture/Downloader.java: -------------------------------------------------------------------------------- 1 | package com.aspsine.multithreaddownload.architecture; 2 | 3 | /** 4 | * Created by Aspsine on 2015/10/29. 5 | */ 6 | public interface Downloader { 7 | 8 | public interface OnDownloaderDestroyedListener { 9 | void onDestroyed(String key, Downloader downloader); 10 | } 11 | 12 | boolean isRunning(); 13 | 14 | void start(); 15 | 16 | void pause(); 17 | 18 | void cancel(); 19 | 20 | void onDestroy(); 21 | 22 | } 23 | -------------------------------------------------------------------------------- /library/src/main/java/com/aspsine/multithreaddownload/core/DownloadStatusDeliveryImpl.java: -------------------------------------------------------------------------------- 1 | package com.aspsine.multithreaddownload.core; 2 | 3 | import android.os.Handler; 4 | 5 | import com.aspsine.multithreaddownload.CallBack; 6 | import com.aspsine.multithreaddownload.DownloadException; 7 | import com.aspsine.multithreaddownload.architecture.DownloadStatus; 8 | import com.aspsine.multithreaddownload.architecture.DownloadStatusDelivery; 9 | 10 | import java.util.concurrent.Executor; 11 | 12 | /** 13 | * Created by Aspsine on 2015/7/15. 14 | */ 15 | public class DownloadStatusDeliveryImpl implements DownloadStatusDelivery { 16 | private Executor mDownloadStatusPoster; 17 | 18 | public DownloadStatusDeliveryImpl(final Handler handler) { 19 | mDownloadStatusPoster = new Executor() { 20 | @Override 21 | public void execute(Runnable command) { 22 | handler.post(command); 23 | } 24 | }; 25 | } 26 | 27 | @Override 28 | public void post(DownloadStatus status) { 29 | mDownloadStatusPoster.execute(new DownloadStatusDeliveryRunnable(status)); 30 | } 31 | 32 | private static class DownloadStatusDeliveryRunnable implements Runnable { 33 | private final DownloadStatus mDownloadStatus; 34 | private final CallBack mCallBack; 35 | 36 | public DownloadStatusDeliveryRunnable(DownloadStatus downloadStatus) { 37 | this.mDownloadStatus = downloadStatus; 38 | this.mCallBack = mDownloadStatus.getCallBack(); 39 | } 40 | 41 | @Override 42 | public void run() { 43 | switch (mDownloadStatus.getStatus()) { 44 | case DownloadStatus.STATUS_CONNECTING: 45 | mCallBack.onConnecting(); 46 | break; 47 | case DownloadStatus.STATUS_CONNECTED: 48 | mCallBack.onConnected(mDownloadStatus.getLength(), mDownloadStatus.isAcceptRanges()); 49 | break; 50 | case DownloadStatus.STATUS_PROGRESS: 51 | mCallBack.onProgress(mDownloadStatus.getFinished(), mDownloadStatus.getLength(), mDownloadStatus.getPercent()); 52 | break; 53 | case DownloadStatus.STATUS_COMPLETED: 54 | mCallBack.onCompleted(); 55 | break; 56 | case DownloadStatus.STATUS_PAUSED: 57 | mCallBack.onDownloadPaused(); 58 | break; 59 | case DownloadStatus.STATUS_CANCELED: 60 | mCallBack.onDownloadCanceled(); 61 | break; 62 | case DownloadStatus.STATUS_FAILED: 63 | mCallBack.onFailed((DownloadException) mDownloadStatus.getException()); 64 | break; 65 | } 66 | } 67 | } 68 | } 69 | -------------------------------------------------------------------------------- /library/src/main/java/com/aspsine/multithreaddownload/core/MultiDownloadTask.java: -------------------------------------------------------------------------------- 1 | package com.aspsine.multithreaddownload.core; 2 | 3 | /** 4 | * Created by Aspsine on 2015/7/20. 5 | */ 6 | 7 | import com.aspsine.multithreaddownload.DownloadInfo; 8 | import com.aspsine.multithreaddownload.db.DataBaseManager; 9 | import com.aspsine.multithreaddownload.db.ThreadInfo; 10 | 11 | import java.io.File; 12 | import java.io.IOException; 13 | import java.io.RandomAccessFile; 14 | import java.net.HttpURLConnection; 15 | import java.util.HashMap; 16 | import java.util.Map; 17 | 18 | /** 19 | * download thread 20 | */ 21 | public class MultiDownloadTask extends DownloadTaskImpl { 22 | 23 | private DataBaseManager mDBManager; 24 | 25 | public MultiDownloadTask(DownloadInfo downloadInfo, ThreadInfo threadInfo, DataBaseManager dbManager, OnDownloadListener listener) { 26 | 27 | super(downloadInfo, threadInfo, listener); 28 | this.mDBManager = dbManager; 29 | } 30 | 31 | 32 | @Override 33 | protected void insertIntoDB(ThreadInfo info) { 34 | if (!mDBManager.exists(info.getTag(), info.getId())) { 35 | mDBManager.insert(info); 36 | } 37 | } 38 | 39 | @Override 40 | protected int getResponseCode() { 41 | return HttpURLConnection.HTTP_PARTIAL; 42 | } 43 | 44 | @Override 45 | protected void updateDB(ThreadInfo info) { 46 | mDBManager.update(info.getTag(), info.getId(), info.getFinished()); 47 | } 48 | 49 | @Override 50 | protected Map getHttpHeaders(ThreadInfo info) { 51 | Map headers = new HashMap(); 52 | long start = info.getStart() + info.getFinished(); 53 | long end = info.getEnd(); 54 | headers.put("Range", "bytes=" + start + "-" + end); 55 | return headers; 56 | } 57 | 58 | @Override 59 | protected RandomAccessFile getFile(File dir, String name, long offset) throws IOException { 60 | File file = new File(dir, name); 61 | RandomAccessFile raf = new RandomAccessFile(file, "rwd"); 62 | raf.seek(offset); 63 | return raf; 64 | } 65 | 66 | 67 | @Override 68 | protected String getTag() { 69 | return this.getClass().getSimpleName(); 70 | } 71 | } -------------------------------------------------------------------------------- /library/src/main/java/com/aspsine/multithreaddownload/core/SingleDownloadTask.java: -------------------------------------------------------------------------------- 1 | package com.aspsine.multithreaddownload.core; 2 | 3 | 4 | import com.aspsine.multithreaddownload.DownloadInfo; 5 | import com.aspsine.multithreaddownload.db.ThreadInfo; 6 | 7 | import java.io.File; 8 | import java.io.IOException; 9 | import java.io.RandomAccessFile; 10 | import java.net.HttpURLConnection; 11 | import java.util.Map; 12 | 13 | /** 14 | * Created by Aspsine on 2015/7/22. 15 | */ 16 | public class SingleDownloadTask extends DownloadTaskImpl { 17 | 18 | public SingleDownloadTask(DownloadInfo mDownloadInfo, ThreadInfo mThreadInfo, OnDownloadListener mOnDownloadListener) { 19 | super(mDownloadInfo, mThreadInfo, mOnDownloadListener); 20 | } 21 | 22 | @Override 23 | protected void insertIntoDB(ThreadInfo info) { 24 | // don't support 25 | } 26 | 27 | @Override 28 | protected int getResponseCode() { 29 | return HttpURLConnection.HTTP_OK; 30 | } 31 | 32 | @Override 33 | protected void updateDB(ThreadInfo info) { 34 | // needn't Override this 35 | } 36 | 37 | @Override 38 | protected Map getHttpHeaders(ThreadInfo info) { 39 | // simply return null 40 | return null; 41 | } 42 | 43 | @Override 44 | protected RandomAccessFile getFile(File dir, String name, long offset) throws IOException { 45 | File file = new File(dir, name); 46 | RandomAccessFile raf = new RandomAccessFile(file, "rwd"); 47 | raf.seek(0); 48 | return raf; 49 | } 50 | 51 | @Override 52 | protected String getTag() { 53 | return this.getClass().getSimpleName(); 54 | } 55 | } 56 | 57 | -------------------------------------------------------------------------------- /library/src/main/java/com/aspsine/multithreaddownload/db/AbstractDao.java: -------------------------------------------------------------------------------- 1 | package com.aspsine.multithreaddownload.db; 2 | 3 | import android.content.Context; 4 | import android.database.sqlite.SQLiteDatabase; 5 | 6 | /** 7 | * Created by aspsine on 15-4-19. 8 | */ 9 | public abstract class AbstractDao { 10 | private DBOpenHelper mHelper; 11 | 12 | public AbstractDao(Context context) { 13 | mHelper = new DBOpenHelper(context); 14 | } 15 | 16 | protected SQLiteDatabase getWritableDatabase() { 17 | return mHelper.getWritableDatabase(); 18 | } 19 | 20 | protected SQLiteDatabase getReadableDatabase() { 21 | return mHelper.getReadableDatabase(); 22 | } 23 | 24 | public void close() { 25 | mHelper.close(); 26 | } 27 | } 28 | -------------------------------------------------------------------------------- /library/src/main/java/com/aspsine/multithreaddownload/db/DBOpenHelper.java: -------------------------------------------------------------------------------- 1 | package com.aspsine.multithreaddownload.db; 2 | 3 | import android.content.Context; 4 | import android.database.sqlite.SQLiteDatabase; 5 | import android.database.sqlite.SQLiteOpenHelper; 6 | 7 | /** 8 | * Created by aspsine on 15-4-19. 9 | */ 10 | public class DBOpenHelper extends SQLiteOpenHelper { 11 | 12 | private static final String DB_NAME = "download.db"; 13 | private static final int DB_VERSION = 1; 14 | 15 | public DBOpenHelper(Context context) { 16 | super(context, DB_NAME, null, DB_VERSION); 17 | } 18 | 19 | void createTable(SQLiteDatabase db){ 20 | ThreadInfoDao.createTable(db); 21 | } 22 | 23 | void dropTable(SQLiteDatabase db){ 24 | ThreadInfoDao.dropTable(db); 25 | } 26 | 27 | @Override 28 | public void onCreate(SQLiteDatabase db) { 29 | createTable(db); 30 | } 31 | 32 | @Override 33 | public void onUpgrade(SQLiteDatabase db, int oldVersion, int newVersion) { 34 | dropTable(db); 35 | createTable(db); 36 | } 37 | } 38 | -------------------------------------------------------------------------------- /library/src/main/java/com/aspsine/multithreaddownload/db/DataBaseManager.java: -------------------------------------------------------------------------------- 1 | package com.aspsine.multithreaddownload.db; 2 | 3 | import android.content.Context; 4 | 5 | import java.util.List; 6 | 7 | /** 8 | * Created by aspsine on 15-4-19. 9 | */ 10 | public class DataBaseManager { 11 | private static DataBaseManager sDataBaseManager; 12 | private final ThreadInfoDao mThreadInfoDao; 13 | 14 | public static DataBaseManager getInstance(Context context) { 15 | if (sDataBaseManager == null) { 16 | sDataBaseManager = new DataBaseManager(context); 17 | } 18 | return sDataBaseManager; 19 | } 20 | 21 | private DataBaseManager(Context context) { 22 | mThreadInfoDao = new ThreadInfoDao(context); 23 | } 24 | 25 | public synchronized void insert(ThreadInfo threadInfo) { 26 | mThreadInfoDao.insert(threadInfo); 27 | } 28 | 29 | public synchronized void delete(String tag) { 30 | mThreadInfoDao.delete(tag); 31 | } 32 | 33 | public synchronized void update(String tag, int threadId, long finished) { 34 | mThreadInfoDao.update(tag, threadId, finished); 35 | } 36 | 37 | public List getThreadInfos(String tag) { 38 | return mThreadInfoDao.getThreadInfos(tag); 39 | } 40 | 41 | public boolean exists(String tag, int threadId) { 42 | return mThreadInfoDao.exists(tag, threadId); 43 | } 44 | } 45 | -------------------------------------------------------------------------------- /library/src/main/java/com/aspsine/multithreaddownload/db/ThreadInfo.java: -------------------------------------------------------------------------------- 1 | package com.aspsine.multithreaddownload.db; 2 | 3 | /** 4 | * Created by aspsine on 15-4-19. 5 | */ 6 | public class ThreadInfo { 7 | private int id; 8 | private String tag; 9 | private String uri; 10 | private long start; 11 | private long end; 12 | private long finished; 13 | 14 | public ThreadInfo() { 15 | } 16 | 17 | public ThreadInfo(int id, String tag, String uri, long finished) { 18 | this.id = id; 19 | this.tag = tag; 20 | this.uri = uri; 21 | this.finished = finished; 22 | } 23 | 24 | public ThreadInfo(int id, String tag, String uri, long start, long end, long finished) { 25 | this.id = id; 26 | this.tag = tag; 27 | this.uri = uri; 28 | this.start = start; 29 | this.end = end; 30 | this.finished = finished; 31 | } 32 | 33 | public int getId() { 34 | return id; 35 | } 36 | 37 | public void setId(int id) { 38 | this.id = id; 39 | } 40 | 41 | public String getTag() { 42 | return tag; 43 | } 44 | 45 | public void setTag(String tag) { 46 | this.tag = tag; 47 | } 48 | 49 | public String getUri() { 50 | return uri; 51 | } 52 | 53 | public void setUri(String uri) { 54 | this.uri = uri; 55 | } 56 | 57 | public long getStart() { 58 | return start; 59 | } 60 | 61 | public void setStart(long start) { 62 | this.start = start; 63 | } 64 | 65 | public long getEnd() { 66 | return end; 67 | } 68 | 69 | public void setEnd(long end) { 70 | this.end = end; 71 | } 72 | 73 | public long getFinished() { 74 | return finished; 75 | } 76 | 77 | public void setFinished(long finished) { 78 | this.finished = finished; 79 | } 80 | } 81 | -------------------------------------------------------------------------------- /library/src/main/java/com/aspsine/multithreaddownload/util/FileUtils.java: -------------------------------------------------------------------------------- 1 | package com.aspsine.multithreaddownload.util; 2 | 3 | import android.content.Context; 4 | import android.os.Environment; 5 | import android.support.annotation.NonNull; 6 | 7 | import java.io.File; 8 | 9 | /** 10 | * Created by aspsine on 15-4-19. 11 | */ 12 | public class FileUtils { 13 | private static final String DOWNLOAD_DIR = "download"; 14 | 15 | public static final File getDefaultDownloadDir(Context context) { 16 | if (Environment.getExternalStorageState().equals(Environment.MEDIA_MOUNTED)) { 17 | return new File(context.getExternalCacheDir(), DOWNLOAD_DIR); 18 | } 19 | return new File(context.getCacheDir(), DOWNLOAD_DIR); 20 | } 21 | 22 | public static boolean isSDMounted(){ 23 | return Environment.getExternalStorageState().equals(Environment.MEDIA_MOUNTED); 24 | } 25 | 26 | public static final String getPrefix(@NonNull String fileName) { 27 | return fileName.substring(0, fileName.lastIndexOf(".")); 28 | } 29 | 30 | public static final String getSuffix(@NonNull String fileName) { 31 | return fileName.substring(fileName.lastIndexOf(".") + 1); 32 | } 33 | } 34 | -------------------------------------------------------------------------------- /library/src/main/java/com/aspsine/multithreaddownload/util/IOCloseUtils.java: -------------------------------------------------------------------------------- 1 | package com.aspsine.multithreaddownload.util; 2 | 3 | import java.io.Closeable; 4 | import java.io.IOException; 5 | 6 | /** 7 | * Created by Aspsine on 2015/7/10. 8 | */ 9 | public class IOCloseUtils { 10 | 11 | public static final void close(Closeable closeable) throws IOException { 12 | if (closeable != null) { 13 | synchronized (IOCloseUtils.class) { 14 | closeable.close(); 15 | } 16 | } 17 | } 18 | } 19 | -------------------------------------------------------------------------------- /library/src/main/java/com/aspsine/multithreaddownload/util/L.java: -------------------------------------------------------------------------------- 1 | package com.aspsine.multithreaddownload.util; 2 | 3 | import android.util.Log; 4 | 5 | import com.aspsine.multithreaddownload.Constants; 6 | 7 | 8 | /** 9 | * Created by Aspsine on 2015/4/30. 10 | */ 11 | public class L { 12 | private static final String TAG = "MultiThreadDownload"; 13 | 14 | /** 15 | * d 16 | * 17 | * @param tag 18 | * @param msg 19 | */ 20 | public static void d(String tag, String msg) { 21 | if (Constants.CONFIG.DEBUG) { 22 | Log.d(tag, msg); 23 | } 24 | } 25 | 26 | /** 27 | * d 28 | * 29 | * @param msg 30 | */ 31 | public static void d(String msg) { 32 | d(TAG, msg); 33 | } 34 | 35 | /** 36 | * i 37 | * 38 | * @param tag 39 | * @param msg 40 | */ 41 | public static void i(String tag, String msg) { 42 | if (Constants.CONFIG.DEBUG) { 43 | Log.i(tag, msg); 44 | } 45 | } 46 | 47 | /** 48 | * i 49 | * 50 | * @param msg 51 | */ 52 | public static void i(String msg) { 53 | i(TAG, msg); 54 | } 55 | 56 | /** 57 | * e 58 | * 59 | * @param tag 60 | * @param msg 61 | */ 62 | public static void e(String tag, String msg) { 63 | if (Constants.CONFIG.DEBUG) { 64 | Log.e(tag, msg); 65 | } 66 | } 67 | 68 | /** 69 | * w 70 | * 71 | * @param msg 72 | */ 73 | public static void w(String msg) { 74 | w(TAG, msg); 75 | } 76 | 77 | /** 78 | * w 79 | * 80 | * @param tag 81 | * @param msg 82 | */ 83 | public static void w(String tag, String msg) { 84 | if (Constants.CONFIG.DEBUG) { 85 | Log.w(tag, msg); 86 | } 87 | } 88 | } 89 | -------------------------------------------------------------------------------- /library/src/main/java/com/aspsine/multithreaddownload/util/ListUtils.java: -------------------------------------------------------------------------------- 1 | package com.aspsine.multithreaddownload.util; 2 | 3 | import java.util.List; 4 | 5 | /** 6 | * Created by aspsine on 15-4-6. 7 | */ 8 | public class ListUtils { 9 | 10 | public static final boolean isEmpty(List list) { 11 | if (list != null && list.size() > 0) { 12 | return false; 13 | } 14 | return true; 15 | } 16 | } 17 | -------------------------------------------------------------------------------- /library/src/main/res/values/strings.xml: -------------------------------------------------------------------------------- 1 | 2 | library 3 | 4 | -------------------------------------------------------------------------------- /readme/Screenshot_2016-07-10-22-17-15_zkk.com.mengqu.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/panacena/mengqu/1aef82b772e4f5efdb3ddc8c26f68940e3deeb0f/readme/Screenshot_2016-07-10-22-17-15_zkk.com.mengqu.png -------------------------------------------------------------------------------- /readme/Screenshot_2016-07-10-22-17-27_zkk.com.mengqu.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/panacena/mengqu/1aef82b772e4f5efdb3ddc8c26f68940e3deeb0f/readme/Screenshot_2016-07-10-22-17-27_zkk.com.mengqu.png -------------------------------------------------------------------------------- /readme/Screenshot_2016-07-10-22-17-41_zkk.com.mengqu.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/panacena/mengqu/1aef82b772e4f5efdb3ddc8c26f68940e3deeb0f/readme/Screenshot_2016-07-10-22-17-41_zkk.com.mengqu.png -------------------------------------------------------------------------------- /readme/Screenshot_2016-07-10-22-17-52_zkk.com.mengqu.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/panacena/mengqu/1aef82b772e4f5efdb3ddc8c26f68940e3deeb0f/readme/Screenshot_2016-07-10-22-17-52_zkk.com.mengqu.png -------------------------------------------------------------------------------- /readme/Screenshot_2016-07-10-22-17-56_zkk.com.mengqu.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/panacena/mengqu/1aef82b772e4f5efdb3ddc8c26f68940e3deeb0f/readme/Screenshot_2016-07-10-22-17-56_zkk.com.mengqu.png -------------------------------------------------------------------------------- /readme/Screenshot_2016-07-10-22-18-03_zkk.com.mengqu.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/panacena/mengqu/1aef82b772e4f5efdb3ddc8c26f68940e3deeb0f/readme/Screenshot_2016-07-10-22-18-03_zkk.com.mengqu.png -------------------------------------------------------------------------------- /readme/Screenshot_2016-07-10-22-18-10_zkk.com.mengqu.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/panacena/mengqu/1aef82b772e4f5efdb3ddc8c26f68940e3deeb0f/readme/Screenshot_2016-07-10-22-18-10_zkk.com.mengqu.png -------------------------------------------------------------------------------- /readme/Screenshot_2016-07-10-22-18-14_zkk.com.mengqu.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/panacena/mengqu/1aef82b772e4f5efdb3ddc8c26f68940e3deeb0f/readme/Screenshot_2016-07-10-22-18-14_zkk.com.mengqu.png -------------------------------------------------------------------------------- /readme/Screenshot_2016-07-10-22-18-23_zkk.com.mengqu.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/panacena/mengqu/1aef82b772e4f5efdb3ddc8c26f68940e3deeb0f/readme/Screenshot_2016-07-10-22-18-23_zkk.com.mengqu.png -------------------------------------------------------------------------------- /readme/Screenshot_2016-07-10-22-18-32_zkk.com.mengqu.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/panacena/mengqu/1aef82b772e4f5efdb3ddc8c26f68940e3deeb0f/readme/Screenshot_2016-07-10-22-18-32_zkk.com.mengqu.png -------------------------------------------------------------------------------- /readme/Screenshot_2016-07-10-22-18-41_zkk.com.mengqu.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/panacena/mengqu/1aef82b772e4f5efdb3ddc8c26f68940e3deeb0f/readme/Screenshot_2016-07-10-22-18-41_zkk.com.mengqu.png -------------------------------------------------------------------------------- /readme/Screenshot_2016-07-10-22-18-48_zkk.com.mengqu.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/panacena/mengqu/1aef82b772e4f5efdb3ddc8c26f68940e3deeb0f/readme/Screenshot_2016-07-10-22-18-48_zkk.com.mengqu.png -------------------------------------------------------------------------------- /readme/Screenshot_2016-07-10-22-19-04_zkk.com.mengqu.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/panacena/mengqu/1aef82b772e4f5efdb3ddc8c26f68940e3deeb0f/readme/Screenshot_2016-07-10-22-19-04_zkk.com.mengqu.png -------------------------------------------------------------------------------- /readme/Screenshot_2016-07-10-22-19-22_zkk.com.mengqu.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/panacena/mengqu/1aef82b772e4f5efdb3ddc8c26f68940e3deeb0f/readme/Screenshot_2016-07-10-22-19-22_zkk.com.mengqu.png -------------------------------------------------------------------------------- /readme/Screenshot_2016-07-10-22-19-28_zkk.com.mengqu.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/panacena/mengqu/1aef82b772e4f5efdb3ddc8c26f68940e3deeb0f/readme/Screenshot_2016-07-10-22-19-28_zkk.com.mengqu.png -------------------------------------------------------------------------------- /readme/Screenshot_2016-07-10-22-21-05_zkk.com.mengqu.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/panacena/mengqu/1aef82b772e4f5efdb3ddc8c26f68940e3deeb0f/readme/Screenshot_2016-07-10-22-21-05_zkk.com.mengqu.png -------------------------------------------------------------------------------- /settings.gradle: -------------------------------------------------------------------------------- 1 | include ':app', ':library' 2 | --------------------------------------------------------------------------------