作者 zhangji

分享二维码页面与我的收藏页面写完

新增recyclerView侧滑删除自定义View
正在显示 41 个修改的文件 包含 1013 行增加51 行删除
@@ -9,7 +9,9 @@ @@ -9,7 +9,9 @@
9 <uses-permission android:name="android.permission.ACCESS_WIFI_STATE" /> 9 <uses-permission android:name="android.permission.ACCESS_WIFI_STATE" />
10 10
11 <!-- 往sdcard中写入数据的权限 --> 11 <!-- 往sdcard中写入数据的权限 -->
12 - <uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE" /> 12 + <uses-permission
  13 + android:name="android.permission.WRITE_EXTERNAL_STORAGE"
  14 + tools:ignore="ScopedStorage" />
13 <!-- 在sdcard中创建/删除文件的权限 --> 15 <!-- 在sdcard中创建/删除文件的权限 -->
14 <uses-permission 16 <uses-permission
15 android:name="android.permission.MOUNT_UNMOUNT_FILESYSTEMS" 17 android:name="android.permission.MOUNT_UNMOUNT_FILESYSTEMS"
@@ -45,7 +47,9 @@ @@ -45,7 +47,9 @@
45 android:value="portrait|landscape" /> 47 android:value="portrait|landscape" />
46 48
47 49
48 - <activity android:name=".ui.login.AccountLoginActivity"> 50 + <activity
  51 + android:name=".ui.login.AccountLoginActivity"
  52 + android:screenOrientation="portrait">
49 <intent-filter> 53 <intent-filter>
50 <action android:name="android.intent.action.MAIN" /> 54 <action android:name="android.intent.action.MAIN" />
51 55
@@ -73,29 +77,50 @@ @@ -73,29 +77,50 @@
73 android:name=".ui.home.activity.DatabaseDetailActivity" 77 android:name=".ui.home.activity.DatabaseDetailActivity"
74 android:configChanges="keyboard|keyboardHidden|orientation|screenSize|screenLayout|smallestScreenSize|uiMode" 78 android:configChanges="keyboard|keyboardHidden|orientation|screenSize|screenLayout|smallestScreenSize|uiMode"
75 android:screenOrientation="portrait" /> 79 android:screenOrientation="portrait" />
76 - <activity android:name=".ui.home.activity.WebViewActivity" />  
77 - <activity android:name=".ui.home.activity.TextCourseActivity" />  
78 - <activity android:name=".ui.home.activity.TextDetailActivity" />  
79 - <activity android:name=".ui.home.activity.OnlineActivity" />  
80 - <activity android:name=".ui.bank.activity.PracticeActivity" />  
81 - <activity android:name=".ui.bank.activity.AnswerSheetActivity" />  
82 - <activity android:name=".ui.bank.activity.ChallengeActivity" />  
83 - <activity android:name=".ui.bank.activity.LeaderboardActivity" />  
84 - <activity android:name=".ui.bank.activity.MockExamActivity" />  
85 - <activity android:name=".ui.bank.activity.ExamTypeActivity" />  
86 - <activity android:name=".ui.bank.activity.ExamDetailActivity" />  
87 - <activity android:name=".ui.bank.activity.ExamCardActivity" /> 80 + <activity android:name=".ui.home.activity.WebViewActivity"
  81 + android:screenOrientation="portrait"/>
  82 + <activity android:name=".ui.home.activity.TextCourseActivity"
  83 + android:screenOrientation="portrait"/>
  84 + <activity android:name=".ui.home.activity.TextDetailActivity"
  85 + android:screenOrientation="portrait"/>
  86 + <activity android:name=".ui.home.activity.OnlineActivity"
  87 + android:screenOrientation="portrait"/>
  88 + <activity android:name=".ui.bank.activity.PracticeActivity"
  89 + android:screenOrientation="portrait"/>
  90 + <activity android:name=".ui.bank.activity.AnswerSheetActivity"
  91 + android:screenOrientation="portrait"/>
  92 + <activity android:name=".ui.bank.activity.ChallengeActivity"
  93 + android:screenOrientation="portrait"/>
  94 + <activity android:name=".ui.bank.activity.LeaderboardActivity"
  95 + android:screenOrientation="portrait"/>
  96 + <activity android:name=".ui.bank.activity.MockExamActivity"
  97 + android:screenOrientation="portrait"/>
  98 + <activity android:name=".ui.bank.activity.ExamTypeActivity"
  99 + android:screenOrientation="portrait"/>
  100 + <activity android:name=".ui.bank.activity.ExamDetailActivity"
  101 + android:screenOrientation="portrait"/>
  102 + <activity android:name=".ui.bank.activity.ExamCardActivity"
  103 + android:screenOrientation="portrait"/>
88 <activity 104 <activity
89 android:name=".ui.home.activity.OnlineDetailActivity" 105 android:name=".ui.home.activity.OnlineDetailActivity"
90 android:configChanges="keyboard|keyboardHidden|orientation|screenSize|screenLayout|smallestScreenSize|uiMode" 106 android:configChanges="keyboard|keyboardHidden|orientation|screenSize|screenLayout|smallestScreenSize|uiMode"
91 android:screenOrientation="portrait" /> 107 android:screenOrientation="portrait" />
92 - <activity android:name=".ui.home.activity.LiveCourseActivity" />  
93 - <activity android:name=".ui.mine.activity.EditPersonalInfoActivity" />  
94 - <activity android:name=".ui.mine.activity.ChangePwdActivity" />  
95 - <activity android:name=".ui.mine.activity.ChangePhoneActivity" />  
96 - <activity android:name=".ui.mine.activity.MyErrorQuestionActivity" />  
97 - <activity android:name=".ui.mine.activity.QuestionRecordActivity" />  
98 - <activity android:name=".ui.mine.activity.MyCredentialsActivity" /> 108 + <activity android:name=".ui.home.activity.LiveCourseActivity"
  109 + android:screenOrientation="portrait"/>
  110 + <activity android:name=".ui.mine.activity.EditPersonalInfoActivity"
  111 + android:screenOrientation="portrait"/>
  112 + <activity android:name=".ui.mine.activity.ChangePwdActivity"
  113 + android:screenOrientation="portrait"/>
  114 + <activity android:name=".ui.mine.activity.ChangePhoneActivity"
  115 + android:screenOrientation="portrait"/>
  116 + <activity android:name=".ui.mine.activity.MyErrorQuestionActivity"
  117 + android:screenOrientation="portrait"/>
  118 + <activity android:name=".ui.mine.activity.QuestionRecordActivity"
  119 + android:screenOrientation="portrait"/>
  120 + <activity android:name=".ui.mine.activity.MyCredentialsActivity"
  121 + android:screenOrientation="portrait"/>
  122 + <activity android:name=".ui.mine.activity.ServiceActivity" />
  123 + <activity android:name=".ui.mine.activity.CollectActivity" />
