作者 zhangji

1、资料库页面已创建

2、资料详情
3、文本课程
4、文本课程详情
以上页面与部分逻辑全部写完
正在显示 58 个修改的文件 包含 1385 行增加39 行删除
1 <?xml version="1.0" encoding="utf-8"?> 1 <?xml version="1.0" encoding="utf-8"?>
2 <manifest xmlns:android="http://schemas.android.com/apk/res/android" 2 <manifest xmlns:android="http://schemas.android.com/apk/res/android"
  3 + xmlns:tools="http://schemas.android.com/tools"
3 package="com.br_technology.securitytrain_master"> 4 package="com.br_technology.securitytrain_master">
4 5
  6 + <uses-permission android:name="android.permission.CHANGE_NETWORK_STATE" />
5 <uses-permission android:name="android.permission.INTERNET" /> 7 <uses-permission android:name="android.permission.INTERNET" />
6 <uses-permission android:name="android.permission.ACCESS_NETWORK_STATE" /> 8 <uses-permission android:name="android.permission.ACCESS_NETWORK_STATE" />
7 - <uses-permission android:name="android.permission.CHANGE_NETWORK_STATE" /> 9 + <uses-permission android:name="android.permission.ACCESS_WIFI_STATE" />
  10 +
  11 + <!-- 往sdcard中写入数据的权限 -->
  12 + <uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE" />
  13 + <!-- 在sdcard中创建/删除文件的权限 -->
  14 + <uses-permission android:name="android.permission.MOUNT_UNMOUNT_FILESYSTEMS"
  15 + tools:ignore="ProtectedPermissions" />
8 16
9 <application 17 <application
10 android:allowBackup="true" 18 android:allowBackup="true"
11 android:icon="@mipmap/ic_launcher" 19 android:icon="@mipmap/ic_launcher"
12 android:label="@string/app_name" 20 android:label="@string/app_name"
13 android:roundIcon="@mipmap/ic_launcher_round" 21 android:roundIcon="@mipmap/ic_launcher_round"
  22 + android:usesCleartextTraffic="true"
  23 + android:hardwareAccelerated="true"
14 android:supportsRtl="true" 24 android:supportsRtl="true"
15 android:theme="@style/Theme.SecurityTrainMaster"> 25 android:theme="@style/Theme.SecurityTrainMaster">
16 <meta-data 26 <meta-data
@@ -55,7 +65,13 @@ @@ -55,7 +65,13 @@
55 <activity 65 <activity
56 android:name=".ui.home.activity.SearchActivity" 66 android:name=".ui.home.activity.SearchActivity"
57 android:screenOrientation="portrait" /> 67 android:screenOrientation="portrait" />
58 - <activity android:name=".ui.home.activity.DatabaseActivity" /> 68 + <activity android:name=".ui.home.activity.DatabaseActivity"
  69 + android:screenOrientation="portrait"/>
  70 + <activity android:name=".ui.home.activity.DatabaseDetailActivity"
  71 + android:screenOrientation="portrait"/>
  72 + <activity android:name=".ui.home.activity.WebViewActivity" />
  73 + <activity android:name=".ui.home.activity.TextCourseActivity" />
  74 + <activity android:name=".ui.home.activity.TextDetailActivity" />
59 75
60 76
61 </application> 77 </application>
  1 +<!DOCTYPE html>
  2 +<html lang="en">
  3 +<head>
  4 + <meta charset="UTF-8">
  5 + <meta name="viewport"
  6 + content="width=device-width,initial-scale=1.0,maximum-scale=1.0,user-scalable=no"/>
  7 + <title>Document</title>
  8 + <style type="text/css">
  9 + canvas {
  10 + width: 100%;
  11 + height: 100%;
  12 + border: 1px solid black;
  13 + }
  14 + </style>
  15 + <script src="https://unpkg.com/pdfjs-dist@1.9.426/build/pdf.min.js"></script>
  16 + <script type="text/javascript" src="index.js"></script>
  17 +</head>
  18 +<body>
  19 +</body>
  20 +</html>
  1 +var url = location.search.substring(1);
  2 +
  3 +PDFJS.cMapUrl = 'https://unpkg.com/pdfjs-dist@1.9.426/cmaps/';
  4 +PDFJS.cMapPacked = true;
  5 +
  6 +var pdfDoc = null;
  7 +
  8 +function createPage() {
  9 + var div = document.createElement("canvas");
  10 + document.body.appendChild(div);
  11 + return div;
  12 +}
  13 +
  14 +function renderPage(num) {
  15 + pdfDoc.getPage(num).then(function (page) {
  16 + var viewport = page.getViewport(2.0);
  17 + var canvas = createPage();
  18 + var ctx = canvas.getContext('2d');
  19 +
  20 + canvas.height = viewport.height;
  21 + canvas.width = viewport.width;
  22 +
  23 + page.render({
  24 + canvasContext: ctx,
  25 + viewport: viewport
  26 + });
  27 + });
  28 +}
  29 +
  30 +PDFJS.getDocument(url).then(function (pdf) {
  31 + pdfDoc = pdf;
  32 + for (var i = 1; i <= pdfDoc.numPages; i++) {
  33 + renderPage(i)
  34 + }
  35 +});
1 package com.br_technology.securitytrain_master.base.view 1 package com.br_technology.securitytrain_master.base.view
2 2
  3 +import android.content.Context
3 import android.view.LayoutInflater 4 import android.view.LayoutInflater
4 -import android.view.View  
5 import android.view.ViewGroup 5 import android.view.ViewGroup
6 import androidx.recyclerview.widget.RecyclerView 6 import androidx.recyclerview.widget.RecyclerView
7 import androidx.viewbinding.ViewBinding 7 import androidx.viewbinding.ViewBinding
  8 +import com.br_technology.securitytrain_master.view.listener.OnItemClickListener
8 import java.util.ArrayList 9 import java.util.ArrayList
9 10
10 /** 11 /**
@@ -12,22 +13,35 @@ import java.util.ArrayList @@ -12,22 +13,35 @@ import java.util.ArrayList
12 * auth:张继 13 * auth:张继
13 * des: 简单列表适配器 14 * des: 简单列表适配器
14 */ 15 */
15 -abstract class BaseAdapter<T, VB : ViewBinding>(private val inflate: (LayoutInflater) -> VB) : 16 +abstract class BaseAdapter<T, VB : ViewBinding> :
16 RecyclerView.Adapter<BaseViewHolder<VB>>() { 17 RecyclerView.Adapter<BaseViewHolder<VB>>() {
  18 +
  19 + private var listener: OnItemClickListener<T>? = null
  20 +
17 private val list: MutableList<T> = ArrayList() 21 private val list: MutableList<T> = ArrayList()
18 22
19 override fun onCreateViewHolder(parent: ViewGroup, viewType: Int): BaseViewHolder<VB> { 23 override fun onCreateViewHolder(parent: ViewGroup, viewType: Int): BaseViewHolder<VB> {
20 - return BaseViewHolder(inflate(LayoutInflater.from(parent.context))) 24 + return BaseViewHolder(getViewBinding(parent.context,parent,viewType,LayoutInflater.from(parent.context)))
21 } 25 }
22 26
  27 + abstract fun getViewBinding(
  28 + context: Context,
  29 + parent: ViewGroup,
  30 + viewType: Int,
  31 + from: LayoutInflater
  32 + ): VB
  33 +
23 override fun onBindViewHolder(holder: BaseViewHolder<VB>, position: Int) { 34 override fun onBindViewHolder(holder: BaseViewHolder<VB>, position: Int) {
24 if (list.isEmpty()) return 35 if (list.isEmpty()) return
25 onBind(holder.item, position, list[position]) 36 onBind(holder.item, position, list[position])
  37 + // item点击时间
  38 + holder.itemView.setOnClickListener {
  39 + listener?.onClick(position, list[position])
  40 + }
26 } 41 }
27 42
28 abstract fun onBind(holder: VB, position: Int, data: T) 43 abstract fun onBind(holder: VB, position: Int, data: T)
29 44
30 -  
31 override fun getItemCount(): Int { 45 override fun getItemCount(): Int {
32 return list.size 46 return list.size
33 } 47 }
@@ -59,4 +73,8 @@ abstract class BaseAdapter<T, VB : ViewBinding>(private val inflate: (LayoutInfl @@ -59,4 +73,8 @@ abstract class BaseAdapter<T, VB : ViewBinding>(private val inflate: (LayoutInfl
59 notifyItemChanged(position, list.size) 73 notifyItemChanged(position, list.size)
60 } 74 }
61 75
  76 + fun addListener(listener: OnItemClickListener<T>){
  77 + this.listener=listener
  78 + }
  79 +
62 } 80 }
@@ -9,6 +9,7 @@ import android.view.View @@ -9,6 +9,7 @@ import android.view.View
9 import android.view.ViewGroup 9 import android.view.ViewGroup
10 import androidx.recyclerview.widget.RecyclerView 10 import androidx.recyclerview.widget.RecyclerView
11 import androidx.viewbinding.ViewBinding 11 import androidx.viewbinding.ViewBinding
  12 +import com.br_technology.securitytrain_master.view.listener.OnItemClickListener
12 import java.util.ArrayList 13 import java.util.ArrayList
13 14
14 /** 15 /**
@@ -18,6 +19,7 @@ import java.util.ArrayList @@ -18,6 +19,7 @@ import java.util.ArrayList
18 */ 19 */
19 abstract class BaseMultiAdapter<T, VB : ViewBinding> : RecyclerView.Adapter<BaseViewHolder<VB>>() { 20 abstract class BaseMultiAdapter<T, VB : ViewBinding> : RecyclerView.Adapter<BaseViewHolder<VB>>() {
20 protected val list: MutableList<T> = ArrayList() 21 protected val list: MutableList<T> = ArrayList()
  22 + private var listener: OnItemClickListener<T>? = null
21 23
22 abstract override fun onCreateViewHolder(parent: ViewGroup, viewType: Int): BaseViewHolder<VB> 24 abstract override fun onCreateViewHolder(parent: ViewGroup, viewType: Int): BaseViewHolder<VB>
23 25
@@ -25,6 +27,9 @@ abstract class BaseMultiAdapter<T, VB : ViewBinding> : RecyclerView.Adapter<Base @@ -25,6 +27,9 @@ abstract class BaseMultiAdapter<T, VB : ViewBinding> : RecyclerView.Adapter<Base
25 override fun onBindViewHolder(holder: BaseViewHolder<VB>, position: Int) { 27 override fun onBindViewHolder(holder: BaseViewHolder<VB>, position: Int) {
26 if (list.isEmpty()) return 28 if (list.isEmpty()) return
27 onBind(holder.item, position, list[position]) 29 onBind(holder.item, position, list[position])
  30 + holder.itemView.setOnClickListener {
  31 + listener?.onClick(position,list[position])
  32 + }
28 } 33 }
29 34
30 abstract fun onBind(holder: VB, position: Int, data: T) 35 abstract fun onBind(holder: VB, position: Int, data: T)
@@ -77,5 +82,8 @@ abstract class BaseMultiAdapter<T, VB : ViewBinding> : RecyclerView.Adapter<Base @@ -77,5 +82,8 @@ abstract class BaseMultiAdapter<T, VB : ViewBinding> : RecyclerView.Adapter<Base
77 context.startActivity(intent) 82 context.startActivity(intent)
78 } 83 }
79 84
  85 + fun addListener(listener: OnItemClickListener<T>) {
  86 + this.listener = listener
  87 + }
80 88
81 } 89 }
1 package com.br_technology.securitytrain_master.expand 1 package com.br_technology.securitytrain_master.expand
2 2
3 -import android.app.Application 3 +import android.R.attr
4 import android.content.Context 4 import android.content.Context
5 import android.graphics.Point 5 import android.graphics.Point
6 -import android.os.Build 6 +import android.graphics.Rect
  7 +import android.util.Log
