作者 zhangji

1、资料库页面已创建

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