lmw
2024-07-09 b13afc751dbbce24753d008f1f87d2c5e133a4ad
fix bug
1 文件已重命名
91个文件已修改
56个文件已删除
9个文件已添加
9656 ■■■■ 已修改文件
.idea/gradle.xml 3 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
app/build.gradle 6 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
app/src/main/AndroidManifest.xml 112 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
app/src/main/java/com/dollearn/student/DollearnApplication.kt 9 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
app/src/main/java/com/dollearn/student/MainActivity.kt 57 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
app/src/main/java/com/dollearn/student/dialog/CheckQrCodeDialog.kt 39 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
app/src/main/java/com/dollearn/student/dialog/ChooseCouponDialog.kt 43 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
app/src/main/java/com/dollearn/student/dialog/ChooseShopDialog.kt 184 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
app/src/main/java/com/dollearn/student/dialog/CompetitionTipDialog.kt 22 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
app/src/main/java/com/dollearn/student/dialog/ShareDialog.kt 28 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
app/src/main/java/com/dollearn/student/dialog/TipDialog.kt 1 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
app/src/main/java/com/dollearn/student/network/ApiService.kt 351 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
app/src/main/java/com/dollearn/student/network/Apis.kt 68 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
app/src/main/java/com/dollearn/student/network/Functions.kt 6 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
app/src/main/java/com/dollearn/student/network/HttpManager.kt 351 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
app/src/main/java/com/dollearn/student/network/entity/Banner.kt 8 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
app/src/main/java/com/dollearn/student/network/entity/ConfigBean.kt 8 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
app/src/main/java/com/dollearn/student/network/entity/ExchangeRecord.kt 14 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
app/src/main/java/com/dollearn/student/network/entity/Goods.kt 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
app/src/main/java/com/dollearn/student/network/entity/GoodsDetail.kt 7 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
app/src/main/java/com/dollearn/student/network/entity/GoodsType.kt 6 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
app/src/main/java/com/dollearn/student/network/entity/ProgressBean.kt 3 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
app/src/main/java/com/dollearn/student/network/entity/ReqFinishStory.kt 7 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
app/src/main/java/com/dollearn/student/network/entity/ReqSaveProgress.kt 3 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
app/src/main/java/com/dollearn/student/ui/H5Activity.kt 5 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
app/src/main/java/com/dollearn/student/ui/SplashActivity.kt 6 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
app/src/main/java/com/dollearn/student/ui/TransparentStatusBarActivity.kt 4 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
app/src/main/java/com/dollearn/student/ui/course/CourseActivity.kt 11 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
app/src/main/java/com/dollearn/student/ui/course/CourseDetailActivity.kt 10 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
app/src/main/java/com/dollearn/student/ui/course/CourseFragment.kt 393 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
app/src/main/java/com/dollearn/student/ui/course/JoinCourseActivity.kt 380 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
app/src/main/java/com/dollearn/student/ui/course/JoinedCourseDetailActivity.kt 7 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
app/src/main/java/com/dollearn/student/ui/course/MyCourseActivity.kt 7 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
app/src/main/java/com/dollearn/student/ui/course/MyCourseDetailActivity.kt 13 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
app/src/main/java/com/dollearn/student/ui/course/ReserveRecordActivity.kt 58 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
app/src/main/java/com/dollearn/student/ui/course/ReserveRecordFragment.kt 76 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
app/src/main/java/com/dollearn/student/ui/course/UnPayCourseDetailActivity.kt 206 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
app/src/main/java/com/dollearn/student/ui/course/WeekFragment.kt 46 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
app/src/main/java/com/dollearn/student/ui/course/WelfareDetailActivity.kt 9 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
app/src/main/java/com/dollearn/student/ui/course/adapter/CourseScheduleAdapter.kt 20 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
app/src/main/java/com/dollearn/student/ui/course/adapter/MedalAdapter.kt 3 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
app/src/main/java/com/dollearn/student/ui/course/adapter/PaySuccessCouponAdapter.kt 54 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
app/src/main/java/com/dollearn/student/ui/course/adapter/ReserveRecordAdapter.kt 91 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
app/src/main/java/com/dollearn/student/ui/course/adapter/WeekAdapter.kt 29 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
app/src/main/java/com/dollearn/student/ui/course/adapter/WeekViewPagerAdapter.kt 11 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
app/src/main/java/com/dollearn/student/ui/discovery/MyQrCodeActivity.kt 41 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
app/src/main/java/com/dollearn/student/ui/discovery/ShopListActivity.kt 206 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
app/src/main/java/com/dollearn/student/ui/discovery/StudentManageActivity.kt 74 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
app/src/main/java/com/dollearn/student/ui/discovery/adapter/QrAdapter.kt 33 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
app/src/main/java/com/dollearn/student/ui/discovery/adapter/StuManageAdapter.kt 67 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
app/src/main/java/com/dollearn/student/ui/home/ChooseVoiceActivity.kt 9 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
app/src/main/java/com/dollearn/student/ui/home/ChooseVoiceFragment.kt 213 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
app/src/main/java/com/dollearn/student/ui/home/DailyFragment.kt 52 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
app/src/main/java/com/dollearn/student/ui/home/FieldActivity.kt 26 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
app/src/main/java/com/dollearn/student/ui/home/IncludeActivity.kt 17 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
app/src/main/java/com/dollearn/student/ui/home/IncludeFragment.kt 115 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
app/src/main/java/com/dollearn/student/ui/home/JoinVipActivity.kt 4 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
app/src/main/java/com/dollearn/student/ui/home/ListenActivity.kt 7 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
app/src/main/java/com/dollearn/student/ui/home/ListenFragment.kt 67 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
app/src/main/java/com/dollearn/student/ui/home/ListenStoryActivity.kt 30 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
app/src/main/java/com/dollearn/student/ui/home/LookImgActivity.kt 12 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
app/src/main/java/com/dollearn/student/ui/home/LookImgFragment.kt 145 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
app/src/main/java/com/dollearn/student/ui/home/MatchActivity.kt 10 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
app/src/main/java/com/dollearn/student/ui/home/MatchDetailActivity.kt 13 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
app/src/main/java/com/dollearn/student/ui/home/MatchFragment.kt 122 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
app/src/main/java/com/dollearn/student/ui/home/MemoryActivity.kt 102 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
app/src/main/java/com/dollearn/student/ui/home/PayResultActivity.kt 3 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
app/src/main/java/com/dollearn/student/ui/home/PlaceDetailActivity.kt 39 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
app/src/main/java/com/dollearn/student/ui/home/QAActivity.kt 6 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
app/src/main/java/com/dollearn/student/ui/home/QAFragment.kt 132 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
app/src/main/java/com/dollearn/student/ui/home/RememberFinishActivity.kt 9 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
app/src/main/java/com/dollearn/student/ui/home/RememberFragment.kt 6 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
app/src/main/java/com/dollearn/student/ui/home/ResultActivity.kt 33 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
app/src/main/java/com/dollearn/student/ui/home/ScannerActivity.kt 6 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
app/src/main/java/com/dollearn/student/ui/home/ScheduleActivity.kt 1 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
app/src/main/java/com/dollearn/student/ui/home/SuperListenActivity.kt 111 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
app/src/main/java/com/dollearn/student/ui/home/WeekSelectActivity.kt 1 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
app/src/main/java/com/dollearn/student/ui/home/adapter/CouponAdapter.kt 26 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
app/src/main/java/com/dollearn/student/ui/home/adapter/GameAdapter.kt 57 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
app/src/main/java/com/dollearn/student/ui/home/adapter/WeekAdapter.kt 3 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
app/src/main/java/com/dollearn/student/ui/login/LoginActivity.kt 2 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
app/src/main/java/com/dollearn/student/ui/login/RegisterActivity.kt 24 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
app/src/main/java/com/dollearn/student/ui/mine/AddressManageActivity.kt 10 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
app/src/main/java/com/dollearn/student/ui/mine/LearnRecordActivity.kt 5 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
app/src/main/java/com/dollearn/student/ui/mine/MineFragment.kt 45 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
app/src/main/java/com/dollearn/student/ui/shop/ExchangeActivity.kt 7 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
app/src/main/java/com/dollearn/student/ui/shop/ShopFragment.kt 7 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
app/src/main/java/com/dollearn/student/ui/welfare/CouponActivity.kt 55 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
app/src/main/java/com/dollearn/student/ui/welfare/CouponFragment.kt 69 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
app/src/main/java/com/dollearn/student/ui/welfare/ExchangeRecordActivity.kt 31 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
app/src/main/java/com/dollearn/student/ui/welfare/GoodsDetailActivity.kt 8 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
app/src/main/java/com/dollearn/student/ui/welfare/ScoreShopActivity.kt 226 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
app/src/main/java/com/dollearn/student/ui/welfare/adapter/CouponDetailAdapter.kt 90 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
app/src/main/java/com/dollearn/student/ui/worldcup/MyWorldActivity.kt 185 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
app/src/main/java/com/dollearn/student/ui/worldcup/MyWorldFragment.kt 93 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
app/src/main/java/com/dollearn/student/ui/worldcup/MyWorldInfoActivity.kt 161 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
app/src/main/java/com/dollearn/student/ui/worldcup/WorldCupListActivity.kt 4 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
app/src/main/java/com/dollearn/student/ui/worldcup/WorldRankFragment.kt 119 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
app/src/main/java/com/dollearn/student/ui/worldcup/WorldRecordFragment.kt 73 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
app/src/main/java/com/dollearn/student/ui/worldcup/adapter/StudentQrAdapter.kt 42 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
app/src/main/java/com/dollearn/student/ui/worldcup/adapter/WorldCupRecordAdapter.kt 19 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
app/src/main/java/com/dollearn/student/utils/Const.kt 30 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
app/src/main/java/com/dollearn/student/utils/extention/WeparkEx.kt 48 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
app/src/main/java/com/dollearn/student/utils/glide/GlideUtil.java 6 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
app/src/main/res/drawable/bg_blue_line_grey_8dp.xml 6 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
app/src/main/res/drawable/selector_enable_choose.xml 5 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
app/src/main/res/layout/activity_coupon.xml 56 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
app/src/main/res/layout/activity_exchange_record.xml 18 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
app/src/main/res/layout/activity_join_course.xml 394 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
app/src/main/res/layout/activity_login.xml 1 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
app/src/main/res/layout/activity_my_qr.xml 31 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
app/src/main/res/layout/activity_my_world_detail.xml 439 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
app/src/main/res/layout/activity_reserve_record.xml 89 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
app/src/main/res/layout/activity_score_shop.xml 244 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
app/src/main/res/layout/activity_shop_list.xml 175 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
app/src/main/res/layout/activity_stu_manage.xml 27 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
app/src/main/res/layout/dialog_check_qrcode.xml 48 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
app/src/main/res/layout/dialog_choose_coupon.xml 53 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
app/src/main/res/layout/dialog_competition_tip.xml 50 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
app/src/main/res/layout/dialog_rule.xml 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
app/src/main/res/layout/dialog_share.xml 65 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
app/src/main/res/layout/dialog_shop_choose.xml 199 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
app/src/main/res/layout/fragment_course.xml 622 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
app/src/main/res/layout/fragment_include.xml 54 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
app/src/main/res/layout/fragment_q_a.xml 59 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
app/src/main/res/layout/fragment_wc_record.xml 50 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
app/src/main/res/layout/fragment_world_rank.xml 198 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
app/src/main/res/layout/item_coupon.xml 98 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
app/src/main/res/layout/item_coupon_detail.xml 131 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
app/src/main/res/layout/item_reserve_record.xml 101 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
app/src/main/res/layout/item_stu_manage.xml 95 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
app/src/main/res/layout/item_stu_qr.xml 62 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
app/src/main/res/layout/item_stu_wc_detail.xml 70 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
app/src/main/res/layout/item_wc_record.xml 77 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
app/src/main/res/layout/item_week.xml 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
app/src/main/res/layout/item_week_course.xml 32 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
app/src/main/res/mipmap-xxhdpi/ic_launcher.png 补丁 | 查看 | 原始文档 | blame | 历史
app/src/main/res/mipmap-xxhdpi/share_moment.png 补丁 | 查看 | 原始文档 | blame | 历史
app/src/main/res/mipmap-xxhdpi/share_wx.png 补丁 | 查看 | 原始文档 | blame | 历史
app/src/main/res/values/colors.xml 1 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
app/src/main/res/xml/fragment_listen_scene_result_1.xml 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
app/src/main/res/xml/fragment_listen_scene_result_2.xml 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
app/src/main/res/xml/fragment_listen_scene_result_3.xml 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
app/src/main/res/xml/fragment_listen_scene_result_4.xml 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
app/src/main/res/xml/fragment_listen_scene_result_5.xml 65 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
app/src/main/res/xml/fragment_listen_scene_result_6.xml 65 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
app/src/main/res/xml/item_game_1_scene.xml 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
app/src/main/res/xml/scene_fragment_choose_voice.xml 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
app/src/main/res/xml/scene_fragment_listen_voice.xml 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
app/src/main/res/xml/scene_fragment_look.xml 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
app/src/main/res/xml/scene_fragment_match.xml 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
xldutils-kotlin/src/main/AndroidManifest.xml 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
xldutils-kotlin/src/main/java/cn/sinata/xldutils/activity/ImagePagerActivity.kt 4 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
xldutils-kotlin/src/main/java/cn/sinata/xldutils/activity/TitleActivity.kt 5 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
xldutils-kotlin/src/main/java/cn/sinata/xldutils/fragment/ImageFragment.kt 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
xldutils-kotlin/src/main/res/layout/activity_base_title.xml 3 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
xldutils-kotlin/src/main/res/layout/activity_image_pager.xml 4 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
.idea/gradle.xml
@@ -5,9 +5,7 @@
    <option name="linkedExternalProjectsSettings">
      <GradleProjectSettings>
        <option name="testRunner" value="PLATFORM" />
        <option name="distributionType" value="DEFAULT_WRAPPED" />
        <option name="externalProjectPath" value="$PROJECT_DIR$" />
        <option name="gradleJvm" value="Embedded JDK" />
        <option name="modules">
          <set>
            <option value="$PROJECT_DIR$" />
@@ -18,6 +16,7 @@
            <option value="$PROJECT_DIR$/zxinglibrary" />
          </set>
        </option>
        <option name="resolveExternalAnnotations" value="false" />
        <option name="resolveModulePerSourceSet" value="false" />
        <option name="useQualifiedModuleNames" value="true" />
      </GradleProjectSettings>
app/build.gradle
@@ -10,8 +10,8 @@
        applicationId "com.dollearn.student"
        minSdkVersion 21
        targetSdkVersion 30
        versionCode 8
        versionName "1.18"
        versionCode 1
        versionName "1.0"
        testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
    }
@@ -47,7 +47,7 @@
            applicationVariants.all { variant ->
                // 更新至Android Studio 3.3 gradle 4.10.1
                variant.outputs.all {
                    outputFileName = "wepark-${defaultConfig.versionName}-${new Date().format("yyyy-MM-dd" , TimeZone.getTimeZone("GMT+08")) }.apk"
                    outputFileName = "dollearn-${defaultConfig.versionName}-${new Date().format("yyyy-MM-dd" , TimeZone.getTimeZone("GMT+08")) }.apk"
                }
            }
//            ndk {
app/src/main/AndroidManifest.xml
@@ -33,7 +33,7 @@
    </queries>
    <application
        android:name=".WeparkApplication"
        android:name=".DollearnApplication"
        android:allowBackup="true"
        android:icon="@mipmap/ic_launcher"
        android:label="@string/app_name"
@@ -44,7 +44,8 @@
        android:theme="@style/AppTheme">
        <activity
            android:name=".MainActivity"
            android:launchMode="singleTask" />
            android:launchMode="singleTask"
            android:screenOrientation="landscape" />
        <activity android:name=".ui.SplashActivity"
            android:screenOrientation="landscape">
            <intent-filter>
@@ -63,7 +64,8 @@
            android:exported="true" />
        <activity
            android:name=".ui.H5Activity"
            android:launchMode="singleTask" />
            android:launchMode="singleTask"
            android:screenOrientation="landscape" />
        <activity
            android:name=".ui.login.LoginActivity"
            android:label="登录"
@@ -85,16 +87,15 @@
        <activity
            android:name=".ui.home.JoinVipActivity"
            android:label="成为会员" />
        <activity android:name=".ui.home.PayResultActivity" />
        <activity
            android:name=".ui.course.JoinCourseActivity"
            android:label="运动营详情" />
        <activity android:name=".ui.home.PayResultActivity"
            android:screenOrientation="landscape" />
        <activity
            android:name=".ui.home.AddStudentActivity"
            android:label="添加运动营成员" android:windowSoftInputMode="adjustPan" />
        <activity
            android:name=".ui.home.MatchActivity"
            android:label="自主学习5-音图相配" />
            android:label="自主学习5-音图相配"
            android:screenOrientation="landscape" />
        <activity
            android:name=".ui.home.MatchDetailActivity"
            android:label="活动详情" />
@@ -140,9 +141,6 @@
            android:label="课时详情"
            android:launchMode="singleTask" />
        <activity
            android:name=".ui.discovery.ShopListActivity"
            android:label="门店列表" />
        <activity
            android:name=".ui.discovery.ShopDetailActivity"
            android:label="门店详情" />
        <activity
@@ -173,9 +171,6 @@
            android:name=".ui.course.ReportActivity"
            android:label="测试报告" />
        <activity
            android:name=".ui.course.ReserveRecordActivity"
            android:label="预约运动营" />
        <activity
            android:name=".ui.welfare.UserInfoActivity"
            android:label="个人信息" />
        <activity
@@ -185,12 +180,6 @@
        <activity
            android:name=".ui.welfare.CoinRecordActivity"
            android:label="账单" />
        <activity
            android:name=".ui.welfare.CouponActivity"
            android:label="我的券包" />
        <activity
            android:name=".ui.welfare.ScoreShopActivity"
            android:label="积分商城" />
        <activity
            android:name=".ui.welfare.GoodsDetailActivity"
            android:label="商品详情" />
@@ -213,49 +202,68 @@
        <activity
            android:name=".ui.course.ExperienceCourseActivity"
            android:label="体验购课" />
        <activity android:name=".ui.course.SmartStadiumActivity" android:label="扫码启动智慧足球墙"/>
        <activity
            android:name=".ui.game.GameActivity"
            android:label="智慧球场"
            android:configChanges="orientation|screenSize|keyboardHidden"
            android:screenOrientation="portrait" />
        <activity android:name=".ui.welfare.OnlineShopActivity" />
        <activity android:name=".ui.game.MyDataActivity" android:label="我的数据"/>
        <activity android:name=".ui.course.UnPayCourseDetailActivity" android:label="运动营详情"/>
        <activity android:name=".ui.home.PlatformActivity" />
        <activity android:name=".ui.worldcup.WorldCupListActivity" android:label="社区世界杯"/>
        <activity android:name=".ui.worldcup.WorldCupDetailActivity" android:label="社区世界杯"/>
        <activity android:name=".ui.worldcup.JoinWCActivity" android:label="社区世界杯"/>
        <activity android:name=".ui.worldcup.MyWorldActivity" android:label="我的报名"/>
        <activity android:name=".ui.discovery.MyQrCodeActivity" android:label="我的二维码"/>
        <activity android:name=".ui.worldcup.MyWorldInfoActivity" android:label="社区世界杯"/>
        <activity android:name=".ui.discovery.StudentManageActivity" android:label="人员管理"/>
        <activity android:name=".ui.worldcup.RefereeWorldListActivity" android:label="社区世界杯"/>
        <activity android:name=".ui.worldcup.StartWorldActivity" />
        <activity android:name=".ui.home.WeekSelectActivity" android:label="第一年学习周目选择">
        <activity android:name=".ui.welfare.OnlineShopActivity"
            android:screenOrientation="landscape"/>
        <activity android:name=".ui.game.MyDataActivity" android:label="我的数据"
            android:screenOrientation="landscape"/>
        <activity android:name=".ui.home.PlatformActivity"
            android:screenOrientation="landscape"/>
        <activity android:name=".ui.worldcup.WorldCupListActivity" android:label="社区世界杯"
            android:screenOrientation="landscape"/>
        <activity android:name=".ui.worldcup.WorldCupDetailActivity" android:label="社区世界杯"
            android:screenOrientation="landscape"/>
        <activity android:name=".ui.worldcup.JoinWCActivity" android:label="社区世界杯"
            android:screenOrientation="landscape"/>
        <activity android:name=".ui.worldcup.RefereeWorldListActivity" android:label="社区世界杯"
            android:screenOrientation="landscape"/>
        <activity android:name=".ui.worldcup.StartWorldActivity"
            android:screenOrientation="landscape" />
        <activity android:name=".ui.home.WeekSelectActivity" android:label="第一年学习周目选择"
            android:screenOrientation="landscape">
<!--            <intent-filter>-->
<!--                <action android:name="android.intent.action.MAIN" />-->
<!--                <category android:name="android.intent.category.LAUNCHER" />-->
<!--            </intent-filter>-->
        </activity>
        <activity android:name=".ui.home.ScheduleActivity" />
        <activity android:name=".ui.shop.ExchangeActivity" android:label="立即兑换"/>
        <activity android:name=".ui.mine.LearnRecordActivity" android:label="学习记录"/>
        <activity android:name=".ui.mine.ChangeAddressActivity" android:label="修改地址"/>
        <activity android:name=".ui.shop.AddAddressActivity" android:label="添加地址"/>
        <activity android:name=".ui.mine.AddressManageActivity" android:label="地址管理"/>
        <activity android:name=".ui.mine.ScoreRecordActivity" android:label="积分明细"/>
        <activity android:name=".ui.home.ListenActivity" android:label="自主学习1-听音选图" android:launchMode="singleTask"/>
        <activity android:name=".ui.home.ChooseVoiceActivity" android:label="自主学习2-看图选音" android:launchMode="singleTask"/>
        <activity android:name=".ui.home.IncludeActivity" android:label="自主学习3-归纳排除" android:launchMode="singleTask"/>
        <activity android:name=".ui.home.QAActivity" android:label="自主学习4-有问有答" android:launchMode="singleTask"/>
        <activity android:name=".ui.home.ResultActivity" />
        <activity android:name=".ui.home.LookImgActivity" android:label="自主学故事1-看图配音" android:launchMode="singleTask"/>
        <activity android:name=".ui.home.RememberFinishActivity" android:label="自主故事2—框架记忆"/>
        <activity android:name=".ui.home.ListenStoryActivity" android:label="自主故事2—框架记忆" />
        <activity android:name=".ui.home.MemoryActivity"  android:label="自主游戏1—超级记忆" />
        <activity android:name=".ui.home.SuperListenActivity"  android:label="自主游戏1—超级听力" />
        <activity android:name=".ui.home.ScheduleActivity"
            android:screenOrientation="landscape"/>
        <activity android:name=".ui.shop.ExchangeActivity" android:label="立即兑换"
            android:screenOrientation="landscape"/>
        <activity android:name=".ui.mine.LearnRecordActivity" android:label="学习记录"
            android:screenOrientation="landscape"/>
        <activity android:name=".ui.mine.ChangeAddressActivity" android:label="修改地址"
            android:screenOrientation="landscape"/>
        <activity android:name=".ui.shop.AddAddressActivity" android:label="添加地址"
            android:screenOrientation="landscape"/>
        <activity android:name=".ui.mine.AddressManageActivity" android:label="地址管理"
            android:screenOrientation="landscape"/>
        <activity android:name=".ui.mine.ScoreRecordActivity" android:label="积分明细"
            android:screenOrientation="landscape"/>
        <activity android:name=".ui.home.ListenActivity" android:label="自主学习1-听音选图" android:launchMode="singleTask" android:screenOrientation="landscape"/>
        <activity android:name=".ui.home.ChooseVoiceActivity" android:label="自主学习2-看图选音" android:launchMode="singleTask"
            android:screenOrientation="landscape"/>
        <activity android:name=".ui.home.IncludeActivity" android:label="自主学习3-归纳排除" android:launchMode="singleTask"
            android:screenOrientation="landscape"/>
        <activity android:name=".ui.home.QAActivity" android:label="自主学习4-有问有答" android:launchMode="singleTask"
            android:screenOrientation="landscape"/>
        <activity android:name=".ui.home.ResultActivity"
            android:screenOrientation="landscape"/>
        <activity android:name=".ui.home.LookImgActivity" android:label="自主学故事1-看图配音" android:launchMode="singleTask"
            android:screenOrientation="landscape"/>
        <activity android:name=".ui.home.RememberFinishActivity" android:label="自主故事2—框架记忆"
            android:screenOrientation="landscape"/>
        <activity android:name=".ui.home.ListenStoryActivity" android:label="自主故事2—框架记忆"
            android:screenOrientation="landscape"/>
        <activity android:name=".ui.home.MemoryActivity"  android:label="自主游戏1—超级记忆"
            android:screenOrientation="landscape"/>
        <activity android:name=".ui.home.SuperListenActivity"  android:label="自主游戏1—超级听力"
            android:screenOrientation="landscape"/>
        <meta-data
            android:name="com.amap.api.v2.apikey"