7 import android.view.View 8 import android.view.View
8 import android.view.WindowManager 9 import android.view.WindowManager
  10 +import androidx.recyclerview.widget.RecyclerView
  11 +
9 12
10 /** 13 /**
11 * createTime:2021/7/28 11:29 14 * createTime:2021/7/28 11:29
@@ -18,9 +21,38 @@ fun View.statusBarHeight(): Int { @@ -18,9 +21,38 @@ fun View.statusBarHeight(): Int {
18 } 21 }
19 22
20 fun View.screenWidth(): Int { 23 fun View.screenWidth(): Int {
21 - val manager: WindowManager = this.context.getSystemService(Context.WINDOW_SERVICE) as WindowManager 24 + val manager: WindowManager =
  25 + this.context.getSystemService(Context.WINDOW_SERVICE) as WindowManager
22 val point = Point() 26 val point = Point()
23 manager.defaultDisplay.getRealSize(point) 27 manager.defaultDisplay.getRealSize(point)
24 return point.x 28 return point.x
25 } 29 }
26 30
  31 +fun RecyclerView.addItemDecoration(spanCount: Int, spacing: Int) {
  32 + this.addItemDecoration(object : RecyclerView.ItemDecoration() {
  33 + override fun getItemOffsets(
  34 + outRect: Rect,
  35 + view: View,
  36 + parent: RecyclerView,
  37 + state: RecyclerView.State
  38 + ) {
  39 + super.getItemOffsets(outRect, view, parent, state)
  40 + //这里是关键,需要根据你有几列来判断
  41 + val position: Int = parent.getChildAdapterPosition(view) // item position
  42 + val column = position % spanCount // item column
  43 + outRect.top=32
  44 + when (column) {
  45 + 0->{
  46 + outRect.right=spacing
  47 + }
  48 + 1->{
  49 + outRect.left=spacing
  50 + outRect.right=spacing
  51 + }
  52 + else->{
  53 + outRect.left=spacing
  54 + }
  55 + }
  56 + }
  57 + })
  58 +}
1 package com.br_technology.securitytrain_master.ui.home.activity 1 package com.br_technology.securitytrain_master.ui.home.activity
2 2
  3 +import android.graphics.Rect
3 import android.os.Bundle 4 import android.os.Bundle
  5 +import android.view.View
  6 +import android.widget.TextView
  7 +import androidx.core.content.ContextCompat
  8 +import androidx.recyclerview.widget.RecyclerView
  9 +import com.br_technology.securitytrain_master.R
4 import com.br_technology.securitytrain_master.databinding.ActivityDatabaseBinding 10 import com.br_technology.securitytrain_master.databinding.ActivityDatabaseBinding
  11 +import com.br_technology.securitytrain_master.ui.home.adapter.ClassifyAdapter
  12 +import com.br_technology.securitytrain_master.ui.home.adapter.ResultAdapter
  13 +import com.br_technology.securitytrain_master.ui.home.pojo.RecommendData
5 import com.br_technology.securitytrain_master.ui.home.viewmodel.DatabaseViewModel 14 import com.br_technology.securitytrain_master.ui.home.viewmodel.DatabaseViewModel
  15 +import com.br_technology.securitytrain_master.view.listener.OnItemClickListener
  16 +import com.google.android.material.tabs.TabLayout
6 import com.wjx.android.wanandroidmvvm.base.view.BaseLifeCycleActivity 17 import com.wjx.android.wanandroidmvvm.base.view.BaseLifeCycleActivity
7 18
8 /** 19 /**
@@ -15,6 +26,153 @@ class DatabaseActivity : @@ -15,6 +26,153 @@ class DatabaseActivity :
15 override fun onCreate(savedInstanceState: Bundle?) { 26 override fun onCreate(savedInstanceState: Bundle?) {
16 super.onCreate(savedInstanceState) 27 super.onCreate(savedInstanceState)
17 28
  29 + binding.apply {
  30 + back.setOnClickListener {
  31 + finish()
  32 + }
  33 + tabLayout.addTab(tabLayout.newTab(), true)
  34 + tabLayout.addTab(tabLayout.newTab())
  35 + for (i in 0..1) {
  36 + val tabAt = tabLayout.getTabAt(i)
  37 + tabAt?.setCustomView(R.layout.layout_text)
  38 + val textView: TextView? = tabAt?.customView?.findViewById(R.id.tab_text)
  39 + if (i == 0) {
  40 + textView?.text = "共享资料库"
  41 + textView?.setTextColor(ContextCompat.getColor(baseContext, R.color.color_252))
  42 + textView?.textSize = 18f
  43 + } else {
  44 + textView?.text = "企业资料库"
  45 + textView?.setTextColor(ContextCompat.getColor(baseContext, R.color.color_96))
  46 + textView?.textSize = 16f
  47 + }
  48 + }
  49 + tabLayout.addOnTabSelectedListener(object : TabLayout.OnTabSelectedListener {
  50 + override fun onTabSelected(tab: TabLayout.Tab) {
  51 + val view: TextView? = tab.customView?.findViewById(R.id.tab_text)
  52 + view?.isSelected = true;
  53 + view?.setTextColor(ContextCompat.getColor(baseContext, R.color.color_252))
  54 + view?.textSize = 18f
  55 + }
  56 +
  57 + override fun onTabUnselected(tab: TabLayout.Tab) {
  58 + val view: TextView? = tab.customView?.findViewById(R.id.tab_text)
  59 + view?.isSelected = false;
  60 + view?.setTextColor(ContextCompat.getColor(baseContext, R.color.color_96))
  61 + view?.textSize = 16f
  62 + }
  63 +
  64 + override fun onTabReselected(tab: TabLayout.Tab?) {
  65 + }
  66 + })
  67 +
  68 + classify.addItemDecoration(object : RecyclerView.ItemDecoration() {
  69 + override fun getItemOffsets(
  70 + outRect: Rect,
  71 + view: View,
  72 + parent: RecyclerView,
  73 + state: RecyclerView.State
  74 + ) {
  75 + super.getItemOffsets(outRect, view, parent, state)
  76 + if (parent.getChildAdapterPosition(view) == 0) {
  77 + outRect.right = 24
  78 + outRect.left = 32
  79 + } else {
  80 + outRect.right = 24
  81 + }
  82 + }
  83 + })
  84 + val classifyAdapter = ClassifyAdapter()
  85 + val classifyList = listOf(
  86 + "法律法规",
  87 + "安全生产技术",
  88 + "二级标题",
  89 + "二级标题",
  90 + "二级标题",
  91 + "二级标题",
  92 + "二级标题",
  93 + "二级标题",
  94 + "二级标题",
  95 + "二级标题",
  96 + "二级标题",
  97 + )
  98 + classify.adapter = classifyAdapter
  99 + classifyAdapter.addList(classifyList)
  100 + classifyAdapter.addListener(object : OnItemClickListener<String> {
  101 + override fun onClick(position: Int, data: String) {
  102 + classifyAdapter.index = position
  103 + classifyAdapter.notifyDataSetChanged()
  104 + }
  105 + })
  106 +
  107 + val recommendList = mutableListOf(
  108 + RecommendData(
  109 + R.mipmap.banner,
  110 + "思维导图高分作文法(高中)议论",
  111 + "从这个角度看,康得在不经意间这样说过,既然我已踏上了这条道路,那么"
  112 + ),
  113 + RecommendData(
  114 + R.mipmap.banner,
  115 + "思维导图高分作文法(高中)议论",
  116 + "从这个角度看,康得在不经意间这样说过,既然我已踏上了这条道路,那么"
  117 + ),
  118 + RecommendData(
  119 + R.mipmap.banner,
  120 + "思维导图高分作文法(高中)议论",
  121 + "从这个角度看,康得在不经意间这样说过,既然我已踏上了这条道路,那么"
  122 + ),
  123 + RecommendData(
  124 + R.mipmap.banner,
  125 + "思维导图高分作文法(高中)议论",
  126 + "从这个角度看,康得在不经意间这样说过,既然我已踏上了这条道路,那么"
  127 + ),
  128 + RecommendData(
  129 + R.mipmap.banner,
  130 + "思维导图高分作文法(高中)议论",
  131 + "从这个角度看,康得在不经意间这样说过,既然我已踏上了这条道路,那么"
  132 + ),
  133 + RecommendData(
  134 + R.mipmap.banner,
  135 + "思维导图高分作文法(高中)议论",
  136 + "从这个角度看,康得在不经意间这样说过,既然我已踏上了这条道路,那么"
  137 + ),
  138 + RecommendData(
  139 + R.mipmap.banner,
  140 + "思维导图高分作文法(高中)议论",
  141 + "从这个角度看,康得在不经意间这样说过,既然我已踏上了这条道路,那么"
  142 + ),
  143 + RecommendData(
  144 + R.mipmap.banner,
  145 + "思维导图高分作文法(高中)议论",
  146 + "从这个角度看,康得在不经意间这样说过,既然我已踏上了这条道路,那么"
  147 + ),
  148 + RecommendData(
  149 + R.mipmap.banner,
  150 + "思维导图高分作文法(高中)议论",
  151 + "从这个角度看,康得在不经意间这样说过,既然我已踏上了这条道路,那么"
  152 + ),
  153 + RecommendData(
  154 + R.mipmap.banner,
  155 + "思维导图高分作文法(高中)议论",
  156 + "从这个角度看,康得在不经意间这样说过,既然我已踏上了这条道路,那么"
  157 + ),
  158 + RecommendData(
  159 + R.mipmap.banner,
  160 + "思维导图高分作文法(高中)议论",
  161 + "从这个角度看,康得在不经意间这样说过,既然我已踏上了这条道路,那么"
  162 + ),
  163 + )
  164 + val resultAdapter = ResultAdapter()
  165 + resultAdapter.addListener(object : OnItemClickListener<RecommendData> {
  166 + override fun onClick(position: Int, data: RecommendData) {
  167 + startActivity(DatabaseDetailActivity::class.java)
  168 + }
  169 + })
  170 + databaseRecycler.adapter = resultAdapter
  171 + resultAdapter.addList(recommendList)
  172 +
  173 +
  174 + }
  175 +
18 } 176 }
19 177
20 override fun initDataObserver() { 178 override fun initDataObserver() {
  1 +package com.br_technology.securitytrain_master.ui.home.activity
  2 +
  3 +import android.os.Bundle
  4 +import com.br_technology.securitytrain_master.databinding.ActivityDatabaseDetailBinding
  5 +import com.br_technology.securitytrain_master.ui.home.adapter.PdfAdapter
  6 +import com.br_technology.securitytrain_master.ui.home.viewmodel.DatabaseDetailViewModel
  7 +import com.br_technology.securitytrain_master.view.listener.OnItemClickListener
  8 +import com.wjx.android.wanandroidmvvm.base.view.BaseLifeCycleActivity
  9 +import java.net.URLEncoder
  10 +
  11 +/**
  12 + * createTime:2021/7/29 10:43
  13 + * auth:张继
  14 + * des:资料库详情
  15 + */
  16 +class DatabaseDetailActivity :
  17 + BaseLifeCycleActivity<DatabaseDetailViewModel, ActivityDatabaseDetailBinding>(
  18 + ActivityDatabaseDetailBinding::inflate
  19 + ) {
  20 + override fun onCreate(savedInstanceState: Bundle?) {
  21 + super.onCreate(savedInstanceState)
  22 +
  23 + binding.apply {
  24 +
  25 + back.setOnClickListener {
  26 + finish()
  27 + }
  28 + val data: String =
  29 + "<p>2021年1月20日0时25分,我国在西昌卫星发射中心用长征三号乙运载火箭," +
  30 + "成功将天通一号03星发射升空。在为中国航天发射带来2021年开门红的同时," +
  31 + "也标志着我国首个卫星移动通信系统建设取得重要进展。</p ><p>天通一号03" +
  32 + "星是中国航天科技集团五院通信与导航总体部自主研制的第三颗移动通信卫星。它" +
  33 + "在轨交付后,将与天通一号01星、02星组网运行,为我国及周边、中东、非洲等相关" +
  34 + "地区,以及太平洋、印度洋大部分海域用户,提供全天候、全天时、稳定可靠的话音、短" +
  35 + "消息和数据等移动通信服务。</p ><p><strong>发展卫星移动通信是我国必然要求<" +
  36 + "/strong></p ><p>当今,人们对信息的获取和使用需求越来越高,卫星移动通信可以" +
  37 + "弥补地面移动通信的不足。</p ><p>五院天通一号卫星总指挥边炳秀介绍,卫星移动通信系" +
  38 + "统主要为小型化移动终端,包括地面个人移动终端、车载终端、机载终端、船载终端等,提供多样化的" +
  39 + "中低速率的通信服务。</p ><p>该系统能够实现对海洋、山区和高原等地区近乎无缝的覆盖,满" +
  40 + "足各类用户对移动通信覆盖性的需求。因其灵活移动和便携的特点,具有很高的民用和商用价值。</p ><" +
  41 + "p>2008年汶川地震后,为了拥有自主移动通信卫星系统,我国启动了天通一号卫星研制工作。为此,五院突破" +
  42 + "了大口径可展开网状天线、多波束形成等关键技术。2016年,S频段大容量地球同步轨道移动通信卫星天通一" +
  43 + "号01星成功发射,实现了我国移动通信卫星零的突破。随后02星、03星启动研制。</p ><p><strong>天通一号将" +
  44 + "与5G融合发展</strong></p ><p>记者从五院了解到,天通一号03星基于东方红四号卫星平台研制,核心部组件全" +
  45 + "部自主研发,关键技术均拥有自主知识产权。</p ><p>五院天通一号卫星总设计师陈明章表示,天通一号系列卫星研制成" +
  46 + "功,使我国拥有了自主知识产权的卫星移动通信系统,标志着我国在新载荷、大平台的研制与应用等领域进入了国际领先" +
  47 + "行列。同时也表明我国在卫星的设计制造能力、平台技术、载荷技术、基础元器件、原材料和地面仿真实验验证技术领域,达到了较" +
  48 + "高技术水准,有力提升了后续同类卫星的研制水平。</p ><p>03星与01星、02星组网后,将大大扩宽我国国土及周边海域的各类手持和" +
  49 + "小型移动终端提供话音和数据通信覆盖,满足更多民商用户多样化通信需求。</p ><p><strong>任务火箭实现两大变化</strong></p >"
  50 +
  51 + val dataImg: String = "<p>中新网1月21日电 为什么要对返乡人员加强疫情防控管理?返乡前核酸检测阴性证明如何获得?" +
  52 + "持核酸检测阴性证明返乡后是否需要隔离?20日,国家卫健委就《冬春季农村地区新冠肺炎疫情防控工作方案》重点问题答问。" +
  53 + "</p ><p>近日,国务院应对新型冠状病毒肺炎疫情联防联控机制综合组和中央农村工作领导小组办公室制定了《冬春季农村地区新" +
  54 + "冠肺炎疫情防控工作方案》。《方案》明确,返乡人员需持7天内有效新冠病毒核酸检测阴性结果返乡,返乡后实行14天居家健康监测" +
  55 + ",期间不聚集、不流动,每7天开展一次核酸检测。</p ><p style=\"text-align: center;\"><img title=\"资" +
  56 + "料图:2020年2月18日,乘坐火车抵达南京火车站的乘客们有序出站。当日,为期四十天的2020年中国春运落幕。<a target='_bla" +
  57 + "nk' href=' '>中新社</ a>记者 泱波 摄\" alt=\"点击进入下一页\" src=\"http://image1.chinanews.com.cn" +
  58 + "/cnsupload/big/2020/02-18/4-426/18402a9652714f66895f38c0806224f3.jpg\"/></p ><p>资料图:2020年2" +
  59 + "月18日,乘坐火车抵达南京火车站的乘客们有序出站。当日,为期四十天的2020年中国春运落幕。中新社记者  泱波 摄</p ><p>一、" +
  60 + "为什么要对返乡人员加强疫情防控管理?</p ><p>进入冬季以来,农村地区零星散发病例和局部聚集性疫情明显增加,严重影响当地正常生产生" +
  61 + "活秩序。农村地区防控能力薄弱,疫情防控难度大,特别是春运期间返乡人员明显增多,人员流动增大,将会进一步加大疫情传播风险。为严格落实内" +
  62 + "防反弹的防控策略,对返乡人员加强疫情防控管理十分必要。核酸检测是目前尽早发现新冠病毒感染者的有效手段,要求返乡人员持核酸检测阴性证明" +
  63 + "能够有效降低疫情传入农村的风险,保障大家度过一个健康、平安的春节。</p ><p>二、工作方案所指返乡人员包括哪些人群?</p ><p>工作方案" +
  64 + "所指返乡人员是指从外地返回农村地区的人员,主要包括:一是跨省份返乡人员;二是来自本省内中高风险区域所在地市的返乡人员(中高风险区" +
  65 + "域内部人员原则上不流动);三是本省内的进口冷链食品从业人员、口岸直接接触进口货物从业人员、隔离场所工作人员、交通运输工具从业人员等重点人群。"
  66 +
  67 + webView.loadDataWithBaseURL(null, dataImg, "text/html", "utf-8", null)
  68 + val pdfAdapter = PdfAdapter()
  69 + pdfAdapter.addListener(object :OnItemClickListener<String>{
  70 + override fun onClick(position: Int, data: String) {
  71 + startActivity(WebViewActivity::class.java)
  72 + }
  73 + })
  74 + val list = listOf(
  75 + "",
  76 + "",
  77 + "",
  78 + "",
  79 + "",
  80 + "",
  81 + )
  82 + pdf.adapter = pdfAdapter
  83 + pdfAdapter.addList(list)
  84 +
  85 +
  86 + }
  87 +
  88 +
  89 + }
  90 +
  91 + override fun initDataObserver() {
  92 +
  93 + }
  94 +}
  1 +package com.br_technology.securitytrain_master.ui.home.activity
  2 +
  3 +import android.graphics.Rect
  4 +import android.os.Bundle
  5 +import android.view.View
  6 +import android.widget.Toast
  7 +import androidx.core.content.ContextCompat
  8 +import androidx.recyclerview.widget.RecyclerView
  9 +import com.br_technology.securitytrain_master.R
  10 +import com.br_technology.securitytrain_master.databinding.ActivityTextCourseBinding
  11 +import com.br_technology.securitytrain_master.expand.addItemDecoration
  12 +import com.br_technology.securitytrain_master.ui.home.adapter.ResultAdapter
  13 +import com.br_technology.securitytrain_master.ui.home.adapter.TextCourseTypeAdapter
  14 +import com.br_technology.securitytrain_master.ui.home.pojo.RecommendData
  15 +import com.br_technology.securitytrain_master.ui.home.viewmodel.TextCourseViewModel
  16 +import com.br_technology.securitytrain_master.view.listener.OnItemClickListener
  17 +import com.br_technology.securitytrain_master.view.listener.ToolBarClickListener
  18 +import com.wjx.android.wanandroidmvvm.base.view.BaseLifeCycleActivity
  19 +
  20 +/**
  21 + * createTime:2021/7/29 15:20
  22 + * auth:张继
  23 + * des:
  24 + */
  25 +class TextCourseActivity :
  26 + BaseLifeCycleActivity<TextCourseViewModel, ActivityTextCourseBinding>(ActivityTextCourseBinding::inflate) {
  27 + override fun onCreate(savedInstanceState: Bundle?) {
  28 + super.onCreate(savedInstanceState)
  29 + binding.apply {
  30 + toolBar.setRightText("焊工")
  31 + toolBar.setRightTextDrawable(
  32 + ContextCompat.getDrawable(
  33 + baseContext,
  34 + R.mipmap.down_arrow
  35 + )
  36 + )
  37 + toolBar.addRightListener(object : ToolBarClickListener {
  38 + override fun onClick(view: View) {
  39 + courseTypeGroup.visibility = View.VISIBLE
  40 + }
  41 + })
  42 +
  43 + val recommendList = mutableListOf(
  44 + RecommendData(
  45 + R.mipmap.banner,
  46 + "思维导图高分作文法(高中)议论",
  47 + "从这个角度看,康得在不经意间这样说过,既然我已踏上了这条道路,那么"
  48 + ),
  49 + RecommendData(
  50 + R.mipmap.banner,
  51 + "思维导图高分作文法(高中)议论",
  52 + "从这个角度看,康得在不经意间这样说过,既然我已踏上了这条道路,那么"
  53 + ),
  54 + RecommendData(
  55 + R.mipmap.banner,
  56 + "思维导图高分作文法(高中)议论",
  57 + "从这个角度看,康得在不经意间这样说过,既然我已踏上了这条道路,那么"
  58 + ),
  59 + RecommendData(
  60 + R.mipmap.banner,
  61 + "思维导图高分作文法(高中)议论",
  62 + "从这个角度看,康得在不经意间这样说过,既然我已踏上了这条道路,那么"
  63 + ),
  64 + RecommendData(
  65 + R.mipmap.banner,
  66 + "思维导图高分作文法(高中)议论",
  67 + "从这个角度看,康得在不经意间这样说过,既然我已踏上了这条道路,那么"
  68 + ),
  69 + RecommendData(
  70 + R.mipmap.banner,
  71 + "思维导图高分作文法(高中)议论",
  72 + "从这个角度看,康得在不经意间这样说过,既然我已踏上了这条道路,那么"
  73 + ),
  74 + RecommendData(
  75 + R.mipmap.banner,
  76 + "思维导图高分作文法(高中)议论",
  77 + "从这个角度看,康得在不经意间这样说过,既然我已踏上了这条道路,那么"
  78 + ),
  79 + RecommendData(
  80 + R.mipmap.banner,
  81 + "思维导图高分作文法(高中)议论",
  82 + "从这个角度看,康得在不经意间这样说过,既然我已踏上了这条道路,那么"
  83 + ),
  84 + RecommendData(
  85 + R.mipmap.banner,
  86 + "思维导图高分作文法(高中)议论",
  87 + "从这个角度看,康得在不经意间这样说过,既然我已踏上了这条道路,那么"
  88 + ),
  89 + RecommendData(
  90 + R.mipmap.banner,
  91 + "思维导图高分作文法(高中)议论",
  92 + "从这个角度看,康得在不经意间这样说过,既然我已踏上了这条道路,那么"
  93 + ),
  94 + RecommendData(
  95 + R.mipmap.banner,
  96 + "思维导图高分作文法(高中)议论",
  97 + "从这个角度看,康得在不经意间这样说过,既然我已踏上了这条道路,那么"
  98 + ),
  99 + )
  100 + val resultAdapter = ResultAdapter()
  101 + resultAdapter.addListener(object : OnItemClickListener<RecommendData> {
  102 + override fun onClick(position: Int, data: RecommendData) {
  103 + startActivity(TextDetailActivity::class.java)
  104 + }
  105 + })
  106 + courseRecycler.adapter = resultAdapter
  107 + resultAdapter.addList(recommendList)
  108 +
  109 + complete.setOnClickListener {
  110 + courseTypeGroup.visibility = View.GONE
  111 + }
  112 +
  113 + courseType.addItemDecoration(3, 14)
  114 + val list = listOf(
  115 + "测试",
  116 + "岗位1",
  117 + "岗位2",
  118 + "岗位3",
  119 + "gangw4",
  120 + "岗位5",
  121 + "岗位6",
  122 + "岗位8",
  123 + "岗位7",
  124 + "岗位9",
  125 + )
  126 + val textCourseTypeAdapter = TextCourseTypeAdapter()
  127 + textCourseTypeAdapter.addListener(object : OnItemClickListener<String> {
  128 + override fun onClick(position: Int, data: String) {
  129 + textCourseTypeAdapter.index = position
  130 + textCourseTypeAdapter.notifyDataSetChanged()
  131 + }
  132 + })
  133 + courseType.adapter = textCourseTypeAdapter
  134 + textCourseTypeAdapter.addList(list)
  135 + }
  136 + }
  137 +
  138 + override fun initDataObserver() {
  139 +
  140 + }
  141 +}
  1 +package com.br_technology.securitytrain_master.ui.home.activity
  2 +
  3 +import android.os.Bundle
  4 +import com.br_technology.securitytrain_master.databinding.ActivityTextDetailBinding
  5 +import com.br_technology.securitytrain_master.ui.home.viewmodel.TextDetailViewModel
  6 +import com.wjx.android.wanandroidmvvm.base.view.BaseLifeCycleActivity
  7 +
  8 +/**
  9 + * createTime:2021/7/29 17:50
  10 + * auth:张继
  11 + * des:
  12 + */
  13 +class TextDetailActivity:BaseLifeCycleActivity<TextDetailViewModel,ActivityTextDetailBinding>(ActivityTextDetailBinding::inflate) {
  14 + override fun onCreate(savedInstanceState: Bundle?) {
  15 + super.onCreate(savedInstanceState)
  16 + binding.apply{
  17 + val dataImg: String = "<p>中新网1月21日电 为什么要对返乡人员加强疫情防控管理?返乡前核酸检测阴性证明如何获得?" +
  18 + "持核酸检测阴性证明返乡后是否需要隔离?20日,国家卫健委就《冬春季农村地区新冠肺炎疫情防控工作方案》重点问题答问。" +
  19 + "</p ><p>近日,国务院应对新型冠状病毒肺炎疫情联防联控机制综合组和中央农村工作领导小组办公室制定了《冬春季农村地区新" +
  20 + "冠肺炎疫情防控工作方案》。《方案》明确,返乡人员需持7天内有效新冠病毒核酸检测阴性结果返乡,返乡后实行14天居家健康监测" +
  21 + ",期间不聚集、不流动,每7天开展一次核酸检测。</p ><p style=\"text-align: center;\"><img title=\"资" +
  22 + "料图:2020年2月18日,乘坐火车抵达南京火车站的乘客们有序出站。当日,为期四十天的2020年中国春运落幕。<a target='_bla" +
  23 + "nk' href=' '>中新社</ a>记者 泱波 摄\" alt=\"点击进入下一页\" src=\"http://image1.chinanews.com.cn" +
  24 + "/cnsupload/big/2020/02-18/4-426/18402a9652714f66895f38c0806224f3.jpg\"/></p ><p>资料图:2020年2" +
  25 + "月18日,乘坐火车抵达南京火车站的乘客们有序出站。当日,为期四十天的2020年中国春运落幕。中新社记者  泱波 摄</p ><p>一、" +
  26 + "为什么要对返乡人员加强疫情防控管理?</p ><p>进入冬季以来,农村地区零星散发病例和局部聚集性疫情明显增加,严重影响当地正常生产生" +
  27 + "活秩序。农村地区防控能力薄弱,疫情防控难度大,特别是春运期间返乡人员明显增多,人员流动增大,将会进一步加大疫情传播风险。为严格落实内" +
  28 + "防反弹的防控策略,对返乡人员加强疫情防控管理十分必要。核酸检测是目前尽早发现新冠病毒感染者的有效手段,要求返乡人员持核酸检测阴性证明" +
  29 + "能够有效降低疫情传入农村的风险,保障大家度过一个健康、平安的春节。</p ><p>二、工作方案所指返乡人员包括哪些人群?</p ><p>工作方案" +
  30 + "所指返乡人员是指从外地返回农村地区的人员,主要包括:一是跨省份返乡人员;二是来自本省内中高风险区域所在地市的返乡人员(中高风险区" +
  31 + "域内部人员原则上不流动);三是本省内的进口冷链食品从业人员、口岸直接接触进口货物从业人员、隔离场所工作人员、交通运输工具从业人员等重点人群。"
  32 +
  33 + content.loadDataWithBaseURL(null, dataImg, "text/html", "utf-8", null)
  34 + }
  35 + }
  36 + override fun initDataObserver() {
  37 + }
  38 +}
  1 +package com.br_technology.securitytrain_master.ui.home.activity
  2 +
  3 +import android.os.Bundle
  4 +import android.webkit.WebSettings
  5 +import android.webkit.WebView
  6 +import android.webkit.WebViewClient
  7 +import androidx.appcompat.app.AppCompatActivity
  8 +import com.br_technology.securitytrain_master.R
  9 +
  10 +
  11 +/**
  12 + * createTime:2021/7/29 11:55
  13 + * auth:张继
  14 + * des:
  15 + */
  16 +class WebViewActivity : AppCompatActivity() {
  17 + override fun onCreate(savedInstanceState: Bundle?) {
  18 + super.onCreate(savedInstanceState)
  19 + setContentView(R.layout.activity_web)
  20 + val webView: WebView = findViewById(R.id.web_view)
  21 + webView.loadUrl("file:///android_asset/index.html?"+"http://www.tjxqda.com/cms/picture/8697695a-b8a6-4379-b89e-85c11fd127e2.pdf")
  22 + webView.webViewClient=object :WebViewClient(){
  23 + override fun shouldOverrideUrlLoading(view: WebView, url: String): Boolean {
  24 + view.loadUrl(url)
  25 + return true
  26 + }
  27 + }
  28 + val webSettings: WebSettings = webView.settings
  29 + webSettings.javaScriptEnabled = true
  30 + webSettings.allowFileAccess = true
  31 + webSettings.allowFileAccessFromFileURLs = true
  32 + webSettings.allowUniversalAccessFromFileURLs = true
  33 + }
  34 +}
  1 +package com.br_technology.securitytrain_master.ui.home.adapter
  2 +
  3 +import android.content.Context
  4 +import android.view.LayoutInflater
  5 +import android.view.ViewGroup
  6 +import com.br_technology.securitytrain_master.base.view.BaseAdapter
  7 +import com.br_technology.securitytrain_master.base.view.BaseViewHolder
  8 +import com.br_technology.securitytrain_master.databinding.AdapterClassifyBinding
  9 +
  10 +/**
  11 + * createTime:2021/7/29 10:00
  12 + * auth:张继
  13 + * des:
  14 + */
  15 +class ClassifyAdapter : BaseAdapter<String, AdapterClassifyBinding>() {
  16 +
  17 + var index: Int = 0
  18 + override fun onBind(holder: AdapterClassifyBinding, position: Int, data: String) {
  19 + holder.classify.text = data
  20 + holder.classify.isSelected = position == index
  21 + }
  22 +
  23 + override fun onCreateViewHolder(
  24 + parent: ViewGroup,
  25 + viewType: Int
  26 + ): BaseViewHolder<AdapterClassifyBinding> {
  27 + return BaseViewHolder(
  28 + AdapterClassifyBinding.inflate(
  29 + LayoutInflater.from(parent.context),
  30 + parent,
  31 + false
  32 + )
  33 + )
  34 + }
  35 +
  36 + override fun getViewBinding(
  37 + context: Context,
  38 + parent: ViewGroup,
  39 + viewType: Int,
  40 + from: LayoutInflater
  41 + ): AdapterClassifyBinding {
  42 + return AdapterClassifyBinding.inflate(
  43 + from,
  44 + parent,
  45 + false
  46 + )
  47 + }
  48 +}
