正在显示
44 个修改的文件
包含
920 行增加
和
135 行删除
@@ -27,8 +27,8 @@ | @@ -27,8 +27,8 @@ | ||
27 | android:label="@string/app_name" | 27 | android:label="@string/app_name" |
28 | android:networkSecurityConfig="@xml/network_security_config" | 28 | android:networkSecurityConfig="@xml/network_security_config" |
29 | android:requestLegacyExternalStorage="true" | 29 | android:requestLegacyExternalStorage="true" |
30 | - android:roundIcon="@mipmap/ic_launcher_round" | ||
31 | android:supportsRtl="true" | 30 | android:supportsRtl="true" |
31 | + android:roundIcon="@mipmap/ic_launcher_round" | ||
32 | android:theme="@style/Theme.SecurityTrainMaster" | 32 | android:theme="@style/Theme.SecurityTrainMaster" |
33 | android:usesCleartextTraffic="true"> | 33 | android:usesCleartextTraffic="true"> |
34 | <meta-data | 34 | <meta-data |
@@ -199,6 +199,9 @@ | @@ -199,6 +199,9 @@ | ||
199 | android:configChanges="keyboard|keyboardHidden|orientation|screenSize|screenLayout|smallestScreenSize|uiMode" /> | 199 | android:configChanges="keyboard|keyboardHidden|orientation|screenSize|screenLayout|smallestScreenSize|uiMode" /> |
200 | <activity android:name=".ui.view.bank.activity.AnswerRecordDetailsActivity" /> | 200 | <activity android:name=".ui.view.bank.activity.AnswerRecordDetailsActivity" /> |
201 | <activity android:name=".ui.view.bank.activity.WrongQuestionsActivity" /> | 201 | <activity android:name=".ui.view.bank.activity.WrongQuestionsActivity" /> |
202 | + <activity android:name=".ui.view.mine.activity.ChatRecordActivity" /> | ||
203 | + <activity android:name=".ui.view.mine.activity.ChatActivity" /> | ||
204 | + <activity android:name=".ui.view.mine.activity.LiveWebActivity" /> | ||
202 | 205 | ||
203 | </application> | 206 | </application> |
204 | 207 |
@@ -10,7 +10,8 @@ import java.io.File | @@ -10,7 +10,8 @@ import java.io.File | ||
10 | */ | 10 | */ |
11 | object Constant { | 11 | object Constant { |
12 | // const val BASE_URL = "https://security.brofirst.cn/" | 12 | // const val BASE_URL = "https://security.brofirst.cn/" |
13 | - const val BASE_URL = "http://security.brofirst.cn/" | 13 | +// const val BASE_URL = "http://security.brofirst.cn/" |
14 | + const val BASE_URL = "https://test.mobile.anqixing.com/" | ||
14 | // const val BASE_URL = "http://admin.anqixing.com" | 15 | // const val BASE_URL = "http://admin.anqixing.com" |
15 | const val USERNAME_KEY = "username" | 16 | const val USERNAME_KEY = "username" |
16 | const val USERID_KEY = "userid" | 17 | const val USERID_KEY = "userid" |
@@ -128,11 +128,11 @@ interface LessonApi : ApiService { | @@ -128,11 +128,11 @@ interface LessonApi : ApiService { | ||
128 | @FormUrlEncoded | 128 | @FormUrlEncoded |
129 | @POST("/api/lesson/lesson_live") | 129 | @POST("/api/lesson/lesson_live") |
130 | fun lessonLiveList( | 130 | fun lessonLiveList( |
131 | - @Field("keyword") keyword: String, // 搜索关键词 | 131 | + @Field("keyword") keyword: String?, // 搜索关键词 |
132 | @Field("type") type: Int, // 直播类型1=正在直播2=回放直播3=即将开播 | 132 | @Field("type") type: Int, // 直播类型1=正在直播2=回放直播3=即将开播 |
133 | - @Field("page") page: String, | ||
134 | - @Field("page_num") page_num: String, | ||
135 | - ): Observable<BaseResponse<CommonDataList<CommonPage<LessonLive>>>> | 133 | + @Field("page") page: Int, |
134 | + @Field("page_num") page_num: Int, | ||
135 | + ): Observable<BaseResponse<CommonDataList<CommonPage<LessonLiveBean>>>> | ||
136 | 136 | ||
137 | /** | 137 | /** |
138 | * 直播课程列表 | 138 | * 直播课程列表 |
@@ -3,6 +3,7 @@ package com.br_technology.securitytrain_master.base.network.api | @@ -3,6 +3,7 @@ package com.br_technology.securitytrain_master.base.network.api | ||
3 | import com.br_technology.securitytrain_master.base.network.response.* | 3 | import com.br_technology.securitytrain_master.base.network.response.* |
4 | import com.br_technology.securitytrain_master.ui.bean.* | 4 | import com.br_technology.securitytrain_master.ui.bean.* |
5 | import com.br_technology.securitytrain_master.ui.view.login.bean.LoginBean | 5 | import com.br_technology.securitytrain_master.ui.view.login.bean.LoginBean |
6 | +import com.br_technology.securitytrain_master.ui.view.mine.bean.ChatRecordBean | ||
6 | import io.reactivex.rxjava3.core.Observable | 7 | import io.reactivex.rxjava3.core.Observable |
7 | import retrofit2.http.* | 8 | import retrofit2.http.* |
8 | 9 | ||
@@ -209,7 +210,6 @@ interface UserApi : ApiService { | @@ -209,7 +210,6 @@ interface UserApi : ApiService { | ||
209 | /** | 210 | /** |
210 | * 证件类型 | 211 | * 证件类型 |
211 | */ | 212 | */ |
212 | - @FormUrlEncoded | ||
213 | @POST("/api/user/cert_list") | 213 | @POST("/api/user/cert_list") |
214 | fun certClassify(): Observable<BaseResponse<CommonList<CertType>>> | 214 | fun certClassify(): Observable<BaseResponse<CommonList<CertType>>> |
215 | 215 | ||
@@ -236,12 +236,11 @@ interface UserApi : ApiService { | @@ -236,12 +236,11 @@ interface UserApi : ApiService { | ||
236 | @FormUrlEncoded | 236 | @FormUrlEncoded |
237 | @POST("/api/user/my_cert_add") | 237 | @POST("/api/user/my_cert_add") |
238 | fun certAdd( | 238 | fun certAdd( |
239 | -// @Field("id") id: Int, | 239 | + @Field("id") id: Int?, |
240 | @Field("cert_id") cert_id: Int, | 240 | @Field("cert_id") cert_id: Int, |
241 | - @Field("image") image: Int, | 241 | + @Field("image") image: String, |
242 | @Field("start_time") start_time: String, | 242 | @Field("start_time") start_time: String, |
243 | - @Field("end_time") end_time: String, | ||
244 | - @FieldMap map: HashMap<String, String> | 243 | + @Field("end_time") end_time: String? |
245 | ): Observable<BaseResponse<Void>> | 244 | ): Observable<BaseResponse<Void>> |
246 | 245 | ||
247 | /** | 246 | /** |
@@ -257,6 +256,18 @@ interface UserApi : ApiService { | @@ -257,6 +256,18 @@ interface UserApi : ApiService { | ||
257 | ): Observable<BaseResponse<CommonPage<CertLog>>> | 256 | ): Observable<BaseResponse<CommonPage<CertLog>>> |
258 | 257 | ||
259 | /** | 258 | /** |
259 | + * 教师消息列表 | ||
260 | + * @param page 页数 | ||
261 | + * @param page_num 每页显示数量 | ||
262 | + */ | ||
263 | + @FormUrlEncoded | ||
264 | + @POST("/api/teachermessage/msg_list") | ||
265 | + fun msgList( | ||
266 | + @Field("page") page: Int, | ||
267 | + @Field("page_num") page_num: Int | ||
268 | + ): Observable<BaseResponse<CommonDataList<CommonPage<ChatRecordBean>>>> | ||
269 | + | ||
270 | + /** | ||
260 | * 删除证件 | 271 | * 删除证件 |
261 | * @param id 证件id | 272 | * @param id 证件id |
262 | */ | 273 | */ |
@@ -74,11 +74,11 @@ class LessonRepository(loadState: MutableLiveData<State>) : ApiRepository(loadSt | @@ -74,11 +74,11 @@ class LessonRepository(loadState: MutableLiveData<State>) : ApiRepository(loadSt | ||
74 | } | 74 | } |
75 | 75 | ||
76 | fun lessonLiveList( | 76 | fun lessonLiveList( |
77 | - keyword: String, | 77 | + keyword: String?=null, |
78 | type: Int, | 78 | type: Int, |
79 | - page: String, | ||
80 | - page_num: String, | ||
81 | - liveData: MutableLiveData<BaseResponse<CommonDataList<CommonPage<LessonLive>>>> | 79 | + page: Int, |
80 | + page_num: Int, | ||
81 | + liveData: MutableLiveData<BaseResponse<CommonDataList<CommonPage<LessonLiveBean>>>> | ||
82 | ) { | 82 | ) { |
83 | addRequest(lessonService.lessonLiveList(keyword, type, page, page_num), liveData) | 83 | addRequest(lessonService.lessonLiveList(keyword, type, page, page_num), liveData) |
84 | } | 84 | } |
@@ -5,6 +5,14 @@ import com.br_technology.securitytrain_master.base.common.State | @@ -5,6 +5,14 @@ import com.br_technology.securitytrain_master.base.common.State | ||
5 | import com.br_technology.securitytrain_master.base.network.response.* | 5 | import com.br_technology.securitytrain_master.base.network.response.* |
6 | import com.br_technology.securitytrain_master.ui.bean.* | 6 | import com.br_technology.securitytrain_master.ui.bean.* |
7 | import com.br_technology.securitytrain_master.ui.view.login.bean.LoginBean | 7 | import com.br_technology.securitytrain_master.ui.view.login.bean.LoginBean |
8 | +import com.wjx.android.wanandroidmvvm.base.observer.BaseObserver | ||
9 | +import io.reactivex.rxjava3.android.schedulers.AndroidSchedulers | ||
10 | +import io.reactivex.rxjava3.schedulers.Schedulers | ||
11 | +import okhttp3.MediaType | ||
12 | +import okhttp3.MultipartBody | ||
13 | +import okhttp3.RequestBody | ||
14 | +import java.io.File | ||
15 | +import java.net.URLEncoder | ||
8 | 16 | ||
9 | /** | 17 | /** |
10 | * Author by YSir | 18 | * Author by YSir |
@@ -12,7 +20,7 @@ import com.br_technology.securitytrain_master.ui.view.login.bean.LoginBean | @@ -12,7 +20,7 @@ import com.br_technology.securitytrain_master.ui.view.login.bean.LoginBean | ||
12 | * description | 20 | * description |
13 | * PS: Not easy to write code, please indicate. | 21 | * PS: Not easy to write code, please indicate. |
14 | */ | 22 | */ |
15 | -class UserRepository(loadState: MutableLiveData<State>) : ApiRepository(loadState) { | 23 | +class UserRepository(val loadState: MutableLiveData<State>) : ApiRepository(loadState) { |
16 | 24 | ||
17 | fun userCenter(liveData: MutableLiveData<BaseResponse<UserInfo>>) { | 25 | fun userCenter(liveData: MutableLiveData<BaseResponse<UserInfo>>) { |
18 | addRequest(userService.getUserCenter(), liveData) | 26 | addRequest(userService.getUserCenter(), liveData) |
@@ -128,15 +136,14 @@ class UserRepository(loadState: MutableLiveData<State>) : ApiRepository(loadStat | @@ -128,15 +136,14 @@ class UserRepository(loadState: MutableLiveData<State>) : ApiRepository(loadStat | ||
128 | } | 136 | } |
129 | 137 | ||
130 | fun certAdd( | 138 | fun certAdd( |
131 | -// id: Int, | 139 | + id: Int?, |
132 | cert_id: Int, | 140 | cert_id: Int, |
133 | - image: Int, | 141 | + image: String, |
134 | start_time: String, | 142 | start_time: String, |
135 | - end_time: String, | ||
136 | - map: HashMap<String, String>, | 143 | + end_time: String?, |
137 | liveData: MutableLiveData<BaseResponse<Void>> | 144 | liveData: MutableLiveData<BaseResponse<Void>> |
138 | ) { | 145 | ) { |
139 | - addRequest(userService.certAdd(cert_id, image, start_time, end_time, map), liveData) | 146 | + addRequest(userService.certAdd(id,cert_id, image, start_time, end_time), liveData) |
140 | } | 147 | } |
141 | 148 | ||
142 | fun certLog( | 149 | fun certLog( |
@@ -158,4 +165,33 @@ class UserRepository(loadState: MutableLiveData<State>) : ApiRepository(loadStat | @@ -158,4 +165,33 @@ class UserRepository(loadState: MutableLiveData<State>) : ApiRepository(loadStat | ||
158 | ) { | 165 | ) { |
159 | addRequest(userService.scoreLog(page, page_num), liveData) | 166 | addRequest(userService.scoreLog(page, page_num), liveData) |
160 | } | 167 | } |
168 | + | ||
169 | + | ||
170 | + fun uploadFile( | ||
171 | + path: String, | ||
172 | + liveData: MutableLiveData<BaseResponse<UploadFileData>> | ||
173 | + ) { | ||
174 | + | ||
175 | + val imageRequestFile: RequestBody? | ||
176 | + var imageBody: MultipartBody.Part? = null | ||
177 | + val file = File(path) | ||
178 | + if (file.exists()) { | ||
179 | + imageRequestFile = RequestBody.create(MediaType.parse("multipart/form-data"), file) | ||
180 | + imageBody = MultipartBody.Part.createFormData( | ||
181 | + "file", | ||
182 | + URLEncoder.encode(file.name, "UTF-8"), imageRequestFile!! | ||
183 | + ) | ||
184 | + } | ||
185 | + | ||
186 | + apiService.uploadFile(imageBody!!) | ||
187 | + .subscribeOn(Schedulers.io()) | ||
188 | + .observeOn(AndroidSchedulers.mainThread()) | ||
189 | + .subscribe( | ||
190 | + BaseObserver( | ||
191 | + liveData, | ||
192 | + loadState, | ||
193 | + this | ||
194 | + ) | ||
195 | + ) | ||
196 | + } | ||
161 | } | 197 | } |
@@ -70,6 +70,109 @@ open class LessonLive( | @@ -70,6 +70,109 @@ open class LessonLive( | ||
70 | var teacher: Teacher | 70 | var teacher: Teacher |
71 | ) : Serializable | 71 | ) : Serializable |
72 | 72 | ||
73 | +data class LessonLiveBean( | ||
74 | + val average_study: String, | ||
75 | + val company_id: Int, | ||
76 | + val create_time: Int, | ||
77 | + val create_time_text: String, | ||
78 | + val delete_time: Any, | ||
79 | + val delete_time_text: String, | ||
80 | + val id: Int, | ||
81 | + val lesson_id: String, | ||
82 | + val lessonlive: LessonLiveEntity, | ||
83 | + val name: String, | ||
84 | + val playerPcUrl: String, | ||
85 | + val playerUrl: String, | ||
86 | + val sort_id: String, | ||
87 | + val sort_id_text: String, | ||
88 | + val train_class_id: Int, | ||
89 | + val train_id: Int, | ||
90 | + val trainclass: TrainclassBean, | ||
91 | + val update_time: Int, | ||
92 | + val update_time_text: String | ||
93 | +) | ||
94 | + | ||
95 | +data class LessonLiveEntity( | ||
96 | + val class_hours: Int, | ||
97 | + val company_id: Int, | ||
98 | + val content: String, | ||
99 | + val create_time: Int, | ||
100 | + val create_time_text: String, | ||
101 | + val delete_time: Any, | ||
102 | + val delete_time_text: String, | ||
103 | + val end_time: String, | ||
104 | + val id: Int, | ||
105 | + val image: String, | ||
106 | + val is_open: String, | ||
107 | + val is_open_text: String, | ||
108 | + val live_status: String, | ||
109 | + val live_time: Int, | ||
110 | + val live_url: String, | ||
111 | + val name: String, | ||
112 | + val playback_url: String, | ||
113 | + val pos_ids: String, | ||
114 | + val score: Int, | ||
115 | + val stream_name: String, | ||
116 | + val teacher_id: Int, | ||
117 | + val type: String, | ||
118 | + val type_text: String, | ||
119 | + val update_time: Int, | ||
120 | + val update_time_text: String, | ||
121 | + val webrtc_url: String | ||
122 | +) | ||
123 | + | ||
124 | +data class TrainclassBean( | ||
125 | + val average_study: String, | ||
126 | + val company_id: Int, | ||
127 | + val create_time: Int, | ||
128 | + val create_time_text: String, | ||
129 | + val delete_time: Any, | ||
130 | + val delete_time_text: String, | ||
131 | + val des: String, | ||
132 | + val end_time: Int, | ||
133 | + val end_time_text: String, | ||
134 | + val id: Int, | ||
135 | + val is_exam: String, | ||
136 | + val is_exam_text: String, | ||
137 | + val is_parctise: String, | ||
138 | + val is_parctise_text: String, | ||
139 | + val lesson_ids: String, | ||
140 | + val lesson_live_ids: String, | ||
141 | + val lesson_offline_content: String, | ||
142 | + val lesson_offline_ids: String, | ||
143 | + val lesson_offline_image: String, | ||
144 | + val lesson_times: Int, | ||
145 | + val lesson_times_count: Int, | ||
146 | + val lesson_word_ids: String, | ||
147 | + val lessons: String, | ||
148 | + val name: String, | ||
149 | + val sort_id: String, | ||
150 | + val sort_id_text: String, | ||
151 | + val start_time: Int, | ||
152 | + val start_time_text: String, | ||
153 | + val status: String, | ||
154 | + val status_text: String, | ||
155 | + val students: Int, | ||
156 | + val study_per: String, | ||
157 | + val teacher_id: String, | ||
158 | + val teachers: Teachers, | ||
159 | + val train_id: Int, | ||
160 | + val update_time: Int, | ||
161 | + val update_time_text: String, | ||
162 | + val user_item_pass: Any | ||
163 | +) | ||
164 | + | ||
165 | +data class Teachers( | ||
166 | + val avatar: String, | ||
167 | + val create_time_text: String, | ||
168 | + val delete_time_text: String, | ||
169 | + val gender_text: String, | ||
170 | + val id: Int, | ||
171 | + val name: String, | ||
172 | + val update_time_text: String | ||
173 | +) | ||
174 | + | ||
175 | + | ||
73 | open class LessonOffline( | 176 | open class LessonOffline( |
74 | var class_name: String, | 177 | var class_name: String, |
75 | var pos_names: String, | 178 | var pos_names: String, |
@@ -62,9 +62,14 @@ open class UserCertData( | @@ -62,9 +62,14 @@ open class UserCertData( | ||
62 | ) | 62 | ) |
63 | 63 | ||
64 | open class CertType( | 64 | open class CertType( |
65 | - var id: Int, | ||
66 | - var name: String, // 证件名称 | ||
67 | - var valid: Int, // 有效期 | 65 | + val id:Int, |
66 | + val company_id:Int, | ||
67 | + val name:String,// 证件名称 | ||
68 | + val valid:Int,// 有效期 | ||
69 | + val weigh:Int, | ||
70 | + val create_time:Int, | ||
71 | + val update_time:Int, | ||
72 | + val delete_time:Int, | ||
68 | ) | 73 | ) |
69 | 74 | ||
70 | open class UserCertDetail( | 75 | open class UserCertDetail( |
app/src/main/java/com/br_technology/securitytrain_master/ui/view/home/activity/LiveCourseActivity.kt
@@ -8,6 +8,7 @@ import com.br_technology.securitytrain_master.base.view.BasePagerAdapter | @@ -8,6 +8,7 @@ import com.br_technology.securitytrain_master.base.view.BasePagerAdapter | ||
8 | import com.br_technology.securitytrain_master.databinding.ActivityLiveCourseBinding | 8 | import com.br_technology.securitytrain_master.databinding.ActivityLiveCourseBinding |
9 | import com.br_technology.securitytrain_master.ui.view.home.fragment.OnLiveCourseFragment | 9 | import com.br_technology.securitytrain_master.ui.view.home.fragment.OnLiveCourseFragment |
10 | import com.br_technology.securitytrain_master.ui.view.home.viewmodel.LiveCourseViewModel | 10 | import com.br_technology.securitytrain_master.ui.view.home.viewmodel.LiveCourseViewModel |
11 | +import com.br_technology.securitytrain_master.util.sp_job_name | ||
11 | import com.br_technology.securitytrain_master.view.ClassifyPop | 12 | import com.br_technology.securitytrain_master.view.ClassifyPop |
12 | import com.br_technology.securitytrain_master.view.listener.ToolBarClickListener | 13 | import com.br_technology.securitytrain_master.view.listener.ToolBarClickListener |
13 | import com.google.android.material.tabs.TabLayout | 14 | import com.google.android.material.tabs.TabLayout |
@@ -41,35 +42,39 @@ class LiveCourseActivity | @@ -41,35 +42,39 @@ class LiveCourseActivity | ||
41 | binding.apply { | 42 | binding.apply { |
42 | 43 | ||
43 | 44 | ||
44 | - toolBar.setRightText("焊工") | 45 | + toolBar.setRightText(sp_job_name) |
45 | toolBar.setRightTextDrawable( | 46 | toolBar.setRightTextDrawable( |
46 | ContextCompat.getDrawable( | 47 | ContextCompat.getDrawable( |
47 | baseContext, | 48 | baseContext, |
48 | R.mipmap.down_arrow | 49 | R.mipmap.down_arrow |
49 | ) | 50 | ) |
50 | ) | 51 | ) |
51 | - toolBar.addRightListener(object : ToolBarClickListener { | ||
52 | - override fun onClick(view: View) { | ||
53 | - if (!classifyPop.isShowing) { | ||
54 | - classifyPop.showAsDropDown(view) | ||
55 | - } | ||
56 | - | ||
57 | - } | ||
58 | - }) | 52 | +// toolBar.addRightListener(object : ToolBarClickListener { |
53 | +// override fun onClick(view: View) { | ||
54 | +// if (!classifyPop.isShowing) { | ||
55 | +// classifyPop.showAsDropDown(view) | ||
56 | +// } | ||
57 | +// | ||
58 | +// } | ||
59 | +// }) | ||
59 | 60 | ||
60 | val searchResultAdapter = BasePagerAdapter( | 61 | val searchResultAdapter = BasePagerAdapter( |
61 | supportFragmentManager, | 62 | supportFragmentManager, |
62 | FragmentPagerAdapter.BEHAVIOR_RESUME_ONLY_CURRENT_FRAGMENT | 63 | FragmentPagerAdapter.BEHAVIOR_RESUME_ONLY_CURRENT_FRAGMENT |
63 | ) | 64 | ) |
64 | val list = | 65 | val list = |
65 | - mutableListOf(OnLiveCourseFragment(),OnLiveCourseFragment(),OnLiveCourseFragment()) | 66 | + mutableListOf( |
67 | + OnLiveCourseFragment.newInstance(1), | ||
68 | + OnLiveCourseFragment.newInstance(2), | ||
69 | + OnLiveCourseFragment.newInstance(3) | ||
70 | + ) | ||
66 | val titles = listOf("正在直播", "回放课程", "即将开播") | 71 | val titles = listOf("正在直播", "回放课程", "即将开播") |
67 | searchResultAdapter.addData(list.toMutableList()) | 72 | searchResultAdapter.addData(list.toMutableList()) |
68 | searchResultAdapter.addTitle(titles) | 73 | searchResultAdapter.addTitle(titles) |
69 | viewPager.adapter = searchResultAdapter | 74 | viewPager.adapter = searchResultAdapter |
70 | tabLayout.setupWithViewPager(viewPager) | 75 | tabLayout.setupWithViewPager(viewPager) |
71 | 76 | ||
72 | - tabLayout.addOnTabSelectedListener(object :TabLayout.OnTabSelectedListener{ | 77 | + tabLayout.addOnTabSelectedListener(object : TabLayout.OnTabSelectedListener { |
73 | override fun onTabSelected(tab: TabLayout.Tab?) { | 78 | override fun onTabSelected(tab: TabLayout.Tab?) { |
74 | 79 | ||
75 | } | 80 | } |
app/src/main/java/com/br_technology/securitytrain_master/ui/view/home/adapter/LiveAdapter.kt
0 → 100644
1 | +package com.br_technology.securitytrain_master.ui.view.home.adapter | ||
2 | + | ||
3 | +import com.br_technology.securitytrain_master.R | ||
4 | +import com.br_technology.securitytrain_master.ui.bean.LessonLiveBean | ||
5 | +import com.bumptech.glide.Glide | ||
6 | +import com.bumptech.glide.load.resource.bitmap.RoundedCorners | ||
7 | +import com.bumptech.glide.request.RequestOptions | ||
8 | +import com.chad.library.adapter.base.BaseQuickAdapter | ||
9 | +import com.chad.library.adapter.base.viewholder.BaseViewHolder | ||
10 | + | ||
11 | +/** | ||
12 | + * auth: 张继 | ||
13 | + * date: 2022/1/27 16:38 | ||
14 | + * dsc: | ||
15 | + * updateInfo: | ||
16 | + */ | ||
17 | +class LiveAdapter(layoutResId: Int) : | ||
18 | + BaseQuickAdapter<LessonLiveBean, BaseViewHolder>(layoutResId) { | ||
19 | + override fun convert(holder: BaseViewHolder, item: LessonLiveBean) { | ||
20 | + | ||
21 | + // 视频首贞图片 | ||
22 | + Glide.with(context) | ||
23 | + .load(item.lessonlive.image) | ||
24 | + .apply(RequestOptions.bitmapTransform(RoundedCorners(14))) | ||
25 | + .into(holder.getView(R.id.video_pic)) | ||
26 | + | ||
27 | + val typeName = when (item.lessonlive.live_status) { | ||
28 | + "1" -> { | ||
29 | + "正在直播" | ||
30 | + } | ||
31 | + "2" -> { | ||
32 | + "回放直播" | ||
33 | + } | ||
34 | + else -> { | ||
35 | + "即将开播" | ||
36 | + } | ||
37 | + } | ||
38 | + | ||
39 | + holder.setText(R.id.course_name, item.lessonlive.name) | ||
40 | + .setText(R.id.name, "${item.trainclass.teachers.name}-${item.trainclass.name}") | ||
41 | + .setText(R.id.lesson, "$typeName") | ||
42 | + } | ||
43 | +} |
1 | package com.br_technology.securitytrain_master.ui.view.home.fragment | 1 | package com.br_technology.securitytrain_master.ui.view.home.fragment |
2 | 2 | ||
3 | +import android.content.Intent | ||
4 | +import android.os.Bundle | ||
3 | import com.br_technology.securitytrain_master.R | 5 | import com.br_technology.securitytrain_master.R |
4 | import com.br_technology.securitytrain_master.databinding.FragmentOnliveCourseBinding | 6 | import com.br_technology.securitytrain_master.databinding.FragmentOnliveCourseBinding |
5 | import com.br_technology.securitytrain_master.expand.addItemDecoration2 | 7 | import com.br_technology.securitytrain_master.expand.addItemDecoration2 |
6 | -import com.br_technology.securitytrain_master.ui.view.home.adapter.VideoCourseAdapter | ||
7 | -import com.br_technology.securitytrain_master.ui.view.home.bean.VideoLessonBean | 8 | +import com.br_technology.securitytrain_master.ui.bean.LessonLiveBean |
9 | +import com.br_technology.securitytrain_master.ui.view.home.adapter.LiveAdapter | ||
8 | import com.br_technology.securitytrain_master.ui.view.home.viewmodel.OnLiveCourseFragmentViewModel | 10 | import com.br_technology.securitytrain_master.ui.view.home.viewmodel.OnLiveCourseFragmentViewModel |
11 | +import com.br_technology.securitytrain_master.ui.view.mine.activity.LiveWebActivity | ||
12 | +import com.br_technology.securitytrain_master.ui.view.mine.viewmodel.LiveWebViewModel | ||
9 | import com.wjx.android.wanandroidmvvm.base.view.BaseLifeCycleFragment | 13 | import com.wjx.android.wanandroidmvvm.base.view.BaseLifeCycleFragment |
10 | 14 | ||
11 | /** | 15 | /** |
@@ -14,42 +18,92 @@ import com.wjx.android.wanandroidmvvm.base.view.BaseLifeCycleFragment | @@ -14,42 +18,92 @@ import com.wjx.android.wanandroidmvvm.base.view.BaseLifeCycleFragment | ||
14 | * Description: 初见时你很迷人 | 18 | * Description: 初见时你很迷人 |
15 | */ | 19 | */ |
16 | class OnLiveCourseFragment | 20 | class OnLiveCourseFragment |
17 | - : BaseLifeCycleFragment<OnLiveCourseFragmentViewModel,FragmentOnliveCourseBinding>(FragmentOnliveCourseBinding :: inflate){ | ||
18 | - private var videoLessonList: MutableList<VideoLessonBean.ListBean.DataBean>? = null | ||
19 | - override fun initDataObserver() { | 21 | + : BaseLifeCycleFragment<OnLiveCourseFragmentViewModel, FragmentOnliveCourseBinding>( |
22 | + FragmentOnliveCourseBinding::inflate | ||
23 | +) { | ||
24 | + | ||
25 | + private var page = 1 | ||
26 | + private val map = hashMapOf(1 to true, 2 to true, 3 to true) | ||
27 | + private var type: Int = 1 | ||
28 | + private val adapter: LiveAdapter by lazy { | ||
29 | + LiveAdapter(R.layout.adapter_video_course) | ||
30 | + } | ||
20 | 31 | ||
32 | + override fun initDataObserver() { | ||
33 | + mViewModel.liveData.observe(this) { | ||
34 | + if (it.data.list.data.size < 10) { | ||
35 | + binding.smartRefresh.setNoMoreData(true) | ||
36 | + } | ||
37 | + if (page == 1) { | ||
38 | + adapter.setNewInstance(it.data.list.data as MutableList<LessonLiveBean>) | ||
39 | + } else { | ||
40 | + adapter.addData(it.data.list.data) | ||
41 | + } | ||
42 | + } | ||
21 | } | 43 | } |
22 | 44 | ||
23 | override fun initData() { | 45 | override fun initData() { |
24 | super.initData() | 46 | super.initData() |
47 | + type = arguments?.getInt("type") ?: 1 | ||
25 | binding.apply { | 48 | binding.apply { |
49 | + smartRefresh.setOnRefreshListener { | ||
50 | + page = 1 | ||
51 | + smartRefresh.setNoMoreData(false) | ||
52 | + mViewModel.lessonLiveList(type, page) | ||
53 | + smartRefresh.finishRefresh() | ||
54 | + } | ||
26 | 55 | ||
27 | - onlineRecycler.addItemDecoration2(2, 15,24) | ||
28 | - val videoCourseAdapter = VideoCourseAdapter(R.layout.adapter_video_course, videoLessonList) | ||
29 | -// val list = mutableListOf( | ||
30 | -// VideoCourse(R.mipmap.banner, "10课时", "自动化制作课程", "", "张钧-三岗职位培训班"), | ||
31 | -// VideoCourse(R.mipmap.banner, "10课时", "自动化制作课程", "", "张钧-三岗职位培训班"), | ||
32 | -// VideoCourse(R.mipmap.banner, "10课时", "自动化制作课程", "", "张钧-三岗职位培训班"), | ||
33 | -// VideoCourse(R.mipmap.banner, "10课时", "自动化制作课程", "", "张钧-三岗职位培训班"), | ||
34 | -// VideoCourse(R.mipmap.banner, "10课时", "自动化制作课程", "", "张钧-三岗职位培训班"), | ||
35 | -// VideoCourse(R.mipmap.banner, "10课时", "自动化制作课程", "", "张钧-三岗职位培训班"), | ||
36 | -// VideoCourse(R.mipmap.banner, "10课时", "自动化制作课程", "", "张钧-三岗职位培训班"), | ||
37 | -// VideoCourse(R.mipmap.banner, "10课时", "自动化制作课程", "", "张钧-三岗职位培训班"), | ||
38 | -// VideoCourse(R.mipmap.banner, "10课时", "自动化制作课程", "", "张钧-三岗职位培训班"), | ||
39 | -// VideoCourse(R.mipmap.banner, "10课时", "自动化制作课程", "", "张钧-三岗职位培训班"), | ||
40 | -// ) | ||
41 | - videoLessonList = mutableListOf() | ||
42 | - onlineRecycler.adapter = videoCourseAdapter | ||
43 | -// videoCourseAdapter.addList(videoLessonList!!) | ||
44 | -// | ||
45 | -// videoCourseAdapter.addListener(object : OnItemClickListener<VideoLessonBean.ListBean.DataBean> { | ||
46 | -// | ||
47 | -// override fun onClick(position: Int, data: VideoLessonBean.ListBean.DataBean) { | ||
48 | -// startActivity(OnlineDetailActivity :: class.java) | ||
49 | -// } | ||
50 | -// | ||
51 | -// }) | 56 | + smartRefresh.setOnLoadMoreListener { |
57 | + ++page | ||
58 | + mViewModel.lessonLiveList(type, page) | ||
59 | + smartRefresh.finishLoadMore() | ||
60 | + } | ||
52 | 61 | ||
62 | + onlineRecycler.addItemDecoration2(2, 15, 24) | ||
63 | + onlineRecycler.adapter = adapter | ||
64 | + | ||
65 | + adapter.setOnItemClickListener { _, _, position -> | ||
66 | + | ||
67 | + val status = adapter.data.get(position).lessonlive.live_status | ||
68 | + if (status == "3") { | ||
69 | + showTip("教师未开播") | ||
70 | + return@setOnItemClickListener | ||
71 | + } | ||
72 | + var url = "" | ||
73 | + if (status == "2") { | ||
74 | + url = adapter.data.get(position).lessonlive.playback_url | ||
75 | + } | ||
76 | + if (status == "1") { | ||
77 | + url = adapter.data.get(position).playerUrl | ||
78 | + } | ||
79 | + val title = adapter.data.get(position).name | ||
80 | + val intent = Intent(requireActivity(), LiveWebActivity::class.java) | ||
81 | + intent.putExtra("url", url) | ||
82 | + intent.putExtra("title", title) | ||
83 | + startActivity(intent) | ||
84 | + } | ||
53 | } | 85 | } |
54 | } | 86 | } |
87 | + | ||
88 | + | ||
89 | + override fun onResume() { | ||
90 | + super.onResume() | ||
91 | + if (map[type] == true) { | ||
92 | + map[type] = false | ||
93 | + binding.smartRefresh.autoRefresh() | ||
94 | + } | ||
95 | + } | ||
96 | + | ||
97 | + | ||
98 | + companion object { | ||
99 | + fun newInstance(type: Int): OnLiveCourseFragment { | ||
100 | + val fragment = OnLiveCourseFragment() | ||
101 | + val bundle = Bundle() | ||
102 | + bundle.putInt("type", type) | ||
103 | + fragment.arguments = bundle | ||
104 | + return fragment | ||
105 | + } | ||
106 | + } | ||
107 | + | ||
108 | + | ||
55 | } | 109 | } |
@@ -10,4 +10,9 @@ import com.br_technology.securitytrain_master.base.repository.ApiRepository | @@ -10,4 +10,9 @@ import com.br_technology.securitytrain_master.base.repository.ApiRepository | ||
10 | * Description: 初见时你很迷人 | 10 | * Description: 初见时你很迷人 |
11 | */ | 11 | */ |
12 | class OnLiveCourseFragmentRepository(val loadState: MutableLiveData<State>) : ApiRepository(loadState) { | 12 | class OnLiveCourseFragmentRepository(val loadState: MutableLiveData<State>) : ApiRepository(loadState) { |
13 | + | ||
14 | + | ||
15 | + fun lessonLiveList() { | ||
16 | + | ||
17 | + } | ||
13 | } | 18 | } |
1 | package com.br_technology.securitytrain_master.ui.view.home.viewmodel | 1 | package com.br_technology.securitytrain_master.ui.view.home.viewmodel |
2 | 2 | ||
3 | +import androidx.lifecycle.MutableLiveData | ||
4 | +import com.br_technology.securitytrain_master.base.network.response.BaseResponse | ||
5 | +import com.br_technology.securitytrain_master.base.network.response.CommonDataList | ||
6 | +import com.br_technology.securitytrain_master.base.network.response.CommonPage | ||
7 | +import com.br_technology.securitytrain_master.base.repository.LessonRepository | ||
3 | import com.br_technology.securitytrain_master.base.view.BaseViewModel | 8 | import com.br_technology.securitytrain_master.base.view.BaseViewModel |
9 | +import com.br_technology.securitytrain_master.ui.bean.LessonLive | ||
10 | +import com.br_technology.securitytrain_master.ui.bean.LessonLiveBean | ||
4 | import com.br_technology.securitytrain_master.ui.view.home.repository.OnLiveCourseFragmentRepository | 11 | import com.br_technology.securitytrain_master.ui.view.home.repository.OnLiveCourseFragmentRepository |
5 | 12 | ||
6 | /** | 13 | /** |
@@ -8,5 +15,12 @@ import com.br_technology.securitytrain_master.ui.view.home.repository.OnLiveCour | @@ -8,5 +15,12 @@ import com.br_technology.securitytrain_master.ui.view.home.repository.OnLiveCour | ||
8 | * Author: Captain | 15 | * Author: Captain |
9 | * Description: 初见时你很迷人 | 16 | * Description: 初见时你很迷人 |
10 | */ | 17 | */ |
11 | -class OnLiveCourseFragmentViewModel : BaseViewModel<OnLiveCourseFragmentRepository>() { | 18 | +class OnLiveCourseFragmentViewModel : BaseViewModel<LessonRepository>() { |
19 | + | ||
20 | + val liveData: MutableLiveData<BaseResponse<CommonDataList<CommonPage<LessonLiveBean>>>> = | ||
21 | + MutableLiveData() | ||
22 | + | ||
23 | + fun lessonLiveList(type: Int, page: Int) { | ||
24 | + mRepository.lessonLiveList(null, type, page, 20, liveData) | ||
25 | + } | ||
12 | } | 26 | } |
app/src/main/java/com/br_technology/securitytrain_master/ui/view/mine/activity/ChatActivity.kt
0 → 100644
1 | +package com.br_technology.securitytrain_master.ui.view.mine.activity | ||
2 | + | ||
3 | +import com.br_technology.securitytrain_master.databinding.ActivityChatRecordBinding | ||
4 | +import com.br_technology.securitytrain_master.ui.view.mine.viewmodel.ChatRecordViewModel | ||
5 | +import com.wjx.android.wanandroidmvvm.base.view.BaseLifeCycleActivity | ||
6 | + | ||
7 | +/** | ||
8 | + * auth: 张继 | ||
9 | + * date: 2022/1/27 15:00 | ||
10 | + * dsc:聊天详情 | ||
11 | + * updateInfo: | ||
12 | + */ | ||
13 | +class ChatActivity : | ||
14 | + BaseLifeCycleActivity<ChatRecordViewModel, ActivityChatRecordBinding>(ActivityChatRecordBinding::inflate) { | ||
15 | + override fun initDataObserver() { | ||
16 | + | ||
17 | + } | ||
18 | + | ||
19 | + override fun initData() { | ||
20 | + super.initData() | ||
21 | + binding.apply { | ||
22 | +// chatRv.adapter= | ||
23 | + } | ||
24 | + } | ||
25 | +} |
app/src/main/java/com/br_technology/securitytrain_master/ui/view/mine/activity/ChatRecordActivity.kt
0 → 100644
1 | +package com.br_technology.securitytrain_master.ui.view.mine.activity | ||
2 | + | ||
3 | +import com.br_technology.securitytrain_master.databinding.ActivityChatRecordBinding | ||
4 | +import com.br_technology.securitytrain_master.ui.view.mine.adapter.ChatRecordAdapter | ||
5 | +import com.br_technology.securitytrain_master.ui.view.mine.bean.ChatRecordBean | ||
6 | +import com.br_technology.securitytrain_master.ui.view.mine.viewmodel.ChatRecordViewModel | ||
7 | +import com.wjx.android.wanandroidmvvm.base.view.BaseLifeCycleActivity | ||
8 | + | ||
9 | +/** | ||
10 | + * auth: 张继 | ||
11 | + * date: 2022/1/27 13:28 | ||
12 | + * dsc:聊天记录 | ||
13 | + * updateInfo: | ||
14 | + */ | ||
15 | +class ChatRecordActivity : | ||
16 | + BaseLifeCycleActivity<ChatRecordViewModel, ActivityChatRecordBinding>(ActivityChatRecordBinding::inflate) { | ||
17 | + private val chatRecordAdapter: ChatRecordAdapter by lazy { | ||
18 | + ChatRecordAdapter() | ||
19 | + } | ||
20 | + | ||
21 | + private var page = 1 | ||
22 | + override fun initDataObserver() { | ||
23 | + mViewModel.liveData.observe(this) { | ||
24 | + if (it.data.list.data.size < 10) { | ||
25 | + binding.smartRefresh.setNoMoreData(true) | ||
26 | + } | ||
27 | + if (page == 1) { | ||
28 | + chatRecordAdapter.setNewInstance(it.data.list.data as MutableList<ChatRecordBean>) | ||
29 | + } else { | ||
30 | + chatRecordAdapter.addData(it.data.list.data) | ||
31 | + } | ||
32 | + } | ||
33 | + } | ||
34 | + | ||
35 | + override fun initData() { | ||
36 | + super.initData() | ||
37 | + | ||
38 | + binding.apply { | ||
39 | + smartRefresh.autoRefresh() | ||
40 | + // 刷新 | ||
41 | + smartRefresh.setOnRefreshListener { | ||
42 | + smartRefresh.setNoMoreData(false) | ||
43 | + page = 1 | ||
44 | + mViewModel.msgList(page) | ||
45 | + smartRefresh.finishRefresh() | ||
46 | + } | ||
47 | + // 加载 | ||
48 | + smartRefresh.setOnLoadMoreListener { | ||
49 | + ++page | ||
50 | + mViewModel.msgList(page) | ||
51 | + smartRefresh.finishLoadMore() | ||
52 | + } | ||
53 | + chatRv.adapter = chatRecordAdapter | ||
54 | + } | ||
55 | + | ||
56 | + chatRecordAdapter.setOnItemClickListener { adapter, view, position -> | ||
57 | + startActivity(ChatActivity::class.java) | ||
58 | + } | ||
59 | + } | ||
60 | + | ||
61 | +} |
1 | package com.br_technology.securitytrain_master.ui.view.mine.activity | 1 | package com.br_technology.securitytrain_master.ui.view.mine.activity |
2 | 2 | ||
3 | +import android.graphics.Color | ||
3 | import android.view.View | 4 | import android.view.View |
4 | -import android.widget.TimePicker | 5 | +import androidx.recyclerview.widget.RecyclerView |
5 | import com.bigkoo.pickerview.builder.TimePickerBuilder | 6 | import com.bigkoo.pickerview.builder.TimePickerBuilder |
6 | -import com.bigkoo.pickerview.configure.PickerOptions | ||
7 | -import com.bigkoo.pickerview.listener.OnTimeSelectListener | ||
8 | -import com.bigkoo.pickerview.view.TimePickerView | ||
9 | import com.br_technology.securitytrain_master.R | 7 | import com.br_technology.securitytrain_master.R |
10 | import com.br_technology.securitytrain_master.databinding.ActivityCredentialsUploadBinding | 8 | import com.br_technology.securitytrain_master.databinding.ActivityCredentialsUploadBinding |
11 | import com.br_technology.securitytrain_master.expand.dp2px | 9 | import com.br_technology.securitytrain_master.expand.dp2px |
12 | import com.br_technology.securitytrain_master.expand.loadPicNoCrop | 10 | import com.br_technology.securitytrain_master.expand.loadPicNoCrop |
13 | import com.br_technology.securitytrain_master.expand.screenWidth | 11 | import com.br_technology.securitytrain_master.expand.screenWidth |
12 | +import com.br_technology.securitytrain_master.ui.bean.CertType | ||
13 | +import com.br_technology.securitytrain_master.ui.bean.UserCertDetail | ||
14 | +import com.br_technology.securitytrain_master.ui.view.mine.adapter.CertTypeAdapter | ||
14 | import com.br_technology.securitytrain_master.ui.view.mine.viewmodel.CredentialsUpLoadViewModel | 15 | import com.br_technology.securitytrain_master.ui.view.mine.viewmodel.CredentialsUpLoadViewModel |
15 | import com.br_technology.securitytrain_master.util.GlideEnginePic | 16 | import com.br_technology.securitytrain_master.util.GlideEnginePic |
17 | +import com.br_technology.securitytrain_master.util.PoPWindowUtil | ||
18 | +import com.br_technology.securitytrain_master.view.CenterToast | ||
19 | +import com.google.gson.Gson | ||
16 | import com.luck.picture.lib.PictureSelector | 20 | import com.luck.picture.lib.PictureSelector |
17 | import com.luck.picture.lib.config.PictureMimeType | 21 | import com.luck.picture.lib.config.PictureMimeType |
18 | import com.luck.picture.lib.entity.LocalMedia | 22 | import com.luck.picture.lib.entity.LocalMedia |
19 | import com.luck.picture.lib.listener.OnResultCallbackListener | 23 | import com.luck.picture.lib.listener.OnResultCallbackListener |
20 | import com.wjx.android.wanandroidmvvm.base.view.BaseLifeCycleActivity | 24 | import com.wjx.android.wanandroidmvvm.base.view.BaseLifeCycleActivity |
25 | +import java.text.DateFormat | ||
26 | +import java.text.SimpleDateFormat | ||
21 | import java.util.* | 27 | import java.util.* |
22 | 28 | ||
23 | /** | 29 | /** |
@@ -28,40 +34,119 @@ import java.util.* | @@ -28,40 +34,119 @@ import java.util.* | ||
28 | class CredentialsUpLoadActivity : | 34 | class CredentialsUpLoadActivity : |
29 | BaseLifeCycleActivity<CredentialsUpLoadViewModel, ActivityCredentialsUploadBinding>( | 35 | BaseLifeCycleActivity<CredentialsUpLoadViewModel, ActivityCredentialsUploadBinding>( |
30 | ActivityCredentialsUploadBinding::inflate | 36 | ActivityCredentialsUploadBinding::inflate |
31 | - ), View.OnClickListener { | 37 | + ) { |
32 | 38 | ||
33 | private var path: String = "" | 39 | private var path: String = "" |
40 | + private var dateTime: String = "" | ||
41 | + private var typeId: Int = 0 | ||
42 | + private var id: Int? = 0 | ||
43 | + private var endTime: String? = "" | ||
44 | + private val certTypeAdapter: CertTypeAdapter by lazy { | ||
45 | + CertTypeAdapter() | ||
46 | + } | ||
34 | 47 | ||
35 | override fun initDataObserver() { | 48 | override fun initDataObserver() { |
36 | - | 49 | + mViewModel.liveData.observe(this) { |
50 | + certTypeAdapter.setNewInstance(it.data.list as MutableList<CertType>) | ||
51 | + } | ||
52 | + mViewModel.picLiveData.observe(this) { | ||
53 | + // 图片地址 | ||
54 | + path = it.data.fullurl | ||
55 | + } | ||
56 | + mViewModel.certLiveData.observe(this) { | ||
57 | + // 根据类型跳转 | ||
58 | + binding.tvUpload.isClickable = true | ||
59 | + val title = CenterToast(this).setTitle("上传成功") | ||
60 | + title.setOnDismissListener { | ||
61 | + finish() | ||
62 | + } | ||
63 | + title.show() | ||
64 | + } | ||
37 | } | 65 | } |
38 | 66 | ||
39 | override fun initData() { | 67 | override fun initData() { |
40 | super.initData() | 68 | super.initData() |
69 | + | ||
70 | + mViewModel.certClassify() | ||
71 | + | ||
72 | + val json = intent.getStringExtra("json") | ||
73 | + if (json?.isNotEmpty() == true) { | ||
74 | + val user = Gson().fromJson<UserCertDetail>(json, UserCertDetail::class.java) | ||
75 | + // 证件类型id | ||
76 | + typeId = user.cert.id | ||
77 | + // 证件照片地址 | ||
78 | + path = user.image_text | ||
79 | + // 开始时间 | ||
80 | + dateTime = user.start_time | ||
81 | + // 证件id | ||
82 | + id = user.id | ||
83 | + // 结束时间 | ||
84 | + endTime = user.end_time | ||
85 | + // 适配宽度 | ||
86 | + val width = mRootView.screenWidth() - 64.dp2px() | ||
87 | + binding.uploadPic.loadPicNoCrop(path, width, 208.dp2px()) | ||
88 | + // 开始时间 | ||
89 | + binding.uploadTime.text = dateTime | ||
90 | + // 证件名称 | ||
91 | + binding.certTypeTv.text = user.cert.name | ||
92 | + } | ||
93 | + | ||
94 | + id = if (id == 0) { | ||
95 | + null | ||
96 | + } else { | ||
97 | + id | ||
98 | + } | ||
99 | + endTime = if (endTime?.isEmpty() == true) { | ||
100 | + null | ||
101 | + } else { | ||
102 | + endTime | ||
103 | + } | ||
41 | binding.apply { | 104 | binding.apply { |
42 | - tvUpload.setOnClickListener(this@CredentialsUpLoadActivity) | 105 | + // 上传照片 |
106 | + tvUpload.setOnClickListener { | ||
107 | + tvUpload.isClickable = false | ||
108 | + if (path.isEmpty()) { | ||
109 | + showTip("请选择证件照片") | ||
110 | + tvUpload.isClickable = true | ||
111 | + return@setOnClickListener | ||
112 | + } | ||
113 | + if (typeId == 0) { | ||
114 | + tvUpload.isClickable = true | ||
115 | + showTip("请选择证件类型") | ||
116 | + return@setOnClickListener | ||
117 | + } | ||
118 | + if (dateTime.isEmpty()) { | ||
119 | + tvUpload.isClickable = true | ||
120 | + showTip("请选择证件开始时间") | ||
121 | + return@setOnClickListener | ||
122 | + } | ||
123 | + mViewModel.certAdd(id, typeId, path, dateTime, endTime) | ||
124 | + } | ||
43 | 125 | ||
126 | + // 选择图片 | ||
44 | uploadPic.setOnClickListener { | 127 | uploadPic.setOnClickListener { |
45 | - | ||
46 | selectPicture() | 128 | selectPicture() |
47 | -// PictureSelector.create(this@CredentialsUpLoadActivity) | ||
48 | } | 129 | } |
130 | + // 选择时间 | ||
49 | selectionPeriod.setOnClickListener { | 131 | selectionPeriod.setOnClickListener { |
50 | selectTime() | 132 | selectTime() |
51 | } | 133 | } |
52 | - } | ||
53 | - | ||
54 | - | ||
55 | - // // 根据类型跳转 | ||
56 | -// CenterToast(this@MyCredentialsActivity).setTitle("上传成功").show() | ||
57 | - } | ||
58 | - | ||
59 | - override fun onClick(v: View?) { | ||
60 | - when (v?.id) { | ||
61 | - R.id.tv_upload -> { | ||
62 | 134 | ||
135 | + // 选择证件类型 | ||
136 | + selectType.setOnClickListener { | ||
137 | + val initPopWindow = PoPWindowUtil.get() | ||
138 | + .initPopWindow(baseContext, selectType, R.layout.dialog_cert_type) | ||
139 | + val certRv = initPopWindow.findViewById<RecyclerView>(R.id.cert_rv) | ||
140 | + certRv.adapter = certTypeAdapter | ||
63 | } | 141 | } |
64 | } | 142 | } |
143 | + | ||
144 | + certTypeAdapter.setOnItemClickListener { _, _, position -> | ||
145 | + val certType = certTypeAdapter.data[position] | ||
146 | + binding.certTypeTv.text = certType.name | ||
147 | + typeId = certType.id | ||
148 | + PoPWindowUtil.get().dismissPoPWindow() | ||
149 | + } | ||
65 | } | 150 | } |
66 | 151 | ||
67 | private fun selectPicture() { | 152 | private fun selectPicture() { |
@@ -71,24 +156,28 @@ class CredentialsUpLoadActivity : | @@ -71,24 +156,28 @@ class CredentialsUpLoadActivity : | ||
71 | .imageEngine(GlideEnginePic.createGlideEngine()) | 156 | .imageEngine(GlideEnginePic.createGlideEngine()) |
72 | .forResult(object : OnResultCallbackListener<LocalMedia> { | 157 | .forResult(object : OnResultCallbackListener<LocalMedia> { |
73 | override fun onResult(result: MutableList<LocalMedia>?) { | 158 | override fun onResult(result: MutableList<LocalMedia>?) { |
74 | - path = result?.get(0)?.realPath ?: "" | 159 | + val path = result?.get(0)?.realPath ?: "" |
75 | if (path.isNotEmpty()) { | 160 | if (path.isNotEmpty()) { |
76 | binding.uploadPic.loadPicNoCrop(path, width, 208.dp2px()) | 161 | binding.uploadPic.loadPicNoCrop(path, width, 208.dp2px()) |
162 | + mViewModel.uploadFile(path) | ||
77 | } | 163 | } |
78 | } | 164 | } |
79 | 165 | ||
80 | - override fun onCancel() { | ||
81 | - } | 166 | + override fun onCancel() {} |
82 | }) | 167 | }) |
83 | } | 168 | } |
84 | 169 | ||
85 | private fun selectTime() { | 170 | private fun selectTime() { |
86 | - TimePickerBuilder(baseContext, object : OnTimeSelectListener { | ||
87 | - override fun onTimeSelect(date: Date?, v: View?) { | ||
88 | - | ||
89 | - } | ||
90 | - }).build().show() | 171 | + TimePickerBuilder(this) { date, _ -> |
172 | + val dateFormat = SimpleDateFormat("yyyy-MM-dd") | ||
173 | + val format = dateFormat.format(date) | ||
174 | + dateTime = format | ||
175 | + binding.uploadTime.text = format | ||
176 | + }.setTitleText("选择日期") | ||
177 | + .setTitleBgColor(Color.parseColor("#ffffff")) | ||
178 | + .setCancelColor(Color.parseColor("#000000")) | ||
179 | + .setSubmitColor(Color.parseColor("#000000")) | ||
180 | + .build().show() | ||
91 | } | 181 | } |
92 | 182 | ||
93 | - | ||
94 | } | 183 | } |
app/src/main/java/com/br_technology/securitytrain_master/ui/view/mine/activity/LiveWebActivity.kt
0 → 100644
1 | +package com.br_technology.securitytrain_master.ui.view.mine.activity | ||
2 | + | ||
3 | +import com.br_technology.securitytrain_master.databinding.ActivityLiveWebBinding | ||
4 | +import com.br_technology.securitytrain_master.ui.view.mine.viewmodel.LiveWebViewModel | ||
5 | +import com.wjx.android.wanandroidmvvm.base.view.BaseLifeCycleActivity | ||
6 | + | ||
7 | +/** | ||
8 | + * auth: 张继 | ||
9 | + * date: 2022/1/27 17:23 | ||
10 | + * dsc: | ||
11 | + * updateInfo: | ||
12 | + */ | ||
13 | +class LiveWebActivity : | ||
14 | + BaseLifeCycleActivity<LiveWebViewModel, ActivityLiveWebBinding>(ActivityLiveWebBinding::inflate) { | ||
15 | + override fun initDataObserver() { | ||
16 | + | ||
17 | + } | ||
18 | + | ||
19 | + override fun initData() { | ||
20 | + super.initData() | ||
21 | + val url = intent.getStringExtra("url") ?: "" | ||
22 | + val title = intent.getStringExtra("title")?:"" | ||
23 | + binding.apply { | ||
24 | + toolBar.setTitle(title) | ||
25 | + liveWeb.loadUrl(url) | ||
26 | + } | ||
27 | + } | ||
28 | +} |
1 | package com.br_technology.securitytrain_master.ui.view.mine.activity | 1 | package com.br_technology.securitytrain_master.ui.view.mine.activity |
2 | 2 | ||
3 | +import android.content.Intent | ||
3 | import com.br_technology.securitytrain_master.databinding.ActivityMyCredentialsDetailBinding | 4 | import com.br_technology.securitytrain_master.databinding.ActivityMyCredentialsDetailBinding |
4 | import com.br_technology.securitytrain_master.expand.loadPic | 5 | import com.br_technology.securitytrain_master.expand.loadPic |
5 | import com.br_technology.securitytrain_master.ui.view.mine.viewmodel.MyCredentialDetailViewModel | 6 | import com.br_technology.securitytrain_master.ui.view.mine.viewmodel.MyCredentialDetailViewModel |
7 | +import com.google.gson.Gson | ||
6 | import com.wjx.android.wanandroidmvvm.base.view.BaseLifeCycleActivity | 8 | import com.wjx.android.wanandroidmvvm.base.view.BaseLifeCycleActivity |
7 | 9 | ||
8 | /** | 10 | /** |
@@ -14,8 +16,12 @@ class MyCredentialsDetailActivity : | @@ -14,8 +16,12 @@ class MyCredentialsDetailActivity : | ||
14 | BaseLifeCycleActivity<MyCredentialDetailViewModel, ActivityMyCredentialsDetailBinding>( | 16 | BaseLifeCycleActivity<MyCredentialDetailViewModel, ActivityMyCredentialsDetailBinding>( |
15 | ActivityMyCredentialsDetailBinding::inflate | 17 | ActivityMyCredentialsDetailBinding::inflate |
16 | ) { | 18 | ) { |
19 | + private var json = "" | ||
20 | + | ||
21 | + | ||
17 | override fun initDataObserver() { | 22 | override fun initDataObserver() { |
18 | mViewModel.liveData.observe(this) { | 23 | mViewModel.liveData.observe(this) { |
24 | + json = Gson().toJson(it.data.detail) | ||
19 | binding.apply { | 25 | binding.apply { |
20 | pictureIv.loadPic(it.data.detail.image_text) | 26 | pictureIv.loadPic(it.data.detail.image_text) |
21 | certName.text = it.data.detail.cert.name | 27 | certName.text = it.data.detail.cert.name |
@@ -30,8 +36,10 @@ class MyCredentialsDetailActivity : | @@ -30,8 +36,10 @@ class MyCredentialsDetailActivity : | ||
30 | super.initData() | 36 | super.initData() |
31 | binding.apply { | 37 | binding.apply { |
32 | tvReUpload.setOnClickListener { | 38 | tvReUpload.setOnClickListener { |
39 | + val intent = Intent(baseContext, CredentialsUpLoadActivity::class.java) | ||
40 | + intent.putExtra("json", json) | ||
33 | //重新上传 | 41 | //重新上传 |
34 | - startActivity(CredentialsUpLoadActivity::class.java) | 42 | + startActivity(intent) |
35 | } | 43 | } |
36 | } | 44 | } |
37 | } | 45 | } |
app/src/main/java/com/br_technology/securitytrain_master/ui/view/mine/adapter/CertTypeAdapter.kt
0 → 100644
1 | +package com.br_technology.securitytrain_master.ui.view.mine.adapter | ||
2 | + | ||
3 | +import com.br_technology.securitytrain_master.R | ||
4 | +import com.br_technology.securitytrain_master.ui.bean.CertType | ||
5 | +import com.chad.library.adapter.base.BaseQuickAdapter | ||
6 | +import com.chad.library.adapter.base.viewholder.BaseViewHolder | ||
7 | + | ||
8 | +/** | ||
9 | + * auth: 张继 | ||
10 | + * date: 2022/1/27 10:25 | ||
11 | + * dsc: | ||
12 | + * updateInfo: | ||
13 | + */ | ||
14 | +class CertTypeAdapter:BaseQuickAdapter<CertType,BaseViewHolder>(R.layout.adapter_cert_type) { | ||
15 | + override fun convert(holder: BaseViewHolder, item: CertType) { | ||
16 | + holder.setText(R.id.cert_name,item.name) | ||
17 | + } | ||
18 | +} |
app/src/main/java/com/br_technology/securitytrain_master/ui/view/mine/adapter/ChatRecordAdapter.kt
0 → 100644
1 | +package com.br_technology.securitytrain_master.ui.view.mine.adapter | ||
2 | + | ||
3 | +import com.br_technology.securitytrain_master.R | ||
4 | +import com.br_technology.securitytrain_master.ui.view.mine.bean.ChatRecordBean | ||
5 | +import com.chad.library.adapter.base.BaseQuickAdapter | ||
6 | +import com.chad.library.adapter.base.viewholder.BaseViewHolder | ||
7 | + | ||
8 | +/** | ||
9 | + * auth: 张继 | ||
10 | + * date: 2022/1/27 14:09 | ||
11 | + * dsc: | ||
12 | + * updateInfo: | ||
13 | + */ | ||
14 | +class ChatRecordAdapter : | ||
15 | + BaseQuickAdapter<ChatRecordBean, BaseViewHolder>(R.layout.adapter_chat_record) { | ||
16 | + override fun convert(holder: BaseViewHolder, item: ChatRecordBean) { | ||
17 | + holder.setText(R.id.chat_name, item.teacher.name) | ||
18 | + .setText(R.id.chat_content, item.last_content) | ||
19 | + .setText(R.id.chat_date, item.update_time) | ||
20 | + } | ||
21 | +} |
app/src/main/java/com/br_technology/securitytrain_master/ui/view/mine/bean/ChatRecordBean.kt
0 → 100644
1 | +package com.br_technology.securitytrain_master.ui.view.mine.bean | ||
2 | + | ||
3 | +/** | ||
4 | + * auth: 张继 | ||
5 | + * date: 2022/1/27 13:58 | ||
6 | + * dsc: | ||
7 | + * updateInfo: | ||
8 | + */ | ||
9 | +data class ChatRecordBean( | ||
10 | + val id: Int, | ||
11 | + val is_read: String, | ||
12 | + val last_content: String, | ||
13 | + val teacher: Teacher, | ||
14 | + val teacher_id: Int, | ||
15 | + val update_time: String | ||
16 | +) | ||
17 | + | ||
18 | +data class Teacher( | ||
19 | + val create_time_text: String, | ||
20 | + val delete_time_text: String, | ||
21 | + val gender_text: String, | ||
22 | + val name: String, | ||
23 | + val update_time_text: String | ||
24 | +) |
@@ -136,6 +136,7 @@ class MineFragment | @@ -136,6 +136,7 @@ class MineFragment | ||
136 | 136 | ||
137 | R.id.rl_mine_liaotianjilu -> { | 137 | R.id.rl_mine_liaotianjilu -> { |
138 | //我的聊天记录 | 138 | //我的聊天记录 |
139 | + startActivity(ChatRecordActivity::class.java) | ||
139 | } | 140 | } |
140 | 141 | ||
141 | R.id.rl_mine_tousuyujianyi -> { | 142 | R.id.rl_mine_tousuyujianyi -> { |
app/src/main/java/com/br_technology/securitytrain_master/ui/view/mine/repository/ChatRepository.kt
0 → 100644
1 | +package com.br_technology.securitytrain_master.ui.view.mine.repository | ||
2 | + | ||
3 | +import androidx.lifecycle.MutableLiveData | ||
4 | +import com.br_technology.securitytrain_master.base.common.State | ||
5 | +import com.br_technology.securitytrain_master.base.network.response.BaseResponse | ||
6 | +import com.br_technology.securitytrain_master.base.network.response.CommonDataList | ||
7 | +import com.br_technology.securitytrain_master.base.network.response.CommonPage | ||
8 | +import com.br_technology.securitytrain_master.base.repository.ApiRepository | ||
9 | +import com.br_technology.securitytrain_master.ui.view.mine.bean.ChatRecordBean | ||
10 | + | ||
11 | +/** | ||
12 | + * auth: 张继 | ||
13 | + * date: 2022/1/27 13:50 | ||
14 | + * dsc: | ||
15 | + * updateInfo: | ||
16 | + */ | ||
17 | +class ChatRepository(val loadState: MutableLiveData<State>) : ApiRepository(loadState) { | ||
18 | + | ||
19 | + | ||
20 | + fun msgList( | ||
21 | + page: Int, | ||
22 | + liveData: MutableLiveData<BaseResponse<CommonDataList<CommonPage<ChatRecordBean>>>> | ||
23 | + ) { | ||
24 | + addRequest(userService.msgList(page, 20), liveData) | ||
25 | + } | ||
26 | + | ||
27 | + | ||
28 | +} |
1 | +package com.br_technology.securitytrain_master.ui.view.mine.viewmodel | ||
2 | + | ||
3 | +import androidx.lifecycle.MutableLiveData | ||
4 | +import com.br_technology.securitytrain_master.base.network.response.BaseResponse | ||
5 | +import com.br_technology.securitytrain_master.base.network.response.CommonDataList | ||
6 | +import com.br_technology.securitytrain_master.base.network.response.CommonPage | ||
7 | +import com.br_technology.securitytrain_master.base.view.BaseViewModel | ||
8 | +import com.br_technology.securitytrain_master.ui.view.mine.bean.ChatRecordBean | ||
9 | +import com.br_technology.securitytrain_master.ui.view.mine.repository.ChatRepository | ||
10 | + | ||
11 | +/** | ||
12 | + * auth: 张继 | ||
13 | + * date: 2022/1/27 13:31 | ||
14 | + * dsc: | ||
15 | + * updateInfo: | ||
16 | + */ | ||
17 | +class ChatRecordViewModel : BaseViewModel<ChatRepository>() { | ||
18 | + val liveData: MutableLiveData<BaseResponse<CommonDataList<CommonPage<ChatRecordBean>>>> = | ||
19 | + MutableLiveData() | ||
20 | + | ||
21 | + fun msgList(page: Int) { | ||
22 | + mRepository.msgList(page, liveData) | ||
23 | + } | ||
24 | +} |
1 | package com.br_technology.securitytrain_master.ui.view.mine.viewmodel | 1 | package com.br_technology.securitytrain_master.ui.view.mine.viewmodel |
2 | 2 | ||
3 | +import androidx.lifecycle.MutableLiveData | ||
4 | +import com.br_technology.securitytrain_master.base.network.response.BaseResponse | ||
5 | +import com.br_technology.securitytrain_master.base.network.response.CommonList | ||
6 | +import com.br_technology.securitytrain_master.base.repository.UserRepository | ||
3 | import com.br_technology.securitytrain_master.base.view.BaseViewModel | 7 | import com.br_technology.securitytrain_master.base.view.BaseViewModel |
8 | +import com.br_technology.securitytrain_master.ui.bean.CertType | ||
9 | +import com.br_technology.securitytrain_master.ui.bean.UploadFileData | ||
4 | import com.br_technology.securitytrain_master.ui.view.mine.repository.CredentialsUpLoadRepository | 10 | import com.br_technology.securitytrain_master.ui.view.mine.repository.CredentialsUpLoadRepository |
5 | 11 | ||
6 | /** | 12 | /** |
@@ -8,5 +14,31 @@ import com.br_technology.securitytrain_master.ui.view.mine.repository.Credential | @@ -8,5 +14,31 @@ import com.br_technology.securitytrain_master.ui.view.mine.repository.Credential | ||
8 | * Author: Captain | 14 | * Author: Captain |
9 | * Description: 初见时你很迷人 | 15 | * Description: 初见时你很迷人 |
10 | */ | 16 | */ |
11 | -class CredentialsUpLoadViewModel : BaseViewModel<CredentialsUpLoadRepository>() { | 17 | +class CredentialsUpLoadViewModel : BaseViewModel<UserRepository>() { |
18 | + | ||
19 | + val liveData: MutableLiveData<BaseResponse<CommonList<CertType>>> = MutableLiveData() | ||
20 | + val picLiveData: MutableLiveData<BaseResponse<UploadFileData>> = MutableLiveData() | ||
21 | + val certLiveData: MutableLiveData<BaseResponse<Void>> = MutableLiveData() | ||
22 | + | ||
23 | + fun certClassify() { | ||
24 | + mRepository.certClassify(liveData) | ||
25 | + } | ||
26 | + | ||
27 | + | ||
28 | + fun uploadFile( | ||
29 | + path: String, | ||
30 | + ) { | ||
31 | + mRepository.uploadFile(path, picLiveData) | ||
32 | + } | ||
33 | + | ||
34 | + fun certAdd( | ||
35 | + id: Int?, | ||
36 | + cert_id: Int, | ||
37 | + image: String, | ||
38 | + start_time: String, | ||
39 | + end_time: String? | ||
40 | + ) { | ||
41 | + mRepository.certAdd(id, cert_id, image, start_time, end_time, certLiveData) | ||
42 | + } | ||
43 | + | ||
12 | } | 44 | } |
app/src/main/java/com/br_technology/securitytrain_master/ui/view/mine/viewmodel/LiveWebViewModel.kt
0 → 100644
1 | +package com.br_technology.securitytrain_master.ui.view.mine.viewmodel | ||
2 | + | ||
3 | +import com.br_technology.securitytrain_master.base.repository.UserRepository | ||
4 | +import com.br_technology.securitytrain_master.base.view.BaseViewModel | ||
5 | + | ||
6 | +/** | ||
7 | + * auth: 张继 | ||
8 | + * date: 2022/1/27 17:26 | ||
9 | + * dsc: | ||
10 | + * updateInfo: | ||
11 | + */ | ||
12 | +class LiveWebViewModel:BaseViewModel<UserRepository>() { | ||
13 | +} |
@@ -3,10 +3,13 @@ package com.br_technology.securitytrain_master.util | @@ -3,10 +3,13 @@ package com.br_technology.securitytrain_master.util | ||
3 | import android.content.Context | 3 | import android.content.Context |
4 | import android.content.res.Resources | 4 | import android.content.res.Resources |
5 | import android.graphics.drawable.ColorDrawable | 5 | import android.graphics.drawable.ColorDrawable |
6 | +import android.view.Gravity | ||
6 | import android.view.LayoutInflater | 7 | import android.view.LayoutInflater |
7 | import android.view.View | 8 | import android.view.View |
8 | import android.view.ViewGroup | 9 | import android.view.ViewGroup |
9 | import android.widget.PopupWindow | 10 | import android.widget.PopupWindow |
11 | +import com.br_technology.securitytrain_master.expand.dp2px | ||
12 | +import com.br_technology.securitytrain_master.expand.screenWidth | ||
10 | 13 | ||
11 | 14 | ||
12 | /** | 15 | /** |
@@ -38,7 +41,7 @@ class PoPWindowUtil { | @@ -38,7 +41,7 @@ class PoPWindowUtil { | ||
38 | * @param layout 弹窗的布局文件 | 41 | * @param layout 弹窗的布局文件 |
39 | * | 42 | * |
40 | */ | 43 | */ |
41 | - fun initPopWindow(context: Context?, anchorView: View?, layout: Int): View? { | 44 | + fun initPopWindow(context: Context?, anchorView: View?, layout: Int): View { |
42 | // 初始化popUpWindow | 45 | // 初始化popUpWindow |
43 | // 生成 View 对象 | 46 | // 生成 View 对象 |
44 | val popRootView: View = LayoutInflater.from(context).inflate(layout, null) | 47 | val popRootView: View = LayoutInflater.from(context).inflate(layout, null) |
@@ -54,18 +57,16 @@ class PoPWindowUtil { | @@ -54,18 +57,16 @@ class PoPWindowUtil { | ||
54 | // mPopupWindow.setAnimationStyle(R.style.popwin_anim_style);//设置动画 | 57 | // mPopupWindow.setAnimationStyle(R.style.popwin_anim_style);//设置动画 |
55 | // 设置背景 | 58 | // 设置背景 |
56 | //实例化一个ColorDrawable颜色为半透明,以达到变暗的效果 | 59 | //实例化一个ColorDrawable颜色为半透明,以达到变暗的效果 |
57 | - val dw = ColorDrawable(-0x50000000) | ||
58 | - mPopupWindow!!.setBackgroundDrawable(dw) | 60 | +// val dw = ColorDrawable(-0x50000000) |
61 | +// mPopupWindow?.setBackgroundDrawable(dw) | ||
62 | + mPopupWindow?.width=popRootView.screenWidth()-64.dp2px() | ||
59 | // 外部点击事件 | 63 | // 外部点击事件 |
60 | - mPopupWindow!!.setOutsideTouchable(false) | 64 | + mPopupWindow?.isOutsideTouchable = false |
61 | // 传入点 | 65 | // 传入点 |
62 | - mPopupWindow!!.showAsDropDown(anchorView) | 66 | +// mPopupWindow?.showAtLocation(anchorView,Gravity.CENTER_HORIZONTAL,0,0) |
67 | + mPopupWindow?.showAsDropDown(anchorView) | ||
63 | //关闭时置空对象 | 68 | //关闭时置空对象 |
64 | - mPopupWindow!!.setOnDismissListener(object : PopupWindow.OnDismissListener { | ||
65 | - override fun onDismiss() { | ||
66 | - mPopupWindow = null | ||
67 | - } | ||
68 | - }) | 69 | + mPopupWindow?.setOnDismissListener { mPopupWindow = null } |
69 | return popRootView //返回View | 70 | return popRootView //返回View |
70 | } | 71 | } |
71 | 72 | ||
@@ -86,7 +87,7 @@ class PoPWindowUtil { | @@ -86,7 +87,7 @@ class PoPWindowUtil { | ||
86 | */ | 87 | */ |
87 | fun dismissPoPWindow() { | 88 | fun dismissPoPWindow() { |
88 | if (mPopupWindow != null) { | 89 | if (mPopupWindow != null) { |
89 | - mPopupWindow!!.dismiss() | 90 | + mPopupWindow?.dismiss() |
90 | } | 91 | } |
91 | } | 92 | } |
92 | 93 |
1 | +<?xml version="1.0" encoding="utf-8"?> | ||
2 | +<androidx.appcompat.widget.LinearLayoutCompat xmlns:android="http://schemas.android.com/apk/res/android" | ||
3 | + xmlns:app="http://schemas.android.com/apk/res-auto" | ||
4 | + android:layout_width="match_parent" | ||
5 | + android:layout_height="match_parent" | ||
6 | + android:orientation="vertical"> | ||
7 | + | ||
8 | + <include layout="@layout/layout_tool_bar" /> | ||
9 | + | ||
10 | + <com.br_technology.securitytrain_master.view.ViewToolBar | ||
11 | + android:id="@+id/tool_bar" | ||
12 | + android:layout_width="match_parent" | ||
13 | + android:layout_height="wrap_content" | ||
14 | + app:toolTitle="聊天记录" /> | ||
15 | + | ||
16 | + <com.scwang.smart.refresh.layout.SmartRefreshLayout | ||
17 | + android:id="@+id/smart_refresh" | ||
18 | + android:layout_width="match_parent" | ||
19 | + android:layout_height="match_parent"> | ||
20 | + | ||
21 | + <androidx.recyclerview.widget.RecyclerView | ||
22 | + android:id="@+id/chat_rv" | ||
23 | + android:layout_width="match_parent" | ||
24 | + android:layout_height="match_parent" | ||
25 | + android:layout_marginHorizontal="16dp" | ||
26 | + android:layout_marginTop="16dp" | ||
27 | + android:overScrollMode="never" | ||
28 | + app:layoutManager="androidx.recyclerview.widget.LinearLayoutManager" /> | ||
29 | + </com.scwang.smart.refresh.layout.SmartRefreshLayout> | ||
30 | +</androidx.appcompat.widget.LinearLayoutCompat> |
@@ -35,6 +35,7 @@ | @@ -35,6 +35,7 @@ | ||
35 | android:orientation="horizontal"> | 35 | android:orientation="horizontal"> |
36 | 36 | ||
37 | <TextView | 37 | <TextView |
38 | + android:id="@+id/cert_type_tv" | ||
38 | android:layout_width="0dp" | 39 | android:layout_width="0dp" |
39 | android:layout_height="wrap_content" | 40 | android:layout_height="wrap_content" |
40 | android:layout_gravity="center_vertical" | 41 | android:layout_gravity="center_vertical" |
@@ -75,11 +76,13 @@ | @@ -75,11 +76,13 @@ | ||
75 | 76 | ||
76 | 77 | ||
77 | <TextView | 78 | <TextView |
79 | + android:id="@+id/upload_time" | ||
78 | android:layout_width="wrap_content" | 80 | android:layout_width="wrap_content" |
79 | android:layout_height="wrap_content" | 81 | android:layout_height="wrap_content" |
80 | android:layout_gravity="center_vertical" | 82 | android:layout_gravity="center_vertical" |
81 | android:layout_marginEnd="16dp" | 83 | android:layout_marginEnd="16dp" |
82 | android:background="@null" | 84 | android:background="@null" |
85 | + android:gravity="right" | ||
83 | android:hint="请选择初始取证时间" | 86 | android:hint="请选择初始取证时间" |
84 | android:textColor="@color/color_32" | 87 | android:textColor="@color/color_32" |
85 | android:textColorHint="@color/color_96" | 88 | android:textColorHint="@color/color_96" |
@@ -88,13 +91,12 @@ | @@ -88,13 +91,12 @@ | ||
88 | 91 | ||
89 | </LinearLayout> | 92 | </LinearLayout> |
90 | 93 | ||
91 | - <LinearLayout | 94 | + <View |
92 | android:layout_width="match_parent" | 95 | android:layout_width="match_parent" |
93 | - android:layout_height="wrap_content" | 96 | + android:layout_height="0dp" |
94 | android:layout_weight="1" | 97 | android:layout_weight="1" |
95 | - android:orientation="vertical"> | 98 | + android:orientation="vertical" /> |
96 | 99 | ||
97 | - </LinearLayout> | ||
98 | 100 | ||
99 | <TextView | 101 | <TextView |
100 | android:id="@+id/tv_upload" | 102 | android:id="@+id/tv_upload" |
@@ -19,7 +19,7 @@ | @@ -19,7 +19,7 @@ | ||
19 | android:layout_width="match_parent" | 19 | android:layout_width="match_parent" |
20 | android:layout_height="?actionBarSize" | 20 | android:layout_height="?actionBarSize" |
21 | android:overScrollMode="never" | 21 | android:overScrollMode="never" |
22 | - app:tabMode="auto" | 22 | + app:tabMode="fixed" |
23 | app:tabSelectedTextColor="@color/color_252" | 23 | app:tabSelectedTextColor="@color/color_252" |
24 | app:tabTextColor="@color/color_96" /> | 24 | app:tabTextColor="@color/color_96" /> |
25 | 25 |
1 | +<?xml version="1.0" encoding="utf-8"?> | ||
2 | +<androidx.appcompat.widget.LinearLayoutCompat xmlns:android="http://schemas.android.com/apk/res/android" | ||
3 | + xmlns:app="http://schemas.android.com/apk/res-auto" | ||
4 | + xmlns:tools="http://schemas.android.com/tools" | ||
5 | + android:layout_width="match_parent" | ||
6 | + android:layout_height="match_parent" | ||
7 | + android:orientation="vertical"> | ||
8 | + | ||
9 | + <include layout="@layout/layout_tool_bar" /> | ||
10 | + | ||
11 | + <com.br_technology.securitytrain_master.view.ViewToolBar | ||
12 | + android:id="@+id/tool_bar" | ||
13 | + android:layout_width="match_parent" | ||
14 | + android:layout_height="wrap_content" /> | ||
15 | + | ||
16 | + <com.tencent.smtt.sdk.WebView | ||
17 | + android:id="@+id/live_web" | ||
18 | + android:layout_width="match_parent" | ||
19 | + android:layout_height="match_parent" /> | ||
20 | +</androidx.appcompat.widget.LinearLayoutCompat> |
1 | +<?xml version="1.0" encoding="utf-8"?> | ||
2 | +<TextView xmlns:android="http://schemas.android.com/apk/res/android" | ||
3 | + android:id="@+id/cert_name" | ||
4 | + android:layout_width="match_parent" | ||
5 | + android:layout_height="40dp" | ||
6 | + android:gravity="center_vertical" | ||
7 | + android:paddingHorizontal="16dp" | ||
8 | + android:textColor="@color/black" | ||
9 | + android:textSize="@dimen/sp_14" /> |
1 | +<?xml version="1.0" encoding="utf-8"?> | ||
2 | +<androidx.constraintlayout.widget.ConstraintLayout xmlns:android="http://schemas.android.com/apk/res/android" | ||
3 | + xmlns:app="http://schemas.android.com/apk/res-auto" | ||
4 | + android:layout_width="match_parent" | ||
5 | + android:layout_height="wrap_content"> | ||
6 | + | ||
7 | + | ||
8 | + <androidx.appcompat.widget.AppCompatImageView | ||
9 | + android:id="@+id/chat_icon" | ||
10 | + android:layout_width="44dp" | ||
11 | + android:layout_height="44dp" | ||
12 | + app:layout_constraintStart_toStartOf="parent" | ||
13 | + app:layout_constraintTop_toTopOf="parent" | ||
14 | + app:srcCompat="@mipmap/icon_chat_group" /> | ||
15 | + | ||
16 | + | ||
17 | + <TextView | ||
18 | + android:id="@+id/chat_date" | ||
19 | + android:layout_width="wrap_content" | ||
20 | + android:layout_height="wrap_content" | ||
21 | + android:textColor="@color/color_96" | ||
22 | + android:textSize="12sp" | ||
23 | + app:layout_constraintBaseline_toBaselineOf="@id/chat_name" | ||
24 | + app:layout_constraintEnd_toEndOf="parent" | ||
25 | + app:layout_constraintTop_toTopOf="parent" /> | ||
26 | + | ||
27 | + | ||
28 | + <androidx.appcompat.widget.AppCompatTextView | ||
29 | + android:id="@+id/chat_name" | ||
30 | + android:layout_width="0dp" | ||
31 | + android:layout_height="wrap_content" | ||
32 | + android:layout_marginStart="12dp" | ||
33 | + android:textColor="@color/color_32" | ||
34 | + android:textSize="14sp" | ||
35 | + app:layout_constraintEnd_toStartOf="@+id/chat_date" | ||
36 | + app:layout_constraintStart_toEndOf="@+id/chat_icon" | ||
37 | + app:layout_constraintTop_toTopOf="parent" /> | ||
38 | + | ||
39 | + <androidx.appcompat.widget.AppCompatTextView | ||
40 | + android:id="@+id/chat_content" | ||
41 | + android:layout_width="0dp" | ||
42 | + android:layout_height="wrap_content" | ||
43 | + android:layout_marginStart="12dp" | ||
44 | + android:layout_marginTop="8dp" | ||
45 | + android:textColor="@color/color_32" | ||
46 | + android:textSize="12sp" | ||
47 | + app:layout_constraintEnd_toEndOf="parent" | ||
48 | + app:layout_constraintStart_toEndOf="@+id/chat_icon" | ||
49 | + app:layout_constraintTop_toBottomOf="@id/chat_name" /> | ||
50 | + | ||
51 | + <View | ||
52 | + android:layout_width="match_parent" | ||
53 | + android:layout_height="1dp" | ||
54 | + android:layout_marginVertical="15dp" | ||
55 | + android:background="@color/color_eb" | ||
56 | + app:layout_constraintTop_toBottomOf="@id/chat_content" /> | ||
57 | +</androidx.constraintlayout.widget.ConstraintLayout> |
@@ -10,19 +10,20 @@ | @@ -10,19 +10,20 @@ | ||
10 | 10 | ||
11 | 11 | ||
12 | <ImageView | 12 | <ImageView |
13 | - android:scaleType="fitXY" | ||
14 | android:id="@+id/video_pic" | 13 | android:id="@+id/video_pic" |
15 | android:layout_width="match_parent" | 14 | android:layout_width="match_parent" |
16 | android:layout_height="match_parent" | 15 | android:layout_height="match_parent" |
17 | android:contentDescription="@string/logo" | 16 | android:contentDescription="@string/logo" |
17 | + android:scaleType="fitXY" | ||
18 | android:src="@mipmap/banner" /> | 18 | android:src="@mipmap/banner" /> |
19 | 19 | ||
20 | <TextView | 20 | <TextView |
21 | android:id="@+id/lesson" | 21 | android:id="@+id/lesson" |
22 | - android:layout_width="39dp" | 22 | + android:layout_width="wrap_content" |
23 | android:layout_height="16dp" | 23 | android:layout_height="16dp" |
24 | android:background="@drawable/gradient_e8_e5_4" | 24 | android:background="@drawable/gradient_e8_e5_4" |
25 | android:gravity="center" | 25 | android:gravity="center" |
26 | + android:paddingHorizontal="5dp" | ||
26 | android:textColor="@color/white" | 27 | android:textColor="@color/white" |
27 | android:textSize="10sp" /> | 28 | android:textSize="10sp" /> |
28 | </FrameLayout> | 29 | </FrameLayout> |
app/src/main/res/layout/dialog_cert_type.xml
0 → 100644
1 | +<?xml version="1.0" encoding="utf-8"?> | ||
2 | +<androidx.appcompat.widget.LinearLayoutCompat xmlns:android="http://schemas.android.com/apk/res/android" | ||
3 | + xmlns:app="http://schemas.android.com/apk/res-auto" | ||
4 | + android:layout_width="match_parent" | ||
5 | + android:layout_marginHorizontal="32dp" | ||
6 | + android:layout_height="wrap_content"> | ||
7 | + | ||
8 | + <FrameLayout | ||
9 | + android:background="@color/white" | ||
10 | + android:layout_width="match_parent" | ||
11 | + android:layout_height="wrap_content"> | ||
12 | + <androidx.recyclerview.widget.RecyclerView | ||
13 | + android:id="@+id/cert_rv" | ||
14 | + android:layout_width="match_parent" | ||
15 | + android:layout_height="wrap_content" | ||
16 | + app:layoutManager="androidx.recyclerview.widget.LinearLayoutManager" /> | ||
17 | + </FrameLayout> | ||
18 | +</androidx.appcompat.widget.LinearLayoutCompat> |
@@ -5,17 +5,22 @@ | @@ -5,17 +5,22 @@ | ||
5 | android:layout_width="match_parent" | 5 | android:layout_width="match_parent" |
6 | android:layout_height="match_parent"> | 6 | android:layout_height="match_parent"> |
7 | 7 | ||
8 | - <androidx.recyclerview.widget.RecyclerView | ||
9 | - android:id="@+id/online_recycler" | 8 | + <com.scwang.smart.refresh.layout.SmartRefreshLayout |
9 | + android:id="@+id/smart_refresh" | ||
10 | android:layout_width="match_parent" | 10 | android:layout_width="match_parent" |
11 | - android:layout_height="match_parent" | ||
12 | - android:layout_marginStart="16dp" | ||
13 | - android:layout_marginEnd="16dp" | ||
14 | - android:overScrollMode="never" | ||
15 | - android:paddingTop="4dp" | ||
16 | - android:paddingBottom="12dp" | ||
17 | - android:scrollbars="none" | ||
18 | - app:layoutManager="androidx.recyclerview.widget.GridLayoutManager" | ||
19 | - app:spanCount="2" /> | 11 | + android:layout_height="match_parent"> |
12 | + <androidx.recyclerview.widget.RecyclerView | ||
13 | + android:id="@+id/online_recycler" | ||
14 | + android:layout_width="match_parent" | ||
15 | + android:layout_height="match_parent" | ||
16 | + android:layout_marginStart="16dp" | ||
17 | + android:layout_marginEnd="16dp" | ||
18 | + android:overScrollMode="never" | ||
19 | + android:paddingTop="4dp" | ||
20 | + android:paddingBottom="12dp" | ||
21 | + android:scrollbars="none" | ||
22 | + app:layoutManager="androidx.recyclerview.widget.GridLayoutManager" | ||
23 | + app:spanCount="2" /> | ||
24 | + </com.scwang.smart.refresh.layout.SmartRefreshLayout> | ||
20 | 25 | ||
21 | </LinearLayout> | 26 | </LinearLayout> |
4.7 KB
-
请 注册 或 登录 后发表评论