作者 zhangji

1、账号登录

2、忘记密码
3、手机号登录
4、首页
5、搜索
以上页面UI与基础逻辑全部写完
6、资料库页面已创建
正在显示 100 个修改的文件 包含 2825 行增加150 行删除

要显示太多修改。

为保证性能只显示 100 of 100+ 个文件。

1 <?xml version="1.0" encoding="UTF-8"?> 1 <?xml version="1.0" encoding="UTF-8"?>
2 <project version="4"> 2 <project version="4">
3 <component name="CompilerConfiguration"> 3 <component name="CompilerConfiguration">
4 - <bytecodeTargetLevel target="1.8" /> 4 + <bytecodeTargetLevel target="11" />
5 </component> 5 </component>
6 </project> 6 </project>
@@ -82,4 +82,6 @@ dependencies { @@ -82,4 +82,6 @@ dependencies {
82 implementation 'com.kingja.loadsir:loadsir:1.3.8' 82 implementation 'com.kingja.loadsir:loadsir:1.3.8'
83 83
84 implementation 'com.android.support:multidex:1.0.3' 84 implementation 'com.android.support:multidex:1.0.3'
  85 +
  86 + implementation 'io.github.youth5201314:banner:2.2.2'
85 } 87 }
@@ -2,9 +2,10 @@ @@ -2,9 +2,10 @@
2 <manifest xmlns:android="http://schemas.android.com/apk/res/android" 2 <manifest xmlns:android="http://schemas.android.com/apk/res/android"
3 package="com.br_technology.securitytrain_master"> 3 package="com.br_technology.securitytrain_master">
4 4
5 - <uses-permission android:name="android.permission.INTERNET"/> 5 + <uses-permission android:name="android.permission.INTERNET" />
6 <uses-permission android:name="android.permission.ACCESS_NETWORK_STATE" /> 6 <uses-permission android:name="android.permission.ACCESS_NETWORK_STATE" />
7 <uses-permission android:name="android.permission.CHANGE_NETWORK_STATE" /> 7 <uses-permission android:name="android.permission.CHANGE_NETWORK_STATE" />
  8 +
8 <application 9 <application
9 android:allowBackup="true" 10 android:allowBackup="true"
10 android:icon="@mipmap/ic_launcher" 11 android:icon="@mipmap/ic_launcher"
@@ -26,20 +27,37 @@ @@ -26,20 +27,37 @@
26 <!--适配华为(huawei)刘海屏--> 27 <!--适配华为(huawei)刘海屏-->
27 <meta-data 28 <meta-data
28 android:name="android.notch_support" 29 android:name="android.notch_support"
29 - android:value="true"/> 30 + android:value="true" />
30 <!--适配小米(xiaomi)刘海屏--> 31 <!--适配小米(xiaomi)刘海屏-->
31 <meta-data 32 <meta-data
32 android:name="notch.config" 33 android:name="notch.config"
33 android:value="portrait|landscape" /> 34 android:value="portrait|landscape" />
34 35
35 36
36 - <activity android:name=".MainActivity"> 37 + <activity android:name=".ui.login.AccountLoginActivity">
37 <intent-filter> 38 <intent-filter>
38 <action android:name="android.intent.action.MAIN" /> 39 <action android:name="android.intent.action.MAIN" />
39 40
40 <category android:name="android.intent.category.LAUNCHER" /> 41 <category android:name="android.intent.category.LAUNCHER" />
41 </intent-filter> 42 </intent-filter>
42 </activity> 43 </activity>
  44 +
  45 + <activity
  46 + android:name=".ui.main.MainActivity"
  47 + android:screenOrientation="portrait" />
  48 +
  49 + <activity
  50 + android:name=".ui.login.ForgetPasswordActivity"
  51 + android:screenOrientation="portrait" />
  52 + <activity
  53 + android:name=".ui.login.MobileLoginActivity"
  54 + android:screenOrientation="portrait" />
  55 + <activity
  56 + android:name=".ui.home.activity.SearchActivity"
  57 + android:screenOrientation="portrait" />
  58 + <activity android:name=".ui.home.activity.DatabaseActivity" />
  59 +
  60 +
43 </application> 61 </application>
44 62
45 </manifest> 63 </manifest>
1 -package com.br_technology.securitytrain_master  
2 -  
3 -import androidx.appcompat.app.AppCompatActivity  
4 -import android.os.Bundle  
5 -import android.view.View  
6 -import androidx.lifecycle.Observer  
7 -import com.br_technology.securitytrain_master.databinding.ActivityMainBinding  
8 -import com.br_technology.securitytrain_master.test.TestModel  
9 -import com.wjx.android.wanandroidmvvm.base.view.BaseLifeCycleActivity  
10 -  
11 -class MainActivity : BaseLifeCycleActivity<TestModel,ActivityMainBinding>(ActivityMainBinding::inflate),  
12 - View.OnClickListener {  
13 - override fun onCreate(savedInstanceState: Bundle?) {  
14 - super.onCreate(savedInstanceState)  
15 - binding.tvTest.setOnClickListener(this)  
16 - }  
17 -  
18 - override fun initDataObserver() {  
19 - mViewModel.mTestListData.observe(this, Observer { response ->  
20 - response.let {  
21 - binding.tvName.text = it.result[0].name  
22 - }  
23 - })  
24 - }  
25 -  
26 - override fun onClick(v: View?) {  
27 - when(v?.id){  
28 - R.id.tv_test ->{  
29 - mViewModel.getTestData()  
30 - }  
31 - }  
32 - }  
33 -}  
1 package com.br_technology.securitytrain_master.base.common 1 package com.br_technology.securitytrain_master.base.common
2 2
3 -import android.app.Service  
4 import android.content.Context 3 import android.content.Context
5 -import android.content.Intent  
6 -import android.os.Vibrator  
7 import java.lang.reflect.ParameterizedType 4 import java.lang.reflect.ParameterizedType
8 5
9 /** 6 /**
1 package com.wjx.android.wanandroidmvvm.network 1 package com.wjx.android.wanandroidmvvm.network
2 2
3 -import com.br_technology.securitytrain_master.test.TestResponse 3 +import com.br_technology.securitytrain_master.ui.main.repository.MainRepository
4 import com.wjx.android.wanandroidmvvm.network.response.BaseResponse 4 import com.wjx.android.wanandroidmvvm.network.response.BaseResponse
5 import io.reactivex.Observable 5 import io.reactivex.Observable
6 import retrofit2.http.GET 6 import retrofit2.http.GET
@@ -16,5 +16,5 @@ import retrofit2.http.Query @@ -16,5 +16,5 @@ import retrofit2.http.Query
16 interface ApiService { 16 interface ApiService {
17 @Headers("apicode:e25d1b2303dc443b8428b08f08400f04") 17 @Headers("apicode:e25d1b2303dc443b8428b08f08400f04")
18 @GET("apis/dst/collegeInfoQuery/collegeInfoQuery") 18 @GET("apis/dst/collegeInfoQuery/collegeInfoQuery")
19 - fun test(@Query("name") name : String): Observable<BaseResponse<List<TestResponse>>> 19 + fun test(@Query("name") name : String): Observable<BaseResponse<List<MainRepository>>>
20 } 20 }
1 package com.wjx.android.wanandroidmvvm.base.view 1 package com.wjx.android.wanandroidmvvm.base.view
2 2
  3 +import android.app.Activity
3 import android.content.Context 4 import android.content.Context
  5 +import android.content.Intent
4 import android.graphics.Color 6 import android.graphics.Color
5 import android.os.Build 7 import android.os.Build
6 import android.os.Bundle 8 import android.os.Bundle
@@ -40,7 +42,7 @@ abstract class BaseActivity : AppCompatActivity() { @@ -40,7 +42,7 @@ abstract class BaseActivity : AppCompatActivity() {
40 } 42 }
41 43
42 override fun onCreate(savedInstanceState: Bundle?) { 44 override fun onCreate(savedInstanceState: Bundle?) {
43 - if(Build.VERSION.SDK_INT >= Build.VERSION_CODES.M) { 45 + if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.M) {
44 val modes = window.windowManager.defaultDisplay.supportedModes 46 val modes = window.windowManager.defaultDisplay.supportedModes
45 modes.sortBy { 47 modes.sortBy {
46 it.refreshRate 48 it.refreshRate
@@ -62,8 +64,9 @@ abstract class BaseActivity : AppCompatActivity() { @@ -62,8 +64,9 @@ abstract class BaseActivity : AppCompatActivity() {
62 } 64 }
63 // EventBus.getDefault().register(this) 65 // EventBus.getDefault().register(this)
64 66
65 - ImmersionBar.with(this).transparentStatusBar() .transparentNavigationBar() //透明导航栏,不写默认黑色(设置此方法,fullScreen()方法自动为true)  
66 - .transparentBar().navigationBarDarkIcon(true).init() 67 + ImmersionBar.with(this).transparentStatusBar().init()
  68 +// .transparentNavigationBar() //透明导航栏,不写默认黑色(设置此方法,fullScreen()方法自动为true)
  69 +// .transparentBar().navigationBarDarkIcon(true)
67 } 70 }
68 71
69 @RequiresApi(Build.VERSION_CODES.M) 72 @RequiresApi(Build.VERSION_CODES.M)
@@ -176,4 +179,18 @@ abstract class BaseActivity : AppCompatActivity() { @@ -176,4 +179,18 @@ abstract class BaseActivity : AppCompatActivity() {
176 // fun changeThemeEvent(event: ChangeThemeEvent) { 179 // fun changeThemeEvent(event: ChangeThemeEvent) {
177 // initStatusColor(0) 180 // initStatusColor(0)
178 // } 181 // }
  182 +
  183 +
  184 + protected fun startActivity(activity: Class<out Activity>) {
  185 + startActivity(activity, null)
  186 + }
  187 +
  188 + protected fun startActivity(activity: Class<out Activity>, bundle: Bundle?) {
  189 + val intent = Intent(this, activity)
  190 + if (bundle != null) {
  191 + intent.putExtras(bundle)
  192 + }
  193 + startActivity(intent)
  194 + }
  195 +
179 } 196 }
  1 +package com.br_technology.securitytrain_master.base.view
  2 +
  3 +import android.view.LayoutInflater
  4 +import android.view.View
  5 +import android.view.ViewGroup
  6 +import androidx.recyclerview.widget.RecyclerView
  7 +import androidx.viewbinding.ViewBinding
  8 +import java.util.ArrayList
  9 +
  10 +/**
  11 + * createTime:2021/7/28 8:44
  12 + * auth:张继
  13 + * des: 简单列表适配器
  14 + */
  15 +abstract class BaseAdapter<T, VB : ViewBinding>(private val inflate: (LayoutInflater) -> VB) :
  16 + RecyclerView.Adapter<BaseViewHolder<VB>>() {
  17 + private val list: MutableList<T> = ArrayList()
  18 +
  19 + override fun onCreateViewHolder(parent: ViewGroup, viewType: Int): BaseViewHolder<VB> {
  20 + return BaseViewHolder(inflate(LayoutInflater.from(parent.context)))
  21 + }
  22 +
  23 + override fun onBindViewHolder(holder: BaseViewHolder<VB>, position: Int) {
  24 + if (list.isEmpty()) return
  25 + onBind(holder.item, position, list[position])
  26 + }
  27 +
  28 + abstract fun onBind(holder: VB, position: Int, data: T)
  29 +
  30 +
  31 + override fun getItemCount(): Int {
  32 + return list.size
  33 + }
  34 +
  35 + /**
  36 + * 添加一条数据
  37 + */
  38 + fun addData(t: T) {
  39 + list.add(t)
  40 + notifyDataSetChanged()
  41 + }
  42 +
  43 + /**
  44 + * 指定位置添加一条数据
  45 + */
  46 + fun addDataAndPosition(t: T, position: Int) {
  47 + list.add(position, t)
  48 + notifyItemChanged(position)
  49 + }
  50 +
  51 + fun addList(t: List<T>) {
  52 + val oldPosition = list.size
  53 + list.addAll(t)
  54 + notifyItemChanged(oldPosition, list.size)
  55 + }
  56 +
  57 + fun addListAndPosition(t: List<T>, position: Int) {
  58 + list.addAll(position, t)
  59 + notifyItemChanged(position, list.size)
  60 + }
  61 +
  62 +}
@@ -63,10 +63,12 @@ abstract class BaseFragment : Fragment() { @@ -63,10 +63,12 @@ abstract class BaseFragment : Fragment() {
63 } 63 }
64 if (ColorUtils.calculateLuminance(Color.TRANSPARENT) >= 0.5) { 64 if (ColorUtils.calculateLuminance(Color.TRANSPARENT) >= 0.5) {
65 // 设置状态栏中字体的颜色为黑色 65 // 设置状态栏中字体的颜色为黑色
66 - requireActivity().window.decorView.systemUiVisibility = View.SYSTEM_UI_FLAG_LIGHT_STATUS_BAR 66 + requireActivity().window.decorView.systemUiVisibility =
  67 + View.SYSTEM_UI_FLAG_LIGHT_STATUS_BAR
67 } else { 68 } else {
68 // 跟随系统 69 // 跟随系统
69 - requireActivity().window.decorView.systemUiVisibility = View.SYSTEM_UI_FLAG_LAYOUT_STABLE 70 + requireActivity().window.decorView.systemUiVisibility =
  71 + View.SYSTEM_UI_FLAG_LAYOUT_STABLE
70 } 72 }
71 } 73 }
72 74
@@ -5,12 +5,15 @@ import android.text.TextUtils @@ -5,12 +5,15 @@ import android.text.TextUtils
5 import android.view.LayoutInflater 5 import android.view.LayoutInflater
6 import android.view.View 6 import android.view.View
7 import android.widget.Toast 7 import android.widget.Toast
  8 +import androidx.appcompat.widget.Toolbar
8 import androidx.lifecycle.Observer 9 import androidx.lifecycle.Observer
9 import androidx.lifecycle.ViewModelProvider 10 import androidx.lifecycle.ViewModelProvider
10 import androidx.viewbinding.ViewBinding 11 import androidx.viewbinding.ViewBinding
  12 +import com.br_technology.securitytrain_master.R
11 import com.br_technology.securitytrain_master.base.common.CommonUtil 13 import com.br_technology.securitytrain_master.base.common.CommonUtil
12 import com.br_technology.securitytrain_master.base.common.State 14 import com.br_technology.securitytrain_master.base.common.State
13 import com.br_technology.securitytrain_master.base.common.StateType 15 import com.br_technology.securitytrain_master.base.common.StateType
  16 +import com.br_technology.securitytrain_master.expand.statusBarHeight