1 package com.br_technology.securitytrain_master.ui.home.adapter 1 package com.br_technology.securitytrain_master.ui.home.adapter
2 2
  3 +import android.content.Context
  4 +import android.view.LayoutInflater
  5 +import android.view.ViewGroup
3 import com.br_technology.securitytrain_master.base.view.BaseAdapter 6 import com.br_technology.securitytrain_master.base.view.BaseAdapter
4 import com.br_technology.securitytrain_master.databinding.AdapterHistoryBinding 7 import com.br_technology.securitytrain_master.databinding.AdapterHistoryBinding
5 8
@@ -8,9 +11,18 @@ import com.br_technology.securitytrain_master.databinding.AdapterHistoryBinding @@ -8,9 +11,18 @@ import com.br_technology.securitytrain_master.databinding.AdapterHistoryBinding
8 * auth:张继 11 * auth:张继
9 * des: 12 * des:
10 */ 13 */
11 -class HistoryAdapter : BaseAdapter<String, AdapterHistoryBinding>(AdapterHistoryBinding::inflate) { 14 +class HistoryAdapter : BaseAdapter<String, AdapterHistoryBinding>() {
12 15
13 override fun onBind(holder: AdapterHistoryBinding, position: Int, data: String) { 16 override fun onBind(holder: AdapterHistoryBinding, position: Int, data: String) {
14 holder.name.text = data 17 holder.name.text = data
15 } 18 }
  19 +
  20 + override fun getViewBinding(
  21 + context: Context,
  22 + parent: ViewGroup,
  23 + viewType: Int,
  24 + from: LayoutInflater
  25 + ): AdapterHistoryBinding {
  26 + return AdapterHistoryBinding.inflate(from,parent,false)
  27 + }
16 } 28 }
  1 +package com.br_technology.securitytrain_master.ui.home.adapter
  2 +
  3 +import android.content.Context
  4 +import android.view.LayoutInflater
  5 +import android.view.ViewGroup
  6 +import com.br_technology.securitytrain_master.base.view.BaseAdapter
  7 +import com.br_technology.securitytrain_master.base.view.BaseViewHolder
  8 +import com.br_technology.securitytrain_master.databinding.AdapterPdfBinding
  9 +
  10 +/**
  11 + * createTime:2021/7/29 11:19
  12 + * auth:张继
  13 + * des:
  14 + */
  15 +class PdfAdapter:BaseAdapter<String,AdapterPdfBinding>() {
  16 +
  17 + override fun onCreateViewHolder(
  18 + parent: ViewGroup,
  19 + viewType: Int
  20 + ): BaseViewHolder<AdapterPdfBinding> {
  21 + return BaseViewHolder(AdapterPdfBinding.inflate(LayoutInflater.from(parent.context), parent, false))
  22 + }
  23 + override fun onBind(holder: AdapterPdfBinding, position: Int, data: String) {
  24 +
  25 + }
  26 +
  27 + override fun getViewBinding(
  28 + context: Context,
  29 + parent: ViewGroup,
  30 + viewType: Int,
  31 + from: LayoutInflater
  32 + ): AdapterPdfBinding {
  33 + return AdapterPdfBinding.inflate(from,parent,false)
  34 + }
  35 +}
