Browse Source

1.增加用户中心界面
2.增加他人作品界面
3.图片替换站位色
4.跳转逻辑问题修改
5.增加所有页面返回键按钮功能

FailedToRead 3 years ago
parent
commit
7ee1527197
100 changed files with 3877 additions and 2838 deletions
  1. 28 3
      .idea/misc.xml
  2. 0 1
      app/build.gradle
  3. 12 0
      app/src/fragmentRecommend/drawable/activity_comment_quick_item_one_bg.xml
  4. 12 0
      app/src/fragmentRecommend/drawable/activity_comment_quick_item_three_bg.xml
  5. 12 0
      app/src/fragmentRecommend/drawable/activity_comment_quick_item_two_bg.xml
  6. BIN
      app/src/fragmentRecommend/drawable/to_record_bg.png
  7. BIN
      app/src/fragmentRecommend/drawable/to_record_icon.png
  8. BIN
      app/src/fragmentRecommend/drawable/to_record_icon_mike.png
  9. 14 6
      app/src/fragmentRecommend/layout/fragment_main_recommend.xml
  10. BIN
      app/src/fragmentUser/drawable/fragment_user_no_record.png
  11. 54 0
      app/src/fragmentUser/layout/activity_mycollection.xml
  12. 54 0
      app/src/fragmentUser/layout/activity_myfollow.xml
  13. 37 0
      app/src/fragmentUser/layout/activity_smallfull_video.xml
  14. 6 43
      app/src/main/res/layout/adapter_item_record.xml
  15. 108 0
      app/src/fragmentUser/layout/popupwindow_exit_login.xml
  16. 184 0
      app/src/fragmentUser/layout/popupwindow_select_grade.xml
  17. 118 2
      app/src/main/AndroidManifest.xml
  18. 116 0
      app/src/main/java/com/edufound/reader/activity/CommentActivity.java
  19. 7 7
      app/src/main/java/com/edufound/reader/activity/CrashDialogActivity.java
  20. 75 0
      app/src/main/java/com/edufound/reader/activity/CustomerServiceActivity.java
  21. 26 2
      app/src/main/java/com/edufound/reader/activity/LoginAlertActivity.java
  22. 22 12
      app/src/main/java/com/edufound/reader/activity/MainActivity.java
  23. 89 0
      app/src/main/java/com/edufound/reader/activity/MessageActivity.java
  24. 83 0
      app/src/main/java/com/edufound/reader/activity/MyCollectionActivity.java
  25. 83 0
      app/src/main/java/com/edufound/reader/activity/MyFollowActivity.java
  26. 118 0
      app/src/main/java/com/edufound/reader/activity/OthersRecordActivity.java
  27. 82 0
      app/src/main/java/com/edufound/reader/activity/PayActivity.java
  28. 23 10
      app/src/main/java/com/edufound/reader/activity/VideoActivity.java
  29. 104 0
      app/src/main/java/com/edufound/reader/activity/SmallFullVideoActivity.java
  30. 93 0
      app/src/main/java/com/edufound/reader/activity/UserInfoSettingActivity.java
  31. 81 0
      app/src/main/java/com/edufound/reader/activity/WebActivity.java
  32. 86 0
      app/src/main/java/com/edufound/reader/adapter/MessageItemAdapter.java
  33. 108 0
      app/src/main/java/com/edufound/reader/adapter/MyCollectionItemAdapter.java
  34. 38 37
      app/src/main/java/com/edufound/reader/adapter/RecordItemAdapter.java
  35. 4 0
      app/src/main/java/com/edufound/reader/adapter/SlideVideoAdapter.java
  36. 61 1
      app/src/main/java/com/edufound/reader/base/BaseActivity.java
  37. 16 0
      app/src/main/java/com/edufound/reader/base/BaseMvpFragment.java
  38. 5 0
      app/src/main/java/com/edufound/reader/base/BaseView.java
  39. 6 0
      app/src/main/java/com/edufound/reader/contract/CharacterFragmentContract.java
  40. 19 0
      app/src/main/java/com/edufound/reader/contract/CommentContract.java
  41. 16 0
      app/src/main/java/com/edufound/reader/contract/CustomerServiceContract.java
  42. 7 1
      app/src/main/java/com/edufound/reader/contract/LoginAlertContract.java
  43. 17 0
      app/src/main/java/com/edufound/reader/contract/MessageContract.java
  44. 19 0
      app/src/main/java/com/edufound/reader/contract/MyCollectionContract.java
  45. 17 0
      app/src/main/java/com/edufound/reader/contract/MyFollowContract.java
  46. 3 2
      app/src/main/java/com/edufound/reader/contract/UserFragmentContract.java
  47. 4 14
      app/src/main/java/com/edufound/reader/contract/UserFragmentContract.java
  48. 14 0
      app/src/main/java/com/edufound/reader/contract/PayContract.java
  49. 10 2
      app/src/main/java/com/edufound/reader/contract/RecommendFragmentContract.java
  50. 4 10
      app/src/main/java/com/edufound/reader/contract/VideoContract.java
  51. 15 0
      app/src/main/java/com/edufound/reader/contract/SmallFullVideoContract.java
  52. 14 0
      app/src/main/java/com/edufound/reader/contract/UserInfoSettingContract.java
  53. 18 0
      app/src/main/java/com/edufound/reader/contract/WebContract.java
  54. 422 0
      app/src/main/java/com/edufound/reader/cusview/GridRadioGroup.java
  55. 9 8
      app/src/main/java/com/edufound/reader/cusview/RoundFrameLayout.java
  56. 30 7
      app/src/main/java/com/edufound/reader/cusview/RvListJzvdStd.java
  57. 41 9
      app/src/main/java/com/edufound/reader/fragment/CharacterFragment.java
  58. 190 0
      app/src/main/java/com/edufound/reader/fragment/MyTabFragment.java
  59. 89 20
      app/src/main/java/com/edufound/reader/fragment/RecommendFragment.java
  60. 0 135
      app/src/main/java/com/edufound/reader/fragment/UserFragment.java
  61. 0 104
      app/src/main/java/com/edufound/reader/ijkplayer/application/Settings.java
  62. 0 57
      app/src/main/java/com/edufound/reader/ijkplayer/media/FileMediaDataSource.java
  63. 0 42
      app/src/main/java/com/edufound/reader/ijkplayer/media/IMediaController.java
  64. 0 87
      app/src/main/java/com/edufound/reader/ijkplayer/media/IRenderView.java
  65. 0 1150
      app/src/main/java/com/edufound/reader/ijkplayer/media/IjkVideoView.java
  66. 0 215
      app/src/main/java/com/edufound/reader/ijkplayer/media/MeasureHelper.java
  67. 0 288
      app/src/main/java/com/edufound/reader/ijkplayer/media/SurfaceRenderView.java
  68. 0 370
      app/src/main/java/com/edufound/reader/ijkplayer/media/TextureRenderView.java
  69. 0 63
      app/src/main/java/com/edufound/reader/ijkplayer/services/MediaPlayerService.java
  70. 6 0
      app/src/main/java/com/edufound/reader/model/CommentModel.java
  71. 6 0
      app/src/main/java/com/edufound/reader/model/CustomerServiceModel.java
  72. 1 0
      app/src/main/java/com/edufound/reader/model/LoginAlertModel.java
  73. 6 0
      app/src/main/java/com/edufound/reader/model/MessageModel.java
  74. 6 0
      app/src/main/java/com/edufound/reader/model/MyCollectionModel.java
  75. 6 0
      app/src/main/java/com/edufound/reader/model/MyFollowModel.java
  76. 7 0
      app/src/main/java/com/edufound/reader/model/MyTabFragmentModel.java
  77. 7 0
      app/src/main/java/com/edufound/reader/model/OthersRecordModel.java
  78. 6 0
      app/src/main/java/com/edufound/reader/model/PayModel.java
  79. 2 2
      app/src/main/java/com/edufound/reader/model/VideoModel.java
  80. 6 0
      app/src/main/java/com/edufound/reader/model/SmallFullVideoModel.java
  81. 0 7
      app/src/main/java/com/edufound/reader/model/UserFragmentModel.java
  82. 6 0
      app/src/main/java/com/edufound/reader/model/UserInfoSettingModel.java
  83. 6 0
      app/src/main/java/com/edufound/reader/model/WebModel.java
  84. 109 0
      app/src/main/java/com/edufound/reader/popwindow/PopWindowUtil.java
  85. 27 30
      app/src/main/java/com/edufound/reader/presenter/CharacterFragmentPresenter.java
  86. 32 0
      app/src/main/java/com/edufound/reader/presenter/CommentPresenter.java
  87. 9 0
      app/src/main/java/com/edufound/reader/presenter/CustomerServicePresenter.java
  88. 89 14
      app/src/main/java/com/edufound/reader/presenter/LoginAlertPresenter.java
  89. 32 6
      app/src/main/java/com/edufound/reader/presenter/MainPresenter.java
  90. 71 0
      app/src/main/java/com/edufound/reader/presenter/MessagePresenter.java
  91. 102 0
      app/src/main/java/com/edufound/reader/presenter/MyCollectionPresenter.java
  92. 108 0
      app/src/main/java/com/edufound/reader/presenter/MyFollowPresenter.java
  93. 45 24
      app/src/main/java/com/edufound/reader/presenter/UserFragmentPresenter.java
  94. 113 0
      app/src/main/java/com/edufound/reader/presenter/OthersRecordPresenter.java
  95. 7 0
      app/src/main/java/com/edufound/reader/presenter/PayPresenter.java
  96. 47 3
      app/src/main/java/com/edufound/reader/presenter/RecommendFragmentPresenter.java
  97. 38 44
      app/src/main/java/com/edufound/reader/presenter/VideoPresenter.java
  98. 47 0
      app/src/main/java/com/edufound/reader/presenter/SmallFullVideoPresenter.java
  99. 7 0
      app/src/main/java/com/edufound/reader/presenter/UserInfoSettingPresenter.java
  100. 0 0
      app/src/main/java/com/edufound/reader/presenter/WebPresenter.java

+ 28 - 3
.idea/misc.xml

@@ -4,15 +4,26 @@
     <option name="filePathToZoomLevelMap">
       <map>
         <entry key="..\:/WorkSpace/Git_WorkSpace/efunboxReader-android/efunboxReader-android-master/app/src/activityLoginAlert/drawable/activity_loginalert_check_selector.xml" value="0.3328125" />
+        <entry key="..\:/WorkSpace/Git_WorkSpace/efunboxReader-android/efunboxReader-android-master/app/src/fragmentRecommend/drawable/activity_comment_quick_item_bg.xml" value="0.4326171875" />
+        <entry key="..\:/WorkSpace/Git_WorkSpace/efunboxReader-android/efunboxReader-android-master/app/src/fragmentRecommend/drawable/activity_comment_quick_item_one_two.xml" value="0.4326171875" />
+        <entry key="..\:/WorkSpace/Git_WorkSpace/efunboxReader-android/efunboxReader-android-master/app/src/fragmentRecommend/drawable/activity_comment_quick_item_three_bg.xml" value="0.34609375" />
         <entry key="..\:/WorkSpace/Git_WorkSpace/efunboxReader-android/efunboxReader-android-master/app/src/fragmentRecommend/drawable/fragment_recommend_rv_round.xml" value="0.32421875" />
         <entry key="..\:/WorkSpace/Git_WorkSpace/efunboxReader-android/efunboxReader-android-master/app/src/fragmentRecommend/drawable/fragment_recommend_to_record_bg_rotation.xml" value="0.2203125" />
         <entry key="..\:/WorkSpace/Git_WorkSpace/efunboxReader-android/efunboxReader-android-master/app/src/fragmentRecommend/drawable/fragment_recommend_userhead_round.xml" value="0.26197916666666665" />
         <entry key="..\:/WorkSpace/Git_WorkSpace/efunboxReader-android/efunboxReader-android-master/app/src/fragmentRecommend/drawable/slidevideo_switch_track.xml" value="0.32734375" />
         <entry key="..\:/WorkSpace/Git_WorkSpace/efunboxReader-android/efunboxReader-android-master/app/src/fragmentRecommend/drawable/slidevideo_switch_track_selector.xml" value="0.32734375" />
-        <entry key="..\:/WorkSpace/Git_WorkSpace/efunboxReader-android/efunboxReader-android-master/app/src/fragmentRecommend/layout/fragment_main_recommend.xml" value="0.75" />
+        <entry key="..\:/WorkSpace/Git_WorkSpace/efunboxReader-android/efunboxReader-android-master/app/src/fragmentRecommend/layout/fragment_main_recommend.xml" value="4.0" />
         <entry key="..\:/WorkSpace/Git_WorkSpace/efunboxReader-android/efunboxReader-android-master/app/src/fragmentRecommend/layout/slide_video_marqueen_item.xml" value="0.75" />
         <entry key="..\:/WorkSpace/Git_WorkSpace/efunboxReader-android/efunboxReader-android-master/app/src/fragmentUser/drawable/fragment_user_info_divider.xml" value="0.31640625" />
+        <entry key="..\:/WorkSpace/Git_WorkSpace/efunboxReader-android/efunboxReader-android-master/app/src/fragmentUser/layout/activity_mycollection.xml" value="0.18" />
+        <entry key="..\:/WorkSpace/Git_WorkSpace/efunboxReader-android/efunboxReader-android-master/app/src/fragmentUser/layout/activity_myfollow.xml" value="0.14" />
+        <entry key="..\:/WorkSpace/Git_WorkSpace/efunboxReader-android/efunboxReader-android-master/app/src/fragmentUser/layout/activity_smallfull_video.xml" value="0.1" />
+        <entry key="..\:/WorkSpace/Git_WorkSpace/efunboxReader-android/efunboxReader-android-master/app/src/fragmentUser/layout/adapter_item_record_authority.xml" value="0.3798449612403101" />
         <entry key="..\:/WorkSpace/Git_WorkSpace/efunboxReader-android/efunboxReader-android-master/app/src/fragmentUser/layout/fragment_user_rv_bottom.xml" value="0.2771317829457364" />
+        <entry key="..\:/WorkSpace/Git_WorkSpace/efunboxReader-android/efunboxReader-android-master/app/src/fragmentUser/layout/popupwindow_exit_login.xml" value="0.25" />
+        <entry key="..\:/WorkSpace/Git_WorkSpace/efunboxReader-android/efunboxReader-android-master/app/src/fragmentUser/layout/popupwindow_select_grade.xml" value="0.5" />
+        <entry key="..\:/WorkSpace/Git_WorkSpace/efunboxReader-android/efunboxReader-android-master/app/src/fragmentUser/layout/popupwindow_select_grade_griditem_divder.xml" value="0.3309002433090024" />
+        <entry key="..\:/WorkSpace/Git_WorkSpace/efunboxReader-android/efunboxReader-android-master/app/src/main/res/drawable-v24/popupwindow_select_grade_selector.xml" value="0.4443359375" />
         <entry key="..\:/WorkSpace/Git_WorkSpace/efunboxReader-android/efunboxReader-android-master/app/src/main/res/drawable/cusjzplayer_controller_seekbar.xml" value="0.2713541666666667" />
         <entry key="..\:/WorkSpace/Git_WorkSpace/efunboxReader-android/efunboxReader-android-master/app/src/main/res/drawable/main_left_tab_character_selector.xml" value="0.32421875" />
         <entry key="..\:/WorkSpace/Git_WorkSpace/efunboxReader-android/efunboxReader-android-master/app/src/main/res/drawable/main_left_tab_divider.xml" value="0.4" />
@@ -23,19 +34,33 @@
         <entry key="..\:/WorkSpace/Git_WorkSpace/efunboxReader-android/efunboxReader-android-master/app/src/main/res/drawable/main_left_tab_recommend_selector.xml" value="0.32421875" />
         <entry key="..\:/WorkSpace/Git_WorkSpace/efunboxReader-android/efunboxReader-android-master/app/src/main/res/drawable/player_seekbar_list.xml" value="0.2713541666666667" />
         <entry key="..\:/WorkSpace/Git_WorkSpace/efunboxReader-android/efunboxReader-android-master/app/src/main/res/layout/activity_alert_login.xml" value="0.5" />
+        <entry key="..\:/WorkSpace/Git_WorkSpace/efunboxReader-android/efunboxReader-android-master/app/src/main/res/layout/activity_comment.xml" value="0.5" />
         <entry key="..\:/WorkSpace/Git_WorkSpace/efunboxReader-android/efunboxReader-android-master/app/src/main/res/layout/activity_crash_dialog.xml" value="0.12" />
+        <entry key="..\:/WorkSpace/Git_WorkSpace/efunboxReader-android/efunboxReader-android-master/app/src/main/res/layout/activity_customerservice.xml" value="0.16" />
         <entry key="..\:/WorkSpace/Git_WorkSpace/efunboxReader-android/efunboxReader-android-master/app/src/main/res/layout/activity_main.xml" value="0.15" />
-        <entry key="..\:/WorkSpace/Git_WorkSpace/efunboxReader-android/efunboxReader-android-master/app/src/main/res/layout/activity_video.xml" value="0.1331521739130435" />
+        <entry key="..\:/WorkSpace/Git_WorkSpace/efunboxReader-android/efunboxReader-android-master/app/src/main/res/layout/activity_message.xml" value="0.18" />
+        <entry key="..\:/WorkSpace/Git_WorkSpace/efunboxReader-android/efunboxReader-android-master/app/src/main/res/layout/activity_otherrecord.xml" value="0.4627039627039627" />
+        <entry key="..\:/WorkSpace/Git_WorkSpace/efunboxReader-android/efunboxReader-android-master/app/src/main/res/layout/activity_pay.xml" value="0.2" />
+        <entry key="..\:/WorkSpace/Git_WorkSpace/efunboxReader-android/efunboxReader-android-master/app/src/main/res/layout/activity_userinfo_setting.xml" value="0.33" />
+        <entry key="..\:/WorkSpace/Git_WorkSpace/efunboxReader-android/efunboxReader-android-master/app/src/main/res/layout/activity_video.xml" value="0.18824087245139876" />
+        <entry key="..\:/WorkSpace/Git_WorkSpace/efunboxReader-android/efunboxReader-android-master/app/src/main/res/layout/activity_web.xml" value="0.2731143552311436" />
+        <entry key="..\:/WorkSpace/Git_WorkSpace/efunboxReader-android/efunboxReader-android-master/app/src/main/res/layout/adapter_item_message.xml" value="0.22" />
+        <entry key="..\:/WorkSpace/Git_WorkSpace/efunboxReader-android/efunboxReader-android-master/app/src/main/res/layout/adapter_item_myfollow.xml" value="0.5" />
+        <entry key="..\:/WorkSpace/Git_WorkSpace/efunboxReader-android/efunboxReader-android-master/app/src/main/res/layout/adapter_item_myollow.xml" value="0.25" />
         <entry key="..\:/WorkSpace/Git_WorkSpace/efunboxReader-android/efunboxReader-android-master/app/src/main/res/layout/adapter_item_record.xml" value="0.4539641943734015" />
+        <entry key="..\:/WorkSpace/Git_WorkSpace/efunboxReader-android/efunboxReader-android-master/app/src/main/res/layout/adapter_item_record_user.xml" value="0.25387596899224807" />
         <entry key="..\:/WorkSpace/Git_WorkSpace/efunboxReader-android/efunboxReader-android-master/app/src/main/res/layout/adapter_item_slidevideo.xml" value="0.25" />
+        <entry key="..\:/WorkSpace/Git_WorkSpace/efunboxReader-android/efunboxReader-android-master/app/src/main/res/layout/anim_getfollow.xml" value="0.75" />
         <entry key="..\:/WorkSpace/Git_WorkSpace/efunboxReader-android/efunboxReader-android-master/app/src/main/res/layout/curjzplayer_controller.xml" value="0.16" />
-        <entry key="..\:/WorkSpace/Git_WorkSpace/efunboxReader-android/efunboxReader-android-master/app/src/main/res/layout/cusjzplayer_controller.xml" value="0.22" />
+        <entry key="..\:/WorkSpace/Git_WorkSpace/efunboxReader-android/efunboxReader-android-master/app/src/main/res/layout/cusjzplayer_controller.xml" value="0.2791970802919708" />
         <entry key="..\:/WorkSpace/Git_WorkSpace/efunboxReader-android/efunboxReader-android-master/app/src/main/res/layout/fragment_main_character.xml" value="0.18" />
         <entry key="..\:/WorkSpace/Git_WorkSpace/efunboxReader-android/efunboxReader-android-master/app/src/main/res/layout/fragment_main_recommend.xml" value="0.2" />
         <entry key="..\:/WorkSpace/Git_WorkSpace/efunboxReader-android/efunboxReader-android-master/app/src/main/res/layout/fragment_main_user.xml" value="0.25" />
         <entry key="..\:/WorkSpace/Git_WorkSpace/efunboxReader-android/efunboxReader-android-master/app/src/main/res/layout/fragment_user_rv_bottom.xml" value="0.30103359173126615" />
         <entry key="..\:/WorkSpace/Git_WorkSpace/efunboxReader-android/efunboxReader-android-master/app/src/main/res/layout/fragment_user_rv_header.xml" value="0.2" />
         <entry key="..\:/WorkSpace/Git_WorkSpace/efunboxReader-android/efunboxReader-android-master/app/src/main/res/layout/player_controller.xml" value="0.13" />
+        <entry key="..\:/WorkSpace/Git_WorkSpace/efunboxReader-android/efunboxReader-android-master/app/src/main/res/layout/popupwindow_comment.xml" value="0.16" />
+        <entry key="..\:/WorkSpace/Git_WorkSpace/efunboxReader-android/efunboxReader-android-master/app/src/main/res/layout/popupwindow_exit_app.xml" value="0.25" />
       </map>
     </option>
   </component>

+ 0 - 1
app/build.gradle

