作者 zhangji

1、账号登录

2、忘记密码
3、手机号登录
4、首页
5、搜索
以上页面UI与基础逻辑全部写完
6、资料库页面已创建
正在显示 123 个修改的文件 包含 2894 行增加150 行删除
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
<component name="CompilerConfiguration">
<bytecodeTargetLevel target="1.8" />
<bytecodeTargetLevel target="11" />
</component>
</project>
\ No newline at end of file
... ...
... ... @@ -82,4 +82,6 @@ dependencies {
implementation 'com.kingja.loadsir:loadsir:1.3.8'
implementation 'com.android.support:multidex:1.0.3'
implementation 'io.github.youth5201314:banner:2.2.2'
}
\ No newline at end of file
... ...
... ... @@ -2,9 +2,10 @@
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.br_technology.securitytrain_master">
<uses-permission android:name="android.permission.INTERNET"/>
<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" />
<application
android:allowBackup="true"
android:icon="@mipmap/ic_launcher"
... ... @@ -26,20 +27,37 @@
<!--适配华为(huawei)刘海屏-->
<meta-data
android:name="android.notch_support"
android:value="true"/>
android:value="true" />
<!--适配小米(xiaomi)刘海屏-->
<meta-data
android:name="notch.config"
android:value="portrait|landscape" />
<activity android:name=".MainActivity">
<activity android:name=".ui.login.AccountLoginActivity">
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity>
<activity
android:name=".ui.main.MainActivity"
android:screenOrientation="portrait" />
<activity
android:name=".ui.login.ForgetPasswordActivity"
android:screenOrientation="portrait" />
<activity
android:name=".ui.login.MobileLoginActivity"
android:screenOrientation="portrait" />
<activity
android:name=".ui.home.activity.SearchActivity"
android:screenOrientation="portrait" />
<activity android:name=".ui.home.activity.DatabaseActivity" />
</application>
</manifest>
\ No newline at end of file
... ...
package com.br_technology.securitytrain_master
import androidx.appcompat.app.AppCompatActivity
import android.os.Bundle
import android.view.View
import androidx.lifecycle.Observer
import com.br_technology.securitytrain_master.databinding.ActivityMainBinding
import com.br_technology.securitytrain_master.test.TestModel
import com.wjx.android.wanandroidmvvm.base.view.BaseLifeCycleActivity
class MainActivity : BaseLifeCycleActivity<TestModel,ActivityMainBinding>(ActivityMainBinding::inflate),
View.OnClickListener {
override fun onCreate(savedInstanceState: Bundle?) {
super.onCreate(savedInstanceState)
binding.tvTest.setOnClickListener(this)
}
override fun initDataObserver() {
mViewModel.mTestListData.observe(this, Observer { response ->
response.let {
binding.tvName.text = it.result[0].name
}
})
}
override fun onClick(v: View?) {
when(v?.id){
R.id.tv_test ->{
mViewModel.getTestData()
}
}
}
}
\ No newline at end of file
package com.br_technology.securitytrain_master.base.common
import android.app.Service
import android.content.Context
import android.content.Intent
import android.os.Vibrator
import java.lang.reflect.ParameterizedType
/**
... ...
package com.wjx.android.wanandroidmvvm.network
import com.br_technology.securitytrain_master.test.TestResponse
import com.br_technology.securitytrain_master.ui.main.repository.MainRepository
import com.wjx.android.wanandroidmvvm.network.response.BaseResponse
import io.reactivex.Observable
import retrofit2.http.GET
... ... @@ -16,5 +16,5 @@ import retrofit2.http.Query
interface ApiService {
@Headers("apicode:e25d1b2303dc443b8428b08f08400f04")
@GET("apis/dst/collegeInfoQuery/collegeInfoQuery")
fun test(@Query("name") name : String): Observable<BaseResponse<List<TestResponse>>>
fun test(@Query("name") name : String): Observable<BaseResponse<List<MainRepository>>>
}
\ No newline at end of file
... ...
package com.wjx.android.wanandroidmvvm.base.view
import android.app.Activity
import android.content.Context
import android.content.Intent
import android.graphics.Color
import android.os.Build
import android.os.Bundle
... ... @@ -40,7 +42,7 @@ abstract class BaseActivity : AppCompatActivity() {
}
override fun onCreate(savedInstanceState: Bundle?) {
if(Build.VERSION.SDK_INT >= Build.VERSION_CODES.M) {
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.M) {
val modes = window.windowManager.defaultDisplay.supportedModes
modes.sortBy {
it.refreshRate
... ... @@ -62,8 +64,9 @@ abstract class BaseActivity : AppCompatActivity() {
}
// EventBus.getDefault().register(this)
ImmersionBar.with(this).transparentStatusBar() .transparentNavigationBar() //透明导航栏,不写默认黑色(设置此方法,fullScreen()方法自动为true)
.transparentBar().navigationBarDarkIcon(true).init()
ImmersionBar.with(this).transparentStatusBar().init()
// .transparentNavigationBar() //透明导航栏,不写默认黑色(设置此方法,fullScreen()方法自动为true)
// .transparentBar().navigationBarDarkIcon(true)
}
@RequiresApi(Build.VERSION_CODES.M)
... ... @@ -176,4 +179,18 @@ abstract class BaseActivity : AppCompatActivity() {
// fun changeThemeEvent(event: ChangeThemeEvent) {
// initStatusColor(0)
// }
protected fun startActivity(activity: Class<out Activity>) {
startActivity(activity, null)
}
protected fun startActivity(activity: Class<out Activity>, bundle: Bundle?) {
val intent = Intent(this, activity)
if (bundle != null) {
intent.putExtras(bundle)
}
startActivity(intent)
}
}
\ No newline at end of file
... ...
package com.br_technology.securitytrain_master.base.view
import android.view.LayoutInflater
import android.view.View
import android.view.ViewGroup
import androidx.recyclerview.widget.RecyclerView
import androidx.viewbinding.ViewBinding
import java.util.ArrayList
/**
* createTime:2021/7/28 8:44
* auth:张继
* des: 简单列表适配器
*/
abstract class BaseAdapter<T, VB : ViewBinding>(private val inflate: (LayoutInflater) -> VB) :
RecyclerView.Adapter<BaseViewHolder<VB>>() {
private val list: MutableList<T> = ArrayList()
override fun onCreateViewHolder(parent: ViewGroup, viewType: Int): BaseViewHolder<VB> {
return BaseViewHolder(inflate(LayoutInflater.from(parent.context)))
}
override fun onBindViewHolder(holder: BaseViewHolder<VB>, position: Int) {
if (list.isEmpty()) return
onBind(holder.item, position, list[position])
}
abstract fun onBind(holder: VB, position: Int, data: T)
override fun getItemCount(): Int {
return list.size
}
/**
* 添加一条数据
*/
fun addData(t: T) {
list.add(t)
notifyDataSetChanged()
}
/**
* 指定位置添加一条数据
*/
fun addDataAndPosition(t: T, position: Int) {
list.add(position, t)
notifyItemChanged(position)
}
fun addList(t: List<T>) {
val oldPosition = list.size
list.addAll(t)
notifyItemChanged(oldPosition, list.size)
}
fun addListAndPosition(t: List<T>, position: Int) {
list.addAll(position, t)
notifyItemChanged(position, list.size)
}
}
\ No newline at end of file
... ...
... ... @@ -63,10 +63,12 @@ abstract class BaseFragment : Fragment() {
}
if (ColorUtils.calculateLuminance(Color.TRANSPARENT) >= 0.5) {
// 设置状态栏中字体的颜色为黑色
requireActivity().window.decorView.systemUiVisibility = View.SYSTEM_UI_FLAG_LIGHT_STATUS_BAR
requireActivity().window.decorView.systemUiVisibility =
View.SYSTEM_UI_FLAG_LIGHT_STATUS_BAR
} else {
// 跟随系统
requireActivity().window.decorView.systemUiVisibility = View.SYSTEM_UI_FLAG_LAYOUT_STABLE
requireActivity().window.decorView.systemUiVisibility =
View.SYSTEM_UI_FLAG_LAYOUT_STABLE
}
}
... ...
... ... @@ -5,12 +5,15 @@ import android.text.TextUtils
import android.view.LayoutInflater
import android.view.View
import android.widget.Toast
import androidx.appcompat.widget.Toolbar
import androidx.lifecycle.Observer
import androidx.lifecycle.ViewModelProvider
import androidx.viewbinding.ViewBinding
import com.br_technology.securitytrain_master.R
import com.br_technology.securitytrain_master.base.common.CommonUtil
import com.br_technology.securitytrain_master.base.common.State
import com.br_technology.securitytrain_master.base.common.StateType
import com.br_technology.securitytrain_master.expand.statusBarHeight
import com.kingja.loadsir.callback.SuccessCallback
import com.wjx.android.wanandroidmvvm.base.viewmodel.BaseViewModel
import com.wjx.android.wanandroidmvvm.common.callback.EmptyCallBack
... ... @@ -24,7 +27,8 @@ import com.wjx.android.wanandroidmvvm.common.callback.LoadingCallBack
* @date: 2020/02/22
* Time: 16:30
*/
abstract class BaseLifeCycleActivity<VM : BaseViewModel<*>,VB : ViewBinding>(private val inflate: (LayoutInflater) -> VB) : BaseActivity() {
abstract class BaseLifeCycleActivity<VM : BaseViewModel<*>, VB : ViewBinding>(private val inflate: (LayoutInflater) -> VB) :
BaseActivity() {
protected lateinit var mViewModel: VM
lateinit var binding: VB
... ... @@ -34,6 +38,15 @@ abstract class BaseLifeCycleActivity<VM : BaseViewModel<*>,VB : ViewBinding>(pri
}
override fun initView() {
val statusBar: Toolbar? = binding.root.findViewById(R.id.status_bar)
statusBar?.post {
val layoutParams = statusBar.layoutParams
layoutParams.height = statusBar.statusBarHeight()
statusBar.layoutParams = layoutParams
}
showLoading()
mViewModel = ViewModelProvider(this).get(CommonUtil.getClass(this))
... ...
... ... @@ -39,18 +39,18 @@ abstract class BaseLifeCycleFragment<VM : BaseViewModel<*>> : BaseFragment() {
abstract fun initDataObserver()
private fun showLoading() {
loadService.showCallback(LoadingCallBack::class.java)
// loadService.showCallback(LoadingCallBack::class.java)
}
private fun showSuccess() {
loadService.showCallback(SuccessCallback::class.java)
// loadService.showCallback(SuccessCallback::class.java)
}
private fun showError(msg: String) {
if (!TextUtils.isEmpty(msg)) {
Toast.makeText(context, msg, Toast.LENGTH_SHORT).show()
}
loadService.showCallback(ErrorCallBack::class.java)
// loadService.showCallback(ErrorCallBack::class.java)
}
open fun showTip(msg: String) {
... ... @@ -63,11 +63,11 @@ abstract class BaseLifeCycleFragment<VM : BaseViewModel<*>> : BaseFragment() {
// }
// false
// }
loadService.showCallback(SuccessCallback::class.java)
// loadService.showCallback(SuccessCallback::class.java)
}
open fun showEmpty() {
loadService.showCallback(EmptyCallBack::class.java)
// loadService.showCallback(EmptyCallBack::class.java)
}
private val observer by lazy {
... ...
package com.br_technology.securitytrain_master.base.view
import android.app.Activity
import android.content.Context
import android.content.Intent
import android.os.Bundle
import android.view.LayoutInflater
import android.view.View
import android.view.ViewGroup
import androidx.recyclerview.widget.RecyclerView
import androidx.viewbinding.ViewBinding
import java.util.ArrayList
/**
* createTime:2021/7/28 8:44
* auth:张继
* des:多布局适配器
*/
abstract class BaseMultiAdapter<T, VB : ViewBinding> : RecyclerView.Adapter<BaseViewHolder<VB>>() {
protected val list: MutableList<T> = ArrayList()
abstract override fun onCreateViewHolder(parent: ViewGroup, viewType: Int): BaseViewHolder<VB>
override fun onBindViewHolder(holder: BaseViewHolder<VB>, position: Int) {
if (list.isEmpty()) return
onBind(holder.item, position, list[position])
}
abstract fun onBind(holder: VB, position: Int, data: T)
override fun getItemCount(): Int {
return if (list.isEmpty()) {
1
} else {
list.size
}
}
/**
* 添加一条数据
*/
fun addData(t: T) {
list.add(t)
notifyDataSetChanged()
}
/**
* 指定位置添加一条数据
*/
fun addDataAndPosition(t: T, position: Int) {
list.add(position, t)
notifyItemChanged(position)
}
fun addList(t: List<T>) {
val oldPosition = list.size
list.addAll(t)
notifyItemChanged(oldPosition, list.size)
}
fun addListAndPosition(t: List<T>, position: Int) {
list.addAll(position, t)
notifyItemChanged(position, list.size)
}
protected fun startActivity(context: Context, cls: Class<out Activity>) {
startActivity(context, cls, null)
}
protected fun startActivity(context: Context, cls: Class<out Activity>, bundle: Bundle?) {
val intent = Intent(context, cls)
if (bundle != null) {
intent.putExtras(bundle)
}
context.startActivity(intent)
}
}
\ No newline at end of file
... ...
package com.br_technology.securitytrain_master.base.view
import androidx.recyclerview.widget.RecyclerView
import androidx.viewbinding.ViewBinding
/**
* createTime:2021/7/28 8:46
* auth:张继
* des:
*/
class BaseViewHolder<VB:ViewBinding>(val item: VB) : RecyclerView.ViewHolder(item.root) {
}
\ No newline at end of file
... ...
... ... @@ -28,6 +28,7 @@ open class BaseViewModel<T : BaseRepository> : ViewModel() {
.newInstance(loadState)
}
override fun onCleared() {
super.onCleared()
mRepository.unSubscribe()
... ...
package com.br_technology.securitytrain_master.expand
import android.widget.ImageView
import com.br_technology.securitytrain_master.R
import com.bumptech.glide.Glide
import com.bumptech.glide.load.resource.bitmap.RoundedCorners
import com.bumptech.glide.request.RequestOptions
/**
* createTime:2021/7/28 9:56
* auth:张继
* des:
*/
fun ImageView.glideRound(pic: Int, round: Int) {
Glide.with(this)
.load(pic)
.apply(RequestOptions.bitmapTransform(RoundedCorners(round)))
.into(this)
}
fun ImageView.courseHead(pic: String) {
Glide.with(this)
.load(pic)
.placeholder(R.mipmap.placeholder_head)
.into(this)
}
\ No newline at end of file
... ...
package com.br_technology.securitytrain_master
import android.text.Editable
import android.text.TextUtils
import java.util.regex.Pattern
/**
* createTime:2021/7/27 11:46
* auth:张继
* des:
*/
fun Editable.identity(): Boolean {
if (TextUtils.isEmpty(this)) {
return false
}
val regex = "^[1-9]\\d{5}[1-9]\\d{3}((0\\d)|(1[0-2]))(([0|1|2]\\d)|3[0-1])\\d{3}([0-9Xx])$";
return Pattern.matches(regex, this.toString())
}
fun Editable.isPhone(): Boolean {
return !TextUtils.isEmpty(this) && Pattern.matches(
"^1(3[0-9]|4[0-9]|5[0-9]|6[0-9]|7[0-9]|8[0-9]|9[0-9])\\d{8}$",
this
)
}
\ No newline at end of file
... ...
package com.br_technology.securitytrain_master.expand
import android.app.Application
import android.content.Context
import android.graphics.Point
import android.os.Build
import android.view.View
import android.view.WindowManager
/**
* createTime:2021/7/28 11:29
* auth:张继
* des:
*/
fun View.statusBarHeight(): Int {
val resourceId = resources.getIdentifier("status_bar_height", "dimen", "android")
return resources.getDimensionPixelSize(resourceId);
}
fun View.screenWidth(): Int {
val manager: WindowManager = this.context.getSystemService(Context.WINDOW_SERVICE) as WindowManager
val point = Point()
manager.defaultDisplay.getRealSize(point)
return point.x
}
... ...
package com.br_technology.securitytrain_master.test
import androidx.lifecycle.MutableLiveData
import com.wjx.android.wanandroidmvvm.base.viewmodel.BaseViewModel
import com.wjx.android.wanandroidmvvm.network.response.BaseResponse
/**
* Time: 7/26/2021 14:54
* Author: Captain
* Description: 初见时你很迷人
*/
class TestModel : BaseViewModel<TestRepository>(){
val mTestListData: MutableLiveData<BaseResponse<List<TestResponse>>> = MutableLiveData()
fun getTestData(){
mRepository.test(mTestListData)
}
}
\ No newline at end of file
package com.br_technology.securitytrain_master.test
import androidx.lifecycle.MutableLiveData
import com.br_technology.securitytrain_master.base.common.State
import com.wjx.android.wanandroidmvvm.base.observer.BaseObserver
import com.wjx.android.wanandroidmvvm.base.repository.ApiRepository
import com.wjx.android.wanandroidmvvm.network.response.BaseResponse
import io.reactivex.android.schedulers.AndroidSchedulers
import io.reactivex.schedulers.Schedulers
/**
* Time: 7/26/2021 14:55
* Author: Captain
* Description: 初见时你很迷人
*/
class TestRepository(val loadState: MutableLiveData<State>) : ApiRepository() {
fun test(liveData: MutableLiveData<BaseResponse<List<TestResponse>>>) {
apiService.test("北京")
.subscribeOn(Schedulers.io())
.observeOn(AndroidSchedulers.mainThread())
.subscribe(
BaseObserver(
liveData,
loadState,
this
)
)
}
}
\ No newline at end of file
package com.br_technology.securitytrain_master.test
/**
* Time: 7/26/2021 15:03
* Author: Captain
* Description: 初见时你很迷人
*/
data class TestResponse(
var name : String
)
\ No newline at end of file
package com.br_technology.securitytrain_master
package com.br_technology.securitytrain_master.ui
/**
* Time: 7/26/2021 10:11
... ...
package com.br_technology.securitytrain_master.ui.bank
import com.br_technology.securitytrain_master.R
import com.br_technology.securitytrain_master.ui.bank.viewmodel.BankViewModel
import com.wjx.android.wanandroidmvvm.base.view.BaseLifeCycleFragment
/**
* createTime:2021/7/27 15:47
* auth:张继
* des:
*/
class BankFragment :BaseLifeCycleFragment<BankViewModel>() {
override fun initDataObserver() {
}
override fun getLayoutId(): Int {
return R.layout.fragment_bank
}
}
\ No newline at end of file
... ...
package com.br_technology.securitytrain_master.ui.bank.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 BankRepository(val loadState: MutableLiveData<State>):ApiRepository() {
}
\ No newline at end of file
... ...
package com.br_technology.securitytrain_master.ui.bank.viewmodel
import com.br_technology.securitytrain_master.ui.bank.repository.BankRepository
import com.wjx.android.wanandroidmvvm.base.viewmodel.BaseViewModel
/**
* createTime:2021/7/27 15:48
* auth:张继
* des:
*/
class BankViewModel:BaseViewModel<BankRepository>() {
}
\ 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.ActivityDatabaseBinding
import com.br_technology.securitytrain_master.ui.home.viewmodel.DatabaseViewModel
import com.wjx.android.wanandroidmvvm.base.view.BaseLifeCycleActivity
/**
* createTime:2021/7/28 17:41
* auth:张继
* des:
*/
class DatabaseActivity :
BaseLifeCycleActivity<DatabaseViewModel, ActivityDatabaseBinding>(ActivityDatabaseBinding::inflate) {
override fun onCreate(savedInstanceState: Bundle?) {
super.onCreate(savedInstanceState)
}
override fun initDataObserver() {
}
}
\ No newline at end of file
... ...
package com.br_technology.securitytrain_master.ui.home.activity
import android.graphics.drawable.Drawable
import android.os.Bundle
import android.view.MotionEvent
import android.view.View
import android.widget.EditText
import androidx.fragment.app.FragmentPagerAdapter
import com.br_technology.securitytrain_master.databinding.ActivitySearchBinding
import com.br_technology.securitytrain_master.ui.home.adapter.HistoryAdapter
import com.br_technology.securitytrain_master.ui.home.adapter.ResultPagerAdapter
import com.br_technology.securitytrain_master.ui.home.fragment.HomeFragment
import com.br_technology.securitytrain_master.ui.home.fragment.ResultFragment
import com.br_technology.securitytrain_master.ui.home.viewmodel.SearchViewModel
import com.br_technology.securitytrain_master.view.DialogSureCancel
import com.br_technology.securitytrain_master.view.listener.DialogListener
import com.wjx.android.wanandroidmvvm.base.view.BaseLifeCycleActivity
/**
* createTime:2021/7/28 11:13
* auth:张继
* des:
*/
class SearchActivity :
BaseLifeCycleActivity<SearchViewModel, ActivitySearchBinding>(ActivitySearchBinding::inflate) {
override fun onCreate(savedInstanceState: Bundle?) {
super.onCreate(savedInstanceState)
binding.apply {
back.setOnClickListener {
finish()
}
val historyAdapter = HistoryAdapter()
historyRecycler.adapter = historyAdapter
val listOf = listOf(
"历史标签记录历史标签记录历史标签记录历史标签记录",
"历史标签记录",
"历史标签记录",
"d",
"历史标签记录历史标签记录",
"历史标签记录历史标签记录历史标签记录",
"历史标签记录历史标签记录历史标签记录历史标签记录",
)
historyAdapter.addList(listOf)
// 清空历史记录
clear.setOnClickListener {
DialogSureCancel(it.context).setListener(object : DialogListener {
override fun determine() {
// 清空记录
}
}).show()
}
clearEdit.setOnClickListener {
searchEdit.setText("")
}
// 点击搜索按钮
search.setOnClickListener {
// 点击搜索时隐藏历史记录
historyGroup.visibility = View.GONE
historyRecycler.visibility = View.GONE
tabLayout.visibility = View.VISIBLE
viewPager.visibility = View.VISIBLE
}
searchEdit.setOnClickListener {
// 输入框点击时显示历史记录
historyGroup.visibility = View.VISIBLE
historyRecycler.visibility = View.VISIBLE
tabLayout.visibility = View.GONE
viewPager.visibility = View.GONE
}
val searchResultAdapter = ResultPagerAdapter(
supportFragmentManager,
FragmentPagerAdapter.BEHAVIOR_RESUME_ONLY_CURRENT_FRAGMENT
)
val list =
listOf(ResultFragment(), ResultFragment(), ResultFragment(), ResultFragment())
val titles = listOf("在线课程", "直播课程", "文本课程", "资料库")
searchResultAdapter.addData(list)
searchResultAdapter.addTitle(titles)
viewPager.adapter = searchResultAdapter
tabLayout.setupWithViewPager(viewPager)
}
}
override fun initDataObserver() {
}
}
\ No newline at end of file
... ...
package com.br_technology.securitytrain_master.ui.home.adapter
import com.br_technology.securitytrain_master.base.view.BaseAdapter
import com.br_technology.securitytrain_master.databinding.AdapterHistoryBinding
/**
* createTime:2021/7/28 11:50
* auth:张继
* des:
*/
class HistoryAdapter : BaseAdapter<String, AdapterHistoryBinding>(AdapterHistoryBinding::inflate) {
override fun onBind(holder: AdapterHistoryBinding, position: Int, data: String) {
holder.name.text = data
}
}
\ No newline at end of file
... ...
package com.br_technology.securitytrain_master.ui.home.adapter
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
import com.br_technology.securitytrain_master.ui.home.pojo.RecommendData
/**
* createTime:2021/7/28 10:45
* auth:张继
* des:
*/
class RecommendDataAdapter : BaseAdapter<RecommendData, AdapterRecommendDataBinding>(AdapterRecommendDataBinding::inflate) {
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
}
}
\ No newline at end of file
... ...
package com.br_technology.securitytrain_master.ui.home.adapter
import android.view.LayoutInflater
import android.view.ViewGroup
import androidx.viewbinding.ViewBinding
import com.br_technology.securitytrain_master.base.view.BaseMultiAdapter
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
/**
* createTime:2021/7/28 15:45
* auth:张继
* des:
*/
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)
}
}
}
override fun getItemViewType(position: Int): Int {
return if (list.isEmpty()) {
0
} else {
1
}
}
override fun onCreateViewHolder(parent: ViewGroup, viewType: Int): BaseViewHolder<ViewBinding> {
return if (viewType == 0) {
BaseViewHolder(
LayoutEmptyBinding.inflate(
LayoutInflater.from(parent.context),
parent,
false
)
)
} else {
BaseViewHolder(
AdapterRecommendDataBinding.inflate(
LayoutInflater.from(parent.context),
parent,
false
)
)
}
}
}
\ No newline at end of file
... ...
package com.br_technology.securitytrain_master.ui.home.adapter
import android.view.ViewGroup
import androidx.fragment.app.Fragment
import androidx.fragment.app.FragmentManager
import androidx.fragment.app.FragmentPagerAdapter
/**
* createTime:2021/7/28 15:00
* auth:张继
* des:
*/
class ResultPagerAdapter(fm: FragmentManager, behavior: Int) : FragmentPagerAdapter(fm, behavior) {
private val fragments: MutableList<Fragment> = ArrayList()
private val titles: MutableList<String> = ArrayList()
fun addTitle(titles: List<String>) {
this.titles.addAll(titles)
}
fun addData(data: List<Fragment>) {
fragments.addAll(data)
notifyDataSetChanged()
}
override fun getCount(): Int {
return fragments.size
}
override fun getItem(position: Int): Fragment {
return fragments[position]
}
override fun destroyItem(container: ViewGroup, position: Int, `object`: Any) {
// super.destroyItem(container, position, `object`)
}
override fun getPageTitle(position: Int): CharSequence? {
return titles[position]
}
}
\ No newline at end of file
... ...
package com.br_technology.securitytrain_master.ui.home.adapter
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
import com.br_technology.securitytrain_master.expand.glideRound
import com.br_technology.securitytrain_master.ui.home.pojo.VideoCourse
/**
* createTime:2021/7/28 8:42
* auth:张继
* des:
*/
class VideoCourseAdapter :
BaseAdapter<VideoCourse, AdapterVideoCourseBinding>(AdapterVideoCourseBinding::inflate) {
override fun onBind(holder: AdapterVideoCourseBinding, position: Int, data: VideoCourse) {
// 视频首贞图片
holder.videoPic.glideRound(data.pic, 14)
// 课时
holder.lesson.text = data.lesson
// 视频名称
holder.courseName.text = data.courseName
holder.head.courseHead(data.head)
holder.name.text = data.name
}
}
\ No newline at end of file
... ...
package com.br_technology.securitytrain_master.ui.home.fragment
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 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.SearchActivity
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
import com.br_technology.securitytrain_master.ui.home.pojo.VideoCourse
import com.bumptech.glide.Glide
import com.bumptech.glide.load.resource.bitmap.RoundedCorners
import com.bumptech.glide.request.RequestOptions
import com.youth.banner.Banner
import com.youth.banner.adapter.BannerAdapter
import com.youth.banner.adapter.BannerImageAdapter
import com.youth.banner.holder.BannerImageHolder
import com.youth.banner.indicator.CircleIndicator
/**
* createTime:2021/7/27 15:47
* auth:张继
* des:
*/
//class HomeFragment :BaseLifeCycleFragment<MineViewModel>() {
// override fun initDataObserver() {
//
// }
//
// override fun getLayoutId(): Int {
// return R.layout.fragment_home
// }
//}
class HomeFragment : Fragment() {
override fun onCreateView(
inflater: LayoutInflater,
container: ViewGroup?,
savedInstanceState: Bundle?
): View? {
return inflater.inflate(R.layout.fragment_home, container, false)
}
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(
R.mipmap.banner,
R.mipmap.banner,
R.mipmap.banner
)
) {
override fun onBindView(
holder: BannerImageHolder,
data: Int,
position: Int,
size: Int
) {
Glide.with(requireActivity())
.load(data)
.apply(RequestOptions.bitmapTransform(RoundedCorners(8)))
.into(holder.imageView)
}
}).addBannerLifecycleObserver(this)
.indicator = CircleIndicator(requireContext())
// 视频课程
val videoCourse: RecyclerView = view.findViewById(R.id.video_course)
videoCourse.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) % 2 == 0) {
outRect.top = 24
outRect.right = 15
} else {
outRect.top = 24
outRect.left = 15
}
}
})
val videoCourseAdapter = VideoCourseAdapter()
val list = mutableListOf(
VideoCourse(R.mipmap.banner, "10课时", "自动化制作课程", "", "张钧-三岗职位培训班"),
VideoCourse(R.mipmap.banner, "10课时", "自动化制作课程", "", "张钧-三岗职位培训班"),
VideoCourse(R.mipmap.banner, "10课时", "自动化制作课程", "", "张钧-三岗职位培训班"),
VideoCourse(R.mipmap.banner, "10课时", "自动化制作课程", "", "张钧-三岗职位培训班"),
)
videoCourse.adapter = videoCourseAdapter
videoCourseAdapter.addList(list)
val recommendData: RecyclerView = view.findViewById(R.id.recommended_data)
val recommendDataAdapter = RecommendDataAdapter()
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, "思维导图高分作文法(高中)议论", "从这个角度看,康得在不经意间这样说过,既然我已踏上了这条道路,那么"),
)
recommendData.adapter = recommendDataAdapter
recommendDataAdapter.addList(recommendList)
view.findViewById<View>(R.id.search).setOnClickListener {
val intent = Intent(requireActivity(), SearchActivity::class.java)
startActivity(intent)
}
}
}
\ No newline at end of file
... ...
package com.br_technology.securitytrain_master.ui.home.fragment
import android.os.Bundle
import android.view.LayoutInflater
import android.view.View
import android.view.ViewGroup
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.adapter.ResultAdapter
import com.br_technology.securitytrain_master.ui.home.pojo.RecommendData
/**
* createTime:2021/7/28 15:39
* auth:张继
* des:
*/
class ResultFragment : Fragment() {
override fun onCreateView(
inflater: LayoutInflater,
container: ViewGroup?,
savedInstanceState: Bundle?
): View {
return FragmentResultBinding.inflate(inflater).root
}
override fun onViewCreated(view: View, savedInstanceState: Bundle?) {
super.onViewCreated(view, savedInstanceState)
val resultRecycler: RecyclerView = view.findViewById(R.id.result)
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()
resultRecycler.adapter = resultAdapter
resultAdapter.addList(recommendList)
}
}
\ No newline at end of file
... ...
package com.br_technology.securitytrain_master.ui.home.pojo
/**
* createTime:2021/7/28 10:46
* auth:张继
* des:
*/
class RecommendData(
val pic: Int,
var name: String,
var info: String
)
\ No newline at end of file
... ...
package com.br_technology.securitytrain_master.ui.home.pojo
/**
* createTime:2021/7/28 9:19
* auth:张继
* des:
*/
class VideoCourse(
val pic: Int,
val lesson: String,
val courseName:String,
val head:String,
val name:String
)
\ 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 DatabaseRepository(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/27 15:49
* auth:张继
* des:
*/
class HomeRepository(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/27 15:49
* auth:张继
* des:
*/
class SearchRepository(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.DatabaseRepository
import com.wjx.android.wanandroidmvvm.base.viewmodel.BaseViewModel
/**
* createTime:2021/7/27 15:48
* auth:张继
* des:
*/
class DatabaseViewModel:BaseViewModel<DatabaseRepository>() {
}
\ No newline at end of file
... ...
package com.br_technology.securitytrain_master.ui.home.viewmodel
import com.br_technology.securitytrain_master.ui.home.repository.HomeRepository
import com.wjx.android.wanandroidmvvm.base.viewmodel.BaseViewModel
/**
* createTime:2021/7/27 15:48
* auth:张继
* des:
*/
class HomeViewModel:BaseViewModel<HomeRepository>() {
}
\ No newline at end of file
... ...
package com.br_technology.securitytrain_master.ui.home.viewmodel
import com.br_technology.securitytrain_master.ui.home.repository.SearchRepository
import com.wjx.android.wanandroidmvvm.base.viewmodel.BaseViewModel
/**
* createTime:2021/7/27 15:48
* auth:张继
* des:
*/
class SearchViewModel:BaseViewModel<SearchRepository>() {
}
\ No newline at end of file
... ...
package com.br_technology.securitytrain_master.ui.login
import android.os.Bundle
import android.text.TextUtils
import android.text.method.HideReturnsTransformationMethod
import android.text.method.PasswordTransformationMethod
import com.br_technology.securitytrain_master.databinding.ActivityAccountLoginBinding
import com.br_technology.securitytrain_master.identity
import com.br_technology.securitytrain_master.ui.login.viewmode.AccountLoginViewModel
import com.br_technology.securitytrain_master.ui.main.MainActivity
import com.wjx.android.wanandroidmvvm.base.view.BaseLifeCycleActivity
/**
* createTime:2021/7/26 17:29
* auth:张继
* des:
*/
class AccountLoginActivity :
BaseLifeCycleActivity<AccountLoginViewModel, ActivityAccountLoginBinding>(
ActivityAccountLoginBinding::inflate
) {
override fun onCreate(savedInstanceState: Bundle?) {
super.onCreate(savedInstanceState)
binding.apply {
// 登录
login.setOnClickListener {
// val identityNum = identityNumber.text
// val password = password.text
// if (identityNum.identity()) {
// showTip("身份证号码不能为空")
// return@setOnClickListener
// }
// if (TextUtils.isEmpty(password)) {
// showTip("密码格式有误")
// return@setOnClickListener
// }
startActivity(MainActivity::class.java)
// 登录接口
}
// 忘记密码
forgetPassword.setOnClickListener {
startActivity(ForgetPasswordActivity::class.java)
}
// 手机号登陆
mobileLogin.setOnClickListener {
startActivity(MobileLoginActivity::class.java)
}
// 密码可见
display.setOnClickListener {
if (it.isSelected) {// 初始 it.isSelected为false
//设置EditText文本为隐藏的
password.transformationMethod = PasswordTransformationMethod.getInstance();
} else {
//设置EditText文本为可见的
password.transformationMethod = HideReturnsTransformationMethod.getInstance();
}
password.postInvalidate()
it.isSelected = !it.isSelected
password.setSelection(password.length())
}
}
}
override fun initDataObserver() {
}
}
\ No newline at end of file
... ...
package com.br_technology.securitytrain_master.ui.login
import android.os.Bundle
import android.text.TextUtils
import android.text.method.HideReturnsTransformationMethod
import android.text.method.PasswordTransformationMethod
import com.br_technology.securitytrain_master.databinding.ActivityForgetPasswordBinding
import com.br_technology.securitytrain_master.isPhone
import com.br_technology.securitytrain_master.ui.login.viewmode.ForgetPasswordViewModel
import com.wjx.android.wanandroidmvvm.base.view.BaseLifeCycleActivity
/**
* createTime:2021/7/27 11:11
* auth:张继
* des:
*/
class ForgetPasswordActivity :
BaseLifeCycleActivity<ForgetPasswordViewModel, ActivityForgetPasswordBinding>(
ActivityForgetPasswordBinding::inflate
) {
override fun onCreate(savedInstanceState: Bundle?) {
super.onCreate(savedInstanceState)
binding.apply {
// 完成
complete.setOnClickListener {
val mobile = mobile.text
val code = verificationCode.text
val password = password.text
val againPassword = againPassword.text
if (mobile.isPhone()) {
showTip("手机号格式不正确")
return@setOnClickListener
}
if (TextUtils.isEmpty(code)) {
showTip("验证码格式不正确")
return@setOnClickListener
}
if (TextUtils.isEmpty(password) || TextUtils.isEmpty(againPassword)) {
showTip("密码不能为空")
return@setOnClickListener
}
if (password.equals(againPassword)) {
showTip("两次输入的密码不一致")
return@setOnClickListener
}
// 请求接口
}
getVerificationCode.setOnClickListener {
// 获取验证码
if (mobile.text.isPhone()) {
showTip("手机号格式不正确")
return@setOnClickListener
}
// 获取验证码
}
// 密码可见
display.setOnClickListener {
if (it.isSelected) {// 初始 it.isSelected为false
//设置EditText文本为隐藏的
password.transformationMethod = PasswordTransformationMethod.getInstance();
} else {
//设置EditText文本为可见的
password.transformationMethod = HideReturnsTransformationMethod.getInstance();
}
password.postInvalidate()
it.isSelected = !it.isSelected
password.setSelection(password.length())
}
// 密码可见
againDisplay.setOnClickListener {
if (it.isSelected) {// 初始 it.isSelected为false
//设置EditText文本为隐藏的
againPassword.transformationMethod = PasswordTransformationMethod.getInstance();
} else {
//设置EditText文本为可见的
againPassword.transformationMethod =
HideReturnsTransformationMethod.getInstance();
}
againPassword.postInvalidate()
it.isSelected = !it.isSelected
againPassword.setSelection(againPassword.length())
}
}
}
override fun initDataObserver() {
}
}
\ No newline at end of file
... ...
package com.br_technology.securitytrain_master.ui.login
import android.os.Bundle
import android.text.TextUtils
import com.br_technology.securitytrain_master.databinding.ActivityMobileLoginBinding
import com.br_technology.securitytrain_master.isPhone
import com.br_technology.securitytrain_master.ui.login.viewmode.MobileLoginViewModel
import com.wjx.android.wanandroidmvvm.base.view.BaseLifeCycleActivity
/**
* createTime:2021/7/27 14:40
* auth:张继
* des:
*/
class MobileLoginActivity : BaseLifeCycleActivity<MobileLoginViewModel, ActivityMobileLoginBinding>(
ActivityMobileLoginBinding::inflate
) {
override fun onCreate(savedInstanceState: Bundle?) {
super.onCreate(savedInstanceState)
binding.apply {
// 完成
login.setOnClickListener {
val mobile = mobile.text
val code = verificationCode.text
if (mobile.isPhone()) {
showTip("手机号格式不正确")
return@setOnClickListener
}
if (TextUtils.isEmpty(code)) {
showTip("验证码格式不正确")
return@setOnClickListener
}
// 请求接口
}
getVerificationCode.setOnClickListener {
// 获取验证码
if (mobile.text.isPhone()) {
showTip("手机号格式不正确")
return@setOnClickListener
}
// 获取验证码
}
accountLogin.setOnClickListener {
startActivity(AccountLoginActivity::class.java)
}
}
}
override fun initDataObserver() {
}
}
\ No newline at end of file
... ...
package com.br_technology.securitytrain_master.ui.login.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/26 17:30
* auth:张继
* des:
*/
class AccountLoginRepository(val loadState: MutableLiveData<State>):ApiRepository() {
}
\ No newline at end of file
... ...
package com.br_technology.securitytrain_master.ui.login.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/26 17:30
* auth:张继
* des:
*/
class ForgetPasswordRepository(val loadState: MutableLiveData<State>):ApiRepository() {
}
\ No newline at end of file
... ...
package com.br_technology.securitytrain_master.ui.login.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/26 17:30
* auth:张继
* des:
*/
class MobileLoginRepository(val loadState: MutableLiveData<State>):ApiRepository() {
}
\ No newline at end of file
... ...
package com.br_technology.securitytrain_master.ui.login.viewmode
import com.br_technology.securitytrain_master.ui.login.repository.AccountLoginRepository
import com.wjx.android.wanandroidmvvm.base.viewmodel.BaseViewModel
/**
* createTime:2021/7/26 17:29
* auth:张继
* des:
*/
class AccountLoginViewModel() : BaseViewModel<AccountLoginRepository>() {
}
\ No newline at end of file
... ...
package com.br_technology.securitytrain_master.ui.login.viewmode
import com.br_technology.securitytrain_master.ui.login.repository.ForgetPasswordRepository
import com.wjx.android.wanandroidmvvm.base.viewmodel.BaseViewModel
/**
* createTime:2021/7/27 11:11
* auth:张继
* des:
*/
class ForgetPasswordViewModel : BaseViewModel<ForgetPasswordRepository>() {
}
\ No newline at end of file
... ...
package com.br_technology.securitytrain_master.ui.login.viewmode
import com.br_technology.securitytrain_master.ui.login.repository.MobileLoginRepository
import com.wjx.android.wanandroidmvvm.base.viewmodel.BaseViewModel
/**
* createTime:2021/7/27 14:44
* auth:张继
* des:
*/
class MobileLoginViewModel:BaseViewModel<MobileLoginRepository>() {
}
\ No newline at end of file
... ...
package com.br_technology.securitytrain_master.ui.main
import android.os.Bundle
import androidx.fragment.app.FragmentPagerAdapter
import com.br_technology.securitytrain_master.R
import com.br_technology.securitytrain_master.databinding.ActivityMainBinding
import com.br_technology.securitytrain_master.ui.bank.BankFragment
import com.br_technology.securitytrain_master.ui.home.fragment.HomeFragment
import com.br_technology.securitytrain_master.ui.home.MineFragment
import com.br_technology.securitytrain_master.ui.main.viewmodel.MainViewModel
import com.gyf.immersionbar.ImmersionBar
import com.wjx.android.wanandroidmvvm.base.view.BaseLifeCycleActivity
class MainActivity :
BaseLifeCycleActivity<MainViewModel, ActivityMainBinding>(ActivityMainBinding::inflate) {
// private lateinit var mainAdapter: MainAdapter
override fun onCreate(savedInstanceState: Bundle?) {
super.onCreate(savedInstanceState)
ImmersionBar.with(this).statusBarColor(R.color.color_25).init()
val list = listOf(HomeFragment(), BankFragment(), MineFragment())
// 初始化适配器
val mainAdapter = MainAdapter(
supportFragmentManager,
FragmentPagerAdapter.BEHAVIOR_RESUME_ONLY_CURRENT_FRAGMENT
)
binding.apply {
viewPage.adapter = mainAdapter
mainAdapter.addData(list)
viewPage.offscreenPageLimit = 1
home.isChecked = true
home.setOnClickListener {
viewPage.currentItem = 0
}
questionBank.setOnClickListener {
viewPage.currentItem = 1
}
mine.setOnClickListener {
viewPage.currentItem = 2
}
}
}
override fun initDataObserver() {
// mViewModel.liveData.observe(this) {
// mainAdapter.addData(it)
// }
}
}
\ No newline at end of file
... ...
package com.br_technology.securitytrain_master.ui.main
import android.view.ViewGroup
import androidx.fragment.app.Fragment
import androidx.fragment.app.FragmentManager
import androidx.fragment.app.FragmentPagerAdapter
/**
* createTime:2021/7/27 16:04
* auth:张继
* des:
*/
class MainAdapter(manager: FragmentManager, behavior: Int) :
FragmentPagerAdapter(manager, behavior) {
private var fragments: MutableList<Fragment> = ArrayList()
fun addData(data: List<Fragment>) {
fragments.addAll(data)
notifyDataSetChanged()
}
override fun getCount(): Int {
return fragments.size
}
override fun getItem(position: Int): Fragment {
return fragments[position]
}
override fun destroyItem(container: ViewGroup, position: Int, `object`: Any) {
// super.destroyItem(container, position, `object`)
}
}
\ No newline at end of file
... ...
package com.br_technology.securitytrain_master.ui.main.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 14:51
* auth:张继
* des:
*/
class MainRepository(val loadState: MutableLiveData<State>):ApiRepository() {
}
\ No newline at end of file
... ...
package com.br_technology.securitytrain_master.ui.main.viewmodel
import androidx.fragment.app.Fragment
import androidx.lifecycle.MutableLiveData
import com.br_technology.securitytrain_master.ui.bank.BankFragment
import com.br_technology.securitytrain_master.ui.home.fragment.HomeFragment
import com.br_technology.securitytrain_master.ui.home.MineFragment
import com.br_technology.securitytrain_master.ui.main.repository.MainRepository
import com.wjx.android.wanandroidmvvm.base.viewmodel.BaseViewModel
/**
* createTime:2021/7/27 14:51
* auth:张继
* des:
*/
class MainViewModel:BaseViewModel<MainRepository>() {
val liveData:MutableLiveData<List<Fragment>> by lazy {
MutableLiveData()
}
init {
val list= listOf(HomeFragment(),BankFragment(),MineFragment())
liveData.postValue(list)
}
}
\ No newline at end of file
... ...
package com.br_technology.securitytrain_master.ui.home
import com.br_technology.securitytrain_master.R
import com.br_technology.securitytrain_master.ui.home.viewmodel.MineViewModel
import com.wjx.android.wanandroidmvvm.base.view.BaseLifeCycleFragment
/**
* createTime:2021/7/27 15:47
* auth:张继
* des:
*/
class MineFragment :BaseLifeCycleFragment<MineViewModel>() {
override fun initDataObserver() {
}
override fun getLayoutId(): Int {
return R.layout.fragment_mine
}
}
\ 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 MineRepository(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.MineRepository
import com.wjx.android.wanandroidmvvm.base.viewmodel.BaseViewModel
/**
* createTime:2021/7/27 15:48
* auth:张继
* des:
*/
class MineViewModel:BaseViewModel<MineRepository>() {
}
\ No newline at end of file
... ...
... ... @@ -31,6 +31,8 @@ class AppManager {
activityStack.remove(activity)
}
private fun finishAllActivity() {
for(activity in activityStack) {
activity.finish()
... ...
package com.br_technology.securitytrain_master.view
import android.app.Dialog
import android.content.Context
import android.os.Bundle
import android.view.LayoutInflater
import com.br_technology.securitytrain_master.R
import com.br_technology.securitytrain_master.databinding.DialogSureCancelBinding
import com.br_technology.securitytrain_master.expand.screenWidth
import com.br_technology.securitytrain_master.view.listener.DialogListener
/**
* createTime:2021/7/28 13:45
* auth:张继
* des:
*/
class DialogSureCancel(context: Context) : Dialog(context, R.style.UserDefaultDialog) {
private var listener: DialogListener? = null
override fun onCreate(savedInstanceState: Bundle?) {
super.onCreate(savedInstanceState)
val inflate = DialogSureCancelBinding.inflate(LayoutInflater.from(context))
setContentView(inflate.root)
val attributes = window?.attributes
attributes?.width = inflate.root.screenWidth() - 160
// 点击区域外不取消
setCanceledOnTouchOutside(false)
inflate.apply {
// 取消
cancel.setOnClickListener {
dismiss()
}
// 确定
determine.setOnClickListener {
listener?.determine()
}
}
}
fun setListener(listener: DialogListener):DialogSureCancel {
this.listener = listener
return this
}
}
\ No newline at end of file
... ...
package com.br_technology.securitytrain_master.view
import android.content.Context
import android.util.AttributeSet
import android.view.MotionEvent
import androidx.viewpager.widget.ViewPager
/**
* createTime:2021/7/26 17:29
* auth:张继
* des:
*/
class NoScrollViewPage : ViewPager {
// true禁止滑动 false允许滑动
var isSlidingEnable: Boolean = true
constructor(context: Context) : super(context)
constructor(context: Context, attrs: AttributeSet?) : super(context, attrs)
override fun scrollTo(x: Int, y: Int) {
super.scrollTo(x, y)
}
override fun setCurrentItem(item: Int) {
super.setCurrentItem(item)
}
override fun setCurrentItem(item: Int, smoothScroll: Boolean) {
super.setCurrentItem(item, smoothScroll)
}
override fun onTouchEvent(ev: MotionEvent?): Boolean {
return if (isSlidingEnable) {
false
} else {
super.onTouchEvent(ev)
}
}
override fun onInterceptTouchEvent(ev: MotionEvent?): Boolean {
return if (isSlidingEnable) {
false
} else {
super.onInterceptTouchEvent(ev)
}
}
}
\ No newline at end of file
... ...
package com.br_technology.securitytrain_master.view
import android.app.Activity
import android.content.Context
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
/**
* createTime:2021/7/26 17:53
* auth:张继
* des:
*/
class ViewToolBar(context: Context, attrs: AttributeSet) : RelativeLayout(context, attrs) {
private var inflate: BarToolViewBinding =
BarToolViewBinding.inflate(LayoutInflater.from(context), this, true)
init {
val typedArray = context.obtainStyledAttributes(attrs, R.styleable.UIToolBar)
val leftImg = typedArray.getResourceId(R.styleable.UIToolBar_leftImg, R.mipmap.ic_back)
if (leftImg != -1) {
inflate.back.setImageResource(leftImg)
}
// 标题文字
val title = typedArray.getString(R.styleable.UIToolBar_toolTitle)
inflate.title.text = title
inflate.back.setOnClickListener {
(context as Activity).finish()
}
}
fun setBackImg(img: Int) {
inflate.back.setImageResource(img)
}
fun setTitle(text: String) {
inflate.title.text = text
}
}
\ No newline at end of file
... ...
package com.br_technology.securitytrain_master.view.listener
/**
* createTime:2021/7/28 14:35
* auth:张继
* des:
*/
interface DialogListener {
fun determine()
}
\ No newline at end of file
... ...
<?xml version="1.0" encoding="utf-8"?>
<layer-list xmlns:android="http://schemas.android.com/apk/res/android">
<item
android:width="12dp"
android:height="3dp"
android:gravity="center_horizontal">
<shape>
<gradient
android:endColor="#6096EA"
android:startColor="@color/color_25"
android:type="linear" />
</shape>
</item>
</layer-list>
\ 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="@color/color_25" android:state_selected="true" />
<item android:drawable="@drawable/solid_25_4_69f" />
</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="@mipmap/question_bank_y" android:state_checked="true" />
<item android:drawable="@mipmap/question_bank_n" />
</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="@mipmap/home_y" android:state_checked="true" />
<item android:drawable="@mipmap/home_n" />
</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="@mipmap/mine_y" android:state_checked="true" />
<item android:drawable="@mipmap/mine_n" />
</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_checked="true" />
<item android:color="@color/color_96" />
</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="@mipmap/ic_eye_y" android:state_selected="true" />
<item android:drawable="@mipmap/ic_eye_n" />
</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="#50FFFFFF" />
<stroke
android:color="#80FFFFFF"
android:width="1dp" />
<corners android:radius="30dp" />
</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_25" />
<corners android:radius="4dp" />
</shape>
\ No newline at end of file
... ...
<?xml version="1.0" encoding="utf-8"?>
<layer-list xmlns:android="http://schemas.android.com/apk/res/android">
<item>
<shape>
<solid android:color="@color/color_25" />
<corners android:radius="4dp" />
</shape>
</item>
<item>
<shape>
<solid android:color="#69ffffff" />
<corners android:radius="4dp" />
</shape>
</item>
</layer-list>
\ 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_25" />
<corners android:radius="8dp" />
</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_ef" />
<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_f2" />
<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/white" />
<corners android:radius="14dp" />
</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/white" />
<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/white" />
<corners android:radius="8dp" />
</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_25"
android:width="1dp" />
<solid android:color="@android:color/transparent" />
<corners android:radius="4dp" />
</shape>
\ No newline at end of file
... ...
<?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="match_parent"
android:orientation="vertical">
<include layout="@layout/layout_tool_bar" />
<com.br_technology.securitytrain_master.view.ViewToolBar
android:layout_width="match_parent"
android:layout_height="wrap_content" />
<ImageView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginStart="32dp"
android:layout_marginTop="36dp"
android:contentDescription="@string/logo"
android:src="@mipmap/ic_back" />
<EditText
android:id="@+id/identity_number"
android:layout_width="match_parent"
android:layout_height="52dp"
android:layout_marginStart="32dp"
android:layout_marginTop="32dp"
android:layout_marginEnd="32dp"
android:background="@null"
android:digits="1234567890Xx"
android:hint="身份证号码"
android:textColor="@color/black"
android:textColorHint="#CECED6"
android:textSize="18sp" />
<View
android:layout_width="match_parent"
android:layout_height="1dp"
android:layout_marginStart="32dp"
android:layout_marginEnd="32dp"
android:background="#EBEDF0" />
<LinearLayout
android:layout_width="match_parent"
android:layout_height="52dp"
android:layout_marginStart="32dp"
android:layout_marginTop="12dp"
android:layout_marginEnd="32dp"
android:orientation="horizontal">
<EditText
android:id="@+id/password"
android:layout_width="0dp"
android:layout_height="match_parent"
android:layout_weight="1"
android:background="@null"
android:hint="登录密码"
android:importantForAutofill="no"
android:inputType="textPassword"
android:lines="1"
android:textColorHint="#CECED6"
android:maxLength="20"
android:textColor="@color/black"
android:textSize="18sp" />
<ImageView
android:id="@+id/display"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="center"
android:contentDescription="@string/logo"
android:src="@drawable/password_display" />
</LinearLayout>
<View
android:layout_width="match_parent"
android:layout_height="1dp"
android:layout_marginStart="32dp"
android:layout_marginEnd="32dp"
android:background="#EBEDF0" />
<TextView
android:id="@+id/login"
android:layout_width="match_parent"
android:layout_height="40dp"
android:layout_marginStart="32dp"
android:layout_marginTop="40dp"
android:layout_marginEnd="32dp"
android:background="@drawable/login"
android:gravity="center"
android:text="登录"
android:textColor="@color/white"
android:textSize="15sp" />
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginStart="32dp"
android:layout_marginTop="16dp"
android:layout_marginEnd="32dp"
android:orientation="horizontal">
<TextView
android:id="@+id/forget_password"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="忘记密码"
android:textColor="#A7A6B3"
android:textSize="13sp" />
<View
android:layout_width="0dp"
android:layout_height="match_parent"
android:layout_weight="1" />
<TextView
android:id="@+id/mobile_login"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="手机号登陆"
android:textColor="#257CFF"
android:textSize="13sp" />
</LinearLayout>
</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.google.android.material.tabs.TabLayout
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">
<com.google.android.material.tabs.TabItem
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="共享资料库" />
<com.google.android.material.tabs.TabItem
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="企业资料库" />
</com.google.android.material.tabs.TabLayout>
</LinearLayout>
\ No newline at end of file
... ...
<?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="match_parent"
android:orientation="vertical">
<include layout="@layout/layout_tool_bar" />
<com.br_technology.securitytrain_master.view.ViewToolBar
android:layout_width="match_parent"
android:layout_height="wrap_content" />
<ImageView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginStart="32dp"
android:layout_marginTop="36dp"
android:contentDescription="@string/logo"
android:src="@mipmap/ic_back" />
<EditText
android:id="@+id/mobile"
android:layout_width="match_parent"
android:layout_height="52dp"
android:layout_marginStart="32dp"
android:layout_marginTop="32dp"
android:layout_marginEnd="32dp"
android:background="@null"
android:hint="手机号"
android:inputType="phone"
android:textColor="@color/black"
android:textColorHint="#CECED6"
android:textSize="18sp" />
<View
android:layout_width="match_parent"
android:layout_height="1dp"
android:layout_marginStart="32dp"
android:layout_marginEnd="32dp"
android:background="#EBEDF0" />
<LinearLayout
android:layout_width="match_parent"
android:layout_height="52dp"
android:layout_marginStart="32dp"
android:layout_marginTop="12dp"
android:layout_marginEnd="32dp"
android:orientation="horizontal">
<EditText
android:id="@+id/verification_code"
android:layout_width="0dp"
android:layout_height="match_parent"
android:layout_weight="1"
android:background="@null"
android:hint="验证码"
android:inputType="phone"
android:textColor="@color/black"
android:textColorHint="#CECED6"
android:textSize="18sp" />
<TextView
android:id="@+id/get_verification_code"
android:layout_width="94dp"
android:layout_height="32dp"
android:background="@drawable/solid_25_8"
android:gravity="center"
android:text="获取验证码"
android:textColor="@color/white"
android:textSize="14sp" />
</LinearLayout>
<View
android:layout_width="match_parent"
android:layout_height="1dp"
android:layout_marginStart="32dp"
android:layout_marginEnd="32dp"
android:background="#EBEDF0" />
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginStart="32dp"
android:layout_marginTop="12dp"
android:layout_marginEnd="32dp"
android:orientation="horizontal">
<EditText
android:id="@+id/password"
android:layout_width="0dp"
android:layout_height="52dp"
android:layout_weight="1"
android:background="@null"
android:hint="设置6~20位登录密码"
android:inputType="textPassword"
android:textColor="@color/black"
android:textColorHint="#CECED6"
android:textSize="18sp" />
<ImageView
android:id="@+id/display"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="center"
android:background="@drawable/password_display"
android:contentDescription="@string/logo"
android:paddingStart="10dp" />
</LinearLayout>
<View
android:layout_width="match_parent"
android:layout_height="1dp"
android:layout_marginStart="32dp"
android:layout_marginEnd="32dp"
android:background="#EBEDF0" />
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginStart="32dp"
android:layout_marginTop="12dp"
android:layout_marginEnd="32dp"
android:orientation="horizontal">
<EditText
android:id="@+id/again_password"
android:layout_width="0dp"
android:layout_height="52dp"
android:layout_weight="1"
android:background="@null"
android:hint="请再次输入密码"
android:inputType="textPassword"
android:textColor="@color/black"
android:textColorHint="#CECED6"
android:textSize="18sp" />
<ImageView
android:id="@+id/again_display"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="center"
android:background="@drawable/password_display"
android:contentDescription="@string/logo"
android:paddingStart="10dp" />
</LinearLayout>
<View
android:layout_width="match_parent"
android:layout_height="1dp"
android:layout_marginStart="32dp"
android:layout_marginEnd="32dp"
android:background="#EBEDF0" />
<TextView
android:id="@+id/complete"
android:layout_width="match_parent"
android:layout_height="40dp"
android:layout_marginStart="32dp"
android:layout_marginTop="40dp"
android:layout_marginEnd="32dp"
android:background="@drawable/solid_25_4"
android:gravity="center"
android:text="完成"
android:textColor="@color/white"
android:textSize="15sp" />
</LinearLayout>
\ No newline at end of file
... ...
<?xml version="1.0" encoding="utf-8"?>
<androidx.constraintlayout.widget.ConstraintLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
xmlns:tools="http://schemas.android.com/tools"
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="match_parent"
tools:context=".MainActivity">
android:orientation="vertical">
<TextView
android:id="@+id/tv_name"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="Hello World!"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintLeft_toLeftOf="parent"
app:layout_constraintRight_toRightOf="parent"
app:layout_constraintTop_toTopOf="parent" />
<com.br_technology.securitytrain_master.view.NoScrollViewPage
android:id="@+id/view_page"
android:layout_width="match_parent"
android:layout_height="0dp"
android:layout_weight="1" />
<TextView
android:id="@+id/tv_test"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="请求数据"
android:layout_marginTop="200dp"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintLeft_toLeftOf="parent"
app:layout_constraintRight_toRightOf="parent"
app:layout_constraintTop_toTopOf="parent" />
</androidx.constraintlayout.widget.ConstraintLayout>
\ No newline at end of file
<RadioGroup
android:layout_width="match_parent"
android:layout_height="50dp"
android:orientation="horizontal"
android:paddingTop="6dp"
android:paddingBottom="4dp">
<RadioButton
android:id="@+id/home"
style="@style/Main.RadioButton"
android:drawableTop="@drawable/main_home"
android:text="首页" />
<RadioButton
android:id="@+id/question_bank"
style="@style/Main.RadioButton"
android:drawableTop="@drawable/main_bank"
android:text="全能题库" />
<RadioButton
android:id="@+id/mine"
style="@style/Main.RadioButton"
android:drawableTop="@drawable/main_mine"
android:text="我的" />
</RadioGroup>
</LinearLayout>
\ No newline at end of file
... ...
<?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="match_parent"
android:orientation="vertical">
<include layout="@layout/layout_tool_bar" />
<com.br_technology.securitytrain_master.view.ViewToolBar
android:layout_width="match_parent"
android:layout_height="wrap_content" />
<ImageView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginStart="32dp"
android:layout_marginTop="36dp"
android:contentDescription="@string/logo"
android:src="@mipmap/ic_back" />
<EditText
android:id="@+id/mobile"
android:layout_width="match_parent"
android:layout_height="52dp"
android:layout_marginStart="32dp"
android:layout_marginTop="32dp"
android:layout_marginEnd="32dp"
android:background="@null"
android:hint="手机号"
android:inputType="phone"
android:textColor="@color/black"
android:textColorHint="#CECED6"
android:textSize="18sp" />
<View
android:layout_width="match_parent"
android:layout_height="1dp"
android:layout_marginStart="32dp"
android:layout_marginEnd="32dp"
android:background="#EBEDF0" />
<LinearLayout
android:layout_width="match_parent"
android:layout_height="52dp"
android:layout_marginStart="32dp"
android:layout_marginTop="12dp"
android:layout_marginEnd="32dp"
android:orientation="horizontal">
<EditText
android:id="@+id/verification_code"
android:layout_width="0dp"
android:layout_height="match_parent"
android:layout_weight="1"
android:background="@null"
android:hint="验证码"
android:inputType="phone"
android:textColor="@color/black"
android:textColorHint="#CECED6"
android:textSize="18sp" />
<TextView
android:id="@+id/get_verification_code"
android:layout_width="94dp"
android:layout_height="32dp"
android:background="@drawable/solid_25_8"
android:gravity="center"
android:text="获取验证码"
android:textColor="@color/white"
android:textSize="14sp" />
</LinearLayout>
<View
android:layout_width="match_parent"
android:layout_height="1dp"
android:layout_marginStart="32dp"
android:layout_marginEnd="32dp"
android:background="#EBEDF0" />
<TextView
android:id="@+id/login"
android:layout_width="match_parent"
android:layout_height="40dp"
android:layout_marginStart="32dp"
android:layout_marginTop="40dp"
android:layout_marginEnd="32dp"
android:background="@drawable/login"
android:gravity="center"
android:text="登录"
android:textColor="@color/white"
android:textSize="15sp" />
<TextView
android:id="@+id/account_login"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="center_horizontal"
android:layout_marginTop="16dp"
android:text="账号密码登录"
android:textColor="@color/color_25"
android:textSize="13sp" />
</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:layout_marginStart="16dp"
android:layout_marginEnd="16dp"
android:gravity="center_vertical"
android:orientation="horizontal">
<ImageView
android:id="@+id/back"
android:layout_width="wrap_content"
android:layout_height="match_parent"
android:src="@mipmap/ic_back" />
<LinearLayout
android:layout_width="0dp"
android:layout_height="32dp"
android:layout_weight="1"
android:background="@drawable/stroke_25_4"
android:orientation="horizontal">
<EditText
android:id="@+id/search_edit"
android:layout_width="0dp"
android:layout_height="32dp"
android:layout_weight="1"
android:background="@null"
android:drawableStart="@mipmap/search"
android:drawablePadding="12dp"
android:hint="搜索"
android:maxLines="1"
android:paddingStart="16dp"
android:paddingEnd="10dp"
android:textColor="@color/color_25"
android:textColorHint="@color/color_4025"
android:textSize="14sp" />
<ImageView
android:id="@+id/clear_edit"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="center"
android:layout_marginEnd="16dp"
android:src="@mipmap/ic_clear" />
</LinearLayout>
<TextView
android:id="@+id/search"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginStart="12dp"
android:text="搜索"
android:textColor="@color/color_32"
android:textSize="14sp" />
</LinearLayout>
<LinearLayout
android:id="@+id/history_group"
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="8dp"
android:gravity="center_vertical"
android:orientation="horizontal">
<TextView
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_weight="1"
android:text="历史记录"
android:textColor="@color/color_32"
android:textSize="16sp" />
<ImageView
android:id="@+id/clear"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:contentDescription="@string/logo"
android:src="@mipmap/delete" />
</LinearLayout>
<androidx.recyclerview.widget.RecyclerView
android:id="@+id/history_recycler"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_marginStart="16dp"
android:overScrollMode="never"
android:scrollbars="none"
app:layoutManager="androidx.recyclerview.widget.LinearLayoutManager" />
<com.google.android.material.tabs.TabLayout
android:id="@+id/tab_layout"
style="@style/SearchTab"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:visibility="gone" />
<androidx.viewpager.widget.ViewPager
android:id="@+id/view_pager"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_marginTop="16dp"
android:overScrollMode="never"
android:scrollbars="none"
android:visibility="gone" />
</LinearLayout>
\ No newline at end of file
... ...
<?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:orientation="vertical">
<TextView
android:id="@+id/name"
android:maxLines="1"
android:ellipsize="end"
android:layout_width="match_parent"
android:layout_height="50dp"
android:layout_marginEnd="16dp"
android:gravity="center_vertical"
android:textColor="@color/color_64"
android:textSize="13sp" />
<View
android:layout_width="match_parent"
android:layout_height="1dp"
android:background="@color/color_eb" />
</LinearLayout>
\ No newline at end of file
... ...
<?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:orientation="vertical">
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="horizontal">
<ImageView
android:id="@+id/pic"
android:layout_width="97dp"
android:layout_height="72dp"
android:contentDescription="@string/logo"
android:scaleType="fitXY" />
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginStart="16dp"
android:orientation="vertical">
<TextView
android:id="@+id/name"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:ellipsize="end"
android:gravity="center_vertical"
android:maxLines="1"
android:minHeight="22dp"
android:textColor="@color/color_32"
android:textSize="14sp" />
<TextView
android:id="@+id/info"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginTop="8dp"
android:ellipsize="end"
android:maxLines="2"
android:textColor="@color/color_96"
android:textSize="12sp" />
</LinearLayout>
</LinearLayout>
<View
android:layout_width="match_parent"
android:layout_height="1dp"
android:layout_marginTop="15dp"
android:layout_marginBottom="15dp"
android:background="@color/color_eb" />
</LinearLayout>
\ No newline at end of file
... ...
<?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:orientation="vertical">
<FrameLayout
android:layout_width="match_parent"
android:layout_height="92dp">
<ImageView
android:scaleType="fitXY"
android:id="@+id/video_pic"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:contentDescription="@string/logo"
android:src="@mipmap/banner" />
<TextView
android:id="@+id/lesson"
android:layout_width="39dp"
android:layout_height="16dp"
android:background="@drawable/gradient_e8_e5_4"
android:gravity="center"
android:textColor="@color/white"
android:textSize="10sp" />
</FrameLayout>
<TextView
android:id="@+id/course_name"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginTop="8dp"
android:textColor="@color/color_32"
android:textSize="12sp" />
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginTop="6dp"
android:gravity="center_vertical"
android:orientation="horizontal">
<ImageView
android:id="@+id/head"
android:layout_width="16dp"
android:layout_height="16dp"
android:contentDescription="@string/logo" />
<TextView
android:id="@+id/name"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginStart="8dp"
android:textColor="@color/color_96"
android:textSize="11sp" />
</LinearLayout>
</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="?actionBarSize">
<androidx.appcompat.widget.AppCompatImageView
android:id="@+id/back"
android:layout_width="wrap_content"
android:layout_height="match_parent"
android:layout_centerVertical="true"
android:paddingStart="16dp"
android:paddingEnd="0dp"
android:src="@mipmap/ic_back" />
<androidx.appcompat.widget.AppCompatTextView
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" />
</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:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginStart="40dp"
android:layout_marginEnd="40dp"
android:background="@drawable/solid_ff_8"
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="32dp"
android:layout_marginEnd="16dp"
android:gravity="center"
android:text="确认删除吗?"
android:textColor="@color/color_252"
android:textSize="18sp" />
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginStart="20dp"
android:layout_marginTop="24dp"
android:layout_marginEnd="20dp"
android:layout_marginBottom="24dp"
android:orientation="horizontal">
<TextView
android:id="@+id/cancel"
android:layout_width="0dp"
android:layout_height="40dp"
android:layout_weight="1"
android:background="@drawable/solid_f2_4"
android:gravity="center"
android:text="取消"
android:textColor="@color/color_64"
android:textSize="15sp" />
<View
android:layout_width="20dp"
android:layout_height="match_parent" />
<TextView
android:id="@+id/determine"
android:layout_width="0dp"
android:layout_height="40dp"
android:layout_weight="1"
android:background="@drawable/solid_25_4"
android:gravity="center"
android:text="确定"
android:textColor="@color/white"
android:textSize="15sp" />
</LinearLayout>
</LinearLayout>
\ 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">
<TextView
android:layout_gravity="center_horizontal"
android:gravity="center"
android:text="home"
android:layout_width="match_parent"
android:layout_height="match_parent" />
</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"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="vertical">
<LinearLayout
android:layout_width="match_parent"
android:layout_height="?actionBarSize"
android:background="@color/color_25"
android:orientation="horizontal"
android:paddingStart="16dp"
android:paddingEnd="16dp">
<ImageView
android:layout_width="87dp"
android:layout_height="26dp"
android:layout_gravity="center_vertical"
android:background="@color/color_96"
android:contentDescription="@string/logo" />
<RelativeLayout
android:id="@+id/search"
android:layout_width="match_parent"
android:layout_height="32dp"
android:layout_gravity="center_vertical"
android:layout_marginStart="8dp"
android:background="@drawable/search_back">
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_centerInParent="true"
android:text="搜索"
android:textColor="@color/white"
android:textSize="14sp" />
<ImageView
android:layout_width="40dp"
android:layout_height="28dp"
android:layout_alignParentEnd="true"
android:layout_centerVertical="true"
android:layout_marginEnd="2dp"
android:background="@drawable/solid_ff_14"
android:contentDescription="@string/logo"
android:paddingStart="12dp"
android:paddingEnd="12dp"
android:src="@mipmap/search" />
</RelativeLayout>
</LinearLayout>
<androidx.core.widget.NestedScrollView
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:fadingEdge="none"
android:overScrollMode="never"
android:scrollbars="none">
<LinearLayout
android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="vertical">
<FrameLayout
android:layout_width="match_parent"
android:layout_height="wrap_content">
<ImageView
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:contentDescription="@string/logo"
android:scaleType="fitXY"
android:src="@mipmap/banner_back" />
<com.youth.banner.Banner
android:id="@+id/banner"
android:layout_width="match_parent"
android:layout_height="160dp"
android:layout_marginStart="16dp"
android:layout_marginTop="15dp"
android:layout_marginEnd="16dp" />
</FrameLayout>
<androidx.cardview.widget.CardView
android:id="@+id/announcement"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginStart="16dp"
android:layout_marginTop="15dp"
android:layout_marginEnd="16dp"
app:cardCornerRadius="4dp"
app:cardElevation="10dp">
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="horizontal">
<ImageView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:contentDescription="@string/logo"
android:src="@mipmap/announcement" />
<TextView
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_gravity="center_vertical"
android:layout_marginStart="12dp"
android:layout_weight="1"
android:ellipsize="end"
android:maxLines="1"
android:text="最新课程通知,最新课程通知,最新课程通知,最新课程通知。。。" />
<ImageView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="center_vertical"
android:layout_marginStart="18dp"
android:layout_marginEnd="12dp"
android:src="@mipmap/ic_arrow" />
</LinearLayout>
</androidx.cardview.widget.CardView>
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginTop="25dp"
android:orientation="horizontal">
<TextView
android:id="@+id/online_course"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_weight="1"
android:drawableTop="@mipmap/online_course"
android:drawablePadding="4dp"
android:gravity="center"
android:text="在线课程"
android:textColor="@color/color_32"
android:textSize="14sp" />
<TextView
android:id="@+id/live_course"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_weight="1"
android:drawableTop="@mipmap/live_course"
android:drawablePadding="4dp"
android:gravity="center"
android:text="直播课程"
android:textColor="@color/color_32"
android:textSize="14sp" />
<TextView
android:id="@+id/txt_course"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_weight="1"
android:drawableTop="@mipmap/txt_course"
android:drawablePadding="4dp"
android:gravity="center"
android:text="文本课程"
android:textColor="@color/color_32"
android:textSize="14sp" />
<TextView
android:id="@+id/database"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_weight="1"
android:drawableTop="@mipmap/database"
android:drawablePadding="4dp"
android:gravity="center"
android:text="资料库"
android:textColor="@color/color_32"
android:textSize="14sp" />
</LinearLayout>
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginStart="16dp"
android:layout_marginTop="24dp"
android:layout_marginBottom="4dp"
android:text="视频课程"
android:textColor="@color/color_32"
android:textSize="18sp" />
<androidx.recyclerview.widget.RecyclerView
android:id="@+id/video_course"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginStart="16dp"
android:layout_marginEnd="16dp"
android:nestedScrollingEnabled="false"
android:overScrollMode="never"
app:layoutManager="androidx.recyclerview.widget.GridLayoutManager"
app:spanCount="2"
tools:itemCount="4" />
<LinearLayout
android:layout_width="match_parent"
android:layout_height="40dp"
android:layout_gravity="center"
android:layout_marginStart="16dp"
android:layout_marginTop="16dp"
android:layout_marginEnd="16dp"
android:background="@drawable/solid_ef_4"
android:gravity="center"
android:orientation="horizontal">
<TextView
android:layout_width="wrap_content"
android:layout_height="match_parent"
android:layout_gravity="center"
android:gravity="center"
android:text="查看更多资料"
android:textColor="@color/color_25"
android:textSize="12sp" />
<ImageView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginStart="8dp"
android:contentDescription="@string/logo"
android:src="@mipmap/load_arrow_right" />
</LinearLayout>
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginStart="16dp"
android:layout_marginTop="24dp"
android:layout_marginBottom="16dp"
android:text="推荐资料"
android:textColor="@color/color_32"
android:textSize="18sp" />
<androidx.recyclerview.widget.RecyclerView
android:id="@+id/recommended_data"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginStart="16dp"
android:layout_marginEnd="16dp"
android:nestedScrollingEnabled="false"
android:overScrollMode="never"
app:layoutManager="androidx.recyclerview.widget.LinearLayoutManager" />
<LinearLayout
android:layout_width="match_parent"
android:layout_height="40dp"
android:layout_gravity="center"
android:layout_marginStart="16dp"
android:layout_marginTop="16dp"
android:layout_marginEnd="16dp"
android:background="@drawable/solid_ef_4"
android:gravity="center"
android:orientation="horizontal">
<TextView
android:layout_width="wrap_content"
android:layout_height="match_parent"
android:layout_gravity="center"
android:gravity="center"
android:text="查看更多资料"
android:textColor="@color/color_25"
android:textSize="12sp" />
<ImageView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginStart="8dp"
android:contentDescription="@string/logo"
android:src="@mipmap/load_arrow_right" />
</LinearLayout>
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="center"
android:layout_marginTop="20dp"
android:layout_marginBottom="24dp"
android:gravity="center"
android:text="已经到底了~"
android:textColor="@color/color_c8"
android:textSize="12sp" />
</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"
android:orientation="vertical"
android:layout_width="match_parent"
android:layout_height="match_parent">
<TextView
android:layout_gravity="center_horizontal"
android:gravity="center"
android:text="mine"
android:layout_width="match_parent"
android:layout_height="match_parent" />
</LinearLayout>
\ No newline at end of file
... ...
<?xml version="1.0" encoding="utf-8"?>
<androidx.recyclerview.widget.RecyclerView xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
android:id="@+id/result"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:overScrollMode="never"
android:paddingStart="16dp"
android:paddingEnd="16dp"
android:scrollbars="none"
app:layoutManager="androidx.recyclerview.widget.LinearLayoutManager" />
... ...
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout
xmlns:android="http://schemas.android.com/apk/res/android"
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_gravity="center_horizontal"
android:gravity="center_horizontal"
android:orientation="vertical"
android:gravity="center">
android:paddingTop="48dp"
android:paddingBottom="0dp">
<!-- <ImageView-->
<!-- android:layout_width="wrap_content"-->
<!-- android:layout_height="wrap_content"-->
<!-- android:src="@drawable/empty"-->
<!-- android:layout_centerInParent="true"/>-->
<ImageView
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:contentDescription="@string/logo"
android:src="@mipmap/blank" />
<!-- <TextView-->
<!-- android:text="@string/empty_message"-->
<!-- android:layout_marginTop="10dp"-->
<!-- android:textColor="@color/primary_grey_dark"-->
<!-- android:layout_width="wrap_content"-->
<!-- android:layout_height="wrap_content"-->
<!-- />-->
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginTop="8dp"
android:text="暂无搜索记录~"
android:textColor="@color/color_c8"
android:textSize="12sp" />
</LinearLayout>
\ No newline at end of file
... ...
<?xml version="1.0" encoding="utf-8"?>
<androidx.appcompat.widget.Toolbar xmlns:android="http://schemas.android.com/apk/res/android"
android:id="@+id/status_bar"
android:layout_width="match_parent"
android:layout_height="24dp"
android:background="@android:color/transparent" />
\ No newline at end of file
... ...
<?xml version="1.0" encoding="utf-8"?>
<resources>
<declare-styleable name="UIToolBar">
<attr name="leftText" format="reference|string" />
<attr name="leftImg" format="reference" />
<attr name="toolTitle" format="reference|string" />
<attr name="rightText" format="reference|string" />
<attr name="rightImg" format="reference" />
<attr name="toolTitleTextSize" format="reference|dimension" />
<attr name="toolTitleTextColor" format="reference|color" />
<attr name="navTextSize" format="reference|dimension" />
<attr name="navTextColor" format="reference|color" />
</declare-styleable>
</resources>
\ No newline at end of file
... ...
... ... @@ -10,4 +10,15 @@
<color name="transparent">#00000000</color>
<color name="text_light_gray">#9A9A9A</color>
<color name="colorAccent">#80000000</color>
<color name="color_25">#257CFF</color>
<color name="color_4025">#40257CFF</color>
<color name="color_96">#969799</color>
<color name="color_32">#323233</color>
<color name="color_ef">#EFF2F7</color>
<color name="color_eb">#EBEDF0</color>
<color name="color_c8">#C8C9CC</color>
<color name="color_64">#646566</color>
<color name="color_252">#25283D</color>
<color name="color_f2">#F2F2F5</color>
</resources>
\ No newline at end of file
... ...
<resources>
<string name="app_name">SecurityTrain-Master</string>
<string name="logo">logo</string>
</resources>
\ No newline at end of file
... ...
<?xml version="1.0" encoding="utf-8"?>
<resources>
<style name="dialog_progress" parent="@android:style/Theme.Dialog">
<item name="android:windowBackground">@color/transparent</item><!--背景透明-->
<item name="android:backgroundDimEnabled">false</item><!--模糊-->
... ... @@ -19,4 +20,44 @@
<item name="android:maxWidth">60dp</item>
<item name="android:maxHeight">60dp</item>
</style>
<!--首页底部导航栏-->
<style name="Main.RadioButton" parent="Widget.AppCompat.CompoundButton.RadioButton">
<item name="android:background">@android:color/transparent</item>
<item name="android:button">@null</item>
<item name="android:layout_width">0dp</item>
<item name="android:layout_height">match_parent</item>
<item name="android:layout_weight">1</item>
<item name="android:textSize">10sp</item>
<item name="android:textColor">@drawable/main_text_color</item>
<item name="android:drawablePadding">2dp</item>
<item name="android:gravity">center</item>
</style>
<!-- dialog -->
<style name="UserDefaultDialog" parent="@style/Theme.AppCompat.Dialog">
<!-- 背景颜色及透明程度 -->
<item name="android:windowBackground">@android:color/transparent</item>
<!-- 是否半透明 -->
<item name="android:windowIsTranslucent">true</item>
<!-- 是否没有标题 -->
<item name="android:windowNoTitle">true</item>
<!--是否现实状态栏-->
<item name="android:windowActionBar">false</item>
<!-- 是否浮现在activity之上 -->
<item name="android:windowIsFloating">true</item>
<!-- 背景昏暗已启用 -->
<item name="android:backgroundDimEnabled">true</item>
<!-- 背景昏暗的透明度-->
<item name="android:backgroundDimAmount">0.5</item>
</style>
<style name="SearchTab" parent="Widget.Design.TabLayout">
<item name="tabSelectedTextColor">@color/color_32</item>
<item name="tabTextColor">@color/color_96</item>
<item name="tabIndicatorColor">@color/color_25</item>
<item name="tabIndicator">@drawable/indicator</item>
<item name="tabIndicatorFullWidth">false</item>
<item name="tabBackground">@android:color/transparent</item>
<item name="tabRippleColor">@android:color/transparent</item>
</style>
</resources>
\ No newline at end of file
... ...