1 package com.br_technology.securitytrain_master.ui.home.adapter 1 package com.br_technology.securitytrain_master.ui.home.adapter
2 2
  3 +import android.content.Context
  4 +import android.view.LayoutInflater
  5 +import android.view.ViewGroup
3 import com.br_technology.securitytrain_master.base.view.BaseAdapter 6 import com.br_technology.securitytrain_master.base.view.BaseAdapter
4 import com.br_technology.securitytrain_master.databinding.AdapterRecommendDataBinding 7 import com.br_technology.securitytrain_master.databinding.AdapterRecommendDataBinding
5 import com.br_technology.securitytrain_master.expand.glideRound 8 import com.br_technology.securitytrain_master.expand.glideRound
@@ -10,11 +13,20 @@ import com.br_technology.securitytrain_master.ui.home.pojo.RecommendData @@ -10,11 +13,20 @@ import com.br_technology.securitytrain_master.ui.home.pojo.RecommendData
10 * auth:张继 13 * auth:张继
11 * des: 14 * des:
12 */ 15 */
13 -class RecommendDataAdapter : BaseAdapter<RecommendData, AdapterRecommendDataBinding>(AdapterRecommendDataBinding::inflate) { 16 +class RecommendDataAdapter : BaseAdapter<RecommendData, AdapterRecommendDataBinding>() {
14 17
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 18 + override fun onBind(holder: AdapterRecommendDataBinding, position: Int, data: RecommendData) {
  19 + holder.pic.glideRound(data.pic, 16)
  20 + holder.name.text = data.name
  21 + holder.info.text = data.info
  22 + }
  23 +
  24 + override fun getViewBinding(
  25 + context: Context,
  26 + parent: ViewGroup,
  27 + viewType: Int,
  28 + from: LayoutInflater
  29 + ): AdapterRecommendDataBinding {
  30 + return AdapterRecommendDataBinding.inflate(from,parent,false)
19 } 31 }
20 } 32 }
@@ -8,7 +8,6 @@ import com.br_technology.securitytrain_master.base.view.BaseViewHolder @@ -8,7 +8,6 @@ import com.br_technology.securitytrain_master.base.view.BaseViewHolder
8 import com.br_technology.securitytrain_master.databinding.AdapterRecommendDataBinding 8 import com.br_technology.securitytrain_master.databinding.AdapterRecommendDataBinding
9 import com.br_technology.securitytrain_master.databinding.LayoutEmptyBinding 9 import com.br_technology.securitytrain_master.databinding.LayoutEmptyBinding
10 import com.br_technology.securitytrain_master.expand.glideRound 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 11 import com.br_technology.securitytrain_master.ui.home.pojo.RecommendData
13 12
14 /** 13 /**
@@ -19,16 +18,12 @@ import com.br_technology.securitytrain_master.ui.home.pojo.RecommendData @@ -19,16 +18,12 @@ import com.br_technology.securitytrain_master.ui.home.pojo.RecommendData
19 class ResultAdapter : BaseMultiAdapter<RecommendData, ViewBinding>() { 18 class ResultAdapter : BaseMultiAdapter<RecommendData, ViewBinding>() {
20 19
21 20
  21 +
22 override fun onBind(holder: ViewBinding, position: Int, data: RecommendData) { 22 override fun onBind(holder: ViewBinding, position: Int, data: RecommendData) {
23 if (holder is AdapterRecommendDataBinding) { 23 if (holder is AdapterRecommendDataBinding) {
24 holder.pic.glideRound(data.pic, 16) 24 holder.pic.glideRound(data.pic, 16)
25 holder.name.text = data.name 25 holder.name.text = data.name
26 holder.info.text = data.info 26 holder.info.text = data.info
27 - // item点击时间  
28 - holder.root.setOnClickListener {  
29 - // 跳转  
30 - startActivity(it.context, DatabaseActivity::class.java)  
31 - }  
32 } 27 }
33 } 28 }
34 29
  1 +package com.br_technology.securitytrain_master.ui.home.adapter
  2 +
  3 +import android.content.Context
  4 +import android.view.LayoutInflater
  5 +import android.view.ViewGroup
  6 +import com.br_technology.securitytrain_master.base.view.BaseAdapter
  7 +import com.br_technology.securitytrain_master.databinding.AdapterCourseTypeBinding
  8 +
  9 +/**
  10 + * createTime:2021/7/29 17:00
  11 + * auth:张继
  12 + * des:
  13 + */
  14 +class TextCourseTypeAdapter : BaseAdapter<String, AdapterCourseTypeBinding>() {
  15 + var index: Int = 0
  16 +
  17 + override fun getViewBinding(
  18 + context: Context,
  19 + parent: ViewGroup,
  20 + viewType: Int,
  21 + from: LayoutInflater
  22 + ): AdapterCourseTypeBinding {
  23 + return AdapterCourseTypeBinding.inflate(from, parent, false)
  24 + }
  25 +
  26 + override fun onBind(holder: AdapterCourseTypeBinding, position: Int, data: String) {
  27 + holder.name.isSelected = position == index
  28 + holder.name.text = data
  29 + }
  30 +}