app/src/main/java/com/dollearn/student/DollearnApplication.kt
File was renamed from app/src/main/java/com/dollearn/student/WeparkApplication.kt
@@ -16,7 +16,7 @@
import java.util.concurrent.TimeUnit
class WeparkApplication :BaseApplication(), Application.ActivityLifecycleCallbacks {
class DollearnApplication :BaseApplication(), Application.ActivityLifecycleCallbacks {
    override fun getSPName() = "GWXSp"
    private var heartSubscribe: Disposable? = null
@@ -113,14 +113,13 @@
        var provinceCode = "" //当前省
        var cityName = "" //当前市
        var cityCode = "" //当前市
        var store = "" //门店名称
        var storeId = "" //门店id
        var avatar = "" //本人头像
        var appContext: WeparkApplication? = null
        fun getInstance(): WeparkApplication? {
        var appContext: DollearnApplication? = null
        fun getInstance(): DollearnApplication? {
            if (appContext == null) {
                appContext = WeparkApplication()
                appContext = DollearnApplication()
            }
            return appContext
        }
app/src/main/java/com/dollearn/student/MainActivity.kt
@@ -1,14 +1,17 @@
package com.dollearn.student
import android.annotation.SuppressLint
import android.os.Handler
import android.os.Looper
import android.os.Message
import android.util.Log
import androidx.fragment.app.Fragment
import androidx.fragment.app.FragmentPagerAdapter
import cn.sinata.xldutils.gone
import cn.sinata.xldutils.utils.showAllowingStateLoss
import cn.sinata.xldutils.utils.SPUtils
import com.flyco.tablayout.listener.CustomTabEntity
import com.flyco.tablayout.listener.OnTabSelectListener
import com.github.zackratos.ultimatebar.UltimateBar
import com.dollearn.student.dialog.CompetitionTipDialog
import com.dollearn.student.network.HttpManager
import com.dollearn.student.network.entity.UserBean
import com.dollearn.student.network.request
@@ -29,6 +32,7 @@
    private val fragments    = arrayListOf<Fragment>()
    var homeData: UserBean? = null //个人信息
    var score = 0
    private var handler: Handler? = null
    override fun initClick() {
    }
@@ -42,6 +46,50 @@
        initTab()
        EventBus.getDefault().register(this)
        getData()
        getVoiceUrl()
        getScoreConfig()
    }
    private fun getScoreConfig() {
        HttpManager.onlineDuration().request(this,false,{_,data->
            SPUtils.instance().put(Const.SCORE_DURATION,(data?:"0").toInt()).apply()
            startTimer()
        }){_,_->
            startTimer()
        }
    }
    private fun startTimer() {
        val duration = SPUtils.instance().getInt(Const.SCORE_DURATION,30)//单位分钟
        var mins = 0
        handler = object :Handler(Looper.myLooper()!!){
            override fun handleMessage(msg: Message) {
                super.handleMessage(msg)
                if (msg.what == 0){
                    mins++
                    Log.e("mmp","当前已在线${mins}分钟")
                    if (mins > duration){
                        HttpManager.giveIntegral().request(this@MainActivity,false,{_,_->
                            mins = 0
                            handler?.sendEmptyMessageDelayed(0,1000*60)
                        }){_,_->
                            handler?.sendEmptyMessageDelayed(0,1000*60)
                        }
                    }else
                        handler?.sendEmptyMessageDelayed(0,1000*60)
                }
            }
        }
        handler?.sendEmptyMessageDelayed(0,1000*60)
    }
    private fun getVoiceUrl() {
        HttpManager.promptVoice().request(this,false){_,data->
            if (!data?.correct.isNullOrEmpty())
                SPUtils.instance().put(Const.RV,data?.correct?:"").apply()
            if (!data?.error.isNullOrEmpty())
                SPUtils.instance().put(Const.EV,data?.error?:"").apply()
        }
    }
    private fun initTab() {
@@ -97,7 +145,7 @@
    @Subscribe
    fun onSwitch(e:EmptyEvent){
        if (e.code == Const.EventCode.SWITCH_HOME){
        if (e.code == Const.EventCode.CLICK_GAME_ITEM){
            switchHome()
        }else if(e.code == Const.EventCode.CHANGE_WELFARE){
            tab_bar.currentTab = 2
@@ -145,6 +193,7 @@
    override fun onDestroy() {
        super.onDestroy()
        EventBus.getDefault().unregister(this)
        WeparkApplication.storeId = ""
        handler?.removeCallbacksAndMessages(null)
        handler = null
    }
}
app/src/main/java/com/dollearn/student/dialog/CheckQrCodeDialog.kt
File was deleted
app/src/main/java/com/dollearn/student/dialog/ChooseCouponDialog.kt
File was deleted
app/src/main/java/com/dollearn/student/dialog/ChooseShopDialog.kt
File was deleted
app/src/main/java/com/dollearn/student/dialog/CompetitionTipDialog.kt
File was deleted
app/src/main/java/com/dollearn/student/dialog/ShareDialog.kt
New file
@@ -0,0 +1,28 @@
package com.dollearn.student.dialog
import android.view.Gravity
import com.dollearn.student.R
import com.dollearn.student.utils.interfaces.StringCallback
import kotlinx.android.synthetic.main.dialog_share.*
class ShareDialog:BaseDialogFragment() {
    override fun setContentView() = R.layout.dialog_share
    override fun setGravity() = Gravity.BOTTOM
    var callback:StringCallback? = null
    override fun initView() {
        iv_close.setOnClickListener { dismissAllowingStateLoss() }
        wv_1.setOnClickListener {
            callback?.onResult("wx")
            dismissAllowingStateLoss()
        }
        wv_2.setOnClickListener {
            callback?.onResult("circle")
            dismissAllowingStateLoss()
        }
    }
}
app/src/main/java/com/dollearn/student/dialog/TipDialog.kt
@@ -53,7 +53,6 @@
            tv_ok.gone()
            tv_alert.visible()
            tv_alert.text = ok
            alert_line.visible()
        }
        tv_msg.text = msg
app/src/main/java/com/dollearn/student/network/ApiService.kt
@@ -2,22 +2,17 @@
import cn.sinata.xldutils.data.ResultData
import com.google.gson.JsonObject
import com.dollearn.student.WeparkApplication
import com.dollearn.student.WeparkApplication.Companion.storeId
import com.dollearn.student.DollearnApplication.Companion.storeId
import com.dollearn.student.network.entity.*
import com.dollearn.student.utils.Const
import com.dollearn.student.utils.pay.PayInfo
import io.reactivex.Flowable
import okhttp3.ResponseBody
import retrofit2.http.*
interface ApiService {
    @FormUrlEncoded
    @POST(Apis.H5_URL)
    fun getH5(@Field("type") type: Int): Flowable<ResultData<String>>
    @POST(Apis.queryBasisSet)
    fun queryBasisSet(): Flowable<ResultData<ArrayList<CommonData>>>
    @FormUrlEncoded
    @POST(Apis.queryProvinceAndCity)
@@ -26,25 +21,6 @@
    @FormUrlEncoded
    @POST(Apis.queryStoreByCityCode)
    fun queryStoreByCityCode(@Field("cityCode") code: String,@Field("provinceCode") provinceCode: String): Flowable<ResultData<ArrayList<CommonData>>>
    @FormUrlEncoded
    @POST(Apis.queryVersionByType)
    fun queryVersionByType(
        @Field("type") type: Int = 1
    ): Flowable<ResultData<JsonObject>>
    @FormUrlEncoded
    @POST(Apis.querySystemSetByType)
    fun querySystemSetByType(
        @Field("type") type: Int
    ): Flowable<ResultData<JsonObject>>
    @FormUrlEncoded
    @POST(Apis.queryJoinPlayPai)
    fun queryJoinPlayPai(
        @Field("lat") lat: Double?,
        @Field("lon") lon: Double?
    ): Flowable<ResultData<HomeData>>
    @FormUrlEncoded
    @POST(Apis.addVipPayment)
@@ -61,10 +37,6 @@
        @Field("couponId") couponId: Long,
        @Field("orderId") orderId: String?
    ): Flowable<ResultData<PayInfo>>
    @FormUrlEncoded
    @POST(Apis.payment)
    fun paymentCourse2(@FieldMap map: HashMap<String, Any?>): Flowable<ResultData<PayInfo>>
    @FormUrlEncoded
    @POST(Apis.payment)
@@ -88,28 +60,8 @@
    ): Flowable<ResultData<PayInfo>>
    @FormUrlEncoded
    @POST(Apis.queryStoreConfig)
    fun queryStoreConfig(@Field("storeId") storeId: String): Flowable<ResultData<List<Banner>>>
    @FormUrlEncoded
    @POST(Apis.queryIndexSet)
    fun queryIndexSet(@Field("id") storeId: String): Flowable<ResultData<List<Banner>>>
    @FormUrlEncoded
    @POST(Apis.queryPhysical)
    fun queryPhysical(@Field("stuID") id: String): Flowable<ResultData<Report>>
    @FormUrlEncoded
    @POST(Apis.cancelCourse)
    fun cancelCourse(@Field("courseStuRecordId") courseStuRecordId: String): Flowable<ResultData<Any>>
    @FormUrlEncoded
    @POST(Apis.reverse)
    fun reverse(
        @Field("time") time: String,
        @Field("stuId") stuId: String,
        @Field("courseID") courseID: String
    ): Flowable<ResultData<Any>>
    @FormUrlEncoded
    @POST(Apis.stuAppointList)
@@ -122,18 +74,11 @@
        @Field("size") size: Int = Const.PAGE_SIZE
    ): Flowable<ResultData<List<ReserveRecord>>>
    @FormUrlEncoded
    @POST(Apis.goodsOfCourseStore)
    fun goodsOfCourseStore(
        @Field("isCourse") isCourse: Int,
        @Field("pointsMerId") pointsMerId: String,
        @Field("lat") lat: Double?,
        @Field("lon") lon: Double?
    ): Flowable<ResultData<DefaultData>>
    @GET(Apis.userDetails)
    fun userDetails(): Flowable<ResultData<UserBean>>
    @GET(Apis.shareInfo)
    fun shareInfo(): Flowable<ResultData<ConfigBean>>
    @GET(Apis.studyRecord)
    fun studyRecord(): Flowable<ResultData<StudyRecord>>
@@ -141,13 +86,6 @@
    @FormUrlEncoded
    @POST(Apis.uploadImage)
    fun uploadImage(@Field("userImage") userImage: String): Flowable<ResultData<Any>>
    @FormUrlEncoded
    @POST(Apis.queryCompetitionList)
    fun queryCompetitionList(
        @Field("cityCode") cityCode: String?, @Field("registerCondition") registerCondition: Int?,
        @Field("heat") heat: String?, @Field("content") search: String?
    ): Flowable<ResultData<List<Match>>>
    @FormUrlEncoded
    @POST(Apis.queryClassificationBenefitsVideosList)
@@ -233,14 +171,6 @@
    fun weeksOfAddHours(@Field("packetId") id: Long): Flowable<ResultData<Any>>
    @FormUrlEncoded
    @POST(Apis.paymentCourseCouponList)
    fun paymentCourseCouponList(@Field("coursePackagePaymentConfigId") id: Int?): Flowable<ResultData<List<Coupon>>>
    @FormUrlEncoded
    @POST(Apis.queryCouponList)
    fun queryCouponList(@Field("distributionMethod") id: Int = 2): Flowable<ResultData<List<Coupon>>>
    @FormUrlEncoded
    @POST(Apis.queryMySiteById)
    fun queryMySiteById(@Field("id") id: String): Flowable<ResultData<MySite>>
@@ -265,46 +195,6 @@
        @Field("courseTypeId") courseTypeId: Int?,
        @Field("search") search: String?
    ): Flowable<ResultData<List<JoinedCourse>>>
    @FormUrlEncoded
    @POST(Apis.querySiteTimes)
    fun querySiteTimes(
        @Field("id") id: String,
        @Field("day") day: String,
        @Field("halfName") halfName: String?,
        @Field("siteName") siteName: String?
    ): Flowable<ResultData<List<PlaceTime>>>
    @FormUrlEncoded
    @POST(Apis.querySiteCouponList)
    fun querySiteCouponList(
        @Field("siteId") id: String,
        @Field("lat") lat: Double?,
        @Field("lon") lon: Double?,
        @Field("price") price: Double
    ): Flowable<ResultData<List<Coupon>>>
    @FormUrlEncoded
    @POST(Apis.querySiteInfo)
    fun querySiteInfo(
        @Field("id") id: String,
        @Field("lat") lat: Double?,
        @Field("lon") lon: Double?
    ): Flowable<ResultData<Place>>
    @FormUrlEncoded
    @POST(Apis.reservationSite)
    fun reservationSite(
        @Field("id") id: String,
        @Field("booker") booker: String,
        @Field("phone") phone: String,
        @Field("times") times: String,
        @Field("payType") payType: Int,
        @Field("couponId") couponId: Long?,
        @Field("isHalf") isHalf: Int,
        @Field("halfName") halfName: String?,
        @Field("nextName") nextName: String
    ): Flowable<ResultData<PayInfo>>
    @FormUrlEncoded
    @POST(Apis.continuePaymentMySite)
@@ -415,10 +305,6 @@
    ): Flowable<ResultData<WeeksOfCourseDetails>>
    @FormUrlEncoded
    @POST(Apis.switchStu)
    fun switchStu(@Field("stuId") stuId: String): Flowable<ResultData<Any>>
    @FormUrlEncoded
    @POST(Apis.lessonDetails)
    fun lessonDetails(
        @Field("stuId") stuId: String,
@@ -450,6 +336,9 @@
        @Query("phone") phone: String
    ): Flowable<ResultData<Any>>
    @GET(Apis.promptVoice)
    fun promptVoice(): Flowable<ResultData<ConfigBean>>
    @FormUrlEncoded
    @POST
    fun register(
@@ -466,13 +355,6 @@
        @Field("openId") openId: String?, @Field("lat") lat: Double?, @Field("lon") lon: Double?
    ): Flowable<ResultData<JsonObject>>
    @FormUrlEncoded
    @POST(Apis.userLogin)
    fun userLogin(
        @Field("password") password: String,
        @Field("phone") phone: String
    ): Flowable<ResultData<String>>
    @POST(Apis.captchaLogin)
    fun captchaLogin(
        @Body phoneRequest : String
@@ -486,6 +368,12 @@
    @GET(Apis.studySchedule)
    fun studySchedule(@Query("week")week:Int,@Query("day")day:Int): Flowable<ResultData<Schedule>>
    @GET(Apis.onlineDuration)
    fun onlineDuration(): Flowable<ResultData<String>>
    @GET(Apis.giveIntegral)
    fun giveIntegral(): Flowable<ResultData<Boolean>>
    @FormUrlEncoded
    @POST(Apis.queryBanner)
@@ -546,21 +434,6 @@
        @Field("shopId") shopId: String?
    ): Flowable<ResultData<List<Goods>>>
    @FormUrlEncoded
    @POST(Apis.exchangeStoreIds)
    fun exchangeStoreIds(
        @Field("goodsType") goodsType: Int,
        @Field("pointsMerId") id: String
    ): Flowable<ResultData<List<Shop>>>
    @FormUrlEncoded
    @POST(Apis.exchangeRecords)
    fun exchangeRecords(
        @Field("goodsType") goodsType: Int?,
        @Field("useType") useType: Int?
    ): Flowable<ResultData<List<ExchangeRecord>>>
    @FormUrlEncoded
    @POST(Apis.redemptionDetails)
    fun redemptionDetails(
@@ -569,18 +442,6 @@
    @POST(Apis.cancellation)
    fun cancellation(): Flowable<ResultData<Any>>
    @FormUrlEncoded
    @POST(Apis.productRedemptionOperation)
    fun productRedemptionOperation(
        @Field("goodsType") goodsType: Int,
        @Field("exchangeType") exchangeType: Int,
        @Field("goodId") goodId: String,
        @Field("nums") nums: Int,
        @Field("payType") payType: Int?,
        @Field("stuIds") stuIds: String?,
        @Field("storeId") storeId: String?
    ): Flowable<ResultData<PayInfo>>
    @FormUrlEncoded
    @POST(Apis.queryStoreFreeBenefit)
@@ -651,14 +512,20 @@
    @POST(Apis.exitLearning)
    fun exitLearning(@Body body: String): Flowable<ResultData<Any>>
    @POST(Apis.completeLearning)
    fun completeLearning(@Body body: String): Flowable<ResultData<Any>>
    @GET(Apis.exitGameOrStory)
    fun exitGameOrStory(@Query("studyTime") studyTime: Int): Flowable<ResultData<Any>>
    @POST(Apis.completeStory)
    fun completeStory(@Body body: String): Flowable<ResultData<Any>>
    @POST(Apis.completeLearning)
    fun completeLearning(@Body body: String): Flowable<ResultData<Int?>>
    @GET(Apis.completeStory)
    fun completeStory(@Query("accuracy") accuracy: Int,
                      @Query("storyId") storyId: String,
                      @Query("type") type: Int,
                      @Query("studyTime") studyTime: Int): Flowable<ResultData<Int?>>
    @POST(Apis.gameAchievement)
    fun gameAchievement(@Body body: String): Flowable<ResultData<Any>>
    fun gameAchievement(@Body body: String): Flowable<ResultData<Int?>>
    @GET(Apis.teamSchedule)
    fun teamSchedule(@Query("day") day:Int,@Query("type") type:Int,@Query("week") week:Int): Flowable<ResultData<ProgressBean>>
@@ -772,154 +639,10 @@
    ): Flowable<ResultData<GoodsList>>
    @GET(Apis.goodDetail)
    fun goodDetail(
        @Query("goodId") goodId: String): Flowable<ResultData<GoodsDetail>>
    @FormUrlEncoded
    @POST(Apis.queryIsTest)
    fun queryIsTest(
        @Field("gradeId") gradeId: Int,
        @Field("subjectsId") subjectsId: Int
    ): Flowable<ResultData<TestingResult>>
    @FormUrlEncoded
    @POST(Apis.queryTestQuestion)
    fun queryTestQuestion(
        @Field("gradeId") gradeId: Int,
        @Field("subjectsId") subjectsId: Int
    ): Flowable<ResultData<ArrayList<TestingQuestion>>>
    @FormUrlEncoded
    @POST(Apis.optSubmitTestPaper)
    fun optSubmitTestPaper(
        @Field("paperId") paperId: Int,
        @Field("time") time: Int,
        @Field("data") data: String
    ): Flowable<ResultData<JsonObject>>
    @FormUrlEncoded
    @POST(Apis.queryMeAppraisal)
    fun queryMeAppraisal(
        @Field("current") current: Int,
        @Field("size") size: Int = Const.PAGE_SIZE
    ): Flowable<ResultData<ArrayList<TestingRecord>>>
    @FormUrlEncoded
    @POST(Apis.queryOrderList)
    fun queryOrderList(
        @Field("current") current: Int,
        @Field("type") type: Int,
        @Field("size") size: Int = Const.PAGE_SIZE
    ): Flowable<ResultData<ArrayList<Order>>>
    @FormUrlEncoded
    @POST(Apis.queryApplyDetail)
    fun queryApplyDetail(
        @Field("courseStudentId") courseStudentId: Int
    ): Flowable<ResultData<Order>>
    @POST(Apis.queryIsBindAlipay)
    fun queryIsBindAlipay(): Flowable<ResultData<Boolean>>
    fun goodDetail(@Query("goodId") goodId: String): Flowable<ResultData<GoodsDetail>>
    @GET(Apis.exchangeRecord)
    fun exchangeRecord(): Flowable<ResultData<List<ExchangeRecord>>>
    @FormUrlEncoded
    @POST(Apis.queryCanRefund)
    fun queryCanRefund(
        @Field("courseStudentId") courseStudentId: Int
    ): Flowable<ResultData<JsonObject>>
    @FormUrlEncoded
    @POST(Apis.optApplyRefund)
    fun optApplyRefund(
        @Field("courseStudentId") courseStudentId: Int,
        @Field("refundClassHours") refundClassHours: Int,
        @Field("refundMark") refundMark: String,
        @Field("refundMoney") refundMoney: Double
    ): Flowable<ResultData<JsonObject>>
    @FormUrlEncoded
    @POST(Apis.optCancelApply)
    fun optCancelApply(
        @Field("applyId") applyId: Int
    ): Flowable<ResultData<JsonObject>>
    @FormUrlEncoded
    @POST(Apis.optAddBind)
    fun optAddBind(
        @Field("openId") openId: String,
        @Field("unionid") unionid: String,
        @Field("otherName") otherName: String,
        @Field("type") type: Int
    ): Flowable<ResultData<JsonObject>>
    @FormUrlEncoded
    @POST(Apis.optAddQuestion)
    fun optAddQuestion(
        @Field("question") question: String,
        @Field("describe") describe: String,
        @Field("imgUrl") imgUrl: String,
        @Field("golds") golds: Int
    ): Flowable<ResultData<RewardQuestion>>
    @FormUrlEncoded
    @POST(Apis.queryQuestionSquareList)
    fun queryQuestionSquareList(
        @Field("current") current: Int,
        @Field("conditions") conditions: String?,
        @Field("size") size: Int = Const.PAGE_SIZE
    ): Flowable<ResultData<ArrayList<RewardQuestion>>>
    @FormUrlEncoded
    @POST(Apis.queryQuestionAnswerList)
    fun queryQuestionAnswerList(
        @Field("current") current: Int,
        @Field("questionId") questionId: Int,
        @Field("size") size: Int = Const.PAGE_SIZE
    ): Flowable<ResultData<ArrayList<RewardAnswer>>>
    @FormUrlEncoded
    @POST
    fun queryMeQuestionList(
        @Field("current") current: Int,
        @Url url: String,
        @Field("size") size: Int = Const.PAGE_SIZE
    ): Flowable<ResultData<ArrayList<RewardQuestion>>>
    @FormUrlEncoded
    @POST(Apis.optDeleteQuestion)
    fun optDeleteQuestion(
        @Field("questionId") questionId: Int
    ): Flowable<ResultData<JsonObject>>
    @FormUrlEncoded
    @POST(Apis.optDeleteAnswer)
    fun optDeleteAnswer(
        @Field("answerId") answerId: Int,
        @Field("questionId") questionId: Int
    ): Flowable<ResultData<JsonObject>>
    @FormUrlEncoded
    @POST(Apis.optAdoptAnswer)
    fun optAdoptAnswer(
        @Field("answerId") answerId: Int,
        @Field("questionId") questionId: Int
    ): Flowable<ResultData<JsonObject>>
    @FormUrlEncoded
    @POST(Apis.optAddAnswer)
    fun optAddAnswer(
        @Field("answer") answer: String,
        @Field("questionId") questionId: Int
    ): Flowable<ResultData<JsonObject>>
    @FormUrlEncoded
    @POST(Apis.queryGameList)
    fun queryGameList(
        @Field("siteId") siteId: Int,
        @Field("storeId") storeId: String
    ): Flowable<ResultData<List<GameBean>>>
    fun exchangeRecord(@Query("pageNumber") page:Int,@Query("pageSize") pageSize: Int = 30): Flowable<ResultData<ExchangeRecordBean>>
    @Headers("notapp:true")
    @FormUrlEncoded
@@ -932,17 +655,6 @@
    ): Flowable<ResultData<List<GameRecordBean>>>
    @FormUrlEncoded
    @POST(Apis.payGame)
    fun payGame(
        @Field("configId") configId: Int,
        @Field("gameId") gameId: Int,
        @Field("spaceId") spaceId: Int,
        @Field("sutuId") sutuId: Int,
        @Field("type") type: Int,
        @Field("gameType") gameType: Int
    ): Flowable<ResultData<PayInfo>>
    @FormUrlEncoded
    @POST(Apis.registeredData)
    fun registeredData(
        @Field("lat") lat: Double?,
@@ -950,13 +662,6 @@
        @Field("coursePayId") coursePayId: String,
        @Field("orderId") orderId: String
    ): Flowable<ResultData<JoinedCourse>>
    @FormUrlEncoded
    @POST(Apis.indexOfEx)
    fun indexOfEx(
        @Field("latitude") lat: Double?,
        @Field("longitude") lon: Double?
    ): Flowable<ResultData<List<Shop>>>
    @FormUrlEncoded
    @POST(Apis.storeList)
@@ -997,10 +702,6 @@
        @Field("imgs") imgs: String?,
        @Field("score") score: Double
    ): Flowable<ResultData<Any>>
    @Headers("notapp:true")
    @GET
    fun getGameList(@Url url: String): Flowable<ResponseBody>
    @POST(Apis.getHomeModule)
    fun getHomeModule(): Flowable<ResultData<Banner>>
app/src/main/java/com/dollearn/student/network/Apis.kt
@@ -20,13 +20,11 @@
//    const val gameRecord ="https://try.daowepark.com/v7/user_api/general/gameRecord" //测试
    /**公共接口*/
    val SHARE_URL = "https://gengwoxue.com:8443/share/index.html?type=1&invitation=%d" //普通分享
    val SHARE_URL = "https://dollearn.com/" //分享链接 官网
    const val H5_URL = "study/base/user/getProtocol" //获取协议
    const val getCode = "study/base/user/sendPhoneCode"
    const val queryBasisSet = "base/app/agreement/queryBasisSet"
    const val queryVersionByType = "base/app/agreement/queryVersionByType"
    const val querySystemSetByType = "base/app/agreement/querySystemSetByType"
    const val querySystemImg = "base/user/parentPage"
    const val promptVoice = "study/base/study/promptVoice"
    const val querySystemImg = "study/base/user/studyPage"
    const val queryProvinceAndCity = "other/base/store/queryProvinceAndCity"
    const val queryStoreByCityCode = "other/base/store/queryStoreByCityCode"
@@ -35,7 +33,6 @@
     */
    const val register = "account/base/appUser/addAppUser"
    const val updatePassword = "account/base/appUser/updatePassword"
    const val userLogin = "account/base/appUser/loginPassword"
    const val captchaLogin = "study/base/user/studyLogin"
    const val forgetPassword = "account/base/appUser/forgetPassword"
    const val bindWx = "account/base/appUser/bind"
@@ -46,6 +43,8 @@
    const val goodRecommend = "study/base/study/goodRecommend"
    const val weekList = "study/base/study/weekList"
    const val studySchedule = "study/base/study/studySchedule"
    const val onlineDuration = "study/base/study/onlineDuration"
    const val giveIntegral = "study/base/study/giveIntegral"
    const val queryBanner = "other/base/banner/queryBannerList"
    const val querySearchCourseList = "api/app/course/querySearchCourseList"
@@ -63,6 +62,7 @@
    const val questionsAndAnswers = "study/base/study/questionsAndAnswers"
    const val pictureMateVoice = "study/base/study/pictureMateVoice"
    const val exitLearning = "study/base/study/exitLearning"
    const val exitGameOrStory = "study/base/study/exitGameOrStory"
    const val teamSchedule = "study/base/study/teamSchedule"
    const val completeLearning = "study/base/study/completeLearning"
@@ -91,9 +91,9 @@
    /**
     * 我的
     */
    const val shareInfo = "study/base/user/shareInfo"
    const val userDetails = "study/base/user/userInfo"
    const val studyRecord = "study/base/study/studyRecord"
    const val optAddBind = "api/app/student/optAddBind"
    const val exchangeRecord = "goods/base/goods/exchangeRecord"
    const val shopAddress = "goods/base/goods/shopAddress"
    const val setDefaultStudy = "goods/base/goods/setDefaultStudy"
@@ -105,32 +105,10 @@
    const val updateInfo = "account/api/appUser/updateInfo"
    /**
     * 测评
     */
    const val queryIsTest = "api/app/test/queryIsTest"
    const val queryTestQuestion = "api/app/test/queryTestQuestion"
    const val optSubmitTestPaper = "api/app/test/optSubmitTestPaper"
    const val queryMeAppraisal = "api/app/test/queryMeAppraisal"
    /**
     * 订单
     */
    const val queryOrderList = "api/app/order/queryOrderList"
    const val queryApplyDetail = "api/app/student/queryApplyDetail"
    const val queryIsBindAlipay = "api/app/student/queryIsBindAlipay"
    const val queryCanRefund = "api/app/student/queryCanRefund"
    const val optApplyRefund = "api/app/student/optApplyRefund"
    const val optCancelApply = "api/app/student/optCancelApply"
    /**
     * 加入玩派
     */
    const val queryCouponList = "activity/api/coupon/queryCouponList"
    const val queryJoinPlayPai = "account/api/appUser/queryJoinPlayPai"
    const val addVipPayment = "account/api/appUser/addVipPayment"
    const val paymentCourse = "course/api/course/paymentCourse"
    const val queryStoreConfig = "other/base/store/queryStoreConfig"
    const val queryIndexSet = "other/base/store/queryIndexSet"
    const val queryStoreLists = "other/base/store/queryStoreLists"
    const val voucherCenter = "account/api/useBenefit/voucherCenter"
    const val rechargeDescription = "other/base/stored/rechargeDescription"
@@ -148,7 +126,6 @@
    const val queryStudentData = "account/api/startCource/queryStudentData"
    const val stuGoog = "account/api/startCource/stuGoog"
    const val weeksOfCourseDetails = "account/api/startCource/weeksOfCourseDetailsList"
    const val switchStu = "account/api/startCource/switchStu"
    const val lessonDetails = "account/api/startCource/lessonDetails"
    const val editDefault = "account/api/startCource/editDefault"
    const val recordDetails = "account/api/startCource/recordDetails"
@@ -161,13 +138,9 @@
    const val registeredData = "course/api/startCource/RegisteredData"
    const val payment = "course/api/startCource/payment"
    const val queryPhysical = "account/api/startCource/queryPhysical"
    const val reverse = "course/api/startCource/reverse"
    const val cancelCourse = "account/api/startCource/cancelCourse"
    const val stuAppointList = "account/api/startCource/stuAppointList"
    const val goodsOfCourseStore = "account/api/useBenefit/goodsOfCourseStore"
    const val weeksOfGetHours = "account/api/startCource/weeksOfGetHours"
    const val weeksOfAddHours = "account/api/startCource/weeksOfAddHours"
    const val paymentCourseCouponList = "course/api/course/paymentCourseCouponList"
    const val queryMySiteById = "other/api/site/queryMySiteById"
    const val payCourseInfo = "course/api/startCource/payCourseInfo"
@@ -185,13 +158,8 @@
    const val userBilling = "account/api/useBenefit/userBilling"
    const val queryCouponPackage = "activity/api/coupon/queryCouponPackage"
    const val integralMallList = "account/api/useBenefit/integralMallList"
    const val goodsDetails = "account/api/useBenefit/goodsDetails"
    const val goodsDetailsOne = "account/api/useBenefit/goodsDetailsOne"
    const val cancellation = "account/api/useBenefit/cancellation"
    const val productRedemptionOperation = "account/api/useBenefit/productRedemptionOperation"
    const val exchangeRecords = "account/api/useBenefit/exchangeRecords"
    const val redemptionDetails = "account/api/useBenefit/redemptionDetails"
    const val exchangeStoreIds = "account/api/useBenefit/exchangeStoreIds"
    /**
     * 视频
@@ -207,20 +175,13 @@
     */
    const val querySiteList = "other/base/site/querySiteList"
    const val querySiteType = "other/base/site/querySiteType"
    const val querySiteInfo = "other/base/site/querySiteInfo"
    const val querySiteTimes = "other/base/site/querySiteTimes"
    const val querySiteCouponList = "activity/api/coupon/querySiteCouponList"
    const val reservationSite = "other/api/site/reservationSite"
    const val queryMySite = "other/api/site/queryMySite"
    const val cancelMySite = "other/api/site/cancelMySite"
    const val continuePaymentMySite = "other/api/site/continuePaymentMySite"
    /**
     * 赛事
     */
    const val queryCompetitionList = "competition/base/competition/queryCompetitionList"
    const val queryAllCity = "other/base/store/queryAllCity"
    const val queryCompetitionInfo = "competition/base/competition/queryCompetitionInfo"
    const val queryParticipantList = "competition/api/participant/queryParticipantList"
@@ -236,7 +197,6 @@
    /**
     * 探索玩湃
     */
    const val indexOfEx = "account/api/exploreWP/indexOfEx"
    const val storeList = "account/base/exploreWP/storeList"
    const val storeDetail = "account/base/exploreWP/storeDetail"
    const val saveEvaluation = "other/base/storeEvaluation/saveEvaluation"
@@ -245,20 +205,6 @@
    const val noticeDetail = "account/base/exploreWP/noticeDetail"
    const val exceptionDetail = "account/base/exploreWP/exceptionDetail"
    const val exceptionList = "account/base/exploreWP/exceptionList"
    const val optAddQuestion = "api/app/answer/optAddQuestion"
    const val queryQuestionSquareList = "api/app/answer/queryQuestionSquareList"
    const val queryQuestionAnswerList = "api/app/answer/queryQuestionAnswerList"
    const val optDeleteQuestion = "api/app/answer/optDeleteQuestion"
    const val optDeleteAnswer = "api/app/answer/optDeleteAnswer"
    const val optAdoptAnswer = "api/app/answer/optAdoptAnswer"
    const val optAddAnswer = "api/app/answer/optAddAnswer"
    /**
     * 游戏
     */
    const val queryGameList ="other/api/game/queryGameList"
    const val payGame ="other/api/game/payGame"
    /**
     * 世界杯
app/src/main/java/com/dollearn/student/network/Functions.kt
@@ -6,7 +6,7 @@
import cn.sinata.xldutils.fragment.BaseFragment
import cn.sinata.xldutils.rxutils.ResultDataSubscriber
import cn.sinata.xldutils.utils.SPUtils
import com.dollearn.student.WeparkApplication
import com.dollearn.student.DollearnApplication
import com.dollearn.student.ui.login.LoginActivity
import com.dollearn.student.utils.Const
import io.reactivex.Flowable
@@ -29,7 +29,7 @@
            if (code == 700||code == 600){//token无效
                error(code,"登录已失效")
                SPUtils.instance().remove(Const.User.TOKEN).remove(Const.User.USER_ID).apply()
                (activity.application as WeparkApplication).exit()
                (activity.application as DollearnApplication).exit()
                activity.startActivity<LoginActivity>()
            }else{
                super.onError(code, msg)
@@ -55,7 +55,7 @@
            if (code == 700||code == 600){//token无效
                error(code,"登录已失效")
                SPUtils.instance().remove(Const.User.TOKEN).remove(Const.User.USER_ID).apply()
                (fragment.activity!!.application as WeparkApplication).exit()
                (fragment.activity!!.application as DollearnApplication).exit()
                fragment.startActivity<LoginActivity>()
            }else{
                super.onError(code, msg)
app/src/main/java/com/dollearn/student/network/HttpManager.kt
@@ -2,14 +2,12 @@
import cn.sinata.xldutils.data.ResultData
import com.google.gson.JsonObject
import com.dollearn.student.WeparkApplication
import com.dollearn.student.DollearnApplication
import com.dollearn.student.dialog.ChooseStudentDialog
import com.dollearn.student.network.entity.*
import com.dollearn.student.utils.pay.PayInfo
import com.google.gson.Gson
import io.reactivex.Flowable
import okhttp3.ResponseBody
import retrofit2.http.Field
object HttpManager {
    private const val PAGE_SIZE = 20
@@ -41,28 +39,6 @@
     */
    fun queryStoreByCityCode(code: String,provinceCode:String): Flowable<ResultData<ArrayList<CommonData>>> {
        return request().queryStoreByCityCode(code,provinceCode)
    }
    /**
     * 获取最新版本
     */
    fun queryVersionByType(): Flowable<ResultData<JsonObject>> {
        return request().queryVersionByType()
    }
    /**
     * 获取客服电话/推广中心图片/引导页等
     * @param type 1=客服电话,2=推广中心图片,3=引导页
     */
    fun querySystemSetByType(type: Int): Flowable<ResultData<JsonObject>> {
        return request().querySystemSetByType(type)
    }
    /**
     * 获取加入玩湃首页数据
     */
    fun queryJoinPlayPai(lat: Double?, lon: Double?): Flowable<ResultData<HomeData>> {
        return request().queryJoinPlayPai(lat, lon)
    }
    /**
@@ -102,10 +78,6 @@
        return request().payment(payType, id, courseId, courseCount, students, useCoupon, coupon)
    }
    fun paymentCourse2(map: HashMap<String, Any?>): Flowable<ResultData<PayInfo>> {
        return request().paymentCourse2(map)
    }
    /**
     * 赛事报名
     */