@@ -91,7 +91,6 @@ android {
 dependencies {
 
     implementation 'androidx.appcompat:appcompat:1.0.0'
-    testImplementation 'junit:junit:4.+'
     implementation 'com.github.bumptech.glide:glide:4.12.0'
     annotationProcessor 'com.github.bumptech.glide:compiler:4.12.0'
     implementation 'jp.wasabeef:glide-transformations:4.3.0'

+ 12 - 0
app/src/fragmentRecommend/drawable/activity_comment_quick_item_one_bg.xml

@@ -0,0 +1,12 @@
+<?xml version="1.0" encoding="utf-8"?>
+<shape xmlns:android="http://schemas.android.com/apk/res/android">
+    <solid android:color="#FF9B55" />
+    <corners
+            android:bottomLeftRadius="30dp"
+            android:bottomRightRadius="30dp"
+            android:topLeftRadius="30dp"
+            android:topRightRadius="30dp" />
+    <stroke
+            android:width="0dp"
+            android:color="@color/transparent" />
+</shape>

+ 12 - 0
app/src/fragmentRecommend/drawable/activity_comment_quick_item_three_bg.xml

@@ -0,0 +1,12 @@
+<?xml version="1.0" encoding="utf-8"?>
+<shape xmlns:android="http://schemas.android.com/apk/res/android">
+    <solid android:color="#67A5FF" />
+    <corners
+            android:bottomLeftRadius="30dp"
+            android:bottomRightRadius="30dp"
+            android:topLeftRadius="30dp"
+            android:topRightRadius="30dp" />
+    <stroke
+            android:width="0dp"
+            android:color="@color/transparent" />
+</shape>

+ 12 - 0
app/src/fragmentRecommend/drawable/activity_comment_quick_item_two_bg.xml

@@ -0,0 +1,12 @@
+<?xml version="1.0" encoding="utf-8"?>
+<shape xmlns:android="http://schemas.android.com/apk/res/android">
+    <solid android:color="#22B841" />
+    <corners
+            android:bottomLeftRadius="30dp"
+            android:bottomRightRadius="30dp"
+            android:topLeftRadius="30dp"
+            android:topRightRadius="30dp" />
+    <stroke
+            android:width="0dp"
+            android:color="@color/transparent" />
+</shape>

BIN
app/src/fragmentRecommend/drawable/to_record_bg.png


BIN
app/src/fragmentRecommend/drawable/to_record_icon.png


BIN
app/src/fragmentRecommend/drawable/to_record_icon_mike.png


+ 14 - 6
app/src/fragmentRecommend/layout/fragment_main_recommend.xml

@@ -5,19 +5,19 @@
         android:gravity="center">
 
     <FrameLayout
-            android:layout_width="972dp"
+            android:layout_width="1002dp"
             android:layout_height="700dp"
             android:layout_gravity="center">
 
         <ImageView
-                android:layout_width="match_parent"
+                android:layout_width="972dp"
                 android:layout_height="650dp"
                 android:background="@drawable/fragment_recommend_bg"></ImageView>
 
         <LinearLayout
-                android:layout_width="match_parent"
+                android:layout_width="972dp"
                 android:layout_height="match_parent"
-                android:layout_gravity="center"
+                android:layout_gravity="center|left"
                 android:gravity="center"
                 android:orientation="vertical">
 
@@ -303,17 +303,25 @@
                 <ImageView
                         android:id="@+id/fragment_recommend_to_record_bg"
                         android:layout_width="match_parent"
-                        android:rotation="80"
                         android:layout_height="match_parent"
                         android:layout_gravity="center"
                         android:src="@drawable/to_record_bg"></ImageView>
 
                 <ImageView
-                        android:id="@+id/fragment_recommend_to_record_icon"
                         android:layout_width="match_parent"
                         android:layout_height="match_parent"
                         android:layout_gravity="center"
+                        android:padding="10dp"
                         android:src="@drawable/to_record_icon"></ImageView>
+
+                <ImageView
+                        android:id="@+id/fragment_recommend_to_record_icon"
+                        android:layout_width="match_parent"
+                        android:layout_height="match_parent"
+                        android:layout_gravity="center"
+                        android:padding="38dp"
+                        android:src="@drawable/to_record_icon_mike"></ImageView>
+
             </FrameLayout>
 
             <ImageView

BIN
app/src/fragmentUser/drawable/fragment_user_no_record.png


+ 54 - 0
app/src/fragmentUser/layout/activity_mycollection.xml

@@ -0,0 +1,54 @@
+<?xml version="1.0" encoding="utf-8"?>
+<androidx.constraintlayout.widget.ConstraintLayout xmlns:android="http://schemas.android.com/apk/res/android"
+        xmlns:app="http://schemas.android.com/apk/res-auto"
+        xmlns:tools="http://schemas.android.com/tools"
+        android:layout_width="match_parent"
+        android:layout_height="match_parent">
+
+
+    <FrameLayout
+            android:id="@+id/background"
+            android:layout_width="match_parent"
+            android:layout_height="match_parent"
+            android:background="#70C1FF"
+            app:layout_constraintBottom_toBottomOf="parent"
+            app:layout_constraintEnd_toEndOf="parent"
+            app:layout_constraintStart_toStartOf="parent"
+            app:layout_constraintTop_toTopOf="parent"></FrameLayout>
+
+
+    <LinearLayout
+            android:layout_width="1280dp"
+            android:layout_height="720dp"
+            android:orientation="vertical"
+            app:layout_constraintBottom_toBottomOf="parent"
+            app:layout_constraintDimensionRatio="h,16:9"
+            app:layout_constraintEnd_toEndOf="parent"
+            app:layout_constraintStart_toStartOf="parent"
+            app:layout_constraintTop_toTopOf="parent">
+
+        <FrameLayout
+                android:layout_width="match_parent"
+                android:layout_height="0dp"
+                android:layout_weight="1">
+
+            <ImageView
+                    android:id="@+id/activity_mycollection_back"
+                    android:layout_width="77dp"
+                    android:layout_height="77dp"
+                    android:layout_gravity="left|top"
+                    android:layout_marginLeft="32dp"
+                    android:layout_marginTop="20dp"
+                    android:src="@drawable/main_back"></ImageView>
+        </FrameLayout>
+
+        <androidx.recyclerview.widget.RecyclerView
+                android:id="@+id/mycollection_recyclearview"
+                android:layout_width="match_parent"
+                android:layout_height="0dp"
+                android:layout_gravity="center_horizontal"
+                android:layout_weight="6"></androidx.recyclerview.widget.RecyclerView>
+
+    </LinearLayout>
+
+</androidx.constraintlayout.widget.ConstraintLayout>

+ 54 - 0
app/src/fragmentUser/layout/activity_myfollow.xml

@@ -0,0 +1,54 @@
+<?xml version="1.0" encoding="utf-8"?>
+<androidx.constraintlayout.widget.ConstraintLayout xmlns:android="http://schemas.android.com/apk/res/android"
+        xmlns:app="http://schemas.android.com/apk/res-auto"
+        xmlns:tools="http://schemas.android.com/tools"
+        android:layout_width="match_parent"
+        android:layout_height="match_parent">
+
+
+    <FrameLayout
+            android:id="@+id/background"
+            android:layout_width="match_parent"
+            android:layout_height="match_parent"
+            android:background="#70C1FF"
+            app:layout_constraintBottom_toBottomOf="parent"
+            app:layout_constraintEnd_toEndOf="parent"
+            app:layout_constraintStart_toStartOf="parent"
+            app:layout_constraintTop_toTopOf="parent"></FrameLayout>
+
+
+    <LinearLayout
+            android:layout_width="1280dp"
+            android:layout_height="720dp"
+            android:orientation="vertical"
+            app:layout_constraintBottom_toBottomOf="parent"
+            app:layout_constraintDimensionRatio="h,16:9"
+            app:layout_constraintEnd_toEndOf="parent"
+            app:layout_constraintStart_toStartOf="parent"
+            app:layout_constraintTop_toTopOf="parent">
+
+        <FrameLayout
+                android:layout_width="match_parent"
+                android:layout_height="0dp"
+                android:layout_weight="1">
+
+            <ImageView
+                    android:id="@+id/activity_myfollow_back"
+                    android:layout_width="77dp"
+                    android:layout_height="77dp"
+                    android:layout_gravity="left|top"
+                    android:layout_marginLeft="32dp"
+                    android:layout_marginTop="20dp"
+                    android:src="@drawable/main_back"></ImageView>
+        </FrameLayout>
+
+        <androidx.recyclerview.widget.RecyclerView
+                android:id="@+id/myfollow_recyclearview"
+                android:layout_width="match_parent"
+                android:layout_height="0dp"
+                android:layout_gravity="center_horizontal"
+                android:layout_weight="6"></androidx.recyclerview.widget.RecyclerView>
+
+    </LinearLayout>
+
+</androidx.constraintlayout.widget.ConstraintLayout>

+ 37 - 0
app/src/fragmentUser/layout/activity_smallfull_video.xml

@@ -0,0 +1,37 @@
+<?xml version="1.0" encoding="utf-8"?>
+<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:layout_height="match_parent"
+        android:layout_gravity="center"
+        android:background="@drawable/main_background">
+
+    <FrameLayout
+            android:layout_width="1280dp"
+            android:layout_height="720dp"
+            android:orientation="horizontal"
+            app:layout_constraintBottom_toBottomOf="parent"
+            app:layout_constraintDimensionRatio="h,16:9"
+            app:layout_constraintEnd_toEndOf="parent"
+            app:layout_constraintStart_toStartOf="parent"
+            app:layout_constraintTop_toTopOf="parent">
+
+        <FrameLayout
+                android:id="@+id/smallfull_fragment_layout"
+                android:layout_width="match_parent"
+                android:layout_height="match_parent"
+                android:layout_gravity="center"></FrameLayout>
+
+        <ImageView
+                android:id="@+id/activity_smallfull_video_back"
+                android:layout_width="77dp"
+                android:layout_height="77dp"
+                android:layout_marginLeft="32dp"
+                android:layout_marginTop="20dp"
+                android:src="@drawable/main_back"
+                app:layout_constraintStart_toStartOf="parent"
+                app:layout_constraintTop_toTopOf="parent"></ImageView>
+    </FrameLayout>
+
+
+</androidx.constraintlayout.widget.ConstraintLayout>

+ 6 - 43
app/src/main/res/layout/adapter_item_record.xml

@@ -19,7 +19,7 @@
                 android:orientation="vertical">
 
             <ImageView
-                    android:id="@+id/adapter_item_record_icon"
+                    android:id="@+id/adapter_item_record_authority_icon"
                     android:layout_width="match_parent"
                     android:layout_height="0dp"
                     android:layout_weight="3"
@@ -31,7 +31,7 @@
                     android:layout_weight="1">
 
                 <TextView
-                        android:id="@+id/adapter_item_record_name"
+                        android:id="@+id/adapter_item_record_authority_name"
                         android:layout_width="0dp"
                         android:layout_height="match_parent"
                         android:layout_weight="1.3"
@@ -41,22 +41,6 @@
                         android:textSize="27dp"
                         android:textStyle="bold"></TextView>
 
-                <ImageView
-                        android:id="@+id/adapter_item_record_del"
-                        android:layout_width="0dp"
-                        android:layout_height="match_parent"
-                        android:layout_weight="1"
-                        android:scaleType="center"
-                        android:src="@drawable/adapter_item_record_del"></ImageView>
-
-                <ImageView
-                        android:id="@+id/adapter_item_record_priv"
-                        android:layout_width="0dp"
-                        android:layout_height="match_parent"
-                        android:layout_weight="1"
-                        android:scaleType="center"
-                        android:src="@drawable/adapter_item_record_pri"></ImageView>
-
                 <Space
                         android:layout_width="0dp"
                         android:layout_height="match_parent"
@@ -86,7 +70,7 @@
                             android:src="@drawable/adapter_item_record_look"></ImageView>
 
                     <TextView
-                            android:id="@+id/adapter_item_record_look_num"
+                            android:id="@+id/adapter_item_record_authority_look_num"
                             android:layout_width="0dp"
                             android:layout_height="match_parent"
                             android:layout_gravity="center|left"
@@ -112,7 +96,7 @@
                             android:src="@drawable/adapter_item_record_thumb"></ImageView>
 
                     <TextView
-                            android:id="@+id/adapter_item_record_thumb_num"
+                            android:id="@+id/adapter_item_record_authority_thumb_num"
                             android:layout_width="0dp"
                             android:layout_height="match_parent"
                             android:layout_gravity="center|left"
@@ -138,7 +122,7 @@
                             android:src="@drawable/adapter_item_record_comment"></ImageView>
 
                     <TextView
-                            android:id="@+id/adapter_item_record_comment_num"
+                            android:id="@+id/adapter_item_record_authority_comment_num"
                             android:layout_width="0dp"
                             android:layout_height="match_parent"
                             android:layout_gravity="center|left"
@@ -165,7 +149,7 @@
                             android:src="@drawable/adapter_item_record_start"></ImageView>
 
                     <TextView
-                            android:id="@+id/adapter_item_record_start_num"
+                            android:id="@+id/adapter_item_record_authority_start_num"
                             android:layout_width="0dp"
                             android:layout_height="match_parent"
                             android:layout_gravity="center|left"
@@ -182,25 +166,4 @@
     </FrameLayout>
 
 
-    <FrameLayout
-            android:id="@+id/adapter_item_record_examine_layout"
-            android:layout_width="match_parent"
-            android:layout_height="match_parent"
-            android:layout_gravity="center"
-            android:clickable="false">
-
-        <FrameLayout
-                android:layout_width="match_parent"
-                android:layout_height="match_parent"
-                android:alpha="0.4"
-                android:background="@color/black"
-                android:clickable="false"></FrameLayout>
-
-        <ImageView
-                android:layout_width="110dp"
-                android:layout_height="110dp"
-                android:layout_gravity="center"
-                android:src="@drawable/adapter_item_record_examine"></ImageView>
-    </FrameLayout>
-
 </com.edufound.reader.cusview.RoundFrameLayout>

+ 108 - 0
app/src/fragmentUser/layout/popupwindow_exit_login.xml

@@ -0,0 +1,108 @@
+<?xml version="1.0" encoding="utf-8"?>
+<FrameLayout xmlns:android="http://schemas.android.com/apk/res/android"
+        android:layout_width="match_parent"
+        android:layout_height="match_parent"
+        android:background="@color/translucent_background">
+
+
+    <com.edufound.reader.cusview.RoundFrameLayout
+            android:layout_width="718dp"
+            android:layout_height="500dp"
+            android:layout_gravity="center"
+            android:background="#EF9B47">
+
+        <com.edufound.reader.cusview.RoundFrameLayout
+                android:layout_width="718dp"
+                android:layout_height="490dp"
+                android:layout_gravity="center|top"
+                android:background="#FFCE82">
+
+            <com.edufound.reader.cusview.RoundFrameLayout
+                    android:layout_width="685dp"
+                    android:layout_height="378dp"
+                    android:layout_gravity="center|top"
+                    android:layout_marginTop="18dp"
+                    android:background="#FFD78B">
+
+                <com.edufound.reader.cusview.RoundFrameLayout
+                        android:layout_width="match_parent"
+                        android:layout_height="368dp"
+                        android:layout_gravity="center|top"
+                        android:background="@color/white">
+
+                    <ImageView
+                            android:id="@+id/popupwindow_exit_login_image"
+                            android:layout_width="match_parent"
+                            android:layout_height="match_parent"
+                            android:src="@color/blueviolet"></ImageView>
+
+                    <TextView
+                            android:layout_width="wrap_content"
+                            android:layout_height="wrap_content"
+                            android:layout_gravity="center|bottom"
+                            android:layout_marginBottom="50dp"
+                            android:text="确定退出登录么?"
+                            android:textSize="34dp"
+                            android:textStyle="bold"></TextView>
+                </com.edufound.reader.cusview.RoundFrameLayout>
+            </com.edufound.reader.cusview.RoundFrameLayout>
+
+            <LinearLayout
+                    android:layout_width="match_parent"
+                    android:layout_height="70dp"
+                    android:layout_gravity="bottom"
+                    android:layout_marginBottom="20dp"
+                    android:orientation="horizontal">
+
+                <FrameLayout
+                        android:layout_width="0dp"
+                        android:layout_height="match_parent"
+                        android:layout_weight="1">
+
+                    <FrameLayout
+                            android:id="@+id/popupwindow_exit_login_ok"
+                            android:layout_width="184dp"
+                            android:layout_height="match_parent"
+                            android:layout_gravity="center"
+                            android:background="@drawable/main_ok_btn_bg">
+
+                        <TextView
+                                android:layout_width="match_parent"
+                                android:layout_height="match_parent"
+                                android:layout_gravity="center"
+                                android:gravity="center"
+                                android:text="确认"
+                                android:textColor="@color/white"
+                                android:textSize="30dp"
+                                android:textStyle="bold"></TextView>
+                    </FrameLayout>
+                </FrameLayout>
+
+                <FrameLayout
+                        android:layout_width="0dp"
+                        android:layout_height="match_parent"
+                        android:layout_weight="1">
+
+                    <FrameLayout
+                            android:id="@+id/popupwindow_exit_login_cancel"
+                            android:layout_width="184dp"
+                            android:layout_height="match_parent"
+                            android:layout_gravity="center"
+                            android:background="@drawable/main_cancel_btn_bg">
+
+                        <TextView
+                                android:layout_width="match_parent"
+                                android:layout_height="match_parent"
+                                android:layout_gravity="center"
+                                android:gravity="center"
+                                android:text="取消"
+                                android:textColor="@color/white"
+                                android:textSize="30dp"
+                                android:textStyle="bold"></TextView>
+                    </FrameLayout>
+                </FrameLayout>
+            </LinearLayout>
+        </com.edufound.reader.cusview.RoundFrameLayout>
+    </com.edufound.reader.cusview.RoundFrameLayout>
+
+</FrameLayout>

+ 184 - 0
app/src/fragmentUser/layout/popupwindow_select_grade.xml

@@ -0,0 +1,184 @@
+<?xml version="1.0" encoding="utf-8"?>
+<FrameLayout xmlns:android="http://schemas.android.com/apk/res/android"
+        android:layout_width="match_parent"
+        android:layout_height="match_parent"
+        android:background="@color/translucent_background">
+
+
+    <com.edufound.reader.cusview.RoundFrameLayout
+            android:layout_width="718dp"
+            android:layout_height="500dp"
+            android:layout_gravity="center"
+            android:background="#EF9B47">
+
+        <com.edufound.reader.cusview.RoundFrameLayout
+                android:layout_width="718dp"
+                android:layout_height="490dp"
+                android:layout_gravity="center|top"
+                android:background="#FFCE82">
+
+            <com.edufound.reader.cusview.RoundFrameLayout
+                    android:layout_width="685dp"
+                    android:layout_height="378dp"
+                    android:layout_gravity="center|top"
+                    android:layout_marginTop="18dp"
+                    android:background="#FFD78B">
+
+                <com.edufound.reader.cusview.RoundFrameLayout
+                        android:layout_width="match_parent"
+                        android:layout_height="368dp"
+                        android:layout_gravity="center|top"
+                        android:background="@color/white">
+
+                    <LinearLayout
+                            android:layout_width="match_parent"
+                            android:layout_height="match_parent"
+                            android:orientation="vertical">
+
+                        <TextView
+                                android:layout_width="match_parent"
+                                android:layout_height="80dp"
+                                android:layout_gravity="center"
+                                android:gravity="center"
+                                android:text="选择年级"
+                                android:textColor="@color/black"
+                                android:textSize="36dp"
+                                android:textStyle="bold"></TextView>
+
+                        <com.edufound.reader.cusview.GridRadioGroup
+                                android:id="@+id/popupwindow_select_grade_gridgroup"
+                                android:layout_width="528dp"
+                                android:layout_height="270dp"
+                                android:layout_gravity="center"
+                                android:orientation="vertical">
+
+                            <LinearLayout
+                                    android:layout_width="match_parent"
+                                    android:layout_height="0dp"
+                                    android:layout_gravity="center"
+                                    android:layout_weight="1"
+                                    android:divider="@drawable/popupwindow_select_grade_griditem_divder"
+                                    android:gravity="center"
+                                    android:orientation="horizontal"
+                                    android:showDividers="middle">
+
+                                <RadioButton
+                                        android:id="@+id/popupwindow_select_grade_one"
+                                        android:layout_width="219dp"
+                                        android:layout_height="66dp"
+                                        android:background="@drawable/popupwindow_select_grade_selector"
+                                        android:button="@null"
+                                        android:gravity="center"
+                                        android:text="一年级"
+                                        android:textColor="@color/white"
+                                        android:textSize="31dp"
+                                        android:textStyle="bold"></RadioButton>
+
+
+                                <RadioButton
+                                        android:id="@+id/popupwindow_select_grade_two"
+                                        android:layout_width="219dp"
+                                        android:layout_height="66dp"
+                                        android:background="@drawable/popupwindow_select_grade_selector"
+                                        android:button="@null"
+                                        android:gravity="center"
+                                        android:text="二年级"
+                                        android:textColor="@color/white"
+                                        android:textSize="31dp"
+                                        android:textStyle="bold"></RadioButton>
+                            </LinearLayout>
+
+                            <LinearLayout
+                                    android:layout_width="match_parent"
+                                    android:layout_height="0dp"
+                                    android:layout_gravity="center"
+                                    android:layout_weight="1"
+                                    android:divider="@drawable/popupwindow_select_grade_griditem_divder"
+                                    android:gravity="center"
+                                    android:orientation="horizontal"
+                                    android:showDividers="middle">
+
+
+                                <RadioButton
+                                        android:id="@+id/popupwindow_select_grade_three"
+                                        android:layout_width="219dp"
+                                        android:layout_height="66dp"
+                                        android:background="@drawable/popupwindow_select_grade_selector"
+                                        android:button="@null"
+                                        android:gravity="center"
+                                        android:text="三年级"
+                                        android:textColor="@color/white"
+                                        android:textSize="31dp"
+                                        android:textStyle="bold"></RadioButton>
+
+                                <RadioButton
+                                        android:id="@+id/popupwindow_select_grade_four"
+                                        android:layout_width="219dp"
+                                        android:layout_height="66dp"
+                                        android:background="@drawable/popupwindow_select_grade_selector"
+                                        android:button="@null"
+                                        android:gravity="center"
+                                        android:text="四年级"
+                                        android:textColor="@color/white"
+                                        android:textSize="31dp"
+                                        android:textStyle="bold"></RadioButton>
+                            </LinearLayout>
+
+                            <LinearLayout
+                                    android:layout_width="match_parent"
+                                    android:layout_height="0dp"
+                                    android:layout_gravity="center"
+                                    android:layout_weight="1"
+                                    android:divider="@drawable/popupwindow_select_grade_griditem_divder"
+                                    android:gravity="center"
+                                    android:orientation="horizontal"
+                                    android:showDividers="middle">
+
+                                <RadioButton
+                                        android:id="@+id/popupwindow_select_grade_pre"
+                                        android:layout_width="219dp"
+                                        android:layout_height="66dp"
+                                        android:background="@drawable/popupwindow_select_grade_selector"
+                                        android:button="@null"
+                                        android:gravity="center"
+                                        android:text="学前"
+                                        android:textColor="@color/white"
+                                        android:textSize="31dp"
+                                        android:textStyle="bold"></RadioButton>
+
+                                <Space
+                                        android:layout_width="219dp"
+                                        android:layout_height="66dp"></Space>
+                            </LinearLayout>
+
+                        </com.edufound.reader.cusview.GridRadioGroup>
+                    </LinearLayout>
+                </com.edufound.reader.cusview.RoundFrameLayout>
+            </com.edufound.reader.cusview.RoundFrameLayout>
+
+        </com.edufound.reader.cusview.RoundFrameLayout>
+
+        <FrameLayout
+                android:id="@+id/popupwindow_select_ok"
+                android:layout_width="182dp"
+                android:layout_height="67dp"
+                android:layout_gravity="center|bottom"
+                android:layout_marginBottom="30dp">
+
+            <ImageView
+                    android:layout_width="match_parent"
+                    android:layout_height="match_parent"
+                    android:src="@drawable/main_ok_btn_bg"></ImageView>
+
+            <TextView
+                    android:layout_width="match_parent"
+                    android:layout_height="match_parent"
+                    android:gravity="center"
+                    android:text="确定"
+                    android:textColor="@color/white"
+                    android:textSize="31dp"
+                    android:textStyle="bold"></TextView>
+        </FrameLayout>
+    </com.edufound.reader.cusview.RoundFrameLayout>
+
+</FrameLayout>

+ 118 - 2
app/src/main/AndroidManifest.xml

@@ -22,7 +22,7 @@
             android:label="@string/app_name"
             android:roundIcon="${icon}"
             android:supportsRtl="true"
-            android:theme="@style/AppStartTheme">
+            android:theme="@style/Theme.AppCompat.Light.NoActionBar.FullScreen">
 
         <meta-data
                 android:name="android.notch_support"
@@ -34,9 +34,11 @@
                 android:name="notch.config"
                 android:value="portrait|landscape" />
 
+        <!--主页-->
         <activity
                 android:name="com.edufound.reader.activity.MainActivity"
                 android:configChanges="screenLayout|screenSize|keyboardHidden|keyboard|orientation"
+                android:launchMode="singleTop"
                 android:maxAspectRatio="2.1"
                 android:resizeableActivity="true"
                 android:screenOrientation="landscape"
@@ -49,17 +51,21 @@
             </intent-filter>
         </activity>
 
+        <!--录音界面-->
         <activity
-                android:name="com.edufound.reader.activity.VideoActivity"
+                android:name="com.edufound.reader.activity.RecordActivity"
                 android:configChanges="screenLayout|screenSize|keyboardHidden|keyboard|orientation"
+                android:launchMode="singleTask"
                 android:maxAspectRatio="2.1"
                 android:resizeableActivity="true"
                 android:screenOrientation="landscape"
                 android:theme="@style/Theme.AppCompat.Light.NoActionBar.FullScreen"
                 android:windowSoftInputMode="adjustNothing|stateHidden"></activity>
+        <!--登录界面 -->
         <activity
                 android:name="com.edufound.reader.activity.CrashDialogActivity"
                 android:configChanges="screenLayout|screenSize|keyboardHidden|keyboard|orientation"
+                android:launchMode="singleTask"
                 android:maxAspectRatio="2.1"
                 android:resizeableActivity="true"
                 android:screenOrientation="landscape"
@@ -68,10 +74,63 @@
 
         </activity>
 
+        <!--登录界面 -->
         <activity
                 android:name="com.edufound.reader.activity.LoginAlertActivity"
                 android:configChanges="screenLayout|screenSize|keyboardHidden|keyboard|orientation"
                 android:label=""
+                android:launchMode="singleTask"
+                android:maxAspectRatio="2.1"
+                android:resizeableActivity="true"
+                android:screenOrientation="landscape"
+                android:theme="@style/efunboxTransparentLoginAlert"
+                android:windowSoftInputMode="adjustNothing|stateHidden"></activity>
+        <!--我的收藏界面 -->
+        <activity
+                android:name="com.edufound.reader.activity.MyCollectionActivity"
+                android:configChanges="screenLayout|screenSize|keyboardHidden|keyboard|orientation"
+                android:launchMode="singleTask"
+                android:maxAspectRatio="2.1"
+                android:resizeableActivity="true"
+                android:screenOrientation="landscape"
+                android:theme="@style/efunboxTransparentLoginAlert"
+                android:windowSoftInputMode="adjustNothing|stateHidden"></activity>
+        <!--我的关注界面 -->
+        <activity
+                android:name="com.edufound.reader.activity.MyFollowActivity"
+                android:configChanges="screenLayout|screenSize|keyboardHidden|keyboard|orientation"
+                android:launchMode="singleTask"
+                android:maxAspectRatio="2.1"
+                android:resizeableActivity="true"
+                android:screenOrientation="landscape"
+                android:theme="@style/efunboxTransparentLoginAlert"
+                android:windowSoftInputMode="adjustNothing|stateHidden"></activity>
+        <!--消息通知界面 -->
+        <activity
+                android:name="com.edufound.reader.activity.MessageActivity"
+                android:configChanges="screenLayout|screenSize|keyboardHidden|keyboard|orientation"
+                android:launchMode="singleTask"
+                android:maxAspectRatio="2.1"
+                android:resizeableActivity="true"
+                android:screenOrientation="landscape"
+                android:theme="@style/efunboxTransparentLoginAlert"
+                android:windowSoftInputMode="adjustNothing|stateHidden"></activity>
+        <!--联系我们界面 -->
+        <activity
+                android:name="com.edufound.reader.activity.CustomerServiceActivity"
+                android:configChanges="screenLayout|screenSize|keyboardHidden|keyboard|orientation"
+                android:launchMode="singleTask"
+                android:maxAspectRatio="2.1"
+                android:resizeableActivity="true"
+                android:screenOrientation="landscape"
+                android:theme="@style/efunboxTransparentLoginAlert"
+                android:windowSoftInputMode="adjustNothing|stateHidden"></activity>
+
+        <!--支付界面 -->
+        <activity
+                android:name="com.edufound.reader.activity.PayActivity"
+                android:configChanges="screenLayout|screenSize|keyboardHidden|keyboard|orientation"
+                android:launchMode="singleTask"
                 android:maxAspectRatio="2.1"
                 android:resizeableActivity="true"
                 android:screenOrientation="landscape"
@@ -79,6 +138,63 @@
                 android:windowSoftInputMode="adjustNothing|stateHidden"></activity>
 
 
+        <!--评论界面 -->
+        <activity
+                android:name="com.edufound.reader.activity.CommentActivity"
+                android:configChanges="screenLayout|screenSize|keyboardHidden|keyboard|orientation"
+                android:label=""
+                android:launchMode="singleTask"
+                android:maxAspectRatio="2.1"
+                android:resizeableActivity="true"
+                android:screenOrientation="landscape"
+                android:theme="@style/efunboxTransparentLoginAlert"
+                android:windowSoftInputMode="adjustPan|stateHidden"></activity>
+        <!--web界面 -->
+        <activity
+                android:name="com.edufound.reader.activity.WebActivity"
+                android:configChanges="screenLayout|screenSize|keyboardHidden|keyboard|orientation"
+                android:label=""
+                android:launchMode="singleTask"
+                android:maxAspectRatio="2.1"
+                android:process=":web"
+                android:resizeableActivity="true"
+                android:screenOrientation="landscape"
+                android:theme="@style/efunboxTransparentLoginAlert"
+                android:windowSoftInputMode="adjustNothing|stateHidden"></activity>
+
+        <activity
+                android:name="com.edufound.reader.activity.SmallFullVideoActivity"
+                android:configChanges="screenLayout|screenSize|keyboardHidden|keyboard|orientation"
+                android:label=""
+                android:launchMode="singleTask"
+                android:maxAspectRatio="2.1"
+                android:resizeableActivity="true"
+                android:screenOrientation="landscape"
+                android:theme="@style/efunboxTransparentLoginAlert"
+                android:windowSoftInputMode="adjustNothing|stateHidden"></activity>
+
+        <activity
+                android:name="com.edufound.reader.activity.OthersRecordActivity"
+                android:configChanges="screenLayout|screenSize|keyboardHidden|keyboard|orientation"
+                android:label=""
+                android:launchMode="singleTask"
+                android:maxAspectRatio="2.1"
+                android:resizeableActivity="true"
+                android:screenOrientation="landscape"
+                android:theme="@style/efunboxTransparentLoginAlert"
+                android:windowSoftInputMode="adjustNothing|stateHidden"></activity>
+
+
+        <activity
+                android:name="com.edufound.reader.activity.UserInfoSettingActivity"
+                android:configChanges="screenLayout|screenSize|keyboardHidden|keyboard|orientation"
+                android:label=""
+                android:launchMode="singleTask"
+                android:maxAspectRatio="2.1"
+                android:resizeableActivity="true"
+                android:screenOrientation="landscape"
+                android:theme="@style/efunboxTransparentLoginAlert"
+                android:windowSoftInputMode="adjustNothing|stateHidden"></activity>
         <!--友盟start-->
         <meta-data
                 android:name="UMENG_APPKEY"

+ 116 - 0
app/src/main/java/com/edufound/reader/activity/CommentActivity.java

@@ -0,0 +1,116 @@
+package com.edufound.reader.activity;
+
+import android.app.Activity;
+import android.view.View;
+import android.view.ViewGroup;
+import android.widget.EditText;
+import android.widget.FrameLayout;
+import android.widget.ImageView;
+import android.widget.Toast;
+
+import com.edufound.reader.R;
+import com.edufound.reader.annotation.BindView;
+import com.edufound.reader.base.BaseMvpActivity;
+import com.edufound.reader.contract.CommentContract;
+import com.edufound.reader.presenter.CommentPresenter;
+import com.orhanobut.logger.Logger;
+
+import androidx.recyclerview.widget.RecyclerView;
+
+public class CommentActivity extends BaseMvpActivity<CommentPresenter> implements CommentContract.View {
+
+
+    Activity mActivity;
+
+    @BindView(id = R.id.comment_touch_back)
+    FrameLayout mTouchBack;
+
+    @BindView(id = R.id.comment_close_quick)
+    ImageView mCloseKuaijie;
+
+    @BindView(id = R.id.comment_quick_layout)
+    FrameLayout mQuickLayout;
+
+    @BindView(id = R.id.comment_edit_text)
+    EditText mCommentEdit;
+
+    @BindView(id = R.id.comment_sendcomment)
+    FrameLayout mSendComment;
+
+    @BindView(id = R.id.comment_back)
+    ImageView mBack;
+
+    @BindView(id = R.id.comment_no_comment)
+    FrameLayout mNoCommentLayout;
+
+    @BindView(id = R.id.comment_item_layout)
+    RecyclerView mRecyclerView;
+
+
+    @Override
+    public int getLayoutId() {
+        return R.layout.activity_comment;
+    }
+
+    @Override
+    public void initView() {
+        mActivity = this;
+        mPresenter = new CommentPresenter();
+        mPresenter.attachView(this);
+        addUiClickListener(mTouchBack, o -> {
+            Logger.e("123123123");
+            mActivity.finish();
+        });
+        addUiClickListener(mBack, o -> {
+            mActivity.finish();
+        });
+        addUiClickListener(mCloseKuaijie, o -> {
+            mQuickLayout.setVisibility(View.GONE);
+        });
+        addUiClickListener(mSendComment, o -> {
+            Toast.makeText(getActivity(), "发送评论", Toast.LENGTH_SHORT).show();
+        });
+        mPresenter.initComment(mRecyclerView, mNoCommentLayout);
+
+    }
+
+    @Override
+    public void onDisconnect() {
+
+    }
+
+    @Override
+    public void onMobileConnect() {
+
+    }
+
+    @Override
+    public void onWifiConnect() {
+
+    }
+
+    @Override
+    public void showLoading() {
+
+    }
+
+    @Override
+    public void hideLoading() {
+
+    }
+
+    @Override
+    public void onError(String errMessage) {
+
+    }
+
+    @Override
+    public Activity getActivity() {
+        return mActivity;
+    }
+
+    @Override
+    public ViewGroup getRootView() {
+        return findViewById(android.R.id.content);
+    }
+}

+ 7 - 7
app/src/main/java/com/edufound/reader/activity/CrashDialogActivity.java

@@ -3,19 +3,13 @@ package com.edufound.reader.activity;
 import android.app.Activity;
 import android.app.AlertDialog;
 import android.content.DialogInterface;
-import android.os.Bundle;
-import android.widget.Button;
+import android.view.ViewGroup;
 
 import com.edufound.reader.R;
-import com.edufound.reader.annotation.BindView;
 import com.edufound.reader.application.EApplication;
 import com.edufound.reader.base.BaseMvpActivity;
 import com.edufound.reader.contract.CrashDialogContract;
-import com.edufound.reader.contract.MainContract;
 import com.edufound.reader.presenter.CrashDialogPresenter;
-import com.edufound.reader.presenter.VideoPresenter;
-
-import androidx.annotation.Nullable;
 
 public class CrashDialogActivity extends BaseMvpActivity<CrashDialogPresenter> implements CrashDialogContract.View {
 
@@ -62,6 +56,7 @@ public class CrashDialogActivity extends BaseMvpActivity<CrashDialogPresenter> i
 
     }
 
+
     @Override
     public void showLoading() {
 
@@ -81,4 +76,9 @@ public class CrashDialogActivity extends BaseMvpActivity<CrashDialogPresenter> i
     public Activity getActivity() {
         return mActivity;
     }
+
+    @Override
+    public ViewGroup getRootView() {
+        return findViewById(android.R.id.content);
+    }
 }

+ 75 - 0
app/src/main/java/com/edufound/reader/activity/CustomerServiceActivity.java

@@ -0,0 +1,75 @@
+package com.edufound.reader.activity;
+
+import android.app.Activity;
+import android.view.ViewGroup;
+import android.widget.ImageView;
+
+import com.edufound.reader.R;
+import com.edufound.reader.annotation.BindView;
+import com.edufound.reader.base.BaseActivity;
+import com.edufound.reader.base.BaseMvpActivity;
+import com.edufound.reader.contract.CustomerServiceContract;
+import com.edufound.reader.presenter.CustomerServicePresenter;
+
+public class CustomerServiceActivity extends BaseMvpActivity<CustomerServicePresenter> implements CustomerServiceContract.View {
+
+    Activity mActivity;
+
+    @BindView(id = R.id.activity_customerservice_back)
+    ImageView mBack;
+
+    @Override
+    public int getLayoutId() {
+        return R.layout.activity_customerservice;
+    }
+
+    @Override
+    public void initView() {
+        mActivity = this;
+        mPresenter = new CustomerServicePresenter();
+        mPresenter.attachView(this);
+        addUiClickListener(mBack, o -> {
+            mActivity.finish();
+        });
+    }
+
+    @Override
+    public void onDisconnect() {
+
+    }
+
+    @Override
+    public void onMobileConnect() {
+
+    }
+
+    @Override
+    public void onWifiConnect() {
+
+    }
+
+    @Override
+    public void showLoading() {
+
+    }
+
+    @Override
+    public void hideLoading() {
+
+    }
+
+    @Override
+    public void onError(String errMessage) {
+
+    }
+
+    @Override
+    public Activity getActivity() {
+        return mActivity;
+    }
+
+    @Override
+    public ViewGroup getRootView() {
+        return findViewById(android.R.id.content);
+    }
+}

+ 26 - 2
app/src/main/java/com/edufound/reader/activity/LoginAlertActivity.java

@@ -1,6 +1,8 @@
 package com.edufound.reader.activity;
 
 import android.app.Activity;
+import android.os.Process;
+import android.view.ViewGroup;
 import android.widget.CompoundButton;
 import android.widget.EditText;
 import android.widget.FrameLayout;
@@ -10,6 +12,7 @@ import android.widget.Toast;
 
 import com.edufound.reader.R;
 import com.edufound.reader.annotation.BindView;
+import com.edufound.reader.base.BaseActivity;
 import com.edufound.reader.base.BaseMvpActivity;
 import com.edufound.reader.contract.LoginAlertContract;
 import com.edufound.reader.presenter.LoginAlertPresenter;
@@ -28,6 +31,8 @@ public class LoginAlertActivity extends BaseMvpActivity<LoginAlertPresenter> imp
     EditText mEditVCode;
     @BindView(id = R.id.activity_loginalert_getvercode)
     FrameLayout mGetVCode;
+    @BindView(id = R.id.activity_loginalert_getvercode_text)
+    TextView mGetVCodeText;
     @BindView(id = R.id.activity_loginalert_login)
     FrameLayout mLoginBtn;
     @BindView(id = R.id.activity_loginalert_checkbox)
@@ -53,9 +58,11 @@ public class LoginAlertActivity extends BaseMvpActivity<LoginAlertPresenter> imp
             finish();
         });
         addUiClickListener(mGetVCode, o -> {
-            Toast.makeText(mActivity, "click 获取验证码", Toast.LENGTH_SHORT).show();
+            mPresenter.getVCode(mEditPhone.getText().toString());
+//            Toast.makeText(mActivity, "click 获取验证码", Toast.LENGTH_SHORT).show();
         });
         addUiClickListener(mLoginBtn, o -> {
+            mPresenter.Login(mEditPhone.getText().toString(), mEditVCode.getText().toString());
         });
     }
 
@@ -95,7 +102,7 @@ public class LoginAlertActivity extends BaseMvpActivity<LoginAlertPresenter> imp
     }
 
     @Override
-    public ConstraintLayout getRootView() {
+    public ConstraintLayout getConstraintLayoutView() {
         return mRootView;
     }
 
@@ -103,4 +110,21 @@ public class LoginAlertActivity extends BaseMvpActivity<LoginAlertPresenter> imp
     public AppCompatCheckBox getCheckBox() {
         return mCheckBox;
     }
+
+    @Override
+    public TextView getVCodeText() {
+        return mGetVCodeText;
+    }
+
+
+    @Override
+    protected void onDestroy() {
+        super.onDestroy();
+        mPresenter.activityDestory();
+    }
+
+    @Override
+    public ViewGroup getRootView() {
+        return findViewById(android.R.id.content);
+    }
 }

+ 22 - 12
app/src/main/java/com/edufound/reader/activity/MainActivity.java

@@ -3,17 +3,20 @@ package com.edufound.reader.activity;
 import android.annotation.SuppressLint;
 import android.app.Activity;
 import android.view.KeyEvent;
-import android.widget.FrameLayout;
+import android.view.ViewGroup;
 import android.widget.RadioButton;
 import android.widget.RadioGroup;
-import android.widget.Toast;
 
 import com.edufound.reader.R;
 import com.edufound.reader.annotation.BindView;
 import com.edufound.reader.base.BaseMvpActivity;
 import com.edufound.reader.contract.MainContract;
+import com.edufound.reader.popwindow.PopWindowUtil;
 import com.edufound.reader.presenter.MainPresenter;
 
+import cn.jzvd.Jzvd;
+import cn.jzvd.JzvdStd;
+
 public class MainActivity extends BaseMvpActivity<MainPresenter> implements MainContract.View {
 
 
@@ -23,9 +26,6 @@ public class MainActivity extends BaseMvpActivity<MainPresenter> implements Main
     RadioGroup mRadioGroupTab;
 
 
-    @BindView(id = R.id.main_fragment_layout)
-    FrameLayout mFragmentLayout;
-
     @Override
     public int getLayoutId() {
         return R.layout.activity_main;
@@ -34,7 +34,6 @@ public class MainActivity extends BaseMvpActivity<MainPresenter> implements Main
     @SuppressLint("AutoDispose")
     @Override
     public void initView() {
-
         mPresenter = new MainPresenter(getSupportFragmentManager());
         mPresenter.attachView(this);
         mActivity = this;
@@ -45,6 +44,7 @@ public class MainActivity extends BaseMvpActivity<MainPresenter> implements Main
             }
         });
         ((RadioButton) mRadioGroupTab.getChildAt(1)).setChecked(true);
+      
     }
 
 
@@ -64,6 +64,11 @@ public class MainActivity extends BaseMvpActivity<MainPresenter> implements Main
     }
 
     @Override
+    public void onLoginSuccess() {
+
+    }
+
+    @Override
     public void showLoading() {
 
     }
@@ -85,23 +90,23 @@ public class MainActivity extends BaseMvpActivity<MainPresenter> implements Main
 
     @Override
     public void onBackPressed() {
-//        if (Jzvd.backPress()) {
-//            return;
-//        }
+        if (Jzvd.backPress()) {
+            return;
+        }
         super.onBackPressed();
     }
 
     @Override
     protected void onPause() {
         super.onPause();
-//        Jzvd.releaseAllVideos();
-//        JzvdStd.goOnPlayOnPause();
+        Jzvd.releaseAllVideos();
+        JzvdStd.goOnPlayOnPause();
     }
 
     @Override
     protected void onResume() {
         super.onResume();
-//        JzvdStd.goOnPlayOnResume();
+        JzvdStd.goOnPlayOnResume();
     }
 
     @Override
@@ -114,4 +119,9 @@ public class MainActivity extends BaseMvpActivity<MainPresenter> implements Main
     public boolean onKeyDown(int keyCode, KeyEvent event) {
         return mPresenter.onKeyDown(keyCode, event);
     }
+
+    @Override
+    public ViewGroup getRootView() {
+        return findViewById(android.R.id.content);
+    }
 }

+ 89 - 0
app/src/main/java/com/edufound/reader/activity/MessageActivity.java