1 package com.br_technology.securitytrain_master.ui.home.adapter 1 package com.br_technology.securitytrain_master.ui.home.adapter
2 2
  3 +import android.content.Context
  4 +import android.view.LayoutInflater
  5 +import android.view.ViewGroup
3 import com.br_technology.securitytrain_master.base.view.BaseAdapter 6 import com.br_technology.securitytrain_master.base.view.BaseAdapter
4 import com.br_technology.securitytrain_master.databinding.AdapterVideoCourseBinding 7 import com.br_technology.securitytrain_master.databinding.AdapterVideoCourseBinding
5 import com.br_technology.securitytrain_master.expand.courseHead 8 import com.br_technology.securitytrain_master.expand.courseHead
@@ -12,7 +15,7 @@ import com.br_technology.securitytrain_master.ui.home.pojo.VideoCourse @@ -12,7 +15,7 @@ import com.br_technology.securitytrain_master.ui.home.pojo.VideoCourse
12 * des: 15 * des:
13 */ 16 */
14 class VideoCourseAdapter : 17 class VideoCourseAdapter :
15 - BaseAdapter<VideoCourse, AdapterVideoCourseBinding>(AdapterVideoCourseBinding::inflate) { 18 + BaseAdapter<VideoCourse, AdapterVideoCourseBinding>() {
16 19
17 override fun onBind(holder: AdapterVideoCourseBinding, position: Int, data: VideoCourse) { 20 override fun onBind(holder: AdapterVideoCourseBinding, position: Int, data: VideoCourse) {
18 // 视频首贞图片 21 // 视频首贞图片
@@ -24,4 +27,13 @@ class VideoCourseAdapter : @@ -24,4 +27,13 @@ class VideoCourseAdapter :
24 holder.head.courseHead(data.head) 27 holder.head.courseHead(data.head)
25 holder.name.text = data.name 28 holder.name.text = data.name
26 } 29 }
  30 +
  31 + override fun getViewBinding(
  32 + context: Context,
  33 + parent: ViewGroup,
  34 + viewType: Int,
  35 + from: LayoutInflater
  36 + ): AdapterVideoCourseBinding {
  37 + return AdapterVideoCourseBinding.inflate(from, parent, false)
  38 + }
27 } 39 }
1 package com.br_technology.securitytrain_master.ui.home.fragment 1 package com.br_technology.securitytrain_master.ui.home.fragment
2 2
  3 +import android.app.Activity