@@ -114,38 +86,10 @@
    }
    /**
     * 门店配置
     */
    fun queryStoreConfig(shopId: String): Flowable<ResultData<List<Banner>>> {
        return request().queryStoreConfig(shopId)
    }
    /**
     * 门店更多配置
     */
    fun queryIndexSet(shopId: String): Flowable<ResultData<List<Banner>>> {
        return request().queryIndexSet(shopId)
    }
    /**
     * 体检报告
     */
    fun queryPhysical(id: String): Flowable<ResultData<Report>> {
        return request().queryPhysical(id)
    }
    /**
     * 预约
     */
    fun reverse(time: String, stuId: String, courseId: String): Flowable<ResultData<Any>> {
        return request().reverse(time, stuId, courseId)
    }
    /**
     * 取消预约
     */
    fun cancelCourse(id: String): Flowable<ResultData<Any>> {
        return request().cancelCourse(id)
    }
    /**
@@ -161,23 +105,20 @@
        return request().stuAppointList(id, type, timeType, search,page)
    }
    /**
     * 兑换默认运动营成员或门店
     */
    fun goodsOfCourseStore(isCourse: Int, id: String): Flowable<ResultData<DefaultData>> {
        return request().goodsOfCourseStore(
            isCourse,
            id,
            WeparkApplication.lat,
            WeparkApplication.lon
        )
    }
    /**
     * 用户信息
     */
    fun userDetails(): Flowable<ResultData<UserBean>> {
        return request().userDetails()
    }
    /**
     * 分享信息
     */
    fun shareInfo(): Flowable<ResultData<ConfigBean>> {
        return request().shareInfo()
    }
    /**
@@ -260,8 +201,8 @@
        return request().querySiteList(
            page,
            PAGE_SIZE,
            WeparkApplication.lat,
            WeparkApplication.lon,
            DollearnApplication.lat,
            DollearnApplication.lon,
            cityCode,
            startTime,
            endTime,
@@ -285,17 +226,6 @@
        return request().cancelMySite(id)
    }
    /**
     * 赛事列表
     */
    fun queryCompetitionList(
        cityCode: String?,
        registerCondition: Int?,
        heat: String?,
        search: String?
    ): Flowable<ResultData<List<Match>>> {
        return request().queryCompetitionList(cityCode, registerCondition, heat, search)
    }
    /**
     * 我的赛事列表
@@ -311,19 +241,6 @@
        return request().querySiteType()
    }
    /**
     * 支付运动营--完成后优惠券列表
     */
    fun paymentCourseCouponList(id: Int? = null): Flowable<ResultData<List<Coupon>>> {
        return request().paymentCourseCouponList(id)
    }
    /**
     * 支付会员--完成后优惠券列表
     */
    fun queryCouponList(): Flowable<ResultData<List<Coupon>>> {
        return request().queryCouponList()
    }
    /**
     * 查询预约详情
@@ -365,59 +282,6 @@
     */
    fun registeredCourses(type: Int?, search: String?): Flowable<ResultData<List<JoinedCourse>>> {
        return request().registeredCourses(type, search)
    }
    /**
     * 场地时间段
     */
    fun querySiteTimes(id: String, date: String,siteName:String?,halfName:String?): Flowable<ResultData<List<PlaceTime>>> {
        return request().querySiteTimes(id, date,halfName,siteName)
    }
    /**
     * 场地优惠券
     */
    fun querySiteCouponList(id: String, price: Double): Flowable<ResultData<List<Coupon>>> {
        return request().querySiteCouponList(
            id,
            WeparkApplication.lat,
            WeparkApplication.lon,
            price
        )
    }
    /**
     * 场地详情
     */
    fun querySiteInfo(id: String): Flowable<ResultData<Place>> {
        return request().querySiteInfo(id, WeparkApplication.lat, WeparkApplication.lon)
    }
    /**
     * 场地下单
     */
    fun reservationSite(
        id: String,
        name: String,
        phone: String,
        time: String,
        payType: Int,
        coupon: Long?,
        isHalf: Int,
        halfName: String?,
        nextName: String
    ): Flowable<ResultData<PayInfo>> {
        return request().reservationSite(
            id,
            name,
            phone,
            time,
            payType,
            coupon,
            isHalf,
            halfName,
            nextName
        )
    }
    /**
@@ -575,16 +439,9 @@
            id,
            storeID,
            time,
            WeparkApplication.lat,
            WeparkApplication.lon
            DollearnApplication.lat,
            DollearnApplication.lon
        )
    }
    /**
     * 切换运动营成员
     */
    fun switchStu(id: String): Flowable<ResultData<Any>> {
        return request().switchStu(id)
    }
    /**
@@ -606,6 +463,13 @@
     */
    fun getCode(phone: String): Flowable<ResultData<Any>> {
        return request().getCode(phone)
    }
    /**
     * 获取正确和错误语音
     */
    fun promptVoice(): Flowable<ResultData<ConfigBean>> {
        return request().promptVoice()
    }
    /**
@@ -650,6 +514,20 @@
     */
    fun studySchedule(week:Int,day:Int): Flowable<ResultData<Schedule>> {
        return request().studySchedule(week,day)
    }
    /**
     * 获取在线时间赠送积分信息(单位分钟)
     */
    fun onlineDuration(): Flowable<ResultData<String>> {
        return request().onlineDuration()
    }
    /**
     * 获取在线时间赠送积分信
     */
    fun giveIntegral(): Flowable<ResultData<Boolean>> {
        return request().giveIntegral()
    }
    /**
@@ -781,28 +659,35 @@
    /**
     * 保存进度
     */
    fun exitLearning(answerNumber: Int,correctNumber: Int,day: Int,week: Int,type: Int,teamIds:String,topicIds:String): Flowable<ResultData<Any>> {
        return request().exitLearning(Gson().toJson(ReqSaveProgress(answerNumber,correctNumber,day, week, type, teamIds, topicIds)))
    fun exitLearning(schedule: Int,season: Int,studyTime: Int,answerNumber: Int,correctNumber: Int,day: Int,week: Int,type: Int,teamIds:String,topicIds:String): Flowable<ResultData<Any>> {
        return request().exitLearning(Gson().toJson(ReqSaveProgress(schedule+1,season,answerNumber,correctNumber,day, week, studyTime,type, teamIds, topicIds)))
    }
    /**
     * 保存游戏和故事时间
     */
    fun exitGameOrStory(studyTime: Int): Flowable<ResultData<Any>> {
        return request().exitGameOrStory(studyTime)
    }
    /**
     * 完成学习
     */
    fun completeLearning(rate: Int,time: Int,day: Int,week: Int,season: Int,type: Int,teamIds:String): Flowable<ResultData<Any>> {
    fun completeLearning(rate: Int,time: Int,day: Int,week: Int,season: Int,type: Int,teamIds:String): Flowable<ResultData<Int?>> {
        return request().completeLearning(Gson().toJson(ReqFinishStudy(rate,day,season,teamIds,time,type,week)))
    }
    /**
     * 完成学习
     * 完成故事
     */
    fun completeStory(rate: Int,type: Int,storyId:String): Flowable<ResultData<Any>> {
        return request().completeStory(Gson().toJson(ReqFinishStory(rate,storyId, type)))
    fun completeStory(rate: Int,type: Int,storyId:String,time: Int): Flowable<ResultData<Int?>> {
        return request().completeStory(rate,storyId, type,time)
    }
    /**
     * 完成游戏
     */
    fun gameAchievement(rate: Int,difficulty: Int,gameId:String,gameName:String,useTime:Int): Flowable<ResultData<Any>> {
    fun gameAchievement(rate: Int,difficulty: Int,gameId:String,gameName:String,useTime:Int): Flowable<ResultData<Int?>> {
        return request().gameAchievement(Gson().toJson(ReqFinishGame(rate,difficulty,gameId,gameName, useTime)))
    }
@@ -872,26 +757,13 @@
            sort,
            page,
            PAGE_SIZE,
            WeparkApplication.lat,
            WeparkApplication.lon,
            DollearnApplication.lat,
            DollearnApplication.lon,
            search,
            shopId
        )
    }
    /**
     * 商品可用门店列表
     */
    fun exchangeStoreIds(type: Int, id: String): Flowable<ResultData<List<Shop>>> {
        return request().exchangeStoreIds(type, id)
    }
    /**
     * 兑换记录
     */
    fun exchangeRecords(type: Int?, state: Int?): Flowable<ResultData<List<ExchangeRecord>>> {
        return request().exchangeRecords(type, state)
    }
    /**
     * 兑换详情
@@ -908,29 +780,6 @@
    }
    /**
     * 兑换商品
     */
    fun productRedemptionOperation(
        goodsId: String,
        goodsType: Int,
        exchangeType: Int,
        num: Int,
        payType: Int?,
        students: String?,
        storeId: String?
    ): Flowable<ResultData<PayInfo>> {
        return request().productRedemptionOperation(
            goodsType,
            exchangeType,
            goodsId,
            num,
            payType,
            students,
            storeId
        )
    }
    /**
     * 查询免费福利
     */
    fun queryStoreFreeBenefit(id: String): Flowable<ResultData<JsonObject>> {
@@ -941,7 +790,7 @@
     * 福利
     */
    fun weekLimitedBenefit(type: Int): Flowable<ResultData<ArrayList<Welfare>>> {
        return request().weekLimitedBenefit(type, WeparkApplication.lat, WeparkApplication.lon)
        return request().weekLimitedBenefit(type, DollearnApplication.lat, DollearnApplication.lon)
    }
    /**
@@ -1131,88 +980,19 @@
        return request().goodDetail(id)
    }
    /**
     * 订单详情
     */
    fun queryIsBindAlipay(): Flowable<ResultData<Boolean>> {
        return request().queryIsBindAlipay()
    }
    /**
     * 兑换记录
     */
    fun exchangeRecord(): Flowable<ResultData<List<ExchangeRecord>>> {
        return request().exchangeRecord()
    fun exchangeRecord(page: Int): Flowable<ResultData<ExchangeRecordBean>> {
        return request().exchangeRecord(page)
    }
    /**
     * 运动营退款
     */
    fun optApplyRefund(
        id: Int,
        refundClassHours: Int,
        refundMark: String,
        refundMoney: Double
    ): Flowable<ResultData<JsonObject>> {
        return request().optApplyRefund(id, refundClassHours, refundMark, refundMoney)
    }
    /**
     * 撤销运动营退款
     */
    fun optCancelApply(id: Int): Flowable<ResultData<JsonObject>> {
        return request().optCancelApply(id)
    }
    /**
     * 添加悬赏问题
     */
    fun optAddQuestion(
        question: String,
        describe: String,
        img: String,
        gold: Int
    ): Flowable<ResultData<RewardQuestion>> {
        return request().optAddQuestion(question, describe, img, gold)
    }
    /**
     * 悬赏问题列表
     */
    fun queryQuestionSquareList(
        page: Int,
        key: String? = null
    ): Flowable<ResultData<ArrayList<RewardQuestion>>> {
        return request().queryQuestionSquareList(page, key)
    }
    /**
     * 悬赏答案列表
     */
    fun queryQuestionAnswerList(page: Int, id: Int): Flowable<ResultData<ArrayList<RewardAnswer>>> {
        return request().queryQuestionAnswerList(page, id)
    }
    /**
     * 已报运动营详情
     */
    fun registeredData(id: String,orderId: String): Flowable<ResultData<JoinedCourse>> {
        return request().registeredData(WeparkApplication.lat,WeparkApplication.lon,id,orderId)
    }
    /**
     * 探索首页
     */
    fun indexOfEx(): Flowable<ResultData<List<Shop>>> {
        return request().indexOfEx(WeparkApplication.lat, WeparkApplication.lon)
    }
    /**
     * 游戏列表
     */
    fun queryGameList(storeID: String,siteId:Int): Flowable<ResultData<List<GameBean>>> {
        return request().queryGameList(siteId,storeID)
        return request().registeredData(DollearnApplication.lat,DollearnApplication.lon,id,orderId)
    }
    /**
@@ -1222,20 +1002,14 @@
        return request().gameRecord(userId,page)
    }
    /**
     * 游戏支付
     */
    fun payGame(configId:Int,gameId:Int,spaceId:Int,sutuId:Int,type: Int,gameType: Int): Flowable<ResultData<PayInfo>> {
        return request().payGame(configId,gameId,spaceId,sutuId, type,gameType)
    }
    /**
     * 门店列表
     */
    fun storeList(cityCode: String?, distanceSort: Int?,search: String?): Flowable<ResultData<List<ShopListBean>>> {
        return request().storeList(
            WeparkApplication.lat,
            WeparkApplication.lon,
            DollearnApplication.lat,
            DollearnApplication.lon,
            cityCode,
            distanceSort,
            search)
@@ -1315,13 +1089,6 @@
    }
    /**
     * 获取游戏列表
     */
    fun getGameList(url: String): Flowable<ResponseBody> {
        return request().getGameList(url)
    }
    /**
     *获取平台配置模块详情【2.0】
     */
    fun getHomeModule(): Flowable<ResultData<Banner>> {
@@ -1346,7 +1113,7 @@
     * 裁判世界杯列表
     */
    fun getWorldCupListCoach(storeId: Int?,search: String?): Flowable<ResultData<List<WorldCupBean>>> {
        return request().getWorldCupListCoach(WeparkApplication.lat,WeparkApplication.lon,storeId,search)
        return request().getWorldCupListCoach(DollearnApplication.lat,DollearnApplication.lon,storeId,search)
    }
    /**
@@ -1360,7 +1127,7 @@
     * 世界杯详情
     */
    fun getWorldCupInfo(id: String): Flowable<ResultData<WorldCupBean>> {
        return request().getWorldCupInfo(id,WeparkApplication.lat, WeparkApplication.lon)
        return request().getWorldCupInfo(id,DollearnApplication.lat, DollearnApplication.lon)
    }
    /**
@@ -1409,7 +1176,7 @@
     * 世界杯报名详情
     */
    fun getMyWorldCupInfo(id: String): Flowable<ResultData<WorldCupBean>> {
        return request().getMyWorldCupInfo(id,WeparkApplication.lat, WeparkApplication.lon)
        return request().getMyWorldCupInfo(id,DollearnApplication.lat, DollearnApplication.lon)
    }
    /**
app/src/main/java/com/dollearn/student/network/entity/Banner.kt
@@ -6,11 +6,9 @@
import com.dollearn.student.ui.course.*
import com.dollearn.student.ui.discovery.NoticeDetailActivity
import com.dollearn.student.ui.discovery.ServiceActivity
import com.dollearn.student.ui.discovery.ShopListActivity
import com.dollearn.student.ui.home.*
import com.dollearn.student.ui.mine.RechargeActivity
import com.dollearn.student.ui.welfare.GoodsDetailActivity
import com.dollearn.student.ui.welfare.ScoreShopActivity
import com.dollearn.student.ui.worldcup.WorldCupDetailActivity
import com.dollearn.student.ui.worldcup.WorldCupListActivity
import com.dollearn.student.utils.Const
@@ -49,7 +47,7 @@
            "加入玩湃"->{
                when(page){
                    "主页"->{
                        EventBus.getDefault().post(EmptyEvent(Const.EventCode.SWITCH_HOME))
                        EventBus.getDefault().post(EmptyEvent(Const.EventCode.CLICK_GAME_ITEM))
                        context.startActivity<MainActivity>()
                    }
                    "课程列表"->{
@@ -104,7 +102,6 @@
                    "充值中心"-> context.startActivity<RechargeActivity>()
                    "积分商城"-> {
                        when(type){
                            "主页"-> context.startActivity<ScoreShopActivity>()
                            "指定商品"-> context.startActivity<GoodsDetailActivity>("id" to turnId)
                        }
                    }
@@ -119,9 +116,6 @@
            }
            "探索玩湃"-> {
                when(page) {
                    "门店列表"-> {
                        context.startActivity<ShopListActivity>()
                    }
                    "常见问题"-> {
                        when(type){
                            "列表"-> context.startActivity<ServiceActivity>("index" to 1)
app/src/main/java/com/dollearn/student/network/entity/ConfigBean.kt
New file
@@ -0,0 +1,8 @@
package com.dollearn.student.network.entity
data class ConfigBean(
    val error:String,
    val correct:String,
    val img:String,
    val title:String
)
app/src/main/java/com/dollearn/student/network/entity/ExchangeRecord.kt
@@ -19,4 +19,16 @@
    val orderNumber: String,
    var state: Int,
    val userId: Int
)
)
data class ExchangeRecordBean(
    val current: Int,
    val hasNextPage: Boolean,
    val hasPrevPage: Boolean,
    val pages: Int,
    val records: List<ExchangeRecord>,
    val size: Int,
    val startIndex: Int,
    val total: Int
)
app/src/main/java/com/dollearn/student/network/entity/Goods.kt
@@ -24,5 +24,5 @@
    val typeIds: String,
    val updateBy: String,
    val updateTime: String,
    val userCount: Int
    val userCount: Int?
):Parcelable
app/src/main/java/com/dollearn/student/network/entity/GoodsDetail.kt
@@ -6,6 +6,7 @@
@Parcelize
data class GoodsDetail(
    val exchangeNumber: Int,
    val residueNumber: Int?,
    val good: Goods,
    val goodTypes: List<GoodsType>?,
    val orderNumber: String,
@@ -17,14 +18,10 @@
    val address: String,
    val city: String,
    val cityCode: String,
    val createBy: String?,
    val createTime: String,
    val disabled: Boolean,
    val id: String,
    val isDefault: Int,
    val province: String,
    val provinceCode: String,
    val recipient: String,
    val recipientPhone: String,
    val updateTime: String
    val recipientPhone: String
):Parcelable
app/src/main/java/com/dollearn/student/network/entity/GoodsType.kt
@@ -5,13 +5,7 @@
@Parcelize
data class GoodsType(
    val createBy: String,
    val createTime: String,
    val disabled: Boolean,
    val id: Int,
    val isDelete: Int,
    val name: String,
    val updateBy: String,
    val updateTime: String,
    var checked:Boolean = false
): Parcelable
app/src/main/java/com/dollearn/student/network/entity/ProgressBean.kt
@@ -3,5 +3,6 @@
data class ProgressBean(
    val topicIds: List<String>,
    val answerNumber: Int,
    val correctNumber: Int
    val correctNumber: Int,
    val schedule: Int
)
app/src/main/java/com/dollearn/student/network/entity/ReqFinishStory.kt
File was deleted
app/src/main/java/com/dollearn/student/network/entity/ReqSaveProgress.kt
@@ -1,10 +1,13 @@
package com.dollearn.student.network.entity
data class ReqSaveProgress(
    val schedule:Int,
    val quarter:Int,
    val answerNumber:Int,
    val correctNumber:Int,
    val day:Int,
    val week:Int,
    val studyTime:Int,
    val type:Int,
    val teamIds:String,
    val topicIds:String
app/src/main/java/com/dollearn/student/ui/H5Activity.kt
@@ -14,13 +14,12 @@
import cn.sinata.xldutils.visible
import com.github.zackratos.ultimatebar.UltimateBar
import com.dollearn.student.R
import com.dollearn.student.WeparkApplication
import com.dollearn.student.DollearnApplication
import com.dollearn.student.dialog.TipDialog
import com.dollearn.student.network.HttpManager
import com.dollearn.student.network.request
import com.dollearn.student.ui.login.LoginActivity
import com.dollearn.student.utils.Const
import org.jetbrains.anko.backgroundColorResource
import org.jetbrains.anko.backgroundResource
import org.jetbrains.anko.find
import org.jetbrains.anko.startActivity
@@ -81,7 +80,7 @@
                        HttpManager.cancellation().request(this@H5Activity){ _, _->
                            myToast("注销成功")
                            SPUtils.instance().remove(Const.User.TOKEN).apply()
                            (application as WeparkApplication).exit()
                            (application as DollearnApplication).exit()
                            startActivity<LoginActivity>()
                        }
                    }
app/src/main/java/com/dollearn/student/ui/SplashActivity.kt
@@ -14,7 +14,7 @@
import com.amap.api.maps.MapsInitializer
import com.dollearn.student.MainActivity
import com.dollearn.student.R
import com.dollearn.student.WeparkApplication
import com.dollearn.student.DollearnApplication
import com.dollearn.student.dialog.RuleDialog
import com.dollearn.student.network.Apis
import com.dollearn.student.network.HttpManager
@@ -58,7 +58,7 @@
                ruleDialog.show(supportFragmentManager,"rule")
            },500)
        }
//        getSignInfo(this)
        getSignInfo(this)
    }
    private fun getImg() {
@@ -114,7 +114,7 @@
     * 判断是否第一次启动
     */
    private fun startNext(){
        (application as WeparkApplication).initSdk()
        (application as DollearnApplication).initSdk()
//        if (SPUtils.instance().getBoolean(Const.FIRST_LAUNCH,true)){ //第一次启动显示引导页
//            HttpManager.querySystemSetByType(3).request(this,false,{_,data->
//                val s = data?.optString("content")
app/src/main/java/com/dollearn/student/ui/TransparentStatusBarActivity.kt
@@ -4,12 +4,12 @@
import cn.sinata.xldutils.R
import cn.sinata.xldutils.activity.TitleActivity
import com.github.zackratos.ultimatebar.UltimateBar
import com.dollearn.student.WeparkApplication
import com.dollearn.student.DollearnApplication
import org.jetbrains.anko.backgroundColorResource
abstract class TransparentStatusBarActivity : TitleActivity() {
    protected val app by lazy {
        application as WeparkApplication
        application as DollearnApplication
    }
    override fun onCreate(savedInstanceState: Bundle?) {
app/src/main/java/com/dollearn/student/ui/course/CourseActivity.kt
@@ -5,7 +5,7 @@
import cn.sinata.xldutils.gone
import cn.sinata.xldutils.visible
import com.dollearn.student.R
import com.dollearn.student.WeparkApplication
import com.dollearn.student.DollearnApplication
import com.dollearn.student.network.HttpManager
import com.dollearn.student.network.entity.CommonData
import com.dollearn.student.network.entity.Course
@@ -13,7 +13,6 @@
import com.dollearn.student.ui.TransparentStatusBarActivity
import com.dollearn.student.ui.home.adapter.CourseAdapter
import com.dollearn.student.ui.home.adapter.FilterAdapter
import com.dollearn.student.utils.Const
import com.dollearn.student.utils.event.EmptyEvent
import com.dollearn.student.utils.extention.clickDelay
import kotlinx.android.synthetic.main.activity_course.*
@@ -29,7 +28,7 @@
    private val adapter = CourseAdapter(datas)
    //筛选条件
    var shop = WeparkApplication.storeId //店铺id
    var shop = DollearnApplication.storeId //店铺id
    var type: Int? = null //运动营类型id
    var distanceSort: String? = null //距离排序(asc=正序,desc=降序)
    var salesSort: String? = null //销量排序(asc=正序,desc=降序)
@@ -177,8 +176,8 @@
    private fun getData() {
        HttpManager.queryCourseList(
            shop,
            WeparkApplication.lat,
            WeparkApplication.lon,
            DollearnApplication.lat,
            DollearnApplication.lon,
            type,
            distanceSort,
            salesSort,
@@ -200,7 +199,7 @@
    }
    private fun getShop() {
        HttpManager.queryStoreLists(WeparkApplication.lat, WeparkApplication.lon)
        HttpManager.queryStoreLists(DollearnApplication.lat, DollearnApplication.lon)
            .request(this) { _, data ->
                storeList.addAll(data ?: arrayListOf())
            }
app/src/main/java/com/dollearn/student/ui/course/CourseDetailActivity.kt
@@ -7,7 +7,7 @@
import cn.sinata.xldutils.utils.*
import cn.sinata.xldutils.visible
import com.dollearn.student.R
import com.dollearn.student.WeparkApplication
import com.dollearn.student.DollearnApplication
import com.dollearn.student.dialog.MapTypeDialog
import com.dollearn.student.network.HttpManager
import com.dollearn.student.network.entity.Banner
@@ -15,7 +15,6 @@
import com.dollearn.student.network.request
import com.dollearn.student.ui.TransparentStatusBarActivity
import com.dollearn.student.ui.home.adapter.HomeBannerAdapter
import com.dollearn.student.utils.Const
import com.dollearn.student.utils.ThirdPartyMapsGuide
import com.dollearn.student.utils.event.EmptyEvent
import com.dollearn.student.utils.extention.clickDelay
@@ -61,10 +60,7 @@
            }
        }
        tv_action.clickDelay {
            if (course != null)
                startActivity<JoinCourseActivity>("course" to course)
        }
    }
    override fun initView() {
@@ -85,7 +81,7 @@
    @SuppressLint("SetTextI18n")
    private fun getDetail() {
        HttpManager.queryCourseInfo(id, WeparkApplication.lat, WeparkApplication.lon)
        HttpManager.queryCourseInfo(id, DollearnApplication.lat, DollearnApplication.lon)
            .request(this) { _, data ->
                course = data
                data?.apply {
app/src/main/java/com/dollearn/student/ui/course/CourseFragment.kt
File was deleted
app/src/main/java/com/dollearn/student/ui/course/JoinCourseActivity.kt
File was deleted
app/src/main/java/com/dollearn/student/ui/course/JoinedCourseDetailActivity.kt
@@ -5,7 +5,7 @@
import cn.sinata.xldutils.utils.*
import cn.sinata.xldutils.visible
import com.dollearn.student.R
import com.dollearn.student.WeparkApplication
import com.dollearn.student.DollearnApplication
import com.dollearn.student.network.HttpManager
import com.dollearn.student.network.entity.Banner
import com.dollearn.student.network.entity.JoinedCourse
@@ -33,10 +33,7 @@
    override fun initClick() {
        tv_action.clickDelay {
            showDialog()
            HttpManager.queryCourseInfo(course?.coursePackageId?:"", WeparkApplication.lat, WeparkApplication.lon).request(this){ _, data->
                startActivity<JoinCourseActivity>("paymentId" to id,"course" to data,"isContinue" to (tv_action.text == "续课"))
            }
        }
    }
app/src/main/java/com/dollearn/student/ui/course/MyCourseActivity.kt
@@ -56,12 +56,7 @@
        bg_filter.setOnClickListener {
            cb_type.isChecked = false
        }
        adapter.setOnItemClickListener { view, position ->
            if (datas[position].payStatus == 1) //待支付,跳转支付详情页
                startActivityForResult<UnPayCourseDetailActivity>(1,"orderId" to datas[position].orderId,"id" to datas[position].coursePayId)
            else
                startActivityForResult<JoinedCourseDetailActivity>(1,"orderId" to datas[position].orderId,"id" to datas[position].coursePayId)
        }
    }
    override fun initView() {
app/src/main/java/com/dollearn/student/ui/course/MyCourseDetailActivity.kt
@@ -3,11 +3,10 @@
import android.content.Intent
import android.view.View
import androidx.recyclerview.widget.LinearLayoutManager
import cn.sinata.xldutils.utils.SpanBuilder
import cn.sinata.xldutils.utils.showAllowingStateLoss
import cn.sinata.xldutils.utils.toTime
import com.dollearn.student.R
import com.dollearn.student.WeparkApplication
import com.dollearn.student.DollearnApplication
import com.dollearn.student.dialog.ChooseMonthDialog
import com.dollearn.student.dialog.FilterPop
import com.dollearn.student.network.HttpManager
@@ -73,15 +72,7 @@
        }
        tv_buy.setOnClickListener {
            showDialog()
            HttpManager.queryCourseInfo(courseId!!, WeparkApplication.lat, WeparkApplication.lon,stuId)
                .request(this) { _, data ->
                    startActivityForResult<JoinCourseActivity>(
                        1,
                        "course" to data,
                        "isContinue" to true
                    )
                }
        }
    }
app/src/main/java/com/dollearn/student/ui/course/ReserveRecordActivity.kt
File was deleted
app/src/main/java/com/dollearn/student/ui/course/ReserveRecordFragment.kt
File was deleted
app/src/main/java/com/dollearn/student/ui/course/UnPayCourseDetailActivity.kt
File was deleted
app/src/main/java/com/dollearn/student/ui/course/WeekFragment.kt
File was deleted
app/src/main/java/com/dollearn/student/ui/course/WelfareDetailActivity.kt
@@ -5,7 +5,7 @@
import cn.sinata.xldutils.utils.SpanBuilder
import cn.sinata.xldutils.visible
import com.dollearn.student.R
import com.dollearn.student.WeparkApplication
import com.dollearn.student.DollearnApplication
import com.dollearn.student.network.HttpManager
import com.dollearn.student.network.entity.Banner
import com.dollearn.student.network.request
@@ -31,10 +31,7 @@
    override fun initClick() {
        tv_action.clickDelay {
            if (courseId!=null){
                showDialog()
                HttpManager.queryCourseInfo(courseId!!,WeparkApplication.lat,WeparkApplication.lon).request(this){_,data->
                    startActivity<JoinCourseActivity>("course" to data,"courseCount" to courseCount)
                }
            }
        }
    }
@@ -46,7 +43,7 @@
    }
    private fun getDetail(){
        HttpManager.discountCourseDatas(id, WeparkApplication.lat, WeparkApplication.lon).request(this){ _, data->
        HttpManager.discountCourseDatas(id, DollearnApplication.lat, DollearnApplication.lon).request(this){ _, data->
            data?.apply {
                courseId = coursePackageDiscountId
                bannerImg.addAll((detailDrawing?:"").split(",").map { Banner(url = it) })
app/src/main/java/com/dollearn/student/ui/course/adapter/CourseScheduleAdapter.kt
File was deleted
app/src/main/java/com/dollearn/student/ui/course/adapter/MedalAdapter.kt
@@ -9,7 +9,6 @@
import com.dollearn.student.network.entity.Medal
import com.dollearn.student.ui.course.PracticeListActivity
import com.dollearn.student.ui.home.FieldActivity
import com.dollearn.student.ui.worldcup.MyWorldActivity
import org.jetbrains.anko.imageResource
import org.jetbrains.anko.startActivity
import java.util.ArrayList
@@ -29,8 +28,6 @@
                    1->(context as BaseActivity).finish()
                    3->context.startActivity<FieldActivity>()
                    4->context.startActivity<PracticeListActivity>("stuId" to stuId)
                    5->context.startActivity<MyWorldActivity>()
                    6->context.startActivity<MyWorldActivity>()
                }
            }
        }
app/src/main/java/com/dollearn/student/ui/course/adapter/PaySuccessCouponAdapter.kt
File was deleted
app/src/main/java/com/dollearn/student/ui/course/adapter/ReserveRecordAdapter.kt
File was deleted
app/src/main/java/com/dollearn/student/ui/course/adapter/WeekAdapter.kt
File was deleted
app/src/main/java/com/dollearn/student/ui/course/adapter/WeekViewPagerAdapter.kt
File was deleted
app/src/main/java/com/dollearn/student/ui/discovery/MyQrCodeActivity.kt
File was deleted
app/src/main/java/com/dollearn/student/ui/discovery/ShopListActivity.kt
File was deleted
app/src/main/java/com/dollearn/student/ui/discovery/StudentManageActivity.kt
File was deleted
app/src/main/java/com/dollearn/student/ui/discovery/adapter/QrAdapter.kt
File was deleted
app/src/main/java/com/dollearn/student/ui/discovery/adapter/StuManageAdapter.kt
File was deleted
app/src/main/java/com/dollearn/student/ui/home/ChooseVoiceActivity.kt
@@ -18,7 +18,6 @@
import com.dollearn.student.network.request
import com.dollearn.student.ui.TransparentStatusBarActivity
import kotlinx.android.synthetic.main.activity_listen.*
import org.jetbrains.anko.startActivity
class ChooseVoiceActivity:TransparentStatusBarActivity() {
    override fun setContentView() = R.layout.activity_listen
@@ -56,7 +55,7 @@
    fun next(){
        if (view_pager.currentItem == fragments.lastIndex){
            handler?.removeMessages(0)
            ResultActivity.startResult(this,day,week,season,1,totalCount,rightCount,data!!.data.integral,time,data!!.data.id)
            ResultActivity.startResult(this,day,week,season,2,totalCount,rightCount,data!!.data.integral,time,data!!.data.id)
            finish()
        }else{
            (fragments[view_pager.currentItem+1] as ChooseVoiceFragment).recover()
@@ -117,7 +116,9 @@
    private fun recover(){
        HttpManager.teamSchedule(day,week,2).request(this){_,data->
//            view_pager.setCurrentItem(data?.topicIds?.size?:1,false)
            view_pager.setCurrentItem((data?.schedule?:1)-1,false)
            if (view_pager.currentItem != 0)
                tv_last.visible()
            totalCount = data?.answerNumber?:0
            rightCount = data?.correctNumber?:0
        }
@@ -132,7 +133,7 @@
                    finish()
                else{
                    val list = (data?.subjectList?: arrayListOf()).subList(0,view_pager.currentItem).flatMap { it }
                    HttpManager.exitLearning(totalCount,rightCount,day,week,2,data?.data?.id?:"", list.joinToString(",") { it.id }).request(this@ChooseVoiceActivity){ _, _->
                    HttpManager.exitLearning(view_pager.currentItem,season,time,totalCount,rightCount,day,week,2,data?.data?.id?:"", list.joinToString(",") { it.id }).request(this@ChooseVoiceActivity){ _, _->
                        finish()
                    }
                }
app/src/main/java/com/dollearn/student/ui/home/ChooseVoiceFragment.kt
@@ -9,10 +9,12 @@
import androidx.core.os.bundleOf
import cn.sinata.xldutils.fragment.BaseFragment
import cn.sinata.xldutils.gone
import cn.sinata.xldutils.utils.SPUtils
import cn.sinata.xldutils.utils.myToast
import cn.sinata.xldutils.visible
import com.dollearn.student.R
import com.dollearn.student.utils.AudioUtils
import com.dollearn.student.utils.Const
import com.dollearn.student.utils.extention.clickDelay
import kotlinx.android.synthetic.main.fragment_choose_voice.*
import org.jetbrains.anko.backgroundResource
@@ -27,6 +29,15 @@
    private val PLAY_VOICE = 1
    private val TO_NEXT = 10
    private val PLAY_ERROR = 3
    private val PLAY_RIGHT = 4
    private val errorVoice by lazy { SPUtils.instance().getString(Const.EV) }
    private val rightVoice by lazy { SPUtils.instance().getString(Const.RV) }
    private var rightPlaying = false
    private var errorPlaying = false
    private var voiceList = arrayListOf<String>() //本题音频,每题有3个音频
    private val player by lazy { AudioUtils() }
@@ -45,6 +56,8 @@
    private val act by lazy { (requireActivity() as ChooseVoiceActivity) }
    private var nowVoiceView:View? = null
    override fun onFirstVisibleToUser() {
        player.setOnAudioStatusUpdateListener(this)
        player.stopPlayMusic()
@@ -58,6 +71,14 @@
                    TO_NEXT->{
                        if (isAdded&&!playing)
                            (requireActivity() as ChooseVoiceActivity).next()
                    }
                    PLAY_RIGHT->{
                        rightPlaying = true
                        player.startPlayMusic(requireContext(),rightVoice)
                    }
                    PLAY_ERROR->{
                        errorPlaying = true
                        player.startPlayMusic(requireContext(),errorVoice)
                    }
                }
            }
@@ -98,57 +119,81 @@
        rl_check_1.clickDelay {
            if (playing)
                return@clickDelay
            dot_1.visible()
            act.totalCount++
            if (voiceList[0] == data!!.subjectList[group][currentIndex].correct){
                act.rightCount++
                data!!.subjectList[group][currentIndex].completed = true
                motion.transitionToEnd()
                cl_voice1.callOnClick()
            }else{
                iv_error_1.visible()
                dot_1.postDelayed({
                    iv_error_1.gone()
                    dot_1.gone()
                },2000)
            }
            if (rl_check_2.visibility == View.VISIBLE&&rl_check_3.visibility == View.VISIBLE){
                dot_1.visible()
                act.totalCount++
                if (voiceList[0] == data!!.subjectList[group][currentIndex].correct){
                    act.rightCount++
                    motion.transitionToEnd()
                    nowVoiceView = cl_voice1
                    handler?.sendEmptyMessage(PLAY_RIGHT)
                }else{
                    handler?.sendEmptyMessage(PLAY_ERROR)
                    iv_error_1.visible()
                    dot_1.postDelayed({
                        iv_error_1.gone()
                        dot_1.gone()
                        rl_check_1.gone()
                        rl_check_2.gone()
                        rl_check_3.gone()
                    },2000)
                }
            }else
                myToast("请听完题")
        }
        rl_check_2.clickDelay {
            if (playing)
                return@clickDelay
            dot_2.visible()
            act.totalCount++
            if (voiceList[1] == data!!.subjectList[group][currentIndex].correct){
                act.rightCount++
                data!!.subjectList[group][currentIndex].completed = true
                motion.transitionToEnd()
                cl_voice2.callOnClick()
            }else{
                iv_error_2.visible()
                dot_1.postDelayed({
                    dot_2.gone()
                    iv_error_2.gone()
                },2000)
            }
            if (rl_check_1.visibility == View.VISIBLE&&rl_check_3.visibility == View.VISIBLE) {
                dot_2.visible()
                act.totalCount++
                if (voiceList[1] == data!!.subjectList[group][currentIndex].correct){
                    act.rightCount++
                    motion.transitionToEnd()
                    nowVoiceView = cl_voice2
                    handler?.sendEmptyMessage(PLAY_RIGHT)
                }else{
                    handler?.sendEmptyMessage(PLAY_ERROR)
                    iv_error_2.visible()
                    dot_1.postDelayed({
                        dot_2.gone()
                        iv_error_2.gone()
                        rl_check_1.gone()
                        rl_check_2.gone()
                        rl_check_3.gone()
                    },2000)
                }
            }else
                myToast("请听完题")
        }
        rl_check_3.clickDelay {
            if (playing)
                return@clickDelay
            dot_3.visible()
            act.totalCount++
            if (voiceList[2] == data!!.subjectList[group][currentIndex].correct){
                data!!.subjectList[group][currentIndex].completed = true
                act.rightCount++
                motion.transitionToEnd()
                cl_voice3.callOnClick()
            }else{
                iv_error_3.visible()
                dot_1.postDelayed({
                    iv_error_3.gone()
                    dot_3.gone()
                },2000)
            }
            if (rl_check_2.visibility == View.VISIBLE&&rl_check_3.visibility == View.VISIBLE) {
                dot_3.visible()
                act.totalCount++
                if (voiceList[2] == data!!.subjectList[group][currentIndex].correct){
                    act.rightCount++
                    nowVoiceView = cl_voice3
                    handler?.sendEmptyMessage(PLAY_RIGHT)
                    motion.transitionToEnd()
                }else{
                    handler?.sendEmptyMessage(PLAY_ERROR)
                    iv_error_3.visible()
                    dot_1.postDelayed({
                        iv_error_3.gone()
                        dot_3.gone()
                        rl_check_1.gone()
                        rl_check_2.gone()
                        rl_check_3.gone()
                    },2000)
                }
            }else
                myToast("请听完题")
        }
        cl_voice_end_1.clickDelay {
@@ -292,40 +337,42 @@
    override fun onStartPlay() {
        playing = true
        if (voiceIndex == 0){
            iv1_1.gone()
            iv2_1.gone()
            iv_playing_1.visible()
        }
        if (voiceIndex == 1){
            iv1_2.gone()
            iv2_2.gone()
            iv_playing_2.visible()
        }
        if (voiceIndex == 2){
            iv1_3.gone()
            iv2_3.gone()
            iv_playing_3.visible()
        }
        if (voiceIndex == 3){
            iv1_1_end.gone()
            iv2_1_end.gone()
            iv_playing_1_end.visible()
        }
        if (voiceIndex == 4){
            iv1_2_end.gone()
            iv2_2_end.gone()
            iv_playing_2_end.visible()
        }
        if (voiceIndex == 5){
            iv1_3_end.gone()
            iv2_3_end.gone()
            iv_playing_3_end.visible()
        }
        if (voiceIndex == 6){
            iv1_4_end.gone()
            iv2_4_end.gone()
            iv_playing_4_end.visible()
        if (!errorPlaying&&!rightPlaying){
            if (voiceIndex == 0){
                iv1_1.gone()
                iv2_1.gone()
                iv_playing_1.visible()
            }
            if (voiceIndex == 1){
                iv1_2.gone()
                iv2_2.gone()
                iv_playing_2.visible()
            }
            if (voiceIndex == 2){
                iv1_3.gone()
                iv2_3.gone()
                iv_playing_3.visible()
            }
            if (voiceIndex == 3){
                iv1_1_end.gone()
                iv2_1_end.gone()
                iv_playing_1_end.visible()
            }
            if (voiceIndex == 4){
                iv1_2_end.gone()
                iv2_2_end.gone()
                iv_playing_2_end.visible()
            }
            if (voiceIndex == 5){
                iv1_3_end.gone()
                iv2_3_end.gone()
                iv_playing_3_end.visible()
            }
            if (voiceIndex == 6){
                iv1_4_end.gone()
                iv2_4_end.gone()
                iv_playing_4_end.visible()
            }
        }
    }
@@ -379,5 +426,19 @@
                showSubImage()
            }
        }
        if (rightPlaying){
            rightPlaying = false
            data!!.subjectList[group][currentIndex].completed = true
            nowVoiceView?.callOnClick()
        }
        if (errorPlaying)
            errorPlaying = false
    }
    override fun onPause() {
        super.onPause()
        player.stopPlayMusic()
    }
}
app/src/main/java/com/dollearn/student/ui/home/DailyFragment.kt
@@ -5,12 +5,17 @@
import android.widget.TextView
import androidx.core.os.bundleOf
import cn.sinata.xldutils.fragment.BaseFragment
import cn.sinata.xldutils.utils.myToast
import cn.sinata.xldutils.utils.showAllowingStateLoss
import com.dollearn.student.R
import com.dollearn.student.dialog.TipDialog
import com.dollearn.student.network.Apis
import com.dollearn.student.network.HttpManager
import com.dollearn.student.network.requestByF
import com.dollearn.student.utils.extention.clickDelay
import kotlinx.android.synthetic.main.fragment_daily.*
import org.jetbrains.anko.backgroundResource
import org.jetbrains.anko.support.v4.browse
import org.jetbrains.anko.support.v4.startActivityForResult
import org.jetbrains.anko.support.v4.toast
@@ -34,33 +39,61 @@
        getProgress()
        cl_1.clickDelay {
            showDialog("加载题目...")
            HttpManager.listenSelectPicture(season, week, day).requestByF(this){_,data->
            HttpManager.listenSelectPicture(season, week, day).requestByF(this,false, {_,data->
                startActivityForResult<ListenActivity>(1,"data" to data,"day" to day,"week" to week,"season" to season)
            }){_,msg->
                handleError(msg)
            }
        }
        cl_2.clickDelay {
            showDialog("加载题目...")
            HttpManager.pictureSelectVoice(season, week, day).requestByF(this){_,data->
            HttpManager.pictureSelectVoice(season, week, day).requestByF(this,false, {_,data->
                startActivityForResult<ChooseVoiceActivity>(1,"data" to data,"day" to day,"week" to week,"season" to season)
            }){_,msg->
                handleError(msg)
            }
        }
        cl_3.clickDelay {
            showDialog("加载题目...")
            HttpManager.induceExclude(season, week, day).requestByF(this){_,data->
            HttpManager.induceExclude(season, week, day).requestByF(this,false, {_,data->
                startActivityForResult<IncludeActivity>(1,"data" to data,"day" to day,"week" to week,"season" to season)
            }){_,msg->
                handleError(msg)
            }
        }
        cl_4.clickDelay {
            showDialog("加载题目...")
            HttpManager.questionsAndAnswers(season, week, day).requestByF(this){_,data->
            HttpManager.questionsAndAnswers(season, week, day).requestByF(this,false, {_,data->
                startActivityForResult<QAActivity>(1,"data" to data,"day" to day,"week" to week,"season" to season)
            }){_,msg->
                handleError(msg)
            }
        }
        cl_5.clickDelay {
            showDialog("加载题目...")
            HttpManager.pictureMateVoice(season, week, day).requestByF(this){_,data->
            HttpManager.pictureMateVoice(season, week, day).requestByF(this,false,{_,data->
                startActivityForResult<MatchActivity>(1,"data" to data,"day" to day,"week" to week,"season" to season)
            }){_,msg->
                handleError(msg)
            }
        }
    }
    private fun handleError(msg:String){
        if (msg.contains("会员")){
            val tipDialog = TipDialog()
            tipDialog.arguments = bundleOf("msg" to msg,"ok" to "成为会员")
            tipDialog.setCallback(object :TipDialog.OnClickCallback{
                override fun onOk() {
                    browse(Apis.SHARE_URL,true)
                }
                override fun onCancel() {
                }
            })
            tipDialog.showAllowingStateLoss(childFragmentManager,"vip")
        }else{
            myToast(msg)
        }
    }
@@ -92,11 +125,7 @@
    private fun formatProgress(progress:Int,tv:TextView){
        tv.text =  when(progress){
            -1->{
                tv.backgroundResource = R.drawable.bg_grey_9dp
               "未开始"
            }
            0->{
            -1, 0->{
                tv.backgroundResource = R.drawable.bg_red_9dp
                "未完成"
            }
@@ -105,7 +134,8 @@
                "已完成"
            }
            else->{
                "剩余:${100-progress}%"
                tv.backgroundResource = R.drawable.bg_pink_9dp
                "剩余:${progress}%"
            }
        }
    }
app/src/main/java/com/dollearn/student/ui/home/FieldActivity.kt
@@ -11,7 +11,7 @@
import cn.sinata.xldutils.visible
import com.amap.api.location.AMapLocationListener
import com.dollearn.student.R
import com.dollearn.student.WeparkApplication
import com.dollearn.student.DollearnApplication
import com.dollearn.student.dialog.ChooseTimeDialog
import com.dollearn.student.network.HttpManager
import com.dollearn.student.network.entity.CommonData
@@ -85,10 +85,10 @@
            getShop()
        }
        tv_current.setOnClickListener {
            if (WeparkApplication.cityCode.isNotEmpty()){
            if (DollearnApplication.cityCode.isNotEmpty()){
                cb_city.isChecked = false
                cityCode = WeparkApplication.cityCode
                cb_city.text = WeparkApplication.cityName
                cityCode = DollearnApplication.cityCode
                cb_city.text = DollearnApplication.cityName
                shop = null
                refreshLayout.autoRefresh()
                getShop()
@@ -100,12 +100,12 @@
                    .subscribe {
                        if (it){
                            AMapKit.initLocation(this, AMapLocationListener {
                                WeparkApplication.lat = it.latitude
                                WeparkApplication.lon = it.longitude
                                WeparkApplication.province = it.province
                                WeparkApplication.provinceCode = "${it.adCode.substring(0,3)}000"
                                WeparkApplication.cityName = it.city
                                WeparkApplication.cityCode = "${it.adCode.substring(0,4)}00"
                                DollearnApplication.lat = it.latitude
                                DollearnApplication.lon = it.longitude
                                DollearnApplication.province = it.province
                                DollearnApplication.provinceCode = "${it.adCode.substring(0,3)}000"
                                DollearnApplication.cityName = it.city
                                DollearnApplication.cityCode = "${it.adCode.substring(0,4)}00"
                                tv_current.text = it.city
                            })
                        }else
@@ -236,7 +236,7 @@
    }
    override fun initView() {
        shop = WeparkApplication.storeId
        shop = DollearnApplication.storeId
        rv_course.layoutManager = LinearLayoutManager(this)
        rv_course.adapter = adapter
        refreshLayout.setOnRefreshListener {
@@ -262,7 +262,7 @@
        }
        rv_filter.layoutManager = LinearLayoutManager(this)
        rv_filter.adapter = filterAdapter
        tv_current.text = SpanBuilder("当前城市:${WeparkApplication.cityName}").color(this,0,5,R.color.textColor).build()
        tv_current.text = SpanBuilder("当前城市:${DollearnApplication.cityName}").color(this,0,5,R.color.textColor).build()
        //筛选项数据
        getCity()
        getTypes()
@@ -316,7 +316,7 @@
    }
    private fun getShop(){
        HttpManager.queryStoreLists(WeparkApplication.lat,WeparkApplication.lon,cityCode).request(this){_,data->
        HttpManager.queryStoreLists(DollearnApplication.lat,DollearnApplication.lon,cityCode).request(this){ _, data->
            storeList.clear()
            storeList.add(CommonData(name = "全部"))
            storeList.addAll(data?: arrayListOf())
app/src/main/java/com/dollearn/student/ui/home/IncludeActivity.kt
@@ -14,6 +14,7 @@
import com.dollearn.student.R
import com.dollearn.student.dialog.TipDialog
import com.dollearn.student.network.HttpManager
import com.dollearn.student.network.entity.Subject
import com.dollearn.student.network.entity.SubjectBean
import com.dollearn.student.network.request
import com.dollearn.student.ui.TransparentStatusBarActivity
@@ -116,7 +117,9 @@
    private fun recover(){
        HttpManager.teamSchedule(day,week,3).request(this){_,data->
            view_pager.setCurrentItem(data?.topicIds?.size?:0,false)
            view_pager.setCurrentItem((data?.schedule?:1)-1,false)
            if (view_pager.currentItem != 0)
                tv_last.visible()
            totalCount = data?.answerNumber?:0
            rightCount = data?.correctNumber?:0
        }
@@ -130,8 +133,16 @@
                if (view_pager.currentItem == 0)
                    finish()
                else{
                    val list = (data?.subjectList?: arrayListOf()).flatMap { it }.subList(0,view_pager.currentItem)
                    HttpManager.exitLearning(totalCount,rightCount,day,week,3,data?.data?.id?:"", list.joinToString(",") { it.id }).request(this@IncludeActivity){ _, _->
                    val list = (data?.subjectList?.subList(0,view_pager.currentItem))
                    val arrayListOf = arrayListOf<Subject>()
                    list?.forEach { it ->
                        it.forEachIndexed { index, subject ->
                            if (index == 2||index == 4||index == 5){
                                arrayListOf.add(subject)
                            }
                        }
                    }
                    HttpManager.exitLearning(view_pager.currentItem,season,time,totalCount,rightCount,day,week,3,data?.data?.id?:"", arrayListOf.joinToString(",") { it.id }).request(this@IncludeActivity){ _, _->
                        finish()
                    }
                }
app/src/main/java/com/dollearn/student/ui/home/IncludeFragment.kt
@@ -4,16 +4,21 @@
import android.os.Looper
import android.os.Message
import android.util.Log
import android.view.View
import androidx.constraintlayout.motion.widget.MotionLayout
import androidx.core.os.bundleOf
import cn.sinata.xldutils.activity.ImagePagerActivity
import cn.sinata.xldutils.fragment.BaseFragment
import cn.sinata.xldutils.gone
import cn.sinata.xldutils.utils.SPUtils
import cn.sinata.xldutils.utils.myToast
import cn.sinata.xldutils.visible
import com.dollearn.student.R
import com.dollearn.student.utils.AudioUtils
import com.dollearn.student.utils.Const
import com.dollearn.student.utils.extention.clickDelay
import kotlinx.android.synthetic.main.fragment_include.*
import org.jetbrains.anko.support.v4.startActivity
class IncludeFragment : BaseFragment(), AudioUtils.OnAudioStatusUpdateListener {
    override fun contentViewId() = R.layout.fragment_include
@@ -23,6 +28,15 @@
    private var handler:Handler? = null
    private val PLAY_VOICE = 1
    private val TO_NEXT = 2
    private val PLAY_ERROR = 3
    private val PLAY_RIGHT = 4
    private val errorVoice by lazy { SPUtils.instance().getString(Const.EV) }
    private val rightVoice by lazy { SPUtils.instance().getString(Const.RV) }
    private var rightPlaying = false
    private var errorPlaying = false
    private val player by lazy { AudioUtils() }
    private val group by lazy { arguments?.getInt("group")?:0 }
@@ -39,6 +53,8 @@
    private val answerImg = arrayListOf<String>() //随机答案图片
    private var currentImage = 0 //当前作答的题号:2,4,5
    private var nowVoiceView: View? = null
    override fun onFirstVisibleToUser() {
        player.setOnAudioStatusUpdateListener(this)
        player.stopPlayMusic()
@@ -53,6 +69,14 @@
                        if (isAdded&&!playing){
                            (requireActivity() as IncludeActivity).next()
                        }
                    }
                    PLAY_RIGHT->{
                        rightPlaying = true
                        player.startPlayMusic(requireContext(),rightVoice)
                    }
                    PLAY_ERROR->{
                        errorPlaying = true
                        player.startPlayMusic(requireContext(),errorVoice)
                    }
                }
            }
@@ -104,11 +128,13 @@
            }
            act.totalCount++
            if (answerImg[0] == subject.img){
                nowVoiceView = voiceViews[currentImage]
                act.rightCount++
                data!!.subjectList[group][currentImage].completed = true
                voiceViews[currentImage].callOnClick()
                handler?.sendEmptyMessage(PLAY_RIGHT)
                motion.transitionToEnd()
                showResultAnim()
            }else{
                handler?.sendEmptyMessage(PLAY_ERROR)
                iv_error_1.visible()
                iv_error_1.postDelayed({
                    clearAnswerImg()
@@ -123,11 +149,16 @@
            if (!subject.listend||subject.completed){
                return@clickDelay
            }
            act.totalCount++
            if (answerImg[1] == subject.img){
                data!!.subjectList[group][currentImage].completed = true
                voiceViews[currentImage].callOnClick()
                nowVoiceView = voiceViews[currentImage]
                act.rightCount++
                handler?.sendEmptyMessage(PLAY_RIGHT)
                motion.transitionToEnd()
                showResultAnim()
            }else{
                handler?.sendEmptyMessage(PLAY_ERROR)
                iv_error_2.visible()
                iv_error_2.postDelayed({
                    clearAnswerImg()
@@ -142,17 +173,40 @@
            if (!subject.listend||subject.completed){
                return@clickDelay
            }
            act.totalCount++
            if (answerImg[2] == subject.img){
                data!!.subjectList[group][currentImage].completed = true
                voiceViews[currentImage].callOnClick()
                nowVoiceView = voiceViews[currentImage]
                act.rightCount++
                handler?.sendEmptyMessage(PLAY_RIGHT)
                motion.transitionToEnd()
                showResultAnim()
            }else{
                handler?.sendEmptyMessage(PLAY_ERROR)
                iv_error_3.visible()
                iv_error_3.postDelayed({
                    clearAnswerImg()
                },3000)
            }
        }
        iv_full_1.clickDelay {
            startActivity<ImagePagerActivity>("url" to arrayListOf(answerImg[0]))
        }
        iv_full_2.clickDelay {
            startActivity<ImagePagerActivity>("url" to arrayListOf(answerImg[1]))
        }
        iv_full_3.clickDelay {
            startActivity<ImagePagerActivity>("url" to arrayListOf(answerImg[2]))
        }
    }
    private fun showResultAnim(){
        val v = if (currentImage == 2) result_3 else if (currentImage == 4) result_5 else result_6
        v.visible()
        v.postDelayed({v.gone()},3000)
    }
    private fun showVoiceEnable(){
@@ -168,13 +222,19 @@
        }
    }
    /**
     * 答错后重置
     */
    private fun clearAnswerImg(){
        iv_answer_1.setImageURI("")
        iv_answer_2.setImageURI("")
        iv_answer_3.setImageURI("")
        iv_3.setImageURI("")
        iv_5.setImageURI("")
        iv_6.setImageURI("")
        if (currentImage == 2)
            iv_3.setImageURI("")
        if (currentImage == 4)
            iv_5.setImageURI("")
        if (currentImage == 5)
            iv_6.setImageURI("")
        iv_full_1.gone()
        iv_full_2.gone()
        iv_full_3.gone()
@@ -184,7 +244,24 @@
        data!!.subjectList[group][currentImage].listend = false
    }
    /**
     * 答对后的重置
     */
    private fun hideAnswerImg(){
        iv_answer_1.setImageURI("")
        iv_answer_2.setImageURI("")
        iv_answer_3.setImageURI("")
        iv_full_1.gone()
        iv_full_2.gone()
        iv_full_3.gone()
        iv_error_1.gone()
        iv_error_2.gone()
        iv_error_3.gone()
    }
    private fun showAnswerImg(){
        if (errorPlaying||rightPlaying)
            return
        answerImg.shuffle()
        iv_answer_1.setImageURI(answerImg[0])
        iv_answer_2.setImageURI(answerImg[1])
@@ -299,6 +376,8 @@
    override fun onStartPlay() {
        playing = true
        if (errorPlaying||rightPlaying)
            return
        when(voiceIndex){
            0->{
                iv1_1.gone()
@@ -357,6 +436,8 @@
                if (!subject.completed){
                    currentImage = 2
                    showAnswerImg()
                }else{
                    hideAnswerImg()
                }
            }
            3->{
@@ -371,6 +452,8 @@
                if (!subject.completed){
                    currentImage = 4
                    showAnswerImg()
                }else{
                    hideAnswerImg()
                }
            }
            5->{
@@ -381,11 +464,25 @@
                    currentImage = 5
                    showAnswerImg()
                }else{
                    hideAnswerImg()
                    Log.e(TAG,"本题全部答对,3秒后进入下一图")
                    handler?.sendEmptyMessageDelayed(TO_NEXT,3000)
                }
            }
        }
        showVoiceEnable()
        if (errorPlaying)
            errorPlaying = false
        if (rightPlaying) {
            rightPlaying = false
            data!!.subjectList[group][currentImage].completed = true
            nowVoiceView?.callOnClick()
        }
    }
    override fun onPause() {
        super.onPause()
        player.stopPlayMusic()
    }
}
app/src/main/java/com/dollearn/student/ui/home/JoinVipActivity.kt
@@ -4,7 +4,7 @@
import cn.sinata.xldutils.callPhone
import cn.sinata.xldutils.utils.optString
import com.dollearn.student.R
import com.dollearn.student.WeparkApplication
import com.dollearn.student.DollearnApplication
import com.dollearn.student.dialog.PayDialog
import com.dollearn.student.network.Apis
import com.dollearn.student.network.HttpManager
@@ -53,7 +53,7 @@
    }
    private fun getFree(){
        HttpManager.queryStoreFreeBenefit(WeparkApplication.storeId).request(this){_,data->
        HttpManager.queryStoreFreeBenefit(DollearnApplication.storeId).request(this){ _, data->
            phone = data?.optString("phone")
            data?.optString("img")?.loadLongImage(this,iv_img)
        }
app/src/main/java/com/dollearn/student/ui/home/ListenActivity.kt
@@ -18,7 +18,6 @@
import com.dollearn.student.network.request
import com.dollearn.student.ui.TransparentStatusBarActivity
import kotlinx.android.synthetic.main.activity_listen.*
import org.jetbrains.anko.startActivity
class ListenActivity:TransparentStatusBarActivity() {
    override fun setContentView() = R.layout.activity_listen
@@ -119,7 +118,9 @@
    private fun recover(){
        HttpManager.teamSchedule(day,week,1).request(this){_,data->
            view_pager.setCurrentItem(data?.topicIds?.size?:0,false)
            view_pager.setCurrentItem((data?.schedule?:1)-1,false)
            if (view_pager.currentItem != 0)
                tv_last.visible()
            totalCount = data?.answerNumber?:0
            rightCount = data?.correctNumber?:0
        }
@@ -134,7 +135,7 @@
                    finish()
                else{
                    val list = (data?.subjectList?: arrayListOf()).flatMap { it }.subList(0,view_pager.currentItem)
                    HttpManager.exitLearning(totalCount,rightCount,day,week,1,data?.data?.id?:"", list.joinToString(",") { it.id }).request(this@ListenActivity){_,_->
                    HttpManager.exitLearning(view_pager.currentItem,season,time,totalCount,rightCount,day,week,1,data?.data?.id?:"", list.joinToString(",") { it.id }).request(this@ListenActivity){_,_->
                        finish()
                    }
                }
app/src/main/java/com/dollearn/student/ui/home/ListenFragment.kt
@@ -10,10 +10,12 @@
import androidx.core.os.bundleOf
import cn.sinata.xldutils.fragment.BaseFragment
import cn.sinata.xldutils.gone
import cn.sinata.xldutils.utils.SPUtils
import cn.sinata.xldutils.utils.myToast
import cn.sinata.xldutils.visible
import com.dollearn.student.R
import com.dollearn.student.utils.AudioUtils
import com.dollearn.student.utils.Const
import com.dollearn.student.utils.extention.clickDelay
import kotlinx.android.synthetic.main.fragment_listen.*
import org.jetbrains.anko.imageResource
@@ -26,6 +28,16 @@
    private var handler:Handler? = null
    private val PLAY_VOICE = 1
    private val TO_NEXT = 2
    private val PLAY_ERROR = 3
    private val PLAY_RIGHT = 4
    private val errorVoice by lazy { SPUtils.instance().getString(Const.EV) }
    private val rightVoice by lazy { SPUtils.instance().getString(Const.RV) }
    private var rightPlaying = false
    private var errorPlaying = false
    private var playing = false //播放中,不能有任何操作
    private var correctVoice = "" //本题音频
    private val player by lazy { AudioUtils() }
@@ -34,7 +46,7 @@
    private val data by lazy {
        (requireActivity() as ListenActivity).data
    }
    private var hasListen = true //要听一次才能作答 true:已经听完题目
    private var hasListen = false //要听一次才能作答 true:已经听完题目
    private var hasRight = false //正确以后不再做出选择 true:已经选出正确答案
    private val randomList by lazy { data?.subjectList!![group].shuffled() }//随机排序后的题目
@@ -49,6 +61,10 @@
                super.handleMessage(msg)
                when(msg.what){
                    PLAY_VOICE->{
                        playing = true
                        if (activity == null){
                            return
                        }
                        val listenActivity = activity as ListenActivity
                        val indexOf = listenActivity.fragments.indexOf(this@ListenFragment) //当前题目序号
                        if (iv_playing.visibility != View.VISIBLE&&indexOf == listenActivity.viewPager.currentItem){ //没有播放并且是当前题号
@@ -57,8 +73,20 @@
                        }
                    }
                    TO_NEXT->{
                        if (isAdded)
                        if (isAdded&&!playing){
                            (requireActivity() as ListenActivity).next()
                            removeMessages(TO_NEXT)
                        }
                    }
                    PLAY_RIGHT->{
                        playing = true
                        rightPlaying = true
                        player.startPlayMusic(requireContext(),rightVoice)
                    }
                    PLAY_ERROR->{
                        playing = true
                        errorPlaying = true
                        player.startPlayMusic(requireContext(),errorVoice)
                    }
                }
            }
@@ -85,7 +113,8 @@
    private fun initClick() {
        cl_voice.clickDelay {
            handler?.sendEmptyMessage(PLAY_VOICE)
            if (!playing)
                handler?.sendEmptyMessage(PLAY_VOICE)
        }
        setResultAnimation(cl_1,0)
        setResultAnimation(cl_2,1)
@@ -132,11 +161,15 @@
                myToast("请先听题")
                return@clickDelay
            }
            if (playing)
                    return@clickDelay
            (activity as ListenActivity).totalCount ++
            if (!hasRight){
                v.progress = 0f
                v.transitionToEnd()
                if (randomList[index].correct != correctVoice){ //答案不对,结束后消失
                    hasListen = false
                    handler?.sendEmptyMessage(PLAY_ERROR)
                    v.setTransitionListener(object :MotionLayout.TransitionListener{
                        override fun onTransitionStarted(p0: MotionLayout?, p1: Int, p2: Int) {
                        }
@@ -152,10 +185,9 @@
                        }
                    })
                }else{
                    hasRight = true
                    (activity as ListenActivity).rightCount ++
                    motion.transitionToEnd()
                    handler?.sendEmptyMessage(PLAY_VOICE)
                    handler?.sendEmptyMessage(PLAY_RIGHT)
                }
            }
        }
@@ -163,19 +195,34 @@
    }
    override fun onStartPlay() {
        iv1.gone()
        iv2.gone()
        iv_playing.visible()
        if (!errorPlaying&&!rightPlaying){
            iv1.gone()
            iv2.gone()
            iv_playing.visible()
        }
    }
    override fun onFinishPlay() {
        playing = false
        iv1.visible()
        iv2.visible()
        iv_playing.gone()
        hasListen = true
        if (hasRight){ //选对答案后的播放结束3秒后进入下一图
        if (hasRight&&!playing){ //选对答案后的播放结束3秒后进入下一图
            Log.e(TAG,"选对答案后的播放结束3秒后进入下一图")
            handler?.sendEmptyMessageDelayed(TO_NEXT,3000)
        }
        if (rightPlaying){
            rightPlaying = false
            hasRight = true
            handler?.sendEmptyMessage(PLAY_VOICE)
        }else if (errorPlaying)
            errorPlaying = false
        else if (!hasRight)
            hasListen = true
    }
    override fun onPause() {
        super.onPause()
        player.stopPlayMusic()
    }
}
app/src/main/java/com/dollearn/student/ui/home/ListenStoryActivity.kt
@@ -10,6 +10,7 @@
import androidx.fragment.app.FragmentPagerAdapter
import androidx.viewpager.widget.ViewPager
import cn.sinata.xldutils.gone
import cn.sinata.xldutils.visible
import com.dollearn.student.R
import com.dollearn.student.dialog.TipDialog
import com.dollearn.student.network.HttpManager
@@ -41,30 +42,35 @@
    override fun initClick() {
        tv_last.setOnClickListener {
            (fragments[view_pager.currentItem] as RememberFragment).stopVoice()
            if ((fragments[view_pager.currentItem] as RememberFragment).playing||!(fragments[view_pager.currentItem] as RememberFragment).listened)
                return@setOnClickListener
            (fragments[view_pager.currentItem-1] as RememberFragment).recover()
            view_pager.setCurrentItem(view_pager.currentItem-1,true)
            if (view_pager.currentItem == 0)
                tv_last.gone()
            tv_exit.text = "退出"
            tv_next.visible()
        }
        tv_next.setOnClickListener {
            (fragments[view_pager.currentItem] as RememberFragment).stopVoice()
            if ((fragments[view_pager.currentItem] as RememberFragment).playing||!(fragments[view_pager.currentItem] as RememberFragment).listened)
                return@setOnClickListener
            (fragments[view_pager.currentItem+1] as RememberFragment).recover()
            view_pager.setCurrentItem(view_pager.currentItem+1,true)
            if (view_pager.currentItem == fragments.lastIndex){
                tv_next.gone()
                tv_exit.text = "完成"
            }
            tv_last.visible()
        }
        tv_exit.setOnClickListener {
            if (tv_exit.text == "退出")
                onBackPressed()
            else{
                (fragments[view_pager.currentItem] as RememberFragment).stopVoice()
                if ((fragments[view_pager.currentItem] as RememberFragment).playing||!(fragments[view_pager.currentItem] as RememberFragment).listened)
                   return@setOnClickListener
                handler?.removeMessages(0)
                startActivity<RememberFinishActivity>("score" to data!!.data.integral)
                startActivity<RememberFinishActivity>("score" to data!!.data.integral,"time" to time,"id" to data!!.data.id)
                finish()
            }
        }
@@ -73,6 +79,10 @@
    override fun initView() {
        data?.apply {
            tv_progress.text = "已完成:1/${storyList.size}"
            if (storyList.size == 1){
                tv_next.gone()
                tv_exit.text = "完成"
            }
            storyList.forEachIndexed { index, subject ->
                fragments.add(RememberFragment.getInstance(index))
            }
@@ -120,20 +130,14 @@
        handler?.sendEmptyMessageDelayed(0,1000L)
    }
    private fun recover(){
        HttpManager.teamSchedule(day,week,3).request(this){_,data->
            view_pager.setCurrentItem(data?.topicIds?.size?:0,false)
            totalCount = data?.answerNumber?:0
            rightCount = data?.correctNumber?:0
        }
    }
    override fun onBackPressed() {
        val tipDialog = TipDialog()
        tipDialog.arguments = bundleOf("msg" to "未完成全部答题,确认退出吗?")
        tipDialog.setCallback(object :TipDialog.OnClickCallback{
            override fun onOk() {
                finish()
                HttpManager.exitGameOrStory(time).request(this@ListenStoryActivity){_,_->
                    finish()
                }
            }
            override fun onCancel() {
app/src/main/java/com/dollearn/student/ui/home/LookImgActivity.kt
@@ -115,20 +115,14 @@
        handler?.sendEmptyMessageDelayed(0,1000L)
    }
    private fun recover(){
        HttpManager.teamSchedule(day,week,3).request(this){_,data->
            view_pager.setCurrentItem(data?.topicIds?.size?:0,false)
            totalCount = data?.answerNumber?:0
            rightCount = data?.correctNumber?:0
        }
    }
    override fun onBackPressed() {
        val tipDialog = TipDialog()
        tipDialog.arguments = bundleOf("msg" to "未完成全部答题,确认退出吗?")
        tipDialog.setCallback(object :TipDialog.OnClickCallback{
            override fun onOk() {
                finish()
                HttpManager.exitGameOrStory(time).request(this@LookImgActivity){_,_->
                    finish()
                }
            }
            override fun onCancel() {
app/src/main/java/com/dollearn/student/ui/home/LookImgFragment.kt
@@ -4,12 +4,16 @@
import android.os.Looper
import android.os.Message
import android.util.Log
import android.view.View
import androidx.core.os.bundleOf
import cn.sinata.xldutils.fragment.BaseFragment
import cn.sinata.xldutils.gone
import cn.sinata.xldutils.utils.SPUtils
import cn.sinata.xldutils.utils.myToast
import cn.sinata.xldutils.visible
import com.dollearn.student.R
import com.dollearn.student.utils.AudioUtils
import com.dollearn.student.utils.Const
import com.dollearn.student.utils.extention.clickDelay
import kotlinx.android.synthetic.main.fragmetn_look_img.*
@@ -29,10 +33,22 @@
    private val PLAY_VOICE = 1
    private val TO_NEXT = 10
    private val PLAY_ERROR = 3
    private val PLAY_RIGHT = 4
    private val errorVoice by lazy { SPUtils.instance().getString(Const.EV) }
    private val rightVoice by lazy { SPUtils.instance().getString(Const.RV) }
    private var rightPlaying = false
    private var errorPlaying = false
    private val player by lazy { AudioUtils() }
    private var voiceIndex = -1 //点击播放的声音序号 0-2取值
    private var playing = false //播放中,不能有任何操作
    private var nowVoiceView: View? = null
    override fun onFirstVisibleToUser() {
        player.setOnAudioStatusUpdateListener(this)
@@ -42,12 +58,24 @@
                super.handleMessage(msg)
                when(msg.what){
                    PLAY_VOICE->{
                        playing = true
                        if (voiceIndex<voiceList.size)
                            player.startPlayMusic(requireContext(),voiceList[voiceIndex])
                    }
                    TO_NEXT->{
                        if (isAdded&&!playing)
                            (requireActivity() as LookImgActivity).next()
                    }
                    PLAY_RIGHT->{
                        rightPlaying = true
                        player.startPlayMusic(requireContext(),rightVoice)
                    }
                    PLAY_ERROR->{
                        rl_check_1.gone()
                        rl_check_2.gone()
                        rl_check_3.gone()
                        errorPlaying = true
                        player.startPlayMusic(requireContext(),errorVoice)
                    }
                }
            }
@@ -87,57 +115,74 @@
        rl_check_1.clickDelay {
            if (playing)
                return@clickDelay
            dot_1.visible()
            act.totalCount++
            if (voiceList[0] == data!!.storyList[index].correct){
                act.rightCount++
                data!!.storyList[index].completed = true
                motion.transitionToEnd()
                cl_voice1.callOnClick()
            if (rl_check_1.visibility == View.VISIBLE&&rl_check_2.visibility == View.VISIBLE&&rl_check_3.visibility == View.VISIBLE){
                dot_1.visible()
                act.totalCount++
                if (voiceList[0] == data!!.storyList[index].correct){
                    act.rightCount++
                    motion.transitionToEnd()
                    nowVoiceView = cl_voice1
                    handler?.sendEmptyMessage(PLAY_RIGHT)
                }else{
                    handler?.sendEmptyMessage(PLAY_ERROR)
                    iv_error_1.visible()
                    dot_1.postDelayed({
                        iv_error_1.gone()
                        dot_1.gone()
                    },2000)
                }
            }else{
                iv_error_1.visible()
                dot_1.postDelayed({
                    iv_error_1.gone()
                    dot_1.gone()
                },2000)
                myToast("请听完")
            }
        }
        rl_check_2.clickDelay {
            if (playing)
                return@clickDelay
            dot_2.visible()
            act.totalCount++
            if (voiceList[1] == data!!.storyList[index].correct){
                act.rightCount++
                data!!.storyList[index].completed = true
                motion.transitionToEnd()
                cl_voice2.callOnClick()
            }else{
                iv_error_2.visible()
                dot_1.postDelayed({
                    dot_2.gone()
                    iv_error_2.gone()
                },2000)
            }
            if (rl_check_1.visibility == View.VISIBLE&&rl_check_2.visibility == View.VISIBLE&&rl_check_3.visibility == View.VISIBLE) {
                dot_2.visible()
                act.totalCount++
                if (voiceList[1] == data!!.storyList[index].correct){
                    act.rightCount++
                    motion.transitionToEnd()
                    nowVoiceView = cl_voice2
                    handler?.sendEmptyMessage(PLAY_RIGHT)
                }else{
                    handler?.sendEmptyMessage(PLAY_ERROR)
                    iv_error_2.visible()
                    dot_1.postDelayed({
                        dot_2.gone()
                        iv_error_2.gone()
                    },2000)
                }
            }else
                myToast("请听完")
        }
        rl_check_3.clickDelay {
            if (playing)
                return@clickDelay
            dot_3.visible()
            act.totalCount++
            if (voiceList[2] == data!!.storyList[index].correct){
                data!!.storyList[index].completed = true
                act.rightCount++
                motion.transitionToEnd()
                cl_voice3.callOnClick()
            }else{
                iv_error_3.visible()
                dot_1.postDelayed({
                    iv_error_3.gone()
                    dot_3.gone()
                },2000)
            }
            if (rl_check_1.visibility == View.VISIBLE&&rl_check_2.visibility == View.VISIBLE&&rl_check_3.visibility == View.VISIBLE) {
                dot_3.visible()
                act.totalCount++
                if (voiceList[2] == data!!.storyList[index].correct){
                    act.rightCount++
                    motion.transitionToEnd()
                    nowVoiceView = cl_voice3
                    handler?.sendEmptyMessage(PLAY_RIGHT)
                }else{
                    handler?.sendEmptyMessage(PLAY_ERROR)
                    iv_error_3.visible()
                    dot_1.postDelayed({
                        iv_error_3.gone()
                        dot_3.gone()
                    },2000)
                }
            }else
                myToast("请听完")
        }
    }
@@ -194,6 +239,8 @@
    override fun onStartPlay() {
        playing = true
        if (rightPlaying||errorPlaying)
            return
        if (voiceIndex == 0){
            iv1_1.gone()
            iv2_1.gone()
@@ -213,23 +260,31 @@
    override fun onFinishPlay() {
        playing = false
        if (voiceIndex == 0){
        if (voiceIndex == 0&&!errorPlaying){
            rl_check_1.visible()
            iv1_1.visible()
            iv2_1.visible()
            iv_playing_1.gone()
        }
        if (voiceIndex == 1){
        if (voiceIndex == 1&&!errorPlaying){
            rl_check_2.visible()
            iv1_2.visible()
            iv2_2.visible()
            iv_playing_2.gone()
        }
        if (voiceIndex == 2){
        if (voiceIndex == 2&&!errorPlaying){
            rl_check_3.visible()
            iv1_3.visible()
            iv2_3.visible()
            iv_playing_3.gone()
        }
        if (errorPlaying){
            errorPlaying = false
        }
        if (rightPlaying){
            rightPlaying = false
            nowVoiceView?.callOnClick()
            data!!.storyList[index].completed = true
        }
        if (data!!.storyList[index].completed){ //本题已答对
            Log.e(TAG,"选对答案后的播放结束3秒后进入下一图")
@@ -237,4 +292,8 @@
        }
    }
    override fun onPause() {
        super.onPause()
        player.stopPlayMusic()
    }
}
app/src/main/java/com/dollearn/student/ui/home/MatchActivity.kt
@@ -55,7 +55,7 @@
    fun next(){
        if (view_pager.currentItem == fragments.lastIndex){
            handler?.removeMessages(0)
            ResultActivity.startResult(this,day,week,season,3,totalCount,rightCount,data!!.data.integral,time,data!!.data.id)
            ResultActivity.startResult(this,day,week,season,5,totalCount,rightCount,data!!.data.integral,time,data!!.data.id)
            finish()
        }else{
            (fragments[view_pager.currentItem+1] as MatchFragment).recover()
@@ -115,8 +115,10 @@
    }
    private fun recover(){
        HttpManager.teamSchedule(day,week,3).request(this){_,data->
            view_pager.setCurrentItem(data?.topicIds?.size?:0,false)
        HttpManager.teamSchedule(day,week,5).request(this){_,data->
            view_pager.setCurrentItem((data?.schedule?:1)-1,false)
            if (view_pager.currentItem != 0)
                tv_last.visible()
            totalCount = data?.answerNumber?:0
            rightCount = data?.correctNumber?:0
        }
@@ -131,7 +133,7 @@
                    finish()
                else{
                    val list = (data?.subjectList?: arrayListOf()).flatMap { it }.subList(0,view_pager.currentItem)
                    HttpManager.exitLearning(totalCount,rightCount,day,week,3,data?.data?.id?:"", list.joinToString(",") { it.id }).request(this@MatchActivity){ _, _->
                    HttpManager.exitLearning(view_pager.currentItem,season,time,totalCount,rightCount,day,week,5,data?.data?.id?:"", list.joinToString(",") { it.id }).request(this@MatchActivity){ _, _->
                        finish()
                    }
                }
app/src/main/java/com/dollearn/student/ui/home/MatchDetailActivity.kt
@@ -1,20 +1,13 @@
package com.dollearn.student.ui.home
import android.content.Intent
import android.graphics.Bitmap
import android.graphics.Paint
import androidx.constraintlayout.widget.ConstraintLayout
import androidx.core.os.bundleOf
import cn.sinata.xldutils.gone
import cn.sinata.xldutils.utils.*
import cn.sinata.xldutils.visible
import com.bumptech.glide.Glide
import com.bumptech.glide.request.target.SimpleTarget
import com.bumptech.glide.request.transition.Transition
import com.dollearn.student.R
import com.dollearn.student.WeparkApplication
import com.dollearn.student.DollearnApplication
import com.dollearn.student.dialog.CheckShopsDialog
import com.dollearn.student.dialog.ChooseCouponDialog
import com.dollearn.student.network.HttpManager
import com.dollearn.student.network.entity.Banner
import com.dollearn.student.network.entity.Match
@@ -25,8 +18,6 @@
import com.dollearn.student.utils.extention.loadLongImage
import kotlinx.android.synthetic.main.activity_match_deatil.*
import org.jetbrains.anko.backgroundColorResource
import org.jetbrains.anko.startActivity
import org.jetbrains.anko.toast
class MatchDetailActivity : TransparentStatusBarActivity() {
    override fun setContentView() = R.layout.activity_match_deatil
@@ -62,7 +53,7 @@
     * 获取运动营详情,暂时列表数据够用,不需实现
     */
    private fun getDetail() {
        HttpManager.queryCompetitionInfo(id, WeparkApplication.lat, WeparkApplication.lon)
        HttpManager.queryCompetitionInfo(id, DollearnApplication.lat, DollearnApplication.lon)
            .request(this) { _, data ->
                match = data
                data?.apply {
app/src/main/java/com/dollearn/student/ui/home/MatchFragment.kt
@@ -4,19 +4,22 @@
import android.os.Looper
import android.os.Message
import android.util.Log
import android.view.View
import androidx.constraintlayout.motion.widget.MotionLayout
import androidx.core.os.bundleOf
import cn.sinata.xldutils.fragment.BaseFragment
import cn.sinata.xldutils.gone
import cn.sinata.xldutils.utils.SPUtils
import cn.sinata.xldutils.utils.myToast
import cn.sinata.xldutils.visible
import com.dollearn.student.R
import com.dollearn.student.utils.AudioUtils
import com.dollearn.student.utils.Const
import com.dollearn.student.utils.extention.clickDelay
import kotlinx.android.synthetic.main.fragment_match.*
import org.jetbrains.anko.imageResource
//todo 2.选择正确后不能再选择 3.选择正确后处理语音条位置
class MatchFragment : BaseFragment(), AudioUtils.OnAudioStatusUpdateListener {
    override fun contentViewId() = R.layout.fragment_match
@@ -25,6 +28,15 @@
    private var handler:Handler? = null
    private val PLAY_VOICE = 1
    private val TO_NEXT = 2
    private val PLAY_ERROR = 3
    private val PLAY_RIGHT = 4
    private val errorVoice by lazy { SPUtils.instance().getString(Const.EV) }
    private val rightVoice by lazy { SPUtils.instance().getString(Const.RV) }
    private var rightPlaying = false
    private var errorPlaying = false
    private val player by lazy { AudioUtils() }
    private val group by lazy { arguments?.getInt("group")?:0 }
@@ -38,6 +50,11 @@
    private var playing = false
    private val voiceList = arrayListOf<String>() //语音列表,随机排序
    private var voiceIndex = -1 //点击播放的声音序号 0-3取值
    private var nowVoiceView: View? = null
    private var imgPosition = -1
    private val completedVoice = arrayListOf<String>() //已经选了的音频 飞到图片上了
    override fun onFirstVisibleToUser() {
        player.setOnAudioStatusUpdateListener(this)
@@ -53,6 +70,15 @@
                        if (isAdded&&!playing){
                            (requireActivity() as MatchActivity).next()
                        }
                    }
                    PLAY_RIGHT->{
                        rightPlaying = true
                        player.startPlayMusic(requireContext(),rightVoice)
                    }
                    PLAY_ERROR->{
                        voiceIndex = -1
                        errorPlaying = true
                        player.startPlayMusic(requireContext(),errorVoice)
                    }
                }
            }
@@ -86,14 +112,17 @@
        cl_1.clickDelay {
            val voiceIndex = voiceIndex
            if (playing||voiceIndex == -1) //未播放或者正在播放,不可点击
            if (playing) //未播放或者正在播放,不可点击
                return@clickDelay
            if (data!!.subjectList[group][0].completed) //已作答不可点击
            if (voiceIndex == -1){//未播放不可点击
                myToast("请先听题")
                return@clickDelay
            }
//            if (data!!.subjectList[group][0].completed) //已作答不可点击
//                return@clickDelay
            act.totalCount ++
            if (data!!.subjectList[group][0].correct == voiceList[voiceIndex]){
                result_1.imageResource = R.mipmap.successs
                data!!.subjectList[group][0].completed = true
                act.rightCount ++
                //执行飞行动画
                var start = 0
@@ -116,7 +145,8 @@
                        end = R.id.end_4_1
                    }
                }
                voiceViews[voiceIndex].callOnClick()
                nowVoiceView =  voiceViews[voiceIndex]
                imgPosition = 0
                motion.setTransitionListener(object :MotionLayout.TransitionListener{
                    override fun onTransitionStarted(p0: MotionLayout?, p1: Int, p2: Int) {
@@ -150,8 +180,10 @@
                })
                motion.setTransition(start,end)
                motion.transitionToEnd()
                handler?.sendEmptyMessage(PLAY_RIGHT)
            }else{
                result_1.imageResource = R.mipmap.zhifushibai
                handler?.sendEmptyMessage(PLAY_ERROR)
            }
            showResultAnim(cl_1)
        }
@@ -159,15 +191,19 @@
        cl_2.clickDelay {
            val voiceIndex = voiceIndex
            if (playing||voiceIndex == -1) //未播放或者正在播放,不可点击
            if (playing) //未播放或者正在播放,不可点击
                return@clickDelay
            if (data!!.subjectList[group][1].completed) //已作答不可点击
            if (voiceIndex == -1){//未播放不可点击
                myToast("请先听题")
                return@clickDelay
            }
//            if (data!!.subjectList[group][1].completed) //已作答不可点击
//                return@clickDelay
            act.totalCount ++
            if (data!!.subjectList[group][1].correct == voiceList[voiceIndex]){
                result_2.imageResource = R.mipmap.successs
                data!!.subjectList[group][1].completed = true
                act.rightCount ++
                imgPosition = 1
                //执行飞行动画
                var start = 0
                var end = 0
@@ -189,7 +225,7 @@
                        end = R.id.end_4_2
                    }
                }
                voiceViews[voiceIndex].callOnClick()
                nowVoiceView =  voiceViews[voiceIndex]
                motion.setTransitionListener(object :MotionLayout.TransitionListener{
                    override fun onTransitionStarted(p0: MotionLayout?, p1: Int, p2: Int) {
@@ -224,8 +260,10 @@
                })
                motion.setTransition(start,end)
                motion.transitionToEnd()
                handler?.sendEmptyMessage(PLAY_RIGHT)
            }else{
                result_2.imageResource = R.mipmap.zhifushibai
                handler?.sendEmptyMessage(PLAY_ERROR)
            }
            showResultAnim(cl_2)
        }
@@ -233,14 +271,18 @@
        cl_3.clickDelay {
            val voiceIndex = voiceIndex
            if (playing||voiceIndex == -1) //未播放或者正在播放,不可点击
            if (playing) //未播放或者正在播放,不可点击
                return@clickDelay
            if (data!!.subjectList[group][2].completed) //已作答不可点击
            if (voiceIndex == -1){//未播放不可点击
                myToast("请先听题")
                return@clickDelay
            }
//            if (data!!.subjectList[group][2].completed) //已作答不可点击
//                return@clickDelay
            act.totalCount ++
            if (data!!.subjectList[group][2].correct == voiceList[voiceIndex]){
                result_3.imageResource = R.mipmap.successs
                data!!.subjectList[group][2].completed = true
                imgPosition = 2
                act.rightCount ++
                //执行飞行动画
                var start = 0
@@ -263,7 +305,7 @@
                        end = R.id.end_4_3
                    }
                }
                voiceViews[voiceIndex].callOnClick()
                nowVoiceView =  voiceViews[voiceIndex]
                motion.setTransitionListener(object :MotionLayout.TransitionListener{
                    override fun onTransitionStarted(p0: MotionLayout?, p1: Int, p2: Int) {
@@ -298,22 +340,28 @@
                })
                motion.setTransition(start,end)
                motion.transitionToEnd()
                handler?.sendEmptyMessage(PLAY_RIGHT)
            }else{
                result_3.imageResource = R.mipmap.zhifushibai
                handler?.sendEmptyMessage(PLAY_ERROR)
            }
            showResultAnim(cl_3)
        }
        cl_4.clickDelay {
            val voiceIndex = voiceIndex
            if (playing||voiceIndex == -1) //未播放或者正在播放,不可点击
            if (playing) //未播放或者正在播放,不可点击
                return@clickDelay
            if (data!!.subjectList[group][3].completed) //已作答不可点击
            if (voiceIndex == -1){//未播放不可点击
                myToast("请先听题")
                return@clickDelay
            }
//            if (data!!.subjectList[group][3].completed) //已作答不可点击
//                return@clickDelay
            act.totalCount ++
            if (data!!.subjectList[group][3].correct == voiceList[voiceIndex]){
                result_4.imageResource = R.mipmap.successs
                data!!.subjectList[group][3].completed = true
                imgPosition = 3
                act.rightCount ++
                //执行飞行动画
                var start = 0
@@ -336,7 +384,7 @@
                        end = R.id.end_4_4
                    }
                }
                voiceViews[voiceIndex].callOnClick()
                nowVoiceView =  voiceViews[voiceIndex]
                motion.setTransitionListener(object :MotionLayout.TransitionListener{
                    override fun onTransitionStarted(p0: MotionLayout?, p1: Int, p2: Int) {
@@ -371,8 +419,10 @@
                })
                motion.setTransition(start,end)
                motion.transitionToEnd()
                handler?.sendEmptyMessage(PLAY_RIGHT)
            }else{
                result_4.imageResource = R.mipmap.zhifushibai
                handler?.sendEmptyMessage(PLAY_ERROR)
            }
            showResultAnim(cl_4)
        }
@@ -409,6 +459,7 @@
            override fun onTransitionCompleted(p0: MotionLayout?, p1: Int) {
                m.progress = 0f
                tv_name.text =""
            }
            override fun onTransitionTrigger(p0: MotionLayout?, p1: Int, p2: Boolean, p3: Float) {
@@ -457,6 +508,8 @@
    override fun onStartPlay() {
        playing = true
        if (errorPlaying||rightPlaying)
            return
        val list = data!!.subjectList[group]
        if (voiceIndex in 0..3)
            tv_name.text = list[list.map { it.correct }.indexOf(voiceList[voiceIndex])].name
@@ -515,45 +568,80 @@
                iv1_1.visible()
                iv2_1.visible()
                iv_playing_1.gone()
                if (nowVoiceView!=null && data!!.subjectList[group][imgPosition].completed){
                    voiceIndex = -1
                    nowVoiceView = null
                }
            }
            1->{
                iv1_2.visible()
                iv2_2.visible()
                iv_playing_2.gone()
                if (nowVoiceView!=null && data!!.subjectList[group][imgPosition].completed){
                    voiceIndex = -1
                    nowVoiceView = null
                }
            }
            2->{
                iv1_3.visible()
                iv2_3.visible()
                iv_playing_3.gone()
                if (nowVoiceView!=null && data!!.subjectList[group][imgPosition].completed){
                    voiceIndex = -1
                    nowVoiceView = null
                }
            }
            3->{
                iv1_4.visible()
                iv2_4.visible()
                iv_playing_4.gone()
                if (nowVoiceView!=null && data!!.subjectList[group][imgPosition].completed){
                    voiceIndex = -1
                    nowVoiceView = null
                }
            }
            4->{
                iv1_1_end.visible()
                iv2_1_end.visible()
                iv_playing_1_end.gone()
                voiceIndex = -1
            }
            5->{
                iv1_2_end.visible()
                iv2_2_end.visible()
                iv_playing_2_end.gone()
                voiceIndex = -1
            }
            6->{
                iv1_3_end.visible()
                iv2_3_end.visible()
                iv_playing_3_end.gone()
                voiceIndex = -1
            }
            7->{
                iv1_4_end.visible()
                iv2_4_end.visible()
                iv_playing_4_end.gone()
                voiceIndex = -1
            }
        }
        if (data!!.subjectList[group].filter { it.completed }.size == 4){ //全部答对
            handler?.sendEmptyMessage(TO_NEXT)
        }
        if (errorPlaying)
            errorPlaying = false
        if (rightPlaying){
            rightPlaying = false
            nowVoiceView?.callOnClick()
            data!!.subjectList[group][imgPosition].completed = true
        }
    }
    override fun onPause() {
        super.onPause()
        player.stopPlayMusic()
    }
}
app/src/main/java/com/dollearn/student/ui/home/MemoryActivity.kt
@@ -3,16 +3,21 @@
import android.os.Handler
import androidx.core.os.bundleOf
import androidx.recyclerview.widget.GridLayoutManager
import cn.sinata.xldutils.utils.SPUtils
import cn.sinata.xldutils.utils.showAllowingStateLoss
import com.dollearn.student.R
import com.dollearn.student.dialog.TipDialog
import com.dollearn.student.network.HttpManager
import com.dollearn.student.network.entity.Card
import com.dollearn.student.network.entity.MemoryBean
import com.dollearn.student.network.request
import com.dollearn.student.ui.TransparentStatusBarActivity
import com.dollearn.student.ui.home.adapter.CardAdapter
import com.dollearn.student.utils.AudioUtils
import com.dollearn.student.utils.Const
import kotlinx.android.synthetic.main.activity_memory.*
class MemoryActivity : TransparentStatusBarActivity() {
class MemoryActivity : TransparentStatusBarActivity(), AudioUtils.OnAudioStatusUpdateListener {
    override fun setContentView() = R.layout.activity_memory
    private val data by lazy {
@@ -33,23 +38,37 @@
    private val PLAY_VOICE = 1
    private val STUDY_TIME = 2
    private val player by lazy { com.dollearn.student.utils.AudioUtils() }
    val PLAY_RIGHT = 4
    val PLAY_ERROR = 5
    private val errorVoice by lazy { SPUtils.instance().getString(Const.EV) }
    private val rightVoice by lazy { SPUtils.instance().getString(Const.RV) }
    private var rightPlaying = false
    private var errorPlaying = false
    private val player by lazy { AudioUtils() }
    private var index = 0
    var playing = false
    override fun initClick() {
        tv_exit.setOnClickListener {
            if (tv_exit.text == "提交"){
                //todo 分数问题
                ResultActivity.startResult(this,0,0,0,7,totalCount,rightCount,100,time,data!!.data.id)
                val right = list.filter { !it.isBack }.size / 2
                val total = data.photoList.size
                val score = right*data.data.answerIntegral/total
                ResultActivity.startResult(this,0,0,0,7, total, right,score,time,data!!.data.id)
                finish()
            }else
                finish()
                onBackPressed()
        }
    }
    override fun initView() {
        player.setOnAudioStatusUpdateListener(this)
        player.stopPlayMusic()
        handler = object : Handler(android.os.Looper.getMainLooper()){
            override fun handleMessage(msg: android.os.Message) {
                super.handleMessage(msg)
@@ -63,8 +82,12 @@
                            tipDialog.arguments = bundleOf("msg" to "答题时间已结束,停止作答!","isAlert" to true,"ok" to "查看成绩")
                            tipDialog.setDismissCallback(object :TipDialog.OnDismiss{
                                override fun onDismiss() {
                                    ResultActivity.startResult(this@MemoryActivity,0,0,0,7,totalCount,rightCount
                                        ,100,time,data!!.data.id)
                                    val right = list.filter { !it.isBack }.size / 2
                                    val total = data.photoList.size
                                    val score = right*data.data.answerIntegral/total
                                    ResultActivity.startResult(this@MemoryActivity,0,0,0,7,total,right
                                        ,score,time,data.data.id)
                                    finish()
                                }
                            })
                            tipDialog.showAllowingStateLoss(supportFragmentManager,"finish")
@@ -74,12 +97,21 @@
                    PLAY_VOICE->{
                        player.startPlayMusic(this@MemoryActivity,list[index].url)
                    }
                    PLAY_RIGHT->{
                        rightPlaying = true
                        player.startPlayMusic(this@MemoryActivity,rightVoice)
                    }
                    PLAY_ERROR->{
                        errorPlaying = true
                        player.startPlayMusic(this@MemoryActivity,errorVoice)
                    }
                }
            }
        }
        lastTime = data.data.answerTime //倒计时时间
        tv_timer.text = "${lastTime}S"
        handler?.sendEmptyMessageDelayed(STUDY_TIME,1000)
        rv_list.layoutManager = GridLayoutManager(this,5)
        rv_list.adapter = adapter
        list.addAll(data.photoList.map { Card(it.id,1,it.photo) })
@@ -93,17 +125,21 @@
     */
    fun flyover(position:Int){
        val card = list[position]
        if (card.type == 2){
        if (card.type == 2){ //如果是语音 先播放语音
            index = position
            handler?.sendEmptyMessage(PLAY_VOICE)
        }else{ //不是语音直接比较结果
            checkResult()
        }
    }
    private fun checkResult(){
        if (adapter.position1!=-1&&adapter.position2!=-1){ //已经翻开2张卡片,比较结果是否匹配
            totalCount++
            val card1 = list[adapter.position1]
            val card2 = list[adapter.position2]
            if (card1.type!=card2.type&&card1.id == card2.id){//匹配成功
                adapter.releaseHolder()
                handler?.sendEmptyMessage(PLAY_RIGHT)
                rightCount++
                tv_timer.postDelayed({
                    if (list.filter { !it.isBack }.size == list.size){ //全部答对
@@ -112,13 +148,16 @@
                    }
                },500)
            }else{
                tv_timer.postDelayed({
                    adapter.bothToBack()
                },500)
                handler?.sendEmptyMessage(PLAY_ERROR)
            }
        }
    }
    override fun onBackPressed() {
        HttpManager.exitGameOrStory(time).request(this){ _, _->
            super.onBackPressed()
        }
    }
    override fun onDestroy() {
        super.onDestroy()
@@ -126,4 +165,41 @@
        handler?.removeMessages(STUDY_TIME)
        handler = null
    }
    override fun onPause() {
        super.onPause()
        player.stopPlayMusic()
    }
    override fun onUpdate(db: Double, time: Long) {
    }
    override fun onStop(filePath: String?) {
    }
    override fun onStartPlay() {
        playing = true
    }
    override fun onFinishPlay() {
        playing = false
        if (errorPlaying){
            errorPlaying = false
            tv_timer.postDelayed({
                adapter.bothToBack()
            },500)
        }else if (rightPlaying){
            rightPlaying = false
            val card1 = list[adapter.position1]
            if (card1.type == 2)
                index = adapter.position1
            else
                index = adapter.position2
            adapter.releaseHolder()
            handler?.sendEmptyMessage(PLAY_VOICE)
        }else{
            checkResult()
        }
    }
}
app/src/main/java/com/dollearn/student/ui/home/PayResultActivity.kt
@@ -4,6 +4,7 @@
import com.dollearn.student.MainActivity
import com.dollearn.student.R
import com.dollearn.student.ui.TransparentStatusBarActivity
import com.dollearn.student.ui.welfare.ExchangeRecordActivity
import kotlinx.android.synthetic.main.activity_pay_rlt.*
import org.jetbrains.anko.startActivity
@@ -21,7 +22,7 @@
            startActivity<MainActivity>()
        }
        tv_action.setOnClickListener {
            startActivity<ExchangeRecordActivity>()
        }
    }
app/src/main/java/com/dollearn/student/ui/home/PlaceDetailActivity.kt
@@ -1,47 +1,8 @@
package com.dollearn.student.ui.home
import android.annotation.SuppressLint
import android.content.Intent
import android.util.Log
import android.view.View
import android.webkit.WebChromeClient
import android.webkit.WebSettings
import android.webkit.WebViewClient
import androidx.core.os.bundleOf
import androidx.recyclerview.widget.GridLayoutManager
import cn.sinata.xldutils.callPhone
import cn.sinata.xldutils.gone
import cn.sinata.xldutils.utils.*
import cn.sinata.xldutils.visible
import com.dollearn.student.R
import com.dollearn.student.dialog.CalendarDialog
import com.dollearn.student.dialog.ChooseCouponDialog
import com.dollearn.student.dialog.ConfirmShopDialog
import com.dollearn.student.dialog.PayDialog
import com.dollearn.student.network.HttpManager
import com.dollearn.student.network.entity.Banner
import com.dollearn.student.network.entity.Coupon
import com.dollearn.student.network.entity.Place
import com.dollearn.student.network.entity.PlaceTime
import com.dollearn.student.network.request
import com.dollearn.student.ui.TransparentStatusBarActivity
import com.dollearn.student.ui.course.MyReservationActivity
import com.dollearn.student.ui.home.adapter.HomeBannerAdapter
import com.dollearn.student.ui.home.adapter.LessonCountAdapter
import com.dollearn.student.ui.home.adapter.TimeAdapter
import com.dollearn.student.ui.home.adapter.WeekAdapter
import com.dollearn.student.utils.Const
import com.dollearn.student.utils.event.EmptyEvent
import com.dollearn.student.utils.extention.clickDelay
import com.dollearn.student.utils.interfaces.StringCallback
import com.dollearn.student.utils.pay.PayListener
import com.dollearn.student.utils.pay.PayUtil
import com.youth.banner.indicator.CircleIndicator
import org.greenrobot.eventbus.EventBus
import org.jetbrains.anko.startActivity
import org.jetbrains.anko.startActivityForResult
import org.jetbrains.anko.toast
import java.util.*
@SuppressLint("SetTextI18n")
class PlaceDetailActivity : TransparentStatusBarActivity() {
app/src/main/java/com/dollearn/student/ui/home/QAActivity.kt
@@ -116,7 +116,9 @@
    private fun recover(){
        HttpManager.teamSchedule(day,week,4).request(this,false){_,data->
            view_pager.setCurrentItem(data?.topicIds?.size?:0,false)
            view_pager.setCurrentItem((data?.schedule?:1)-1,false)
            if (view_pager.currentItem != 0)
                tv_last.visible()
            totalCount = data?.answerNumber?:0
            rightCount = data?.correctNumber?:0
        }
@@ -131,7 +133,7 @@
                    finish()
                else{
                    val list = (data?.subjectList?: arrayListOf()).flatMap { it }.subList(0,view_pager.currentItem)
                    HttpManager.exitLearning(totalCount,rightCount,day,week,4,data?.data?.id?:"", list.joinToString(",") { it.id }).request(this@QAActivity){ _, _->
                    HttpManager.exitLearning(view_pager.currentItem,season,time,totalCount,rightCount,day,week,4,data?.data?.id?:"", list.joinToString(",") { it.id }).request(this@QAActivity){ _, _->
                        finish()
                    }
                }
app/src/main/java/com/dollearn/student/ui/home/QAFragment.kt
@@ -15,9 +15,12 @@
import cn.sinata.xldutils.fragment.BaseFragment
import cn.sinata.xldutils.gone
import cn.sinata.xldutils.invisible
import cn.sinata.xldutils.utils.SPUtils
import cn.sinata.xldutils.utils.myToast
import cn.sinata.xldutils.visible
import com.dollearn.student.R
import com.dollearn.student.utils.AudioUtils
import com.dollearn.student.utils.Const
import com.dollearn.student.utils.extention.clickDelay
import kotlinx.android.synthetic.main.fragment_q_a.*
import org.jetbrains.anko.support.v4.dip
@@ -30,6 +33,15 @@
    private var handler: Handler? = null
    private val PLAY_VOICE = 1
    private val TO_NEXT = 2
    private val PLAY_ERROR = 3
    private val PLAY_RIGHT = 4
    private val errorVoice by lazy { SPUtils.instance().getString(Const.EV) }
    private val rightVoice by lazy { SPUtils.instance().getString(Const.RV) }
    private var rightPlaying = false
    private var errorPlaying = false
    private val player by lazy { AudioUtils() }
    private val group by lazy { arguments?.getInt("group")?:0 }
@@ -46,6 +58,7 @@
    private val v1Views by lazy { arrayListOf(iv1_1,iv1_2,iv1_3,iv1_4,iv1_answer_1,iv1_answer_2,iv1_answer_3) }
    private val v2Views by lazy { arrayListOf(iv2_1,iv2_2,iv2_3,iv2_4,iv2_answer_1,iv2_answer_2,iv2_answer_3) }
    private val v3Views by lazy { arrayListOf(iv3_1,iv3_2,iv3_3,iv3_4) }
    private val resultViews by lazy { arrayListOf(iv_right_1,iv_right_2,iv_right_3,iv_right_4) }
    private val playingViews by lazy { arrayListOf(iv_playing_1,iv_playing_2,iv_playing_3,iv_playing_4,iv_playing_answer_1,iv_playing_answer_2,iv_playing_answer_3) }
    private var voiceIndex = -1 //点击播放的声音序号 0-3取值
@@ -57,6 +70,7 @@
    private var answerList = arrayListOf<String>() //右侧答案语音
    private var nowVoiceView: View? = null
    override fun onFirstVisibleToUser() {
        player.setOnAudioStatusUpdateListener(this)
@@ -66,6 +80,7 @@
                super.handleMessage(msg)
                when(msg.what){
                    PLAY_VOICE->{
                        playing = true
                        if (voiceIndex in 0..3)
                            player.startPlayMusic(requireContext(),list[voiceIndex].correct)
                        else
@@ -76,6 +91,14 @@
                            (requireActivity() as QAActivity).next()
                        }
                    }
                    PLAY_RIGHT->{
                        rightPlaying = true
                        player.startPlayMusic(requireContext(),rightVoice)
                    }
                    PLAY_ERROR->{
                        errorPlaying = true
                        player.startPlayMusic(requireContext(),errorVoice)
                    }
                }
            }
        }
@@ -83,27 +106,36 @@
        iv_2.setImageURI(list[1].img)
        iv_3.setImageURI(list[2].img)
        iv_4.setImageURI(list[3].img)
        showVoiceUi()
        recover()
        rl_check_1.clickDelay {
            if (playing)
                return@clickDelay
            if (list[questionIndex].completed) //已作答
                return@clickDelay
            if (!rl_check_1.isSelected||!rl_check_2.isSelected||!rl_check_3.isSelected){
                myToast("请先听完")
                return@clickDelay
            }
            act.totalCount++
            if (list[questionIndex].correct == answerList[0]){
                act.rightCount++
                Log.e(TAG,"选择正确")
                transAnimation(cl_answer_1,voiceViews[questionIndex])
                list[questionIndex].completed = true
                cl_answer_1.callOnClick()
                resultViews[questionIndex].visible()
                resultViews[questionIndex].postDelayed({
                    resultViews[questionIndex].gone()
                },3000)
                nowVoiceView = voiceViews[questionIndex]
                handler?.sendEmptyMessage(PLAY_RIGHT)
            }else{
                recoverAnswer()
                handler?.sendEmptyMessage(PLAY_ERROR)
                dot_1.visible()
                iv_error_1.visible()
                dot_1.postDelayed({
                    dot_1.gone()
                    iv_error_1.gone()
                },500)
                },3000)
            }
        }
        rl_check_2.clickDelay {
@@ -111,20 +143,26 @@
                return@clickDelay
            if (list[questionIndex].completed) //已作答
                return@clickDelay
            if (!rl_check_1.isSelected||!rl_check_2.isSelected||!rl_check_3.isSelected){
                myToast("请先听完")
                return@clickDelay
            }
            act.totalCount++
            if (list[questionIndex].correct == answerList[1]){
                act.rightCount++
                Log.e(TAG,"选择正确")
                transAnimation(cl_answer_2,voiceViews[questionIndex])
                list[questionIndex].completed = true
                cl_answer_2.callOnClick()
                nowVoiceView = voiceViews[questionIndex]
                handler?.sendEmptyMessage(PLAY_RIGHT)
            }else{
                recoverAnswer()
                handler?.sendEmptyMessage(PLAY_ERROR)
                dot_2.visible()
                iv_error_2.visible()
                dot_2.postDelayed({
                    dot_2.gone()
                    iv_error_2.gone()
                },500)
                },3000)
            }
        }
        rl_check_3.clickDelay {
@@ -132,42 +170,68 @@
                return@clickDelay
            if (list[questionIndex].completed) //已作答
                return@clickDelay
            if (!rl_check_1.isSelected||!rl_check_2.isSelected||!rl_check_3.isSelected){
                myToast("请先听完")
                return@clickDelay
            }
            act.totalCount++
            if (list[questionIndex].correct == answerList[2]){
                act.rightCount++
                Log.e(TAG,"选择正确")
                transAnimation(cl_answer_3,voiceViews[questionIndex])
                list[questionIndex].completed = true
                cl_answer_3.callOnClick()
                nowVoiceView = voiceViews[questionIndex]
                handler?.sendEmptyMessage(PLAY_RIGHT)
            }else{
                recoverAnswer()
                handler?.sendEmptyMessage(PLAY_ERROR)
                dot_3.visible()
                iv_error_3.visible()
                dot_3.postDelayed({
                    dot_3.gone()
                    iv_error_3.gone()
                },500)
                },3000)
            }
        }
    }
    /**
     * 恢复答案和题目ui
     */
    fun recover(){
        showVoiceUi()
        list.forEach { it.completed = false }
        recoverAnswer()
    }
    /**
     * 只恢复答案ui
     */
    private fun recoverAnswer(){
        rl_check_1.isSelected = false
        rl_check_2.isSelected = false
        rl_check_3.isSelected = false
        if (list.filter { it.completed }.isEmpty()){
            voiceViews[2].isEnabled = false
            voiceViews[3].isEnabled = false
        }else{
            voiceViews[2].isEnabled = true
            voiceViews[3].isEnabled = true
        }
    }
    private fun showVoiceUi(){
        list.forEachIndexed { index, subject ->
            if (subject.isQuestion == 1){
                v3Views[index].setImageResource(R.mipmap.voice_question)
                voiceViews[index].visible()
            }else{
                v3Views[index].setImageResource(R.mipmap.voice_answer)
                voiceViews[index].invisible()
            }
            voiceViews[index].clickDelay {
                voiceIndex = index
                handler?.sendEmptyMessage(PLAY_VOICE)
                if (!playing){
                    voiceIndex = index
                    handler?.sendEmptyMessage(PLAY_VOICE)
                }
            }
        }
    }
@@ -186,6 +250,15 @@
            layoutChanged = true
        }
        questionIndex = position
        if (questionIndex == 0||questionIndex == 2){
            iv2_answer_1.setImageResource(R.mipmap.voice_question)
            iv2_answer_2.setImageResource(R.mipmap.voice_question)
            iv2_answer_3.setImageResource(R.mipmap.voice_question)
        }else{
            iv2_answer_1.setImageResource(R.mipmap.voice_answer)
            iv2_answer_2.setImageResource(R.mipmap.voice_answer)
            iv2_answer_3.setImageResource(R.mipmap.voice_answer)
        }
        rl_check_1.visible()
        rl_check_2.visible()
        rl_check_3.visible()
@@ -273,6 +346,8 @@
    override fun onStartPlay() {
        playing = true
        if (rightPlaying||errorPlaying)
            return
        v1Views[voiceIndex].gone()
        v2Views[voiceIndex].gone()
        playingViews[voiceIndex].visible()
@@ -296,8 +371,33 @@
        v1Views[voiceIndex].visible()
        v2Views[voiceIndex].visible()
        playingViews[voiceIndex].gone()
        if (!errorPlaying&&!rightPlaying&&!list[questionIndex].completed){
            if (voiceIndex == 4){
                rl_check_1.isSelected = true
            }
            if (voiceIndex == 5){
                rl_check_2.isSelected = true
            }
            if (voiceIndex == 6){
                rl_check_3.isSelected = true
            }
        }
        if (list.filter { it.completed }.size == 2){ //全部作答,3秒后下一题
            handler?.sendEmptyMessageDelayed(TO_NEXT,3000)
        }
        if (errorPlaying)
            errorPlaying = false
        if (rightPlaying){
            rightPlaying = false
            nowVoiceView?.callOnClick()
            list[questionIndex].completed = true
            recoverAnswer()
        }
    }
    override fun onPause() {
        super.onPause()
        player.stopPlayMusic()
    }
}
app/src/main/java/com/dollearn/student/ui/home/RememberFinishActivity.kt
@@ -2,14 +2,20 @@
import com.dollearn.student.MainActivity
import com.dollearn.student.R
import com.dollearn.student.network.HttpManager
import com.dollearn.student.network.request
import com.dollearn.student.ui.TransparentStatusBarActivity
import kotlinx.android.synthetic.main.activity_finish_remember.*
import kotlinx.android.synthetic.main.activity_finish_remember.tv_back
import kotlinx.android.synthetic.main.activity_result.*
import org.jetbrains.anko.startActivity
class RememberFinishActivity:TransparentStatusBarActivity() {
    override fun setContentView() = R.layout.activity_finish_remember
    private val score by lazy { intent.getIntExtra("score",0) }
    private val id by lazy { intent.getStringExtra("id") }
    private val time by lazy { intent.getIntExtra("time",0) }
    override fun initClick() {
        tv_back.setOnClickListener {
@@ -19,5 +25,8 @@
    override fun initView() {
        tv_tip.text = "恭喜你,已听完全部故事!获得${score}积分!"
        HttpManager.completeStory(0,2,id?:"",time).request(this){ _, data->
            tv_tip.text = "恭喜你,已听完全部故事!获得${data?:0}积分!"
        }
    }
}
app/src/main/java/com/dollearn/student/ui/home/RememberFragment.kt
@@ -27,6 +27,7 @@
    val player by lazy { AudioUtils() }
    var playing = false //播放中,不能有任何操作
    var listened = false //是否已播放
    override fun onFirstVisibleToUser() {
        player.setOnAudioStatusUpdateListener(this)
@@ -101,6 +102,11 @@
        iv1.visible()
        iv2.visible()
        iv_playing.gone()
        listened = true
    }
    override fun onPause() {
        super.onPause()
        player.stopPlayMusic()
    }
}
app/src/main/java/com/dollearn/student/ui/home/ResultActivity.kt
@@ -2,6 +2,7 @@
import android.content.Context
import cn.sinata.xldutils.gone
import cn.sinata.xldutils.invisible
import cn.sinata.xldutils.visible
import com.dollearn.student.MainActivity
import com.dollearn.student.R
@@ -19,6 +20,7 @@
    override fun setContentView() = R.layout.activity_result
    private val id by lazy { intent.getStringExtra("id") }
    private val time by lazy { intent.getIntExtra("time",0) }
    private val type by lazy { intent.getIntExtra("type",0) }
    private val day by lazy { intent.getIntExtra("day",0) }
    private val week by lazy { intent.getIntExtra("week",0) }
@@ -27,7 +29,6 @@
    private val total by lazy { intent.getIntExtra("total",0) }
    private val right by lazy { intent.getIntExtra("right",0) }
    private val score by lazy { intent.getIntExtra("score",0) }
    private val time by lazy { intent.getIntExtra("time",0) }
    private val difficulty by lazy { intent.getIntExtra("difficulty",0) } //游戏难度
@@ -47,38 +48,50 @@
    }
    override fun initView() {
        tv_score.text = "恭喜你,已完成全部答题!获得${score}积分!"
        tv_count.text = "${total}次"
        tv_right.text = "${right}次"
        tv_fault.text = "${total-right}次"
        val rate = (right * 100) / total
        val rate = if(total == 0) 0 else (right * 100) / total
        tv_rate.text = "正确率:$rate%"
        when(type){
            6->{
                title = "超级听力"
                tv_back.visible()
                tv_last.gone()
                tv_exit.gone()
                tv_last.invisible()
                tv_exit.invisible()
                HttpManager.gameAchievement(rate,difficulty,id?:"","超级听力",time).request(this){_,data->
                    tv_score.text = "恭喜你,已完成全部答题!获得${data?:0}积分!"
                }
            }
            7->{
                title = "超级记忆"
                tv_score.text = "恭喜你,已完成游戏!获得${score}积分!"
                tv_back.visible()
                tv_last.gone()
                tv_exit.gone()
                tv_last.invisible()
                tv_exit.invisible()
                HttpManager.gameAchievement(rate,difficulty,id?:"","超级记忆",time).request(this){_,data->
                    tv_score.text = "恭喜你,已完成全部答题!获得${data?:0}积分!"
                }
            }
            8->{
                tv_back.visible()
                tv_last.gone()
                tv_exit.gone()
                HttpManager.completeStory(rate,type,id?:"").request(this){_,data->
                tv_last.invisible()
                tv_exit.invisible()
                HttpManager.completeStory(rate,1,id?:"",time).request(this){_,data->
                    tv_score.text = "恭喜你,已完成全部答题!获得${data?:0}积分!"
                }
            }
            else->{
                if (type == 5){
                    title = "音图相配"
                    tv_back.visible()
                    tv_last.invisible()
                    tv_exit.invisible()
                }
                HttpManager.completeLearning(rate,time,day,week,season,type,id?:"").request(this){_,data->
                    tv_score.text = "恭喜你,已完成全部答题!获得${data?:0}积分!"
                }
            }
        }
app/src/main/java/com/dollearn/student/ui/home/ScannerActivity.kt
@@ -3,12 +3,10 @@
import android.Manifest
import android.annotation.SuppressLint
import android.app.Activity
import android.content.Context
import android.content.Intent
import android.graphics.Bitmap
import android.util.Log
import androidx.core.content.ContextCompat
import androidx.core.content.ContextCompat.startActivity
import androidx.core.os.bundleOf
import cn.sinata.xldutils.activity.BaseActivity
import cn.sinata.xldutils.utils.SPUtils
@@ -16,11 +14,8 @@
import com.google.gson.Gson
import com.google.zxing.Result
import com.dollearn.student.R
import com.dollearn.student.WeparkApplication
import com.dollearn.student.dialog.TipDialog
import com.dollearn.student.network.HttpManager
import com.dollearn.student.network.entity.ScanResultBean
import com.dollearn.student.network.request
import com.dollearn.student.ui.TransparentStatusBarActivity
import com.dollearn.student.ui.course.CourseDetailActivity
import com.dollearn.student.ui.game.GameActivity
@@ -30,7 +25,6 @@
import com.zxing.scanner.common.Scanner
import kotlinx.android.synthetic.main.scanner_activity.*
import org.jetbrains.anko.startActivity
import org.jetbrains.anko.toast
class ScannerActivity : TransparentStatusBarActivity(), OnScannerCompletionListener {
    companion object {
app/src/main/java/com/dollearn/student/ui/home/ScheduleActivity.kt
@@ -12,6 +12,7 @@
import kotlinx.android.synthetic.main.activity_schedul.*
import org.greenrobot.eventbus.EventBus
import org.greenrobot.eventbus.Subscribe
import org.jetbrains.anko.browse
class ScheduleActivity :TransparentStatusBarActivity(){
    override fun setContentView() = R.layout.activity_schedul
app/src/main/java/com/dollearn/student/ui/home/SuperListenActivity.kt
@@ -7,6 +7,7 @@
import android.view.View
import androidx.recyclerview.widget.GridLayoutManager
import cn.sinata.xldutils.gone
import cn.sinata.xldutils.utils.SPUtils
import cn.sinata.xldutils.utils.myToast
import cn.sinata.xldutils.visible
import com.dollearn.student.R
@@ -19,6 +20,7 @@
import com.dollearn.student.ui.TransparentStatusBarActivity
import com.dollearn.student.ui.home.adapter.GameAdapter
import com.dollearn.student.utils.AudioUtils
import com.dollearn.student.utils.Const
import com.dollearn.student.utils.interfaces.StringCallback
import kotlinx.android.synthetic.main.activity_super_listen.*
import kotlinx.android.synthetic.main.fragmetn_look_img.*
@@ -26,71 +28,58 @@
class SuperListenActivity : TransparentStatusBarActivity(), AudioUtils.OnAudioStatusUpdateListener {
    override fun setContentView() = R.layout.activity_super_listen
    private val week by lazy {
        intent.getIntExtra("week",0)
    }
    private val season by lazy {
        intent.getIntExtra("season",0)
    }
    private var data:GameBean? = null
    private var index = 0
    private var handler:Handler? = null
    var data:GameBean? = null
    var index = 0
    var handler:Handler? = null
    private var difficulty = 0 //难度
    private val TAG = "Listen====>"
    val TAG = "Listen====>"
    private val list = arrayListOf<Subject>()
    val list = arrayListOf<Subject>()
    private val adapter = GameAdapter(list)
    private val PLAY_VOICE = 1
    private val COUNT_DOWN = 2
    val PLAY_VOICE = 1
    val COUNT_DOWN = 2
    private val STUDY_TIME = 3
    val PLAY_RIGHT = 4
    val PLAY_ERROR = 5
    private val errorVoice by lazy { SPUtils.instance().getString(Const.EV) }
    private val rightVoice by lazy { SPUtils.instance().getString(Const.RV) }
    private var rightPlaying = false
    private var errorPlaying = false
    private val player by lazy { AudioUtils() }
    private val voiceList = arrayListOf<String>() //声音按顺序播放
    val voiceList = arrayListOf<String>() //声音按顺序播放
    private var TIME = 10 //每题答题时间
    private var countTime = 10 //倒计时计数
    private var countTime = 0 //倒计时计数
    var totalCount = 0 //总答题次数
    var rightCount = 0 //正确答题次数
    var time = 0 //学习秒数
    var playing = false
    var state = 0 //0:准备听题 1:听题中 2:请作答 3:结束答题
    override fun initClick() {
        adapter.setOnItemClickListener { view, position ->
            Log.e(TAG,"点击图片:${list[position].name}")
            Log.e(TAG,"音频position:${index}")
            Log.e(TAG,"音频路径:${voiceList[index]}")
            val subject = data!!.subjectList[data!!.subjectList.map { it.correct }.indexOf(voiceList[index])] //当前音频对应题目
            Log.e(TAG,"正确答案:${subject.name}")
            totalCount++
            handler?.removeMessages(COUNT_DOWN) //选择答案后,停止倒计时
            if (list[position].id == subject.id){
                rightCount++
                subject.completed = true
                subject.right = true
                handler?.sendEmptyMessage(PLAY_VOICE)
                adapter.notifyItemChanged(position)
            }else{
                subject.completed = true
                subject.right = false
                index++
                startGame()
            }
        }
        tv_exit.setOnClickListener {
            if (tv_exit.text == "提交"){
                ResultActivity.startResult(this,0,0,0,6,totalCount,rightCount,list.filter { it.right }.sumBy { 1 },time,data!!.data.id)
                ResultActivity.startResult(this,0,0,0,6,totalCount,rightCount,list.filter { it.right }.sumBy { 1 },time,data!!.data.id,difficulty)
                finish()
            }else
                finish()
                onBackPressed()
        }
    }
@@ -129,7 +118,10 @@
                            player.startPlayMusic(this@SuperListenActivity,voiceList[index])
                    }
                    COUNT_DOWN->{
                        countTime --
                        if (!playing){
                            countTime --
                            state = 2
                        }
                        tv_tip.text = "请在${countTime}s内选择答案!"
                        if ( countTime == 0){
                            index++
@@ -138,9 +130,18 @@
                            sendEmptyMessageDelayed(COUNT_DOWN,1000)
                        }
                    }
                    PLAY_RIGHT->{
                        rightPlaying = true
                        player.startPlayMusic(this@SuperListenActivity,rightVoice)
                    }
                    PLAY_ERROR->{
                        errorPlaying = true
                        player.startPlayMusic(this@SuperListenActivity,errorVoice)
                    }
                }
            }
        }
        handler?.sendEmptyMessageDelayed(STUDY_TIME,1000)
    }
    private fun refreshUi() {
@@ -153,7 +154,7 @@
        list.shuffle() //图片随机顺序
        rv_list.adapter = adapter
        Log.e(TAG,"图片打乱后顺序:${list.joinToString(",,,") { it.name }}")
        TIME = data!!.data.time.toInt()
        val countdownDialog = CountdownDialog()
        countdownDialog.callback = object :StringCallback{
            override fun onResult(rst: String) {
@@ -164,17 +165,19 @@
        countdownDialog.show(supportFragmentManager,"timer")
    }
    private fun startGame() {
    fun startGame() {
        if (index < voiceList.size){
            Log.e(TAG,"开始答题:index=${index}")
            tv_sort.text = (index+1).toString()
            handler?.removeMessages(COUNT_DOWN)
            countTime = TIME //重置答题时间
            tv_tip.text = "准备听题"
            state = 0
            handler?.sendEmptyMessageDelayed(PLAY_VOICE,3000)
        }else{
            tv_sort.visibility = View.INVISIBLE
            tv_tip.text = ""
            state = 3
            tv_end.text = "已完成全部问题"
            tv_exit.text = "提交"
            handler?.removeMessages(STUDY_TIME)
@@ -188,7 +191,11 @@
    }
    override fun onStartPlay() {
        playing = true
        if (errorPlaying||rightPlaying)
            return
        if (!data!!.subjectList[data!!.subjectList.map { it.correct }.indexOf(voiceList[index])].completed){//首次播放
            state = 1
            tv_tip.text = "请在${countTime}s内选择答案!"
            handler?.sendEmptyMessageDelayed(COUNT_DOWN,1000)
        }
@@ -198,6 +205,7 @@
    }
    override fun onFinishPlay() {
        playing = false
        iv1.visible()
        iv2.visible()
        iv_playing.gone()
@@ -205,6 +213,29 @@
            index++
            startGame()
        }
        if (errorPlaying)
            errorPlaying = false
        if (rightPlaying){
            rightPlaying = false
            val subject = data!!.subjectList[data!!.subjectList.map { it.correct }.indexOf(voiceList[index])] //当前音频对应题目
            subject.completed = true
            handler?.sendEmptyMessage(PLAY_VOICE)
        }
    }
    override fun onBackPressed() {
        HttpManager.exitGameOrStory(time).request(this){_,_->
            super.onBackPressed()
        }
    }
    override fun onDestroy() {
        super.onDestroy()
        handler?.removeCallbacksAndMessages(null)
    }
    override fun onPause() {
        super.onPause()
        player.stopPlayMusic()
    }
}
app/src/main/java/com/dollearn/student/ui/home/WeekSelectActivity.kt
@@ -29,7 +29,6 @@
        weekAdapter.setOnItemClickListener { view, position ->
            startActivity<ScheduleActivity>("week" to weeks[position].week,"season" to seasonAdapter.checked+1)
            finish()
        }
    }
app/src/main/java/com/dollearn/student/ui/home/adapter/CouponAdapter.kt
File was deleted
app/src/main/java/com/dollearn/student/ui/home/adapter/GameAdapter.kt
@@ -1,22 +1,79 @@
package com.dollearn.student.ui.home.adapter
import android.util.Log
import android.view.View
import android.widget.ImageView
import androidx.constraintlayout.motion.widget.MotionLayout
import cn.sinata.xldutils.adapter.HFRecyclerAdapter
import cn.sinata.xldutils.adapter.util.ViewHolder
import com.dollearn.student.R
import com.dollearn.student.network.entity.Subject
import com.dollearn.student.ui.home.SuperListenActivity
import com.dollearn.student.utils.Const
import com.dollearn.student.utils.event.EmptyEvent
import com.dollearn.student.utils.event.IntEvent
import com.dollearn.student.utils.extention.clickDelay
import com.facebook.drawee.view.SimpleDraweeView
import kotlinx.android.synthetic.main.fragment_listen.*
import org.greenrobot.eventbus.EventBus
import java.util.ArrayList
class GameAdapter(list: ArrayList<Subject>):HFRecyclerAdapter<Subject>(list, R.layout.item_game_1) {
    override fun onBind(holder: ViewHolder, position: Int, data: Subject) {
        holder.bind<SimpleDraweeView>(R.id.iv_img).setImageURI(data.img)
        val view = holder.bind<View>(R.id.cl_voice_end_1)
        val motion = holder.bind<MotionLayout>(R.id.motion)
        motion.progress = 0f
        val ivResult = holder.bind<ImageView>(R.id.result_1)
        view.visibility = if (data.right) View.VISIBLE else View.GONE
        view.clickDelay {
//            (context as SuperListenActivity)
        }
        val act = context as SuperListenActivity
        holder.itemView.setOnClickListener {
            if (act.playing||act.index>act.voiceList.size-1)
                return@setOnClickListener
            if (act.state!=2)
                return@setOnClickListener
            Log.e(act.TAG,"点击图片:${act.list[position].name}")
            Log.e(act.TAG,"音频position:${act.index}")
            Log.e(act.TAG,"音频路径:${act.voiceList[act.index]}")
            val subject = act.data!!.subjectList[act.data!!.subjectList.map { it.correct }.indexOf(act.voiceList[act.index])] //当前音频对应题目
            Log.e(act.TAG,"正确答案:${subject.name}")
            act.totalCount++
            act.handler?.removeMessages(act.COUNT_DOWN) //选择答案后,停止倒计时
            if (data.id == subject.id){
                ivResult.setImageResource(R.mipmap.successs)
                act.handler?.sendEmptyMessage(act.PLAY_RIGHT)
                act.rightCount++
                subject.right = true
                notifyItemChanged(position)
            }else{
                act.handler?.sendEmptyMessage(act.PLAY_ERROR) //选择答案后,停止倒计时
                ivResult.setImageResource(R.mipmap.zhifushibai)
                subject.completed = true
                subject.right = false
                act.index++
                act.startGame()
            }
            motion.transitionToEnd()
            motion.setTransitionListener(object :MotionLayout.TransitionListener{
                override fun onTransitionStarted(p0: MotionLayout?, p1: Int, p2: Int) {
                }
                override fun onTransitionChange(p0: MotionLayout?, p1: Int, p2: Int, p3: Float) {
                }
                override fun onTransitionCompleted(p0: MotionLayout?, p1: Int) {
                    motion.progress = 0f
                }
                override fun onTransitionTrigger(p0: MotionLayout?, p1: Int, p2: Boolean, p3: Float) {
                }
            })
        }
    }
}
app/src/main/java/com/dollearn/student/ui/home/adapter/WeekAdapter.kt
@@ -5,13 +5,14 @@
import cn.sinata.xldutils.adapter.util.ViewHolder
import com.dollearn.student.R
import com.dollearn.student.network.entity.Week
import com.dollearn.student.utils.extention.formatToChinese
import org.jetbrains.anko.backgroundResource
import java.util.ArrayList
class WeekAdapter(weekList: ArrayList<Week>) :HFRecyclerAdapter<Week>(weekList, R.layout.item_week){
    var checked = -1
    override fun onBind(holder: ViewHolder, position: Int, data: Week) {
        holder.setText(R.id.tv_week,"第${data.week}周")
        holder.setText(R.id.tv_week,"第${data.week.formatToChinese()}周")
        holder.setText(R.id.tv_name,data.title)
        holder.setText(R.id.tv_score,"完成后可获积分数:${data.totalIntegral}")
        holder.bind<View>(R.id.ll_week).backgroundResource = getWeekBg(position)
app/src/main/java/com/dollearn/student/ui/login/LoginActivity.kt
@@ -54,6 +54,7 @@
        }
        tv_privacy_rule.clickDelay {
            showDialog()
            HttpManager.getH5(LoginRuleDialog.TYPE_PRIVACY).request(this@LoginActivity){ _, data->
                data?.let {
                    startActivityForResult<H5Activity>(1,"title" to "隐私协议","url" to it)
@@ -61,6 +62,7 @@
            }
        }
        tv_user_rule.clickDelay {
            showDialog()
            HttpManager.getH5(LoginRuleDialog.TYPE_USER).request(this@LoginActivity){ _, data->
                data?.let {
                    startActivityForResult<H5Activity>(2,"title" to "用户协议","url" to it)
app/src/main/java/com/dollearn/student/ui/login/RegisterActivity.kt
@@ -4,7 +4,6 @@
import android.app.Activity
import android.content.Intent
import android.os.CountDownTimer
import android.text.Editable
import android.text.method.HideReturnsTransformationMethod
import android.text.method.PasswordTransformationMethod
import androidx.core.os.bundleOf
@@ -13,18 +12,15 @@
import cn.sinata.xldutils.visible
import com.amap.api.location.AMapLocationListener
import com.dollearn.student.R
import com.dollearn.student.WeparkApplication
import com.dollearn.student.DollearnApplication
import com.dollearn.student.dialog.TipDialog
import com.dollearn.student.network.HttpManager
import com.dollearn.student.network.request
import com.dollearn.student.ui.H5Activity
import com.dollearn.student.ui.TransparentStatusBarActivity
import com.dollearn.student.utils.AMapKit
import com.dollearn.student.utils.SimpleTextWatcher
import com.tbruyelle.rxpermissions2.RxPermissions
import kotlinx.android.synthetic.main.activity_register.*
import org.jetbrains.anko.sdk27.coroutines.onClick
import org.jetbrains.anko.startActivity
class RegisterActivity : TransparentStatusBarActivity() {
    override fun setContentView() = R.layout.activity_register
@@ -116,17 +112,17 @@
     * 有权限的情况获取定位
     */
    private fun getLocation(phone:String,pwd:String,code:String,invitePhone:String){
        if (WeparkApplication.lat!=null)
        if (DollearnApplication.lat!=null)
            next(phone, pwd, code, invitePhone)
        else{
            showDialog("正在获取定位...")
            AMapKit.initLocation(this, AMapLocationListener {
                WeparkApplication.lat = it.latitude
                WeparkApplication.lon = it.longitude
                WeparkApplication.province = it.province
                WeparkApplication.provinceCode = "${it.adCode.substring(0, 3)}000"
                WeparkApplication.cityName = it.city
                WeparkApplication.cityCode = "${it.adCode.substring(0, 4)}00"
                DollearnApplication.lat = it.latitude
                DollearnApplication.lon = it.longitude
                DollearnApplication.province = it.province
                DollearnApplication.provinceCode = "${it.adCode.substring(0, 3)}000"
                DollearnApplication.cityName = it.city
                DollearnApplication.cityCode = "${it.adCode.substring(0, 4)}00"
                dismissDialog()
                next(phone, pwd, code, invitePhone)
            })
@@ -136,7 +132,7 @@
    private fun next(phone:String,pwd:String,code:String,invitePhone:String){
        tv_action.isEnabled = false
        if (type == TYPE_BIND){
            HttpManager.bindPhone(phone, code,if (invitePhone.isNullOrEmpty()) null else invitePhone,openid , WeparkApplication.lat,WeparkApplication.lon)
            HttpManager.bindPhone(phone, code,if (invitePhone.isNullOrEmpty()) null else invitePhone,openid , DollearnApplication.lat,DollearnApplication.lon)
                .request(this@RegisterActivity,success = {_,data->
                    val intent = Intent()
                    intent.putExtra("token",data?.optString("token"))
@@ -148,7 +144,7 @@
                }
        }else{
            HttpManager.register(type,phone, pwd.md5(), code,if (invitePhone.isNullOrEmpty()) null else invitePhone,if (type == TYPE_BIND) openid else null,
                WeparkApplication.lat,WeparkApplication.lon)
                DollearnApplication.lat,DollearnApplication.lon)
                .request(this@RegisterActivity,success = {_,_->
                    myToast(if (type == TYPE_REGISTER)"注册成功" else "密码修改成功")
                    finish()
app/src/main/java/com/dollearn/student/ui/mine/AddressManageActivity.kt
@@ -18,11 +18,21 @@
    private val list = arrayListOf<Recipient>()
    private val adapter = AddressManageAdapter(list)
    private val canChoose by lazy { intent.getBooleanExtra("canChoose",false) }
    override fun initClick() {
        tv_add.setOnClickListener {
            startActivityForResult<AddAddressActivity>(1)
        }
        adapter.setOnItemClickListener { view, position ->
            if (canChoose){
                val intent = Intent()
                intent.putExtra("address",list[position])
                setResult(RESULT_OK,intent)
                finish()
            }
        }
    }
    override fun initView() {
app/src/main/java/com/dollearn/student/ui/mine/LearnRecordActivity.kt
@@ -7,6 +7,7 @@
import com.dollearn.student.network.request
import com.dollearn.student.ui.TransparentStatusBarActivity
import com.dollearn.student.ui.mine.adapter.GameRecordAdapter
import com.dollearn.student.utils.extention.formatToChinese
import kotlinx.android.synthetic.main.activity_learn_record.*
class LearnRecordActivity : TransparentStatusBarActivity() {
@@ -31,8 +32,8 @@
            list.clear()
            list.addAll(data?.gameRecordList?: arrayListOf())
            adapter.notifyDataSetChanged()
            tv_current.text = "当前进度:周目${data?.record?.week}"
            tv_last.text = "剩余进度:${data?.record?.week}周目"
            tv_current.text = "当前进度:周目${(data?.record?.week?:0).formatToChinese()}"
            tv_last.text = "剩余进度:${(data?.record?.surplus?:0).formatToChinese()}周目"
            tv_total.text = "${data?.record?.totalStudy}小时"
            tv_today.text = "${data?.record?.todayStudy}小时"
            tv_week.text = "${data?.record?.weekStudy}小时"
app/src/main/java/com/dollearn/student/ui/mine/MineFragment.kt
@@ -1,28 +1,33 @@
package com.dollearn.student.ui.mine
import androidx.core.os.bundleOf
import androidx.recyclerview.widget.LinearLayoutManager
import cn.sinata.xldutils.fragment.BaseFragment
import cn.sinata.xldutils.utils.SPUtils
import cn.sinata.xldutils.utils.showAllowingStateLoss
import com.dollearn.student.MainActivity
import com.dollearn.student.R
import com.dollearn.student.WeparkApplication
import com.dollearn.student.dialog.ShareDialog
import com.dollearn.student.dialog.TipDialog
import com.dollearn.student.network.entity.Commodity
import com.dollearn.student.network.Apis
import com.dollearn.student.network.HttpManager
import com.dollearn.student.network.entity.UserBean
import com.dollearn.student.network.entity.WelfareHomeData
import com.dollearn.student.ui.course.WelfareActivity
import com.dollearn.student.ui.home.JoinVipActivity
import com.dollearn.student.network.requestByF
import com.dollearn.student.ui.login.LoginActivity
import com.dollearn.student.ui.welfare.*
import com.dollearn.student.ui.welfare.adapter.WelfareGoodsAdapter
import com.dollearn.student.utils.Const
import com.dollearn.student.utils.event.EmptyEvent
import com.dollearn.student.utils.extention.clickDelay
import com.dollearn.student.utils.interfaces.StringCallback
import com.share.utils.ShareUtils
import com.umeng.socialize.UMShareListener
import com.umeng.socialize.bean.SHARE_MEDIA
import com.umeng.socialize.media.UMImage
import kotlinx.android.synthetic.main.form_view_layout.*
import kotlinx.android.synthetic.main.fragment_mine.*
import org.greenrobot.eventbus.EventBus
import org.greenrobot.eventbus.Subscribe
import org.jetbrains.anko.support.v4.startActivity
import org.jetbrains.anko.support.v4.toast
class MineFragment : BaseFragment() {
    override fun contentViewId() = R.layout.fragment_mine
@@ -67,6 +72,32 @@
        tv_address.setOnClickListener {
            startActivity<AddressManageActivity>()
        }
        tv_share.setOnClickListener {
            val shareDialog = ShareDialog()
            shareDialog.callback = object :StringCallback{
                override fun onResult(rst: String) {
                    HttpManager.shareInfo().requestByF(this@MineFragment){_,data->
                        ShareUtils.share(requireActivity(),if (rst == "wx") SHARE_MEDIA.WEIXIN else SHARE_MEDIA.WEIXIN_CIRCLE,data?.title?:"孩子自己就学会的英语",if (rst == "wx") "海豚英语智能教育平台" else data?.title?:"孩子自己就学会的英语", Apis.SHARE_URL,
                            UMImage(requireContext(),data?.img?:""),object :UMShareListener{
                                override fun onStart(p0: SHARE_MEDIA?) {
                                }
                                override fun onResult(p0: SHARE_MEDIA?) {
                                    toast("已分享")
                                }
                                override fun onError(p0: SHARE_MEDIA?, p1: Throwable?) {
                                }
                                override fun onCancel(p0: SHARE_MEDIA?) {
                                }
                            },""
                        )
                    }
                }
            }
            shareDialog.showAllowingStateLoss(childFragmentManager,"share")
        }
    }
    @Subscribe
app/src/main/java/com/dollearn/student/ui/shop/ExchangeActivity.kt
@@ -12,6 +12,7 @@
import com.dollearn.student.network.request
import com.dollearn.student.ui.TransparentStatusBarActivity
import com.dollearn.student.ui.home.PayResultActivity
import com.dollearn.student.ui.mine.AddressManageActivity
import com.dollearn.student.ui.mine.ChangeAddressActivity
import com.dollearn.student.utils.Const
import com.dollearn.student.utils.event.EmptyEvent
@@ -48,11 +49,7 @@
        }
        cl_address.setOnClickListener {
            if (recipient?.id.isNullOrEmpty()){
                startActivityForResult<AddAddressActivity>(1)
            }else{
                startActivityForResult<ChangeAddressActivity>(2)
            }
            startActivityForResult<AddressManageActivity>(2,"canChoose" to true)
        }
        tv_action.setOnClickListener {
app/src/main/java/com/dollearn/student/ui/shop/ShopFragment.kt
@@ -1,5 +1,8 @@
package com.dollearn.student.ui.shop
import android.content.Context
import android.view.inputmethod.InputMethodManager
import androidx.core.content.ContextCompat.getSystemService
import androidx.recyclerview.widget.GridLayoutManager
import androidx.recyclerview.widget.LinearLayoutManager
import cn.sinata.xldutils.fragment.BaseFragment
@@ -56,6 +59,8 @@
        }
        tv_search.setOnClickListener {
            (requireActivity().getSystemService(Context.INPUT_METHOD_SERVICE) as InputMethodManager)
                .hideSoftInputFromWindow(requireActivity().currentFocus!!.windowToken, InputMethodManager.HIDE_NOT_ALWAYS)
            if (refreshLayout.isRefreshing)
                return@setOnClickListener
            search = et_search.text.toString()
@@ -78,7 +83,7 @@
    }
    private fun getGoods(){
        HttpManager.goodListStudy(page,search,goodsTypes.filter { it.checked }.map { it.name }).requestByF(this,success = {_,data->
        HttpManager.goodListStudy(page,search,goodsTypes.filter { it.checked }.map { it.id.toString() }).requestByF(this,success = {_,data->
            if (page == 1)
                goods.clear()
            goods.addAll(data ?.records?: arrayListOf())
app/src/main/java/com/dollearn/student/ui/welfare/CouponActivity.kt
File was deleted
app/src/main/java/com/dollearn/student/ui/welfare/CouponFragment.kt
File was deleted
app/src/main/java/com/dollearn/student/ui/welfare/ExchangeRecordActivity.kt
@@ -15,7 +15,7 @@
    private val list = arrayListOf<ExchangeRecord>()
    private val adapter = ExchangeRecordAdapter(list)
    private var page = 1
    override fun initClick() {
@@ -24,14 +24,37 @@
    override fun initView() {
        rv_record.layoutManager = LinearLayoutManager(this)
        rv_record.adapter = adapter
        refreshLayout.setOnRefreshListener {
            page = 1
            getData()
        }
        refreshLayout.setOnLoadMoreListener {
            page++
            getData()
        }
        getData()
    }
    private fun getData() {
        HttpManager.exchangeRecord().request(this){_,data->
            list.clear()
            list.addAll(data?: arrayListOf())
        HttpManager.exchangeRecord(page).request(this,success = {_,data->
            if (page == 1)
                list.clear()
            list.addAll(data?.records?: arrayListOf())
            adapter.notifyDataSetChanged()
            if (list.isEmpty())
                refreshLayout.finishRefreshWithNoMoreData()
            else if (data?.records.isNullOrEmpty())
                refreshLayout.finishLoadMoreWithNoMoreData()
            else if (page == 1)
                refreshLayout.finishRefresh()
            else
                refreshLayout.finishLoadMore()
        }){_,_->
            if (page == 1)
                refreshLayout.finishRefresh(false)
            else
                refreshLayout.finishLoadMore(false)
            page--
        }
    }
app/src/main/java/com/dollearn/student/ui/welfare/GoodsDetailActivity.kt
@@ -39,6 +39,12 @@
    override fun initClick() {
        tv_action.setOnClickListener {
            if (score<goods?.good?.integral?:0){
                val tipDialog = TipDialog()
                tipDialog.arguments = bundleOf("isAlert" to true,"msg" to "兑换失败,当前剩余积分不足!","ok" to "关闭")
                tipDialog.show(supportFragmentManager,"tip")
                return@setOnClickListener
            }
            tv_action.isEnabled = false
            showDialog()
            HttpManager.redeemNow(id).request(this,false, {_,data->
@@ -88,7 +94,7 @@
                tv_value.paintFlags = tv_value.paintFlags or Paint.STRIKE_THRU_TEXT_FLAG
                tv_name.text = good.name
                tv_category.text = goodTypes?.joinToString ("|"){ it.name }
                tv_sold.text = "剩余数量:%d|可换数量:%d|%d人已换".format(good.surplus,good.userCount,good.inventory?:0)
                tv_sold.text = "%s%s%d人已换".format(if (residueNumber == null) "" else "剩余数量:${residueNumber}|",if (good.userCount == null) "" else "可换数量:${good.userCount}|", exchangeNumber)
                val sHead =
                    "<html><head><meta name=\"viewport\" content=\"width=device-width, " + "initial-scale=1.0, minimum-scale=0.5, maximum-scale=2.0, user-scalable=yes\" />" + "<style>img{max-width:100% !important;height:auto !important;}</style>" + "<style>body{max-width:100% !important;}</style>" + "</head><body>"
                webView!!.loadDataWithBaseURL(null, sHead + good.detail, "text/html", "utf-8", null)
app/src/main/java/com/dollearn/student/ui/welfare/ScoreShopActivity.kt
File was deleted
app/src/main/java/com/dollearn/student/ui/welfare/adapter/CouponDetailAdapter.kt
File was deleted
app/src/main/java/com/dollearn/student/ui/worldcup/MyWorldActivity.kt
File was deleted
app/src/main/java/com/dollearn/student/ui/worldcup/MyWorldFragment.kt
File was deleted
app/src/main/java/com/dollearn/student/ui/worldcup/MyWorldInfoActivity.kt
File was deleted
app/src/main/java/com/dollearn/student/ui/worldcup/WorldCupListActivity.kt
@@ -14,7 +14,7 @@
import com.bumptech.glide.request.transition.Transition
import com.github.zackratos.ultimatebar.UltimateBar
import com.dollearn.student.R
import com.dollearn.student.WeparkApplication
import com.dollearn.student.DollearnApplication
import com.dollearn.student.network.HttpManager
import com.dollearn.student.network.entity.Banner
import com.dollearn.student.network.entity.CommonData
@@ -178,7 +178,7 @@
    }
    private fun getData(){
        HttpManager.getWorldCupList(WeparkApplication.storeId,WeparkApplication.lat,WeparkApplication.lon,heatSort,condition,siteId,search).request(this,success = {_,data->
        HttpManager.getWorldCupList(DollearnApplication.storeId,DollearnApplication.lat,DollearnApplication.lon,heatSort,condition,siteId,search).request(this,success = { _, data->
            refreshLayout.finishRefresh()
            list.clear()
            list.addAll(data?: arrayListOf())
app/src/main/java/com/dollearn/student/ui/worldcup/WorldRankFragment.kt
File was deleted
app/src/main/java/com/dollearn/student/ui/worldcup/WorldRecordFragment.kt
File was deleted
app/src/main/java/com/dollearn/student/ui/worldcup/adapter/StudentQrAdapter.kt
File was deleted
app/src/main/java/com/dollearn/student/ui/worldcup/adapter/WorldCupRecordAdapter.kt
File was deleted
app/src/main/java/com/dollearn/student/utils/Const.kt
@@ -6,30 +6,22 @@
 */
object Const {
    const val Tag = "GWXLog"
    const val TICTag = "TICLog"
    const val PAGE_SIZE = 20 //列表页大小
    //各类第三方key
    const val UMENG_KEY = "5face26b45b2b751a92a70b8"
    const val WX_APP_ID = "wx41d32f362ba0f911"
    const val WX_SECRET = "cf0ebf950f5926a69041a0e2bbe20f3e"
    const val WX_APP_ID = "wx723c6b080f204773"
    const val WX_SECRET = "b7904c5721aeccc20fd11fe9afc23f4d"
    const val QQ_APP_ID = "101912859"
    const val QQ_SECRET = "692a092b65a6ec830fb62d1dc2270813"
    const val JX_APP_KEY = "cw52ddjimxhzzw#gwx597#10001"
    const val APP_KEY = "BT7NPhA0f775uzcUuftWjCE1TYZlWmHZ" //接口秘钥
    /**
     * 实时音视频sdkAppid
     */
    const val TIC_APP_ID = 1400455000 //release
//    const val TIC_APP_ID = 1400127140 //demo
    const val FIRST_LAUNCH = "isFirst"
    const val RV = "rightVoice"
    const val EV = "errorVoice"
    const val SCORE_DURATION = "score_duration"
    object Permission{
        const val LOCATION_REFUSE = "LOCATION_REFUSE"
        const val CAMERA_REFUSE = "CAMERA_REFUSE"
        const val FILE_REFUSE = "FILE_REFUSE"
    }
    object User {
@@ -37,19 +29,9 @@
        const val USER_ID = "userId"
        const val APP_ID = "appid"
        const val IS_AGREE = "isAgree" //是否同意用户协议和隐私协议
        const val IS_READ = "isRead" //是否阅读并同意过登录协议
        const val GRADE = "grade" //年级
        const val USER_HEAD = "userHead"
        const val USER_NAME = "userName"
        const val USER_PWD = "pwd"
        const val USER_PHONE = "userPhone"
    }
    object Share{
        const val TITLE = "海豚英语"
        const val NORMAL_CONTENT = "快来使用海豚英语吧" //推广中心分享
        const val COURSE_CONTENT = "这个课很不错哦" //运动营分享
    }
    object Method{
        const val PING_RECEIVE = "OK"
@@ -65,7 +47,7 @@
        const val CHANGE_SHOP = 0x01 //更换门店
        const val SCORE_CHANGED = 0x02 //积分改变
        const val REFRESH_USER = 0x03 //刷新福利首页信息
        const val SWITCH_HOME = 0x04 //切换到首页
        const val CLICK_GAME_ITEM = 0x04 //超级听力点击item
        const val NEXT_SUBJECT = 0x05 //下一大题
app/src/main/java/com/dollearn/student/utils/extention/WeparkEx.kt
@@ -5,20 +5,18 @@
import android.util.Log
import android.view.View
import android.widget.ImageView
import android.widget.TextView
import androidx.constraintlayout.widget.ConstraintLayout
import cn.sinata.xldutils.activity.BaseActivity
import com.bumptech.glide.Glide
import com.bumptech.glide.request.target.SimpleTarget
import com.bumptech.glide.request.transition.Transition
import com.github.promeg.pinyinhelper.Pinyin
import com.dollearn.student.utils.interfaces.StringCallback
import com.dollearn.student.network.entity.Grade
import com.dollearn.student.utils.OSSUtil
import com.dollearn.student.utils.extention.ViewClickDelay.SPACE_TIME
import com.dollearn.student.utils.extention.ViewClickDelay.hash
import com.dollearn.student.utils.extention.ViewClickDelay.lastClickTime
import com.dollearn.student.utils.glide.GlideUtil
import com.dollearn.student.utils.interfaces.StringCallback
import com.github.promeg.pinyinhelper.Pinyin
import kotlinx.android.synthetic.main.activity_course_deatil.*
import org.jetbrains.anko.toast
import top.zibin.luban.Luban
@@ -27,15 +25,15 @@
fun String.getInitial():String = if (startsWith("重庆")) "C" else Pinyin.toPinyin(this[0])[0].toString()
fun String.uploadWithCompress(act:BaseActivity,callback: StringCallback){
fun String.uploadWithCompress(act: BaseActivity, callback: StringCallback){
    Luban.with(act).load(File(this))
        .ignoreBy(100).setTargetDir(act.getPath())
        .filter { path -> path.isNotEmpty() || path.toLowerCase().endsWith(".gif") }
        .setCompressListener(object :OnCompressListener{
        .setCompressListener(object : OnCompressListener {
            override fun onSuccess(file: File) {
                Log.e("gwx","压缩完成")
                Log.e("gwx", "压缩完成")
                Thread(Runnable {
                    OSSUtil(act).uploadSingle(file.path,object :OSSUtil.OSSUploadCallBack(){
                    OSSUtil(act).uploadSingle(file.path, object : OSSUtil.OSSUploadCallBack() {
                        override fun onFial(message: String?) {
                            super.onFial(message)
                            act.runOnUiThread {
@@ -62,7 +60,7 @@
            }
            override fun onStart() {
                Log.e("gwx","压缩开始")
                Log.e("gwx", "压缩开始")
                act.showDialog(canCancel = false)
            }
        }).launch()
@@ -94,7 +92,7 @@
 * 使用Glide计算网络图片的宽高比加载长图
 * 父布局必须是ConstraintLayout:使用 dimensionRatio 属性
 */
fun String.loadLongImage(context:Context,imageView: ImageView){
fun String.loadLongImage(context: Context, imageView: ImageView){
    Glide.with(context).asBitmap().load(this)
        .into(object : SimpleTarget<Bitmap?>() {
            override fun onResourceReady(
@@ -105,7 +103,35 @@
                layoutParams.dimensionRatio =
                    "${resource.width}:${resource.height}"
                imageView.layoutParams = layoutParams
                GlideUtil.load(context,this@loadLongImage,imageView,0)
                GlideUtil.load(context, this@loadLongImage, imageView, 0)
            }
        })
}
fun Int.formatToChinese():String{
    var number = this
    val DIGITS = arrayListOf('零', '一', '二', '三', '四', '五', '六', '七', '八', '九')
    val UNITS = arrayListOf('0', '十', '百', '千', '万')
    if (number == 0) {
        return DIGITS[0].toString()
    }
    val chineseNumber = StringBuilder()
    var unitPlace = 0 // 位数,从百位开始
    var lastWasZero = false // 前一个数字是否为零
    while (number > 0) {
        val digit: Int = number % 10
        lastWasZero = if (digit == 0) {
            if (!lastWasZero) {
                chineseNumber.insert(0, DIGITS[0])
            }
            true
        } else {
            chineseNumber.insert(0, DIGITS[digit])
            chineseNumber.insert(0, UNITS[unitPlace])
            false
        }
        number /= 10
        unitPlace++
    }
    return chineseNumber.toString().replace("0","")
}
app/src/main/java/com/dollearn/student/utils/glide/GlideUtil.java
@@ -22,7 +22,7 @@
import com.bumptech.glide.request.RequestOptions;
import com.bumptech.glide.request.target.Target;
import com.dollearn.student.R;
import com.dollearn.student.WeparkApplication;
import com.dollearn.student.DollearnApplication;
import java.util.concurrent.ExecutionException;
@@ -261,7 +261,7 @@
                    .error(R.color.page_bg)
                    .placeholder(R.color.page_bg)
                    .diskCacheStrategy(diskCacheStrategy)
                    .apply(new RequestOptions().transform(new CenterCrop(), new RoundedCorners(DensityUtil.dip2px(WeparkApplication.Companion.getInstance(), num))));
                    .apply(new RequestOptions().transform(new CenterCrop(), new RoundedCorners(DensityUtil.dip2px(DollearnApplication.Companion.getInstance(), num))));
        }
        return chatcricleFoursUserHead;
    }
@@ -280,7 +280,7 @@
                    .error(R.color.black)
                    .placeholder(R.color.black)
                    .diskCacheStrategy(diskCacheStrategy)
                    .apply(new RequestOptions().transform(new FitCenter(), new RoundedCorners(DensityUtil.dip2px(WeparkApplication.Companion.getInstance(), num))));
                    .apply(new RequestOptions().transform(new FitCenter(), new RoundedCorners(DensityUtil.dip2px(DollearnApplication.Companion.getInstance(), num))));
        }
        return chatcricleFoursUserHead;
    }
app/src/main/res/drawable/bg_blue_line_grey_8dp.xml
New file
@@ -0,0 +1,6 @@
<?xml version="1.0" encoding="utf-8"?>
<shape xmlns:android="http://schemas.android.com/apk/res/android">
    <corners android:radius="8dp"/>
    <solid android:color="@color/page_bg"/>
    <stroke android:color="@color/colorPrimary" android:width="1dp"/>
</shape>
app/src/main/res/drawable/selector_enable_choose.xml
New file
@@ -0,0 +1,5 @@
<?xml version="1.0" encoding="utf-8"?>
<selector xmlns:android="http://schemas.android.com/apk/res/android">
    <item android:state_selected="true" android:drawable="@drawable/bg_blue_line_8dp"/>
    <item android:state_selected="false" android:drawable="@drawable/bg_blue_line_grey_8dp"/>
</selector>
app/src/main/res/layout/activity_coupon.xml
File was deleted
app/src/main/res/layout/activity_exchange_record.xml
@@ -2,9 +2,21 @@
<androidx.constraintlayout.widget.ConstraintLayout xmlns:android="http://schemas.android.com/apk/res/android"
    android:layout_width="match_parent"
    android:layout_height="match_parent">
    <androidx.recyclerview.widget.RecyclerView
        android:id="@+id/rv_record"
    <com.scwang.smart.refresh.layout.SmartRefreshLayout
        android:id="@+id/refreshLayout"
        android:layout_width="match_parent"
        android:layout_marginHorizontal="230dp"
        android:layout_height="match_parent"/>
        android:layout_height="match_parent">
        <com.scwang.smart.refresh.header.ClassicsHeader
            android:layout_width="match_parent"
            android:layout_height="wrap_content"/>
        <androidx.recyclerview.widget.RecyclerView
            android:id="@+id/rv_record"
            android:layout_width="match_parent"
            android:layout_height="match_parent"/>
        <com.scwang.smart.refresh.footer.ClassicsFooter
            android:layout_width="match_parent"
            android:layout_height="wrap_content"/>
    </com.scwang.smart.refresh.layout.SmartRefreshLayout>
</androidx.constraintlayout.widget.ConstraintLayout>
app/src/main/res/layout/activity_join_course.xml
File was deleted
app/src/main/res/layout/activity_login.xml
@@ -2,6 +2,7 @@
<androidx.constraintlayout.widget.ConstraintLayout xmlns:android="http://schemas.android.com/apk/res/android"
    xmlns:app="http://schemas.android.com/apk/res-auto"
    android:layout_width="match_parent"
    android:background="@color/page_bg"
    android:layout_height="match_parent">
    <ImageView
app/src/main/res/layout/activity_my_qr.xml
File was deleted
app/src/main/res/layout/activity_my_world_detail.xml
File was deleted
app/src/main/res/layout/activity_reserve_record.xml
File was deleted
app/src/main/res/layout/activity_score_shop.xml
File was deleted
app/src/main/res/layout/activity_shop_list.xml
File was deleted
app/src/main/res/layout/activity_stu_manage.xml
File was deleted
app/src/main/res/layout/dialog_check_qrcode.xml
File was deleted
app/src/main/res/layout/dialog_choose_coupon.xml
File was deleted
app/src/main/res/layout/dialog_competition_tip.xml
File was deleted
app/src/main/res/layout/dialog_rule.xml
@@ -26,7 +26,7 @@
        android:layout_marginStart="26dp"
        android:layout_marginTop="20dp"
        android:layout_marginEnd="26dp"
        android:text="尊敬的用户,为了向您提供更优质的服务,在您使用海豚英语App前,需要通过点击“同意”表示您已阅读并同意相关协议的各项规则,包括:我们会在您开启位置权限后访问、获取您的位置信息。"
        android:text="尊敬的用户,为了向您提供更优质的服务,在您使用海豚英语App前,需要通过点击“同意”表示您已阅读并同意相关协议的各项规则。"
        android:textColor="@color/textColor"
        android:textSize="14sp"
        app:layout_constraintTop_toBottomOf="@id/tv_title" />
app/src/main/res/layout/dialog_share.xml
New file
@@ -0,0 +1,65 @@
<?xml version="1.0" encoding="utf-8"?>
<androidx.constraintlayout.widget.ConstraintLayout xmlns:android="http://schemas.android.com/apk/res/android"
    android:layout_width="match_parent"
    android:layout_height="wrap_content"
    xmlns:app="http://schemas.android.com/apk/res-auto">
    <androidx.constraintlayout.widget.ConstraintLayout
        android:layout_width="match_parent"
        app:layout_constraintBottom_toBottomOf="parent"
        android:background="@color/white"
        android:layout_height="213dp">
        <TextView
            android:id="@+id/tv_title"
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            android:text="分享方式"
            android:textColor="@color/textColor"
            android:textStyle="bold"
            android:textSize="16sp"
            app:layout_constraintStart_toStartOf="parent"
            app:layout_constraintTop_toTopOf="parent"
            app:layout_constraintEnd_toEndOf="parent"
            android:layout_marginTop="18dp"/>
        <ImageView
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            android:id="@+id/iv_close"
            app:layout_constraintTop_toTopOf="parent"
            app:layout_constraintEnd_toEndOf="parent"
            android:padding="10dp"
            android:layout_marginTop="3dp"
            android:layout_marginEnd="55dp"
            android:src="@mipmap/icon_close"/>
        <TextView
            android:id="@+id/wv_1"
            android:layout_width="0dp"
            android:layout_height="wrap_content"
            android:layout_marginBottom="40dp"
            android:layout_marginStart="280dp"
            android:text="微信好友"
            android:gravity="center"
            android:drawableTop="@mipmap/share_wx"
            android:textSize="12sp"
            android:drawablePadding="8dp"
            app:layout_constraintStart_toStartOf="parent"
            app:layout_constraintEnd_toStartOf="@id/wv_2"
            app:layout_constraintBottom_toBottomOf="parent" />
        <TextView
            android:id="@+id/wv_2"
            android:layout_width="0dp"
            android:layout_height="wrap_content"
            android:layout_marginBottom="10dp"
            app:layout_constraintStart_toEndOf="@id/wv_1"
            app:layout_constraintEnd_toEndOf="parent"
            android:layout_marginEnd="280dp"
            android:textSize="12sp"
            android:drawablePadding="8dp"
            android:gravity="center"
            android:text="朋友圈"
            android:drawableTop="@mipmap/share_moment"
            app:layout_constraintTop_toTopOf="@id/wv_1" />
    </androidx.constraintlayout.widget.ConstraintLayout>
</androidx.constraintlayout.widget.ConstraintLayout>
app/src/main/res/layout/dialog_shop_choose.xml
File was deleted
app/src/main/res/layout/fragment_course.xml
File was deleted
app/src/main/res/layout/fragment_include.xml
@@ -118,7 +118,6 @@
            app:actualImageScaleType="centerCrop"
            app:failureImage="@color/grey_f1"
            android:layout_height="match_parent"/>
    </androidx.constraintlayout.widget.ConstraintLayout>
@@ -495,4 +494,57 @@
            app:layout_constraintEnd_toEndOf="parent"
            android:src="@mipmap/quanping"/>
    </androidx.constraintlayout.widget.ConstraintLayout>
    <RelativeLayout
        android:id="@+id/rv_3"
        android:layout_width="0dp"
        app:layout_constraintStart_toStartOf="@id/cl_3"
        app:layout_constraintEnd_toEndOf="@id/cl_3"
        app:layout_constraintTop_toTopOf="@id/cl_3"
        android:elevation="2dp"
        app:layout_constraintBottom_toBottomOf="@id/cl_3"
        android:layout_height="0dp">
        <ImageView
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            android:id="@+id/result_3"
            android:layout_centerInParent="true"
            android:visibility="gone"
            android:src="@mipmap/successs"/>
    </RelativeLayout>
    <RelativeLayout
        android:id="@+id/rv_5"
        android:layout_width="0dp"
        app:layout_constraintStart_toStartOf="@id/cl_5"
        app:layout_constraintEnd_toEndOf="@id/cl_5"
        app:layout_constraintTop_toTopOf="@id/cl_5"
        android:elevation="2dp"
        app:layout_constraintBottom_toBottomOf="@id/cl_5"
        android:layout_height="0dp">
        <ImageView
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            android:id="@+id/result_5"
            android:layout_centerInParent="true"
            android:visibility="gone"
            android:src="@mipmap/successs"/>
    </RelativeLayout>
    <RelativeLayout
        android:id="@+id/rv_6"
        android:layout_width="0dp"
        app:layout_constraintStart_toStartOf="@id/cl_6"
        app:layout_constraintEnd_toEndOf="@id/cl_6"
        app:layout_constraintTop_toTopOf="@id/cl_6"
        android:elevation="2dp"
        app:layout_constraintBottom_toBottomOf="@id/cl_6"
        android:layout_height="0dp">
        <ImageView
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            android:id="@+id/result_6"
            android:layout_centerInParent="true"
            android:visibility="gone"
            android:src="@mipmap/successs"/>
    </RelativeLayout>
</androidx.constraintlayout.motion.widget.MotionLayout>
app/src/main/res/layout/fragment_q_a.xml
@@ -47,7 +47,7 @@
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            android:layout_marginStart="20dp"
            android:src="@mipmap/voice_answer"
            android:src="@mipmap/voice_question"
            app:layout_constraintBottom_toBottomOf="parent"
            app:layout_constraintStart_toStartOf="parent"
            app:layout_constraintTop_toTopOf="parent" />
@@ -81,13 +81,23 @@
        app:layout_constraintTop_toTopOf="parent"
        app:layout_constraintVertical_chainStyle="packed">
        <com.facebook.drawee.view.SimpleDraweeView
            android:id="@+id/iv_1"
            android:layout_width="match_parent"
            android:layout_height="match_parent"
            app:layout_constraintBottom_toBottomOf="parent"
            app:layout_constraintTop_toTopOf="parent" />
        <ImageView
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            android:id="@+id/iv_right_1"
            android:src="@mipmap/successs"
            android:visibility="gone"
            app:layout_constraintStart_toStartOf="parent"
            app:layout_constraintTop_toTopOf="parent"
            app:layout_constraintBottom_toBottomOf="parent"
            app:layout_constraintEnd_toEndOf="parent"/>
    </androidx.constraintlayout.widget.ConstraintLayout>
@@ -96,7 +106,7 @@
        android:layout_width="159dp"
        android:layout_height="52dp"
        android:layout_marginTop="8dp"
        android:background="@drawable/bg_blue_8dp"
        android:background="@drawable/selector_bg_voice"
        app:layout_constraintBottom_toTopOf="@id/cl_3"
        app:layout_constraintStart_toStartOf="@id/cl_3"
        app:layout_constraintTop_toBottomOf="@id/cl_1">
@@ -126,7 +136,7 @@
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            android:layout_marginStart="20dp"
            android:src="@mipmap/voice_answer"
            android:src="@mipmap/voice_question"
            app:layout_constraintBottom_toBottomOf="parent"
            app:layout_constraintStart_toStartOf="parent"
            app:layout_constraintTop_toTopOf="parent" />
@@ -164,6 +174,17 @@
            android:layout_width="match_parent"
            android:layout_height="match_parent"
            app:actualImageScaleType="centerCrop" />
        <ImageView
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            android:id="@+id/iv_right_3"
            android:src="@mipmap/successs"
            android:visibility="gone"
            app:layout_constraintStart_toStartOf="parent"
            app:layout_constraintTop_toTopOf="parent"
            app:layout_constraintBottom_toBottomOf="parent"
            app:layout_constraintEnd_toEndOf="parent"/>
    </androidx.constraintlayout.widget.ConstraintLayout>
    <androidx.constraintlayout.widget.ConstraintLayout
@@ -236,6 +257,17 @@
            android:layout_width="match_parent"
            android:layout_height="match_parent"
            app:actualImageScaleType="centerCrop" />
        <ImageView
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            android:id="@+id/iv_right_2"
            android:src="@mipmap/successs"
            android:visibility="gone"
            app:layout_constraintStart_toStartOf="parent"
            app:layout_constraintTop_toTopOf="parent"
            app:layout_constraintBottom_toBottomOf="parent"
            app:layout_constraintEnd_toEndOf="parent"/>
    </androidx.constraintlayout.widget.ConstraintLayout>
    <androidx.constraintlayout.widget.ConstraintLayout
@@ -256,6 +288,17 @@
            android:layout_width="match_parent"
            android:layout_height="match_parent"
            app:actualImageScaleType="centerCrop" />
        <ImageView
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            android:id="@+id/iv_right_4"
            android:src="@mipmap/successs"
            android:visibility="gone"
            app:layout_constraintStart_toStartOf="parent"
            app:layout_constraintTop_toTopOf="parent"
            app:layout_constraintBottom_toBottomOf="parent"
            app:layout_constraintEnd_toEndOf="parent"/>
    </androidx.constraintlayout.widget.ConstraintLayout>
@@ -263,7 +306,7 @@
        android:id="@+id/cl_voice_4"
        android:layout_width="159dp"
        android:layout_height="52dp"
        android:background="@drawable/bg_blue_8dp"
        android:background="@drawable/selector_bg_voice"
        app:layout_constraintStart_toStartOf="@id/cl_4"
        app:layout_constraintTop_toTopOf="@id/cl_voice_3">
@@ -508,7 +551,7 @@
            android:id="@+id/rl_check_1"
            android:layout_width="52dp"
            android:layout_height="52dp"
            android:background="@drawable/bg_blue_line_8dp"
            android:background="@drawable/selector_enable_choose"
            android:visibility="gone">
            <View
@@ -533,7 +576,7 @@
            android:id="@+id/rl_check_2"
            android:layout_width="52dp"
            android:layout_height="52dp"
            android:background="@drawable/bg_blue_line_8dp"
            android:background="@drawable/selector_enable_choose"
            android:visibility="gone">
            <View
@@ -558,7 +601,7 @@
            android:id="@+id/rl_check_3"
            android:layout_width="52dp"
            android:layout_height="52dp"
            android:background="@drawable/bg_blue_line_8dp"
            android:background="@drawable/selector_enable_choose"
            android:visibility="gone">
            <View
app/src/main/res/layout/fragment_wc_record.xml
File was deleted
app/src/main/res/layout/fragment_world_rank.xml
File was deleted
app/src/main/res/layout/item_coupon.xml
File was deleted
app/src/main/res/layout/item_coupon_detail.xml
File was deleted
app/src/main/res/layout/item_reserve_record.xml
File was deleted
app/src/main/res/layout/item_stu_manage.xml
File was deleted
app/src/main/res/layout/item_stu_qr.xml
File was deleted
app/src/main/res/layout/item_stu_wc_detail.xml
File was deleted
app/src/main/res/layout/item_wc_record.xml
File was deleted
app/src/main/res/layout/item_week.xml
@@ -1,7 +1,7 @@
<?xml version="1.0" encoding="utf-8"?>
<androidx.constraintlayout.widget.ConstraintLayout xmlns:android="http://schemas.android.com/apk/res/android"
    android:layout_width="match_parent"
    android:layout_height="match_parent"
    android:layout_height="wrap_content"
    xmlns:app="http://schemas.android.com/apk/res-auto">
    <LinearLayout
app/src/main/res/layout/item_week_course.xml
File was deleted
app/src/main/res/mipmap-xxhdpi/ic_launcher.png

app/src/main/res/mipmap-xxhdpi/share_moment.png
app/src/main/res/mipmap-xxhdpi/share_wx.png
app/src/main/res/values/colors.xml
@@ -21,4 +21,5 @@
    <color name="colorTextDark">#2F5264</color>
    <color name="colorLittleBlue">#F4FAFE</color>
    <color name="dkplayer_theme_color">@color/colorAccent</color>
    <color name="page_bg">#C3BFB3</color>
</resources>
app/src/main/res/xml/fragment_listen_scene_result_1.xml
@@ -6,7 +6,7 @@
    <Transition
        motion:constraintSetEnd="@+id/end"
        motion:constraintSetStart="@id/start"
        motion:duration="2000">
        motion:duration="3000">
       <KeyFrameSet>
           <KeyAttribute motion:framePosition="10"
               android:alpha="1"
app/src/main/res/xml/fragment_listen_scene_result_2.xml
@@ -6,7 +6,7 @@
    <Transition
        motion:constraintSetEnd="@+id/end"
        motion:constraintSetStart="@id/start"
        motion:duration="2000">
        motion:duration="3000">
       <KeyFrameSet>
           <KeyAttribute motion:framePosition="10"
               android:alpha="1"
app/src/main/res/xml/fragment_listen_scene_result_3.xml
@@ -6,7 +6,7 @@
    <Transition
        motion:constraintSetEnd="@+id/end"
        motion:constraintSetStart="@id/start"
        motion:duration="2000">
        motion:duration="3000">
       <KeyFrameSet>
           <KeyAttribute motion:framePosition="10"
               android:alpha="1"
app/src/main/res/xml/fragment_listen_scene_result_4.xml
@@ -6,7 +6,7 @@
    <Transition
        motion:constraintSetEnd="@+id/end"
        motion:constraintSetStart="@id/start"
        motion:duration="2000">
        motion:duration="3000">
       <KeyFrameSet>
           <KeyAttribute motion:framePosition="10"
               android:alpha="1"
app/src/main/res/xml/fragment_listen_scene_result_5.xml
New file
@@ -0,0 +1,65 @@
<?xml version="1.0" encoding="utf-8"?>
<MotionScene
    xmlns:android="http://schemas.android.com/apk/res/android"
    xmlns:motion="http://schemas.android.com/apk/res-auto">
    <Transition
        motion:constraintSetEnd="@+id/end"
        motion:constraintSetStart="@id/start"
        motion:duration="3000">
       <KeyFrameSet>
           <KeyAttribute motion:framePosition="10"
               android:alpha="1"
               motion:motionTarget="@id/result_5"/>
           <KeyAttribute motion:framePosition="98"
               android:alpha="1"
               motion:motionTarget="@id/result_5"/>
           <KeyAttribute motion:framePosition="20"
               android:scaleX="0.9"
               android:scaleY="0.9"
               motion:motionTarget="@id/result_5"/>
           <KeyAttribute motion:framePosition="25"
               android:scaleX="1.1"
               android:scaleY="1.1"
               motion:motionTarget="@id/result_5"/>
           <KeyAttribute motion:framePosition="30"
               android:scaleX="0.9"
               android:scaleY="0.9"
               motion:motionTarget="@id/result_5"/>
           <KeyAttribute motion:framePosition="35"
               android:scaleX="1.1"
               android:scaleY="1.1"
               motion:motionTarget="@id/result_5"/>
           <KeyAttribute motion:framePosition="40"
               android:scaleX="1.0"
               android:scaleY="1.0"
               motion:motionTarget="@id/result_5"/>
       </KeyFrameSet>
    </Transition>
    <ConstraintSet android:id="@+id/start">
        <Constraint android:id="@+id/result_5"
            android:alpha="0"
            motion:layout_constraintStart_toStartOf="@+id/iv_5"
            motion:layout_constraintEnd_toEndOf="@+id/iv_5"
            motion:layout_constraintTop_toTopOf="@+id/iv_5"
            motion:layout_constraintBottom_toBottomOf="@+id/iv_5"
            android:layout_width="100dp"
            android:layout_height="100dp"
            android:visibility="visible"/>
    </ConstraintSet>
    <ConstraintSet android:id="@+id/end">
        <Constraint android:id="@+id/result_5"
            android:alpha="1"
            motion:layout_constraintStart_toStartOf="@+id/iv_5"
            motion:layout_constraintEnd_toEndOf="@+id/iv_5"
            motion:layout_constraintTop_toTopOf="@+id/iv_5"
            motion:layout_constraintBottom_toBottomOf="@+id/iv_5"
            android:layout_width="100dp"
            android:layout_height="100dp"
            android:visibility="visible"/>
    </ConstraintSet>
</MotionScene>
app/src/main/res/xml/fragment_listen_scene_result_6.xml
New file
@@ -0,0 +1,65 @@
<?xml version="1.0" encoding="utf-8"?>
<MotionScene
    xmlns:android="http://schemas.android.com/apk/res/android"
    xmlns:motion="http://schemas.android.com/apk/res-auto">
    <Transition
        motion:constraintSetEnd="@+id/end"
        motion:constraintSetStart="@id/start"
        motion:duration="3000">
       <KeyFrameSet>
           <KeyAttribute motion:framePosition="10"
               android:alpha="1"
               motion:motionTarget="@id/result_6"/>
           <KeyAttribute motion:framePosition="98"
               android:alpha="1"
               motion:motionTarget="@id/result_6"/>
           <KeyAttribute motion:framePosition="20"
               android:scaleX="0.9"
               android:scaleY="0.9"
               motion:motionTarget="@id/result_6"/>
           <KeyAttribute motion:framePosition="25"
               android:scaleX="1.1"
               android:scaleY="1.1"
               motion:motionTarget="@id/result_6"/>
           <KeyAttribute motion:framePosition="30"
               android:scaleX="0.9"
               android:scaleY="0.9"
               motion:motionTarget="@id/result_6"/>
           <KeyAttribute motion:framePosition="35"
               android:scaleX="1.1"
               android:scaleY="1.1"
               motion:motionTarget="@id/result_6"/>
           <KeyAttribute motion:framePosition="40"
               android:scaleX="1.0"
               android:scaleY="1.0"
               motion:motionTarget="@id/result_6"/>
       </KeyFrameSet>
    </Transition>
    <ConstraintSet android:id="@+id/start">
        <Constraint android:id="@+id/result_6"
            android:alpha="0"
            motion:layout_constraintStart_toStartOf="@+id/iv_6"
            motion:layout_constraintEnd_toEndOf="@+id/iv_6"
            motion:layout_constraintTop_toTopOf="@+id/iv_6"
            motion:layout_constraintBottom_toBottomOf="@+id/iv_6"
            android:layout_width="100dp"
            android:layout_height="100dp"
            android:visibility="visible"/>
    </ConstraintSet>
    <ConstraintSet android:id="@+id/end">
        <Constraint android:id="@+id/result_6"
            android:alpha="1"
            motion:layout_constraintStart_toStartOf="@+id/iv_6"
            motion:layout_constraintEnd_toEndOf="@+id/iv_6"
            motion:layout_constraintTop_toTopOf="@+id/iv_6"
            motion:layout_constraintBottom_toBottomOf="@+id/iv_6"
            android:layout_width="100dp"
            android:layout_height="100dp"
            android:visibility="visible"/>
    </ConstraintSet>
</MotionScene>
app/src/main/res/xml/item_game_1_scene.xml
@@ -6,7 +6,7 @@
    <Transition
        motion:constraintSetEnd="@+id/end"
        motion:constraintSetStart="@id/start"
        motion:duration="2000">
        motion:duration="3000">
        <KeyFrameSet>
            <KeyAttribute motion:framePosition="10"
                android:alpha="1"
app/src/main/res/xml/scene_fragment_choose_voice.xml
@@ -6,7 +6,7 @@
    <Transition
        motion:constraintSetEnd="@+id/end"
        motion:constraintSetStart="@id/start"
        motion:duration="2000">
        motion:duration="3000">
        <KeyFrameSet>
        </KeyFrameSet>
app/src/main/res/xml/scene_fragment_listen_voice.xml
@@ -6,7 +6,7 @@
    <Transition
        motion:constraintSetEnd="@+id/end"
        motion:constraintSetStart="@id/start"
        motion:duration="2000">
        motion:duration="3000">
       <KeyFrameSet>
       </KeyFrameSet>
app/src/main/res/xml/scene_fragment_look.xml
@@ -6,7 +6,7 @@
    <Transition
        motion:constraintSetEnd="@+id/end"
        motion:constraintSetStart="@id/start"
        motion:duration="2000">
        motion:duration="3000">
        <KeyFrameSet>
        </KeyFrameSet>
app/src/main/res/xml/scene_fragment_match.xml
@@ -6,7 +6,7 @@
    <Transition
        motion:constraintSetEnd="@+id/end"
        motion:constraintSetStart="@id/start"
        motion:duration="2000">
        motion:duration="3000">
       <KeyFrameSet>
       </KeyFrameSet>
xldutils-kotlin/src/main/AndroidManifest.xml
@@ -17,7 +17,7 @@
            android:theme="@style/Dialog" />
        <activity
            android:name="cn.sinata.xldutils.activity.ImagePagerActivity"
            android:screenOrientation="portrait" />
            android:screenOrientation="landscape" />
        <activity android:name=".activity.WebViewActivity" />
        <activity
            android:name=".activity.SelectPhotoActivity"
xldutils-kotlin/src/main/java/cn/sinata/xldutils/activity/ImagePagerActivity.kt
@@ -9,6 +9,7 @@
import androidx.viewpager.widget.ViewPager
import cn.sinata.xldutils.R
import cn.sinata.xldutils.adapter.ImagePagerAdapter
import cn.sinata.xldutils.gone
import cn.sinata.xldutils.visible
import org.jetbrains.anko.find
@@ -44,6 +45,9 @@
            this.urls.addAll(urls)
        }
        find<TextView>(R.id.tv_pages).text = getString(R.string.pageAndSizes,position+1,urls!!.size)
        find<View>(R.id.cl_back).setOnClickListener {
            finish()
        }
        imagePager.adapter = ImagePagerAdapter(supportFragmentManager,urls)
        imagePager.currentItem = position
xldutils-kotlin/src/main/java/cn/sinata/xldutils/activity/TitleActivity.kt
@@ -1,5 +1,6 @@
package cn.sinata.xldutils.activity
import android.graphics.Color
import android.view.View
import android.view.ViewGroup
import android.widget.LinearLayout
@@ -21,6 +22,9 @@
    val bg_title by lazy {
        find<View>(R.id.bg_title)
    }
    val base_root by lazy {
        find<View>(R.id.base_root)
    }
    val titleBar by lazy {
        val titleBar = find<TitleBar>(R.id.titleBar)
@@ -34,6 +38,7 @@
        if (layoutResID > 0) {
            layoutInflater.inflate(layoutResID, llContainer, true)
        }
        base_root.setBackgroundColor(Color.parseColor("#C3BFB3"))
    }
    override fun setContentView(view: View?) {
xldutils-kotlin/src/main/java/cn/sinata/xldutils/fragment/ImageFragment.kt
@@ -57,7 +57,7 @@
        zoomDraweeView.setOnClickListener{
            if (activity != null) {
//                activity?.onBackPressed()
                activity?.onBackPressed()
            }
        }
    }
xldutils-kotlin/src/main/res/layout/activity_base_title.xml
@@ -2,7 +2,8 @@
<androidx.constraintlayout.widget.ConstraintLayout xmlns:android="http://schemas.android.com/apk/res/android"
    android:layout_width="match_parent"
    android:layout_height="match_parent"
    android:background="@color/page_bg"
    android:id="@+id/base_root"
    android:background="#C3BFB3"
    xmlns:app="http://schemas.android.com/apk/res-auto">
    <View
        android:id="@+id/bg_title"
xldutils-kotlin/src/main/res/layout/activity_image_pager.xml
@@ -2,14 +2,14 @@
<androidx.constraintlayout.widget.ConstraintLayout xmlns:android="http://schemas.android.com/apk/res/android"
    android:layout_width="match_parent"
    android:layout_height="match_parent"
    android:id="@+id/cl_back"
    xmlns:app="http://schemas.android.com/apk/res-auto"
    android:background="@android:color/black">
    <androidx.viewpager.widget.ViewPager
        android:id="@+id/mViewPager"
        android:layout_width="match_parent"
        android:layout_height="0dp"
        app:layout_constraintTop_toBottomOf="@id/tv_back"
        android:layout_height="match_parent"
        app:layout_constraintBottom_toBottomOf="parent"/>
    <TextView
        android:id="@+id/tv_pages"