99 124
100 125
101 </application> 126 </application>
@@ -11,7 +11,7 @@ import com.br_technology.securitytrain_master.databinding.ActivityDatabaseBindin @@ -11,7 +11,7 @@ import com.br_technology.securitytrain_master.databinding.ActivityDatabaseBindin
11 import com.br_technology.securitytrain_master.ui.home.adapter.ClassifyAdapter 11 import com.br_technology.securitytrain_master.ui.home.adapter.ClassifyAdapter
12 import com.br_technology.securitytrain_master.ui.home.adapter.ResultAdapter 12 import com.br_technology.securitytrain_master.ui.home.adapter.ResultAdapter
13 import com.br_technology.securitytrain_master.ui.home.pojo.RecommendData 13 import com.br_technology.securitytrain_master.ui.home.pojo.RecommendData
14 -import com.br_technology.securitytrain_master.ui.home.viewmodel.DatabaseViewModel 14 +import com.br_technology.securitytrain_master.ui.home.viewmodel.DatabaseFViewModel
15 import com.br_technology.securitytrain_master.view.listener.OnItemClickListener 15 import com.br_technology.securitytrain_master.view.listener.OnItemClickListener
16 import com.google.android.material.tabs.TabLayout 16 import com.google.android.material.tabs.TabLayout
17 import com.wjx.android.wanandroidmvvm.base.view.BaseLifeCycleActivity 17 import com.wjx.android.wanandroidmvvm.base.view.BaseLifeCycleActivity
@@ -22,7 +22,7 @@ import com.wjx.android.wanandroidmvvm.base.view.BaseLifeCycleActivity @@ -22,7 +22,7 @@ import com.wjx.android.wanandroidmvvm.base.view.BaseLifeCycleActivity
22 * des: 22 * des:
23 */ 23 */
24 class DatabaseActivity : 24 class DatabaseActivity :
25 - BaseLifeCycleActivity<DatabaseViewModel, ActivityDatabaseBinding>(ActivityDatabaseBinding::inflate) { 25 + BaseLifeCycleActivity<DatabaseFViewModel, ActivityDatabaseBinding>(ActivityDatabaseBinding::inflate) {
26 override fun onCreate(savedInstanceState: Bundle?) { 26 override fun onCreate(savedInstanceState: Bundle?) {
27 super.onCreate(savedInstanceState) 27 super.onCreate(savedInstanceState)
28 28
@@ -9,6 +9,8 @@ import com.br_technology.securitytrain_master.ui.home.adapter.VideoCourseAdapter @@ -9,6 +9,8 @@ import com.br_technology.securitytrain_master.ui.home.adapter.VideoCourseAdapter
9 import com.br_technology.securitytrain_master.ui.home.pojo.RecommendData 9 import com.br_technology.securitytrain_master.ui.home.pojo.RecommendData
10 import com.br_technology.securitytrain_master.ui.home.pojo.VideoCourse 10 import com.br_technology.securitytrain_master.ui.home.pojo.VideoCourse
11 import com.br_technology.securitytrain_master.ui.home.viewmodel.MineViewModel 11 import com.br_technology.securitytrain_master.ui.home.viewmodel.MineViewModel
  12 +import com.br_technology.securitytrain_master.ui.mine.activity.CollectActivity
  13 +import com.br_technology.securitytrain_master.ui.mine.activity.ServiceActivity
12 import com.bumptech.glide.Glide 14 import com.bumptech.glide.Glide
13 import com.bumptech.glide.load.resource.bitmap.RoundedCorners 15 import com.bumptech.glide.load.resource.bitmap.RoundedCorners
14 import com.bumptech.glide.request.RequestOptions 16 import com.bumptech.glide.request.RequestOptions
@@ -35,7 +37,8 @@ class HomeFragment : @@ -35,7 +37,8 @@ class HomeFragment :
35 binding.apply { 37 binding.apply {
36 //搜索 38 //搜索
37 search.setOnClickListener { 39 search.setOnClickListener {
38 - startActivity(SearchActivity::class.java) 40 + startActivity(CollectActivity::class.java)
  41 +// startActivity(SearchActivity::class.java)
39 } 42 }
40 banner.setAdapter(object : BannerImageAdapter<Int>( 43 banner.setAdapter(object : BannerImageAdapter<Int>(
41 mutableListOf( 44 mutableListOf(
@@ -13,26 +13,22 @@ import com.br_technology.securitytrain_master.databinding.FragmentResultBinding @@ -13,26 +13,22 @@ import com.br_technology.securitytrain_master.databinding.FragmentResultBinding
13 import com.br_technology.securitytrain_master.ui.home.activity.DatabaseActivity 13 import com.br_technology.securitytrain_master.ui.home.activity.DatabaseActivity
14 import com.br_technology.securitytrain_master.ui.home.adapter.ResultAdapter 14 import com.br_technology.securitytrain_master.ui.home.adapter.ResultAdapter
15 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.ui.home.viewmodel.ResultViewModel
16 import com.br_technology.securitytrain_master.view.listener.OnItemClickListener 17 import com.br_technology.securitytrain_master.view.listener.OnItemClickListener
  18 +import com.wjx.android.wanandroidmvvm.base.view.BaseLifeCycleFragment
17 19
18 /** 20 /**
19 * createTime:2021/7/28 15:39 21 * createTime:2021/7/28 15:39
20 * auth:张继 22 * auth:张继
21 * des: 23 * des:
22 */ 24 */
23 -class ResultFragment : Fragment() {  
24 -  
25 - override fun onCreateView(  
26 - inflater: LayoutInflater,  
27 - container: ViewGroup?,  
28 - savedInstanceState: Bundle?  
29 - ): View {  
30 - return FragmentResultBinding.inflate(inflater).root  
31 - } 25 +class ResultFragment : BaseLifeCycleFragment<ResultViewModel,FragmentResultBinding>(FragmentResultBinding::inflate) {
  26 +
  27 +
32 28
33 - override fun onViewCreated(view: View, savedInstanceState: Bundle?) {  
34 - super.onViewCreated(view, savedInstanceState)  
35 - val resultRecycler: RecyclerView = view.findViewById(R.id.result) 29 + override fun initData() {
  30 + super.initData()
  31 + binding.apply {
36 val recommendList = mutableListOf( 32 val recommendList = mutableListOf(
37 RecommendData(R.mipmap.banner, "思维导图高分作文法(高中)议论", "从这个角度看,康得在不经意间这样说过,既然我已踏上了这条道路,那么"), 33 RecommendData(R.mipmap.banner, "思维导图高分作文法(高中)议论", "从这个角度看,康得在不经意间这样说过,既然我已踏上了这条道路,那么"),
38 RecommendData(R.mipmap.banner, "思维导图高分作文法(高中)议论", "从这个角度看,康得在不经意间这样说过,既然我已踏上了这条道路,那么"), 34 RecommendData(R.mipmap.banner, "思维导图高分作文法(高中)议论", "从这个角度看,康得在不经意间这样说过,既然我已踏上了这条道路,那么"),
@@ -47,8 +43,11 @@ class ResultFragment : Fragment() { @@ -47,8 +43,11 @@ class ResultFragment : Fragment() {
47 RecommendData(R.mipmap.banner, "思维导图高分作文法(高中)议论", "从这个角度看,康得在不经意间这样说过,既然我已踏上了这条道路,那么"), 43 RecommendData(R.mipmap.banner, "思维导图高分作文法(高中)议论", "从这个角度看,康得在不经意间这样说过,既然我已踏上了这条道路,那么"),
48 ) 44 )
49 val resultAdapter = ResultAdapter() 45 val resultAdapter = ResultAdapter()
50 - resultRecycler.adapter = resultAdapter 46 + result.adapter = resultAdapter
51 resultAdapter.addList(recommendList) 47 resultAdapter.addList(recommendList)
  48 + }
  49 + }
  50 + override fun initDataObserver() {
52 51
53 } 52 }
54 53
  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 ResultRepository(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.HomeRepository
  4 +import com.br_technology.securitytrain_master.ui.home.repository.ResultRepository
  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 ResultViewModel:BaseViewModel<ResultRepository>() {
  13 +}
  1 +package com.br_technology.securitytrain_master.ui.mine.activity
  2 +
  3 +import android.widget.BaseAdapter
  4 +import androidx.fragment.app.FragmentPagerAdapter
  5 +import com.br_technology.securitytrain_master.base.view.BasePagerAdapter
  6 +import com.br_technology.securitytrain_master.databinding.ActivityCollectBinding
  7 +import com.br_technology.securitytrain_master.ui.home.viewmodel.CollectViewModel
  8 +import com.br_technology.securitytrain_master.ui.mine.fragment.CourseFragment
  9 +import com.br_technology.securitytrain_master.ui.mine.fragment.DatabaseFragment
  10 +import com.wjx.android.wanandroidmvvm.base.view.BaseLifeCycleActivity
  11 +
  12 +/**
  13 + * createTime:2021/8/2 16:07
  14 + * auth:张继
  15 + * des: 收藏
  16 + */
  17 +class CollectActivity :
  18 + BaseLifeCycleActivity<CollectViewModel, ActivityCollectBinding>(ActivityCollectBinding::inflate) {
  19 +
  20 + override fun initData() {
  21 + super.initData()
  22 + binding.apply {
  23 +
  24 + val listTitle = listOf(
  25 + "课程",
  26 + "资料",
  27 + )
  28 + val fragments = listOf(
  29 + CourseFragment(), DatabaseFragment()
  30 + )
  31 +
  32 + val basePagerAdapter = BasePagerAdapter(
  33 + supportFragmentManager,
  34 + FragmentPagerAdapter.BEHAVIOR_RESUME_ONLY_CURRENT_FRAGMENT
  35 + )
  36 + basePagerAdapter.addTitle(listTitle)
  37 + basePagerAdapter.addData(fragments)
  38 + viewPager.adapter= basePagerAdapter
  39 + tabLayout.setupWithViewPager(viewPager)
  40 + }
  41 + }
  42 +
  43 + override fun initDataObserver() {
  44 + }
  45 +}
  1 +package com.br_technology.securitytrain_master.ui.mine.activity
  2 +
  3 +import com.br_technology.securitytrain_master.databinding.ActivityServiceBinding
  4 +import com.br_technology.securitytrain_master.ui.home.viewmodel.ServiceViewModel
  5 +import com.wjx.android.wanandroidmvvm.base.view.BaseLifeCycleActivity
  6 +
  7 +/**
  8 + * createTime:2021/8/2 15:29
  9 + * auth:张继
  10 + * des:客服
  11 + */
  12 +class ServiceActivity :
  13 + BaseLifeCycleActivity<ServiceViewModel, ActivityServiceBinding>(ActivityServiceBinding::inflate) {
  14 + override fun initData() {
  15 + super.initData()
  16 +
  17 + binding.apply {
  18 + // 拨打电话
  19 + call.setOnClickListener { }
  20 + // 下载二维码
  21 + download.setOnClickListener { }
  22 + }
  23 + }
  24 +
  25 + override fun initDataObserver() {
  26 +
  27 + }
  28 +}
  1 +package com.br_technology.securitytrain_master.ui.mine.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.AdapterSideslipBinding
  8 +import com.br_technology.securitytrain_master.expand.glideRound
  9 +import com.br_technology.securitytrain_master.ui.home.pojo.RecommendData
  10 +
  11 +/**
  12 + * createTime:2021/8/2 17:48
  13 + * auth:张继
  14 + * des:
  15 + */
  16 +class SideslipAdapter:BaseAdapter<RecommendData,AdapterSideslipBinding>() {
  17 + override fun getViewBinding(
  18 + context: Context,
  19 + parent: ViewGroup,
  20 + viewType: Int,
  21 + from: LayoutInflater
  22 + ): AdapterSideslipBinding {
  23 + return AdapterSideslipBinding.inflate(from,parent,false)
  24 + }
  25 +
  26 + override fun onBind(holder: AdapterSideslipBinding, position: Int, data: RecommendData) {
  27 + holder.pic.glideRound(data.pic, 16)
  28 + holder.name.text = data.name
  29 + holder.info.text = data.info
  30 + }
  31 +}
  1 +package com.br_technology.securitytrain_master.ui.mine.fragment
  2 +
  3 +import com.br_technology.securitytrain_master.R
  4 +import com.br_technology.securitytrain_master.databinding.FragmentCourseBinding
  5 +import com.br_technology.securitytrain_master.ui.home.adapter.ResultAdapter
  6 +import com.br_technology.securitytrain_master.ui.home.pojo.RecommendData
  7 +import com.br_technology.securitytrain_master.ui.home.viewmodel.CourseViewModel
  8 +import com.br_technology.securitytrain_master.ui.mine.adapter.SideslipAdapter
  9 +import com.wjx.android.wanandroidmvvm.base.view.BaseLifeCycleFragment
  10 +
  11 +/**
  12 + * createTime:2021/8/2 16:21
  13 + * auth:张继
  14 + * des:课程
  15 + */
  16 +class CourseFragment :
  17 + BaseLifeCycleFragment<CourseViewModel, FragmentCourseBinding>(FragmentCourseBinding::inflate) {
  18 + override fun initData() {
  19 + super.initData()
  20 + binding.apply {
  21 + val recommendList = mutableListOf(
  22 + RecommendData(
  23 + R.mipmap.banner,
  24 + "思维导图高分作文法(高中)议论",
  25 + "从这个角度看,康得在不经意间这样说过,既然我已踏上了这条道路,那么"
  26 + ),
  27 + RecommendData(
  28 + R.mipmap.banner,
  29 + "思维导图高分作文法(高中)议论",
  30 + "从这个角度看,康得在不经意间这样说过,既然我已踏上了这条道路,那么"
  31 + ),
  32 + RecommendData(
  33 + R.mipmap.banner,
  34 + "思维导图高分作文法(高中)议论",
  35 + "从这个角度看,康得在不经意间这样说过,既然我已踏上了这条道路,那么"
  36 + ),
  37 + RecommendData(
  38 + R.mipmap.banner,
  39 + "思维导图高分作文法(高中)议论",
  40 + "从这个角度看,康得在不经意间这样说过,既然我已踏上了这条道路,那么"
  41 + ),
  42 + RecommendData(
  43 + R.mipmap.banner,
  44 + "思维导图高分作文法(高中)议论",
  45 + "从这个角度看,康得在不经意间这样说过,既然我已踏上了这条道路,那么"
  46 + ),
  47 + RecommendData(
  48 + R.mipmap.banner,
  49 + "思维导图高分作文法(高中)议论",
  50 + "从这个角度看,康得在不经意间这样说过,既然我已踏上了这条道路,那么"
  51 + ),
  52 + RecommendData(
  53 + R.mipmap.banner,
  54 + "思维导图高分作文法(高中)议论",
  55 + "从这个角度看,康得在不经意间这样说过,既然我已踏上了这条道路,那么"
  56 + ),
  57 + RecommendData(
  58 + R.mipmap.banner,
  59 + "思维导图高分作文法(高中)议论",
  60 + "从这个角度看,康得在不经意间这样说过,既然我已踏上了这条道路,那么"
  61 + ),
  62 + RecommendData(
  63 + R.mipmap.banner,
  64 + "思维导图高分作文法(高中)议论",
  65 + "从这个角度看,康得在不经意间这样说过,既然我已踏上了这条道路,那么"
  66 + ),
  67 + RecommendData(
  68 + R.mipmap.banner,
  69 + "思维导图高分作文法(高中)议论",
  70 + "从这个角度看,康得在不经意间这样说过,既然我已踏上了这条道路,那么"
  71 + ),
  72 + RecommendData(
  73 + R.mipmap.banner,
  74 + "思维导图高分作文法(高中)议论",
  75 + "从这个角度看,康得在不经意间这样说过,既然我已踏上了这条道路,那么"
  76 + ),
  77 + )
  78 + val resultAdapter = SideslipAdapter()
  79 + result.adapter = resultAdapter
  80 + resultAdapter.addList(recommendList)
  81 + }
  82 + }
  83 +
  84 + override fun initDataObserver() {
  85 +
  86 + }
  87 +}
  1 +package com.br_technology.securitytrain_master.ui.mine.fragment
  2 +
  3 +import com.br_technology.securitytrain_master.R
  4 +import com.br_technology.securitytrain_master.databinding.FragmentDatabaseBinding
  5 +import com.br_technology.securitytrain_master.ui.home.adapter.ResultAdapter
  6 +import com.br_technology.securitytrain_master.ui.home.pojo.RecommendData
  7 +import com.br_technology.securitytrain_master.ui.home.viewmodel.DatabaseFViewModel
  8 +import com.br_technology.securitytrain_master.ui.mine.adapter.SideslipAdapter
  9 +import com.wjx.android.wanandroidmvvm.base.view.BaseLifeCycleFragment
  10 +
  11 +/**
  12 + * createTime:2021/8/2 16:21
  13 + * auth:张继
  14 + * des:资料
  15 + */
  16 +class DatabaseFragment :BaseLifeCycleFragment<DatabaseFViewModel,FragmentDatabaseBinding>(FragmentDatabaseBinding::inflate){
  17 + override fun initData() {
  18 + super.initData()
  19 + binding.apply {
  20 + val recommendList = mutableListOf(
  21 + RecommendData(
  22 + R.mipmap.banner,
  23 + "思维导图高分作文法(高中)议论",
  24 + "从这个角度看,康得在不经意间这样说过,既然我已踏上了这条道路,那么"
  25 + ),
  26 + RecommendData(
  27 + R.mipmap.banner,
  28 + "思维导图高分作文法(高中)议论",
  29 + "从这个角度看,康得在不经意间这样说过,既然我已踏上了这条道路,那么"
  30 + ),
  31 + RecommendData(
  32 + R.mipmap.banner,
  33 + "思维导图高分作文法(高中)议论",
  34 + "从这个角度看,康得在不经意间这样说过,既然我已踏上了这条道路,那么"
  35 + ),
  36 + RecommendData(
  37 + R.mipmap.banner,
  38 + "思维导图高分作文法(高中)议论",
  39 + "从这个角度看,康得在不经意间这样说过,既然我已踏上了这条道路,那么"
  40 + ),
  41 + RecommendData(
  42 + R.mipmap.banner,
  43 + "思维导图高分作文法(高中)议论",
  44 + "从这个角度看,康得在不经意间这样说过,既然我已踏上了这条道路,那么"
  45 + ),
  46 + RecommendData(
  47 + R.mipmap.banner,
  48 + "思维导图高分作文法(高中)议论",
  49 + "从这个角度看,康得在不经意间这样说过,既然我已踏上了这条道路,那么"
  50 + ),
  51 + RecommendData(
  52 + R.mipmap.banner,
  53 + "思维导图高分作文法(高中)议论",
  54 + "从这个角度看,康得在不经意间这样说过,既然我已踏上了这条道路,那么"
  55 + ),
  56 + RecommendData(
  57 + R.mipmap.banner,
  58 + "思维导图高分作文法(高中)议论",
  59 + "从这个角度看,康得在不经意间这样说过,既然我已踏上了这条道路,那么"
  60 + ),
  61 + RecommendData(
  62 + R.mipmap.banner,
  63 + "思维导图高分作文法(高中)议论",
  64 + "从这个角度看,康得在不经意间这样说过,既然我已踏上了这条道路,那么"
  65 + ),
  66 + RecommendData(
  67 + R.mipmap.banner,
  68 + "思维导图高分作文法(高中)议论",
  69 + "从这个角度看,康得在不经意间这样说过,既然我已踏上了这条道路,那么"
  70 + ),
  71 + RecommendData(
  72 + R.mipmap.banner,
  73 + "思维导图高分作文法(高中)议论",
  74 + "从这个角度看,康得在不经意间这样说过,既然我已踏上了这条道路,那么"
  75 + ),
  76 + )
  77 + val resultAdapter = SideslipAdapter()
  78 + result.adapter = resultAdapter
  79 + resultAdapter.addList(recommendList)
  80 + }
  81 + }
  82 + override fun initDataObserver() {
  83 +
  84 + }
  85 +}
  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 CollectRepository(val loadState: MutableLiveData<State>):ApiRepository() {
  13 +}
  1 +package com.br_technology.securitytrain_master.ui.home.repository
  2 +
  3 +import androidx.lifecycle.MutableLiveData
  4 +import com.br_technology.securitytrain_master.base.common.State
  5 +import com.wjx.android.wanandroidmvvm.base.repository.ApiRepository
  6 +
  7 +/**
  8 + * createTime:2021/7/27 15:49
  9 + * auth:张继
  10 + * des:
  11 + */
  12 +class CourseRepository(val loadState: MutableLiveData<State>):ApiRepository() {
  13 +}
  1 +package com.br_technology.securitytrain_master.ui.home.repository
  2 +
  3 +import androidx.lifecycle.MutableLiveData
  4 +import com.br_technology.securitytrain_master.base.common.State
  5 +import com.wjx.android.wanandroidmvvm.base.repository.ApiRepository
  6 +
  7 +/**
  8 + * createTime:2021/7/27 15:49
  9 + * auth:张继
  10 + * des:
  11 + */
  12 +class DatabaseFRepository(val loadState: MutableLiveData<State>):ApiRepository() {
  13 +}
  1 +package com.br_technology.securitytrain_master.ui.home.repository
  2 +
  3 +import androidx.lifecycle.MutableLiveData
  4 +import com.br_technology.securitytrain_master.base.common.State
  5 +import com.wjx.android.wanandroidmvvm.base.repository.ApiRepository
  6 +
  7 +/**
  8 + * createTime:2021/7/27 15:49
  9 + * auth:张继
  10 + * des:
  11 + */
  12 +class ServiceRepository(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.CollectRepository
  4 +import com.br_technology.securitytrain_master.ui.home.repository.MineRepository
  5 +import com.br_technology.securitytrain_master.ui.home.repository.ServiceRepository
  6 +import com.wjx.android.wanandroidmvvm.base.viewmodel.BaseViewModel
  7 +
  8 +/**
  9 + * createTime:2021/7/27 15:48
  10 + * auth:张继
  11 + * des:
  12 + */
  13 +class CollectViewModel:BaseViewModel<CollectRepository>() {
  14 +}
  1 +package com.br_technology.securitytrain_master.ui.home.viewmodel
  2 +
  3 +import com.br_technology.securitytrain_master.ui.home.repository.CollectRepository
  4 +import com.br_technology.securitytrain_master.ui.home.repository.CourseRepository
  5 +import com.br_technology.securitytrain_master.ui.home.repository.MineRepository
  6 +import com.br_technology.securitytrain_master.ui.home.repository.ServiceRepository
  7 +import com.wjx.android.wanandroidmvvm.base.viewmodel.BaseViewModel
  8 +
  9 +/**
  10 + * createTime:2021/7/27 15:48
  11 + * auth:张继
  12 + * des:
  13 + */
  14 +class CourseViewModel:BaseViewModel<CourseRepository>() {
  15 +}
  1 +package com.br_technology.securitytrain_master.ui.home.viewmodel
  2 +
  3 +import com.br_technology.securitytrain_master.ui.home.repository.CollectRepository
  4 +import com.br_technology.securitytrain_master.ui.home.repository.DatabaseFRepository
  5 +import com.br_technology.securitytrain_master.ui.home.repository.MineRepository
  6 +import com.br_technology.securitytrain_master.ui.home.repository.ServiceRepository
  7 +import com.wjx.android.wanandroidmvvm.base.viewmodel.BaseViewModel
  8 +
  9 +/**
  10 + * createTime:2021/7/27 15:48
  11 + * auth:张继
  12 + * des:
  13 + */
  14 +class DatabaseFViewModel:BaseViewModel<DatabaseFRepository>() {
  15 +}
  1 +package com.br_technology.securitytrain_master.ui.home.viewmodel
  2 +
  3 +import com.br_technology.securitytrain_master.ui.home.repository.MineRepository
  4 +import com.br_technology.securitytrain_master.ui.home.repository.ServiceRepository
  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 ServiceViewModel:BaseViewModel<ServiceRepository>() {
  13 +}
@@ -38,6 +38,12 @@ class MyVideoPlayer : StandardGSYVideoPlayer,LifecycleObserver { @@ -38,6 +38,12 @@ class MyVideoPlayer : StandardGSYVideoPlayer,LifecycleObserver {
38 } 38 }
39 39
40 40
  41 + override fun updateStartImage() {
  42 + super.updateStartImage()
  43 + if (this.startButton is ImageView) {
  44 + (this.startButton as ImageView).setImageResource(R.mipmap.play)
  45 + }
  46 + }
41 /** 47 /**
42 * 选择普通模式 48 * 选择普通模式
43 */ 49 */
  1 +package com.br_technology.securitytrain_master.view
  2 +
  3 +import android.content.Context
  4 +import android.graphics.Rect
  5 +import android.util.AttributeSet
  6 +import android.view.*
  7 +import android.widget.Scroller
  8 +import androidx.annotation.Nullable
  9 +import androidx.recyclerview.widget.LinearLayoutManager
  10 +import androidx.recyclerview.widget.RecyclerView
  11 +
  12 +
  13 +/**
  14 + * createTime:2021/8/2 16:51
  15 + * auth:张继
  16 + * des:
  17 + */
  18 +class SlideRecyclerView : RecyclerView {
  19 + private val TAG = "SlideRecyclerView"
  20 + private val INVALID_POSITION = -1 // 触摸到的点不在子View范围内
  21 +
  22 + private val INVALID_CHILD_WIDTH = -1 // 子ItemView不含两个子View
  23 +
  24 + private val SNAP_VELOCITY = 600 // 最小滑动速度
  25 +
  26 +
  27 + private var mVelocityTracker // 速度追踪器
  28 + : VelocityTracker? = null
  29 + private var mTouchSlop // 认为是滑动的最小距离(一般由系统提供)
  30 + = 0
  31 + private var mTouchFrame // 子View所在的矩形范围
  32 + : Rect? = null
  33 + private var mScroller: Scroller? = null
  34 + private var mLastX // 滑动过程中记录上次触碰点X
  35 + = 0f
  36 + private var mFirstX = 0f
  37 + private var mFirstY = 0f // 首次触碰范围
  38 + private var mIsSlide // 是否滑动子View
  39 + = false
  40 + private var mFlingView // 触碰的子View
  41 + : ViewGroup? = null
  42 + private var mPosition // 触碰的view的位置
  43 + = 0
  44 + private var mMenuViewWidth // 菜单按钮宽度
  45 + = 0
  46 +
  47 + constructor(context: Context) : this(context, null)
  48 +
  49 + constructor(context: Context, @Nullable attrs: AttributeSet?) : this(context, attrs, 0)
  50 +
  51 + constructor(context: Context, @Nullable attrs: AttributeSet?, defStyle: Int) : super(
  52 + context,
  53 + attrs,
  54 + defStyle
  55 + )
  56 +
  57 + init {
  58 + mTouchSlop = ViewConfiguration.get(context).scaledTouchSlop
  59 + mScroller = Scroller(context)
  60 + }
  61 +
  62 + override fun onInterceptTouchEvent(e: MotionEvent): Boolean {
  63 + val x = e.x.toInt()
  64 + val y = e.y.toInt()
  65 + obtainVelocity(e)
  66 + when (e.action) {
  67 + MotionEvent.ACTION_DOWN -> {
  68 + if (!mScroller!!.isFinished) { // 如果动画还没停止,则立即终止动画
  69 + mScroller!!.abortAnimation()
  70 + }
  71 + run {
  72 + mLastX = x.toFloat()
  73 + mFirstX = mLastX
  74 + }
  75 + mFirstY = y.toFloat()
  76 + mPosition = pointToPosition(x, y) // 获取触碰点所在的position
  77 + if (mPosition != INVALID_POSITION) {
  78 + val view: View? = mFlingView
  79 + // 获取触碰点所在的view
  80 + mFlingView =
  81 + getChildAt(mPosition - (layoutManager as LinearLayoutManager?)!!.findFirstVisibleItemPosition()) as ViewGroup
  82 + // 这里判断一下如果之前触碰的view已经打开,而当前碰到的view不是那个view则立即关闭之前的view,此处并不需要担动画没完成冲突,因为之前已经abortAnimation
  83 + if (view != null && mFlingView != view && view.scrollX != 0) {
  84 + view.scrollTo(0, 0)
  85 + }
  86 + // 这里进行了强制的要求,RecyclerView的子ViewGroup必须要有2个子view,这样菜单按钮才会有值,
  87 + // 需要注意的是:如果不定制RecyclerView的子View,则要求子View必须要有固定的width。
  88 + // 比如使用LinearLayout作为根布局,而content部分width已经是match_parent,此时如果菜单view用的是wrap_content,menu的宽度就会为0。
  89 + mMenuViewWidth = if (mFlingView!!.childCount == 2) {
  90 + mFlingView!!.getChildAt(1).width
  91 + } else {
  92 + INVALID_CHILD_WIDTH
  93 + }
  94 + }
  95 + }
  96 + MotionEvent.ACTION_MOVE -> {
  97 + mVelocityTracker!!.computeCurrentVelocity(10000)
  98 + // 此处有俩判断,满足其一则认为是侧滑:
  99 + // 1.如果x方向速度大于y方向速度,且大于最小速度限制;
  100 + // 2.如果x方向的侧滑距离大于y方向滑动距离,且x方向达到最小滑动距离;
  101 + val xVelocity = mVelocityTracker!!.xVelocity
  102 + val yVelocity = mVelocityTracker!!.yVelocity
  103 + if (Math.abs(xVelocity) > SNAP_VELOCITY && Math.abs(xVelocity) > Math.abs(yVelocity)
  104 + || Math.abs(x - mFirstX) >= mTouchSlop
  105 + && Math.abs(x - mFirstX) > Math.abs(y - mFirstY)
  106 + ) {
  107 + mIsSlide = true
  108 + return true
  109 + }
  110 + }
  111 + MotionEvent.ACTION_UP -> releaseVelocity()
  112 + }
  113 + return super.onInterceptTouchEvent(e)
  114 + }
  115 +
  116 + override fun onTouchEvent(e: MotionEvent): Boolean {
  117 + if (mIsSlide && mPosition != INVALID_POSITION) {
  118 + val x = e.x
  119 + obtainVelocity(e)
  120 + when (e.action) {
  121 + MotionEvent.ACTION_DOWN -> {
  122 + }
  123 + MotionEvent.ACTION_MOVE -> // 随手指滑动
  124 + if (mMenuViewWidth != INVALID_CHILD_WIDTH) {
  125 + val dx = mLastX - x
  126 + if (mFlingView!!.scrollX + dx <= mMenuViewWidth
  127 + && mFlingView!!.scrollX + dx > 0
  128 + ) {
  129 + mFlingView!!.scrollBy(dx.toInt(), 0)
  130 + }
  131 + mLastX = x
  132 + }
  133 + MotionEvent.ACTION_UP -> {
  134 + if (mMenuViewWidth != INVALID_CHILD_WIDTH) {
  135 + val scrollX = mFlingView!!.scrollX
  136 + mVelocityTracker!!.computeCurrentVelocity(1000)
  137 + // 此处有两个原因决定是否打开菜单:
  138 + // 1.菜单被拉出宽度大于菜单宽度一半;
  139 + // 2.横向滑动速度大于最小滑动速度;
  140 + // 注意:之所以要小于负值,是因为向左滑则速度为负值
  141 + if (mVelocityTracker!!.xVelocity < -SNAP_VELOCITY) { // 向左侧滑达到侧滑最低速度,则打开
  142 + mScroller!!.startScroll(
  143 + scrollX,
  144 + 0,
  145 + mMenuViewWidth - scrollX,
  146 + 0,
  147 + Math.abs(mMenuViewWidth - scrollX)
  148 + )
  149 + } else if (mVelocityTracker!!.xVelocity >= SNAP_VELOCITY) { // 向右侧滑达到侧滑最低速度,则关闭
  150 + mScroller!!.startScroll(scrollX, 0, -scrollX, 0, Math.abs(scrollX))
  151 + } else if (scrollX >= mMenuViewWidth / 2) { // 如果超过删除按钮一半,则打开
  152 + mScroller!!.startScroll(
  153 + scrollX,
  154 + 0,
  155 + mMenuViewWidth - scrollX,
  156 + 0,
  157 + Math.abs(mMenuViewWidth - scrollX)
  158 + )
  159 + } else { // 其他情况则关闭
  160 + mScroller!!.startScroll(scrollX, 0, -scrollX, 0, Math.abs(scrollX))
  161 + }
  162 + invalidate()
  163 + }
  164 + mMenuViewWidth = INVALID_CHILD_WIDTH
  165 + mIsSlide = false
  166 + mPosition = INVALID_POSITION
  167 + releaseVelocity() // 这里之所以会调用,是因为如果前面拦截了,就不会执行ACTION_UP,需要在这里释放追踪
  168 + }
  169 + }
  170 + return true
  171 + } else {
  172 + // 此处防止RecyclerView正常滑动时,还有菜单未关闭
  173 + closeMenu()
  174 + // Velocity,这里的释放是防止RecyclerView正常拦截了,但是在onTouchEvent中却没有被释放;
  175 + // 有三种情况:1.onInterceptTouchEvent并未拦截,在onInterceptTouchEvent方法中,DOWN和UP一对获取和释放;
  176 + // 2.onInterceptTouchEvent拦截,DOWN获取,但事件不是被侧滑处理,需要在这里进行释放;
  177 + // 3.onInterceptTouchEvent拦截,DOWN获取,事件被侧滑处理,则在onTouchEvent的UP中释放。
  178 + releaseVelocity()
  179 + }
  180 + return super.onTouchEvent(e)
  181 + }
  182 +
  183 + private fun releaseVelocity() {
  184 + if (mVelocityTracker != null) {
  185 + mVelocityTracker!!.clear()
  186 + mVelocityTracker!!.recycle()
  187 + mVelocityTracker = null
  188 + }
  189 + }
  190 +
  191 + private fun obtainVelocity(event: MotionEvent) {
  192 + if (mVelocityTracker == null) {
  193 + mVelocityTracker = VelocityTracker.obtain()
  194 + }
  195 + mVelocityTracker!!.addMovement(event)
  196 + }
  197 +
  198 + private fun pointToPosition(x: Int, y: Int): Int {
  199 + val firstPosition = (layoutManager as LinearLayoutManager?)!!.findFirstVisibleItemPosition()
  200 + var frame: Rect? = mTouchFrame
  201 + if (frame == null) {
  202 + mTouchFrame = Rect()
  203 + frame = mTouchFrame
  204 + }
  205 + val count = childCount
  206 + for (i in count - 1 downTo 0) {
  207 + val child: View = getChildAt(i)
  208 + if (child.visibility == View.VISIBLE) {
  209 + child.getHitRect(frame)
  210 + if (frame!!.contains(x, y)) {
  211 + return firstPosition + i
  212 + }
  213 + }
  214 + }
  215 + return INVALID_POSITION
  216 + }
  217 +
  218 + override fun computeScroll() {
  219 + if (mScroller!!.computeScrollOffset()) {
  220 + mFlingView!!.scrollTo(mScroller!!.currX, mScroller!!.currY)
  221 + invalidate()
  222 + }
  223 + }
  224 +
  225 + /**
  226 + * 将显示子菜单的子view关闭
  227 + * 这里本身是要自己来实现的,但是由于不定制item,因此不好监听器点击事件,因此需要调用者手动的关闭
  228 + */
  229 + fun closeMenu() {
  230 + if (mFlingView != null && mFlingView!!.scrollX != 0) {
  231 + mFlingView!!.scrollTo(0, 0)
  232 + }
  233 + }
  234 +
  235 +
  236 +
  237 +}
@@ -7,6 +7,7 @@ import android.util.AttributeSet @@ -7,6 +7,7 @@ import android.util.AttributeSet
7 import android.view.LayoutInflater 7 import android.view.LayoutInflater
8 import android.widget.RelativeLayout 8 import android.widget.RelativeLayout
9 import androidx.appcompat.widget.Toolbar 9 import androidx.appcompat.widget.Toolbar
  10 +import androidx.core.content.ContextCompat
10 import com.br_technology.securitytrain_master.R 11 import com.br_technology.securitytrain_master.R
11 import com.br_technology.securitytrain_master.databinding.BarToolViewBinding 12 import com.br_technology.securitytrain_master.databinding.BarToolViewBinding
12 import com.br_technology.securitytrain_master.view.listener.ToolBarClickListener 13 import com.br_technology.securitytrain_master.view.listener.ToolBarClickListener
@@ -32,8 +33,9 @@ class ViewToolBar(context: Context, attrs: AttributeSet) : RelativeLayout(contex @@ -32,8 +33,9 @@ class ViewToolBar(context: Context, attrs: AttributeSet) : RelativeLayout(contex
32 } 33 }
33 // 标题文字 34 // 标题文字
34 val title = typedArray.getString(R.styleable.UIToolBar_toolTitle) 35 val title = typedArray.getString(R.styleable.UIToolBar_toolTitle)
  36 + val titleColor = typedArray.getColor(R.styleable.UIToolBar_toolTitleTextColor,ContextCompat.getColor(context,R.color.black))
35 inflate.title.text = title 37 inflate.title.text = title
36 - 38 + inflate.title.setTextColor(titleColor)
37 inflate.back.setOnClickListener { 39 inflate.back.setOnClickListener {
38 if (leftClickListener == null) { 40 if (leftClickListener == null) {
39 (context as Activity).finish() 41 (context as Activity).finish()
  1 +<?xml version="1.0" encoding="utf-8"?>
  2 +<shape xmlns:android="http://schemas.android.com/apk/res/android">
  3 +
  4 + <solid android:color="#40000000" />
  5 + <corners android:radius="9dp" />
  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_e8" />
  5 + <corners android:radius="20dp" />
  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_ff2" />
  5 + <corners android:radius="4dp" />
  6 +</shape>
  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:background="@color/white"
  7 + android:orientation="vertical">
  8 +
  9 + <include layout="@layout/layout_tool_bar" />
  10 +
  11 + <com.br_technology.securitytrain_master.view.ViewToolBar
  12 + android:layout_width="match_parent"
  13 + android:layout_height="wrap_content"
  14 + app:toolTitle="我的收藏" />
  15 +
  16 + <com.google.android.material.tabs.TabLayout
  17 + android:id="@+id/tab_layout"
  18 + style="@style/SearchTab"
  19 + android:layout_width="match_parent"
  20 + android:layout_height="wrap_content" />
  21 +
  22 + <View
  23 + android:layout_width="match_parent"
  24 + android:layout_height="8dp"
  25 + android:background="@color/color_f7" />
  26 +
  27 + <FrameLayout
  28 + android:layout_width="match_parent"
  29 + android:layout_height="32dp"
  30 + android:background="#10257CFF">
  31 +
  32 + <TextView
  33 + android:layout_width="wrap_content"
  34 + android:layout_height="match_parent"
  35 + android:layout_marginStart="16dp"
  36 + android:gravity="center_vertical"
  37 + android:text="左滑可删除通知哦……"
  38 + android:textColor="@color/color_25"
  39 + android:textSize="12sp" />
  40 +
  41 + <ImageView
  42 + android:id="@+id/close"
  43 + android:layout_width="wrap_content"
  44 + android:layout_height="match_parent"
  45 + android:layout_gravity="end|center_vertical"
  46 + android:contentDescription="@string/logo"
  47 + android:paddingStart="16dp"
  48 + android:paddingEnd="16dp"
  49 + android:src="@mipmap/close_blue" />
  50 +
  51 + </FrameLayout>
  52 +
  53 + <com.br_technology.securitytrain_master.view.NoScrollViewPage
  54 + android:id="@+id/view_pager"
  55 + android:layout_width="match_parent"
  56 + android:layout_height="match_parent"
  57 + android:overScrollMode="never"
  58 + android:paddingTop="16dp"
  59 + android:paddingBottom="0dp"
  60 + android:scrollbars="none" />
  61 +
  62 +
  63 +</LinearLayout>
@@ -31,7 +31,7 @@ @@ -31,7 +31,7 @@
31 android:id="@+id/start" 31 android:id="@+id/start"
32 android:layout_width="wrap_content" 32 android:layout_width="wrap_content"
33 android:layout_height="match_parent" 33 android:layout_height="match_parent"
34 - android:src="@mipmap/start_n" /> 34 + android:src="@mipmap/star_black_n" />
35 35
36 <ImageView 36 <ImageView
37 android:id="@+id/share" 37 android:id="@+id/share"
  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:background="@color/color_25"
  7 + android:orientation="vertical">
  8 +
  9 +
  10 + <include layout="@layout/layout_tool_bar" />
  11 +
  12 + <com.br_technology.securitytrain_master.view.ViewToolBar
  13 + android:layout_width="match_parent"
  14 + android:layout_height="wrap_content"
  15 + app:leftImg="@mipmap/ic_back_white"
  16 + app:toolTitle="客服"
  17 + app:toolTitleTextColor="@color/white" />
  18 +
  19 +
  20 + <FrameLayout
  21 + android:layout_width="match_parent"
  22 + android:layout_height="476dp"
  23 + android:layout_margin="40dp">
  24 +
  25 +
  26 + <LinearLayout
  27 + android:layout_width="match_parent"
  28 + android:layout_height="wrap_content"
  29 + android:layout_marginTop="32dp"
  30 + android:background="@drawable/solid_ff_4"
  31 + android:gravity="center_horizontal"
  32 + android:orientation="vertical">
  33 +
  34 +
  35 + <TextView
  36 + android:layout_width="wrap_content"
  37 + android:layout_height="wrap_content"
  38 + android:layout_marginTop="48dp"
  39 + android:text="客服"
  40 + android:textColor="@color/color_22"
  41 + android:textSize="20sp" />
  42 +
  43 + <TextView
  44 + android:layout_width="wrap_content"
  45 + android:layout_height="wrap_content"
  46 + android:layout_marginTop="8dp"
  47 + android:text="添加客服微信,一对一解决您的问题"
  48 + android:textColor="@color/color_87"
  49 + android:textSize="12sp" />
  50 +
  51 + <ImageView
  52 + android:id="@+id/code"
  53 + android:layout_width="196dp"
  54 + android:layout_height="196dp"
  55 + android:src="@mipmap/mask"
  56 + android:scaleType="fitXY"
  57 + android:layout_marginTop="43dp"
  58 + android:layout_marginBottom="40dp"
  59 + android:contentDescription="@string/logo" />
  60 +
  61 + <FrameLayout
  62 + android:id="@+id/call"
  63 + android:layout_width="196dp"
  64 + android:layout_height="40dp"
  65 + android:layout_marginBottom="24dp"
  66 + android:background="@drawable/solid_a2_20">
  67 +
  68 + <TextView
  69 + android:id="@+id/mobile"
  70 + android:layout_width="wrap_content"
  71 + android:layout_height="match_parent"
  72 + android:layout_gravity="center"
  73 + android:drawablePadding="12dp"
  74 + android:gravity="center_vertical"
  75 + android:text="1856547589"
  76 + android:textColor="@color/white"
  77 + android:textSize="16sp"
  78 + app:drawableStartCompat="@mipmap/call" />
  79 + </FrameLayout>
  80 + </LinearLayout>
  81 +
  82 + <ImageView
  83 + android:id="@+id/head"
  84 + android:layout_width="64dp"
  85 + android:layout_height="64dp"
  86 + android:layout_gravity="center_horizontal"
  87 + android:contentDescription="@string/logo"
  88 + android:src="@mipmap/placeholder_head" />
  89 + </FrameLayout>
  90 +
  91 + <TextView
  92 + android:id="@+id/download"
  93 + android:layout_width="wrap_content"
  94 + android:layout_height="wrap_content"
  95 + android:layout_gravity="center_horizontal"
  96 + android:layout_marginTop="16dp"
  97 + android:drawablePadding="12dp"
  98 + android:text="保存在本地"
  99 + android:textColor="@color/white"
  100 + android:textSize="12sp"
  101 + app:drawableTopCompat="@mipmap/download" />
  102 +</LinearLayout>
  1 +<?xml version="1.0" encoding="utf-8"?>
  2 +<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
  3 + android:layout_width="match_parent"
  4 + android:layout_height="wrap_content"
  5 + android:orientation="horizontal">
  6 +
  7 + <LinearLayout
  8 + android:layout_marginEnd="12dp"
  9 + android:layout_width="match_parent"
  10 + android:layout_height="wrap_content"
  11 + android:orientation="vertical">
  12 +
  13 + <LinearLayout
  14 + android:layout_width="match_parent"
  15 + android:layout_height="wrap_content"
  16 + android:orientation="horizontal">
  17 +
  18 + <ImageView
  19 + android:id="@+id/pic"
  20 + android:layout_width="97dp"
  21 + android:layout_height="72dp"
  22 + android:contentDescription="@string/logo"
  23 + android:scaleType="fitXY" />
  24 +
  25 + <LinearLayout
  26 + android:layout_width="match_parent"
  27 + android:layout_height="wrap_content"
  28 + android:layout_marginStart="16dp"
  29 + android:orientation="vertical">
  30 +
  31 + <TextView
  32 + android:id="@+id/name"
  33 + android:layout_width="match_parent"
  34 + android:layout_height="wrap_content"
  35 + android:ellipsize="end"
  36 + android:gravity="center_vertical"
  37 + android:maxLines="1"
  38 + android:minHeight="22dp"
  39 + android:textColor="@color/color_32"
  40 + android:textSize="14sp" />
  41 +
  42 + <TextView
  43 + android:id="@+id/info"
  44 + android:layout_width="match_parent"
  45 + android:layout_height="wrap_content"
  46 + android:layout_marginTop="8dp"
  47 + android:ellipsize="end"
  48 + android:maxLines="2"
  49 + android:textColor="@color/color_96"
  50 + android:textSize="12sp" />
  51 +
  52 + </LinearLayout>
  53 +
  54 + </LinearLayout>
  55 +
  56 + <View
  57 + android:layout_width="match_parent"
  58 + android:layout_height="1dp"
  59 + android:layout_marginTop="15dp"
  60 + android:layout_marginBottom="15dp"
  61 + android:background="@color/color_eb" />
  62 + </LinearLayout>
  63 +
  64 +
  65 + <TextView
  66 + android:id="@+id/delete"
  67 + android:layout_width="52dp"
  68 + android:layout_height="88dp"
  69 + android:background="@drawable/solid_ff2_4"
  70 + android:gravity="center"
  71 + android:text="删除"
  72 + android:textColor="@color/white"
  73 + android:textSize="14sp" />
  74 +</LinearLayout>
  1 +<?xml version="1.0" encoding="utf-8"?>
  2 +<com.br_technology.securitytrain_master.view.SlideRecyclerView xmlns:android="http://schemas.android.com/apk/res/android"
  3 + xmlns:app="http://schemas.android.com/apk/res-auto"
  4 + android:id="@+id/result"
  5 + android:layout_width="match_parent"
  6 + android:layout_height="match_parent"
  7 + android:overScrollMode="never"
  8 + android:paddingStart="16dp"
  9 + android:paddingEnd="16dp"
  10 + android:scrollbars="none"
  11 + app:layoutManager="androidx.recyclerview.widget.LinearLayoutManager" />
  12 +
  1 +<?xml version="1.0" encoding="utf-8"?>
  2 +<com.br_technology.securitytrain_master.view.SlideRecyclerView xmlns:android="http://schemas.android.com/apk/res/android"
  3 + xmlns:app="http://schemas.android.com/apk/res-auto"
  4 + android:id="@+id/result"
  5 + android:layout_width="match_parent"
  6 + android:layout_height="match_parent"
  7 + android:overScrollMode="never"
  8 + android:paddingStart="16dp"
  9 + android:paddingEnd="16dp"
  10 + android:scrollbars="none"
  11 + app:layoutManager="androidx.recyclerview.widget.LinearLayoutManager" />
  12 +
@@ -96,6 +96,7 @@ @@ -96,6 +96,7 @@
96 android:id="@+id/layout_top" 96 android:id="@+id/layout_top"
97 android:layout_width="match_parent" 97 android:layout_width="match_parent"
98 android:layout_height="48dp" 98 android:layout_height="48dp"
  99 + android:layout_marginTop="7dp"
99 android:background="@drawable/video_title_bg" 100 android:background="@drawable/video_title_bg"
100 android:gravity="center_vertical"> 101 android:gravity="center_vertical">
101 102
@@ -105,15 +106,18 @@ @@ -105,15 +106,18 @@
105 android:layout_height="48dp" 106 android:layout_height="48dp"
106 android:paddingLeft="10dp" 107 android:paddingLeft="10dp"
107 android:scaleType="centerInside" 108 android:scaleType="centerInside"
108 - android:src="@drawable/video_back" /> 109 + android:src="@mipmap/ic_back_white" />
109 110
110 <TextView 111 <TextView
111 android:id="@+id/title" 112 android:id="@+id/title"
112 - android:layout_width="wrap_content" 113 + android:layout_width="0dp"
  114 + android:layout_weight="1"
113 android:layout_height="wrap_content" 115 android:layout_height="wrap_content"
114 android:paddingLeft="10dp" 116 android:paddingLeft="10dp"
115 android:textColor="@android:color/white" 117 android:textColor="@android:color/white"
116 android:textSize="18sp" /> 118 android:textSize="18sp" />
  119 +
  120 +
117 </LinearLayout> 121 </LinearLayout>
118 122
119 123
@@ -146,15 +150,5 @@ @@ -146,15 +150,5 @@
146 android:src="@drawable/video_small_close" 150 android:src="@drawable/video_small_close"
147 android:visibility="gone" /> 151 android:visibility="gone" />
148 152
149 - <ImageView  
150 - android:id="@+id/lock_screen"  
151 - android:layout_width="30dp"  
152 - android:layout_height="30dp"  
153 - android:layout_alignParentRight="true"  
154 - android:layout_centerVertical="true"  
155 - android:layout_marginRight="50dp"  
156 - android:scaleType="centerInside"  
157 - android:src="@drawable/unlock"  
158 - android:visibility="gone" />  
159 153
160 </RelativeLayout> 154 </RelativeLayout>
@@ -34,5 +34,9 @@ @@ -34,5 +34,9 @@
34 <color name="color_f7">#F7F8FA</color> 34 <color name="color_f7">#F7F8FA</color>
35 <color name="color_e3">#E3F1FF</color> 35 <color name="color_e3">#E3F1FF</color>
36 <color name="color_dcdee0">#DCDEE0</color> 36 <color name="color_dcdee0">#DCDEE0</color>
  37 + <color name="color_22">#22272B</color>
  38 + <color name="color_87">#879099</color>
  39 + <color name="color_ff2">#FF2F2F</color>
  40 +
37 41
38 </resources> 42 </resources>