3 import android.content.Intent 4 import android.content.Intent
4 import android.graphics.Rect 5 import android.graphics.Rect
5 import android.os.Bundle 6 import android.os.Bundle
6 import android.view.LayoutInflater 7 import android.view.LayoutInflater
7 import android.view.View 8 import android.view.View
8 import android.view.ViewGroup 9 import android.view.ViewGroup
  10 +import android.widget.TextView
9 import androidx.fragment.app.Fragment 11 import androidx.fragment.app.Fragment
10 import androidx.recyclerview.widget.RecyclerView 12 import androidx.recyclerview.widget.RecyclerView
11 import com.br_technology.securitytrain_master.R 13 import com.br_technology.securitytrain_master.R
  14 +import com.br_technology.securitytrain_master.ui.home.activity.DatabaseActivity
12 import com.br_technology.securitytrain_master.ui.home.activity.SearchActivity 15 import com.br_technology.securitytrain_master.ui.home.activity.SearchActivity
  16 +import com.br_technology.securitytrain_master.ui.home.activity.TextCourseActivity
13 import com.br_technology.securitytrain_master.ui.home.adapter.RecommendDataAdapter 17 import com.br_technology.securitytrain_master.ui.home.adapter.RecommendDataAdapter
14 import com.br_technology.securitytrain_master.ui.home.adapter.VideoCourseAdapter 18 import com.br_technology.securitytrain_master.ui.home.adapter.VideoCourseAdapter
15 import com.br_technology.securitytrain_master.ui.home.pojo.RecommendData 19 import com.br_technology.securitytrain_master.ui.home.pojo.RecommendData
@@ -50,6 +54,7 @@ class HomeFragment : Fragment() { @@ -50,6 +54,7 @@ class HomeFragment : Fragment() {
50 override fun onViewCreated(view: View, savedInstanceState: Bundle?) { 54 override fun onViewCreated(view: View, savedInstanceState: Bundle?) {
51 super.onViewCreated(view, savedInstanceState) 55 super.onViewCreated(view, savedInstanceState)
52 56
  57 +
53 val banner: Banner<Int, BannerImageAdapter<Int>> = view.findViewById(R.id.banner) 58 val banner: Banner<Int, BannerImageAdapter<Int>> = view.findViewById(R.id.banner)
54 banner.setAdapter(object : BannerImageAdapter<Int>( 59 banner.setAdapter(object : BannerImageAdapter<Int>(
55 mutableListOf( 60 mutableListOf(
@@ -73,6 +78,17 @@ class HomeFragment : Fragment() { @@ -73,6 +78,17 @@ class HomeFragment : Fragment() {
73 }).addBannerLifecycleObserver(this) 78 }).addBannerLifecycleObserver(this)
74 .indicator = CircleIndicator(requireContext()) 79 .indicator = CircleIndicator(requireContext())
75 80
  81 + // 共享资料库
  82 + view.findViewById<TextView>(R.id.database).setOnClickListener {
  83 + startActivity(DatabaseActivity::class.java)
  84 + }
  85 +
  86 + // 共享资料库
  87 + view.findViewById<TextView>(R.id.txt_course).setOnClickListener {
  88 + startActivity(TextCourseActivity::class.java)
  89 + }
  90 +
  91 +
76 // 视频课程 92 // 视频课程
77 val videoCourse: RecyclerView = view.findViewById(R.id.video_course) 93 val videoCourse: RecyclerView = view.findViewById(R.id.video_course)
78 videoCourse.addItemDecoration(object : RecyclerView.ItemDecoration() { 94 videoCourse.addItemDecoration(object : RecyclerView.ItemDecoration() {
@@ -126,4 +142,17 @@ class HomeFragment : Fragment() { @@ -126,4 +142,17 @@ class HomeFragment : Fragment() {
126 startActivity(intent) 142 startActivity(intent)
127 } 143 }
128 } 144 }
  145 +
  146 +
  147 + private fun startActivity(cls: Class<out Activity>) {
  148 + startActivity(cls, null)
  149 + }
  150 +
  151 + private fun startActivity(cls: Class<out Activity>, bundle: Bundle?) {
  152 + val intent = Intent(requireActivity(), cls)
  153 + if (bundle != null) {
  154 + intent.putExtras(bundle)
  155 + }
  156 + startActivity(intent)
  157 + }
129 } 158 }
1 package com.br_technology.securitytrain_master.ui.home.fragment 1 package com.br_technology.securitytrain_master.ui.home.fragment
2 2
  3 +import android.app.Activity
  4 +import android.content.Intent
3 import android.os.Bundle 5 import android.os.Bundle
4 import android.view.LayoutInflater 6 import android.view.LayoutInflater
5 import android.view.View 7 import android.view.View
@@ -8,8 +10,10 @@ import androidx.fragment.app.Fragment @@ -8,8 +10,10 @@ import androidx.fragment.app.Fragment
8 import androidx.recyclerview.widget.RecyclerView 10 import androidx.recyclerview.widget.RecyclerView
9 import com.br_technology.securitytrain_master.R 11 import com.br_technology.securitytrain_master.R
10 import com.br_technology.securitytrain_master.databinding.FragmentResultBinding 12 import com.br_technology.securitytrain_master.databinding.FragmentResultBinding
  13 +import com.br_technology.securitytrain_master.ui.home.activity.DatabaseActivity
11 import com.br_technology.securitytrain_master.ui.home.adapter.ResultAdapter 14 import com.br_technology.securitytrain_master.ui.home.adapter.ResultAdapter
12 import com.br_technology.securitytrain_master.ui.home.pojo.RecommendData 15 import com.br_technology.securitytrain_master.ui.home.pojo.RecommendData
  16 +import com.br_technology.securitytrain_master.view.listener.OnItemClickListener
13 17
14 /** 18 /**
15 * createTime:2021/7/28 15:39 19 * createTime:2021/7/28 15:39
@@ -48,4 +52,5 @@ class ResultFragment : Fragment() { @@ -48,4 +52,5 @@ class ResultFragment : Fragment() {
48 52
49 } 53 }
50 54
  55 +
51 } 56 }
  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 DatabaseDetailRepository(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/29 15:20
  9 + * auth:张继
  10 + * des:
  11 + */
  12 +class TextCourseRepository(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/29 15:20
  9 + * auth:张继
  10 + * des:
  11 + */
  12 +class TextDetailRepository(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.DatabaseDetailRepository
  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 DatabaseDetailViewModel:BaseViewModel<DatabaseDetailRepository>() {
  12 +}
  1 +package com.br_technology.securitytrain_master.ui.home.viewmodel
  2 +
  3 +import com.br_technology.securitytrain_master.ui.home.repository.DatabaseDetailRepository
  4 +import com.br_technology.securitytrain_master.ui.home.repository.TextCourseRepository
  5 +import com.wjx.android.wanandroidmvvm.base.viewmodel.BaseViewModel
  6 +
  7 +/**
  8 + * createTime:2021/7/27 15:48
  9 + * auth:张继
  10 + * des:
  11 + */
  12 +class TextCourseViewModel:BaseViewModel<TextCourseRepository>() {
  13 +}
  1 +package com.br_technology.securitytrain_master.ui.home.viewmodel
  2 +
  3 +import com.br_technology.securitytrain_master.ui.home.repository.TextDetailRepository
  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 TextDetailViewModel:BaseViewModel<TextDetailRepository>() {
  12 +}
@@ -2,11 +2,13 @@ package com.br_technology.securitytrain_master.view @@ -2,11 +2,13 @@ package com.br_technology.securitytrain_master.view
2 2
3 import android.app.Activity 3 import android.app.Activity
4 import android.content.Context 4 import android.content.Context
  5 +import android.graphics.drawable.Drawable
5 import android.util.AttributeSet 6 import android.util.AttributeSet
6 import android.view.LayoutInflater 7 import android.view.LayoutInflater
7 import android.widget.RelativeLayout 8 import android.widget.RelativeLayout
8 import com.br_technology.securitytrain_master.R 9 import com.br_technology.securitytrain_master.R
9 import com.br_technology.securitytrain_master.databinding.BarToolViewBinding 10 import com.br_technology.securitytrain_master.databinding.BarToolViewBinding
  11 +import com.br_technology.securitytrain_master.view.listener.ToolBarClickListener
10 12
11 /** 13 /**
12 * createTime:2021/7/26 17:53 14 * createTime:2021/7/26 17:53
@@ -15,6 +17,9 @@ import com.br_technology.securitytrain_master.databinding.BarToolViewBinding @@ -15,6 +17,9 @@ import com.br_technology.securitytrain_master.databinding.BarToolViewBinding
15 */ 17 */
16 class ViewToolBar(context: Context, attrs: AttributeSet) : RelativeLayout(context, attrs) { 18 class ViewToolBar(context: Context, attrs: AttributeSet) : RelativeLayout(context, attrs) {
17 19
  20 + private var leftClickListener: ToolBarClickListener? = null
  21 + private var rightClickListener: ToolBarClickListener? = null
  22 +
18 private var inflate: BarToolViewBinding = 23 private var inflate: BarToolViewBinding =
19 BarToolViewBinding.inflate(LayoutInflater.from(context), this, true) 24 BarToolViewBinding.inflate(LayoutInflater.from(context), this, true)
20 25
@@ -29,8 +34,17 @@ class ViewToolBar(context: Context, attrs: AttributeSet) : RelativeLayout(contex @@ -29,8 +34,17 @@ class ViewToolBar(context: Context, attrs: AttributeSet) : RelativeLayout(contex
29 inflate.title.text = title 34 inflate.title.text = title
30 35
31 inflate.back.setOnClickListener { 36 inflate.back.setOnClickListener {
32 - (context as Activity).finish() 37 + if (leftClickListener == null) {
  38 + (context as Activity).finish()
  39 + } else {
  40 + leftClickListener?.onClick(it)
  41 + }
  42 + }
  43 + inflate.rightText.setOnClickListener {
  44 + rightClickListener?.onClick(it)
33 } 45 }
  46 +
  47 +
34 } 48 }
35 49
36 fun setBackImg(img: Int) { 50 fun setBackImg(img: Int) {
@@ -41,4 +55,21 @@ class ViewToolBar(context: Context, attrs: AttributeSet) : RelativeLayout(contex @@ -41,4 +55,21 @@ class ViewToolBar(context: Context, attrs: AttributeSet) : RelativeLayout(contex
41 inflate.title.text = text 55 inflate.title.text = text
42 } 56 }
43 57
  58 + fun setRightText(text: String) {
  59 + inflate.rightText.text = text
  60 + }
  61 +
  62 + fun setRightTextDrawable(drawable: Drawable?) {
  63 + drawable?.setBounds(0, 0, drawable.minimumWidth, drawable.minimumHeight);
  64 + inflate.rightText.setCompoundDrawables(null, null, drawable, null);
  65 + }
  66 +
  67 + fun addLeftListener(listener: ToolBarClickListener) {
  68 + this.leftClickListener = listener
  69 + }
  70 +
  71 + fun addRightListener(listener: ToolBarClickListener) {
  72 + this.rightClickListener = listener
  73 + }
  74 +
44 } 75 }
  1 +package com.br_technology.securitytrain_master.view.listener
  2 +
  3 +/**
  4 + * createTime:2021/7/29 9:45
  5 + * auth:张继
  6 + * des:
  7 + */
  8 +interface OnItemClickListener<T> {
  9 + fun onClick(position: Int, data: T)
  10 +}
  1 +package com.br_technology.securitytrain_master.view.listener
  2 +
  3 +import android.view.View
  4 +
  5 +/**
  6 + * createTime:2021/7/29 16:34
  7 + * auth:张继
  8 + * des:
  9 + */
  10 +interface ToolBarClickListener {
  11 + fun onClick(view:View)
  12 +}
  1 +<?xml version="1.0" encoding="utf-8"?>
  2 +<selector xmlns:android="http://schemas.android.com/apk/res/android">
  3 +
  4 + <item android:drawable="@drawable/solid_stroke_25_4_1025" android:state_selected="true" />
  5 + <item android:drawable="@drawable/solid_f2f3_4" />
  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_selected="true" />
  5 + <item android:color="@color/color_64" />
  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="@drawable/solid_25_4" android:state_selected="true" />
  5 + <item android:drawable="@drawable/solid_eff2_4" />
  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/white" android:state_selected="true" />
  5 + <item android:color="@color/color_33" />
  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="#10257CFF" />
  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_eff2" />
  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 + <corners android:radius="4dp" />
  5 + <solid android:color="@color/color_f2f3" />
  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:width="1dp"
  6 + android:color="@color/color_25" />
  7 + <solid android:color="#10257CFF" />
  8 + <corners android:radius="4dp" />
  9 +</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_eb"
  6 + android:width="1dp" />
  7 + <corners android:radius="4dp" />
  8 +</shape>
@@ -7,24 +7,68 @@ @@ -7,24 +7,68 @@
7 7
8 <include layout="@layout/layout_tool_bar" /> 8 <include layout="@layout/layout_tool_bar" />
9 9
10 - <com.google.android.material.tabs.TabLayout  
11 - style="@style/SearchTab" 10 + <RelativeLayout
12 android:layout_width="match_parent" 11 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"> 12 + android:layout_height="?attr/actionBarSize"
  13 + android:orientation="horizontal">
  14 +
  15 + <com.google.android.material.tabs.TabLayout
  16 + android:id="@+id/tab_layout"
  17 + style="@style/SearchTab"
  18 + android:layout_width="match_parent"
  19 + android:layout_height="?actionBarSize"
  20 + android:overScrollMode="never"
  21 + app:tabMode="auto"
  22 + app:tabSelectedTextColor="@color/color_252"
  23 + app:tabTextColor="@color/color_96" />
18 24
19 - <com.google.android.material.tabs.TabItem 25 + <ImageView
  26 + android:id="@+id/back"
20 android:layout_width="wrap_content" 27 android:layout_width="wrap_content"
21 android:layout_height="wrap_content" 28 android:layout_height="wrap_content"
22 - android:text="共享资料库" /> 29 + android:layout_centerVertical="true"
  30 + android:layout_marginStart="16dp"
  31 + android:contentDescription="@string/logo"
  32 + android:src="@mipmap/ic_back" />
  33 + </RelativeLayout>
  34 +
  35 + <androidx.recyclerview.widget.RecyclerView
  36 + android:id="@+id/classify"
  37 + android:layout_width="match_parent"
  38 + android:layout_height="wrap_content"
  39 + android:orientation="horizontal"
  40 + android:overScrollMode="never"
  41 + android:paddingTop="10dp"
  42 + android:paddingBottom="10dp"
  43 + android:scrollbars="none"
  44 + app:layoutManager="androidx.recyclerview.widget.LinearLayoutManager" />
23 45
24 - <com.google.android.material.tabs.TabItem 46 + <FrameLayout
  47 + android:layout_width="match_parent"
  48 + android:layout_height="32dp"
  49 + android:background="@color/color_f2f3">
  50 +
  51 + <TextView
  52 + android:id="@+id/type"
25 android:layout_width="wrap_content" 53 android:layout_width="wrap_content"
26 - android:layout_height="wrap_content"  
27 - android:text="企业资料库" /> 54 + android:layout_height="match_parent"
  55 + android:layout_marginStart="16dp"
  56 + android:drawableEnd="@mipmap/bold_arrow"
  57 + android:drawablePadding="8dp"
  58 + android:gravity="center_vertical"
  59 + android:text="通用知识"
  60 + android:textColor="@color/color_25"
  61 + android:textSize="12sp" />
  62 + </FrameLayout>
28 63
29 - </com.google.android.material.tabs.TabLayout> 64 + <androidx.recyclerview.widget.RecyclerView
  65 + android:id="@+id/database_recycler"
  66 + android:layout_width="match_parent"
  67 + android:layout_height="match_parent"
  68 + android:layout_marginStart="16dp"
  69 + android:layout_marginTop="16dp"
  70 + android:layout_marginEnd="16dp"
  71 + android:overScrollMode="never"
  72 + android:scrollbars="none"
  73 + app:layoutManager="androidx.recyclerview.widget.LinearLayoutManager" />
30 </LinearLayout> 74 </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:gravity="center_vertical"
  14 + android:orientation="horizontal"
  15 + android:paddingStart="16dp"
  16 + android:paddingEnd="16dp">
  17 +
  18 + <ImageView
  19 + android:id="@+id/back"
  20 + android:layout_width="wrap_content"
  21 + android:layout_height="wrap_content"
  22 + android:contentDescription="@string/logo"
  23 + android:src="@mipmap/ic_back" />
  24 +
  25 + <View
  26 + android:layout_width="0dp"
  27 + android:layout_height="match_parent"
  28 + android:layout_weight="1" />
  29 +
  30 + <ImageView
  31 + android:id="@+id/start"
  32 + android:layout_width="wrap_content"
  33 + android:layout_height="match_parent"
  34 + android:src="@mipmap/start_n" />
  35 +
  36 + <ImageView
  37 + android:id="@+id/share"
  38 + android:layout_width="wrap_content"
  39 + android:layout_height="match_parent"
  40 + android:layout_marginStart="16dp"
  41 + android:src="@mipmap/share" />
  42 + </LinearLayout>
  43 +
  44 + <TextView
  45 + android:layout_width="match_parent"
  46 + android:layout_height="wrap_content"
  47 + android:layout_marginStart="16dp"
  48 + android:layout_marginTop="16dp"
  49 + android:layout_marginEnd="16dp"
  50 + android:layout_marginBottom="12dp"
  51 + android:text="课程名称课程名称课程名称课程名称课程名称课程名称课程名称课程名称课程名称课程名称课程名称课程名称"
  52 + android:textColor="@color/color_32"
  53 + android:textSize="17sp" />
  54 +
  55 + <FrameLayout
  56 + android:layout_width="match_parent"
  57 + android:layout_height="wrap_content"
  58 + android:layout_gravity="center"
  59 + android:layout_marginStart="16dp"
  60 + android:layout_marginEnd="16dp">
  61 +
  62 + <ImageView
  63 + android:layout_width="match_parent"
  64 + android:layout_height="match_parent"
  65 + android:scaleType="centerCrop"
  66 + android:src="@mipmap/mask" />
  67 +
  68 + <ImageView
  69 + android:layout_width="wrap_content"
  70 + android:layout_height="wrap_content"
  71 + android:layout_gravity="center"
  72 + android:src="@mipmap/paly" />
  73 + </FrameLayout>
  74 +
  75 + <androidx.core.widget.NestedScrollView
  76 + android:layout_width="match_parent"
  77 + android:layout_height="wrap_content"
  78 + android:layout_marginStart="16dp"
  79 + android:layout_marginEnd="16dp"
  80 + android:overScrollMode="never"
  81 + android:scrollbars="none">
  82 +
  83 + <LinearLayout
  84 + android:layout_width="match_parent"
  85 + android:layout_height="match_parent"
  86 + android:orientation="vertical">
  87 +
  88 + <WebView
  89 + android:id="@+id/web_view"
  90 + android:layout_width="match_parent"
  91 + android:layout_height="wrap_content"
  92 + android:layout_marginTop="24dp"
  93 + android:scrollbars="none"
  94 + android:layout_marginBottom="40dp" />
  95 +
  96 + <androidx.recyclerview.widget.RecyclerView
  97 + android:id="@+id/pdf"
  98 + android:layout_width="match_parent"
  99 + android:layout_height="wrap_content"
  100 + android:nestedScrollingEnabled="false"
  101 + android:overScrollMode="never"
  102 + android:scrollbars="none"
  103 + app:layoutManager="androidx.recyclerview.widget.LinearLayoutManager" />
  104 + </LinearLayout>
  105 + </androidx.core.widget.NestedScrollView>
  106 +</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.br_technology.securitytrain_master.view.ViewToolBar
  11 + android:id="@+id/tool_bar"
  12 + android:layout_width="match_parent"
  13 + android:layout_height="wrap_content"
  14 + app:toolTitle="文本课程" />
  15 +
  16 +
  17 + <RelativeLayout
  18 + android:layout_width="match_parent"
  19 + android:layout_height="match_parent">
  20 +
  21 + <androidx.recyclerview.widget.RecyclerView
  22 + android:id="@+id/course_recycler"
  23 + android:layout_width="match_parent"
  24 + android:layout_height="match_parent"
  25 + android:layout_marginStart="16dp"
  26 + android:layout_marginTop="24dp"
  27 + android:layout_marginEnd="16dp"
  28 + android:overScrollMode="never"
  29 + android:scrollbars="none"
  30 + app:layoutManager="androidx.recyclerview.widget.LinearLayoutManager" />
  31 +
  32 + <LinearLayout
  33 + android:id="@+id/course_type_group"
  34 + android:layout_width="match_parent"
  35 + android:layout_height="match_parent"
  36 + android:orientation="vertical"
  37 + android:visibility="gone">
  38 +
  39 + <LinearLayout
  40 + android:layout_width="match_parent"
  41 + android:layout_height="252dp"
  42 + android:background="@color/white"
  43 + android:orientation="vertical">
  44 +
  45 + <androidx.recyclerview.widget.RecyclerView
  46 + android:id="@+id/course_type"
  47 + android:layout_width="match_parent"
  48 + android:layout_height="0dp"
  49 + android:layout_marginBottom="8dp"
  50 + android:layout_weight="1"
  51 + android:overScrollMode="never"
  52 + android:paddingStart="16dp"
  53 + android:paddingEnd="16dp"
  54 + android:scrollbars="none"
  55 + app:layoutManager="androidx.recyclerview.widget.GridLayoutManager"
  56 + app:spanCount="3" />
  57 +
  58 + <TextView
  59 + android:id="@+id/complete"
  60 + android:layout_width="match_parent"
  61 + android:layout_height="40dp"
  62 + android:layout_margin="16dp"
  63 + android:background="@drawable/solid_25_4"
  64 + android:gravity="center"
  65 + android:text="完成"
  66 + android:textColor="@color/white"
  67 + android:textSize="15sp" />
  68 +
  69 + </LinearLayout>
  70 +
  71 + <View
  72 + android:layout_width="match_parent"
  73 + android:layout_height="0dp"
  74 + android:layout_weight="1"
  75 + android:alpha="0.3"
  76 + android:background="@color/black" />
  77 + </LinearLayout>
  78 +
  79 + </RelativeLayout>
  80 +
  81 +</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="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:id="@+id/tool_bar"
  11 + android:layout_width="match_parent"
  12 + android:layout_height="wrap_content"
  13 + android:layout_below="@id/status_bar" />
  14 +
  15 + <androidx.core.widget.NestedScrollView
  16 + android:layout_width="match_parent"
  17 + android:layout_height="match_parent"
  18 + android:layout_below="@id/tool_bar"
  19 + android:paddingBottom="48dp"
  20 + android:overScrollMode="never"
  21 + android:scrollbars="none">
  22 +
  23 + <LinearLayout
  24 + android:layout_width="match_parent"
  25 + android:layout_height="match_parent"
  26 + android:orientation="vertical">
  27 +
  28 + <TextView
  29 + android:id="@+id/title"
  30 + android:layout_width="match_parent"
  31 + android:layout_height="wrap_content"
  32 + android:layout_marginStart="16dp"
  33 + android:layout_marginTop="20dp"
  34 + android:layout_marginEnd="16dp"
  35 + android:text="Strategy Analytics:2020年全球首次售出超5亿部可穿戴设备"
  36 + android:textColor="@color/color_32"
  37 + android:textSize="26sp" />
  38 +
  39 + <WebView
  40 + android:id="@+id/content"
  41 + android:layout_width="match_parent"
  42 + android:layout_height="match_parent"
  43 + android:layout_marginStart="16dp"
  44 + android:layout_marginTop="16dp"
  45 + android:layout_marginEnd="16dp"
  46 + android:overScrollMode="never"
  47 + android:scrollbars="none" />
  48 + </LinearLayout>
  49 + </androidx.core.widget.NestedScrollView>
  50 +
  51 +
  52 + <TextView
  53 + android:id="@+id/to_problem"
  54 + android:layout_width="match_parent"
  55 + android:layout_height="40dp"
  56 + android:layout_alignParentBottom="true"
  57 + android:layout_marginStart="16dp"
  58 + android:layout_marginEnd="16dp"
  59 + android:layout_marginBottom="8dp"
  60 + android:background="@drawable/solid_25_4"
  61 + android:gravity="center"
  62 + android:text="去做题"
  63 + android:textColor="@color/white"
  64 + android:textSize="15sp" />
  65 +
  66 +</RelativeLayout>
  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 + <WebView
  8 + android:id="@+id/web_view"
  9 + android:layout_width="match_parent"
  10 + android:layout_height="match_parent" />
  11 +</LinearLayout>
  1 +<?xml version="1.0" encoding="utf-8"?>
  2 +<TextView xmlns:android="http://schemas.android.com/apk/res/android"
  3 + android:id="@+id/classify"
  4 + android:layout_width="wrap_content"
  5 + android:layout_height="match_parent"
  6 + android:background="@drawable/classify_text_back"
  7 + android:gravity="center"
  8 + android:paddingStart="16dp"
  9 + android:paddingTop="4dp"
  10 + android:paddingEnd="16dp"
  11 + android:paddingBottom="4dp"
  12 + android:text="@string/logo"
  13 + android:textColor="@drawable/classify_text_color"
  14 + android:textSize="12sp" />
  1 +<?xml version="1.0" encoding="utf-8"?>
  2 +<TextView xmlns:android="http://schemas.android.com/apk/res/android"
  3 + android:id="@+id/name"
  4 + android:layout_width="match_parent"
  5 + android:layout_height="40dp"
  6 + android:background="@drawable/course_type"
  7 + android:gravity="center"
  8 + android:textColor="@drawable/ff_33"
  9 + android:textSize="14sp" />
  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:background="@drawable/stroke_eb_4"
  6 + android:layout_marginBottom="12dp"
  7 + android:orientation="vertical">
  8 +
  9 + <TextView
  10 + android:layout_width="match_parent"
  11 + android:layout_height="wrap_content"
  12 + android:layout_marginStart="12dp"
  13 + android:layout_marginTop="13dp"
  14 + android:drawableStart="@mipmap/pdf"
  15 + android:drawablePadding="8dp"
  16 + android:gravity="center_vertical"
  17 + android:text="三岗专项练习.pdf"
  18 + android:textColor="@color/color_32"
  19 + android:textSize="14sp" />
  20 +
  21 + <TextView
  22 + android:layout_width="59dp"
  23 + android:layout_height="28dp"
  24 + android:layout_gravity="end"
  25 + android:layout_marginTop="8dp"
  26 + android:layout_marginEnd="16dp"
  27 + android:layout_marginBottom="12sp"
  28 + android:background="@drawable/solid_1025_4"
  29 + android:gravity="center"
  30 + android:text="预览"
  31 + android:textColor="@color/color_25"
  32 + android:textSize="12sp" />
  33 +</LinearLayout>
@@ -16,11 +16,19 @@ @@ -16,11 +16,19 @@
16 android:id="@+id/title" 16 android:id="@+id/title"
17 android:layout_width="match_parent" 17 android:layout_width="match_parent"
18 android:layout_height="match_parent" 18 android:layout_height="match_parent"
19 - android:layout_toEndOf="@id/back"  
20 android:gravity="center" 19 android:gravity="center"
21 - android:text="@string/app_name" />  
22 - 20 + android:text="@string/app_name"
  21 + android:textColor="@color/color_33"
  22 + android:textSize="17sp" />
23 23
24 24
  25 + <TextView
  26 + android:id="@+id/right_text"
  27 + android:layout_width="wrap_content"
  28 + android:layout_height="match_parent"
  29 + android:layout_alignParentEnd="true"
  30 + android:layout_marginEnd="16dp"
  31 + android:drawablePadding="8dp"
  32 + android:gravity="center" />
25 33
26 </RelativeLayout> 34 </RelativeLayout>
  1 +<?xml version="1.0" encoding="utf-8"?>
  2 +<TextView xmlns:android="http://schemas.android.com/apk/res/android"
  3 + android:id="@+id/tab_text"
  4 + android:layout_width="wrap_content"
  5 + android:gravity="center_vertical"
  6 + android:layout_height="match_parent"/>
@@ -20,5 +20,8 @@ @@ -20,5 +20,8 @@
20 <color name="color_64">#646566</color> 20 <color name="color_64">#646566</color>
21 <color name="color_252">#25283D</color> 21 <color name="color_252">#25283D</color>
22 <color name="color_f2">#F2F2F5</color> 22 <color name="color_f2">#F2F2F5</color>
  23 + <color name="color_f2f3">#F2F3F5</color>
  24 + <color name="color_33">#333333</color>
  25 + <color name="color_eff2">#EFF2F6</color>
23 26
24 </resources> 27 </resources>
@@ -59,5 +59,10 @@ @@ -59,5 +59,10 @@
59 <item name="tabIndicatorFullWidth">false</item> 59 <item name="tabIndicatorFullWidth">false</item>
60 <item name="tabBackground">@android:color/transparent</item> 60 <item name="tabBackground">@android:color/transparent</item>
61 <item name="tabRippleColor">@android:color/transparent</item> 61 <item name="tabRippleColor">@android:color/transparent</item>
  62 + <item name="tabTextAppearance">@style/MyTabText</item>
  63 + </style>
  64 +
  65 + <style name="MyTabText" parent="TextAppearance.Design.Tab">
  66 + <item name="android:textSize">14sp</item>
62 </style> 67 </style>
63 </resources> 68 </resources>