├── app ├── .gitignore ├── libs │ └── alipaySdk-20170725.jar ├── src │ ├── main │ │ ├── res │ │ │ ├── drawable │ │ │ │ ├── willflow.png │ │ │ │ └── progress_bar_states.xml │ │ │ ├── drawable-hdpi │ │ │ │ ├── ic_more.png │ │ │ │ ├── ic_layout.png │ │ │ │ ├── ic_search.png │ │ │ │ ├── ic_menu_white.png │ │ │ │ ├── ic_gridedouble.png │ │ │ │ ├── ic_star_checked.png │ │ │ │ ├── ic_face_black_48dp.png │ │ │ │ ├── ic_grideview_grey.png │ │ │ │ ├── ic_lineview_grey.png │ │ │ │ ├── ic_star_unchecked.png │ │ │ │ ├── ic_stars_black_48dp.png │ │ │ │ ├── ic_keyboard_arrow_down.png │ │ │ │ ├── ic_loyalty_black_48dp.png │ │ │ │ ├── ic_settings_black_48dp.png │ │ │ │ ├── ic_waterfallview_grey.png │ │ │ │ └── search_edit_bg.xml │ │ │ ├── drawable-mdpi │ │ │ │ ├── ic_clean.png │ │ │ │ ├── ic_menu_white.png │ │ │ │ ├── transparent.9.png │ │ │ │ ├── btn_back_normal.png │ │ │ │ ├── ic_star_checked.png │ │ │ │ ├── btn_back_pressed.png │ │ │ │ ├── ic_face_black_48dp.png │ │ │ │ ├── ic_star_unchecked.png │ │ │ │ ├── btn_common_normal.9.png │ │ │ │ ├── btn_common_pressed.9.png │ │ │ │ ├── ic_stars_black_48dp.png │ │ │ │ ├── btn_common_disabled.9.png │ │ │ │ ├── ic_loyalty_black_48dp.png │ │ │ │ ├── ic_settings_black_48dp.png │ │ │ │ ├── bg_titlebar.xml │ │ │ │ ├── btn_back.xml │ │ │ │ ├── btn_common.xml │ │ │ │ └── subscribe_item_bg.xml │ │ │ ├── drawable-xhdpi │ │ │ │ ├── ic_more.png │ │ │ │ ├── ic_clean.png │ │ │ │ ├── ic_layout.png │ │ │ │ ├── ic_search.png │ │ │ │ ├── ic_gridedouble.png │ │ │ │ ├── ic_menu_white.png │ │ │ │ ├── ic_grideview_grey.png │ │ │ │ ├── ic_lineview_grey.png │ │ │ │ ├── ic_star_checked.png │ │ │ │ ├── ic_star_unchecked.png │ │ │ │ ├── ic_face_black_48dp.png │ │ │ │ ├── ic_stars_black_48dp.png │ │ │ │ ├── ic_keyboard_arrow_down.png │ │ │ │ ├── ic_loyalty_black_48dp.png │ │ │ │ ├── ic_settings_black_48dp.png │ │ │ │ └── ic_waterfallview_grey.png │ │ │ ├── drawable-xxhdpi │ │ │ │ ├── head_red.jpg │ │ │ │ ├── ic_clean.png │ │ │ │ ├── ic_more.png │ │ │ │ ├── head_black.jpg │ │ │ │ ├── head_blue.jpg │ │ │ │ ├── head_green.jpg │ │ │ │ ├── head_grey.jpg │ │ │ │ ├── head_love.jpg │ │ │ │ ├── head_orange.png │ │ │ │ ├── head_pink.jpg │ │ │ │ ├── head_purple.jpg │ │ │ │ ├── ic_layout.png │ │ │ │ ├── ic_search.png │ │ │ │ ├── ic_menu_white.png │ │ │ │ ├── ic_gridedouble.png │ │ │ │ ├── ic_lineview_grey.png │ │ │ │ ├── ic_star_checked.png │ │ │ │ ├── ic_face_black_48dp.png │ │ │ │ ├── ic_grideview_grey.png │ │ │ │ ├── ic_star_unchecked.png │ │ │ │ ├── ic_loyalty_black_48dp.png │ │ │ │ ├── ic_stars_black_48dp.png │ │ │ │ ├── ic_waterfallview_grey.png │ │ │ │ ├── ic_keyboard_arrow_down.png │ │ │ │ └── ic_settings_black_48dp.png │ │ │ ├── drawable-xxxhdpi │ │ │ │ ├── ic_more.png │ │ │ │ ├── ic_clean.png │ │ │ │ ├── ic_layout.png │ │ │ │ ├── ic_search.png │ │ │ │ ├── ic_gridedouble.png │ │ │ │ ├── ic_menu_white.png │ │ │ │ ├── ic_star_checked.png │ │ │ │ ├── ic_grideview_grey.png │ │ │ │ ├── ic_lineview_grey.png │ │ │ │ ├── ic_star_unchecked.png │ │ │ │ ├── ic_face_black_48dp.png │ │ │ │ ├── ic_stars_black_48dp.png │ │ │ │ ├── ic_keyboard_arrow_down.png │ │ │ │ ├── ic_loyalty_black_48dp.png │ │ │ │ ├── ic_settings_black_48dp.png │ │ │ │ └── ic_waterfallview_grey.png │ │ │ ├── mipmap-hdpi │ │ │ │ ├── ic_launcher.png │ │ │ │ └── ic_launcher_round.png │ │ │ ├── mipmap-mdpi │ │ │ │ ├── ic_launcher.png │ │ │ │ └── ic_launcher_round.png │ │ │ ├── mipmap-xhdpi │ │ │ │ ├── ic_launcher.png │ │ │ │ └── ic_launcher_round.png │ │ │ ├── mipmap-xxhdpi │ │ │ │ ├── ic_launcher.png │ │ │ │ └── ic_launcher_round.png │ │ │ ├── mipmap-xxxhdpi │ │ │ │ ├── ic_launcher.png │ │ │ │ └── ic_launcher_round.png │ │ │ ├── xml │ │ │ │ └── file_paths.xml │ │ │ ├── color │ │ │ │ ├── btn_common_text.xml │ │ │ │ └── subscribe_item_text_color.xml │ │ │ ├── layout │ │ │ │ ├── fragment_favorite_pager.xml │ │ │ │ ├── activity_detail.xml │ │ │ │ ├── fragment_viewpager.xml │ │ │ │ ├── channel_view_item.xml │ │ │ │ ├── recycler_subscription_item.xml │ │ │ │ ├── navigation_right_item.xml │ │ │ │ ├── fragment_navigation_right.xml │ │ │ │ ├── drawer_header.xml │ │ │ │ ├── activity_favorate.xml │ │ │ │ ├── content_view_item.xml │ │ │ │ ├── activity_about.xml │ │ │ │ ├── activity_search.xml │ │ │ │ ├── activity_main.xml │ │ │ │ ├── dialog_normal_layout.xml │ │ │ │ └── dialog_payofficial_layout.xml │ │ │ ├── values │ │ │ │ ├── attrs.xml │ │ │ │ ├── dimens.xml │ │ │ │ └── themes.xml │ │ │ └── menu │ │ │ │ └── menu_main.xml │ │ ├── java │ │ │ └── com │ │ │ │ └── wgh │ │ │ │ ├── aiyue │ │ │ │ ├── message │ │ │ │ │ ├── KeyMessage.java │ │ │ │ │ ├── ParseMessage.java │ │ │ │ │ ├── PayMessage.java │ │ │ │ │ ├── PagerCategoryMessage.java │ │ │ │ │ ├── RightCategoryMessage.java │ │ │ │ │ └── CrashMessage.java │ │ │ │ ├── util │ │ │ │ │ ├── APPTheme.java │ │ │ │ │ ├── AttrsUtil.java │ │ │ │ │ ├── AnimationUtil.java │ │ │ │ │ ├── ToastUtil.java │ │ │ │ │ ├── KeyBoardUtil.java │ │ │ │ │ ├── VibratorUtil.java │ │ │ │ │ ├── IntentUtil.java │ │ │ │ │ ├── UiUtil.java │ │ │ │ │ ├── DensityUtil.java │ │ │ │ │ ├── PhoneUtil.java │ │ │ │ │ ├── MessageUtil.java │ │ │ │ │ ├── DLog.java │ │ │ │ │ ├── SDCardUtil.java │ │ │ │ │ ├── AppUtil.java │ │ │ │ │ └── ScreenUtil.java │ │ │ │ ├── adapter │ │ │ │ │ ├── PagerListAdapter.java │ │ │ │ │ ├── FavoritePagerAdapter.java │ │ │ │ │ ├── ViewPagerAdapter.java │ │ │ │ │ ├── BelowViewAdapter.java │ │ │ │ │ ├── FavoriteListAdapter.java │ │ │ │ │ ├── SearchListAdapter.java │ │ │ │ │ └── DragViewAdapter.java │ │ │ │ ├── model │ │ │ │ │ ├── FavoriteContent.java │ │ │ │ │ ├── PayResult.java │ │ │ │ │ ├── ImgCat.java │ │ │ │ │ └── FavoriteCat.java │ │ │ │ ├── ui │ │ │ │ │ ├── view │ │ │ │ │ │ ├── OnChannelViewActionListener.java │ │ │ │ │ │ ├── MarqueTextView.java │ │ │ │ │ │ ├── BelowGridView.java │ │ │ │ │ │ ├── ProgressWebView.java │ │ │ │ │ │ ├── FavoritePagerFragment.java │ │ │ │ │ │ ├── ThemeDialog.java │ │ │ │ │ │ ├── AutoLoadRecyclerView.java │ │ │ │ │ │ └── AsyncImageView.java │ │ │ │ │ ├── FavoriteActivity.java │ │ │ │ │ ├── BaseActivity.java │ │ │ │ │ └── DetailActivity.java │ │ │ │ ├── mail │ │ │ │ │ ├── MyAuthenticator.java │ │ │ │ │ ├── ComplexMailSender.java │ │ │ │ │ ├── SimpleMailSender.java │ │ │ │ │ └── MailInfo.java │ │ │ │ ├── helper │ │ │ │ │ ├── CrashHelper.java │ │ │ │ │ └── DialogHelper.java │ │ │ │ ├── greendao │ │ │ │ │ ├── ListConverter.java │ │ │ │ │ ├── DaoSession.java │ │ │ │ │ └── DaoMaster.java │ │ │ │ ├── network │ │ │ │ │ ├── RequestCategory.java │ │ │ │ │ └── RequestManager.java │ │ │ │ ├── MyApplication.java │ │ │ │ └── cache │ │ │ │ │ └── DataCache.java │ │ │ │ └── willflowaicollection │ │ │ │ └── greendao │ │ │ │ ├── DaoSession.java │ │ │ │ └── DaoMaster.java │ │ └── AndroidManifest.xml │ ├── test │ │ └── java │ │ │ └── com │ │ │ └── wgh │ │ │ └── aiyue │ │ │ └── ExampleUnitTest.java │ └── androidTest │ │ └── java │ │ └── com │ │ └── wgh │ │ └── aiyue │ │ └── ExampleInstrumentedTest.java ├── proguard-rules.pro ├── build.gradle └── proguard-project.txt ├── revealator ├── .gitignore ├── src │ ├── main │ │ ├── AndroidManifest.xml │ │ └── java │ │ │ └── com │ │ │ └── jaouan │ │ │ └── revealator │ │ │ ├── animations │ │ │ └── AnimationListenerAdapter.java │ │ │ └── Revealator.java │ ├── test │ │ └── java │ │ │ └── com │ │ │ └── jaouan │ │ │ └── revealator │ │ │ └── ExampleUnitTest.java │ └── androidTest │ │ └── java │ │ └── com │ │ └── jaouan │ │ └── revealator │ │ └── ApplicationTest.java ├── proguard-rules.pro └── build.gradle ├── settings.gradle ├── .gitattributes ├── Download └── 爱阅V1.0.apk ├── gradle └── wrapper │ ├── gradle-wrapper.jar │ └── gradle-wrapper.properties ├── .idea ├── copyright │ └── profiles_settings.xml ├── encodings.xml ├── inspectionProfiles │ ├── profiles_settings.xml │ └── Project_Default.xml ├── modules.xml ├── runConfigurations.xml ├── gradle.xml ├── compiler.xml └── misc.xml ├── .gitignore ├── gradle.properties ├── README.md └── gradlew.bat /app/.gitignore: -------------------------------------------------------------------------------- 1 | /build 2 | -------------------------------------------------------------------------------- /revealator/.gitignore: -------------------------------------------------------------------------------- 1 | /build 2 | -------------------------------------------------------------------------------- /settings.gradle: -------------------------------------------------------------------------------- 1 | include ':app', ':revealator' 2 | -------------------------------------------------------------------------------- /.gitattributes: -------------------------------------------------------------------------------- 1 | # Auto detect text files and perform LF normalization 2 | * text=auto -------------------------------------------------------------------------------- /Download/爱阅V1.0.apk: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/WillFlower/AiYue/HEAD/Download/爱阅V1.0.apk -------------------------------------------------------------------------------- /app/libs/alipaySdk-20170725.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/WillFlower/AiYue/HEAD/app/libs/alipaySdk-20170725.jar -------------------------------------------------------------------------------- /gradle/wrapper/gradle-wrapper.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/WillFlower/AiYue/HEAD/gradle/wrapper/gradle-wrapper.jar -------------------------------------------------------------------------------- /.idea/copyright/profiles_settings.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | -------------------------------------------------------------------------------- /app/src/main/res/drawable/willflow.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/WillFlower/AiYue/HEAD/app/src/main/res/drawable/willflow.png -------------------------------------------------------------------------------- /app/src/main/res/drawable-hdpi/ic_more.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/WillFlower/AiYue/HEAD/app/src/main/res/drawable-hdpi/ic_more.png -------------------------------------------------------------------------------- /app/src/main/res/drawable-mdpi/ic_clean.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/WillFlower/AiYue/HEAD/app/src/main/res/drawable-mdpi/ic_clean.png -------------------------------------------------------------------------------- /app/src/main/res/drawable-xhdpi/ic_more.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/WillFlower/AiYue/HEAD/app/src/main/res/drawable-xhdpi/ic_more.png -------------------------------------------------------------------------------- /app/src/main/res/drawable-hdpi/ic_layout.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/WillFlower/AiYue/HEAD/app/src/main/res/drawable-hdpi/ic_layout.png -------------------------------------------------------------------------------- /app/src/main/res/drawable-hdpi/ic_search.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/WillFlower/AiYue/HEAD/app/src/main/res/drawable-hdpi/ic_search.png -------------------------------------------------------------------------------- /app/src/main/res/drawable-xhdpi/ic_clean.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/WillFlower/AiYue/HEAD/app/src/main/res/drawable-xhdpi/ic_clean.png -------------------------------------------------------------------------------- /app/src/main/res/drawable-xhdpi/ic_layout.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/WillFlower/AiYue/HEAD/app/src/main/res/drawable-xhdpi/ic_layout.png -------------------------------------------------------------------------------- /app/src/main/res/drawable-xhdpi/ic_search.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/WillFlower/AiYue/HEAD/app/src/main/res/drawable-xhdpi/ic_search.png -------------------------------------------------------------------------------- /app/src/main/res/drawable-xxhdpi/head_red.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/WillFlower/AiYue/HEAD/app/src/main/res/drawable-xxhdpi/head_red.jpg -------------------------------------------------------------------------------- /app/src/main/res/drawable-xxhdpi/ic_clean.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/WillFlower/AiYue/HEAD/app/src/main/res/drawable-xxhdpi/ic_clean.png -------------------------------------------------------------------------------- /app/src/main/res/drawable-xxhdpi/ic_more.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/WillFlower/AiYue/HEAD/app/src/main/res/drawable-xxhdpi/ic_more.png -------------------------------------------------------------------------------- /app/src/main/res/drawable-xxxhdpi/ic_more.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/WillFlower/AiYue/HEAD/app/src/main/res/drawable-xxxhdpi/ic_more.png -------------------------------------------------------------------------------- /app/src/main/res/mipmap-hdpi/ic_launcher.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/WillFlower/AiYue/HEAD/app/src/main/res/mipmap-hdpi/ic_launcher.png -------------------------------------------------------------------------------- /app/src/main/res/mipmap-mdpi/ic_launcher.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/WillFlower/AiYue/HEAD/app/src/main/res/mipmap-mdpi/ic_launcher.png -------------------------------------------------------------------------------- /app/src/main/res/mipmap-xhdpi/ic_launcher.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/WillFlower/AiYue/HEAD/app/src/main/res/mipmap-xhdpi/ic_launcher.png -------------------------------------------------------------------------------- /app/src/main/res/drawable-hdpi/ic_menu_white.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/WillFlower/AiYue/HEAD/app/src/main/res/drawable-hdpi/ic_menu_white.png -------------------------------------------------------------------------------- /app/src/main/res/drawable-mdpi/ic_menu_white.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/WillFlower/AiYue/HEAD/app/src/main/res/drawable-mdpi/ic_menu_white.png -------------------------------------------------------------------------------- /app/src/main/res/drawable-mdpi/transparent.9.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/WillFlower/AiYue/HEAD/app/src/main/res/drawable-mdpi/transparent.9.png -------------------------------------------------------------------------------- /app/src/main/res/drawable-xxhdpi/head_black.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/WillFlower/AiYue/HEAD/app/src/main/res/drawable-xxhdpi/head_black.jpg -------------------------------------------------------------------------------- /app/src/main/res/drawable-xxhdpi/head_blue.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/WillFlower/AiYue/HEAD/app/src/main/res/drawable-xxhdpi/head_blue.jpg -------------------------------------------------------------------------------- /app/src/main/res/drawable-xxhdpi/head_green.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/WillFlower/AiYue/HEAD/app/src/main/res/drawable-xxhdpi/head_green.jpg -------------------------------------------------------------------------------- /app/src/main/res/drawable-xxhdpi/head_grey.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/WillFlower/AiYue/HEAD/app/src/main/res/drawable-xxhdpi/head_grey.jpg -------------------------------------------------------------------------------- /app/src/main/res/drawable-xxhdpi/head_love.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/WillFlower/AiYue/HEAD/app/src/main/res/drawable-xxhdpi/head_love.jpg -------------------------------------------------------------------------------- /app/src/main/res/drawable-xxhdpi/head_orange.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/WillFlower/AiYue/HEAD/app/src/main/res/drawable-xxhdpi/head_orange.png -------------------------------------------------------------------------------- /app/src/main/res/drawable-xxhdpi/head_pink.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/WillFlower/AiYue/HEAD/app/src/main/res/drawable-xxhdpi/head_pink.jpg -------------------------------------------------------------------------------- /app/src/main/res/drawable-xxhdpi/head_purple.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/WillFlower/AiYue/HEAD/app/src/main/res/drawable-xxhdpi/head_purple.jpg -------------------------------------------------------------------------------- /app/src/main/res/drawable-xxhdpi/ic_layout.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/WillFlower/AiYue/HEAD/app/src/main/res/drawable-xxhdpi/ic_layout.png -------------------------------------------------------------------------------- /app/src/main/res/drawable-xxhdpi/ic_search.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/WillFlower/AiYue/HEAD/app/src/main/res/drawable-xxhdpi/ic_search.png -------------------------------------------------------------------------------- /app/src/main/res/drawable-xxxhdpi/ic_clean.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/WillFlower/AiYue/HEAD/app/src/main/res/drawable-xxxhdpi/ic_clean.png -------------------------------------------------------------------------------- /app/src/main/res/drawable-xxxhdpi/ic_layout.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/WillFlower/AiYue/HEAD/app/src/main/res/drawable-xxxhdpi/ic_layout.png -------------------------------------------------------------------------------- /app/src/main/res/drawable-xxxhdpi/ic_search.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/WillFlower/AiYue/HEAD/app/src/main/res/drawable-xxxhdpi/ic_search.png -------------------------------------------------------------------------------- /app/src/main/res/mipmap-xxhdpi/ic_launcher.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/WillFlower/AiYue/HEAD/app/src/main/res/mipmap-xxhdpi/ic_launcher.png -------------------------------------------------------------------------------- /app/src/main/res/mipmap-xxxhdpi/ic_launcher.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/WillFlower/AiYue/HEAD/app/src/main/res/mipmap-xxxhdpi/ic_launcher.png -------------------------------------------------------------------------------- /app/src/main/res/drawable-hdpi/ic_gridedouble.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/WillFlower/AiYue/HEAD/app/src/main/res/drawable-hdpi/ic_gridedouble.png -------------------------------------------------------------------------------- /app/src/main/res/drawable-hdpi/ic_star_checked.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/WillFlower/AiYue/HEAD/app/src/main/res/drawable-hdpi/ic_star_checked.png -------------------------------------------------------------------------------- /app/src/main/res/drawable-mdpi/btn_back_normal.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/WillFlower/AiYue/HEAD/app/src/main/res/drawable-mdpi/btn_back_normal.png -------------------------------------------------------------------------------- /app/src/main/res/drawable-mdpi/ic_star_checked.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/WillFlower/AiYue/HEAD/app/src/main/res/drawable-mdpi/ic_star_checked.png -------------------------------------------------------------------------------- /app/src/main/res/drawable-xhdpi/ic_gridedouble.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/WillFlower/AiYue/HEAD/app/src/main/res/drawable-xhdpi/ic_gridedouble.png -------------------------------------------------------------------------------- /app/src/main/res/drawable-xhdpi/ic_menu_white.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/WillFlower/AiYue/HEAD/app/src/main/res/drawable-xhdpi/ic_menu_white.png -------------------------------------------------------------------------------- /app/src/main/res/drawable-xxhdpi/ic_menu_white.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/WillFlower/AiYue/HEAD/app/src/main/res/drawable-xxhdpi/ic_menu_white.png -------------------------------------------------------------------------------- /app/src/main/res/mipmap-hdpi/ic_launcher_round.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/WillFlower/AiYue/HEAD/app/src/main/res/mipmap-hdpi/ic_launcher_round.png -------------------------------------------------------------------------------- /app/src/main/res/mipmap-mdpi/ic_launcher_round.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/WillFlower/AiYue/HEAD/app/src/main/res/mipmap-mdpi/ic_launcher_round.png -------------------------------------------------------------------------------- /app/src/main/res/drawable-hdpi/ic_face_black_48dp.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/WillFlower/AiYue/HEAD/app/src/main/res/drawable-hdpi/ic_face_black_48dp.png -------------------------------------------------------------------------------- /app/src/main/res/drawable-hdpi/ic_grideview_grey.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/WillFlower/AiYue/HEAD/app/src/main/res/drawable-hdpi/ic_grideview_grey.png -------------------------------------------------------------------------------- /app/src/main/res/drawable-hdpi/ic_lineview_grey.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/WillFlower/AiYue/HEAD/app/src/main/res/drawable-hdpi/ic_lineview_grey.png -------------------------------------------------------------------------------- /app/src/main/res/drawable-hdpi/ic_star_unchecked.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/WillFlower/AiYue/HEAD/app/src/main/res/drawable-hdpi/ic_star_unchecked.png -------------------------------------------------------------------------------- /app/src/main/res/drawable-mdpi/btn_back_pressed.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/WillFlower/AiYue/HEAD/app/src/main/res/drawable-mdpi/btn_back_pressed.png -------------------------------------------------------------------------------- /app/src/main/res/drawable-mdpi/ic_face_black_48dp.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/WillFlower/AiYue/HEAD/app/src/main/res/drawable-mdpi/ic_face_black_48dp.png -------------------------------------------------------------------------------- /app/src/main/res/drawable-mdpi/ic_star_unchecked.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/WillFlower/AiYue/HEAD/app/src/main/res/drawable-mdpi/ic_star_unchecked.png -------------------------------------------------------------------------------- /app/src/main/res/drawable-xhdpi/ic_grideview_grey.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/WillFlower/AiYue/HEAD/app/src/main/res/drawable-xhdpi/ic_grideview_grey.png -------------------------------------------------------------------------------- /app/src/main/res/drawable-xhdpi/ic_lineview_grey.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/WillFlower/AiYue/HEAD/app/src/main/res/drawable-xhdpi/ic_lineview_grey.png -------------------------------------------------------------------------------- /app/src/main/res/drawable-xhdpi/ic_star_checked.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/WillFlower/AiYue/HEAD/app/src/main/res/drawable-xhdpi/ic_star_checked.png -------------------------------------------------------------------------------- /app/src/main/res/drawable-xhdpi/ic_star_unchecked.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/WillFlower/AiYue/HEAD/app/src/main/res/drawable-xhdpi/ic_star_unchecked.png -------------------------------------------------------------------------------- /app/src/main/res/drawable-xxhdpi/ic_gridedouble.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/WillFlower/AiYue/HEAD/app/src/main/res/drawable-xxhdpi/ic_gridedouble.png -------------------------------------------------------------------------------- /app/src/main/res/drawable-xxhdpi/ic_lineview_grey.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/WillFlower/AiYue/HEAD/app/src/main/res/drawable-xxhdpi/ic_lineview_grey.png -------------------------------------------------------------------------------- /app/src/main/res/drawable-xxhdpi/ic_star_checked.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/WillFlower/AiYue/HEAD/app/src/main/res/drawable-xxhdpi/ic_star_checked.png -------------------------------------------------------------------------------- /app/src/main/res/drawable-xxxhdpi/ic_gridedouble.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/WillFlower/AiYue/HEAD/app/src/main/res/drawable-xxxhdpi/ic_gridedouble.png -------------------------------------------------------------------------------- /app/src/main/res/drawable-xxxhdpi/ic_menu_white.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/WillFlower/AiYue/HEAD/app/src/main/res/drawable-xxxhdpi/ic_menu_white.png -------------------------------------------------------------------------------- /app/src/main/res/drawable-xxxhdpi/ic_star_checked.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/WillFlower/AiYue/HEAD/app/src/main/res/drawable-xxxhdpi/ic_star_checked.png -------------------------------------------------------------------------------- /app/src/main/res/mipmap-xhdpi/ic_launcher_round.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/WillFlower/AiYue/HEAD/app/src/main/res/mipmap-xhdpi/ic_launcher_round.png -------------------------------------------------------------------------------- /app/src/main/res/mipmap-xxhdpi/ic_launcher_round.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/WillFlower/AiYue/HEAD/app/src/main/res/mipmap-xxhdpi/ic_launcher_round.png -------------------------------------------------------------------------------- /app/src/main/res/mipmap-xxxhdpi/ic_launcher_round.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/WillFlower/AiYue/HEAD/app/src/main/res/mipmap-xxxhdpi/ic_launcher_round.png -------------------------------------------------------------------------------- /app/src/main/res/xml/file_paths.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | -------------------------------------------------------------------------------- /app/src/main/res/drawable-hdpi/ic_stars_black_48dp.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/WillFlower/AiYue/HEAD/app/src/main/res/drawable-hdpi/ic_stars_black_48dp.png -------------------------------------------------------------------------------- /app/src/main/res/drawable-mdpi/btn_common_normal.9.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/WillFlower/AiYue/HEAD/app/src/main/res/drawable-mdpi/btn_common_normal.9.png -------------------------------------------------------------------------------- /app/src/main/res/drawable-mdpi/btn_common_pressed.9.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/WillFlower/AiYue/HEAD/app/src/main/res/drawable-mdpi/btn_common_pressed.9.png -------------------------------------------------------------------------------- /app/src/main/res/drawable-mdpi/ic_stars_black_48dp.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/WillFlower/AiYue/HEAD/app/src/main/res/drawable-mdpi/ic_stars_black_48dp.png -------------------------------------------------------------------------------- /app/src/main/res/drawable-xhdpi/ic_face_black_48dp.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/WillFlower/AiYue/HEAD/app/src/main/res/drawable-xhdpi/ic_face_black_48dp.png -------------------------------------------------------------------------------- /app/src/main/res/drawable-xhdpi/ic_stars_black_48dp.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/WillFlower/AiYue/HEAD/app/src/main/res/drawable-xhdpi/ic_stars_black_48dp.png -------------------------------------------------------------------------------- /app/src/main/res/drawable-xxhdpi/ic_face_black_48dp.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/WillFlower/AiYue/HEAD/app/src/main/res/drawable-xxhdpi/ic_face_black_48dp.png -------------------------------------------------------------------------------- /app/src/main/res/drawable-xxhdpi/ic_grideview_grey.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/WillFlower/AiYue/HEAD/app/src/main/res/drawable-xxhdpi/ic_grideview_grey.png -------------------------------------------------------------------------------- /app/src/main/res/drawable-xxhdpi/ic_star_unchecked.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/WillFlower/AiYue/HEAD/app/src/main/res/drawable-xxhdpi/ic_star_unchecked.png -------------------------------------------------------------------------------- /app/src/main/res/drawable-xxxhdpi/ic_grideview_grey.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/WillFlower/AiYue/HEAD/app/src/main/res/drawable-xxxhdpi/ic_grideview_grey.png -------------------------------------------------------------------------------- /app/src/main/res/drawable-xxxhdpi/ic_lineview_grey.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/WillFlower/AiYue/HEAD/app/src/main/res/drawable-xxxhdpi/ic_lineview_grey.png -------------------------------------------------------------------------------- /app/src/main/res/drawable-xxxhdpi/ic_star_unchecked.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/WillFlower/AiYue/HEAD/app/src/main/res/drawable-xxxhdpi/ic_star_unchecked.png -------------------------------------------------------------------------------- /app/src/main/res/drawable-hdpi/ic_keyboard_arrow_down.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/WillFlower/AiYue/HEAD/app/src/main/res/drawable-hdpi/ic_keyboard_arrow_down.png -------------------------------------------------------------------------------- /app/src/main/res/drawable-hdpi/ic_loyalty_black_48dp.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/WillFlower/AiYue/HEAD/app/src/main/res/drawable-hdpi/ic_loyalty_black_48dp.png -------------------------------------------------------------------------------- /app/src/main/res/drawable-hdpi/ic_settings_black_48dp.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/WillFlower/AiYue/HEAD/app/src/main/res/drawable-hdpi/ic_settings_black_48dp.png -------------------------------------------------------------------------------- /app/src/main/res/drawable-hdpi/ic_waterfallview_grey.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/WillFlower/AiYue/HEAD/app/src/main/res/drawable-hdpi/ic_waterfallview_grey.png -------------------------------------------------------------------------------- /app/src/main/res/drawable-mdpi/btn_common_disabled.9.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/WillFlower/AiYue/HEAD/app/src/main/res/drawable-mdpi/btn_common_disabled.9.png -------------------------------------------------------------------------------- /app/src/main/res/drawable-mdpi/ic_loyalty_black_48dp.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/WillFlower/AiYue/HEAD/app/src/main/res/drawable-mdpi/ic_loyalty_black_48dp.png -------------------------------------------------------------------------------- /app/src/main/res/drawable-mdpi/ic_settings_black_48dp.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/WillFlower/AiYue/HEAD/app/src/main/res/drawable-mdpi/ic_settings_black_48dp.png -------------------------------------------------------------------------------- /app/src/main/res/drawable-xhdpi/ic_keyboard_arrow_down.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/WillFlower/AiYue/HEAD/app/src/main/res/drawable-xhdpi/ic_keyboard_arrow_down.png -------------------------------------------------------------------------------- /app/src/main/res/drawable-xhdpi/ic_loyalty_black_48dp.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/WillFlower/AiYue/HEAD/app/src/main/res/drawable-xhdpi/ic_loyalty_black_48dp.png -------------------------------------------------------------------------------- /app/src/main/res/drawable-xhdpi/ic_settings_black_48dp.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/WillFlower/AiYue/HEAD/app/src/main/res/drawable-xhdpi/ic_settings_black_48dp.png -------------------------------------------------------------------------------- /app/src/main/res/drawable-xhdpi/ic_waterfallview_grey.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/WillFlower/AiYue/HEAD/app/src/main/res/drawable-xhdpi/ic_waterfallview_grey.png -------------------------------------------------------------------------------- /app/src/main/res/drawable-xxhdpi/ic_loyalty_black_48dp.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/WillFlower/AiYue/HEAD/app/src/main/res/drawable-xxhdpi/ic_loyalty_black_48dp.png -------------------------------------------------------------------------------- /app/src/main/res/drawable-xxhdpi/ic_stars_black_48dp.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/WillFlower/AiYue/HEAD/app/src/main/res/drawable-xxhdpi/ic_stars_black_48dp.png -------------------------------------------------------------------------------- /app/src/main/res/drawable-xxhdpi/ic_waterfallview_grey.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/WillFlower/AiYue/HEAD/app/src/main/res/drawable-xxhdpi/ic_waterfallview_grey.png -------------------------------------------------------------------------------- /app/src/main/res/drawable-xxxhdpi/ic_face_black_48dp.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/WillFlower/AiYue/HEAD/app/src/main/res/drawable-xxxhdpi/ic_face_black_48dp.png -------------------------------------------------------------------------------- /app/src/main/res/drawable-xxxhdpi/ic_stars_black_48dp.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/WillFlower/AiYue/HEAD/app/src/main/res/drawable-xxxhdpi/ic_stars_black_48dp.png -------------------------------------------------------------------------------- /app/src/main/res/drawable-xxhdpi/ic_keyboard_arrow_down.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/WillFlower/AiYue/HEAD/app/src/main/res/drawable-xxhdpi/ic_keyboard_arrow_down.png -------------------------------------------------------------------------------- /app/src/main/res/drawable-xxhdpi/ic_settings_black_48dp.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/WillFlower/AiYue/HEAD/app/src/main/res/drawable-xxhdpi/ic_settings_black_48dp.png -------------------------------------------------------------------------------- /app/src/main/res/drawable-xxxhdpi/ic_keyboard_arrow_down.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/WillFlower/AiYue/HEAD/app/src/main/res/drawable-xxxhdpi/ic_keyboard_arrow_down.png -------------------------------------------------------------------------------- /app/src/main/res/drawable-xxxhdpi/ic_loyalty_black_48dp.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/WillFlower/AiYue/HEAD/app/src/main/res/drawable-xxxhdpi/ic_loyalty_black_48dp.png -------------------------------------------------------------------------------- /app/src/main/res/drawable-xxxhdpi/ic_settings_black_48dp.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/WillFlower/AiYue/HEAD/app/src/main/res/drawable-xxxhdpi/ic_settings_black_48dp.png -------------------------------------------------------------------------------- /app/src/main/res/drawable-xxxhdpi/ic_waterfallview_grey.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/WillFlower/AiYue/HEAD/app/src/main/res/drawable-xxxhdpi/ic_waterfallview_grey.png -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | *.iml 2 | .gradle 3 | /local.properties 4 | /.idea/workspace.xml 5 | /.idea/libraries 6 | .DS_Store 7 | /build 8 | /captures 9 | .externalNativeBuild 10 | -------------------------------------------------------------------------------- /.idea/encodings.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | -------------------------------------------------------------------------------- /app/src/main/java/com/wgh/aiyue/message/KeyMessage.java: -------------------------------------------------------------------------------- 1 | package com.wgh.aiyue.message; 2 | 3 | /** 4 | * Created by : WGH. 5 | */ 6 | public class KeyMessage { 7 | public int what; 8 | public String userKey; 9 | } 10 | -------------------------------------------------------------------------------- /app/src/main/java/com/wgh/aiyue/message/ParseMessage.java: -------------------------------------------------------------------------------- 1 | package com.wgh.aiyue.message; 2 | 3 | /** 4 | * Created by : WGH. 5 | */ 6 | public class ParseMessage { 7 | public int what; 8 | public String key; 9 | } 10 | -------------------------------------------------------------------------------- /app/src/main/java/com/wgh/aiyue/message/PayMessage.java: -------------------------------------------------------------------------------- 1 | package com.wgh.aiyue.message; 2 | 3 | /** 4 | * Created by : WGH. 5 | */ 6 | public class PayMessage { 7 | public int what; 8 | public Object object; 9 | } 10 | -------------------------------------------------------------------------------- /app/src/main/res/drawable-mdpi/bg_titlebar.xml: -------------------------------------------------------------------------------- 1 | 2 | 4 | 5 | -------------------------------------------------------------------------------- /app/src/main/java/com/wgh/aiyue/message/PagerCategoryMessage.java: -------------------------------------------------------------------------------- 1 | package com.wgh.aiyue.message; 2 | 3 | /** 4 | * Created by : WGH. 5 | */ 6 | public class PagerCategoryMessage { 7 | public int what; 8 | public String key; 9 | } 10 | -------------------------------------------------------------------------------- /app/src/main/java/com/wgh/aiyue/message/RightCategoryMessage.java: -------------------------------------------------------------------------------- 1 | package com.wgh.aiyue.message; 2 | 3 | /** 4 | * Created by : WGH. 5 | */ 6 | public class RightCategoryMessage { 7 | public int what; 8 | public String drawerKey; 9 | } 10 | -------------------------------------------------------------------------------- /gradle/wrapper/gradle-wrapper.properties: -------------------------------------------------------------------------------- 1 | #Wed Jul 19 11:42:42 CST 2017 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-3.3-all.zip 7 | -------------------------------------------------------------------------------- /.idea/inspectionProfiles/profiles_settings.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 7 | -------------------------------------------------------------------------------- /revealator/src/main/AndroidManifest.xml: -------------------------------------------------------------------------------- 1 | 3 | 4 | 7 | 8 | 9 | 10 | -------------------------------------------------------------------------------- /app/src/main/java/com/wgh/aiyue/util/APPTheme.java: -------------------------------------------------------------------------------- 1 | package com.wgh.aiyue.util; 2 | 3 | /** 4 | * Created by : WGH. 5 | */ 6 | public enum APPTheme { 7 | Blue, 8 | Green, 9 | Red, 10 | Grey, 11 | Black, 12 | Purple, 13 | Orange, 14 | Pink, 15 | WillFLow 16 | } 17 | -------------------------------------------------------------------------------- /app/src/main/res/color/btn_common_text.xml: -------------------------------------------------------------------------------- 1 | 2 | 4 | 5 | 6 | 7 | -------------------------------------------------------------------------------- /app/src/main/java/com/wgh/aiyue/message/CrashMessage.java: -------------------------------------------------------------------------------- 1 | package com.wgh.aiyue.message; 2 | 3 | /** 4 | * Created by : WGH. 5 | */ 6 | public class CrashMessage { 7 | public int what; 8 | public String key; 9 | public Thread thread; 10 | public Throwable throwable; 11 | public Thread.UncaughtExceptionHandler exceptionHandler; 12 | } 13 | -------------------------------------------------------------------------------- /app/src/main/res/drawable-hdpi/search_edit_bg.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | -------------------------------------------------------------------------------- /app/src/main/res/drawable-mdpi/btn_back.xml: -------------------------------------------------------------------------------- 1 | 2 | 4 | 5 | 6 | 7 | -------------------------------------------------------------------------------- /app/src/main/res/drawable-mdpi/btn_common.xml: -------------------------------------------------------------------------------- 1 | 2 | 4 | 5 | 6 | 7 | -------------------------------------------------------------------------------- /revealator/src/test/java/com/jaouan/revealator/ExampleUnitTest.java: -------------------------------------------------------------------------------- 1 | package com.jaouan.revealator; 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 | } -------------------------------------------------------------------------------- /app/src/main/res/color/subscribe_item_text_color.xml: -------------------------------------------------------------------------------- 1 | 2 | 4 | 5 | 6 | 7 | -------------------------------------------------------------------------------- /revealator/src/androidTest/java/com/jaouan/revealator/ApplicationTest.java: -------------------------------------------------------------------------------- 1 | package com.jaouan.revealator; 2 | 3 | import android.app.Application; 4 | import android.test.ApplicationTestCase; 5 | 6 | /** 7 | * Testing Fundamentals 8 | */ 9 | public class ApplicationTest extends ApplicationTestCase { 10 | public ApplicationTest() { 11 | super(Application.class); 12 | } 13 | } -------------------------------------------------------------------------------- /app/src/main/java/com/wgh/aiyue/adapter/PagerListAdapter.java: -------------------------------------------------------------------------------- 1 | package com.wgh.aiyue.adapter; 2 | 3 | import android.content.Context; 4 | 5 | import com.wgh.aiyue.model.Category; 6 | 7 | /** 8 | * Created by : WGH. 9 | */ 10 | public class PagerListAdapter extends BaseListAdapter { 11 | public PagerListAdapter(Context mContext, Category mCategory, OnLoadPageFinishListener mLoadPageFinishListener) { 12 | super(mContext, mCategory, mLoadPageFinishListener); 13 | } 14 | } 15 | -------------------------------------------------------------------------------- /app/src/test/java/com/wgh/aiyue/ExampleUnitTest.java: -------------------------------------------------------------------------------- 1 | package com.wgh.aiyue; 2 | 3 | import org.junit.Test; 4 | 5 | import static org.junit.Assert.*; 6 | 7 | /** 8 | * Example local unit test, which will execute on the development machine (host). 9 | * 10 | * @see Testing documentation 11 | */ 12 | public class ExampleUnitTest { 13 | @Test 14 | public void addition_isCorrect() throws Exception { 15 | assertEquals(4, 2 + 2); 16 | } 17 | } -------------------------------------------------------------------------------- /.idea/modules.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | -------------------------------------------------------------------------------- /app/src/main/res/layout/fragment_favorite_pager.xml: -------------------------------------------------------------------------------- 1 | 2 | 6 | 7 | 12 | -------------------------------------------------------------------------------- /app/src/main/res/values/attrs.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | -------------------------------------------------------------------------------- /app/src/main/java/com/wgh/aiyue/util/AttrsUtil.java: -------------------------------------------------------------------------------- 1 | package com.wgh.aiyue.util; 2 | 3 | import android.content.Context; 4 | import android.content.res.Resources; 5 | import android.util.TypedValue; 6 | 7 | /** 8 | * Created by : WGH. 9 | */ 10 | public class AttrsUtil { 11 | public static int getColor(Context context, int attr) { 12 | TypedValue typedValue = new TypedValue(); 13 | Resources.Theme theme = context.getTheme(); 14 | theme.resolveAttribute(attr, typedValue, true); 15 | int color = typedValue.data; 16 | return color; 17 | } 18 | } 19 | -------------------------------------------------------------------------------- /app/src/main/java/com/wgh/aiyue/model/FavoriteContent.java: -------------------------------------------------------------------------------- 1 | package com.wgh.aiyue.model; 2 | 3 | /** 4 | * Created by : WGH. 5 | */ 6 | public class FavoriteContent { 7 | private String categoryKey; 8 | private int index; 9 | 10 | public String getCategoryKey() { 11 | return categoryKey; 12 | } 13 | 14 | public void setCategoryKey(String categoryKey) { 15 | this.categoryKey = categoryKey; 16 | } 17 | 18 | public int getIndex() { 19 | return index; 20 | } 21 | 22 | public void setIndex(int index) { 23 | this.index = index; 24 | } 25 | } 26 | -------------------------------------------------------------------------------- /.idea/runConfigurations.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 11 | 12 | -------------------------------------------------------------------------------- /revealator/src/main/java/com/jaouan/revealator/animations/AnimationListenerAdapter.java: -------------------------------------------------------------------------------- 1 | package com.jaouan.revealator.animations; 2 | 3 | import android.view.animation.Animation; 4 | 5 | /** 6 | * Animation listener adapter. 7 | */ 8 | public class AnimationListenerAdapter implements Animation.AnimationListener { 9 | 10 | @Override 11 | public void onAnimationStart(final Animation animation) { 12 | } 13 | 14 | @Override 15 | public void onAnimationEnd(final Animation animation) { 16 | } 17 | 18 | @Override 19 | public void onAnimationRepeat(final Animation animation) { 20 | } 21 | 22 | } 23 | -------------------------------------------------------------------------------- /app/src/main/res/layout/activity_detail.xml: -------------------------------------------------------------------------------- 1 | 2 | 7 | 8 | 14 | 15 | 16 | -------------------------------------------------------------------------------- /app/src/main/res/layout/fragment_viewpager.xml: -------------------------------------------------------------------------------- 1 | 2 | 6 | 7 | 12 | 13 | 14 | -------------------------------------------------------------------------------- /app/src/main/java/com/wgh/aiyue/ui/view/OnChannelViewActionListener.java: -------------------------------------------------------------------------------- 1 | package com.wgh.aiyue.ui.view; 2 | 3 | import android.view.View; 4 | import android.widget.AdapterView; 5 | 6 | /** 7 | * Created by : WGH. 8 | */ 9 | interface OnChannelViewActionListener { 10 | void onEditMode(boolean isEditMode); 11 | void onItemLongClick(AdapterView parent, View view, int position, long id); 12 | void onItemDragPosition(int startPosition, int endPosition); 13 | void onItemDragFinish(); 14 | void onDragItemClick(int position); 15 | void onBelowItemClick(int position); 16 | void onDragItemEditClick(int position); 17 | void onBelowItemEditClick(int position); 18 | } 19 | -------------------------------------------------------------------------------- /app/src/main/java/com/wgh/aiyue/mail/MyAuthenticator.java: -------------------------------------------------------------------------------- 1 | package com.wgh.aiyue.mail; 2 | 3 | import javax.mail.Authenticator; 4 | import javax.mail.PasswordAuthentication; 5 | 6 | /** 7 | * Created by : WGH. 8 | * Basic information of identity authentication. 9 | */ 10 | public class MyAuthenticator extends Authenticator { 11 | String userName = null; 12 | String password = null; 13 | 14 | public MyAuthenticator(String username, String password) { 15 | this.userName = username; 16 | this.password = password; 17 | } 18 | 19 | protected PasswordAuthentication getPasswordAuthentication() { 20 | return new PasswordAuthentication(userName, password); 21 | } 22 | } 23 | 24 | 25 | -------------------------------------------------------------------------------- /revealator/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 C:\Users\Maxence\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 | -------------------------------------------------------------------------------- /revealator/build.gradle: -------------------------------------------------------------------------------- 1 | apply plugin: 'com.android.library' 2 | 3 | android { 4 | compileSdkVersion 23 5 | buildToolsVersion '25.0.0' 6 | 7 | defaultConfig { 8 | minSdkVersion 15 9 | targetSdkVersion 23 10 | versionCode 1 11 | versionName "1.0" 12 | } 13 | buildTypes { 14 | release { 15 | minifyEnabled false 16 | proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro' 17 | } 18 | } 19 | } 20 | 21 | dependencies { 22 | compile 'com.android.support:support-annotations:23.4.0' 23 | 24 | // CircularReveal 25 | compile ('com.github.ozodrukh:CircularReveal:2.0.1@aar') { 26 | transitive = true; 27 | } 28 | } 29 | -------------------------------------------------------------------------------- /.idea/gradle.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 18 | 19 | -------------------------------------------------------------------------------- /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 | org.gradle.jvmargs=-Xmx1536m 13 | 14 | # When configured, Gradle will run in incubating parallel mode. 15 | # This option should only be used with decoupled projects. More details, visit 16 | # http://www.gradle.org/docs/current/userguide/multi_project_builds.html#sec:decoupled_projects 17 | # org.gradle.parallel=true 18 | -------------------------------------------------------------------------------- /.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 | 23 | -------------------------------------------------------------------------------- /app/src/main/java/com/wgh/aiyue/util/AnimationUtil.java: -------------------------------------------------------------------------------- 1 | package com.wgh.aiyue.util; 2 | 3 | import android.view.View; 4 | import android.view.animation.Animation; 5 | import android.view.animation.LinearInterpolator; 6 | import android.view.animation.RotateAnimation; 7 | 8 | /** 9 | * Created by : WGH. 10 | */ 11 | public class AnimationUtil { 12 | public static void rotateSelf(View view, float fromDegrees, float toDegrees) { 13 | Animation rotateAnimation = new RotateAnimation(fromDegrees, fromDegrees, Animation.RELATIVE_TO_SELF, 0.5f, Animation.RELATIVE_TO_SELF, 0.5f); 14 | rotateAnimation.setFillAfter(true); 15 | rotateAnimation.setDuration(100); 16 | rotateAnimation.setRepeatCount(0); 17 | rotateAnimation.setInterpolator(new LinearInterpolator()); 18 | view.startAnimation(rotateAnimation); 19 | } 20 | } 21 | -------------------------------------------------------------------------------- /app/src/main/res/layout/channel_view_item.xml: -------------------------------------------------------------------------------- 1 | 2 | 8 | 9 | 20 | 21 | -------------------------------------------------------------------------------- /app/src/main/java/com/wgh/aiyue/util/ToastUtil.java: -------------------------------------------------------------------------------- 1 | package com.wgh.aiyue.util; 2 | 3 | import android.content.Context; 4 | import android.widget.Toast; 5 | 6 | import com.wgh.aiyue.MyApplication; 7 | 8 | /** 9 | * Created by : WGH. 10 | */ 11 | public class ToastUtil { 12 | 13 | public static void ToastShort(Context context, String string) { 14 | Toast.makeText(context, string, Toast.LENGTH_SHORT).show(); 15 | } 16 | 17 | public static void ToastShort(String string) { 18 | ToastShort(MyApplication.context(), string); 19 | } 20 | 21 | public static void ToastShort(int stringId) { 22 | ToastShort(MyApplication.context(), MyApplication.context().getString(stringId)); 23 | } 24 | 25 | public static void ToastLong(int stringId) { 26 | ToastShort(MyApplication.context(), MyApplication.context().getString(stringId)); 27 | } 28 | } 29 | -------------------------------------------------------------------------------- /app/src/androidTest/java/com/wgh/aiyue/ExampleInstrumentedTest.java: -------------------------------------------------------------------------------- 1 | package com.wgh.aiyue; 2 | 3 | import android.content.Context; 4 | import android.support.test.InstrumentationRegistry; 5 | import android.support.test.runner.AndroidJUnit4; 6 | 7 | import org.junit.Test; 8 | import org.junit.runner.RunWith; 9 | 10 | import static org.junit.Assert.*; 11 | 12 | /** 13 | * Instrumentation test, which will execute on an Android device. 14 | * 15 | * @see Testing documentation 16 | */ 17 | @RunWith(AndroidJUnit4.class) 18 | public class ExampleInstrumentedTest { 19 | @Test 20 | public void useAppContext() throws Exception { 21 | // Context of the app under test. 22 | Context appContext = InstrumentationRegistry.getTargetContext(); 23 | 24 | assertEquals("com.wgh.willflowaicollection", appContext.getPackageName()); 25 | } 26 | } 27 | -------------------------------------------------------------------------------- /app/src/main/java/com/wgh/aiyue/ui/view/MarqueTextView.java: -------------------------------------------------------------------------------- 1 | package com.wgh.aiyue.ui.view; 2 | 3 | import android.annotation.SuppressLint; 4 | import android.content.Context; 5 | import android.support.annotation.Nullable; 6 | import android.util.AttributeSet; 7 | import android.widget.TextView; 8 | 9 | /** 10 | * Created by : WGH. 11 | */ 12 | @SuppressLint("AppCompatCustomView") 13 | public class MarqueTextView extends TextView { 14 | public MarqueTextView(Context context) { 15 | super(context); 16 | } 17 | 18 | public MarqueTextView(Context context, @Nullable AttributeSet attrs) { 19 | super(context, attrs); 20 | } 21 | 22 | public MarqueTextView(Context context, @Nullable AttributeSet attrs, int defStyleAttr) { 23 | super(context, attrs, defStyleAttr); 24 | } 25 | 26 | @Override 27 | public boolean isFocused() { 28 | return true; 29 | } 30 | } 31 | -------------------------------------------------------------------------------- /revealator/src/main/java/com/jaouan/revealator/Revealator.java: -------------------------------------------------------------------------------- 1 | package com.jaouan.revealator; 2 | 3 | import android.support.annotation.NonNull; 4 | import android.view.View; 5 | 6 | /** 7 | * Revealator utils. 8 | */ 9 | public class Revealator { 10 | 11 | /** 12 | * Reveal a view. 13 | * 14 | * @param viewToReveal View to reveal. 15 | * @return Revealator "reveal" builder. 16 | */ 17 | public static RevealBuilder reveal(@NonNull final View viewToReveal) { 18 | return new RevealBuilder(viewToReveal); 19 | } 20 | 21 | /** 22 | * Reveal a view. 23 | * 24 | * @param viewToUnreveal View to reveal. Parent must be instance of RevealViewGroup. 25 | * @return Revealator "unreveal" builder. 26 | */ 27 | public static UnrevealBuilder unreveal(@NonNull final View viewToUnreveal) { 28 | return new UnrevealBuilder(viewToUnreveal); 29 | } 30 | 31 | } 32 | -------------------------------------------------------------------------------- /app/src/main/java/com/wgh/aiyue/ui/view/BelowGridView.java: -------------------------------------------------------------------------------- 1 | package com.wgh.aiyue.ui.view; 2 | 3 | import android.content.Context; 4 | import android.util.AttributeSet; 5 | import android.widget.GridView; 6 | 7 | /** 8 | * Created by : WGH. 9 | */ 10 | public class BelowGridView extends GridView { 11 | public BelowGridView(Context context) { 12 | super(context); 13 | } 14 | 15 | public BelowGridView(Context context, AttributeSet attrs) { 16 | super(context, attrs); 17 | } 18 | 19 | public BelowGridView(Context context, AttributeSet attrs, int defStyleAttr) { 20 | super(context, attrs, defStyleAttr); 21 | } 22 | 23 | @Override 24 | public void onMeasure(int widthMeasureSpec, int heightMeasureSpec) { 25 | int expandSpec = MeasureSpec.makeMeasureSpec(Integer.MAX_VALUE >> 2, MeasureSpec.AT_MOST); 26 | super.onMeasure(widthMeasureSpec, expandSpec); 27 | } 28 | } 29 | -------------------------------------------------------------------------------- /app/src/main/res/drawable/progress_bar_states.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 21 | 22 | 23 | 24 | 25 | -------------------------------------------------------------------------------- /app/src/main/java/com/wgh/aiyue/model/PayResult.java: -------------------------------------------------------------------------------- 1 | package com.wgh.aiyue.model; import android.text.TextUtils; import java.util.Map; public class PayResult { private String resultStatus; private String result; private String memo; public PayResult(Map rawResult) { if (rawResult == null) { return; } for (String key : rawResult.keySet()) { if (TextUtils.equals(key, "resultStatus")) { resultStatus = rawResult.get(key); } else if (TextUtils.equals(key, "result")) { result = rawResult.get(key); } else if (TextUtils.equals(key, "memo")) { memo = rawResult.get(key); } } } @Override public String toString() { return "resultStatus={" + resultStatus + "};memo={" + memo + "};result={" + result + "}"; } /** * @return the resultStatus */ public String getResultStatus() { return resultStatus; } /** * @return the memo */ public String getMemo() { return memo; } /** * @return the result */ public String getResult() { return result; } } -------------------------------------------------------------------------------- /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 /home/wgh/Applications/android-sdk-linux/tools/proguard/proguard-android.txt 4 | # You can edit the include path and order by changing the proguardFiles 5 | # directive in build.gradle. 6 | # 7 | # For more details, see 8 | # http://developer.android.com/guide/developing/tools/proguard.html 9 | 10 | # Add any project specific keep options here: 11 | 12 | # If your project uses WebView with JS, uncomment the following 13 | # and specify the fully qualified class name to the JavaScript interface 14 | # class: 15 | #-keepclassmembers class fqcn.of.javascript.interface.for.webview { 16 | # public *; 17 | #} 18 | 19 | # Uncomment this to preserve the line number information for 20 | # debugging stack traces. 21 | #-keepattributes SourceFile,LineNumberTable 22 | 23 | # If you keep the line number information, uncomment this to 24 | # hide the original source file name. 25 | #-renamesourcefileattribute SourceFile 26 | -------------------------------------------------------------------------------- /app/src/main/java/com/wgh/aiyue/util/KeyBoardUtil.java: -------------------------------------------------------------------------------- 1 | package com.wgh.aiyue.util; 2 | 3 | import android.content.Context; 4 | import android.view.inputmethod.InputMethodManager; 5 | import android.widget.EditText; 6 | 7 | /** 8 | * Created by : WGH. 9 | */ 10 | public class KeyBoardUtil { 11 | 12 | /** 13 | * Open soft keyboard 14 | */ 15 | public static void openKeybord(EditText mEditText, Context mContext) { 16 | InputMethodManager imm = (InputMethodManager) mContext.getSystemService(Context.INPUT_METHOD_SERVICE); 17 | imm.showSoftInput(mEditText, InputMethodManager.RESULT_SHOWN); 18 | imm.toggleSoftInput(InputMethodManager.SHOW_FORCED, InputMethodManager.HIDE_IMPLICIT_ONLY); 19 | } 20 | 21 | /** 22 | * Close soft keyboard 23 | */ 24 | public static void closeKeybord(EditText mEditText, Context mContext) { 25 | InputMethodManager imm = (InputMethodManager) mContext.getSystemService(Context.INPUT_METHOD_SERVICE); 26 | imm.hideSoftInputFromWindow(mEditText.getWindowToken(), 0); 27 | } 28 | } 29 | -------------------------------------------------------------------------------- /app/src/main/res/layout/recycler_subscription_item.xml: -------------------------------------------------------------------------------- 1 | 2 | 14 | 15 | 23 | 24 | -------------------------------------------------------------------------------- /app/src/main/res/layout/navigation_right_item.xml: -------------------------------------------------------------------------------- 1 | 2 | 16 | 17 | 25 | 26 | -------------------------------------------------------------------------------- /app/src/main/res/menu/menu_main.xml: -------------------------------------------------------------------------------- 1 | 5 | 6 | 13 | 14 | 18 | 22 | 26 | 27 | 28 | 29 | -------------------------------------------------------------------------------- /app/src/main/res/layout/fragment_navigation_right.xml: -------------------------------------------------------------------------------- 1 | 2 | 7 | 8 | 22 | 23 | 27 | 28 | -------------------------------------------------------------------------------- /app/src/main/java/com/wgh/aiyue/util/VibratorUtil.java: -------------------------------------------------------------------------------- 1 | package com.wgh.aiyue.util; 2 | 3 | import android.app.Service; 4 | import android.content.Context; 5 | import android.os.Vibrator; 6 | 7 | import com.wgh.aiyue.MyApplication; 8 | 9 | public class VibratorUtil { 10 | 11 | /** 12 | * long milliseconds :Length of vibration(ms) 13 | */ 14 | public static void Vibrate(long millSecond) { 15 | Vibrator vibrator = (Vibrator) MyApplication.context().getSystemService(Service.VIBRATOR_SERVICE); 16 | vibrator.vibrate(millSecond); 17 | } 18 | 19 | public static void Vibrate(Context context, long millSecond) { 20 | Vibrator vibrator = (Vibrator) context.getSystemService(Service.VIBRATOR_SERVICE); 21 | vibrator.vibrate(millSecond); 22 | } 23 | 24 | /** 25 | * long[] pattern :Custom shock mode. long at rest, long at shock, long at rest, long at shock... 26 | * boolean isRepeat :Repeated vibration. 27 | */ 28 | public static void Vibrate(Context context, long[] pattern, boolean isRepeat) { 29 | Vibrator vibrator = (Vibrator) context.getSystemService(Service.VIBRATOR_SERVICE); 30 | vibrator.vibrate(pattern, isRepeat ? 1 : -1); 31 | } 32 | } 33 | -------------------------------------------------------------------------------- /app/src/main/res/values/dimens.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 16dp 4 | 16dp 5 | 6 | 24dp 7 | 8dp 8 | 2dp 9 | 4dp 10 | 16dp 11 | 4dp 12 | 13 | 222dp 14 | 16dp 15 | 16dp 16 | 17 | 18 | 10sp 19 | 11sp 20 | 12sp 21 | 13sp 22 | 14sp 23 | 15sp 24 | 16sp 25 | 17sp 26 | 18sp 27 | 21sp 28 | 29 | -------------------------------------------------------------------------------- /app/src/main/java/com/wgh/aiyue/helper/CrashHelper.java: -------------------------------------------------------------------------------- 1 | package com.wgh.aiyue.helper; 2 | 3 | import android.content.Context; 4 | 5 | import com.wgh.aiyue.util.MessageUtil; 6 | 7 | import java.lang.Thread.UncaughtExceptionHandler; 8 | 9 | /** 10 | * Created by : WGH. 11 | */ 12 | public class CrashHelper implements UncaughtExceptionHandler { 13 | 14 | private Context mContext; 15 | private static CrashHelper crashHelper; 16 | private UncaughtExceptionHandler mDefaultHandler; 17 | 18 | private CrashHelper() { 19 | } 20 | 21 | public static CrashHelper getInstance() { 22 | if (crashHelper == null) { 23 | crashHelper = new CrashHelper(); 24 | } 25 | return crashHelper; 26 | } 27 | 28 | public void init(Context context) { 29 | mContext = context; 30 | // to get the default UncaughtException of system 31 | mDefaultHandler = Thread.getDefaultUncaughtExceptionHandler(); 32 | // to set the CrashHandler as the default program handler 33 | Thread.setDefaultUncaughtExceptionHandler(this); 34 | } 35 | 36 | @Override 37 | public void uncaughtException(Thread thread, Throwable exception) { 38 | MessageUtil.postAppCrashMsg(exception, mDefaultHandler, thread); 39 | } 40 | } 41 | -------------------------------------------------------------------------------- /app/src/main/res/layout/drawer_header.xml: -------------------------------------------------------------------------------- 1 | 2 | 7 | 8 | 14 | 15 | 23 | 24 | 32 | 33 | -------------------------------------------------------------------------------- /app/src/main/java/com/wgh/aiyue/greendao/ListConverter.java: -------------------------------------------------------------------------------- 1 | package com.wgh.aiyue.greendao; 2 | 3 | import com.wgh.aiyue.util.ConstDefine; 4 | 5 | import org.greenrobot.greendao.converter.PropertyConverter; 6 | 7 | import java.util.ArrayList; 8 | import java.util.Arrays; 9 | import java.util.List; 10 | 11 | /** 12 | * Created by : WGH. 13 | */ 14 | public class ListConverter implements PropertyConverter, String> { 15 | 16 | @Override 17 | public ArrayList convertToEntityProperty(String databaseValue) { 18 | ArrayList arrayList; 19 | if (databaseValue == null) { 20 | return null; 21 | } else { 22 | List list = Arrays.asList(databaseValue.split(ConstDefine.SplitString)); 23 | arrayList = new ArrayList<>(list); 24 | return arrayList; 25 | } 26 | } 27 | 28 | @Override 29 | public String convertToDatabaseValue(ArrayList entityProperty) { 30 | if (entityProperty == null) { 31 | return null; 32 | } else { 33 | StringBuilder sb = new StringBuilder(); 34 | for (String entity : entityProperty) { 35 | sb.append(entity); 36 | sb.append(ConstDefine.SplitString); 37 | } 38 | return sb.toString(); 39 | } 40 | } 41 | } 42 | -------------------------------------------------------------------------------- /app/src/main/java/com/wgh/aiyue/model/ImgCat.java: -------------------------------------------------------------------------------- 1 | package com.wgh.aiyue.model; 2 | 3 | import org.greenrobot.greendao.annotation.Entity; 4 | import org.greenrobot.greendao.annotation.Generated; 5 | import org.greenrobot.greendao.annotation.Id; 6 | 7 | /** 8 | * Created by : WGH. 9 | */ 10 | @Entity 11 | public class ImgCat { 12 | @Id(autoincrement = true) 13 | private Long id; 14 | private String contentUrl; 15 | private String imgUrl; 16 | 17 | @Generated(hash = 896637884) 18 | public ImgCat() { 19 | } 20 | 21 | public ImgCat(String contentUrl, String imgUrl) { 22 | this.contentUrl = contentUrl; 23 | this.imgUrl = imgUrl; 24 | } 25 | 26 | @Generated(hash = 1692887716) 27 | public ImgCat(Long id, String contentUrl, String imgUrl) { 28 | this.id = id; 29 | this.contentUrl = contentUrl; 30 | this.imgUrl = imgUrl; 31 | } 32 | 33 | public Long getId() { 34 | return id; 35 | } 36 | 37 | public void setId(Long id) { 38 | this.id = id; 39 | } 40 | 41 | public String getContentUrl() { 42 | return contentUrl; 43 | } 44 | 45 | public void setContentUrl(String contentUrl) { 46 | this.contentUrl = contentUrl; 47 | } 48 | 49 | public String getImgUrl() { 50 | return imgUrl; 51 | } 52 | 53 | public void setImgUrl(String imgUrl) { 54 | this.imgUrl = imgUrl; 55 | } 56 | } 57 | -------------------------------------------------------------------------------- /app/src/main/java/com/wgh/aiyue/adapter/FavoritePagerAdapter.java: -------------------------------------------------------------------------------- 1 | package com.wgh.aiyue.adapter; 2 | 3 | import android.content.Context; 4 | import android.support.v4.app.Fragment; 5 | import android.support.v4.app.FragmentManager; 6 | import android.support.v4.app.FragmentPagerAdapter; 7 | 8 | import com.wgh.aiyue.helper.DatabaseHelper; 9 | import com.wgh.aiyue.model.Category; 10 | import com.wgh.aiyue.ui.view.FavoritePagerFragment; 11 | 12 | import java.util.ArrayList; 13 | 14 | /** 15 | * Created by : WGH. 16 | */ 17 | public class FavoritePagerAdapter extends FragmentPagerAdapter { 18 | private Context mContext; 19 | private ArrayList mCategoryList; 20 | 21 | public FavoritePagerAdapter(FragmentManager fm, Context context) { 22 | super(fm); 23 | mContext = context; 24 | mCategoryList = DatabaseHelper.getInstance().getAllFavoriteCategory(); 25 | } 26 | 27 | @Override 28 | public Fragment getItem(int position) { 29 | return FavoritePagerFragment.newInstance(mContext, mCategoryList.get(position)); 30 | } 31 | 32 | @Override 33 | public int getCount() { 34 | if (mCategoryList != null) { 35 | return mCategoryList.size(); 36 | } else { 37 | return 0; 38 | } 39 | } 40 | 41 | @Override 42 | public CharSequence getPageTitle(int position) { 43 | return mCategoryList.get(position).getName(); 44 | } 45 | } 46 | -------------------------------------------------------------------------------- /app/src/main/java/com/wgh/aiyue/util/IntentUtil.java: -------------------------------------------------------------------------------- 1 | package com.wgh.aiyue.util; 2 | 3 | import android.content.Context; 4 | import android.content.Intent; 5 | 6 | import com.wgh.aiyue.ui.AboutActivity; 7 | import com.wgh.aiyue.ui.DetailActivity; 8 | import com.wgh.aiyue.ui.FavoriteActivity; 9 | import com.wgh.aiyue.ui.MainActivity; 10 | import com.wgh.aiyue.ui.SearchActivity; 11 | 12 | /** 13 | * Created by : WGH. 14 | */ 15 | public class IntentUtil { 16 | 17 | public static void openMain(Context context) { 18 | Intent intent = new Intent(context, MainActivity.class); 19 | context.startActivity(intent); 20 | } 21 | 22 | public static void openDetail(Context context, String urlString) { 23 | Intent intent = new Intent(context, DetailActivity.class); 24 | intent.putExtra(DetailActivity.EXTRA_Url, urlString); 25 | context.startActivity(intent); 26 | } 27 | 28 | public static void openAbout(Context context) { 29 | Intent intent = new Intent(context, AboutActivity.class); 30 | context.startActivity(intent); 31 | } 32 | 33 | public static void openFavorite(Context context) { 34 | Intent intent = new Intent(context, FavoriteActivity.class); 35 | context.startActivity(intent); 36 | } 37 | 38 | public static void openSearch(Context context) { 39 | Intent intent = new Intent(context, SearchActivity.class); 40 | context.startActivity(intent); 41 | } 42 | } 43 | -------------------------------------------------------------------------------- /app/src/main/java/com/wgh/aiyue/util/UiUtil.java: -------------------------------------------------------------------------------- 1 | package com.wgh.aiyue.util; 2 | 3 | import android.app.Activity; 4 | import android.content.Context; 5 | import android.util.DisplayMetrics; 6 | 7 | /** 8 | * Created by : WGH. 9 | */ 10 | 11 | public class UiUtil { 12 | 13 | private static DisplayMetrics metric = new DisplayMetrics(); 14 | private static android.view.WindowManager.LayoutParams mParams; 15 | private static UiUtil uiUtil = null; 16 | 17 | public static UiUtil getInstance(Context context) { 18 | Activity activity = (Activity) context; 19 | activity.getWindowManager().getDefaultDisplay().getMetrics(metric); 20 | mParams = activity.getWindow().getAttributes(); 21 | if (uiUtil == null) { 22 | uiUtil = new UiUtil(); 23 | } 24 | return uiUtil; 25 | } 26 | 27 | public int getWindowWidth() { 28 | return metric.widthPixels; // The width of the screen.(pixel) 29 | } 30 | 31 | public int getWindowHeight() { 32 | return metric.heightPixels; // The height of the screen.(pixel) 33 | } 34 | 35 | public float getDensity() { 36 | return metric.density; // The density of the screen.(0.75 / 1.0 / 1.5) 37 | } 38 | 39 | public int getDensityDpi() { 40 | return metric.densityDpi; // The screen density DPI.(120 / 160 / 240) 41 | } 42 | 43 | public void setWindowWidth(int width) { 44 | mParams.width = width; 45 | } 46 | 47 | public void setWindowHeight(int height) { 48 | mParams.height = height; 49 | } 50 | } 51 | -------------------------------------------------------------------------------- /app/src/main/java/com/wgh/aiyue/util/DensityUtil.java: -------------------------------------------------------------------------------- 1 | package com.wgh.aiyue.util; 2 | 3 | import android.content.Context; 4 | import android.util.TypedValue; 5 | 6 | /** 7 | * Created by : WGH. 8 | */ 9 | public class DensityUtil { 10 | 11 | private DensityUtil() { 12 | /* cannot be instantiated */ 13 | throw new UnsupportedOperationException("cannot be instantiated"); 14 | } 15 | 16 | public static int dip2px(Context context, float dipValue) { 17 | final float scale = context.getResources().getDisplayMetrics().density; 18 | return (int) (dipValue * scale + 0.5f); 19 | } 20 | 21 | public int px2dip(Context context, float pxValue) { 22 | final float scale = context.getResources().getDisplayMetrics().density; 23 | return (int) (pxValue / scale + 0.5f); 24 | } 25 | 26 | public static int dp2px(Context context, float dpVal) { 27 | return (int) TypedValue.applyDimension(TypedValue.COMPLEX_UNIT_DIP, 28 | dpVal, context.getResources().getDisplayMetrics()); 29 | } 30 | 31 | public static int sp2px(Context context, float spVal) { 32 | return (int) TypedValue.applyDimension(TypedValue.COMPLEX_UNIT_SP, 33 | spVal, context.getResources().getDisplayMetrics()); 34 | } 35 | 36 | public static float px2dp(Context context, float pxVal) { 37 | final float scale = context.getResources().getDisplayMetrics().density; 38 | return (pxVal / scale); 39 | } 40 | 41 | public static float px2sp(Context context, float pxVal) { 42 | return (pxVal / context.getResources().getDisplayMetrics().scaledDensity); 43 | } 44 | } 45 | -------------------------------------------------------------------------------- /app/src/main/java/com/wgh/aiyue/ui/FavoriteActivity.java: -------------------------------------------------------------------------------- 1 | package com.wgh.aiyue.ui; 2 | 3 | import android.os.Bundle; 4 | import android.support.design.widget.TabLayout; 5 | import android.support.v4.app.FragmentTransaction; 6 | import android.support.v4.view.ViewPager; 7 | import android.support.v7.app.ActionBar; 8 | 9 | import com.wgh.aiyue.R; 10 | import com.wgh.aiyue.adapter.FavoritePagerAdapter; 11 | 12 | import butterknife.BindView; 13 | import butterknife.ButterKnife; 14 | 15 | public class FavoriteActivity extends BaseActivity implements ActionBar.TabListener { 16 | 17 | 18 | @BindView(R.id.tab_layout_favorite) 19 | TabLayout tabLayoutFavorite; 20 | @BindView(R.id.viewpager_favorite) 21 | ViewPager pagerFavorite; 22 | 23 | private FavoritePagerAdapter mFavoritePagerAdapter; 24 | 25 | @Override 26 | protected void onCreate(Bundle savedInstanceState) { 27 | super.onCreate(savedInstanceState); 28 | setContentView(R.layout.activity_favorate); 29 | ButterKnife.bind(this); 30 | 31 | mFavoritePagerAdapter = new FavoritePagerAdapter(getSupportFragmentManager(), this); 32 | pagerFavorite.setAdapter(mFavoritePagerAdapter); 33 | tabLayoutFavorite.setupWithViewPager(pagerFavorite); 34 | } 35 | 36 | @Override 37 | public void onTabSelected(ActionBar.Tab tab, FragmentTransaction ft) { 38 | pagerFavorite.setCurrentItem(tab.getPosition()); 39 | } 40 | 41 | @Override 42 | public void onTabUnselected(ActionBar.Tab tab, FragmentTransaction ft) { 43 | 44 | } 45 | 46 | @Override 47 | public void onTabReselected(ActionBar.Tab tab, FragmentTransaction ft) { 48 | 49 | } 50 | } 51 | -------------------------------------------------------------------------------- /app/src/main/res/drawable-mdpi/subscribe_item_bg.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 | 33 | 34 | 35 | 36 | 37 | 38 | -------------------------------------------------------------------------------- /app/src/main/res/layout/activity_favorate.xml: -------------------------------------------------------------------------------- 1 | 2 | 8 | 9 | 13 | 14 | 17 | 18 | 24 | 25 | 26 | 33 | 34 | 35 | 36 | 37 | -------------------------------------------------------------------------------- /app/src/main/java/com/wgh/aiyue/network/RequestCategory.java: -------------------------------------------------------------------------------- 1 | package com.wgh.aiyue.network; 2 | 3 | import com.android.volley.NetworkResponse; 4 | import com.android.volley.ParseError; 5 | import com.android.volley.Request; 6 | import com.android.volley.Response; 7 | import com.android.volley.toolbox.HttpHeaderParser; 8 | 9 | import java.io.BufferedReader; 10 | import java.io.ByteArrayInputStream; 11 | import java.io.InputStreamReader; 12 | import java.util.ArrayList; 13 | 14 | /** 15 | * Created by : WGH. 16 | */ 17 | public class RequestCategory extends Request> { 18 | 19 | private Response.Listener> listener; 20 | private int SOURCE = -1; 21 | 22 | public RequestCategory(String url, Response.Listener> listener, Response.ErrorListener errorListener) { 23 | super(Method.GET, url, errorListener); 24 | this.listener = listener; 25 | } 26 | 27 | @Override 28 | protected Response> parseNetworkResponse(NetworkResponse response) { 29 | try { 30 | ArrayList contents = parseImgSession(new BufferedReader(new InputStreamReader(new ByteArrayInputStream(response.data)))); 31 | return Response.success(contents, HttpHeaderParser.parseCacheHeaders(response)); 32 | } catch (Exception e) { 33 | e.printStackTrace(); 34 | return Response.error(new ParseError(e)); 35 | } 36 | } 37 | 38 | @Override 39 | protected void deliverResponse(ArrayList response) { 40 | listener.onResponse(response); 41 | } 42 | 43 | private ArrayList parseImgSession(BufferedReader bufferedReader) { 44 | ArrayList contents = new ArrayList<>(); 45 | // to deal with the response data. 46 | return contents; 47 | } 48 | } 49 | -------------------------------------------------------------------------------- /app/src/main/java/com/wgh/aiyue/model/FavoriteCat.java: -------------------------------------------------------------------------------- 1 | package com.wgh.aiyue.model; 2 | 3 | import com.wgh.aiyue.greendao.ListConverter; 4 | 5 | import org.greenrobot.greendao.annotation.Convert; 6 | import org.greenrobot.greendao.annotation.Entity; 7 | import org.greenrobot.greendao.annotation.Generated; 8 | import org.greenrobot.greendao.annotation.Id; 9 | 10 | import java.util.ArrayList; 11 | 12 | /** 13 | * Created by : WGH. 14 | */ 15 | @Entity 16 | public class FavoriteCat { 17 | @Id(autoincrement = true) 18 | private Long id; 19 | private String categoryKey; 20 | @Convert(columnType = String.class, converter = ListConverter.class) 21 | private ArrayList favoriteUrls = new ArrayList<>(); 22 | 23 | @Generated(hash = 2133203663) 24 | public FavoriteCat(Long id, String categoryKey, ArrayList favoriteUrls) { 25 | this.id = id; 26 | this.categoryKey = categoryKey; 27 | this.favoriteUrls = favoriteUrls; 28 | } 29 | 30 | @Generated(hash = 937828944) 31 | public FavoriteCat() { 32 | } 33 | 34 | public FavoriteCat(String categoryKey, ArrayList favoriteUrls) { 35 | this.categoryKey = categoryKey; 36 | this.favoriteUrls = favoriteUrls; 37 | } 38 | 39 | public Long getId() { 40 | return id; 41 | } 42 | 43 | public void setId(Long id) { 44 | this.id = id; 45 | } 46 | 47 | public String getCategoryKey() { 48 | return categoryKey; 49 | } 50 | 51 | public void setCategoryKey(String categoryKey) { 52 | this.categoryKey = categoryKey; 53 | } 54 | 55 | public ArrayList getFavoriteUrls() { 56 | return favoriteUrls; 57 | } 58 | 59 | public void setFavoriteUrls(ArrayList favoriteUrls) { 60 | this.favoriteUrls = favoriteUrls; 61 | } 62 | } 63 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # 爱阅(AiYue) 2 | 3 | ## 1、博客地址:[简书_WillFlow](http://www.jianshu.com/p/a72135e057ec)、[CSDN_WillFlow](http://blog.csdn.net/comwill/article/details/78091883) 4 | 5 | ## 2、效果图 6 | ##### (1)整体效果图1 7 | ![](https://i.imgur.com/TZx1Kqt.png) 8 | ##### (2)整体效果图2 9 | ![](https://i.imgur.com/7YXkTNl.png) 10 | ##### (3)开机动图 11 | ![](http://upload-images.jianshu.io/upload_images/2682788-8e52ee65d9b8edb2.gif?imageMogr2/auto-orient/strip) 12 | 13 | #### 更多动图及文章教程可到我的博客中查看:[WillFlow](http://www.jianshu.com/p/a72135e057ec) 14 | 15 | 关于“爱阅” 16 | 1、“爱阅”专注于收集优质的文章、站点、教程,与大家共分享。 17 | 2、如果你有好的意见和建议,欢迎反馈给我。 18 | 3、如果你有好的文章、站点或教程,欢迎联系我推广(填写好网址URL并尽量配送一张网站图标URL发送至邮箱wanggh0757@163.com即可) 19 | 4、如有涉及版权,请立即与我取得联系。 20 | 21 | “爱阅”的打开方式 22 | 1、如果你是第一次使用,你第一眼看到的是“爱阅”的时代广场,在这里你可以这么玩耍: 23 | (1)滑动:上下左右滑一滑你就知道咯! 24 | (2)点击:轻轻一点,你就进入了她的内心世界;长按,她就把她的地址交给了你! 25 | (3)右上角:帮你快速找到你想要的,帮你用不同的眼光看世界! 26 | 2、如果你用温柔的目光打开左侧边栏,这是“爱阅”为您准备的精品菜单,主要有四大菜系: 27 | (1)个人收藏:这里是你所有宝藏的汇集地,你前行路上收藏的所有宝贝都在这了! 28 | (2)订阅管理:“爱阅”世界里的六大门类,想去哪里由你掌控! 29 | (3)系统设置:想换种颜色?想打通任督二脉升级更高超的技能?来这就对了! 30 | (4)关 于:想夸夸她?想吐吐她?想撩撩她?还不快点击右上角小按钮! 31 | 3、如果你一不小心打开了右侧边栏,您将收获万能的遥控器一枚,你可以用它遥控“爱阅”的整个世界: 32 | (1)我的订阅:当你在左侧边栏选择了某一个门类后,这里便迅速地为你展开门内的世界。单击标签就切换了你的时代广场,长按就进入了编辑模式。 33 | (2)更多订阅:进入编辑模式后,一些标签有可能就被残忍地丢弃到了这里,当然你也可以扔回去,还可以进行排序。 34 | 35 | 关于作者 36 | 1、互联网江湖中勤恳的程序员一枚。 37 | 2、常混迹于各技术论坛,对Android情有独钟。 38 | 3、爱编程、爱写作、爱交友,欢迎与我取得联系。 39 | 40 | 41 | ## 联系方式 42 | 43 | 1、邮箱:wanggh0757@163.com 44 | 45 | 2、CSDN:[WillFlow](http://blog.csdn.net/comwill?viewmode=contents) 46 | 47 | 3、简书:[WillFlow](http://www.jianshu.com/u/dcf7bd45aecd) 48 | 49 | 4、微信公众号:[WillFlow](https://mp.weixin.qq.com/mp/profile_ext?action=home&__biz=MzIzMTQ4OTMxOQ==&scene=124#wechat_redirect) 50 | 51 | ![](http://upload-images.jianshu.io/upload_images/2682788-c760ad0a46251619.jpg?imageMogr2/auto-orient/strip%7CimageView2/2/w/233) -------------------------------------------------------------------------------- /app/src/main/java/com/wgh/aiyue/util/PhoneUtil.java: -------------------------------------------------------------------------------- 1 | package com.wgh.aiyue.util; 2 | 3 | import android.content.pm.PackageInfo; 4 | import android.content.pm.PackageManager; 5 | import android.os.Build; 6 | 7 | import com.wgh.aiyue.MyApplication; 8 | 9 | import java.lang.reflect.Field; 10 | import java.util.HashMap; 11 | 12 | /** 13 | * Created by : WGH. 14 | */ 15 | public class PhoneUtil { 16 | 17 | private static PhoneUtil phoneUtil; 18 | 19 | public static PhoneUtil getInstance() { 20 | if (phoneUtil == null) { 21 | phoneUtil = new PhoneUtil(); 22 | } 23 | return phoneUtil; 24 | } 25 | 26 | public HashMap getDeviceInfo() { 27 | HashMap deviceInfos = new HashMap<>(); 28 | try { 29 | PackageManager packageManager = MyApplication.context().getPackageManager(); 30 | PackageInfo packageInfo = packageManager.getPackageInfo(MyApplication.context().getPackageName(), PackageManager.GET_ACTIVITIES); 31 | if (packageInfo != null) { 32 | deviceInfos.put("appName", AppUtil.getInstance().getAppName(MyApplication.context())); 33 | deviceInfos.put("versionName", AppUtil.getInstance().getVersionName(MyApplication.context())); 34 | deviceInfos.put("versionCode", String.valueOf(AppUtil.getInstance().getVersionCode(MyApplication.context()))); 35 | } 36 | } catch (Exception e) { 37 | DLog.e("an error occured when collect package info.\n" + e.toString()); 38 | e.printStackTrace(); 39 | } 40 | Field[] fields = Build.class.getDeclaredFields(); 41 | for (Field field : fields) { 42 | try { 43 | field.setAccessible(true); 44 | deviceInfos.put(field.getName(), field.get(null).toString()); 45 | } catch (Exception e) { 46 | DLog.e("an error occured when collect crash info.\n" + e.toString()); 47 | e.printStackTrace(); 48 | } 49 | } 50 | return deviceInfos; 51 | } 52 | } 53 | -------------------------------------------------------------------------------- /app/src/main/java/com/wgh/aiyue/util/MessageUtil.java: -------------------------------------------------------------------------------- 1 | package com.wgh.aiyue.util; 2 | 3 | import com.wgh.aiyue.message.CrashMessage; 4 | import com.wgh.aiyue.message.KeyMessage; 5 | import com.wgh.aiyue.message.PagerCategoryMessage; 6 | import com.wgh.aiyue.message.PayMessage; 7 | import com.wgh.aiyue.message.RightCategoryMessage; 8 | 9 | import org.greenrobot.eventbus.EventBus; 10 | 11 | import java.util.Map; 12 | 13 | /** 14 | * Created by : WGH. 15 | */ 16 | public class MessageUtil { 17 | public static void postRightCategoryChangeMsg(String categoryKey) { 18 | RightCategoryMessage message = new RightCategoryMessage(); 19 | message.what = ConstDefine.DrawerCategoryChange; 20 | message.drawerKey = categoryKey; 21 | EventBus.getDefault().post(message); 22 | } 23 | 24 | public static void postPagerCategoryChangeMsg(String categoryKey) { 25 | PagerCategoryMessage message = new PagerCategoryMessage(); 26 | message.what = ConstDefine.PagerCategoryChange; 27 | message.key = categoryKey; 28 | EventBus.getDefault().post(message); 29 | } 30 | 31 | public static void postAppCrashMsg(Throwable exception, Thread.UncaughtExceptionHandler exceptionHandler, Thread thread) { 32 | CrashMessage crashMessage = new CrashMessage(); 33 | crashMessage.what = ConstDefine.AppCrash; 34 | crashMessage.throwable = exception; 35 | crashMessage.exceptionHandler = exceptionHandler; 36 | crashMessage.thread = thread; 37 | EventBus.getDefault().post(crashMessage); 38 | } 39 | 40 | public static void postPayMsg(Map result) { 41 | PayMessage payMessage = new PayMessage(); 42 | payMessage.what = ConstDefine.PayOffical; 43 | payMessage.object = result; 44 | EventBus.getDefault().post(payMessage); 45 | } 46 | 47 | public static void postKeyMsg(String userKey) { 48 | KeyMessage keyMessage = new KeyMessage(); 49 | keyMessage.what = ConstDefine.UserKey; 50 | keyMessage.userKey = userKey; 51 | EventBus.getDefault().post(keyMessage); 52 | } 53 | } 54 | -------------------------------------------------------------------------------- /app/src/main/java/com/wgh/aiyue/adapter/ViewPagerAdapter.java: -------------------------------------------------------------------------------- 1 | package com.wgh.aiyue.adapter; 2 | 3 | import android.content.Context; 4 | import android.support.v4.app.Fragment; 5 | import android.support.v4.app.FragmentManager; 6 | import android.support.v4.app.FragmentPagerAdapter; 7 | 8 | import com.wgh.aiyue.model.Category; 9 | import com.wgh.aiyue.cache.DataCache; 10 | import com.wgh.aiyue.helper.DataCacheHelper; 11 | import com.wgh.aiyue.ui.view.ViewPagerFragment; 12 | import com.wgh.aiyue.util.DLog; 13 | 14 | import java.util.ArrayList; 15 | 16 | /** 17 | * Created by : WGH. 18 | */ 19 | public class ViewPagerAdapter extends FragmentPagerAdapter { 20 | private static final String TAG = ViewPagerAdapter.class.getSimpleName(); 21 | 22 | private ArrayList mCategoryList; 23 | private Context mContext; 24 | private Fragment mFragment; 25 | 26 | public ViewPagerAdapter(FragmentManager fm, Context context) { 27 | super(fm); 28 | mContext = context; 29 | mCategoryList = DataCacheHelper.getInstance().getPagerChildCategories(); 30 | } 31 | 32 | public void onCategorysChange(String key) { 33 | if (key != null) { 34 | mCategoryList = DataCache.getInstance().getChildCategorys(key); 35 | notifyDataSetChanged(); 36 | } else { 37 | DLog.e("onCategorysChange() Error!"); 38 | } 39 | } 40 | 41 | @Override 42 | public Fragment getItem(int position) { 43 | return ViewPagerFragment.newInstance(mContext, mCategoryList.get(position)); 44 | } 45 | 46 | @Override 47 | public int getCount() { 48 | if (mCategoryList != null) { 49 | return mCategoryList.size(); 50 | } else { 51 | return 0; 52 | } 53 | } 54 | 55 | @Override 56 | public CharSequence getPageTitle(int position) { 57 | return mCategoryList.get(position).getName(); 58 | } 59 | 60 | public String getFragmentTag(int viewPagerId, int fragmentPosition) { 61 | return "android:switcher:" + viewPagerId + ":" + fragmentPosition; 62 | } 63 | 64 | @Override 65 | public int getItemPosition(Object object) { 66 | return POSITION_NONE; 67 | } 68 | } 69 | -------------------------------------------------------------------------------- /app/src/main/java/com/wgh/aiyue/ui/BaseActivity.java: -------------------------------------------------------------------------------- 1 | package com.wgh.aiyue.ui; 2 | 3 | import android.content.Context; 4 | import android.os.Bundle; 5 | import android.support.v7.app.AppCompatActivity; 6 | import android.view.MenuItem; 7 | 8 | import com.wgh.aiyue.R; 9 | import com.wgh.aiyue.util.APPTheme; 10 | import com.wgh.aiyue.util.ConstDefine; 11 | 12 | /** 13 | * Created by : WGH. 14 | */ 15 | public class BaseActivity extends AppCompatActivity { 16 | protected void onPreCreate() { 17 | final APPTheme currentTheme = ConstDefine.getAppTheme(); 18 | 19 | switch (currentTheme) { 20 | case Blue: 21 | this.setTheme(R.style.BlueTheme); 22 | break; 23 | case Green: 24 | this.setTheme(R.style.GreenTheme); 25 | break; 26 | case Red: 27 | this.setTheme(R.style.RedTheme); 28 | break; 29 | case Grey: 30 | this.setTheme(R.style.BlueGreyTheme); 31 | break; 32 | case Black: 33 | this.setTheme(R.style.BlackTheme); 34 | break; 35 | case Orange: 36 | this.setTheme(R.style.OrangeTheme); 37 | break; 38 | case Purple: 39 | this.setTheme(R.style.PurpleTheme); 40 | break; 41 | case Pink: 42 | this.setTheme(R.style.PinkTheme); 43 | break; 44 | case WillFLow: 45 | this.setTheme(R.style.WillFlowTheme); 46 | default: 47 | this.setTheme(R.style.WillFlowTheme); 48 | break; 49 | } 50 | } 51 | 52 | @Override 53 | protected void onCreate(Bundle savedInstanceState) { 54 | onPreCreate(); 55 | super.onCreate(savedInstanceState); 56 | } 57 | 58 | public Context getContext() { 59 | return this; 60 | } 61 | 62 | @Override 63 | public boolean onOptionsItemSelected(MenuItem item) { 64 | switch (item.getItemId()) { 65 | case android.R.id.home: 66 | onBackPressed(); 67 | return true; 68 | } 69 | return super.onOptionsItemSelected(item); 70 | } 71 | } 72 | -------------------------------------------------------------------------------- /app/src/main/java/com/wgh/aiyue/network/RequestManager.java: -------------------------------------------------------------------------------- 1 | package com.wgh.aiyue.network; 2 | 3 | import com.android.volley.DefaultRetryPolicy; 4 | import com.android.volley.Request; 5 | import com.android.volley.RequestQueue; 6 | import com.android.volley.toolbox.Volley; 7 | import com.bumptech.glide.Glide; 8 | import com.wgh.aiyue.BuildConfig; 9 | import com.wgh.aiyue.MyApplication; 10 | import com.wgh.aiyue.util.DLog; 11 | 12 | public class RequestManager { 13 | 14 | private static boolean isRequset = true; 15 | private static final int OVER_TIME = 10000; 16 | private static final int TIMES_OF_RETRY = 1; 17 | private static RequestManager requestManager; 18 | private static RequestQueue mRequestQueue; 19 | private static com.bumptech.glide.RequestManager mGlideManager; 20 | 21 | private RequestManager() { 22 | } 23 | 24 | public static RequestManager getInstance() { 25 | if (requestManager == null) { 26 | requestManager = new RequestManager(); 27 | mRequestQueue = Volley.newRequestQueue(MyApplication.context()); 28 | mGlideManager = Glide.with(MyApplication.context()); 29 | } 30 | return requestManager; 31 | } 32 | 33 | public void addRequest(Request request, Object tag) { 34 | if (!isRequset) { 35 | return; 36 | } 37 | if (tag != null) { 38 | request.setTag(tag); 39 | } 40 | request.setRetryPolicy(new DefaultRetryPolicy(OVER_TIME, TIMES_OF_RETRY, DefaultRetryPolicy.DEFAULT_BACKOFF_MULT)); 41 | mRequestQueue.add(request); 42 | 43 | if (BuildConfig.DEBUG) { 44 | DLog.i(request.getUrl()); 45 | } 46 | } 47 | 48 | public com.bumptech.glide.RequestManager getGlideManager() { 49 | return mGlideManager; 50 | } 51 | 52 | public void setGlidePause() { 53 | if (!mGlideManager.isPaused()) { 54 | mGlideManager.pauseRequests(); 55 | } 56 | } 57 | 58 | public void setGlideResume() { 59 | if (mGlideManager.isPaused()) { 60 | mGlideManager.resumeRequests(); 61 | } 62 | } 63 | 64 | public void setRequsetEnable(boolean flag) { 65 | isRequset = flag; 66 | } 67 | 68 | public static void cancelAll(Object tag) { 69 | mRequestQueue.cancelAll(tag); 70 | } 71 | } -------------------------------------------------------------------------------- /app/src/main/java/com/wgh/aiyue/util/DLog.java: -------------------------------------------------------------------------------- 1 | package com.wgh.aiyue.util; 2 | 3 | import android.util.Log; 4 | 5 | /** 6 | * Created by : WGH. 7 | */ 8 | public class DLog { 9 | public static final int LOG_LEVEL = 6; // If you want to block all logs, you can set it to 0 10 | public static final int VERBOSE = 5; 11 | public static final int DEBUG = 4; 12 | public static final int INFO = 3; 13 | public static final int WARN = 2; 14 | public static final int ERROR = 1; 15 | 16 | public static void v(String tag, String msg) { 17 | if (LOG_LEVEL > VERBOSE) { 18 | Log.v(tag, msg); 19 | } 20 | } 21 | 22 | public static void d(String tag, String msg) { 23 | if (LOG_LEVEL > DEBUG) { 24 | Log.d(tag, msg); 25 | } 26 | } 27 | 28 | public static void i(String tag, String msg) { 29 | if (LOG_LEVEL > INFO) { 30 | Log.i(tag, msg); 31 | } 32 | } 33 | 34 | public static void w(String tag, String msg) { 35 | if (LOG_LEVEL > WARN) { 36 | Log.i(tag, msg); 37 | } 38 | } 39 | 40 | public static void e(String tag, String msg) { 41 | if (LOG_LEVEL > ERROR) { 42 | Log.e(tag, msg); 43 | } 44 | } 45 | 46 | public static void v(String msg) { 47 | if (LOG_LEVEL > VERBOSE) { 48 | Log.v(getCallerName(), msg); 49 | } 50 | } 51 | 52 | public static void d(String msg) { 53 | if (LOG_LEVEL > DEBUG) { 54 | Log.d(getCallerName(), msg); 55 | } 56 | } 57 | 58 | public static void i(String msg) { 59 | if (LOG_LEVEL > INFO) { 60 | Log.i(getCallerName(), msg); 61 | } 62 | } 63 | 64 | public static void w(String msg) { 65 | if (LOG_LEVEL > WARN) { 66 | Log.w(getCallerName(), msg); 67 | } 68 | } 69 | 70 | public static void e(String msg) { 71 | if (LOG_LEVEL > ERROR) { 72 | Log.e(getCallerName(), msg); 73 | } 74 | } 75 | 76 | /** 77 | * Gets the class name of the caller 78 | */ 79 | public static String getCallerName() { 80 | StackTraceElement caller = Thread.currentThread().getStackTrace()[4]; 81 | String className = caller.getClassName(); 82 | className = className.substring(className.lastIndexOf(".") + 1); 83 | return className; 84 | } 85 | } 86 | -------------------------------------------------------------------------------- /app/src/main/res/layout/content_view_item.xml: -------------------------------------------------------------------------------- 1 | 2 | 12 | 13 | 17 | 18 | 22 | 23 | 28 | 29 | 36 | 37 | 38 | 39 | 54 | 55 | 56 | -------------------------------------------------------------------------------- /app/src/main/java/com/wgh/aiyue/util/SDCardUtil.java: -------------------------------------------------------------------------------- 1 | package com.wgh.aiyue.util; 2 | 3 | import android.os.Environment; 4 | import android.os.StatFs; 5 | 6 | import java.io.File; 7 | 8 | /** 9 | * Created by : WGH. 10 | */ 11 | public class SDCardUtil { 12 | 13 | private SDCardUtil() { 14 | /* cannot be instantiated */ 15 | throw new UnsupportedOperationException("cannot be instantiated"); 16 | } 17 | 18 | /** 19 | * Determine if SDCard is available 20 | */ 21 | public static boolean isSDCardEnable() { 22 | return Environment.getExternalStorageState().equals(Environment.MEDIA_MOUNTED); 23 | } 24 | 25 | /** 26 | * Get SD card path 27 | */ 28 | public static String getSDCardPath() { 29 | return Environment.getExternalStorageDirectory().getAbsolutePath() + File.separator; 30 | } 31 | 32 | /** 33 | * Gets the remaining capacity unit of SD card byte 34 | */ 35 | public static long getSDCardAllSize() { 36 | if (isSDCardEnable()) { 37 | StatFs stat = new StatFs(getSDCardPath()); 38 | // Gets the number of free blocks of data 39 | long availableBlocks = (long) stat.getAvailableBlocks() - 4; 40 | // Gets the size of a single block of data (byte) 41 | long freeBlocks = stat.getAvailableBlocks(); 42 | return freeBlocks * availableBlocks; 43 | } 44 | return 0; 45 | } 46 | 47 | /** 48 | * Gets the remaining number of bytes of available capacity in the space in the specified path, in units byte 49 | */ 50 | public static long getFreeBytes(String filePath) { 51 | // If it is the next path of the SD card, the available capacity of the SD card is obtained 52 | if (filePath.startsWith(getSDCardPath())) { 53 | filePath = getSDCardPath(); 54 | } else {// If it is an internally stored path, the available capacity of the memory storage is obtained 55 | filePath = Environment.getDataDirectory().getAbsolutePath(); 56 | } 57 | StatFs stat = new StatFs(filePath); 58 | long availableBlocks = (long) stat.getAvailableBlocks() - 4; 59 | return stat.getBlockSize() * availableBlocks; 60 | } 61 | 62 | /** 63 | * Get system storage path 64 | */ 65 | public static String getRootDirectoryPath() { 66 | return Environment.getRootDirectory().getAbsolutePath(); 67 | } 68 | } 69 | -------------------------------------------------------------------------------- /app/build.gradle: -------------------------------------------------------------------------------- 1 | apply plugin: 'com.android.application' 2 | apply plugin: 'android-apt' 3 | apply plugin: 'org.greenrobot.greendao' 4 | 5 | android { 6 | compileSdkVersion 25 7 | buildToolsVersion "25.0.3" 8 | 9 | defaultConfig { 10 | applicationId "com.wgh.aiyue" 11 | minSdkVersion 18 12 | targetSdkVersion 25 13 | versionCode 1 14 | versionName "1.0" 15 | testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner" 16 | multiDexEnabled true 17 | } 18 | 19 | buildTypes { 20 | release { 21 | minifyEnabled true 22 | proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro' 23 | } 24 | } 25 | 26 | greendao { 27 | schemaVersion 1 28 | daoPackage 'com.wgh.willflowaicollection.greendao' 29 | targetGenDir 'src/main/java' 30 | } 31 | } 32 | 33 | repositories { 34 | jcenter() 35 | maven { 36 | url "https://maven.java.net/content/groups/public/" 37 | } 38 | } 39 | 40 | dependencies { 41 | compile fileTree(include: ['*.jar'], dir: 'libs') 42 | compile project(':revealator') 43 | androidTestCompile('com.android.support.test.espresso:espresso-core:2.2.2', { 44 | exclude group: 'com.android.support', module: 'support-annotations' 45 | }) 46 | compile 'com.android.support:appcompat-v7:23.0.1' 47 | compile 'com.android.support:cardview-v7:23.0.1' 48 | compile 'com.android.support:recyclerview-v7:23.0.1' 49 | compile 'com.android.support:design:23.0.1' 50 | compile 'com.google.code.gson:gson:2.3' 51 | compile 'com.nostra13.universalimageloader:universal-image-loader:1.9.4' 52 | compile 'com.google.android.gms:play-services:7.5.0' 53 | compile 'com.mcxiaoke.volley:library:1.0.19' 54 | compile 'com.squareup.okhttp3:okhttp:3.4.2' 55 | compile 'com.jakewharton:butterknife:8.4.0' 56 | compile 'org.greenrobot:eventbus:3.0.0' 57 | compile 'de.hdodenhof:circleimageview:2.1.0' 58 | compile 'com.android.support.constraint:constraint-layout:1.0.2' 59 | compile 'com.github.bumptech.glide:glide:3.7.0' 60 | compile 'org.greenrobot:greendao:3.1.0' 61 | compile 'org.greenrobot:greendao-generator:3.1.0' 62 | compile 'com.sun.mail:android-mail:1.5.6' 63 | compile 'com.sun.mail:android-activation:1.5.6' 64 | testCompile 'junit:junit:4.12' 65 | apt 'com.jakewharton:butterknife-compiler:8.4.0' 66 | compile files('libs/alipaySdk-20170725.jar') 67 | } 68 | -------------------------------------------------------------------------------- /app/src/main/java/com/wgh/aiyue/greendao/DaoSession.java: -------------------------------------------------------------------------------- 1 | package com.wgh.aiyue.greendao; 2 | 3 | import com.wgh.aiyue.model.Category; 4 | import com.wgh.aiyue.model.FavoriteCat; 5 | import com.wgh.aiyue.model.ImgCat; 6 | 7 | import org.greenrobot.greendao.AbstractDao; 8 | import org.greenrobot.greendao.AbstractDaoSession; 9 | import org.greenrobot.greendao.database.Database; 10 | import org.greenrobot.greendao.identityscope.IdentityScopeType; 11 | import org.greenrobot.greendao.internal.DaoConfig; 12 | 13 | import java.util.Map; 14 | 15 | // THIS CODE IS GENERATED BY greenDAO, DO NOT EDIT. 16 | 17 | /** 18 | * {@inheritDoc} 19 | * 20 | * @see org.greenrobot.greendao.AbstractDaoSession 21 | */ 22 | public class DaoSession extends AbstractDaoSession { 23 | 24 | private final DaoConfig categoryDaoConfig; 25 | private final DaoConfig favoriteCatDaoConfig; 26 | private final DaoConfig imgCatDaoConfig; 27 | 28 | private final CategoryDao categoryDao; 29 | private final FavoriteCatDao favoriteCatDao; 30 | private final ImgCatDao imgCatDao; 31 | 32 | public DaoSession(Database db, IdentityScopeType type, Map>, DaoConfig> 33 | daoConfigMap) { 34 | super(db); 35 | 36 | categoryDaoConfig = daoConfigMap.get(CategoryDao.class).clone(); 37 | categoryDaoConfig.initIdentityScope(type); 38 | 39 | favoriteCatDaoConfig = daoConfigMap.get(FavoriteCatDao.class).clone(); 40 | favoriteCatDaoConfig.initIdentityScope(type); 41 | 42 | imgCatDaoConfig = daoConfigMap.get(ImgCatDao.class).clone(); 43 | imgCatDaoConfig.initIdentityScope(type); 44 | 45 | categoryDao = new CategoryDao(categoryDaoConfig, this); 46 | favoriteCatDao = new FavoriteCatDao(favoriteCatDaoConfig, this); 47 | imgCatDao = new ImgCatDao(imgCatDaoConfig, this); 48 | 49 | registerDao(Category.class, categoryDao); 50 | registerDao(FavoriteCat.class, favoriteCatDao); 51 | registerDao(ImgCat.class, imgCatDao); 52 | } 53 | 54 | public void clear() { 55 | categoryDaoConfig.clearIdentityScope(); 56 | favoriteCatDaoConfig.clearIdentityScope(); 57 | imgCatDaoConfig.clearIdentityScope(); 58 | } 59 | 60 | public CategoryDao getCategoryDao() { 61 | return categoryDao; 62 | } 63 | 64 | public FavoriteCatDao getFavoriteCatDao() { 65 | return favoriteCatDao; 66 | } 67 | 68 | public ImgCatDao getImgCatDao() { 69 | return imgCatDao; 70 | } 71 | 72 | } 73 | -------------------------------------------------------------------------------- /app/src/main/java/com/wgh/aiyue/ui/view/ProgressWebView.java: -------------------------------------------------------------------------------- 1 | package com.wgh.aiyue.ui.view; 2 | 3 | import android.content.Context; 4 | import android.graphics.drawable.Drawable; 5 | import android.os.Build; 6 | import android.support.annotation.RequiresApi; 7 | import android.util.AttributeSet; 8 | import android.webkit.WebView; 9 | import android.widget.LinearLayout; 10 | import android.widget.ProgressBar; 11 | 12 | import com.wgh.aiyue.R; 13 | 14 | /** 15 | * Created by : WGH. 16 | */ 17 | public class ProgressWebView extends WebView { 18 | 19 | private ProgressBar mProgressBar; 20 | private boolean isProgress = false; 21 | 22 | public ProgressWebView(Context context) { 23 | super(context); 24 | init(context); 25 | } 26 | 27 | public ProgressWebView(Context context, AttributeSet attrs) { 28 | super(context, attrs); 29 | init(context); 30 | } 31 | 32 | public ProgressWebView(Context context, AttributeSet attrs, int defStyleAttr) { 33 | super(context, attrs, defStyleAttr); 34 | init(context); 35 | } 36 | 37 | @RequiresApi(api = Build.VERSION_CODES.LOLLIPOP) 38 | public ProgressWebView(Context context, AttributeSet attrs, int defStyleAttr, int defStyleRes) { 39 | super(context, attrs, defStyleAttr, defStyleRes); 40 | init(context); 41 | } 42 | 43 | private void init(Context context) { 44 | mProgressBar = new ProgressBar(context, null, android.R.attr.progressBarStyleHorizontal); 45 | LinearLayout.LayoutParams layoutParams = new LinearLayout.LayoutParams(LinearLayout.LayoutParams.MATCH_PARENT, 9); 46 | mProgressBar.setLayoutParams(layoutParams); 47 | Drawable drawable = context.getResources().getDrawable(R.drawable.progress_bar_states); 48 | mProgressBar.setProgressDrawable(drawable); 49 | addView(mProgressBar); 50 | mProgressBar.setVisibility(isProgress ? VISIBLE : GONE); 51 | } 52 | 53 | public ProgressBar getProgressBar() { 54 | return mProgressBar; 55 | } 56 | 57 | public boolean isProgress() { 58 | return isProgress; 59 | } 60 | 61 | public void setProgress(boolean progress) { 62 | isProgress = progress; 63 | } 64 | 65 | @Override 66 | protected void onScrollChanged(int l, int t, int oldl, int oldt) { 67 | LayoutParams layoutParams = (LayoutParams) mProgressBar.getLayoutParams(); 68 | layoutParams.x = l; 69 | layoutParams.y = t; 70 | mProgressBar.setLayoutParams(layoutParams); 71 | super.onScrollChanged(l, t, oldl, oldt); 72 | } 73 | } 74 | -------------------------------------------------------------------------------- /app/proguard-project.txt: -------------------------------------------------------------------------------- 1 | -dontshrink 2 | -dontpreverify 3 | -dontoptimize 4 | -dontusemixedcaseclassnames 5 | 6 | -flattenpackagehierarchy 7 | -allowaccessmodification 8 | -printmapping map.txt 9 | 10 | -optimizationpasses 7 11 | -verbose 12 | -keepattributes Exceptions,InnerClasses 13 | -dontskipnonpubliclibraryclasses 14 | -dontskipnonpubliclibraryclassmembers 15 | -ignorewarnings 16 | 17 | -keep public class * extends android.app.Activity 18 | -keep public class * extends android.app.Application 19 | -keep public class * extends android.app.Service 20 | -keep public class * extends android.content.BroadcastReceiver 21 | -keep public class * extends android.content.ContentProvider 22 | -keep public class * extends java.lang.Throwable {*;} 23 | -keep public class * extends java.lang.Exception {*;} 24 | 25 | -keep class com.alipay.android.app.IAlixPay{*;} 26 | -keep class com.alipay.android.app.IAlixPay$Stub{*;} 27 | -keep class com.alipay.android.app.IRemoteServiceCallback{*;} 28 | -keep class com.alipay.android.app.IRemoteServiceCallback$Stub{*;} 29 | -keep class com.alipay.sdk.app.PayTask{ public *;} 30 | -keep class com.alipay.sdk.app.AuthTask{ public *;} 31 | -keep class com.alipay.sdk.app.H5PayCallback { 32 | ; 33 | ; 34 | } 35 | -keep class com.alipay.android.phone.mrpc.core.** { *; } 36 | -keep class com.alipay.apmobilesecuritysdk.** { *; } 37 | -keep class com.alipay.mobile.framework.service.annotation.** { *; } 38 | -keep class com.alipay.mobilesecuritysdk.face.** { *; } 39 | -keep class com.alipay.tscenter.biz.rpc.** { *; } 40 | -keep class org.json.alipay.** { *; } 41 | -keep class com.alipay.tscenter.** { *; } 42 | -keep class com.ta.utdid2.** { *;} 43 | -keep class com.ut.device.** { *;} 44 | 45 | 46 | -keepclasseswithmembernames class * { 47 | native ; 48 | } 49 | 50 | -keepclasseswithmembers class * { 51 | public (android.content.Context, android.util.AttributeSet); 52 | } 53 | 54 | -keepclasseswithmembers class * { 55 | public (android.content.Context, android.util.AttributeSet, int); 56 | } 57 | 58 | -keepclassmembers class * extends android.app.Activity { 59 | public void *(android.view.View); 60 | } 61 | 62 | -keepclassmembers enum * { 63 | public static **[] values(); 64 | public static ** valueOf(java.lang.String); 65 | } 66 | 67 | -keep class * implements android.os.Parcelable { 68 | public static final android.os.Parcelable$Creator *; 69 | } 70 | 71 | # adding this in to preserve line numbers so that the stack traces 72 | # can be remapped 73 | -renamesourcefileattribute SourceFile 74 | -keepattributes SourceFile,LineNumberTable -------------------------------------------------------------------------------- /app/src/main/res/layout/activity_about.xml: -------------------------------------------------------------------------------- 1 | 2 | 9 | 10 | 16 | 17 | 24 | 25 | 34 | 35 | 41 | 42 | 43 | 44 | 45 | 46 | 54 | 55 | 56 | -------------------------------------------------------------------------------- /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 | -------------------------------------------------------------------------------- /.idea/inspectionProfiles/Project_Default.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 25 | -------------------------------------------------------------------------------- /app/src/main/java/com/wgh/aiyue/MyApplication.java: -------------------------------------------------------------------------------- 1 | package com.wgh.aiyue; 2 | 3 | import android.app.ActivityManager; 4 | import android.app.Application; 5 | import android.content.Context; 6 | import android.content.Intent; 7 | 8 | import com.google.gson.Gson; 9 | import com.google.gson.GsonBuilder; 10 | import com.wgh.aiyue.greendao.DaoMaster; 11 | import com.wgh.aiyue.greendao.DaoSession; 12 | import com.wgh.aiyue.helper.CrashHelper; 13 | import com.wgh.aiyue.service.AiService; 14 | import com.wgh.aiyue.util.ConstDefine; 15 | 16 | /** 17 | * Created by : WGH. 18 | */ 19 | public class MyApplication extends Application{ 20 | 21 | private static MyApplication mMyApplication; 22 | private static DaoMaster daoMaster; 23 | private static DaoSession daoSession; 24 | 25 | @Override 26 | public void onCreate() { 27 | super.onCreate(); 28 | mMyApplication = this; 29 | 30 | boolean isServiceRunning = false; 31 | ActivityManager manager = (ActivityManager) getSystemService(Context.ACTIVITY_SERVICE); 32 | for (ActivityManager.RunningServiceInfo service : manager.getRunningServices(Integer.MAX_VALUE)) { 33 | if (AiService.class.getName().equals(service.service.getClassName())) { 34 | isServiceRunning = true; 35 | break; 36 | } 37 | } 38 | 39 | if (!isServiceRunning) { 40 | try { 41 | Intent intent = new Intent(this, AiService.class); 42 | intent.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK); 43 | startService(intent); 44 | } catch (Exception e) { 45 | e.printStackTrace(); 46 | } 47 | } 48 | 49 | CrashHelper handler = CrashHelper.getInstance(); 50 | handler.init(getApplicationContext()); 51 | } 52 | 53 | public static MyApplication context() { 54 | return mMyApplication; 55 | } 56 | 57 | public static Gson getGson() { 58 | GsonBuilder builder = new GsonBuilder(); 59 | return builder.create(); 60 | } 61 | 62 | public static DaoMaster getDaoMaster() { 63 | if (daoMaster == null) { 64 | DaoMaster.OpenHelper helper = new DaoMaster.DevOpenHelper(mMyApplication, ConstDefine.DBNAME, null); 65 | daoMaster = new DaoMaster(helper.getReadableDatabase()); 66 | } 67 | return daoMaster; 68 | } 69 | 70 | public static DaoSession getDaoSession() { 71 | if (daoSession == null) { 72 | if (daoMaster == null) { 73 | daoMaster = getDaoMaster(); 74 | } 75 | daoSession = daoMaster.newSession(); 76 | } 77 | return daoSession; 78 | } 79 | } 80 | -------------------------------------------------------------------------------- /app/src/main/java/com/wgh/aiyue/cache/DataCache.java: -------------------------------------------------------------------------------- 1 | package com.wgh.aiyue.cache; 2 | 3 | import com.wgh.aiyue.MyApplication; 4 | import com.wgh.aiyue.greendao.CategoryDao; 5 | import com.wgh.aiyue.helper.DatabaseHelper; 6 | import com.wgh.aiyue.model.Category; 7 | import com.wgh.aiyue.util.ConstDefine; 8 | 9 | import java.util.ArrayList; 10 | import java.util.LinkedHashMap; 11 | 12 | /** 13 | * Created by : WGH. 14 | */ 15 | public class DataCache { 16 | 17 | private static String FirstKey = ConstDefine.SpaceString; 18 | private static DataCache mDataCache; 19 | private static LinkedHashMap mCategoryCache = new LinkedHashMap<>(); 20 | 21 | private static CategoryDao categoryDao; 22 | 23 | public static DataCache getInstance() { 24 | if (mDataCache == null) { 25 | mDataCache = new DataCache(); 26 | } 27 | if (categoryDao == null) { 28 | categoryDao = MyApplication.getDaoSession().getCategoryDao(); 29 | } 30 | return mDataCache; 31 | } 32 | 33 | public static String getFirstKey() { 34 | return FirstKey; 35 | } 36 | 37 | public static void setFirstKey(String firstKey) { 38 | FirstKey = firstKey; 39 | } 40 | 41 | public void putCategory(Category category) { 42 | mCategoryCache.put(category.getSelfKey(), category); 43 | } 44 | 45 | public Category getCategory(String key) { 46 | if (mCategoryCache.get(key) == null) { 47 | syncCategoryFromDB(key); 48 | } 49 | return mCategoryCache.get(key); 50 | } 51 | 52 | public ArrayList getChildCategorys(String key) { 53 | if (key == null || mCategoryCache.size() == 0) { 54 | return null; 55 | } 56 | if (mCategoryCache.get(key) == null) { 57 | syncCategoryFromDB(key); 58 | } 59 | ArrayList categories = new ArrayList<>(); 60 | ArrayList childKeys = mCategoryCache.get(key).getNextKeys(); 61 | for (String childKey : childKeys) { 62 | if (mCategoryCache.get(childKey) == null) { 63 | syncCategoryFromDB(childKey); 64 | } 65 | categories.add(mCategoryCache.get(childKey)); 66 | } 67 | return categories; 68 | } 69 | 70 | private void syncCategoryFromDB(String key) { 71 | Category category = DatabaseHelper.getInstance().getCategotyFromDB(key); 72 | if (category != null) { 73 | putCategory(category); 74 | } else { 75 | syncCategoryFromNet(key); 76 | } 77 | } 78 | 79 | public void syncCategoryFromNet(String key) { 80 | // get data from net... 81 | } 82 | } 83 | -------------------------------------------------------------------------------- /app/src/main/java/com/wgh/willflowaicollection/greendao/DaoSession.java: -------------------------------------------------------------------------------- 1 | package com.wgh.willflowaicollection.greendao; 2 | 3 | import java.util.Map; 4 | 5 | import org.greenrobot.greendao.AbstractDao; 6 | import org.greenrobot.greendao.AbstractDaoSession; 7 | import org.greenrobot.greendao.database.Database; 8 | import org.greenrobot.greendao.identityscope.IdentityScopeType; 9 | import org.greenrobot.greendao.internal.DaoConfig; 10 | 11 | import com.wgh.aiyue.model.Category; 12 | import com.wgh.aiyue.model.FavoriteCat; 13 | import com.wgh.aiyue.model.ImgCat; 14 | 15 | import com.wgh.willflowaicollection.greendao.CategoryDao; 16 | import com.wgh.willflowaicollection.greendao.FavoriteCatDao; 17 | import com.wgh.willflowaicollection.greendao.ImgCatDao; 18 | 19 | // THIS CODE IS GENERATED BY greenDAO, DO NOT EDIT. 20 | 21 | /** 22 | * {@inheritDoc} 23 | * 24 | * @see org.greenrobot.greendao.AbstractDaoSession 25 | */ 26 | public class DaoSession extends AbstractDaoSession { 27 | 28 | private final DaoConfig categoryDaoConfig; 29 | private final DaoConfig favoriteCatDaoConfig; 30 | private final DaoConfig imgCatDaoConfig; 31 | 32 | private final CategoryDao categoryDao; 33 | private final FavoriteCatDao favoriteCatDao; 34 | private final ImgCatDao imgCatDao; 35 | 36 | public DaoSession(Database db, IdentityScopeType type, Map>, DaoConfig> 37 | daoConfigMap) { 38 | super(db); 39 | 40 | categoryDaoConfig = daoConfigMap.get(CategoryDao.class).clone(); 41 | categoryDaoConfig.initIdentityScope(type); 42 | 43 | favoriteCatDaoConfig = daoConfigMap.get(FavoriteCatDao.class).clone(); 44 | favoriteCatDaoConfig.initIdentityScope(type); 45 | 46 | imgCatDaoConfig = daoConfigMap.get(ImgCatDao.class).clone(); 47 | imgCatDaoConfig.initIdentityScope(type); 48 | 49 | categoryDao = new CategoryDao(categoryDaoConfig, this); 50 | favoriteCatDao = new FavoriteCatDao(favoriteCatDaoConfig, this); 51 | imgCatDao = new ImgCatDao(imgCatDaoConfig, this); 52 | 53 | registerDao(Category.class, categoryDao); 54 | registerDao(FavoriteCat.class, favoriteCatDao); 55 | registerDao(ImgCat.class, imgCatDao); 56 | } 57 | 58 | public void clear() { 59 | categoryDaoConfig.clearIdentityScope(); 60 | favoriteCatDaoConfig.clearIdentityScope(); 61 | imgCatDaoConfig.clearIdentityScope(); 62 | } 63 | 64 | public CategoryDao getCategoryDao() { 65 | return categoryDao; 66 | } 67 | 68 | public FavoriteCatDao getFavoriteCatDao() { 69 | return favoriteCatDao; 70 | } 71 | 72 | public ImgCatDao getImgCatDao() { 73 | return imgCatDao; 74 | } 75 | 76 | } 77 | -------------------------------------------------------------------------------- /app/src/main/java/com/wgh/aiyue/adapter/BelowViewAdapter.java: -------------------------------------------------------------------------------- 1 | package com.wgh.aiyue.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.TextView; 9 | 10 | import com.wgh.aiyue.R; 11 | import com.wgh.aiyue.model.Category; 12 | 13 | import java.util.ArrayList; 14 | 15 | /** 16 | * Created by : WGH. 17 | */ 18 | public class BelowViewAdapter extends BaseAdapter { 19 | 20 | private Context mContext; 21 | public ArrayList categories; 22 | private TextView item_text; 23 | boolean isVisible = true; 24 | public int remove_position = -1; 25 | 26 | public BelowViewAdapter(Context context, ArrayList categories) { 27 | this.mContext = context; 28 | this.categories = categories; 29 | } 30 | 31 | @Override 32 | public int getCount() { 33 | return categories == null ? 0 : categories.size(); 34 | } 35 | 36 | @Override 37 | public Category getItem(int position) { 38 | if (categories != null && categories.size() != 0) { 39 | return categories.get(position); 40 | } 41 | return null; 42 | } 43 | 44 | @Override 45 | public long getItemId(int position) { 46 | return position; 47 | } 48 | 49 | @Override 50 | public View getView(int position, View convertView, ViewGroup parent) { 51 | View view = LayoutInflater.from(mContext).inflate(R.layout.channel_view_item, null); 52 | item_text = (TextView) view.findViewById(R.id.text_item); 53 | Category channel = getItem(position); 54 | item_text.setText(channel.getName()); 55 | if (!isVisible && (position == -1 + categories.size())) { 56 | item_text.setText(""); 57 | } 58 | if (remove_position == position) { 59 | item_text.setText(""); 60 | } 61 | return view; 62 | } 63 | 64 | public ArrayList getCategoryLst() { 65 | return categories; 66 | } 67 | 68 | public void addItem(Category channel) { 69 | categories.add(channel); 70 | notifyDataSetChanged(); 71 | } 72 | 73 | public void setRemove(int position) { 74 | remove_position = position; 75 | notifyDataSetChanged(); 76 | } 77 | 78 | public void remove() { 79 | categories.remove(remove_position); 80 | remove_position = -1; 81 | notifyDataSetChanged(); 82 | } 83 | 84 | public void setListDate(ArrayList list) { 85 | categories = list; 86 | } 87 | 88 | public boolean isVisible() { 89 | return isVisible; 90 | } 91 | 92 | public void setVisible(boolean visible) { 93 | isVisible = visible; 94 | } 95 | } 96 | -------------------------------------------------------------------------------- /.idea/misc.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 19 | 29 | 30 | 31 | 32 | 33 | 34 | 35 | 36 | 37 | 38 | 39 | 40 | 41 | 42 | 43 | 44 | 46 | 47 | 48 | 49 | 50 | 51 | 56 | 57 | 58 | 59 | 60 | 61 | -------------------------------------------------------------------------------- /app/src/main/AndroidManifest.xml: -------------------------------------------------------------------------------- 1 | 2 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | 37 | 43 | 44 | 48 | 49 | 54 | 55 | 58 | 59 | 60 | 61 | -------------------------------------------------------------------------------- /app/src/main/java/com/wgh/aiyue/adapter/FavoriteListAdapter.java: -------------------------------------------------------------------------------- 1 | package com.wgh.aiyue.adapter; 2 | 3 | import android.content.Context; 4 | import android.view.LayoutInflater; 5 | import android.view.View; 6 | import android.view.ViewGroup; 7 | 8 | import com.wgh.aiyue.R; 9 | import com.wgh.aiyue.helper.DataCacheHelper; 10 | import com.wgh.aiyue.helper.DatabaseHelper; 11 | import com.wgh.aiyue.model.Category; 12 | import com.wgh.aiyue.util.ConstDefine; 13 | 14 | /** 15 | * Created by : WGH. 16 | */ 17 | public class FavoriteListAdapter extends BaseListAdapter { 18 | 19 | private OnItemClickListener mOnItemClickListener = null; 20 | 21 | public interface OnItemClickListener { 22 | void onItemClick(View view, int position); 23 | } 24 | 25 | public void setOnItemClickListener(OnItemClickListener listener) { 26 | this.mOnItemClickListener = listener; 27 | } 28 | 29 | public FavoriteListAdapter(Context context, Category category, OnLoadPageFinishListener mLoadPageFinishListener) { 30 | super(context, category, mLoadPageFinishListener); 31 | } 32 | 33 | @Override 34 | protected void initContentData() { 35 | mContentUrls = DatabaseHelper.getInstance().getFavoriteUrlFromDB(mCategory); 36 | mContentTitles = DataCacheHelper.getInstance().getFavoriteTitles(mCategory, mContentUrls); 37 | } 38 | 39 | @Override 40 | public ViewHolder onCreateViewHolder(ViewGroup parent, int viewType) { 41 | View view = LayoutInflater.from(parent.getContext()).inflate(R.layout.content_view_item, parent, false); 42 | view.setOnClickListener(new View.OnClickListener() { 43 | @Override 44 | public void onClick(View view) { 45 | mOnItemClickListener.onItemClick(view, (int) view.getTag()); 46 | } 47 | }); 48 | final ViewHolder viewHolder = new ViewHolder(view); 49 | viewHolder.imageStar.setOnClickListener(new View.OnClickListener() { 50 | @Override 51 | public void onClick(View view) { 52 | Integer position = (int) view.getTag(); 53 | viewHolder.imageStar.setImageResource(R.drawable.ic_star_unchecked); 54 | removeItem(position); 55 | DatabaseHelper.getInstance().insertOrUpdateFavorite(mCategory, mContentUrls); 56 | notifyDataSetChanged(); 57 | } 58 | }); 59 | return viewHolder; 60 | } 61 | 62 | @Override 63 | public void onBindViewHolder(ViewHolder holder, int position) { 64 | holder.itemView.setTag(position); 65 | holder.imageStar.setTag(position); 66 | if (mContentTitles != null) { 67 | holder.textTitle.setText(mContentTitles.get(position)); 68 | } 69 | holder.imageCover.setImageResource(R.drawable.willflow); 70 | holder.imageStar.setImageResource(R.drawable.ic_star_checked); 71 | 72 | DataCacheHelper.getInstance().setItemHight(holder.imageCover, holder.textTitle, imgHeight); 73 | DataCacheHelper.getInstance().setCardParams(holder.cardView, ConstDefine.getViewPagerColumnNum()); 74 | } 75 | } 76 | -------------------------------------------------------------------------------- /app/src/main/java/com/wgh/aiyue/util/AppUtil.java: -------------------------------------------------------------------------------- 1 | package com.wgh.aiyue.util; 2 | 3 | import android.content.Context; 4 | import android.content.Intent; 5 | import android.content.pm.PackageInfo; 6 | import android.content.pm.PackageManager; 7 | import android.net.Uri; 8 | import android.os.Build; 9 | import android.support.v4.content.FileProvider; 10 | 11 | import com.wgh.aiyue.MyApplication; 12 | 13 | import java.io.File; 14 | 15 | /** 16 | * Created by : WGH. 17 | */ 18 | 19 | public class AppUtil { 20 | 21 | private static AppUtil appUtil; 22 | 23 | public static AppUtil getInstance() { 24 | if (appUtil == null) { 25 | appUtil = new AppUtil(); 26 | } 27 | return appUtil; 28 | } 29 | 30 | private AppUtil() { 31 | // throw new UnsupportedOperationException("cannot be instantiated"); 32 | } 33 | 34 | public String getAppName(Context context) { 35 | try { 36 | PackageManager packageManager = context.getPackageManager(); 37 | PackageInfo packageInfo = packageManager.getPackageInfo(context.getPackageName(), 0); 38 | int labelRes = packageInfo.applicationInfo.labelRes; 39 | return context.getResources().getString(labelRes); 40 | } catch (Exception e) { 41 | e.printStackTrace(); 42 | } 43 | return null; 44 | } 45 | 46 | public String getVersionName(Context context) { 47 | try { 48 | PackageManager packageManager = context.getPackageManager(); 49 | PackageInfo packageInfo = packageManager.getPackageInfo(context.getPackageName(), 0); 50 | return packageInfo.versionName; 51 | } catch (Exception e) { 52 | e.printStackTrace(); 53 | } 54 | return null; 55 | } 56 | 57 | public int getVersionCode(Context context) { 58 | try { 59 | PackageManager packageManager = context.getPackageManager(); 60 | PackageInfo packageInfo = packageManager.getPackageInfo(context.getPackageName(), 0); 61 | return packageInfo.versionCode; 62 | } catch (Exception e) { 63 | e.printStackTrace(); 64 | } 65 | return 0; 66 | } 67 | 68 | public static void installApk(File file) { 69 | Intent intent = new Intent(Intent.ACTION_VIEW); 70 | // Since you did not start Activity in the Activity environment, set the following label. 71 | intent.setFlags(Intent.FLAG_ACTIVITY_NEW_TASK); 72 | if (Build.VERSION.SDK_INT >= 24) { 73 | Uri apkUri = FileProvider.getUriForFile(MyApplication.context(), "com.wgh.willflowaicollection.fileprovider", file); 74 | // Add this sentence to indicate that the application is temporarily authorized to the file represented by the Uri. 75 | intent.addFlags(Intent.FLAG_GRANT_READ_URI_PERMISSION); 76 | intent.setDataAndType(apkUri, "application/vnd.android.package-archive"); 77 | } else { 78 | intent.setDataAndType(Uri.fromFile(file), "application/vnd.android.package-archive"); 79 | } 80 | MyApplication.context().startActivity(intent); 81 | } 82 | } 83 | -------------------------------------------------------------------------------- /app/src/main/java/com/wgh/aiyue/mail/ComplexMailSender.java: -------------------------------------------------------------------------------- 1 | package com.wgh.aiyue.mail; 2 | 3 | import java.util.Date; 4 | import java.util.Properties; 5 | 6 | import javax.activation.DataHandler; 7 | import javax.activation.FileDataSource; 8 | import javax.mail.Address; 9 | import javax.mail.Message; 10 | import javax.mail.MessagingException; 11 | import javax.mail.Session; 12 | import javax.mail.Transport; 13 | import javax.mail.internet.InternetAddress; 14 | import javax.mail.internet.MimeBodyPart; 15 | import javax.mail.internet.MimeMessage; 16 | import javax.mail.internet.MimeMultipart; 17 | 18 | /** 19 | * Created by : WGH. 20 | */ 21 | public class ComplexMailSender { 22 | 23 | public boolean sendTextMail(MailInfo mailInfo, String filePath) { 24 | // Determine whether authentication is required. 25 | MyAuthenticator authenticator = null; 26 | Properties properties = mailInfo.getProperties(); 27 | if (mailInfo.isValidate()) { 28 | // If an authentication is required, then create a password verifier. 29 | authenticator = new MyAuthenticator(mailInfo.getUserName(), mailInfo.getPassword()); 30 | } 31 | // According to the mail session attribute and password verifier to construct a mail session. 32 | Session sendMailSession = Session.getDefaultInstance(properties, authenticator); 33 | try { 34 | // According to the mail session to construct a mail message. 35 | Message mailMessage = new MimeMessage(sendMailSession); 36 | // Create mail sender address. 37 | Address fromAddress = new InternetAddress(mailInfo.getFromAddress()); 38 | // Sets the sender of the mail message. 39 | mailMessage.setFrom(fromAddress); 40 | // Creates the recipient address of the message and sets it to the mail message. 41 | Address toAddress = new InternetAddress(mailInfo.getToAddress()); 42 | mailMessage.setRecipient(Message.RecipientType.TO, toAddress); 43 | // Set the subject of the mail message. 44 | mailMessage.setSubject(mailInfo.getSubject()); 45 | // Set the time when the mail message was sent. 46 | mailMessage.setSentDate(new Date()); 47 | // Set the main contents of the mail message. 48 | String mailContent = mailInfo.getContent(); 49 | mailMessage.setText(mailContent); 50 | // Add attachments when sending messages. 51 | MimeBodyPart attachPart = new MimeBodyPart(); 52 | FileDataSource fileDataSource = new FileDataSource(filePath); // Open the file you want to send. 53 | attachPart.setDataHandler(new DataHandler(fileDataSource)); 54 | attachPart.setFileName(fileDataSource.getName()); 55 | MimeMultipart allMultipart = new MimeMultipart("mixed"); // Attachment. 56 | allMultipart.addBodyPart(attachPart); 57 | mailMessage.setContent(allMultipart); 58 | Transport.send(mailMessage); 59 | return true; 60 | } catch (MessagingException ex) { 61 | ex.printStackTrace(); 62 | } 63 | return false; 64 | } 65 | } 66 | -------------------------------------------------------------------------------- /app/src/main/java/com/wgh/aiyue/adapter/SearchListAdapter.java: -------------------------------------------------------------------------------- 1 | package com.wgh.aiyue.adapter; 2 | 3 | import android.content.Context; 4 | import android.text.TextUtils; 5 | 6 | import com.wgh.aiyue.helper.DatabaseHelper; 7 | import com.wgh.aiyue.util.ConstDefine; 8 | 9 | import java.util.HashMap; 10 | import java.util.Iterator; 11 | import java.util.Map; 12 | 13 | /** 14 | * Created by : WGH. 15 | */ 16 | public class SearchListAdapter extends BaseListAdapter { 17 | 18 | private OnSearchFinishListener onSearchFinishListener; 19 | 20 | public void setOnSearchFinishListener(OnSearchFinishListener listener) { 21 | this.onSearchFinishListener = listener; 22 | } 23 | 24 | public interface OnSearchFinishListener { 25 | void onSearchSuccess(); 26 | void onSearchFail(); 27 | } 28 | 29 | public SearchListAdapter(Context mContext, OnLoadPageFinishListener loadPageFinishListener) { 30 | super(mContext, loadPageFinishListener); 31 | } 32 | 33 | @Override 34 | protected void initContentData() { 35 | if (getContentDate(null)) { 36 | if (onSearchFinishListener != null) { 37 | onSearchFinishListener.onSearchSuccess(); 38 | } 39 | } else { 40 | if (onSearchFinishListener != null) { 41 | onSearchFinishListener.onSearchFail(); 42 | } 43 | } 44 | } 45 | 46 | public void updateData(String string) { 47 | if (getContentDate(string)) { 48 | notifyDataSetChanged(); 49 | if (onSearchFinishListener != null) { 50 | onSearchFinishListener.onSearchSuccess(); 51 | } 52 | } else { 53 | if (onSearchFinishListener != null) { 54 | onSearchFinishListener.onSearchFail(); 55 | } 56 | } 57 | } 58 | 59 | private boolean getContentDate(String searchString) { 60 | HashMap mapSearch; 61 | if (TextUtils.isEmpty(searchString)) { 62 | if (!TextUtils.isEmpty(ConstDefine.getSearch())) { 63 | mapSearch = DatabaseHelper.getInstance().getEligibleContent(ConstDefine.getSearch()); 64 | } else { 65 | return false; 66 | } 67 | } else { 68 | mapSearch = DatabaseHelper.getInstance().getEligibleContent(searchString); 69 | } 70 | if (null == mapSearch) { 71 | return false; 72 | } 73 | Iterator iterator = mapSearch.entrySet().iterator(); 74 | if (iterator.hasNext() && !TextUtils.isEmpty(searchString)) { 75 | ConstDefine.setLastSearch(searchString); 76 | } 77 | if (!mContentTitles.isEmpty()) { 78 | mContentTitles.clear(); 79 | } 80 | if (!mContentUrls.isEmpty()) { 81 | mContentUrls.clear(); 82 | } 83 | while (iterator.hasNext()) { 84 | Map.Entry entry = (Map.Entry) iterator.next(); 85 | Object contentTitle = entry.getKey(); 86 | Object contentUrl = entry.getValue(); 87 | mContentTitles.add(contentTitle.toString()); 88 | mContentUrls.add(contentUrl.toString()); 89 | } 90 | return true; 91 | } 92 | } 93 | -------------------------------------------------------------------------------- /app/src/main/java/com/wgh/aiyue/mail/SimpleMailSender.java: -------------------------------------------------------------------------------- 1 | package com.wgh.aiyue.mail; 2 | 3 | 4 | import java.util.Date; 5 | import java.util.Properties; 6 | 7 | import javax.mail.Address; 8 | import javax.mail.BodyPart; 9 | import javax.mail.Message; 10 | import javax.mail.MessagingException; 11 | import javax.mail.Multipart; 12 | import javax.mail.Session; 13 | import javax.mail.Transport; 14 | import javax.mail.internet.InternetAddress; 15 | import javax.mail.internet.MimeBodyPart; 16 | import javax.mail.internet.MimeMessage; 17 | import javax.mail.internet.MimeMultipart; 18 | 19 | 20 | /** 21 | * Created by : WGH. 22 | */ 23 | public class SimpleMailSender { 24 | 25 | public boolean sendTextMail(MailInfo mailInfo) { 26 | MyAuthenticator authenticator = null; 27 | Properties properties = mailInfo.getProperties(); 28 | if (mailInfo.isValidate()) { 29 | authenticator = new MyAuthenticator(mailInfo.getUserName(), mailInfo.getPassword()); 30 | } 31 | Session sendMailSession = Session.getDefaultInstance(properties, authenticator); 32 | try { 33 | Message mailMessage = new MimeMessage(sendMailSession); 34 | Address from = new InternetAddress(mailInfo.getFromAddress()); 35 | mailMessage.setFrom(from); 36 | Address to = new InternetAddress(mailInfo.getToAddress()); 37 | mailMessage.setRecipient(Message.RecipientType.TO, to); 38 | mailMessage.setSubject(mailInfo.getSubject()); 39 | mailMessage.setSentDate(new Date()); 40 | String mailContent = mailInfo.getContent(); 41 | mailMessage.setText(mailContent); 42 | Transport.send(mailMessage); 43 | return true; 44 | } catch (MessagingException ex) { 45 | ex.printStackTrace(); 46 | } 47 | return false; 48 | } 49 | 50 | public static boolean sendHtmlMail(MailInfo mailInfo) { 51 | MyAuthenticator authenticator = null; 52 | Properties pro = mailInfo.getProperties(); 53 | if (mailInfo.isValidate()) { 54 | authenticator = new MyAuthenticator(mailInfo.getUserName(), mailInfo.getPassword()); 55 | } 56 | Session sendMailSession = Session.getDefaultInstance(pro, authenticator); 57 | try { 58 | Message mailMessage = new MimeMessage(sendMailSession); 59 | Address from = new InternetAddress(mailInfo.getFromAddress()); 60 | mailMessage.setFrom(from); 61 | Address to = new InternetAddress(mailInfo.getToAddress()); 62 | mailMessage.setRecipient(Message.RecipientType.TO, to); 63 | mailMessage.setSubject(mailInfo.getSubject()); 64 | mailMessage.setSentDate(new Date()); 65 | Multipart mainPart = new MimeMultipart(); 66 | BodyPart html = new MimeBodyPart(); 67 | html.setContent(mailInfo.getContent(), "text/html; charset=utf-8"); 68 | mainPart.addBodyPart(html); 69 | mailMessage.setContent(mainPart); 70 | Transport.send(mailMessage); 71 | return true; 72 | } catch (MessagingException ex) { 73 | ex.printStackTrace(); 74 | } 75 | return false; 76 | } 77 | } 78 | 79 | -------------------------------------------------------------------------------- /app/src/main/res/layout/activity_search.xml: -------------------------------------------------------------------------------- 1 | 2 | 9 | 10 | 18 | 19 | 27 | 28 | 41 | 42 | 52 | 53 | 62 | 63 | 64 | 65 | 70 | 71 | 72 | -------------------------------------------------------------------------------- /app/src/main/java/com/wgh/aiyue/ui/view/FavoritePagerFragment.java: -------------------------------------------------------------------------------- 1 | package com.wgh.aiyue.ui.view; 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.support.v7.widget.GridLayoutManager; 8 | import android.text.TextUtils; 9 | import android.view.LayoutInflater; 10 | import android.view.View; 11 | import android.view.ViewGroup; 12 | 13 | import com.wgh.aiyue.R; 14 | import com.wgh.aiyue.adapter.FavoriteListAdapter; 15 | import com.wgh.aiyue.adapter.PagerListAdapter; 16 | import com.wgh.aiyue.model.Category; 17 | import com.wgh.aiyue.util.IntentUtil; 18 | import com.wgh.aiyue.util.ConstDefine; 19 | 20 | import butterknife.BindView; 21 | import butterknife.ButterKnife; 22 | import butterknife.Unbinder; 23 | 24 | /** 25 | * Created by : WGH. 26 | */ 27 | public class FavoritePagerFragment extends Fragment implements FavoriteListAdapter.OnItemClickListener, PagerListAdapter.OnLoadPageFinishListener { 28 | private static final String FAVORITE_CATEGORY = "favorite_pager_category"; 29 | 30 | Unbinder unbinder; 31 | @BindView(R.id.recycler_favorite) 32 | AutoLoadRecyclerView recyclerFavorite; 33 | 34 | private FavoriteListAdapter mFavoritePagerAdapter; 35 | 36 | private static Context mContext; 37 | private Category mCategory; 38 | 39 | public static Fragment newInstance(Context context, Category category) { 40 | mContext = context; 41 | Bundle bundle = new Bundle(); 42 | bundle.putSerializable(FAVORITE_CATEGORY, category); 43 | return Fragment.instantiate(context, FavoritePagerFragment.class.getName(), bundle); 44 | } 45 | 46 | @Override 47 | public void onCreate(@Nullable Bundle savedInstanceState) { 48 | super.onCreate(savedInstanceState); 49 | mCategory = (Category) getArguments().getSerializable(FAVORITE_CATEGORY); 50 | } 51 | 52 | @Nullable 53 | @Override 54 | public View onCreateView(LayoutInflater inflater, ViewGroup viewGroup, Bundle savedInstanceState) { 55 | View view = inflater.inflate(R.layout.fragment_favorite_pager, viewGroup, false); 56 | unbinder = ButterKnife.bind(this, view); 57 | mFavoritePagerAdapter = new FavoriteListAdapter(mContext, mCategory, this); 58 | mFavoritePagerAdapter.setOnItemClickListener(this); 59 | recyclerFavorite.setAdapter(mFavoritePagerAdapter); 60 | recyclerFavorite.setLayoutManager(new GridLayoutManager(mContext, ConstDefine.getViewPagerColumnNum())); 61 | recyclerFavorite.setLoadMoreListener(new AutoLoadRecyclerView.LoadMoreListener() { 62 | @Override 63 | public void loadMore() { 64 | mFavoritePagerAdapter.loadNextPage(); 65 | } 66 | }); 67 | return view; 68 | } 69 | 70 | @Override 71 | public void onItemClick(View view, int position) { 72 | if (!TextUtils.isEmpty(mFavoritePagerAdapter.getClickUrl(position))) { 73 | IntentUtil.openDetail(mContext, mFavoritePagerAdapter.getClickUrl(position)); 74 | } 75 | } 76 | 77 | @Override 78 | public void onDestroyView() { 79 | super.onDestroyView(); 80 | unbinder.unbind(); 81 | } 82 | 83 | @Override 84 | public void onLoadPageFinish() { 85 | recyclerFavorite.loadFinish(); 86 | } 87 | } 88 | -------------------------------------------------------------------------------- /app/src/main/java/com/wgh/aiyue/util/ScreenUtil.java: -------------------------------------------------------------------------------- 1 | package com.wgh.aiyue.util; 2 | 3 | import android.app.Activity; 4 | import android.content.Context; 5 | import android.graphics.Bitmap; 6 | import android.graphics.Rect; 7 | import android.util.DisplayMetrics; 8 | import android.view.View; 9 | import android.view.WindowManager; 10 | 11 | /** 12 | * Created by : WGH. 13 | */ 14 | public class ScreenUtil { 15 | 16 | private ScreenUtil() { 17 | /* cannot be instantiated */ 18 | throw new UnsupportedOperationException("cannot be instantiated"); 19 | } 20 | 21 | /** 22 | * Get screen height 23 | */ 24 | public static int getScreenWidth(Context context) { 25 | WindowManager wm = (WindowManager) context.getSystemService(Context.WINDOW_SERVICE); 26 | DisplayMetrics outMetrics = new DisplayMetrics(); 27 | wm.getDefaultDisplay().getMetrics(outMetrics); 28 | return outMetrics.widthPixels; 29 | } 30 | 31 | /** 32 | * Get screen width 33 | */ 34 | public static int getScreenHeight(Context context) { 35 | WindowManager wm = (WindowManager) context.getSystemService(Context.WINDOW_SERVICE); 36 | DisplayMetrics outMetrics = new DisplayMetrics(); 37 | wm.getDefaultDisplay().getMetrics(outMetrics); 38 | return outMetrics.heightPixels; 39 | } 40 | 41 | /** 42 | * Gets the height of the status bar 43 | */ 44 | public static int getStatusHeight(Context context) { 45 | int statusHeight = -1; 46 | try { 47 | Class clazz = Class.forName("com.android.internal.R$dimen"); 48 | Object object = clazz.newInstance(); 49 | int height = Integer.parseInt(clazz.getField("status_bar_height").get(object).toString()); 50 | statusHeight = context.getResources().getDimensionPixelSize(height); 51 | } catch (Exception e) { 52 | e.printStackTrace(); 53 | } 54 | return statusHeight; 55 | } 56 | 57 | /** 58 | * Gets the current screen capture, including the status bar 59 | */ 60 | public static Bitmap snapShotWithStatusBar(Activity activity) { 61 | View view = activity.getWindow().getDecorView(); 62 | view.setDrawingCacheEnabled(true); 63 | view.buildDrawingCache(); 64 | Bitmap bmp = view.getDrawingCache(); 65 | int width = getScreenWidth(activity); 66 | int height = getScreenHeight(activity); 67 | Bitmap bp = null; 68 | bp = Bitmap.createBitmap(bmp, 0, 0, width, height); 69 | view.destroyDrawingCache(); 70 | return bp; 71 | 72 | } 73 | 74 | /** 75 | * Gets the current screen capture without the status bar 76 | */ 77 | public static Bitmap snapShotWithoutStatusBar(Activity activity) { 78 | View view = activity.getWindow().getDecorView(); 79 | view.setDrawingCacheEnabled(true); 80 | view.buildDrawingCache(); 81 | Bitmap bmp = view.getDrawingCache(); 82 | Rect frame = new Rect(); 83 | activity.getWindow().getDecorView().getWindowVisibleDisplayFrame(frame); 84 | int statusBarHeight = frame.top; 85 | int width = getScreenWidth(activity); 86 | int height = getScreenHeight(activity); 87 | Bitmap bp; 88 | bp = Bitmap.createBitmap(bmp, 0, statusBarHeight, width, height - statusBarHeight); 89 | view.destroyDrawingCache(); 90 | return bp; 91 | } 92 | } 93 | -------------------------------------------------------------------------------- /app/src/main/java/com/wgh/aiyue/ui/view/ThemeDialog.java: -------------------------------------------------------------------------------- 1 | package com.wgh.aiyue.ui.view; 2 | 3 | import android.app.Dialog; 4 | import android.content.Intent; 5 | import android.os.Bundle; 6 | import android.support.annotation.Nullable; 7 | import android.support.v4.app.DialogFragment; 8 | import android.view.LayoutInflater; 9 | import android.view.View; 10 | import android.view.ViewGroup; 11 | import android.view.Window; 12 | 13 | import com.wgh.aiyue.R; 14 | import com.wgh.aiyue.ui.MainActivity; 15 | import com.wgh.aiyue.util.APPTheme; 16 | import com.wgh.aiyue.util.ConstDefine; 17 | 18 | 19 | /** 20 | * Created by : WGH. 21 | */ 22 | public class ThemeDialog extends DialogFragment implements View.OnClickListener { 23 | 24 | @Nullable 25 | @Override 26 | public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) { 27 | this.getDialog().getWindow().requestFeature(Window.FEATURE_NO_TITLE); 28 | final View layout = inflater.inflate(R.layout.dialog_theme, container, false); 29 | layout.findViewById(R.id.blue_theme).setOnClickListener(this); 30 | layout.findViewById(R.id.willflow_theme).setOnClickListener(this); 31 | layout.findViewById(R.id.green_theme).setOnClickListener(this); 32 | layout.findViewById(R.id.red_theme).setOnClickListener(this); 33 | layout.findViewById(R.id.grey_theme).setOnClickListener(this); 34 | layout.findViewById(R.id.black_theme).setOnClickListener(this); 35 | layout.findViewById(R.id.purple_theme).setOnClickListener(this); 36 | layout.findViewById(R.id.orange_theme).setOnClickListener(this); 37 | layout.findViewById(R.id.pink_theme).setOnClickListener(this); 38 | return layout; 39 | } 40 | 41 | @Override 42 | public void onStart() { 43 | super.onStart(); 44 | Dialog dialog = getDialog(); 45 | if (dialog != null) { 46 | int width = ViewGroup.LayoutParams.MATCH_PARENT; 47 | int height = ViewGroup.LayoutParams.MATCH_PARENT; 48 | dialog.getWindow().setLayout(width, height); 49 | } 50 | } 51 | 52 | @Override 53 | public void onClick(View v) { 54 | APPTheme theme; 55 | switch (v.getId()) { 56 | case R.id.blue_theme: 57 | theme = APPTheme.Blue; 58 | break; 59 | case R.id.willflow_theme: 60 | theme = APPTheme.WillFLow; 61 | break; 62 | case R.id.green_theme: 63 | theme = APPTheme.Green; 64 | break; 65 | case R.id.red_theme: 66 | theme = APPTheme.Red; 67 | break; 68 | case R.id.grey_theme: 69 | theme = APPTheme.Grey; 70 | break; 71 | case R.id.black_theme: 72 | theme = APPTheme.Black; 73 | break; 74 | case R.id.orange_theme: 75 | theme = APPTheme.Orange; 76 | break; 77 | case R.id.purple_theme: 78 | theme = APPTheme.Purple; 79 | break; 80 | case R.id.pink_theme: 81 | theme = APPTheme.Pink; 82 | break; 83 | default: 84 | theme = APPTheme.WillFLow; 85 | break; 86 | } 87 | ConstDefine.setAppTheme(theme); 88 | startActivity(new Intent(getContext(), MainActivity.class)); 89 | getActivity().finish(); 90 | } 91 | } 92 | -------------------------------------------------------------------------------- /app/src/main/java/com/wgh/aiyue/helper/DialogHelper.java: -------------------------------------------------------------------------------- 1 | package com.wgh.aiyue.helper; 2 | 3 | import android.content.Context; 4 | import android.content.DialogInterface; 5 | 6 | import com.wgh.aiyue.R; 7 | import com.wgh.aiyue.ui.view.CustomDialog; 8 | 9 | /** 10 | * Created by : WGH. 11 | */ 12 | public class DialogHelper { 13 | 14 | private static DialogHelper dialogHelper; 15 | private static Context mContext; 16 | private static AlertListener mAlertListener; 17 | private static PayOfficalListener mOfficalListener; 18 | 19 | public DialogHelper(Context context) { 20 | this.mContext = context; 21 | } 22 | 23 | public interface AlertListener { 24 | void onPositiveButtonClick(); 25 | void onNegativeButtonClick(); 26 | } 27 | 28 | public interface PayOfficalListener { 29 | void onPositiveButtonClick(DialogInterface dialog, String string); 30 | void onNegativeButtonClick(DialogInterface dialog, String string); 31 | } 32 | 33 | public static DialogHelper getInstance(Context context) { 34 | dialogHelper = new DialogHelper(context); 35 | return dialogHelper; 36 | } 37 | 38 | public static DialogHelper getInstance(Context context, AlertListener alertListener) { 39 | dialogHelper = new DialogHelper(context); 40 | mAlertListener = alertListener; 41 | return dialogHelper; 42 | } 43 | 44 | public static DialogHelper getInstance(Context context, PayOfficalListener officalListener) { 45 | dialogHelper = new DialogHelper(context); 46 | mOfficalListener = officalListener; 47 | return dialogHelper; 48 | } 49 | 50 | public void showAlertDialog(String message) { 51 | CustomDialog.Builder builder = new CustomDialog.Builder(mContext); 52 | builder.setMessage(message); 53 | builder.setTitle(R.string.dialog_title_alert); 54 | builder.setPositiveButton(R.string.dialog_button_positive, new DialogInterface.OnClickListener() { 55 | public void onClick(DialogInterface dialog, int which) { 56 | dialog.dismiss(); 57 | mAlertListener.onPositiveButtonClick(); 58 | } 59 | }); 60 | 61 | builder.setNegativeButton(R.string.dialog_button_negative, new android.content.DialogInterface.OnClickListener() { 62 | public void onClick(DialogInterface dialog, int which) { 63 | dialog.dismiss(); 64 | mAlertListener.onNegativeButtonClick(); 65 | } 66 | }); 67 | builder.create().show(); 68 | } 69 | 70 | public void showOfficalDialog(String message) { 71 | final CustomDialog.Builder builder = new CustomDialog.Builder(mContext); 72 | builder.setLayout(R.layout.dialog_payofficial_layout); 73 | builder.setMessage(message); 74 | builder.setTitle(R.string.dialog_title_update); 75 | builder.setPositiveButton(R.string.dialog_button_payoffical, new DialogInterface.OnClickListener() { 76 | public void onClick(DialogInterface dialog, int which) { 77 | mOfficalListener.onPositiveButtonClick(dialog, builder.getInputText()); 78 | } 79 | }); 80 | 81 | builder.setNegativeButton(R.string.dialog_button_inputnum, new android.content.DialogInterface.OnClickListener() { 82 | public void onClick(DialogInterface dialog, int which) { 83 | mOfficalListener.onNegativeButtonClick(dialog, builder.getInputText()); 84 | } 85 | }); 86 | builder.create().show(); 87 | } 88 | } 89 | -------------------------------------------------------------------------------- /app/src/main/res/values/themes.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 12 | 13 | 14 | 20 | 21 | 22 | 28 | 29 | 30 | 36 | 37 | 38 | 44 | 45 | 51 | 52 | 53 | 59 | 60 | 66 | 67 | 73 | 74 | -------------------------------------------------------------------------------- /app/src/main/java/com/wgh/aiyue/ui/view/AutoLoadRecyclerView.java: -------------------------------------------------------------------------------- 1 | package com.wgh.aiyue.ui.view; 2 | 3 | import android.content.Context; 4 | import android.support.v7.widget.LinearLayoutManager; 5 | import android.support.v7.widget.RecyclerView; 6 | import android.util.AttributeSet; 7 | 8 | import com.wgh.aiyue.network.RequestManager; 9 | 10 | /** 11 | * Created by : WGH. 12 | */ 13 | public class AutoLoadRecyclerView extends RecyclerView{ 14 | 15 | private LoadMoreListener loadMoreListener; 16 | private boolean isLoadingMore; 17 | private int ySpeed; 18 | 19 | public AutoLoadRecyclerView(Context context) { 20 | this(context, null); 21 | } 22 | 23 | public AutoLoadRecyclerView(Context context, AttributeSet attrs) { 24 | this(context, attrs, 0); 25 | } 26 | 27 | public AutoLoadRecyclerView(Context context, AttributeSet attrs, int defStyle) { 28 | super(context, attrs, defStyle); 29 | isLoadingMore = false; 30 | addOnScrollListener(new AutoLoadScrollListener()); 31 | } 32 | 33 | public void loadFinish() { 34 | isLoadingMore = false; 35 | } 36 | 37 | public interface LoadMoreListener { 38 | void loadMore(); 39 | } 40 | 41 | public void setLoadMoreListener(LoadMoreListener loadMoreListener) { 42 | this.loadMoreListener = loadMoreListener; 43 | } 44 | 45 | /** 46 | * Slide auto load monitor. 47 | */ 48 | private class AutoLoadScrollListener extends OnScrollListener { 49 | public AutoLoadScrollListener() { 50 | super(); 51 | } 52 | 53 | @Override 54 | public void onScrolled(RecyclerView recyclerView, int dx, int dy) { 55 | super.onScrolled(recyclerView, dx, dy); 56 | ySpeed = dy; 57 | // GridLayoutManager is the LinearLayoutManager subclass. 58 | if (getLayoutManager() instanceof LinearLayoutManager) { 59 | int lastVisibleItem = ((LinearLayoutManager) getLayoutManager()).findLastVisibleItemPosition(); 60 | int totalItemCount = AutoLoadRecyclerView.this.getAdapter().getItemCount(); 61 | if (loadMoreListener != null && !isLoadingMore && lastVisibleItem >= totalItemCount - 2 && dy > 0) { 62 | isLoadingMore = true; 63 | loadMoreListener.loadMore(); 64 | } 65 | } 66 | } 67 | 68 | @Override 69 | public void onScrollStateChanged(RecyclerView recyclerView, int newState) { 70 | switch (newState) { 71 | case SCROLL_STATE_IDLE: 72 | RequestManager.getInstance().setGlideResume(); 73 | break; 74 | case SCROLL_STATE_DRAGGING: 75 | if (ySpeed > 20) { 76 | RequestManager.getInstance().setRequsetEnable(false); 77 | RequestManager.getInstance().setGlidePause(); 78 | } else { 79 | RequestManager.getInstance().setRequsetEnable(true); 80 | RequestManager.getInstance().setGlideResume(); 81 | } 82 | break; 83 | case SCROLL_STATE_SETTLING: 84 | if (ySpeed > 20) { 85 | RequestManager.getInstance().setRequsetEnable(false); 86 | RequestManager.getInstance().setGlidePause(); 87 | } else { 88 | RequestManager.getInstance().setRequsetEnable(true); 89 | RequestManager.getInstance().setGlideResume(); 90 | } 91 | break; 92 | } 93 | } 94 | } 95 | } 96 | -------------------------------------------------------------------------------- /app/src/main/res/layout/activity_main.xml: -------------------------------------------------------------------------------- 1 | 7 | 8 | 12 | 13 | 16 | 17 | 25 | 26 | 35 | 36 | 47 | 48 | 49 | 56 | 57 | 58 | 65 | 66 | 67 | 72 | 73 | 78 | -------------------------------------------------------------------------------- /app/src/main/res/layout/dialog_normal_layout.xml: -------------------------------------------------------------------------------- 1 | 2 | 8 | 9 | 14 | 15 | 24 | 25 | 29 | 30 | 35 | 36 | 46 | 47 | 58 | 59 | 60 | 67 | 68 | 77 | 78 | 88 | 89 | 90 | 91 | -------------------------------------------------------------------------------- /app/src/main/java/com/wgh/aiyue/mail/MailInfo.java: -------------------------------------------------------------------------------- 1 | package com.wgh.aiyue.mail; 2 | 3 | 4 | /** 5 | * Created by : WGH. 6 | * 发送邮件需要使用的基本信息 7 | */ 8 | 9 | import com.sun.mail.util.MailSSLSocketFactory; 10 | 11 | import java.security.GeneralSecurityException; 12 | import java.util.Properties; 13 | 14 | public class MailInfo { 15 | 16 | private String mailServerHost; 17 | private String mailServerPort = "465"; 18 | private String fromAddress; 19 | private String toAddress; 20 | private String userName; 21 | private String password; 22 | private boolean validate = false; // Weather need authentication. 23 | private String subject; 24 | private String content; 25 | private String[] attachFileNames; 26 | 27 | /** 28 | * Get mail session properties. 29 | */ 30 | public Properties getProperties() { 31 | Properties props = new Properties(); 32 | props.put("mail.smtp.host", this.mailServerHost); 33 | props.put("mail.smtp.port", this.mailServerPort); 34 | props.put("mail.smtp.auth", validate ? true : false); 35 | MailSSLSocketFactory sf = null; 36 | try { 37 | sf = new MailSSLSocketFactory(); 38 | sf.setTrustAllHosts(true); 39 | } catch (GeneralSecurityException e) { 40 | e.printStackTrace(); 41 | } 42 | props.put("mail.smtp.ssl.enable", "true"); // SSL verification 43 | props.put("mail.smtp.ssl.socketFactory", sf); 44 | props.put("mail.transport.protocol", "smtp"); // Specified protocol 45 | props.put("mail.debug", "false"); // Debug mode 46 | return props; 47 | } 48 | 49 | 50 | public String getMailServerHost() { 51 | return mailServerHost; 52 | } 53 | 54 | public void setMailServerHost(String mailServerHost) { 55 | this.mailServerHost = mailServerHost; 56 | } 57 | 58 | public String getMailServerPort() { 59 | return mailServerPort; 60 | } 61 | 62 | public void setMailServerPort(String mailServerPort) { 63 | this.mailServerPort = mailServerPort; 64 | } 65 | 66 | public boolean isValidate() { 67 | return validate; 68 | } 69 | 70 | public void setValidate(boolean validate) { 71 | this.validate = validate; 72 | } 73 | 74 | public String[] getAttachFileNames() { 75 | return attachFileNames; 76 | } 77 | 78 | public void setAttachFileNames(String[] fileNames) { 79 | this.attachFileNames = fileNames; 80 | } 81 | 82 | public String getFromAddress() { 83 | return fromAddress; 84 | } 85 | 86 | public void setFromAddress(String fromAddress) { 87 | this.fromAddress = fromAddress; 88 | } 89 | 90 | public String getPassword() { 91 | return password; 92 | } 93 | 94 | public void setPassword(String password) { 95 | this.password = password; 96 | } 97 | 98 | public String getToAddress() { 99 | return toAddress; 100 | } 101 | 102 | public void setToAddress(String toAddress) { 103 | this.toAddress = toAddress; 104 | } 105 | 106 | public String getUserName() { 107 | return userName; 108 | } 109 | 110 | public void setUserName(String userName) { 111 | this.userName = userName; 112 | } 113 | 114 | public String getSubject() { 115 | return subject; 116 | } 117 | 118 | public void setSubject(String subject) { 119 | this.subject = subject; 120 | } 121 | 122 | public String getContent() { 123 | return content; 124 | } 125 | 126 | public void setContent(String textContent) { 127 | this.content = textContent; 128 | } 129 | } -------------------------------------------------------------------------------- /app/src/main/java/com/wgh/aiyue/ui/DetailActivity.java: -------------------------------------------------------------------------------- 1 | package com.wgh.aiyue.ui; 2 | 3 | import android.os.Bundle; 4 | import android.text.TextUtils; 5 | import android.view.View; 6 | import android.webkit.WebSettings; 7 | import android.webkit.WebView; 8 | import android.webkit.WebViewClient; 9 | import android.widget.FrameLayout; 10 | 11 | import com.wgh.aiyue.R; 12 | import com.wgh.aiyue.ui.view.ProgressWebView; 13 | import com.wgh.aiyue.util.DLog; 14 | 15 | import butterknife.BindView; 16 | import butterknife.ButterKnife; 17 | 18 | /** 19 | * Created by : WGH. 20 | */ 21 | public class DetailActivity extends BaseActivity { 22 | public static final String EXTRA_Url = "extra_detail_url"; 23 | @BindView(R.id.web_detail) 24 | ProgressWebView mWebView; 25 | @BindView(R.id.detail_frame_layout) 26 | FrameLayout frameLayout; 27 | 28 | private String mUrlString; 29 | 30 | @Override 31 | protected void onCreate(Bundle savedInstanceState) { 32 | super.onCreate(savedInstanceState); 33 | setContentView(R.layout.activity_detail); 34 | ButterKnife.bind(this); 35 | 36 | mUrlString = this.getIntent().getStringExtra(EXTRA_Url); 37 | 38 | if (TextUtils.isEmpty(mUrlString)) { 39 | DLog.e("TextUtils.isEmpty(mUrlString)"); 40 | finish(); 41 | } 42 | 43 | mWebView.setProgress(true); 44 | WebSettings settings = mWebView.getSettings(); 45 | settings.setJavaScriptEnabled(true); 46 | settings.setSupportZoom(true); 47 | settings.setBuiltInZoomControls(true); 48 | settings.setDisplayZoomControls(false); 49 | settings.setJavaScriptCanOpenWindowsAutomatically(true); 50 | settings.setMinimumFontSize(settings.getMinimumFontSize() + 8); 51 | settings.setAllowFileAccess(false); 52 | settings.setSavePassword(false); 53 | settings.setTextSize(WebSettings.TextSize.NORMAL); 54 | mWebView.setVerticalScrollbarOverlay(true); 55 | 56 | mWebView.setWebViewClient(new DetailWebViewClient()); 57 | mWebView.setWebChromeClient(new WebChromeClient()); 58 | mWebView.loadUrl(mUrlString); 59 | } 60 | 61 | private class DetailWebViewClient extends WebViewClient { 62 | @Override 63 | public boolean shouldOverrideUrlLoading(WebView view, String url) { 64 | if (!(url.startsWith("http") || url.startsWith("https"))) { 65 | return true; 66 | } 67 | return super.shouldOverrideUrlLoading(view, url); 68 | } 69 | } 70 | 71 | private class WebChromeClient extends android.webkit.WebChromeClient { 72 | @Override 73 | public void onProgressChanged(WebView view, int newProgress) { 74 | if (newProgress == 100) { 75 | mWebView.getProgressBar().setVisibility(View.GONE); 76 | } else { 77 | if (mWebView.isProgress()) { 78 | if (mWebView.getProgressBar().getVisibility() == View.GONE) { 79 | mWebView.getProgressBar().setVisibility(View.VISIBLE); 80 | } 81 | mWebView.getProgressBar().setProgress(newProgress); 82 | } else { 83 | mWebView.getProgressBar().setVisibility(View.GONE); 84 | } 85 | } 86 | super.onProgressChanged(view, newProgress); 87 | } 88 | } 89 | 90 | @Override 91 | public void onBackPressed() { 92 | if (mWebView.canGoBack()) { 93 | mWebView.goBack(); 94 | } else { 95 | super.onBackPressed(); 96 | } 97 | } 98 | 99 | @Override 100 | protected void onDestroy() { 101 | super.onDestroy(); 102 | mWebView.removeAllViews(); 103 | } 104 | } 105 | -------------------------------------------------------------------------------- /app/src/main/res/layout/dialog_payofficial_layout.xml: -------------------------------------------------------------------------------- 1 | 2 | 8 | 9 | 14 | 15 | 24 | 25 | 29 | 30 | 36 | 37 | 49 | 50 | 59 | 60 | 61 | 62 | 69 | 70 | 79 | 80 | 90 | 91 | 92 | 93 | -------------------------------------------------------------------------------- /app/src/main/java/com/wgh/aiyue/greendao/DaoMaster.java: -------------------------------------------------------------------------------- 1 | package com.wgh.aiyue.greendao; 2 | 3 | import android.content.Context; 4 | import android.database.sqlite.SQLiteDatabase; 5 | import android.database.sqlite.SQLiteDatabase.CursorFactory; 6 | import android.util.Log; 7 | 8 | import org.greenrobot.greendao.AbstractDaoMaster; 9 | import org.greenrobot.greendao.database.StandardDatabase; 10 | import org.greenrobot.greendao.database.Database; 11 | import org.greenrobot.greendao.database.DatabaseOpenHelper; 12 | import org.greenrobot.greendao.identityscope.IdentityScopeType; 13 | 14 | 15 | // THIS CODE IS GENERATED BY greenDAO, DO NOT EDIT. 16 | /** 17 | * Master of DAO (schema version 1): knows all DAOs. 18 | */ 19 | public class DaoMaster extends AbstractDaoMaster { 20 | public static final int SCHEMA_VERSION = 1; 21 | 22 | /** Creates underlying database table using DAOs. */ 23 | public static void createAllTables(Database db, boolean ifNotExists) { 24 | CategoryDao.createTable(db, ifNotExists); 25 | FavoriteCatDao.createTable(db, ifNotExists); 26 | ImgCatDao.createTable(db, ifNotExists); 27 | } 28 | 29 | /** Drops underlying database table using DAOs. */ 30 | public static void dropAllTables(Database db, boolean ifExists) { 31 | CategoryDao.dropTable(db, ifExists); 32 | FavoriteCatDao.dropTable(db, ifExists); 33 | ImgCatDao.dropTable(db, ifExists); 34 | } 35 | 36 | /** 37 | * WARNING: Drops all table on Upgrade! Use only during development. 38 | * Convenience method using a {@link DevOpenHelper}. 39 | */ 40 | public static DaoSession newDevSession(Context context, String name) { 41 | Database db = new DevOpenHelper(context, name).getWritableDb(); 42 | DaoMaster daoMaster = new DaoMaster(db); 43 | return daoMaster.newSession(); 44 | } 45 | 46 | public DaoMaster(SQLiteDatabase db) { 47 | this(new StandardDatabase(db)); 48 | } 49 | 50 | public DaoMaster(Database db) { 51 | super(db, SCHEMA_VERSION); 52 | registerDaoClass(CategoryDao.class); 53 | registerDaoClass(FavoriteCatDao.class); 54 | registerDaoClass(ImgCatDao.class); 55 | } 56 | 57 | public DaoSession newSession() { 58 | return new DaoSession(db, IdentityScopeType.Session, daoConfigMap); 59 | } 60 | 61 | public DaoSession newSession(IdentityScopeType type) { 62 | return new DaoSession(db, type, daoConfigMap); 63 | } 64 | 65 | /** 66 | * Calls {@link #createAllTables(Database, boolean)} in {@link #onCreate(Database)} - 67 | */ 68 | public static abstract class OpenHelper extends DatabaseOpenHelper { 69 | public OpenHelper(Context context, String name) { 70 | super(context, name, SCHEMA_VERSION); 71 | } 72 | 73 | public OpenHelper(Context context, String name, CursorFactory factory) { 74 | super(context, name, factory, SCHEMA_VERSION); 75 | } 76 | 77 | @Override 78 | public void onCreate(Database db) { 79 | Log.i("greenDAO", "Creating tables for schema version " + SCHEMA_VERSION); 80 | createAllTables(db, false); 81 | } 82 | } 83 | 84 | /** WARNING: Drops all table on Upgrade! Use only during development. */ 85 | public static class DevOpenHelper extends OpenHelper { 86 | public DevOpenHelper(Context context, String name) { 87 | super(context, name); 88 | } 89 | 90 | public DevOpenHelper(Context context, String name, CursorFactory factory) { 91 | super(context, name, factory); 92 | } 93 | 94 | @Override 95 | public void onUpgrade(Database db, int oldVersion, int newVersion) { 96 | Log.i("greenDAO", "Upgrading schema from version " + oldVersion + " to " + newVersion + " by dropping all tables"); 97 | dropAllTables(db, true); 98 | onCreate(db); 99 | } 100 | } 101 | 102 | } 103 | -------------------------------------------------------------------------------- /app/src/main/java/com/wgh/willflowaicollection/greendao/DaoMaster.java: -------------------------------------------------------------------------------- 1 | package com.wgh.willflowaicollection.greendao; 2 | 3 | import android.content.Context; 4 | import android.database.sqlite.SQLiteDatabase; 5 | import android.database.sqlite.SQLiteDatabase.CursorFactory; 6 | import android.util.Log; 7 | 8 | import org.greenrobot.greendao.AbstractDaoMaster; 9 | import org.greenrobot.greendao.database.StandardDatabase; 10 | import org.greenrobot.greendao.database.Database; 11 | import org.greenrobot.greendao.database.DatabaseOpenHelper; 12 | import org.greenrobot.greendao.identityscope.IdentityScopeType; 13 | 14 | 15 | // THIS CODE IS GENERATED BY greenDAO, DO NOT EDIT. 16 | /** 17 | * Master of DAO (schema version 1): knows all DAOs. 18 | */ 19 | public class DaoMaster extends AbstractDaoMaster { 20 | public static final int SCHEMA_VERSION = 1; 21 | 22 | /** Creates underlying database table using DAOs. */ 23 | public static void createAllTables(Database db, boolean ifNotExists) { 24 | CategoryDao.createTable(db, ifNotExists); 25 | FavoriteCatDao.createTable(db, ifNotExists); 26 | ImgCatDao.createTable(db, ifNotExists); 27 | } 28 | 29 | /** Drops underlying database table using DAOs. */ 30 | public static void dropAllTables(Database db, boolean ifExists) { 31 | CategoryDao.dropTable(db, ifExists); 32 | FavoriteCatDao.dropTable(db, ifExists); 33 | ImgCatDao.dropTable(db, ifExists); 34 | } 35 | 36 | /** 37 | * WARNING: Drops all table on Upgrade! Use only during development. 38 | * Convenience method using a {@link DevOpenHelper}. 39 | */ 40 | public static DaoSession newDevSession(Context context, String name) { 41 | Database db = new DevOpenHelper(context, name).getWritableDb(); 42 | DaoMaster daoMaster = new DaoMaster(db); 43 | return daoMaster.newSession(); 44 | } 45 | 46 | public DaoMaster(SQLiteDatabase db) { 47 | this(new StandardDatabase(db)); 48 | } 49 | 50 | public DaoMaster(Database db) { 51 | super(db, SCHEMA_VERSION); 52 | registerDaoClass(CategoryDao.class); 53 | registerDaoClass(FavoriteCatDao.class); 54 | registerDaoClass(ImgCatDao.class); 55 | } 56 | 57 | public DaoSession newSession() { 58 | return new DaoSession(db, IdentityScopeType.Session, daoConfigMap); 59 | } 60 | 61 | public DaoSession newSession(IdentityScopeType type) { 62 | return new DaoSession(db, type, daoConfigMap); 63 | } 64 | 65 | /** 66 | * Calls {@link #createAllTables(Database, boolean)} in {@link #onCreate(Database)} - 67 | */ 68 | public static abstract class OpenHelper extends DatabaseOpenHelper { 69 | public OpenHelper(Context context, String name) { 70 | super(context, name, SCHEMA_VERSION); 71 | } 72 | 73 | public OpenHelper(Context context, String name, CursorFactory factory) { 74 | super(context, name, factory, SCHEMA_VERSION); 75 | } 76 | 77 | @Override 78 | public void onCreate(Database db) { 79 | Log.i("greenDAO", "Creating tables for schema version " + SCHEMA_VERSION); 80 | createAllTables(db, false); 81 | } 82 | } 83 | 84 | /** WARNING: Drops all table on Upgrade! Use only during development. */ 85 | public static class DevOpenHelper extends OpenHelper { 86 | public DevOpenHelper(Context context, String name) { 87 | super(context, name); 88 | } 89 | 90 | public DevOpenHelper(Context context, String name, CursorFactory factory) { 91 | super(context, name, factory); 92 | } 93 | 94 | @Override 95 | public void onUpgrade(Database db, int oldVersion, int newVersion) { 96 | Log.i("greenDAO", "Upgrading schema from version " + oldVersion + " to " + newVersion + " by dropping all tables"); 97 | dropAllTables(db, true); 98 | onCreate(db); 99 | } 100 | } 101 | 102 | } 103 | -------------------------------------------------------------------------------- /app/src/main/java/com/wgh/aiyue/adapter/DragViewAdapter.java: -------------------------------------------------------------------------------- 1 | package com.wgh.aiyue.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.TextView; 9 | 10 | import com.wgh.aiyue.R; 11 | import com.wgh.aiyue.model.Category; 12 | 13 | import java.util.ArrayList; 14 | 15 | /** 16 | * Created by : WGH. 17 | */ 18 | public class DragViewAdapter extends BaseAdapter { 19 | 20 | private boolean isItemShow = false; 21 | private Context context; 22 | private int holdPosition; 23 | private boolean isChanged = false; 24 | boolean isVisible = true; 25 | public ArrayList categories; 26 | private TextView item_text; 27 | public int remove_position = -1; 28 | 29 | public DragViewAdapter(Context context, ArrayList categories) { 30 | this.context = context; 31 | this.categories = categories; 32 | } 33 | 34 | @Override 35 | public int getCount() { 36 | return categories == null ? 0 : categories.size(); 37 | } 38 | 39 | @Override 40 | public Category getItem(int position) { 41 | if (categories != null && categories.size() != 0) { 42 | return categories.get(position); 43 | } 44 | return null; 45 | } 46 | 47 | @Override 48 | public long getItemId(int position) { 49 | return position; 50 | } 51 | 52 | @Override 53 | public View getView(int position, View convertView, ViewGroup parent) { 54 | View view = LayoutInflater.from(context).inflate(R.layout.channel_view_item, null); 55 | item_text = (TextView) view.findViewById(R.id.text_item); 56 | Category category = getItem(position); 57 | item_text.setText(category.getName()); 58 | if ((position == 0) || (position == 1)){ 59 | item_text.setEnabled(false); 60 | } 61 | if (isChanged && (position == holdPosition) && !isItemShow) { 62 | item_text.setText(""); 63 | item_text.setSelected(true); 64 | item_text.setEnabled(true); 65 | isChanged = false; 66 | } 67 | if (!isVisible && (position == -1 + categories.size())) { 68 | item_text.setText(""); 69 | item_text.setSelected(true); 70 | item_text.setEnabled(true); 71 | } 72 | if(remove_position == position){ 73 | item_text.setText(""); 74 | } 75 | return view; 76 | } 77 | 78 | public void addItem(Category category) { 79 | categories.add(category); 80 | notifyDataSetChanged(); 81 | } 82 | 83 | public void exchange(int dragPostion, int dropPostion) { 84 | holdPosition = dropPostion; 85 | Category dragItem = getItem(dragPostion); 86 | if (dragPostion < dropPostion) { 87 | categories.add(dropPostion + 1, dragItem); 88 | categories.remove(dragPostion); 89 | } else { 90 | categories.add(dropPostion, dragItem); 91 | categories.remove(dragPostion + 1); 92 | } 93 | isChanged = true; 94 | notifyDataSetChanged(); 95 | } 96 | 97 | public ArrayList getCategoryLst() { 98 | return categories; 99 | } 100 | 101 | public void setRemove(int position) { 102 | remove_position = position; 103 | notifyDataSetChanged(); 104 | } 105 | 106 | public void remove() { 107 | categories.remove(remove_position); 108 | remove_position = -1; 109 | notifyDataSetChanged(); 110 | } 111 | 112 | public void setListDate(ArrayList list) { 113 | categories = list; 114 | } 115 | 116 | public boolean isVisible() { 117 | return isVisible; 118 | } 119 | 120 | public void setVisible(boolean visible) { 121 | isVisible = visible; 122 | } 123 | 124 | public void setShowDropItem(boolean show) { 125 | isItemShow = show; 126 | } 127 | } 128 | -------------------------------------------------------------------------------- /app/src/main/java/com/wgh/aiyue/ui/view/AsyncImageView.java: -------------------------------------------------------------------------------- 1 | package com.wgh.aiyue.ui.view; 2 | 3 | import android.annotation.SuppressLint; 4 | import android.content.Context; 5 | import android.support.annotation.Nullable; 6 | import android.util.AttributeSet; 7 | import android.widget.ImageView; 8 | 9 | import com.android.volley.Response; 10 | import com.android.volley.VolleyError; 11 | import com.bumptech.glide.load.engine.DiskCacheStrategy; 12 | import com.bumptech.glide.load.resource.drawable.GlideDrawable; 13 | import com.bumptech.glide.request.RequestListener; 14 | import com.bumptech.glide.request.target.Target; 15 | import com.wgh.aiyue.R; 16 | import com.wgh.aiyue.helper.DatabaseHelper; 17 | import com.wgh.aiyue.model.ImgCat; 18 | import com.wgh.aiyue.network.RequestCategory; 19 | import com.wgh.aiyue.network.RequestManager; 20 | import com.wgh.aiyue.util.DLog; 21 | import com.wgh.aiyue.util.NetWorkUtil; 22 | 23 | import java.util.ArrayList; 24 | 25 | /** 26 | * Created by : WGH. 27 | */ 28 | @SuppressLint("AppCompatCustomView") 29 | public class AsyncImageView extends ImageView { 30 | 31 | public AsyncImageView(Context context) { 32 | super(context); 33 | } 34 | 35 | public AsyncImageView(Context context, @Nullable AttributeSet attrs) { 36 | super(context, attrs); 37 | } 38 | 39 | public AsyncImageView(Context context, @Nullable AttributeSet attrs, int defStyleAttr) { 40 | super(context, attrs, defStyleAttr); 41 | } 42 | 43 | public void loadImage(final String contentUrl, final int position) { 44 | if (NetWorkUtil.isNetWork()) { 45 | ImgCat imgCat = DatabaseHelper.getInstance().getImgCatFromDB(contentUrl); 46 | if (imgCat != null) { 47 | loadWithGlide(imgCat); 48 | } else { 49 | RequestManager.getInstance().addRequest(new RequestCategory(contentUrl, 50 | new Response.Listener>() { 51 | @Override 52 | public void onResponse(ArrayList response) { 53 | DLog.i("onResponse : " + response); 54 | if (response != null) { 55 | if (response.size() > 1) { 56 | String imgUrl = response.get(0); 57 | String description = response.get(1); 58 | ImgCat ic = new ImgCat(contentUrl, imgUrl); 59 | loadWithGlide(ic); 60 | } 61 | } 62 | } 63 | }, new Response.ErrorListener() { 64 | 65 | @Override 66 | public void onErrorResponse(VolleyError error) { 67 | DLog.e("onErrorResponse : " + error.toString()); 68 | } 69 | }), contentUrl); 70 | } 71 | } else { 72 | setImageResource(R.mipmap.ic_launcher); 73 | } 74 | } 75 | 76 | private void loadWithGlide(final ImgCat imgCat) { 77 | RequestManager.getInstance().getGlideManager().load(imgCat.getImgUrl()).listener(new RequestListener() { 78 | @Override 79 | public boolean onException(Exception e, String imgUrl, Target target, boolean isFirstResource) { 80 | DatabaseHelper.getInstance().deleteImgCatFromDB(imgCat.getContentUrl()); 81 | return false; 82 | } 83 | 84 | @Override 85 | public boolean onResourceReady(GlideDrawable resource, String imgUrl, Target target, boolean isFromMemoryCache, boolean isFirstResource) { 86 | DatabaseHelper.getInstance().insetOrUpdateImgCat(imgCat); 87 | return false; 88 | } 89 | }) 90 | .placeholder(R.mipmap.ic_launcher).error(R.mipmap.ic_launcher) 91 | .centerCrop() 92 | .crossFade(666) 93 | .skipMemoryCache(false) 94 | .diskCacheStrategy(DiskCacheStrategy.SOURCE) 95 | .into(this); 96 | } 97 | } 98 | --------------------------------------------------------------------------------