Selaa lähdekoodia

学籍异动

master
leiyun 3 vuotta sitten
vanhempi
commit
0886fe19cb
40 muutettua tiedostoa jossa 2646 lisäystä ja 415 poistoa
  1. +8
    -3
      .idea/misc.xml
  2. +7
    -2
      app/build.gradle
  3. +179
    -32
      app/src/main/java/com/yzx/escreen/MainActivity.kt
  4. +1
    -0
      app/src/main/java/com/yzx/escreen/activity/WebActivity.kt
  5. +10
    -16
      app/src/main/java/com/yzx/escreen/activity/base/BaseActivity.kt
  6. +94
    -0
      app/src/main/java/com/yzx/escreen/adapter/ChangeDialogStepAdapter.kt
  7. +80
    -0
      app/src/main/java/com/yzx/escreen/adapter/ChangeListAdapter.kt
  8. +26
    -0
      app/src/main/java/com/yzx/escreen/config/Config.kt
  9. +53
    -0
      app/src/main/java/com/yzx/escreen/config/RefreshToken.kt
  10. +9
    -38
      app/src/main/java/com/yzx/escreen/config/YzxInterface.kt
  11. +484
    -0
      app/src/main/java/com/yzx/escreen/fragment/ChangeFragment.kt
  12. +68
    -37
      app/src/main/java/com/yzx/escreen/fragment/HomeFragment.kt
  13. +24
    -1
      app/src/main/java/com/yzx/escreen/fragment/MyFragment.kt
  14. +11
    -0
      app/src/main/java/com/yzx/escreen/fragment/base/BaseFragment.kt
  15. +38
    -0
      app/src/main/java/com/yzx/escreen/model/MessageEvent.kt
  16. +5
    -0
      app/src/main/java/com/yzx/escreen/model/ReToken.kt
  17. +209
    -0
      app/src/main/java/com/yzx/escreen/model/StuChange.kt
  18. +11
    -12
      app/src/main/java/com/yzx/escreen/model/StuLeave.kt
  19. +77
    -0
      app/src/main/java/com/yzx/escreen/presenter/ChangePresenter.kt
  20. +46
    -0
      app/src/main/java/com/yzx/escreen/presenter/MainPresenter.kt
  21. +20
    -9
      app/src/main/java/com/yzx/escreen/utils/KotlinX.kt
  22. +14
    -0
      app/src/main/java/com/yzx/escreen/widget/BaseDialog.kt
  23. +122
    -0
      app/src/main/java/com/yzx/escreen/widget/ChangeDialog.kt
  24. +95
    -0
      app/src/main/java/com/yzx/escreen/widget/LeaveDialog.kt
  25. +28
    -0
      app/src/main/java/com/yzx/escreen/widget/TimeView.kt
  26. +35
    -26
      app/src/main/res/layout/activity_main.xml
  27. +196
    -0
      app/src/main/res/layout/dialog_change.xml
  28. +2
    -2
      app/src/main/res/layout/dialog_leave.xml
  29. +269
    -0
      app/src/main/res/layout/fragment_change.xml
  30. +252
    -235
      app/src/main/res/layout/fragment_home.xml
  31. +6
    -1
      app/src/main/res/layout/fragment_my.xml
  32. +95
    -0
      app/src/main/res/layout/layout_change_table.xml
  33. +48
    -0
      app/src/main/res/layout/view_time.xml
  34. BIN
      app/src/main/res/mipmap-mdpi/change_select.png
  35. BIN
      app/src/main/res/mipmap-mdpi/change_unselect.png
  36. BIN
      app/src/main/res/mipmap-mdpi/leave_select.png
  37. BIN
      app/src/main/res/mipmap-mdpi/leave_unselect.png
  38. +1
    -1
      app/src/main/res/values/colors.xml
  39. +5
    -0
      app/src/main/res/values/ids.xml
  40. +18
    -0
      app/src/main/res/values/styles.xml

+ 8
- 3
.idea/misc.xml Näytä tiedosto

@@ -13,23 +13,28 @@
<entry key="..\:/work/escreen/app/src/main/res/drawable/switch_ios_track_selector.xml" value="0.372" /> <entry key="..\:/work/escreen/app/src/main/res/drawable/switch_ios_track_selector.xml" value="0.372" />
<entry key="..\:/work/escreen/app/src/main/res/layout/activity_book.xml" value="0.37135416666666665" /> <entry key="..\:/work/escreen/app/src/main/res/layout/activity_book.xml" value="0.37135416666666665" />
<entry key="..\:/work/escreen/app/src/main/res/layout/activity_home.xml" value="0.12378472222222223" /> <entry key="..\:/work/escreen/app/src/main/res/layout/activity_home.xml" value="0.12378472222222223" />
<entry key="..\:/work/escreen/app/src/main/res/layout/activity_main.xml" value="0.4279711884753902" />
<entry key="..\:/work/escreen/app/src/main/res/layout/activity_main.xml" value="0.10822707953855495" />
<entry key="..\:/work/escreen/app/src/main/res/layout/activity_main1.xml" value="0.37135416666666665" /> <entry key="..\:/work/escreen/app/src/main/res/layout/activity_main1.xml" value="0.37135416666666665" />
<entry key="..\:/work/escreen/app/src/main/res/layout/activity_note.xml" value="0.37135416666666665" /> <entry key="..\:/work/escreen/app/src/main/res/layout/activity_note.xml" value="0.37135416666666665" />
<entry key="..\:/work/escreen/app/src/main/res/layout/activity_read.xml" value="0.31567028985507245" /> <entry key="..\:/work/escreen/app/src/main/res/layout/activity_read.xml" value="0.31567028985507245" />
<entry key="..\:/work/escreen/app/src/main/res/layout/activity_web.xml" value="0.30483112441214194" /> <entry key="..\:/work/escreen/app/src/main/res/layout/activity_web.xml" value="0.30483112441214194" />
<entry key="..\:/work/escreen/app/src/main/res/layout/dialog_change.xml" value="0.12378472222222223" />
<entry key="..\:/work/escreen/app/src/main/res/layout/dialog_exit.xml" value="0.30483112441214194" /> <entry key="..\:/work/escreen/app/src/main/res/layout/dialog_exit.xml" value="0.30483112441214194" />
<entry key="..\:/work/escreen/app/src/main/res/layout/dialog_leave.xml" value="0.30483112441214194" /> <entry key="..\:/work/escreen/app/src/main/res/layout/dialog_leave.xml" value="0.30483112441214194" />
<entry key="..\:/work/escreen/app/src/main/res/layout/dialog_test.xml" value="0.29827742520398914" /> <entry key="..\:/work/escreen/app/src/main/res/layout/dialog_test.xml" value="0.29827742520398914" />
<entry key="..\:/work/escreen/app/src/main/res/layout/dialog_vacation.xml" value="0.10822707953855495" /> <entry key="..\:/work/escreen/app/src/main/res/layout/dialog_vacation.xml" value="0.10822707953855495" />
<entry key="..\:/work/escreen/app/src/main/res/layout/fragment_home.xml" value="0.2941427960666952" />
<entry key="..\:/work/escreen/app/src/main/res/layout/fragment_my.xml" value="0.45940721649484534" />
<entry key="..\:/work/escreen/app/src/main/res/layout/fragment_change.xml" value="0.10822707953855495" />
<entry key="..\:/work/escreen/app/src/main/res/layout/fragment_home.xml" value="0.10822707953855495" />
<entry key="..\:/work/escreen/app/src/main/res/layout/fragment_my.xml" value="0.10822707953855495" />
<entry key="..\:/work/escreen/app/src/main/res/layout/item_home.xml" value="0.12378472222222223" />
<entry key="..\:/work/escreen/app/src/main/res/layout/layout_change_table.xml" value="0.12378472222222223" />
<entry key="..\:/work/escreen/app/src/main/res/layout/layout_empty.xml" value="0.37135416666666665" /> <entry key="..\:/work/escreen/app/src/main/res/layout/layout_empty.xml" value="0.37135416666666665" />
<entry key="..\:/work/escreen/app/src/main/res/layout/layout_leave_step.xml" value="0.1" /> <entry key="..\:/work/escreen/app/src/main/res/layout/layout_leave_step.xml" value="0.1" />
<entry key="..\:/work/escreen/app/src/main/res/layout/layout_leave_table.xml" value="0.21462163317657118" /> <entry key="..\:/work/escreen/app/src/main/res/layout/layout_leave_table.xml" value="0.21462163317657118" />
<entry key="..\:/work/escreen/app/src/main/res/layout/layout_loading.xml" value="0.30483112441214194" /> <entry key="..\:/work/escreen/app/src/main/res/layout/layout_loading.xml" value="0.30483112441214194" />
<entry key="..\:/work/escreen/app/src/main/res/layout/leave_dialog_title.xml" value="0.37135416666666665" /> <entry key="..\:/work/escreen/app/src/main/res/layout/leave_dialog_title.xml" value="0.37135416666666665" />
<entry key="..\:/work/escreen/app/src/main/res/layout/version_dialog.xml" value="0.30483112441214194" /> <entry key="..\:/work/escreen/app/src/main/res/layout/version_dialog.xml" value="0.30483112441214194" />
<entry key="..\:/work/escreen/app/src/main/res/layout/view_time.xml" value="0.12378472222222223" />
<entry key="..\:/work/escreen/app/src/main/res/mipmap-anydpi-v26/ic_launcher.xml" value="0.331" /> <entry key="..\:/work/escreen/app/src/main/res/mipmap-anydpi-v26/ic_launcher.xml" value="0.331" />
</map> </map>
</option> </option>


+ 7
- 2
app/build.gradle Näytä tiedosto

@@ -8,6 +8,9 @@ apply plugin: 'kotlin-android-extensions'


//apply plugin: 'org.greenrobot.greendao' //apply plugin: 'org.greenrobot.greendao'


