From 43f96491ae16db2e7d0754c39597ac2e869c3339 Mon Sep 17 00:00:00 2001 From: FinalJcsp <869150743@qq.com> Date: Wed, 31 May 2023 15:55:49 +0800 Subject: [PATCH] init --- .gitignore | 15 + .idea/codeStyles/Project.xml | 116 +++++ .idea/compiler.xml | 6 + .idea/dbnavigator.xml | 414 ++++++++++++++++++ .idea/deploymentTargetDropDown.xml | 17 + .idea/gradle.xml | 20 + .idea/jarRepositories.xml | 85 ++++ .idea/misc.xml | 18 + .idea/vcs.xml | 6 + app/.gitignore | 1 + app/build.gradle | 48 ++ app/proguard-rules.pro | 21 + .../ExampleInstrumentedTest.java | 27 ++ app/src/main/AndroidManifest.xml | 61 +++ app/src/main/assets/images/back.png | Bin 0 -> 238 bytes app/src/main/assets/images/broad.png | Bin 0 -> 700 bytes app/src/main/assets/images/duanxin.png | Bin 0 -> 774 bytes app/src/main/assets/images/iconwhite.png | Bin 0 -> 2848 bytes app/src/main/assets/images/onplay.png | Bin 0 -> 484 bytes app/src/main/assets/images/share.png | Bin 0 -> 500 bytes app/src/main/assets/images/shoucang.png | Bin 0 -> 676 bytes app/src/main/assets/index.css | 129 ++++++ app/src/main/assets/index.html | 42 ++ app/src/main/assets/index.js | 94 ++++ app/src/main/assets/mock_data_tv_01.json | 62 +++ app/src/main/assets/mock_data_tv_02.json | 52 +++ .../main/assets/mock_data_tv_comments.json | 42 ++ app/src/main/assets/mock_data_tv_details.json | 8 + app/src/main/assets/mock_list_task.json | 37 ++ app/src/main/assets/mock_user_points.json | 5 + .../example/androidtermwork/Activity1.java | 39 ++ .../example/androidtermwork/Activity2.java | 25 ++ .../example/androidtermwork/Activity3.java | 34 ++ .../example/androidtermwork/Activity4.java | 33 ++ .../example/androidtermwork/Activity5.java | 32 ++ .../androidtermwork/AndroidToastForJs.java | 45 ++ .../example/androidtermwork/ChatActivity.java | 155 +++++++ .../example/androidtermwork/LoginPage.java | 277 ++++++++++++ .../com/example/androidtermwork/LossPage.java | 21 + .../example/androidtermwork/MainActivity.java | 129 ++++++ .../com/example/androidtermwork/MinePage.java | 34 ++ .../example/androidtermwork/PointsPage.java | 92 ++++ .../androidtermwork/RegisterFirstPage.java | 104 +++++ .../androidtermwork/RegisterSecondPage.java | 98 +++++ .../androidtermwork/RegisterThirdPage.java | 89 ++++ .../androidtermwork/ResetPasswordPage.java | 99 +++++ .../androidtermwork/RetrievePasswordPage.java | 98 +++++ .../androidtermwork/TvStationPlayPage.java | 177 ++++++++ .../example/androidtermwork/WelcomePage.java | 37 ++ .../adpter/PointsItemAdapter.java | 263 +++++++++++ .../adpter/TVDetailsCommentsAdapter.java | 281 ++++++++++++ .../adpter/TVStationAdapter.java | 131 ++++++ .../androidtermwork/pojo/PointSummary.java | 51 +++ .../androidtermwork/pojo/PointTask.java | 51 +++ .../androidtermwork/pojo/TVStation.java | 78 ++++ .../androidtermwork/pojo/TvComment.java | 67 +++ .../androidtermwork/pojo/TvDetails.java | 103 +++++ .../ui/dashboard/DashboardFragment.java | 140 ++++++ .../ui/dashboard/DashboardViewModel.java | 32 ++ .../androidtermwork/ui/home/HomeFragment.java | 73 +++ .../ui/home/HomeViewModel.java | 19 + .../notifications/NotificationsFragment.java | 170 +++++++ .../notifications/NotificationsViewModel.java | 19 + .../androidtermwork/util/FormatUtil.java | 36 ++ .../androidtermwork/util/ResourceUtil.java | 26 ++ .../androidtermwork/util/StatusBarUtil.java | 30 ++ .../androidtermwork/util/TestUtil.java | 99 +++++ .../androidtermwork/view/JzvdPlayer.java | 32 ++ .../androidtermwork/volley/BitmapCache.java | 32 ++ .../com/example/androidtermwork/webView.java | 160 +++++++ .../main/res/drawable-v24/avatar_border.xml | 12 + app/src/main/res/drawable-v24/bj.png | Bin 0 -> 78780 bytes .../main/res/drawable-v24/button_border.xml | 11 + app/src/main/res/drawable-v24/edit_border.xml | 10 + .../drawable-v24/ic_launcher_foreground.xml | 34 ++ app/src/main/res/drawable-v24/layer.xml | 20 + .../main/res/drawable-v24/left_messages.9.png | Bin 0 -> 2306 bytes app/src/main/res/drawable-v24/mine_border.xml | 5 + .../res/drawable-v24/right_messages.9.png | Bin 0 -> 1972 bytes app/src/main/res/drawable-v24/shadow.png | Bin 0 -> 7793 bytes app/src/main/res/drawable-v24/shan.png | Bin 0 -> 693 bytes app/src/main/res/drawable-v24/shezhiblack.png | Bin 0 -> 1770 bytes app/src/main/res/drawable-v24/tis.png | Bin 0 -> 1899 bytes app/src/main/res/drawable/border_comment.xml | 10 + app/src/main/res/drawable/feel_good.xml | 11 + app/src/main/res/drawable/ic_collect_star.xml | 12 + app/src/main/res/drawable/ic_comments.xml | 14 + .../res/drawable/ic_dashboard_black_24dp.xml | 9 + app/src/main/res/drawable/ic_feel_good.xml | 11 + .../main/res/drawable/ic_home_black_24dp.xml | 9 + .../res/drawable/ic_launcher_background.xml | 170 +++++++ .../drawable/ic_notifications_black_24dp.xml | 9 + app/src/main/res/drawable/ic_share.xml | 20 + app/src/main/res/drawable/listview_border.xml | 11 + .../main/res/drawable/loginbutton_border.xml | 11 + app/src/main/res/drawable/pagetop_border.xml | 13 + .../main/res/drawable/points_alarm_border.xml | 10 + .../drawable/points_introduction_border.xml | 12 + .../main/res/drawable/points_item_divider.xml | 7 + .../res/drawable/points_progressbar_bg.xml | 23 + .../main/res/drawable/regisbutton_border.xml | 11 + .../main/res/drawable/time_length_border.xml | 10 + .../main/res/drawable/toappbutton_border.xml | 13 + .../res/drawable/tv_play_collect_checkbox.xml | 19 + .../main/res/drawable/tv_play_collected.xml | 11 + .../drawable/tv_play_feel_good_checkbox.xml | 7 + .../res/drawable/tv_play_gradient_divider.xml | 20 + .../tv_play_open_details_radiobutton.xml | 18 + .../res/drawable/tv_play_open_information.xml | 11 + app/src/main/res/layout/activity_1.xml | 145 ++++++ app/src/main/res/layout/activity_2.xml | 172 ++++++++ app/src/main/res/layout/activity_3.xml | 173 ++++++++ app/src/main/res/layout/activity_4.xml | 145 ++++++ app/src/main/res/layout/activity_5.xml | 124 ++++++ app/src/main/res/layout/activity_chat.xml | 67 +++ .../main/res/layout/activity_login_page.xml | 130 ++++++ .../main/res/layout/activity_loss_page.xml | 80 ++++ app/src/main/res/layout/activity_main.xml | 119 +++++ .../main/res/layout/activity_mine_page.xml | 144 ++++++ .../main/res/layout/activity_points_page.xml | 38 ++ .../layout/activity_register_third_page.xml | 65 +++ .../layout/activity_reset_password_page.xml | 80 ++++ .../activity_retrieve_password_page.xml | 77 ++++ .../res/layout/activity_tv_station_play.xml | 114 +++++ app/src/main/res/layout/activity_web_view.xml | 21 + .../main/res/layout/activity_welcome_page.xml | 15 + app/src/main/res/layout/chat_list_item.xml | 42 ++ .../main/res/layout/fragment_dashboard.xml | 16 + app/src/main/res/layout/fragment_home.xml | 39 ++ .../res/layout/fragment_notifications.xml | 26 ++ app/src/main/res/layout/list_item.xml | 37 ++ app/src/main/res/layout/msg_item.xml | 60 +++ app/src/main/res/layout/news_list_item.xml | 52 +++ .../main/res/layout/points_page_item_sum.xml | 132 ++++++ .../main/res/layout/points_page_item_task.xml | 66 +++ .../main/res/layout/tv_play_comment_item.xml | 95 ++++ .../main/res/layout/tv_play_details_item.xml | 156 +++++++ .../layout/tv_play_hint_item_nocomment.xml | 5 + .../main/res/layout/tv_station_big_item.xml | 57 +++ .../res/layout/tv_station_standard_item.xml | 82 ++++ app/src/main/res/menu/bottom_nav_menu.xml | 23 + app/src/main/res/menu/top_menu.xml | 37 ++ .../res/mipmap-anydpi-v26/ic_launcher.xml | 5 + .../mipmap-anydpi-v26/ic_launcher_round.xml | 5 + .../res/mipmap-hdpi/default_head_portrait.png | Bin 0 -> 4429 bytes app/src/main/res/mipmap-hdpi/ewm.png | Bin 0 -> 425 bytes app/src/main/res/mipmap-hdpi/gobackhui.png | Bin 0 -> 710 bytes app/src/main/res/mipmap-hdpi/gobackwhite.png | Bin 0 -> 552 bytes app/src/main/res/mipmap-hdpi/ic_launcher.png | Bin 0 -> 2963 bytes .../res/mipmap-hdpi/ic_launcher_round.png | Bin 0 -> 4905 bytes .../res/mipmap-hdpi/loading_head_portrait.png | Bin 0 -> 547 bytes app/src/main/res/mipmap-hdpi/no_comment.png | Bin 0 -> 60531 bytes app/src/main/res/mipmap-hdpi/shezhi.png | Bin 0 -> 644 bytes app/src/main/res/mipmap-hdpi/shuxiang.png | Bin 0 -> 151 bytes app/src/main/res/mipmap-hdpi/tx1.png | Bin 0 -> 3318 bytes app/src/main/res/mipmap-hdpi/tx2.png | Bin 0 -> 3495 bytes app/src/main/res/mipmap-hdpi/user_head.jpg | Bin 0 -> 169372 bytes app/src/main/res/mipmap-mdpi/appicon.png | Bin 0 -> 5056 bytes app/src/main/res/mipmap-mdpi/avatar.png | Bin 0 -> 3138 bytes app/src/main/res/mipmap-mdpi/bg.jpg | Bin 0 -> 678671 bytes app/src/main/res/mipmap-mdpi/broadcast.png | Bin 0 -> 2165 bytes app/src/main/res/mipmap-mdpi/clear.png | Bin 0 -> 602 bytes app/src/main/res/mipmap-mdpi/dialogmsg.png | Bin 0 -> 2211 bytes app/src/main/res/mipmap-mdpi/go_back_dark.png | Bin 0 -> 329 bytes app/src/main/res/mipmap-mdpi/goback.png | Bin 0 -> 194 bytes app/src/main/res/mipmap-mdpi/hornred.png | Bin 0 -> 697 bytes .../main/res/mipmap-mdpi/ic_bright_star0.png | Bin 0 -> 159 bytes .../main/res/mipmap-mdpi/ic_bright_star1.png | Bin 0 -> 5346 bytes .../main/res/mipmap-mdpi/ic_bright_star10.png | Bin 0 -> 5854 bytes .../main/res/mipmap-mdpi/ic_bright_star2.png | Bin 0 -> 5564 bytes .../main/res/mipmap-mdpi/ic_bright_star3.png | Bin 0 -> 5856 bytes .../main/res/mipmap-mdpi/ic_bright_star4.png | Bin 0 -> 6090 bytes .../main/res/mipmap-mdpi/ic_bright_star5.png | Bin 0 -> 6106 bytes .../main/res/mipmap-mdpi/ic_bright_star6.png | Bin 0 -> 6091 bytes .../main/res/mipmap-mdpi/ic_bright_star7.png | Bin 0 -> 5870 bytes .../main/res/mipmap-mdpi/ic_bright_star8.png | Bin 0 -> 5911 bytes .../main/res/mipmap-mdpi/ic_bright_star9.png | Bin 0 -> 5444 bytes app/src/main/res/mipmap-mdpi/ic_launcher.png | Bin 0 -> 2060 bytes .../res/mipmap-mdpi/ic_launcher_round.png | Bin 0 -> 2783 bytes app/src/main/res/mipmap-mdpi/ic_play_tv.png | Bin 0 -> 328 bytes app/src/main/res/mipmap-mdpi/ic_right.png | Bin 0 -> 287 bytes app/src/main/res/mipmap-mdpi/ic_speaker.png | Bin 0 -> 2365 bytes app/src/main/res/mipmap-mdpi/icon.png | Bin 0 -> 5447 bytes app/src/main/res/mipmap-mdpi/iconcir.png | Bin 0 -> 4236 bytes app/src/main/res/mipmap-mdpi/iconcirred.png | Bin 0 -> 5628 bytes app/src/main/res/mipmap-mdpi/iconlarge.png | Bin 0 -> 9153 bytes app/src/main/res/mipmap-mdpi/iconwhite.png | Bin 0 -> 2848 bytes .../main/res/mipmap-mdpi/img_fail_to_load.png | Bin 0 -> 41992 bytes app/src/main/res/mipmap-mdpi/img_loading.png | Bin 0 -> 32684 bytes app/src/main/res/mipmap-mdpi/locking.png | Bin 0 -> 1363 bytes app/src/main/res/mipmap-mdpi/message.png | Bin 0 -> 774 bytes app/src/main/res/mipmap-mdpi/password.png | Bin 0 -> 880 bytes app/src/main/res/mipmap-mdpi/right_arrow.png | Bin 0 -> 198 bytes app/src/main/res/mipmap-mdpi/search.png | Bin 0 -> 635 bytes app/src/main/res/mipmap-mdpi/username.png | Bin 0 -> 1329 bytes app/src/main/res/mipmap-mdpi/visibleoff.png | Bin 0 -> 548 bytes app/src/main/res/mipmap-mdpi/visibleon.png | Bin 0 -> 732 bytes app/src/main/res/mipmap-mdpi/welcome.jpg | Bin 0 -> 56082 bytes app/src/main/res/mipmap-xhdpi/center.png | Bin 0 -> 6052 bytes app/src/main/res/mipmap-xhdpi/ic_launcher.png | Bin 0 -> 4490 bytes .../res/mipmap-xhdpi/ic_launcher_round.png | Bin 0 -> 6895 bytes app/src/main/res/mipmap-xhdpi/search.png | Bin 0 -> 4484 bytes app/src/main/res/mipmap-xhdpi/xxqg.png | Bin 0 -> 21399 bytes .../main/res/mipmap-xxhdpi/ic_launcher.png | Bin 0 -> 6387 bytes .../res/mipmap-xxhdpi/ic_launcher_round.png | Bin 0 -> 10413 bytes .../main/res/mipmap-xxxhdpi/ic_launcher.png | Bin 0 -> 9128 bytes .../res/mipmap-xxxhdpi/ic_launcher_round.png | Bin 0 -> 15132 bytes .../main/res/navigation/mobile_navigation.xml | 25 ++ app/src/main/res/values/colors.xml | 8 + app/src/main/res/values/dimens.xml | 5 + app/src/main/res/values/strings.xml | 7 + app/src/main/res/values/styles.xml | 88 ++++ .../main/res/values/values_points_page.xml | 24 + .../main/res/xml/network_security_config.xml | 8 + .../androidtermwork/ExampleUnitTest.java | 17 + build.gradle | 31 ++ gradle.properties | 20 + gradle/wrapper/gradle-wrapper.jar | Bin 0 -> 54329 bytes gradle/wrapper/gradle-wrapper.properties | 6 + gradlew | 172 ++++++++ gradlew.bat | 84 ++++ settings.gradle | 2 + 222 files changed, 8552 insertions(+) create mode 100644 .gitignore create mode 100644 .idea/codeStyles/Project.xml create mode 100644 .idea/compiler.xml create mode 100644 .idea/dbnavigator.xml create mode 100644 .idea/deploymentTargetDropDown.xml create mode 100644 .idea/gradle.xml create mode 100644 .idea/jarRepositories.xml create mode 100644 .idea/misc.xml create mode 100644 .idea/vcs.xml create mode 100644 app/.gitignore create mode 100644 app/build.gradle create mode 100644 app/proguard-rules.pro create mode 100644 app/src/androidTest/java/com/example/androidtermwork/ExampleInstrumentedTest.java create mode 100644 app/src/main/AndroidManifest.xml create mode 100644 app/src/main/assets/images/back.png create mode 100644 app/src/main/assets/images/broad.png create mode 100644 app/src/main/assets/images/duanxin.png create mode 100644 app/src/main/assets/images/iconwhite.png create mode 100644 app/src/main/assets/images/onplay.png create mode 100644 app/src/main/assets/images/share.png create mode 100644 app/src/main/assets/images/shoucang.png create mode 100644 app/src/main/assets/index.css create mode 100644 app/src/main/assets/index.html create mode 100644 app/src/main/assets/index.js create mode 100644 app/src/main/assets/mock_data_tv_01.json create mode 100644 app/src/main/assets/mock_data_tv_02.json create mode 100644 app/src/main/assets/mock_data_tv_comments.json create mode 100644 app/src/main/assets/mock_data_tv_details.json create mode 100644 app/src/main/assets/mock_list_task.json create mode 100644 app/src/main/assets/mock_user_points.json create mode 100644 app/src/main/java/com/example/androidtermwork/Activity1.java create mode 100644 app/src/main/java/com/example/androidtermwork/Activity2.java create mode 100644 app/src/main/java/com/example/androidtermwork/Activity3.java create mode 100644 app/src/main/java/com/example/androidtermwork/Activity4.java create mode 100644 app/src/main/java/com/example/androidtermwork/Activity5.java create mode 100644 app/src/main/java/com/example/androidtermwork/AndroidToastForJs.java create mode 100644 app/src/main/java/com/example/androidtermwork/ChatActivity.java create mode 100644 app/src/main/java/com/example/androidtermwork/LoginPage.java create mode 100644 app/src/main/java/com/example/androidtermwork/LossPage.java create mode 100644 app/src/main/java/com/example/androidtermwork/MainActivity.java create mode 100644 app/src/main/java/com/example/androidtermwork/MinePage.java create mode 100644 app/src/main/java/com/example/androidtermwork/PointsPage.java create mode 100644 app/src/main/java/com/example/androidtermwork/RegisterFirstPage.java create mode 100644 app/src/main/java/com/example/androidtermwork/RegisterSecondPage.java create mode 100644 app/src/main/java/com/example/androidtermwork/RegisterThirdPage.java create mode 100644 app/src/main/java/com/example/androidtermwork/ResetPasswordPage.java create mode 100644 app/src/main/java/com/example/androidtermwork/RetrievePasswordPage.java create mode 100644 app/src/main/java/com/example/androidtermwork/TvStationPlayPage.java create mode 100644 app/src/main/java/com/example/androidtermwork/WelcomePage.java create mode 100644 app/src/main/java/com/example/androidtermwork/adpter/PointsItemAdapter.java create mode 100644 app/src/main/java/com/example/androidtermwork/adpter/TVDetailsCommentsAdapter.java create mode 100644 app/src/main/java/com/example/androidtermwork/adpter/TVStationAdapter.java create mode 100644 app/src/main/java/com/example/androidtermwork/pojo/PointSummary.java create mode 100644 app/src/main/java/com/example/androidtermwork/pojo/PointTask.java create mode 100644 app/src/main/java/com/example/androidtermwork/pojo/TVStation.java create mode 100644 app/src/main/java/com/example/androidtermwork/pojo/TvComment.java create mode 100644 app/src/main/java/com/example/androidtermwork/pojo/TvDetails.java create mode 100644 app/src/main/java/com/example/androidtermwork/ui/dashboard/DashboardFragment.java create mode 100644 app/src/main/java/com/example/androidtermwork/ui/dashboard/DashboardViewModel.java create mode 100644 app/src/main/java/com/example/androidtermwork/ui/home/HomeFragment.java create mode 100644 app/src/main/java/com/example/androidtermwork/ui/home/HomeViewModel.java create mode 100644 app/src/main/java/com/example/androidtermwork/ui/notifications/NotificationsFragment.java create mode 100644 app/src/main/java/com/example/androidtermwork/ui/notifications/NotificationsViewModel.java create mode 100644 app/src/main/java/com/example/androidtermwork/util/FormatUtil.java create mode 100644 app/src/main/java/com/example/androidtermwork/util/ResourceUtil.java create mode 100644 app/src/main/java/com/example/androidtermwork/util/StatusBarUtil.java create mode 100644 app/src/main/java/com/example/androidtermwork/util/TestUtil.java create mode 100644 app/src/main/java/com/example/androidtermwork/view/JzvdPlayer.java create mode 100644 app/src/main/java/com/example/androidtermwork/volley/BitmapCache.java create mode 100644 app/src/main/java/com/example/androidtermwork/webView.java create mode 100644 app/src/main/res/drawable-v24/avatar_border.xml create mode 100644 app/src/main/res/drawable-v24/bj.png create mode 100644 app/src/main/res/drawable-v24/button_border.xml create mode 100644 app/src/main/res/drawable-v24/edit_border.xml create mode 100644 app/src/main/res/drawable-v24/ic_launcher_foreground.xml create mode 100644 app/src/main/res/drawable-v24/layer.xml create mode 100644 app/src/main/res/drawable-v24/left_messages.9.png create mode 100644 app/src/main/res/drawable-v24/mine_border.xml create mode 100644 app/src/main/res/drawable-v24/right_messages.9.png create mode 100644 app/src/main/res/drawable-v24/shadow.png create mode 100644 app/src/main/res/drawable-v24/shan.png create mode 100644 app/src/main/res/drawable-v24/shezhiblack.png create mode 100644 app/src/main/res/drawable-v24/tis.png create mode 100644 app/src/main/res/drawable/border_comment.xml create mode 100644 app/src/main/res/drawable/feel_good.xml create mode 100644 app/src/main/res/drawable/ic_collect_star.xml create mode 100644 app/src/main/res/drawable/ic_comments.xml create mode 100644 app/src/main/res/drawable/ic_dashboard_black_24dp.xml create mode 100644 app/src/main/res/drawable/ic_feel_good.xml create mode 100644 app/src/main/res/drawable/ic_home_black_24dp.xml create mode 100644 app/src/main/res/drawable/ic_launcher_background.xml create mode 100644 app/src/main/res/drawable/ic_notifications_black_24dp.xml create mode 100644 app/src/main/res/drawable/ic_share.xml create mode 100644 app/src/main/res/drawable/listview_border.xml create mode 100644 app/src/main/res/drawable/loginbutton_border.xml create mode 100644 app/src/main/res/drawable/pagetop_border.xml create mode 100644 app/src/main/res/drawable/points_alarm_border.xml create mode 100644 app/src/main/res/drawable/points_introduction_border.xml create mode 100644 app/src/main/res/drawable/points_item_divider.xml create mode 100644 app/src/main/res/drawable/points_progressbar_bg.xml create mode 100644 app/src/main/res/drawable/regisbutton_border.xml create mode 100644 app/src/main/res/drawable/time_length_border.xml create mode 100644 app/src/main/res/drawable/toappbutton_border.xml create mode 100644 app/src/main/res/drawable/tv_play_collect_checkbox.xml create mode 100644 app/src/main/res/drawable/tv_play_collected.xml create mode 100644 app/src/main/res/drawable/tv_play_feel_good_checkbox.xml create mode 100644 app/src/main/res/drawable/tv_play_gradient_divider.xml create mode 100644 app/src/main/res/drawable/tv_play_open_details_radiobutton.xml create mode 100644 app/src/main/res/drawable/tv_play_open_information.xml create mode 100644 app/src/main/res/layout/activity_1.xml create mode 100644 app/src/main/res/layout/activity_2.xml create mode 100644 app/src/main/res/layout/activity_3.xml create mode 100644 app/src/main/res/layout/activity_4.xml create mode 100644 app/src/main/res/layout/activity_5.xml create mode 100644 app/src/main/res/layout/activity_chat.xml create mode 100644 app/src/main/res/layout/activity_login_page.xml create mode 100644 app/src/main/res/layout/activity_loss_page.xml create mode 100644 app/src/main/res/layout/activity_main.xml create mode 100644 app/src/main/res/layout/activity_mine_page.xml create mode 100644 app/src/main/res/layout/activity_points_page.xml create mode 100644 app/src/main/res/layout/activity_register_third_page.xml create mode 100644 app/src/main/res/layout/activity_reset_password_page.xml create mode 100644 app/src/main/res/layout/activity_retrieve_password_page.xml create mode 100644 app/src/main/res/layout/activity_tv_station_play.xml create mode 100644 app/src/main/res/layout/activity_web_view.xml create mode 100644 app/src/main/res/layout/activity_welcome_page.xml create mode 100644 app/src/main/res/layout/chat_list_item.xml create mode 100644 app/src/main/res/layout/fragment_dashboard.xml create mode 100644 app/src/main/res/layout/fragment_home.xml create mode 100644 app/src/main/res/layout/fragment_notifications.xml create mode 100644 app/src/main/res/layout/list_item.xml create mode 100644 app/src/main/res/layout/msg_item.xml create mode 100644 app/src/main/res/layout/news_list_item.xml create mode 100644 app/src/main/res/layout/points_page_item_sum.xml create mode 100644 app/src/main/res/layout/points_page_item_task.xml create mode 100644 app/src/main/res/layout/tv_play_comment_item.xml create mode 100644 app/src/main/res/layout/tv_play_details_item.xml create mode 100644 app/src/main/res/layout/tv_play_hint_item_nocomment.xml create mode 100644 app/src/main/res/layout/tv_station_big_item.xml create mode 100644 app/src/main/res/layout/tv_station_standard_item.xml create mode 100644 app/src/main/res/menu/bottom_nav_menu.xml create mode 100644 app/src/main/res/menu/top_menu.xml create mode 100644 app/src/main/res/mipmap-anydpi-v26/ic_launcher.xml create mode 100644 app/src/main/res/mipmap-anydpi-v26/ic_launcher_round.xml create mode 100644 app/src/main/res/mipmap-hdpi/default_head_portrait.png create mode 100644 app/src/main/res/mipmap-hdpi/ewm.png create mode 100644 app/src/main/res/mipmap-hdpi/gobackhui.png create mode 100644 app/src/main/res/mipmap-hdpi/gobackwhite.png create mode 100644 app/src/main/res/mipmap-hdpi/ic_launcher.png create mode 100644 app/src/main/res/mipmap-hdpi/ic_launcher_round.png create mode 100644 app/src/main/res/mipmap-hdpi/loading_head_portrait.png create mode 100644 app/src/main/res/mipmap-hdpi/no_comment.png create mode 100644 app/src/main/res/mipmap-hdpi/shezhi.png create mode 100644 app/src/main/res/mipmap-hdpi/shuxiang.png create mode 100644 app/src/main/res/mipmap-hdpi/tx1.png create mode 100644 app/src/main/res/mipmap-hdpi/tx2.png create mode 100644 app/src/main/res/mipmap-hdpi/user_head.jpg create mode 100644 app/src/main/res/mipmap-mdpi/appicon.png create mode 100644 app/src/main/res/mipmap-mdpi/avatar.png create mode 100644 app/src/main/res/mipmap-mdpi/bg.jpg create mode 100644 app/src/main/res/mipmap-mdpi/broadcast.png create mode 100644 app/src/main/res/mipmap-mdpi/clear.png create mode 100644 app/src/main/res/mipmap-mdpi/dialogmsg.png create mode 100644 app/src/main/res/mipmap-mdpi/go_back_dark.png create mode 100644 app/src/main/res/mipmap-mdpi/goback.png create mode 100644 app/src/main/res/mipmap-mdpi/hornred.png create mode 100644 app/src/main/res/mipmap-mdpi/ic_bright_star0.png create mode 100644 app/src/main/res/mipmap-mdpi/ic_bright_star1.png create mode 100644 app/src/main/res/mipmap-mdpi/ic_bright_star10.png create mode 100644 app/src/main/res/mipmap-mdpi/ic_bright_star2.png create mode 100644 app/src/main/res/mipmap-mdpi/ic_bright_star3.png create mode 100644 app/src/main/res/mipmap-mdpi/ic_bright_star4.png create mode 100644 app/src/main/res/mipmap-mdpi/ic_bright_star5.png create mode 100644 app/src/main/res/mipmap-mdpi/ic_bright_star6.png create mode 100644 app/src/main/res/mipmap-mdpi/ic_bright_star7.png create mode 100644 app/src/main/res/mipmap-mdpi/ic_bright_star8.png create mode 100644 app/src/main/res/mipmap-mdpi/ic_bright_star9.png create mode 100644 app/src/main/res/mipmap-mdpi/ic_launcher.png create mode 100644 app/src/main/res/mipmap-mdpi/ic_launcher_round.png create mode 100644 app/src/main/res/mipmap-mdpi/ic_play_tv.png create mode 100644 app/src/main/res/mipmap-mdpi/ic_right.png create mode 100644 app/src/main/res/mipmap-mdpi/ic_speaker.png create mode 100644 app/src/main/res/mipmap-mdpi/icon.png create mode 100644 app/src/main/res/mipmap-mdpi/iconcir.png create mode 100644 app/src/main/res/mipmap-mdpi/iconcirred.png create mode 100644 app/src/main/res/mipmap-mdpi/iconlarge.png create mode 100644 app/src/main/res/mipmap-mdpi/iconwhite.png create mode 100644 app/src/main/res/mipmap-mdpi/img_fail_to_load.png create mode 100644 app/src/main/res/mipmap-mdpi/img_loading.png create mode 100644 app/src/main/res/mipmap-mdpi/locking.png create mode 100644 app/src/main/res/mipmap-mdpi/message.png create mode 100644 app/src/main/res/mipmap-mdpi/password.png create mode 100644 app/src/main/res/mipmap-mdpi/right_arrow.png create mode 100644 app/src/main/res/mipmap-mdpi/search.png create mode 100644 app/src/main/res/mipmap-mdpi/username.png create mode 100644 app/src/main/res/mipmap-mdpi/visibleoff.png create mode 100644 app/src/main/res/mipmap-mdpi/visibleon.png create mode 100644 app/src/main/res/mipmap-mdpi/welcome.jpg create mode 100644 app/src/main/res/mipmap-xhdpi/center.png create mode 100644 app/src/main/res/mipmap-xhdpi/ic_launcher.png create mode 100644 app/src/main/res/mipmap-xhdpi/ic_launcher_round.png create mode 100644 app/src/main/res/mipmap-xhdpi/search.png create mode 100644 app/src/main/res/mipmap-xhdpi/xxqg.png create mode 100644 app/src/main/res/mipmap-xxhdpi/ic_launcher.png create mode 100644 app/src/main/res/mipmap-xxhdpi/ic_launcher_round.png create mode 100644 app/src/main/res/mipmap-xxxhdpi/ic_launcher.png create mode 100644 app/src/main/res/mipmap-xxxhdpi/ic_launcher_round.png create mode 100644 app/src/main/res/navigation/mobile_navigation.xml create mode 100644 app/src/main/res/values/colors.xml create mode 100644 app/src/main/res/values/dimens.xml create mode 100644 app/src/main/res/values/strings.xml create mode 100644 app/src/main/res/values/styles.xml create mode 100644 app/src/main/res/values/values_points_page.xml create mode 100644 app/src/main/res/xml/network_security_config.xml create mode 100644 app/src/test/java/com/example/androidtermwork/ExampleUnitTest.java create mode 100644 build.gradle create mode 100644 gradle.properties create mode 100644 gradle/wrapper/gradle-wrapper.jar create mode 100644 gradle/wrapper/gradle-wrapper.properties create mode 100644 gradlew create mode 100644 gradlew.bat create mode 100644 settings.gradle diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..a8f8666 --- /dev/null +++ b/.gitignore @@ -0,0 +1,15 @@ +*.iml +.gradle +/local.properties +/.idea/caches +/.idea/libraries +/.idea/modules.xml +/.idea/workspace.xml +/.idea/navEditor.xml +/.idea/assetWizardSettings.xml +.DS_Store +/build +/captures +.externalNativeBuild +.cxx +/.idea/shelf/ diff --git a/.idea/codeStyles/Project.xml b/.idea/codeStyles/Project.xml new file mode 100644 index 0000000..681f41a --- /dev/null +++ b/.idea/codeStyles/Project.xml @@ -0,0 +1,116 @@ + + + + + + + +
+ + + + xmlns:android + + ^$ + + + +
+
+ + + + xmlns:.* + + ^$ + + + BY_NAME + +
+
+ + + + .*:id + + http://schemas.android.com/apk/res/android + + + +
+
+ + + + .*:name + + http://schemas.android.com/apk/res/android + + + +
+
+ + + + name + + ^$ + + + +
+
+ + + + style + + ^$ + + + +
+
+ + + + .* + + ^$ + + + BY_NAME + +
+
+ + + + .* + + http://schemas.android.com/apk/res/android + + + ANDROID_ATTRIBUTE_ORDER + +
+
+ + + + .* + + .* + + + BY_NAME + +
+
+
+
+
+
\ No newline at end of file diff --git a/.idea/compiler.xml b/.idea/compiler.xml new file mode 100644 index 0000000..fb7f4a8 --- /dev/null +++ b/.idea/compiler.xml @@ -0,0 +1,6 @@ + + + + + + \ No newline at end of file diff --git a/.idea/dbnavigator.xml b/.idea/dbnavigator.xml new file mode 100644 index 0000000..70f212e --- /dev/null +++ b/.idea/dbnavigator.xml @@ -0,0 +1,414 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/.idea/deploymentTargetDropDown.xml b/.idea/deploymentTargetDropDown.xml new file mode 100644 index 0000000..346f741 --- /dev/null +++ b/.idea/deploymentTargetDropDown.xml @@ -0,0 +1,17 @@ + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/.idea/gradle.xml b/.idea/gradle.xml new file mode 100644 index 0000000..6e5389e --- /dev/null +++ b/.idea/gradle.xml @@ -0,0 +1,20 @@ + + + + + + + \ No newline at end of file diff --git a/.idea/jarRepositories.xml b/.idea/jarRepositories.xml new file mode 100644 index 0000000..4e875f3 --- /dev/null +++ b/.idea/jarRepositories.xml @@ -0,0 +1,85 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/.idea/misc.xml b/.idea/misc.xml new file mode 100644 index 0000000..113ceb4 --- /dev/null +++ b/.idea/misc.xml @@ -0,0 +1,18 @@ + + + + + + + + + + + \ No newline at end of file diff --git a/.idea/vcs.xml b/.idea/vcs.xml new file mode 100644 index 0000000..35eb1dd --- /dev/null +++ b/.idea/vcs.xml @@ -0,0 +1,6 @@ + + + + + + \ No newline at end of file diff --git a/app/.gitignore b/app/.gitignore new file mode 100644 index 0000000..796b96d --- /dev/null +++ b/app/.gitignore @@ -0,0 +1 @@ +/build diff --git a/app/build.gradle b/app/build.gradle new file mode 100644 index 0000000..cbc0067 --- /dev/null +++ b/app/build.gradle @@ -0,0 +1,48 @@ +apply plugin: 'com.android.application' + +android { + compileSdkVersion 31 + buildToolsVersion "31.0.0" + defaultConfig { + applicationId "com.example.androidtermwork" + minSdkVersion 21 + targetSdkVersion 31 + versionCode 1 + versionName "1.0" + testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner" + vectorDrawables.useSupportLibrary = true + } + buildTypes { + release { + minifyEnabled false + proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-rules.pro' + } + } + compileOptions { + sourceCompatibility JavaVersion.VERSION_1_8 + targetCompatibility JavaVersion.VERSION_1_8 + } +} + +dependencies { + implementation fileTree(dir: 'libs', include: ['*.jar']) + implementation 'androidx.appcompat:appcompat:1.0.2' + implementation 'androidx.constraintlayout:constraintlayout:1.1.3' + implementation 'com.google.android.material:material:1.0.0' + implementation 'androidx.vectordrawable:vectordrawable:1.0.1' + implementation 'androidx.navigation:navigation-fragment:2.3.5' + implementation 'androidx.navigation:navigation-ui:2.3.5' + implementation 'androidx.lifecycle:lifecycle-extensions:2.0.0' + testImplementation 'junit:junit:4.12' + androidTestImplementation 'androidx.test:runner:1.1.1' + androidTestImplementation 'androidx.test.espresso:espresso-core:3.1.1' + implementation group: 'com.google.code.gson', name: 'gson', version: '2.8.5' + + implementation 'com.android.volley:volley:1.1.1' + implementation 'com.scwang.smart:refresh-layout-kernel:2.0.1' //核心必须依赖 + implementation 'com.scwang.smart:refresh-header-classics:2.0.1' //经典刷新头 + implementation 'com.scwang.smart:refresh-footer-classics:2.0.1' //经典加载 + + implementation 'cn.jzvd:jiaozivideoplayer:7.7.0' + implementation 'de.hdodenhof:circleimageview:3.1.0' +} diff --git a/app/proguard-rules.pro b/app/proguard-rules.pro new file mode 100644 index 0000000..f1b4245 --- /dev/null +++ b/app/proguard-rules.pro @@ -0,0 +1,21 @@ +# Add project specific ProGuard rules here. +# You can control the set of applied configuration files using the +# proguardFiles setting in build.gradle. +# +# For more details, see +# http://developer.android.com/guide/developing/tools/proguard.html + +# If your project uses WebView with JS, uncomment the following +# and specify the fully qualified class name to the JavaScript interface +# class: +#-keepclassmembers class fqcn.of.javascript.interface.for.webview { +# public *; +#} + +# Uncomment this to preserve the line number information for +# debugging stack traces. +#-keepattributes SourceFile,LineNumberTable + +# If you keep the line number information, uncomment this to +# hide the original source file name. +#-renamesourcefileattribute SourceFile diff --git a/app/src/androidTest/java/com/example/androidtermwork/ExampleInstrumentedTest.java b/app/src/androidTest/java/com/example/androidtermwork/ExampleInstrumentedTest.java new file mode 100644 index 0000000..dd8fa44 --- /dev/null +++ b/app/src/androidTest/java/com/example/androidtermwork/ExampleInstrumentedTest.java @@ -0,0 +1,27 @@ +package com.example.androidtermwork; + +import android.content.Context; + +import androidx.test.platform.app.InstrumentationRegistry; +import androidx.test.ext.junit.runners.AndroidJUnit4; + +import org.junit.Test; +import org.junit.runner.RunWith; + +import static org.junit.Assert.*; + +/** + * Instrumented test, which will execute on an Android device. + * + * @see Testing documentation + */ +@RunWith(AndroidJUnit4.class) +public class ExampleInstrumentedTest { + @Test + public void useAppContext() { + // Context of the app under test. + Context appContext = InstrumentationRegistry.getInstrumentation().getTargetContext(); + + assertEquals("com.example.androidtermwork", appContext.getPackageName()); + } +} diff --git a/app/src/main/AndroidManifest.xml b/app/src/main/AndroidManifest.xml new file mode 100644 index 0000000..b0dd3f0 --- /dev/null +++ b/app/src/main/AndroidManifest.xml @@ -0,0 +1,61 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/app/src/main/assets/images/back.png b/app/src/main/assets/images/back.png new file mode 100644 index 0000000000000000000000000000000000000000..ec69d51dc97d5b87fd39d973ccbcda1dea37d7e3 GIT binary patch literal 238 zcmV}F6ay_z;qNGM$45%Pn<%da2k!k64VRJP!B9ct*{)mz)jE^`~Y5` zP#8VoV2RG!JKj%R=BK5gbxjQ}b(-K7xCw5B<+uly;$B#WM_>sah0}NjPT^U2$8Se| oeZE7g%P-TKl0WMdtv(mL0WgL(A5Tj{@&Et;07*qoM6N<$g7NWTzyJUM literal 0 HcmV?d00001 diff --git a/app/src/main/assets/images/broad.png b/app/src/main/assets/images/broad.png new file mode 100644 index 0000000000000000000000000000000000000000..6c11f616056aa82e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sVYeo{MLo0O6>#>^3keI=q3zB`8*V?ToKL;?{)ye6WHz96?5WA}rC zaL#oA!e`qt4CB%;5YG8u083swfYZ9JzmF5-Aram5I&>W8nrWKPhJdUAc>o0j%=uEO^lMx{LWoC1bYtA}BhK~yjb8^)i@}-eVr-ZgA>6nxQLELK+wHbn zmB??b0IU$vm3}coVZ0Dh%8x{}Jxw7U$JvVQeF*1#3&8a-7(axjY3C+s$6>&+fw%#} zV3LAxW5)_I3MNU2L_mUI+$AvBPVP*^)lS|vi(Qd{b6=bFzD^1vF-3x4l7vVcq~B&1 z5fwB|TaRNq&17p$^II_O-Na^O+QcTkpMp$Uv82!c15(4{<_H}-lmGw#07*qoM6N<$ Ef@{xaaR2}S literal 0 HcmV?d00001 diff --git a/app/src/main/assets/images/iconwhite.png b/app/src/main/assets/images/iconwhite.png new file mode 100644 index 0000000000000000000000000000000000000000..56302e6c83dd0e3eb5b738167ae1690558a75ce7 GIT binary patch literal 2848 zcmV+*3*YpKP)Px#1ZP1_K>z@;j|==^1poj532;bRa{vGi!vFvd!vV){sAK>D3bjc@K~!i%?U@O* zRZ|#%doK+VO-L!Fkf|sY5lN{GQCVgRC6p){unbGGG_fK>hNPvavzwP}?z`{Z9$KyV*ZS7K&%WpEv-iLM{qKLDTkP*hZf} zpc;(hT_eHkog!&_5*^N97VDtz;IgN6baXXpV`!kJFa{o>ZZNt?UdnT2^ceJ0TuLK& zAuQ`f2ft0CYF> z%l!N}=ta-K&9pTceI#sxNw5ue9iiiOU?kLK0Oip~K|Od8M!^2w$8UPtH?RdXRD$q( zN$MLwXP5*lzzC81-LU?Y5_A%ybTFb{r% z3#ropXToMMkSBR4^?Sp+@GH!MVW7O_{X*GYvNXgDLD`8}03X9XVfC&fbgFjP`Dvh` zI>J*h7xV%R^%~TG&mjw{hmR)-zqzc+p-n>14e!4>{H-oDhQNCw;aX#QU*oW9r%TG+ zjlmR$A1Iy=9f%9Yi_OcF=rFyZItIyZV2~qErq5740;f%8#H4loXK@(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zgnh?K=<)2V|j!1250do7o5TQ z$MjU;m%G_Z@EN?Vn_QhJ{tw>KWp=aYO1EWyF7Nr=z>_k+LHkdA0rB>L$%SnzHxb{1Lx1y55j*RVR)ZnS6V%&$OsoVOPAnqb&L1ri=J2lI_j~Asl7W^}+!MF34>J>>85Uqk3Tk62zK`ksF-%Af7*<;E zCn~CrcWgByfNN5beXDO{x#Fq@R@K`75BvksE`A>yGU`tN0000< KMNUMnLSTZV%{g)a literal 0 HcmV?d00001 diff --git a/app/src/main/assets/index.css b/app/src/main/assets/index.css new file mode 100644 index 0000000..669aeb0 --- /dev/null +++ b/app/src/main/assets/index.css @@ -0,0 +1,129 @@ +body { + background-color: rgb(250, 251, 253); + padding: 0 10px; +} + +.top { + width: 90%; + height: 90px; + display: flex; + justify-content: space-between; + border-bottom: 2px solid rgb(213, 215, 216); + position: fixed; + top: -2px; + background-color: rgb(250, 251, 253); +} + +.top img { + height: 30px; + width: 30px; + margin-top: 10px; +} + +.top>div { + display: flex; + flex-direction: column; +} + +.top .topIcon { + background-color: rgb(228, 36, 23); + height: fit-content; + width: fit-content; + padding: 10px 20px; +} + +#time { + font-size: 9px; + color: rgb(116, 116, 117); + margin-top: 5px; +} + +.container { + margin-top: 100px; + margin-bottom: 100px; +} + +#resource { + font-size: 8px; + color: rgb(116, 116, 117); + margin-top: 5px; +} + +#title { + margin-top: 15px; +} + +#title2 { + margin-top: 10px; +} + +#article { + margin-top: 10px; + font-size: 16px; + line-height: 1.5em; + text-indent: 2em; +} + +#editor { + margin-top: 10px; + font-size: 13px; + float: right; +} + +.bottom { + width: 90%; + height: 40px; + display: flex; + justify-content: space-between; + align-items: center; + border-top: 1px solid rgb(213, 215, 216); + position: fixed; + bottom: -2px; + background-color: rgb(250, 251, 253); +} + +#input { + padding: 2px 8px; + font-size: 10px; + background-color: rgb(212, 211, 211); + width: 200px; + height: 20px; + border: rgb(212, 211, 211); + border-radius: 2px; +} + +.bottom img { + height: 20px; + width: 20px; +} + +.player { + position: fixed; + bottom: 120px; + display: flex; + align-items: center; + justify-content: space-around; + border: 1px solid rgb(212, 211, 211); + background-color: rgb(241, 243, 244); + border-radius: 5px; +} + +.player img { + margin-left: 5px; + height: 20px; + width: 20px; +} + +#zhankai { + position: fixed; + bottom: 131px; + left: 0px; + margin-left: 5px; + height: 20px; + width: 20px; +} + +#audio { + width: 230px; + height: 40px; +} \ No newline at end of file diff --git a/app/src/main/assets/index.html b/app/src/main/assets/index.html new file mode 100644 index 0000000..c0d5533 --- /dev/null +++ b/app/src/main/assets/index.html @@ -0,0 +1,42 @@ + + + + + + + demo + + + + +
+ +
+ +
+
+ +
+ +
+

+
+

+
+
+
+ +
+ + + + +
+ +
+ + + + + \ No newline at end of file diff --git a/app/src/main/assets/index.js b/app/src/main/assets/index.js new file mode 100644 index 0000000..625741f --- /dev/null +++ b/app/src/main/assets/index.js @@ -0,0 +1,94 @@ +// var result = JavaScriptInterface.jsontohtml(); +// var obj = eval("(" + result + ")"); //解析json字符串 +// function showAndroidToast(toast) { +// JavaScriptInterface.showToast(toast); +// } +var title = document.getElementById('title'); +var title2 = document.getElementById('title2'); +var time = document.getElementById('time'); +var resource = document.getElementById('resource'); +var article = document.getElementById('article'); +var editor = document.getElementById('editor'); +var player = document.getElementById('player'); +getjsonData(); + +function getjsonData() { +// var result = JavaScriptInterface.jsontohtml(); +// var obj = eval("("+result+")");//解析json字符串 + var news = { + title: '中国共产党第十九届中央委员会第六次全体会议公报', + title2: '中国共产党第十九届中央委员会第六次全体会议公报(2021年11月11日中国共产党第十九届中央委员会第六次全体会议通过)', + time: '2021 年 11 月 12 日', + resource: '“学习强国”学习平台', + article: '中国共产党第十九届中央委员会第六次全体会议,于2021年11月8日至11日在北京举行。\n' + + '出席这次全会的有,中央委员197人,候补中央委员151人。中央纪律检查委员会常务委员会委员和有关方面负责同志列席会议。\n' + + '全会由中央政治局主持。中央委员会总书记习近平作了重要讲话。\n' + + '全会听取和讨论了习近平受中央政治局委托作的工作报告,审议通过了《中共中央关于党的百年奋斗重大成就和历史经验的决议》,审议通过了《关于召开党的第二十次全国代表大会的决议》。习近平就《中共中央关于党的百年奋斗重大成就和历史经验的决议(讨论稿)》向全会作了说明。\n' + + '全会认为,总结党的百年奋斗重大成就和历史经验,是在建党百年历史条件下开启全面建设社会主义现代化国家新征程、在新时代坚持和发展中国特色社会主义的需要;是增强政治意识、大局意识、核心意识、看齐意识,坚定道路自信、理论自信、制度自信、文化自信,做到坚决维护习近平同志党中央的核心、全党的核心地位,坚决维护党中央权威和集中统一领导,确保全党步调一致向前进的需要;是推进党的自我革命、提高全党斗争本领和应对风险挑战能力、永葆党的生机活力、团结带领全国各族人民为实现中华民族伟大复兴的中国梦而继续奋斗的需要。全党要坚持唯物史观和正确党史观,从党的百年奋斗中看清楚过去我们为什么能够成功、弄明白未来我们怎样才能继续成功,从而更加坚定、更加自觉地践行初心使命,在新时代更好坚持和发展中国特色社会主义。', + editor: '秦辰宇', + } + showData(news); +} + +function showData(news) { + console.log(news) + title.innerHTML = news.title; + title2.innerHTML = news.title2; + time.innerHTML = news.time; + resource.innerHTML = `来源:${news.resource}`; + //按照换行符分隔成数组 + const tempArr = news.article.split(/[(\r\n)\r\n]+/); + //删除空项 + tempArr.forEach((item, index) => { + if (!item) { + snsArr.splice(index, 1); + } + }); + //循环添加单个段落 + tempArr.forEach((item, index) => { + var p = document.createElement('div'); + console.log(item) + p.id = `p${index}`; + p.innerText = item; + article.appendChild(p); + }); + editor.innerHTML = `责任编辑:${news.editor}`; +} + +function changeBroadIcon(flag) { + if (flag) { + var play = document.getElementById('play'); + play.src = './images/onplay.png'; + play.onclick = () => { + stop(); + } + } else { + var play = document.getElementById('play'); + play.src = './images/broad.png'; + play.onclick = () => { + fun(); + } + } +} + +function fun() { + const values = title.innerText + title2.innerText + time.innerText + article.innerText + editor.innerText; + console.log(values); + var url = "http://tts.baidu.com/text2audio?lan=zh&ie=UTF-8&text=" + encodeURI(values); + var div = document.createElement('div'); + div.innerHTML = `` + player.appendChild(div); + var audio = document.getElementById('audio'); + audio.play(); + changeBroadIcon(true); +} + +function stop() { + var audio = document.getElementById('audio'); + //停止音频 + audio.currentTime = 0; + audio.pause(); + //删除dom + player.removeChild(player.children[0]); + changeBroadIcon(false); +} \ No newline at end of file diff --git a/app/src/main/assets/mock_data_tv_01.json b/app/src/main/assets/mock_data_tv_01.json new file mode 100644 index 0000000..32c00d0 --- /dev/null +++ b/app/src/main/assets/mock_data_tv_01.json @@ -0,0 +1,62 @@ +[ + { + "id": 1, + "videoSource": "http://asdasdqqw.6655.la/video/0.mp4", + "cover": "http://asdasdqqw.6655.la/img/0.jpg", + "title": "我们的背后,就是祖国", + "timeLength": 171, + "itemType": 0, + "author": "人民日报", + "date": "2021-10-25" + }, + { + "id": 2, + "videoSource": "http://asdasdqqw.6655.la/video/1.mp4", + "cover": "http://asdasdqqw.6655.la/img/1.jpg", + "title": "\u3010\u65b0\u95fb\u8054\u64ad\u3011\u78cb\u5546\u4e25\u91cd\u53d7\u632b \u8d23\u4efb\u5b8c\u5168\u5728\u7f8e\u65b9", + "timeLength": 33, + "itemType": 1, + "author": "\u4e2d\u592e\u7535\u89c6\u53f0", + "date": "2021-10-27" + }, + { + "id": 3, + "videoSource": "http://asdasdqqw.6655.la/video/2.mp4", + "cover": "http://asdasdqqw.6655.la/img/2.jpg", + "title": "\u3010\u65b0\u95fb\u8054\u64ad\u3011\u4e60\u8fd1\u5e73\u5bf9\u65b0\u578b\u51a0\u72b6\u75c5\u6bd2\u611f\u67d3\u7684\u80ba\u708e\u75ab\u60c5\u4f5c\u51fa\u91cd\u8981\u6307\u793a", + "timeLength": 33, + "itemType": 0, + "author": "\u4e2d\u592e\u7535\u89c6\u53f0", + "date": "2021-10-27" + }, + { + "id": 4, + "videoSource": "http://asdasdqqw.6655.la/video/3.mp4", + "cover": "http://asdasdqqw.6655.la/img/3.jpg", + "title": "\u3010\u65b0\u95fb\u8054\u64ad5\u8054\u5f39\u3011\u4e2d\u56fd\u7ecf\u6d4e\u7684\u5e95\u6c14\u4ece\u4f55\u800c\u6765\uff1f\u5173\u7a0e\u5927\u68d2\u635f\u4eba\u5bb3\u5df1\uff01\u7f8e\u65b9\u5728\u8c08\u5224\u4e2d\u4e0d\u8bb2\u89c4\u5219\u86ee\u6a2a\u65e0\u7406", + "timeLength": 33, + "itemType": 0, + "author": "\u4e2d\u592e\u7535\u89c6\u53f0", + "date": "2021-10-27" + }, + { + "id": 5, + "videoSource": "http://asdasdqqw.6655.la/video/4.mp4", + "cover": "http://asdasdqqw.6655.la/img/4.jpg", + "title": "\u65b0\u95fb\u8054\u64ad\uff1a\u541b\u5b50\u4e4b\u56fd \u5148\u793c\u540e\u5175", + "timeLength": 33, + "itemType": 0, + "author": "\u4e2d\u592e\u7535\u89c6\u53f0", + "date": "2021-10-27" + }, + { + "id": 6, + "videoSource": "http://asdasdqqw.6655.la/video/5.mp4", + "cover": "http://asdasdqqw.6655.la/img/5.jpg", + "title": "\u65b0\u95fb\u8054\u64ad\uff1a\u4e2d\u529e \u56fd\u529e\u5370\u53d1\u300a\u5173\u4e8e\u8fdb\u4e00\u6b65\u51cf\u8f7b\u4e49\u52a1\u6559\u80b2\u9636\u6bb5\u5b66\u751f\u4f5c\u4e1a\u8d1f\u62c5\u548c\u6821\u5916\u57f9\u8bad\u8d1f\u62c5\u7684\u610f\u89c1\u300b", + "timeLength": 33, + "itemType": 1, + "author": "\u4e2d\u592e\u7535\u89c6\u53f0", + "date": "2021-10-27" + } +] \ No newline at end of file diff --git a/app/src/main/assets/mock_data_tv_02.json b/app/src/main/assets/mock_data_tv_02.json new file mode 100644 index 0000000..e70ce12 --- /dev/null +++ b/app/src/main/assets/mock_data_tv_02.json @@ -0,0 +1,52 @@ +[ + { + "id": "7", + "videoSource": "http://asdasdqqw.6655.la/video/10.mp4", + "cover": "http://asdasdqqw.6655.la/img/10.jpg", + "title": "\u4e2d\u5171\u4e2d\u592e\u5173\u4e8e\u5236\u5b9a\u56fd\u6c11\u7ecf\u6d4e\u548c\u793e\u4f1a\u53d1\u5c55\u7b2c\u5341\u56db\u4e2a\u4e94\u5e74\u89c4\u5212\u548c\u4e8c\u3007\u4e09\u4e94\u5e74\u8fdc\u666f\u76ee\u6807\u7684\u5efa\u8bae", + "timeLength": 33, + "itemType": 1, + "author": "\u592e\u89c6\u65b0\u95fb", + "date": "2021-10-30" + }, + { + "id": "8", + "videoSource": "http://asdasdqqw.6655.la/video/6.mp4", + "cover": "http://asdasdqqw.6655.la/img/6.jpg", + "title": "\u3010\u65b0\u95fb\u8054\u64ad\u3011\u5341\u4e8c\u8fde\u53d1\uff01\u6279\u7f8e\u56fd\u63d2\u624b\u9999\u6e2f\u4e8b\u52a1", + "timeLength": 33, + "itemType": 1, + "author": "\u592e\u89c6\u65b0\u95fb", + "date": "2021-10-30" + }, + { + "id": "9", + "videoSource": "http://asdasdqqw.6655.la/video/7.mp4", + "cover": "http://asdasdqqw.6655.la/img/7.jpg", + "title": "\u3010\u65b0\u95fb\u8054\u64ad\u3011\u4ed6\u56fd\u9a9a\u4e71\u662f\u201c\u7f8e\u4e3d\u7684\u98ce\u666f\u7ebf\u201d\uff1f\u865a\u4f2a\u53cc\u6807 \u4ee4\u4eba\u4f5c\u5455\uff01", + "timeLength": 33, + "itemType": 0, + "author": "\u592e\u89c6\u65b0\u95fb", + "date": "2021-10-30" + }, + { + "id": "10", + "videoSource": "http://asdasdqqw.6655.la/video/8.mp4", + "cover": "http://asdasdqqw.6655.la/img/8.jpg", + "title": "\u65b0\u95fb\u8054\u64ad\uff1a\u7f8e\u56fd\u6ee1\u5634\u8dd1\u706b\u8f66\uff0c\u6028\u5987\u5fc3\u6001\uff01", + "timeLength": 33, + "itemType": 1, + "author": "\u592e\u89c6\u65b0\u95fb", + "date": "2021-10-30" + }, + { + "id": "11", + "videoSource": "http://asdasdqqw.6655.la/video/9.mp4", + "cover": "http://asdasdqqw.6655.la/img/9.jpg", + "title": "\u3010\u65b0\u95fb\u8054\u64ad\u3011\u534e\u4e3a\u7edd\u5730\u53cd\u51fb \u4e2d\u56fd\u5c45\u5b89\u601d\u5371", + "timeLength": 33, + "itemType": 0, + "author": "\u592e\u89c6\u65b0\u95fb", + "date": "2021-10-30" + } +] \ No newline at end of file diff --git a/app/src/main/assets/mock_data_tv_comments.json b/app/src/main/assets/mock_data_tv_comments.json new file mode 100644 index 0000000..521406b --- /dev/null +++ b/app/src/main/assets/mock_data_tv_comments.json @@ -0,0 +1,42 @@ +[ + { + "userId": 342284102, + "userName": "头像我女神438", + "feelGoodCounts": 16592, + "isFeelGood": false, + "commentDate": "2021-10-25", + "commentContent": "197653,不是冰冷的数字,是鲜活的生命和滚烫的热血。" + }, + { + "userId": 268085226, + "userName": "努力_上岸", + "feelGoodCounts": 10599, + "isFeelGood": false, + "commentDate": "2021-10-25", + "commentContent": "我工作就要去基层了 我会用自己的方式去为群众服务" + }, + { + "userId": 138408320, + "userName": "懿维我祖", + "feelGoodCounts": 9599, + "isFeelGood": false, + "commentDate": "2021-10-25", + "commentContent": "我希望大家把197653喊成197654 多那个1,代表所有未被统计的英烈!不知牺牲在战俘营里的英烈在不在统计范围" + }, + { + "userId": 987423234, + "userName": "杜甫几句堆积思思", + "feelGoodCounts": 7642, + "isFeelGood": false, + "commentDate": "2021-10-25", + "commentContent": "我外公打过抗美援朝,参加过上甘岭和三八线" + }, + { + "userId": 887635213, + "userName": "安丘一中学生会", + "feelGoodCounts": 5557, + "isFeelGood": false, + "commentDate": "2021-10-25", + "commentContent": "\"什么叫祖国,当我们跨过鸭绿江,看到战火的时候,我后边就是祖国\"" + } +] \ No newline at end of file diff --git a/app/src/main/assets/mock_data_tv_details.json b/app/src/main/assets/mock_data_tv_details.json new file mode 100644 index 0000000..afb2134 --- /dev/null +++ b/app/src/main/assets/mock_data_tv_details.json @@ -0,0 +1,8 @@ +{ + "playCounts": 1089906, + "feelGoodCounts": 82615, + "introduction": "“黄继光”“杨根思”“到!到!到!”……这一声声“到”,跨越71年。纪念中国人民志愿军抗美援朝出国作战71周年,致敬每一位最可爱的人。山河无恙,如您所愿!", + "isFeelGood": false, + "moreInfo": "责任编辑:...\n校对:...", + "isCollect": false +} \ No newline at end of file diff --git a/app/src/main/assets/mock_list_task.json b/app/src/main/assets/mock_list_task.json new file mode 100644 index 0000000..6a9284f --- /dev/null +++ b/app/src/main/assets/mock_list_task.json @@ -0,0 +1,37 @@ +[ + { + "name": "登录", + "description": "1分/每日首次登录", + "todayPoints": 1, + "pointsLimit": 1, + "goAction": "def" + }, + { + "name": "我要选读文章", + "description": "1分/每有效阅读/播报一篇,上限6分\n1分/有效阅读或播报文章累计1分钟,上限6分", + "todayPoints": 11, + "pointsLimit": 12, + "goAction": "res_article" + }, + { + "name": "视听学习", + "description": "1分/每有效收听/观看一个", + "todayPoints": 4, + "pointsLimit": 6, + "goAction": "res_tv" + }, + { + "name": "每日答题", + "description": "每组答题每答对1道积1分", + "todayPoints": 1, + "pointsLimit": 6, + "goAction": "new_dailyQ" + }, + { + "name": "每周答题", + "description": "每组答题每答对1道积1分,同组答题不重复积分", + "todayPoints": 6, + "pointsLimit": 6, + "goAction": "new_weeklyQ" + } +] \ No newline at end of file diff --git a/app/src/main/assets/mock_user_points.json b/app/src/main/assets/mock_user_points.json new file mode 100644 index 0000000..7698f69 --- /dev/null +++ b/app/src/main/assets/mock_user_points.json @@ -0,0 +1,5 @@ +{ + "points": 9000, + "dan": 9, + "pointsToday": 20 +} diff --git a/app/src/main/java/com/example/androidtermwork/Activity1.java b/app/src/main/java/com/example/androidtermwork/Activity1.java new file mode 100644 index 0000000..a4cf709 --- /dev/null +++ b/app/src/main/java/com/example/androidtermwork/Activity1.java @@ -0,0 +1,39 @@ +package com.example.androidtermwork; + +import androidx.annotation.RequiresApi; +import androidx.appcompat.app.AppCompatActivity; + +import android.content.Intent; +import android.os.Build; +import android.os.Bundle; +import android.text.Html; +import android.view.View; +import android.widget.TextView; + +import com.example.androidtermwork.util.StatusBarUtil; + +public class Activity1 extends AppCompatActivity { + + @RequiresApi(api = Build.VERSION_CODES.M) + @Override + protected void onCreate(Bundle savedInstanceState) { + super.onCreate(savedInstanceState); + setContentView(R.layout.activity_1); + StatusBarUtil.setAndroidNativeLightStatusBar(this, true); + TextView tv=(TextView)findViewById(R.id.text3); + String str="来源:《中国共产党简史》(人民出版社、中国共产党史出版社2021年版)"; + tv.setTextSize(16); + tv.setText(Html.fromHtml(str)); + } + public void ts(View view){ + Intent intent = new Intent(); + intent.setClass(Activity1.this,Activity2.class); + startActivity(intent); + } + public void next(View view){ + Intent intent = new Intent(); + intent.setClass(Activity1.this,Activity3.class); + startActivity(intent); + finish(); + } +} \ No newline at end of file diff --git a/app/src/main/java/com/example/androidtermwork/Activity2.java b/app/src/main/java/com/example/androidtermwork/Activity2.java new file mode 100644 index 0000000..6a91e7b --- /dev/null +++ b/app/src/main/java/com/example/androidtermwork/Activity2.java @@ -0,0 +1,25 @@ +package com.example.androidtermwork; + +import androidx.annotation.RequiresApi; +import androidx.appcompat.app.AppCompatActivity; + +import android.os.Build; +import android.os.Bundle; +import android.text.Html; +import android.widget.TextView; + +import com.example.androidtermwork.util.StatusBarUtil; + +public class Activity2 extends AppCompatActivity { + + @RequiresApi(api = Build.VERSION_CODES.M) + @Override + protected void onCreate(Bundle savedInstanceState) { + super.onCreate(savedInstanceState); + setContentView(R.layout.activity_2); + StatusBarUtil.setAndroidNativeLightStatusBar(this, true); + TextView da =(TextView) findViewById(R.id.daan); + String str2="中华苏维埃第一次全国代表大会于1931年11月在江西瑞金召开,中华苏维埃共和国临时中央政府宣布成立。"; + da.setText(Html.fromHtml(str2)); + } +} \ No newline at end of file diff --git a/app/src/main/java/com/example/androidtermwork/Activity3.java b/app/src/main/java/com/example/androidtermwork/Activity3.java new file mode 100644 index 0000000..9b2794a --- /dev/null +++ b/app/src/main/java/com/example/androidtermwork/Activity3.java @@ -0,0 +1,34 @@ +package com.example.androidtermwork; + +import androidx.annotation.RequiresApi; +import androidx.appcompat.app.AppCompatActivity; + +import android.content.Intent; +import android.os.Build; +import android.os.Bundle; +import android.text.Html; +import android.view.View; +import android.widget.TextView; + +import com.example.androidtermwork.util.StatusBarUtil; + +public class Activity3 extends AppCompatActivity { + + @RequiresApi(api = Build.VERSION_CODES.M) + @Override + protected void onCreate(Bundle savedInstanceState) { + super.onCreate(savedInstanceState); + setContentView(R.layout.activity_3); + StatusBarUtil.setAndroidNativeLightStatusBar(this, true); + TextView tv=(TextView)findViewById(R.id.from3); + String str3="来源:《中国共产党简史》(人民出版社、中国共产党史出版社2021年版)"; + tv.setTextSize(16); + tv.setText(Html.fromHtml(str3)); + } + public void next2(View view){ + Intent intent = new Intent(); + intent.setClass(Activity3.this,Activity4.class); + startActivity(intent); + finish(); + } +} \ No newline at end of file diff --git a/app/src/main/java/com/example/androidtermwork/Activity4.java b/app/src/main/java/com/example/androidtermwork/Activity4.java new file mode 100644 index 0000000..841a47b --- /dev/null +++ b/app/src/main/java/com/example/androidtermwork/Activity4.java @@ -0,0 +1,33 @@ +package com.example.androidtermwork; + +import androidx.annotation.RequiresApi; +import androidx.appcompat.app.AppCompatActivity; + +import android.content.Intent; +import android.os.Build; +import android.os.Bundle; +import android.text.Html; +import android.view.View; +import android.widget.TextView; + +import com.example.androidtermwork.util.StatusBarUtil; + +public class Activity4 extends AppCompatActivity { + + @RequiresApi(api = Build.VERSION_CODES.M) + @Override + protected void onCreate(Bundle savedInstanceState) { + super.onCreate(savedInstanceState); + setContentView(R.layout.activity_4); + StatusBarUtil.setAndroidNativeLightStatusBar(this, true); + TextView tv=(TextView)findViewById(R.id.from4); + String str4="来源:《中国共产党简史》(人民出版社、中国共产党史出版社2021年版)"; + tv.setTextSize(16); + tv.setText(Html.fromHtml(str4)); + } + public void next1(View view){ + Intent intent =new Intent(Activity4.this,Activity5.class); + startActivity(intent); + finish(); + } +} \ No newline at end of file diff --git a/app/src/main/java/com/example/androidtermwork/Activity5.java b/app/src/main/java/com/example/androidtermwork/Activity5.java new file mode 100644 index 0000000..d12e56d --- /dev/null +++ b/app/src/main/java/com/example/androidtermwork/Activity5.java @@ -0,0 +1,32 @@ +package com.example.androidtermwork; + +import androidx.annotation.RequiresApi; +import androidx.appcompat.app.AppCompatActivity; + +import android.content.Intent; +import android.os.Build; +import android.os.Bundle; +import android.view.View; +import android.widget.Button; + +import com.example.androidtermwork.util.StatusBarUtil; + +public class Activity5 extends AppCompatActivity { + private Button btn; + @RequiresApi(api = Build.VERSION_CODES.M) + @Override + protected void onCreate(Bundle savedInstanceState) { + super.onCreate(savedInstanceState); + setContentView(R.layout.activity_5); + StatusBarUtil.setAndroidNativeLightStatusBar(this, true); + btn = (Button) findViewById(R.id.btn2); + btn.setOnClickListener(new View.OnClickListener() { + @Override + public void onClick(View v) { + Intent intent = new Intent(Activity5.this,PointsPage.class); + startActivity(intent); + finish(); + } + }); + } +} \ No newline at end of file diff --git a/app/src/main/java/com/example/androidtermwork/AndroidToastForJs.java b/app/src/main/java/com/example/androidtermwork/AndroidToastForJs.java new file mode 100644 index 0000000..8e6082d --- /dev/null +++ b/app/src/main/java/com/example/androidtermwork/AndroidToastForJs.java @@ -0,0 +1,45 @@ +package com.example.androidtermwork; + +import android.content.Context; +import android.widget.Toast; + +import org.json.JSONException; +import org.json.JSONObject; + +public class AndroidToastForJs { + + public static String title; + public static String resource; + public static String title2; + public static String time; + public static String article; + public static String editor; + + private Context mContext; + + public AndroidToastForJs(Context context) { + this.mContext = context; + } + + //webview中调用toast原生组件 + public void showToast(String toast) { + Toast.makeText(mContext, toast, Toast.LENGTH_SHORT).show(); + } + + //以json实现webview与js之间的数据交互 + public String jsontohtml() { + JSONObject map = null; + try { + map = new JSONObject(); + map.put("title", title); + map.put("resource", resource); + map.put("title2", title2); + map.put("time", time); + map.put("article", article); + map.put("editor", editor); + } catch (JSONException e) { + e.printStackTrace(); + } + return map.toString(); + } +} diff --git a/app/src/main/java/com/example/androidtermwork/ChatActivity.java b/app/src/main/java/com/example/androidtermwork/ChatActivity.java new file mode 100644 index 0000000..c41bb96 --- /dev/null +++ b/app/src/main/java/com/example/androidtermwork/ChatActivity.java @@ -0,0 +1,155 @@ +package com.example.androidtermwork; + +import androidx.annotation.RequiresApi; +import androidx.appcompat.app.AppCompatActivity; +import androidx.appcompat.widget.Toolbar; + +import android.content.Context; +import android.os.Build; +import android.os.Bundle; +import android.view.LayoutInflater; +import android.view.View; +import android.view.ViewGroup; +import android.view.Window; +import android.widget.ArrayAdapter; +import android.widget.Button; +import android.widget.EditText; +import android.widget.ImageView; +import android.widget.LinearLayout; +import android.widget.ListView; +import android.widget.TextView; + +import com.example.androidtermwork.util.StatusBarUtil; + +import java.util.ArrayList; +import java.util.List; + +public class ChatActivity extends AppCompatActivity { + + private ListView msgListView; + private EditText inputText; + private Button send; + private MsgAdapter adapter; + private List msgList = new ArrayList(); + private Toolbar toolbar; + @RequiresApi(api = Build.VERSION_CODES.M) + @Override + protected void onCreate(Bundle savedInstanceState) { + super.onCreate(savedInstanceState); + requestWindowFeature(Window.FEATURE_NO_TITLE);//设置窗口没有标题栏 + StatusBarUtil.setAndroidNativeLightStatusBar(this, true); + setContentView(R.layout.activity_chat); + toolbar = findViewById(R.id.chat_toolbar); + eventListener(); + initMsg(); + adapter = new MsgAdapter(ChatActivity.this, R.layout.msg_item, msgList); + inputText = (EditText) findViewById(R.id.input_text); + send = (Button) findViewById(R.id.send); + msgListView = (ListView) findViewById(R.id.msg_list_view); + msgListView.setAdapter(adapter); + send.setOnClickListener(new View.OnClickListener(){ + @Override + public void onClick(View v) { + String content = inputText.getText().toString(); + if(!"".equals(content)){ + Msg msg = new Msg(content, Msg.SENT); + msgList.add(msg); + adapter.notifyDataSetChanged();//有新消息时,刷新ListView中的显示 + msgListView.setSelection(msgList.size());//将ListView定位到最后一行 + inputText.setText("");//清空输入框的内容 + } + } + }); + } + private void eventListener() { + //右上角返回 + toolbar.setNavigationOnClickListener(new View.OnClickListener() { + @Override + public void onClick(View v) { + finish(); // 返回 + } + }); + } + private void initMsg() { + Msg msg1 = new Msg("全国党史知识竞赛总决赛",Msg.RECEIVED); + msgList.add(msg1); + Msg msg2 = new Msg("收到",Msg.SENT); + msgList.add(msg2); + Msg msg3 = new Msg("关注进博会,游世界展馆,看全球展品",Msg.RECEIVED); + msgList.add(msg3); + } + + public class Msg{ + public static final int RECEIVED = 0;//收到一条消息 + public static final int SENT = 1;//发出一条消息 + private String content;//消息的内容 + private int type;//消息的类型 + public Msg(String content,int type){ + this.content = content; + this.type = type; + } + public String getContent(){ + return content; + } + public int getType(){ + return type; + } + } + + public class MsgAdapter extends ArrayAdapter { + private int resourceId; + + public MsgAdapter(Context context, int textViewresourceId, List objects) { + super(context, textViewresourceId, objects); + resourceId = textViewresourceId; + } + + @Override + public View getView(int position, View convertView, ViewGroup parent) { + Msg msg = getItem(position); + View view; + ViewHolder viewHolder; + + if(convertView == null){ + view = LayoutInflater.from(getContext()).inflate(resourceId, null); + viewHolder = new ViewHolder(); + viewHolder.leftLayout = (LinearLayout)view.findViewById(R.id.left_layout); + viewHolder.rightLayout = (LinearLayout)view.findViewById(R.id.right_Layout); + viewHolder.leftMsg = (TextView)view.findViewById(R.id.left_msg); + viewHolder.rightMsg = (TextView)view.findViewById(R.id.right_msg); + viewHolder.lefthead = (ImageView)view.findViewById(R.id.head_left); + viewHolder.righthead = (ImageView)view.findViewById(R.id.head_right); + view.setTag(viewHolder); + }else{ + view = convertView; + viewHolder = (ViewHolder) view.getTag(); + } + + if(msg.getType()==Msg.RECEIVED){ + //如果是收到的消息,则显示左边消息布局,将右边消息布局隐藏 + viewHolder.leftLayout.setVisibility(View.VISIBLE); + viewHolder.lefthead.setVisibility(View.VISIBLE); + viewHolder.rightLayout.setVisibility(View.GONE); + viewHolder.righthead.setVisibility(View.GONE); + viewHolder.leftMsg.setText(msg.getContent()); + }else if(msg.getType()==Msg.SENT){ + //如果是发出去的消息,显示右边布局的消息布局,将左边的消息布局隐藏 + viewHolder.rightLayout.setVisibility(View.VISIBLE); + viewHolder.righthead.setVisibility(View.VISIBLE); + viewHolder.leftLayout.setVisibility(View.GONE); + viewHolder.lefthead.setVisibility(View.GONE); + viewHolder.rightMsg.setText(msg.getContent()); + } + return view; + } + + class ViewHolder{ + LinearLayout leftLayout; + LinearLayout rightLayout; + TextView leftMsg; + TextView rightMsg; + ImageView lefthead; + ImageView righthead; + } + } +} \ No newline at end of file diff --git a/app/src/main/java/com/example/androidtermwork/LoginPage.java b/app/src/main/java/com/example/androidtermwork/LoginPage.java new file mode 100644 index 0000000..77d3d12 --- /dev/null +++ b/app/src/main/java/com/example/androidtermwork/LoginPage.java @@ -0,0 +1,277 @@ +package com.example.androidtermwork; + +import androidx.annotation.RequiresApi; +import androidx.appcompat.app.AlertDialog; +import androidx.appcompat.app.AppCompatActivity; + +import android.annotation.SuppressLint; +import android.app.ProgressDialog; +import android.content.Context; +import android.content.DialogInterface; +import android.content.Intent; +import android.graphics.Color; +import android.os.Build; +import android.os.Bundle; +import android.os.Handler; +import android.os.Message; +import android.text.Editable; +import android.text.InputType; +import android.text.SpannableStringBuilder; +import android.text.Spanned; +import android.text.TextPaint; +import android.text.TextWatcher; +import android.text.method.HideReturnsTransformationMethod; +import android.text.method.LinkMovementMethod; +import android.text.method.PasswordTransformationMethod; +import android.text.method.TransformationMethod; +import android.text.style.ClickableSpan; +import android.view.View; +import android.view.WindowManager; +import android.widget.Button; +import android.widget.EditText; +import android.widget.ImageView; +import android.widget.TextView; +import android.widget.Toast; + +import com.example.androidtermwork.util.StatusBarUtil; +@RequiresApi(api = Build.VERSION_CODES.M) +public class LoginPage extends AppCompatActivity { + private AlertDialog.Builder builder; + private boolean isHideFirst = true;// 输入框密码是否是隐藏的,默认为true + private ImageView imageView_password; + private ImageView inputDel; //一键清除输入内容 + public static ProgressDialog mDefaultDialog; //加载中对话框 + + //加载中对话框:正在进行网络请求 + + /** + * setCancelable默认为true,表示可以触摸屏幕或者按后退键关闭对话框。如果改为false,那么必须要使用代码来控制关闭对话框,触摸屏幕或者按后退键都是无法关闭对话框。 + * setCanceledOnTouchOutside 默认true表示触摸屏幕可以关闭对话框。如果改为false,表示按后退键可以退出对话框,触摸屏幕不会退回对话框。 + */ + public static void showCommonDialog(Context context) { + mDefaultDialog = new ProgressDialog(context); + //默认就是小圆圈的那种形式 + mDefaultDialog.setProgressStyle(android.app.ProgressDialog.STYLE_SPINNER); + mDefaultDialog.setMessage("正在进行网络请求..."); + // mDefaultDialog.setCancelable(true); + mDefaultDialog.setCanceledOnTouchOutside(false); + mDefaultDialog.show(); + } + + //延时关闭加载中对话框 + @SuppressLint("HandlerLeak") + public static Handler dialogHandler = new Handler() { + @Override + public void handleMessage(Message msg) { + mDefaultDialog.dismiss(); + super.handleMessage(msg); + } + }; + + @Override + protected void onCreate(Bundle savedInstanceState) { + super.onCreate(savedInstanceState); + setContentView(R.layout.activity_login_page); + //登录 + OnButtonToLogin(); + //注册 + OnButtonToRegister(); + //初始化页面底部可点击文本 + initView(); + //密码显示或隐藏 + showOrHide(); + //清空输入框 + inputClear(); + } + + /** + * 密码显示或隐藏 (切换) + */ + private void showOrHide() { + final EditText password = findViewById(R.id.userPassword); + imageView_password = findViewById(R.id.imageView); + imageView_password.setImageResource(R.mipmap.visibleoff); + imageView_password.setOnClickListener(new View.OnClickListener() { + @Override + public void onClick(View view) { + if (isHideFirst == true) { + imageView_password.setImageResource(R.mipmap.visibleon); + //密文 + HideReturnsTransformationMethod method1 = HideReturnsTransformationMethod.getInstance(); + password.setTransformationMethod(method1); + isHideFirst = false; + } else { + imageView_password.setImageResource(R.mipmap.visibleoff); + //密文 + TransformationMethod method = PasswordTransformationMethod.getInstance(); + password.setTransformationMethod(method); + isHideFirst = true; + + } + // 光标的位置 + int index = password.getText().toString().length(); + password.setSelection(index); + } + }); + } + + /** + * 清空输入框 + */ + private void inputClear() { + //设置监听器 + final EditText input = findViewById(R.id.userPhone); + inputDel = findViewById(R.id.del); + input.addTextChangedListener(new TextWatcher() { + @Override + public void beforeTextChanged(CharSequence charSequence, int i, int i1, int i2) { + } + + @Override + public void onTextChanged(CharSequence charSequence, int i, int i1, int i2) { + } + + @Override + public void afterTextChanged(Editable editable) { + if (input.getEditableText().length() >= 1) { + inputDel.setVisibility(View.VISIBLE); + } else { + inputDel.setVisibility(View.GONE); + } + } + }); + inputDel.setOnClickListener(new View.OnClickListener() { + @Override + //点击事件(清空) + public void onClick(View view) { + input.setText(""); + } + }); + } + + public void OnButtonToLogin() { + final EditText phoneEdit = findViewById(R.id.userPhone); + final EditText passwordEdit = findViewById(R.id.userPassword); + + final Button btn_login = findViewById(R.id.submit); + btn_login.setOnClickListener(new View.OnClickListener() { + public void onClick(View arg0) { + final String input_phone = phoneEdit.getText().toString().trim(); + String input_password = passwordEdit.getText().toString().trim(); + // 不为空 + if (input_phone.length() != 0 && input_password.length() != 0) { + // 密码长度大于等于6且小于等于20 + if (input_password.length() >= 6 && input_password.length() <= 20) { + // 通过接口判断密码是否正确 + if (input_password.length() != 0) { + //加载中对话框 + showCommonDialog(LoginPage.this); + try { + Intent intent = new Intent(LoginPage.this, MainActivity.class); + startActivity(intent); + } catch (Exception e) { + e.printStackTrace(); + } + dialogHandler.sendEmptyMessageDelayed(0, 1000); + } else { + builder = new AlertDialog.Builder(LoginPage.this) + .setMessage("号码或者密码不正确") + .setPositiveButton("确定", new DialogInterface.OnClickListener() { + @Override + public void onClick(DialogInterface dialogInterface, int i) { + //ToDo: 关闭弹窗 + dialogInterface.dismiss(); + } + }); + builder.create().show(); + } + } else { + builder = new AlertDialog.Builder(LoginPage.this) + .setMessage("普通成员的密码需要6~20位字符;为保证安全性,请在大写英文字母,小写英文字母,数字和特殊符号中选中至少两项组合为密码。") + .setPositiveButton("确定", new DialogInterface.OnClickListener() { + @Override + public void onClick(DialogInterface dialogInterface, int i) { + //ToDo: 关闭弹窗 + dialogInterface.dismiss(); + } + }); + builder.create().show(); + } + } else { + Toast.makeText(LoginPage.this, "用户名或密码不能为空!", Toast.LENGTH_SHORT).show(); + } + } + }); + } + + public void OnButtonToRegister() { + Button regis = findViewById(R.id.register); + regis.setOnClickListener(new View.OnClickListener() { + @Override + public void onClick(View view) { + Intent intent = new Intent(LoginPage.this, RegisterFirstPage.class); + startActivity(intent); + } + }); + } + + //初始化页面底部可点击文本 + + public void initView() { + TextView textView1 = findViewById(R.id.retrieve); + TextView textView2 = findViewById(R.id.loss); + SpannableStringBuilder stringBuilder1 = new SpannableStringBuilder("找回密码"); + SpannableStringBuilder stringBuilder2 = new SpannableStringBuilder("账号挂失"); + TextViewSpan1 span1 = new TextViewSpan1(); + TextViewSpan2 span2 = new TextViewSpan2(); + //找回密码 + stringBuilder1.setSpan(span1, 0, 4, Spanned.SPAN_EXCLUSIVE_EXCLUSIVE); + textView1.setText(stringBuilder1); + //账号挂失 + stringBuilder2.setSpan(span2, 0, 4, Spanned.SPAN_EXCLUSIVE_EXCLUSIVE); + textView2.setText(stringBuilder2); + //一定要记得设置这个方法 不然不起作用 + textView1.setMovementMethod(LinkMovementMethod.getInstance()); + textView2.setMovementMethod(LinkMovementMethod.getInstance()); + //取消文本的点击背景 + textView1.setHighlightColor(getResources().getColor(android.R.color.transparent)); + textView2.setHighlightColor(getResources().getColor(android.R.color.transparent)); + //修改状态栏字体为黑色 + StatusBarUtil.setAndroidNativeLightStatusBar(this, true); + } + + //找回密码 + private class TextViewSpan1 extends ClickableSpan { + @Override + public void updateDrawState(TextPaint ds) { + //设置是否有下划线 + ds.setUnderlineText(false); + } + + @Override + public void onClick(View widget) { + //点击事件 + Intent intent = new Intent(LoginPage.this, RetrievePasswordPage.class); + startActivity(intent); + //点击后设置可点击文本的字体颜色 +// TextView textView = findViewById(R.id.retrieve); +// textView.setTextColor(Color.parseColor("#6495ED")); + } + } + + //账号挂失 + private class TextViewSpan2 extends ClickableSpan { + @Override + public void updateDrawState(TextPaint ds) { + //设置是否有下划线 + ds.setUnderlineText(false); + } + + @Override + public void onClick(View widget) { + //点击事件 + Intent intent = new Intent(LoginPage.this, LossPage.class); + startActivity(intent); + } + } +} diff --git a/app/src/main/java/com/example/androidtermwork/LossPage.java b/app/src/main/java/com/example/androidtermwork/LossPage.java new file mode 100644 index 0000000..e3d72b7 --- /dev/null +++ b/app/src/main/java/com/example/androidtermwork/LossPage.java @@ -0,0 +1,21 @@ +package com.example.androidtermwork; + +import androidx.annotation.RequiresApi; +import androidx.appcompat.app.AppCompatActivity; + +import android.os.Build; +import android.os.Bundle; +import android.view.WindowManager; + +import com.example.androidtermwork.util.StatusBarUtil; + +public class LossPage extends AppCompatActivity { + + @RequiresApi(api = Build.VERSION_CODES.M) + @Override + protected void onCreate(Bundle savedInstanceState) { + super.onCreate(savedInstanceState); + setContentView(R.layout.activity_loss_page); + StatusBarUtil.setAndroidNativeLightStatusBar(this, true); + } +} diff --git a/app/src/main/java/com/example/androidtermwork/MainActivity.java b/app/src/main/java/com/example/androidtermwork/MainActivity.java new file mode 100644 index 0000000..c60c49e --- /dev/null +++ b/app/src/main/java/com/example/androidtermwork/MainActivity.java @@ -0,0 +1,129 @@ +package com.example.androidtermwork; + +import android.content.Intent; +import android.os.Bundle; +import android.text.SpannableStringBuilder; +import android.text.Spanned; +import android.text.TextPaint; +import android.text.method.LinkMovementMethod; +import android.text.style.ClickableSpan; +import android.view.View; +import android.widget.TextView; +import android.widget.Toast; + +import com.google.android.material.bottomnavigation.BottomNavigationView; + +import androidx.annotation.Nullable; +import androidx.appcompat.app.AppCompatActivity; +import androidx.navigation.NavController; +import androidx.navigation.Navigation; +import androidx.navigation.ui.AppBarConfiguration; +import androidx.navigation.ui.NavigationUI; + +public class MainActivity extends AppCompatActivity { + + static final int POINTS_PAGE = 0x36f2; + private NavController navController; + @Override + protected void onCreate(Bundle savedInstanceState) { + super.onCreate(savedInstanceState); + setContentView(R.layout.activity_main); + BottomNavigationView navView = findViewById(R.id.nav_view); + // Passing each menu ID as a set of Ids because each + // menu should be considered as top level destinations. + AppBarConfiguration appBarConfiguration = new AppBarConfiguration.Builder( + R.id.navigation_home, R.id.navigation_dashboard, R.id.navigation_notifications) + .build(); + navController = Navigation.findNavController(this, R.id.nav_host_fragment); + //顶部菜单栏 +// NavigationUI.setupActionBarWithNavController(this, navController, appBarConfiguration); + NavigationUI.setupWithNavController(navView, navController); + initView(); + } + + //初始化可点击文本 + public void initView() { + int score = 9000; + TextView scoreText = findViewById(R.id.score); + TextView ownText = findViewById(R.id.own); + scoreText.setText(String.valueOf(score)); + + SpannableStringBuilder stringBuilder1 = new SpannableStringBuilder(scoreText.getText()); + SpannableStringBuilder stringBuilder2 = new SpannableStringBuilder(ownText.getText()); + MainActivity.TextViewSpan1 span1 = new MainActivity.TextViewSpan1(); + MainActivity.TextViewSpan2 span2 = new MainActivity.TextViewSpan2(); + //积分 + stringBuilder1.setSpan(span1, 0, scoreText.getText().length(), Spanned.SPAN_EXCLUSIVE_EXCLUSIVE); + scoreText.setText(stringBuilder1); + scoreText.setMovementMethod(LinkMovementMethod.getInstance()); + //我的 + stringBuilder2.setSpan(span2, 0, ownText.getText().length(), Spanned.SPAN_EXCLUSIVE_EXCLUSIVE); + ownText.setText(stringBuilder2); + ownText.setMovementMethod(LinkMovementMethod.getInstance()); + //取消文本的点击背景 + scoreText.setHighlightColor(getResources().getColor(android.R.color.transparent)); + ownText.setHighlightColor(getResources().getColor(android.R.color.transparent)); + } + + //积分 + private class TextViewSpan1 extends ClickableSpan { + @Override + public void updateDrawState(TextPaint ds) { + //设置是否有下划线 + ds.setUnderlineText(false); + } + + @Override + public void onClick(View widget) { + //点击事件 + //Toast.makeText(MainActivity.this, "点击积分", Toast.LENGTH_SHORT).show(); + Intent intent = new Intent(MainActivity.this, PointsPage.class); + startActivityForResult(intent, POINTS_PAGE); + } + } + + //我的 + private class TextViewSpan2 extends ClickableSpan { + @Override + public void updateDrawState(TextPaint ds) { + //设置是否有下划线 + ds.setUnderlineText(false); + } + + @Override + public void onClick(View widget) { + //点击事件 + Intent intent = new Intent(MainActivity.this,MinePage.class); + startActivity(intent); + } + } + + /** + * 获取子Activity返回值 + * @param requestCode + * @param resultCode + * @param data + */ + @Override + protected void onActivityResult(int requestCode, int resultCode, @Nullable Intent data) { + super.onActivityResult(requestCode, resultCode, data); + if (requestCode == RESULT_CANCELED || data == null) + return; + if (requestCode == POINTS_PAGE){ + handlePointsPageResult(data.getStringExtra("goAction")); + } + } + + /** + * 根据“学习积分”Activity的返回值,导航至不同的Tab + * @param goAction + */ + private void handlePointsPageResult(String goAction) + { + switch (goAction){ + //如果点击的是“我要选读文章”的去做任务,则导航到第二个Tab + case "res_article":navController.navigate(R.id.navigation_dashboard);break; + case "res_tv":navController.navigate(R.id.navigation_notifications);break; + } + } +} diff --git a/app/src/main/java/com/example/androidtermwork/MinePage.java b/app/src/main/java/com/example/androidtermwork/MinePage.java new file mode 100644 index 0000000..c898d98 --- /dev/null +++ b/app/src/main/java/com/example/androidtermwork/MinePage.java @@ -0,0 +1,34 @@ +package com.example.androidtermwork; + +import androidx.annotation.RequiresApi; +import androidx.appcompat.app.AppCompatActivity; +import androidx.appcompat.widget.Toolbar; + +import android.os.Build; +import android.os.Bundle; +import android.view.View; + +import com.example.androidtermwork.util.StatusBarUtil; + +public class MinePage extends AppCompatActivity { + + private Toolbar toolbar; + @RequiresApi(api = Build.VERSION_CODES.M) + @Override + protected void onCreate(Bundle savedInstanceState) { + super.onCreate(savedInstanceState); + setContentView(R.layout.activity_mine_page); + StatusBarUtil.setAndroidNativeLightStatusBar(this, true); + toolbar = findViewById(R.id.mine_toolbar); + eventListener(); + } + private void eventListener() { + //右上角返回 + toolbar.setNavigationOnClickListener(new View.OnClickListener() { + @Override + public void onClick(View v) { + finish(); // 返回 + } + }); + } +} \ No newline at end of file diff --git a/app/src/main/java/com/example/androidtermwork/PointsPage.java b/app/src/main/java/com/example/androidtermwork/PointsPage.java new file mode 100644 index 0000000..4a6c06a --- /dev/null +++ b/app/src/main/java/com/example/androidtermwork/PointsPage.java @@ -0,0 +1,92 @@ +package com.example.androidtermwork; + +import androidx.annotation.RequiresApi; +import androidx.appcompat.app.AppCompatActivity; +import androidx.appcompat.widget.Toolbar; + +import android.os.Build; +import android.os.Bundle; +import android.view.View; +import android.widget.ListView; + +import com.example.androidtermwork.adpter.PointsItemAdapter; +import com.example.androidtermwork.pojo.PointSummary; +import com.example.androidtermwork.pojo.PointTask; +import com.example.androidtermwork.util.ResourceUtil; +import com.example.androidtermwork.util.StatusBarUtil; +import com.example.androidtermwork.util.TestUtil; +import com.google.gson.Gson; +import com.google.gson.reflect.TypeToken; + +import java.util.List; + +@RequiresApi(api = Build.VERSION_CODES.M) +public class PointsPage extends AppCompatActivity { + + private Gson gson; + private Toolbar toolbar; + + @Override + protected void onCreate(Bundle savedInstanceState) { + super.onCreate(savedInstanceState); + setContentView(R.layout.activity_points_page); + initInstance(); + //setToolbar(); + bindListViewData(); + StatusBarUtil.setAndroidNativeLightStatusBar(this, true); + eventListener(); + } + + /** + * 初始化对象(引用) + */ + private void initInstance() { + gson = new Gson(); + toolbar = findViewById(R.id.points_toolbar); + } + + /** + * 添加事件监听器 + */ + private void eventListener() { + //右上角返回 + toolbar.setNavigationOnClickListener(new View.OnClickListener() { + @Override + public void onClick(View v) { + finish(); // 返回 + } + }); + } + + /** + * 给ListView绑定数据 + */ + private void bindListViewData() { + PointSummary pointSummary = + gson.fromJson( + TestUtil.getJson("mock_user_points.json", this), + PointSummary.class); + int dan = pointSummary.getDan(); + pointSummary.setDanName(getResources().getStringArray(R.array.dan_name_array)[dan]); + pointSummary.setDanStar( + ResourceUtil.getIdentifier(this, getString(R.string.dan_star_prefix) + dan, "mipmap") + ); + List pointTasks = gson.fromJson( + TestUtil.getJson("mock_list_task.json", this), + new TypeToken>() { + }.getType() + ); + ListView listView = findViewById(R.id.contentListView); + listView.setAdapter(new PointsItemAdapter(this, pointSummary, pointTasks)); + } + + /** + * 设置ToolBar + */ + private void setToolbar() { + setSupportActionBar(toolbar); + getSupportActionBar().setHomeButtonEnabled(true); + getSupportActionBar().setDisplayHomeAsUpEnabled(true); + } + +} \ No newline at end of file diff --git a/app/src/main/java/com/example/androidtermwork/RegisterFirstPage.java b/app/src/main/java/com/example/androidtermwork/RegisterFirstPage.java new file mode 100644 index 0000000..28d8c85 --- /dev/null +++ b/app/src/main/java/com/example/androidtermwork/RegisterFirstPage.java @@ -0,0 +1,104 @@ +package com.example.androidtermwork; + +import androidx.annotation.RequiresApi; +import androidx.appcompat.app.AlertDialog; +import androidx.appcompat.app.AppCompatActivity; + +import android.content.DialogInterface; +import android.content.Intent; +import android.os.Build; +import android.os.Bundle; +import android.text.Editable; +import android.text.TextWatcher; +import android.view.View; +import android.view.WindowManager; +import android.widget.Button; +import android.widget.EditText; +import android.widget.ImageView; +import android.widget.TextView; + +import com.example.androidtermwork.util.StatusBarUtil; + +public class RegisterFirstPage extends AppCompatActivity { + private AlertDialog.Builder builder; + private ImageView inputDel; //一键清除输入内容 + private Button next; //下一步 + + @RequiresApi(api = Build.VERSION_CODES.M) + @Override + protected void onCreate(Bundle savedInstanceState) { + super.onCreate(savedInstanceState); + setContentView(R.layout.activity_retrieve_password_page); + //复用找回密码页面,将“请输入手机号”替换为“新用户注册” + TextView textView = findViewById(R.id.fontText); + textView.setText("新用户注册"); + + OnButtonToNext(); + //清空输入框 + inputClear(); + //设置状态栏字体为黑色 + StatusBarUtil.setAndroidNativeLightStatusBar(this, true); + } + + public void OnButtonToNext() { + final EditText phoneNumber = findViewById(R.id.userPhone); + next = findViewById(R.id.submit_next); + next.setOnClickListener(new View.OnClickListener() { + @Override + public void onClick(View view) { + String input_phoneNumber = phoneNumber.getText().toString().trim(); + // 密码长度大于等于6且小于等于20 + if (input_phoneNumber.length() == 11) { + // 通过接口设置密码 + Intent intent = new Intent(RegisterFirstPage.this, RegisterSecondPage.class); + startActivity(intent); + } else { + builder = new AlertDialog.Builder(RegisterFirstPage.this) + .setMessage("请输入11位手机号。") + .setPositiveButton("确定", new DialogInterface.OnClickListener() { + @Override + public void onClick(DialogInterface dialogInterface, int i) { + //ToDo: 关闭弹窗 + dialogInterface.dismiss(); + } + }); + builder.create().show(); + } + } + }); + } + + /** + * 清空输入框 + */ + private void inputClear() { + //设置监听器 + final EditText input = findViewById(R.id.userPhone); + inputDel = findViewById(R.id.del); + input.addTextChangedListener(new TextWatcher() { + @Override + public void beforeTextChanged(CharSequence charSequence, int i, int i1, int i2) { + } + + @Override + public void onTextChanged(CharSequence charSequence, int i, int i1, int i2) { + } + + @Override + public void afterTextChanged(Editable editable) { + if (input.getEditableText().length() >= 1) { + inputDel.setVisibility(View.VISIBLE); + } else { + inputDel.setVisibility(View.GONE); + } + } + }); + inputDel.setOnClickListener(new View.OnClickListener() { + @Override + //点击事件(清空) + public void onClick(View view) { + input.setText(""); + } + }); + } +} diff --git a/app/src/main/java/com/example/androidtermwork/RegisterSecondPage.java b/app/src/main/java/com/example/androidtermwork/RegisterSecondPage.java new file mode 100644 index 0000000..b9f73b2 --- /dev/null +++ b/app/src/main/java/com/example/androidtermwork/RegisterSecondPage.java @@ -0,0 +1,98 @@ +package com.example.androidtermwork; + +import androidx.annotation.RequiresApi; +import androidx.appcompat.app.AlertDialog; +import androidx.appcompat.app.AppCompatActivity; + +import android.content.DialogInterface; +import android.content.Intent; +import android.os.Build; +import android.os.Bundle; +import android.text.method.HideReturnsTransformationMethod; +import android.text.method.PasswordTransformationMethod; +import android.text.method.TransformationMethod; +import android.view.View; +import android.view.WindowManager; +import android.widget.Button; +import android.widget.EditText; +import android.widget.ImageView; + +import com.example.androidtermwork.util.StatusBarUtil; + +public class RegisterSecondPage extends AppCompatActivity { + private AlertDialog.Builder builder; + private Button next; //下一步 + private boolean isHideFirst = true;// 输入框密码是否是隐藏的,默认为true + private ImageView imageView_password; + + @RequiresApi(api = Build.VERSION_CODES.M) + @Override + protected void onCreate(Bundle savedInstanceState) { + super.onCreate(savedInstanceState); + setContentView(R.layout.activity_reset_password_page); + OnButtonToNext(); + //密码显示或隐藏 + showOrHide(); + //设置状态栏字体为黑色 + StatusBarUtil.setAndroidNativeLightStatusBar(this, true); + } + + public void OnButtonToNext() { + final EditText passwordEdit = findViewById(R.id.userPassword); + next = findViewById(R.id.submit_next); + next.setOnClickListener(new View.OnClickListener() { + @Override + public void onClick(View view) { + String input_password = passwordEdit.getText().toString().trim(); + // 密码长度大于等于6且小于等于20 + if (input_password.length() >= 6 && input_password.length() <= 20) { + // 通过接口设置密码 + Intent intent = new Intent(RegisterSecondPage.this, RegisterThirdPage.class); + startActivity(intent); + } else { + builder = new AlertDialog.Builder(RegisterSecondPage.this) + .setMessage("普通成员的密码需要6~20位字符;为保证安全性,请在大写英文字母,小写英文字母,数字和特殊符号中选中至少两项组合为密码。") + .setPositiveButton("确定", new DialogInterface.OnClickListener() { + @Override + public void onClick(DialogInterface dialogInterface, int i) { + //ToDo: 关闭弹窗 + dialogInterface.dismiss(); + } + }); + builder.create().show(); + } + } + }); + } + + /** + * 密码显示或隐藏 (切换) + */ + private void showOrHide() { + final EditText password = findViewById(R.id.userPassword); + imageView_password = findViewById(R.id.imageView); + imageView_password.setImageResource(R.mipmap.visibleoff); + imageView_password.setOnClickListener(new View.OnClickListener() { + @Override + public void onClick(View view) { + if (isHideFirst == true) { + imageView_password.setImageResource(R.mipmap.visibleon); + //密文 + HideReturnsTransformationMethod method1 = HideReturnsTransformationMethod.getInstance(); + password.setTransformationMethod(method1); + isHideFirst = false; + } else { + imageView_password.setImageResource(R.mipmap.visibleoff); + //密文 + TransformationMethod method = PasswordTransformationMethod.getInstance(); + password.setTransformationMethod(method); + isHideFirst = true; + + } + // 光标的位置 + int index = password.getText().toString().length(); + password.setSelection(index); + } + }); + } +} diff --git a/app/src/main/java/com/example/androidtermwork/RegisterThirdPage.java b/app/src/main/java/com/example/androidtermwork/RegisterThirdPage.java new file mode 100644 index 0000000..1c463a9 --- /dev/null +++ b/app/src/main/java/com/example/androidtermwork/RegisterThirdPage.java @@ -0,0 +1,89 @@ +package com.example.androidtermwork; + +import androidx.annotation.RequiresApi; +import androidx.appcompat.app.AppCompatActivity; + +import android.content.Intent; +import android.os.Build; +import android.os.Bundle; +import android.text.Editable; +import android.text.TextWatcher; +import android.util.Log; +import android.view.View; +import android.view.WindowManager; +import android.widget.Button; +import android.widget.EditText; +import android.widget.ImageView; +import android.widget.TextView; + +import com.example.androidtermwork.util.StatusBarUtil; + +public class RegisterThirdPage extends AppCompatActivity { + private ImageView inputDel; //一键清除输入内容 + private Button intoApp; //进入学习强国 + + @RequiresApi(api = Build.VERSION_CODES.M) + @Override + protected void onCreate(Bundle savedInstanceState) { + super.onCreate(savedInstanceState); + setContentView(R.layout.activity_register_third_page); + + OnButtonIntoApp(); + //清空输入框 + inputClear(); + //设置状态栏字体为黑色 + StatusBarUtil.setAndroidNativeLightStatusBar(this, true); + } + + //点击进入学习强国 + public void OnButtonIntoApp() { + intoApp = findViewById(R.id.submit_intoApp); + intoApp.setOnClickListener(new View.OnClickListener() { + @Override + public void onClick(View view) { + LoginPage.showCommonDialog(RegisterThirdPage.this); + try { + Intent intent = new Intent(RegisterThirdPage.this, LoginPage.class); + startActivity(intent); + } catch (Exception e) { + e.printStackTrace(); + } + LoginPage.dialogHandler.sendEmptyMessageDelayed(0,1000); + } + }); + } + + /** + * 清空输入框 + */ + private void inputClear() { + //设置监听器 + final EditText input = findViewById(R.id.userName); + inputDel = findViewById(R.id.del); + input.addTextChangedListener(new TextWatcher() { + @Override + public void beforeTextChanged(CharSequence charSequence, int i, int i1, int i2) { + } + + @Override + public void onTextChanged(CharSequence charSequence, int i, int i1, int i2) { + } + + @Override + public void afterTextChanged(Editable editable) { + if (input.getEditableText().length() >= 1) { + inputDel.setVisibility(View.VISIBLE); + } else { + inputDel.setVisibility(View.GONE); + } + } + }); + inputDel.setOnClickListener(new View.OnClickListener() { + @Override + //点击事件(清空) + public void onClick(View view) { + input.setText(""); + } + }); + } +} diff --git a/app/src/main/java/com/example/androidtermwork/ResetPasswordPage.java b/app/src/main/java/com/example/androidtermwork/ResetPasswordPage.java new file mode 100644 index 0000000..7b8a752 --- /dev/null +++ b/app/src/main/java/com/example/androidtermwork/ResetPasswordPage.java @@ -0,0 +1,99 @@ +package com.example.androidtermwork; + +import androidx.annotation.RequiresApi; +import androidx.appcompat.app.AlertDialog; +import androidx.appcompat.app.AppCompatActivity; + +import android.content.DialogInterface; +import android.content.Intent; +import android.os.Build; +import android.os.Bundle; +import android.text.method.HideReturnsTransformationMethod; +import android.text.method.PasswordTransformationMethod; +import android.text.method.TransformationMethod; +import android.view.View; +import android.view.WindowManager; +import android.widget.Button; +import android.widget.EditText; +import android.widget.ImageView; +import android.widget.Toast; + +import com.example.androidtermwork.util.StatusBarUtil; + +public class ResetPasswordPage extends AppCompatActivity { + private AlertDialog.Builder builder; + private Button next; //下一步 + private boolean isHideFirst = true;// 输入框密码是否是隐藏的,默认为true + private ImageView imageView_password; + + @RequiresApi(api = Build.VERSION_CODES.M) + @Override + protected void onCreate(Bundle savedInstanceState) { + super.onCreate(savedInstanceState); + setContentView(R.layout.activity_reset_password_page); + OnButtonToNext(); + //密码显示或隐藏 + showOrHide(); + //设置状态栏字体为黑色 + StatusBarUtil.setAndroidNativeLightStatusBar(this, true); + } + + public void OnButtonToNext() { + final EditText passwordEdit = findViewById(R.id.userPassword); + next = findViewById(R.id.submit_next); + next.setOnClickListener(new View.OnClickListener() { + @Override + public void onClick(View view) { + String input_password = passwordEdit.getText().toString().trim(); + // 密码长度大于等于6且小于等于20 + if (input_password.length() >= 6 && input_password.length() <= 20) { + // 通过接口设置密码 + Intent intent = new Intent(ResetPasswordPage.this, LoginPage.class); + startActivity(intent); + } else { + builder = new AlertDialog.Builder(ResetPasswordPage.this) + .setMessage("普通成员的密码需要6~20位字符;为保证安全性,请在大写英文字母,小写英文字母,数字和特殊符号中选中至少两项组合为密码。") + .setPositiveButton("确定", new DialogInterface.OnClickListener() { + @Override + public void onClick(DialogInterface dialogInterface, int i) { + //ToDo: 关闭弹窗 + dialogInterface.dismiss(); + } + }); + builder.create().show(); + } + } + }); + } + + /** + * 密码显示或隐藏 (切换) + */ + private void showOrHide() { + final EditText password = findViewById(R.id.userPassword); + imageView_password = findViewById(R.id.imageView); + imageView_password.setImageResource(R.mipmap.visibleoff); + imageView_password.setOnClickListener(new View.OnClickListener() { + @Override + public void onClick(View view) { + if (isHideFirst == true) { + imageView_password.setImageResource(R.mipmap.visibleon); + //密文 + HideReturnsTransformationMethod method1 = HideReturnsTransformationMethod.getInstance(); + password.setTransformationMethod(method1); + isHideFirst = false; + } else { + imageView_password.setImageResource(R.mipmap.visibleoff); + //密文 + TransformationMethod method = PasswordTransformationMethod.getInstance(); + password.setTransformationMethod(method); + isHideFirst = true; + + } + // 光标的位置 + int index = password.getText().toString().length(); + password.setSelection(index); + } + }); + } +} diff --git a/app/src/main/java/com/example/androidtermwork/RetrievePasswordPage.java b/app/src/main/java/com/example/androidtermwork/RetrievePasswordPage.java new file mode 100644 index 0000000..6a71075 --- /dev/null +++ b/app/src/main/java/com/example/androidtermwork/RetrievePasswordPage.java @@ -0,0 +1,98 @@ +package com.example.androidtermwork; + +import androidx.annotation.RequiresApi; +import androidx.appcompat.app.AlertDialog; +import androidx.appcompat.app.AppCompatActivity; + +import android.content.DialogInterface; +import android.content.Intent; +import android.os.Build; +import android.os.Bundle; +import android.text.Editable; +import android.text.TextWatcher; +import android.view.View; +import android.view.WindowManager; +import android.widget.Button; +import android.widget.EditText; +import android.widget.ImageView; + +import com.example.androidtermwork.util.StatusBarUtil; + +public class RetrievePasswordPage extends AppCompatActivity { + private AlertDialog.Builder builder; + private ImageView inputDel; //一键清除输入内容 + private Button next; //下一步 + + @RequiresApi(api = Build.VERSION_CODES.M) + @Override + protected void onCreate(Bundle savedInstanceState) { + super.onCreate(savedInstanceState); + setContentView(R.layout.activity_retrieve_password_page); + OnButtonToNext(); + inputClear(); + //设置状态栏字体为黑色 + StatusBarUtil.setAndroidNativeLightStatusBar(this, true); + } + + public void OnButtonToNext() { + final EditText phoneNumber = findViewById(R.id.userPhone); + next = findViewById(R.id.submit_next); + next.setOnClickListener(new View.OnClickListener() { + @Override + public void onClick(View view) { + String input_phoneNumber = phoneNumber.getText().toString().trim(); + // 密码长度大于等于6且小于等于20 + if (input_phoneNumber.length() == 11) { + // 通过接口设置密码 + Intent intent = new Intent(RetrievePasswordPage.this, ResetPasswordPage.class); + startActivity(intent); + } else { + builder = new AlertDialog.Builder(RetrievePasswordPage.this) + .setMessage("请输入11位手机号。") + .setPositiveButton("确定", new DialogInterface.OnClickListener() { + @Override + public void onClick(DialogInterface dialogInterface, int i) { + //ToDo: 关闭弹窗 + dialogInterface.dismiss(); + } + }); + builder.create().show(); + } + } + }); + } + + /** + * 清空输入框 + */ + private void inputClear() { + //设置监听器 + final EditText input = findViewById(R.id.userPhone); + inputDel = findViewById(R.id.del); + input.addTextChangedListener(new TextWatcher() { + @Override + public void beforeTextChanged(CharSequence charSequence, int i, int i1, int i2) { + } + + @Override + public void onTextChanged(CharSequence charSequence, int i, int i1, int i2) { + } + + @Override + public void afterTextChanged(Editable editable) { + if (input.getEditableText().length() >= 1) { + inputDel.setVisibility(View.VISIBLE); + } else { + inputDel.setVisibility(View.GONE); + } + } + }); + inputDel.setOnClickListener(new View.OnClickListener() { + @Override + //点击事件(清空) + public void onClick(View view) { + input.setText(""); + } + }); + } +} diff --git a/app/src/main/java/com/example/androidtermwork/TvStationPlayPage.java b/app/src/main/java/com/example/androidtermwork/TvStationPlayPage.java new file mode 100644 index 0000000..ed951d6 --- /dev/null +++ b/app/src/main/java/com/example/androidtermwork/TvStationPlayPage.java @@ -0,0 +1,177 @@ +package com.example.androidtermwork; + +import android.content.Context; +import android.content.Intent; +import android.os.Build; +import android.os.Bundle; +import android.view.View; +import android.widget.ImageView; +import android.widget.TextView; + +import androidx.annotation.RequiresApi; +import androidx.appcompat.app.AppCompatActivity; +import androidx.recyclerview.widget.LinearLayoutManager; +import androidx.recyclerview.widget.LinearSmoothScroller; +import androidx.recyclerview.widget.RecyclerView; + +import com.example.androidtermwork.adpter.TVDetailsCommentsAdapter; +import com.example.androidtermwork.pojo.TvComment; +import com.example.androidtermwork.pojo.TvDetails; +import com.example.androidtermwork.util.StatusBarUtil; +import com.example.androidtermwork.util.TestUtil; +import com.example.androidtermwork.view.JzvdPlayer; +import com.google.gson.reflect.TypeToken; +import com.scwang.smart.refresh.layout.SmartRefreshLayout; + +import java.util.ArrayList; +import java.util.List; + +import cn.jzvd.Jzvd; + + +public class TvStationPlayPage extends AppCompatActivity { + + private TvDetails tvDetails; + private List tvComments; + private RecyclerView detailsCommentsView; + private JzvdPlayer playerStandard; + private Intent startIntent; + private SmartRefreshLayout refreshLayout; + @RequiresApi(api = Build.VERSION_CODES.M) + @Override + protected void onCreate(Bundle savedInstanceState) { + super.onCreate(savedInstanceState); + setContentView(R.layout.activity_tv_station_play); + //设置状态栏字体为黑色 + StatusBarUtil.setAndroidNativeLightStatusBar(this, true); + startIntent = getIntent(); + prepareTestData(); + buildDetailsData(); + initPlayer(); + loadDetailsAndComments(); + buildCommentIcon(); + + } + + /** + * 测试方法 + */ + private void prepareTestData() { + //第一个视频有测试数据 + if (startIntent.getLongExtra("id", 0) == 1){ + tvDetails = + TestUtil.getMockData("mock_data_tv_details.json", + new TypeToken(){}, this); + tvComments = TestUtil.getMockData("mock_data_tv_comments.json", + new TypeToken>(){}, this); + } else { + tvDetails = new TvDetails(); + tvComments = new ArrayList<>(); + tvDetails.setPlayCounts((long)(Math.random() * 1005)); + tvDetails.setFeelGoodCounts((long)(Math.random() * 105)); + tvDetails.setCollect((Math.random() + 0.5) > 1.0d); + tvDetails.setFeelGood((Math.random() + 0.5) > 1.0d); + tvDetails.setIntroduction("暂无简介"); + closeLoadMore(); + } + } + + /** + * 关闭下拉加载更多评论 + */ + private void closeLoadMore(){ + if (refreshLayout == null) + refreshLayout = findViewById(R.id.videoInfoRefreshLayout); + refreshLayout.setEnableLoadMore(false); + } + /** + * 加载视频详情和评论 + */ + private void loadDetailsAndComments() { + detailsCommentsView = findViewById(R.id.play_recyclerView); + TVDetailsCommentsAdapter dataAdapter = new TVDetailsCommentsAdapter(this); + dataAdapter.setTvDetails(tvDetails); + dataAdapter.setTvComments(tvComments); + LinearLayoutManager layoutManager = new LinearLayoutManager(this); + detailsCommentsView.setLayoutManager(layoutManager); + detailsCommentsView.setAdapter(dataAdapter); + } + + /** + * 准备视频详情 + * + */ + private void buildDetailsData(){ + tvDetails.setId(startIntent.getLongExtra("id", 0)); + tvDetails.setTitle(startIntent.getStringExtra("title")); + tvDetails.setAuthor(startIntent.getStringExtra("author")); + tvDetails.setDate(startIntent.getStringExtra("date")); + tvDetails.setSourceUrl(startIntent.getStringExtra("sourceUrl")); + } + + /** + * 加载播放器 + */ + private void initPlayer(){ + playerStandard = findViewById(R.id.play_playerStandard); + playerStandard.setUp(tvDetails.getSourceUrl(),""); + playerStandard.startVideo(); + } + + /** + * 设置评论按钮显示评论数,以及点击事件 + */ + private void buildCommentIcon() { + ImageView icon = findViewById(R.id.icComment); + TextView commentCount = findViewById(R.id.tvCommentCount); + if (tvComments.size() > 0){ + commentCount.setText(String.valueOf(tvComments.size())); + icon.setOnClickListener(new View.OnClickListener() { + @Override + public void onClick(View v) { + scrollItemToTop(1); + } + }); + } else { + commentCount.setVisibility(View.GONE); + } + + } + @Override + public void onBackPressed() { + if (Jzvd.backPress()) { + return; + } + super.onBackPressed(); + } + + @Override + protected void onPause() { + super.onPause(); + Jzvd.releaseAllVideos(); + } + + @Override + protected void onDestroy() { + super.onDestroy(); + } + + private void scrollItemToTop(int position){ + LinearSmoothScroller smoothScroller = new LinearTopSmoothScroller(this); + smoothScroller.setTargetPosition(position); + detailsCommentsView.getLayoutManager().startSmoothScroll(smoothScroller); + } + +} + +class LinearTopSmoothScroller extends LinearSmoothScroller { + + public LinearTopSmoothScroller(Context context) { + super(context); + } + + @Override + protected int getVerticalSnapPreference() { + return SNAP_TO_START; + } +} \ No newline at end of file diff --git a/app/src/main/java/com/example/androidtermwork/WelcomePage.java b/app/src/main/java/com/example/androidtermwork/WelcomePage.java new file mode 100644 index 0000000..6953c9b --- /dev/null +++ b/app/src/main/java/com/example/androidtermwork/WelcomePage.java @@ -0,0 +1,37 @@ +package com.example.androidtermwork; + +import androidx.appcompat.app.AppCompatActivity; + +import android.annotation.SuppressLint; +import android.content.Intent; +import android.os.Bundle; +import android.os.Handler; +import android.os.Message; +import android.view.WindowManager; + +public class WelcomePage extends AppCompatActivity { + + @Override + protected void onCreate(Bundle savedInstanceState) { + super.onCreate(savedInstanceState); + setContentView(R.layout.activity_welcome_page); +// //设置全屏 +// getWindow().setFlags(WindowManager.LayoutParams.FLAG_FULLSCREEN, WindowManager.LayoutParams.FLAG_FULLSCREEN); +// //隐藏顶部标题栏 +// getSupportActionBar().hide(); + //设置延时时间 + handler.sendEmptyMessageDelayed(0,1000); + } + + @SuppressLint("HandlerLeak") + private Handler handler = new Handler() { + @Override + public void handleMessage(Message msg) { + //实现页面的跳转 + Intent intent = new Intent(WelcomePage.this, LoginPage.class); + startActivity(intent); + finish(); + super.handleMessage(msg); + } + }; +} diff --git a/app/src/main/java/com/example/androidtermwork/adpter/PointsItemAdapter.java b/app/src/main/java/com/example/androidtermwork/adpter/PointsItemAdapter.java new file mode 100644 index 0000000..c5de764 --- /dev/null +++ b/app/src/main/java/com/example/androidtermwork/adpter/PointsItemAdapter.java @@ -0,0 +1,263 @@ +package com.example.androidtermwork.adpter; + +import android.annotation.SuppressLint; +import android.app.Activity; +import android.content.Context; +import android.content.Intent; +import android.graphics.Color; +import android.text.SpannableString; +import android.text.Spanned; +import android.text.style.ForegroundColorSpan; +import android.view.LayoutInflater; +import android.view.View; +import android.view.ViewGroup; +import android.widget.BaseAdapter; +import android.widget.ImageView; +import android.widget.ProgressBar; +import android.widget.RelativeLayout; +import android.widget.TextView; + +import androidx.appcompat.app.AppCompatActivity; + +import com.example.androidtermwork.Activity1; +import com.example.androidtermwork.R; +import com.example.androidtermwork.pojo.PointSummary; +import com.example.androidtermwork.pojo.PointTask; +import com.example.androidtermwork.util.TestUtil; + +import org.w3c.dom.Text; + +import java.util.List; + +/** + * “学习积分”界面采用ListView,这是ListView的数据适配器。 + * 列表项中第一项是“积分概述”,之后的项都是“积分任务” + */ +public class PointsItemAdapter extends BaseAdapter { + + private static final int TYPE_SUMMARY = 0; //表示积分概述 + private static final int TYPE_TASK = 1; //表示积分任务 + private Context context; + private PointSummary summary; //积分概述 + private List pointTasks; //积分任务列表 + + public PointsItemAdapter(Context context, PointSummary summary, List pointTasks) { + super(); + this.context = context; + this.summary = summary; + this.pointTasks = pointTasks; + } + + @Override + public int getCount() { + return pointTasks.size() + 1; + } + + @Override + public Object getItem(int position) { + return null; + } + + @Override + public long getItemId(int position) { + return 0; + } + + @Override + public int getItemViewType(int position) { + return position == 0 ? TYPE_SUMMARY : TYPE_TASK; //只有第一个列表项是概述,之后的都是任务 + } + + @Override + public int getViewTypeCount() { + return 2; //概述、任务2种类型的item放在ListView中 + } + + @Override + public boolean isEnabled(int position) { + return false; + } + + @SuppressLint("InflateParams") + @Override + public View getView(int position, View convertView, ViewGroup parent) { + TaskSummaryViewHolder summaryHolder; + TaskViewHolder taskHolder; + switch (getItemViewType(position)) { + case TYPE_SUMMARY: { + if (convertView == null) { + convertView = LayoutInflater.from(context).inflate(R.layout.points_page_item_sum, null); + summaryHolder = buildSummaryViewHolder(convertView); + convertView.setTag(summaryHolder); + + } else { + summaryHolder = (TaskSummaryViewHolder) convertView.getTag(); + } + buildPointSummaryLayout(summaryHolder); + break; + } + + case TYPE_TASK: { + if (convertView == null) { + convertView = LayoutInflater.from(context).inflate(R.layout.points_page_item_task, null); + + RelativeLayout.LayoutParams layoutParams = new RelativeLayout.LayoutParams( + ViewGroup.LayoutParams.MATCH_PARENT, ViewGroup.LayoutParams.WRAP_CONTENT); + convertView.setLayoutParams(layoutParams); + taskHolder = buildTaskViewHolder(convertView); + + convertView.setTag(taskHolder); + } else { + taskHolder = (TaskViewHolder) convertView.getTag(); + } + buildPointTaskLayout(taskHolder, position - 1); + break; + } + } + return convertView; + } + + /** + * 获取积分概述布局中的组件,存放到其ViewHolder中 + * + * @param summaryView + * @return viewHolder + */ + private TaskSummaryViewHolder buildSummaryViewHolder(View summaryView) { + TaskSummaryViewHolder viewHolder = new TaskSummaryViewHolder(); + viewHolder.points = summaryView.findViewById(R.id.tvPoints); + viewHolder.danName = summaryView.findViewById(R.id.tvDanName); + viewHolder.pointsToday = summaryView.findViewById(R.id.tvPointsToday); + viewHolder.danStars = summaryView.findViewById(R.id.imgDanStar); + return viewHolder; + } + + /** + * 将“积分概览”的数据展示到布局中 + * + * @param viewHolder + */ + private void buildPointSummaryLayout(TaskSummaryViewHolder viewHolder) { + viewHolder.points.setText(String.valueOf(this.summary.getPoints())); + viewHolder.danName.setText(String.format(context.getString(R.string.dan_name), + this.summary.getDanName())); + viewHolder.danStars.setImageDrawable(context.getDrawable(summary.getDanStar())); + SpannableString pointsTodayString = + SpannableString.valueOf(String.format(context.getString(R.string.today_points), + summary.getPointsToday())); + + pointsTodayString.setSpan(new ForegroundColorSpan(Color.RED), 6, pointsTodayString.length(), + Spanned.SPAN_EXCLUSIVE_EXCLUSIVE); //标红 ”%d积分“ + viewHolder.pointsToday.setText(pointsTodayString); + } + + /** + * 获取积分任务布局中的组件,存放到其ViewHolder中 + * + * @param taskView + * @return + */ + private TaskViewHolder buildTaskViewHolder(View taskView) { + TaskViewHolder taskViewHolder = new TaskViewHolder(); + taskViewHolder.name = taskView.findViewById(R.id.taskName); + taskViewHolder.description = taskView.findViewById(R.id.taskDescription); + taskViewHolder.pointDetails = taskView.findViewById(R.id.taskPointsDetail); + taskViewHolder.go = taskView.findViewById(R.id.taskGo); + taskViewHolder.pointsProgress = taskView.findViewById(R.id.progress_bar_points); + + return taskViewHolder; + } + + /** + * 将“积分任务”的数据展示到其布局中 + * + * @param position + * @param viewHolder + */ + private void buildPointTaskLayout(TaskViewHolder viewHolder, int position) { + PointTask pointTaskData = this.pointTasks.get(position); + viewHolder.name.setText(pointTaskData.getName()); + viewHolder.description.setText(pointTaskData.getDescription()); + + int pointsToday = pointTaskData.getTodayPoints(); + int pointsLimit = pointTaskData.getPointsLimit(); + String pointDetails = String.format(context.getString(R.string.today_points_details), + pointsToday, pointsLimit); + viewHolder.pointDetails.setText(pointDetails); + viewHolder.pointsProgress.setProgress((int) ((double) pointsToday / pointsLimit * 100)); + //根据今日积分和积分上限判断今日该任务是否完成,未完成添加跳转界面的事件监听器 + String backColor = context.getString(R.string.background_todo); + String textColor = context.getString(R.string.text_todo); + String text = "去看看"; + + if (pointsToday == pointsLimit) { + backColor = context.getString(R.string.background_done); + textColor = context.getString(R.string.text_done); + text = "已完成"; + } + if (pointsToday < pointsLimit || pointTaskData.getGoAction().startsWith("new_")){ + viewHolder.go.setTag(pointTaskData.getGoAction()); //将动作描述设置为去做任务TextView的tag + viewHolder.go.setOnClickListener(new DoTaskClickListener(context)); + } + + viewHolder.go.setText(text); + viewHolder.go.setTextColor(Color.parseColor(textColor)); + viewHolder.go.setBackgroundColor(Color.parseColor(backColor)); + + } + + /** + * ViewHolder类,用于存放布局中组件,把它放在组件的Tag中。 + * 需要时可以直接获取它,通过它改掉布局中组件的显示内容等属性。 + */ + private static final class TaskSummaryViewHolder { + TextView points; //总积分 + TextView pointsToday; //今日已累积积分 + TextView danName; //段位名称 + ImageView danStars; //段位星星数图片 + } + + private static final class TaskViewHolder { + TextView name; //任务名称 + TextView description; //任务描述 + TextView pointDetails; //积分详情 + TextView go; //去做任务 + ProgressBar pointsProgress; //积分进度条 + } +} + +//点击去做任务的事件监听器 +class DoTaskClickListener implements View.OnClickListener { + + private Context context; + + public DoTaskClickListener(Context context) { + this.context = context; + } + + @Override + public void onClick(View v) { + String task = (String) v.getTag(); + AppCompatActivity activity = (AppCompatActivity) context; + if (task.startsWith("res_")) { + + activity.setResult(Activity.RESULT_OK, new Intent().putExtra("goAction", task)); + activity.finish(); + return; + } + + //TestUtil.showSnakeBarMessage(task, -1, v); + switch (task){ + case "new_dailyQ": + Intent intent = new Intent(context, Activity1.class); + context.startActivity(intent); + break; + case "new_weeklyQ": + Intent intent1 = new Intent(context, Activity1.class); + context.startActivity(intent1); + break; + //case... + } + activity.finish(); + } +} diff --git a/app/src/main/java/com/example/androidtermwork/adpter/TVDetailsCommentsAdapter.java b/app/src/main/java/com/example/androidtermwork/adpter/TVDetailsCommentsAdapter.java new file mode 100644 index 0000000..910e577 --- /dev/null +++ b/app/src/main/java/com/example/androidtermwork/adpter/TVDetailsCommentsAdapter.java @@ -0,0 +1,281 @@ +package com.example.androidtermwork.adpter; + +import android.content.Context; +import android.view.LayoutInflater; +import android.view.View; +import android.view.ViewGroup; +import android.widget.CheckBox; +import android.widget.ImageView; +import android.widget.LinearLayout; +import android.widget.RelativeLayout; +import android.widget.TextView; + +import androidx.annotation.NonNull; +import androidx.core.content.ContextCompat; +import androidx.recyclerview.widget.RecyclerView; + +import com.android.volley.RequestQueue; +import com.android.volley.toolbox.ImageLoader; +import com.android.volley.toolbox.Volley; +import com.example.androidtermwork.R; +import com.example.androidtermwork.pojo.TvComment; +import com.example.androidtermwork.pojo.TvDetails; +import com.example.androidtermwork.util.FormatUtil; +import com.example.androidtermwork.util.TestUtil; +import com.example.androidtermwork.volley.BitmapCache; + +import java.util.List; + +import de.hdodenhof.circleimageview.CircleImageView; + + +public class TVDetailsCommentsAdapter extends RecyclerView.Adapter { + + private TvDetails tvDetails; + private List tvComments; + private static final int DETAILS = 0; + private static final int COMMENT = 1; + private static final int HINT_NO_COMMENT = 2; + private static boolean isMoreInfoOpened = false; + private RequestQueue requestQueue; + private ImageLoader imageLoader; + private Context context; + public TVDetailsCommentsAdapter(Context context){ + this.context = context; + requestQueue = Volley.newRequestQueue(context); + imageLoader = new ImageLoader(requestQueue, new BitmapCache()); + } + @NonNull + @Override + public RecyclerView.ViewHolder onCreateViewHolder(@NonNull ViewGroup parent, int viewType) { + RecyclerView.ViewHolder viewHolder; + View view; + switch (viewType){ + case DETAILS: + view = LayoutInflater.from(parent.getContext()).inflate(R.layout.tv_play_details_item, parent, false); + viewHolder = new TvDetailsViewHolder(view); + break; + case COMMENT: + view = LayoutInflater.from(parent.getContext()).inflate(R.layout.tv_play_comment_item, parent, false); + viewHolder = new TvCommentsViewHolder(view); + break; + default: // case HINT_NO_COMMENT: + view = LayoutInflater.from(parent.getContext()).inflate(R.layout.tv_play_hint_item_nocomment, parent, false); + viewHolder = new RecyclerView.ViewHolder(view){}; + break; + } + + return viewHolder; + } + + @Override + public void onBindViewHolder(@NonNull RecyclerView.ViewHolder holder, int position) { + if (holder instanceof TvDetailsViewHolder){ + bindDetailsData(holder); + } else if (holder instanceof TvCommentsViewHolder){ + bindCommentData(holder, position); + } + } + + private void bindCommentData(RecyclerView.ViewHolder viewHolder, int position) { + TvCommentsViewHolder holder = (TvCommentsViewHolder) viewHolder; + TvComment comment = tvComments.get(position - 1); + //请求并设置头像 + if (comment.getUserHead() != null) { + imageLoader.get(comment.getUserHead(), + ImageLoader.getImageListener(holder.userHeadImage, R.mipmap.loading_head_portrait, R.mipmap.default_head_portrait)); + } else { + holder.userHeadImage.setImageResource(R.mipmap.default_head_portrait); + } + + //设置用户名 + holder.userName.setText(comment.getUserName()); + //设置评论内容 + holder.commentContent.setText(comment.getCommentContent()); + //设置评论发表时间 + holder.commentDate.setText(comment.getCommentDate()); + //设置点赞 + holder.setFeelGood(comment.getFeelGoodCounts(), comment.isFeelGood()); + //设置点赞事件监听(测试,跳过接口调用) + holder.feelGoodHub.setOnClickListener(new View.OnClickListener() { + @Override + public void onClick(View v) { + if (comment.isFeelGood()){ + comment.setFeelGood(false); + comment.setFeelGoodCounts(comment.getFeelGoodCounts() - 1); + } else { + comment.setFeelGood(true); + comment.setFeelGoodCounts(comment.getFeelGoodCounts() + 1); + } + holder.setFeelGood(comment.getFeelGoodCounts(), comment.isFeelGood()); + } + }); + //todo 设置点击回复事件监听 + + } + + private void bindDetailsData(RecyclerView.ViewHolder viewHolder) { + TvDetailsViewHolder holder = (TvDetailsViewHolder) viewHolder; + //设置视频标题 + holder.title.setText(tvDetails.getTitle()); + //设置作者和发布时间 + String authorAndDate = tvDetails.getAuthor() + " " + tvDetails.getDate(); + holder.authorAndDate.setText(authorAndDate); + //设置播放量 + String playCounts = "播放 " + FormatUtil.simpleFormat(tvDetails.getPlayCounts()); + holder.playCounts.setText(playCounts); + //设置点赞数 + holder.setFeelGood(tvDetails.getFeelGoodCounts(), tvDetails.isFeelGood()); + //点赞数事件监听 + holder.feelGood.setOnClickListener(new View.OnClickListener() { + @Override + public void onClick(View v) { + if (!tvDetails.isFeelGood()){ + // 调用相关接口,成功后增加点赞数 + //测试,跳过接口调用 + tvDetails.setFeelGoodCounts(tvDetails.getFeelGoodCounts() + 1); + tvDetails.setFeelGood(true); + } else { + //调用相关接口,成功后减少点赞数 + //测试,跳过接口调用 + tvDetails.setFeelGoodCounts(tvDetails.getFeelGoodCounts() - 1); + tvDetails.setFeelGood(false); + } + holder.setFeelGood(tvDetails.getFeelGoodCounts(), tvDetails.isFeelGood()); + } + }); + //设置简介 + holder.introduction.setText(tvDetails.getIntroduction()); + + //设置更多信息和展开更多信息 + holder.moreInfo.setVisibility(View.GONE); + if (tvDetails.getMoreInfo() == null || tvDetails.getMoreInfo().length() == 0) { + holder.openOrCloseHub.setVisibility(View.GONE); + + } else { + holder.moreInfo.setText(tvDetails.getMoreInfo()); + holder.openOrCloseHub.setOnClickListener(view -> { + ImageView openOrClose = view.findViewById(R.id.tvPlay_openOrCloseImage); + if (isMoreInfoOpened){ + isMoreInfoOpened = false; + openOrClose.setRotation(0f); + holder.moreInfo.setVisibility(View.GONE); + } else { + isMoreInfoOpened = true; + openOrClose.setRotation(180f); + holder.moreInfo.setVisibility(View.VISIBLE); + } + }); + } + + } + + @Override + public int getItemCount() { + int t = tvComments.size() + 1; + return t == 1 ? 2 : t; + } + + @Override + public int getItemViewType(int position) { + int type = COMMENT; + if (tvComments.size() == 0){ + type = HINT_NO_COMMENT; + } + return position == 0 ? DETAILS : type; + } + + public TvDetails getTvDetails() { + return tvDetails; + } + + public void setTvDetails(TvDetails tvDetails) { + this.tvDetails = tvDetails; + } + + public List getTvComments() { + return tvComments; + } + + public void setTvComments(List tvComments) { + this.tvComments = tvComments; + } + + class TvDetailsViewHolder extends RecyclerView.ViewHolder { + + TextView title; + TextView authorAndDate; + TextView moreInfo; + TextView playCounts; + CheckBox feelGood; + TextView introduction; + RelativeLayout openOrCloseHub; + public TvDetailsViewHolder(@NonNull View itemView) { + super(itemView); + title = itemView.findViewById(R.id.title); + authorAndDate = itemView.findViewById(R.id.authorAndDate); + moreInfo = itemView.findViewById(R.id.moreInfo); + playCounts = itemView.findViewById(R.id.playCounts); + feelGood = itemView.findViewById(R.id.feelGood); + introduction = itemView.findViewById(R.id.introduction); + openOrCloseHub = itemView.findViewById(R.id.tvPlay_openOrCloseHub); + } + + /** + * 设置视频点赞 + * @param counts + * @param status + */ + private void setFeelGood(long counts, boolean status){ + String feelGoodCounts = "点赞 " + FormatUtil.simpleFormat(counts); + feelGood.setText(feelGoodCounts); + feelGood.setChecked(status); + } + } + + class TvCommentsViewHolder extends RecyclerView.ViewHolder{ + + CircleImageView userHeadImage; + TextView userName; + TextView feelGoodCounts; + ImageView feelGood; + TextView commentContent; + TextView commentDate; + TextView reply; + LinearLayout feelGoodHub; + public TvCommentsViewHolder(@NonNull View itemView) { + super(itemView); + userHeadImage = itemView.findViewById(R.id.userHeadImage); + userName = itemView.findViewById(R.id.userName); + feelGoodCounts = itemView.findViewById(R.id.commentFeelGoodCounts); + feelGood = itemView.findViewById(R.id.commentFeelGood); + commentContent = itemView.findViewById(R.id.commentContent); + commentDate = itemView.findViewById(R.id.commentDate); + reply = itemView.findViewById(R.id.replyComment); + feelGoodHub = itemView.findViewById(R.id.commentFeelGoodHub); + } + + + /** + * 设置评论点赞 + * @param counts + * @param status + */ + private void setFeelGood(long counts, boolean status){ + String feelGoodCounts = String.valueOf(counts); + if (counts > 10000){ + feelGoodCounts = String.format("%.2f万", FormatUtil.getFloorCount(counts) /10000.0); + //feelGoodCounts = counts / 10000.0 + "万"; + } + this.feelGoodCounts.setText(feelGoodCounts); + if (status){ + feelGood.setImageDrawable(ContextCompat.getDrawable(context, R.drawable.feel_good)); + } else { + feelGood.setImageDrawable(ContextCompat.getDrawable(context, R.drawable.ic_feel_good)); + } + } + + + } + +} diff --git a/app/src/main/java/com/example/androidtermwork/adpter/TVStationAdapter.java b/app/src/main/java/com/example/androidtermwork/adpter/TVStationAdapter.java new file mode 100644 index 0000000..1a38703 --- /dev/null +++ b/app/src/main/java/com/example/androidtermwork/adpter/TVStationAdapter.java @@ -0,0 +1,131 @@ +package com.example.androidtermwork.adpter; + +import android.content.Context; +import android.view.LayoutInflater; +import android.view.View; +import android.view.ViewGroup; +import android.widget.BaseAdapter; +import android.widget.ImageView; +import android.widget.TextView; + +import com.android.volley.RequestQueue; +import com.android.volley.toolbox.ImageLoader; +import com.android.volley.toolbox.Volley; +import com.example.androidtermwork.R; +import com.example.androidtermwork.pojo.TVStation; +import com.example.androidtermwork.volley.BitmapCache; + +import java.util.List; + + +public class TVStationAdapter extends BaseAdapter { + private static final int BIG_COVER_TV = 0; + //private static final int STD_COVER_TV = 1; + private Context context; + private List tvStations; + private RequestQueue mQueue; + private ImageLoader imageLoader; + + public TVStationAdapter(Context context, List tvStations) { + this.context = context; + this.tvStations = tvStations; + mQueue = Volley.newRequestQueue(context); + imageLoader = new ImageLoader(mQueue, new BitmapCache()); + } + + public Context getContext() { + return context; + } + public void setContext(Context context) { + this.context = context; + } + public List getTvStations() { + return tvStations; + } + public void setTvStations(List tvStations) { + this.tvStations = tvStations; + } + + @Override + public int getCount() { + return tvStations.size(); + } + + @Override + public Object getItem(int position) { + return tvStations.get(position); + } + + @Override + public long getItemId(int position) { + return tvStations.get(position).getId(); + } + + @Override + public View getView(int position, View convertView, ViewGroup parent) { + TVStationViewHolder viewHolder; + TVStation tvStation = tvStations.get(position); + if (convertView != null){ + viewHolder = (TVStationViewHolder) convertView.getTag(); + bindItemData(tvStation, viewHolder); + return convertView; + } + switch (tvStation.getItemType()){ + case BIG_COVER_TV: + convertView = LayoutInflater.from(context).inflate(R.layout.tv_station_big_item, null); + break; + default: convertView = LayoutInflater.from(context).inflate(R.layout.tv_station_standard_item, null); + } + ViewGroup.MarginLayoutParams layoutParams = new ViewGroup.MarginLayoutParams(ViewGroup.LayoutParams.MATCH_PARENT, + ViewGroup.LayoutParams.WRAP_CONTENT); + convertView.setLayoutParams(layoutParams); + viewHolder = buildTVStationViewHolder(convertView); + bindItemData(tvStation, viewHolder); + convertView.setTag(viewHolder); + return convertView; + } + + private void bindItemData(TVStation tvStation, TVStationViewHolder viewHolder) { + //设置标题 + viewHolder.title.setText(tvStation.getTitle()); + //设置作者和发布时间 + String authorAndDate = tvStation.getAuthor() + " " + tvStation.getDate(); + viewHolder.authorAndDate.setText(authorAndDate); + //设置视频时长 + int minutes = tvStation.getTimeLength()/60; + int seconds = tvStation.getTimeLength()%60; + String timeLength = minutes + ":" + seconds; + viewHolder.timeLength.setText(timeLength); + + //请求封面图片 + imageLoader.get(tvStation.getCover(), + ImageLoader.getImageListener(viewHolder.cover, R.mipmap.img_loading, R.mipmap.img_fail_to_load)); + + //viewHolder.cover.setImageURI(Uri.parse(tvStation.getCover())); + + } + + private TVStationViewHolder buildTVStationViewHolder(View convertView) { + TVStationViewHolder viewHolder = new TVStationViewHolder(); + viewHolder.cover = convertView.findViewById(R.id.tvImgCover); + viewHolder.title = convertView.findViewById(R.id.tvTitle); + viewHolder.timeLength = convertView.findViewById(R.id.tvTimeLength); + viewHolder.authorAndDate = convertView.findViewById(R.id.tvAuthorDate); + return viewHolder; + } + + @Override + public int getViewTypeCount() { + return 2; //大图片封面和小封面图片两种电视台 + } + + /** + * “电视台”ViewHolder + */ + private static final class TVStationViewHolder { + ImageView cover; //封面图片 + TextView title; //标题 + TextView authorAndDate; //作者和发布时间 + TextView timeLength; //视频时长 + } +} \ No newline at end of file diff --git a/app/src/main/java/com/example/androidtermwork/pojo/PointSummary.java b/app/src/main/java/com/example/androidtermwork/pojo/PointSummary.java new file mode 100644 index 0000000..7b72eaf --- /dev/null +++ b/app/src/main/java/com/example/androidtermwork/pojo/PointSummary.java @@ -0,0 +1,51 @@ +package com.example.androidtermwork.pojo; + +//积分概览 +public class PointSummary +{ + private int points; //总积分 + private int pointsToday; //今日已累积积分 + private int dan; //段位 + private String danName; //段位名称 + private int danStar; //段位星星图片id + + public int getPoints() { + return points; + } + + public void setPoints(int points) { + this.points = points; + } + + public int getPointsToday() { + return pointsToday; + } + + public void setPointsToday(int pointsToday) { + this.pointsToday = pointsToday; + } + + public String getDanName() { + return danName; + } + + public void setDanName(String danName) { + this.danName = danName; + } + + public int getDanStar() { + return danStar; + } + + public void setDanStar(int danStar) { + this.danStar = danStar; + } + + public int getDan() { + return dan; + } + + public void setDan(int dan) { + this.dan = dan; + } +} diff --git a/app/src/main/java/com/example/androidtermwork/pojo/PointTask.java b/app/src/main/java/com/example/androidtermwork/pojo/PointTask.java new file mode 100644 index 0000000..696172e --- /dev/null +++ b/app/src/main/java/com/example/androidtermwork/pojo/PointTask.java @@ -0,0 +1,51 @@ +package com.example.androidtermwork.pojo; + +//积分任务 +public class PointTask +{ + private String name; // 任务名 + private String description; // 任务描述 + private int todayPoints; // 今日已获积分 + private int pointsLimit; // 任务积分上限 + private String goAction; // 表示点击去做任务后的动作 + + public String getName() { + return name; + } + + public void setName(String name) { + this.name = name; + } + + public String getGoAction() { + return goAction; + } + + public void setGoAction(String goAction) { + this.goAction = goAction; + } + + public String getDescription() { + return description; + } + + public void setDescription(String description) { + this.description = description; + } + + public int getTodayPoints() { + return todayPoints; + } + + public void setTodayPoints(int todayPoints) { + this.todayPoints = todayPoints; + } + + public int getPointsLimit() { + return pointsLimit; + } + + public void setPointsLimit(int pointsLimit) { + this.pointsLimit = pointsLimit; + } +} diff --git a/app/src/main/java/com/example/androidtermwork/pojo/TVStation.java b/app/src/main/java/com/example/androidtermwork/pojo/TVStation.java new file mode 100644 index 0000000..a8d87c7 --- /dev/null +++ b/app/src/main/java/com/example/androidtermwork/pojo/TVStation.java @@ -0,0 +1,78 @@ +package com.example.androidtermwork.pojo; + +public class TVStation +{ + private long id; + private String cover; + private String videoSource; + private String author; + private String date; + private int timeLength; + private int itemType; + private String title; + + + public long getId() { + return id; + } + + public void setId(long id) { + this.id = id; + } + + public String getTitle() { + return title; + } + + public void setTitle(String title) { + this.title = title; + } + + public String getCover() { + return cover; + } + + public void setCover(String cover) { + this.cover = cover; + } + + public String getVideoSource() { + return videoSource; + } + + public void setVideoSource(String videoSource) { + this.videoSource = videoSource; + } + + public String getAuthor() { + return author; + } + + public void setAuthor(String author) { + this.author = author; + } + + public String getDate() { + return date; + } + + public void setDate(String date) { + this.date = date; + } + + public int getTimeLength() { + return timeLength; + } + + public void setTimeLength(int timeLength) { + this.timeLength = timeLength; + } + + public int getItemType() { + return itemType; + } + + public void setItemType(int itemType) { + this.itemType = itemType; + } +} diff --git a/app/src/main/java/com/example/androidtermwork/pojo/TvComment.java b/app/src/main/java/com/example/androidtermwork/pojo/TvComment.java new file mode 100644 index 0000000..553112c --- /dev/null +++ b/app/src/main/java/com/example/androidtermwork/pojo/TvComment.java @@ -0,0 +1,67 @@ +package com.example.androidtermwork.pojo; + +public class TvComment { + private String userHead; + private String userId; + private String userName; + private long feelGoodCounts; + private boolean isFeelGood; + private String commentContent; + private String commentDate; + + public String getUserHead() { + return userHead; + } + + public void setUserHead(String userHead) { + this.userHead = userHead; + } + + public String getUserId() { + return userId; + } + + public void setUserId(String userId) { + this.userId = userId; + } + + public String getUserName() { + return userName; + } + + public void setUserName(String userName) { + this.userName = userName; + } + + public long getFeelGoodCounts() { + return feelGoodCounts; + } + + public void setFeelGoodCounts(long feelGoodCounts) { + this.feelGoodCounts = feelGoodCounts; + } + + public boolean isFeelGood() { + return isFeelGood; + } + + public void setFeelGood(boolean feelGood) { + isFeelGood = feelGood; + } + + public String getCommentContent() { + return commentContent; + } + + public void setCommentContent(String commentContent) { + this.commentContent = commentContent; + } + + public String getCommentDate() { + return commentDate; + } + + public void setCommentDate(String commentDate) { + this.commentDate = commentDate; + } +} diff --git a/app/src/main/java/com/example/androidtermwork/pojo/TvDetails.java b/app/src/main/java/com/example/androidtermwork/pojo/TvDetails.java new file mode 100644 index 0000000..1a803aa --- /dev/null +++ b/app/src/main/java/com/example/androidtermwork/pojo/TvDetails.java @@ -0,0 +1,103 @@ +package com.example.androidtermwork.pojo; + +public class TvDetails { + private long id; + private String title; + private String author; + private String date; + private String moreInfo; + private long playCounts; + private long feelGoodCounts; + private String introduction; + private boolean isFeelGood; + private boolean isCollect; + private String sourceUrl; + + public String getTitle() { + return title; + } + + public void setTitle(String title) { + this.title = title; + } + + public String getAuthor() { + return author; + } + + public void setAuthor(String author) { + this.author = author; + } + + public String getDate() { + return date; + } + + public void setDate(String date) { + this.date = date; + } + + public String getMoreInfo() { + return moreInfo; + } + + public void setMoreInfo(String moreInfo) { + this.moreInfo = moreInfo; + } + + public long getPlayCounts() { + return playCounts; + } + + public void setPlayCounts(long playCounts) { + this.playCounts = playCounts; + } + + public long getFeelGoodCounts() { + return feelGoodCounts; + } + + public void setFeelGoodCounts(long feelGoodCounts) { + this.feelGoodCounts = feelGoodCounts; + } + + public String getIntroduction() { + return introduction; + } + + public void setIntroduction(String introduction) { + this.introduction = introduction; + } + + public boolean isFeelGood() { + return isFeelGood; + } + + public void setFeelGood(boolean feelGood) { + isFeelGood = feelGood; + } + + public long getId() { + return id; + } + + public void setId(long id) { + this.id = id; + } + + public boolean isCollect() { + return isCollect; + } + + public void setCollect(boolean collect) { + isCollect = collect; + } + + public String getSourceUrl() { + return sourceUrl; + } + + public void setSourceUrl(String sourceUrl) { + this.sourceUrl = sourceUrl; + } +} diff --git a/app/src/main/java/com/example/androidtermwork/ui/dashboard/DashboardFragment.java b/app/src/main/java/com/example/androidtermwork/ui/dashboard/DashboardFragment.java new file mode 100644 index 0000000..822005c --- /dev/null +++ b/app/src/main/java/com/example/androidtermwork/ui/dashboard/DashboardFragment.java @@ -0,0 +1,140 @@ +package com.example.androidtermwork.ui.dashboard; + +import android.content.Intent; +import android.os.Bundle; +import android.view.LayoutInflater; +import android.view.View; +import android.view.ViewGroup; +import android.widget.AdapterView; +import android.widget.ListView; +import android.widget.SimpleAdapter; + +import androidx.annotation.NonNull; +import androidx.fragment.app.Fragment; + +import com.example.androidtermwork.R; +import com.example.androidtermwork.webView; + +import java.util.ArrayList; +import java.util.Arrays; +import java.util.HashMap; +import java.util.List; +import java.util.Map; + +class News { + public String title; + public String resource; + public String title2; + public String time; + public String article; + public String editor; + + public News(String title, String resource, String title2, String time, String article, String editor) { + this.title = title; + this.resource = resource; + this.title2 = title2; + this.time = time; + this.article = article; + this.editor = editor; + } +} + +public class DashboardFragment extends Fragment { + public static List newLists = Arrays.asList( + new News("中国共产党第十九届中央委员会第六次全体会议公报", + "“学习强国”学习平台", + "中国共产党第十九届中央委员会第六次全体会议公报(2021年11月11日中国共产党第十九届中央委员会第六次全体会议通过)", + "2021-11-12", + "中国共产党第十九届中央委员会第六次全体会议,于2021年11月8日至11日在北京举行。\\n' +\n" + + " '出席这次全会的有,中央委员197人,候补中央委员151人。中央纪律检查委员会常务委员会委员和有关方面负责同志列席会议。\\n' +\n" + + " '全会由中央政治局主持。中央委员会总书记习近平作了重要讲话。\\n' +\n" + + " '全会听取和讨论了习近平受中央政治局委托作的工作报告,审议通过了《中共中央关于党的百年奋斗重大成就和历史经验的决议》,审议通过了《关于召开党的第二十次全国代表大会的决议》。习近平就《中共中央关于党的百年奋斗重大成就和历史经验的决议(讨论稿)》向全会作了说明。\\n' +\n" + + " '全会认为,总结党的百年奋斗重大成就和历史经验,是在建党百年历史条件下开启全面建设社会主义现代化国家新征程、在新时代坚持和发展中国特色社会主义的需要;是增强政治意识、大局意识、核心意识、看齐意识,坚定道路自信、理论自信、制度自信、文化自信,做到坚决维护习近平同志党中央的核心、全党的核心地位,坚决维护党中央权威和集中统一领导,确保全党步调一致向前进的需要;是推进党的自我革命、提高全党斗争本领和应对风险挑战能力、永葆党的生机活力、团结带领全国各族人民为实现中华民族伟大复兴的中国梦而继续奋斗的需要。全党要坚持唯物史观和正确党史观,从党的百年奋斗中看清楚过去我们为什么能够成功、弄明白未来我们怎样才能继续成功,从而更加坚定、更加自觉地践行初心使命,在新时代更好坚持和发展中国特色社会主义。", + "秦辰宇"), + new News("习近平主持召开中央政治局会议 分析研究2022年经济工作", "“学习强国”学习平台", + "征求对经济工作的意见和建议\n" + + "\n" + + "中共中央召开党外人士座谈会\n" + + "\n" + + "习近平主持并发表重要讲话\n" + + "\n" + + "李克强通报有关情况 汪洋王沪宁韩正出席", + "2021-12-06", + "新华社北京12月6日电 12月2日,中共中央在中南海召开党外人士座谈会,就今年经济形势和明年经济工作听取各民主党派中央、全国工商联负责人和无党派人士代表的意见和建议。中共中央总书记习近平主持座谈会并发表重要讲话强调,要全面贯彻落实中共十九届六中全会精神,重温多党合作的历程和作用,发扬光荣传统,坚守合作初心,围绕宏观政策要稳健有效、微观政策要激发市场主体活力、改革开放政策要增强发展动力、社会政策要兜住民生底线,积极履行职能,加强自身建设,引导广大成员和所联系群众把会议精神转化为共同奋斗的政治共识,在全面建设社会主义现代化国家新征程中继续团结奋斗。\n" + + "\n" + + "座谈会上,民革中央主席万鄂湘、民盟中央主席丁仲礼、民建中央主席郝明金、民进中央主席蔡达峰、农工党中央主席陈竺、致公党中央常务副主席蒋作君、九三学社中央主席武维华、台盟中央主席苏辉、全国工商联主席高云龙、无党派人士代表宇如聪先后发言。他们完全赞同中共中央对当前我国经济形势的分析判断和明年经济工作的谋划考虑,并就加强宏观调控、提升政策效能,改善进出口结构、促进内外贸一体化,提高生产制造装备水平、加快我国高端制造业发展,健全人口服务体系、激发内需增长潜力,完善我国疫情防控策略、为稳增长打牢扎实基础,强化法治保障和政策引领、科学有序推进“双碳”目标,转变涉企财税支持方式、提高财政收入质量,加强农村生态环境治理、夯实乡村振兴基础,加大改革力度、助力推进共同富裕,强化中小企业发展政策导向和可持续发展能力,发挥民企在促进共同富裕中积极作用,完善科技领域“揭榜挂帅”工作机制,加快推动省际交界地区协同发展等提出意见建议。", + "张秋兰"), + new News("习近平主持党外人士座谈会并发表重要讲话", "“学习强国”学习平台", + "", + "2021-12-06", + "", "张玙蕗"), + new News("国家主席习近平任免驻外大使", "“学习强国”学习平台", + "", + "2021-12-03", + "", "齐翼"), + new News("习近平向“2021从都国际论坛”开幕式发表视频致辞", + "“学习强国”学习平台", + "", + "2021-12-05", + "", "秦辰宇"), + new News("习近平同老挝人民革命党中央总书记、国家主席通伦共同出席中老铁路通车仪式", + "“学习强国”学习平台", + "", + "2021-12-03", + "", "胡佳"), + new News("习近平向中国-拉共体论坛第三届部长会议发表视频致辞", + "“学习强国”学习平台", + "", + "2021-12-03", + "", "齐翼"), + new News("习近平出席全国宗教工作会议并发表重要讲话", + "“学习强国”学习平台", + "", + "2021-12-04", + "", "秦辰宇")); + + private DashboardViewModel dashboardViewModel; + + public View onCreateView(@NonNull LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) { +// dashboardViewModel = +// ViewModelProviders.of(this).get(DashboardViewModel.class); + View root = inflater.inflate(R.layout.fragment_dashboard, container, false); + final ListView listView = root.findViewById(R.id.newsList); +// dashboardViewModel.getText().observe(this, new Observer() { +// @Override +// public void onChanged(@Nullable String s) { +// } +// }); + updateListView(listView); + return root; + } + + public void updateListView(ListView listView) { + final List> listItem = new ArrayList<>(); + for (int i = 0; i < newLists.size(); i++) { + Map tempMap = new HashMap<>(); + tempMap.put("title", newLists.get(i).title); + tempMap.put("resource", newLists.get(i).resource + newLists.get(i).time); + listItem.add(tempMap); + } + SimpleAdapter mAdapter = new SimpleAdapter(getActivity(), listItem, R.layout.news_list_item, new String[]{"title", "resource"}, new int[]{R.id.title, R.id.resource}); + listView.setAdapter(mAdapter); + listView.setOnItemClickListener(new AdapterView.OnItemClickListener() { + @Override + public void onItemClick(AdapterView adapterView, View view, int i, long l) { + //跳转页面,显示详细信息 + Intent intent = new Intent(getActivity(), webView.class); + Bundle bundle = new Bundle(); + bundle.putString("title", newLists.get(i).title); + bundle.putString("resource", newLists.get(i).resource); + bundle.putString("title2", newLists.get(i).title2); + bundle.putString("time", newLists.get(i).time); + bundle.putString("article", newLists.get(i).article); + bundle.putString("editor", newLists.get(i).editor); + intent.putExtras(bundle); + startActivity(intent); + } + }); + } + +} \ No newline at end of file diff --git a/app/src/main/java/com/example/androidtermwork/ui/dashboard/DashboardViewModel.java b/app/src/main/java/com/example/androidtermwork/ui/dashboard/DashboardViewModel.java new file mode 100644 index 0000000..2f9821f --- /dev/null +++ b/app/src/main/java/com/example/androidtermwork/ui/dashboard/DashboardViewModel.java @@ -0,0 +1,32 @@ +package com.example.androidtermwork.ui.dashboard; + +import android.content.Intent; +import android.view.View; +import android.widget.AdapterView; +import android.widget.ListView; +import android.widget.SimpleAdapter; + +import androidx.lifecycle.LiveData; +import androidx.lifecycle.MutableLiveData; +import androidx.lifecycle.ViewModel; + +import com.example.androidtermwork.R; +import com.example.androidtermwork.webView; + +import java.util.ArrayList; +import java.util.HashMap; +import java.util.List; +import java.util.Map; + +public class DashboardViewModel extends ViewModel { + + private MutableLiveData listView; + + public DashboardViewModel() { + listView = new MutableLiveData<>(); + } + + public LiveData getListView() { + return listView; + } +} \ No newline at end of file diff --git a/app/src/main/java/com/example/androidtermwork/ui/home/HomeFragment.java b/app/src/main/java/com/example/androidtermwork/ui/home/HomeFragment.java new file mode 100644 index 0000000..33c6695 --- /dev/null +++ b/app/src/main/java/com/example/androidtermwork/ui/home/HomeFragment.java @@ -0,0 +1,73 @@ +package com.example.androidtermwork.ui.home; + +import android.content.Intent; +import android.os.Bundle; +import android.view.LayoutInflater; +import android.view.View; +import android.view.ViewGroup; +import android.widget.AdapterView; +import android.widget.ListView; +import android.widget.SimpleAdapter; +import android.widget.Toast; + +import androidx.annotation.NonNull; +import androidx.fragment.app.Fragment; + +import com.example.androidtermwork.ChatActivity; +import com.example.androidtermwork.R; + +import java.util.ArrayList; +import java.util.Arrays; +import java.util.HashMap; +import java.util.List; +import java.util.Map; + +class chat { + public int img; + public String name; + public String word; + public String date; + + public chat(int img, String name, String word, String date) { + this.img = img; + this.name = name; + this.word = word; + this.date = date; + } +} + +public class HomeFragment extends Fragment { + + public static List chatLists = Arrays.asList( + new chat(R.mipmap.tx1, "学习强国助手1", "关注进博会,游世界展馆,看……","11月1日"), + new chat(R.mipmap.tx2, "学习强国助手2", "关注进博会,游世界展馆,看……","11月3日")); + + public View onCreateView(@NonNull LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) { + View root = inflater.inflate(R.layout.fragment_home, container, false); + final ListView listView = root.findViewById(R.id.listview); + updateListView(listView); + return root; + } + + public void updateListView(ListView listView) { + final List> listItem = new ArrayList<>(); + for (int i = 0; i < chatLists.size(); i++) { + Map tempMap = new HashMap<>(); + tempMap.put("img", chatLists.get(i).img); + tempMap.put("name", chatLists.get(i).name); + tempMap.put("word", chatLists.get(i).word); + tempMap.put("date", chatLists.get(i).date); + listItem.add(tempMap); + } + SimpleAdapter mAdapter = new SimpleAdapter(getActivity(), listItem, R.layout.chat_list_item, new String[]{"img", "name", "word", "date"}, new int[]{R.id.img, R.id.name, R.id.word, R.id.date}); + listView.setAdapter(mAdapter); + listView.setOnItemClickListener(new AdapterView.OnItemClickListener() { + @Override + public void onItemClick(AdapterView parent, View view, int position, long id) { + //Toast.makeText(getActivity(),chatLists.get(position).name,Toast.LENGTH_SHORT).show(); + Intent intent = new Intent(getActivity(), ChatActivity.class); + startActivity(intent); + } + }); + } +} \ No newline at end of file diff --git a/app/src/main/java/com/example/androidtermwork/ui/home/HomeViewModel.java b/app/src/main/java/com/example/androidtermwork/ui/home/HomeViewModel.java new file mode 100644 index 0000000..01cef41 --- /dev/null +++ b/app/src/main/java/com/example/androidtermwork/ui/home/HomeViewModel.java @@ -0,0 +1,19 @@ +package com.example.androidtermwork.ui.home; + +import androidx.lifecycle.LiveData; +import androidx.lifecycle.MutableLiveData; +import androidx.lifecycle.ViewModel; + +public class HomeViewModel extends ViewModel { + + private MutableLiveData mText; + + public HomeViewModel() { + mText = new MutableLiveData<>(); + mText.setValue("This is 强国通 fragment"); + } + + public LiveData getText() { + return mText; + } +} \ No newline at end of file diff --git a/app/src/main/java/com/example/androidtermwork/ui/notifications/NotificationsFragment.java b/app/src/main/java/com/example/androidtermwork/ui/notifications/NotificationsFragment.java new file mode 100644 index 0000000..99abf7b --- /dev/null +++ b/app/src/main/java/com/example/androidtermwork/ui/notifications/NotificationsFragment.java @@ -0,0 +1,170 @@ +package com.example.androidtermwork.ui.notifications; + +import android.content.Intent; +import android.os.Bundle; +import android.os.Handler; +import android.os.Looper; +import android.os.Message; +import android.view.LayoutInflater; +import android.view.View; +import android.view.ViewGroup; +import android.widget.AdapterView; +import android.widget.BaseAdapter; +import android.widget.ListView; + +import androidx.annotation.NonNull; +import androidx.fragment.app.Fragment; + + +import com.example.androidtermwork.R; +import com.example.androidtermwork.TvStationPlayPage; +import com.example.androidtermwork.adpter.TVStationAdapter; +import com.example.androidtermwork.pojo.TVStation; +import com.example.androidtermwork.util.TestUtil; +import com.scwang.smart.refresh.layout.SmartRefreshLayout; +import com.scwang.smart.refresh.layout.api.RefreshLayout; + +import java.util.ArrayList; +import java.util.HashMap; +import java.util.List; +import java.util.Map; + + +/** + * 这是电视台Fragment + */ +public class NotificationsFragment extends Fragment { + + private View bindingView; + private ListView TVListView; + private SmartRefreshLayout refreshLayout; + //private Gson gson; + private Handler refreshLayoutHandler; + private TVStationAdapter tvStationAdapter; + private int page = 1; + private static final int TV_STATION_PLAY = 0x03; + + public View onCreateView(@NonNull LayoutInflater inflater, + ViewGroup container, Bundle savedInstanceState) { + /*dashboardViewModel = + new ViewModelProvider(this).get(DashboardViewModel.class);*/ + + bindingView = inflater.inflate(R.layout.fragment_notifications, container, false); + View root = bindingView.getRootView(); + TVListView = bindingView.findViewById(R.id.tvListView); + refreshLayout = bindingView.findViewById(R.id.refreshLayout); + init(); + eventListener(); + refreshLayout.autoRefresh(150); + return root; + } + + private void init() { + //gson = new Gson(); + refreshLayoutHandler = new Handler(Looper.getMainLooper()) { + @Override + public void handleMessage(@NonNull Message msg) { + super.handleMessage(msg); + Map resp = (Map)msg.obj; + if (msg.what == 0){ + switch ((int)resp.get("code")){ + case 200: refreshLayout.finishRefresh();break; + case 400: refreshLayout.finishRefresh(false);break; + } + } else if (msg.what == 1){ + switch ((int)resp.get("code")){ + case 200: refreshLayout.finishLoadMore();break; + case 400: refreshLayout.finishLoadMore(false);break; + case 201: refreshLayout.finishLoadMoreWithNoMoreData();break; + } + } + ((BaseAdapter) resp.get("data_adapter")).notifyDataSetChanged(); + } + }; + + tvStationAdapter = new TVStationAdapter(getContext(), new ArrayList<>()); + TVListView.setAdapter(tvStationAdapter); + } + + private void bindTVListViewData(List tvStations, int operationType) { + List tvStationsInAdapter = tvStationAdapter.getTvStations(); + switch (operationType) { + case 0: + tvStationsInAdapter.clear(); + tvStationsInAdapter.addAll(tvStations); + break; + case 1: + tvStationsInAdapter.addAll(tvStations); + break; + } + + } + + private void refreshLayoutMessage(Map resp, int what) { + refreshLayoutHandler.sendMessage(Message.obtain(refreshLayoutHandler, what, resp)); + } + + private void eventListener() { + refreshLayout.setOnLoadMoreListener(new MyOnLoadMoreRefreshListener(1)::listener); + refreshLayout.setOnRefreshListener(new MyOnLoadMoreRefreshListener(0)::listener); + TVListView.setOnItemClickListener(new AdapterView.OnItemClickListener() { + @Override + public void onItemClick(AdapterView parent, View view, int position, long id) { + TVStation station = (TVStation) parent.getItemAtPosition(position); + startActivityForResult( + new Intent(getActivity(), TvStationPlayPage.class) + .putExtra("id", id) + .putExtra("title", station.getTitle()) + .putExtra("author", station.getAuthor()) + .putExtra("date", station.getDate()) + .putExtra("sourceUrl", station.getVideoSource()), TV_STATION_PLAY); + } + }); + } + + @Override + public void onDestroyView() { + super.onDestroyView(); + bindingView = null; + } + + class MyOnLoadMoreRefreshListener{ + private int type; + + public MyOnLoadMoreRefreshListener(int type) { + this.type = type; + } + + public void listener(RefreshLayout refreshLayout){ + new Thread(() -> { + Map resp = new HashMap<>(); + resp.put("data_adapter", tvStationAdapter); + try { + Thread.sleep(2000); + } catch (InterruptedException e) { + e.printStackTrace(); + resp.put("code", 400); + refreshLayoutMessage(resp, type); + } + List tvStations; + if (type == 0) { + page = 1; + tvStations = TestUtil.getTVStationsPaging(page, getContext()); + } else { + tvStations = TestUtil.getTVStationsPaging(++page, getContext()); + } + if (tvStations.isEmpty()) { + resp.put("code", 201); + } else { + resp.put("code", 200); + bindTVListViewData(tvStations, type); + } + refreshLayoutMessage(resp, type); + + }).start(); + + } + + } +} + diff --git a/app/src/main/java/com/example/androidtermwork/ui/notifications/NotificationsViewModel.java b/app/src/main/java/com/example/androidtermwork/ui/notifications/NotificationsViewModel.java new file mode 100644 index 0000000..638be9a --- /dev/null +++ b/app/src/main/java/com/example/androidtermwork/ui/notifications/NotificationsViewModel.java @@ -0,0 +1,19 @@ +package com.example.androidtermwork.ui.notifications; + +import androidx.lifecycle.LiveData; +import androidx.lifecycle.MutableLiveData; +import androidx.lifecycle.ViewModel; + +public class NotificationsViewModel extends ViewModel { + + private MutableLiveData mText; + + public NotificationsViewModel() { + mText = new MutableLiveData<>(); + mText.setValue("This is 电视台 fragment"); + } + + public LiveData getText() { + return mText; + } +} \ No newline at end of file diff --git a/app/src/main/java/com/example/androidtermwork/util/FormatUtil.java b/app/src/main/java/com/example/androidtermwork/util/FormatUtil.java new file mode 100644 index 0000000..fe57d14 --- /dev/null +++ b/app/src/main/java/com/example/androidtermwork/util/FormatUtil.java @@ -0,0 +1,36 @@ +package com.example.androidtermwork.util; + +import java.text.DecimalFormat; + +public class FormatUtil +{ + /** + * 将数值格式化成指定格式 + * @param num + * @param pattern + * @param + * @return + */ + public static String simpleFormat(T num, String pattern){ + return new DecimalFormat(pattern).format(num); + } + + /** + * 以默认的”###,###“的格式将数值格式化成字符串 + * @param num + * @param + * @return + */ + public static String simpleFormat(T num){ + return simpleFormat(num, "###,###"); + } + + /** + * 获取数据只精确到百位的值 + * + * @return 数据精确到百位的值 + */ + public static long getFloorCount(long count){ + return count/100*100; + } +} diff --git a/app/src/main/java/com/example/androidtermwork/util/ResourceUtil.java b/app/src/main/java/com/example/androidtermwork/util/ResourceUtil.java new file mode 100644 index 0000000..eb15bed --- /dev/null +++ b/app/src/main/java/com/example/androidtermwork/util/ResourceUtil.java @@ -0,0 +1,26 @@ +package com.example.androidtermwork.util; + +import android.content.Context; + +/** + * 资源工具类 + */ +public class ResourceUtil +{ + /** + * 按名称获取资源的id + * @param context + * @param var 资源名称 + * @param type 资源类型 + * @return 资源id + */ + public static int getIdentifier(Context context, String var, String type) { + + try { + return context.getResources().getIdentifier(var, type, context.getPackageName()); + } catch (Exception e) { + //e.printStackTrace(); + return 0; + } + } +} diff --git a/app/src/main/java/com/example/androidtermwork/util/StatusBarUtil.java b/app/src/main/java/com/example/androidtermwork/util/StatusBarUtil.java new file mode 100644 index 0000000..a2db3e8 --- /dev/null +++ b/app/src/main/java/com/example/androidtermwork/util/StatusBarUtil.java @@ -0,0 +1,30 @@ +package com.example.androidtermwork.util; + +import android.app.Activity; +import android.os.Build; +import android.view.View; +import android.view.Window; +import android.view.WindowManager; + +import androidx.annotation.RequiresApi; + +/** + * 状态栏工具类 + */ +public class StatusBarUtil { + + /** + * 设置状态栏文字颜色(Android 6.0及以上) + * @param activity + * @param dark 是否为黑色 + */ + @RequiresApi(api = Build.VERSION_CODES.M) + public static void setAndroidNativeLightStatusBar(Activity activity, boolean dark) { + View decor = activity.getWindow().getDecorView(); + if (dark) { + decor.setSystemUiVisibility(View.SYSTEM_UI_FLAG_LIGHT_STATUS_BAR); + } else { + decor.setSystemUiVisibility(View.SYSTEM_UI_FLAG_LAYOUT_STABLE); + } + } +} diff --git a/app/src/main/java/com/example/androidtermwork/util/TestUtil.java b/app/src/main/java/com/example/androidtermwork/util/TestUtil.java new file mode 100644 index 0000000..7c68434 --- /dev/null +++ b/app/src/main/java/com/example/androidtermwork/util/TestUtil.java @@ -0,0 +1,99 @@ +package com.example.androidtermwork.util; + +import android.content.Context; +import android.content.res.AssetManager; +import android.view.View; + +import com.example.androidtermwork.pojo.TVStation; +import com.google.android.material.snackbar.Snackbar; +import com.google.gson.Gson; +import com.google.gson.reflect.TypeToken; + +import java.io.BufferedReader; +import java.io.IOException; +import java.io.InputStreamReader; +import java.util.Collections; +import java.util.List; + +/** + * 测试工具类 + */ +public class TestUtil +{ + + private static Gson gson; + + private static void gsonInit() { + if (gson == null) { + synchronized (TestUtil.class) { + if (gson == null) { + gson = new Gson(); + } + } + } + } + /** + * 读取assets下的JSON文件为字符串 + * @param fileName 文件名 + * @param context context + * @return 字符串 - JSON文件内容 + */ + public static String getJson(String fileName, Context context) { + //将json数据变成字符串 + StringBuilder stringBuilder = new StringBuilder(); + try { + //获取assets资源管理器 + AssetManager assetManager = context.getAssets(); + //通过管理器打开文件并读取 + BufferedReader bf = new BufferedReader(new InputStreamReader( + assetManager.open(fileName))); + String line; + while ((line = bf.readLine()) != null) { + stringBuilder.append(line); + } + } catch (IOException e) { + e.printStackTrace(); + } + return stringBuilder.toString(); + } + + /** + * SnakeBar消息提示 + * @param message 要显示的信息 + * @param duration LENGTH_SHORT = -1 or LENGTH_LONG = 0 + * @param base 附加到的视图,往上搜索至最外层组件。通常,最简单的方法是仅传递封装您的内容的最外层组件。 + */ + public static void showSnakeBarMessage(String message, int duration, View base) { + + Snackbar.make(base, message, duration).show(); + } + + /** + * 获取电视台数据,模拟数据库分页查询,测试下拉加载更多 + * @param page + * @param context + * @return + */ + public static List getTVStationsPaging(int page, Context context){ + if(page > 2){ + return Collections.emptyList(); + } + gsonInit(); + return gson.fromJson(getJson("mock_data_tv_" + String.format("%02d", page) + ".json", context), + new TypeToken>(){}.getType()); + } + + /** + * 获取测试数据(Java对象) + * @param jsonFileName + * @param typeToken + * @param context + * @param + * @return + */ + public static T getMockData(String jsonFileName, TypeToken typeToken, Context context){ + gsonInit(); + return gson.fromJson(getJson(jsonFileName, context), typeToken.getType()); + } + +} diff --git a/app/src/main/java/com/example/androidtermwork/view/JzvdPlayer.java b/app/src/main/java/com/example/androidtermwork/view/JzvdPlayer.java new file mode 100644 index 0000000..68b2b9f --- /dev/null +++ b/app/src/main/java/com/example/androidtermwork/view/JzvdPlayer.java @@ -0,0 +1,32 @@ +package com.example.androidtermwork.view; + +import android.content.Context; +import android.util.AttributeSet; + +import androidx.appcompat.app.AppCompatActivity; + +import cn.jzvd.JzvdStd; + +public class JzvdPlayer extends JzvdStd { + + public JzvdPlayer(Context context) { + super(context); + } + + public JzvdPlayer(Context context, AttributeSet attrs) { + super(context, attrs); + } + + @Override + public void setScreenNormal() { + super.setScreenNormal(); + backButton.setVisibility(VISIBLE); + } + + @Override + protected void clickBack() { + if (!backPress() && CURRENT_JZVD.screen == SCREEN_NORMAL) { + ((AppCompatActivity) jzvdContext).finish(); + } + } +} diff --git a/app/src/main/java/com/example/androidtermwork/volley/BitmapCache.java b/app/src/main/java/com/example/androidtermwork/volley/BitmapCache.java new file mode 100644 index 0000000..ad49979 --- /dev/null +++ b/app/src/main/java/com/example/androidtermwork/volley/BitmapCache.java @@ -0,0 +1,32 @@ +package com.example.androidtermwork.volley; + +import android.graphics.Bitmap; +import android.util.LruCache; + +import com.android.volley.toolbox.ImageLoader; + +public class BitmapCache implements ImageLoader.ImageCache { + + private LruCache mCache; + + public BitmapCache() { + int maxSize = (int) Runtime.getRuntime().maxMemory();//获取手机分配给应用的最大内存 + mCache = new LruCache(maxSize) { + @Override + protected int sizeOf(String key, Bitmap bitmap) { + return bitmap.getRowBytes() * bitmap.getHeight(); + } + }; + } + + @Override + public Bitmap getBitmap(String url) { + return mCache.get(url); + } + + @Override + public void putBitmap(String url, Bitmap bitmap) { + mCache.put(url, bitmap); + } + +} \ No newline at end of file diff --git a/app/src/main/java/com/example/androidtermwork/webView.java b/app/src/main/java/com/example/androidtermwork/webView.java new file mode 100644 index 0000000..ccb656f --- /dev/null +++ b/app/src/main/java/com/example/androidtermwork/webView.java @@ -0,0 +1,160 @@ +package com.example.androidtermwork; + +import androidx.annotation.RequiresApi; +import androidx.appcompat.app.AlertDialog; +import androidx.appcompat.app.AppCompatActivity; + +import android.annotation.SuppressLint; +import android.content.Intent; +import android.graphics.Bitmap; +import android.os.Build; +import android.os.Bundle; +import android.util.Log; +import android.view.KeyEvent; +import android.view.View; +import android.webkit.JavascriptInterface; +import android.webkit.JsResult; +import android.webkit.WebChromeClient; +import android.webkit.WebSettings; +import android.webkit.WebView; +import android.webkit.WebViewClient; +import android.widget.ProgressBar; +import android.widget.Toast; + +import com.example.androidtermwork.util.StatusBarUtil; + +public class webView extends AppCompatActivity { + private WebView webView; + private ProgressBar progressBar; + + @RequiresApi(api = Build.VERSION_CODES.M) + @SuppressLint({"SetJavaScriptEnabled", "JavascriptInterface"}) + @Override + protected void onCreate(Bundle savedInstanceState) { + super.onCreate(savedInstanceState); + setContentView(R.layout.activity_web_view); + //设置状态栏字体为黑色 + StatusBarUtil.setAndroidNativeLightStatusBar(this, true); + + Bundle bundle = this.getIntent().getExtras(); + AndroidToastForJs.title= bundle.getString("title"); + AndroidToastForJs.resource = bundle.getString("resource"); + AndroidToastForJs.title2 = bundle.getString("title2"); + AndroidToastForJs.time = bundle.getString("time"); + AndroidToastForJs.article = bundle.getString("article"); + AndroidToastForJs.editor = bundle.getString("editor"); + + progressBar= findViewById(R.id.progressbar);//进度条 + webView = findViewById(R.id.webview); + + WebSettings webSettings=webView.getSettings(); + webSettings.setJavaScriptEnabled(true);//允许使用js + webSettings.setDefaultTextEncodingName("GBK");//设置字符编码 增加对中文的支持 + // 设置允许JS弹窗 + webSettings.setJavaScriptCanOpenWindowsAutomatically(true); + //使用webview显示html代码 +// webView.loadDataWithBaseURL(null," 欢迎您 " + +// "

使用webview显示 html代码

", "text/html" , "utf-8", null); + webView.addJavascriptInterface(this,"android");//添加js监听 这样html就能调用客户端 + webView.setWebChromeClient(webChromeClient); + webView.setWebViewClient(webViewClient); + webView.addJavascriptInterface(new AndroidToastForJs(this), "JavaScriptInterface"); + + + webView.loadUrl("file:///android_asset/index.html");//加载asset文件夹下html +// webView.loadUrl(url);//加载url + /** + * LOAD_CACHE_ONLY: 不使用网络,只读取本地缓存数据 + * LOAD_DEFAULT: (默认)根据cache-control决定是否从网络上取数据。 + * LOAD_NO_CACHE: 不使用缓存,只从网络获取数据. + * LOAD_CACHE_ELSE_NETWORK,只要本地有,无论是否过期,或者no-cache,都使用缓存中的数据。 + */ + webSettings.setCacheMode(WebSettings.LOAD_NO_CACHE);//不使用缓存,只从网络获取数据. + + //支持屏幕缩放 + webSettings.setSupportZoom(true); + webSettings.setBuiltInZoomControls(true); + + //不显示webview缩放按钮 +// webSettings.setDisplayZoomControls(false); + } + + //WebViewClient主要帮助WebView处理各种通知、请求事件 + private WebViewClient webViewClient=new WebViewClient(){ + + public void onPageFinished(WebView view, String url) {//页面加载完成 + progressBar.setVisibility(View.GONE); + } + + public void onPageStarted(WebView view, String url, Bitmap favicon) {//页面开始加载 + progressBar.setVisibility(View.VISIBLE); + } + + public boolean shouldOverrideUrlLoading(WebView view, String url) { + Log.i("ansen","拦截url:"+url); + if(url.equals("http://www.google.com/")){ + Toast.makeText(webView.this,"国内不能访问google,拦截该url",Toast.LENGTH_LONG).show(); + return true;//表示我已经处理过了 + } + return super.shouldOverrideUrlLoading(view, url); + } + }; + + //WebChromeClient主要辅助WebView处理Javascript的对话框、网站图标、网站title、加载进度等 + private final WebChromeClient webChromeClient = new WebChromeClient() { + //不支持js的alert弹窗,需要自己监听然后通过dialog弹窗 + + public boolean onJsAlert(WebView webView, String url, String message, JsResult result) { + AlertDialog.Builder localBuilder = new AlertDialog.Builder(webView.getContext()); + localBuilder.setMessage(message).setPositiveButton("确定", null); + localBuilder.setCancelable(false); + localBuilder.create().show(); + + //注意: + //必须要这一句代码:result.confirm()表示: + //处理结果为确定状态同时唤醒WebCore线程 + //否则不能继续点击按钮 + result.confirm(); + return true; + } + + //获取网页标题 + public void onReceivedTitle(WebView view, String title) { + super.onReceivedTitle(view, title); + Log.i("ansen", "网页标题:" + title); + } + + //加载进度回调 + public void onProgressChanged(WebView view, int newProgress) { + progressBar.setProgress(newProgress); + } + }; + + @Override + public boolean onKeyDown(int keyCode, KeyEvent event) { + Log.i("ansen","是否有上一个页面:"+webView.canGoBack()); + if (webView.canGoBack() && keyCode == KeyEvent.KEYCODE_BACK){//点击返回按钮的时候判断有没有上一页 + webView.goBack(); // goBack()表示返回webView的上一页面 + return true; + } + return super.onKeyDown(keyCode,event); + } + + /** + * JS调用android的方法 + * @param str + * @return + */ + @JavascriptInterface //仍然必不可少 + public void getClient(String str){ + Log.i("ansen","html调用客户端:"+str); + } + + @Override + protected void onDestroy() { + super.onDestroy(); + //释放资源 + webView.destroy(); + webView=null; + } +} diff --git a/app/src/main/res/drawable-v24/avatar_border.xml b/app/src/main/res/drawable-v24/avatar_border.xml new file mode 100644 index 0000000..a41c35f --- /dev/null +++ b/app/src/main/res/drawable-v24/avatar_border.xml @@ -0,0 +1,12 @@ + + + + + + + \ No newline at end of file diff --git a/app/src/main/res/drawable-v24/bj.png b/app/src/main/res/drawable-v24/bj.png new file mode 100644 index 0000000000000000000000000000000000000000..b09d83e3ab30c2a14134d241ed78e83e715e7a73 GIT binary patch literal 78780 zcmeI4Z)j6j7{<>{VvVJBaXN5L=Urr2WG1l=si7^=#kuM#H8@sD?(nML-N)6IW2#! z+G}vu@_Ng**?{UD7PCRU?Hp!byZn`WSyp)BU`dEogU+w@=GU*qg$Ue}JuqAz9(*!6 zmYB$qhQgXU4TJ4dP+fH*lYFE3IkM~7~2Z!v( z^2Kp`TPzVvMEl!q+wLtMnMh{Rk9&v9|N5fG%H={b9-o?;icM{e<%>t-TeffC9#3?~ zySq2b9-B+g<;tVen{%ZN?n%^n(&MGEVzyAu=5w}l-qFMPljXi>)VWaY$9)2FBXb2iq$Ks>oxDucrJbMr*heHzdAufvv*W)+zFWxLiheuTjdSv zZ|{xQZnoU@$^9<~krD&x9S5eZUw^vTIhW`N?)dWOBY#_Oe75)2v(|TSZ+z?di5q{u zwB8DY!Vx=F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Q>g?ioyHu7u}7!V%uFRXH=ACuaCmhw=3H)sh!;80NYKa$a)O*_l&<6iIYCaqzbb-u3ly_TuEHLL|-%q<0)> z_%O_^F}K#ZD3F{WC&&qt4Y6inp#>b^1ULasfD`U0@M|a40#1Mv-~>1UPB8DJZ~$Ko zU#-E4Vy%uLvfxZ`CWV#o==#}7Y6rE0+M!TEdy}e#+ClB0cA&S>+vshD18^od6P!sg zBsf#E+5k>~6W|0mQSZ3;;{i^96X1k@T&Na27(5uIy~v6BYC`S!&)1G0mahxTXM+iG o`|`G(r-DnDuk9(!&&@a+;^tsv(+A(AZ#cULcI``F*g10QA4{YtWB>pF literal 0 HcmV?d00001 diff --git a/app/src/main/res/drawable-v24/button_border.xml b/app/src/main/res/drawable-v24/button_border.xml new file mode 100644 index 0000000..4667621 --- /dev/null +++ b/app/src/main/res/drawable-v24/button_border.xml @@ -0,0 +1,11 @@ + + + + + + \ No newline at end of file diff --git a/app/src/main/res/drawable-v24/edit_border.xml b/app/src/main/res/drawable-v24/edit_border.xml new file mode 100644 index 0000000..2249fad --- /dev/null +++ b/app/src/main/res/drawable-v24/edit_border.xml @@ -0,0 +1,10 @@ + + + + + + \ No newline at end of file diff --git a/app/src/main/res/drawable-v24/ic_launcher_foreground.xml b/app/src/main/res/drawable-v24/ic_launcher_foreground.xml new file mode 100644 index 0000000..1f6bb29 --- /dev/null +++ b/app/src/main/res/drawable-v24/ic_launcher_foreground.xml @@ -0,0 +1,34 @@ + + + + + + + + + + + diff --git a/app/src/main/res/drawable-v24/layer.xml b/app/src/main/res/drawable-v24/layer.xml new file mode 100644 index 0000000..9646a2d --- /dev/null +++ b/app/src/main/res/drawable-v24/layer.xml @@ -0,0 +1,20 @@ + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/app/src/main/res/drawable-v24/left_messages.9.png b/app/src/main/res/drawable-v24/left_messages.9.png new file mode 100644 index 0000000000000000000000000000000000000000..b4af2bf6e239ec783f1c83ac4b9faacef381d44a GIT binary patch literal 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|hwbgd%hqCe6wm=+e{F)HFDJp-*>Sb>zSHoeD&Lj|^EI0_IqttvCECVb{?@cvzS+;|5|{OJ`b!*ojIWh zT~t_dvP}iSof8=|qE>jHFY5J0MvDzHn#8;!tyzE~tq0;${U=;vPvPwK>mozMl|lbJ zf2qe{VUG{7YlHMgF|SB#5@1iS2Uev_|49+tXPewHgUaxvGs^r}uQR*4ypcvkq#YCS ziqu9M6drfO`&)g-74f<>-1wEbnV;xnO$ z@gDP8aAp$g@K{y<&Nfe^G}$1fUc@Vs8wAjF5fMrHi+FXbj{aCi2hw>&M1HFWQb?F3 z*NJ$Ax?X^t9V)C$^!iyMOxeImMVN%dxc22XyF*RvZmSjXimgWl$ZvDSyPLcoGZA|2 zS-wuh)PPV$TlO(`5@vSTc0|l8wjQ-bUW+SY<6ZBPx;U~~(ZmiZ-?9_cLYZ{X<14k`#B=$%ptI{HDC5YzQ>ES1{twTFCgU&sig7J4|>7H z(@w+cWpBuH4PA;ZW;2H(CeHD0_AwRIN67_hBFuHd}m1-SPJ39WLO#^!kn{LL9C-uFuBKICSaDXYqMyu;J!?z?>m;nco~heLVB?$}i*Qr!`{e(B cJD(i?1%4f9?UkqE4*&oF07*qoM6N<$f~XQ}EC2ui literal 0 HcmV?d00001 diff --git a/app/src/main/res/drawable-v24/mine_border.xml b/app/src/main/res/drawable-v24/mine_border.xml new file mode 100644 index 0000000..87a8a39 --- /dev/null +++ b/app/src/main/res/drawable-v24/mine_border.xml @@ -0,0 +1,5 @@ + + + + + \ No newline at end of file diff --git a/app/src/main/res/drawable-v24/right_messages.9.png b/app/src/main/res/drawable-v24/right_messages.9.png new file mode 100644 index 0000000000000000000000000000000000000000..de1d8cd742480fc7f0541498473ddfd1e6abc2c7 GIT binary patch literal 1972 zcmV;l2TS;gP)x{QYM==uOOkMTd3nuGN=o{5+qP}RIXOAiM~@zD$ji&CdlTaKs?W{M ztV4X+IJ;$R!QbPK`u8l0S&1|@X3=W2c)H?71h+#FkDZcK4n8g zL&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2|FY4->l*z0qg~4C}Beq|J5=+3cwyS6N&M#=@udNF0kf5`^Ai6lSA0o;oj|t|c0uAl=8P`|umhN*gk6;Q z54qz@0Bi?(l(0(@|K20s8(> z@g4x1fdxv~Rf&IHB0e|3CSaiwc1_}6m5R>^FaRu4!mdmF%aZZA05$@Pm9QHU|Dtq! z4uB275+&@W#6OP^Zw;^>SgM5GlK5v);w=Hz0n3!I+YnHX`v)qQzSP ztN~UiVRt0{am4skfYrcCCG4)mKZ+Wk0?-fiDq;5|{$b?!wg7#=Dkbc`#6O50{~sV> zGBj>>LCR=sTp*+XG@nrQ2&n+oBUk`bjbH^(ErKOLl?c`V)gj~ns0tw$Ks5+C0jfaA z4GhcN&tjHCEgwg=T5h4H-MTi1W3?ULg5rk*} z?g$Y9ToIxIxFJLaa6yO;@GpdBO5F@+TCW-a#zIJrZ#x}st(|z`=rNp0d~E=KcEad$ bqAC0aN07EbAFf`G00000NkvXXu0mjfuYe#n literal 0 HcmV?d00001 diff --git a/app/src/main/res/drawable-v24/shezhiblack.png b/app/src/main/res/drawable-v24/shezhiblack.png new file mode 100644 index 0000000000000000000000000000000000000000..3991bd75b0606db84507d4b2fe3a68033c427d3f GIT binary patch literal 1770 zcmV$~@$vzm>r*Sl$~s^`z{ z%$#%Pn=@y=b1rC>qP6}C5e)-4Bx%abdz4Zq?%1*8o!Pj=Y?MXU7_*j${@%*2R;#To z6bk>GjnDrTz#6~V)AIX&2QV-&&^u?&oJ|0}!^}IKbAz(6)_Ny^0U~;=TCHvv9v=SS zV52Z20=ZmnMLL~+l89ccR4V6|%jJn62((h_w?wqE;h33UaL%pr0A2uaa$@c2IF7F< z6bd_Yx!mEYRB9W5D+X04FB&_7YLIAHQO)Jw;MR#`^(itv3U> z+AE#F%O)y%E4Ki0Dmb{uTgigw#d7m-nXd?Q^D~?-h=S>3;1i?B061q-i{tq*+4#Utj zd(P+c$0(()1u(?SO94zs!V=K~*4lqa>a?&iN~tFREMVp;5v_C1Jvt4541yq7s+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o&0lQe! zjb}vS8!@pBa0ZJHgXpGlLIytbD&G97*O+g_NklZ}*+QDkcDM?P52BwkFX9u?!ftt=$y5coqZO*iJth$e+~Z0i*O7lnrK9hzR~m*JN-z_qOx7`SX)gn)Z9x)E%Aru^gD z)+Pq-4CV4-MmK&TlZcc7`%SZLbf!8M7Eo2?XNy+${zFDIDeTCj8|QkS|MxIo2YDwf z%$Z+`YDgKdcfg#{(XM_NBL70ujgv&h(!ja4^&tZ@CWfJRzLqmz7uAw7AYuT%tLer} zQL!{|PT6`9j7!J4*+*x#+ZYzrk}|*@EX`-)muq6cYgyg6P*f}poMV>;0oH3dG2fW& zD*QoIOUeMpE?olfUqj@7({!VLZ7!;u5N_DE`U&`bZ4eUmW^(y^MCqjraLd+gW`viz ziEK$lla0c;<q5+9WYPq zXjg-k)|s`*3*490jb_K;GWiH&8*hIA-W?tD<}B_pzYr#ga|s0Gu6@*H@Ufz{&%1Kv z`ol8faj}1Sbkj`V8w-B@+Vm&TLm54Pt1PGVB~ZN+Y%g8}pMtIE#NCJe4M{(>X;#e8 z;09A6rLXRLh39Ll3a?Iy0aX+1(g46~>ILZzP0vg1$7K_C?9w`b!{-q}BR`_)`H5jD zK^m(A0{)?`8|NyjKLp_PupR+xGrBP#k%KVQwXGfo>el%TexFrU>x{W2k8Qw_E?5Te zQB#+RmuGW@$Av2s01lUn*AvrYjZpS^dA2*gR!as{J0a?NtY*pms;BlZTHX5}f%=+4 zMz(JJv8Q^$F1zrM1i)6n;)4 zHvu~`y0M~_;)B>k45*q=F6{yH;;4j(;Ii*OsCD%PGh@yBm4YKKr6lPlxT-Hm`Tj_lJ+1+1+*QW&68c5rTIARk$Bhlg z`5qQ_t~L%N!8K(aP`wXvh$ixF l;ie7vww(X2=pOeS@D&+ + + + + + + + + \ No newline at end of file diff --git a/app/src/main/res/drawable/feel_good.xml b/app/src/main/res/drawable/feel_good.xml new file mode 100644 index 0000000..a88e0ff --- /dev/null +++ b/app/src/main/res/drawable/feel_good.xml @@ -0,0 +1,11 @@ + + + + + \ No newline at end of file diff --git a/app/src/main/res/drawable/ic_collect_star.xml b/app/src/main/res/drawable/ic_collect_star.xml new file mode 100644 index 0000000..44fd0f5 --- /dev/null +++ b/app/src/main/res/drawable/ic_collect_star.xml @@ -0,0 +1,12 @@ + + + + + \ No newline at end of file diff --git a/app/src/main/res/drawable/ic_comments.xml b/app/src/main/res/drawable/ic_comments.xml new file mode 100644 index 0000000..ff39c87 --- /dev/null +++ b/app/src/main/res/drawable/ic_comments.xml @@ -0,0 +1,14 @@ + + + + + + \ No newline at end of file diff --git a/app/src/main/res/drawable/ic_dashboard_black_24dp.xml b/app/src/main/res/drawable/ic_dashboard_black_24dp.xml new file mode 100644 index 0000000..46fc8de --- /dev/null +++ b/app/src/main/res/drawable/ic_dashboard_black_24dp.xml @@ -0,0 +1,9 @@ + + + diff --git a/app/src/main/res/drawable/ic_feel_good.xml b/app/src/main/res/drawable/ic_feel_good.xml new file mode 100644 index 0000000..892b76b --- /dev/null +++ b/app/src/main/res/drawable/ic_feel_good.xml @@ -0,0 +1,11 @@ + + + + + \ No newline at end of file diff --git a/app/src/main/res/drawable/ic_home_black_24dp.xml b/app/src/main/res/drawable/ic_home_black_24dp.xml new file mode 100644 index 0000000..f8bb0b5 --- /dev/null +++ b/app/src/main/res/drawable/ic_home_black_24dp.xml @@ -0,0 +1,9 @@ + + + diff --git a/app/src/main/res/drawable/ic_launcher_background.xml b/app/src/main/res/drawable/ic_launcher_background.xml new file mode 100644 index 0000000..0d025f9 --- /dev/null +++ b/app/src/main/res/drawable/ic_launcher_background.xml @@ -0,0 +1,170 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/app/src/main/res/drawable/ic_notifications_black_24dp.xml b/app/src/main/res/drawable/ic_notifications_black_24dp.xml new file mode 100644 index 0000000..78b75c3 --- /dev/null +++ b/app/src/main/res/drawable/ic_notifications_black_24dp.xml @@ -0,0 +1,9 @@ + + + diff --git a/app/src/main/res/drawable/ic_share.xml b/app/src/main/res/drawable/ic_share.xml new file mode 100644 index 0000000..1a2df66 --- /dev/null +++ b/app/src/main/res/drawable/ic_share.xml @@ -0,0 +1,20 @@ + + + + + + + + \ No newline at end of file diff --git a/app/src/main/res/drawable/listview_border.xml b/app/src/main/res/drawable/listview_border.xml new file mode 100644 index 0000000..be8d31b --- /dev/null +++ b/app/src/main/res/drawable/listview_border.xml @@ -0,0 +1,11 @@ + + + + + + \ No newline at end of file diff --git a/app/src/main/res/drawable/loginbutton_border.xml b/app/src/main/res/drawable/loginbutton_border.xml new file mode 100644 index 0000000..1c796d1 --- /dev/null +++ b/app/src/main/res/drawable/loginbutton_border.xml @@ -0,0 +1,11 @@ + + + + + + \ No newline at end of file diff --git a/app/src/main/res/drawable/pagetop_border.xml b/app/src/main/res/drawable/pagetop_border.xml new file mode 100644 index 0000000..04cda6c --- /dev/null +++ b/app/src/main/res/drawable/pagetop_border.xml @@ -0,0 +1,13 @@ + + + + + + + + + + + + + diff --git a/app/src/main/res/drawable/points_alarm_border.xml b/app/src/main/res/drawable/points_alarm_border.xml new file mode 100644 index 0000000..db8c6d4 --- /dev/null +++ b/app/src/main/res/drawable/points_alarm_border.xml @@ -0,0 +1,10 @@ + + + + + + + + + \ No newline at end of file diff --git a/app/src/main/res/drawable/points_introduction_border.xml b/app/src/main/res/drawable/points_introduction_border.xml new file mode 100644 index 0000000..5618a73 --- /dev/null +++ b/app/src/main/res/drawable/points_introduction_border.xml @@ -0,0 +1,12 @@ + + + + + + + + + \ No newline at end of file diff --git a/app/src/main/res/drawable/points_item_divider.xml b/app/src/main/res/drawable/points_item_divider.xml new file mode 100644 index 0000000..266281f --- /dev/null +++ b/app/src/main/res/drawable/points_item_divider.xml @@ -0,0 +1,7 @@ + + + + + + + \ No newline at end of file diff --git a/app/src/main/res/drawable/points_progressbar_bg.xml b/app/src/main/res/drawable/points_progressbar_bg.xml new file mode 100644 index 0000000..48f5fe7 --- /dev/null +++ b/app/src/main/res/drawable/points_progressbar_bg.xml @@ -0,0 +1,23 @@ + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/app/src/main/res/drawable/regisbutton_border.xml b/app/src/main/res/drawable/regisbutton_border.xml new file mode 100644 index 0000000..912b910 --- /dev/null +++ b/app/src/main/res/drawable/regisbutton_border.xml @@ -0,0 +1,11 @@ + + + + + + \ No newline at end of file diff --git a/app/src/main/res/drawable/time_length_border.xml b/app/src/main/res/drawable/time_length_border.xml new file mode 100644 index 0000000..bbe6915 --- /dev/null +++ b/app/src/main/res/drawable/time_length_border.xml @@ -0,0 +1,10 @@ + + + + + + + + + \ No newline at end of file diff --git a/app/src/main/res/drawable/toappbutton_border.xml b/app/src/main/res/drawable/toappbutton_border.xml new file mode 100644 index 0000000..4e4a963 --- /dev/null +++ b/app/src/main/res/drawable/toappbutton_border.xml @@ -0,0 +1,13 @@ + + + + + + \ No newline at end of file diff --git a/app/src/main/res/drawable/tv_play_collect_checkbox.xml b/app/src/main/res/drawable/tv_play_collect_checkbox.xml new file mode 100644 index 0000000..3181460 --- /dev/null +++ b/app/src/main/res/drawable/tv_play_collect_checkbox.xml @@ -0,0 +1,19 @@ + + + + + + + + + + + + + \ No newline at end of file diff --git a/app/src/main/res/drawable/tv_play_collected.xml b/app/src/main/res/drawable/tv_play_collected.xml new file mode 100644 index 0000000..6825182 --- /dev/null +++ b/app/src/main/res/drawable/tv_play_collected.xml @@ -0,0 +1,11 @@ + + + + + \ No newline at end of file diff --git a/app/src/main/res/drawable/tv_play_feel_good_checkbox.xml b/app/src/main/res/drawable/tv_play_feel_good_checkbox.xml new file mode 100644 index 0000000..4b2a8f2 --- /dev/null +++ b/app/src/main/res/drawable/tv_play_feel_good_checkbox.xml @@ -0,0 +1,7 @@ + + + + + + + \ No newline at end of file diff --git a/app/src/main/res/drawable/tv_play_gradient_divider.xml b/app/src/main/res/drawable/tv_play_gradient_divider.xml new file mode 100644 index 0000000..16bd956 --- /dev/null +++ b/app/src/main/res/drawable/tv_play_gradient_divider.xml @@ -0,0 +1,20 @@ + + + + + + + \ No newline at end of file diff --git a/app/src/main/res/drawable/tv_play_open_details_radiobutton.xml b/app/src/main/res/drawable/tv_play_open_details_radiobutton.xml new file mode 100644 index 0000000..18a5f77 --- /dev/null +++ b/app/src/main/res/drawable/tv_play_open_details_radiobutton.xml @@ -0,0 +1,18 @@ + + + + + + + + + + \ No newline at end of file diff --git a/app/src/main/res/drawable/tv_play_open_information.xml b/app/src/main/res/drawable/tv_play_open_information.xml new file mode 100644 index 0000000..62e134c --- /dev/null +++ b/app/src/main/res/drawable/tv_play_open_information.xml @@ -0,0 +1,11 @@ + + + + + \ No newline at end of file diff --git a/app/src/main/res/layout/activity_1.xml b/app/src/main/res/layout/activity_1.xml new file mode 100644 index 0000000..3db221b --- /dev/null +++ b/app/src/main/res/layout/activity_1.xml @@ -0,0 +1,145 @@ + + + + + +