@@ -0,0 +1,89 @@
+package com.edufound.reader.activity;
+
+import android.app.Activity;
+import android.view.ViewGroup;
+import android.widget.FrameLayout;
+import android.widget.ImageView;
+import android.widget.Toast;
+
+import com.edufound.reader.R;
+import com.edufound.reader.annotation.BindView;
+import com.edufound.reader.base.BaseActivity;
+import com.edufound.reader.base.BaseMvpActivity;
+import com.edufound.reader.contract.MessageContract;
+import com.edufound.reader.presenter.MessagePresenter;
+
+import androidx.recyclerview.widget.RecyclerView;
+
+public class MessageActivity extends BaseMvpActivity<MessagePresenter> implements MessageContract.View {
+
+
+    Activity mActivity;
+    @BindView(id = R.id.message_recyclerview)
+    RecyclerView mRecyclerView;
+
+    @BindView(id = R.id.activity_message_readall)
+    FrameLayout mReadAll;
+
+    @BindView(id = R.id.activity_message_back)
+    ImageView mBack;
+
+    @Override
+    public int getLayoutId() {
+        return R.layout.activity_message;
+    }
+
+    @Override
+    public void initView() {
+        mActivity = this;
+        mPresenter = new MessagePresenter();
+        mPresenter.attachView(this);
+        mPresenter.initRecyclerView(mRecyclerView);
+        addUiClickListener(mBack, o -> {
+            mActivity.finish();
+        });
+        addUiClickListener(mReadAll, o -> {
+            Toast.makeText(mActivity, "全部已读", Toast.LENGTH_SHORT).show();
+        });
+    }
+
+    @Override
+    public void onDisconnect() {
+
+    }
+
+    @Override
+    public void onMobileConnect() {
+
+    }
+
+    @Override
+    public void onWifiConnect() {
+
+    }
+
+    @Override
+    public void showLoading() {
+
+    }
+
+    @Override
+    public void hideLoading() {
+
+    }
+
+    @Override
+    public void onError(String errMessage) {
+
+    }
+
+    @Override
+    public Activity getActivity() {
+        return mActivity;
+    }
+
+    @Override
+    public ViewGroup getRootView() {
+        return findViewById(android.R.id.content);
+    }
+}

+ 83 - 0
app/src/main/java/com/edufound/reader/activity/MyCollectionActivity.java

@@ -0,0 +1,83 @@
+package com.edufound.reader.activity;
+
+import android.app.Activity;
+import android.os.Build;
+import android.view.ViewGroup;
+import android.widget.ImageView;
+
+import com.edufound.reader.R;
+import com.edufound.reader.annotation.BindView;
+import com.edufound.reader.base.BaseActivity;
+import com.edufound.reader.base.BaseMvpActivity;
+import com.edufound.reader.contract.MyCollectionContract;
+import com.edufound.reader.presenter.MyCollectionPresenter;
+
+import androidx.annotation.RequiresApi;
+import androidx.recyclerview.widget.RecyclerView;
+
+public class MyCollectionActivity extends BaseMvpActivity<MyCollectionPresenter> implements MyCollectionContract.View {
+
+
+    Activity mActivity;
+    @BindView(id = R.id.mycollection_recyclearview)
+    RecyclerView mRecyclerView;
+    @BindView(id = R.id.activity_mycollection_back)
+    ImageView mBack;
+
+
+    @Override
+    public int getLayoutId() {
+        return R.layout.activity_mycollection;
+    }
+
+    @Override
+    public void initView() {
+        mActivity = this;
+        mPresenter = new MyCollectionPresenter();
+        mPresenter.attachView(this);
+        mPresenter.initRecyclerView(mRecyclerView);
+        addUiClickListener(mBack, o -> {
+            mActivity.finish();
+        });
+    }
+
+    @Override
+    public void onDisconnect() {
+
+    }
+
+    @Override
+    public void onMobileConnect() {
+
+    }
+
+    @Override
+    public void onWifiConnect() {
+
+    }
+
+    @Override
+    public void showLoading() {
+
+    }
+
+    @Override
+    public void hideLoading() {
+
+    }
+
+    @Override
+    public void onError(String errMessage) {
+
+    }
+
+    @Override
+    public Activity getActivity() {
+        return mActivity;
+    }
+
+    @Override
+    public ViewGroup getRootView() {
+        return findViewById(android.R.id.content);
+    }
+}

+ 83 - 0
app/src/main/java/com/edufound/reader/activity/MyFollowActivity.java

@@ -0,0 +1,83 @@
+package com.edufound.reader.activity;
+
+import android.app.Activity;
+import android.view.ViewGroup;
+import android.widget.ImageView;
+
+import com.edufound.reader.R;
+import com.edufound.reader.annotation.BindView;
+import com.edufound.reader.base.BaseActivity;
+import com.edufound.reader.base.BaseMvpActivity;
+import com.edufound.reader.contract.MyCollectionContract;
+import com.edufound.reader.contract.MyFollowContract;
+import com.edufound.reader.presenter.MyCollectionPresenter;
+import com.edufound.reader.presenter.MyFollowPresenter;
+
+import androidx.recyclerview.widget.RecyclerView;
+
+public class MyFollowActivity extends BaseMvpActivity<MyFollowPresenter> implements MyFollowContract.View {
+
+
+    Activity mActivity;
+    @BindView(id = R.id.myfollow_recyclearview)
+    RecyclerView mRecyclerView;
+    @BindView(id = R.id.activity_myfollow_back)
+    ImageView mBack;
+
+
+    @Override
+    public int getLayoutId() {
+        return R.layout.activity_myfollow;
+    }
+
+    @Override
+    public void initView() {
+        mActivity = this;
+        mPresenter = new MyFollowPresenter();
+        mPresenter.attachView(this);
+        mPresenter.initRecyclerView(mRecyclerView);
+        addUiClickListener(mBack, o -> {
+            mActivity.finish();
+        });
+    }
+
+    @Override
+    public void onDisconnect() {
+
+    }
+
+    @Override
+    public void onMobileConnect() {
+
+    }
+
+    @Override
+    public void onWifiConnect() {
+
+    }
+
+    @Override
+    public void showLoading() {
+
+    }
+
+    @Override
+    public void hideLoading() {
+
+    }
+
+    @Override
+    public void onError(String errMessage) {
+
+    }
+
+    @Override
+    public Activity getActivity() {
+        return mActivity;
+    }
+
+    @Override
+    public ViewGroup getRootView() {
+        return findViewById(android.R.id.content);
+    }
+}

+ 118 - 0
app/src/main/java/com/edufound/reader/activity/OthersRecordActivity.java

@@ -0,0 +1,118 @@
+package com.edufound.reader.activity;
+
+import android.app.Activity;
+import android.graphics.Rect;
+import android.os.Build;
+import android.view.View;
+import android.widget.FrameLayout;
+import android.widget.GridLayout;
+import android.widget.HorizontalScrollView;
+import android.widget.ImageView;
+import android.widget.Space;
+
+import com.edufound.reader.R;
+import com.edufound.reader.annotation.BindView;
+import com.edufound.reader.base.BaseMvpActivity;
+import com.edufound.reader.contract.OthersRecordContract;
+import com.edufound.reader.presenter.OthersRecordPresenter;
+import com.edufound.reader.util.Consts;
+
+import androidx.annotation.RequiresApi;
+import io.reactivex.rxjava3.functions.Consumer;
+
+public class OthersRecordActivity extends BaseMvpActivity<OthersRecordPresenter> implements OthersRecordContract.View {
+
+
+    Activity mActivity;
+    @BindView(id = R.id.activity_otherrecord_gridlayout)
+    GridLayout mGridLayout;
+
+    @BindView(id = R.id.activity_otherrecord_norecord)
+    FrameLayout mNoRecordLayout;
+    @BindView(id = R.id.activity_otherrecord_bottomview)
+    Space mBottomView;
+    @BindView(id = R.id.activity_otherrecord_scroll)
+    HorizontalScrollView mScrollView;
+    @BindView(id = R.id.activity_otherrecord_back)
+    ImageView mBack;
+    Rect mScreenRect;
+    boolean isNeedLoad = false;
+
+    @Override
+    public int getLayoutId() {
+        return R.layout.activity_otherrecord;
+    }
+
+    @RequiresApi(api = Build.VERSION_CODES.M)
+    @Override
+    public void initView() {
+        mActivity = this;
+        mPresenter = new OthersRecordPresenter();
+        mPresenter.attachView(this);
+        mScreenRect = new Rect(0, 0, Consts.getScreenSize()[0], Consts.getScreenSize()[1]);
+
+        mScrollView.setOnScrollChangeListener(new View.OnScrollChangeListener() {
+            @Override
+            public void onScrollChange(View view, int x, int y, int oldx, int oldy) {
+                if (mBottomView.getLocalVisibleRect(mScreenRect)) {
+                    if (isNeedLoad) {
+                        isNeedLoad = false;
+                        mPresenter.initGridLayout(mGridLayout, mNoRecordLayout);
+                    }
+                } else {
+                    isNeedLoad = true;
+                }
+            }
+        });
+        mPresenter.initGridLayout(mGridLayout, mNoRecordLayout);
+        addUiClick(mBack, o -> {
+            mActivity.finish();
+        });
+    }
+
+    @Override
+    public void onDisconnect() {
+
+    }
+
+    @Override
+    public void onMobileConnect() {
+
+    }
+
+    @Override
+    public void onWifiConnect() {
+
+    }
+
+    @Override
+    public void showLoading() {
+
+    }
+
+    @Override
+    public void hideLoading() {
+
+    }
+
+    @Override
+    public void onError(String errMessage) {
+
+    }
+
+    @Override
+    public Activity getActivity() {
+        return mActivity;
+    }
+
+    @Override
+    public void addUiClick(View view, Consumer onNext) {
+        addUiClickListener(view, onNext);
+    }
+
+    @Override
+    protected void onDestroy() {
+        super.onDestroy();
+        mPresenter.onDestory(mGridLayout);
+    }
+}

+ 82 - 0
app/src/main/java/com/edufound/reader/activity/PayActivity.java

@@ -0,0 +1,82 @@
+package com.edufound.reader.activity;
+
+import android.app.Activity;
+import android.view.ViewGroup;
+import android.widget.ImageView;
+import android.widget.Toast;
+
+import com.edufound.reader.R;
+import com.edufound.reader.annotation.BindView;
+import com.edufound.reader.base.BaseActivity;
+import com.edufound.reader.base.BaseMvpActivity;
+import com.edufound.reader.contract.PayContract;
+import com.edufound.reader.presenter.PayPresenter;
+
+public class PayActivity extends BaseMvpActivity<PayPresenter> implements PayContract.View {
+
+    Activity mActivity;
+
+    @BindView(id = R.id.activity_pay_tomyorder)
+    ImageView mToMyOrder;
+
+    @BindView(id = R.id.activity_pay_back)
+    ImageView mBack;
+
+    @Override
+    public int getLayoutId() {
+        return R.layout.activity_pay;
+    }
+
+    @Override
+    public void initView() {
+        mActivity = this;
+        mPresenter = new PayPresenter();
+        mPresenter.attachView(this);
+        addUiClickListener(mBack, o -> {
+            mActivity.finish();
+        });
+        addUiClickListener(mToMyOrder, o -> {
+            Toast.makeText(mActivity, "to my order", Toast.LENGTH_SHORT).show();
+        });
+    }
+
+    @Override
+    public void onDisconnect() {
+
+    }
+
+    @Override
+    public void onMobileConnect() {
+
+    }
+
+    @Override
+    public void onWifiConnect() {
+
+    }
+
+    @Override
+    public void showLoading() {
+
+    }
+
+    @Override
+    public void hideLoading() {
+
+    }
+
+    @Override
+    public void onError(String errMessage) {
+
+    }
+
+    @Override
+    public Activity getActivity() {
+        return mActivity;
+    }
+
+    @Override
+    public ViewGroup getRootView() {
+        return findViewById(android.R.id.content);
+    }
+}

+ 23 - 10
app/src/main/java/com/edufound/reader/activity/VideoActivity.java

@@ -1,23 +1,25 @@
 package com.edufound.reader.activity;
 
 import android.app.Activity;
+import android.view.ViewGroup;
 import android.widget.FrameLayout;
+import android.widget.ImageView;
 
 import com.edufound.reader.R;
 import com.edufound.reader.annotation.BindView;
 import com.edufound.reader.base.BaseMvpActivity;
-import com.edufound.reader.contract.VideoContract;
-import com.edufound.reader.presenter.VideoPresenter;
+import com.edufound.reader.contract.RecordContract;
+import com.edufound.reader.presenter.RecordPresenter;
 
-import tv.danmaku.ijk.media.player.IjkMediaPlayer;
-
-public class VideoActivity extends BaseMvpActivity<VideoPresenter> implements VideoContract.View {
+public class RecordActivity extends BaseMvpActivity<RecordPresenter> implements RecordContract.View {
 
     Activity mActivity;
 
     @BindView(id = R.id.player_frame)
     FrameLayout mPlayerFrame;
 
+    @BindView(id = R.id.activity_record_back)
+    ImageView mBack;
 
     @Override
     public int getLayoutId() {
@@ -26,19 +28,20 @@ public class VideoActivity extends BaseMvpActivity<VideoPresenter> implements Vi
 
     @Override
     public void initView() {
-        mPresenter = new VideoPresenter();
+        mPresenter = new RecordPresenter();
         mPresenter.attachView(this);
         mActivity = this;
-        IjkMediaPlayer.loadLibrariesOnce(null);
-        IjkMediaPlayer.native_profileBegin("libijkplayer.so");
         mPresenter.createVideoPlayer(mPlayerFrame);
-        mPresenter.addVideoController(mPlayerFrame);
+//        mPresenter.addVideoController(mPlayerFrame);
         mPresenter.initVideoPlayer(getIntent());
+        addUiClickListener(mBack, o -> {
+            mActivity.finish();
+        });
     }
 
     @Override
     public void onDisconnect() {
-        
+
     }
 
     @Override
@@ -52,6 +55,11 @@ public class VideoActivity extends BaseMvpActivity<VideoPresenter> implements Vi
     }
 
     @Override
+    public void onLoginSuccess() {
+
+    }
+
+    @Override
     public void showLoading() {
 
     }
@@ -88,4 +96,9 @@ public class VideoActivity extends BaseMvpActivity<VideoPresenter> implements Vi
         super.onResume();
         mPresenter.activityResume();
     }
+
+    @Override
+    public ViewGroup getRootView() {
+        return findViewById(android.R.id.content);
+    }
 }

+ 104 - 0
app/src/main/java/com/edufound/reader/activity/SmallFullVideoActivity.java

@@ -0,0 +1,104 @@
+package com.edufound.reader.activity;
+
+import android.app.Activity;
+import android.view.KeyEvent;
+import android.widget.FrameLayout;
+import android.widget.ImageView;
+import android.widget.Toast;
+
+import com.edufound.reader.R;
+import com.edufound.reader.annotation.BindView;
+import com.edufound.reader.base.BaseMvpActivity;
+import com.edufound.reader.contract.SmallFullVideoContract;
+import com.edufound.reader.presenter.SmallFullVideoPresenter;
+import com.orhanobut.logger.Logger;
+
+import cn.jzvd.Jzvd;
+import cn.jzvd.JzvdStd;
+
+public class SmallFullVideoActivity extends BaseMvpActivity<SmallFullVideoPresenter> implements SmallFullVideoContract.View {
+
+
+    Activity mActivity;
+
+
+    @BindView(id = R.id.activity_smallfull_video_back)
+    ImageView mBack;
+
+    @Override
+    public int getLayoutId() {
+        return R.layout.activity_smallfull_video;
+    }
+
+    @Override
+    public void initView() {
+        mActivity = this;
+        mPresenter = new SmallFullVideoPresenter(getSupportFragmentManager());
+        mPresenter.attachView(this);
+        addUiClickListener(mBack, o -> {
+            mActivity.finish();
+        });
+        int index = Integer.valueOf(getIntent().getStringExtra("index"));
+        Toast.makeText(getActivity(), "index:" + index, Toast.LENGTH_SHORT).show();
+        mPresenter.initFragment(index);
+    }
+
+    @Override
+    public void onDisconnect() {
+
+    }
+
+    @Override
+    public void onMobileConnect() {
+
+    }
+
+    @Override
+    public void onWifiConnect() {
+
+    }
+
+    @Override
+    public void showLoading() {
+
+    }
+
+    @Override
+    public void hideLoading() {
+
+    }
+
+    @Override
+    public void onError(String errMessage) {
+
+    }
+
+    @Override
+    public Activity getActivity() {
+        return mActivity;
+    }
+
+    @Override
+    public boolean onKeyDown(int keyCode, KeyEvent event) {
+        return mPresenter.onKeyDown(keyCode, event);
+    }
+
+    @Override
+    protected void onDestroy() {
+        super.onDestroy();
+    }
+
+    @Override
+    public void onBackPressed() {
+    }
+
+    @Override
+    protected void onPause() {
+        super.onPause();
+    }
+
+    @Override
+    protected void onResume() {
+        super.onResume();
+    }
+}

+ 93 - 0
app/src/main/java/com/edufound/reader/activity/UserInfoSettingActivity.java

@@ -0,0 +1,93 @@
+package com.edufound.reader.activity;
+
+import android.app.Activity;
+import android.content.Intent;
+import android.widget.ImageView;
+import android.widget.LinearLayout;
+
+import com.edufound.reader.R;
+import com.edufound.reader.annotation.BindView;
+import com.edufound.reader.base.BaseMvpActivity;
+import com.edufound.reader.contract.UserInfoSettingContract;
+import com.edufound.reader.popwindow.PopWindowUtil;
+import com.edufound.reader.presenter.UserInfoSettingPresenter;
+import com.edufound.reader.util.Consts;
+
+public class UserInfoSettingActivity extends BaseMvpActivity<UserInfoSettingPresenter> implements UserInfoSettingContract.View {
+
+
+    Activity mActivity;
+    @BindView(id = R.id.activity_userinfo_setting_back)
+    ImageView mBack;
+
+    @BindView(id = R.id.activity_userinfo_setting_loginout_layout)
+    LinearLayout mLoginOut;
+
+    @BindView(id = R.id.activity_userinfo_setting_privservices_layout)
+    LinearLayout mPrivServices;
+    @BindView(id = R.id.activity_userinfo_setting_services_layout)
+    LinearLayout mAgreementServices;
+
+    @Override
+    public int getLayoutId() {
+        return R.layout.activity_userinfo_setting;
+    }
+
+    @Override
+    public void initView() {
+        mActivity = this;
+        mPresenter = new UserInfoSettingPresenter();
+        mPresenter.attachView(this);
+        addUiClickListener(mBack, o -> {
+            mActivity.finish();
+        });
+        addUiClickListener(mLoginOut, o -> {
+            PopWindowUtil.showExitLoginWindow(mActivity, getRootView());
+        });
+        addUiClickListener(mPrivServices, o -> {
+            Intent intent = new Intent(getActivity(), WebActivity.class);
+            intent.putExtra("loadUrl", Consts.getPrivServiceUrl());
+            getActivity().startActivity(intent);
+        });
+        addUiClickListener(mAgreementServices, o -> {
+            Intent intent = new Intent(getActivity(), WebActivity.class);
+            intent.putExtra("loadUrl", Consts.getAgreementServicesUrl());
+            getActivity().startActivity(intent);
+        });
+    }
+
+    @Override
+    public void onDisconnect() {
+
+    }
+
+    @Override
+    public void onMobileConnect() {
+
+    }
+
+    @Override
+    public void onWifiConnect() {
+
+    }
+
+    @Override
+    public void showLoading() {
+
+    }
+
+    @Override
+    public void hideLoading() {
+
+    }
+
+    @Override
+    public void onError(String errMessage) {
+
+    }
+
+    @Override
+    public Activity getActivity() {
+        return mActivity;
+    }
+}

+ 81 - 0
app/src/main/java/com/edufound/reader/activity/WebActivity.java

@@ -0,0 +1,81 @@
+package com.edufound.reader.activity;
+
+import android.app.Activity;
+import android.os.Process;
+import android.view.ViewGroup;
+import android.webkit.WebView;
+import android.widget.FrameLayout;
+import android.widget.ImageView;
+
+import com.edufound.reader.R;
+import com.edufound.reader.annotation.BindView;
+import com.edufound.reader.base.BaseMvpActivity;
+import com.edufound.reader.contract.WebContract;
+import com.edufound.reader.presenter.WebPresenter;
+import com.edufound.reader.util.Consts;
+
+public class WebActivity extends BaseMvpActivity<WebPresenter> implements WebContract.View {
+
+
+    @BindView(id = R.id.web_back)
+    ImageView mBack;
+
+    @BindView(id = R.id.web_frame)
+    FrameLayout mWebFrame;
+
+    @Override
+    public int getLayoutId() {
+        return R.layout.activity_web;
+    }
+
+    @Override
+    public void initView() {
+        mPresenter = new WebPresenter();
+        mPresenter.attachView(this);
+        mWebFrame.addView(mPresenter.initWebView(getIntent()));
+        addUiClickListener(mBack, o -> {
+            android.os.Process.killProcess(Process.myPid());
+            finish();
+        });
+    }
+
+    @Override
+    public void onDisconnect() {
+
+    }
+
+    @Override
+    public void onMobileConnect() {
+
+    }
+
+    @Override
+    public void onWifiConnect() {
+
+    }
+
+    @Override
+    public void showLoading() {
+
+    }
+
+    @Override
+    public void hideLoading() {
+
+    }
+
+    @Override
+    public void onError(String errMessage) {
+
+    }
+
+    @Override
+    public Activity getActivity() {
+        return null;
+    }
+
+    @Override
+    public ViewGroup getRootView() {
+        return findViewById(android.R.id.content);
+    }
+}

+ 86 - 0
app/src/main/java/com/edufound/reader/adapter/MessageItemAdapter.java

@@ -0,0 +1,86 @@
+package com.edufound.reader.adapter;
+
+import android.content.Context;
+import android.view.LayoutInflater;
+import android.view.View;
+import android.view.ViewGroup;
+import android.widget.ImageView;
+import android.widget.TextView;
+
+import com.edufound.reader.R;
+import com.edufound.reader.util.GlideUtils;
+
+import java.util.List;
+
+import androidx.annotation.NonNull;
+import androidx.recyclerview.widget.RecyclerView;
+
+public class MessageItemAdapter extends RecyclerView.Adapter<RecyclerView.ViewHolder> {
+
+    private LayoutInflater mLayoutInflater;
+    private Context mContext;
+    private List<Object> mListData;
+
+    public MessageItemAdapter(Context context, List<Object> listData) {
+        mContext = context;
+        mLayoutInflater = LayoutInflater.from(context);
+        mListData = listData;
+
+
+    }
+
+    public void addMored(List<Object> listData) {
+        mListData = listData;
+    }
+
+    @Override
+    public int getItemViewType(int position) {
+        return position;
+    }
+
+    @NonNull
+    @Override
+    public RecyclerView.ViewHolder onCreateViewHolder(@NonNull ViewGroup parent, int viewType) {
+        return new MessageItemHolder(mLayoutInflater.inflate(R.layout.adapter_item_message, parent, false));
+
+    }
+
+    @Override
+    public void onBindViewHolder(@NonNull RecyclerView.ViewHolder holder, int position) {
+        ((MessageItemHolder) holder).mItemTime.setText(String.valueOf(mListData.get(position)));
+        if (((MessageItemHolder) holder).mItemLoadAll.getVisibility() == View.VISIBLE) {
+            ((MessageItemHolder) holder).mItemContent.setText(((MessageItemHolder) holder).mItemContent.getText().toString().substring(0, 55));
+        }
+        ((MessageItemHolder) holder).mItemLoadAll.setOnClickListener(new View.OnClickListener() {
+            @Override
+            public void onClick(View view) {
+                view.setVisibility(View.INVISIBLE);
+                ((MessageItemHolder) holder).mItemContent.setText(((MessageItemHolder) holder).mItemContent.getText() + "--" + ((MessageItemHolder) holder).mItemContent.getText());
+            }
+        });
+    }
+
+    @Override
+    public int getItemCount() {
+        return mListData.size();
+    }
+}
+
+
+class MessageItemHolder extends RecyclerView.ViewHolder {
+
+    ImageView mItemIsNew;
+    TextView mItemTime;
+    TextView mItemContent;
+    TextView mItemLoadAll;
+
+    public MessageItemHolder(@NonNull View itemView) {
+        super(itemView);
+        mItemIsNew = itemView.findViewById(R.id.adapter_item_message_isnew);
+        mItemTime = itemView.findViewById(R.id.adapter_item_message_time);
+        mItemContent = itemView.findViewById(R.id.adapter_item_message_content);
+        mItemLoadAll = itemView.findViewById(R.id.adapter_item_message_loadall);
+    }
+}
+
+

+ 108 - 0
app/src/main/java/com/edufound/reader/adapter/MyCollectionItemAdapter.java

@@ -0,0 +1,108 @@
+package com.edufound.reader.adapter;
+
+import android.annotation.SuppressLint;
+import android.content.Context;
+import android.view.LayoutInflater;
+import android.view.View;
+import android.view.ViewGroup;
+import android.widget.ImageView;
+import android.widget.TextView;
+import android.widget.Toast;
+
+import com.edufound.reader.R;
+import com.edufound.reader.util.GlideUtils;
+
+import java.util.List;
+
+import androidx.annotation.NonNull;
+import androidx.recyclerview.widget.RecyclerView;
+
+public class MyCollectionItemAdapter extends RecyclerView.Adapter<RecyclerView.ViewHolder> {
+
+    public static final int ITEM_TYPE_HEADER = 0;
+    public static final int ITEM_TYPE_CONTENT = 1;
+    public static final int ITEM_TYPE_BOTTOM = 2;
+    private LayoutInflater mLayoutInflater;
+    private Context mContext;
+    private List<Object> mListData;
+
+    public MyCollectionItemAdapter(Context context, List<Object> listData) {
+        mContext = context;
+        mLayoutInflater = LayoutInflater.from(context);
+        mListData = listData;
+
+
+    }
+
+    public void addMored(List<Object> listData) {
+        mListData = listData;
+    }
+
+    @Override
+    public int getItemViewType(int position) {
+        return position;
+    }
+
+    @NonNull
+    @Override
+    public RecyclerView.ViewHolder onCreateViewHolder(@NonNull ViewGroup parent, int viewType) {
+        return new MyCollectionItemHolder(mLayoutInflater.inflate(R.layout.adapter_item_record_authority, parent, false));
+
+    }
+
+    @Override
+    public void onBindViewHolder(@NonNull RecyclerView.ViewHolder holder, @SuppressLint("RecyclerView") int position) {
+        ((MyCollectionItemHolder) holder).mItemName.setText(String.valueOf(mListData.get(position)));
+        GlideUtils.loadImage(mContext, "http://p.qpic.cn/videoyun/0/2449_43b6f696980311e59ed467f22794e792_1/640", ((MyCollectionItemHolder) holder).mItemIcon);
+        ((MyCollectionItemHolder) holder).mItemView.setOnClickListener(new View.OnClickListener() {
+            @Override
+            public void onClick(View view) {
+                Toast.makeText(mContext, "click :" + position, Toast.LENGTH_SHORT).show();
+            }
+        });
+    }
+
+    @Override
+    public int getItemCount() {
+        return mListData.size();
+    }
+}
+
+
+class MyCollectionItemHolder extends RecyclerView.ViewHolder {
+
+    View mItemView;
+    ImageView mItemIcon;
+    TextView mItemName;
+    TextView mLookNum;
+    TextView mThumbNum;
+    TextView mCommentNum;
+    TextView mStartNum;
+
+    public MyCollectionItemHolder(@NonNull View itemView) {
+        super(itemView);
+        mItemView = itemView;
+        mItemIcon = itemView.findViewById(R.id.adapter_item_record_authority_icon);
+        mItemName = itemView.findViewById(R.id.adapter_item_record_authority_name);
+        mLookNum = itemView.findViewById(R.id.adapter_item_record_authority_look_num);
+        mThumbNum = itemView.findViewById(R.id.adapter_item_record_authority_thumb_num);
+        mCommentNum = itemView.findViewById(R.id.adapter_item_record_authority_comment_num);
+        mStartNum = itemView.findViewById(R.id.adapter_item_record_authority_start_num);
+
+    }
+}
+
+class MyCollectionHeaderViewHolder extends RecyclerView.ViewHolder {
+
+    public MyCollectionHeaderViewHolder(@NonNull View itemView) {
+        super(itemView);
+    }
+}
+
+class MyCollectionBottomViewHolder extends RecyclerView.ViewHolder {
+
+    public MyCollectionBottomViewHolder(@NonNull View itemView) {
+        super(itemView);
+    }
+}
+

+ 38 - 37
app/src/main/java/com/edufound/reader/adapter/RecordItemAdapter.java

@@ -1,23 +1,25 @@
 package com.edufound.reader.adapter;
 
+import android.annotation.SuppressLint;
 import android.content.Context;
+import android.content.Intent;
 import android.view.LayoutInflater;
 import android.view.View;
 import android.view.ViewGroup;
 import android.widget.ImageView;
 import android.widget.TextView;
+import android.widget.Toast;
 
 import com.edufound.reader.R;
-import com.edufound.reader.bean.SlideVideoBean;
-import com.jakewharton.rxbinding4.widget.RxTextView;
-import com.orhanobut.logger.Logger;
+import com.edufound.reader.activity.OthersRecordActivity;
+import com.edufound.reader.util.GlideUtils;
 
 import java.util.List;
 
 import androidx.annotation.NonNull;
 import androidx.recyclerview.widget.RecyclerView;
 