androidExtensions {
experimental = true
}
android { android {
compileSdkVersion 30 compileSdkVersion 30
buildToolsVersion "30.0.3" buildToolsVersion "30.0.3"
@@ -16,8 +19,8 @@ android {
// minSdkVersion 26 // minSdkVersion 26
minSdkVersion 21 minSdkVersion 21
targetSdkVersion 25 targetSdkVersion 25
versionCode 9
versionName "2.0.7"
versionCode 10
versionName "2.0.8"
testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner" testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"


// ndk { // ndk {
@@ -187,4 +190,6 @@ dependencies {


api 'com.tencent.tbs:tbssdk:44181' api 'com.tencent.tbs:tbssdk:44181'
implementation 'com.github.HuanTanSheng:EasyPhotos:3.1.5' implementation 'com.github.HuanTanSheng:EasyPhotos:3.1.5'

implementation("org.greenrobot:eventbus:3.3.1")
} }

+ 179
- 32
app/src/main/java/com/yzx/escreen/MainActivity.kt Näytä tiedosto

@@ -4,12 +4,15 @@ import android.annotation.SuppressLint
import android.app.Dialog import android.app.Dialog
import android.content.Context import android.content.Context
import android.content.Intent import android.content.Intent
import android.text.InputType
import android.os.Handler
import android.os.Looper
import android.util.Log import android.util.Log
import android.view.KeyEvent import android.view.KeyEvent
import android.view.View import android.view.View
import android.view.ViewGroup
import android.widget.TextView import android.widget.TextView
import androidx.appcompat.app.AppCompatActivity import androidx.appcompat.app.AppCompatActivity
import androidx.constraintlayout.widget.ConstraintLayout
import androidx.core.widget.ContentLoadingProgressBar import androidx.core.widget.ContentLoadingProgressBar
import androidx.fragment.app.Fragment import androidx.fragment.app.Fragment
import androidx.viewpager2.adapter.FragmentStateAdapter import androidx.viewpager2.adapter.FragmentStateAdapter
@@ -30,33 +33,41 @@ import com.qmuiteam.qmui.widget.dialog.QMUIDialog
import com.yzx.escreen.activity.WebActivity import com.yzx.escreen.activity.WebActivity
import com.yzx.escreen.activity.base.BaseActivity import com.yzx.escreen.activity.base.BaseActivity
import com.yzx.escreen.config.Config import com.yzx.escreen.config.Config
import com.yzx.escreen.config.RefreshToken
import com.yzx.escreen.fragment.ChangeFragment
import com.yzx.escreen.fragment.HomeFragment import com.yzx.escreen.fragment.HomeFragment
import com.yzx.escreen.fragment.MyFragment import com.yzx.escreen.fragment.MyFragment
import com.yzx.escreen.model.BaseBean
import com.yzx.escreen.model.TabEntity
import com.yzx.escreen.model.User
import com.yzx.escreen.model.Version
import com.yzx.escreen.presenter.base.BasePresenter
import com.yzx.escreen.model.*
import com.yzx.escreen.presenter.MainPresenter
import com.yzx.escreen.presenter.MainView
import com.yzx.escreen.presenter.base.JsonCallBack
import com.yzx.escreen.presenter.base.YzxResponse
import com.yzx.escreen.utils.hideNavigationBar import com.yzx.escreen.utils.hideNavigationBar
import com.yzx.escreen.widget.BaseDialog import com.yzx.escreen.widget.BaseDialog
import com.yzx.escreen.widget.ChangeDialog
import com.yzx.escreen.widget.LeaveDialog
import com.yzx.webebook.config.YzxInterface
import kotlinx.android.synthetic.main.activity_main.* import kotlinx.android.synthetic.main.activity_main.*
import org.greenrobot.eventbus.EventBus
import org.greenrobot.eventbus.Subscribe
import org.greenrobot.eventbus.ThreadMode
import org.jetbrains.anko.find import org.jetbrains.anko.find
import org.jetbrains.anko.toast import org.jetbrains.anko.toast
import java.util.* import java.util.*
import kotlin.system.exitProcess




/** /**
* Yun.Lei * Yun.Lei
* 2020年5月6日14:49:10 * 2020年5月6日14:49:10
*/ */
class MainActivity : BaseActivity<BasePresenter<*>>(), NetworkUtils.OnNetworkStatusChangedListener {
class MainActivity : BaseActivity<MainPresenter>(), NetworkUtils.OnNetworkStatusChangedListener,
MainView {




override val inflateId: Int override val inflateId: Int
get() = R.layout.activity_main get() = R.layout.activity_main
var netLoadingDialog:QMUIDialog? = null
var netErrorDialog:QMUIDialog? = null
var netLoadingDialog: QMUIDialog? = null
var netErrorDialog: QMUIDialog? = null
private val netLoadingRun = Runnable { private val netLoadingRun = Runnable {
netLoadingDialog?.apply { netLoadingDialog?.apply {
dismiss() dismiss()
@@ -64,23 +75,56 @@ class MainActivity : BaseActivity<BasePresenter<*>>(), NetworkUtils.OnNetworkSta
showNetworkError() showNetworkError()
} }


override fun initView() {
private val mHandler = Handler(Looper.getMainLooper())
private val runnable = object : Runnable {
override fun run() {
mPresenter?.getLeaveShowIds()
mHandler.postDelayed(this, 2000)
}
}

private val mTimeHandler = Handler(Looper.getMainLooper())
private val timeRunnable = object : Runnable {
override fun run() {
EventBus.getDefault().post(TimeShow().getNowObj())
mTimeHandler.postDelayed(this, 1000)
}
}

private val dialogList = mutableListOf<ConstraintLayout>()


if(NetworkUtils.isConnected()){
if (!User.isLogin()) {
override fun initView() {
if (NetworkUtils.isConnected()) {
if (!User.isLogin() && User.getUser().token.isEmpty()) {
WebActivity.active(this, "${Config.OA_URL}/login") WebActivity.active(this, "${Config.OA_URL}/login")
finish() finish()
} }
checkVersion()
}else{
if(!User.isLogin()){
RefreshToken.refresh(object :RefreshToken.RefreshCallback{
override fun onSuccess() {
checkVersion()
checkAuto()
}
})
}else{
checkVersion()
checkAuto()
RefreshToken.refresh(object :RefreshToken.RefreshCallback{
override fun onSuccess() {
}
})
}
} else {
showNetworkLoading() //显示网络检查中 showNetworkLoading() //显示网络检查中
} }
val tabData = arrayListOf<CustomTabEntity>() val tabData = arrayListOf<CustomTabEntity>()
tabData.add(TabEntity("首页", R.mipmap.home_select, R.mipmap.home_unselect))
tabData.add(TabEntity("学生请假", R.mipmap.leave_select, R.mipmap.leave_unselect))
tabData.add(TabEntity("学籍异动", R.mipmap.change_select, R.mipmap.change_unselect))
tabData.add(TabEntity("我的", R.mipmap.my_select, R.mipmap.my_unselect)) tabData.add(TabEntity("我的", R.mipmap.my_select, R.mipmap.my_unselect))
tabLayout.setTabData(tabData) tabLayout.setTabData(tabData)


viewPager2.adapter = HomePagerAdapter(this) viewPager2.adapter = HomePagerAdapter(this)
viewPager2.offscreenPageLimit = 2
viewPager2.registerOnPageChangeCallback(object : ViewPager2.OnPageChangeCallback() { viewPager2.registerOnPageChangeCallback(object : ViewPager2.OnPageChangeCallback() {
override fun onPageSelected(position: Int) { override fun onPageSelected(position: Int) {
super.onPageSelected(position) super.onPageSelected(position)
@@ -89,14 +133,85 @@ class MainActivity : BaseActivity<BasePresenter<*>>(), NetworkUtils.OnNetworkSta
}) })
tabLayout.setOnTabSelectListener(object : OnTabSelectListener { tabLayout.setOnTabSelectListener(object : OnTabSelectListener {
override fun onTabSelect(position: Int) { override fun onTabSelect(position: Int) {
viewPager2.currentItem = position
KeyboardUtils.hideSoftInput( viewPager2)
// viewPager2.currentItem = position
viewPager2.setCurrentItem(position,false)
KeyboardUtils.hideSoftInput(viewPager2)
} }


override fun onTabReselect(position: Int) { override fun onTabReselect(position: Int) {
} }


}) })

mTimeHandler.post(timeRunnable)
}

private fun checkAuto() {
val isAutoShowLeave = SPUtils.getInstance().getBoolean("auto_show_leave", false)
val isAutoShowChange = SPUtils.getInstance().getBoolean("auto_show_change", false)
if (isAutoShowLeave || isAutoShowChange) {
mHandler.postDelayed(runnable, 2000)
} else {
mHandler.removeCallbacks(runnable)
}
}

//接收消息
@Subscribe(threadMode = ThreadMode.MAIN)
fun onMessageEvent(event: AutoSwitchChange) {
checkAuto()
}

//接收请假消息
@Subscribe(threadMode = ThreadMode.MAIN)
fun onMessageEvent(detail: StuLeave) {
removeOld(detail.id,0)
val dialog = LeaveDialog(this)
dialog.layoutParams = ViewGroup.LayoutParams(
ViewGroup.LayoutParams.MATCH_PARENT,
ViewGroup.LayoutParams.MATCH_PARENT
)
dialog.setData(detail)
dialog.setTag(R.id.tag_dialog_name,detail.id)
dialog.setTag(R.id.tag_dialog_type,0)
dialog.onCloseClick = {
dialogLayout.removeView(it)
dialogList.remove(it)
}
dialogLayout.addView(dialog)
dialogList.add(dialog)
}

//接收异动消息
@Subscribe(threadMode = ThreadMode.MAIN)
fun onMessageEvent(detail: StuChange) {
removeOld(detail.id,1)
val dialog = ChangeDialog(this)
dialog.layoutParams = ViewGroup.LayoutParams(
ViewGroup.LayoutParams.MATCH_PARENT,
ViewGroup.LayoutParams.MATCH_PARENT
)
dialog.setData(detail)
dialog.setTag(R.id.tag_dialog_name,detail.id)
dialog.setTag(R.id.tag_dialog_type,1)
dialog.onCloseClick = {
dialogLayout.removeView(it)
dialogList.remove(it)
}
dialogLayout.addView(dialog,0) //请假权限更高,异动插入到最底层
dialogList.add(dialog)
}

private fun removeOld(id:Int, type:Int){
val view = dialogList.find {
val tagId: Int = it.getTag(R.id.tag_dialog_name) as Int
val tagType: Int = it.getTag(R.id.tag_dialog_type) as Int
return@find id == tagId && type == tagType
}
view?.apply {
dialogList.remove(this)
dialogLayout.removeView(this)
}
} }


override fun initData() { override fun initData() {
@@ -121,39 +236,38 @@ class MainActivity : BaseActivity<BasePresenter<*>>(), NetworkUtils.OnNetworkSta


} }


private fun showNetworkError(){
if(!NetworkUtils.isConnected()){ //无网提示
private fun showNetworkError() {
if (!NetworkUtils.isConnected()) { //无网提示
val builder = QMUIDialog.MessageDialogBuilder(this) val builder = QMUIDialog.MessageDialogBuilder(this)


builder.setMessage("你还没有连接网络,请先连接网络!") builder.setMessage("你还没有连接网络,请先连接网络!")
.setTitle("温馨提示") .setTitle("温馨提示")
.addAction("去设置"
.addAction(
"去设置"
) { dialog, index -> ) { dialog, index ->
NetworkUtils.openWirelessSettings() NetworkUtils.openWirelessSettings()
} }
.setCancelable(false) .setCancelable(false)
.setCanceledOnTouchOutside(false) .setCanceledOnTouchOutside(false)
netErrorDialog = builder.show()
netErrorDialog = builder.show()
netErrorDialog?.hideNavigationBar() netErrorDialog?.hideNavigationBar()
} }
} }


private fun showNetworkLoading(){
private fun showNetworkLoading() {
val builder = QMUIDialog.MessageDialogBuilder(this) val builder = QMUIDialog.MessageDialogBuilder(this)


builder.setMessage("网络检查中,请稍后...") builder.setMessage("网络检查中,请稍后...")
.setTitle("温馨提示") .setTitle("温馨提示")
.setCancelable(false) .setCancelable(false)
.setCanceledOnTouchOutside(false) .setCanceledOnTouchOutside(false)
netLoadingDialog = builder.show()
netLoadingDialog = builder.show()
netLoadingDialog?.hideNavigationBar() netLoadingDialog?.hideNavigationBar()


viewPager2.postDelayed(netLoadingRun,5000)
viewPager2.postDelayed(netLoadingRun, 5000)
} }


override fun initPresenter(): BasePresenter<*>? {
return null
}
override fun initPresenter(): MainPresenter = MainPresenter(this)


@SuppressLint("SetTextI18n") @SuppressLint("SetTextI18n")
override fun onActivityResult(requestCode: Int, resultCode: Int, data: Intent?) { override fun onActivityResult(requestCode: Int, resultCode: Int, data: Intent?) {
@@ -177,12 +291,12 @@ class MainActivity : BaseActivity<BasePresenter<*>>(), NetworkUtils.OnNetworkSta


override fun onConnected(networkType: NetworkUtils.NetworkType?) { override fun onConnected(networkType: NetworkUtils.NetworkType?) {
netLoadingDialog?.apply { netLoadingDialog?.apply {
if(isShowing){
if (isShowing) {
dismiss() dismiss()
} }
} }
netErrorDialog?.apply { netErrorDialog?.apply {
if(isShowing){
if (isShowing) {
dismiss() dismiss()
} }
} }
@@ -192,13 +306,14 @@ class MainActivity : BaseActivity<BasePresenter<*>>(), NetworkUtils.OnNetworkSta
finish() finish()
} }
checkVersion() checkVersion()
checkAuto()
} }


private fun checkVersion(userCheck: Boolean = false): Unit { private fun checkVersion(userCheck: Boolean = false): Unit {
val BASE_URL = Config.BASE_URL val BASE_URL = Config.BASE_URL
OkGo.post<String>("$BASE_URL/parent/common/getInkBottleMaxVersion") OkGo.post<String>("$BASE_URL/parent/common/getInkBottleMaxVersion")
.tag(this) .tag(this)
.params("app_id",Config.APP_ID)
.params("app_id", Config.APP_ID)
.execute(object : StringCallback() { .execute(object : StringCallback() {


override fun onSuccess(response: Response<String>) { override fun onSuccess(response: Response<String>) {
@@ -294,10 +409,39 @@ class MainActivity : BaseActivity<BasePresenter<*>>(), NetworkUtils.OnNetworkSta
}) })
.executeMission(this) .executeMission(this)
} }

override fun onLeaveIDsSuccess(list: MutableList<LeaveID>) {
val listLeave = list.filter { it.type == 0 }.toMutableList()
val listChange = list.filter { it.type == 1 }.toMutableList()
var type =0
if(listLeave.isNotEmpty()){
viewPager2.currentItem = 0
type =0
}else if(listChange.isNotEmpty()){
viewPager2.currentItem = 1
type =1
}
if(list.isNotEmpty()){
viewPager2.postDelayed({
EventBus.getDefault().post(MessageEventAuto(list,type))
},500)
}
}

override fun onStart() {
super.onStart()
EventBus.getDefault().register(this)
}

override fun onStop() {
mHandler.removeCallbacks(runnable)
super.onStop()
EventBus.getDefault().unregister(this)
}
} }


class HomePagerAdapter(act: AppCompatActivity) : FragmentStateAdapter(act) { class HomePagerAdapter(act: AppCompatActivity) : FragmentStateAdapter(act) {
override fun getItemCount(): Int = 2
override fun getItemCount(): Int = 3


override fun createFragment(position: Int): Fragment { override fun createFragment(position: Int): Fragment {
when (position) { when (position) {
@@ -305,6 +449,9 @@ class HomePagerAdapter(act: AppCompatActivity) : FragmentStateAdapter(act) {
return HomeFragment.getNewInstance() return HomeFragment.getNewInstance()
} }
1 -> { 1 -> {
return ChangeFragment.getNewInstance()
}
2 -> {
return MyFragment.getNewInstance() return MyFragment.getNewInstance()
} }
} }


+ 1
- 0
app/src/main/java/com/yzx/escreen/activity/WebActivity.kt Näytä tiedosto

@@ -398,6 +398,7 @@ class YzxJavascriptInterface(var ctx: Activity) {
@JavascriptInterface @JavascriptInterface
fun toHome() { fun toHome() {
ctx.startActivity<MainActivity>() ctx.startActivity<MainActivity>()
ctx.finish()
} }


@JavascriptInterface @JavascriptInterface


+ 10
- 16
app/src/main/java/com/yzx/escreen/activity/base/BaseActivity.kt Näytä tiedosto

@@ -4,6 +4,7 @@ import android.os.Bundle
import android.view.View import android.view.View
import android.view.WindowManager import android.view.WindowManager
import androidx.appcompat.app.AppCompatActivity import androidx.appcompat.app.AppCompatActivity
import com.blankj.utilcode.util.BarUtils
import com.gyf.immersionbar.ktx.immersionBar import com.gyf.immersionbar.ktx.immersionBar
import com.yzx.escreen.R import com.yzx.escreen.R
import com.yzx.escreen.presenter.base.BasePresenter import com.yzx.escreen.presenter.base.BasePresenter
@@ -44,6 +45,8 @@ abstract class BaseActivity<out P : BasePresenter<*>> : AppCompatActivity() {
override fun onCreate(savedInstanceState: Bundle?) { override fun onCreate(savedInstanceState: Bundle?) {
super.onCreate(savedInstanceState) super.onCreate(savedInstanceState)
hideBottomUIMenu() hideBottomUIMenu()
window.decorView.systemUiVisibility = View.SYSTEM_UI_FLAG_FULLSCREEN
actionBar?.hide()
setContentView(inflateId) setContentView(inflateId)
initView() initView()
initData() initData()
@@ -52,13 +55,13 @@ abstract class BaseActivity<out P : BasePresenter<*>> : AppCompatActivity() {
} }


open fun setStatusBar() { open fun setStatusBar() {
immersionBar {
statusBarColor(R.color.white)
fitsSystemWindows(true)
statusBarDarkFont(true, 0.2f)
keyboardEnable(true)
init()
}
// immersionBar {
// statusBarColor(R.color.white)
// fitsSystemWindows(false)
// statusBarDarkFont(true, 0.2f)
// keyboardEnable(true)
// init()
// }
} }




@@ -67,15 +70,6 @@ abstract class BaseActivity<out P : BasePresenter<*>> : AppCompatActivity() {
params.systemUiVisibility = params.systemUiVisibility =
View.SYSTEM_UI_FLAG_HIDE_NAVIGATION or View.SYSTEM_UI_FLAG_IMMERSIVE View.SYSTEM_UI_FLAG_HIDE_NAVIGATION or View.SYSTEM_UI_FLAG_IMMERSIVE
window.attributes = params window.attributes = params

// window.decorView.systemUiVisibility = View.SYSTEM_UI_FLAG_HIDE_NAVIGATION
// window.decorView.setOnSystemUiVisibilityChangeListener {
// val uiOptions = View.SYSTEM_UI_FLAG_LAYOUT_STABLE or
// View.SYSTEM_UI_FLAG_LAYOUT_HIDE_NAVIGATION or
// View.SYSTEM_UI_FLAG_HIDE_NAVIGATION or
// View.SYSTEM_UI_FLAG_LAYOUT_FULLSCREEN
// window.decorView.systemUiVisibility = uiOptions
// }
} }






+ 94
- 0
app/src/main/java/com/yzx/escreen/adapter/ChangeDialogStepAdapter.kt Näytä tiedosto

@@ -0,0 +1,94 @@
package com.yzx.escreen.adapter

import android.annotation.SuppressLint
import android.graphics.Color
import android.view.View
import com.chad.library.adapter.base.BaseQuickAdapter
import com.chad.library.adapter.base.viewholder.BaseViewHolder
import com.yzx.escreen.R
import com.yzx.escreen.model.ChangeActivity
import com.yzx.escreen.utils.setSrc
import com.yzx.escreen.utils.toTime
import kotlinx.android.synthetic.main.layout_leave_step.view.*
import org.jetbrains.anko.dip

class ChangeDialogStepAdapter(list: MutableList<ChangeActivity>) :
BaseQuickAdapter<ChangeActivity, BaseViewHolder>(R.layout.layout_leave_step, list) {

@SuppressLint("SetTextI18n")
override fun convert(holder: BaseViewHolder, item: ChangeActivity) {
holder.itemView.inImg.visibility = View.GONE
holder.itemView.visibility = View.VISIBLE
holder.itemView.addUserTypeName.visibility = View.GONE
holder.itemView.activityName.visibility = View.GONE
holder.itemView.addUserName.visibility = View.VISIBLE
when (item.is_approve) {
0 -> {

holder.itemView.addUserTypeName.visibility = View.GONE
holder.itemView.addUserName.text = "${item.add_user_name}发起异动申请${
if (item.is_auto_pass == 1) {
"(直接通过)"
} else {
""
}
}"
holder.itemView.approvalComments.visibility = View.GONE
}
1 -> {
holder.itemView.addUserName.text = "班主任审批"
holder.itemView.statusName.text = when (item.approval_status) {
0,1 -> "(待审批)"
2 -> "(通过)"
3 -> "(拒绝)"
else -> ""
}
holder.itemView.statusName.setTextColor(when (item.approval_status) {
0,1 -> Color.parseColor("#3c7ef6")
2 -> Color.parseColor("#07c160")
3 -> Color.parseColor("#ff4040")
else -> 0
})
holder.itemView.approvalComments.visibility = View.VISIBLE
var str = "审批人:${item.add_user_name}"
if (item.approval_comments.isNotEmpty()) {
str += "。${item.approval_comments}"
}
holder.itemView.approvalComments.text = str
}
2->{
holder.itemView.addUserName.text = "提前结束"
holder.itemView.approvalComments.visibility = View.VISIBLE
var str = "操作人:${item.add_user_name}"
if (item.approval_comments.isNotEmpty()) {
str += "。${item.approval_comments}"
}
holder.itemView.approvalComments.text = str
}
else -> {
holder.itemView.visibility = View.GONE
}
}

holder.itemView.signImg.visibility = if(item.sign_key?.isNotEmpty() == true){
holder.itemView.signImg.setSrc(item.sign_identity,item.sign_key)
View.VISIBLE
}else{
View.GONE
}

holder.itemView.stepTime.text = item.add_time.toTime()

if (holder.adapterPosition == 0) {
holder.itemView.line1.setBackgroundResource(R.color.transparent)
} else {
holder.itemView.line1.setBackgroundResource(R.color.gray_1)
}

if (holder.adapterPosition == data.size - 1) {
holder.itemView.contentLayout.setPadding(0, 0, 0, 0)
} else {
holder.itemView.contentLayout.setPadding(0, 0, 0, holder.itemView.contentLayout.dip(20))
}
}
}

+ 80
- 0
app/src/main/java/com/yzx/escreen/adapter/ChangeListAdapter.kt Näytä tiedosto

@@ -0,0 +1,80 @@
package com.yzx.escreen.adapter

import android.annotation.SuppressLint
import android.graphics.Color
import android.view.View
import com.chad.library.adapter.base.BaseQuickAdapter
import com.chad.library.adapter.base.viewholder.BaseViewHolder
import com.yzx.escreen.R
import com.yzx.escreen.model.StuChange
import com.yzx.escreen.utils.setSrc
import com.yzx.escreen.utils.toDay
import com.yzx.escreen.utils.toTime
import kotlinx.android.synthetic.main.layout_change_table.view.*
import org.jetbrains.anko.textColor

class ChangeListAdapter(list: MutableList<StuChange>) :
BaseQuickAdapter<StuChange, BaseViewHolder>(R.layout.layout_change_table, list) {

init {
addChildClickViewIds(R.id.cancelBtn)
}

@SuppressLint("SetTextI18n")
override fun convert(holder: BaseViewHolder, item: StuChange) {
holder.itemView.studentName.text = item.status_change_student_name
if (item.face_key.isNullOrBlank()) {
holder.itemView.faceEmpty.visibility = View.VISIBLE
holder.itemView.faceImg.visibility = View.GONE
} else {
holder.itemView.faceImg.visibility = View.VISIBLE
holder.itemView.faceEmpty.visibility = View.GONE
holder.itemView.faceImg.setSrc(item.face_identity, item.face_key)
}
holder.itemView.className.text = "${item.grade_name}${item.class_name}"
holder.itemView.typeName.text = item.status_change_type_name

var time = "--"
if (item.start_time > 0) {
time = item.start_time.toDay()
}
if (item.end_time > 0) {
time = "$time -- ${item.end_time.toDay()}"
}
holder.itemView.leaveTime.text = time

holder.itemView.statusName.text = when (item.status) {
1 -> "待处理"
2 -> "已确认"
3 -> "已拒绝"
else -> "--"
}
holder.itemView.statusName.textColor = when (item.status) {
1 -> Color.parseColor("#333333")
2 -> Color.parseColor("#3c7ef6")
3 -> Color.parseColor("#ff4040")
4 -> Color.parseColor("#3c7ef6")
5 -> Color.parseColor("#ff4040")
else -> Color.parseColor("#333333")
}
if (item.getSubStatusName().isNotEmpty()) {
holder.itemView.subStatusName.text = "(${item.getSubStatusName()})"
holder.itemView.subStatusName.textColor = when (item.sub_status) {
0, 2 -> Color.parseColor("#ff4040")
1, 3 -> Color.parseColor("#07c160")
else -> Color.parseColor("#333333")
}
} else {
holder.itemView.subStatusName.text = ""
}

holder.itemView.applyTime.text = item.add_time.toTime()

holder.itemView.bottomLine.visibility = if (holder.adapterPosition == data.size - 1) {
View.GONE
} else {
View.VISIBLE
}
holder.itemView.addUser.text = item.add_user_name
}
}

+ 26
- 0
app/src/main/java/com/yzx/escreen/config/Config.kt Näytä tiedosto

@@ -1,6 +1,7 @@
package com.yzx.escreen.config package com.yzx.escreen.config


import com.yzx.escreen.BuildConfig import com.yzx.escreen.BuildConfig
import com.yzx.escreen.model.StuChangeType


object Config { object Config {
var BASE_URL = BuildConfig.BASE_URL var BASE_URL = BuildConfig.BASE_URL
@@ -8,4 +9,29 @@ object Config {
var M_URL = BuildConfig.M_URL var M_URL = BuildConfig.M_URL
var OA_URL = BuildConfig.OA_URL var OA_URL = BuildConfig.OA_URL
val APP_ID = 602 val APP_ID = 602


const val STU_CHANGE_STATUS_DROP_OUT = 42001
const val STU_CHANGE_STATUS_LEAVE_SCHOOL = 42002
const val STU_CHANGE_STATUS_RETURN_SCHOOL = 42003
const val STU_CHANGE_STATUS_OUT_SCHOOL = 42004
const val STU_CHANGE_STATUS_TRANSFER_SCHOOL = 42005
const val STU_CHANGE_STATUS_REPEAT = 42006
const val STU_CHANGE_STATUS_DOWNGRADE = 42007
const val STU_CHANGE_STATUS_TRANSFER_OUT = 42008
const val STU_CHANGE_STATUS_INTROSPECTION = 42009
const val STU_CHANGE_STATUS_INTERNSHIP = 42010

val STU_CHANGE_STATUS_LIST = mutableListOf(
StuChangeType(STU_CHANGE_STATUS_DROP_OUT,"辍学",""),
StuChangeType(STU_CHANGE_STATUS_LEAVE_SCHOOL,"休学",""),
StuChangeType(STU_CHANGE_STATUS_RETURN_SCHOOL,"复学",""),
StuChangeType(STU_CHANGE_STATUS_OUT_SCHOOL,"退学",""),
StuChangeType(STU_CHANGE_STATUS_TRANSFER_SCHOOL,"转学",""),
StuChangeType(STU_CHANGE_STATUS_REPEAT,"留级",""),
StuChangeType(STU_CHANGE_STATUS_TRANSFER_OUT,"转出",""),
StuChangeType(STU_CHANGE_STATUS_DOWNGRADE,"降级",""),
StuChangeType(STU_CHANGE_STATUS_INTROSPECTION,"回家反省","反省"),
StuChangeType(STU_CHANGE_STATUS_INTERNSHIP,"实习","反省")
)
} }

+ 53
- 0
app/src/main/java/com/yzx/escreen/config/RefreshToken.kt Näytä tiedosto

@@ -0,0 +1,53 @@
package com.yzx.escreen.config

import com.blankj.utilcode.util.LogUtils
import com.lzy.okgo.OkGo
import com.lzy.okgo.model.Response
import com.yzx.escreen.model.ReToken
import com.yzx.escreen.model.RefreshTokenEvent
import com.yzx.escreen.model.User
import com.yzx.escreen.presenter.base.JsonCallBack
import com.yzx.escreen.presenter.base.YzxResponse
import com.yzx.webebook.config.YzxInterface
import org.greenrobot.eventbus.EventBus
import java.util.*

object RefreshToken {
fun refresh(callBack:RefreshCallback) {
val user = User.getUser()
val lastLoginTime = user.loginTime
val currTime = Date().time
if (currTime - lastLoginTime > 12L * 60 * 60 * 1000 && currTime - lastLoginTime < 365L * 24 * 60 * 60 * 1000) {
if (user.user_id > 0) {
val url = Config.BASE_URL + YzxInterface.INTERFACE_REFRESH_TOKEN
OkGo.post<YzxResponse<ReToken>>(url)
.tag(this)
.params("old_token", User.getUser().token)
.params("type", 1)
.params("source", "201")
.execute(object : JsonCallBack<YzxResponse<ReToken>>() {
override fun onSuccess(response: Response<YzxResponse<ReToken>>?) {
LogUtils.d(response)
val token = response?.body()?.data?.token ?: ""
if (token.isNotBlank()) {
user.token = token
user.loginTime = Date().time
user.save()
callBack.onSuccess()
EventBus.getDefault().post(RefreshTokenEvent(token))
}
}

override fun onError(response: Response<YzxResponse<ReToken>>?) {
super.onError(response)
LogUtils.d(response)
}
})
}
}
}

interface RefreshCallback{
fun onSuccess()
}
}

+ 9
- 38
app/src/main/java/com/yzx/escreen/config/YzxInterface.kt Näytä tiedosto

@@ -5,48 +5,19 @@ object YzxInterface {
const val FILE_UPLOAD_URL = "https://fileupload.oa.qbjjyyun.net/edufile/fileUpload" const val FILE_UPLOAD_URL = "https://fileupload.oa.qbjjyyun.net/edufile/fileUpload"


const val INTERFACE_REFRESH_TOKEN = "/login/user2/refreshToken"// 刷新token const val INTERFACE_REFRESH_TOKEN = "/login/user2/refreshToken"// 刷新token
const val INTERFACE_GET_HOMEWORK_LIST = "/parent/weixin/getwxHomeworksByme"//获取家庭作业列表

const val INTERFACE_EBOOK_NOTEBOOK_GET_LIST = "/parent/notebook/getMyNotebookList"//获取笔记本列表
const val INTERFACE_EBOOK_NOTEBOOK_RESET_NAME = "/parent/notebook/renameMyNotebook"//重命名笔记本
const val INTERFACE_EBOOK_NOTEBOOK_DEL_NOTEBOOK = "/parent/notebook/deleteMyNotebook"//删除笔记本
const val INTERFACE_EBOOK_NOTEBOOK_INSET_NOTEBOOK = "/parent/notebook/createMyNotebook"//新建笔记本
const val INTERFACE_EBOOK_NOTEBOOK_UPDATE_NOTEBOOK = "/parent/notebook/updateMyNotebook"//编辑笔记本
const val INTERFACE_EBOOK_NOTEBOOK_TAG_LIST = "/parent/notebook/getNoteTagList"//笔记标签
const val INTERFACE_EBOOK_NOTEBOOK_TAG_ADD = "/parent/notebook/insertNoteTag"//添加笔记标签

const val INTERFACE_PREPARE_TEAM_COMMENT = "/parent/teacherPrePareLesson/getCommentDetailsByTeamId"
const val INTERFACE_PREPARE_TEAM_INPUT = "/parent/teacherPrePareLesson/inputContent"
const val INTERFACE_PREPARE_STU_RUSH = "/parent/teacherPrePareLesson/studentRush"
const val INTERFACE_PREPARE_RECORD_LIST = "/parent/teacherPrePareLesson/getInteractiveRecordList"
const val INTERFACE_PREPARE_MY_TEAMS = "/parent/teacherPrePareLesson/getMyTeams"
const val INTERFACE_PREPARE_MY_NEW_TEAM = "/parent/teacherPrePareLesson/getMyNewTeam"


const val INTERFACE_EXERCISES_LIST = "/parent/teacherPrePareLesson/issueExercisesListByStudent" // 练习题列表
const val INTERFACE_QUESTION_GET_RESOURCE_CATEGORY_LIST= "/parent/questionBank/getResourceCategoryAllListBySuperId"//获取公共资源层级
const val INTERFACE_QUESTION_REAL_GRADE= "/parent/common/getGradesByPeriodType"//根据学段(type:1小学,2初中,3高中 resource_category_id)获取对应年级接口
const val INTERFACE_QUESTION_GET_INFO = "/parent/studentAfterClassPractice/getQuestionBankById"//获取试题信息
const val INTERFACE_QUESTION_GET_LAST_PRACTICE = "/parent/studentAfterClassPractice/getLastPractice"//获取上次练习到第几题
const val INTERFACE_QUESTION_GET_PRACTICE_CURR_NUM = "/parent/studentAfterClassPractice/getPracticeCurrNum"//获取当前练习次数
const val INTERFACE_QUESTION_GET_PRACTICE_BY_TYPE = "/parent/studentAfterClassPractice/getCurrPracticeCorrectRate"//获取本次练习的正确率
const val INTERFACE_QUESTION_POST_PRACTICE = "/parent/studentAfterClassPractice/insertStudentAfterClassPractice"//插入一条学生课后练习题
const val INTERFACE_QUESTION_GET_PRACTICE_IDS = "/parent/studentAfterClassPractice/getQuestionBankIdsByType"//按练习类型获取试题Ids
const val INTERFACE_QUESTION_POST_COLLECT = "/parent/studentAfterClassPractice/collectQuestionBankById"//收藏(取消)试题
const val INTERFACE_QUESTION_GET_PRACTICE_STAT = "/parent/studentAfterClassPractice/getPracticeStat"//获取练习统计
const val INTERFACE_QUESTION_GET_KNOWLEDGE_POINT = "/parent/questionBank/getKnowledgePoint"//获取知识点

const val INTERFACE_NEW_WORD_GET_BOOK_LIST = "/parent/learningNewWords/getBooksList"//教材列表
const val INTERFACE_NEW_WORD_GET_BOOK_RES_CATE_LIST = "/parent/learningNewWords/getBooksResourceCatalogList"//获取课本资源目录
const val INTERFACE_INTERFACE_NEW_WORD_LIST= "/parent/learningNewWords/getNewWordsList" // 生字-列表
const val INTERFACE_NEW_WORD_ADD_RECORD= "/parent/learningNewWords/insertPracticeRecord" // 生字-提交记录
const val INTERFACE_NEW_WORD_GET_RECORD= "/parent/learningNewWords/getPracticeRecordsList" // 练习记录



/**
* 学生请假
*/
const val INTERFACE_GET_STU_LEAVE_LIST= "/edu/attendance/teacher/listStudentLeaveRequest"//获取学生请假列表 const val INTERFACE_GET_STU_LEAVE_LIST= "/edu/attendance/teacher/listStudentLeaveRequest"//获取学生请假列表
const val INTERFACE_GET_STU_LEAVE_INFO_DETAIL= "/edu/attendance/getStudentLeaveRequestDetail" //获取学生的请假信息详情 const val INTERFACE_GET_STU_LEAVE_INFO_DETAIL= "/edu/attendance/getStudentLeaveRequestDetail" //获取学生的请假信息详情
const val INTERFACE_GET_TEACHER_INFO= "/rights/teacherWork/getTeacherByUserId"//获取人员信息 const val INTERFACE_GET_TEACHER_INFO= "/rights/teacherWork/getTeacherByUserId"//获取人员信息
const val INTERFACE_STUDENT_GET_SHOW_BOX_LIST= "/edu/attendance/student/getStudentLeaveIds" //获取需要弹出的数据 const val INTERFACE_STUDENT_GET_SHOW_BOX_LIST= "/edu/attendance/student/getStudentLeaveIds" //获取需要弹出的数据
const val INTERFACE_STUDENT_POST_LEAVE_VACATION= "/edu/attendance/student/studentLeaveVacation"//人工销假操作 const val INTERFACE_STUDENT_POST_LEAVE_VACATION= "/edu/attendance/student/studentLeaveVacation"//人工销假操作
/**
* 学籍异动
*/


}
const val INTERFACE_STUDENT_GET_CHANGE_LIST= "/edu/attendance/teacher/listStudentStatusChange"//学籍异动列表
const val INTERFACE_STUDENT_GET_CHANGE_DETAIL= "/edu/attendance/getStudentStatusChangeDetail"//学籍异动详情
}

+ 484
- 0
app/src/main/java/com/yzx/escreen/fragment/ChangeFragment.kt Näytä tiedosto

@@ -0,0 +1,484 @@
package com.yzx.escreen.fragment

import android.annotation.SuppressLint
import android.app.Activity
import android.content.Intent
import android.content.res.ColorStateList
import android.graphics.Color
import android.text.Editable
import android.text.TextWatcher
import android.view.KeyEvent
import android.view.View
import android.widget.ImageView
import android.widget.TextView
import androidx.recyclerview.widget.LinearLayoutManager
import androidx.recyclerview.widget.RecyclerView
import com.blankj.utilcode.util.*
import com.qmuiteam.qmui.widget.roundwidget.QMUIRoundButton
import com.yzx.escreen.R
import com.yzx.escreen.adapter.ChangeDialogStepAdapter
import com.yzx.escreen.adapter.ChangeListAdapter
import com.yzx.escreen.fragment.base.BaseFragment
import com.yzx.escreen.model.*
import com.yzx.escreen.presenter.ChangePresenter
import com.yzx.escreen.presenter.ChangeView
import com.yzx.escreen.utils.FileUploadCallBack
import com.yzx.escreen.utils.hideNavigationBar
import com.yzx.escreen.utils.setSrc
import com.yzx.escreen.utils.toDay
import com.yzx.escreen.widget.BaseDialog
import kotlinx.android.synthetic.main.fragment_change.*
import kotlinx.android.synthetic.main.layout_loading.view.*
import org.greenrobot.eventbus.EventBus
import org.greenrobot.eventbus.Subscribe
import org.greenrobot.eventbus.ThreadMode
import org.jetbrains.anko.find
import org.jetbrains.anko.support.v4.act
import org.jetbrains.anko.support.v4.ctx
import org.jetbrains.anko.textColor


class ChangeFragment : BaseFragment<ChangePresenter>(), ChangeView,
NetworkUtils.OnNetworkStatusChangedListener, FileUploadCallBack {

companion object {

val CAMER_REQUEST_CODE = 0x01

@JvmStatic
fun getNewInstance() =
ChangeFragment()
}

private val mAdapter: ChangeListAdapter by lazy {
val list = mutableListOf<StuChange>()
ChangeListAdapter(list)
}

private var mPager = Pager()
var list = mutableListOf<StuChange>()
private val statusBtnList = mutableListOf<QMUIRoundButton>()
var keyword: String = ""
var status: String = ""
private var isLoading = false
private val mShowList = mutableListOf<StuChange>()
private val mShowDialogList = mutableListOf<BaseDialog>()

private val refreshRun = Runnable {
refreshData()
}

override val inflateId: Int
get() = R.layout.fragment_change

override fun initView() {
NetworkUtils.registerNetworkStatusChangedListener(this)
recyclerView.layoutManager =
LinearLayoutManager(context, LinearLayoutManager.VERTICAL, false)
recyclerView.adapter = mAdapter

preTxtBtn.setOnClickListener { pre() }
nextTxtBtn.setOnClickListener { next() }
allBtn.setOnClickListener { changeStatus(0) }
status1Btn.setOnClickListener { changeStatus(1) }
status2Btn.setOnClickListener { changeStatus(2) }
status3Btn.setOnClickListener { changeStatus(3) }
statusBtnList.add(allBtn)
statusBtnList.add(status1Btn)
statusBtnList.add(status2Btn)
statusBtnList.add(status3Btn)
keywordInput.setOnKeyListener { _, keyCode, _ ->
if (!isLoading) {
if (keyCode == KeyEvent.KEYCODE_ENTER) {
keyword = keywordInput.text.toString()
initData()
KeyboardUtils.hideSoftInput(keywordInput)
}
}
false
}
clearBtn.setOnClickListener {
keyword = ""
keywordInput.setText("")
KeyboardUtils.hideSoftInput(keywordInput)
initData()
}
var lastClickTime = TimeUtils.getNowMills()
mAdapter.setOnItemClickListener { adapter, view, position ->
val curr = TimeUtils.getNowMills()
if(curr - lastClickTime > 500){
lastClickTime = curr
mPresenter?.getDetail(mAdapter.getItem(position).id)
}
}

mAdapter.setOnItemChildClickListener { adapter, view, position ->
LogUtils.d("setOnItemChildClickListener", position)
when (view.id) {
R.id.cancelBtn -> {

}
}
}


switchBtn.setOnCheckedChangeListener { buttonView, isChecked ->
SPUtils.getInstance().put("auto_show_change", isChecked)
changeSwitchBtnTxt(isChecked)
EventBus.getDefault().post(AutoSwitchChange(2))
}
val isAutoShowLeave = SPUtils.getInstance().getBoolean("auto_show_change", false)
switchBtn.isChecked = isAutoShowLeave
changeSwitchBtnTxt(isAutoShowLeave)

switchBtnTxt.setOnClickListener {
switchBtn.isChecked = !switchBtn.isChecked
}
keywordInput.addTextChangedListener(object : TextWatcher {
override fun beforeTextChanged(s: CharSequence?, start: Int, count: Int, after: Int) {

}

override fun onTextChanged(s: CharSequence?, start: Int, before: Int, count: Int) {
if (s != null && s.isNotEmpty()) {
clearBtn.visibility = View.VISIBLE
} else {
clearBtn.visibility = View.INVISIBLE
}
}

override fun afterTextChanged(s: Editable?) {

}

})
filterLayout.setOnClickListener {
KeyboardUtils.hideSoftInput(keywordInput)
}
}


private fun changeSwitchBtnTxt(isChecked: Boolean) {
if (isChecked) {
switchBtnTxt.setTextColor(ctx.resources.getColor(R.color.green2))
} else {
switchBtnTxt.setTextColor(ctx.resources.getColor(R.color.black_3))
}
}

@SuppressLint("SetTextI18n")
private fun showLeaveDialog(detail: StuChange) {
EventBus.getDefault().post(detail)
return
val adapter = ChangeDialogStepAdapter(mutableListOf())
val dialog = BaseDialog(act, R.style.BaseDialog, R.layout.dialog_change)
//处理弹窗显示
dialog.find<TextView>(R.id.leave_student_name).text = detail.status_change_student_name
if (detail.face_key.isNotEmpty()) {
val img = dialog.find<ImageView>(R.id.face_img)
img.setSrc(detail.face_identity, detail.face_key)
img.visibility = View.VISIBLE
dialog.find<View>(R.id.face_empty).visibility = View.GONE
} else {
dialog.find<View>(R.id.face_empty).visibility = View.VISIBLE
dialog.find<View>(R.id.face_img).visibility = View.GONE
}
dialog.find<TextView>(R.id.class_name).text = "${detail.grade_name}${detail.class_name}"
dialog.find<TextView>(R.id.leave_request_type_name).text = detail.status_change_type_name
dialog.find<TextView>(R.id.statusName).text = when (detail.status) {
1 -> "待处理"
2 -> "已确认"
3 -> "已拒绝"
else -> "--"
}
dialog.find<TextView>(R.id.statusName).textColor = when (detail.status) {
1 -> Color.parseColor("#333333")
2 -> Color.parseColor("#3c7ef6")
3 -> Color.parseColor("#ff4040")
else -> Color.parseColor("#333333")
}
if (detail.getSubStatusName().isNotEmpty()) {
dialog.find<TextView>(R.id.subStatusName).text = "(${detail.getSubStatusName()})"
dialog.find<TextView>(R.id.subStatusName).textColor = when (detail.sub_status) {
0, 2 -> Color.parseColor("#ff4040")
1, 3 -> Color.parseColor("#07c160")
else -> Color.parseColor("#333333")
}
} else {
dialog.find<TextView>(R.id.subStatusName).text = ""
}
var time = "--"
if (detail.start_time > 0) {
time = detail.start_time.toDay()
}
if (detail.end_time > 0) {
time = "$time -- ${detail.end_time.toDay()}"
}
dialog.find<TextView>(R.id.add_time).text = time
if (detail.status_change_reason.isNotEmpty()) {
dialog.find<View>(R.id.remarkLayout).visibility = View.VISIBLE
dialog.find<TextView>(R.id.leave_request_reason).text = detail.status_change_reason
} else {
dialog.find<View>(R.id.remarkLayout).visibility = View.GONE
}
dialog.find<ImageView>(R.id.statusImg).setSrc(detail.getStatusImg())

dialog.find<RecyclerView>(R.id.stepRecycler)
val recyclerView = dialog.find<RecyclerView>(R.id.stepRecycler)
recyclerView.layoutManager =
LinearLayoutManager(context, LinearLayoutManager.VERTICAL, false)
recyclerView.adapter = adapter
adapter.setList(detail.getStep())

dialog.find<View>(R.id.closeBtn).setOnClickListener {
dialog.hide()
val index = mShowList.indexOfFirst { it.id == detail.id }
if (index >= 0) {
mShowList.removeAt(index)
}
val dialogIndex = mShowDialogList.indexOfFirst { it.getLeaveId() == detail.id }
if (index >= 0) {
mShowDialogList.removeAt(dialogIndex)
}
val showItem = mShowDialogList.find { !it.showed }
showItem?.apply {
show()
}

}
val showList = mShowDialogList.filter { it.showed }
if (showList.isEmpty()) {
dialog.show()
dialog.showed = true
}
dialog.hideNavigationBar()
dialog.setLeaveId(detail.id)
mShowDialogList.add(dialog)
}

private fun changeStatusBtn(idx: Int) {
statusBtnList.forEachIndexed { index, button ->
if (index == idx) {
button.textColor = Color.parseColor("#ffffff")
button.setBackgroundColor(Color.parseColor("#3ca0e9"))
button.setStrokeColors(ColorStateList.valueOf(Color.parseColor("#3ca0e9")))
} else {
button.textColor = Color.parseColor("#808080")
button.setBackgroundColor(Color.parseColor("#ffffff"))
button.setStrokeColors(ColorStateList.valueOf(Color.parseColor("#dcdee0")))
}
}
}

private fun changeStatus(status: Int) {
KeyboardUtils.hideSoftInput(keywordInput)
if (isLoading) {
return
}
changeStatusBtn(status)
this.status = if (status == 0) {
""
} else {
"${status}"
}
initData()
}

override fun initData() {

mPager.page_no = 1
if (NetworkUtils.isConnected()) {
showEmpty(1)
isLoading = true
mPresenter?.getList(mPager.page_no, keyword, status)
} else {
showEmpty(2)
}

}

/**
* type 1 loading 2 neterror 3 empty
*/
private fun showEmpty(type: Int) {
when (type) {
1 -> {
mAdapter.setEmptyView(R.layout.layout_loading)
mAdapter.emptyLayout?.apply {
this.QMUIEmptyView.setLoadingShowing(true)
this.QMUIEmptyView.setTitleText("数据加载中")
}
}
2 -> {
mAdapter.setEmptyView(R.layout.layout_loading)
mAdapter.emptyLayout?.apply {
this.QMUIEmptyView.show(false, null, "网络连接异常,请检查", "去设置") {
NetworkUtils.openWirelessSettings()
}
}
}
3 -> {
mAdapter.setEmptyView(R.layout.layout_empty)
}
}

}

private fun refreshData() {
if (isLoading) {
return
}
isLoading = true
mPresenter?.getList(mPager.page_no, keyword, status)
}

private fun pre() {
KeyboardUtils.hideSoftInput(keywordInput)
if (isLoading) {
return
}
if (mPager.page_no <= 1) {
} else {
isLoading = true
mPresenter?.getList(mPager.page_no - 1, keyword, status)
}
}

private fun next() {
KeyboardUtils.hideSoftInput(keywordInput)
if (isLoading) {
return
}
if (mPager.page_no >= mPager.total_pages) {
} else {
isLoading = true
mPresenter?.getList(mPager.page_no + 1, keyword, status)
}
}

override fun initPresenter(): ChangePresenter = ChangePresenter(this)

@SuppressLint("SetTextI18n")
override fun onListSuccess(list: MutableList<StuChange>, pager: Pager) {
pageTv?.apply {
mAdapter.setList(list)
mPager = pager
pageTv.text = "${pager.page_no} / ${pager.total_pages}"
totalTv.text = "共${pager.total_count}条"

val disabledColor = Color.parseColor("#666666")
val color = Color.parseColor("#3ca0e9")
if (pager.page_no <= 1) {
preTxtBtn.textColor = disabledColor
} else {
preTxtBtn.textColor = color
}

if (pager.page_no >= pager.total_pages) {
nextTxtBtn.textColor = disabledColor
} else {
nextTxtBtn.textColor = color
}
isLoading = false
showEmpty(3)
pageTv.postDelayed({
refreshData()
}, 30 * 1000)
}
}

override fun onStop() {
pageTv.removeCallbacks(refreshRun)
super.onStop()
EventBus.getDefault().unregister(this)
}


override fun onStart() {
super.onStart()
EventBus.getDefault().register(this)
}

override fun onListError(error: String) {
isLoading = false
}

override fun onDetailSuccess(detail: StuChange) {
pageTv?.apply {
val item = mShowList.find { it.id == detail.id }
if (item != null) {
//替换新的数据
val index = mShowList.indexOf(item)
mShowList[index] = detail

//移除原本的dialog
val dialogIndex = mShowDialogList.indexOfFirst { it.getLeaveId() == item.id }
if (dialogIndex > -1) {
mShowDialogList[dialogIndex].hide()
mShowDialogList.removeAt(dialogIndex)
}

} else {
mShowList.add(detail)
}
showLeaveDialog(detail)
}
}

override fun onDetailError(error: String) {

}

override fun onDisconnected() {

}

override fun onConnected(networkType: NetworkUtils.NetworkType?) {
refreshData()
}

override fun onActivityResult(requestCode: Int, resultCode: Int, data: Intent?) {
if (resultCode == Activity.RESULT_OK) {


}
super.onActivityResult(requestCode, resultCode, data)
}

override fun onSuccess(identity: String, key: String) {
LogUtils.d(identity, key)

}

override fun onError(msg: String) {
LogUtils.d(msg)


}

//接收消息
@Subscribe(threadMode = ThreadMode.MAIN)
fun onMessageEvent(event: MessageEventAuto) {
val list = event.list.filter { it.type == 1 }.toMutableList()
if (list.isNotEmpty() && switchBtn.isChecked) {
list.forEachIndexed { index, leaveID ->
pageTv.postDelayed({
mPresenter?.getDetail(leaveID.id)
}, 500L * index)
}
}
}

//接收消息
@Subscribe(threadMode = ThreadMode.MAIN)
fun onMessageRefreshEvent(event: RefreshTokenEvent) {
refreshData()
}

//接收消息
@Subscribe(threadMode = ThreadMode.MAIN)
fun onMessageEvent(event: TimeShow) {
timeView.setTime(event)
}
}


+ 68
- 37
app/src/main/java/com/yzx/escreen/fragment/HomeFragment.kt Näytä tiedosto

@@ -6,8 +6,6 @@ import android.app.Activity
import android.content.Intent import android.content.Intent
import android.content.res.ColorStateList import android.content.res.ColorStateList
import android.graphics.Color import android.graphics.Color
import android.os.Handler
import android.os.Looper
import android.text.Editable import android.text.Editable
import android.text.TextWatcher import android.text.TextWatcher
import android.view.KeyEvent import android.view.KeyEvent
@@ -34,6 +32,9 @@ import com.yzx.escreen.utils.*
import com.yzx.escreen.widget.BaseDialog import com.yzx.escreen.widget.BaseDialog
import kotlinx.android.synthetic.main.fragment_home.* import kotlinx.android.synthetic.main.fragment_home.*
import kotlinx.android.synthetic.main.layout_loading.view.* import kotlinx.android.synthetic.main.layout_loading.view.*
import org.greenrobot.eventbus.EventBus
import org.greenrobot.eventbus.Subscribe
import org.greenrobot.eventbus.ThreadMode
import org.jetbrains.anko.find import org.jetbrains.anko.find
import org.jetbrains.anko.support.v4.act import org.jetbrains.anko.support.v4.act
import org.jetbrains.anko.support.v4.ctx import org.jetbrains.anko.support.v4.ctx
@@ -69,15 +70,9 @@ class HomeFragment : BaseFragment<HomePresenter>(), HomeView,
private var mCancelFaceImg: ImageView? = null private var mCancelFaceImg: ImageView? = null
private var mDialogVacation: BaseDialog? = null private var mDialogVacation: BaseDialog? = null
private val mVacation = Vacation() private val mVacation = Vacation()
private val mVacationAttachment = Attachment("","","")
private val mVacationAttachment = Attachment("", "", "")



private val mHandler = Handler(Looper.getMainLooper())
private val runnable = object : Runnable {
override fun run() {
mPresenter?.getLeaveShowIds()
mHandler.postDelayed(this, 2000)
}
}
private val refreshRun = Runnable { private val refreshRun = Runnable {
refreshData() refreshData()
} }
@@ -121,17 +116,25 @@ class HomeFragment : BaseFragment<HomePresenter>(), HomeView,
KeyboardUtils.hideSoftInput(keywordInput) KeyboardUtils.hideSoftInput(keywordInput)
initData() initData()
} }
var lastClickTime = TimeUtils.getNowMills()
mAdapter.setOnItemClickListener { adapter, view, position -> mAdapter.setOnItemClickListener { adapter, view, position ->
mPresenter?.getDetail(mAdapter.getItem(position).id)
val curr = TimeUtils.getNowMills()
if(curr - lastClickTime > 500){
lastClickTime = curr
mPresenter?.getDetail(mAdapter.getItem(position).id)
}
} }


mAdapter.setOnItemChildClickListener { adapter, view, position -> mAdapter.setOnItemChildClickListener { adapter, view, position ->
LogUtils.d("setOnItemChildClickListener", position) LogUtils.d("setOnItemChildClickListener", position)
when (view.id) {
R.id.cancelBtn -> {
mCancelItem = mAdapter.getItem(position)
showCancelDialog()
val curr = TimeUtils.getNowMills()
if(curr - lastClickTime > 500){
lastClickTime = curr
when (view.id) {
R.id.cancelBtn -> {
mCancelItem = mAdapter.getItem(position)
showCancelDialog()
}
} }
} }
} }
@@ -140,20 +143,16 @@ class HomeFragment : BaseFragment<HomePresenter>(), HomeView,
switchBtn.setOnCheckedChangeListener { buttonView, isChecked -> switchBtn.setOnCheckedChangeListener { buttonView, isChecked ->
SPUtils.getInstance().put("auto_show_leave", isChecked) SPUtils.getInstance().put("auto_show_leave", isChecked)
changeSwitchBtnTxt(isChecked) changeSwitchBtnTxt(isChecked)
if (!isChecked) {
mHandler.removeCallbacks(runnable)
} else {
mHandler.postDelayed(runnable, 2000)
}

} }
val isAutoShowLeave = SPUtils.getInstance().getBoolean("auto_show_leave", false) val isAutoShowLeave = SPUtils.getInstance().getBoolean("auto_show_leave", false)
switchBtn.isChecked = isAutoShowLeave switchBtn.isChecked = isAutoShowLeave
changeSwitchBtnTxt(isAutoShowLeave) changeSwitchBtnTxt(isAutoShowLeave)
if (isAutoShowLeave) {
mHandler.postDelayed(runnable, 2000)
}

switchBtnTxt.setOnClickListener { switchBtnTxt.setOnClickListener {
switchBtn.isChecked = !switchBtn.isChecked switchBtn.isChecked = !switchBtn.isChecked

EventBus.getDefault().post(AutoSwitchChange(1))
} }
keywordInput.addTextChangedListener(object : TextWatcher { keywordInput.addTextChangedListener(object : TextWatcher {
override fun beforeTextChanged(s: CharSequence?, start: Int, count: Int, after: Int) { override fun beforeTextChanged(s: CharSequence?, start: Int, count: Int, after: Int) {
@@ -176,6 +175,8 @@ class HomeFragment : BaseFragment<HomePresenter>(), HomeView,
filterLayout.setOnClickListener { filterLayout.setOnClickListener {
KeyboardUtils.hideSoftInput(keywordInput) KeyboardUtils.hideSoftInput(keywordInput)
} }


} }


@SuppressLint("SetTextI18n") @SuppressLint("SetTextI18n")
@@ -210,8 +211,8 @@ class HomeFragment : BaseFragment<HomePresenter>(), HomeView,
mDialogVacation = dialogVacation mDialogVacation = dialogVacation
} }


private fun postVacation(){
if(mVacationAttachment.id.isNotEmpty()){
private fun postVacation() {
if (mVacationAttachment.id.isNotEmpty()) {
mVacation.vacation_attachment = GsonUtils.toJson(mutableListOf(mVacationAttachment)) mVacation.vacation_attachment = GsonUtils.toJson(mutableListOf(mVacationAttachment))
} }
showLoading("销假中") showLoading("销假中")
@@ -262,6 +263,8 @@ class HomeFragment : BaseFragment<HomePresenter>(), HomeView,


@SuppressLint("SetTextI18n") @SuppressLint("SetTextI18n")
private fun showLeaveDialog(detail: StuLeave) { private fun showLeaveDialog(detail: StuLeave) {
EventBus.getDefault().post(detail)
return
val adapter = HomeDialogStepAdapter(mutableListOf()) val adapter = HomeDialogStepAdapter(mutableListOf())
val dialog = BaseDialog(act, R.style.BaseDialog, R.layout.dialog_leave) val dialog = BaseDialog(act, R.style.BaseDialog, R.layout.dialog_leave)
//处理弹窗显示 //处理弹窗显示
@@ -295,11 +298,13 @@ class HomeFragment : BaseFragment<HomePresenter>(), HomeView,


dialog.find<RecyclerView>(R.id.stepRecycler) dialog.find<RecyclerView>(R.id.stepRecycler)
val recyclerView = dialog.find<RecyclerView>(R.id.stepRecycler) val recyclerView = dialog.find<RecyclerView>(R.id.stepRecycler)
recyclerView.layoutManager =
LinearLayoutManager(context, LinearLayoutManager.VERTICAL, false)
val layoutManager = LinearLayoutManager(context, LinearLayoutManager.VERTICAL, false)
// layoutManager.stackFromEnd = true
recyclerView.layoutManager = layoutManager

recyclerView.adapter = adapter recyclerView.adapter = adapter
adapter.setList(detail.getStep()) adapter.setList(detail.getStep())
recyclerView.scrollToPosition(adapter.itemCount - 1)
dialog.find<View>(R.id.closeBtn).setOnClickListener { dialog.find<View>(R.id.closeBtn).setOnClickListener {
dialog.hide() dialog.hide()
val index = mShowList.indexOfFirst { it.id == detail.id } val index = mShowList.indexOfFirst { it.id == detail.id }
@@ -316,12 +321,12 @@ class HomeFragment : BaseFragment<HomePresenter>(), HomeView,
} }


} }
val showList = mShowDialogList.filter { it.showed }
if(showList.isEmpty()){
dialog.hideNavigationBar()
val showList = mShowDialogList.filter { it.showed }
if (showList.isEmpty()) {
dialog.show() dialog.show()
dialog.showed = true dialog.showed = true
} }
dialog.hideNavigationBar()
dialog.setLeaveId(detail.id) dialog.setLeaveId(detail.id)
mShowDialogList.add(dialog) mShowDialogList.add(dialog)
} }
@@ -458,9 +463,9 @@ class HomeFragment : BaseFragment<HomePresenter>(), HomeView,
} }


override fun onStop() { override fun onStop() {
super.onStop()
pageTv.removeCallbacks(refreshRun) pageTv.removeCallbacks(refreshRun)
mHandler.removeCallbacks(runnable)
super.onStop()
EventBus.getDefault().unregister(this)
} }


override fun onLeaveListError(error: String) { override fun onLeaveListError(error: String) {
@@ -493,17 +498,43 @@ class HomeFragment : BaseFragment<HomePresenter>(), HomeView,


} }


override fun onStart() {
super.onStart()
EventBus.getDefault().register(this)
}

//接收消息
@Subscribe(threadMode = ThreadMode.MAIN)
fun onMessageEvent(event: MessageEventAuto) {
val list = event.list.filter { it.type == 0 }.toMutableList()
if (list.isNotEmpty() && switchBtn.isChecked) {
onLeaveIDsSuccess(list)
}
}

//接收消息
@Subscribe(threadMode = ThreadMode.MAIN)
fun onMessageRefreshEvent(event: RefreshTokenEvent) {
refreshData()
}

//接收消息
@Subscribe(threadMode = ThreadMode.MAIN)
fun onMessageEvent(event: TimeShow) {
timeView.setTime(event)
}

override fun onLeaveIDsSuccess(list: MutableList<LeaveID>) { override fun onLeaveIDsSuccess(list: MutableList<LeaveID>) {


list.forEachIndexed { index, leaveID -> list.forEachIndexed { index, leaveID ->
pageTv.postDelayed({ pageTv.postDelayed({
mPresenter?.getDetail(leaveID.id) mPresenter?.getDetail(leaveID.id)
},500L*index)
}, 500L * index)
} }
} }


override fun postVacationSuccess(msg: String) { override fun postVacationSuccess(msg: String) {
showDialogToast(msg,2000L)
showDialogToast(msg, 2000L)
hideLoading() hideLoading()
mDialogVacation?.apply { mDialogVacation?.apply {
dismiss() dismiss()
@@ -513,7 +544,7 @@ class HomeFragment : BaseFragment<HomePresenter>(), HomeView,


override fun postVacationError(msg: String) { override fun postVacationError(msg: String) {
hideLoading() hideLoading()
showDialogToast(msg,2000L,QMUITipDialog.Builder.ICON_TYPE_FAIL)
showDialogToast(msg, 2000L, QMUITipDialog.Builder.ICON_TYPE_FAIL)
} }


override fun onDisconnected() { override fun onDisconnected() {


+ 24
- 1
app/src/main/java/com/yzx/escreen/fragment/MyFragment.kt Näytä tiedosto

@@ -1,7 +1,6 @@
package com.yzx.escreen.fragment package com.yzx.escreen.fragment


import android.text.InputType import android.text.InputType
import com.blankj.utilcode.util.ActivityUtils
import com.blankj.utilcode.util.KeyboardUtils import com.blankj.utilcode.util.KeyboardUtils
import com.blankj.utilcode.util.LogUtils import com.blankj.utilcode.util.LogUtils
import com.blankj.utilcode.util.ScreenUtils import com.blankj.utilcode.util.ScreenUtils
@@ -12,11 +11,17 @@ import com.yzx.escreen.activity.WebActivity
import com.yzx.escreen.config.Config import com.yzx.escreen.config.Config
import com.yzx.escreen.fragment.base.BaseFragment import com.yzx.escreen.fragment.base.BaseFragment
import com.yzx.escreen.model.TeacherInfo import com.yzx.escreen.model.TeacherInfo
import com.yzx.escreen.model.TimeShow
import com.yzx.escreen.model.User import com.yzx.escreen.model.User
import com.yzx.escreen.presenter.MyPresenter import com.yzx.escreen.presenter.MyPresenter
import com.yzx.escreen.presenter.MyView import com.yzx.escreen.presenter.MyView
import com.yzx.escreen.utils.hideNavigationBar import com.yzx.escreen.utils.hideNavigationBar
import kotlinx.android.synthetic.main.fragment_change.*
import kotlinx.android.synthetic.main.fragment_my.* import kotlinx.android.synthetic.main.fragment_my.*
import kotlinx.android.synthetic.main.fragment_my.timeView
import org.greenrobot.eventbus.EventBus
import org.greenrobot.eventbus.Subscribe
import org.greenrobot.eventbus.ThreadMode
import kotlin.system.exitProcess import kotlin.system.exitProcess


class MyFragment : BaseFragment<MyPresenter>(), MyView { class MyFragment : BaseFragment<MyPresenter>(), MyView {
@@ -145,4 +150,22 @@ class MyFragment : BaseFragment<MyPresenter>(), MyView {


} }



override fun onStop() {
super.onStop()
EventBus.getDefault().unregister(this)
}


override fun onStart() {
super.onStart()
EventBus.getDefault().register(this)
}

//接收消息
@Subscribe(threadMode = ThreadMode.MAIN)
fun onMessageEvent(event: TimeShow) {
timeView.setTime(event)
}

} }

+ 11
- 0
app/src/main/java/com/yzx/escreen/fragment/base/BaseFragment.kt Näytä tiedosto

@@ -9,6 +9,7 @@ import androidx.fragment.app.Fragment
import com.qmuiteam.qmui.widget.dialog.QMUITipDialog import com.qmuiteam.qmui.widget.dialog.QMUITipDialog
import com.yzx.escreen.presenter.base.BasePresenter import com.yzx.escreen.presenter.base.BasePresenter
import com.yzx.escreen.utils.hideNavigationBar import com.yzx.escreen.utils.hideNavigationBar
import org.greenrobot.eventbus.EventBus


/** /**
* fragment 基类 * fragment 基类
@@ -54,6 +55,16 @@ abstract class BaseFragment<out P : BasePresenter<*>> : Fragment() {
initData() initData()
} }


override fun onStart() {
super.onStart()

}

override fun onStop() {
super.onStop()

}



override fun onDestroy() { override fun onDestroy() {
super.onDestroy() super.onDestroy()


+ 38
- 0
app/src/main/java/com/yzx/escreen/model/MessageEvent.kt Näytä tiedosto

@@ -0,0 +1,38 @@
package com.yzx.escreen.model

import com.blankj.utilcode.util.TimeUtils
import com.yzx.escreen.utils.zhCn
import java.util.*

data class MessageEventAuto(
var list: MutableList<LeaveID>,
val type: Int = 0
)

data class AutoSwitchChange(val type: Int)

data class RefreshTokenEvent(val token: String)


data class TimeShow(
var year: String = "",
var month: String = "",
var day: String = "",
var hour: String = "",
var min: String = "",
var sec: String = "",
var week: String = ""
) {
fun getNowObj(): TimeShow {
//yyyy-MM-dd HH:mm:ss
year = TimeUtils.getNowString(TimeUtils.getSafeDateFormat("yyyy").zhCn())
month = TimeUtils.getNowString(TimeUtils.getSafeDateFormat("MM").zhCn())
day = TimeUtils.getNowString(TimeUtils.getSafeDateFormat("dd").zhCn())
hour = TimeUtils.getNowString(TimeUtils.getSafeDateFormat("HH").zhCn())
min = TimeUtils.getNowString(TimeUtils.getSafeDateFormat("mm").zhCn())
sec = TimeUtils.getNowString(TimeUtils.getSafeDateFormat("ss").zhCn())
week = TimeUtils.getChineseWeek(System.currentTimeMillis()).replace("周","星期")
return this
}

}

+ 5
- 0
app/src/main/java/com/yzx/escreen/model/ReToken.kt Näytä tiedosto

@@ -0,0 +1,5 @@
package com.yzx.escreen.model

class ReToken (
val token:String
)

+ 209
- 0
app/src/main/java/com/yzx/escreen/model/StuChange.kt Näytä tiedosto

@@ -0,0 +1,209 @@
package com.yzx.escreen.model

import com.yzx.escreen.config.Config

data class StuChangeType(
val id: Int = 0,
val label: String = "",
val shortLabel: String = ""
) {
fun getShortLabelVal(): String {
if (shortLabel.isNotEmpty()) {
return shortLabel
}
return label
}
}

data class StuChange(
val activities: List<ChangeActivity> = mutableListOf(),
val add_time: Int = 0,
val add_user_id: Int = 0,
val add_user_name: String = "",
val attachment: String = "",
val attachments: List<Any> = listOf(),
val can_reviewed: Int = 0,
val class_id: Int = 0,
val class_name: String = "",
val end_time: Int = 0,
val face_identity: String = "",
val face_key: String = "",
val grade_id: Int = 0,
val grade_name: String = "",
val headteacher_id: Int = 0,
val id: Int = 0,
val is_cancel_change: Int = 0,
val is_delete: Int = 0,
val is_resume_school: Int = 0,
val new_todo_list_id: Int = 0,
val school_id: Int = 0,
val school_name: String = "",
val sign_identity: String = "",
val sign_key: String = "",
val start_time: Int = 0,
val status: Int = 0,
val status_change_reason: String = "",
val status_change_student_id: Int = 0,
val status_change_student_name: String = "",
val status_change_type: Int = 0,
val status_change_type_name: String = "",
val sub_status: Int = 0,
val target_class_id: Int = 0,
val target_class_name: String = "",
val target_grade_id: Int = 0,
val target_grade_name: String = "",
val target_headteacher_id: Int = 0,
val target_school_id: Int = 0,
val target_school_name: String = "",
val target_status: Int = 0,
val todo_list_id: Int = 0,
val type: Int = 0
) {
fun getStatusImg(): String {
return when {
getSubStatusName().isNotEmpty() -> {
"https://oa-edu-1259243469.cos.ap-chengdu.myqcloud.com/public/mini/statuschange/${getSubStatusIcon()}.png"
}
status == 1 -> "https://oa-edu-1259243469.cos.ap-chengdu.myqcloud.com/public/mini/stutakeleave_wait.png"
status == 2 -> "https://oa-edu-1259243469.cos.ap-chengdu.myqcloud.com/public/mini/stutakeleave_pass.png"
status == 3 -> "https://oa-edu-1259243469.cos.ap-chengdu.myqcloud.com/public/mini/stutakeleave_nopass.png"
else -> ""
}
}

fun getSubStatusIcon(
changeType: Int = status_change_type,
subStatus: Int = sub_status
): String {
if (is_resume_school == 1) {
return "resume_school"
}
return when (subStatus) {
0 -> "change0"
else -> {
"${changeType}_${subStatus}"
}
}
}

fun getSubStatusName(
changeType: Int = status_change_type,
subStatus: Int = sub_status
): String {
if (status != 2) {
return ""
}
if (is_resume_school == 1) {
return "恢复上学"
}
//其他type 无子状态
when (changeType) {
Config.STU_CHANGE_STATUS_LEAVE_SCHOOL -> {
return when (subStatus) {
0 -> {
"未开始"
}
1 -> {
"休学中"
}
else -> {
"休学结束"
}
}
}
Config.STU_CHANGE_STATUS_OUT_SCHOOL -> {
return when (subStatus) {
0 -> {
"未开始"
}
else -> {
"已退学"
}
}
}
Config.STU_CHANGE_STATUS_INTROSPECTION -> {
return when (subStatus) {
0 -> {
"未开始"
}
1 -> {
"反省中"
}
else -> {
"反省结束"
}
}
}
Config.STU_CHANGE_STATUS_INTERNSHIP -> {
return when (subStatus) {
0 -> {
"未开始"
}
1 -> {
"实习中"
}
else -> {
"实习结束"
}
}
}
Config.STU_CHANGE_STATUS_DROP_OUT -> {
return when (subStatus) {
0 -> {
"未开始"
}
else -> {
"已辍学"
}
}
}
Config.STU_CHANGE_STATUS_TRANSFER_OUT -> {
return when (subStatus) {
0 -> {
"未开始"
}
else -> {
"已转出"
}
}
}
}
return ""
}

fun getStep(): List<ChangeActivity> {
return activities.reversed()
}

}

data class ChangeActivity(
val activity_name: String = "",
val add_time: Int = 0,
val add_user_id: Int = 0,
val add_user_name: String = "",
val add_user_type: Int = 0,
val approval_comments: String = "",
val approval_status: Int = 0,
val approve_node: Int = 0,
val approve_sort: Int = 0,
val approve_user_type: Int = 0,
val approve_way: Int = 0,
val id: Int = 0,
val is_approve: Int = 0,
val is_auto_pass: Int = 0,
val related_id: Int = 0,
val relation_id: Int = 0,
val report_end_date: Int = 0,
val report_start_date: Int = 0,
val role_type: Int = 0,
val school_name: String = "",
val sign_identity: String = "",
val sign_key: String? = "",
val status: Int = 0,
val sub_type: String = "",
val type: Int = 0,
val unit_id: Int = 0,
val unit_name: String = "",
val vacation_type: Int = 0
)

+ 11
- 12
app/src/main/java/com/yzx/escreen/model/StuLeave.kt Näytä tiedosto

@@ -1,9 +1,10 @@
package com.yzx.escreen.model package com.yzx.escreen.model


import android.app.Dialog
import com.blankj.utilcode.util.LogUtils
import android.os.Parcelable
import com.yzx.escreen.utils.durationStr import com.yzx.escreen.utils.durationStr
import kotlinx.android.parcel.Parcelize


@Parcelize
data class StuLeave( data class StuLeave(
val activities: MutableList<LeaveActivity> = mutableListOf(), val activities: MutableList<LeaveActivity> = mutableListOf(),
val add_time: Int = 0, val add_time: Int = 0,
@@ -11,7 +12,6 @@ data class StuLeave(
val add_user_name: String = "", val add_user_name: String = "",
val add_user_type: Int = 0, val add_user_type: Int = 0,
val approve_time: Int = 0, val approve_time: Int = 0,
val attachments: List<Any> = listOf(),
val can_reviewed: Int = 0, val can_reviewed: Int = 0,
val class_id: Int = 0, val class_id: Int = 0,
val class_name: String = "", val class_name: String = "",
@@ -32,14 +32,13 @@ data class StuLeave(
val leave_student_id: Int = 0, val leave_student_id: Int = 0,
val leave_student_name: String = "", val leave_student_name: String = "",
val relation_id: Int = 0, val relation_id: Int = 0,
val request_status: Any = Any(),
val school_id: Int = 0, val school_id: Int = 0,
val school_name: String = "", val school_name: String = "",
val start_time: Int = 0, val start_time: Int = 0,
val status: Int = 0, val status: Int = 0,
val todo_list_id: Int = 0, val todo_list_id: Int = 0,
val todo_status: Int = 0 val todo_status: Int = 0
) {
) : Parcelable {


fun getStep(): MutableList<LeaveActivity> { fun getStep(): MutableList<LeaveActivity> {
val logList = mutableListOf<LeaveActivity>() val logList = mutableListOf<LeaveActivity>()
@@ -135,9 +134,9 @@ data class StuLeave(
} }
} }


data class LeaveID(var id: Int)
@Parcelize
data class LeaveID(var id: Int,var type:Int) : Parcelable
@Parcelize
data class LeaveActivity( data class LeaveActivity(
var activity_name: String = "", var activity_name: String = "",
var add_time: Int = 0, var add_time: Int = 0,
@@ -162,7 +161,7 @@ data class LeaveActivity(
var sign_identity: String = "", var sign_identity: String = "",
var sign_key: String = "", var sign_key: String = "",
var status: Int = 0, var status: Int = 0,
var sub_type: Any = Any(),
var sub_type: Int = 0,
var type: Int = 0, var type: Int = 0,
var unit_id: Int = 0, var unit_id: Int = 0,
var unit_name: String = "", var unit_name: String = "",
@@ -171,7 +170,7 @@ data class LeaveActivity(
var vacation_type: Int = 0, var vacation_type: Int = 0,
var color: String = "", var color: String = "",
val face_infos: MutableList<FaceInfo> = mutableListOf() val face_infos: MutableList<FaceInfo> = mutableListOf()
) {
) : Parcelable {
fun getInImg(): FaceInfo? { fun getInImg(): FaceInfo? {
val imgList = face_infos.filter { it.isImg() } val imgList = face_infos.filter { it.isImg() }
if (imgList.isNotEmpty()) { if (imgList.isNotEmpty()) {
@@ -180,12 +179,12 @@ data class LeaveActivity(
return null return null
} }
} }
@Parcelize
data class FaceInfo( data class FaceInfo(
var attachment_name: String = "", var attachment_name: String = "",
var attachment_id: String = "", var attachment_id: String = "",
var identity: String = "" var identity: String = ""
) {
) : Parcelable {
fun isImg(): Boolean { fun isImg(): Boolean {
if (attachment_name.isNullOrBlank()) { if (attachment_name.isNullOrBlank()) {
return false return false


+ 77
- 0
app/src/main/java/com/yzx/escreen/presenter/ChangePresenter.kt Näytä tiedosto

@@ -0,0 +1,77 @@
package com.yzx.escreen.presenter

import com.blankj.utilcode.util.LogUtils
import com.lzy.okgo.OkGo
import com.lzy.okgo.model.Response
import com.yzx.escreen.config.Config
import com.yzx.escreen.model.*
import com.yzx.escreen.presenter.base.*
import com.yzx.webebook.config.YzxInterface

class ChangePresenter(view: ChangeView) : BasePresenter<ChangeView>(view) {


fun getList(pageNo: Int, keyword: String, status: String) {
if(!User.isLogin()){
return
}
val url = "${Config.BASE_URL}${YzxInterface.INTERFACE_STUDENT_GET_CHANGE_LIST}"
OkGo.post<YzxResponse<StuChange>>(url)
.tag(this)
.params("keyword", keyword)
.params("status", status)
.params("page_size", 6)
.params("page_no", pageNo)
.execute(object : JsonCallBack<YzxResponse<StuChange>>() {


override fun onSuccess(response: Response<YzxResponse<StuChange>>?) {
LogUtils.d(response)
if (response?.isSuccessful == true) {
mView?.onListSuccess(response.body().list, response.body().pager)
}
}

override fun onError(response: Response<YzxResponse<StuChange>>?) {
super.onError(response)
LogUtils.d(response)
mView?.onListError(response?.body()?.msg ?: "")
}
})
}
fun getDetail(id: Int) {
if(!User.isLogin()){
return
}
val url = "${Config.BASE_URL}${YzxInterface.INTERFACE_STUDENT_GET_CHANGE_DETAIL}"
OkGo.post<YzxResponse<StuChange>>(url)
.tag(this)
.params("id", id)
.execute(object : JsonCallBack<YzxResponse<StuChange>>() {


override fun onSuccess(response: Response<YzxResponse<StuChange>>?) {
LogUtils.d(response)
if (response?.isSuccessful == true) {
mView?.onDetailSuccess(response.body().data)
}
}

override fun onError(response: Response<YzxResponse<StuChange>>?) {
super.onError(response)
LogUtils.d(response)
mView?.onDetailError(response?.body()?.msg ?: "")
}
})
}


}

interface ChangeView : IView {
fun onListSuccess(list: MutableList<StuChange>, pager: Pager)
fun onListError(error: String)
fun onDetailSuccess(detail: StuChange)
fun onDetailError(error: String)
}

+ 46
- 0
app/src/main/java/com/yzx/escreen/presenter/MainPresenter.kt Näytä tiedosto

@@ -0,0 +1,46 @@
package com.yzx.escreen.presenter

import com.blankj.utilcode.util.LogUtils
import com.lzy.okgo.OkGo
import com.lzy.okgo.model.Response
import com.yzx.escreen.config.Config
import com.yzx.escreen.model.LeaveID
import com.yzx.escreen.model.User
import com.yzx.escreen.presenter.base.BasePresenter
import com.yzx.escreen.presenter.base.IView
import com.yzx.escreen.presenter.base.JsonCallBack
import com.yzx.escreen.presenter.base.YzxResponse
import com.yzx.webebook.config.YzxInterface

class MainPresenter(view: MainView) : BasePresenter<MainView>(view) {



fun getLeaveShowIds() {
if(!User.isLogin()){
return
}
val url = "${Config.BASE_URL}${YzxInterface.INTERFACE_STUDENT_GET_SHOW_BOX_LIST}"
OkGo.post<YzxResponse<LeaveID>>(url)
.tag(this)
.execute(object : JsonCallBack<YzxResponse<LeaveID>>() {
override fun onSuccess(response: Response<YzxResponse<LeaveID>>?) {
if (response?.isSuccessful == true) {
mView?.onLeaveIDsSuccess(response.body().list)
LogUtils.d("getLeaveShowIds",response.body().list)
}
}

override fun onError(response: Response<YzxResponse<LeaveID>>?) {
super.onError(response)
LogUtils.d(response)
}
})
}


}

interface MainView : IView {
fun onLeaveIDsSuccess(list: MutableList<LeaveID>)
}

+ 20
- 9
app/src/main/java/com/yzx/escreen/utils/KotlinX.kt Näytä tiedosto

@@ -2,9 +2,11 @@ package com.yzx.escreen.utils


import android.app.Dialog import android.app.Dialog
import android.view.View import android.view.View
import android.view.WindowManager
import android.widget.ImageView import android.widget.ImageView
import com.blankj.utilcode.util.TimeUtils import com.blankj.utilcode.util.TimeUtils
import com.bumptech.glide.Glide import com.bumptech.glide.Glide
import java.text.SimpleDateFormat
import java.util.* import java.util.*


fun ImageView.setSrc(identity: String, key: String) { fun ImageView.setSrc(identity: String, key: String) {
@@ -20,12 +22,16 @@ fun ImageView.setSrc(url: String) {
.into(this) .into(this)
} }


fun Int.toTime(): String {
val format = TimeUtils.getSafeDateFormat("yyyy-MM-dd HH:mm")
fun Int.toTime(format:String = "yyyy-MM-dd HH:mm"): String {
val format = TimeUtils.getSafeDateFormat(format)
format.timeZone = TimeZone.getTimeZone("GMT+8:00") format.timeZone = TimeZone.getTimeZone("GMT+8:00")
return TimeUtils.millis2String(this * 1000L, format) return TimeUtils.millis2String(this * 1000L, format)
} }


fun Int.toDay(): String {
return toTime("yyyy-MM-dd")
}

fun Int.durationStr(): String { fun Int.durationStr(): String {
val value = this val value = this
if (value <= 60) { if (value <= 60) {
@@ -61,19 +67,24 @@ fun Int.durationStr(): String {
fun Dialog.hideNavigationBar(){ fun Dialog.hideNavigationBar(){
val window = this.window val window = this.window
window?.apply { window?.apply {
window.decorView.systemUiVisibility = View.SYSTEM_UI_FLAG_HIDE_NAVIGATION
val uiOptions = View.SYSTEM_UI_FLAG_LAYOUT_STABLE or
View.SYSTEM_UI_FLAG_LAYOUT_HIDE_NAVIGATION or
View.SYSTEM_UI_FLAG_FULLSCREEN or
View.SYSTEM_UI_FLAG_HIDE_NAVIGATION or
View.SYSTEM_UI_FLAG_LAYOUT_FULLSCREEN or
View.SYSTEM_UI_FLAG_IMMERSIVE_STICKY
window.decorView.systemUiVisibility = uiOptions
window.decorView.setOnSystemUiVisibilityChangeListener { window.decorView.setOnSystemUiVisibilityChangeListener {
val uiOptions = View.SYSTEM_UI_FLAG_LAYOUT_STABLE or
View.SYSTEM_UI_FLAG_LAYOUT_HIDE_NAVIGATION or
View.SYSTEM_UI_FLAG_FULLSCREEN or
View.SYSTEM_UI_FLAG_HIDE_NAVIGATION or
View.SYSTEM_UI_FLAG_LAYOUT_FULLSCREEN or
View.SYSTEM_UI_FLAG_IMMERSIVE_STICKY
window.decorView.systemUiVisibility = uiOptions window.decorView.systemUiVisibility = uiOptions
} }
} }
} }


fun SimpleDateFormat.zhCn():SimpleDateFormat{
timeZone = TimeZone.getTimeZone("GMT+8:00")
return this
}









+ 14
- 0
app/src/main/java/com/yzx/escreen/widget/BaseDialog.kt Näytä tiedosto

@@ -2,6 +2,8 @@ package com.yzx.escreen.widget


import android.app.Dialog import android.app.Dialog
import android.content.Context import android.content.Context
import android.view.Window
import com.yzx.escreen.utils.hideNavigationBar


class BaseDialog(context: Context, themeResId: Int, res: Int) : Dialog(context, themeResId) { class BaseDialog(context: Context, themeResId: Int, res: Int) : Dialog(context, themeResId) {
private var res: Int = 0 private var res: Int = 0
@@ -9,6 +11,8 @@ class BaseDialog(context: Context, themeResId: Int, res: Int) : Dialog(context,
var showed = false var showed = false


init { init {
hideNavigationBar()
requestWindowFeature(Window.FEATURE_NO_TITLE)
setContentView(res) setContentView(res)
this.res = res this.res = res
setCanceledOnTouchOutside(false) setCanceledOnTouchOutside(false)
@@ -22,4 +26,14 @@ class BaseDialog(context: Context, themeResId: Int, res: Int) : Dialog(context,
fun getLeaveId():Int{ fun getLeaveId():Int{
return leaveId return leaveId
} }

override fun onWindowFocusChanged(hasFocus: Boolean) {
super.onWindowFocusChanged(hasFocus)
hideNavigationBar()
}

override fun show() {
hideNavigationBar()
super.show()
}
} }

+ 122
- 0
app/src/main/java/com/yzx/escreen/widget/ChangeDialog.kt Näytä tiedosto

@@ -0,0 +1,122 @@
package com.yzx.escreen.widget

import android.annotation.SuppressLint
import android.content.Context
import android.graphics.Color
import android.util.AttributeSet
import android.view.LayoutInflater
import android.view.View
import android.widget.ImageView
import android.widget.TextView
import androidx.constraintlayout.widget.ConstraintLayout
import androidx.core.content.ContextCompat
import androidx.recyclerview.widget.LinearLayoutManager
import androidx.recyclerview.widget.RecyclerView
import com.yzx.escreen.R
import com.yzx.escreen.adapter.ChangeDialogStepAdapter
import com.yzx.escreen.adapter.HomeDialogStepAdapter
import com.yzx.escreen.model.StuChange
import com.yzx.escreen.model.StuLeave
import com.yzx.escreen.utils.durationStr
import com.yzx.escreen.utils.setSrc
import com.yzx.escreen.utils.toDay
import com.yzx.escreen.utils.toTime
import kotlinx.android.synthetic.main.dialog_leave.view.*
import org.jetbrains.anko.find
import org.jetbrains.anko.textColor

/**
* 展示学生请假
*/
class ChangeDialog(
context: Context,
attrs: AttributeSet? = null,
defStyleAttr: Int = 0,
defStyleRes: Int = 0
) :
ConstraintLayout(context, attrs, defStyleAttr, defStyleRes) {

val adapter: ChangeDialogStepAdapter by lazy {
ChangeDialogStepAdapter(mutableListOf())
}
var onCloseClick: (view:View) -> Unit = {}

init {
val view = LayoutInflater.from(context).inflate(R.layout.dialog_change, null)
val layoutParams = LayoutParams(0, LayoutParams.WRAP_CONTENT)
layoutParams.matchConstraintPercentWidth = 0.8f
layoutParams.topToTop = LayoutParams.PARENT_ID
layoutParams.startToStart = LayoutParams.PARENT_ID
layoutParams.endToEnd = LayoutParams.PARENT_ID
layoutParams.bottomToBottom = LayoutParams.PARENT_ID
view.layoutParams = layoutParams
addView(view)
background = ContextCompat.getDrawable(context, R.color.dialog_bg)
setOnClickListener { } //阻止事件冒泡
}

@SuppressLint("SetTextI18n")
fun setData(detail: StuChange) {
//处理弹窗显示
find<TextView>(R.id.leave_student_name).text = detail.status_change_student_name
if (detail.face_key.isNotEmpty()) {
val img = find<ImageView>(R.id.face_img)
img.setSrc(detail.face_identity, detail.face_key)
img.visibility = View.VISIBLE
find<View>(R.id.face_empty).visibility = View.GONE
} else {
find<View>(R.id.face_empty).visibility = View.VISIBLE
find<View>(R.id.face_img).visibility = View.GONE
}
find<TextView>(R.id.class_name).text = "${detail.grade_name}${detail.class_name}"
find<TextView>(R.id.leave_request_type_name).text = detail.status_change_type_name
find<TextView>(R.id.statusName).text = when (detail.status) {
1 -> "待处理"
2 -> "已确认"
3 -> "已拒绝"
else -> "--"
}
find<TextView>(R.id.statusName).textColor = when (detail.status) {
1 -> Color.parseColor("#333333")
2 -> Color.parseColor("#3c7ef6")
3 -> Color.parseColor("#ff4040")
else -> Color.parseColor("#333333")
}
if (detail.getSubStatusName().isNotEmpty()) {
find<TextView>(R.id.subStatusName).text = "(${detail.getSubStatusName()})"
find<TextView>(R.id.subStatusName).textColor = when (detail.sub_status) {
0, 2 -> Color.parseColor("#ff4040")
1, 3 -> Color.parseColor("#07c160")
else -> Color.parseColor("#333333")
}
} else {
find<TextView>(R.id.subStatusName).text = ""
}
var time = "--"
if (detail.start_time > 0) {
time = detail.start_time.toDay()
}
if (detail.end_time > 0) {
time = "$time -- ${detail.end_time.toDay()}"
}
find<TextView>(R.id.add_time).text = time
if(detail.status_change_reason.isNotEmpty()){
find<View>(R.id.remarkLayout).visibility = View.VISIBLE
find<TextView>(R.id.leave_request_reason).text = detail.status_change_reason
}else{
find<View>(R.id.remarkLayout).visibility = View.GONE
}
find<ImageView>(R.id.statusImg).setSrc(detail.getStatusImg())

find<RecyclerView>(R.id.stepRecycler)
val recyclerView = find<RecyclerView>(R.id.stepRecycler)
recyclerView.layoutManager =
LinearLayoutManager(context, LinearLayoutManager.VERTICAL, false)
recyclerView.adapter = adapter
adapter.setList(detail.getStep())

find<View>(R.id.closeBtn).setOnClickListener {
onCloseClick(this)
}
}
}

+ 95
- 0
app/src/main/java/com/yzx/escreen/widget/LeaveDialog.kt Näytä tiedosto

@@ -0,0 +1,95 @@
package com.yzx.escreen.widget

import android.annotation.SuppressLint
import android.content.Context
import android.util.AttributeSet
import android.view.LayoutInflater
import android.view.View
import android.widget.ImageView
import android.widget.TextView
import androidx.constraintlayout.widget.ConstraintLayout
import androidx.core.content.ContextCompat
import androidx.recyclerview.widget.LinearLayoutManager
import androidx.recyclerview.widget.RecyclerView
import com.yzx.escreen.R
import com.yzx.escreen.adapter.HomeDialogStepAdapter
import com.yzx.escreen.model.StuLeave
import com.yzx.escreen.utils.durationStr
import com.yzx.escreen.utils.setSrc
import com.yzx.escreen.utils.toTime
import kotlinx.android.synthetic.main.dialog_leave.view.*
import org.jetbrains.anko.find

/**
* 展示学生请假
*/
class LeaveDialog(
context: Context,
attrs: AttributeSet? = null,
defStyleAttr: Int = 0,
defStyleRes: Int = 0
) :
ConstraintLayout(context, attrs, defStyleAttr, defStyleRes) {

val adapter: HomeDialogStepAdapter by lazy {
HomeDialogStepAdapter(mutableListOf())
}
var onCloseClick: (view:View) -> Unit = {}

init {
val view = LayoutInflater.from(context).inflate(R.layout.dialog_leave, null)
val layoutParams = LayoutParams(0, LayoutParams.WRAP_CONTENT)
layoutParams.matchConstraintPercentWidth = 0.8f
layoutParams.topToTop = LayoutParams.PARENT_ID
layoutParams.startToStart = LayoutParams.PARENT_ID
layoutParams.endToEnd = LayoutParams.PARENT_ID
layoutParams.bottomToBottom = LayoutParams.PARENT_ID
view.layoutParams = layoutParams
addView(view)
background = ContextCompat.getDrawable(context, R.color.dialog_bg)
setOnClickListener { } //阻止事件冒泡
}

@SuppressLint("SetTextI18n")
fun setData(detail: StuLeave) {
leave_student_name.text = detail.leave_student_name
if (detail.face_key.isNotEmpty()) {
val img = find<ImageView>(R.id.face_img)
img.setSrc(detail.face_identity, detail.face_key)
img.visibility = View.VISIBLE
find<View>(R.id.face_empty).visibility = View.GONE
} else {
find<View>(R.id.face_empty).visibility = View.VISIBLE
find<View>(R.id.face_img).visibility = View.GONE
}
find<TextView>(R.id.class_name).text = "${detail.grade_name}${detail.class_name}"
find<TextView>(R.id.leave_request_type_name).text = detail.leave_request_type_name
find<TextView>(R.id.leave_duration_str).text =
(detail.end_time - detail.start_time).durationStr()
find<TextView>(R.id.add_time).text =
"${detail.start_time.toTime()} - ${detail.end_time.toTime()}"
find<TextView>(R.id.leave_request_reason).text = detail.leave_request_reason
find<ImageView>(R.id.statusImg).setSrc(
when (detail.status) {
1 -> "https://oa-edu-1259243469.cos.ap-chengdu.myqcloud.com/public/mini/stutakeleave_wait.png"
2 -> "https://oa-edu-1259243469.cos.ap-chengdu.myqcloud.com/public/mini/stutakeleave_pass.png"
3 -> "https://oa-edu-1259243469.cos.ap-chengdu.myqcloud.com/public/mini/stutakeleave_nopass.png"
4 -> "https://oa-edu-1259243469.cos.ap-chengdu.myqcloud.com/public/mini/cancellation.png"
5 -> "https://oa-edu-1259243469.cos.ap-chengdu.myqcloud.com/public/mini/cancellation_overtime.png"
else -> ""
}
)

find<RecyclerView>(R.id.stepRecycler)
val recyclerView = find<RecyclerView>(R.id.stepRecycler)
val layoutManager = LinearLayoutManager(context, LinearLayoutManager.VERTICAL, false)
recyclerView.layoutManager = layoutManager

recyclerView.adapter = adapter
adapter.setList(detail.getStep())
recyclerView.scrollToPosition(adapter.itemCount - 1)
find<View>(R.id.closeBtn).setOnClickListener {
onCloseClick(this)
}
}
}

+ 28
- 0
app/src/main/java/com/yzx/escreen/widget/TimeView.kt Näytä tiedosto

@@ -0,0 +1,28 @@
package com.yzx.escreen.widget

import android.annotation.SuppressLint
import android.content.Context
import android.util.AttributeSet
import android.view.LayoutInflater
import android.widget.FrameLayout
import com.yzx.escreen.R
import com.yzx.escreen.model.TimeShow
import kotlinx.android.synthetic.main.view_time.view.*

class TimeView(context: Context, attrs: AttributeSet) :
FrameLayout(context, attrs) {

init {
val view = LayoutInflater.from(context).inflate(R.layout.view_time, null)
addView(view)
}

@SuppressLint("SetTextI18n")
fun setTime(timeShow: TimeShow) {
hour.text = timeShow.hour
min.text = timeShow.min
sec.text = timeShow.sec
week.text = timeShow.week
year.text = "${timeShow.year}年${timeShow.month}月${timeShow.day}日"
}
}

+ 35
- 26
app/src/main/res/layout/activity_main.xml Näytä tiedosto

@@ -1,38 +1,47 @@
<?xml version="1.0" encoding="utf-8"?> <?xml version="1.0" encoding="utf-8"?>
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
<FrameLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
xmlns:tl="http://schemas.android.com/apk/res-auto" xmlns:tl="http://schemas.android.com/apk/res-auto"
xmlns:tools="http://schemas.android.com/tools" xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="match_parent" android:layout_height="match_parent"
android:gravity="center_horizontal"
tools:context=".MainActivity"> tools:context=".MainActivity">


<androidx.viewpager2.widget.ViewPager2
android:id="@+id/viewPager2"
<RelativeLayout
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="match_parent" android:layout_height="match_parent"
android:layout_above="@id/bottomLine"/>
android:gravity="center_horizontal">


<View
android:id="@+id/bottomLine"
android:layout_width="match_parent"
android:layout_height="1px"
android:layout_above="@id/tabLayout"
android:background="#cacbcc" />
<androidx.viewpager2.widget.ViewPager2
android:id="@+id/viewPager2"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_above="@id/bottomLine" />


<com.flyco.tablayout.CommonTabLayout
android:id="@+id/tabLayout"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_alignParentBottom="true"
android:background="#ffffff"
android:paddingVertical="@dimen/d_10"
android:paddingTop="5dp"
android:paddingBottom="5dp"
tl:tl_iconHeight="48dp"
tl:tl_iconWidth="44dp"
tl:tl_textSelectColor="@color/colorPrimary"
tl:tl_textUnselectColor="#999999"
tl:tl_textsize="@dimen/d_24" />
<View
android:id="@+id/bottomLine"
android:layout_width="match_parent"
android:layout_height="1px"
android:layout_above="@id/tabLayout"
android:background="#cacbcc" />


</RelativeLayout>
<com.flyco.tablayout.CommonTabLayout
android:id="@+id/tabLayout"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_alignParentBottom="true"
android:background="#ffffff"
android:paddingVertical="@dimen/d_10"
android:paddingTop="5dp"
android:paddingBottom="5dp"
tl:tl_iconHeight="48dp"
tl:tl_iconWidth="44dp"
tl:tl_textSelectColor="@color/colorPrimary"
tl:tl_textUnselectColor="#999999"
tl:tl_textsize="@dimen/d_24" />
</RelativeLayout>
<FrameLayout
android:id="@+id/dialogLayout"
android:layout_width="match_parent"
android:layout_height="match_parent"/>
</FrameLayout>

+ 196
- 0
app/src/main/res/layout/dialog_change.xml Näytä tiedosto

@@ -0,0 +1,196 @@
<?xml version="1.0" encoding="utf-8"?>
<FrameLayout 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">

<com.qmuiteam.qmui.widget.roundwidget.QMUIRoundLinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:minWidth="1400dp"
android:orientation="vertical"
app:qmui_backgroundColor="@color/white"
app:qmui_radius="@dimen/d_15">

<com.qmuiteam.qmui.widget.roundwidget.QMUIRoundFrameLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
app:qmui_backgroundColor="@color/colorPrimary"
app:qmui_radiusTopLeft="@dimen/d_15"
app:qmui_radiusTopRight="@dimen/d_15">

<TextView
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:gravity="center"
android:padding="@dimen/d_28"
android:text="异动单详情"
android:textColor="@color/white"
android:textSize="@dimen/sp20"
android:textStyle="bold" />
</com.qmuiteam.qmui.widget.roundwidget.QMUIRoundFrameLayout>

<androidx.appcompat.widget.LinearLayoutCompat
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginTop="@dimen/d_20"
android:orientation="horizontal">

<RelativeLayout
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_weight="1">

<ImageView
android:id="@+id/statusImg"
android:layout_width="200dp"
android:layout_height="200dp"
android:layout_alignParentEnd="true"
android:layout_marginEnd="40dp" />

<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="vertical">

<LinearLayout style="@style/leave_dialog_row">

<TextView
style="@style/leave_dialog_title"
android:text="请假学生" />

<TextView
android:id="@+id/leave_student_name"
style="@style/leave_dialog_left_content"
android:text="颜小华" />
</LinearLayout>

<LinearLayout style="@style/leave_dialog_row">

<TextView
style="@style/leave_dialog_title"
android:text="学生人脸" />

<com.qmuiteam.qmui.widget.QMUIRadiusImageView
android:id="@+id/face_img"
android:layout_width="180dp"
android:layout_height="222dp"
android:text="颜小华"
app:qmui_border_color="@color/white"
app:qmui_corner_radius="@dimen/d_5" />

<TextView
android:id="@+id/face_empty"
android:layout_width="180dp"
android:layout_height="222dp"
android:background="@color/gray_2"
android:gravity="center"
android:text="未设置"
android:textColor="@color/white"
app:qmui_corner_radius="@dimen/d_5" />
</LinearLayout>

<LinearLayout style="@style/leave_dialog_row">

<TextView
style="@style/leave_dialog_title"
android:text="班级" />

<TextView
android:id="@+id/class_name"
style="@style/leave_dialog_left_content"
android:text="颜小华" />
</LinearLayout>

<LinearLayout style="@style/leave_dialog_row">

<TextView
style="@style/leave_dialog_title"
android:text="类型" />

<TextView
android:id="@+id/leave_request_type_name"
style="@style/leave_dialog_left_content"
android:text="颜小华" />
</LinearLayout>

<LinearLayout style="@style/leave_dialog_row">

<TextView
style="@style/leave_dialog_title"
android:text="时间" />

<TextView
android:id="@+id/add_time"
style="@style/leave_dialog_left_content"
android:textColor="@color/colorPrimary"
tools:text="2022年4月21日15:38:15" />
</LinearLayout>

<LinearLayout style="@style/leave_dialog_row">

<TextView
style="@style/leave_dialog_title"
android:text="状态" />

<TextView
android:id="@+id/statusName"
style="@style/leave_dialog_left_content"
tools:text="2022年4月21日15:38:15" />

<TextView
android:id="@+id/subStatusName"
style="@style/leave_dialog_left_content"
tools:text="2022年4月21日15:38:15" />
</LinearLayout>

<LinearLayout
android:id="@+id/remarkLayout"
style="@style/leave_dialog_row">

<TextView
style="@style/leave_dialog_title"
android:text="备注" />

<TextView
android:id="@+id/leave_request_reason"
style="@style/leave_dialog_left_content"
tools:text="2022年4月21日15:38:15" />
</LinearLayout>
</LinearLayout>
</RelativeLayout>

<LinearLayout
android:layout_width="0dp"
android:layout_height="700dp"
android:layout_marginStart="50dp"
android:layout_weight="1"
android:orientation="vertical"
android:paddingTop="@dimen/dp_40">

<androidx.recyclerview.widget.RecyclerView
android:id="@+id/stepRecycler"
android:layout_width="match_parent"
android:layout_height="match_parent"
tools:itemCount="4"
tools:listitem="@layout/layout_leave_step" />
</LinearLayout>
</androidx.appcompat.widget.LinearLayoutCompat>

<com.qmuiteam.qmui.widget.roundwidget.QMUIRoundButton
android:id="@+id/closeBtn"
android:layout_width="300dp"
android:layout_height="80dp"
android:layout_gravity="center_horizontal"
android:layout_marginTop="@dimen/dp_40"
android:layout_marginBottom="@dimen/d_20"
android:padding="@dimen/d_10"
android:text="关闭"
android:textColor="@color/black"
android:textSize="@dimen/sp20"
app:qmui_borderColor="@color/gray"
app:qmui_radius="@dimen/d_5" />
</com.qmuiteam.qmui.widget.roundwidget.QMUIRoundLinearLayout>
</FrameLayout>

+ 2
- 2
app/src/main/res/layout/dialog_leave.xml Näytä tiedosto

@@ -83,8 +83,8 @@


<TextView <TextView
android:id="@+id/face_empty" android:id="@+id/face_empty"
android:layout_width="77dp"
android:layout_height="95dp"
android:layout_width="180dp"
android:layout_height="222dp"
android:background="@color/gray_2" android:background="@color/gray_2"
android:gravity="center" android:gravity="center"
android:text="未设置" android:text="未设置"


+ 269
- 0
app/src/main/res/layout/fragment_change.xml Näytä tiedosto

@@ -0,0 +1,269 @@
<?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:background="@color/backgroundColor"
android:orientation="vertical"
tools:context=".fragment.ChangeFragment">

<androidx.appcompat.widget.LinearLayoutCompat
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:background="@color/white"
android:gravity="center_vertical"
android:orientation="horizontal"
android:padding="30dp"
android:paddingStart="@dimen/d_20">

<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="学生学籍异动列表"
android:textColor="@color/black"
android:textSize="@dimen/d_28"
android:textStyle="bold" />

<View
android:layout_width="0dp"
android:layout_height="1dp"
android:layout_weight="1" />

<com.yzx.escreen.widget.TimeView
android:id="@+id/timeView"
android:layout_width="wrap_content"
android:layout_height="wrap_content"/>
</androidx.appcompat.widget.LinearLayoutCompat>


<androidx.appcompat.widget.LinearLayoutCompat
android:id="@+id/filterLayout"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:paddingHorizontal="@dimen/dp_40"
android:paddingVertical="30dp">

<com.qmuiteam.qmui.widget.roundwidget.QMUIRoundLinearLayout
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:gravity="center_vertical"
android:orientation="horizontal"
android:paddingStart="@dimen/d_10"
android:paddingEnd="@dimen/dp_10"
app:qmui_backgroundColor="@color/white"
app:qmui_borderColor="#dcdee0"
app:qmui_borderWidth="1px"
app:qmui_radius="@dimen/d_30">

<androidx.appcompat.widget.AppCompatImageView
android:layout_width="@dimen/d_25"
android:layout_height="@dimen/d_25"
android:src="@mipmap/search" />

<EditText
android:id="@+id/keywordInput"
android:layout_width="300dp"
android:layout_height="60dp"
android:background="@color/transparent"
android:hint="输入学生姓名"
android:imeOptions="actionSearch"
android:maxLength="5"
android:padding="@dimen/d_5"
android:paddingTop="@dimen/d_5"
android:paddingBottom="@dimen/d_5"
android:singleLine="true"
android:textColorHint="#8e8e8e"
android:textSize="@dimen/sp20" />

<androidx.appcompat.widget.AppCompatImageView
android:id="@+id/clearBtn"
android:layout_width="@dimen/d_25"
android:layout_height="@dimen/d_25"
android:src="@mipmap/ic_clear"
android:visibility="invisible" />
</com.qmuiteam.qmui.widget.roundwidget.QMUIRoundLinearLayout>

<com.qmuiteam.qmui.widget.roundwidget.QMUIRoundButton
android:id="@+id/allBtn"
style="@style/home_status_btn"
android:layout_marginStart="50dp"
android:text="全部"
android:textColor="@color/white"
app:qmui_backgroundColor="#3ca0e9"
app:qmui_borderColor="@color/colorPrimary" />

<com.qmuiteam.qmui.widget.roundwidget.QMUIRoundButton
android:id="@+id/status1Btn"
style="@style/home_status_btn"
android:text="待处理"
android:textColor="@color/gray_80"
app:qmui_backgroundColor="#fff"
app:qmui_borderColor="#dcdee0" />

<com.qmuiteam.qmui.widget.roundwidget.QMUIRoundButton
android:id="@+id/status2Btn"
style="@style/home_status_btn"
android:text="已确认"
android:textColor="@color/gray_80"
app:qmui_backgroundColor="#fff"
app:qmui_borderColor="#dcdee0" />

<com.qmuiteam.qmui.widget.roundwidget.QMUIRoundButton
android:id="@+id/status3Btn"
style="@style/home_status_btn"
android:text="已拒绝"
android:textColor="@color/gray_80"
app:qmui_backgroundColor="#fff"
app:qmui_borderColor="#dcdee0" />

<View
android:layout_width="0dp"
android:layout_height="1px"
android:layout_weight="1" />

<Switch
android:id="@+id/switchBtn"
android:layout_width="48dp"
android:layout_height="@dimen/d_28"
android:checked="true"
android:thumb="@drawable/switch_ios_thumb"
android:track="@drawable/switch_ios_track_selector"
tools:ignore="UseSwitchCompatOrMaterialXml" />

<TextView
android:id="@+id/switchBtnTxt"
android:layout_width="wrap_content"
android:layout_height="@dimen/d_28"
android:layout_gravity="center_vertical"
android:layout_marginStart="@dimen/d_10"
android:gravity="center"
android:text="自动弹出请假单"
android:textColor="#53a051" />
</androidx.appcompat.widget.LinearLayoutCompat>

<androidx.appcompat.widget.LinearLayoutCompat
android:layout_width="match_parent"
android:layout_height="0dp"
android:layout_weight="1"
android:background="@color/white"
android:orientation="vertical"
android:paddingStart="@dimen/dp_10"
android:paddingEnd="@dimen/dp_10">

<androidx.appcompat.widget.LinearLayoutCompat
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="horizontal"
android:paddingTop="@dimen/d_20"
android:paddingBottom="@dimen/d_20">

<TextView
style="@style/table_header"
android:layout_weight="1.5"
android:paddingStart="@dimen/dp_40"
android:text="异动学生" />

<TextView
style="@style/table_header"
android:layout_weight="1"
android:text="人脸" />

<TextView
style="@style/table_header"
android:layout_weight="3"
android:text="班级" />

<TextView
style="@style/table_header"
android:layout_weight="1"
android:text="类型" />

<TextView
style="@style/table_header"
android:layout_weight="4"
android:text="时间" />


<TextView
style="@style/table_header"
android:text="异动单状态" />

<TextView
style="@style/table_header"
android:text="发起时间" />

<TextView
style="@style/table_header"
android:text="发起人" />
</androidx.appcompat.widget.LinearLayoutCompat>

<View
android:layout_width="match_parent"
android:layout_height="1px"
android:background="@color/backgroundColor" />

<androidx.recyclerview.widget.RecyclerView
android:id="@+id/recyclerView"
android:layout_width="match_parent"
android:layout_height="0dp"
android:layout_weight="1"
app:layoutManager="androidx.recyclerview.widget.LinearLayoutManager"
tools:itemCount="5"
tools:listitem="@layout/layout_change_table" />

<View
android:layout_width="match_parent"
android:layout_height="1px"
android:background="@color/backgroundColor" />

<androidx.appcompat.widget.LinearLayoutCompat
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:gravity="center_vertical"
android:orientation="horizontal"
android:paddingHorizontal="@dimen/dp_40"
android:paddingVertical="@dimen/d_20">

<TextView
android:id="@+id/totalTv"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="共0条数据"
android:textSize="@dimen/sp18" />

<View
android:layout_width="0dp"
android:layout_height="1px"
android:layout_weight="1" />

<TextView
android:id="@+id/preTxtBtn"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="上一页"
android:textColor="#3ca0e9"
android:textSize="@dimen/sp18" />

<TextView
android:id="@+id/pageTv"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:paddingStart="@dimen/d_20"
android:paddingEnd="@dimen/d_20"
android:text="0/0"
android:textColor="#333"
android:textSize="@dimen/sp18" />

<TextView
android:id="@+id/nextTxtBtn"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="下一页"
android:textColor="#3ca0e9"
android:textSize="@dimen/sp18" />


</androidx.appcompat.widget.LinearLayoutCompat>
</androidx.appcompat.widget.LinearLayoutCompat>
</LinearLayout>

+ 252
- 235
app/src/main/res/layout/fragment_home.xml Näytä tiedosto

@@ -1,279 +1,296 @@
<?xml version="1.0" encoding="utf-8"?> <?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
<FrameLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto" xmlns:app="http://schemas.android.com/apk/res-auto"
xmlns:tools="http://schemas.android.com/tools" xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="match_parent" android:layout_height="match_parent"
android:background="@color/backgroundColor"
android:orientation="vertical"
tools:context=".fragment.HomeFragment"> tools:context=".fragment.HomeFragment">


<androidx.appcompat.widget.LinearLayoutCompat <androidx.appcompat.widget.LinearLayoutCompat
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="wrap_content"
android:background="@color/white"
android:gravity="center_vertical"
android:orientation="horizontal"
android:padding="10dp"
android:paddingStart="@dimen/d_20">

<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="学生请假单列表"
android:textColor="@color/black"
android:textSize="@dimen/d_28"
android:textStyle="bold" />

<View
android:layout_width="0dp"
android:layout_height="1dp"
android:layout_weight="1" />

<Switch
android:id="@+id/switchBtn"
android:layout_width="48dp"
android:layout_height="@dimen/d_28"
android:checked="true"
android:thumb="@drawable/switch_ios_thumb"
android:track="@drawable/switch_ios_track_selector"
tools:ignore="UseSwitchCompatOrMaterialXml" />

<TextView
android:id="@+id/switchBtnTxt"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginStart="@dimen/d_10"
android:text="自动弹出请假单"
android:textColor="#53a051" />
</androidx.appcompat.widget.LinearLayoutCompat>


<androidx.appcompat.widget.LinearLayoutCompat
android:id="@+id/filterLayout"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:paddingHorizontal="@dimen/dp_40"
android:paddingVertical="30dp">

<com.qmuiteam.qmui.widget.roundwidget.QMUIRoundLinearLayout
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:gravity="center_vertical"
android:orientation="horizontal"
android:paddingStart="@dimen/d_10"
android:paddingEnd="@dimen/dp_10"
app:qmui_backgroundColor="@color/white"
app:qmui_borderColor="#dcdee0"
app:qmui_borderWidth="1px"
app:qmui_radius="@dimen/d_30">

<androidx.appcompat.widget.AppCompatImageView
android:layout_width="@dimen/d_25"
android:layout_height="@dimen/d_25"
android:src="@mipmap/search" />

<EditText
android:id="@+id/keywordInput"
android:layout_width="300dp"
android:layout_height="60dp"
android:background="@color/transparent"
android:hint="输入学生姓名"
android:imeOptions="actionSearch"
android:maxLength="5"
android:padding="@dimen/d_5"
android:paddingTop="@dimen/d_5"
android:paddingBottom="@dimen/d_5"
android:singleLine="true"
android:textColorHint="#8e8e8e"
android:textSize="@dimen/sp20" />

<androidx.appcompat.widget.AppCompatImageView
android:id="@+id/clearBtn"
android:layout_width="@dimen/d_25"
android:layout_height="@dimen/d_25"
android:src="@mipmap/ic_clear"
android:visibility="invisible" />
</com.qmuiteam.qmui.widget.roundwidget.QMUIRoundLinearLayout>

<com.qmuiteam.qmui.widget.roundwidget.QMUIRoundButton
android:id="@+id/allBtn"
style="@style/home_status_btn"
android:layout_marginStart="50dp"
android:text="全部"
android:textColor="@color/white"
app:qmui_backgroundColor="#3ca0e9"
app:qmui_borderColor="@color/colorPrimary" />

<com.qmuiteam.qmui.widget.roundwidget.QMUIRoundButton
android:id="@+id/status1Btn"
style="@style/home_status_btn"
android:text="待处理"
android:textColor="@color/gray_80"
app:qmui_backgroundColor="#fff"
app:qmui_borderColor="#dcdee0" />

<com.qmuiteam.qmui.widget.roundwidget.QMUIRoundButton
android:id="@+id/status2Btn"
style="@style/home_status_btn"
android:text="已确认"
android:textColor="@color/gray_80"
app:qmui_backgroundColor="#fff"
app:qmui_borderColor="#dcdee0" />

<com.qmuiteam.qmui.widget.roundwidget.QMUIRoundButton
android:id="@+id/status3Btn"
style="@style/home_status_btn"
android:text="已拒绝"
android:textColor="@color/gray_80"
app:qmui_backgroundColor="#fff"
app:qmui_borderColor="#dcdee0" />

<com.qmuiteam.qmui.widget.roundwidget.QMUIRoundButton
android:id="@+id/status4Btn"
style="@style/home_status_btn"
android:text="正常销假"
android:textColor="@color/gray_80"
app:qmui_backgroundColor="#fff"
app:qmui_borderColor="#dcdee0" />

<com.qmuiteam.qmui.widget.roundwidget.QMUIRoundButton
android:id="@+id/status5Btn"
style="@style/home_status_btn"
android:text="超时销假"
android:textColor="@color/gray_80"
app:qmui_backgroundColor="#fff"
app:qmui_borderColor="#dcdee0" />
android:layout_height="match_parent"
android:background="@color/backgroundColor"
android:orientation="vertical">


</androidx.appcompat.widget.LinearLayoutCompat>

<androidx.appcompat.widget.LinearLayoutCompat
android:layout_width="match_parent"
android:layout_height="0dp"
android:layout_weight="1"
android:background="@color/white"
android:orientation="vertical"
android:paddingStart="@dimen/dp_10"
android:paddingEnd="@dimen/dp_10">


<androidx.appcompat.widget.LinearLayoutCompat <androidx.appcompat.widget.LinearLayoutCompat
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:background="@color/white"
android:gravity="center_vertical"
android:orientation="horizontal" android:orientation="horizontal"
android:paddingTop="@dimen/d_20"
android:paddingBottom="@dimen/d_20">

<TextView
style="@style/table_header"
android:layout_weight="1.5"
android:paddingStart="@dimen/dp_40"
android:text="请假学生" />
android:padding="30dp">


<TextView <TextView
style="@style/table_header"
android:layout_weight="1"
android:text="人脸" />

<TextView
style="@style/table_header"
android:layout_weight="3"
android:text="班级" />

<TextView
style="@style/table_header"
android:layout_weight="1"
android:text="类型" />

<TextView
style="@style/table_header"
android:layout_weight="4"
android:text="请假时间" />

<TextView
style="@style/table_header"
android:layout_weight="1.5"
android:text="请假时长" />

<TextView
style="@style/table_header"
android:text="请假单状态" />
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="学生请假单列表"
android:textColor="@color/black"
android:textSize="@dimen/d_28"
android:textStyle="bold" />


<TextView
style="@style/table_header"
android:text="申请时间" />
<View
android:layout_width="0dp"
android:layout_height="1dp"
android:layout_weight="1" />


<TextView
style="@style/table_header"
android:gravity="center"
android:text="操作" />
<com.yzx.escreen.widget.TimeView
android:id="@+id/timeView"
android:layout_width="wrap_content"
android:layout_height="wrap_content"/>
</androidx.appcompat.widget.LinearLayoutCompat> </androidx.appcompat.widget.LinearLayoutCompat>


<View
android:layout_width="match_parent"
android:layout_height="1px"
android:background="@color/backgroundColor" />

<androidx.recyclerview.widget.RecyclerView
android:id="@+id/recyclerView"
android:layout_width="match_parent"
android:layout_height="0dp"
android:layout_weight="1"
app:layoutManager="androidx.recyclerview.widget.LinearLayoutManager"
tools:itemCount="5"
tools:listitem="@layout/layout_leave_table" />

<View
android:layout_width="match_parent"
android:layout_height="1px"
android:background="@color/backgroundColor" />


<androidx.appcompat.widget.LinearLayoutCompat <androidx.appcompat.widget.LinearLayoutCompat
android:id="@+id/filterLayout"
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:gravity="center_vertical"
android:orientation="horizontal"
android:paddingHorizontal="@dimen/dp_40" android:paddingHorizontal="@dimen/dp_40"
android:paddingVertical="@dimen/d_20">
android:paddingVertical="30dp">


<TextView
android:id="@+id/totalTv"
<com.qmuiteam.qmui.widget.roundwidget.QMUIRoundLinearLayout
android:layout_width="wrap_content" android:layout_width="wrap_content"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:text="共0条数据"
android:textSize="@dimen/sp18" />
android:gravity="center_vertical"
android:orientation="horizontal"
android:paddingStart="@dimen/d_10"
android:paddingEnd="@dimen/dp_10"
app:qmui_backgroundColor="@color/white"
app:qmui_borderColor="#dcdee0"
app:qmui_borderWidth="1px"
app:qmui_radius="@dimen/d_30">

<androidx.appcompat.widget.AppCompatImageView
android:layout_width="@dimen/d_25"
android:layout_height="@dimen/d_25"
android:src="@mipmap/search" />

<EditText
android:id="@+id/keywordInput"
android:layout_width="300dp"
android:layout_height="60dp"
android:background="@color/transparent"
android:hint="输入学生姓名"
android:imeOptions="actionSearch"
android:maxLength="5"
android:padding="@dimen/d_5"
android:paddingTop="@dimen/d_5"
android:paddingBottom="@dimen/d_5"
android:singleLine="true"
android:textColorHint="#8e8e8e"
android:textSize="@dimen/sp20" />

<androidx.appcompat.widget.AppCompatImageView
android:id="@+id/clearBtn"
android:layout_width="@dimen/d_25"
android:layout_height="@dimen/d_25"
android:src="@mipmap/ic_clear"
android:visibility="invisible" />
</com.qmuiteam.qmui.widget.roundwidget.QMUIRoundLinearLayout>

<com.qmuiteam.qmui.widget.roundwidget.QMUIRoundButton
android:id="@+id/allBtn"
style="@style/home_status_btn"
android:layout_marginStart="50dp"
android:text="全部"
android:textColor="@color/white"
app:qmui_backgroundColor="#3ca0e9"
app:qmui_borderColor="@color/colorPrimary" />

<com.qmuiteam.qmui.widget.roundwidget.QMUIRoundButton
android:id="@+id/status1Btn"
style="@style/home_status_btn"
android:text="待处理"
android:textColor="@color/gray_80"
app:qmui_backgroundColor="#fff"
app:qmui_borderColor="#dcdee0" />

<com.qmuiteam.qmui.widget.roundwidget.QMUIRoundButton
android:id="@+id/status2Btn"
style="@style/home_status_btn"
android:text="已确认"
android:textColor="@color/gray_80"
app:qmui_backgroundColor="#fff"
app:qmui_borderColor="#dcdee0" />

<com.qmuiteam.qmui.widget.roundwidget.QMUIRoundButton
android:id="@+id/status3Btn"
style="@style/home_status_btn"
android:text="已拒绝"
android:textColor="@color/gray_80"
app:qmui_backgroundColor="#fff"
app:qmui_borderColor="#dcdee0" />

<com.qmuiteam.qmui.widget.roundwidget.QMUIRoundButton
android:id="@+id/status4Btn"
style="@style/home_status_btn"
android:text="正常销假"
android:textColor="@color/gray_80"
app:qmui_backgroundColor="#fff"
app:qmui_borderColor="#dcdee0" />

<com.qmuiteam.qmui.widget.roundwidget.QMUIRoundButton
android:id="@+id/status5Btn"
style="@style/home_status_btn"
android:text="超时销假"
android:textColor="@color/gray_80"
app:qmui_backgroundColor="#fff"
app:qmui_borderColor="#dcdee0" />


<View <View
android:layout_width="0dp" android:layout_width="0dp"
android:layout_height="1px" android:layout_height="1px"
android:layout_weight="1" /> android:layout_weight="1" />


<TextView
android:id="@+id/preTxtBtn"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="上一页"
android:textColor="#3ca0e9"
android:textSize="@dimen/sp18" />
<Switch
android:id="@+id/switchBtn"
android:layout_width="48dp"
android:layout_height="@dimen/d_28"
android:checked="true"
android:thumb="@drawable/switch_ios_thumb"
android:track="@drawable/switch_ios_track_selector"
tools:ignore="UseSwitchCompatOrMaterialXml" />


<TextView <TextView
android:id="@+id/pageTv"
android:id="@+id/switchBtnTxt"
android:layout_width="wrap_content" android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:paddingStart="@dimen/d_20"
android:paddingEnd="@dimen/d_20"
android:text="0/0"
android:textColor="#333"
android:textSize="@dimen/sp18" />
android:layout_height="@dimen/d_28"
android:layout_gravity="center_vertical"
android:layout_marginStart="@dimen/d_10"
android:gravity="center"
android:text="自动弹出请假单"
android:textColor="#53a051" />


<TextView
android:id="@+id/nextTxtBtn"
android:layout_width="wrap_content"
</androidx.appcompat.widget.LinearLayoutCompat>

<androidx.appcompat.widget.LinearLayoutCompat
android:layout_width="match_parent"
android:layout_height="0dp"
android:layout_weight="1"
android:background="@color/white"
android:orientation="vertical"
android:paddingStart="@dimen/dp_10"
android:paddingEnd="@dimen/dp_10">

<androidx.appcompat.widget.LinearLayoutCompat
android:layout_width="match_parent"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:text="下一页"
android:textColor="#3ca0e9"
android:textSize="@dimen/sp18" />
android:orientation="horizontal"
android:paddingTop="@dimen/d_20"
android:paddingBottom="@dimen/d_20">

<TextView
style="@style/table_header"
android:layout_weight="1.5"
android:paddingStart="@dimen/dp_40"
android:text="请假学生" />

<TextView
style="@style/table_header"
android:layout_weight="1"
android:text="人脸" />

<TextView
style="@style/table_header"
android:layout_weight="3"
android:text="班级" />

<TextView
style="@style/table_header"
android:layout_weight="1"
android:text="类型" />

<TextView
style="@style/table_header"
android:layout_weight="4"
android:text="请假时间" />

<TextView
style="@style/table_header"
android:layout_weight="1.5"
android:text="请假时长" />

<TextView
style="@style/table_header"
android:text="请假单状态" />

<TextView
style="@style/table_header"
android:text="申请时间" />

<TextView
style="@style/table_header"
android:gravity="center"
android:text="操作" />
</androidx.appcompat.widget.LinearLayoutCompat>


<View
android:layout_width="match_parent"
android:layout_height="1px"
android:background="@color/backgroundColor" />

<androidx.recyclerview.widget.RecyclerView
android:id="@+id/recyclerView"
android:layout_width="match_parent"
android:layout_height="0dp"
android:layout_weight="1"
app:layoutManager="androidx.recyclerview.widget.LinearLayoutManager"
tools:itemCount="5"
tools:listitem="@layout/layout_leave_table" />


<View
android:layout_width="match_parent"
android:layout_height="1px"
android:background="@color/backgroundColor" />

<androidx.appcompat.widget.LinearLayoutCompat
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:gravity="center_vertical"
android:orientation="horizontal"
android:paddingHorizontal="@dimen/dp_40"
android:paddingVertical="@dimen/d_20">

<TextView
android:id="@+id/totalTv"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="共0条数据"
android:textSize="@dimen/sp18" />

<View
android:layout_width="0dp"
android:layout_height="1px"
android:layout_weight="1" />

<TextView
android:id="@+id/preTxtBtn"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="上一页"
android:textColor="#3ca0e9"
android:textSize="@dimen/sp18" />

<TextView
android:id="@+id/pageTv"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:paddingStart="@dimen/d_20"
android:paddingEnd="@dimen/d_20"
android:text="0/0"
android:textColor="#333"
android:textSize="@dimen/sp18" />

<TextView
android:id="@+id/nextTxtBtn"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="下一页"
android:textColor="#3ca0e9"
android:textSize="@dimen/sp18" />


</androidx.appcompat.widget.LinearLayoutCompat>
</androidx.appcompat.widget.LinearLayoutCompat> </androidx.appcompat.widget.LinearLayoutCompat>
</androidx.appcompat.widget.LinearLayoutCompat> </androidx.appcompat.widget.LinearLayoutCompat>
</LinearLayout>
</FrameLayout>

+ 6
- 1
app/src/main/res/layout/fragment_my.xml Näytä tiedosto

@@ -15,7 +15,7 @@
android:background="@color/white" android:background="@color/white"
android:gravity="center_vertical" android:gravity="center_vertical"
android:orientation="horizontal" android:orientation="horizontal"
android:padding="10dp">
android:padding="30dp">


<TextView <TextView
android:layout_width="wrap_content" android:layout_width="wrap_content"
@@ -35,6 +35,11 @@
android:textStyle="bold" android:textStyle="bold"
android:visibility="gone"/> android:visibility="gone"/>


<com.yzx.escreen.widget.TimeView
android:id="@+id/timeView"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentEnd="true"/>
</RelativeLayout> </RelativeLayout>


<androidx.appcompat.widget.LinearLayoutCompat <androidx.appcompat.widget.LinearLayoutCompat


+ 95
- 0
app/src/main/res/layout/layout_change_table.xml Näytä tiedosto

@@ -0,0 +1,95 @@
<?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="wrap_content"
android:orientation="vertical">

<androidx.appcompat.widget.LinearLayoutCompat
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:gravity="center_vertical"
android:orientation="horizontal"
android:paddingTop="@dimen/d_12"
android:paddingBottom="@dimen/d_12">

<TextView
android:id="@+id/studentName"
style="@style/table_cell"
android:layout_weight="1.5"
android:paddingStart="@dimen/dp_40"
android:text="请假学生" />

<FrameLayout
style="@style/table_cell"
android:layout_weight="1"
android:text="人脸">

<com.qmuiteam.qmui.widget.QMUIRadiusImageView
android:id="@+id/faceImg"
android:layout_width="@dimen/d_70"
android:layout_height="@dimen/d_70"
app:qmui_border_color="@color/white"
app:qmui_corner_radius="@dimen/d_5" />

<com.qmuiteam.qmui.widget.roundwidget.QMUIRoundButton
android:id="@+id/faceEmpty"
android:layout_width="@dimen/d_70"
android:layout_height="@dimen/d_70"
android:paddingTop="@dimen/d_5"
android:paddingBottom="@dimen/d_5"
android:text="未设置"
android:textColor="@color/white"
app:qmui_backgroundColor="#ccc"
app:qmui_borderColor="#ccc"
app:qmui_radius="@dimen/d_5" />
</FrameLayout>

<TextView
android:id="@+id/className"
style="@style/table_cell"
android:layout_weight="3"
android:text="班级" />

<TextView
android:id="@+id/typeName"
style="@style/table_cell"
android:layout_weight="1"
android:text="类型" />

<TextView
android:id="@+id/leaveTime"
style="@style/table_cell"
android:layout_weight="4"
android:text="时间"
android:textColor="#3ca0e9" />

<androidx.appcompat.widget.LinearLayoutCompat
style="@style/table_cell" >
<TextView
android:id="@+id/statusName"
style="@style/table_status_cell"
android:text="时间" />
<TextView
android:id="@+id/subStatusName"
style="@style/table_status_cell"
android:text="时间" />
</androidx.appcompat.widget.LinearLayoutCompat>

<TextView
android:id="@+id/applyTime"
style="@style/table_cell"
android:text="时间" />

<TextView
android:id="@+id/addUser"
style="@style/table_cell"
android:text="时间" />
</androidx.appcompat.widget.LinearLayoutCompat>

<View
android:id="@+id/bottomLine"
android:layout_width="match_parent"
android:layout_height="1px"
android:background="@color/backgroundColor" />
</LinearLayout>

+ 48
- 0
app/src/main/res/layout/view_time.xml Näytä tiedosto

@@ -0,0 +1,48 @@
<?xml version="1.0" encoding="utf-8"?>
<androidx.appcompat.widget.LinearLayoutCompat xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:orientation="horizontal"
tools:showIn="@layout/fragment_home">

<TextView
android:id="@+id/hour"
style="@style/time_item"
android:text="16" />

<TextView
style="@style/time_item"
android:text=":" />

<TextView
android:id="@+id/min"
style="@style/time_item"
android:text="46" />

<TextView
android:id="@+id/sec"
style="@style/time_item"
android:layout_marginStart="@dimen/d_10"
android:text="46"
android:textSize="@dimen/d_20" />

<androidx.appcompat.widget.LinearLayoutCompat
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginStart="@dimen/d_20"
android:orientation="vertical">

<TextView
android:id="@+id/week"
style="@style/time_item"
android:text="星期四"
android:textSize="@dimen/d_14" />

<TextView
android:id="@+id/year"
style="@style/time_item"
android:text="2022年5月12日"
android:textSize="@dimen/d_12" />
</androidx.appcompat.widget.LinearLayoutCompat>
</androidx.appcompat.widget.LinearLayoutCompat>

BIN
app/src/main/res/mipmap-mdpi/change_select.png Näytä tiedosto

Before After
Leveys: 60  |  Korkeus: 48  |  Koko: 827 B

BIN
app/src/main/res/mipmap-mdpi/change_unselect.png Näytä tiedosto

Before After
Leveys: 60  |  Korkeus: 48  |  Koko: 1.2 KiB

BIN
app/src/main/res/mipmap-mdpi/leave_select.png Näytä tiedosto

Before After
Leveys: 55  |  Korkeus: 48  |  Koko: 1.2 KiB

BIN
app/src/main/res/mipmap-mdpi/leave_unselect.png Näytä tiedosto

Before After
Leveys: 55  |  Korkeus: 48  |  Koko: 1.5 KiB

+ 1
- 1
app/src/main/res/values/colors.xml Näytä tiedosto

@@ -27,7 +27,7 @@
<color name="orange">#ff8635</color> <color name="orange">#ff8635</color>
<color name="transparent">@android:color/transparent</color> <color name="transparent">@android:color/transparent</color>
<color name="nb.theme.background">@color/white</color> <color name="nb.theme.background">@color/white</color>
<color name="dialog_bg">#88000000</color>




<!--common--> <!--common-->


+ 5
- 0
app/src/main/res/values/ids.xml Näytä tiedosto

@@ -0,0 +1,5 @@
<?xml version="1.0" encoding="utf-8"?>
<resources>
<item type="id" name="tag_dialog_name"/>
<item type="id" name="tag_dialog_type"/>
</resources>

+ 18
- 0
app/src/main/res/values/styles.xml Näytä tiedosto

@@ -10,6 +10,8 @@
<item name="colorAccent">@color/colorAccent</item> <item name="colorAccent">@color/colorAccent</item>
<item name="android:windowBackground">@color/backgroundColor</item> <item name="android:windowBackground">@color/backgroundColor</item>
<item name="qmui_dialog_min_width">500dp</item> <item name="qmui_dialog_min_width">500dp</item>
<item name="android:windowNoTitle">true</item>
<item name="android:windowFullscreen">true</item>
</style> </style>
<style name="BaseDialog" parent="android:Theme.Light"> <style name="BaseDialog" parent="android:Theme.Light">
<item name="android:windowFrame">@null</item> <item name="android:windowFrame">@null</item>
@@ -158,6 +160,14 @@
<item name="android:textStyle">normal</item> <item name="android:textStyle">normal</item>
</style> </style>


<style name="table_status_cell">
<item name="android:layout_height">wrap_content</item>
<item name="android:layout_width">wrap_content</item>
<item name="android:textStyle">bold</item>
<item name="android:textColor">#333</item>
<item name="android:textSize">@dimen/sp18</item>
</style>

<style name="leave_dialog_title"> <style name="leave_dialog_title">
<item name="android:layout_width">232dp</item> <item name="android:layout_width">232dp</item>
<item name="android:layout_height">wrap_content</item> <item name="android:layout_height">wrap_content</item>
@@ -205,4 +215,12 @@
<item name="android:textColor">@color/black_3</item> <item name="android:textColor">@color/black_3</item>
<item name="android:textSize">@dimen/sp20</item> <item name="android:textSize">@dimen/sp20</item>
</style> </style>

<style name="time_item">
<item name="android:layout_width">wrap_content</item>
<item name="android:layout_height">wrap_content</item>
<item name="android:textColor">@color/black</item>
<item name="android:textSize">@dimen/d_28</item>
<item name="android:textStyle">bold</item>
</style>
</resources> </resources>

Ladataan…
Peruuta
Tallenna