14 import com.kingja.loadsir.callback.SuccessCallback 17 import com.kingja.loadsir.callback.SuccessCallback
15 import com.wjx.android.wanandroidmvvm.base.viewmodel.BaseViewModel 18 import com.wjx.android.wanandroidmvvm.base.viewmodel.BaseViewModel
16 import com.wjx.android.wanandroidmvvm.common.callback.EmptyCallBack 19 import com.wjx.android.wanandroidmvvm.common.callback.EmptyCallBack
@@ -24,7 +27,8 @@ import com.wjx.android.wanandroidmvvm.common.callback.LoadingCallBack @@ -24,7 +27,8 @@ import com.wjx.android.wanandroidmvvm.common.callback.LoadingCallBack
24 * @date: 2020/02/22 27 * @date: 2020/02/22
25 * Time: 16:30 28 * Time: 16:30
26 */ 29 */
27 -abstract class BaseLifeCycleActivity<VM : BaseViewModel<*>,VB : ViewBinding>(private val inflate: (LayoutInflater) -> VB) : BaseActivity() { 30 +abstract class BaseLifeCycleActivity<VM : BaseViewModel<*>, VB : ViewBinding>(private val inflate: (LayoutInflater) -> VB) :
  31 + BaseActivity() {
28 protected lateinit var mViewModel: VM 32 protected lateinit var mViewModel: VM
29 lateinit var binding: VB 33 lateinit var binding: VB
30 34
@@ -34,6 +38,15 @@ abstract class BaseLifeCycleActivity<VM : BaseViewModel<*>,VB : ViewBinding>(pri @@ -34,6 +38,15 @@ abstract class BaseLifeCycleActivity<VM : BaseViewModel<*>,VB : ViewBinding>(pri
34 } 38 }
35 39
36 override fun initView() { 40 override fun initView() {
  41 +
  42 + val statusBar: Toolbar? = binding.root.findViewById(R.id.status_bar)
  43 + statusBar?.post {
  44 + val layoutParams = statusBar.layoutParams
  45 + layoutParams.height = statusBar.statusBarHeight()
  46 + statusBar.layoutParams = layoutParams
  47 + }
  48 +
  49 +
37 showLoading() 50 showLoading()
38 51
39 mViewModel = ViewModelProvider(this).get(CommonUtil.getClass(this)) 52 mViewModel = ViewModelProvider(this).get(CommonUtil.getClass(this))
@@ -39,18 +39,18 @@ abstract class BaseLifeCycleFragment<VM : BaseViewModel<*>> : BaseFragment() { @@ -39,18 +39,18 @@ abstract class BaseLifeCycleFragment<VM : BaseViewModel<*>> : BaseFragment() {
39 abstract fun initDataObserver() 39 abstract fun initDataObserver()
40 40
41 private fun showLoading() { 41 private fun showLoading() {
42 - loadService.showCallback(LoadingCallBack::class.java) 42 +// loadService.showCallback(LoadingCallBack::class.java)
43 } 43 }
44 44
45 private fun showSuccess() { 45 private fun showSuccess() {
46 - loadService.showCallback(SuccessCallback::class.java) 46 +// loadService.showCallback(SuccessCallback::class.java)
47 } 47 }
48 48
49 private fun showError(msg: String) { 49 private fun showError(msg: String) {
50 if (!TextUtils.isEmpty(msg)) { 50 if (!TextUtils.isEmpty(msg)) {
51 Toast.makeText(context, msg, Toast.LENGTH_SHORT).show() 51 Toast.makeText(context, msg, Toast.LENGTH_SHORT).show()
52 } 52 }
53 - loadService.showCallback(ErrorCallBack::class.java) 53 +// loadService.showCallback(ErrorCallBack::class.java)
54 } 54 }
55 55
56 open fun showTip(msg: String) { 56 open fun showTip(msg: String) {
@@ -63,11 +63,11 @@ abstract class BaseLifeCycleFragment<VM : BaseViewModel<*>> : BaseFragment() { @@ -63,11 +63,11 @@ abstract class BaseLifeCycleFragment<VM : BaseViewModel<*>> : BaseFragment() {
63 // } 63 // }
64 // false 64 // false
65 // } 65 // }
66 - loadService.showCallback(SuccessCallback::class.java) 66 +// loadService.showCallback(SuccessCallback::class.java)
67 } 67 }
68 68
69 open fun showEmpty() { 69 open fun showEmpty() {
70 - loadService.showCallback(EmptyCallBack::class.java) 70 +// loadService.showCallback(EmptyCallBack::class.java)
71 } 71 }
72 72
73 private val observer by lazy { 73 private val observer by lazy {
  1 +package com.br_technology.securitytrain_master.base.view
  2 +
  3 +import android.app.Activity
  4 +import android.content.Context
  5 +import android.content.Intent
  6 +import android.os.Bundle
  7 +import android.view.LayoutInflater
  8 +import android.view.View
  9 +import android.view.ViewGroup
  10 +import androidx.recyclerview.widget.RecyclerView
  11 +import androidx.viewbinding.ViewBinding
  12 +import java.util.ArrayList
  13 +
  14 +/**
  15 + * createTime:2021/7/28 8:44
  16 + * auth:张继
  17 + * des:多布局适配器
  18 + */
  19 +abstract class BaseMultiAdapter<T, VB : ViewBinding> : RecyclerView.Adapter<BaseViewHolder<VB>>() {
  20 + protected val list: MutableList<T> = ArrayList()
  21 +
  22 + abstract override fun onCreateViewHolder(parent: ViewGroup, viewType: Int): BaseViewHolder<VB>
  23 +
  24 +
  25 + override fun onBindViewHolder(holder: BaseViewHolder<VB>, position: Int) {
  26 + if (list.isEmpty()) return
  27 + onBind(holder.item, position, list[position])
  28 + }
  29 +
  30 + abstract fun onBind(holder: VB, position: Int, data: T)
  31 +
  32 +
  33 + override fun getItemCount(): Int {
  34 + return if (list.isEmpty()) {
  35 + 1
  36 + } else {
  37 + list.size
  38 + }
  39 + }
  40 +
  41 + /**
  42 + * 添加一条数据
  43 + */
  44 + fun addData(t: T) {
  45 + list.add(t)
  46 + notifyDataSetChanged()
  47 + }
  48 +
  49 + /**
  50 + * 指定位置添加一条数据
  51 + */
  52 + fun addDataAndPosition(t: T, position: Int) {
  53 + list.add(position, t)
  54 + notifyItemChanged(position)
  55 + }
  56 +
  57 + fun addList(t: List<T>) {
  58 + val oldPosition = list.size
  59 + list.addAll(t)
  60 + notifyItemChanged(oldPosition, list.size)
  61 + }
  62 +
  63 + fun addListAndPosition(t: List<T>, position: Int) {
  64 + list.addAll(position, t)
  65 + notifyItemChanged(position, list.size)
  66 + }
  67 +
  68 + protected fun startActivity(context: Context, cls: Class<out Activity>) {
  69 + startActivity(context, cls, null)
  70 + }
  71 +
  72 + protected fun startActivity(context: Context, cls: Class<out Activity>, bundle: Bundle?) {
  73 + val intent = Intent(context, cls)
  74 + if (bundle != null) {
  75 + intent.putExtras(bundle)
  76 + }
  77 + context.startActivity(intent)
  78 + }
  79 +
  80 +
  81 +}
  1 +package com.br_technology.securitytrain_master.base.view
  2 +
  3 +import androidx.recyclerview.widget.RecyclerView
  4 +import androidx.viewbinding.ViewBinding
  5 +
  6 +/**
  7 + * createTime:2021/7/28 8:46
  8 + * auth:张继
  9 + * des:
  10 + */
  11 +class BaseViewHolder<VB:ViewBinding>(val item: VB) : RecyclerView.ViewHolder(item.root) {
  12 +
  13 +
  14 +}
@@ -28,6 +28,7 @@ open class BaseViewModel<T : BaseRepository> : ViewModel() { @@ -28,6 +28,7 @@ open class BaseViewModel<T : BaseRepository> : ViewModel() {
28 .newInstance(loadState) 28 .newInstance(loadState)
29 } 29 }
30 30
  31 +
31 override fun onCleared() { 32 override fun onCleared() {
32 super.onCleared() 33 super.onCleared()
33 mRepository.unSubscribe() 34 mRepository.unSubscribe()
  1 +package com.br_technology.securitytrain_master.expand
  2 +
  3 +import android.widget.ImageView
  4 +import com.br_technology.securitytrain_master.R
  5 +import com.bumptech.glide.Glide
  6 +import com.bumptech.glide.load.resource.bitmap.RoundedCorners
  7 +import com.bumptech.glide.request.RequestOptions
  8 +
  9 +/**
  10 + * createTime:2021/7/28 9:56
  11 + * auth:张继
  12 + * des:
  13 + */
  14 +
  15 +fun ImageView.glideRound(pic: Int, round: Int) {
  16 + Glide.with(this)
  17 + .load(pic)
  18 + .apply(RequestOptions.bitmapTransform(RoundedCorners(round)))
  19 + .into(this)
  20 +}
  21 +
  22 +fun ImageView.courseHead(pic: String) {
  23 + Glide.with(this)
  24 + .load(pic)
  25 + .placeholder(R.mipmap.placeholder_head)
  26 + .into(this)
  27 +}
  1 +package com.br_technology.securitytrain_master
  2 +
  3 +import android.text.Editable
  4 +import android.text.TextUtils
  5 +import java.util.regex.Pattern
  6 +
  7 +/**
  8 + * createTime:2021/7/27 11:46
  9 + * auth:张继
  10 + * des:
  11 + */
  12 +
  13 +
  14 +fun Editable.identity(): Boolean {
  15 + if (TextUtils.isEmpty(this)) {
  16 + return false
  17 + }
  18 + val regex = "^[1-9]\\d{5}[1-9]\\d{3}((0\\d)|(1[0-2]))(([0|1|2]\\d)|3[0-1])\\d{3}([0-9Xx])$";
  19 + return Pattern.matches(regex, this.toString())
  20 +}
  21 +
  22 +fun Editable.isPhone(): Boolean {
  23 + return !TextUtils.isEmpty(this) && Pattern.matches(
  24 + "^1(3[0-9]|4[0-9]|5[0-9]|6[0-9]|7[0-9]|8[0-9]|9[0-9])\\d{8}$",
  25 + this
  26 + )
  27 +}
  1 +package com.br_technology.securitytrain_master.expand
  2 +
  3 +import android.app.Application
  4 +import android.content.Context
  5 +import android.graphics.Point
  6 +import android.os.Build
  7 +import android.view.View
  8 +import android.view.WindowManager
  9 +
  10 +/**
  11 + * createTime:2021/7/28 11:29
  12 + * auth:张继
  13 + * des:
  14 + */
  15 +fun View.statusBarHeight(): Int {
  16 + val resourceId = resources.getIdentifier("status_bar_height", "dimen", "android")
  17 + return resources.getDimensionPixelSize(resourceId);
  18 +}
  19 +
  20 +fun View.screenWidth(): Int {
  21 + val manager: WindowManager = this.context.getSystemService(Context.WINDOW_SERVICE) as WindowManager
  22 + val point = Point()
  23 + manager.defaultDisplay.getRealSize(point)
  24 + return point.x
  25 +}
  26 +
1 -package com.br_technology.securitytrain_master.test  
2 -  
3 -import androidx.lifecycle.MutableLiveData  
4 -import com.wjx.android.wanandroidmvvm.base.viewmodel.BaseViewModel  
5 -import com.wjx.android.wanandroidmvvm.network.response.BaseResponse  
6 -  
7 -/**  
8 - * Time: 7/26/2021 14:54  
9 - * Author: Captain  
10 - * Description: 初见时你很迷人  
11 - */  
12 -class TestModel : BaseViewModel<TestRepository>(){  
13 - val mTestListData: MutableLiveData<BaseResponse<List<TestResponse>>> = MutableLiveData()  
14 - fun getTestData(){  
15 - mRepository.test(mTestListData)  
16 - }  
17 -}  
1 -package com.br_technology.securitytrain_master.test  
2 -  
3 -import androidx.lifecycle.MutableLiveData  
4 -import com.br_technology.securitytrain_master.base.common.State  
5 -import com.wjx.android.wanandroidmvvm.base.observer.BaseObserver  
6 -import com.wjx.android.wanandroidmvvm.base.repository.ApiRepository  
7 -import com.wjx.android.wanandroidmvvm.network.response.BaseResponse  
8 -import io.reactivex.android.schedulers.AndroidSchedulers  
9 -import io.reactivex.schedulers.Schedulers  
10 -  
11 -/**  
12 - * Time: 7/26/2021 14:55  
13 - * Author: Captain  
14 - * Description: 初见时你很迷人  
15 - */  
16 -class TestRepository(val loadState: MutableLiveData<State>) : ApiRepository() {  
17 -  
18 - fun test(liveData: MutableLiveData<BaseResponse<List<TestResponse>>>) {  
19 - apiService.test("北京")  
20 - .subscribeOn(Schedulers.io())  
21 - .observeOn(AndroidSchedulers.mainThread())  
22 - .subscribe(  
23 - BaseObserver(  
24 - liveData,  
25 - loadState,  
26 - this  
27 - )  
28 - )  
29 - }  
30 -}  
1 -package com.br_technology.securitytrain_master.test  
2 -  
3 -/**  
4 - * Time: 7/26/2021 15:03  
5 - * Author: Captain  
6 - * Description: 初见时你很迷人  
7 - */  
8 -data class TestResponse(  
9 - var name : String  
10 -)  
1 -package com.br_technology.securitytrain_master 1 +package com.br_technology.securitytrain_master.ui
2 2
3 /** 3 /**
4 * Time: 7/26/2021 10:11 4 * Time: 7/26/2021 10:11
  1 +package com.br_technology.securitytrain_master.ui.bank
  2 +
  3 +import com.br_technology.securitytrain_master.R
  4 +import com.br_technology.securitytrain_master.ui.bank.viewmodel.BankViewModel
  5 +import com.wjx.android.wanandroidmvvm.base.view.BaseLifeCycleFragment
  6 +
  7 +/**
  8 + * createTime:2021/7/27 15:47
  9 + * auth:张继
  10 + * des:
  11 + */
  12 +class BankFragment :BaseLifeCycleFragment<BankViewModel>() {
  13 + override fun initDataObserver() {
  14 +
  15 + }
  16 +
  17 + override fun getLayoutId(): Int {
  18 + return R.layout.fragment_bank
  19 + }
  20 +}
  1 +package com.br_technology.securitytrain_master.ui.bank.repository
  2 +
  3 +import androidx.lifecycle.MutableLiveData
  4 +import com.br_technology.securitytrain_master.base.common.State
  5 +import com.wjx.android.wanandroidmvvm.base.repository.ApiRepository
  6 +
  7 +/**
  8 + * createTime:2021/7/27 15:49
  9 + * auth:张继
  10 + * des:
  11 + */
  12 +class BankRepository(val loadState: MutableLiveData<State>):ApiRepository() {
  13 +}
  1 +package com.br_technology.securitytrain_master.ui.bank.viewmodel
  2 +
  3 +import com.br_technology.securitytrain_master.ui.bank.repository.BankRepository
  4 +import com.wjx.android.wanandroidmvvm.base.viewmodel.BaseViewModel
  5 +
  6 +/**
  7 + * createTime:2021/7/27 15:48
  8 + * auth:张继
  9 + * des:
  10 + */
  11 +class BankViewModel:BaseViewModel<BankRepository>() {
  12 +}
  1 +package com.br_technology.securitytrain_master.ui.home.activity
  2 +
  3 +import android.os.Bundle
  4 +import com.br_technology.securitytrain_master.databinding.ActivityDatabaseBinding
  5 +import com.br_technology.securitytrain_master.ui.home.viewmodel.DatabaseViewModel
  6 +import com.wjx.android.wanandroidmvvm.base.view.BaseLifeCycleActivity
  7 +
  8 +/**
  9 + * createTime:2021/7/28 17:41
  10 + * auth:张继
  11 + * des:
  12 + */
  13 +class DatabaseActivity :
  14 + BaseLifeCycleActivity<DatabaseViewModel, ActivityDatabaseBinding>(ActivityDatabaseBinding::inflate) {
  15 + override fun onCreate(savedInstanceState: Bundle?) {
  16 + super.onCreate(savedInstanceState)
  17 +
  18 + }
  19 +
  20 + override fun initDataObserver() {
  21 + }
  22 +}
  1 +package com.br_technology.securitytrain_master.ui.home.activity
  2 +
  3 +import android.graphics.drawable.Drawable
  4 +import android.os.Bundle
  5 +import android.view.MotionEvent
  6 +import android.view.View
  7 +import android.widget.EditText
  8 +import androidx.fragment.app.FragmentPagerAdapter
  9 +import com.br_technology.securitytrain_master.databinding.ActivitySearchBinding
  10 +import com.br_technology.securitytrain_master.ui.home.adapter.HistoryAdapter
  11 +import com.br_technology.securitytrain_master.ui.home.adapter.ResultPagerAdapter
  12 +import com.br_technology.securitytrain_master.ui.home.fragment.HomeFragment
  13 +import com.br_technology.securitytrain_master.ui.home.fragment.ResultFragment
  14 +import com.br_technology.securitytrain_master.ui.home.viewmodel.SearchViewModel
  15 +import com.br_technology.securitytrain_master.view.DialogSureCancel
  16 +import com.br_technology.securitytrain_master.view.listener.DialogListener
  17 +import com.wjx.android.wanandroidmvvm.base.view.BaseLifeCycleActivity
  18 +
  19 +/**
  20 + * createTime:2021/7/28 11:13
  21 + * auth:张继
  22 + * des:
  23 + */
  24 +class SearchActivity :
  25 + BaseLifeCycleActivity<SearchViewModel, ActivitySearchBinding>(ActivitySearchBinding::inflate) {
  26 + override fun onCreate(savedInstanceState: Bundle?) {
  27 + super.onCreate(savedInstanceState)
  28 + binding.apply {
  29 + back.setOnClickListener {
  30 + finish()
  31 + }
  32 +
  33 + val historyAdapter = HistoryAdapter()
  34 + historyRecycler.adapter = historyAdapter
  35 + val listOf = listOf(
  36 + "历史标签记录历史标签记录历史标签记录历史标签记录",
  37 + "历史标签记录",
  38 + "历史标签记录",
  39 + "d",
  40 + "历史标签记录历史标签记录",
  41 + "历史标签记录历史标签记录历史标签记录",
  42 + "历史标签记录历史标签记录历史标签记录历史标签记录",
  43 + )
  44 + historyAdapter.addList(listOf)
  45 + // 清空历史记录
  46 + clear.setOnClickListener {
  47 + DialogSureCancel(it.context).setListener(object : DialogListener {
  48 + override fun determine() {
  49 + // 清空记录
  50 + }
  51 + }).show()
  52 + }
  53 +
  54 + clearEdit.setOnClickListener {
  55 + searchEdit.setText("")
  56 + }
  57 + // 点击搜索按钮
  58 + search.setOnClickListener {
  59 + // 点击搜索时隐藏历史记录
  60 + historyGroup.visibility = View.GONE
  61 + historyRecycler.visibility = View.GONE
  62 + tabLayout.visibility = View.VISIBLE
  63 + viewPager.visibility = View.VISIBLE
  64 + }
  65 +
  66 + searchEdit.setOnClickListener {
  67 + // 输入框点击时显示历史记录
  68 + historyGroup.visibility = View.VISIBLE
  69 + historyRecycler.visibility = View.VISIBLE
  70 + tabLayout.visibility = View.GONE
  71 + viewPager.visibility = View.GONE
  72 + }
  73 +
  74 + val searchResultAdapter = ResultPagerAdapter(
  75 + supportFragmentManager,
  76 + FragmentPagerAdapter.BEHAVIOR_RESUME_ONLY_CURRENT_FRAGMENT
  77 + )
  78 + val list =
  79 + listOf(ResultFragment(), ResultFragment(), ResultFragment(), ResultFragment())
  80 + val titles = listOf("在线课程", "直播课程", "文本课程", "资料库")
  81 + searchResultAdapter.addData(list)
  82 + searchResultAdapter.addTitle(titles)
  83 + viewPager.adapter = searchResultAdapter
  84 + tabLayout.setupWithViewPager(viewPager)
  85 +
  86 +
  87 + }
  88 + }
  89 +
  90 + override fun initDataObserver() {
  91 +
  92 + }
  93 +}
  1 +package com.br_technology.securitytrain_master.ui.home.adapter
  2 +
  3 +import com.br_technology.securitytrain_master.base.view.BaseAdapter
  4 +import com.br_technology.securitytrain_master.databinding.AdapterHistoryBinding
  5 +
  6 +/**
  7 + * createTime:2021/7/28 11:50
  8 + * auth:张继
  9 + * des:
  10 + */
  11 +class HistoryAdapter : BaseAdapter<String, AdapterHistoryBinding>(AdapterHistoryBinding::inflate) {
  12 +
  13 + override fun onBind(holder: AdapterHistoryBinding, position: Int, data: String) {
  14 + holder.name.text = data
  15 + }
  16 +}
  1 +package com.br_technology.securitytrain_master.ui.home.adapter
  2 +
  3 +import com.br_technology.securitytrain_master.base.view.BaseAdapter
  4 +import com.br_technology.securitytrain_master.databinding.AdapterRecommendDataBinding
  5 +import com.br_technology.securitytrain_master.expand.glideRound
  6 +import com.br_technology.securitytrain_master.ui.home.pojo.RecommendData
  7 +
  8 +/**
  9 + * createTime:2021/7/28 10:45
  10 + * auth:张继
  11 + * des:
  12 + */
  13 +class RecommendDataAdapter : BaseAdapter<RecommendData, AdapterRecommendDataBinding>(AdapterRecommendDataBinding::inflate) {
  14 +
  15 + override fun onBind(holder: AdapterRecommendDataBinding, position: Int, t: RecommendData) {
  16 + holder.pic.glideRound(t.pic, 16)
  17 + holder.name.text = t.name
  18 + holder.info.text = t.info
  19 + }
  20 +}
  1 +package com.br_technology.securitytrain_master.ui.home.adapter
  2 +
  3 +import android.view.LayoutInflater
  4 +import android.view.ViewGroup
  5 +import androidx.viewbinding.ViewBinding
  6 +import com.br_technology.securitytrain_master.base.view.BaseMultiAdapter
  7 +import com.br_technology.securitytrain_master.base.view.BaseViewHolder
  8 +import com.br_technology.securitytrain_master.databinding.AdapterRecommendDataBinding
  9 +import com.br_technology.securitytrain_master.databinding.LayoutEmptyBinding
  10 +import com.br_technology.securitytrain_master.expand.glideRound
  11 +import com.br_technology.securitytrain_master.ui.home.activity.DatabaseActivity
  12 +import com.br_technology.securitytrain_master.ui.home.pojo.RecommendData
  13 +
  14 +/**
  15 + * createTime:2021/7/28 15:45
  16 + * auth:张继
  17 + * des:
  18 + */
  19 +class ResultAdapter : BaseMultiAdapter<RecommendData, ViewBinding>() {
  20 +
  21 +
  22 + override fun onBind(holder: ViewBinding, position: Int, data: RecommendData) {
  23 + if (holder is AdapterRecommendDataBinding) {
  24 + holder.pic.glideRound(data.pic, 16)
  25 + holder.name.text = data.name
  26 + holder.info.text = data.info
  27 + // item点击时间
  28 + holder.root.setOnClickListener {
  29 + // 跳转
  30 + startActivity(it.context, DatabaseActivity::class.java)
  31 + }
  32 + }
  33 + }
  34 +
  35 + override fun getItemViewType(position: Int): Int {
  36 + return if (list.isEmpty()) {
  37 + 0
  38 + } else {
  39 + 1
  40 + }
  41 + }
  42 +
  43 + override fun onCreateViewHolder(parent: ViewGroup, viewType: Int): BaseViewHolder<ViewBinding> {
  44 + return if (viewType == 0) {
  45 + BaseViewHolder(
  46 + LayoutEmptyBinding.inflate(
  47 + LayoutInflater.from(parent.context),
  48 + parent,
  49 + false
  50 + )
  51 + )
  52 + } else {
  53 + BaseViewHolder(
  54 + AdapterRecommendDataBinding.inflate(
  55 + LayoutInflater.from(parent.context),
  56 + parent,
  57 + false
  58 + )
  59 + )
  60 + }
  61 + }
  62 +
  63 +}
  1 +package com.br_technology.securitytrain_master.ui.home.adapter
  2 +
  3 +import android.view.ViewGroup
  4 +import androidx.fragment.app.Fragment
  5 +import androidx.fragment.app.FragmentManager
  6 +import androidx.fragment.app.FragmentPagerAdapter
  7 +
  8 +/**
  9 + * createTime:2021/7/28 15:00
  10 + * auth:张继
  11 + * des:
  12 + */
  13 +class ResultPagerAdapter(fm: FragmentManager, behavior: Int) : FragmentPagerAdapter(fm, behavior) {
  14 + private val fragments: MutableList<Fragment> = ArrayList()
  15 + private val titles: MutableList<String> = ArrayList()
  16 +
  17 + fun addTitle(titles: List<String>) {
  18 + this.titles.addAll(titles)
  19 + }
  20 + fun addData(data: List<Fragment>) {
  21 + fragments.addAll(data)
  22 + notifyDataSetChanged()
  23 + }
  24 +
  25 + override fun getCount(): Int {
  26 + return fragments.size
  27 + }
  28 +
  29 + override fun getItem(position: Int): Fragment {
  30 + return fragments[position]
  31 + }
  32 +
  33 + override fun destroyItem(container: ViewGroup, position: Int, `object`: Any) {
  34 +// super.destroyItem(container, position, `object`)
  35 + }
  36 +
  37 + override fun getPageTitle(position: Int): CharSequence? {
  38 + return titles[position]
  39 + }
  40 +}
  1 +package com.br_technology.securitytrain_master.ui.home.adapter
  2 +
  3 +import com.br_technology.securitytrain_master.base.view.BaseAdapter
  4 +import com.br_technology.securitytrain_master.databinding.AdapterVideoCourseBinding
  5 +import com.br_technology.securitytrain_master.expand.courseHead
  6 +import com.br_technology.securitytrain_master.expand.glideRound
  7 +import com.br_technology.securitytrain_master.ui.home.pojo.VideoCourse
  8 +
  9 +/**
  10 + * createTime:2021/7/28 8:42
  11 + * auth:张继
  12 + * des:
  13 + */
  14 +class VideoCourseAdapter :
  15 + BaseAdapter<VideoCourse, AdapterVideoCourseBinding>(AdapterVideoCourseBinding::inflate) {
  16 +
  17 + override fun onBind(holder: AdapterVideoCourseBinding, position: Int, data: VideoCourse) {
  18 + // 视频首贞图片
  19 + holder.videoPic.glideRound(data.pic, 14)
  20 + // 课时
  21 + holder.lesson.text = data.lesson
  22 + // 视频名称
  23 + holder.courseName.text = data.courseName
  24 + holder.head.courseHead(data.head)
  25 + holder.name.text = data.name
  26 + }
  27 +}
  1 +package com.br_technology.securitytrain_master.ui.home.fragment
  2 +
  3 +import android.content.Intent
  4 +import android.graphics.Rect
  5 +import android.os.Bundle
  6 +import android.view.LayoutInflater
  7 +import android.view.View
  8 +import android.view.ViewGroup
  9 +import androidx.fragment.app.Fragment
  10 +import androidx.recyclerview.widget.RecyclerView
  11 +import com.br_technology.securitytrain_master.R
  12 +import com.br_technology.securitytrain_master.ui.home.activity.SearchActivity
  13 +import com.br_technology.securitytrain_master.ui.home.adapter.RecommendDataAdapter
  14 +import com.br_technology.securitytrain_master.ui.home.adapter.VideoCourseAdapter
  15 +import com.br_technology.securitytrain_master.ui.home.pojo.RecommendData
  16 +import com.br_technology.securitytrain_master.ui.home.pojo.VideoCourse
  17 +import com.bumptech.glide.Glide
  18 +import com.bumptech.glide.load.resource.bitmap.RoundedCorners
  19 +import com.bumptech.glide.request.RequestOptions
  20 +import com.youth.banner.Banner
  21 +import com.youth.banner.adapter.BannerAdapter
  22 +import com.youth.banner.adapter.BannerImageAdapter
  23 +import com.youth.banner.holder.BannerImageHolder
  24 +import com.youth.banner.indicator.CircleIndicator
  25 +
  26 +
  27 +/**
  28 + * createTime:2021/7/27 15:47
  29 + * auth:张继
  30 + * des:
  31 + */
  32 +//class HomeFragment :BaseLifeCycleFragment<MineViewModel>() {
  33 +// override fun initDataObserver() {
  34 +//
  35 +// }
  36 +//
  37 +// override fun getLayoutId(): Int {
  38 +// return R.layout.fragment_home
  39 +// }
  40 +//}
  41 +class HomeFragment : Fragment() {
  42 + override fun onCreateView(
  43 + inflater: LayoutInflater,
  44 + container: ViewGroup?,
  45 + savedInstanceState: Bundle?
  46 + ): View? {
  47 + return inflater.inflate(R.layout.fragment_home, container, false)
  48 + }
  49 +
  50 + override fun onViewCreated(view: View, savedInstanceState: Bundle?) {
  51 + super.onViewCreated(view, savedInstanceState)
  52 +
  53 + val banner: Banner<Int, BannerImageAdapter<Int>> = view.findViewById(R.id.banner)
  54 + banner.setAdapter(object : BannerImageAdapter<Int>(
  55 + mutableListOf(
  56 + R.mipmap.banner,
  57 + R.mipmap.banner,
  58 + R.mipmap.banner
  59 + )
  60 + ) {
  61 + override fun onBindView(
  62 + holder: BannerImageHolder,
  63 + data: Int,
  64 + position: Int,
  65 + size: Int
  66 + ) {
  67 + Glide.with(requireActivity())
  68 + .load(data)
  69 + .apply(RequestOptions.bitmapTransform(RoundedCorners(8)))
  70 + .into(holder.imageView)
  71 +
  72 + }
  73 + }).addBannerLifecycleObserver(this)
  74 + .indicator = CircleIndicator(requireContext())
  75 +
  76 + // 视频课程
  77 + val videoCourse: RecyclerView = view.findViewById(R.id.video_course)
  78 + videoCourse.addItemDecoration(object : RecyclerView.ItemDecoration() {
  79 + override fun getItemOffsets(
  80 + outRect: Rect,
  81 + view: View,
  82 + parent: RecyclerView,
  83 + state: RecyclerView.State
  84 + ) {
  85 + super.getItemOffsets(outRect, view, parent, state)
  86 + if (parent.getChildAdapterPosition(view) % 2 == 0) {
  87 + outRect.top = 24
  88 + outRect.right = 15
  89 + } else {
  90 + outRect.top = 24
  91 + outRect.left = 15
  92 + }
  93 + }
  94 + })
  95 + val videoCourseAdapter = VideoCourseAdapter()
  96 + val list = mutableListOf(
  97 + VideoCourse(R.mipmap.banner, "10课时", "自动化制作课程", "", "张钧-三岗职位培训班"),
  98 + VideoCourse(R.mipmap.banner, "10课时", "自动化制作课程", "", "张钧-三岗职位培训班"),
  99 + VideoCourse(R.mipmap.banner, "10课时", "自动化制作课程", "", "张钧-三岗职位培训班"),
  100 + VideoCourse(R.mipmap.banner, "10课时", "自动化制作课程", "", "张钧-三岗职位培训班"),
  101 + )
  102 + videoCourse.adapter = videoCourseAdapter
  103 + videoCourseAdapter.addList(list)
  104 +
  105 + val recommendData: RecyclerView = view.findViewById(R.id.recommended_data)
  106 + val recommendDataAdapter = RecommendDataAdapter()
  107 + val recommendList = mutableListOf(
  108 + RecommendData(R.mipmap.banner, "思维导图高分作文法(高中)议论", "从这个角度看,康得在不经意间这样说过,既然我已踏上了这条道路,那么"),
  109 + RecommendData(R.mipmap.banner, "思维导图高分作文法(高中)议论", "从这个角度看,康得在不经意间这样说过,既然我已踏上了这条道路,那么"),
  110 + RecommendData(R.mipmap.banner, "思维导图高分作文法(高中)议论", "从这个角度看,康得在不经意间这样说过,既然我已踏上了这条道路,那么"),
  111 + RecommendData(R.mipmap.banner, "思维导图高分作文法(高中)议论", "从这个角度看,康得在不经意间这样说过,既然我已踏上了这条道路,那么"),
  112 + RecommendData(R.mipmap.banner, "思维导图高分作文法(高中)议论", "从这个角度看,康得在不经意间这样说过,既然我已踏上了这条道路,那么"),
  113 + RecommendData(R.mipmap.banner, "思维导图高分作文法(高中)议论", "从这个角度看,康得在不经意间这样说过,既然我已踏上了这条道路,那么"),
  114 + RecommendData(R.mipmap.banner, "思维导图高分作文法(高中)议论", "从这个角度看,康得在不经意间这样说过,既然我已踏上了这条道路,那么"),
  115 + RecommendData(R.mipmap.banner, "思维导图高分作文法(高中)议论", "从这个角度看,康得在不经意间这样说过,既然我已踏上了这条道路,那么"),
  116 + RecommendData(R.mipmap.banner, "思维导图高分作文法(高中)议论", "从这个角度看,康得在不经意间这样说过,既然我已踏上了这条道路,那么"),
  117 + RecommendData(R.mipmap.banner, "思维导图高分作文法(高中)议论", "从这个角度看,康得在不经意间这样说过,既然我已踏上了这条道路,那么"),
  118 + RecommendData(R.mipmap.banner, "思维导图高分作文法(高中)议论", "从这个角度看,康得在不经意间这样说过,既然我已踏上了这条道路,那么"),
  119 + )
  120 + recommendData.adapter = recommendDataAdapter
  121 + recommendDataAdapter.addList(recommendList)
  122 +
  123 +
  124 + view.findViewById<View>(R.id.search).setOnClickListener {
  125 + val intent = Intent(requireActivity(), SearchActivity::class.java)
  126 + startActivity(intent)
  127 + }
  128 + }
  129 +}
  1 +package com.br_technology.securitytrain_master.ui.home.fragment
  2 +
  3 +import android.os.Bundle
  4 +import android.view.LayoutInflater
  5 +import android.view.View
  6 +import android.view.ViewGroup
  7 +import androidx.fragment.app.Fragment
  8 +import androidx.recyclerview.widget.RecyclerView
  9 +import com.br_technology.securitytrain_master.R
  10 +import com.br_technology.securitytrain_master.databinding.FragmentResultBinding
  11 +import com.br_technology.securitytrain_master.ui.home.adapter.ResultAdapter
  12 +import com.br_technology.securitytrain_master.ui.home.pojo.RecommendData
  13 +
  14 +/**
  15 + * createTime:2021/7/28 15:39
  16 + * auth:张继
  17 + * des:
  18 + */
  19 +class ResultFragment : Fragment() {
  20 +
  21 + override fun onCreateView(
  22 + inflater: LayoutInflater,
  23 + container: ViewGroup?,
  24 + savedInstanceState: Bundle?
  25 + ): View {
  26 + return FragmentResultBinding.inflate(inflater).root
  27 + }
  28 +
  29 + override fun onViewCreated(view: View, savedInstanceState: Bundle?) {
  30 + super.onViewCreated(view, savedInstanceState)
  31 + val resultRecycler: RecyclerView = view.findViewById(R.id.result)
  32 + val recommendList = mutableListOf(
  33 + RecommendData(R.mipmap.banner, "思维导图高分作文法(高中)议论", "从这个角度看,康得在不经意间这样说过,既然我已踏上了这条道路,那么"),
  34 + RecommendData(R.mipmap.banner, "思维导图高分作文法(高中)议论", "从这个角度看,康得在不经意间这样说过,既然我已踏上了这条道路,那么"),
  35 + RecommendData(R.mipmap.banner, "思维导图高分作文法(高中)议论", "从这个角度看,康得在不经意间这样说过,既然我已踏上了这条道路,那么"),
  36 + RecommendData(R.mipmap.banner, "思维导图高分作文法(高中)议论", "从这个角度看,康得在不经意间这样说过,既然我已踏上了这条道路,那么"),
  37 + RecommendData(R.mipmap.banner, "思维导图高分作文法(高中)议论", "从这个角度看,康得在不经意间这样说过,既然我已踏上了这条道路,那么"),
  38 + RecommendData(R.mipmap.banner, "思维导图高分作文法(高中)议论", "从这个角度看,康得在不经意间这样说过,既然我已踏上了这条道路,那么"),
  39 + RecommendData(R.mipmap.banner, "思维导图高分作文法(高中)议论", "从这个角度看,康得在不经意间这样说过,既然我已踏上了这条道路,那么"),
  40 + RecommendData(R.mipmap.banner, "思维导图高分作文法(高中)议论", "从这个角度看,康得在不经意间这样说过,既然我已踏上了这条道路,那么"),
  41 + RecommendData(R.mipmap.banner, "思维导图高分作文法(高中)议论", "从这个角度看,康得在不经意间这样说过,既然我已踏上了这条道路,那么"),
  42 + RecommendData(R.mipmap.banner, "思维导图高分作文法(高中)议论", "从这个角度看,康得在不经意间这样说过,既然我已踏上了这条道路,那么"),
  43 + RecommendData(R.mipmap.banner, "思维导图高分作文法(高中)议论", "从这个角度看,康得在不经意间这样说过,既然我已踏上了这条道路,那么"),
  44 + )
  45 + val resultAdapter = ResultAdapter()
  46 + resultRecycler.adapter = resultAdapter
  47 + resultAdapter.addList(recommendList)
  48 +
  49 + }
  50 +
  51 +}
  1 +package com.br_technology.securitytrain_master.ui.home.pojo
  2 +
  3 +/**
  4 + * createTime:2021/7/28 10:46
  5 + * auth:张继
  6 + * des:
  7 + */
  8 +class RecommendData(
  9 + val pic: Int,
  10 + var name: String,
  11 + var info: String
  12 +)
  1 +package com.br_technology.securitytrain_master.ui.home.pojo
  2 +
  3 +/**
  4 + * createTime:2021/7/28 9:19
  5 + * auth:张继
  6 + * des:
  7 + */
  8 +class VideoCourse(
  9 + val pic: Int,
  10 + val lesson: String,
  11 + val courseName:String,
  12 + val head:String,
  13 + val name:String
  14 +)
  1 +package com.br_technology.securitytrain_master.ui.home.repository
  2 +
  3 +import androidx.lifecycle.MutableLiveData
  4 +import com.br_technology.securitytrain_master.base.common.State
  5 +import com.wjx.android.wanandroidmvvm.base.repository.ApiRepository
  6 +
  7 +/**
  8 + * createTime:2021/7/27 15:49
  9 + * auth:张继
  10 + * des:
  11 + */
  12 +class DatabaseRepository(val loadState: MutableLiveData<State>):ApiRepository() {
  13 +}
  1 +package com.br_technology.securitytrain_master.ui.home.repository
  2 +
  3 +import androidx.lifecycle.MutableLiveData
  4 +import com.br_technology.securitytrain_master.base.common.State
  5 +import com.wjx.android.wanandroidmvvm.base.repository.ApiRepository
  6 +
  7 +/**
  8 + * createTime:2021/7/27 15:49
  9 + * auth:张继
  10 + * des:
  11 + */
  12 +class HomeRepository(val loadState: MutableLiveData<State>):ApiRepository() {
  13 +}
  1 +package com.br_technology.securitytrain_master.ui.home.repository
  2 +
  3 +import androidx.lifecycle.MutableLiveData
  4 +import com.br_technology.securitytrain_master.base.common.State
  5 +import com.wjx.android.wanandroidmvvm.base.repository.ApiRepository
  6 +
  7 +/**
  8 + * createTime:2021/7/27 15:49
  9 + * auth:张继
  10 + * des:
  11 + */
  12 +class SearchRepository(val loadState: MutableLiveData<State>):ApiRepository() {
  13 +}
  1 +package com.br_technology.securitytrain_master.ui.home.viewmodel
  2 +
  3 +import com.br_technology.securitytrain_master.ui.home.repository.DatabaseRepository
  4 +import com.wjx.android.wanandroidmvvm.base.viewmodel.BaseViewModel
  5 +
  6 +/**
  7 + * createTime:2021/7/27 15:48
  8 + * auth:张继
  9 + * des:
  10 + */
  11 +class DatabaseViewModel:BaseViewModel<DatabaseRepository>() {
  12 +}
  1 +package com.br_technology.securitytrain_master.ui.home.viewmodel
  2 +
  3 +import com.br_technology.securitytrain_master.ui.home.repository.HomeRepository
  4 +import com.wjx.android.wanandroidmvvm.base.viewmodel.BaseViewModel
  5 +
  6 +/**
  7 + * createTime:2021/7/27 15:48
  8 + * auth:张继
  9 + * des:
  10 + */
  11 +class HomeViewModel:BaseViewModel<HomeRepository>() {
  12 +}
  1 +package com.br_technology.securitytrain_master.ui.home.viewmodel
  2 +
  3 +import com.br_technology.securitytrain_master.ui.home.repository.SearchRepository
  4 +import com.wjx.android.wanandroidmvvm.base.viewmodel.BaseViewModel
  5 +
  6 +/**
  7 + * createTime:2021/7/27 15:48
  8 + * auth:张继
  9 + * des:
  10 + */
  11 +class SearchViewModel:BaseViewModel<SearchRepository>() {
  12 +}
  1 +package com.br_technology.securitytrain_master.ui.login
  2 +
  3 +import android.os.Bundle
  4 +import android.text.TextUtils
  5 +import android.text.method.HideReturnsTransformationMethod
  6 +import android.text.method.PasswordTransformationMethod
  7 +import com.br_technology.securitytrain_master.databinding.ActivityAccountLoginBinding
  8 +import com.br_technology.securitytrain_master.identity
  9 +import com.br_technology.securitytrain_master.ui.login.viewmode.AccountLoginViewModel
  10 +import com.br_technology.securitytrain_master.ui.main.MainActivity
  11 +import com.wjx.android.wanandroidmvvm.base.view.BaseLifeCycleActivity
  12 +
  13 +/**
  14 + * createTime:2021/7/26 17:29
  15 + * auth:张继
  16 + * des:
  17 + */
  18 +class AccountLoginActivity :
  19 + BaseLifeCycleActivity<AccountLoginViewModel, ActivityAccountLoginBinding>(
  20 + ActivityAccountLoginBinding::inflate
  21 + ) {
  22 +
  23 + override fun onCreate(savedInstanceState: Bundle?) {
  24 + super.onCreate(savedInstanceState)
  25 + binding.apply {
  26 + // 登录
  27 + login.setOnClickListener {
  28 +// val identityNum = identityNumber.text
  29 +// val password = password.text
  30 +// if (identityNum.identity()) {
  31 +// showTip("身份证号码不能为空")
  32 +// return@setOnClickListener
  33 +// }
  34 +// if (TextUtils.isEmpty(password)) {
  35 +// showTip("密码格式有误")
  36 +// return@setOnClickListener
  37 +// }
  38 + startActivity(MainActivity::class.java)
  39 + // 登录接口
  40 + }
  41 +
  42 + // 忘记密码
  43 + forgetPassword.setOnClickListener {
  44 + startActivity(ForgetPasswordActivity::class.java)
  45 + }
  46 + // 手机号登陆
  47 + mobileLogin.setOnClickListener {
  48 + startActivity(MobileLoginActivity::class.java)
  49 + }
  50 + // 密码可见
  51 + display.setOnClickListener {
  52 + if (it.isSelected) {// 初始 it.isSelected为false
  53 + //设置EditText文本为隐藏的
  54 + password.transformationMethod = PasswordTransformationMethod.getInstance();
  55 + } else {
  56 + //设置EditText文本为可见的
  57 + password.transformationMethod = HideReturnsTransformationMethod.getInstance();
  58 + }
  59 + password.postInvalidate()
  60 + it.isSelected = !it.isSelected
  61 + password.setSelection(password.length())
  62 + }
  63 + }
  64 + }
  65 +
  66 + override fun initDataObserver() {
  67 + }
  68 +}
  1 +package com.br_technology.securitytrain_master.ui.login
  2 +
  3 +import android.os.Bundle
  4 +import android.text.TextUtils
  5 +import android.text.method.HideReturnsTransformationMethod
  6 +import android.text.method.PasswordTransformationMethod
  7 +import com.br_technology.securitytrain_master.databinding.ActivityForgetPasswordBinding
  8 +import com.br_technology.securitytrain_master.isPhone
  9 +import com.br_technology.securitytrain_master.ui.login.viewmode.ForgetPasswordViewModel
  10 +import com.wjx.android.wanandroidmvvm.base.view.BaseLifeCycleActivity
  11 +
  12 +/**
  13 + * createTime:2021/7/27 11:11
  14 + * auth:张继
  15 + * des:
  16 + */
  17 +class ForgetPasswordActivity :
  18 + BaseLifeCycleActivity<ForgetPasswordViewModel, ActivityForgetPasswordBinding>(
  19 + ActivityForgetPasswordBinding::inflate
  20 + ) {
  21 +
  22 + override fun onCreate(savedInstanceState: Bundle?) {
  23 + super.onCreate(savedInstanceState)
  24 + binding.apply {
  25 + // 完成
  26 + complete.setOnClickListener {
  27 + val mobile = mobile.text
  28 + val code = verificationCode.text
  29 + val password = password.text
  30 + val againPassword = againPassword.text
  31 + if (mobile.isPhone()) {
  32 + showTip("手机号格式不正确")
  33 + return@setOnClickListener
  34 + }
  35 + if (TextUtils.isEmpty(code)) {
  36 + showTip("验证码格式不正确")
  37 + return@setOnClickListener
  38 + }
  39 + if (TextUtils.isEmpty(password) || TextUtils.isEmpty(againPassword)) {
  40 + showTip("密码不能为空")
  41 + return@setOnClickListener
  42 + }
  43 +
  44 + if (password.equals(againPassword)) {
  45 + showTip("两次输入的密码不一致")
  46 + return@setOnClickListener
  47 + }
  48 + // 请求接口
  49 +
  50 + }
  51 +
  52 + getVerificationCode.setOnClickListener {
  53 + // 获取验证码
  54 + if (mobile.text.isPhone()) {
  55 + showTip("手机号格式不正确")
  56 + return@setOnClickListener
  57 + }
  58 + // 获取验证码
  59 + }
  60 + // 密码可见
  61 + display.setOnClickListener {
  62 + if (it.isSelected) {// 初始 it.isSelected为false
  63 + //设置EditText文本为隐藏的
  64 + password.transformationMethod = PasswordTransformationMethod.getInstance();
  65 + } else {
  66 + //设置EditText文本为可见的
  67 + password.transformationMethod = HideReturnsTransformationMethod.getInstance();
  68 + }
  69 + password.postInvalidate()
  70 + it.isSelected = !it.isSelected
  71 + password.setSelection(password.length())
  72 + }
  73 +
  74 + // 密码可见
  75 + againDisplay.setOnClickListener {
  76 + if (it.isSelected) {// 初始 it.isSelected为false
  77 + //设置EditText文本为隐藏的
  78 + againPassword.transformationMethod = PasswordTransformationMethod.getInstance();
  79 + } else {
  80 + //设置EditText文本为可见的
  81 + againPassword.transformationMethod =
  82 + HideReturnsTransformationMethod.getInstance();
  83 + }
  84 + againPassword.postInvalidate()
  85 + it.isSelected = !it.isSelected
  86 + againPassword.setSelection(againPassword.length())
  87 + }
  88 +
  89 +
  90 + }
  91 + }
  92 + override fun initDataObserver() {
  93 +
  94 + }
  95 +}
  1 +package com.br_technology.securitytrain_master.ui.login
  2 +
  3 +import android.os.Bundle
  4 +import android.text.TextUtils
  5 +import com.br_technology.securitytrain_master.databinding.ActivityMobileLoginBinding
  6 +import com.br_technology.securitytrain_master.isPhone
  7 +import com.br_technology.securitytrain_master.ui.login.viewmode.MobileLoginViewModel
  8 +import com.wjx.android.wanandroidmvvm.base.view.BaseLifeCycleActivity
  9 +
  10 +/**
  11 + * createTime:2021/7/27 14:40
  12 + * auth:张继
  13 + * des:
  14 + */
  15 +class MobileLoginActivity : BaseLifeCycleActivity<MobileLoginViewModel, ActivityMobileLoginBinding>(
  16 + ActivityMobileLoginBinding::inflate
  17 +) {
  18 +
  19 + override fun onCreate(savedInstanceState: Bundle?) {
  20 + super.onCreate(savedInstanceState)
  21 + binding.apply {
  22 + // 完成
  23 + login.setOnClickListener {
  24 + val mobile = mobile.text
  25 + val code = verificationCode.text
  26 + if (mobile.isPhone()) {
  27 + showTip("手机号格式不正确")
  28 + return@setOnClickListener
  29 + }
  30 + if (TextUtils.isEmpty(code)) {
  31 + showTip("验证码格式不正确")
  32 + return@setOnClickListener
  33 + }
  34 + // 请求接口
  35 +
  36 + }
  37 +
  38 + getVerificationCode.setOnClickListener {
  39 + // 获取验证码
  40 + if (mobile.text.isPhone()) {
  41 + showTip("手机号格式不正确")
  42 + return@setOnClickListener
  43 + }
  44 + // 获取验证码
  45 + }
  46 +
  47 + accountLogin.setOnClickListener {
  48 + startActivity(AccountLoginActivity::class.java)
  49 + }
  50 + }
  51 +
  52 + }
  53 +
  54 + override fun initDataObserver() {
  55 +
  56 + }
  57 +}
  1 +package com.br_technology.securitytrain_master.ui.login.repository
  2 +
  3 +import androidx.lifecycle.MutableLiveData
  4 +import com.br_technology.securitytrain_master.base.common.State
  5 +import com.wjx.android.wanandroidmvvm.base.repository.ApiRepository
  6 +
  7 +/**
  8 + * createTime:2021/7/26 17:30
  9 + * auth:张继
  10 + * des:
  11 + */
  12 +class AccountLoginRepository(val loadState: MutableLiveData<State>):ApiRepository() {
  13 +}
  1 +package com.br_technology.securitytrain_master.ui.login.repository
  2 +
  3 +import androidx.lifecycle.MutableLiveData
  4 +import com.br_technology.securitytrain_master.base.common.State
  5 +import com.wjx.android.wanandroidmvvm.base.repository.ApiRepository
  6 +
  7 +/**
  8 + * createTime:2021/7/26 17:30
  9 + * auth:张继
  10 + * des:
  11 + */
  12 +class ForgetPasswordRepository(val loadState: MutableLiveData<State>):ApiRepository() {
  13 +
  14 +}
  1 +package com.br_technology.securitytrain_master.ui.login.repository
  2 +
  3 +import androidx.lifecycle.MutableLiveData
  4 +import com.br_technology.securitytrain_master.base.common.State
  5 +import com.wjx.android.wanandroidmvvm.base.repository.ApiRepository
  6 +
  7 +/**
  8 + * createTime:2021/7/26 17:30
  9 + * auth:张继
  10 + * des:
  11 + */
  12 +class MobileLoginRepository(val loadState: MutableLiveData<State>):ApiRepository() {
  13 +}
  1 +package com.br_technology.securitytrain_master.ui.login.viewmode
  2 +
  3 +import com.br_technology.securitytrain_master.ui.login.repository.AccountLoginRepository
  4 +import com.wjx.android.wanandroidmvvm.base.viewmodel.BaseViewModel
  5 +
  6 +/**
  7 + * createTime:2021/7/26 17:29
  8 + * auth:张继
  9 + * des:
  10 + */
  11 +class AccountLoginViewModel() : BaseViewModel<AccountLoginRepository>() {
  12 +}
  1 +package com.br_technology.securitytrain_master.ui.login.viewmode
  2 +
  3 +import com.br_technology.securitytrain_master.ui.login.repository.ForgetPasswordRepository
  4 +import com.wjx.android.wanandroidmvvm.base.viewmodel.BaseViewModel
  5 +
  6 +/**
  7 + * createTime:2021/7/27 11:11
  8 + * auth:张继
  9 + * des:
  10 + */
  11 +class ForgetPasswordViewModel : BaseViewModel<ForgetPasswordRepository>() {
  12 +}
  1 +package com.br_technology.securitytrain_master.ui.login.viewmode
  2 +
  3 +import com.br_technology.securitytrain_master.ui.login.repository.MobileLoginRepository
  4 +import com.wjx.android.wanandroidmvvm.base.viewmodel.BaseViewModel
  5 +
  6 +/**
  7 + * createTime:2021/7/27 14:44
  8 + * auth:张继
  9 + * des:
  10 + */
  11 +class MobileLoginViewModel:BaseViewModel<MobileLoginRepository>() {
  12 +}
  1 +package com.br_technology.securitytrain_master.ui.main
  2 +
  3 +import android.os.Bundle
  4 +import androidx.fragment.app.FragmentPagerAdapter
  5 +import com.br_technology.securitytrain_master.R
  6 +import com.br_technology.securitytrain_master.databinding.ActivityMainBinding
  7 +import com.br_technology.securitytrain_master.ui.bank.BankFragment
  8 +import com.br_technology.securitytrain_master.ui.home.fragment.HomeFragment
  9 +import com.br_technology.securitytrain_master.ui.home.MineFragment
  10 +import com.br_technology.securitytrain_master.ui.main.viewmodel.MainViewModel
  11 +import com.gyf.immersionbar.ImmersionBar
  12 +import com.wjx.android.wanandroidmvvm.base.view.BaseLifeCycleActivity
  13 +
  14 +class MainActivity :
  15 + BaseLifeCycleActivity<MainViewModel, ActivityMainBinding>(ActivityMainBinding::inflate) {
  16 +
  17 + // private lateinit var mainAdapter: MainAdapter
  18 + override fun onCreate(savedInstanceState: Bundle?) {
  19 + super.onCreate(savedInstanceState)
  20 +
  21 + ImmersionBar.with(this).statusBarColor(R.color.color_25).init()
  22 +
  23 + val list = listOf(HomeFragment(), BankFragment(), MineFragment())
  24 +
  25 + // 初始化适配器
  26 + val mainAdapter = MainAdapter(
  27 + supportFragmentManager,
  28 + FragmentPagerAdapter.BEHAVIOR_RESUME_ONLY_CURRENT_FRAGMENT
  29 + )
  30 + binding.apply {
  31 + viewPage.adapter = mainAdapter
  32 + mainAdapter.addData(list)
  33 + viewPage.offscreenPageLimit = 1
  34 + home.isChecked = true
  35 +
  36 + home.setOnClickListener {
  37 + viewPage.currentItem = 0
  38 + }
  39 + questionBank.setOnClickListener {
  40 + viewPage.currentItem = 1
  41 + }
  42 + mine.setOnClickListener {
  43 + viewPage.currentItem = 2
  44 + }
  45 + }
  46 + }
  47 +
  48 + override fun initDataObserver() {
  49 +// mViewModel.liveData.observe(this) {
  50 +// mainAdapter.addData(it)
  51 +// }
  52 + }
  53 +
  54 +}
  1 +package com.br_technology.securitytrain_master.ui.main
  2 +
  3 +import android.view.ViewGroup
  4 +import androidx.fragment.app.Fragment
  5 +import androidx.fragment.app.FragmentManager
  6 +import androidx.fragment.app.FragmentPagerAdapter
  7 +
  8 +/**
  9 + * createTime:2021/7/27 16:04
  10 + * auth:张继
  11 + * des:
  12 + */
  13 +class MainAdapter(manager: FragmentManager, behavior: Int) :
  14 + FragmentPagerAdapter(manager, behavior) {
  15 +
  16 + private var fragments: MutableList<Fragment> = ArrayList()
  17 +
  18 + fun addData(data: List<Fragment>) {
  19 + fragments.addAll(data)
  20 + notifyDataSetChanged()
  21 + }
  22 +
  23 + override fun getCount(): Int {
  24 + return fragments.size
  25 + }
  26 +
  27 + override fun getItem(position: Int): Fragment {
  28 + return fragments[position]
  29 + }
  30 +
  31 + override fun destroyItem(container: ViewGroup, position: Int, `object`: Any) {
  32 +// super.destroyItem(container, position, `object`)
  33 + }
  34 +
  35 +}
  1 +package com.br_technology.securitytrain_master.ui.main.repository
  2 +
  3 +import androidx.lifecycle.MutableLiveData
  4 +import com.br_technology.securitytrain_master.base.common.State
  5 +import com.wjx.android.wanandroidmvvm.base.repository.ApiRepository
  6 +
  7 +/**
  8 + * createTime:2021/7/27 14:51
  9 + * auth:张继
  10 + * des:
  11 + */
  12 +class MainRepository(val loadState: MutableLiveData<State>):ApiRepository() {
  13 +}
  1 +package com.br_technology.securitytrain_master.ui.main.viewmodel
  2 +
  3 +import androidx.fragment.app.Fragment
  4 +import androidx.lifecycle.MutableLiveData
  5 +import com.br_technology.securitytrain_master.ui.bank.BankFragment
  6 +import com.br_technology.securitytrain_master.ui.home.fragment.HomeFragment
  7 +import com.br_technology.securitytrain_master.ui.home.MineFragment
  8 +import com.br_technology.securitytrain_master.ui.main.repository.MainRepository
  9 +import com.wjx.android.wanandroidmvvm.base.viewmodel.BaseViewModel
  10 +
  11 +/**
  12 + * createTime:2021/7/27 14:51
  13 + * auth:张继
  14 + * des:
  15 + */
  16 +class MainViewModel:BaseViewModel<MainRepository>() {
  17 + val liveData:MutableLiveData<List<Fragment>> by lazy {
  18 + MutableLiveData()
  19 + }
  20 + init {
  21 + val list= listOf(HomeFragment(),BankFragment(),MineFragment())
  22 + liveData.postValue(list)
  23 + }
  24 +
  25 +
  26 +}
  1 +package com.br_technology.securitytrain_master.ui.home
  2 +
  3 +import com.br_technology.securitytrain_master.R
  4 +import com.br_technology.securitytrain_master.ui.home.viewmodel.MineViewModel
  5 +import com.wjx.android.wanandroidmvvm.base.view.BaseLifeCycleFragment
  6 +
  7 +/**
  8 + * createTime:2021/7/27 15:47
  9 + * auth:张继
  10 + * des:
  11 + */
  12 +class MineFragment :BaseLifeCycleFragment<MineViewModel>() {
  13 + override fun initDataObserver() {
  14 +
  15 + }
  16 +
  17 + override fun getLayoutId(): Int {
  18 + return R.layout.fragment_mine
  19 + }
  20 +}
  1 +package com.br_technology.securitytrain_master.ui.home.repository
  2 +
  3 +import androidx.lifecycle.MutableLiveData
  4 +import com.br_technology.securitytrain_master.base.common.State
  5 +import com.wjx.android.wanandroidmvvm.base.repository.ApiRepository
  6 +
  7 +/**
  8 + * createTime:2021/7/27 15:49
  9 + * auth:张继
  10 + * des:
  11 + */
  12 +class MineRepository(val loadState: MutableLiveData<State>):ApiRepository() {
  13 +}
  1 +package com.br_technology.securitytrain_master.ui.home.viewmodel
  2 +
  3 +import com.br_technology.securitytrain_master.ui.home.repository.MineRepository
  4 +import com.wjx.android.wanandroidmvvm.base.viewmodel.BaseViewModel
  5 +
  6 +/**
  7 + * createTime:2021/7/27 15:48
  8 + * auth:张继
  9 + * des:
  10 + */
  11 +class MineViewModel:BaseViewModel<MineRepository>() {
  12 +}
@@ -31,6 +31,8 @@ class AppManager { @@ -31,6 +31,8 @@ class AppManager {
31 activityStack.remove(activity) 31 activityStack.remove(activity)
32 } 32 }
33 33
  34 +
  35 +
34 private fun finishAllActivity() { 36 private fun finishAllActivity() {
35 for(activity in activityStack) { 37 for(activity in activityStack) {
36 activity.finish() 38 activity.finish()
  1 +package com.br_technology.securitytrain_master.view
  2 +
  3 +import android.app.Dialog
  4 +import android.content.Context
  5 +import android.os.Bundle
  6 +import android.view.LayoutInflater
  7 +import com.br_technology.securitytrain_master.R
  8 +import com.br_technology.securitytrain_master.databinding.DialogSureCancelBinding
  9 +import com.br_technology.securitytrain_master.expand.screenWidth
  10 +import com.br_technology.securitytrain_master.view.listener.DialogListener
  11 +
  12 +/**
  13 + * createTime:2021/7/28 13:45
  14 + * auth:张继
  15 + * des:
  16 + */
  17 +class DialogSureCancel(context: Context) : Dialog(context, R.style.UserDefaultDialog) {
  18 +
  19 + private var listener: DialogListener? = null
  20 +
  21 + override fun onCreate(savedInstanceState: Bundle?) {
  22 + super.onCreate(savedInstanceState)
  23 + val inflate = DialogSureCancelBinding.inflate(LayoutInflater.from(context))
  24 + setContentView(inflate.root)
  25 + val attributes = window?.attributes
  26 + attributes?.width = inflate.root.screenWidth() - 160
  27 + // 点击区域外不取消
  28 + setCanceledOnTouchOutside(false)
  29 +
  30 + inflate.apply {
  31 + // 取消
  32 + cancel.setOnClickListener {
  33 + dismiss()
  34 + }
  35 + // 确定
  36 + determine.setOnClickListener {
  37 + listener?.determine()
  38 + }
  39 + }
  40 + }
  41 +
  42 + fun setListener(listener: DialogListener):DialogSureCancel {
  43 + this.listener = listener
  44 + return this
  45 + }
  46 +
  47 +}
  1 +package com.br_technology.securitytrain_master.view
  2 +
  3 +import android.content.Context
  4 +import android.util.AttributeSet
  5 +import android.view.MotionEvent
  6 +import androidx.viewpager.widget.ViewPager
  7 +
  8 +/**
  9 + * createTime:2021/7/26 17:29
  10 + * auth:张继
  11 + * des:
  12 + */
  13 +class NoScrollViewPage : ViewPager {
  14 + // true禁止滑动 false允许滑动
  15 + var isSlidingEnable: Boolean = true
  16 +
  17 + constructor(context: Context) : super(context)
  18 + constructor(context: Context, attrs: AttributeSet?) : super(context, attrs)
  19 +
  20 + override fun scrollTo(x: Int, y: Int) {
  21 + super.scrollTo(x, y)
  22 + }
  23 +
  24 + override fun setCurrentItem(item: Int) {
  25 + super.setCurrentItem(item)
  26 + }
  27 +
  28 + override fun setCurrentItem(item: Int, smoothScroll: Boolean) {
  29 + super.setCurrentItem(item, smoothScroll)
  30 + }
  31 +
  32 + override fun onTouchEvent(ev: MotionEvent?): Boolean {
  33 + return if (isSlidingEnable) {
  34 + false
  35 + } else {
  36 + super.onTouchEvent(ev)
  37 + }
  38 + }
  39 +
  40 +
  41 + override fun onInterceptTouchEvent(ev: MotionEvent?): Boolean {
  42 + return if (isSlidingEnable) {
  43 + false
  44 + } else {
  45 + super.onInterceptTouchEvent(ev)
  46 + }
  47 + }
  48 +
  49 +}
  1 +package com.br_technology.securitytrain_master.view
  2 +
  3 +import android.app.Activity
  4 +import android.content.Context
  5 +import android.util.AttributeSet
  6 +import android.view.LayoutInflater
  7 +import android.widget.RelativeLayout
  8 +import com.br_technology.securitytrain_master.R
  9 +import com.br_technology.securitytrain_master.databinding.BarToolViewBinding
  10 +
  11 +/**
  12 + * createTime:2021/7/26 17:53
  13 + * auth:张继
  14 + * des:
  15 + */
  16 +class ViewToolBar(context: Context, attrs: AttributeSet) : RelativeLayout(context, attrs) {
  17 +
  18 + private var inflate: BarToolViewBinding =
  19 + BarToolViewBinding.inflate(LayoutInflater.from(context), this, true)
  20 +
  21 + init {
  22 + val typedArray = context.obtainStyledAttributes(attrs, R.styleable.UIToolBar)
  23 + val leftImg = typedArray.getResourceId(R.styleable.UIToolBar_leftImg, R.mipmap.ic_back)
  24 + if (leftImg != -1) {
  25 + inflate.back.setImageResource(leftImg)
  26 + }
  27 + // 标题文字
  28 + val title = typedArray.getString(R.styleable.UIToolBar_toolTitle)
  29 + inflate.title.text = title
  30 +
  31 + inflate.back.setOnClickListener {
  32 + (context as Activity).finish()
  33 + }
  34 + }
  35 +
  36 + fun setBackImg(img: Int) {
  37 + inflate.back.setImageResource(img)
  38 + }
  39 +
  40 + fun setTitle(text: String) {
  41 + inflate.title.text = text
  42 + }
  43 +
  44 +}
  1 +package com.br_technology.securitytrain_master.view.listener
  2 +
  3 +/**
  4 + * createTime:2021/7/28 14:35
  5 + * auth:张继
  6 + * des:
  7 + */
  8 +interface DialogListener {
  9 + fun determine()
  10 +
  11 +}
  1 +<?xml version="1.0" encoding="utf-8"?>
  2 +<layer-list xmlns:android="http://schemas.android.com/apk/res/android">
  3 + <item
  4 + android:width="12dp"
  5 + android:height="3dp"
  6 + android:gravity="center_horizontal">
  7 + <shape>
  8 + <gradient
  9 + android:endColor="#6096EA"
  10 + android:startColor="@color/color_25"
  11 + android:type="linear" />
  12 + </shape>
  13 + </item>
  14 +</layer-list>
  1 +<?xml version="1.0" encoding="utf-8"?>
  2 +<selector xmlns:android="http://schemas.android.com/apk/res/android">
  3 +
  4 + <item android:drawable="@color/color_25" android:state_selected="true" />
  5 + <item android:drawable="@drawable/solid_25_4_69f" />
  6 +</selector>
  1 +<?xml version="1.0" encoding="utf-8"?>
  2 +<selector xmlns:android="http://schemas.android.com/apk/res/android">
  3 +
  4 + <item android:drawable="@mipmap/question_bank_y" android:state_checked="true" />
  5 + <item android:drawable="@mipmap/question_bank_n" />
  6 +</selector>
  1 +<?xml version="1.0" encoding="utf-8"?>
  2 +<selector xmlns:android="http://schemas.android.com/apk/res/android">
  3 +
  4 + <item android:drawable="@mipmap/home_y" android:state_checked="true" />
  5 + <item android:drawable="@mipmap/home_n" />
  6 +</selector>
  1 +<?xml version="1.0" encoding="utf-8"?>
  2 +<selector xmlns:android="http://schemas.android.com/apk/res/android">
  3 +
  4 + <item android:drawable="@mipmap/mine_y" android:state_checked="true" />
  5 + <item android:drawable="@mipmap/mine_n" />
  6 +</selector>
  1 +<?xml version="1.0" encoding="utf-8"?>
  2 +<selector xmlns:android="http://schemas.android.com/apk/res/android">
  3 +
  4 + <item android:color="@color/color_25" android:state_checked="true" />
  5 + <item android:color="@color/color_96" />
  6 +
  7 +</selector>
  1 +<?xml version="1.0" encoding="utf-8"?>
  2 +<selector xmlns:android="http://schemas.android.com/apk/res/android">
  3 +
  4 + <item android:drawable="@mipmap/ic_eye_y" android:state_selected="true" />
  5 + <item android:drawable="@mipmap/ic_eye_n" />
  6 +</selector>
  1 +<?xml version="1.0" encoding="utf-8"?>
  2 +<shape xmlns:android="http://schemas.android.com/apk/res/android">
  3 +
  4 + <solid android:color="#50FFFFFF" />
  5 + <stroke
  6 + android:color="#80FFFFFF"
  7 + android:width="1dp" />
  8 + <corners android:radius="30dp" />
  9 +</shape>
  1 +<?xml version="1.0" encoding="utf-8"?>
  2 +<shape xmlns:android="http://schemas.android.com/apk/res/android">
  3 +
  4 + <solid android:color="@color/color_25" />
  5 + <corners android:radius="4dp" />
  6 +</shape>
  1 +<?xml version="1.0" encoding="utf-8"?>
  2 +<layer-list xmlns:android="http://schemas.android.com/apk/res/android">
  3 +
  4 + <item>
  5 + <shape>
  6 + <solid android:color="@color/color_25" />
  7 + <corners android:radius="4dp" />
  8 + </shape>
  9 + </item>
  10 + <item>
  11 + <shape>
  12 + <solid android:color="#69ffffff" />
  13 + <corners android:radius="4dp" />
  14 + </shape>
  15 + </item>
  16 +</layer-list>
  1 +<?xml version="1.0" encoding="utf-8"?>
  2 +<shape xmlns:android="http://schemas.android.com/apk/res/android">
  3 +
  4 + <solid android:color="@color/color_25" />
  5 + <corners android:radius="8dp" />
  6 +</shape>
  1 +<?xml version="1.0" encoding="utf-8"?>
  2 +<shape xmlns:android="http://schemas.android.com/apk/res/android">
  3 +
  4 + <solid android:color="@color/color_ef" />
  5 + <corners android:radius="4dp" />
  6 +</shape>
  1 +<?xml version="1.0" encoding="utf-8"?>
  2 +<shape xmlns:android="http://schemas.android.com/apk/res/android">
  3 +
  4 + <solid android:color="@color/color_f2" />
  5 + <corners android:radius="4dp" />
  6 +</shape>
  1 +<?xml version="1.0" encoding="utf-8"?>
  2 +<shape xmlns:android="http://schemas.android.com/apk/res/android">
  3 +
  4 + <solid android:color="@color/white" />
  5 + <corners android:radius="14dp" />
  6 +</shape>
  1 +<?xml version="1.0" encoding="utf-8"?>
  2 +<shape xmlns:android="http://schemas.android.com/apk/res/android">
  3 +
  4 + <solid android:color="@color/white" />
  5 + <corners android:radius="4dp" />
  6 +</shape>
  1 +<?xml version="1.0" encoding="utf-8"?>
  2 +<shape xmlns:android="http://schemas.android.com/apk/res/android">
  3 +
  4 + <solid android:color="@color/white" />
  5 + <corners android:radius="8dp" />
  6 +</shape>
  1 +<?xml version="1.0" encoding="utf-8"?>
  2 +<shape xmlns:android="http://schemas.android.com/apk/res/android">
  3 +
  4 + <stroke
  5 + android:color="@color/color_25"
  6 + android:width="1dp" />
  7 + <solid android:color="@android:color/transparent" />
  8 + <corners android:radius="4dp" />
  9 +</shape>
  1 +<?xml version="1.0" encoding="utf-8"?>
  2 +<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
  3 + android:layout_width="match_parent"
  4 + android:layout_height="match_parent"
  5 + android:orientation="vertical">
  6 +
  7 + <include layout="@layout/layout_tool_bar" />
  8 +
  9 + <com.br_technology.securitytrain_master.view.ViewToolBar
  10 + android:layout_width="match_parent"
  11 + android:layout_height="wrap_content" />
  12 +
  13 + <ImageView
  14 + android:layout_width="wrap_content"
  15 + android:layout_height="wrap_content"
  16 + android:layout_marginStart="32dp"
  17 + android:layout_marginTop="36dp"
  18 + android:contentDescription="@string/logo"
  19 + android:src="@mipmap/ic_back" />
  20 +
  21 + <EditText
  22 + android:id="@+id/identity_number"
  23 + android:layout_width="match_parent"
  24 + android:layout_height="52dp"
  25 + android:layout_marginStart="32dp"
  26 + android:layout_marginTop="32dp"
  27 + android:layout_marginEnd="32dp"
  28 + android:background="@null"
  29 + android:digits="1234567890Xx"
  30 + android:hint="身份证号码"
  31 + android:textColor="@color/black"
  32 + android:textColorHint="#CECED6"
  33 + android:textSize="18sp" />
  34 +
  35 + <View
  36 + android:layout_width="match_parent"
  37 + android:layout_height="1dp"
  38 + android:layout_marginStart="32dp"
  39 + android:layout_marginEnd="32dp"
  40 + android:background="#EBEDF0" />
  41 +
  42 + <LinearLayout
  43 + android:layout_width="match_parent"
  44 + android:layout_height="52dp"
  45 + android:layout_marginStart="32dp"
  46 + android:layout_marginTop="12dp"
  47 + android:layout_marginEnd="32dp"
  48 + android:orientation="horizontal">
  49 +
  50 +
  51 + <EditText
  52 + android:id="@+id/password"
  53 + android:layout_width="0dp"
  54 + android:layout_height="match_parent"
  55 + android:layout_weight="1"
  56 + android:background="@null"
  57 + android:hint="登录密码"
  58 + android:importantForAutofill="no"
  59 + android:inputType="textPassword"
  60 + android:lines="1"
  61 + android:textColorHint="#CECED6"
  62 + android:maxLength="20"
  63 + android:textColor="@color/black"
  64 + android:textSize="18sp" />
  65 +
  66 + <ImageView
  67 + android:id="@+id/display"
  68 + android:layout_width="wrap_content"
  69 + android:layout_height="wrap_content"
  70 + android:layout_gravity="center"
  71 + android:contentDescription="@string/logo"
  72 + android:src="@drawable/password_display" />
  73 + </LinearLayout>
  74 +
  75 + <View
  76 + android:layout_width="match_parent"
  77 + android:layout_height="1dp"
  78 + android:layout_marginStart="32dp"
  79 + android:layout_marginEnd="32dp"
  80 + android:background="#EBEDF0" />
  81 +
  82 + <TextView
  83 + android:id="@+id/login"
  84 + android:layout_width="match_parent"
  85 + android:layout_height="40dp"
  86 + android:layout_marginStart="32dp"
  87 + android:layout_marginTop="40dp"
  88 + android:layout_marginEnd="32dp"
  89 + android:background="@drawable/login"
  90 + android:gravity="center"
  91 + android:text="登录"
  92 + android:textColor="@color/white"
  93 + android:textSize="15sp" />
  94 +
  95 + <LinearLayout
  96 + android:layout_width="match_parent"
  97 + android:layout_height="wrap_content"
  98 + android:layout_marginStart="32dp"
  99 + android:layout_marginTop="16dp"
  100 + android:layout_marginEnd="32dp"
  101 + android:orientation="horizontal">
  102 +
  103 + <TextView
  104 + android:id="@+id/forget_password"
  105 + android:layout_width="wrap_content"
  106 + android:layout_height="wrap_content"
  107 + android:text="忘记密码"
  108 + android:textColor="#A7A6B3"
  109 + android:textSize="13sp" />
  110 +
  111 + <View
  112 + android:layout_width="0dp"
  113 + android:layout_height="match_parent"
  114 + android:layout_weight="1" />
  115 +
  116 + <TextView
  117 + android:id="@+id/mobile_login"
  118 + android:layout_width="wrap_content"
  119 + android:layout_height="wrap_content"
  120 + android:text="手机号登陆"
  121 + android:textColor="#257CFF"
  122 + android:textSize="13sp" />
  123 +
  124 +
  125 + </LinearLayout>
  126 +
  127 +
  128 +</LinearLayout>
  1 +<?xml version="1.0" encoding="utf-8"?>
  2 +<LinearLayout 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.google.android.material.tabs.TabLayout
  11 + style="@style/SearchTab"
  12 + android:layout_width="match_parent"
  13 + android:layout_height="?actionBarSize"
  14 + android:overScrollMode="never"
  15 + app:tabMode="auto"
  16 + app:tabSelectedTextColor="@color/color_252"
  17 + app:tabTextColor="@color/color_96">
  18 +
  19 + <com.google.android.material.tabs.TabItem
  20 + android:layout_width="wrap_content"
  21 + android:layout_height="wrap_content"
  22 + android:text="共享资料库" />
  23 +
  24 + <com.google.android.material.tabs.TabItem
  25 + android:layout_width="wrap_content"
  26 + android:layout_height="wrap_content"
  27 + android:text="企业资料库" />
  28 +
  29 + </com.google.android.material.tabs.TabLayout>
  30 +</LinearLayout>
  1 +<?xml version="1.0" encoding="utf-8"?>
  2 +<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
  3 + android:layout_width="match_parent"
  4 + android:layout_height="match_parent"
  5 + android:orientation="vertical">
  6 +
  7 +
  8 + <include layout="@layout/layout_tool_bar" />
  9 +
  10 + <com.br_technology.securitytrain_master.view.ViewToolBar
  11 + android:layout_width="match_parent"
  12 + android:layout_height="wrap_content" />
  13 +
  14 + <ImageView
  15 + android:layout_width="wrap_content"
  16 + android:layout_height="wrap_content"
  17 + android:layout_marginStart="32dp"
  18 + android:layout_marginTop="36dp"
  19 + android:contentDescription="@string/logo"
  20 + android:src="@mipmap/ic_back" />
  21 +
  22 + <EditText
  23 + android:id="@+id/mobile"
  24 + android:layout_width="match_parent"
  25 + android:layout_height="52dp"
  26 + android:layout_marginStart="32dp"
  27 + android:layout_marginTop="32dp"
  28 + android:layout_marginEnd="32dp"
  29 + android:background="@null"
  30 + android:hint="手机号"
  31 + android:inputType="phone"
  32 + android:textColor="@color/black"
  33 + android:textColorHint="#CECED6"
  34 + android:textSize="18sp" />
  35 +
  36 + <View
  37 + android:layout_width="match_parent"
  38 + android:layout_height="1dp"
  39 + android:layout_marginStart="32dp"
  40 + android:layout_marginEnd="32dp"
  41 + android:background="#EBEDF0" />
  42 +
  43 + <LinearLayout
  44 + android:layout_width="match_parent"
  45 + android:layout_height="52dp"
  46 + android:layout_marginStart="32dp"
  47 + android:layout_marginTop="12dp"
  48 + android:layout_marginEnd="32dp"
  49 + android:orientation="horizontal">
  50 +
  51 + <EditText
  52 + android:id="@+id/verification_code"
  53 + android:layout_width="0dp"
  54 + android:layout_height="match_parent"
  55 + android:layout_weight="1"
  56 + android:background="@null"
  57 + android:hint="验证码"
  58 + android:inputType="phone"
  59 + android:textColor="@color/black"
  60 + android:textColorHint="#CECED6"
  61 + android:textSize="18sp" />
  62 +
  63 + <TextView
  64 + android:id="@+id/get_verification_code"
  65 + android:layout_width="94dp"
  66 + android:layout_height="32dp"
  67 + android:background="@drawable/solid_25_8"
  68 + android:gravity="center"
  69 + android:text="获取验证码"
  70 + android:textColor="@color/white"
  71 + android:textSize="14sp" />
  72 + </LinearLayout>
  73 +
  74 + <View
  75 + android:layout_width="match_parent"
  76 + android:layout_height="1dp"
  77 + android:layout_marginStart="32dp"
  78 + android:layout_marginEnd="32dp"
  79 + android:background="#EBEDF0" />
  80 +
  81 + <LinearLayout
  82 + android:layout_width="match_parent"
  83 + android:layout_height="wrap_content"
  84 + android:layout_marginStart="32dp"
  85 + android:layout_marginTop="12dp"
  86 + android:layout_marginEnd="32dp"
  87 + android:orientation="horizontal">
  88 +
  89 + <EditText
  90 + android:id="@+id/password"
  91 + android:layout_width="0dp"
  92 + android:layout_height="52dp"
  93 + android:layout_weight="1"
  94 + android:background="@null"
  95 + android:hint="设置6~20位登录密码"
  96 + android:inputType="textPassword"
  97 + android:textColor="@color/black"
  98 + android:textColorHint="#CECED6"
  99 + android:textSize="18sp" />
  100 +
  101 + <ImageView
  102 + android:id="@+id/display"
  103 + android:layout_width="wrap_content"
  104 + android:layout_height="wrap_content"
  105 + android:layout_gravity="center"
  106 + android:background="@drawable/password_display"
  107 + android:contentDescription="@string/logo"
  108 + android:paddingStart="10dp" />
  109 + </LinearLayout>
  110 +
  111 + <View
  112 + android:layout_width="match_parent"
  113 + android:layout_height="1dp"
  114 + android:layout_marginStart="32dp"
  115 + android:layout_marginEnd="32dp"
  116 + android:background="#EBEDF0" />
  117 +
  118 + <LinearLayout
  119 + android:layout_width="match_parent"
  120 + android:layout_height="wrap_content"
  121 + android:layout_marginStart="32dp"
  122 + android:layout_marginTop="12dp"
  123 + android:layout_marginEnd="32dp"
  124 + android:orientation="horizontal">
  125 +
  126 + <EditText
  127 + android:id="@+id/again_password"
  128 + android:layout_width="0dp"
  129 + android:layout_height="52dp"
  130 + android:layout_weight="1"
  131 + android:background="@null"
  132 + android:hint="请再次输入密码"
  133 + android:inputType="textPassword"
  134 + android:textColor="@color/black"
  135 + android:textColorHint="#CECED6"
  136 + android:textSize="18sp" />
  137 +
  138 + <ImageView
  139 + android:id="@+id/again_display"
  140 + android:layout_width="wrap_content"
  141 + android:layout_height="wrap_content"
  142 + android:layout_gravity="center"
  143 + android:background="@drawable/password_display"
  144 + android:contentDescription="@string/logo"
  145 + android:paddingStart="10dp" />
  146 + </LinearLayout>
  147 +
  148 + <View
  149 + android:layout_width="match_parent"
  150 + android:layout_height="1dp"
  151 + android:layout_marginStart="32dp"
  152 + android:layout_marginEnd="32dp"
  153 + android:background="#EBEDF0" />
  154 +
  155 + <TextView
  156 + android:id="@+id/complete"
  157 + android:layout_width="match_parent"
  158 + android:layout_height="40dp"
  159 + android:layout_marginStart="32dp"
  160 + android:layout_marginTop="40dp"
  161 + android:layout_marginEnd="32dp"
  162 + android:background="@drawable/solid_25_4"
  163 + android:gravity="center"
  164 + android:text="完成"
  165 + android:textColor="@color/white"
  166 + android:textSize="15sp" />
  167 +
  168 +</LinearLayout>
1 <?xml version="1.0" encoding="utf-8"?> 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 - xmlns:tools="http://schemas.android.com/tools" 2 +<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
5 android:layout_width="match_parent" 3 android:layout_width="match_parent"
6 android:layout_height="match_parent" 4 android:layout_height="match_parent"
7 - tools:context=".MainActivity"> 5 + android:orientation="vertical">
8 6
9 - <TextView  
10 - android:id="@+id/tv_name"  
11 - android:layout_width="wrap_content"  
12 - android:layout_height="wrap_content"  
13 - android:text="Hello World!"  
14 - app:layout_constraintBottom_toBottomOf="parent"  
15 - app:layout_constraintLeft_toLeftOf="parent"  
16 - app:layout_constraintRight_toRightOf="parent"  
17 - app:layout_constraintTop_toTopOf="parent" /> 7 + <com.br_technology.securitytrain_master.view.NoScrollViewPage
  8 + android:id="@+id/view_page"
  9 + android:layout_width="match_parent"
  10 + android:layout_height="0dp"
  11 + android:layout_weight="1" />
18 12
19 - <TextView  
20 - android:id="@+id/tv_test"  
21 - android:layout_width="wrap_content"  
22 - android:layout_height="wrap_content"  
23 - android:text="请求数据"  
24 - android:layout_marginTop="200dp"  
25 - app:layout_constraintBottom_toBottomOf="parent"  
26 - app:layout_constraintLeft_toLeftOf="parent"  
27 - app:layout_constraintRight_toRightOf="parent"  
28 - app:layout_constraintTop_toTopOf="parent" />  
29 -</androidx.constraintlayout.widget.ConstraintLayout>  
  13 + <RadioGroup
  14 + android:layout_width="match_parent"
  15 + android:layout_height="50dp"
  16 + android:orientation="horizontal"
  17 + android:paddingTop="6dp"
  18 + android:paddingBottom="4dp">
  19 +
  20 + <RadioButton
  21 + android:id="@+id/home"
  22 + style="@style/Main.RadioButton"
  23 + android:drawableTop="@drawable/main_home"
  24 + android:text="首页" />
  25 +
  26 + <RadioButton
  27 + android:id="@+id/question_bank"
  28 + style="@style/Main.RadioButton"
  29 + android:drawableTop="@drawable/main_bank"
  30 + android:text="全能题库" />
  31 +
  32 + <RadioButton
  33 + android:id="@+id/mine"
  34 + style="@style/Main.RadioButton"
  35 + android:drawableTop="@drawable/main_mine"
  36 + android:text="我的" />
  37 + </RadioGroup>
  38 +
  39 +</LinearLayout>
  1 +<?xml version="1.0" encoding="utf-8"?>
  2 +<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
  3 + android:layout_width="match_parent"
  4 + android:layout_height="match_parent"
  5 + android:orientation="vertical">
  6 +
  7 + <include layout="@layout/layout_tool_bar" />
  8 +
  9 + <com.br_technology.securitytrain_master.view.ViewToolBar
  10 + android:layout_width="match_parent"
  11 + android:layout_height="wrap_content" />
  12 +
  13 + <ImageView
  14 + android:layout_width="wrap_content"
  15 + android:layout_height="wrap_content"
  16 + android:layout_marginStart="32dp"
  17 + android:layout_marginTop="36dp"
  18 + android:contentDescription="@string/logo"
  19 + android:src="@mipmap/ic_back" />
  20 +
  21 + <EditText
  22 + android:id="@+id/mobile"
  23 + android:layout_width="match_parent"
  24 + android:layout_height="52dp"
  25 + android:layout_marginStart="32dp"
  26 + android:layout_marginTop="32dp"
  27 + android:layout_marginEnd="32dp"
  28 + android:background="@null"
  29 + android:hint="手机号"
  30 + android:inputType="phone"
  31 + android:textColor="@color/black"
  32 + android:textColorHint="#CECED6"
  33 + android:textSize="18sp" />
  34 +
  35 + <View
  36 + android:layout_width="match_parent"
  37 + android:layout_height="1dp"
  38 + android:layout_marginStart="32dp"
  39 + android:layout_marginEnd="32dp"
  40 + android:background="#EBEDF0" />
  41 +
  42 + <LinearLayout
  43 + android:layout_width="match_parent"
  44 + android:layout_height="52dp"
  45 + android:layout_marginStart="32dp"
  46 + android:layout_marginTop="12dp"
  47 + android:layout_marginEnd="32dp"
  48 + android:orientation="horizontal">
  49 +
  50 + <EditText
  51 + android:id="@+id/verification_code"
  52 + android:layout_width="0dp"
  53 + android:layout_height="match_parent"
  54 + android:layout_weight="1"
  55 + android:background="@null"
  56 + android:hint="验证码"
  57 + android:inputType="phone"
  58 + android:textColor="@color/black"
  59 + android:textColorHint="#CECED6"
  60 + android:textSize="18sp" />
  61 +
  62 + <TextView
  63 + android:id="@+id/get_verification_code"
  64 + android:layout_width="94dp"
  65 + android:layout_height="32dp"
  66 + android:background="@drawable/solid_25_8"
  67 + android:gravity="center"
  68 + android:text="获取验证码"
  69 + android:textColor="@color/white"
  70 + android:textSize="14sp" />
  71 + </LinearLayout>
  72 +
  73 + <View
  74 + android:layout_width="match_parent"
  75 + android:layout_height="1dp"
  76 + android:layout_marginStart="32dp"
  77 + android:layout_marginEnd="32dp"
  78 + android:background="#EBEDF0" />
  79 +
  80 + <TextView
  81 + android:id="@+id/login"
  82 + android:layout_width="match_parent"
  83 + android:layout_height="40dp"
  84 + android:layout_marginStart="32dp"
  85 + android:layout_marginTop="40dp"
  86 + android:layout_marginEnd="32dp"
  87 + android:background="@drawable/login"
  88 + android:gravity="center"
  89 + android:text="登录"
  90 + android:textColor="@color/white"
  91 + android:textSize="15sp" />
  92 +
  93 + <TextView
  94 + android:id="@+id/account_login"
  95 + android:layout_width="wrap_content"
  96 + android:layout_height="wrap_content"
  97 + android:layout_gravity="center_horizontal"
  98 + android:layout_marginTop="16dp"
  99 + android:text="账号密码登录"
  100 + android:textColor="@color/color_25"
  101 + android:textSize="13sp" />
  102 +</LinearLayout>
  1 +<?xml version="1.0" encoding="utf-8"?>
  2 +<LinearLayout 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 + <LinearLayout
  11 + android:layout_width="match_parent"
  12 + android:layout_height="?actionBarSize"
  13 + android:layout_marginStart="16dp"
  14 + android:layout_marginEnd="16dp"
  15 + android:gravity="center_vertical"
  16 + android:orientation="horizontal">
  17 +
  18 + <ImageView
  19 + android:id="@+id/back"
  20 + android:layout_width="wrap_content"
  21 + android:layout_height="match_parent"
  22 + android:src="@mipmap/ic_back" />
  23 +
  24 + <LinearLayout
  25 + android:layout_width="0dp"
  26 + android:layout_height="32dp"
  27 + android:layout_weight="1"
  28 + android:background="@drawable/stroke_25_4"
  29 + android:orientation="horizontal">
  30 +
  31 + <EditText
  32 + android:id="@+id/search_edit"
  33 + android:layout_width="0dp"
  34 + android:layout_height="32dp"
  35 + android:layout_weight="1"
  36 + android:background="@null"
  37 + android:drawableStart="@mipmap/search"
  38 + android:drawablePadding="12dp"
  39 + android:hint="搜索"
  40 + android:maxLines="1"
  41 + android:paddingStart="16dp"
  42 + android:paddingEnd="10dp"
  43 + android:textColor="@color/color_25"
  44 + android:textColorHint="@color/color_4025"
  45 + android:textSize="14sp" />
  46 +
  47 + <ImageView
  48 + android:id="@+id/clear_edit"
  49 + android:layout_width="wrap_content"
  50 + android:layout_height="wrap_content"
  51 + android:layout_gravity="center"
  52 + android:layout_marginEnd="16dp"
  53 + android:src="@mipmap/ic_clear" />
  54 + </LinearLayout>
  55 +
  56 + <TextView
  57 + android:id="@+id/search"
  58 + android:layout_width="wrap_content"
  59 + android:layout_height="wrap_content"
  60 + android:layout_marginStart="12dp"
  61 + android:text="搜索"
  62 + android:textColor="@color/color_32"
  63 + android:textSize="14sp" />
  64 + </LinearLayout>
  65 +
  66 +
  67 + <LinearLayout
  68 + android:id="@+id/history_group"
  69 + android:layout_width="match_parent"
  70 + android:layout_height="wrap_content"
  71 + android:layout_marginStart="16dp"
  72 + android:layout_marginTop="16dp"
  73 + android:layout_marginEnd="16dp"
  74 + android:layout_marginBottom="8dp"
  75 + android:gravity="center_vertical"
  76 + android:orientation="horizontal">
  77 +
  78 + <TextView
  79 + android:layout_width="0dp"
  80 + android:layout_height="wrap_content"
  81 + android:layout_weight="1"
  82 + android:text="历史记录"
  83 + android:textColor="@color/color_32"
  84 + android:textSize="16sp" />
  85 +
  86 + <ImageView
  87 + android:id="@+id/clear"
  88 + android:layout_width="wrap_content"
  89 + android:layout_height="wrap_content"
  90 + android:contentDescription="@string/logo"
  91 + android:src="@mipmap/delete" />
  92 + </LinearLayout>
  93 +
  94 + <androidx.recyclerview.widget.RecyclerView
  95 + android:id="@+id/history_recycler"
  96 + android:layout_width="match_parent"
  97 + android:layout_height="match_parent"
  98 + android:layout_marginStart="16dp"
  99 + android:overScrollMode="never"
  100 + android:scrollbars="none"
  101 + app:layoutManager="androidx.recyclerview.widget.LinearLayoutManager" />
  102 +
  103 + <com.google.android.material.tabs.TabLayout
  104 + android:id="@+id/tab_layout"
  105 + style="@style/SearchTab"
  106 + android:layout_width="match_parent"
  107 + android:layout_height="wrap_content"
  108 + android:visibility="gone" />
  109 +
  110 + <androidx.viewpager.widget.ViewPager
  111 + android:id="@+id/view_pager"
  112 + android:layout_width="match_parent"
  113 + android:layout_height="match_parent"
  114 + android:layout_marginTop="16dp"
  115 + android:overScrollMode="never"
  116 + android:scrollbars="none"
  117 + android:visibility="gone" />
  118 +
  119 +</LinearLayout>
  1 +<?xml version="1.0" encoding="utf-8"?>
  2 +<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
  3 + android:layout_width="match_parent"
  4 + android:layout_height="wrap_content"
  5 + android:orientation="vertical">
  6 +
  7 + <TextView
  8 + android:id="@+id/name"
  9 + android:maxLines="1"
  10 + android:ellipsize="end"
  11 + android:layout_width="match_parent"
  12 + android:layout_height="50dp"
  13 + android:layout_marginEnd="16dp"
  14 + android:gravity="center_vertical"
  15 + android:textColor="@color/color_64"
  16 + android:textSize="13sp" />
  17 +
  18 + <View
  19 + android:layout_width="match_parent"
  20 + android:layout_height="1dp"
  21 + android:background="@color/color_eb" />
  22 +</LinearLayout>
  1 +<?xml version="1.0" encoding="utf-8"?>
  2 +<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
  3 + android:layout_width="match_parent"
  4 + android:layout_height="wrap_content"
  5 + android:orientation="vertical">
  6 +
  7 + <LinearLayout
  8 + android:layout_width="match_parent"
  9 + android:layout_height="wrap_content"
  10 + android:orientation="horizontal">
  11 +
  12 + <ImageView
  13 + android:id="@+id/pic"
  14 + android:layout_width="97dp"
  15 + android:layout_height="72dp"
  16 + android:contentDescription="@string/logo"
  17 + android:scaleType="fitXY" />
  18 +
  19 + <LinearLayout
  20 + android:layout_width="match_parent"
  21 + android:layout_height="wrap_content"
  22 + android:layout_marginStart="16dp"
  23 + android:orientation="vertical">
  24 +
  25 + <TextView
  26 + android:id="@+id/name"
  27 + android:layout_width="match_parent"
  28 + android:layout_height="wrap_content"
  29 + android:ellipsize="end"
  30 + android:gravity="center_vertical"
  31 + android:maxLines="1"
  32 + android:minHeight="22dp"
  33 + android:textColor="@color/color_32"
  34 + android:textSize="14sp" />
  35 +
  36 + <TextView
  37 + android:id="@+id/info"
  38 + android:layout_width="match_parent"
  39 + android:layout_height="wrap_content"
  40 + android:layout_marginTop="8dp"
  41 + android:ellipsize="end"
  42 + android:maxLines="2"
  43 + android:textColor="@color/color_96"
  44 + android:textSize="12sp" />
  45 +
  46 + </LinearLayout>
  47 +
  48 + </LinearLayout>
  49 +
  50 + <View
  51 + android:layout_width="match_parent"
  52 + android:layout_height="1dp"
  53 + android:layout_marginTop="15dp"
  54 + android:layout_marginBottom="15dp"
  55 + android:background="@color/color_eb" />
  56 +</LinearLayout>
  1 +<?xml version="1.0" encoding="utf-8"?>
  2 +<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
  3 + android:layout_width="match_parent"
  4 + android:layout_height="wrap_content"
  5 + android:orientation="vertical">
  6 +
  7 + <FrameLayout
  8 + android:layout_width="match_parent"
  9 + android:layout_height="92dp">
  10 +
  11 +
  12 + <ImageView
  13 + android:scaleType="fitXY"
  14 + android:id="@+id/video_pic"
  15 + android:layout_width="match_parent"
  16 + android:layout_height="match_parent"
  17 + android:contentDescription="@string/logo"
  18 + android:src="@mipmap/banner" />
  19 +
  20 + <TextView
  21 + android:id="@+id/lesson"
  22 + android:layout_width="39dp"
  23 + android:layout_height="16dp"
  24 + android:background="@drawable/gradient_e8_e5_4"
  25 + android:gravity="center"
  26 + android:textColor="@color/white"
  27 + android:textSize="10sp" />
  28 + </FrameLayout>
  29 +
  30 + <TextView
  31 + android:id="@+id/course_name"
  32 + android:layout_width="match_parent"
  33 + android:layout_height="wrap_content"
  34 + android:layout_marginTop="8dp"
  35 + android:textColor="@color/color_32"
  36 + android:textSize="12sp" />
  37 +
  38 + <LinearLayout
  39 + android:layout_width="match_parent"
  40 + android:layout_height="wrap_content"
  41 + android:layout_marginTop="6dp"
  42 + android:gravity="center_vertical"
  43 + android:orientation="horizontal">
  44 +
  45 + <ImageView
  46 + android:id="@+id/head"
  47 + android:layout_width="16dp"
  48 + android:layout_height="16dp"
  49 + android:contentDescription="@string/logo" />
  50 +
  51 + <TextView
  52 + android:id="@+id/name"
  53 + android:layout_width="match_parent"
  54 + android:layout_height="wrap_content"
  55 + android:layout_marginStart="8dp"
  56 + android:textColor="@color/color_96"
  57 + android:textSize="11sp" />
  58 + </LinearLayout>
  59 +</LinearLayout>
  1 +<?xml version="1.0" encoding="utf-8"?>
  2 +<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
  3 + android:layout_width="match_parent"
  4 + android:layout_height="?actionBarSize">
  5 +
  6 + <androidx.appcompat.widget.AppCompatImageView
  7 + android:id="@+id/back"
  8 + android:layout_width="wrap_content"
  9 + android:layout_height="match_parent"
  10 + android:layout_centerVertical="true"
  11 + android:paddingStart="16dp"
  12 + android:paddingEnd="0dp"
  13 + android:src="@mipmap/ic_back" />
  14 +
  15 + <androidx.appcompat.widget.AppCompatTextView
  16 + android:id="@+id/title"
  17 + android:layout_width="match_parent"
  18 + android:layout_height="match_parent"
  19 + android:layout_toEndOf="@id/back"
  20 + android:gravity="center"
  21 + android:text="@string/app_name" />
  22 +
  23 +
  24 +
  25 +
  26 +</RelativeLayout>
  1 +<?xml version="1.0" encoding="utf-8"?>
  2 +<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
  3 + android:layout_width="match_parent"
  4 + android:layout_height="wrap_content"
  5 + android:layout_marginStart="40dp"
  6 + android:layout_marginEnd="40dp"
  7 + android:background="@drawable/solid_ff_8"
  8 + android:orientation="vertical">
  9 +
  10 + <TextView
  11 + android:id="@+id/title"
  12 + android:layout_width="match_parent"
  13 + android:layout_height="wrap_content"
  14 + android:layout_marginStart="16dp"
  15 + android:layout_marginTop="32dp"
  16 + android:layout_marginEnd="16dp"
  17 + android:gravity="center"
  18 + android:text="确认删除吗?"
  19 + android:textColor="@color/color_252"
  20 + android:textSize="18sp" />
  21 +
  22 + <LinearLayout
  23 + android:layout_width="match_parent"
  24 + android:layout_height="wrap_content"
  25 + android:layout_marginStart="20dp"
  26 + android:layout_marginTop="24dp"
  27 + android:layout_marginEnd="20dp"
  28 + android:layout_marginBottom="24dp"
  29 + android:orientation="horizontal">
  30 +
  31 + <TextView
  32 + android:id="@+id/cancel"
  33 + android:layout_width="0dp"
  34 + android:layout_height="40dp"
  35 + android:layout_weight="1"
  36 + android:background="@drawable/solid_f2_4"
  37 + android:gravity="center"
  38 + android:text="取消"
  39 + android:textColor="@color/color_64"
  40 + android:textSize="15sp" />
  41 +
  42 + <View
  43 + android:layout_width="20dp"
  44 + android:layout_height="match_parent" />
  45 +
  46 + <TextView
  47 + android:id="@+id/determine"
  48 + android:layout_width="0dp"
  49 + android:layout_height="40dp"
  50 + android:layout_weight="1"
  51 + android:background="@drawable/solid_25_4"
  52 + android:gravity="center"
  53 + android:text="确定"
  54 + android:textColor="@color/white"
  55 + android:textSize="15sp" />
  56 +
  57 + </LinearLayout>
  58 +
  59 +</LinearLayout>
  1 +<?xml version="1.0" encoding="utf-8"?>
  2 +<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
  3 + android:orientation="vertical"
  4 + android:layout_width="match_parent"
  5 + android:layout_height="match_parent">
  6 +
  7 + <TextView
  8 + android:layout_gravity="center_horizontal"
  9 + android:gravity="center"
  10 + android:text="home"
  11 + android:layout_width="match_parent"
  12 + android:layout_height="match_parent" />
  13 +</LinearLayout>
  1 +<?xml version="1.0" encoding="utf-8"?>
  2 +<LinearLayout 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 + <LinearLayout
  10 + android:layout_width="match_parent"
  11 + android:layout_height="?actionBarSize"
  12 + android:background="@color/color_25"
  13 + android:orientation="horizontal"
  14 + android:paddingStart="16dp"
  15 + android:paddingEnd="16dp">
  16 +
  17 + <ImageView
  18 + android:layout_width="87dp"
  19 + android:layout_height="26dp"
  20 + android:layout_gravity="center_vertical"
  21 + android:background="@color/color_96"
  22 + android:contentDescription="@string/logo" />
  23 +
  24 + <RelativeLayout
  25 + android:id="@+id/search"
  26 + android:layout_width="match_parent"
  27 + android:layout_height="32dp"
  28 + android:layout_gravity="center_vertical"
  29 + android:layout_marginStart="8dp"
  30 + android:background="@drawable/search_back">
  31 +
  32 + <TextView
  33 + android:layout_width="wrap_content"
  34 + android:layout_height="wrap_content"
  35 + android:layout_centerInParent="true"
  36 + android:text="搜索"
  37 + android:textColor="@color/white"
  38 + android:textSize="14sp" />
  39 +
  40 + <ImageView
  41 + android:layout_width="40dp"
  42 + android:layout_height="28dp"
  43 + android:layout_alignParentEnd="true"
  44 + android:layout_centerVertical="true"
  45 + android:layout_marginEnd="2dp"
  46 + android:background="@drawable/solid_ff_14"
  47 + android:contentDescription="@string/logo"
  48 + android:paddingStart="12dp"
  49 + android:paddingEnd="12dp"
  50 + android:src="@mipmap/search" />
  51 + </RelativeLayout>
  52 + </LinearLayout>
  53 +
  54 +
  55 + <androidx.core.widget.NestedScrollView
  56 + android:layout_width="match_parent"
  57 + android:layout_height="wrap_content"
  58 + android:fadingEdge="none"
  59 + android:overScrollMode="never"
  60 + android:scrollbars="none">
  61 +
  62 + <LinearLayout
  63 + android:layout_width="match_parent"
  64 + android:layout_height="match_parent"
  65 + android:orientation="vertical">
  66 +
  67 + <FrameLayout
  68 + android:layout_width="match_parent"
  69 + android:layout_height="wrap_content">
  70 +
  71 + <ImageView
  72 + android:layout_width="match_parent"
  73 + android:layout_height="wrap_content"
  74 + android:contentDescription="@string/logo"
  75 + android:scaleType="fitXY"
  76 + android:src="@mipmap/banner_back" />
  77 +
  78 + <com.youth.banner.Banner
  79 + android:id="@+id/banner"
  80 + android:layout_width="match_parent"
  81 + android:layout_height="160dp"
  82 + android:layout_marginStart="16dp"
  83 + android:layout_marginTop="15dp"
  84 + android:layout_marginEnd="16dp" />
  85 + </FrameLayout>
  86 +
  87 + <androidx.cardview.widget.CardView
  88 + android:id="@+id/announcement"
  89 + android:layout_width="match_parent"
  90 + android:layout_height="wrap_content"
  91 + android:layout_marginStart="16dp"
  92 + android:layout_marginTop="15dp"
  93 + android:layout_marginEnd="16dp"
  94 + app:cardCornerRadius="4dp"
  95 + app:cardElevation="10dp">
  96 +
  97 + <LinearLayout
  98 + android:layout_width="match_parent"
  99 + android:layout_height="wrap_content"
  100 + android:orientation="horizontal">
  101 +
  102 + <ImageView
  103 + android:layout_width="wrap_content"
  104 + android:layout_height="wrap_content"
  105 + android:contentDescription="@string/logo"
  106 + android:src="@mipmap/announcement" />
  107 +
  108 + <TextView
  109 + android:layout_width="0dp"
  110 + android:layout_height="wrap_content"
  111 + android:layout_gravity="center_vertical"
  112 + android:layout_marginStart="12dp"
  113 + android:layout_weight="1"
  114 + android:ellipsize="end"
  115 + android:maxLines="1"
  116 + android:text="最新课程通知,最新课程通知,最新课程通知,最新课程通知。。。" />
  117 +
  118 + <ImageView
  119 + android:layout_width="wrap_content"
  120 + android:layout_height="wrap_content"
  121 + android:layout_gravity="center_vertical"
  122 + android:layout_marginStart="18dp"
  123 + android:layout_marginEnd="12dp"
  124 + android:src="@mipmap/ic_arrow" />
  125 + </LinearLayout>
  126 +
  127 + </androidx.cardview.widget.CardView>
  128 +
  129 + <LinearLayout
  130 + android:layout_width="match_parent"
  131 + android:layout_height="wrap_content"
  132 + android:layout_marginTop="25dp"
  133 + android:orientation="horizontal">
  134 +
  135 + <TextView
  136 + android:id="@+id/online_course"
  137 + android:layout_width="0dp"
  138 + android:layout_height="wrap_content"
  139 + android:layout_weight="1"
  140 + android:drawableTop="@mipmap/online_course"
  141 + android:drawablePadding="4dp"
  142 + android:gravity="center"
  143 + android:text="在线课程"
  144 + android:textColor="@color/color_32"
  145 + android:textSize="14sp" />
  146 +
  147 + <TextView
  148 + android:id="@+id/live_course"
  149 + android:layout_width="0dp"
  150 + android:layout_height="wrap_content"
  151 + android:layout_weight="1"
  152 + android:drawableTop="@mipmap/live_course"
  153 + android:drawablePadding="4dp"
  154 + android:gravity="center"
  155 + android:text="直播课程"
  156 + android:textColor="@color/color_32"
  157 + android:textSize="14sp" />
  158 +
  159 +
  160 + <TextView
  161 + android:id="@+id/txt_course"
  162 + android:layout_width="0dp"
  163 + android:layout_height="wrap_content"
  164 + android:layout_weight="1"
  165 + android:drawableTop="@mipmap/txt_course"
  166 + android:drawablePadding="4dp"
  167 + android:gravity="center"
  168 + android:text="文本课程"
  169 + android:textColor="@color/color_32"
  170 + android:textSize="14sp" />
  171 +
  172 + <TextView
  173 + android:id="@+id/database"
  174 + android:layout_width="0dp"
  175 + android:layout_height="wrap_content"
  176 + android:layout_weight="1"
  177 + android:drawableTop="@mipmap/database"
  178 + android:drawablePadding="4dp"
  179 + android:gravity="center"
  180 + android:text="资料库"
  181 + android:textColor="@color/color_32"
  182 + android:textSize="14sp" />
  183 + </LinearLayout>
  184 +
  185 + <TextView
  186 + android:layout_width="wrap_content"
  187 + android:layout_height="wrap_content"
  188 + android:layout_marginStart="16dp"
  189 + android:layout_marginTop="24dp"
  190 + android:layout_marginBottom="4dp"
  191 + android:text="视频课程"
  192 + android:textColor="@color/color_32"
  193 + android:textSize="18sp" />
  194 +
  195 + <androidx.recyclerview.widget.RecyclerView
  196 + android:id="@+id/video_course"
  197 + android:layout_width="match_parent"
  198 + android:layout_height="wrap_content"
  199 + android:layout_marginStart="16dp"
  200 + android:layout_marginEnd="16dp"
  201 + android:nestedScrollingEnabled="false"
  202 + android:overScrollMode="never"
  203 + app:layoutManager="androidx.recyclerview.widget.GridLayoutManager"
  204 + app:spanCount="2"
  205 + tools:itemCount="4" />
  206 +
  207 + <LinearLayout
  208 + android:layout_width="match_parent"
  209 + android:layout_height="40dp"
  210 + android:layout_gravity="center"
  211 + android:layout_marginStart="16dp"
  212 + android:layout_marginTop="16dp"
  213 + android:layout_marginEnd="16dp"
  214 + android:background="@drawable/solid_ef_4"
  215 + android:gravity="center"
  216 + android:orientation="horizontal">
  217 +
  218 + <TextView
  219 + android:layout_width="wrap_content"
  220 + android:layout_height="match_parent"
  221 + android:layout_gravity="center"
  222 + android:gravity="center"
  223 + android:text="查看更多资料"
  224 + android:textColor="@color/color_25"
  225 + android:textSize="12sp" />
  226 +
  227 + <ImageView
  228 + android:layout_width="wrap_content"
  229 + android:layout_height="wrap_content"
  230 + android:layout_marginStart="8dp"
  231 + android:contentDescription="@string/logo"
  232 + android:src="@mipmap/load_arrow_right" />
  233 + </LinearLayout>
  234 +
  235 + <TextView
  236 + android:layout_width="wrap_content"
  237 + android:layout_height="wrap_content"
  238 + android:layout_marginStart="16dp"
  239 + android:layout_marginTop="24dp"
  240 + android:layout_marginBottom="16dp"
  241 + android:text="推荐资料"
  242 + android:textColor="@color/color_32"
  243 + android:textSize="18sp" />
  244 +
  245 + <androidx.recyclerview.widget.RecyclerView
  246 + android:id="@+id/recommended_data"
  247 + android:layout_width="match_parent"
  248 + android:layout_height="wrap_content"
  249 + android:layout_marginStart="16dp"
  250 + android:layout_marginEnd="16dp"
  251 + android:nestedScrollingEnabled="false"
  252 + android:overScrollMode="never"
  253 + app:layoutManager="androidx.recyclerview.widget.LinearLayoutManager" />
  254 +
  255 + <LinearLayout
  256 + android:layout_width="match_parent"
  257 + android:layout_height="40dp"
  258 + android:layout_gravity="center"
  259 + android:layout_marginStart="16dp"
  260 + android:layout_marginTop="16dp"
  261 + android:layout_marginEnd="16dp"
  262 + android:background="@drawable/solid_ef_4"
  263 + android:gravity="center"
  264 + android:orientation="horizontal">
  265 +
  266 + <TextView
  267 + android:layout_width="wrap_content"
  268 + android:layout_height="match_parent"
  269 + android:layout_gravity="center"
  270 + android:gravity="center"
  271 + android:text="查看更多资料"
  272 + android:textColor="@color/color_25"
  273 + android:textSize="12sp" />
  274 +
  275 + <ImageView
  276 + android:layout_width="wrap_content"
  277 + android:layout_height="wrap_content"
  278 + android:layout_marginStart="8dp"
  279 + android:contentDescription="@string/logo"
  280 + android:src="@mipmap/load_arrow_right" />
  281 + </LinearLayout>
  282 +
  283 + <TextView
  284 + android:layout_width="wrap_content"
  285 + android:layout_height="wrap_content"
  286 + android:layout_gravity="center"
  287 + android:layout_marginTop="20dp"
  288 + android:layout_marginBottom="24dp"
  289 + android:gravity="center"
  290 + android:text="已经到底了~"
  291 + android:textColor="@color/color_c8"
  292 + android:textSize="12sp" />
  293 + </LinearLayout>
  294 + </androidx.core.widget.NestedScrollView>
  295 +
  296 +
  297 +</LinearLayout>
  1 +<?xml version="1.0" encoding="utf-8"?>
  2 +<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
  3 + android:orientation="vertical"
  4 + android:layout_width="match_parent"
  5 + android:layout_height="match_parent">
  6 +
  7 + <TextView
  8 + android:layout_gravity="center_horizontal"
  9 + android:gravity="center"
  10 + android:text="mine"
  11 + android:layout_width="match_parent"
  12 + android:layout_height="match_parent" />
  13 +</LinearLayout>
  1 +<?xml version="1.0" encoding="utf-8"?>
  2 +<androidx.recyclerview.widget.RecyclerView xmlns:android="http://schemas.android.com/apk/res/android"
  3 + xmlns:app="http://schemas.android.com/apk/res-auto"
  4 + android:id="@+id/result"
  5 + android:layout_width="match_parent"
  6 + android:layout_height="match_parent"
  7 + android:overScrollMode="never"
  8 + android:paddingStart="16dp"
  9 + android:paddingEnd="16dp"
  10 + android:scrollbars="none"
  11 + app:layoutManager="androidx.recyclerview.widget.LinearLayoutManager" />
  12 +
1 <?xml version="1.0" encoding="utf-8"?> 1 <?xml version="1.0" encoding="utf-8"?>
2 -<LinearLayout  
3 - xmlns:android="http://schemas.android.com/apk/res/android" 2 +<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
4 android:layout_width="match_parent" 3 android:layout_width="match_parent"
5 android:layout_height="match_parent" 4 android:layout_height="match_parent"
  5 + android:layout_gravity="center_horizontal"
  6 + android:gravity="center_horizontal"
6 android:orientation="vertical" 7 android:orientation="vertical"
7 - android:gravity="center"> 8 + android:paddingTop="48dp"
  9 + android:paddingBottom="0dp">
8 10
9 -<!-- <ImageView-->  
10 -<!-- android:layout_width="wrap_content"-->  
11 -<!-- android:layout_height="wrap_content"-->  
12 -<!-- android:src="@drawable/empty"-->  
13 -<!-- android:layout_centerInParent="true"/>--> 11 + <ImageView
  12 + android:layout_width="match_parent"
  13 + android:layout_height="wrap_content"
  14 + android:contentDescription="@string/logo"
  15 + android:src="@mipmap/blank" />
14 16
15 -<!-- <TextView-->  
16 -<!-- android:text="@string/empty_message"-->  
17 -<!-- android:layout_marginTop="10dp"-->  
18 -<!-- android:textColor="@color/primary_grey_dark"-->  
19 -<!-- android:layout_width="wrap_content"-->  
20 -<!-- android:layout_height="wrap_content"-->  
21 -<!-- />--> 17 + <TextView
  18 + android:layout_width="wrap_content"
  19 + android:layout_height="wrap_content"
  20 + android:layout_marginTop="8dp"
  21 + android:text="暂无搜索记录~"
  22 + android:textColor="@color/color_c8"
  23 + android:textSize="12sp" />
22 24
23 </LinearLayout> 25 </LinearLayout>
  1 +<?xml version="1.0" encoding="utf-8"?>
  2 +<androidx.appcompat.widget.Toolbar xmlns:android="http://schemas.android.com/apk/res/android"
  3 + android:id="@+id/status_bar"
  4 + android:layout_width="match_parent"
  5 + android:layout_height="24dp"
  6 + android:background="@android:color/transparent" />