-public class RecordItemAdapter extends RecyclerView.Adapter<RecyclerView.ViewHolder> {
+public class MyFollowItemAdapter extends RecyclerView.Adapter<RecyclerView.ViewHolder> {
 
     public static final int ITEM_TYPE_HEADER = 0;
     public static final int ITEM_TYPE_CONTENT = 1;
@@ -26,9 +28,9 @@ public class RecordItemAdapter extends RecyclerView.Adapter<RecyclerView.ViewHol
     private Context mContext;
     private List<Object> mListData;
     private int mHeaderCount = 0;//头部View个数
-    private int mBottomCount = 1;//底部View个数
+    private int mBottomCount = 0;//底部View个数
 
-    public RecordItemAdapter(Context context, List<Object> listData) {
+    public MyFollowItemAdapter(Context context, List<Object> listData) {
         mContext = context;
         mLayoutInflater = LayoutInflater.from(context);
         mListData = listData;
@@ -40,6 +42,7 @@ public class RecordItemAdapter extends RecyclerView.Adapter<RecyclerView.ViewHol
         mListData.addAll(listData);
     }
 
+
     //判断当前item是否是HeadView
     public boolean isHeaderView(int position) {
         return mHeaderCount != 0 && position < mHeaderCount;
@@ -78,22 +81,31 @@ public class RecordItemAdapter extends RecyclerView.Adapter<RecyclerView.ViewHol
         if (viewType == ITEM_TYPE_HEADER) {
 //            return new HeaderViewHolder(mLayoutInflater.inflate(R.layout.fragment_user_rv_header, parent, false));
         } else if (viewType == ITEM_TYPE_CONTENT) {
-            return new RecordItemHolder(mLayoutInflater.inflate(R.layout.adapter_item_record, parent, false));
+            return new MyFollowItemHolder(mLayoutInflater.inflate(R.layout.adapter_item_myfollow, parent, false));
         } else if (viewType == ITEM_TYPE_BOTTOM) {
-            return new BottomViewHolder(mLayoutInflater.inflate(R.layout.fragment_user_rv_bottom, parent, false));
+//            return new BottomViewHolder(mLayoutInflater.inflate(R.layout.fragment_user_rv_bottom, parent, false));
         }
         return null;
 
     }
 
     @Override
-    public void onBindViewHolder(@NonNull RecyclerView.ViewHolder holder, int position) {
-        if (holder instanceof HeaderViewHolder) {
-
-        } else if (holder instanceof RecordItemHolder) {
-            ((RecordItemHolder) holder).mItemName.setText(String.valueOf(mListData.get(position - mHeaderCount)));
-
-        } else if (holder instanceof BottomViewHolder) {
+    public void onBindViewHolder(@NonNull RecyclerView.ViewHolder holder, @SuppressLint("RecyclerView") int position) {
+        if (holder instanceof MyCollectionHeaderViewHolder) {
+
+        } else if (holder instanceof MyFollowItemHolder) {
+            ((MyFollowItemHolder) holder).mItemName.setText(String.valueOf(mListData.get(position - mHeaderCount)));
+            ((MyFollowItemHolder) holder).mItemView.setOnClickListener(new View.OnClickListener() {
+                @Override
+                public void onClick(View view) {
+                    Toast.makeText(mContext, "click:" + position, Toast.LENGTH_SHORT).show();
+                    Intent intent = new Intent(mContext, OthersRecordActivity.class);
+                    intent.putExtra("userId", position);
+                    mContext.startActivity(intent);
+                }
+            });
+
+        } else if (holder instanceof MyCollectionBottomViewHolder) {
 
         }
     }
@@ -105,41 +117,30 @@ public class RecordItemAdapter extends RecyclerView.Adapter<RecyclerView.ViewHol
 }
 
 
-class RecordItemHolder extends RecyclerView.ViewHolder {
+class MyFollowItemHolder extends RecyclerView.ViewHolder {
 
-    ImageView mItemIcon;
+    View mItemView;
     TextView mItemName;
-    ImageView mItemDel;
-    ImageView mItemPriv;
-    TextView mLookNum;
-    TextView mThumbNum;
-    TextView mCommentNum;
-    TextView mStartNum;
-
-    public RecordItemHolder(@NonNull View itemView) {
+
+
+    public MyFollowItemHolder(@NonNull View itemView) {
         super(itemView);
-        mItemIcon = itemView.findViewById(R.id.adapter_item_record_icon);
-        mItemName = itemView.findViewById(R.id.adapter_item_record_name);
-        mItemDel = itemView.findViewById(R.id.adapter_item_record_del);
-        mItemPriv = itemView.findViewById(R.id.adapter_item_record_priv);
-        mLookNum = itemView.findViewById(R.id.adapter_item_record_look_num);
-        mThumbNum = itemView.findViewById(R.id.adapter_item_record_thumb_num);
-        mCommentNum = itemView.findViewById(R.id.adapter_item_record_comment_num);
-        mStartNum = itemView.findViewById(R.id.adapter_item_record_start_num);
+        mItemView = itemView;
+        mItemName = itemView.findViewById(R.id.adapter_item_myfollow_name);
 
     }
 }
 
-class HeaderViewHolder extends RecyclerView.ViewHolder {
+class MyFollowHeaderViewHolder extends RecyclerView.ViewHolder {
 
-    public HeaderViewHolder(@NonNull View itemView) {
+    public MyFollowHeaderViewHolder(@NonNull View itemView) {
         super(itemView);
     }
 }
 
-class BottomViewHolder extends RecyclerView.ViewHolder {
+class MyFollowBottomViewHolder extends RecyclerView.ViewHolder {
 
-    public BottomViewHolder(@NonNull View itemView) {
+    public MyFollowBottomViewHolder(@NonNull View itemView) {
         super(itemView);
     }
 }

+ 4 - 0
app/src/main/java/com/edufound/reader/adapter/SlideVideoAdapter.java

@@ -80,6 +80,10 @@ public class SlideVideoAdapter extends RecyclerView.Adapter<VideoHolder> {
     }
 
 
+    @Override
+    public int getItemViewType(int position) {
+        return position;
+    }
 }
 
 class VideoHolder extends RecyclerView.ViewHolder {

+ 61 - 1
app/src/main/java/com/edufound/reader/base/BaseActivity.java

@@ -1,15 +1,27 @@
 package com.edufound.reader.base;
 
+import android.animation.Animator;
+import android.animation.AnimatorListenerAdapter;
+import android.animation.AnimatorSet;
+import android.animation.ObjectAnimator;
 import android.annotation.SuppressLint;
 import android.app.Activity;
+import android.content.BroadcastReceiver;
+import android.content.Context;
 import android.content.Intent;
 import android.content.IntentFilter;
 import android.os.Build;
 import android.os.Bundle;
 import android.util.DisplayMetrics;
+import android.view.Gravity;
+import android.view.LayoutInflater;
 import android.view.View;
+import android.view.ViewGroup;
 import android.view.WindowManager;
+import android.view.animation.LinearInterpolator;
+import android.widget.FrameLayout;
 
+import com.edufound.reader.R;
 import com.edufound.reader.annotation.BindView;
 import com.edufound.reader.receiver.HomeKeyEventReceiver;
 import com.edufound.reader.receiver.NetworkChangeReceiver;
@@ -35,6 +47,8 @@ public abstract class BaseActivity extends AppCompatActivity {
     public CompositeDisposable mCompositeDisposable;
     //按home键的receiver
     HomeKeyEventReceiver mHomeReceiver;
+    //登录广播action
+    private final String LOGIN_SUCCESS_ACTION = "efunbox.login.success";
 
     @Override
     protected void onCreate(@Nullable Bundle savedInstanceState) {
@@ -65,9 +79,12 @@ public abstract class BaseActivity extends AppCompatActivity {
         }
         mCompositeDisposable = new CompositeDisposable();
         mHomeReceiver = new HomeKeyEventReceiver();
+        //注册home广播
         registerReceiver(mHomeReceiver, new IntentFilter(Intent.ACTION_CLOSE_SYSTEM_DIALOGS));
-        // 注册
+        // 注册网络广播
         NetworkChangeReceiver.registerObserver(NetStateChangeObserver);
+        //注册登录广播
+        registerReceiver(loginReceiver, new IntentFilter(LOGIN_SUCCESS_ACTION));
     }
 
 
@@ -180,4 +197,47 @@ public abstract class BaseActivity extends AppCompatActivity {
     };
 
 
+    protected void onLoginSuccess() {
+    }
+
+
+    BroadcastReceiver loginReceiver = new BroadcastReceiver() {
+        @Override
+        public void onReceive(Context context, Intent intent) {
+            onLoginSuccess();
+        }
+    };
+
+
+    public ViewGroup getRootView() {
+        return findViewById(android.R.id.content);
+    }
+
+
+    public void showFollowCountAnim() {
+        View mFollowView = LayoutInflater.from(this).inflate(R.layout.anim_getfollow, null);
+        FrameLayout.LayoutParams params = new FrameLayout.LayoutParams(ViewGroup.LayoutParams.WRAP_CONTENT, ViewGroup.LayoutParams.WRAP_CONTENT);
+        params.gravity = Gravity.CENTER;
+        mFollowView.setLayoutParams(params);
+        ObjectAnimator mRotationImgAnim = ObjectAnimator.ofFloat(mFollowView, "translationY", 0, -150);
+        mRotationImgAnim.setDuration(1500);
+        LinearInterpolator interpolator = new LinearInterpolator();
+        mRotationImgAnim.setInterpolator(interpolator); //设置匀速旋转,不卡顿 icon_anim.start();
+        ObjectAnimator alphaAnim = ObjectAnimator.ofFloat(mFollowView, "alpha", 1f, 0f);
+        alphaAnim.setDuration(1500);
+        getRootView().addView(mFollowView);
+        AnimatorSet animatorSet = new AnimatorSet();
+        animatorSet.play(mRotationImgAnim).with(alphaAnim);
+        animatorSet.addListener(new AnimatorListenerAdapter() {
+            @Override
+            public void onAnimationEnd(Animator animation) {
+                super.onAnimationEnd(animation);
+                getRootView().removeView(mFollowView);
+            }
+        });
+        animatorSet.start();
+//
+    }
+
+
 }

+ 16 - 0
app/src/main/java/com/edufound/reader/base/BaseMvpFragment.java

@@ -1,5 +1,8 @@
 package com.edufound.reader.base;
 
+import android.content.Intent;
+import android.os.Bundle;
+
 import androidx.lifecycle.Lifecycle;
 import autodispose2.AutoDispose;
 import autodispose2.AutoDisposeConverter;
@@ -30,4 +33,17 @@ public abstract class BaseMvpFragment<T extends BasePresenter> extends BaseFragm
                 .from(this, Lifecycle.Event.ON_DESTROY));
     }
 
+
+    public void toNextActivity(Class clazz) {
+        Intent intent = new Intent(getActivity(), clazz);
+        startActivity(intent);
+    }
+
+    public void toNextActivity(Class clazz, Bundle bundle) {
+        Intent intent = new Intent(getActivity(), clazz);
+        intent.putExtra("params_bundle", bundle);
+        startActivity(intent);
+    }
+
+
 }

+ 5 - 0
app/src/main/java/com/edufound/reader/base/BaseView.java

@@ -1,6 +1,7 @@
 package com.edufound.reader.base;
 
 import android.app.Activity;
+import android.view.ViewGroup;
 
 import autodispose2.AutoDisposeConverter;
 
@@ -32,4 +33,8 @@ public interface BaseView {
     <T> AutoDisposeConverter<T> bindAutoDispose();
 
     Activity getActivity();
+
+
+    ViewGroup getRootView();
+
 }

+ 6 - 0
app/src/main/java/com/edufound/reader/contract/CharacterFragmentContract.java

@@ -1,6 +1,8 @@
 package com.edufound.reader.contract;
 
 import android.widget.GridLayout;
+import android.widget.HorizontalScrollView;
+import android.widget.Space;
 
 import com.edufound.reader.base.BaseView;
 
@@ -12,9 +14,13 @@ public interface CharacterFragmentContract {
 
     interface View extends BaseView {
         void addUiClick(android.view.View view, Consumer onNext);
+
+        Space getBottomView();
     }
 
     interface Presenter {
+
+
         void initGridLayout(GridLayout gridLayout);
 
         void onDestory(GridLayout layout);

+ 19 - 0
app/src/main/java/com/edufound/reader/contract/CommentContract.java

@@ -0,0 +1,19 @@
+package com.edufound.reader.contract;
+
+import android.widget.FrameLayout;
+
+import com.edufound.reader.base.BaseView;
+
+import androidx.recyclerview.widget.RecyclerView;
+
+public interface CommentContract {
+    interface Model {
+    }
+
+    interface View extends BaseView {
+    }
+
+    interface Presenter {
+        void initComment(RecyclerView rv, FrameLayout noCommentLayout);
+    }
+}

+ 16 - 0
app/src/main/java/com/edufound/reader/contract/CustomerServiceContract.java

@@ -0,0 +1,16 @@
+package com.edufound.reader.contract;
+
+import com.edufound.reader.base.BaseView;
+
+import androidx.recyclerview.widget.RecyclerView;
+
+public interface CustomerServiceContract {
+    interface Model {
+    }
+
+    interface View extends BaseView {
+    }
+
+    interface Presenter {
+    }
+}

+ 7 - 1
app/src/main/java/com/edufound/reader/contract/LoginAlertContract.java

@@ -13,14 +13,20 @@ public interface LoginAlertContract {
     }
 
     interface View extends BaseView {
-        ConstraintLayout getRootView();
+        ConstraintLayout getConstraintLayoutView();
 
         AppCompatCheckBox getCheckBox();
+
+        TextView getVCodeText();
     }
 
     interface Presenter {
         void initServiceText(TextView textView);
 
         void getVCode(String phoneNum);
+
+        void Login(String phoneNum, String vcode);
+
+        void activityDestory();
     }
 }

+ 17 - 0
app/src/main/java/com/edufound/reader/contract/MessageContract.java

@@ -0,0 +1,17 @@
+package com.edufound.reader.contract;
+
+import com.edufound.reader.base.BaseView;
+
+import androidx.recyclerview.widget.RecyclerView;
+
+public interface MessageContract {
+    interface Model {
+    }
+
+    interface View extends BaseView {
+    }
+
+    interface Presenter {
+        void initRecyclerView(RecyclerView rv);
+    }
+}

+ 19 - 0
app/src/main/java/com/edufound/reader/contract/MyCollectionContract.java

@@ -0,0 +1,19 @@
+package com.edufound.reader.contract;
+
+import android.widget.RadioGroup;
+
+import com.edufound.reader.base.BaseView;
+
+import androidx.recyclerview.widget.RecyclerView;
+
+public interface MyCollectionContract {
+    interface Model {
+    }
+
+    interface View extends BaseView {
+    }
+
+    interface Presenter {
+        void initRecyclerView(RecyclerView rv);
+    }
+}

+ 17 - 0
app/src/main/java/com/edufound/reader/contract/MyFollowContract.java

@@ -0,0 +1,17 @@
+package com.edufound.reader.contract;
+
+import com.edufound.reader.base.BaseView;
+
+import androidx.recyclerview.widget.RecyclerView;
+
+public interface MyFollowContract {
+    interface Model {
+    }
+
+    interface View extends BaseView {
+    }
+
+    interface Presenter {
+        void initRecyclerView(RecyclerView rv);
+    }
+}

+ 3 - 2
app/src/main/java/com/edufound/reader/contract/UserFragmentContract.java

@@ -1,6 +1,7 @@
 package com.edufound.reader.contract;
 
 import android.view.View;
+import android.widget.FrameLayout;
 import android.widget.GridLayout;
 import android.widget.GridView;
 
@@ -10,7 +11,7 @@ import com.edufound.reader.bean.UserInfoBean;
 import androidx.recyclerview.widget.RecyclerView;
 import io.reactivex.rxjava3.functions.Consumer;
 
-public interface UserFragmentContract {
+public interface MyTabFragmentContract {
     interface Model {
 
     }
@@ -25,7 +26,7 @@ public interface UserFragmentContract {
     interface Presenter {
         void initRecyclerView(RecyclerView rv);
 
-        void initGridLayout(GridLayout gridLayout);
+        void initGridLayout(GridLayout gridLayout, FrameLayout norecordlayout);
 
         void onDestory(GridLayout layout);
 

+ 4 - 14
app/src/main/java/com/edufound/reader/contract/UserFragmentContract.java

@@ -1,34 +1,24 @@
 package com.edufound.reader.contract;
 
-import android.view.View;
+import android.widget.FrameLayout;
 import android.widget.GridLayout;
-import android.widget.GridView;
 
 import com.edufound.reader.base.BaseView;
-import com.edufound.reader.bean.UserInfoBean;
 
-import androidx.recyclerview.widget.RecyclerView;
 import io.reactivex.rxjava3.functions.Consumer;
 
-public interface UserFragmentContract {
+public interface OthersRecordContract {
     interface Model {
-
     }
 
     interface View extends BaseView {
-        void addUiClick(android.view.View view, Consumer onNext);
-
-        void setUserInfo(UserInfoBean bean);
 
+        void addUiClick(android.view.View view, Consumer onNext);
     }
 
     interface Presenter {
-        void initRecyclerView(RecyclerView rv);
-
-        void initGridLayout(GridLayout gridLayout);
+        void initGridLayout(GridLayout gridLayout, FrameLayout norecordlayout);
 
         void onDestory(GridLayout layout);
-
-
     }
 }

+ 14 - 0
app/src/main/java/com/edufound/reader/contract/PayContract.java

@@ -0,0 +1,14 @@
+package com.edufound.reader.contract;
+
+import com.edufound.reader.base.BaseView;
+
+public interface PayContract {
+    interface Model {
+    }
+
+    interface View extends BaseView {
+    }
+
+    interface Presenter {
+    }
+}

+ 10 - 2
app/src/main/java/com/edufound/reader/contract/RecommendFragmentContract.java

@@ -4,6 +4,7 @@ import android.app.Activity;
 import android.view.View;
 
 import com.edufound.reader.base.BaseView;
+import com.edufound.reader.bean.SlideVideoBean;
 
 import androidx.recyclerview.widget.RecyclerView;
 
@@ -13,11 +14,18 @@ public interface RecommendFragmentContract {
     }
 
     interface View extends BaseView {
-
+        void setTopStatus(SlideVideoBean bean);
     }
 
     interface Presenter {
-        void initVideoList(RecyclerView rv, int type);
+        void initVideoList(RecyclerView rv, int type, int startPosition);
+
+
+        Object getCurPlayVideo();
+
+
+        void fragmentPause(RecyclerView rv);
 
+        void fragmentResume(RecyclerView rv);
     }
 }

+ 4 - 10
app/src/main/java/com/edufound/reader/contract/VideoContract.java

@@ -7,7 +7,7 @@ import com.edufound.reader.base.BaseView;
 
 import tv.danmaku.ijk.media.player.IMediaPlayer;
 
-public interface VideoContract {
+public interface RecordContract {
     interface Model {
 //        Observable<Object> login(String username, String password);
     }
@@ -33,24 +33,18 @@ public interface VideoContract {
         /*
          * 播放器播放完成
          * */
-        void onVideoCompletion(IMediaPlayer mediaPlayer);
+        void onVideoCompletion();
 
         /*
          * 播放器异常
          * */
-        void onVideoError(IMediaPlayer mediaPlayer, int what, int extra);
-
-
-        /*
-         * 播放器缓冲完成
-         * */
-        void onVideoPrepared(IMediaPlayer mediaPlayer);
+        void onVideoError(int what, int extra);
 
 
         /*
          * 播放器状态info
          * */
-        void onVideoInfoListener(IMediaPlayer mediaPlayer, int what, int extra);
+        void onVideoInfoListener(int what, int extra);
 
 
         /*

+ 15 - 0
app/src/main/java/com/edufound/reader/contract/SmallFullVideoContract.java

@@ -0,0 +1,15 @@
+package com.edufound.reader.contract;
+
+import com.edufound.reader.base.BaseView;
+
+public interface SmallFullVideoContract {
+    interface Model {
+    }
+
+    interface View extends BaseView {
+    }
+
+    interface Presenter {
+        void initFragment(int index);
+    }
+}

+ 14 - 0
app/src/main/java/com/edufound/reader/contract/UserInfoSettingContract.java

@@ -0,0 +1,14 @@
+package com.edufound.reader.contract;
+
+import com.edufound.reader.base.BaseView;
+
+public interface UserInfoSettingContract {
+    interface Model {
+    }
+
+    interface View extends BaseView {
+    }
+
+    interface Presenter {
+    }
+}

+ 18 - 0
app/src/main/java/com/edufound/reader/contract/WebContract.java

@@ -0,0 +1,18 @@
+package com.edufound.reader.contract;
+
+import android.content.Intent;
+import android.webkit.WebView;
+
+import com.edufound.reader.base.BaseView;
+
+public interface WebContract {
+    interface Model {
+    }
+
+    interface View extends BaseView {
+    }
+
+    interface Presenter {
+        WebView initWebView(Intent intent);
+    }
+}

+ 422 - 0
app/src/main/java/com/edufound/reader/cusview/GridRadioGroup.java

@@ -0,0 +1,422 @@
+package com.edufound.reader.cusview;
+
+
+import android.content.Context;
+import android.content.res.TypedArray;
+import android.util.AttributeSet;
+import android.view.MotionEvent;
+import android.view.View;
+import android.view.ViewGroup;
+import android.view.accessibility.AccessibilityEvent;
+import android.view.accessibility.AccessibilityNodeInfo;
+import android.widget.CompoundButton;
+import android.widget.LinearLayout;
+import android.widget.RadioButton;
+
+import com.orhanobut.logger.Logger;
+
+
+/**
+ * <p>This class is used to create a multiple-exclusion scope for a set of radio
+ * buttons. Checking one radio button that belongs to a radio group unchecks
+ * any previously checked radio button within the same group.</p>
+ *
+ * <p>Intially, all of the radio buttons are unchecked. While it is not possible
+ * to uncheck a particular radio button, the radio group can be cleared to
+ * remove the checked state.</p>
+ *
+ * <p>The selection is identified by the unique id of the radio button as defined
+ * in the XML layout file.</p>
+ *
+ * @see RadioButton
+ */
+public class GridRadioGroup extends LinearLayout {
+    // holds the checked id; the selection is empty by default
+    private int mCheckedId = -1;
+    // tracks children radio buttons checked state
+    private CompoundButton.OnCheckedChangeListener mChildOnCheckedChangeListener;
+    // when true, mOnCheckedChangeListener discards events
+    private boolean mProtectFromCheckedChange = false;
+    private OnCheckedChangeListener mOnCheckedChangeListener;
+    private PassThroughHierarchyChangeListener mPassThroughListener;
+
+    /**
+     * {@inheritDoc}
+     */
+    public GridRadioGroup(Context context) {
+        super(context);
+        setOrientation(VERTICAL);
+        init();
+    }
+
+    /**
+     * {@inheritDoc}
+     */
+    public GridRadioGroup(Context context, AttributeSet attrs) {
+        super(context, attrs);
+        mCheckedId = View.NO_ID;
+
+        final int index = VERTICAL;
+        setOrientation(index);
+
+        init();
+    }
+
+    private void init() {
+        mChildOnCheckedChangeListener = new CheckedStateTracker();
+        mPassThroughListener = new PassThroughHierarchyChangeListener();
+        super.setOnHierarchyChangeListener(mPassThroughListener);
+    }
+
+    /**
+     * {@inheritDoc}
+     */
+    @Override
+    public void setOnHierarchyChangeListener(OnHierarchyChangeListener listener) {
+        // the user listener is delegated to our pass-through listener
+        mPassThroughListener.mOnHierarchyChangeListener = listener;
+    }
+
+    /**
+     * {@inheritDoc}
+     */
+    @Override
+    protected void onFinishInflate() {
+        super.onFinishInflate();
+
+        // checks the appropriate radio button as requested in the XML file
+        if (mCheckedId != -1) {
+            mProtectFromCheckedChange = true;
+            setCheckedStateForView(mCheckedId, true);
+            mProtectFromCheckedChange = false;
+            setCheckedId(mCheckedId);
+        }
+    }
+
+    @Override
+    public void addView(final View child, int index, ViewGroup.LayoutParams params) {
+        if (child instanceof RadioButton) {
+
+            ((RadioButton) child).setOnTouchListener(new OnTouchListener() {
+
+                @Override
+                public boolean onTouch(View v, MotionEvent event) {
+                    ((RadioButton) child).setChecked(true);
+                    checkRadioButton((RadioButton) child);
+                    if (event.getAction() == MotionEvent.ACTION_UP) {
+                        if (mOnCheckedChangeListener != null) {
+                            mOnCheckedChangeListener.onCheckedChanged(GridRadioGroup.this, child.getId());
+                        }
+                    }
+                    return true;
+                }
+            });
+
+        } else if (child instanceof LinearLayout) {
+            int childCount = ((LinearLayout) child).getChildCount();
+            for (int i = 0; i < childCount; i++) {
+                View view = ((LinearLayout) child).getChildAt(i);
+                if (view instanceof RadioButton) {
+                    final RadioButton button = (RadioButton) view;
+                    ((RadioButton) button).setOnTouchListener(new OnTouchListener() {
+
+                        @Override
+                        public boolean onTouch(View v, MotionEvent event) {
+                            ((RadioButton) button).setChecked(true);
+                            checkRadioButton((RadioButton) button);
+                            if (event.getAction() == MotionEvent.ACTION_UP) {
+                                if (mOnCheckedChangeListener != null) {
+                                    mOnCheckedChangeListener.onCheckedChanged(GridRadioGroup.this, button.getId());
+                                }
+                            }
+                            return true;
+                        }
+                    });
+
+                }
+            }
+        }
+
+        super.addView(child, index, params);
+    }
+
+    private void checkRadioButton(RadioButton radioButton) {
+        View child;
+        int radioCount = getChildCount();
+        for (int i = 0; i < radioCount; i++) {
+            child = getChildAt(i);
+            if (child instanceof RadioButton) {
+                if (child == radioButton) {
+                    // do nothing
+                } else {
+                    ((RadioButton) child).setChecked(false);
+                }
+            } else if (child instanceof LinearLayout) {
+                int childCount = ((LinearLayout) child).getChildCount();
+                for (int j = 0; j < childCount; j++) {
+                    View view = ((LinearLayout) child).getChildAt(j);
+                    if (view instanceof RadioButton) {
+                        final RadioButton button = (RadioButton) view;
+                        if (button == radioButton) {
+                            // do nothing
+                        } else {
+                            ((RadioButton) button).setChecked(false);
+                        }
+                    }
+                }
+            }
+        }
+    }
+
+    /**
+     * <p>Sets the selection to the radio button whose identifier is passed in
+     * parameter. Using -1 as the selection identifier clears the selection;
+     * such an operation is equivalent to invoking {@link #clearCheck()}.</p>
+     *
+     * @param id the unique id of the radio button to select in this group
+     * @see #getCheckedRadioButtonId()
+     * @see #clearCheck()
+     */
+    public void check(int id) {
+        // don't even bother
+        if (id != -1 && (id == mCheckedId)) {
+            return;
+        }
+
+        if (mCheckedId != -1) {
+            setCheckedStateForView(mCheckedId, false);
+        }
+
+        if (id != -1) {
+            setCheckedStateForView(id, true);
+        }
+
+        setCheckedId(id);
+    }
+
+    private void setCheckedId(int id) {
+        mCheckedId = id;
+    }
+
+    private void setCheckedStateForView(int viewId, boolean checked) {
+        View checkedView = findViewById(viewId);
+        if (checkedView != null && checkedView instanceof RadioButton) {
+            ((RadioButton) checkedView).setChecked(checked);
+        }
+    }
+
+    /**
+     * <p>Returns the identifier of the selected radio button in this group.
+     * Upon empty selection, the returned value is -1.</p>
+     *
+     * @return the unique id of the selected radio button in this group
+     * @attr ref android.R.styleable#RadioGroup_checkedButton
+     * @see #check(int)
+     * @see #clearCheck()
+     */
+    public int getCheckedRadioButtonId() {
+        return mCheckedId;
+    }
+
+    /**
+     * <p>Clears the selection. When the selection is cleared, no radio button
+     * in this group is selected and {@link #getCheckedRadioButtonId()} returns
+     * null.</p>
+     *
+     * @see #check(int)
+     * @see #getCheckedRadioButtonId()
+     */
+    public void clearCheck() {
+        check(-1);
+    }
+
+    /**
+     * <p>Register a callback to be invoked when the checked radio button
+     * changes in this group.</p>
+     *
+     * @param listener the callback to call on checked state change
+     */
+    public void setOnCheckedChangeListener(OnCheckedChangeListener listener) {
+        mOnCheckedChangeListener = listener;
+    }
+
+    /**
+     * {@inheritDoc}
+     */
+    @Override
+    public LayoutParams generateLayoutParams(AttributeSet attrs) {
+        return new GridRadioGroup.LayoutParams(getContext(), attrs);
+    }
+
+    /**
+     * {@inheritDoc}
+     */
+    @Override
+    protected boolean checkLayoutParams(ViewGroup.LayoutParams p) {
+        return p instanceof GridRadioGroup.LayoutParams;
+    }
+
+    @Override
+    protected LinearLayout.LayoutParams generateDefaultLayoutParams() {
+        return new LayoutParams(LayoutParams.WRAP_CONTENT, LayoutParams.WRAP_CONTENT);
+    }
+
+    @Override
+    public void onInitializeAccessibilityEvent(AccessibilityEvent event) {
+        super.onInitializeAccessibilityEvent(event);
+        event.setClassName(GridRadioGroup.class.getName());
+    }
+
+    @Override
+    public void onInitializeAccessibilityNodeInfo(AccessibilityNodeInfo info) {
+        super.onInitializeAccessibilityNodeInfo(info);
+        info.setClassName(GridRadioGroup.class.getName());
+    }
+
+    /**
+     * <p>This set of layout parameters defaults the width and the height of
+     * the children to {@link #WRAP_CONTENT} when they are not specified in the
+     * XML file. Otherwise, this class ussed the value read from the XML file.</p>
+     *
+     * <p>See
+     */
+    public static class LayoutParams extends LinearLayout.LayoutParams {
+        /**
+         * {@inheritDoc}
+         */
+        public LayoutParams(Context c, AttributeSet attrs) {
+            super(c, attrs);
+        }
+
+        /**
+         * {@inheritDoc}
+         */
+        public LayoutParams(int w, int h) {
+            super(w, h);
+        }
+
+        /**
+         * {@inheritDoc}
+         */
+        public LayoutParams(int w, int h, float initWeight) {
+            super(w, h, initWeight);
+        }
+
+        /**
+         * {@inheritDoc}
+         */
+        public LayoutParams(ViewGroup.LayoutParams p) {
+            super(p);
+        }
+
+        /**
+         * {@inheritDoc}
+         */
+        public LayoutParams(MarginLayoutParams source) {
+            super(source);
+        }
+
+        /**
+         * <p>Fixes the child's width to
+         * {@link android.view.ViewGroup.LayoutParams#WRAP_CONTENT} and the child's
+         * height to  {@link android.view.ViewGroup.LayoutParams#WRAP_CONTENT}
+         * when not specified in the XML file.</p>
+         *
+         * @param a          the styled attributes set
+         * @param widthAttr  the width attribute to fetch
+         * @param heightAttr the height attribute to fetch
+         */
+        @Override
+        protected void setBaseAttributes(TypedArray a,
+                                         int widthAttr, int heightAttr) {
+
+            if (a.hasValue(widthAttr)) {
+                width = a.getLayoutDimension(widthAttr, "layout_width");
+            } else {
+                width = WRAP_CONTENT;
+            }
+
+            if (a.hasValue(heightAttr)) {
+                height = a.getLayoutDimension(heightAttr, "layout_height");
+            } else {
+                height = WRAP_CONTENT;
+            }
+        }
+    }
+
+    /**
+     * <p>Interface definition for a callback to be invoked when the checked
+     * radio button changed in this group.</p>
+     */
+    public interface OnCheckedChangeListener {
+        /**
+         * <p>Called when the checked radio button has changed. When the
+         * selection is cleared, checkedId is -1.</p>
+         *
+         * @param group     the group in which the checked radio button has changed
+         * @param checkedId the unique identifier of the newly checked radio button
+         */
+        public void onCheckedChanged(GridRadioGroup group, int checkedId);
+    }
+
+    private class CheckedStateTracker implements CompoundButton.OnCheckedChangeListener {
+        public void onCheckedChanged(CompoundButton buttonView, boolean isChecked) {
+            // prevents from infinite recursion
+            if (mProtectFromCheckedChange) {
+                return;
+            }
+
+            mProtectFromCheckedChange = true;
+            if (mCheckedId != -1) {
+                setCheckedStateForView(mCheckedId, false);
+            }
+            mProtectFromCheckedChange = false;
+
+            int id = buttonView.getId();
+            setCheckedId(id);
+        }
+    }
+
+    /**
+     * <p>A pass-through listener acts upon the events and dispatches them
+     * to another listener. This allows the table layout to set its own internal
+     * hierarchy change listener without preventing the user to setup his.</p>
+     */
+    private class PassThroughHierarchyChangeListener implements
+            ViewGroup.OnHierarchyChangeListener {
+        private ViewGroup.OnHierarchyChangeListener mOnHierarchyChangeListener;
+
+        /**
+         * {@inheritDoc}
+         */
+        public void onChildViewAdded(View parent, View child) {
+            if (parent == GridRadioGroup.this && child instanceof RadioButton) {
+                int id = child.getId();
+                // generates an id if it's missing
+                if (id == View.NO_ID) {
+                    id = child.hashCode();
+                    child.setId(id);
+                }
+                ((RadioButton) child).setOnCheckedChangeListener(
+                        mChildOnCheckedChangeListener);
+            }
+
+            if (mOnHierarchyChangeListener != null) {
+                mOnHierarchyChangeListener.onChildViewAdded(parent, child);
+            }
+        }
+
+        /**
+         * {@inheritDoc}
+         */
+        public void onChildViewRemoved(View parent, View child) {
+            if (parent == GridRadioGroup.this && child instanceof RadioButton) {
+                ((RadioButton) child).setOnCheckedChangeListener(null);
+            }
+
+            if (mOnHierarchyChangeListener != null) {
+                mOnHierarchyChangeListener.onChildViewRemoved(parent, child);
+            }
+        }
+    }
+}

+ 9 - 8
app/src/main/java/com/edufound/reader/cusview/RoundFrameLayout.java

@@ -1,12 +1,14 @@
 package com.edufound.reader.cusview;
 
 import android.content.Context;
+import android.content.res.TypedArray;
 import android.graphics.Outline;
 import android.util.AttributeSet;
 import android.view.View;
 import android.view.ViewOutlineProvider;
 import android.widget.FrameLayout;
 
+import com.edufound.reader.R;
 import com.edufound.reader.util.SizeUtils;
 
 import androidx.annotation.NonNull;
@@ -15,20 +17,19 @@ import androidx.annotation.Nullable;
 public class RoundFrameLayout extends FrameLayout {
     public RoundFrameLayout(@NonNull Context context) {
         super(context);
-        init();
+        init(16);
     }
 
     public RoundFrameLayout(@NonNull Context context, @Nullable AttributeSet attrs) {
         super(context, attrs);
-        init();
+        TypedArray array = context.obtainStyledAttributes(attrs, R.styleable.RoundFrameLayout);
+        int getradio = array.getInt(R.styleable.RoundFrameLayout_radio, 16);
+        array.recycle();
+        init(getradio);
     }
 
-    public RoundFrameLayout(@NonNull Context context, @Nullable AttributeSet attrs, int defStyleAttr) {
-        super(context, attrs, defStyleAttr);
-        init();
-    }
 
-    void init() {
+    void init(int radio) {
         this.setOutlineProvider(new ViewOutlineProvider() {
             @Override
             public void getOutline(View view, Outline outline) {
@@ -36,7 +37,7 @@ public class RoundFrameLayout extends FrameLayout {
                         0,
                         view.getWidth(),
                         view.getHeight(),
-                        SizeUtils.px2dp(getContext(), 16));
+                        SizeUtils.px2dp(getContext(), radio));
             }
         });
         this.setClipToOutline(true);

+ 30 - 7
app/src/main/java/com/edufound/reader/cusview/RvListJzvdStd.java

@@ -39,10 +39,6 @@ import cn.jzvd.JZDataSource;
 import cn.jzvd.JZUtils;
 import cn.jzvd.Jzvd;
 
-/**
- * Created by Nathen
- * On 2016/04/18 16:15
- */
 public class RvListJzvdStd extends Jzvd {
 
     public static long LAST_GET_BATTERYLEVEL_TIME = 0;
@@ -93,6 +89,7 @@ public class RvListJzvdStd extends Jzvd {
     protected ProgressBar mDialogBrightnessProgressBar;
     protected TextView mDialogBrightnessTextView;
     protected boolean mIsWifi;
+    protected LinearLayout mLoadingLayout;
     public BroadcastReceiver wifiReceiver = new BroadcastReceiver() {
         @Override
         public void onReceive(Context context, Intent intent) {
@@ -127,9 +124,9 @@ public class RvListJzvdStd extends Jzvd {
         bottomProgressBar = findViewById(R.id.bottom_progress);
         titleTextView = findViewById(R.id.title);
         backButton = findViewById(R.id.back);
-
         posterImageView = findViewById(R.id.poster);
         loadingProgressBar = findViewById(R.id.loading);
+        mLoadingLayout = findViewById(R.id.loading_layout);
         tinyBackImageView = findViewById(R.id.back_tiny);
         batteryLevel = findViewById(R.id.battery_level);
         videoCurrentTime = findViewById(R.id.video_current_time);
@@ -279,6 +276,10 @@ public class RvListJzvdStd extends Jzvd {
         startButton.performClick();
     }
 
+    public void startVideoPauseEnd() {
+        startButton.performClick();
+    }
+
     /**
      * 双击
      */
@@ -312,9 +313,12 @@ public class RvListJzvdStd extends Jzvd {
         if (id == R.id.surface_container) {
             switch (event.getAction()) {
                 case MotionEvent.ACTION_DOWN:
+//                    startButton.performClick();
+                    break;
                 case MotionEvent.ACTION_MOVE:
                     break;
                 case MotionEvent.ACTION_UP:
+                    startButton.performClick();
 //                    startDismissControlViewTimer();
 //                    if (mChangePosition) {
 //                        long duration = getDuration();
@@ -460,7 +464,7 @@ public class RvListJzvdStd extends Jzvd {
         fullscreenButton.setImageResource(R.drawable.jz_enlarge);
         backButton.setVisibility(View.GONE);
         tinyBackImageView.setVisibility(View.INVISIBLE);
-        changeStartButtonSize(150);
+        changeStartButtonSize(120);
         batteryTimeLayout.setVisibility(View.GONE);
         clarity.setVisibility(View.GONE);
     }
@@ -479,7 +483,7 @@ public class RvListJzvdStd extends Jzvd {
             clarity.setText(jzDataSource.getCurrentKey().toString());
             clarity.setVisibility(View.VISIBLE);
         }
-        changeStartButtonSize(150);
+        changeStartButtonSize(120);
         setSystemTimeAndBattery();
     }
 
@@ -783,6 +787,7 @@ public class RvListJzvdStd extends Jzvd {
         bottomContainer.setVisibility(View.INVISIBLE);
         startButton.setVisibility(startBtn);
         loadingProgressBar.setVisibility(loadingPro);
+        mLoadingLayout.setVisibility(loadingPro);
         posterImageView.setVisibility(posterImg);
         bottomProgressBar.setVisibility(bottomPro);
         bottomProgressBar.setVisibility(View.INVISIBLE);
@@ -942,6 +947,19 @@ public class RvListJzvdStd extends Jzvd {
         this.mCallBack = callBack;
     }
 
+
+    @Override
+    public void onError(int what, int extra) {
+        super.onError(what, extra);
+        this.mCallBack.onError(what, extra);
+    }
+
+    @Override
+    public void onInfo(int what, int extra) {
+        super.onInfo(what, extra);
+        this.mCallBack.onInfo(what, extra);
+    }
+
     @Override
     public void onCompletion() {
         if (screen == SCREEN_FULLSCREEN) {
@@ -994,6 +1012,7 @@ public class RvListJzvdStd extends Jzvd {
         }
     }
 
+
     public class DismissControlViewTimerTask extends TimerTask {
 
         @Override
@@ -1005,6 +1024,10 @@ public class RvListJzvdStd extends Jzvd {
 
     public interface VideoCallBack {
         void onComplete();
+
+        void onError(int what, int extra);
+
+        void onInfo(int what, int extra);
     }
 
     public String getVideoTitle() {

+ 41 - 9
app/src/main/java/com/edufound/reader/fragment/CharacterFragment.java

@@ -1,36 +1,45 @@
 package com.edufound.reader.fragment;
 
+import android.graphics.Rect;
+import android.os.Build;
 import android.view.View;
-import android.widget.FrameLayout;
+import android.view.ViewGroup;
 import android.widget.GridLayout;
+import android.widget.HorizontalScrollView;
 import android.widget.ImageView;
-import android.widget.TextView;
+import android.widget.Space;
 
 import com.edufound.reader.R;
 import com.edufound.reader.base.BaseMvpFragment;
 import com.edufound.reader.contract.CharacterFragmentContract;
-import com.edufound.reader.contract.UserFragmentContract;
 import com.edufound.reader.presenter.CharacterFragmentPresenter;
-import com.edufound.reader.presenter.UserFragmentPresenter;
-import com.jakewharton.rxbinding4.view.RxViewGroup;
-import com.orhanobut.logger.Logger;
+import com.edufound.reader.util.Consts;
 
+import androidx.annotation.RequiresApi;
 import io.reactivex.rxjava3.functions.Consumer;
 
 public class CharacterFragment extends BaseMvpFragment<CharacterFragmentPresenter> implements CharacterFragmentContract.View {
 
 
+    View mRootView;
+    HorizontalScrollView mScrollView;
     GridLayout mGridLayout;
+    Space mBottomView;
+    Rect mScreenRect;
+    boolean isNeedLoad = false;
 
-
+    @RequiresApi(api = Build.VERSION_CODES.M)
     @Override
     protected void initView(View view) {
+        mRootView = view;
         mPresenter = new CharacterFragmentPresenter(getContext());
         mPresenter.attachView(this);
+        mScreenRect = new Rect(0, 0, Consts.getScreenSize()[0], Consts.getScreenSize()[1]);
         //初始化左侧广告UI
         ImageView mCharacterImage = view.findViewById(R.id.fragment_main_character_img);
-
+        mScrollView = view.findViewById(R.id.fragment_main_character_scrollview);
         mGridLayout = view.findViewById(R.id.fragment_my_recyclerview);
+        mBottomView = view.findViewById(R.id.fragment_main_character_bottomview);
 //        mPresenter.initRecyclerView(mRecyclerView);
         mPresenter.initGridLayout(mGridLayout);
 
@@ -42,9 +51,22 @@ public class CharacterFragment extends BaseMvpFragment<CharacterFragmentPresente
         return R.layout.fragment_main_character;
     }
 
+    @RequiresApi(api = Build.VERSION_CODES.M)
     @Override
     protected void initViewListener() {
-
+        mScrollView.setOnScrollChangeListener(new View.OnScrollChangeListener() {
+            @Override
+            public void onScrollChange(View view, int x, int y, int oldx, int oldy) {
+                if (mBottomView.getLocalVisibleRect(mScreenRect)) {
+                    if (isNeedLoad) {
+                        isNeedLoad = false;
+                        mPresenter.initGridLayout(mGridLayout);
+                    }
+                } else {
+                    isNeedLoad = true;
+                }
+            }
+        });
     }
 
     @Override
@@ -63,11 +85,21 @@ public class CharacterFragment extends BaseMvpFragment<CharacterFragmentPresente
     }
 
     @Override
+    public ViewGroup getRootView() {
+        return (ViewGroup) mRootView;
+    }
+
+    @Override
     public void addUiClick(View view, Consumer onNext) {
         addUiClickListener(view, onNext);
     }
 
     @Override
+    public Space getBottomView() {
+        return mBottomView;
+    }
+
+    @Override
     public void onDestroy() {
         super.onDestroy();
         mPresenter.onDestory(mGridLayout);

+ 190 - 0
app/src/main/java/com/edufound/reader/fragment/MyTabFragment.java

@@ -0,0 +1,190 @@
+package com.edufound.reader.fragment;
+
+import android.graphics.Rect;
+import android.os.Build;
+import android.os.Bundle;
+import android.view.View;
+import android.view.ViewGroup;
+import android.widget.FrameLayout;
+import android.widget.GridLayout;
+import android.widget.HorizontalScrollView;
+import android.widget.ImageView;
+import android.widget.Space;
+import android.widget.TextView;
+import android.widget.Toast;
+
+import com.edufound.reader.R;
+import com.edufound.reader.activity.CustomerServiceActivity;
+import com.edufound.reader.activity.MessageActivity;
+import com.edufound.reader.activity.MyCollectionActivity;
+import com.edufound.reader.activity.MyFollowActivity;
+import com.edufound.reader.activity.PayActivity;
+import com.edufound.reader.activity.RecordActivity;
+import com.edufound.reader.activity.UserInfoSettingActivity;
+import com.edufound.reader.base.BaseMvpFragment;
+import com.edufound.reader.bean.UserInfoBean;
+import com.edufound.reader.contract.MyTabFragmentContract;
+import com.edufound.reader.presenter.MyTabFragmentPresenter;
+import com.edufound.reader.util.Consts;
+import com.edufound.reader.util.GlideUtils;
+import com.orhanobut.logger.Logger;
+
+import androidx.annotation.RequiresApi;
+import io.reactivex.rxjava3.functions.Consumer;
+
+public class MyTabFragment extends BaseMvpFragment<MyTabFragmentPresenter> implements MyTabFragmentContract.View {
+
+
+    View mRootView;
+    HorizontalScrollView mScrollView;
+    GridLayout mGridLayout;
+    FrameLayout mNoRecordLayout;
+    ImageView mHeaderUserImg;
+    ImageView mHeadUserSetting;
+    TextView mHeadUserPhone;
+    TextView mHeadUserGrade;
+    TextView mHeadUserFans;
+    TextView mHeadUserPlayCount;
+    ImageView mHeadUserVip;
+    ImageView mHeadUserRedFlower;
+    ImageView mHeadUserMyAttention;
+    ImageView mHeadUserMyCollection;
+    FrameLayout mUserLayout;
+    FrameLayout mHeadUserMessage;
+    ImageView mHeadUserCustomerService;
+    Space mBottomView;
+    Rect mScreenRect;
+    boolean isNeedLoad = false;
+
+    @Override
+    protected void initView(View view) {
+        mPresenter = new MyTabFragmentPresenter(getContext());
+        mPresenter.attachView(this);
+        mRootView = view;
+        mScrollView = view.findViewById(R.id.fragment_main_user_scrollview);
+        mBottomView = view.findViewById(R.id.fragment_main_user_bottomview);
+        mScreenRect = new Rect(0, 0, Consts.getScreenSize()[0], Consts.getScreenSize()[1]);
+        //初始化左侧header ui
+        FrameLayout headlayout = view.findViewById(R.id.fragment_main_user_head_layout);
+        mHeaderUserImg = headlayout.findViewById(R.id.fragment_main_user_head);
+        mHeadUserSetting = headlayout.findViewById(R.id.fragment_main_user_setting);
+        mHeadUserPhone = headlayout.findViewById(R.id.fragment_main_user_phonenum);
+        mHeadUserGrade = headlayout.findViewById(R.id.fragment_main_user_grade);
+        mHeadUserFans = headlayout.findViewById(R.id.fragment_main_user_fans);
+        mHeadUserPlayCount = headlayout.findViewById(R.id.fragment_main_user_playcount);
+        mHeadUserVip = headlayout.findViewById(R.id.fragment_main_user_vip);
+        mHeadUserRedFlower = headlayout.findViewById(R.id.fragment_main_user_redflower);
+        mHeadUserMyAttention = headlayout.findViewById(R.id.fragment_main_user_myattention);
+        mHeadUserMyCollection = headlayout.findViewById(R.id.fragment_main_user_mycollection);
+        mHeadUserMessage = headlayout.findViewById(R.id.fragment_main_user_messagenotification);
+        mHeadUserCustomerService = headlayout.findViewById(R.id.fragment_main_user_customerservice);
+        mUserLayout = view.findViewById(R.id.fragment_main_user_layout);
+        mGridLayout = view.findViewById(R.id.fragment_my_recyclerview);
+        mNoRecordLayout = view.findViewById(R.id.fragment_main_user_norecord);
+//        mPresenter.initRecyclerView(mRecyclerView);
+        mPresenter.initGridLayout(mGridLayout, mNoRecordLayout);
+    }
+
+
+    @Override
+    protected int getLayoutId() {
+        return R.layout.fragment_main_user;
+    }
+
+    @RequiresApi(api = Build.VERSION_CODES.M)
+    @Override
+    protected void initViewListener() {
+        mScrollView.setOnScrollChangeListener(new View.OnScrollChangeListener() {
+            @Override
+            public void onScrollChange(View view, int x, int y, int oldx, int oldy) {
+                if (mBottomView.getLocalVisibleRect(mScreenRect)) {
+                    if (isNeedLoad) {
+                        isNeedLoad = false;
+                        mPresenter.initGridLayout(mGridLayout, mNoRecordLayout);
+                    }
+                } else {
+                    isNeedLoad = true;
+                }
+            }
+        });
+
+        addUiClick(mHeadUserSetting, o -> {
+            Toast.makeText(getActivity(), "click 设置", Toast.LENGTH_SHORT).show();
+        });
+        addUiClick(mHeadUserVip, o -> {
+            Toast.makeText(getActivity(), "click vip", Toast.LENGTH_SHORT).show();
+            toNextActivity(PayActivity.class);
+        });
+        addUiClick(mHeadUserRedFlower, o -> {
+            Toast.makeText(getActivity(), "click 小红花", Toast.LENGTH_SHORT).show();
+        });
+        addUiClick(mHeadUserMyAttention, o -> {
+            Toast.makeText(getActivity(), "click 我的关注", Toast.LENGTH_SHORT).show();
+            toNextActivity(MyFollowActivity.class);
+        });
+        addUiClick(mHeadUserMyCollection, o -> {
+            Toast.makeText(getActivity(), "click 我的收藏", Toast.LENGTH_SHORT).show();
+            toNextActivity(MyCollectionActivity.class);
+        });
+        addUiClick(mHeadUserMessage, o -> {
+            Toast.makeText(getActivity(), "click 消息通知", Toast.LENGTH_SHORT).show();
+            toNextActivity(MessageActivity.class);
+
+        });
+        addUiClick(mHeadUserCustomerService, o -> {
+            Toast.makeText(getActivity(), "click 联系客服", Toast.LENGTH_SHORT).show();
+            toNextActivity(CustomerServiceActivity.class);
+        });
+        addUiClick(mUserLayout, o -> {
+            Bundle bundle = new Bundle();
+            bundle.putString("index", "123123123");
+            toNextActivity(UserInfoSettingActivity.class, bundle);
+        });
+    }
+
+    @Override
+    public void showLoading() {
+
+    }
+
+    @Override
+    public void hideLoading() {
+
+    }
+
+    @Override
+    public void onError(String errMessage) {
+
+    }
+
+    @Override
+    public ViewGroup getRootView() {
+        return (ViewGroup) mRootView;
+    }
+
+    @Override
+    public void addUiClick(View view, Consumer onNext) {
+        addUiClickListener(view, onNext);
+    }
+
+    @Override
+    public void setUserInfo(UserInfoBean bean) {
+        GlideUtils.loadCircleImage(getContext(), bean.getUserHeadImg(), mHeaderUserImg);
+        mHeadUserPhone.setText(bean.getUserPhone());
+        mHeadUserGrade.setText(bean.getUserGrade());
+        mHeadUserFans.setText(bean.getUserFans());
+        mHeadUserPlayCount.setText(bean.getUserPlayCount());
+    }
+
+    @Override
+    public void onDestroy() {
+        super.onDestroy();
+        mPresenter.onDestory(mGridLayout);
+    }
+
+    @Override
+    public void onDestroyView() {
+        super.onDestroyView();
+        mPresenter.onDestory(mGridLayout);
+    }
+}

+ 89 - 20
app/src/main/java/com/edufound/reader/fragment/RecommendFragment.java

@@ -2,26 +2,31 @@ package com.edufound.reader.fragment;
 
 import android.animation.AnimatorSet;
 import android.animation.ObjectAnimator;
-import android.graphics.drawable.AnimationDrawable;
+import android.os.Bundle;
 import android.view.View;
-import android.view.animation.Animation;
+import android.view.ViewGroup;
 import android.view.animation.LinearInterpolator;
 import android.widget.FrameLayout;
 import android.widget.ImageView;
 import android.widget.LinearLayout;
+import android.widget.TextView;
 
 import com.edufound.reader.R;
+import com.edufound.reader.activity.CommentActivity;
+import com.edufound.reader.activity.RecordActivity;
+import com.edufound.reader.base.BaseActivity;
 import com.edufound.reader.base.BaseMvpFragment;
+import com.edufound.reader.bean.SlideVideoBean;
 import com.edufound.reader.contract.RecommendFragmentContract;
 import com.edufound.reader.presenter.RecommendFragmentPresenter;
 import com.orhanobut.logger.Logger;
 
 import androidx.recyclerview.widget.RecyclerView;
-import cn.jzvd.JzvdStd;
 
 public class RecommendFragment extends BaseMvpFragment<RecommendFragmentPresenter> implements RecommendFragmentContract.View {
 
 
+    View mRootView;
     RecyclerView mRecyclerView;
     FrameLayout mUserHeadLayout;
     FrameLayout mCommentLayout;
@@ -36,16 +41,30 @@ public class RecommendFragment extends BaseMvpFragment<RecommendFragmentPresente
     ObjectAnimator mToRecordScaleYAnim;
     ImageView mToRecordScaleIcon;
 
+
+    ImageView mUserHead;
+    TextView mUserPhone;
+    TextView mCommentCount;
+    TextView mCollentStatus;
+    TextView mThumbCount;
+
     //默认是推荐 mFragmentType=0
     //关注 mFragmentType=1
+    //官方的 mFragmentType=2
+    //关注的人的mFragmentType=3
     int mFragmentType = 0;
 
     public RecommendFragment(int type) {
         mFragmentType = type;
     }
 
+    boolean hideBottom = false;
+
+    int startPosition = 0;
+
     @Override
     protected void initView(View view) {
+        mRootView = view;
         mPresenter = new RecommendFragmentPresenter(getContext());
         mPresenter.attachView(this);
         mRecyclerView = view.findViewById(R.id.fragment_recommend_recyclerview);
@@ -56,9 +75,15 @@ public class RecommendFragment extends BaseMvpFragment<RecommendFragmentPresente
         mVideoUp = view.findViewById(R.id.fragment_recommend_video_up);
         mVideoNext = view.findViewById(R.id.fragment_recommend_video_next);
         mToRecordLayout = view.findViewById(R.id.fragment_recommend_to_record_layout);
+
+        mUserHead = view.findViewById(R.id.fragment_recommend_user_head);
+        mUserPhone = view.findViewById(R.id.fragment_recommend_user_phone);
+        mCommentCount = view.findViewById(R.id.fragment_recommend_comment_num);
+        mCollentStatus = view.findViewById(R.id.fragment_recommend_collection_status);
+        mThumbCount = view.findViewById(R.id.fragment_recommend_thumbs_num);
         //录音按钮背景旋转
         mToRecordRotationbg = mToRecordLayout.findViewById(R.id.fragment_recommend_to_record_bg);
-        mRotationImgAnim = ObjectAnimator.ofFloat(mToRecordRotationbg, "rotation", 0.0F, 359.0F);//设置Y轴的立体旋转动画
+        mRotationImgAnim = ObjectAnimator.ofFloat(mToRecordRotationbg, "rotation", 0.0F, 359.0F);
         mRotationImgAnim.setRepeatCount(-1);
         mRotationImgAnim.setDuration(1500);
         LinearInterpolator interpolator = new LinearInterpolator();
@@ -66,16 +91,16 @@ public class RecommendFragment extends BaseMvpFragment<RecommendFragmentPresente
         mRotationImgAnim.start();
         //录音按钮缩小放大
         mToRecordScaleIcon = mToRecordLayout.findViewById(R.id.fragment_recommend_to_record_icon);
-        mToRecordScaleXAnim = ObjectAnimator.ofFloat(mToRecordScaleIcon, "scaleX", 0.8F, 1F);//设置Y轴的立体旋转动画
+        mToRecordScaleXAnim = ObjectAnimator.ofFloat(mToRecordScaleIcon, "scaleX", 1F, 1.2F);//设置Y轴的立体旋转动画
         mToRecordScaleXAnim.setRepeatCount(-1);
         mToRecordScaleXAnim.setRepeatMode(ObjectAnimator.REVERSE);
-        mToRecordScaleXAnim.setDuration(2000);
+        mToRecordScaleXAnim.setDuration(1000);
         LinearInterpolator interpolator2 = new LinearInterpolator();
         mToRecordScaleXAnim.setInterpolator(interpolator2); //设置匀速旋转,不卡顿 icon_anim.start();
-        mToRecordScaleYAnim = ObjectAnimator.ofFloat(mToRecordScaleIcon, "scaleY", 0.8F, 1F);//设置Y轴的立体旋转动画
+        mToRecordScaleYAnim = ObjectAnimator.ofFloat(mToRecordScaleIcon, "scaleY", 1F, 1.2F);//设置Y轴的立体旋转动画
         mToRecordScaleYAnim.setRepeatCount(-1);
         mToRecordScaleYAnim.setRepeatMode(ObjectAnimator.REVERSE);
-        mToRecordScaleYAnim.setDuration(2000);
+        mToRecordScaleYAnim.setDuration(1000);
         mToRecordScaleYAnim.setInterpolator(interpolator2); //设置匀速旋转,不卡顿 icon_anim.start();
         AnimatorSet animatorSet = new AnimatorSet();
         animatorSet.play(mToRecordScaleXAnim).with(mToRecordScaleYAnim);
@@ -94,25 +119,41 @@ public class RecommendFragment extends BaseMvpFragment<RecommendFragmentPresente
         });
         addUiClickListener(mCommentLayout, o -> {
             Logger.e("点击了评论");
+            toNextActivity(CommentActivity.class);
         });
         addUiClickListener(mCollectionLayout, o -> {
             Logger.e("点击了收藏");
+            ((ImageView) mCollectionLayout.findViewById(R.id.fragment_recommend_collection_icon)).setImageResource(R.drawable.fragment_recommend_collection_icon_s);
+            ((BaseActivity) getActivity()).showFollowCountAnim();
+
         });
         addUiClickListener(mThumbsLayout, o -> {
             Logger.e("点击了点赞");
+            ((ImageView) mThumbsLayout.findViewById(R.id.fragment_recommend_thumbs_icon)).setImageResource(R.drawable.fragment_recommend_thumbs_up_s);
+            ((BaseActivity) getActivity()).showFollowCountAnim();
         });
-        addUiClickListener(mVideoUp, o -> {
-            Logger.e("上一个视频");
-            mPresenter.scrollToUpFunction(mRecyclerView);
-        });
-        addUiClickListener(mVideoNext, o -> {
-            mPresenter.scrollToNextFunction(mRecyclerView, true);
-            Logger.e("下一个视频");
-        });
+
+        if (hideBottom) {
+            mVideoUp.setVisibility(View.GONE);
+            mVideoNext.setVisibility(View.GONE);
+        } else {
+            addUiClickListener(mVideoUp, o -> {
+                Logger.e("上一个视频");
+                mPresenter.scrollToUpFunction(mRecyclerView);
+            });
+            addUiClickListener(mVideoNext, o -> {
+                mPresenter.scrollToNextFunction(mRecyclerView, true);
+                Logger.e("下一个视频");
+            });
+        }
+
         addUiClickListener(mToRecordLayout, o -> {
-            Logger.e("点击我要录音了");
+            Logger.e("点击我要录音了:" + mPresenter.getCurPlayVideo());
+            Bundle bundle = new Bundle();
+            bundle.putString("index", mPresenter.getCurPlayVideo().toString());
+            toNextActivity(RecordActivity.class, bundle);
         });
-        mPresenter.initVideoList(mRecyclerView, mFragmentType);
+        mPresenter.initVideoList(mRecyclerView, mFragmentType, startPosition);
     }
 
     @Override
@@ -134,15 +175,43 @@ public class RecommendFragment extends BaseMvpFragment<RecommendFragmentPresente
     @Override
     public void onPause() {
         super.onPause();
-        JzvdStd.goOnPlayOnPause();
+//        JzvdStd.goOnPlayOnPause();
+        mPresenter.fragmentPause(mRecyclerView);
     }
 
 
     @Override
     public void onResume() {
+        Logger.e("onResume");
         super.onResume();
-        JzvdStd.goOnPlayOnResume();
+//        JzvdStd.goOnPlayOnResume();
+        mPresenter.fragmentResume(mRecyclerView);
+    }
+
+    @Override
+    public ViewGroup getRootView() {
+        return (ViewGroup) mRootView;
+    }
+
+
+    public void hiddenBottomView() {
+        hideBottom = true;
     }
 
 
+    public void scrollPosition(int position) {
+        startPosition = position;
+    }
+
+    @Override
+    public void setTopStatus(SlideVideoBean bean) {
+
+        //设置信息和点赞数等
+//         mUserHead;
+//         mUserPhone;
+//         mCommentCount;
+//         mCollentStatus;
+//         mThumbCount;
+
+    }
 }

+ 0 - 135
app/src/main/java/com/edufound/reader/fragment/UserFragment.java

@@ -1,135 +0,0 @@
-package com.edufound.reader.fragment;
-
-import android.view.View;
-import android.widget.FrameLayout;
-import android.widget.GridLayout;
-import android.widget.ImageView;
-import android.widget.TextView;
-import android.widget.Toast;
-
-import com.edufound.reader.R;
-import com.edufound.reader.base.BaseMvpFragment;
-import com.edufound.reader.bean.UserInfoBean;
-import com.edufound.reader.contract.UserFragmentContract;
-import com.edufound.reader.presenter.UserFragmentPresenter;
-import com.edufound.reader.util.GlideUtils;
-
-import io.reactivex.rxjava3.functions.Consumer;
-
-public class UserFragment extends BaseMvpFragment<UserFragmentPresenter> implements UserFragmentContract.View {
-
-
-    GridLayout mGridLayout;
-    ImageView mHeaderUserImg;
-    ImageView mHeadUserSetting;
-    TextView mHeadUserPhone;
-    TextView mHeadUserGrade;
-    TextView mHeadUserFans;
-    TextView mHeadUserPlayCount;
-    ImageView mHeadUserVip;
-    ImageView mHeadUserRedFlower;
-    ImageView mHeadUserMyAttention;
-    ImageView mHeadUserMyCollection;
-    ImageView mHeadUserMessage;
-    ImageView mHeadUserCustomerService;
-
-    @Override
-    protected void initView(View view) {
-        mPresenter = new UserFragmentPresenter(getContext());
-        mPresenter.attachView(this);
-
-        //初始化左侧header ui
-        FrameLayout headlayout = view.findViewById(R.id.fragment_main_user_head_layout);
-        mHeaderUserImg = headlayout.findViewById(R.id.fragment_main_user_head);
-        mHeadUserSetting = headlayout.findViewById(R.id.fragment_main_user_setting);
-        mHeadUserPhone = headlayout.findViewById(R.id.fragment_main_user_phonenum);
-        mHeadUserGrade = headlayout.findViewById(R.id.fragment_main_user_grade);
-        mHeadUserFans = headlayout.findViewById(R.id.fragment_main_user_fans);
-        mHeadUserPlayCount = headlayout.findViewById(R.id.fragment_main_user_playcount);
-        mHeadUserVip = headlayout.findViewById(R.id.fragment_main_user_vip);
-        mHeadUserRedFlower = headlayout.findViewById(R.id.fragment_main_user_redflower);
-        mHeadUserMyAttention = headlayout.findViewById(R.id.fragment_main_user_myattention);
-        mHeadUserMyCollection = headlayout.findViewById(R.id.fragment_main_user_mycollection);
-        mHeadUserMessage = headlayout.findViewById(R.id.fragment_main_user_messagenotification);
-        mHeadUserCustomerService = headlayout.findViewById(R.id.fragment_main_user_customerservice);
-
-        mGridLayout = view.findViewById(R.id.fragment_my_recyclerview);
-//        mPresenter.initRecyclerView(mRecyclerView);
-        mPresenter.initGridLayout(mGridLayout);
-    }
-
-
-    @Override
-    protected int getLayoutId() {
-        return R.layout.fragment_main_user;
-    }
-
-    @Override
-    protected void initViewListener() {
-        addUiClick(mHeadUserSetting, o -> {
-            Toast.makeText(getActivity(), "click 设置", Toast.LENGTH_SHORT).show();
-        });
-        addUiClick(mHeadUserVip, o -> {
-            Toast.makeText(getActivity(), "click vip", Toast.LENGTH_SHORT).show();
-        });
-        addUiClick(mHeadUserRedFlower, o -> {
-            Toast.makeText(getActivity(), "click 小红花", Toast.LENGTH_SHORT).show();
-        });
-        addUiClick(mHeadUserMyAttention, o -> {
-            Toast.makeText(getActivity(), "click 我的关注", Toast.LENGTH_SHORT).show();
-        });
-        addUiClick(mHeadUserMyCollection, o -> {
-            Toast.makeText(getActivity(), "click 我的收藏", Toast.LENGTH_SHORT).show();
-
-        });
-        addUiClick(mHeadUserMessage, o -> {
-            Toast.makeText(getActivity(), "click 消息通知", Toast.LENGTH_SHORT).show();
-
-        });
-        addUiClick(mHeadUserCustomerService, o -> {
-            Toast.makeText(getActivity(), "click 联系客服", Toast.LENGTH_SHORT).show();
-
-        });
-    }
-
-    @Override
-    public void showLoading() {
-
-    }
-
-    @Override
-    public void hideLoading() {
-
-    }
-
-    @Override
-    public void onError(String errMessage) {
-
-    }
-
-    @Override
-    public void addUiClick(View view, Consumer onNext) {
-        addUiClickListener(view, onNext);
-    }
-
-    @Override
-    public void setUserInfo(UserInfoBean bean) {
-        GlideUtils.loadCircleImage(getContext(), bean.getUserHeadImg(), mHeaderUserImg);
-        mHeadUserPhone.setText(bean.getUserPhone());
-        mHeadUserGrade.setText(bean.getUserGrade());
-        mHeadUserFans.setText(bean.getUserFans());
-        mHeadUserPlayCount.setText(bean.getUserPlayCount());
-    }
-
-    @Override
-    public void onDestroy() {
-        super.onDestroy();
-        mPresenter.onDestory(mGridLayout);
-    }
-
-    @Override
-    public void onDestroyView() {
-        super.onDestroyView();
-        mPresenter.onDestory(mGridLayout);
-    }
-}

+ 0 - 104
app/src/main/java/com/edufound/reader/ijkplayer/application/Settings.java

@@ -1,104 +0,0 @@
-/*
- * Copyright (C) 2015 Bilibili
- * Copyright (C) 2015 Zhang Rui <bbcallen@gmail.com>
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- *      http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package com.edufound.reader.ijkplayer.application;
-
-import android.content.Context;
-import android.content.SharedPreferences;
-import android.preference.PreferenceManager;
-
-import com.edufound.reader.R;
-
-
-public class Settings {
-    private Context mAppContext;
-    private SharedPreferences mSharedPreferences;
-
-    public static final int PV_PLAYER__AndroidMediaPlayer = 1;
-    public static final int PV_PLAYER__IjkMediaPlayer = 2;
-    public static final int PV_PLAYER__IjkExoMediaPlayer = 3;
-
-    public Settings(Context context) {
-        mAppContext = context.getApplicationContext();
-        mSharedPreferences = PreferenceManager.getDefaultSharedPreferences(mAppContext);
-    }
-
-    public boolean getEnableBackgroundPlay() {
-        String key = mAppContext.getString(R.string.pref_key_enable_background_play);
-        return mSharedPreferences.getBoolean(key, false);
-    }
-
-    public int getPlayer() {
-        String key = mAppContext.getString(R.string.pref_key_player);
-        String value = mSharedPreferences.getString(key, "");
-        try {
-            return Integer.valueOf(value).intValue();
-        } catch (NumberFormatException e) {
-            return 0;
-        }
-    }
-
-    public boolean getUsingMediaCodec() {
-        String key = mAppContext.getString(R.string.pref_key_using_media_codec);
-        return mSharedPreferences.getBoolean(key, false);
-    }
-
-    public boolean getUsingMediaCodecAutoRotate() {
-        String key = mAppContext.getString(R.string.pref_key_using_media_codec_auto_rotate);
-        return mSharedPreferences.getBoolean(key, false);
-    }
-
-    public boolean getMediaCodecHandleResolutionChange() {
-        String key = mAppContext.getString(R.string.pref_key_media_codec_handle_resolution_change);
-        return mSharedPreferences.getBoolean(key, false);
-    }
-
-    public boolean getUsingOpenSLES() {
-        String key = mAppContext.getString(R.string.pref_key_using_opensl_es);
-        return mSharedPreferences.getBoolean(key, false);
-    }
-
-    public String getPixelFormat() {
-        String key = mAppContext.getString(R.string.pref_key_pixel_format);
-        return mSharedPreferences.getString(key, "");
-    }
-
-    public boolean getEnableNoView() {
-        String key = mAppContext.getString(R.string.pref_key_enable_no_view);
-        return mSharedPreferences.getBoolean(key, false);
-    }
-
-    public boolean getEnableSurfaceView() {
-        String key = mAppContext.getString(R.string.pref_key_enable_surface_view);
-        return mSharedPreferences.getBoolean(key, false);
-    }
-
-    public boolean getEnableTextureView() {
-        String key = mAppContext.getString(R.string.pref_key_enable_texture_view);
-        return mSharedPreferences.getBoolean(key, false);
-    }
-
-    public boolean getEnableDetachedSurfaceTextureView() {
-        String key = mAppContext.getString(R.string.pref_key_enable_detached_surface_texture);
-        return mSharedPreferences.getBoolean(key, false);
-    }
-
-    public boolean getUsingMediaDataSource() {
-        String key = mAppContext.getString(R.string.pref_key_using_mediadatasource);
-        return mSharedPreferences.getBoolean(key, false);
-    }
-}

+ 0 - 57
app/src/main/java/com/edufound/reader/ijkplayer/media/FileMediaDataSource.java

@@ -1,57 +0,0 @@
-/*
- * Copyright (C) 2015 Bilibili
- * Copyright (C) 2015 Zhang Rui <bbcallen@gmail.com>
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- *      http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package com.edufound.reader.ijkplayer.media;
-
-import java.io.File;
-import java.io.IOException;
-import java.io.RandomAccessFile;
-
-import tv.danmaku.ijk.media.player.misc.IMediaDataSource;
-
-public class FileMediaDataSource implements IMediaDataSource {
-    private RandomAccessFile mFile;
-    private long mFileSize;
-
-    public FileMediaDataSource(File file) throws IOException {
-        mFile = new RandomAccessFile(file, "r");
-        mFileSize = mFile.length();
-    }
-
-    @Override
-    public int readAt(long position, byte[] buffer, int offset, int size) throws IOException {
-        if (mFile.getFilePointer() != position)
-            mFile.seek(position);
-
-        if (size == 0)
-            return 0;
-
-        return mFile.read(buffer, 0, size);
-    }
-
-    @Override
-    public long getSize() throws IOException {
-        return mFileSize;
-    }
-
-    @Override
-    public void close() throws IOException {
-        mFileSize = 0;
-        mFile.close();
-        mFile = null;
-    }
-}

+ 0 - 42
app/src/main/java/com/edufound/reader/ijkplayer/media/IMediaController.java

@@ -1,42 +0,0 @@
-/*
- * Copyright (C) 2015 Bilibili
- * Copyright (C) 2015 Zhang Rui <bbcallen@gmail.com>
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- *      http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package com.edufound.reader.ijkplayer.media;
-
-import android.view.View;
-import android.widget.MediaController;
-
-public interface IMediaController {
-    void hide();
-
-    boolean isShowing();
-
-    void setAnchorView(View view);
-
-    void setEnabled(boolean enabled);
-
-    void setMediaPlayer(MediaController.MediaPlayerControl player);
-
-    void show(int timeout);
-
-    void show();
-
-    //----------
-    // Extends
-    //----------
-    void showOnce(View view);
-}

+ 0 - 87
app/src/main/java/com/edufound/reader/ijkplayer/media/IRenderView.java

@@ -1,87 +0,0 @@
-/*
- * Copyright (C) 2015 Bilibili
- * Copyright (C) 2015 Zhang Rui <bbcallen@gmail.com>
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- *      http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package com.edufound.reader.ijkplayer.media;
-
-import android.graphics.SurfaceTexture;
-import android.view.Surface;
-import android.view.SurfaceHolder;
-import android.view.View;
-
-import io.reactivex.rxjava3.annotations.NonNull;
-import io.reactivex.rxjava3.annotations.Nullable;
-import tv.danmaku.ijk.media.player.IMediaPlayer;
-
-public interface IRenderView {
-    int AR_ASPECT_FIT_PARENT = 0; // without clip
-    int AR_ASPECT_FILL_PARENT = 1; // may clip
-    int AR_ASPECT_WRAP_CONTENT = 2;
-    int AR_MATCH_PARENT = 3;
-    int AR_16_9_FIT_PARENT = 4;
-    int AR_4_3_FIT_PARENT = 5;
-
-    View getView();
-
-    boolean shouldWaitForResize();
-
-    void setVideoSize(int videoWidth, int videoHeight);
-
-    void setVideoSampleAspectRatio(int videoSarNum, int videoSarDen);
-
-    void setVideoRotation(int degree);
-
-    void setAspectRatio(int aspectRatio);
-
-    void addRenderCallback(@NonNull IRenderCallback callback);
-
-    void removeRenderCallback(@NonNull IRenderCallback callback);
-
-    interface ISurfaceHolder {
-        void bindToMediaPlayer(IMediaPlayer mp);
-
-        @NonNull
-        IRenderView getRenderView();
-
-        @Nullable
-        SurfaceHolder getSurfaceHolder();
-
-        @Nullable
-        Surface openSurface();
-
-        @Nullable
-        SurfaceTexture getSurfaceTexture();
-    }
-
-    interface IRenderCallback {
-        /**
-         * @param holder
-         * @param width  could be 0
-         * @param height could be 0
-         */
-        void onSurfaceCreated(@NonNull ISurfaceHolder holder, int width, int height);
-
-        /**
-         * @param holder
-         * @param format could be 0
-         * @param width
-         * @param height
-         */
-        void onSurfaceChanged(@NonNull ISurfaceHolder holder, int format, int width, int height);
-
-        void onSurfaceDestroyed(@NonNull ISurfaceHolder holder);
-    }
-}

File diff suppressed because it is too large
+ 0 - 1150
app/src/main/java/com/edufound/reader/ijkplayer/media/IjkVideoView.java


+ 0 - 215
app/src/main/java/com/edufound/reader/ijkplayer/media/MeasureHelper.java

@@ -1,215 +0,0 @@
-/*
- * Copyright (C) 2015 Bilibili
- * Copyright (C) 2015 Zhang Rui <bbcallen@gmail.com>
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- *      http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package com.edufound.reader.ijkplayer.media;
-
-import android.view.View;
-
-import java.lang.ref.WeakReference;
-
-public final class MeasureHelper {
-    private WeakReference<View> mWeakView;
-
-    private int mVideoWidth;
-    private int mVideoHeight;
-    private int mVideoSarNum;
-    private int mVideoSarDen;
-
-    private int mVideoRotationDegree;
-
-    private int mMeasuredWidth;
-    private int mMeasuredHeight;
-
-    private int mCurrentAspectRatio = IRenderView.AR_ASPECT_FIT_PARENT;
-
-    public MeasureHelper(View view) {
-        mWeakView = new WeakReference<View>(view);
-    }
-
-    public View getView() {
-        if (mWeakView == null)
-            return null;
-        return mWeakView.get();
-    }
-
-    public void setVideoSize(int videoWidth, int videoHeight) {
-        mVideoWidth = videoWidth;
-        mVideoHeight = videoHeight;
-    }
-
-    public void setVideoSampleAspectRatio(int videoSarNum, int videoSarDen) {
-        mVideoSarNum = videoSarNum;
-        mVideoSarDen = videoSarDen;
-    }
-
-    public void setVideoRotation(int videoRotationDegree) {
-        mVideoRotationDegree = videoRotationDegree;
-    }
-
-    /**
-     * Must be called by View.onMeasure(int, int)
-     *
-     * @param widthMeasureSpec
-     * @param heightMeasureSpec
-     */
-    public void doMeasure(int widthMeasureSpec, int heightMeasureSpec) {
-        //Log.i("@@@@", "onMeasure(" + MeasureSpec.toString(widthMeasureSpec) + ", "
-        //        + MeasureSpec.toString(heightMeasureSpec) + ")");
-        if (mVideoRotationDegree == 90 || mVideoRotationDegree == 270) {
-            int tempSpec = widthMeasureSpec;
-            widthMeasureSpec  = heightMeasureSpec;
-            heightMeasureSpec = tempSpec;
-        }
-
-        int width = View.getDefaultSize(mVideoWidth, widthMeasureSpec);
-        int height = View.getDefaultSize(mVideoHeight, heightMeasureSpec);
-        if (mCurrentAspectRatio == IRenderView.AR_MATCH_PARENT) {
-            width = widthMeasureSpec;
-            height = heightMeasureSpec;
-        } else if (mVideoWidth > 0 && mVideoHeight > 0) {
-            int widthSpecMode = View.MeasureSpec.getMode(widthMeasureSpec);
-            int widthSpecSize = View.MeasureSpec.getSize(widthMeasureSpec);
-            int heightSpecMode = View.MeasureSpec.getMode(heightMeasureSpec);
-            int heightSpecSize = View.MeasureSpec.getSize(heightMeasureSpec);
-
-            if (widthSpecMode == View.MeasureSpec.AT_MOST && heightSpecMode == View.MeasureSpec.AT_MOST) {
-                float specAspectRatio = (float) widthSpecSize / (float) heightSpecSize;
-                float displayAspectRatio;
-                switch (mCurrentAspectRatio) {
-                    case IRenderView.AR_16_9_FIT_PARENT:
-                        displayAspectRatio = 16.0f / 9.0f;
-                        if (mVideoRotationDegree == 90 || mVideoRotationDegree == 270)
-                            displayAspectRatio = 1.0f / displayAspectRatio;
-                        break;
-                    case IRenderView.AR_4_3_FIT_PARENT:
-                        displayAspectRatio = 4.0f / 3.0f;
-                        if (mVideoRotationDegree == 90 || mVideoRotationDegree == 270)
-                            displayAspectRatio = 1.0f / displayAspectRatio;
-                        break;
-                    case IRenderView.AR_ASPECT_FIT_PARENT:
-                    case IRenderView.AR_ASPECT_FILL_PARENT:
-                    case IRenderView.AR_ASPECT_WRAP_CONTENT:
-                    default:
-                        displayAspectRatio = (float) mVideoWidth / (float) mVideoHeight;
-                        if (mVideoSarNum > 0 && mVideoSarDen > 0)
-                            displayAspectRatio = displayAspectRatio * mVideoSarNum / mVideoSarDen;
-                        break;
-                }
-                boolean shouldBeWider = displayAspectRatio > specAspectRatio;
-
-                switch (mCurrentAspectRatio) {
-                    case IRenderView.AR_ASPECT_FIT_PARENT:
-                    case IRenderView.AR_16_9_FIT_PARENT:
-                    case IRenderView.AR_4_3_FIT_PARENT:
-                        if (shouldBeWider) {
-                            // too wide, fix width
-                            width = widthSpecSize;
-                            height = (int) (width / displayAspectRatio);
-                        } else {
-                            // too high, fix height
-                            height = heightSpecSize;
-                            width = (int) (height * displayAspectRatio);
-                        }
-                        break;
-                    case IRenderView.AR_ASPECT_FILL_PARENT:
-                        if (shouldBeWider) {
-                            // not high enough, fix height
-                            height = heightSpecSize;
-                            width = (int) (height * displayAspectRatio);
-                        } else {
-                            // not wide enough, fix width
-                            width = widthSpecSize;
-                            height = (int) (width / displayAspectRatio);
-                        }
-                        break;
-                    case IRenderView.AR_ASPECT_WRAP_CONTENT:
-                    default:
-                        if (shouldBeWider) {
-                            // too wide, fix width
-                            width = Math.min(mVideoWidth, widthSpecSize);
-                            height = (int) (width / displayAspectRatio);
-                        } else {
-                            // too high, fix height
-                            height = Math.min(mVideoHeight, heightSpecSize);
-                            width = (int) (height * displayAspectRatio);
-                        }
-                        break;
-                }
-            } else if (widthSpecMode == View.MeasureSpec.EXACTLY && heightSpecMode == View.MeasureSpec.EXACTLY) {
-                // the size is fixed
-                width = widthSpecSize;
-                height = heightSpecSize;
-
-                // for compatibility, we adjust size based on aspect ratio
-                if (mVideoWidth * height < width * mVideoHeight) {
-                    //Log.i("@@@", "image too wide, correcting");
-                    width = height * mVideoWidth / mVideoHeight;
-                } else if (mVideoWidth * height > width * mVideoHeight) {
-                    //Log.i("@@@", "image too tall, correcting");
-                    height = width * mVideoHeight / mVideoWidth;
-                }
-            } else if (widthSpecMode == View.MeasureSpec.EXACTLY) {
-                // only the width is fixed, adjust the height to match aspect ratio if possible
-                width = widthSpecSize;
-                height = width * mVideoHeight / mVideoWidth;
-                if (heightSpecMode == View.MeasureSpec.AT_MOST && height > heightSpecSize) {
-                    // couldn't match aspect ratio within the constraints
-                    height = heightSpecSize;
-                }
-            } else if (heightSpecMode == View.MeasureSpec.EXACTLY) {
-                // only the height is fixed, adjust the width to match aspect ratio if possible
-                height = heightSpecSize;
-                width = height * mVideoWidth / mVideoHeight;
-                if (widthSpecMode == View.MeasureSpec.AT_MOST && width > widthSpecSize) {
-                    // couldn't match aspect ratio within the constraints
-                    width = widthSpecSize;
-                }
-            } else {
-                // neither the width nor the height are fixed, try to use actual video size
-                width = mVideoWidth;
-                height = mVideoHeight;
-                if (heightSpecMode == View.MeasureSpec.AT_MOST && height > heightSpecSize) {
-                    // too tall, decrease both width and height
-                    height = heightSpecSize;
-                    width = height * mVideoWidth / mVideoHeight;
-                }
-                if (widthSpecMode == View.MeasureSpec.AT_MOST && width > widthSpecSize) {
-                    // too wide, decrease both width and height
-                    width = widthSpecSize;
-                    height = width * mVideoHeight / mVideoWidth;
-                }
-            }
-        } else {
-            // no size yet, just adopt the given spec sizes
-        }
-
-        mMeasuredWidth = width;
-        mMeasuredHeight = height;
-    }
-
-    public int getMeasuredWidth() {
-        return mMeasuredWidth;
-    }
-
-    public int getMeasuredHeight() {
-        return mMeasuredHeight;
-    }
-
-    public void setAspectRatio(int aspectRatio) {
-        mCurrentAspectRatio = aspectRatio;
-    }
-}

+ 0 - 288
app/src/main/java/com/edufound/reader/ijkplayer/media/SurfaceRenderView.java

@@ -1,288 +0,0 @@
-/*
- * Copyright (C) 2015 Bilibili
- * Copyright (C) 2015 Zhang Rui <bbcallen@gmail.com>
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- *      http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package com.edufound.reader.ijkplayer.media;
-
-import android.annotation.TargetApi;
-import android.content.Context;
-import android.graphics.SurfaceTexture;
-import android.os.Build;
-import android.util.AttributeSet;
-import android.util.Log;
-import android.view.Surface;
-import android.view.SurfaceHolder;
-import android.view.SurfaceView;
-import android.view.View;
-import android.view.accessibility.AccessibilityEvent;
-import android.view.accessibility.AccessibilityNodeInfo;
-
-import java.lang.ref.WeakReference;
-import java.util.Map;
-import java.util.concurrent.ConcurrentHashMap;
-
-import io.reactivex.rxjava3.annotations.NonNull;
-import io.reactivex.rxjava3.annotations.Nullable;
-import tv.danmaku.ijk.media.player.IMediaPlayer;
-import tv.danmaku.ijk.media.player.ISurfaceTextureHolder;
-
-public class SurfaceRenderView extends SurfaceView implements IRenderView {
-    private MeasureHelper mMeasureHelper;
-
-    public SurfaceRenderView(Context context) {
-        super(context);
-        initView(context);
-    }
-
-    public SurfaceRenderView(Context context, AttributeSet attrs) {
-        super(context, attrs);
-        initView(context);
-    }
-
-    public SurfaceRenderView(Context context, AttributeSet attrs, int defStyleAttr) {
-        super(context, attrs, defStyleAttr);
-        initView(context);
-    }
-
-    @TargetApi(Build.VERSION_CODES.LOLLIPOP)
-    public SurfaceRenderView(Context context, AttributeSet attrs, int defStyleAttr, int defStyleRes) {
-        super(context, attrs, defStyleAttr, defStyleRes);
-        initView(context);
-    }
-
-    private void initView(Context context) {
-        mMeasureHelper = new MeasureHelper(this);
-        mSurfaceCallback = new SurfaceCallback(this);
-        getHolder().addCallback(mSurfaceCallback);
-        //noinspection deprecation
-        getHolder().setType(SurfaceHolder.SURFACE_TYPE_NORMAL);
-    }
-
-    @Override
-    public View getView() {
-        return this;
-    }
-
-    @Override
-    public boolean shouldWaitForResize() {
-        return true;
-    }
-
-    //--------------------
-    // Layout & Measure
-    //--------------------
-    @Override
-    public void setVideoSize(int videoWidth, int videoHeight) {
-        if (videoWidth > 0 && videoHeight > 0) {
-            mMeasureHelper.setVideoSize(videoWidth, videoHeight);
-            getHolder().setFixedSize(videoWidth, videoHeight);
-            requestLayout();
-        }
-    }
-
-    @Override
-    public void setVideoSampleAspectRatio(int videoSarNum, int videoSarDen) {
-        if (videoSarNum > 0 && videoSarDen > 0) {
-            mMeasureHelper.setVideoSampleAspectRatio(videoSarNum, videoSarDen);
-            requestLayout();
-        }
-    }
-
-    @Override
-    public void setVideoRotation(int degree) {
-        Log.e("", "SurfaceView doesn't support rotation (" + degree + ")!\n");
-    }
-
-    @Override
-    public void setAspectRatio(int aspectRatio) {
-        mMeasureHelper.setAspectRatio(aspectRatio);
-        requestLayout();
-    }
-
-    @Override
-    protected void onMeasure(int widthMeasureSpec, int heightMeasureSpec) {
-        mMeasureHelper.doMeasure(widthMeasureSpec, heightMeasureSpec);
-        setMeasuredDimension(mMeasureHelper.getMeasuredWidth(), mMeasureHelper.getMeasuredHeight());
-    }
-
-    //--------------------
-    // SurfaceViewHolder
-    //--------------------
-
-    private static final class InternalSurfaceHolder implements ISurfaceHolder {
-        private SurfaceRenderView mSurfaceView;
-        private SurfaceHolder mSurfaceHolder;
-
-        public InternalSurfaceHolder(@NonNull SurfaceRenderView surfaceView,
-                                     @Nullable SurfaceHolder surfaceHolder) {
-            mSurfaceView = surfaceView;
-            mSurfaceHolder = surfaceHolder;
-        }
-
-        public void bindToMediaPlayer(IMediaPlayer mp) {
-            if (mp != null) {
-                if ((Build.VERSION.SDK_INT >= Build.VERSION_CODES.JELLY_BEAN) &&
-                        (mp instanceof ISurfaceTextureHolder)) {
-                    ISurfaceTextureHolder textureHolder = (ISurfaceTextureHolder) mp;
-                    textureHolder.setSurfaceTexture(null);
-                }
-                mp.setDisplay(mSurfaceHolder);
-            }
-        }
-
-        @NonNull
-        @Override
-        public IRenderView getRenderView() {
-            return mSurfaceView;
-        }
-
-        @Nullable
-        @Override
-        public SurfaceHolder getSurfaceHolder() {
-            return mSurfaceHolder;
-        }
-
-        @Nullable
-        @Override
-        public SurfaceTexture getSurfaceTexture() {
-            return null;
-        }
-
-        @Nullable
-        @Override
-        public Surface openSurface() {
-            if (mSurfaceHolder == null)
-                return null;
-            return mSurfaceHolder.getSurface();
-        }
-    }
-
-    //-------------------------
-    // SurfaceHolder.Callback
-    //-------------------------
-
-    @Override
-    public void addRenderCallback(IRenderCallback callback) {
-        mSurfaceCallback.addRenderCallback(callback);
-    }
-
-    @Override
-    public void removeRenderCallback(IRenderCallback callback) {
-        mSurfaceCallback.removeRenderCallback(callback);
-    }
-
-    private SurfaceCallback mSurfaceCallback;
-
-    private static final class SurfaceCallback implements SurfaceHolder.Callback {
-        private SurfaceHolder mSurfaceHolder;
-        private boolean mIsFormatChanged;
-        private int mFormat;
-        private int mWidth;
-        private int mHeight;
-
-        private WeakReference<SurfaceRenderView> mWeakSurfaceView;
-        private Map<IRenderCallback, Object> mRenderCallbackMap = new ConcurrentHashMap<IRenderCallback, Object>();
-
-        public SurfaceCallback(@NonNull SurfaceRenderView surfaceView) {
-            mWeakSurfaceView = new WeakReference<SurfaceRenderView>(surfaceView);
-        }
-
-        public void addRenderCallback(@NonNull IRenderCallback callback) {
-            mRenderCallbackMap.put(callback, callback);
-
-            ISurfaceHolder surfaceHolder = null;
-            if (mSurfaceHolder != null) {
-                if (surfaceHolder == null)
-                    surfaceHolder = new InternalSurfaceHolder(mWeakSurfaceView.get(), mSurfaceHolder);
-                callback.onSurfaceCreated(surfaceHolder, mWidth, mHeight);
-            }
-
-            if (mIsFormatChanged) {
-                if (surfaceHolder == null)
-                    surfaceHolder = new InternalSurfaceHolder(mWeakSurfaceView.get(), mSurfaceHolder);
-                callback.onSurfaceChanged(surfaceHolder, mFormat, mWidth, mHeight);
-            }
-        }
-
-        public void removeRenderCallback(@NonNull IRenderCallback callback) {
-            mRenderCallbackMap.remove(callback);
-        }
-
-        @Override
-        public void surfaceCreated(SurfaceHolder holder) {
-            mSurfaceHolder = holder;
-            mIsFormatChanged = false;
-            mFormat = 0;
-            mWidth = 0;
-            mHeight = 0;
-
-            ISurfaceHolder surfaceHolder = new InternalSurfaceHolder(mWeakSurfaceView.get(), mSurfaceHolder);
-            for (IRenderCallback renderCallback : mRenderCallbackMap.keySet()) {
-                renderCallback.onSurfaceCreated(surfaceHolder, 0, 0);
-            }
-        }
-
-        @Override
-        public void surfaceDestroyed(SurfaceHolder holder) {
-            mSurfaceHolder = null;
-            mIsFormatChanged = false;
-            mFormat = 0;
-            mWidth = 0;
-            mHeight = 0;
-
-            ISurfaceHolder surfaceHolder = new InternalSurfaceHolder(mWeakSurfaceView.get(), mSurfaceHolder);
-            for (IRenderCallback renderCallback : mRenderCallbackMap.keySet()) {
-                renderCallback.onSurfaceDestroyed(surfaceHolder);
-            }
-        }
-
-        @Override
-        public void surfaceChanged(SurfaceHolder holder, int format,
-                                   int width, int height) {
-            mSurfaceHolder = holder;
-            mIsFormatChanged = true;
-            mFormat = format;
-            mWidth = width;
-            mHeight = height;
-
-            // mMeasureHelper.setVideoSize(width, height);
-
-            ISurfaceHolder surfaceHolder = new InternalSurfaceHolder(mWeakSurfaceView.get(), mSurfaceHolder);
-            for (IRenderCallback renderCallback : mRenderCallbackMap.keySet()) {
-                renderCallback.onSurfaceChanged(surfaceHolder, format, width, height);
-            }
-        }
-    }
-
-    //--------------------
-    // Accessibility
-    //--------------------
-
-    @Override
-    public void onInitializeAccessibilityEvent(AccessibilityEvent event) {
-        super.onInitializeAccessibilityEvent(event);
-        event.setClassName(SurfaceRenderView.class.getName());
-    }
-
-    @TargetApi(Build.VERSION_CODES.ICE_CREAM_SANDWICH)
-    @Override
-    public void onInitializeAccessibilityNodeInfo(AccessibilityNodeInfo info) {
-        super.onInitializeAccessibilityNodeInfo(info);
-        if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.ICE_CREAM_SANDWICH) {
-            info.setClassName(SurfaceRenderView.class.getName());
-        }
-    }
-}

+ 0 - 370
app/src/main/java/com/edufound/reader/ijkplayer/media/TextureRenderView.java

@@ -1,370 +0,0 @@
-/*
- * Copyright (C) 2015 Bilibili
- * Copyright (C) 2015 Zhang Rui <bbcallen@gmail.com>
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- *      http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package com.edufound.reader.ijkplayer.media;
-
-import android.annotation.TargetApi;
-import android.content.Context;
-import android.graphics.SurfaceTexture;
-import android.os.Build;
-import android.util.AttributeSet;
-import android.util.Log;
-import android.view.Surface;
-import android.view.SurfaceHolder;
-import android.view.TextureView;
-import android.view.View;
-import android.view.accessibility.AccessibilityEvent;
-import android.view.accessibility.AccessibilityNodeInfo;
-
-import java.lang.ref.WeakReference;
-import java.util.Map;
-import java.util.concurrent.ConcurrentHashMap;
-
-import io.reactivex.rxjava3.annotations.NonNull;
-import io.reactivex.rxjava3.annotations.Nullable;
-import tv.danmaku.ijk.media.player.IMediaPlayer;
-import tv.danmaku.ijk.media.player.ISurfaceTextureHolder;
-import tv.danmaku.ijk.media.player.ISurfaceTextureHost;
-
-@TargetApi(Build.VERSION_CODES.ICE_CREAM_SANDWICH)
-public class TextureRenderView extends TextureView implements IRenderView {
-    private static final String TAG = "TextureRenderView";
-    private MeasureHelper mMeasureHelper;
-
-    public TextureRenderView(Context context) {
-        super(context);
-        initView(context);
-    }
-
-    public TextureRenderView(Context context, AttributeSet attrs) {
-        super(context, attrs);
-        initView(context);
-    }
-
-    public TextureRenderView(Context context, AttributeSet attrs, int defStyleAttr) {
-        super(context, attrs, defStyleAttr);
-        initView(context);
-    }
-
-    @TargetApi(Build.VERSION_CODES.LOLLIPOP)
-    public TextureRenderView(Context context, AttributeSet attrs, int defStyleAttr, int defStyleRes) {
-        super(context, attrs, defStyleAttr, defStyleRes);
-        initView(context);
-    }
-
-    private void initView(Context context) {
-        mMeasureHelper = new MeasureHelper(this);
-        mSurfaceCallback = new SurfaceCallback(this);
-        setSurfaceTextureListener(mSurfaceCallback);
-    }
-
-    @Override
-    public View getView() {
-        return this;
-    }
-
-    @Override
-    public boolean shouldWaitForResize() {
-        return false;
-    }
-
-    @Override
-    protected void onDetachedFromWindow() {
-        mSurfaceCallback.willDetachFromWindow();
-        super.onDetachedFromWindow();
-        mSurfaceCallback.didDetachFromWindow();
-    }
-
-    //--------------------
-    // Layout & Measure
-    //--------------------
-    @Override
-    public void setVideoSize(int videoWidth, int videoHeight) {
-        if (videoWidth > 0 && videoHeight > 0) {
-            mMeasureHelper.setVideoSize(videoWidth, videoHeight);
-            requestLayout();
-        }
-    }
-
-    @Override
-    public void setVideoSampleAspectRatio(int videoSarNum, int videoSarDen) {
-        if (videoSarNum > 0 && videoSarDen > 0) {
-            mMeasureHelper.setVideoSampleAspectRatio(videoSarNum, videoSarDen);
-            requestLayout();
-        }
-    }
-
-    @Override
-    public void setVideoRotation(int degree) {
-        mMeasureHelper.setVideoRotation(degree);
-        setRotation(degree);
-    }
-
-    @Override
-    public void setAspectRatio(int aspectRatio) {
-        mMeasureHelper.setAspectRatio(aspectRatio);
-        requestLayout();
-    }
-
-    @Override
-    protected void onMeasure(int widthMeasureSpec, int heightMeasureSpec) {
-        mMeasureHelper.doMeasure(widthMeasureSpec, heightMeasureSpec);
-        setMeasuredDimension(mMeasureHelper.getMeasuredWidth(), mMeasureHelper.getMeasuredHeight());
-    }
-
-    //--------------------
-    // TextureViewHolder
-    //--------------------
-
-    public ISurfaceHolder getSurfaceHolder() {
-        return new InternalSurfaceHolder(this, mSurfaceCallback.mSurfaceTexture, mSurfaceCallback);
-    }
-
-    private static final class InternalSurfaceHolder implements ISurfaceHolder {
-        private TextureRenderView mTextureView;
-        private SurfaceTexture mSurfaceTexture;
-        private ISurfaceTextureHost mSurfaceTextureHost;
-
-        public InternalSurfaceHolder(@NonNull TextureRenderView textureView,
-                                     @Nullable SurfaceTexture surfaceTexture,
-                                     @NonNull ISurfaceTextureHost surfaceTextureHost) {
-            mTextureView = textureView;
-            mSurfaceTexture = surfaceTexture;
-            mSurfaceTextureHost = surfaceTextureHost;
-        }
-
-        @TargetApi(Build.VERSION_CODES.JELLY_BEAN)
-        public void bindToMediaPlayer(IMediaPlayer mp) {
-            if (mp == null)
-                return;
-
-            if ((Build.VERSION.SDK_INT >= Build.VERSION_CODES.JELLY_BEAN) &&
-                    (mp instanceof ISurfaceTextureHolder)) {
-                ISurfaceTextureHolder textureHolder = (ISurfaceTextureHolder) mp;
-                mTextureView.mSurfaceCallback.setOwnSurfaceTexture(false);
-
-                SurfaceTexture surfaceTexture = textureHolder.getSurfaceTexture();
-                if (surfaceTexture != null) {
-                    mTextureView.setSurfaceTexture(surfaceTexture);
-                } else {
-                    textureHolder.setSurfaceTexture(mSurfaceTexture);
-                    textureHolder.setSurfaceTextureHost(mTextureView.mSurfaceCallback);
-                }
-            } else {
-                mp.setSurface(openSurface());
-            }
-        }
-
-        @NonNull
-        @Override
-        public IRenderView getRenderView() {
-            return mTextureView;
-        }
-
-        @Nullable
-        @Override
-        public SurfaceHolder getSurfaceHolder() {
-            return null;
-        }
-
-        @Nullable
-        @Override
-        public SurfaceTexture getSurfaceTexture() {
-            return mSurfaceTexture;
-        }
-
-        @Nullable
-        @Override
-        public Surface openSurface() {
-            if (mSurfaceTexture == null)
-                return null;
-            return new Surface(mSurfaceTexture);
-        }
-    }
-
-    //-------------------------
-    // SurfaceHolder.Callback
-    //-------------------------
-
-    @Override
-    public void addRenderCallback(IRenderCallback callback) {
-        mSurfaceCallback.addRenderCallback(callback);
-    }
-
-    @Override
-    public void removeRenderCallback(IRenderCallback callback) {
-        mSurfaceCallback.removeRenderCallback(callback);
-    }
-
-    private SurfaceCallback mSurfaceCallback;
-
-    private static final class SurfaceCallback implements SurfaceTextureListener, ISurfaceTextureHost {
-        private SurfaceTexture mSurfaceTexture;
-        private boolean mIsFormatChanged;
-        private int mWidth;
-        private int mHeight;
-
-        private boolean mOwnSurfaceTexture = true;
-        private boolean mWillDetachFromWindow = false;
-        private boolean mDidDetachFromWindow = false;
-
-        private WeakReference<TextureRenderView> mWeakRenderView;
-        private Map<IRenderCallback, Object> mRenderCallbackMap = new ConcurrentHashMap<IRenderCallback, Object>();
-
-        public SurfaceCallback(@NonNull TextureRenderView renderView) {
-            mWeakRenderView = new WeakReference<TextureRenderView>(renderView);
-        }
-
-        public void setOwnSurfaceTexture(boolean ownSurfaceTexture) {
-            mOwnSurfaceTexture = ownSurfaceTexture;
-        }
-
-        public void addRenderCallback(@NonNull IRenderCallback callback) {
-            mRenderCallbackMap.put(callback, callback);
-
-            ISurfaceHolder surfaceHolder = null;
-            if (mSurfaceTexture != null) {
-                if (surfaceHolder == null)
-                    surfaceHolder = new InternalSurfaceHolder(mWeakRenderView.get(), mSurfaceTexture, this);
-                callback.onSurfaceCreated(surfaceHolder, mWidth, mHeight);
-            }
-
-            if (mIsFormatChanged) {
-                if (surfaceHolder == null)
-                    surfaceHolder = new InternalSurfaceHolder(mWeakRenderView.get(), mSurfaceTexture, this);
-                callback.onSurfaceChanged(surfaceHolder, 0, mWidth, mHeight);
-            }
-        }
-
-        public void removeRenderCallback(@NonNull IRenderCallback callback) {
-            mRenderCallbackMap.remove(callback);
-        }
-
-        @Override
-        public void onSurfaceTextureAvailable(SurfaceTexture surface, int width, int height) {
-            mSurfaceTexture = surface;
-            mIsFormatChanged = false;
-            mWidth = 0;
-            mHeight = 0;
-
-            ISurfaceHolder surfaceHolder = new InternalSurfaceHolder(mWeakRenderView.get(), surface, this);
-            for (IRenderCallback renderCallback : mRenderCallbackMap.keySet()) {
-                renderCallback.onSurfaceCreated(surfaceHolder, 0, 0);
-            }
-        }
-
-        @Override
-        public void onSurfaceTextureSizeChanged(SurfaceTexture surface, int width, int height) {
-            mSurfaceTexture = surface;
-            mIsFormatChanged = true;
-            mWidth = width;
-            mHeight = height;
-
-            ISurfaceHolder surfaceHolder = new InternalSurfaceHolder(mWeakRenderView.get(), surface, this);
-            for (IRenderCallback renderCallback : mRenderCallbackMap.keySet()) {
-                renderCallback.onSurfaceChanged(surfaceHolder, 0, width, height);
-            }
-        }
-
-        @Override
-        public boolean onSurfaceTextureDestroyed(SurfaceTexture surface) {
-            mSurfaceTexture = surface;
-            mIsFormatChanged = false;
-            mWidth = 0;
-            mHeight = 0;
-
-            ISurfaceHolder surfaceHolder = new InternalSurfaceHolder(mWeakRenderView.get(), surface, this);
-            for (IRenderCallback renderCallback : mRenderCallbackMap.keySet()) {
-                renderCallback.onSurfaceDestroyed(surfaceHolder);
-            }
-
-            Log.d(TAG, "onSurfaceTextureDestroyed: destroy: " + mOwnSurfaceTexture);
-            return mOwnSurfaceTexture;
-        }
-
-        @Override
-        public void onSurfaceTextureUpdated(SurfaceTexture surface) {
-        }
-
-        //-------------------------
-        // ISurfaceTextureHost
-        //-------------------------
-
-        @Override
-        public void releaseSurfaceTexture(SurfaceTexture surfaceTexture) {
-            if (surfaceTexture == null) {
-                Log.d(TAG, "releaseSurfaceTexture: null");
-            } else if (mDidDetachFromWindow) {
-                if (surfaceTexture != mSurfaceTexture) {
-                    Log.d(TAG, "releaseSurfaceTexture: didDetachFromWindow(): release different SurfaceTexture");
-                    surfaceTexture.release();
-                } else if (!mOwnSurfaceTexture) {
-                    Log.d(TAG, "releaseSurfaceTexture: didDetachFromWindow(): release detached SurfaceTexture");
-                    surfaceTexture.release();
-                } else {
-                    Log.d(TAG, "releaseSurfaceTexture: didDetachFromWindow(): already released by TextureView");
-                }
-            } else if (mWillDetachFromWindow) {
-                if (surfaceTexture != mSurfaceTexture) {
-                    Log.d(TAG, "releaseSurfaceTexture: willDetachFromWindow(): release different SurfaceTexture");
-                    surfaceTexture.release();
-                } else if (!mOwnSurfaceTexture) {
-                    Log.d(TAG, "releaseSurfaceTexture: willDetachFromWindow(): re-attach SurfaceTexture to TextureView");
-                    setOwnSurfaceTexture(true);
-                } else {
-                    Log.d(TAG, "releaseSurfaceTexture: willDetachFromWindow(): will released by TextureView");
-                }
-            } else {
-                if (surfaceTexture != mSurfaceTexture) {
-                    Log.d(TAG, "releaseSurfaceTexture: alive: release different SurfaceTexture");
-                    surfaceTexture.release();
-                } else if (!mOwnSurfaceTexture) {
-                    Log.d(TAG, "releaseSurfaceTexture: alive: re-attach SurfaceTexture to TextureView");
-                    setOwnSurfaceTexture(true);
-                } else {
-                    Log.d(TAG, "releaseSurfaceTexture: alive: will released by TextureView");
-                }
-            }
-        }
-
-        public void willDetachFromWindow() {
-            Log.d(TAG, "willDetachFromWindow()");
-            mWillDetachFromWindow = true;
-        }
-
-        public void didDetachFromWindow() {
-            Log.d(TAG, "didDetachFromWindow()");
-            mDidDetachFromWindow = true;
-        }
-    }
-
-    //--------------------
-    // Accessibility
-    //--------------------
-
-    @Override
-    public void onInitializeAccessibilityEvent(AccessibilityEvent event) {
-        super.onInitializeAccessibilityEvent(event);
-        event.setClassName(TextureRenderView.class.getName());
-    }
-
-    @Override
-    public void onInitializeAccessibilityNodeInfo(AccessibilityNodeInfo info) {
-        super.onInitializeAccessibilityNodeInfo(info);
-        info.setClassName(TextureRenderView.class.getName());
-    }
-}

+ 0 - 63
app/src/main/java/com/edufound/reader/ijkplayer/services/MediaPlayerService.java

@@ -1,63 +0,0 @@
-/*
- * Copyright (C) 2015 Bilibili
- * Copyright (C) 2015 Zhang Rui <bbcallen@gmail.com>
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- *      http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package com.edufound.reader.ijkplayer.services;
-
-import android.app.Service;
-import android.content.Context;
-import android.content.Intent;
-import android.os.IBinder;
-
-import io.reactivex.rxjava3.annotations.Nullable;
-import tv.danmaku.ijk.media.player.IMediaPlayer;
-
-public class MediaPlayerService extends Service {
-    private static IMediaPlayer sMediaPlayer;
-
-    public static Intent newIntent(Context context) {
-        Intent intent = new Intent(context, MediaPlayerService.class);
-        return intent;
-    }
-
-    public static void intentToStart(Context context) {
-        context.startService(newIntent(context));
-    }
-
-    public static void intentToStop(Context context) {
-        context.stopService(newIntent(context));
-    }
-
-    @Nullable
-    @Override
-    public IBinder onBind(Intent intent) {
-        return null;
-    }
-
-    public static void setMediaPlayer(IMediaPlayer mp) {
-        if (sMediaPlayer != null && sMediaPlayer != mp) {
-            if (sMediaPlayer.isPlaying())
-                sMediaPlayer.stop();
-            sMediaPlayer.release();
-            sMediaPlayer = null;
-        }
-        sMediaPlayer = mp;
-    }
-
-    public static IMediaPlayer getMediaPlayer() {
-        return sMediaPlayer;
-    }
-}

+ 6 - 0
app/src/main/java/com/edufound/reader/model/CommentModel.java

@@ -0,0 +1,6 @@
+package com.edufound.reader.model;
+
+import com.edufound.reader.contract.CommentContract;
+
+public class CommentModel implements CommentContract.Model {
+}

+ 6 - 0
app/src/main/java/com/edufound/reader/model/CustomerServiceModel.java

@@ -0,0 +1,6 @@
+package com.edufound.reader.model;
+
+import com.edufound.reader.contract.CustomerServiceContract;
+
+public class CustomerServiceModel implements CustomerServiceContract.Model {
+}

+ 1 - 0
app/src/main/java/com/edufound/reader/model/LoginAlertModel.java

@@ -3,4 +3,5 @@ package com.edufound.reader.model;
 import com.edufound.reader.contract.LoginAlertContract;
 
 public class LoginAlertModel implements LoginAlertContract.Model {
+    public static final int CHANGE_VCODE_TEXT = 0x22021;
 }

+ 6 - 0
app/src/main/java/com/edufound/reader/model/MessageModel.java

@@ -0,0 +1,6 @@
+package com.edufound.reader.model;
+
+import com.edufound.reader.contract.MessageContract;
+
+public class MessageModel implements MessageContract.Model {
+}

+ 6 - 0
app/src/main/java/com/edufound/reader/model/MyCollectionModel.java

@@ -0,0 +1,6 @@
+package com.edufound.reader.model;
+
+import com.edufound.reader.contract.MyCollectionContract;
+
+public class MyCollectionModel implements MyCollectionContract.Model {
+}

+ 6 - 0
app/src/main/java/com/edufound/reader/model/MyFollowModel.java

@@ -0,0 +1,6 @@
+package com.edufound.reader.model;
+
+import com.edufound.reader.contract.MyCollectionContract;
+
+public class MyFollowModel implements MyCollectionContract.Model {
+}

+ 7 - 0
app/src/main/java/com/edufound/reader/model/MyTabFragmentModel.java

@@ -0,0 +1,7 @@
+package com.edufound.reader.model;
+
+import com.edufound.reader.contract.MyTabFragmentContract;
+
+public class MyTabFragmentModel implements MyTabFragmentContract.Model {
+    public static final int LOAD_GRID = 0x1231;
+}

+ 7 - 0
app/src/main/java/com/edufound/reader/model/OthersRecordModel.java

@@ -0,0 +1,7 @@
+package com.edufound.reader.model;
+
+import com.edufound.reader.contract.OthersRecordContract;
+
+public class OthersRecordModel implements OthersRecordContract.Model {
+    public static final int LOAD_GRID = 0x1231;
+}

+ 6 - 0
app/src/main/java/com/edufound/reader/model/PayModel.java

@@ -0,0 +1,6 @@
+package com.edufound.reader.model;
+
+import com.edufound.reader.contract.PayContract;
+
+public class PayModel implements PayContract.Model {
+}

+ 2 - 2
app/src/main/java/com/edufound/reader/model/VideoModel.java

@@ -1,8 +1,8 @@
 package com.edufound.reader.model;
 
-import com.edufound.reader.contract.VideoContract;
+import com.edufound.reader.contract.RecordContract;
 
-public class VideoModel implements VideoContract.Model {
+public class RecordModel implements RecordContract.Model {
 
 
 //    @Override

+ 6 - 0
app/src/main/java/com/edufound/reader/model/SmallFullVideoModel.java

@@ -0,0 +1,6 @@
+package com.edufound.reader.model;
+
+import com.edufound.reader.contract.SmallFullVideoContract;
+
+public class SmallFullVideoModel implements SmallFullVideoContract.Model {
+}

+ 0 - 7
app/src/main/java/com/edufound/reader/model/UserFragmentModel.java

@@ -1,7 +0,0 @@
-package com.edufound.reader.model;
-
-import com.edufound.reader.contract.UserFragmentContract;
-
-public class UserFragmentModel implements UserFragmentContract.Model {
-    public static final int LOAD_GRID = 0x1231;
-}

+ 6 - 0
app/src/main/java/com/edufound/reader/model/UserInfoSettingModel.java

@@ -0,0 +1,6 @@
+package com.edufound.reader.model;
+
+import com.edufound.reader.contract.UserInfoSettingContract;
+
+public class UserInfoSettingModel implements UserInfoSettingContract.Model {
+}

+ 6 - 0
app/src/main/java/com/edufound/reader/model/WebModel.java

@@ -0,0 +1,6 @@
+package com.edufound.reader.model;
+
+import com.edufound.reader.contract.WebContract;
+
+public class WebModel implements WebContract.Model {
+}

+ 109 - 0
app/src/main/java/com/edufound/reader/popwindow/PopWindowUtil.java

@@ -0,0 +1,109 @@
+package com.edufound.reader.popwindow;
+
+import android.content.Context;
+import android.view.Gravity;
+import android.view.LayoutInflater;
+import android.view.View;
+import android.widget.FrameLayout;
+import android.widget.ImageView;
+import android.widget.PopupWindow;
+
+import com.edufound.reader.R;
+import com.edufound.reader.application.EApplication;
+import com.edufound.reader.cusview.GridRadioGroup;
+import com.orhanobut.logger.Logger;
+
+public class PopWindowUtil {
+    private static PopupWindow mPopupWindow;
+
+    public static void showExitAppWindow(Context context, View parent) {
+        View dialog_view = LayoutInflater.from(context).inflate(R.layout.popupwindow_exit_app, null);
+        dialog_view.setFocusable(true);
+        ImageView image = dialog_view.findViewById(R.id.popupwindow_exit_app_image);
+        FrameLayout exit = dialog_view.findViewById(R.id.popupwindow_exit_app_ok);
+        FrameLayout cancel = dialog_view.findViewById(R.id.popupwindow_exit_app_cancel);
+        exit.setOnClickListener(new View.OnClickListener() {
+            @Override
+            public void onClick(View view) {
+                EApplication.killAppProcess(context);
+            }
+        });
+        cancel.setOnClickListener(new View.OnClickListener() {
+            @Override
+            public void onClick(View view) {
+                mPopupWindow.dismiss();
+            }
+        });
+        mPopupWindow = new PopupWindow(dialog_view, FrameLayout.LayoutParams.MATCH_PARENT, FrameLayout.LayoutParams.MATCH_PARENT);
+        mPopupWindow.setFocusable(true);
+        mPopupWindow.showAtLocation(parent, Gravity.CENTER, 0, 0);
+        mPopupWindow.showAtLocation(parent, Gravity.CENTER, 0, 0);
+    }
+
+    public static void showSelectGradeWindow(Context context, View parent, int checked) {
+        View dialog_view = LayoutInflater.from(context).inflate(R.layout.popupwindow_select_grade, null);
+        dialog_view.setFocusable(true);
+        FrameLayout btn_ok = dialog_view.findViewById(R.id.popupwindow_select_ok);
+        GridRadioGroup gridRadioGroup = dialog_view.findViewById(R.id.popupwindow_select_grade_gridgroup);
+        int id = 0;
+        switch (checked) {
+            case 0:
+                id = R.id.popupwindow_select_grade_one;
+                break;
+            case 1:
+                id = R.id.popupwindow_select_grade_two;
+                break;
+            case 2:
+                id = R.id.popupwindow_select_grade_three;
+                break;
+            case 3:
+                id = R.id.popupwindow_select_grade_four;
+                break;
+            case 4:
+                id = R.id.popupwindow_select_grade_pre;
+                break;
+        }
+        gridRadioGroup.check(id);
+        gridRadioGroup.setOnCheckedChangeListener(new GridRadioGroup.OnCheckedChangeListener() {
+            @Override
+            public void onCheckedChanged(GridRadioGroup group, int checkedId) {
+                Logger.e("checkedId:" + checkedId);
+                group.check(checkedId);
+            }
+        });
+        btn_ok.setOnClickListener(new View.OnClickListener() {
+            @Override
+            public void onClick(View view) {
+                mPopupWindow.dismiss();
+            }
+        });
+        mPopupWindow = new PopupWindow(dialog_view, FrameLayout.LayoutParams.MATCH_PARENT, FrameLayout.LayoutParams.MATCH_PARENT);
+        mPopupWindow.setFocusable(true);
+        mPopupWindow.showAtLocation(parent, Gravity.CENTER, 0, 0);
+    }
+
+
+    public static void showExitLoginWindow(Context context, View parent) {
+        View dialog_view = LayoutInflater.from(context).inflate(R.layout.popupwindow_exit_login, null);
+        dialog_view.setFocusable(true);
+        ImageView image = dialog_view.findViewById(R.id.popupwindow_exit_login_image);
+        FrameLayout exit = dialog_view.findViewById(R.id.popupwindow_exit_login_ok);
+        FrameLayout cancel = dialog_view.findViewById(R.id.popupwindow_exit_login_cancel);
+        exit.setOnClickListener(new View.OnClickListener() {
+            @Override
+            public void onClick(View view) {
+            }
+        });
+        cancel.setOnClickListener(new View.OnClickListener() {
+            @Override
+            public void onClick(View view) {
+                mPopupWindow.dismiss();
+            }
+        });
+        mPopupWindow = new PopupWindow(dialog_view, FrameLayout.LayoutParams.MATCH_PARENT, FrameLayout.LayoutParams.MATCH_PARENT);
+        mPopupWindow.setFocusable(true);
+        mPopupWindow.showAtLocation(parent, Gravity.CENTER, 0, 0);
+        mPopupWindow.showAtLocation(parent, Gravity.CENTER, 0, 0);
+    }
+
+}

+ 27 - 30
app/src/main/java/com/edufound/reader/presenter/CharacterFragmentPresenter.java

@@ -1,6 +1,7 @@
 package com.edufound.reader.presenter;
 
 import android.content.Context;
+import android.content.Intent;
 import android.os.Handler;
 import android.os.Message;
 import android.view.LayoutInflater;
@@ -12,12 +13,12 @@ import android.widget.ImageView;
 import android.widget.TextView;
 
 import com.edufound.reader.R;
+import com.edufound.reader.activity.SmallFullVideoActivity;
 import com.edufound.reader.base.BasePresenter;
 import com.edufound.reader.contract.CharacterFragmentContract;
 import com.edufound.reader.model.CharacterFragmentModel;
 import com.edufound.reader.util.GlideUtils;
 import com.edufound.reader.util.SizeUtils;
-import com.orhanobut.logger.Logger;
 
 import java.util.ArrayList;
 import java.util.List;
@@ -25,26 +26,38 @@ import java.util.List;
 public class CharacterFragmentPresenter extends BasePresenter<CharacterFragmentContract.View> implements CharacterFragmentContract.Presenter {
     Context mContext;
     CharacterFragmentModel mModel;
+    List<Object> mDataList;
+    int mListStart = 0;
+    int mListEnd = 6;
 
     public CharacterFragmentPresenter(Context context) {
         mModel = new CharacterFragmentModel();
         mContext = context;
+
+        mDataList = new ArrayList<>();
+        for (int i = 0; i < 100; i++) {
+            mDataList.add("i=" + i);
+        }
     }
 
+
     @Override
     public void initGridLayout(GridLayout gridLayout) {
-        List<Object> mDataList = new ArrayList<>();
-        for (int i = 0; i < 30; i++) {
-            mDataList.add("i=" + i);
-        }
         gridLayout.setRowCount(2);
-        gridLayout.setColumnCount(mDataList.size() / 2);
-        for (int j = 0; j < mDataList.size(); j++) {
+        int timeCount = 0;
+        for (int j = mListStart; j < mListEnd; j++) {
+            timeCount++;
             Message message = new Message();
             message.obj = gridLayout;
             message.what = CharacterFragmentModel.LOAD_GRID;
             message.arg1 = j;
-            mCharacterHandler.sendMessageDelayed(message, 50 * j);
+            mCharacterHandler.sendMessageDelayed(message, 50 * timeCount);
+        }
+        mListStart = mListEnd;
+        if (mListEnd + 6 > mDataList.size()) {
+            mListEnd = mDataList.size();
+        } else {
+            mListEnd = mListEnd + 6;
         }
     }
 
@@ -63,32 +76,16 @@ public class CharacterFragmentPresenter extends BasePresenter<CharacterFragmentC
         if (mView == null) {
             return;
         }
-        View view = LayoutInflater.from(mContext).inflate(R.layout.adapter_item_record, null);
-        ImageView imgIcon = view.findViewById(R.id.adapter_item_record_icon);
-        TextView name = view.findViewById(R.id.adapter_item_record_name);
-        ImageView imgDel = view.findViewById(R.id.adapter_item_record_del);
-        ImageView imgPriv = view.findViewById(R.id.adapter_item_record_priv);
-        FrameLayout checkLayout = view.findViewById(R.id.adapter_item_record_examine_layout);
+        View view = LayoutInflater.from(mContext).inflate(R.layout.adapter_item_record_authority, null);
+        ImageView imgIcon = view.findViewById(R.id.adapter_item_record_authority_icon);
+        TextView name = view.findViewById(R.id.adapter_item_record_authority_name);
         GlideUtils.loadRoundCircleImage(mContext, "http://p.qpic.cn/videoyun/0/2449_43b6f696980311e59ed467f22794e792_1/640", imgIcon, SizeUtils.dp2px(mContext, 20));
-        if (index < 3) {
-            //测试用
-            checkLayout.setVisibility(View.GONE);
-            imgPriv.setImageResource(R.drawable.adapter_item_record_pub);
-        }
-        mView.addUiClick(imgDel, o -> {
-            gridLayout.removeView(view);
-
-        });
         mView.addUiClick(view, o -> {
-
+            Intent intent = new Intent(mView.getActivity(), SmallFullVideoActivity.class);
+            intent.putExtra("index", index + "");
+            mView.getActivity().startActivity(intent);
         });
 
-        checkLayout.setOnTouchListener(new View.OnTouchListener() {
-            @Override
-            public boolean onTouch(View view, MotionEvent motionEvent) {
-                return true;
-            }
-        });
         name.setText("当前第:" + index + "个");
         GridLayout.LayoutParams params = new GridLayout.LayoutParams(new FrameLayout.LayoutParams(SizeUtils.dp2px(mContext, 415), SizeUtils.dp2px(mContext, 290)));
         params.setMargins(SizeUtils.dp2px(mContext, 10), 0, SizeUtils.dp2px(mContext, 20), SizeUtils.dp2px(mContext, 20));

+ 32 - 0
app/src/main/java/com/edufound/reader/presenter/CommentPresenter.java

@@ -0,0 +1,32 @@
+package com.edufound.reader.presenter;
+
+import android.view.View;
+import android.widget.FrameLayout;
+
+import com.edufound.reader.base.BasePresenter;
+import com.edufound.reader.contract.CommentContract;
+import com.edufound.reader.model.CommentModel;
+
+import java.util.List;
+
+import androidx.recyclerview.widget.RecyclerView;
+
+public class CommentPresenter extends BasePresenter<CommentContract.View> implements CommentContract.Presenter {
+
+
+    CommentModel mModel;
+    List<Object> mDataList;
+
+    public CommentPresenter() {
+        mModel = new CommentModel();
+    }
+
+    @Override
+    public void initComment(RecyclerView rv, FrameLayout noCommentLayout) {
+        if (mDataList == null || mDataList.size() <= 0) {
+            noCommentLayout.setVisibility(View.VISIBLE);
+            rv.setVisibility(View.GONE);
+            return;
+        }
+    }
+}

+ 9 - 0
app/src/main/java/com/edufound/reader/presenter/CustomerServicePresenter.java

@@ -0,0 +1,9 @@
+package com.edufound.reader.presenter;
+
+import com.edufound.reader.base.BasePresenter;
+import com.edufound.reader.contract.CustomerServiceContract;
+
+import androidx.recyclerview.widget.RecyclerView;
+
+public class CustomerServicePresenter extends BasePresenter<CustomerServiceContract.View> implements CustomerServiceContract.Presenter {
+}

+ 89 - 14
app/src/main/java/com/edufound/reader/presenter/LoginAlertPresenter.java

@@ -1,6 +1,9 @@
 package com.edufound.reader.presenter;
 
+import android.content.Intent;
 import android.graphics.Color;
+import android.os.Handler;
+import android.os.Message;
 import android.text.Spannable;
 import android.text.SpannableStringBuilder;
 import android.text.TextPaint;
@@ -14,9 +17,13 @@ import android.widget.FrameLayout;
 import android.widget.TextView;
 import android.widget.Toast;
 
+import com.edufound.reader.R;
+import com.edufound.reader.activity.WebActivity;
 import com.edufound.reader.base.BasePresenter;
 import com.edufound.reader.contract.LoginAlertContract;
+import com.edufound.reader.model.LoginAlertModel;
 import com.edufound.reader.util.Consts;
+import com.orhanobut.logger.Logger;
 
 import java.util.ArrayList;
 import java.util.List;
@@ -25,9 +32,17 @@ import io.reactivex.rxjava3.annotations.NonNull;
 
 public class LoginAlertPresenter extends BasePresenter<LoginAlertContract.View> implements LoginAlertContract.Presenter {
 
+
+    LoginAlertModel mModel;
     List<Integer> leftBrackets = new ArrayList<>();
     List<Integer> rightBrackets = new ArrayList<>();
     String mServiceText = "点击登录表示您已阅读并同意《用户隐私政策》和《服务协议》。";
+    int getVCode;
+    int mVCodeResCount = 60;
+
+    public LoginAlertPresenter() {
+        mModel = new LoginAlertModel();
+    }
 
 
     @Override
@@ -61,14 +76,77 @@ public class LoginAlertPresenter extends BasePresenter<LoginAlertContract.View>
     @Override
     public void getVCode(String phoneNum) {
         if (isMobileNO(phoneNum)) {
-            //正常
-            
+            //正常,获取验证码
+            getVCode = 9999;
+            ((FrameLayout) mView.getVCodeText().getParent()).setClickable(false);
+            ((FrameLayout) mView.getVCodeText().getParent()).setEnabled(false);
+//            ((FrameLayout) mView.getVCodeText().getParent()).setBackgroundColor(mView.getActivity().getResources().getColor(R.color.translucent_background));
+            mView.getVCodeText().setText(String.valueOf(mVCodeResCount));
+            mLoginAlertHandler.sendEmptyMessageDelayed(LoginAlertModel.CHANGE_VCODE_TEXT, 1000);
+
         } else {
             Toast.makeText(mView.getActivity(), "请输入正确的手机号", Toast.LENGTH_SHORT).show();
             //不正常
         }
     }
 
+    @Override
+    public void Login(String phoneNum, String inputVCode) {
+
+        if (isMobileNO(phoneNum)) {
+            //手机号没有改过,正常。获取了验证码了,判断验证码
+            if (TextUtils.isEmpty(inputVCode)) {
+                Toast.makeText(mView.getActivity(), "请输入验证码", Toast.LENGTH_SHORT).show();
+                return;
+            } else {
+                if (!mView.getCheckBox().isChecked()) {
+                    Toast.makeText(mView.getActivity(), "请勾选用户隐私政策和服务协议", Toast.LENGTH_SHORT).show();
+                    return;
+                }
+                if (Integer.valueOf(inputVCode) == getVCode) {
+                    //输入的和返回的是一样的
+                    //请求接口,根据phoneNum,Integer.valueOf(inputVCode)
+                } else {
+                    Toast.makeText(mView.getActivity(), "验证码输入错误", Toast.LENGTH_SHORT).show();
+                }
+            }
+
+
+        } else {
+            Toast.makeText(mView.getActivity(), "请输入正确的手机号", Toast.LENGTH_SHORT).show();
+            //不正常
+        }
+    }
+
+    @Override
+    public void activityDestory() {
+        mLoginAlertHandler.removeMessages(LoginAlertModel.CHANGE_VCODE_TEXT);
+        mLoginAlertHandler = null;
+    }
+
+    Handler mLoginAlertHandler = new Handler(new Handler.Callback() {
+        @Override
+        public boolean handleMessage(@androidx.annotation.NonNull Message message) {
+            switch (message.what) {
+                case LoginAlertModel.CHANGE_VCODE_TEXT:
+                    if (mVCodeResCount > 1) {
+                        mVCodeResCount--;
+                        mView.getVCodeText().setText(String.valueOf(mVCodeResCount));
+                        mLoginAlertHandler.sendEmptyMessageDelayed(LoginAlertModel.CHANGE_VCODE_TEXT, 1000);
+                    } else {
+                        mVCodeResCount = 60;
+                        mView.getVCodeText().setText("获取验证码");
+                        ((FrameLayout) mView.getVCodeText().getParent()).setClickable(true);
+                        ((FrameLayout) mView.getVCodeText().getParent()).setEnabled(true);
+//                        ((FrameLayout) mView.getVCodeText().getParent()).setBackgroundResource(R.drawable.activity_loginalert_verificationcode_bg);
+                    }
+
+                    break;
+            }
+            return false;
+        }
+    });
+
 
     private List<Integer> getChildIndexFromString(String parent, String child) {
         int startIndex = 0;
@@ -83,24 +161,19 @@ public class LoginAlertPresenter extends BasePresenter<LoginAlertContract.View>
     }
 
 
-    void lookPrivacy(int index) {
-        WebView webview = new WebView(Consts.getmApplicAtion());
-        webview.setLayoutParams(new FrameLayout.LayoutParams(ViewGroup.LayoutParams.MATCH_PARENT, ViewGroup.LayoutParams.MATCH_PARENT));
+    private void lookPrivacy(int index) {
         String url = "";
         switch (index) {
             case 0:
-                url = "http://m-xyyf-web.ai160.com/res/protocol/service.htm";
+                url = Consts.getAgreementServicesUrl();
                 break;
             case 1:
-                url = "http://m-xyyf-web.ai160.com/res/protocol/private.htm";
+                url = Consts.getPrivServiceUrl();
                 break;
         }
-        webview.getSettings().setUseWideViewPort(true);
-        webview.getSettings().setLoadWithOverviewMode(true);
-        webview.getSettings().setJavaScriptEnabled(true);
-        webview.getSettings().setDomStorageEnabled(true);
-        webview.loadUrl(url);
-        mView.getRootView().addView(webview);
+        Intent intent = new Intent(mView.getActivity(), WebActivity.class);
+        intent.putExtra("loadUrl", url);
+        mView.getActivity().startActivity(intent);
     }
 
 
@@ -113,7 +186,7 @@ public class LoginAlertPresenter extends BasePresenter<LoginAlertContract.View>
      * @param mobileNums
      * @return 待检测的字符串
      */
-    public boolean isMobileNO(String mobileNums) {
+    private boolean isMobileNO(String mobileNums) {
         String telRegex = "^((13[0-9])|(14[5,7,9])|(15[^4])|(18[0-9])|(17[0,1,3,5,6,7,8]))\\d{8}$";// "[1]"代表第1位为数字1,"[358]"代表第二位可以为3、5、8中的一个,"\\d{9}"代表后面是可以是0~9的数字,有9位。
         if (TextUtils.isEmpty(mobileNums)) {
             return false;
@@ -121,4 +194,6 @@ public class LoginAlertPresenter extends BasePresenter<LoginAlertContract.View>
             return mobileNums.matches(telRegex);
         }
     }
+
+
 }

+ 32 - 6
app/src/main/java/com/edufound/reader/presenter/MainPresenter.java

@@ -2,17 +2,18 @@ package com.edufound.reader.presenter;
 
 import android.content.Intent;
 import android.view.KeyEvent;
+import android.widget.RadioButton;
 import android.widget.RadioGroup;
 
 import com.edufound.reader.R;
 import com.edufound.reader.activity.LoginAlertActivity;
-import com.edufound.reader.application.EApplication;
 import com.edufound.reader.base.BasePresenter;
 import com.edufound.reader.contract.MainContract;
 import com.edufound.reader.fragment.CharacterFragment;
 import com.edufound.reader.fragment.RecommendFragment;
-import com.edufound.reader.fragment.UserFragment;
+import com.edufound.reader.fragment.MyTabFragment;
 import com.edufound.reader.model.MainModel;
+import com.edufound.reader.popwindow.PopWindowUtil;
 import com.edufound.reader.util.Consts;
 import com.orhanobut.logger.Logger;
 
@@ -22,17 +23,18 @@ import androidx.fragment.app.FragmentTransaction;
 
 public class MainPresenter extends BasePresenter<MainContract.View> implements MainContract.Presenter {
     MainModel mModel;
-    UserFragment mUserFragment;
+    MyTabFragment mUserFragment;
     RecommendFragment mRecommendFragment;
     FragmentManager mFragmentManager;
     RecommendFragment mFollowFragment;
     CharacterFragment mCharacterFragment;
-
+    int mRadioCheckIndex = 0;
+    boolean showSelectGrade = true;
 
     public MainPresenter(FragmentManager fragmentManager) {
         mModel = new MainModel();
         mFragmentManager = fragmentManager;
-        mUserFragment = new UserFragment();
+        mUserFragment = new MyTabFragment();
         mRecommendFragment = new RecommendFragment(0);
         mFollowFragment = new RecommendFragment(1);
         mCharacterFragment = new CharacterFragment();
@@ -47,24 +49,44 @@ public class MainPresenter extends BasePresenter<MainContract.View> implements M
                 //我的
                 Logger.e("我的");
 //                if (checkLogin()) {
+//                    mRadioCheckIndex = 0;
 //                    changeFragmentLayout(mUserFragment);
+//                } else {
+//                    ((RadioButton) radioGroup.getChildAt(mRadioCheckIndex)).setChecked(true);
 //                }
                 changeFragmentLayout(mUserFragment);
                 break;
             case R.id.main_left_tab_layout_recommend:
                 //推荐
+                mRadioCheckIndex = 1;
+                ((RadioButton) radioGroup.getChildAt(mRadioCheckIndex)).setChecked(true);
                 Logger.e("推荐");
                 changeFragmentLayout(mRecommendFragment);
+                if (showSelectGrade) {
+                    radioGroup.postDelayed(new Runnable() {
+                        @Override
+                        public void run() {
+                            PopWindowUtil.showSelectGradeWindow(mView.getActivity(), mView.getRootView(), 0);
+                            showSelectGrade = false;
+                        }
+                    }, 500);
+
+                }
                 break;
             case R.id.main_left_tab_layout_follow:
                 //关注
                 Logger.e("关注");
                 if (checkLogin()) {
+                    mRadioCheckIndex = 2;
                     changeFragmentLayout(mFollowFragment);
+                } else {
+                    ((RadioButton) radioGroup.getChildAt(mRadioCheckIndex)).setChecked(true);
                 }
                 break;
             case R.id.main_left_tab_layout_character:
                 //任务
+                mRadioCheckIndex = 3;
+                ((RadioButton) radioGroup.getChildAt(mRadioCheckIndex)).setChecked(true);
                 Logger.e("任务");
                 changeFragmentLayout(mCharacterFragment);
                 break;
@@ -111,7 +133,11 @@ public class MainPresenter extends BasePresenter<MainContract.View> implements M
         switch (keyCode) {
             case KeyEvent.KEYCODE_BACK:
             case KeyEvent.KEYCODE_ESCAPE:
-                EApplication.killAppProcess(mView.getActivity());
+                PopWindowUtil.showExitAppWindow(mView.getActivity(), mView.getRootView());
+//                EApplication.killAppProcess(mView.getActivity());
+//                PupWindowUtil.showSelectGradeWindow(mView.getActivity(), mView.getRootView(), 3);
+//                PupWindowUtil.showExitLoginWindow(mView.getActivity(), mView.getRootView());
+
                 return true;
         }
 

+ 71 - 0
app/src/main/java/com/edufound/reader/presenter/MessagePresenter.java

@@ -0,0 +1,71 @@
+package com.edufound.reader.presenter;
+
+import android.view.View;
+
+import com.edufound.reader.adapter.MessageItemAdapter;
+import com.edufound.reader.base.BasePresenter;
+import com.edufound.reader.contract.MessageContract;
+import com.orhanobut.logger.Logger;
+
+import java.util.ArrayList;
+import java.util.List;
+
+import androidx.recyclerview.widget.LinearLayoutManager;
+import androidx.recyclerview.widget.RecyclerView;
+
+public class MessagePresenter extends BasePresenter<MessageContract.View> implements MessageContract.Presenter {
+
+
+    List<Object> mDataList;
+    MessageItemAdapter mMessageItemAdapter;
+
+    public MessagePresenter() {
+        mDataList = new ArrayList<>();
+        for (int i = 0; i < 30; i++) {
+            mDataList.add("i=" + i);
+        }
+    }
+
+    @Override
+    public void initRecyclerView(RecyclerView rv) {
+        mMessageItemAdapter = new MessageItemAdapter(mView.getActivity(), mDataList);
+        LinearLayoutManager linearLayoutManager = new LinearLayoutManager(mView.getActivity());
+        linearLayoutManager.setOrientation(LinearLayoutManager.VERTICAL);
+        rv.setLayoutManager(linearLayoutManager);
+        rv.addOnChildAttachStateChangeListener(new RecyclerView.OnChildAttachStateChangeListener() {
+            @Override
+            public void onChildViewAttachedToWindow(@androidx.annotation.NonNull View view) {
+                addMoreData(rv);
+            }
+
+            @Override
+            public void onChildViewDetachedFromWindow(@androidx.annotation.NonNull View view) {
+
+            }
+        });
+        rv.setAdapter(mMessageItemAdapter);
+    }
+
+    public void addMoreData(RecyclerView rv) {
+        //获取当前显示的View 的数据
+        int childCount = rv.getChildCount();
+        //获取最后一具 Item 对应的View
+        View childAt = rv.getChildAt(childCount - 1);
+        //获取当前军舰中显示的最后一个 Item 的位置  Postion
+        int childLayoutPosition = rv.getChildLayoutPosition(childAt);
+        //如果不是最后一个就向下滑动
+
+        if (childLayoutPosition < rv.getAdapter().getItemCount() - 2) {
+        } else {
+            Logger.e("倒数第二个,添加数据");
+            mDataList.addAll(mDataList);
+            mMessageItemAdapter.addMored(mDataList);
+            rv.post(new Runnable() {
+                @Override
+                public void run() {
+                    mMessageItemAdapter.notifyDataSetChanged();
+                }
+            });
+        }
+    }
+}

+ 102 - 0
app/src/main/java/com/edufound/reader/presenter/MyCollectionPresenter.java

@@ -0,0 +1,102 @@
+package com.edufound.reader.presenter;
+
+import android.graphics.Rect;
+import android.view.View;
+
+import com.edufound.reader.adapter.MyCollectionItemAdapter;
+import com.edufound.reader.base.BasePresenter;
+import com.edufound.reader.contract.MyCollectionContract;
+import com.edufound.reader.util.SizeUtils;
+import com.orhanobut.logger.Logger;
+
+import java.util.ArrayList;
+import java.util.List;
+
+import androidx.recyclerview.widget.GridLayoutManager;
+import androidx.recyclerview.widget.LinearLayoutManager;
+import androidx.recyclerview.widget.RecyclerView;
+import io.reactivex.rxjava3.annotations.NonNull;
+
+public class MyCollectionPresenter extends BasePresenter<MyCollectionContract.View> implements MyCollectionContract.Presenter {
+    List<Object> mDataList;
+    MyCollectionItemAdapter myCollectionItemAdapter;
+
+    public MyCollectionPresenter() {
+        mDataList = new ArrayList<>();
+        for (int i = 0; i < 30; i++) {
+            mDataList.add("i=" + i);
+        }
+    }
+
+    @Override
+    public void initRecyclerView(RecyclerView rv) {
+//
+        myCollectionItemAdapter = new MyCollectionItemAdapter(mView.getActivity(), mDataList);
+        GridLayoutManager gridLayoutManager = new GridLayoutManager(mView.getActivity(), 2);
+        gridLayoutManager.setOrientation(LinearLayoutManager.HORIZONTAL);
+        rv.addItemDecoration(new MyCollectionItemDecoration(
+                SizeUtils.dp2px(mView.getActivity(), 27f),
+                SizeUtils.dp2px(mView.getActivity(), 27f)));
+        rv.setLayoutManager(gridLayoutManager);
+        rv.addOnChildAttachStateChangeListener(new RecyclerView.OnChildAttachStateChangeListener() {
+            @Override
+            public void onChildViewAttachedToWindow(@androidx.annotation.NonNull View view) {
+                addMoreData(rv);
+            }
+
+            @Override
+            public void onChildViewDetachedFromWindow(@androidx.annotation.NonNull View view) {
+
+            }
+        });
+        rv.setAdapter(myCollectionItemAdapter);
+    }
+
+    public void addMoreData(RecyclerView rv) {
+        //获取当前显示的View 的数据
+        int childCount = rv.getChildCount();
+        //获取最后一具 Item 对应的View
+        View childAt = rv.getChildAt(childCount - 1);
+        //获取当前军舰中显示的最后一个 Item 的位置  Postion
+        int childLayoutPosition = rv.getChildLayoutPosition(childAt);
+        //如果不是最后一个就向下滑动
+
+        if (childLayoutPosition < rv.getAdapter().getItemCount() - 2) {
+        } else {
+            Logger.e("倒数第二个,添加数据");
+            mDataList.addAll(mDataList);
+            myCollectionItemAdapter.addMored(mDataList);
+            rv.post(new Runnable() {
+                @Override
+                public void run() {
+                    myCollectionItemAdapter.notifyDataSetChanged();
+                }
+            });
+        }
+    }
+}
+
+class MyCollectionItemDecoration extends RecyclerView.ItemDecoration {
+
+    private int mRowSpacing;//行间距
+    private int mColumnSpacing;// 列间距
+
+    /**
+     * @param rowSpacing    行间距
+     * @param columnSpacing 列间距
+     */
+    public MyCollectionItemDecoration(int rowSpacing, int columnSpacing) {
+        this.mRowSpacing = rowSpacing;
+        this.mColumnSpacing = columnSpacing;
+    }
+
+    @Override
+    public void getItemOffsets(@NonNull Rect outRect, @NonNull View view, @NonNull RecyclerView parent, @NonNull RecyclerView.State state) {
+        int position = parent.getChildAdapterPosition(view);
+        outRect.bottom = mRowSpacing;
+        outRect.right = mColumnSpacing;
+        if (position < 2) {
+            outRect.left = mColumnSpacing;
+        }
+    }
+}

+ 108 - 0
app/src/main/java/com/edufound/reader/presenter/MyFollowPresenter.java

@@ -0,0 +1,108 @@
+package com.edufound.reader.presenter;
+
+import android.graphics.Rect;
+import android.view.View;
+
+import com.edufound.reader.adapter.MyFollowItemAdapter;
+import com.edufound.reader.base.BasePresenter;
+import com.edufound.reader.contract.MyFollowContract;
+import com.edufound.reader.util.SizeUtils;
+import com.orhanobut.logger.Logger;
+
+import java.util.ArrayList;
+import java.util.List;
+
+import androidx.recyclerview.widget.GridLayoutManager;
+import androidx.recyclerview.widget.LinearLayoutManager;
+import androidx.recyclerview.widget.RecyclerView;
+import io.reactivex.rxjava3.annotations.NonNull;
+
+public class MyFollowPresenter extends BasePresenter<MyFollowContract.View> implements MyFollowContract.Presenter {
+    List<Object> mDataList;
+    MyFollowItemAdapter myFollowItemAdapter;
+
+    public MyFollowPresenter() {
+        mDataList = new ArrayList<>();
+        for (int i = 0; i < 30; i++) {
+            mDataList.add("i=" + i);
+        }
+    }
+
+    @Override
+    public void initRecyclerView(RecyclerView rv) {
+//
+        myFollowItemAdapter = new MyFollowItemAdapter(mView.getActivity(), mDataList);
+        GridLayoutManager gridLayoutManager = new GridLayoutManager(mView.getActivity(), 3);
+        gridLayoutManager.setOrientation(LinearLayoutManager.HORIZONTAL);
+        gridLayoutManager.setSpanSizeLookup(new GridLayoutManager.SpanSizeLookup() {
+            @Override
+            public int getSpanSize(int position) {
+                return (myFollowItemAdapter.isHeaderView(position) || myFollowItemAdapter.isBottomView(position)) ? gridLayoutManager.getSpanCount() : 1;
+            }
+        });
+        rv.addItemDecoration(new MyFollowItemDecoration(
+                SizeUtils.dp2px(mView.getActivity(), 27f),
+                SizeUtils.dp2px(mView.getActivity(), 27f)));
+        rv.setLayoutManager(gridLayoutManager);
+        rv.addOnChildAttachStateChangeListener(new RecyclerView.OnChildAttachStateChangeListener() {
+            @Override
+            public void onChildViewAttachedToWindow(@androidx.annotation.NonNull View view) {
+                addMoreData(rv);
+            }
+
+            @Override
+            public void onChildViewDetachedFromWindow(@androidx.annotation.NonNull View view) {
+
+            }
+        });
+        rv.setAdapter(myFollowItemAdapter);
+    }
+
+    public void addMoreData(RecyclerView rv) {
+        //获取当前显示的View 的数据
+        int childCount = rv.getChildCount();
+        //获取最后一具 Item 对应的View
+        View childAt = rv.getChildAt(childCount - 1);
+        //获取当前军舰中显示的最后一个 Item 的位置  Postion
+        int childLayoutPosition = rv.getChildLayoutPosition(childAt);
+        //如果不是最后一个就向下滑动
+
+        if (childLayoutPosition < rv.getAdapter().getItemCount() - 2) {
+        } else {
+            Logger.e("倒数第二个,添加数据");
+            mDataList.addAll(mDataList);
+            myFollowItemAdapter.addMored(mDataList);
+            rv.post(new Runnable() {
+                @Override
+                public void run() {
+                    myFollowItemAdapter.notifyDataSetChanged();
+                }
+            });
+        }
+    }
+}
+
+class MyFollowItemDecoration extends RecyclerView.ItemDecoration {
+
+    private int mRowSpacing;//行间距
+    private int mColumnSpacing;// 列间距
+
+    /**
+     * @param rowSpacing    行间距
+     * @param columnSpacing 列间距
+     */
+    public MyFollowItemDecoration(int rowSpacing, int columnSpacing) {
+        this.mRowSpacing = rowSpacing;
+        this.mColumnSpacing = columnSpacing;
+    }
+
+    @Override
+    public void getItemOffsets(@NonNull Rect outRect, @NonNull View view, @NonNull RecyclerView parent, @NonNull RecyclerView.State state) {
+        int position = parent.getChildAdapterPosition(view);
+        outRect.bottom = mRowSpacing;
+        outRect.right = mColumnSpacing;
+        if (position < 3) {
+            outRect.left = mColumnSpacing;
+        }
+    }
+}

+ 45 - 24
app/src/main/java/com/edufound/reader/presenter/UserFragmentPresenter.java

@@ -1,6 +1,7 @@
 package com.edufound.reader.presenter;
 
 import android.content.Context;
+import android.content.Intent;
 import android.os.Handler;
 import android.os.Message;
 import android.view.LayoutInflater;
@@ -12,27 +13,34 @@ import android.widget.ImageView;
 import android.widget.TextView;
 
 import com.edufound.reader.R;
+import com.edufound.reader.activity.SmallFullVideoActivity;
 import com.edufound.reader.base.BasePresenter;
-import com.edufound.reader.contract.UserFragmentContract;
+import com.edufound.reader.contract.MyTabFragmentContract;
 import com.edufound.reader.model.CharacterFragmentModel;
-import com.edufound.reader.model.UserFragmentModel;
+import com.edufound.reader.model.MyTabFragmentModel;
 import com.edufound.reader.util.GlideUtils;
 import com.edufound.reader.util.SizeUtils;
-import com.orhanobut.logger.Logger;
 
-import java.util.ArrayList;
 import java.util.List;
 
 import androidx.recyclerview.widget.RecyclerView;
 
-public class UserFragmentPresenter extends BasePresenter<UserFragmentContract.View> implements UserFragmentContract.Presenter {
+public class MyTabFragmentPresenter extends BasePresenter<MyTabFragmentContract.View> implements MyTabFragmentContract.Presenter {
 
-    UserFragmentModel mModel;
+    MyTabFragmentModel mModel;
     Context mContext;
+    List<Object> mDataList;
+    int mListStart = 0;
+    int mListEnd = 6;
 
-    public UserFragmentPresenter(Context context) {
+    public MyTabFragmentPresenter(Context context) {
         mContext = context;
-        mModel = new UserFragmentModel();
+        mModel = new MyTabFragmentModel();
+
+//        mDataList = new ArrayList<>();
+//        for (int i = 0; i < 35; i++) {
+//            mDataList.add("i=" + i);
+//        }
     }
 
     @Override
@@ -65,26 +73,34 @@ public class UserFragmentPresenter extends BasePresenter<UserFragmentContract.Vi
 
 
     @Override
-    public void initGridLayout(GridLayout gridLayout) {
-        List<Object> mDataList = new ArrayList<>();
-        for (int i = 0; i < 30; i++) {
-            mDataList.add("i=" + i);
+    public void initGridLayout(GridLayout gridLayout, FrameLayout norecordlayout) {
+        if (mDataList == null || mDataList.size() <= 0) {
+            norecordlayout.setVisibility(View.VISIBLE);
+            gridLayout.setVisibility(View.GONE);
+            return;
         }
         gridLayout.setRowCount(2);
-        gridLayout.setColumnCount(mDataList.size() / 2);
-        for (int j = 0; j < mDataList.size(); j++) {
+        int timeCount = 0;
+        for (int j = mListStart; j < mListEnd; j++) {
+            timeCount++;
             Message message = new Message();
             message.obj = gridLayout;
             message.what = CharacterFragmentModel.LOAD_GRID;
             message.arg1 = j;
-            mUserFragmentHandler.sendMessageDelayed(message, 50 * j);
+            mUserFragmentHandler.sendMessageDelayed(message, 50 * timeCount);
+        }
+        mListStart = mListEnd;
+        if (mListEnd + 6 > mDataList.size()) {
+            mListEnd = mDataList.size();
+        } else {
+            mListEnd = mListEnd + 6;
         }
     }
 
 
     @Override
     public void onDestory(GridLayout layout) {
-        mUserFragmentHandler.removeMessages(UserFragmentModel.LOAD_GRID);
+        mUserFragmentHandler.removeMessages(MyTabFragmentModel.LOAD_GRID);
         mUserFragmentHandler = null;
         layout.removeAllViews();
         layout = null;
@@ -97,12 +113,12 @@ public class UserFragmentPresenter extends BasePresenter<UserFragmentContract.Vi
         if (mView == null) {
             return;
         }
-        View view = LayoutInflater.from(mContext).inflate(R.layout.adapter_item_record, null);
-        ImageView imgIcon = view.findViewById(R.id.adapter_item_record_icon);
-        TextView name = view.findViewById(R.id.adapter_item_record_name);
-        ImageView imgDel = view.findViewById(R.id.adapter_item_record_del);
-        ImageView imgPriv = view.findViewById(R.id.adapter_item_record_priv);
-        FrameLayout checkLayout = view.findViewById(R.id.adapter_item_record_examine_layout);
+        View view = LayoutInflater.from(mContext).inflate(R.layout.adapter_item_record_user, null);
+        ImageView imgIcon = view.findViewById(R.id.adapter_item_record_user_icon);
+        TextView name = view.findViewById(R.id.adapter_item_record_user_name);
+        ImageView imgDel = view.findViewById(R.id.adapter_item_record_user_del);
+        ImageView imgPriv = view.findViewById(R.id.adapter_item_record_user_priv);
+        FrameLayout checkLayout = view.findViewById(R.id.adapter_item_record_user_examine_layout);
         GlideUtils.loadRoundCircleImage(mContext, "http://p.qpic.cn/videoyun/0/2449_43b6f696980311e59ed467f22794e792_1/640", imgIcon, SizeUtils.dp2px(mContext, 20));
         if (index < 3) {
             //测试用
@@ -113,9 +129,14 @@ public class UserFragmentPresenter extends BasePresenter<UserFragmentContract.Vi
             gridLayout.removeView(view);
 
         });
-        mView.addUiClick(view, o -> {
+        mView.addUiClick(imgPriv, o -> {
 
         });
+        mView.addUiClick(view, o -> {
+            Intent intent = new Intent(mView.getActivity(), SmallFullVideoActivity.class);
+            intent.putExtra("index", index + "");
+            mView.getActivity().startActivity(intent);
+        });
 
         checkLayout.setOnTouchListener(new View.OnTouchListener() {
             @Override
@@ -135,7 +156,7 @@ public class UserFragmentPresenter extends BasePresenter<UserFragmentContract.Vi
         @Override
         public boolean handleMessage(Message msg) {
             switch (msg.what) {
-                case UserFragmentModel.LOAD_GRID:
+                case MyTabFragmentModel.LOAD_GRID:
                     setGridItemView((GridLayout) msg.obj, msg.arg1);
                     break;
                 default:

+ 113 - 0
app/src/main/java/com/edufound/reader/presenter/OthersRecordPresenter.java

@@ -0,0 +1,113 @@
+package com.edufound.reader.presenter;
+
+import android.content.Intent;
+import android.os.Handler;
+import android.os.Message;
+import android.view.LayoutInflater;
+import android.view.View;
+import android.widget.FrameLayout;
+import android.widget.GridLayout;
+import android.widget.ImageView;
+import android.widget.TextView;
+
+import com.edufound.reader.R;
+import com.edufound.reader.activity.SmallFullVideoActivity;
+import com.edufound.reader.base.BasePresenter;
+import com.edufound.reader.contract.OthersRecordContract;
+import com.edufound.reader.model.CharacterFragmentModel;
+import com.edufound.reader.model.OthersRecordModel;
+import com.edufound.reader.util.GlideUtils;
+import com.edufound.reader.util.SizeUtils;
+import com.orhanobut.logger.Logger;
+
+import java.util.ArrayList;
+import java.util.List;
+
+public class OthersRecordPresenter extends BasePresenter<OthersRecordContract.View> implements OthersRecordContract.Presenter {
+
+
+    OthersRecordModel mModel;
+    List<Object> mDataList;
+    int mListStart = 0;
+    int mListEnd = 6;
+
+    public OthersRecordPresenter() {
+        mModel = new OthersRecordModel();
+        mDataList = new ArrayList<>();
+        for (int i = 0; i < 20; i++) {
+            mDataList.add("i=" + i);
+        }
+    }
+
+    @Override
+    public void initGridLayout(GridLayout gridLayout, FrameLayout norecordlayout) {
+        if (mDataList == null || mDataList.size() <= 0) {
+            norecordlayout.setVisibility(View.VISIBLE);
+            gridLayout.setVisibility(View.GONE);
+            return;
+        }
+        norecordlayout.setVisibility(View.GONE);
+        gridLayout.setRowCount(2);
+        int timeCount = 0;
+        for (int j = mListStart; j < mListEnd; j++) {
+            timeCount++;
+            Message message = new Message();
+            message.obj = gridLayout;
+            message.what = OthersRecordModel.LOAD_GRID;
+            message.arg1 = j;
+            otherRecordHandler.sendMessageDelayed(message, 50 * timeCount);
+        }
+        mListStart = mListEnd;
+        if (mListEnd + 6 > mDataList.size()) {
+            mListEnd = mDataList.size();
+        } else {
+            mListEnd = mListEnd + 6;
+        }
+    }
+
+    @Override
+    public void onDestory(GridLayout layout) {
+        otherRecordHandler.removeMessages(CharacterFragmentModel.LOAD_GRID);
+        otherRecordHandler = null;
+        layout.removeAllViews();
+        layout = null;
+        mView = null;
+    }
+
+
+    private void setGridItemView(GridLayout gridLayout, int index) {
+        if (mView == null) {
+            return;
+        }
+        View view = LayoutInflater.from(mView.getActivity()).inflate(R.layout.adapter_item_record_authority, null);
+        ImageView imgIcon = view.findViewById(R.id.adapter_item_record_authority_icon);
+        TextView name = view.findViewById(R.id.adapter_item_record_authority_name);
+        GlideUtils.loadRoundCircleImage(mView.getActivity(), "http://p.qpic.cn/videoyun/0/2449_43b6f696980311e59ed467f22794e792_1/640", imgIcon, SizeUtils.dp2px(mView.getActivity(), 20));
+        mView.addUiClick(view, o -> {
+            Intent intent = new Intent(mView.getActivity(), SmallFullVideoActivity.class);
+            intent.putExtra("index", index + "");
+            mView.getActivity().startActivity(intent);
+        });
+
+        name.setText("当前第:" + index + "个");
+        GridLayout.LayoutParams params = new GridLayout.LayoutParams(new FrameLayout.LayoutParams(SizeUtils.dp2px(mView.getActivity(), 415), SizeUtils.dp2px(mView.getActivity(), 290)));
+        params.setMargins(SizeUtils.dp2px(mView.getActivity(), 10), SizeUtils.dp2px(mView.getActivity(), 10), SizeUtils.dp2px(mView.getActivity(), 10), SizeUtils.dp2px(mView.getActivity(), 10));
+        view.setLayoutParams(params);
+        gridLayout.addView(view);
+    }
+
+
+    Handler otherRecordHandler = new Handler(new Handler.Callback() {
+        @Override
+        public boolean handleMessage(Message msg) {
+            switch (msg.what) {
+                case OthersRecordModel.LOAD_GRID:
+                    setGridItemView((GridLayout) msg.obj, msg.arg1);
+                    break;
+                default:
+                    throw new IllegalStateException("Unexpected value: " + msg.what);
+            }
+            return false;
+        }
+    });
+}

+ 7 - 0
app/src/main/java/com/edufound/reader/presenter/PayPresenter.java

@@ -0,0 +1,7 @@
+package com.edufound.reader.presenter;
+
+import com.edufound.reader.base.BasePresenter;
+import com.edufound.reader.contract.PayContract;
+
+public class PayPresenter extends BasePresenter<PayContract.View> implements PayContract.Presenter {
+}

+ 47 - 3
app/src/main/java/com/edufound/reader/presenter/RecommendFragmentPresenter.java

@@ -5,6 +5,7 @@ import android.graphics.Outline;
 import android.view.View;
 import android.view.ViewOutlineProvider;
 import android.widget.FrameLayout;
+import android.widget.Toast;
 
 import com.edufound.reader.R;
 import com.edufound.reader.adapter.SlideVideoAdapter;
@@ -45,7 +46,7 @@ public class RecommendFragmentPresenter extends BasePresenter<RecommendFragmentC
     }
 
     @Override
-    public void initVideoList(RecyclerView rv, int type) {
+    public void initVideoList(RecyclerView rv, int type, int startPosition) {
 //        FrameLayout frameLayout = (FrameLayout) rv.getParent();
 //        frameLayout.setOutlineProvider(new ViewOutlineProvider() {
 //            @Override
@@ -75,13 +76,17 @@ public class RecommendFragmentPresenter extends BasePresenter<RecommendFragmentC
             //推荐的接口
         } else if (type == 1) {
             //关注的接口
+        } else if (type == 2) {
+            //官方的
+        } else if (type == 3) {
+            //关注的人的
         }
 
         /*
          * 测试数据
          * */
         mDataList = new ArrayList<>();
-        for (int i = 0; i < 5; i++) {
+        for (int i = 0; i < startPosition + 5; i++) {
             SlideVideoBean bean = new SlideVideoBean();
             if (i % 2 == 0) {
                 bean.videoUrl = "http://reader-wx.ai160.com/vs2m-m3u8/reader/053/05303004/05303004038/05303004038.m3u8";
@@ -122,7 +127,9 @@ public class RecommendFragmentPresenter extends BasePresenter<RecommendFragmentC
 //                }
                 autoPlayVideo(rv);
                 mCurrentPosition = position;
-                Logger.e("mCurrentPosition:" + mCurrentPosition);
+                if (mCurrentPosition == 0) {
+                    Toast.makeText(mContext, "已经是第一个了", Toast.LENGTH_SHORT).show();
+                }
             }
         });
         rv.addOnChildAttachStateChangeListener(new RecyclerView.OnChildAttachStateChangeListener() {
@@ -142,6 +149,30 @@ public class RecommendFragmentPresenter extends BasePresenter<RecommendFragmentC
                 }
             }
         });
+        if (startPosition > 0) {
+            rv.scrollToPosition(startPosition);
+        }
+    }
+
+    @Override
+    public Object getCurPlayVideo() {
+        return mCurrentPosition;
+    }
+
+    @Override
+    public void fragmentPause(RecyclerView rv) {
+        if (rv.getChildCount() > 0) {
+            RvListJzvdStd player = rv.getChildAt(0).findViewById(R.id.slidevideo_video);
+            player.pauseVideo();
+        }
+    }
+
+    @Override
+    public void fragmentResume(RecyclerView rv) {
+        if (rv.getChildCount() > 0) {
+            RvListJzvdStd player = rv.getChildAt(0).findViewById(R.id.slidevideo_video);
+            player.startVideoPauseEnd();
+        }
     }
 
     private void autoPlayVideo(RecyclerView rv) {
@@ -160,6 +191,16 @@ public class RecommendFragmentPresenter extends BasePresenter<RecommendFragmentC
                     public void onComplete() {
                         scrollToNextFunction(rv, true);
                     }
+
+                    @Override
+                    public void onError(int what, int extra) {
+
+                    }
+
+                    @Override
+                    public void onInfo(int what, int extra) {
+
+                    }
                 });
             }
 
@@ -194,9 +235,12 @@ public class RecommendFragmentPresenter extends BasePresenter<RecommendFragmentC
         if (mCurrentPosition > 0) {
             rv.smoothScrollToPosition(mCurrentPosition - 1);
             mCurrentPosition = mCurrentPosition - 1;
+        } else if (mCurrentPosition == 0) {
+            Toast.makeText(mContext, "已经是第一个了", Toast.LENGTH_SHORT).show();
         }
 
 
     }
 
+
 }

+ 38 - 44
app/src/main/java/com/edufound/reader/presenter/VideoPresenter.java

@@ -2,55 +2,49 @@ package com.edufound.reader.presenter;
 
 import android.content.Intent;
 import android.media.MediaPlayer;
+import android.os.Bundle;
 import android.view.ViewGroup;
 import android.widget.FrameLayout;
 import android.widget.Toast;
 
 import com.edufound.reader.base.BasePresenter;
-import com.edufound.reader.contract.VideoContract;
+import com.edufound.reader.contract.RecordContract;
 import com.edufound.reader.cusview.FullScreenVideoController;
-import com.edufound.reader.ijkplayer.media.IjkVideoView;
-import com.edufound.reader.model.VideoModel;
+import com.edufound.reader.cusview.RvListJzvdStd;
+import com.edufound.reader.model.RecordModel;
+import com.edufound.reader.videoutil.JZMediaIjk;
 
-import tv.danmaku.ijk.media.player.IMediaPlayer;
+import cn.jzvd.JZDataSource;
+import cn.jzvd.Jzvd;
+import cn.jzvd.JzvdStd;
 
-public class VideoPresenter extends BasePresenter<VideoContract.View> implements VideoContract.Presenter {
-    VideoModel mModel;
-    IjkVideoView mVideoView;
+public class RecordPresenter extends BasePresenter<RecordContract.View> implements RecordContract.Presenter {
+    RecordModel mModel;
+    RvListJzvdStd mVideoView;
 
-    public VideoPresenter() {
-        this.mModel = new VideoModel();
+    public RecordPresenter() {
+        this.mModel = new RecordModel();
     }
 
     @Override
     public void createVideoPlayer(FrameLayout frame) {
         mView.showLoading();
-        mVideoView = new IjkVideoView(mView.getActivity());
+        mVideoView = new RvListJzvdStd(mView.getActivity());
         mVideoView.setLayoutParams(new FrameLayout.LayoutParams(ViewGroup.LayoutParams.MATCH_PARENT, ViewGroup.LayoutParams.MATCH_PARENT));
-        mVideoView.setOnCompletionListener(new IMediaPlayer.OnCompletionListener() {
+        mVideoView.setVideoCallBack(new RvListJzvdStd.VideoCallBack() {
             @Override
-            public void onCompletion(IMediaPlayer iMediaPlayer) {
-                onVideoCompletion(iMediaPlayer);
+            public void onComplete() {
+                onVideoCompletion();
             }
-        });
-        mVideoView.setOnPreparedListener(new IMediaPlayer.OnPreparedListener() {
-            @Override
-            public void onPrepared(IMediaPlayer iMediaPlayer) {
-                onVideoPrepared(iMediaPlayer);
-            }
-        });
-        mVideoView.setOnInfoListener(new IMediaPlayer.OnInfoListener() {
+
             @Override
-            public boolean onInfo(IMediaPlayer iMediaPlayer, int what, int extra) {
-                onVideoInfoListener(iMediaPlayer, what, extra);
-                return true;
+            public void onError(int what, int extra) {
+                onVideoError(what, extra);
             }
-        });
-        mVideoView.setOnErrorListener(new IMediaPlayer.OnErrorListener() {
+
             @Override
-            public boolean onError(IMediaPlayer iMediaPlayer, int what, int extra) {
-                onVideoError(iMediaPlayer, what, extra);
-                return true;
+            public void onInfo(int what, int extra) {
+                onVideoInfoListener(what, extra);
             }
         });
         frame.addView(mVideoView);
@@ -58,39 +52,40 @@ public class VideoPresenter extends BasePresenter<VideoContract.View> implements
 
     @Override
     public void initVideoPlayer(Intent intent) {
-        String play_url = intent.getStringExtra("playUrl");
-        mVideoView.setVideoPath(play_url);
-        mVideoView.start();
+        Bundle params = intent.getBundleExtra("params_bundle");
+        String index = params.getString("index");
+        String play_url = params.getString("playUrl");
+        //play_url没传
+        play_url = "https://reader-wx.ai160.com/reader/resource/video/1610961140479648.mp4";
+        Toast.makeText(mView.getActivity(), "index:" + index, Toast.LENGTH_SHORT).show();
+        mVideoView.setUp(new JZDataSource(play_url), JzvdStd.SCREEN_FULLSCREEN, JZMediaIjk.class);
+        mVideoView.startVideoAfterPreloading();
     }
 
     @Override
-    public void onVideoCompletion(IMediaPlayer mediaPlayer) {
+    public void onVideoCompletion() {
 
     }
 
     @Override
-    public void onVideoError(IMediaPlayer mediaPlayer, int what, int extra) {
+    public void onVideoError(int what, int extra) {
         switch (what) {
             case -10000:
 //                mVideoHandler.sendEmptyMessage(DISCONNECT_NETWORK);
                 Toast.makeText(mView.getActivity(), "网络出现异常", Toast.LENGTH_SHORT).show();
                 break;
             default:
-                mVideoView.stopPlayback();
-                mVideoView.stopBackgroundPlay();
+                mVideoView.pauseVideo();
+                mVideoView.reset();
                 Toast.makeText(mView.getActivity(), "视频异常--what:" + what + "--extra:" + extra, Toast.LENGTH_SHORT).show();
                 mView.getActivity().finish();
                 break;
         }
     }
 
-    @Override
-    public void onVideoPrepared(IMediaPlayer mediaPlayer) {
-
-    }
 
     @Override
-    public void onVideoInfoListener(IMediaPlayer mediaPlayer, int what, int extra) {
+    public void onVideoInfoListener(int what, int extra) {
         switch (what) {
             case MediaPlayer.MEDIA_INFO_BUFFERING_START:
                 mView.showLoading();
@@ -110,9 +105,8 @@ public class VideoPresenter extends BasePresenter<VideoContract.View> implements
 
     @Override
     public void activityDestroy() {
-        mVideoView.stopPlayback();
-        mVideoView.stopBackgroundPlay();
-        mVideoView.release(true);
+        mVideoView.pauseVideo();
+        Jzvd.releaseAllVideos();
         mVideoView = null;
     }
 

+ 47 - 0
app/src/main/java/com/edufound/reader/presenter/SmallFullVideoPresenter.java

@@ -0,0 +1,47 @@
+package com.edufound.reader.presenter;
+
+import android.view.KeyEvent;
+
+import com.edufound.reader.R;
+import com.edufound.reader.base.BasePresenter;
+import com.edufound.reader.contract.SmallFullVideoContract;
+import com.edufound.reader.fragment.RecommendFragment;
+import com.edufound.reader.model.SmallFullVideoModel;
+
+import androidx.fragment.app.FragmentManager;
+import androidx.fragment.app.FragmentTransaction;
+
+public class SmallFullVideoPresenter extends BasePresenter<SmallFullVideoContract.View> implements SmallFullVideoContract.Presenter {
+
+    SmallFullVideoModel mModel;
+    RecommendFragment mRecommendFragment;
+    FragmentManager mFragmentManager;
+
+    public SmallFullVideoPresenter(FragmentManager fragmentManager) {
+        mModel = new SmallFullVideoModel();
+        mFragmentManager = fragmentManager;
+        mRecommendFragment = new RecommendFragment(2);
+        mRecommendFragment.hiddenBottomView();
+
+    }
+
+
+    @Override
+    public void initFragment(int index) {
+        FragmentTransaction transaction = mFragmentManager.beginTransaction();
+        transaction.addToBackStack(null);
+        transaction.replace(R.id.smallfull_fragment_layout, mRecommendFragment);
+        mRecommendFragment.scrollPosition(index);
+        transaction.commit();
+    }
+
+    public boolean onKeyDown(int keyCode, KeyEvent event) {
+        switch (keyCode) {
+            case KeyEvent.KEYCODE_BACK:
+            case KeyEvent.KEYCODE_ESCAPE:
+                mView.getActivity().finish();
+                break;
+        }
+        return true;
+    }
+}

+ 7 - 0
app/src/main/java/com/edufound/reader/presenter/UserInfoSettingPresenter.java

@@ -0,0 +1,7 @@
+package com.edufound.reader.presenter;
+
+import com.edufound.reader.base.BasePresenter;
+import com.edufound.reader.contract.UserInfoSettingContract;
+
+public class UserInfoSettingPresenter extends BasePresenter<UserInfoSettingContract.View> implements UserInfoSettingContract.Presenter {
+}

+ 0 - 0
app/src/main/java/com/edufound/reader/presenter/WebPresenter.java


Some files were not shown because too many files changed in this diff