| @@ -1,17 +0,0 @@ | |||||
| <?xml version="1.0" encoding="UTF-8"?> | |||||
| <project version="4"> | |||||
| <component name="deploymentTargetDropDown"> | |||||
| <targetSelectedWithDropDown> | |||||
| <Target> | |||||
| <type value="QUICK_BOOT_TARGET" /> | |||||
| <deviceKey> | |||||
| <Key> | |||||
| <type value="VIRTUAL_DEVICE_PATH" /> | |||||
| <value value="C:\Users\Administrator\.android\avd\EScreen_API_27.avd" /> | |||||
| </Key> | |||||
| </deviceKey> | |||||
| </Target> | |||||
| </targetSelectedWithDropDown> | |||||
| <timeTargetWasSelectedWithDropDown value="2022-04-20T04:41:22.102557200Z" /> | |||||
| </component> | |||||
| </project> | |||||
| @@ -36,5 +36,10 @@ | |||||
| <option name="name" value="maven3" /> | <option name="name" value="maven3" /> | ||||
| <option name="url" value="https://dl.bintray.com/qichuan/maven/" /> | <option name="url" value="https://dl.bintray.com/qichuan/maven/" /> | ||||
| </remote-repository> | </remote-repository> | ||||
| <remote-repository> | |||||
| <option name="id" value="MavenRepo" /> | |||||
| <option name="name" value="MavenRepo" /> | |||||
| <option name="url" value="https://repo.maven.apache.org/maven2/" /> | |||||
| </remote-repository> | |||||
| </component> | </component> | ||||
| </project> | </project> | ||||
| @@ -3,10 +3,26 @@ | |||||
| <component name="DesignSurface"> | <component name="DesignSurface"> | ||||
| <option name="filePathToZoomLevelMap"> | <option name="filePathToZoomLevelMap"> | ||||
| <map> | <map> | ||||
| <entry key="..\:/work/escreen/app/src/main/res/drawable/btn_select.xml" value="0.321" /> | |||||
| <entry key="..\:/work/escreen/app/src/main/res/drawable/selector_btn_read_setting.xml" value="0.321" /> | |||||
| <entry key="..\:/work/escreen/app/src/main/res/drawable/switch_ios_thumb.xml" value="0.372" /> | |||||
| <entry key="..\:/work/escreen/app/src/main/res/drawable/switch_ios_track_off.xml" value="0.372" /> | |||||
| <entry key="..\:/work/escreen/app/src/main/res/drawable/switch_ios_track_on.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_main.xml" value="0.37135416666666665" /> | |||||
| <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_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_web.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.5" /> | |||||
| <entry key="..\:/work/escreen/app/src/main/res/layout/fragment_home.xml" value="0.6594650205761317" /> | |||||
| <entry key="..\:/work/escreen/app/src/main/res/layout/fragment_my.xml" value="0.45940721649484534" /> | |||||
| <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.4681549573210768" /> | |||||
| <entry key="..\:/work/escreen/app/src/main/res/layout/layout_leave_table.xml" value="0.41030092592592593" /> | |||||
| <entry key="..\:/work/escreen/app/src/main/res/layout/leave_dialog_title.xml" value="0.37135416666666665" /> | |||||
| </map> | </map> | ||||
| </option> | </option> | ||||
| </component> | </component> | ||||
| @@ -33,17 +33,25 @@ android { | |||||
| v2SigningEnabled false | v2SigningEnabled false | ||||
| } | } | ||||
| release { | release { | ||||
| storeFile file("../buildKey/wenote.jks") | |||||
| keyAlias 'wetao' | |||||
| keyPassword 'lhb@123' | |||||
| storePassword 'lhb@123' | |||||
| // storeFile file("../buildKey/wenote.jks") | |||||
| // keyAlias 'wetao' | |||||
| // keyPassword 'lhb@123' | |||||
| // storePassword 'lhb@123' | |||||
| keyAlias ALIAS_NAME | |||||
| keyPassword ALIAS_PWD | |||||
| storeFile file(KEY_PATH) | |||||
| storePassword KEY_PWD | |||||
| v2SigningEnabled false | v2SigningEnabled false | ||||
| } | } | ||||
| debug { | debug { | ||||
| storeFile file("../buildKey/wenote.jks") | |||||
| keyAlias 'wetao' | |||||
| keyPassword 'lhb@123' | |||||
| storePassword 'lhb@123' | |||||
| // storeFile file("../buildKey/wenote.jks") | |||||
| // keyAlias 'wetao' | |||||
| // keyPassword 'lhb@123' | |||||
| // storePassword 'lhb@123' | |||||
| keyAlias ALIAS_NAME | |||||
| keyPassword ALIAS_PWD | |||||
| storeFile file(KEY_PATH) | |||||
| storePassword KEY_PWD | |||||
| v2SigningEnabled false | v2SigningEnabled false | ||||
| } | } | ||||
| } | } | ||||
| @@ -58,6 +66,7 @@ android { | |||||
| // shrinkResources false | // shrinkResources false | ||||
| buildConfigField "String", "BASE_URL", '"https://oa.qbjjyyun.net/api"' | buildConfigField "String", "BASE_URL", '"https://oa.qbjjyyun.net/api"' | ||||
| buildConfigField "String", "M_URL", '"https://m.qbjjyyun.net"' | buildConfigField "String", "M_URL", '"https://m.qbjjyyun.net"' | ||||
| buildConfigField "String", "OA_URL", '"https://oa.qbjjyyun.net"' | |||||
| buildConfigField "String", "APP_NAME", '"家校互通"' | buildConfigField "String", "APP_NAME", '"家校互通"' | ||||
| // buildConfigField "String", "BASE_URL", '"http://192.168.69.99:9009"' | // buildConfigField "String", "BASE_URL", '"http://192.168.69.99:9009"' | ||||
| @@ -72,10 +81,13 @@ android { | |||||
| signingConfig signingConfigs.release | signingConfig signingConfigs.release | ||||
| // 移除无用的resource文件 | // 移除无用的resource文件 | ||||
| shrinkResources false | shrinkResources false | ||||
| buildConfigField "String", "BASE_URL", '"http://192.168.69.99:9009"' | |||||
| buildConfigField "String", "M_URL", '"http://192.168.69.112:8098"' | |||||
| // buildConfigField "String", "BASE_URL", '"https://oa.live.educlouddata.com"' | |||||
| // buildConfigField "String", "M_URL", '"https://m.live.educlouddata.com/"' | |||||
| // buildConfigField "String", "BASE_URL", '"http://192.168.69.99:9009"' | |||||
| // buildConfigField "String", "M_URL", '"http://192.168.69.112:8098"' | |||||
| // buildConfigField "String", "BASE_URL", '"https://oa.qbjjyyun.net/api"' | |||||
| // buildConfigField "String", "OA_URL", '"https://oa.live.educlouddata.com"' | |||||
| buildConfigField "String", "OA_URL", '"http://192.168.69.114:3000"' | |||||
| buildConfigField "String", "M_URL", '"https://m.live.educlouddata.com/"' | |||||
| buildConfigField "String", "BASE_URL", '"https://oa.live.educlouddata.com/api"' | |||||
| buildConfigField "String", "APP_NAME", '"家校互通(开发)"' | buildConfigField "String", "APP_NAME", '"家校互通(开发)"' | ||||
| } | } | ||||
| @@ -171,4 +183,7 @@ dependencies { | |||||
| implementation 'es.voghdev.pdfviewpager:library:1.1.2' | implementation 'es.voghdev.pdfviewpager:library:1.1.2' | ||||
| implementation 'io.github.h07000223:flycoTabLayout:3.0.0' | implementation 'io.github.h07000223:flycoTabLayout:3.0.0' | ||||
| implementation 'com.qmuiteam:qmui:2.0.0-alpha10' | |||||
| api 'com.tencent.tbs:tbssdk:44181' | |||||
| } | } | ||||
| @@ -90,3 +90,15 @@ | |||||
| -dontwarn io.bugtags.** | -dontwarn io.bugtags.** | ||||
| -dontwarn org.apache.http.** | -dontwarn org.apache.http.** | ||||
| -dontwarn android.net.http.AndroidHttpClient | -dontwarn android.net.http.AndroidHttpClient | ||||
| # x5 | |||||
| -dontwarn dalvik.** | |||||
| -dontwarn com.tencent.smtt.** | |||||
| -keep class com.tencent.smtt.** { | |||||
| *; | |||||
| } | |||||
| -keep class com.tencent.tbs.** { | |||||
| *; | |||||
| } | |||||
| @@ -1,7 +1,8 @@ | |||||
| <?xml version="1.0" encoding="utf-8"?> | <?xml version="1.0" encoding="utf-8"?> | ||||
| <manifest xmlns:android="http://schemas.android.com/apk/res/android" | <manifest xmlns:android="http://schemas.android.com/apk/res/android" | ||||
| xmlns:tools="http://schemas.android.com/tools" | xmlns:tools="http://schemas.android.com/tools" | ||||
| package="com.yzx.escreen"> | |||||
| package="com.yzx.escreen" | |||||
| android:installLocation="internalOnly"> | |||||
| <uses-permission android:name="android.permission.INTERNET" /> | <uses-permission android:name="android.permission.INTERNET" /> | ||||
| <uses-permission android:name="android.permission.READ_PHONE_STATE" /> | <uses-permission android:name="android.permission.READ_PHONE_STATE" /> | ||||
| @@ -15,6 +16,7 @@ | |||||
| <uses-permission android:name="android.permission.WRITE_SETTINGS" /> | <uses-permission android:name="android.permission.WRITE_SETTINGS" /> | ||||
| <uses-permission android:name="android.permission.BATTERY_STATS" /> | <uses-permission android:name="android.permission.BATTERY_STATS" /> | ||||
| <uses-permission android:name="android.permission.WAKE_LOCK" /> | <uses-permission android:name="android.permission.WAKE_LOCK" /> | ||||
| <uses-permission android:name="android.permission.RECEIVE_BOOT_COMPLETED" /> | |||||
| <application | <application | ||||
| android:name="com.yzx.escreen.App" | android:name="com.yzx.escreen.App" | ||||
| @@ -27,24 +29,24 @@ | |||||
| android:supportsRtl="true" | android:supportsRtl="true" | ||||
| android:theme="@style/AppTheme" | android:theme="@style/AppTheme" | ||||
| android:usesCleartextTraffic="true"> | android:usesCleartextTraffic="true"> | ||||
| <activity android:name="com.yzx.escreen.activity.WeexTestActivity" /> | |||||
| <activity | <activity | ||||
| android:name="com.yzx.escreen.MainActivity" | android:name="com.yzx.escreen.MainActivity" | ||||
| android:configChanges="orientation|keyboard" | android:configChanges="orientation|keyboard" | ||||
| android:launchMode="singleTask" | android:launchMode="singleTask" | ||||
| android:windowSoftInputMode="adjustResize|stateHidden" | |||||
| android:screenOrientation="landscape"> | android:screenOrientation="landscape"> | ||||
| <intent-filter> | <intent-filter> | ||||
| <action android:name="android.intent.action.MAIN" /> | <action android:name="android.intent.action.MAIN" /> | ||||
| <!-- <category android:name="android.intent.category.HOME" />--> | |||||
| <!-- <category android:name="android.intent.category.DEFAULT" />--> | |||||
| <category android:name="android.intent.category.HOME" /> | |||||
| <category android:name="android.intent.category.DEFAULT" /> | |||||
| <category android:name="android.intent.category.LAUNCHER" /> | <category android:name="android.intent.category.LAUNCHER" /> | ||||
| </intent-filter> | </intent-filter> | ||||
| </activity> | </activity> | ||||
| <activity | <activity | ||||
| android:name="com.yzx.escreen.activity.WebActivity" | android:name="com.yzx.escreen.activity.WebActivity" | ||||
| android:configChanges="orientation|keyboard" | android:configChanges="orientation|keyboard" | ||||
| android:screenOrientation="portrait" /> | |||||
| android:screenOrientation="landscape" /> | |||||
| <!-- <activity--> | <!-- <activity--> | ||||
| <!-- android:name="com.yzx.escreen.MainActivity"--> | <!-- android:name="com.yzx.escreen.MainActivity"--> | ||||
| <!-- android:configChanges="orientation|keyboard"--> | <!-- android:configChanges="orientation|keyboard"--> | ||||
| @@ -62,6 +64,19 @@ | |||||
| android:resource="@xml/provider_paths" | android:resource="@xml/provider_paths" | ||||
| tools:replace="name,resource" /> | tools:replace="name,resource" /> | ||||
| </provider> | </provider> | ||||
| <service | |||||
| android:name="com.tencent.smtt.export.external.DexClassLoaderProviderService" | |||||
| android:label="dexopt" | |||||
| android:process=":dexopt" > | |||||
| </service> | |||||
| <receiver | |||||
| android:name=".receiver.BootReceiver" | |||||
| android:enabled="true" | |||||
| android:exported="true"> | |||||
| <intent-filter android:priority="1000"> | |||||
| <action android:name="android.intent.action.BOOT_COMPLETED"/> | |||||
| </intent-filter> | |||||
| </receiver> | |||||
| </application> | </application> | ||||
| </manifest> | </manifest> | ||||
| @@ -4,10 +4,13 @@ import android.app.Application | |||||
| import com.blankj.utilcode.util.Utils | import com.blankj.utilcode.util.Utils | ||||
| import com.lzy.okgo.OkGo | import com.lzy.okgo.OkGo | ||||
| import com.lzy.okgo.model.HttpHeaders | import com.lzy.okgo.model.HttpHeaders | ||||
| import com.tencent.smtt.export.external.TbsCoreSettings | |||||
| import com.tencent.smtt.sdk.QbSdk | |||||
| import com.umeng.analytics.MobclickAgent | import com.umeng.analytics.MobclickAgent | ||||
| import com.umeng.commonsdk.UMConfigure | import com.umeng.commonsdk.UMConfigure | ||||
| import com.yzx.escreen.model.User | import com.yzx.escreen.model.User | ||||
| class App : Application() { | class App : Application() { | ||||
| @@ -42,6 +45,27 @@ class App : Application() { | |||||
| ) | ) | ||||
| MobclickAgent.setPageCollectionMode(MobclickAgent.PageMode.AUTO) | MobclickAgent.setPageCollectionMode(MobclickAgent.PageMode.AUTO) | ||||
| // 在调用TBS初始化、创建WebView之前进行如下配置 | |||||
| val map = HashMap<String, Any>() | |||||
| map[TbsCoreSettings.TBS_SETTINGS_USE_SPEEDY_CLASSLOADER] = true | |||||
| map[TbsCoreSettings.TBS_SETTINGS_USE_DEXLOADER_SERVICE] = true | |||||
| QbSdk.initTbsSettings(map) | |||||
| //腾讯x5内核 | |||||
| QbSdk.initX5Environment(this, object : QbSdk.PreInitCallback { | |||||
| override fun onCoreInitFinished() { | |||||
| } | |||||
| /** | |||||
| * 预初始化结束 | |||||
| * 由于X5内核体积较大,需要依赖网络动态下发,所以当内核不存在的时候,默认会回调false,此时将会使用系统内核代替 | |||||
| * @param isX5 是否使用X5内核 | |||||
| */ | |||||
| override fun onViewInitFinished(isX5: Boolean) { | |||||
| } | |||||
| }) | |||||
| QbSdk.setDownloadWithoutWifi(true) | |||||
| } | } | ||||
| @@ -2,9 +2,20 @@ package com.yzx.escreen | |||||
| import android.annotation.SuppressLint | import android.annotation.SuppressLint | ||||
| import android.content.Intent | import android.content.Intent | ||||
| import android.view.KeyEvent | |||||
| import androidx.appcompat.app.AppCompatActivity | |||||
| import androidx.fragment.app.Fragment | |||||
| import androidx.viewpager2.adapter.FragmentStateAdapter | |||||
| import androidx.viewpager2.widget.ViewPager2 | |||||
| import com.flyco.tablayout.listener.CustomTabEntity | import com.flyco.tablayout.listener.CustomTabEntity | ||||
| import com.flyco.tablayout.listener.OnTabSelectListener | |||||
| 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.fragment.HomeFragment | |||||
| import com.yzx.escreen.fragment.MyFragment | |||||
| import com.yzx.escreen.model.TabEntity | import com.yzx.escreen.model.TabEntity | ||||
| import com.yzx.escreen.model.User | |||||
| import com.yzx.escreen.presenter.base.BasePresenter | import com.yzx.escreen.presenter.base.BasePresenter | ||||
| import kotlinx.android.synthetic.main.activity_main.* | import kotlinx.android.synthetic.main.activity_main.* | ||||
| @@ -21,10 +32,31 @@ class MainActivity : BaseActivity<BasePresenter<*>>() { | |||||
| override fun initView() { | override fun initView() { | ||||
| if (!User.isLogin()) { | |||||
| WebActivity.active(this, "${Config.OA_URL}/login") | |||||
| finish() | |||||
| } | |||||
| val tabData = arrayListOf<CustomTabEntity>() | val tabData = arrayListOf<CustomTabEntity>() | ||||
| tabData.add(TabEntity("首页",R.mipmap.home_select,R.mipmap.home_unselect)) | |||||
| tabData.add(TabEntity("我的",R.mipmap.my_select,R.mipmap.my_unselect)) | |||||
| tabData.add(TabEntity("首页", R.mipmap.home_select, R.mipmap.home_unselect)) | |||||
| tabData.add(TabEntity("我的", R.mipmap.my_select, R.mipmap.my_unselect)) | |||||
| tabLayout.setTabData(tabData) | tabLayout.setTabData(tabData) | ||||
| viewPager2.adapter = HomePagerAdapter(this) | |||||
| viewPager2.registerOnPageChangeCallback(object : ViewPager2.OnPageChangeCallback() { | |||||
| override fun onPageSelected(position: Int) { | |||||
| super.onPageSelected(position) | |||||
| tabLayout.currentTab = position | |||||
| } | |||||
| }) | |||||
| tabLayout.setOnTabSelectListener(object : OnTabSelectListener { | |||||
| override fun onTabSelect(position: Int) { | |||||
| viewPager2.currentItem = position | |||||
| } | |||||
| override fun onTabReselect(position: Int) { | |||||
| } | |||||
| }) | |||||
| } | } | ||||
| override fun initData() { | override fun initData() { | ||||
| @@ -32,14 +64,40 @@ class MainActivity : BaseActivity<BasePresenter<*>>() { | |||||
| } | } | ||||
| override fun initPresenter(): BasePresenter<*>? { | |||||
| override fun initPresenter(): BasePresenter<*>? { | |||||
| return null | return null | ||||
| } | } | ||||
| @SuppressLint("SetTextI18n") | @SuppressLint("SetTextI18n") | ||||
| override fun onActivityResult(requestCode: Int, resultCode: Int, data: Intent?) { | |||||
| override fun onActivityResult(requestCode: Int, resultCode: Int, data: Intent?) { | |||||
| super.onActivityResult(requestCode, resultCode, data) | super.onActivityResult(requestCode, resultCode, data) | ||||
| } | |||||
| override fun onBackPressed() { | |||||
| // super.onBackPressed() | |||||
| } | } | ||||
| override fun onKeyUp(keyCode: Int, event: KeyEvent?): Boolean { | |||||
| if (keyCode == KeyEvent.KEYCODE_BACK || keyCode == KeyEvent.KEYCODE_HOME) { | |||||
| return true | |||||
| } | |||||
| return super.onKeyUp(keyCode, event) | |||||
| } | |||||
| } | } | ||||
| class HomePagerAdapter(act: AppCompatActivity) : FragmentStateAdapter(act) { | |||||
| override fun getItemCount(): Int = 2 | |||||
| override fun createFragment(position: Int): Fragment { | |||||
| when (position) { | |||||
| 0 -> { | |||||
| return HomeFragment.getNewInstance() | |||||
| } | |||||
| 1 -> { | |||||
| return MyFragment.getNewInstance() | |||||
| } | |||||
| } | |||||
| return HomeFragment.getNewInstance() | |||||
| } | |||||
| } | |||||
| @@ -30,8 +30,8 @@ import com.yzx.escreen.model.BaseBean | |||||
| import com.yzx.escreen.model.HomeItem | import com.yzx.escreen.model.HomeItem | ||||
| import com.yzx.escreen.model.User | import com.yzx.escreen.model.User | ||||
| import com.yzx.escreen.model.Version | import com.yzx.escreen.model.Version | ||||
| import com.yzx.escreen.presenter.base.BasePresenter | |||||
| import com.yzx.escreen.widget.BaseDialog | import com.yzx.escreen.widget.BaseDialog | ||||
| import com.yzx.escreen.presenter.base.BasePresenter | |||||
| import kotlinx.android.synthetic.main.activity_home.* | import kotlinx.android.synthetic.main.activity_home.* | ||||
| import org.jetbrains.anko.find | import org.jetbrains.anko.find | ||||
| import org.jetbrains.anko.startActivity | import org.jetbrains.anko.startActivity | ||||
| @@ -156,7 +156,7 @@ class HomeActivity : BaseActivity<BasePresenter<*>>(), NetworkUtils.OnNetworkSta | |||||
| val user = User.getUser() | val user = User.getUser() | ||||
| if (user.user_id != 0) { | if (user.user_id != 0) { | ||||
| userNameTv.text = "你好,${user.user_name}" | userNameTv.text = "你好,${user.user_name}" | ||||
| userInfoTv.text = "${user.school_name} | ${user.grade_name}${user.class_name}" | |||||
| // userInfoTv.text = "${user.school_name} | ${user.grade_name}${user.class_name}" | |||||
| userInfoTv.visibility = View.VISIBLE | userInfoTv.visibility = View.VISIBLE | ||||
| loginBtn.visibility = View.GONE | loginBtn.visibility = View.GONE | ||||
| switchBtn.visibility = if (User.getUnitCount() > 1) { | switchBtn.visibility = if (User.getUnitCount() > 1) { | ||||
| @@ -6,13 +6,12 @@ import android.app.AlertDialog | |||||
| 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.net.http.SslError | |||||
| import android.os.Build | import android.os.Build | ||||
| import android.text.TextUtils | import android.text.TextUtils | ||||
| import android.util.Log | import android.util.Log | ||||
| import android.view.View | import android.view.View | ||||
| import android.view.ViewGroup | import android.view.ViewGroup | ||||
| import android.webkit.* | |||||
| import android.webkit.JavascriptInterface | |||||
| import android.widget.LinearLayout | import android.widget.LinearLayout | ||||
| import android.widget.TextView | import android.widget.TextView | ||||
| import androidx.annotation.RequiresApi | import androidx.annotation.RequiresApi | ||||
| @@ -27,6 +26,15 @@ import com.google.gson.reflect.TypeToken | |||||
| import com.lzy.okgo.OkGo | import com.lzy.okgo.OkGo | ||||
| import com.lzy.okgo.callback.StringCallback | import com.lzy.okgo.callback.StringCallback | ||||
| import com.lzy.okgo.model.Response | import com.lzy.okgo.model.Response | ||||
| import com.tencent.smtt.export.external.interfaces.JsResult | |||||
| import com.tencent.smtt.export.external.interfaces.SslError | |||||
| import com.tencent.smtt.export.external.interfaces.SslErrorHandler | |||||
| import com.tencent.smtt.export.external.interfaces.WebResourceRequest | |||||
| import com.tencent.smtt.sdk.WebChromeClient | |||||
| import com.tencent.smtt.sdk.WebSettings | |||||
| import com.tencent.smtt.sdk.WebView | |||||
| import com.tencent.smtt.sdk.WebViewClient | |||||
| import com.yzx.escreen.MainActivity | |||||
| import com.yzx.escreen.R | import com.yzx.escreen.R | ||||
| 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 | ||||
| @@ -197,7 +205,7 @@ class WebActivity : BaseActivity<BasePresenter<*>>() { | |||||
| ViewGroup.LayoutParams.MATCH_PARENT | ViewGroup.LayoutParams.MATCH_PARENT | ||||
| ) | ) | ||||
| webLayout.addView(webView) | webLayout.addView(webView) | ||||
| webView.addJavascriptInterface(YzxJavascriptInterface(this), "YZX") | |||||
| webView.addJavascriptInterface(YzxJavascriptInterface(this), "YZX_SCREEN") | |||||
| val userAgent = webView.settings.userAgentString | val userAgent = webView.settings.userAgentString | ||||
| webView.settings.apply { | webView.settings.apply { | ||||
| allowFileAccess = true | allowFileAccess = true | ||||
| @@ -215,10 +223,8 @@ class WebActivity : BaseActivity<BasePresenter<*>>() { | |||||
| domStorageEnabled = true | domStorageEnabled = true | ||||
| setAppCacheMaxSize(1024 * 1024 * 8) | setAppCacheMaxSize(1024 * 1024 * 8) | ||||
| setAppCachePath(ctx.cacheDir.absolutePath) | setAppCachePath(ctx.cacheDir.absolutePath) | ||||
| if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.LOLLIPOP) { | |||||
| mixedContentMode = WebSettings.MIXED_CONTENT_ALWAYS_ALLOW | |||||
| } | |||||
| userAgentString = "$userAgent app/ebook" | |||||
| mixedContentMode = android.webkit.WebSettings.MIXED_CONTENT_COMPATIBILITY_MODE | |||||
| userAgentString = "$userAgent app/escreen" | |||||
| } | } | ||||
| webView.webViewClient = object : WebViewClient() { | webView.webViewClient = object : WebViewClient() { | ||||
| @RequiresApi(Build.VERSION_CODES.LOLLIPOP) | @RequiresApi(Build.VERSION_CODES.LOLLIPOP) | ||||
| @@ -298,7 +304,7 @@ class WebActivity : BaseActivity<BasePresenter<*>>() { | |||||
| override fun onResume() { | override fun onResume() { | ||||
| super.onResume() | super.onResume() | ||||
| webView.onResume() | webView.onResume() | ||||
| checkVersion() | |||||
| // checkVersion() | |||||
| } | } | ||||
| override fun onPause() { | override fun onPause() { | ||||
| @@ -353,50 +359,7 @@ class YzxJavascriptInterface(var ctx: Activity) { | |||||
| * 获取电子书的clientId | * 获取电子书的clientId | ||||
| */ | */ | ||||
| @JavascriptInterface | @JavascriptInterface | ||||
| fun getClientId(): Int = 601 | |||||
| /** | |||||
| * 跳转到电子书页面 | |||||
| */ | |||||
| @JavascriptInterface | |||||
| fun bookPage( | |||||
| title: String, | |||||
| identity: String, | |||||
| key: String, | |||||
| name: String, | |||||
| index: Int, | |||||
| type: Int | |||||
| ) { | |||||
| } | |||||
| /** | |||||
| * 跳转到笔记页面 | |||||
| * @param title 展示的title | |||||
| * @param note_info 笔记得json,新的笔记 传"" ,老的笔记 传 [{"BGid":0,"identity":"fileb","key":"a92511a457cdc444bb274e5dee29c487"}] | |||||
| * @param can_add_page 是否可以新加纸,1可以,0不可以 | |||||
| */ | |||||
| @JavascriptInterface | |||||
| fun notePage( | |||||
| title: String, | |||||
| note_info: String, | |||||
| can_add_page: Int = 1 | |||||
| ) { | |||||
| } | |||||
| /** | |||||
| * 跳转到笔记页面 | |||||
| * @param title 展示的title | |||||
| * @param note_info 笔记得json,新的笔记 传"" ,老的笔记 传 [{"BGid":0,"identity":"fileb","key":"a92511a457cdc444bb274e5dee29c487"}] | |||||
| */ | |||||
| @JavascriptInterface | |||||
| fun notePage( | |||||
| title: String, | |||||
| note_info: String | |||||
| ) { | |||||
| } | |||||
| fun getClientId(): Int = 602 | |||||
| /** | /** | ||||
| * 提示 | * 提示 | ||||
| @@ -434,7 +397,7 @@ class YzxJavascriptInterface(var ctx: Activity) { | |||||
| @JavascriptInterface | @JavascriptInterface | ||||
| fun toHome() { | fun toHome() { | ||||
| ctx.startActivity<HomeActivity>() | |||||
| ctx.startActivity<MainActivity>() | |||||
| } | } | ||||
| @JavascriptInterface | @JavascriptInterface | ||||
| @@ -457,15 +420,6 @@ class YzxJavascriptInterface(var ctx: Activity) { | |||||
| ctx.startActivity<HomeActivity>() | ctx.startActivity<HomeActivity>() | ||||
| } | } | ||||
| @JavascriptInterface | |||||
| fun readPage(bookTaskId: String) { | |||||
| } | |||||
| @JavascriptInterface | |||||
| fun readPage(bookTaskId: String, readTaskId: String) { | |||||
| } | |||||
| } | } | ||||
| @@ -1,6 +1,8 @@ | |||||
| package com.yzx.escreen.activity.base | package com.yzx.escreen.activity.base | ||||
| import android.os.Bundle | import android.os.Bundle | ||||
| import android.view.View | |||||
| import android.view.WindowManager | |||||
| import androidx.appcompat.app.AppCompatActivity | import androidx.appcompat.app.AppCompatActivity | ||||
| import com.gyf.immersionbar.ktx.immersionBar | import com.gyf.immersionbar.ktx.immersionBar | ||||
| import com.yzx.escreen.R | import com.yzx.escreen.R | ||||
| @@ -45,10 +47,11 @@ abstract class BaseActivity<out P : BasePresenter<*>> : AppCompatActivity() { | |||||
| initView() | initView() | ||||
| initData() | initData() | ||||
| setStatusBar() | setStatusBar() | ||||
| hideBottomUIMenu() | |||||
| } | } | ||||
| open fun setStatusBar() { | open fun setStatusBar() { | ||||
| immersionBar { | |||||
| immersionBar { | |||||
| statusBarColor(R.color.white) | statusBarColor(R.color.white) | ||||
| fitsSystemWindows(true) | fitsSystemWindows(true) | ||||
| statusBarDarkFont(true, 0.2f) | statusBarDarkFont(true, 0.2f) | ||||
| @@ -58,7 +61,12 @@ abstract class BaseActivity<out P : BasePresenter<*>> : AppCompatActivity() { | |||||
| } | } | ||||
| private fun hideBottomUIMenu() { | |||||
| val params: WindowManager.LayoutParams = window.attributes | |||||
| params.systemUiVisibility = | |||||
| View.SYSTEM_UI_FLAG_HIDE_NAVIGATION or View.SYSTEM_UI_FLAG_IMMERSIVE | |||||
| window.attributes = params | |||||
| } | |||||
| override fun onBackPressed() { | override fun onBackPressed() { | ||||
| @@ -0,0 +1,78 @@ | |||||
| package com.yzx.escreen.adapter | |||||
| import android.annotation.SuppressLint | |||||
| 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.LeaveActivity | |||||
| 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 HomeDialogStepAdapter(list: MutableList<LeaveActivity>) : | |||||
| BaseQuickAdapter<LeaveActivity, BaseViewHolder>(R.layout.layout_leave_step, list) { | |||||
| @SuppressLint("SetTextI18n") | |||||
| override fun convert(holder: BaseViewHolder, item: LeaveActivity) { | |||||
| if (item.is_approve == 0) { | |||||
| holder.itemView.addUserName.visibility = View.VISIBLE | |||||
| holder.itemView.addUserName.text = item.add_user_name | |||||
| holder.itemView.approvalComments.visibility = View.GONE | |||||
| } else { | |||||
| holder.itemView.addUserName.visibility = View.GONE | |||||
| holder.itemView.approvalComments.visibility = View.VISIBLE | |||||
| var str = "审批人:${item.add_user_name}" | |||||
| if (item.approval_comments != null && item.approval_comments.isNotEmpty()) { | |||||
| str += "。${item.approval_comments}" | |||||
| } | |||||
| holder.itemView.approvalComments.text = str | |||||
| } | |||||
| if (item.add_user_type_name.isNullOrBlank()) { | |||||
| holder.itemView.addUserTypeName.visibility = View.GONE | |||||
| } else { | |||||
| holder.itemView.addUserTypeName.visibility = View.VISIBLE | |||||
| holder.itemView.addUserTypeName.text = "(${item.add_user_type_name})" | |||||
| } | |||||
| holder.itemView.activityName.text = item.activity_name | |||||
| if (item.is_approve == 1 && item.approval_status > 0) { | |||||
| holder.itemView.statusName.visibility = View.VISIBLE | |||||
| holder.itemView.statusName.text = when (item.approval_status) { | |||||
| 1 -> "(待审批)" | |||||
| 2 -> "(通过)" | |||||
| 3 -> "(拒绝)" | |||||
| else -> "" | |||||
| } | |||||
| } else { | |||||
| holder.itemView.statusName.visibility = View.GONE | |||||
| } | |||||
| if (item?.sign_key != null && item?.sign_key?.isNotEmpty()) { | |||||
| holder.itemView.signImg.visibility = View.VISIBLE | |||||
| holder.itemView.signImg.setSrc(item.sign_identity, item.sign_key) | |||||
| } else { | |||||
| holder.itemView.signImg.visibility = View.GONE | |||||
| } | |||||
| if (item.is_approve == 0 || item.approval_status > 1) { | |||||
| holder.itemView.stepTime.visibility = View.VISIBLE | |||||
| holder.itemView.stepTime.text = item.add_time.toTime() | |||||
| } else { | |||||
| holder.itemView.stepTime.visibility = View.GONE | |||||
| } | |||||
| 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(40)) | |||||
| } | |||||
| } | |||||
| } | |||||
| @@ -0,0 +1,55 @@ | |||||
| 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.StuLeave | |||||
| import com.yzx.escreen.utils.durationStr | |||||
| import com.yzx.escreen.utils.setSrc | |||||
| import com.yzx.escreen.utils.toTime | |||||
| import kotlinx.android.synthetic.main.layout_leave_table.view.* | |||||
| import org.jetbrains.anko.textColor | |||||
| class HomeListAdapter(list: MutableList<StuLeave>) : | |||||
| BaseQuickAdapter<StuLeave, BaseViewHolder>(R.layout.layout_leave_table, list) { | |||||
| @SuppressLint("SetTextI18n") | |||||
| override fun convert(holder: BaseViewHolder, item: StuLeave) { | |||||
| holder.itemView.studentName.text = item.leave_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.leave_request_type_name | |||||
| holder.itemView.leaveTime.text = | |||||
| "${item.start_time.toTime()} -- -- ${item.end_time.toTime()}" | |||||
| holder.itemView.durationStrName.text = (item.end_time - item.start_time).durationStr() | |||||
| 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") | |||||
| else -> Color.parseColor("#333333") | |||||
| } | |||||
| holder.itemView.applyTime.text = item.add_time.toTime() | |||||
| holder.itemView.bottomLine.visibility = if (holder.adapterPosition == data.size - 1) { | |||||
| View.GONE | |||||
| } else { | |||||
| View.VISIBLE | |||||
| } | |||||
| } | |||||
| } | |||||
| @@ -6,4 +6,5 @@ object Config { | |||||
| var BASE_URL = BuildConfig.BASE_URL | var BASE_URL = BuildConfig.BASE_URL | ||||
| var APP_NAME = BuildConfig.APP_NAME | var APP_NAME = BuildConfig.APP_NAME | ||||
| var M_URL = BuildConfig.M_URL | var M_URL = BuildConfig.M_URL | ||||
| var OA_URL = BuildConfig.OA_URL | |||||
| } | } | ||||
| @@ -0,0 +1,51 @@ | |||||
| package com.yzx.webebook.config | |||||
| object YzxInterface { | |||||
| const val FILE_UPLOAD_URL = "https://fileupload.oa.qbjjyyun.net/edufile/fileUpload" | |||||
| 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_INFO_DETAIL= "/edu/attendance/getStudentLeaveRequestDetail" //获取学生的请假信息详情 | |||||
| const val INTERFACE_GET_TEACHER_INFO= "/rights/teacherWork/getTeacherByUserId"//获取人员信息 | |||||
| const val INTERFACE_STUDENT_GET_SHOW_BOX_LIST= "/edu/attendance/student/getStudentLeaveIds" //获取需要弹出的数据 | |||||
| } | |||||
| @@ -0,0 +1,311 @@ | |||||
| package com.yzx.escreen.fragment | |||||
| import android.annotation.SuppressLint | |||||
| import android.content.res.ColorStateList | |||||
| import android.graphics.Color | |||||
| import android.os.Handler | |||||
| import android.os.Looper | |||||
| 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.SPUtils | |||||
| import com.qmuiteam.qmui.widget.roundwidget.QMUIRoundButton | |||||
| import com.yzx.escreen.R | |||||
| import com.yzx.escreen.activity.WebActivity | |||||
| import com.yzx.escreen.adapter.HomeDialogStepAdapter | |||||
| import com.yzx.escreen.fragment.base.BaseFragment | |||||
| import com.yzx.escreen.model.Pager | |||||
| import com.yzx.escreen.model.StuLeave | |||||
| import com.yzx.escreen.adapter.HomeListAdapter | |||||
| import com.yzx.escreen.model.LeaveID | |||||
| import com.yzx.escreen.presenter.HomePresenter | |||||
| import com.yzx.escreen.presenter.HomeView | |||||
| import com.yzx.escreen.utils.setSrc | |||||
| import com.yzx.escreen.utils.toTime | |||||
| import com.yzx.escreen.widget.BaseDialog | |||||
| import kotlinx.android.synthetic.main.fragment_home.* | |||||
| 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 HomeFragment : BaseFragment<HomePresenter>(), HomeView { | |||||
| companion object { | |||||
| @JvmStatic | |||||
| fun getNewInstance() = | |||||
| HomeFragment() | |||||
| } | |||||
| private val mAdapter: HomeListAdapter by lazy { | |||||
| val list = mutableListOf<StuLeave>() | |||||
| HomeListAdapter(list) | |||||
| } | |||||
| private var mPager = Pager() | |||||
| var list = mutableListOf<StuLeave>() | |||||
| private val statusBtnList = mutableListOf<QMUIRoundButton>() | |||||
| var keyword: String = "" | |||||
| var status: String = "" | |||||
| private var isLoading = false | |||||
| private val mShowList = mutableListOf<StuLeave>() | |||||
| private val mShowDialogList = mutableListOf<BaseDialog>() | |||||
| private val mHandler = Handler(Looper.getMainLooper()) | |||||
| private val runnable = object : Runnable { | |||||
| override fun run() { | |||||
| mPresenter?.getLeaveShowIds() | |||||
| mHandler.postDelayed(this, 2000) | |||||
| } | |||||
| } | |||||
| override val inflateId: Int | |||||
| get() = R.layout.fragment_home | |||||
| override fun initView() { | |||||
| recyclerView.layoutManager = | |||||
| LinearLayoutManager(context, LinearLayoutManager.VERTICAL, false) | |||||
| recyclerView.adapter = mAdapter | |||||
| mAdapter.setEmptyView(R.layout.layout_empty) | |||||
| 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() | |||||
| } | |||||
| } | |||||
| false | |||||
| } | |||||
| clearBtn.setOnClickListener { | |||||
| keyword = "" | |||||
| keywordInput.setText("") | |||||
| initData() | |||||
| } | |||||
| mAdapter.setOnItemClickListener { adapter, view, position -> | |||||
| mPresenter?.getDetail(mAdapter.getItem(position).id) | |||||
| } | |||||
| switchBtn.setOnCheckedChangeListener { buttonView, isChecked -> | |||||
| SPUtils.getInstance().put("auto_show_leave", isChecked) | |||||
| changeSwitchBtnTxt(isChecked) | |||||
| if (!isChecked) { | |||||
| mHandler.removeCallbacks(runnable) | |||||
| } else { | |||||
| mHandler.postDelayed(runnable, 2000) | |||||
| } | |||||
| } | |||||
| val isAutoShowLeave = SPUtils.getInstance().getBoolean("auto_show_leave", false) | |||||
| switchBtn.isChecked = isAutoShowLeave | |||||
| changeSwitchBtnTxt(isAutoShowLeave) | |||||
| if (isAutoShowLeave) { | |||||
| mHandler.postDelayed(runnable, 2000) | |||||
| } | |||||
| switchBtnTxt.setOnClickListener { | |||||
| switchBtn.isChecked = !switchBtn.isChecked | |||||
| } | |||||
| } | |||||
| 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: StuLeave) { | |||||
| val adapter = HomeDialogStepAdapter(mutableListOf()) | |||||
| val dialog = BaseDialog(act, R.style.BaseDialog, R.layout.dialog_leave) | |||||
| //处理弹窗显示 | |||||
| dialog.find<TextView>(R.id.leave_student_name).text = detail.leave_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.leave_request_type_name | |||||
| dialog.find<TextView>(R.id.add_time).text = | |||||
| "${detail.start_time.toTime()} - ${detail.end_time.toTime()}" | |||||
| dialog.find<TextView>(R.id.leave_request_reason).text = detail.leave_request_reason | |||||
| dialog.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" | |||||
| else -> "" | |||||
| } | |||||
| ) | |||||
| 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) | |||||
| } | |||||
| } | |||||
| dialog.show() | |||||
| 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) { | |||||
| if (isLoading) { | |||||
| return | |||||
| } | |||||
| changeStatusBtn(status) | |||||
| this.status = if (status == 0) { | |||||
| "" | |||||
| } else { | |||||
| "${status}" | |||||
| } | |||||
| initData() | |||||
| } | |||||
| override fun initData() { | |||||
| mPager.page_no = 1 | |||||
| isLoading = true | |||||
| mPresenter?.getLeaveList(mPager.page_no, keyword, status) | |||||
| } | |||||
| private fun refreshData() { | |||||
| if (isLoading) { | |||||
| return | |||||
| } | |||||
| isLoading = true | |||||
| mPresenter?.getLeaveList(mPager.page_no, keyword, status) | |||||
| } | |||||
| private fun pre() { | |||||
| if (isLoading) { | |||||
| return | |||||
| } | |||||
| if (mPager.page_no <= 1) { | |||||
| } else { | |||||
| isLoading = true | |||||
| mPresenter?.getLeaveList(mPager.page_no - 1, keyword, status) | |||||
| } | |||||
| } | |||||
| private fun next() { | |||||
| if (isLoading) { | |||||
| return | |||||
| } | |||||
| if (mPager.page_no >= mPager.total_pages) { | |||||
| } else { | |||||
| isLoading = true | |||||
| mPresenter?.getLeaveList(mPager.page_no + 1, keyword, status) | |||||
| } | |||||
| } | |||||
| override fun initPresenter(): HomePresenter = HomePresenter(this) | |||||
| @SuppressLint("SetTextI18n") | |||||
| override fun onLeaveListSuccess(list: MutableList<StuLeave>, pager: Pager) { | |||||
| 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 | |||||
| pageTv.postDelayed({ | |||||
| refreshData() | |||||
| }, 30 * 1000) | |||||
| } | |||||
| override fun onLeaveListError(error: String) { | |||||
| isLoading = false | |||||
| } | |||||
| override fun onLeaveDetailSuccess(detail: StuLeave) { | |||||
| 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 onLeaveDetailError(error: String) { | |||||
| } | |||||
| override fun onLeaveIDsSuccess(list: MutableList<LeaveID>) { | |||||
| for (leaveID in list) { | |||||
| mPresenter?.getDetail(leaveID.id) | |||||
| } | |||||
| } | |||||
| } | |||||
| @@ -0,0 +1,125 @@ | |||||
| package com.yzx.escreen.fragment | |||||
| import android.text.InputType | |||||
| import com.blankj.utilcode.util.LogUtils | |||||
| import com.blankj.utilcode.util.ScreenUtils | |||||
| import com.blankj.utilcode.util.ToastUtils | |||||
| import com.qmuiteam.qmui.widget.dialog.QMUIDialog | |||||
| import com.qmuiteam.qmui.widget.dialog.QMUIDialogAction | |||||
| import com.yzx.escreen.MainActivity | |||||
| import com.yzx.escreen.R | |||||
| import com.yzx.escreen.activity.WebActivity | |||||
| import com.yzx.escreen.config.Config | |||||
| import com.yzx.escreen.fragment.base.BaseFragment | |||||
| import com.yzx.escreen.model.TeacherInfo | |||||
| import com.yzx.escreen.model.User | |||||
| import com.yzx.escreen.presenter.MyPresenter | |||||
| import com.yzx.escreen.presenter.MyView | |||||
| import kotlinx.android.synthetic.main.activity_home.* | |||||
| import kotlinx.android.synthetic.main.fragment_my.* | |||||
| import org.jetbrains.anko.startActivity | |||||
| import kotlin.system.exitProcess | |||||
| class MyFragment : BaseFragment<MyPresenter>(), MyView { | |||||
| companion object { | |||||
| @JvmStatic | |||||
| fun getNewInstance() = | |||||
| MyFragment() | |||||
| } | |||||
| private var count = 0 | |||||
| private val run = Runnable { | |||||
| count = 0 | |||||
| } | |||||
| override val inflateId: Int | |||||
| get() = R.layout.fragment_my | |||||
| override fun initView() { | |||||
| sysExitBtn.setOnClickListener { | |||||
| count++ | |||||
| sysExitBtn.removeCallbacks(run) | |||||
| sysExitBtn.postDelayed(run, 1000) | |||||
| if (count >= 5) { | |||||
| showExitDialog() | |||||
| } | |||||
| } | |||||
| } | |||||
| private fun showExitDialog() { | |||||
| val builder = QMUIDialog.EditTextDialogBuilder(activity) | |||||
| builder.setPlaceholder("输入密码") | |||||
| .setTitle("请输入密码") | |||||
| .setInputType(InputType.TYPE_CLASS_PHONE) | |||||
| .addAction("取消" | |||||
| ) { dialog, index -> dialog?.dismiss() } | |||||
| .addAction("确定" | |||||
| ) { dialog, index -> | |||||
| val text = builder.editText.text | |||||
| LogUtils.d(text) | |||||
| LogUtils.d("112233".equals(text)) | |||||
| if("112233" == text.toString()){ | |||||
| activity?.finish() | |||||
| exitProcess(0) | |||||
| }else{ | |||||
| ToastUtils.showShort("密码不正确") | |||||
| } | |||||
| } | |||||
| .setCancelable(false) | |||||
| .setCanceledOnTouchOutside(false) | |||||
| .show() | |||||
| } | |||||
| override fun initData() { | |||||
| mPresenter?.getTeacherInfo(User.getUser().user_id) | |||||
| density.text = | |||||
| "density:${ScreenUtils.getScreenDensity()},dpi:${ScreenUtils.getScreenDensityDpi()}" | |||||
| logoutBtn.setOnClickListener { | |||||
| activity?.apply { | |||||
| User.clearUserInfo() | |||||
| WebActivity.active(this, "${Config.OA_URL}/login?logout=1") | |||||
| finish() | |||||
| } | |||||
| } | |||||
| } | |||||
| override fun initPresenter(): MyPresenter = MyPresenter(this) | |||||
| override fun onUserInfoSuccess(info: TeacherInfo) { | |||||
| userName.text = info.teacher_name | |||||
| sex.text = if (info.sex == 1) { | |||||
| "男" | |||||
| } else { | |||||
| "女" | |||||
| } | |||||
| phone.text = info.phone | |||||
| idCard.text = info.card_no | |||||
| if (info.teacherUnits.isNotEmpty()) { | |||||
| val unit = info.teacherUnits[0] | |||||
| if (unit.teacherUnitGroups.isNotEmpty()) { | |||||
| val group = unit.teacherUnitGroups[0] | |||||
| unitName.text = unit.unit_name | |||||
| groupName.text = group.group_name | |||||
| jobType.text = group.job_type_name | |||||
| isLeader.text = if (group.is_leader == 0) { | |||||
| "是" | |||||
| } else { | |||||
| "否" | |||||
| } | |||||
| jobName.text = group.job_name | |||||
| } | |||||
| } | |||||
| } | |||||
| override fun onUserInfoError(error: String) { | |||||
| } | |||||
| } | |||||
| @@ -0,0 +1,59 @@ | |||||
| package com.yzx.escreen.fragment.base | |||||
| import android.os.Bundle | |||||
| import android.view.LayoutInflater | |||||
| import android.view.View | |||||
| import android.view.ViewGroup | |||||
| import androidx.fragment.app.Fragment | |||||
| import com.yzx.escreen.presenter.base.BasePresenter | |||||
| /** | |||||
| * fragment 基类 | |||||
| */ | |||||
| abstract class BaseFragment<out P : BasePresenter<*>> : Fragment() { | |||||
| /** | |||||
| * 当前页面需要加载的layoutId,等价setContentView | |||||
| */ | |||||
| abstract val inflateId: Int | |||||
| /** | |||||
| * 初始化视图操作在这里执行,执行时机为onCreate之后 | |||||
| */ | |||||
| abstract fun initView(): Unit | |||||
| /** | |||||
| * 数据初始化在这里执行,执行时机为initView之后 | |||||
| */ | |||||
| abstract fun initData(): Unit | |||||
| //kotlin 懒加载,在第一次使用Presenter时初始化,这种设计是针对一个View只针对一个Presenter。 | |||||
| //多个Presenter的情况此处不应该使用泛型 | |||||
| protected val mPresenter: P? by lazy { initPresenter() } | |||||
| abstract fun initPresenter(): P? | |||||
| override fun onCreateView( | |||||
| inflater: LayoutInflater, | |||||
| container: ViewGroup?, | |||||
| savedInstanceState: Bundle? | |||||
| ): View? { | |||||
| return inflater.inflate(inflateId, null) | |||||
| } | |||||
| override fun onViewCreated(view: View, savedInstanceState: Bundle?) { | |||||
| super.onViewCreated(view, savedInstanceState) | |||||
| initView() | |||||
| initData() | |||||
| } | |||||
| override fun onDestroy() { | |||||
| super.onDestroy() | |||||
| } | |||||
| } | |||||
| @@ -4,5 +4,13 @@ data class BaseBean<T>( | |||||
| var code: Int, | var code: Int, | ||||
| var msg: String, | var msg: String, | ||||
| val data: T, | val data: T, | ||||
| val list: MutableList<T> | |||||
| val list: MutableList<T>, | |||||
| val pager:Pager = Pager() | |||||
| ) | |||||
| data class Pager( | |||||
| var page_no:Int = 1, | |||||
| val page_size:Int = 0, | |||||
| val total_pages:Int = 0, | |||||
| val total_count:Int = 0 | |||||
| ) | ) | ||||
| @@ -0,0 +1,147 @@ | |||||
| package com.yzx.escreen.model | |||||
| import android.app.Dialog | |||||
| import com.blankj.utilcode.util.LogUtils | |||||
| data class StuLeave( | |||||
| val activities: MutableList<LeaveActivity> = mutableListOf(), | |||||
| val add_time: Int = 0, | |||||
| val add_user_id: Int = 0, | |||||
| val add_user_name: String = "", | |||||
| val add_user_type: Int = 0, | |||||
| val approve_time: Int = 0, | |||||
| val attachments: List<Any> = listOf(), | |||||
| val can_reviewed: Int = 0, | |||||
| val class_id: Int = 0, | |||||
| val class_name: String = "", | |||||
| val copy_recipients: String = "", | |||||
| val end_time: Int = 0, | |||||
| val entry_flag: Int = 0, | |||||
| val face_identity: String = "", | |||||
| val face_key: String = "", | |||||
| val ftime: Int = 0, | |||||
| val grade_id: Int = 0, | |||||
| val grade_name: String = "", | |||||
| val headteacher_id: Int = 0, | |||||
| val id: Int = 0, | |||||
| val leave_request_reason: String = "", | |||||
| val leave_request_type: Int = 0, | |||||
| val leave_request_type_name: String = "", | |||||
| val leave_student_id: Int = 0, | |||||
| val leave_student_name: String = "", | |||||
| val relation_id: Int = 0, | |||||
| val request_status: Any = Any(), | |||||
| val school_id: Int = 0, | |||||
| val school_name: String = "", | |||||
| val start_time: Int = 0, | |||||
| val status: Int = 0, | |||||
| val todo_list_id: Int = 0, | |||||
| val todo_status: Int = 0 | |||||
| ){ | |||||
| fun getStep(): MutableList<LeaveActivity> { | |||||
| val logList = mutableListOf<LeaveActivity>() | |||||
| for (item in activities) { | |||||
| if(item.child.isNotEmpty()){ | |||||
| for (it in item.child) { | |||||
| it.activity_name = when(it.approve_user_type){ | |||||
| 0->"领导审批" | |||||
| 1->"自选" | |||||
| 2->if (it.role_type==3){ | |||||
| "班主任审批" | |||||
| }else{ | |||||
| "任课老师审批" | |||||
| } | |||||
| 3->"专业部领导审批" | |||||
| 4->"值班领导审批" | |||||
| else->"领导审批" | |||||
| } | |||||
| } | |||||
| val approvedList = item.child.filter { | |||||
| return@filter it.approval_status>1 | |||||
| } | |||||
| if(approvedList.isNotEmpty()){ | |||||
| if(item.approve_way==2){ | |||||
| logList.addAll(approvedList) | |||||
| }else{ | |||||
| logList.addAll(item.child) | |||||
| } | |||||
| }else{ | |||||
| item.activity_name = when(item.approve_user_type){ | |||||
| 0->"领导审批" | |||||
| 1->"自选" | |||||
| 2->if (item.role_type==3){ | |||||
| "班主任审批" | |||||
| }else{ | |||||
| "任课老师审批" | |||||
| } | |||||
| 3->"专业部领导审批" | |||||
| 4->"值班领导审批" | |||||
| else->"领导审批" | |||||
| } | |||||
| if(item.child.size>1){ | |||||
| item.activity_name += when(item.approve_way){ | |||||
| 0-> "(依次审批)" | |||||
| 1-> "(会签)" | |||||
| 2-> "(或签)" | |||||
| else->"" | |||||
| } | |||||
| } | |||||
| item.add_user_name = item.child.map { | |||||
| return@map it.add_user_name | |||||
| }.joinToString(separator = "、") | |||||
| item.approval_status = 1 | |||||
| item.is_approve = 1 | |||||
| logList.add(item) | |||||
| } | |||||
| }else{ //提交人 | |||||
| item.activity_name = "提交申请" | |||||
| if(item.add_user_type == 0){ | |||||
| item.add_user_type_name = "老师" | |||||
| }else if (item.add_user_type == 1){ | |||||
| item.add_user_type_name = "学生家长" | |||||
| } | |||||
| logList.add(item) | |||||
| } | |||||
| } | |||||
| return logList | |||||
| } | |||||
| } | |||||
| data class LeaveID(var id: Int) | |||||
| data class LeaveActivity( | |||||
| var activity_name: String = "", | |||||
| var add_time: Int = 0, | |||||
| var add_user_id: Int = 0, | |||||
| var add_user_name: String = "", | |||||
| var add_user_type: Int = 0, | |||||
| var approval_comments: String = "", | |||||
| var approval_status: Int = 0, | |||||
| var approve_node: Int = 0, | |||||
| var approve_sort: Int = 0, | |||||
| var approve_user_type: Int = 0, | |||||
| var approve_way: Int = 0, | |||||
| var child: MutableList<LeaveActivity> = mutableListOf(), | |||||
| var id: Int = 0, | |||||
| var is_approve: Int = 0, | |||||
| var related_id: Int = 0, | |||||
| var relation_id: Int = 0, | |||||
| var report_end_date: Int = 0, | |||||
| var report_start_date: Int = 0, | |||||
| var role_type: Int = 0, | |||||
| var school_name: String = "", | |||||
| var sign_identity: String = "", | |||||
| var sign_key: String = "", | |||||
| var status: Int = 0, | |||||
| var sub_type: Any = Any(), | |||||
| var type: Int = 0, | |||||
| var unit_id: Int = 0, | |||||
| var unit_name: String = "", | |||||
| var add_user_type_name: String="" | |||||
| ) { | |||||
| } | |||||
| @@ -0,0 +1,102 @@ | |||||
| package com.yzx.escreen.model | |||||
| data class TeacherInfo( | |||||
| val academic_degree: Int = 0, | |||||
| val academic_degree_describe: String = "", | |||||
| val add_time: Int = 0, | |||||
| val age: Int = 0, | |||||
| val audit_remark: String = "", | |||||
| val audit_status: Int = 0, | |||||
| val audit_user_id: Int = 0, | |||||
| val audit_user_name: String = "", | |||||
| val birth_place: String = "", | |||||
| val birth_place_json: String = "", | |||||
| val birthday: String = "", | |||||
| val card_no: String = "", | |||||
| val card_no_type: Int = 0, | |||||
| val degree_id: Int = 0, | |||||
| val editing_time: Int = 0, | |||||
| val face_add_time: Int = 0, | |||||
| val face_identity: String = "", | |||||
| val face_key: String = "", | |||||
| val first_part: Int = 0, | |||||
| val first_part_describe: Int = 0, | |||||
| val first_part_time: Int = 0, | |||||
| val head_portrait: String = "", | |||||
| val is_commit: Int = 0, | |||||
| val is_remind_commit: Int = 0, | |||||
| val is_retire_time: Int = 0, | |||||
| val is_show_btn: Int = 0, | |||||
| val is_syn: Int = 0, | |||||
| val marry_status_id: Int = 0, | |||||
| val nation: Int = 0, | |||||
| val native_place: String = "", | |||||
| val native_place_json: String = "", | |||||
| val nick_name: String = "", | |||||
| val not_incumbency_time: Int = 0, | |||||
| val people_identity: Int = 0, | |||||
| val people_source_describe: Int = 0, | |||||
| val people_source_type: Int = 0, | |||||
| val people_type: Int = 0, | |||||
| val phone: String = "", | |||||
| val professional: String = "", | |||||
| val retire_remark: String = "", | |||||
| val retire_time: Long = 0, | |||||
| val salary_unit_id: Int = 0, | |||||
| val school_id: Int = 0, | |||||
| val second_part: Int = 0, | |||||
| val second_part_describe: Int = 0, | |||||
| val second_part_time: Int = 0, | |||||
| val sex: Int = 0, | |||||
| val status: Int = 0, | |||||
| val teach_curriculum: String = "", | |||||
| val teach_interval_time: Int = 0, | |||||
| val teach_period: Int = 0, | |||||
| val teach_start_time: String = "", | |||||
| val teach_years: Int = 0, | |||||
| val teacherUnits: List<TeacherUnit> = listOf(), | |||||
| val teacher_id: Int = 0, | |||||
| val teacher_name: String = "", | |||||
| val teacher_school_status: Int = 0, | |||||
| val urgent_phone: String = "", | |||||
| val user_id: Int = 0, | |||||
| val user_type: Int = 0, | |||||
| val work_interval_time: Int = 0, | |||||
| val work_start_time: String = "", | |||||
| val work_years: Int = 0 | |||||
| ) | |||||
| data class TeacherUnit( | |||||
| val add_time: Int = 0, | |||||
| val id: Int = 0, | |||||
| val into_unit_time: Int = 0, | |||||
| val is_salary_unit: Int = 0, | |||||
| val post_level: Int = 0, | |||||
| val post_level_name: String = "", | |||||
| val status: Int = 0, | |||||
| val teacherUnitGroups: List<TeacherUnitGroup> = listOf(), | |||||
| val title: Int = 0, | |||||
| val title_name: String = "", | |||||
| val unit_id: Int = 0, | |||||
| val unit_main: Int = 0, | |||||
| val unit_main_describe: Int = 0, | |||||
| val unit_main_type: Int = 0, | |||||
| val unit_name: String = "", | |||||
| val user_id: Int = 0 | |||||
| ) | |||||
| data class TeacherUnitGroup( | |||||
| val add_time: Int = 0, | |||||
| val group_id: Int = 0, | |||||
| val group_ids: String = "", | |||||
| val group_name: String = "", | |||||
| val id: Int = 0, | |||||
| val is_leader: Int = 0, | |||||
| val job_name: String = "", | |||||
| val job_name_id: Int = 0, | |||||
| val job_status: Int = 0, | |||||
| val job_type: Int = 0, | |||||
| val job_type_name: String = "", | |||||
| val status: Int = 0, | |||||
| val teacher_unit_id: Int = 0 | |||||
| ) | |||||
| @@ -1,37 +1,31 @@ | |||||
| package com.yzx.escreen.model | package com.yzx.escreen.model | ||||
| import com.blankj.utilcode.util.SPUtils | import com.blankj.utilcode.util.SPUtils | ||||
| import com.blankj.utilcode.util.TimeUtils | |||||
| class User( | class User( | ||||
| var user_name: String, | var user_name: String, | ||||
| var user_id: Int, | var user_id: Int, | ||||
| var type: Int, | |||||
| var account_type: Int, | |||||
| var role: String, | |||||
| var token: String, | var token: String, | ||||
| var school_id: Int, | var school_id: Int, | ||||
| var school_name: String, | |||||
| var phone: String, | var phone: String, | ||||
| var grade_name: String, | |||||
| var grade_id: Int, | |||||
| var class_name: String, | |||||
| var class_id: Int, | |||||
| var ticket: String, | var ticket: String, | ||||
| var login_start: String | |||||
| var loginTime: Long | |||||
| ) { | ) { | ||||
| fun save() { | fun save() { | ||||
| val sp = SPUtils.getInstance() | val sp = SPUtils.getInstance() | ||||
| sp.put("user_name", user_name) | sp.put("user_name", user_name) | ||||
| sp.put("user_id", user_id) | sp.put("user_id", user_id) | ||||
| sp.put("type", type) | |||||
| sp.put("token", token) | sp.put("token", token) | ||||
| sp.put("school_id", school_id) | sp.put("school_id", school_id) | ||||
| sp.put("school_name", school_name) | |||||
| sp.put("phone", phone) | sp.put("phone", phone) | ||||
| sp.put("grade_name", grade_name) | |||||
| sp.put("grade_id", grade_id) | |||||
| sp.put("class_name", class_name) | |||||
| sp.put("class_id", class_id) | |||||
| sp.put("ticket", ticket) | sp.put("ticket", ticket) | ||||
| sp.put("login_start", login_start) | |||||
| sp.put("account_type", account_type) | |||||
| sp.put("role", role) | |||||
| sp.put("loginTime", TimeUtils.getNowMills()) | |||||
| } | } | ||||
| companion object { | companion object { | ||||
| @@ -40,42 +34,45 @@ class User( | |||||
| return User( | return User( | ||||
| sp.getString("user_name", ""), | sp.getString("user_name", ""), | ||||
| sp.getInt("user_id", 0), | sp.getInt("user_id", 0), | ||||
| sp.getInt("type", 0), | |||||
| sp.getInt("account_type", 0), | |||||
| sp.getString("role", ""), | |||||
| sp.getString("token", ""), | sp.getString("token", ""), | ||||
| sp.getInt("school_id", 0), | sp.getInt("school_id", 0), | ||||
| sp.getString("school_name", ""), | |||||
| sp.getString("phone", ""), | sp.getString("phone", ""), | ||||
| sp.getString("grade_name", ""), | |||||
| sp.getInt("grade_id", 0), | |||||
| sp.getString("class_name", ""), | |||||
| sp.getInt("class_id", 0), | |||||
| sp.getString("ticket", ""), | sp.getString("ticket", ""), | ||||
| sp.getString("login_start", "") | |||||
| sp.getLong("loginTime", 0) | |||||
| ) | ) | ||||
| } | } | ||||
| fun getUnitCount():Int = SPUtils.getInstance().getInt("unit_count",1) | |||||
| fun isLogin(): Boolean { | |||||
| val now = TimeUtils.getNowMills() | |||||
| val user = getUser() | |||||
| if (user.token.isNullOrBlank()) { | |||||
| return false | |||||
| } | |||||
| if (now - user.loginTime > 24 * 60 * 60 * 1000) { | |||||
| return false | |||||
| } | |||||
| return true | |||||
| } | |||||
| fun getUnitCount(): Int = SPUtils.getInstance().getInt("unit_count", 1) | |||||
| fun saveUnitCount(count:Int){ | |||||
| SPUtils.getInstance().put("unit_count",count); | |||||
| fun saveUnitCount(count: Int) { | |||||
| SPUtils.getInstance().put("unit_count", count); | |||||
| } | } | ||||
| fun clearUserInfo(){ | |||||
| fun clearUserInfo() { | |||||
| val sp = SPUtils.getInstance() | val sp = SPUtils.getInstance() | ||||
| sp.remove("user_name") | sp.remove("user_name") | ||||
| sp.remove("user_id") | sp.remove("user_id") | ||||
| sp.remove("type") | |||||
| sp.remove("account_type") | |||||
| sp.remove("role") | |||||
| sp.remove("token") | sp.remove("token") | ||||
| sp.remove("school_id") | sp.remove("school_id") | ||||
| sp.remove("school_name") | |||||
| sp.remove("phone") | sp.remove("phone") | ||||
| sp.remove("grade_name") | |||||
| sp.remove("grade_id") | |||||
| sp.remove("class_name") | |||||
| sp.remove("class_id") | |||||
| sp.remove("ticket") | sp.remove("ticket") | ||||
| sp.remove("login_start") | |||||
| sp.remove("unit_count") | |||||
| sp.remove("loginTime") | |||||
| } | } | ||||
| } | } | ||||
| } | } | ||||
| @@ -0,0 +1,106 @@ | |||||
| 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.Pager | |||||
| import com.yzx.escreen.model.StuLeave | |||||
| import com.yzx.escreen.model.User | |||||
| import com.yzx.webebook.config.YzxInterface | |||||
| 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 | |||||
| class HomePresenter(view: HomeView) : BasePresenter<HomeView>(view) { | |||||
| fun getLeaveList(pageNo: Int, keyword: String, status: String) { | |||||
| if(!User.isLogin()){ | |||||
| return | |||||
| } | |||||
| val url = "${Config.BASE_URL}${YzxInterface.INTERFACE_GET_STU_LEAVE_LIST}" | |||||
| OkGo.post<YzxResponse<StuLeave>>(url) | |||||
| .tag(this) | |||||
| .params("keyword", keyword) | |||||
| .params("status", status) | |||||
| .params("page_size", 6) | |||||
| .params("page_no", pageNo) | |||||
| .execute(object : JsonCallBack<YzxResponse<StuLeave>>() { | |||||
| override fun onSuccess(response: Response<YzxResponse<StuLeave>>?) { | |||||
| LogUtils.d(response) | |||||
| if (response?.isSuccessful == true) { | |||||
| mView?.onLeaveListSuccess(response.body().list, response.body().pager) | |||||
| } | |||||
| } | |||||
| override fun onError(response: Response<YzxResponse<StuLeave>>?) { | |||||
| super.onError(response) | |||||
| LogUtils.d(response) | |||||
| mView?.onLeaveListError(response?.body()?.msg ?: "") | |||||
| } | |||||
| }) | |||||
| } | |||||
| 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>>?) { | |||||
| LogUtils.d(response) | |||||
| if (response?.isSuccessful == true) { | |||||
| mView?.onLeaveIDsSuccess(response.body().list) | |||||
| } | |||||
| } | |||||
| override fun onError(response: Response<YzxResponse<LeaveID>>?) { | |||||
| super.onError(response) | |||||
| LogUtils.d(response) | |||||
| mView?.onLeaveListError(response?.body()?.msg ?: "") | |||||
| } | |||||
| }) | |||||
| } | |||||
| fun getDetail(id: Int) { | |||||
| if(!User.isLogin()){ | |||||
| return | |||||
| } | |||||
| val url = "${Config.BASE_URL}${YzxInterface.INTERFACE_GET_STU_LEAVE_INFO_DETAIL}" | |||||
| OkGo.post<YzxResponse<StuLeave>>(url) | |||||
| .tag(this) | |||||
| .params("id", id) | |||||
| .execute(object : JsonCallBack<YzxResponse<StuLeave>>() { | |||||
| override fun onSuccess(response: Response<YzxResponse<StuLeave>>?) { | |||||
| LogUtils.d(response) | |||||
| if (response?.isSuccessful == true) { | |||||
| mView?.onLeaveDetailSuccess(response.body().data) | |||||
| } | |||||
| } | |||||
| override fun onError(response: Response<YzxResponse<StuLeave>>?) { | |||||
| super.onError(response) | |||||
| LogUtils.d(response) | |||||
| mView?.onLeaveDetailError(response?.body()?.msg ?: "") | |||||
| } | |||||
| }) | |||||
| } | |||||
| } | |||||
| interface HomeView : IView { | |||||
| fun onLeaveListSuccess(list: MutableList<StuLeave>, pager: Pager) | |||||
| fun onLeaveListError(error: String) | |||||
| fun onLeaveDetailSuccess(detail: StuLeave) | |||||
| fun onLeaveDetailError(error: String) | |||||
| fun onLeaveIDsSuccess(list: MutableList<LeaveID>) | |||||
| } | |||||
| @@ -0,0 +1,53 @@ | |||||
| 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.Pager | |||||
| import com.yzx.escreen.model.StuLeave | |||||
| import com.yzx.escreen.model.TeacherInfo | |||||
| import com.yzx.escreen.model.User | |||||
| import com.yzx.webebook.config.YzxInterface | |||||
| 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 | |||||
| class MyPresenter(view: MyView) : BasePresenter<MyView>(view) { | |||||
| fun getTeacherInfo(user_id: Int) { | |||||
| if(!User.isLogin()){ | |||||
| return | |||||
| } | |||||
| val url = "${Config.BASE_URL}${YzxInterface.INTERFACE_GET_TEACHER_INFO}" | |||||
| OkGo.post<YzxResponse<TeacherInfo>>(url) | |||||
| .tag(this) | |||||
| .params("user_id", user_id) | |||||
| .execute(object : JsonCallBack<YzxResponse<TeacherInfo>>() { | |||||
| override fun onSuccess(response: Response<YzxResponse<TeacherInfo>>?) { | |||||
| LogUtils.d(response) | |||||
| if (response?.isSuccessful == true) { | |||||
| mView?.onUserInfoSuccess(response.body().data) | |||||
| } | |||||
| } | |||||
| override fun onError(response: Response<YzxResponse<TeacherInfo>>?) { | |||||
| super.onError(response) | |||||
| LogUtils.d(response) | |||||
| mView?.onUserInfoError(response?.body()?.msg ?: "") | |||||
| } | |||||
| }) | |||||
| } | |||||
| } | |||||
| interface MyView : IView { | |||||
| fun onUserInfoSuccess(info: TeacherInfo) | |||||
| fun onUserInfoError(error:String) | |||||
| } | |||||
| @@ -0,0 +1,50 @@ | |||||
| package com.yzx.escreen.presenter.base; | |||||
| import com.google.gson.Gson; | |||||
| import com.google.gson.JsonIOException; | |||||
| import com.google.gson.JsonSyntaxException; | |||||
| import com.google.gson.stream.JsonReader; | |||||
| import java.io.Reader; | |||||
| import java.lang.reflect.Type; | |||||
| public class Convert { | |||||
| private static Gson create() { | |||||
| return GsonHolder.gson; | |||||
| } | |||||
| private static class GsonHolder { | |||||
| private static Gson gson = new Gson(); | |||||
| } | |||||
| public static <T> T fromJson(String json, Class<T> type) throws JsonIOException, JsonSyntaxException { | |||||
| return create().fromJson(json, type); | |||||
| } | |||||
| public static <T> T fromJson(String json, Type type) { | |||||
| return create().fromJson(json, type); | |||||
| } | |||||
| public static <T> T fromJson(JsonReader reader, Type typeOfT) throws JsonIOException, JsonSyntaxException { | |||||
| return create().fromJson(reader, typeOfT); | |||||
| } | |||||
| public static <T> T fromJson(Reader json, Class<T> classOfT) throws JsonSyntaxException, JsonIOException { | |||||
| return create().fromJson(json, classOfT); | |||||
| } | |||||
| public static <T> T fromJson(Reader json, Type typeOfT) throws JsonIOException, JsonSyntaxException { | |||||
| return create().fromJson(json, typeOfT); | |||||
| } | |||||
| public static String toJson(Object src) { | |||||
| return create().toJson(src); | |||||
| } | |||||
| public static String toJson(Object src, Type typeOfSrc) { | |||||
| return create().toJson(src, typeOfSrc); | |||||
| } | |||||
| } | |||||
| @@ -0,0 +1,155 @@ | |||||
| package com.yzx.escreen.presenter.base; | |||||
| import com.google.gson.stream.JsonReader; | |||||
| import com.lzy.okgo.callback.AbsCallback; | |||||
| import com.lzy.okgo.model.HttpHeaders; | |||||
| import com.lzy.okgo.request.base.Request; | |||||
| import com.yzx.escreen.model.User; | |||||
| import com.yzx.escreen.utils.Monitor; | |||||
| import org.json.JSONArray; | |||||
| import org.json.JSONObject; | |||||
| import java.lang.reflect.ParameterizedType; | |||||
| import java.lang.reflect.Type; | |||||
| import okhttp3.Response; | |||||
| import okhttp3.ResponseBody; | |||||
| public abstract class JsonCallBack<T> extends AbsCallback<T> { | |||||
| private Type type; | |||||
| private Class<T> clazz; | |||||
| private StringBuilder sb = new StringBuilder(); | |||||
| public JsonCallBack() { | |||||
| } | |||||
| public JsonCallBack(Type type) { | |||||
| this.type = type; | |||||
| } | |||||
| public JsonCallBack(Class<T> clazz) { | |||||
| this.clazz = clazz; | |||||
| } | |||||
| @Override | |||||
| public void onStart(Request<T, ? extends Request> request) { | |||||
| super.onStart(request); | |||||
| User user = User.Companion.getUser(); | |||||
| HttpHeaders headers = new HttpHeaders(); | |||||
| headers.put("phone", user.getPhone()); | |||||
| headers.put("token", user.getToken()); | |||||
| // headers.put("phone","18780170404"); | |||||
| // headers.put("token","11c73fb160bd715654736e7196dc1b57"); | |||||
| request.headers(headers); | |||||
| sb.append("url:").append(request.getUrl()).append("\n"); | |||||
| sb.append("headers:").append(request.getHeaders().toString()).append("\n"); | |||||
| sb.append("params:").append(request.getParams().toString()).append("\n"); | |||||
| } | |||||
| @Override | |||||
| public T convertResponse(Response response) throws Throwable { | |||||
| if (type == null) { | |||||
| if (clazz == null) { | |||||
| // 如果没有通过构造函数传进来,就自动解析父类泛型的真实类型(有局限性,继承后就无法解析到) | |||||
| Type genType = getClass().getGenericSuperclass(); | |||||
| type = ((ParameterizedType) genType).getActualTypeArguments()[0]; | |||||
| } else { | |||||
| return parseClass(response, clazz); | |||||
| } | |||||
| } | |||||
| if (type instanceof ParameterizedType) { | |||||
| return parseParameterizedType(response, (ParameterizedType) type); | |||||
| } else if (type instanceof Class) { | |||||
| return parseClass(response, (Class<?>) type); | |||||
| } else { | |||||
| return parseType(response, type); | |||||
| } | |||||
| } | |||||
| private T parseClass(Response response, Class<?> rawType) throws Exception { | |||||
| if (rawType == null) return null; | |||||
| ResponseBody body = response.body(); | |||||
| if (body == null) return null; | |||||
| JsonReader jsonReader = new JsonReader(body.charStream()); | |||||
| if (rawType == String.class) { | |||||
| //noinspection unchecked | |||||
| return (T) body.string(); | |||||
| } else if (rawType == JSONObject.class) { | |||||
| //noinspection unchecked | |||||
| return (T) new JSONObject(body.string()); | |||||
| } else if (rawType == JSONArray.class) { | |||||
| //noinspection unchecked | |||||
| return (T) new JSONArray(body.string()); | |||||
| } else { | |||||
| T t = Convert.fromJson(jsonReader, rawType); | |||||
| response.close(); | |||||
| return t; | |||||
| } | |||||
| } | |||||
| private T parseType(Response response, Type type) throws Exception { | |||||
| if (type == null) return null; | |||||
| ResponseBody body = response.body(); | |||||
| if (body == null) return null; | |||||
| JsonReader jsonReader = new JsonReader(body.charStream()); | |||||
| // 泛型格式如下: new JsonCallback<任意JavaBean>(this) | |||||
| T t = Convert.fromJson(jsonReader, type); | |||||
| response.close(); | |||||
| return t; | |||||
| } | |||||
| private T parseParameterizedType(Response response, ParameterizedType type) throws Exception { | |||||
| if (type == null) return null; | |||||
| ResponseBody body = response.body(); | |||||
| if (body == null) return null; | |||||
| JsonReader jsonReader = new JsonReader(body.charStream()); | |||||
| Type rawType = type.getRawType(); // 泛型的实际类型 | |||||
| Type typeArgument = type.getActualTypeArguments()[0]; // 泛型的参数 | |||||
| if (rawType != YzxResponse.class) { | |||||
| // 泛型格式如下: new JsonCallback<外层BaseBean<内层JavaBean>>(this) | |||||
| T t = Convert.fromJson(jsonReader, type); | |||||
| response.close(); | |||||
| return t; | |||||
| } else { | |||||
| if (typeArgument == Void.class) { | |||||
| // 泛型格式如下: new JsonCallback<YzxResponse<Void>>(this) | |||||
| SimpleResponse simpleResponse = Convert.fromJson(jsonReader, SimpleResponse.class); | |||||
| response.close(); | |||||
| //noinspection unchecked | |||||
| return (T) simpleResponse.toYzxResponse(); | |||||
| } else { | |||||
| // 泛型格式如下: new JsonCallback<YzxResponse<内层JavaBean>>(this) | |||||
| YzxResponse yzxResponse = Convert.fromJson(jsonReader, type); | |||||
| response.close(); | |||||
| int code = yzxResponse.code; | |||||
| // 一般来说服务器会和客户端约定一个数表示成功,如200,其余的表示失败,如400,300等,这里根据实际情况罗列并抛出 | |||||
| if (code == 0) { | |||||
| //noinspection unchecked | |||||
| return (T) yzxResponse; | |||||
| } else if (code == 406) { | |||||
| throw new IllegalStateException("错误代码:" + code + ",错误信息:" + yzxResponse.msg); | |||||
| } else { | |||||
| // 直接将服务端的错误信息抛出,onError中可以获取 | |||||
| throw new IllegalStateException("错误代码:" + code + ",错误信息:" + yzxResponse.msg); | |||||
| } | |||||
| } | |||||
| } | |||||
| } | |||||
| @Override | |||||
| public void onError(com.lzy.okgo.model.Response<T> response) { | |||||
| super.onError(response); | |||||
| sb.append("异常信息:").append(response.getException().getMessage()); | |||||
| Monitor.INSTANCE.postNetError(sb); | |||||
| } | |||||
| } | |||||
| @@ -1,22 +0,0 @@ | |||||
| package com.yzx.escreen.presenter.base | |||||
| import com.google.gson.Gson | |||||
| import com.google.gson.reflect.TypeToken | |||||
| import com.lzy.okgo.callback.AbsCallback | |||||
| import com.lzy.okgo.convert.StringConvert | |||||
| import com.yzx.escreen.model.BaseBean | |||||
| import okhttp3.Response | |||||
| abstract class JsonCallBack<T> : AbsCallback<BaseBean<T>>() { | |||||
| private val convert = StringConvert() | |||||
| override fun convertResponse(response: Response?): BaseBean<T> { | |||||
| val json: String = convert.convertResponse(response) | |||||
| val resultType = object : TypeToken<BaseBean<T>>() {}.type | |||||
| val gson = Gson() | |||||
| val fromJson = gson.fromJson<BaseBean<T>>(json, resultType) | |||||
| return fromJson | |||||
| } | |||||
| } | |||||
| @@ -0,0 +1,20 @@ | |||||
| package com.yzx.escreen.presenter.base; | |||||
| import java.io.Serializable; | |||||
| public class SimpleResponse implements Serializable { | |||||
| private static final long serialVersionUID = -1477609349345966116L; | |||||
| public int code; | |||||
| public String msg; | |||||
| public YzxResponse toYzxResponse() { | |||||
| YzxResponse lzyResponse = new YzxResponse(); | |||||
| lzyResponse.code = code; | |||||
| lzyResponse.msg = msg; | |||||
| return lzyResponse; | |||||
| } | |||||
| } | |||||
| @@ -0,0 +1,27 @@ | |||||
| package com.yzx.escreen.presenter.base; | |||||
| import com.yzx.escreen.model.Pager; | |||||
| import java.io.Serializable; | |||||
| import java.util.ArrayList; | |||||
| public class YzxListResponse<T> implements Serializable { | |||||
| private static final long serialVersionUID = 5213230387175987834L; | |||||
| public int code = -1; | |||||
| public String msg; | |||||
| public ArrayList<T> list; | |||||
| public Pager pager; | |||||
| @Override | |||||
| public String toString() { | |||||
| return "YzxResponse{\n" +// | |||||
| "\tcode=" + code + "\n" +// | |||||
| "\tmsg='" + msg + "\'\n" +// | |||||
| "\tlist=" + list + "\n" +// | |||||
| "\tpager=" + pager + "\n" +// | |||||
| '}'; | |||||
| } | |||||
| } | |||||
| @@ -0,0 +1,30 @@ | |||||
| package com.yzx.escreen.presenter.base; | |||||
| import com.yzx.escreen.model.Pager; | |||||
| import java.io.Serializable; | |||||
| import java.util.ArrayList; | |||||
| public class YzxResponse<T> implements Serializable { | |||||
| private static final long serialVersionUID = 5213230387175987834L; | |||||
| public int code = -1; | |||||
| public String msg; | |||||
| public T data; | |||||
| public ArrayList<T> list; | |||||
| public Pager pager; | |||||
| @Override | |||||
| public String toString() { | |||||
| return "YzxResponse{\n" +// | |||||
| "\tcode=" + code + "\n" +// | |||||
| "\tmsg='" + msg + "\'\n" +// | |||||
| "\tdata=" + data + "\n" +// | |||||
| "\tlist=" + list + "\n" +// | |||||
| "\tpager=" + pager + "\n" +// | |||||
| '}'; | |||||
| } | |||||
| } | |||||
| @@ -0,0 +1,21 @@ | |||||
| package com.yzx.escreen.receiver | |||||
| import android.content.BroadcastReceiver | |||||
| import android.content.Context | |||||
| import android.content.Intent | |||||
| import com.yzx.escreen.MainActivity | |||||
| class BootReceiver :BroadcastReceiver(){ | |||||
| override fun onReceive(context: Context?, intent: Intent?) { | |||||
| intent?.apply { | |||||
| if (action.equals("android.intent.action.BOOT_COMPLETED")) { | |||||
| val i = Intent(context, MainActivity::class.java) | |||||
| i.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK) | |||||
| context?.startActivity(i) | |||||
| } | |||||
| } | |||||
| } | |||||
| } | |||||
| @@ -1,2 +1,59 @@ | |||||
| package com.yzx.escreen.utils | package com.yzx.escreen.utils | ||||
| import android.widget.ImageView | |||||
| import com.blankj.utilcode.util.TimeUtils | |||||
| import com.bumptech.glide.Glide | |||||
| import java.lang.Float.parseFloat | |||||
| import java.lang.Integer.parseInt | |||||
| import java.util.* | |||||
| fun ImageView.setSrc(identity: String, key: String) { | |||||
| val url = "https://${identity}.oa.qbjjyyun.net/edufile/imageView?uniqueKey=${key}" | |||||
| Glide.with(this) | |||||
| .load(url) | |||||
| .into(this) | |||||
| } | |||||
| fun ImageView.setSrc(url: String) { | |||||
| Glide.with(this) | |||||
| .load(url) | |||||
| .into(this) | |||||
| } | |||||
| fun Int.toTime(): String { | |||||
| val format = TimeUtils.getSafeDateFormat("yyyy-MM-dd HH:mm") | |||||
| format.timeZone = TimeZone.getTimeZone("GMT+8:00") | |||||
| return TimeUtils.millis2String(this * 1000L, format) | |||||
| } | |||||
| fun Int.durationStr(): String { | |||||
| val value = this | |||||
| if (value <= 60) { | |||||
| return "${value}秒" | |||||
| } else if (value > 60 && value <= 60 * 60) { | |||||
| var min = value / 60 | |||||
| if (min == 60) { | |||||
| return "1小时" | |||||
| } | |||||
| return "${min}分钟" | |||||
| } else if (value > 60 * 60 && value <= 24 * 60 * 60) { | |||||
| var hour = value / 3600.0 | |||||
| if (hour >= 23.5f && hour <25f) { | |||||
| return "1天" | |||||
| } | |||||
| return "${hour.toInt()}小时" | |||||
| } else { | |||||
| var day = value / (24 * 60 * 60) | |||||
| var sub = value % (24 * 60 * 60); | |||||
| var hour = sub / 3600f | |||||
| if (hour >= 23.5f || hour <25f) { | |||||
| return "${day + 1}天" | |||||
| } | |||||
| if (hour < 1) { | |||||
| return "${day}天" | |||||
| } | |||||
| return "${day}天${hour.toInt()}小时" | |||||
| } | |||||
| } | |||||
| @@ -0,0 +1,131 @@ | |||||
| package com.yzx.escreen.utils | |||||
| import android.os.Build | |||||
| import com.blankj.utilcode.util.AppUtils | |||||
| import com.blankj.utilcode.util.LogUtils | |||||
| import com.blankj.utilcode.util.SPUtils | |||||
| import com.google.gson.Gson | |||||
| import com.lzy.okgo.OkGo | |||||
| import com.lzy.okgo.callback.StringCallback | |||||
| import com.lzy.okgo.model.HttpHeaders | |||||
| import com.lzy.okgo.model.Response | |||||
| import com.yzx.escreen.model.User | |||||
| import java.lang.StringBuilder | |||||
| import java.text.SimpleDateFormat | |||||
| import java.util.* | |||||
| object Monitor { | |||||
| val DT_URL = | |||||
| "https://oapi.dingtalk.com/robot/send?access_token=886b2c609ddbcc1c8ff80abfd847e9c192bbde80815721204799b0b300cd7418" | |||||
| fun postDingTalkMsg() { | |||||
| val monitorText = SPUtils.getInstance().getString("crashData") | |||||
| if (!monitorText.isBlank()) { | |||||
| val monitor = MonitorInfo("text", MonitorText(monitorText)) | |||||
| val headers = HttpHeaders() | |||||
| val json = Gson().toJson(monitor) | |||||
| headers.put("content-type", "application/json") | |||||
| OkGo.post<String>(DT_URL) | |||||
| .tag("") | |||||
| .headers(headers) | |||||
| .upJson(json) | |||||
| .execute(object : StringCallback() { | |||||
| override fun onSuccess(response: Response<String>?) { | |||||
| LogUtils.d(json) | |||||
| LogUtils.d(response) | |||||
| SPUtils.getInstance().remove("crashData") | |||||
| } | |||||
| override fun onError(response: Response<String>?) { | |||||
| super.onError(response) | |||||
| LogUtils.d(response) | |||||
| Thread { | |||||
| Thread.sleep(3000) | |||||
| postDingTalkMsg() | |||||
| } | |||||
| } | |||||
| }) | |||||
| } | |||||
| } | |||||
| fun saveErrorInfo( | |||||
| crashType: Int, | |||||
| errorType: String?, | |||||
| errorMessage: String?, | |||||
| errorStack: String? | |||||
| ) { | |||||
| val monitorText = "crashType:${crashType}\n" + | |||||
| "errorType:${errorType}\n" + | |||||
| "errorMessage:${errorMessage}\n" + | |||||
| "errorStack:\n${errorStack}" | |||||
| val stringBuffer = StringBuffer() | |||||
| stringBuffer.append("墨水屏异常上报:").append("\n") | |||||
| stringBuffer.append("系统信息:").append(AppUtils.getAppInfo().versionName).append("\n") | |||||
| val user = User.getUser() | |||||
| if (user.user_id > 0) { | |||||
| stringBuffer.append("用户信息:").append("\n") | |||||
| .append("user_name:${user.user_name}").append("\n") | |||||
| .append("user_id:${user.user_id}").append("\n") | |||||
| .append("phone:${user.phone}").append("\n") | |||||
| .append("token:${user.token}").append("\n") | |||||
| } | |||||
| stringBuffer.append("崩溃时间:") | |||||
| .append(SimpleDateFormat("yyyy-MM-dd HH:mm:ss").format(Date())) | |||||
| .append("\n") | |||||
| stringBuffer.append("手机系统:").append(Build.VERSION.RELEASE).append("\n") | |||||
| stringBuffer.append("手机型号:").append(Build.MODEL).append("\n") | |||||
| stringBuffer.append("崩溃信息:").append("\n").append(monitorText) | |||||
| SPUtils.getInstance().put("crashData", stringBuffer.toString()) | |||||
| } | |||||
| fun postNetError(errorInfo:StringBuilder){ | |||||
| val stringBuffer = StringBuffer() | |||||
| stringBuffer.append("墨水屏接口上报:").append("\n") | |||||
| stringBuffer.append("异常类型:").append("接口异常").append("\n") | |||||
| stringBuffer.append("系统信息:").append(AppUtils.getAppInfo().versionName).append("\n") | |||||
| val user = User.getUser() | |||||
| if (user.user_id > 0) { | |||||
| stringBuffer.append("用户信息:").append("\n") | |||||
| .append("user_name:${user.user_name}").append("\n") | |||||
| .append("user_id:${user.user_id}").append("\n") | |||||
| .append("phone:${user.phone}").append("\n") | |||||
| .append("token:${user.token}").append("\n") | |||||
| } | |||||
| stringBuffer.append("请求时间:") | |||||
| .append(SimpleDateFormat("yyyy-MM-dd HH:mm:ss").format(Date())) | |||||
| .append("\n") | |||||
| stringBuffer.append("手机系统:").append(Build.VERSION.RELEASE).append("\n") | |||||
| stringBuffer.append("手机型号:").append(Build.MODEL).append("\n") | |||||
| stringBuffer.append(errorInfo) | |||||
| val monitor = MonitorInfo("text", MonitorText(stringBuffer.toString())) | |||||
| val headers = HttpHeaders() | |||||
| val json = Gson().toJson(monitor) | |||||
| headers.put("content-type", "application/json") | |||||
| OkGo.post<String>(DT_URL) | |||||
| .tag("") | |||||
| .headers(headers) | |||||
| .upJson(json) | |||||
| .execute(object : StringCallback() { | |||||
| override fun onSuccess(response: Response<String>?) { | |||||
| LogUtils.d(json) | |||||
| LogUtils.d(response) | |||||
| } | |||||
| override fun onError(response: Response<String>?) { | |||||
| super.onError(response) | |||||
| LogUtils.d(response) | |||||
| } | |||||
| }) | |||||
| } | |||||
| } | |||||
| class MonitorInfo( | |||||
| val msgtype: String = "text", | |||||
| val text: MonitorText = MonitorText("墨水屏异常上报") | |||||
| ) | |||||
| class MonitorText(val content: String = "") | |||||
| @@ -5,6 +5,7 @@ import android.content.Context | |||||
| 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 | ||||
| private var leaveId:Int = 0 | |||||
| init { | init { | ||||
| setContentView(res) | setContentView(res) | ||||
| @@ -12,4 +13,12 @@ class BaseDialog(context: Context, themeResId: Int, res: Int) : Dialog(context, | |||||
| setCanceledOnTouchOutside(false) | setCanceledOnTouchOutside(false) | ||||
| setCancelable(false) | setCancelable(false) | ||||
| } | } | ||||
| fun setLeaveId(id:Int){ | |||||
| leaveId = id | |||||
| } | |||||
| fun getLeaveId():Int{ | |||||
| return leaveId | |||||
| } | |||||
| } | } | ||||
| @@ -0,0 +1,11 @@ | |||||
| <?xml version="1.0" encoding="utf-8"?> | |||||
| <shape xmlns:android="http://schemas.android.com/apk/res/android" | |||||
| android:shape="oval"> | |||||
| <solid android:color="#FFF" /> | |||||
| <stroke | |||||
| android:width="3dp" | |||||
| android:color="#00000000" /> | |||||
| <size | |||||
| android:width="20dp" | |||||
| android:height="20dp" /> | |||||
| </shape> | |||||
| @@ -0,0 +1,6 @@ | |||||
| <?xml version="1.0" encoding="utf-8"?> | |||||
| <shape xmlns:android="http://schemas.android.com/apk/res/android" | |||||
| android:shape="rectangle"> | |||||
| <solid android:color="#E3E3E3" /> | |||||
| <corners android:radius="20dp" /> | |||||
| </shape> | |||||
| @@ -0,0 +1,6 @@ | |||||
| <?xml version="1.0" encoding="utf-8"?> | |||||
| <shape xmlns:android="http://schemas.android.com/apk/res/android" | |||||
| android:shape="rectangle"> | |||||
| <solid android:color="#53a051" /> | |||||
| <corners android:radius="20dp" /> | |||||
| </shape> | |||||
| @@ -0,0 +1,5 @@ | |||||
| <?xml version="1.0" encoding="utf-8"?> | |||||
| <selector xmlns:android="http://schemas.android.com/apk/res/android"> | |||||
| <item android:drawable="@drawable/switch_ios_track_on" android:state_checked="true" /> | |||||
| <item android:drawable="@drawable/switch_ios_track_off" android:state_checked="false" /> | |||||
| </selector> | |||||
| @@ -1,33 +1,38 @@ | |||||
| <?xml version="1.0" encoding="utf-8"?> | <?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" | |||||
| <RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android" | |||||
| 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" | |||||
| android:layout_width="match_parent" | android:layout_width="match_parent" | ||||
| android:layout_height="match_parent" | android:layout_height="match_parent" | ||||
| tools:context=".MainActivity" | |||||
| android:gravity="center_horizontal" | android:gravity="center_horizontal" | ||||
| android:orientation="vertical"> | |||||
| tools:context=".MainActivity"> | |||||
| <androidx.viewpager2.widget.ViewPager2 | <androidx.viewpager2.widget.ViewPager2 | ||||
| android:id="@+id/viewPager2" | |||||
| android:layout_width="match_parent" | |||||
| android:layout_height="match_parent" | |||||
| android:layout_above="@id/bottomLine"/> | |||||
| <View | |||||
| android:id="@+id/bottomLine" | |||||
| android:layout_width="match_parent" | android:layout_width="match_parent" | ||||
| android:layout_height="0px" | |||||
| android:layout_weight="1"> | |||||
| android:layout_height="1px" | |||||
| android:layout_above="@id/tabLayout" | |||||
| android:background="#cacbcc" /> | |||||
| </androidx.viewpager2.widget.ViewPager2> | |||||
| <com.flyco.tablayout.CommonTabLayout | <com.flyco.tablayout.CommonTabLayout | ||||
| android:id="@+id/tabLayout" | android:id="@+id/tabLayout" | ||||
| android:layout_width="match_parent" | android:layout_width="match_parent" | ||||
| android:layout_height="wrap_content" | android:layout_height="wrap_content" | ||||
| android:layout_alignParentBottom="true" | |||||
| android:background="#ffffff" | android:background="#ffffff" | ||||
| android:paddingBottom="5dp" | |||||
| android:paddingVertical="@dimen/d_10" | |||||
| android:paddingTop="5dp" | android:paddingTop="5dp" | ||||
| tl:tl_indicator_color="#2C97DE" | |||||
| tl:tl_textSelectColor="#2C97DE" | |||||
| tl:tl_textUnselectColor="#66000000" | |||||
| tl:tl_underline_color="#DDDDDD" | |||||
| tl:tl_underline_height="1dp"> | |||||
| </com.flyco.tablayout.CommonTabLayout> | |||||
| 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" /> | |||||
| </androidx.appcompat.widget.LinearLayoutCompat> | |||||
| </RelativeLayout> | |||||
| @@ -7,6 +7,7 @@ | |||||
| tools:context=".activity.WebActivity"> | tools:context=".activity.WebActivity"> | ||||
| <com.google.android.material.appbar.AppBarLayout | <com.google.android.material.appbar.AppBarLayout | ||||
| android:visibility="gone" | |||||
| android:layout_width="match_parent" | android:layout_width="match_parent" | ||||
| android:layout_height="@dimen/title_height" | android:layout_height="@dimen/title_height" | ||||
| android:background="@color/white"> | android:background="@color/white"> | ||||
| @@ -0,0 +1,177 @@ | |||||
| <?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="100dp" /> | |||||
| <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="120dp" | |||||
| android:layout_height="148dp" | |||||
| android:text="颜小华" | |||||
| app:qmui_corner_radius="@dimen/d_5" | |||||
| app:qmui_border_color="@color/white"/> | |||||
| <TextView | |||||
| android:id="@+id/face_empty" | |||||
| android:layout_width="77dp" | |||||
| android:layout_height="95dp" | |||||
| 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/leave_request_reason" | |||||
| style="@style/leave_dialog_left_content" | |||||
| android:text="2022年4月21日15:38:15" /> | |||||
| </LinearLayout> | |||||
| </LinearLayout> | |||||
| </RelativeLayout> | |||||
| <LinearLayout | |||||
| android:layout_width="0dp" | |||||
| android:layout_height="wrap_content" | |||||
| 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="wrap_content" | |||||
| 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:textSize="@dimen/sp20" | |||||
| android:textColor="@color/black" | |||||
| app:qmui_borderColor="@color/gray" | |||||
| app:qmui_radius="@dimen/d_5" /> | |||||
| </com.qmuiteam.qmui.widget.roundwidget.QMUIRoundLinearLayout> | |||||
| </FrameLayout> | |||||
| @@ -0,0 +1,253 @@ | |||||
| <?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.HomeFragment"> | |||||
| <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="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:text="自动弹出请假单" | |||||
| android:layout_marginStart="@dimen/d_10" | |||||
| android:textColor="#53a051"/> | |||||
| </androidx.appcompat.widget.LinearLayoutCompat> | |||||
| <androidx.appcompat.widget.LinearLayoutCompat | |||||
| 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" /> | |||||
| </com.qmuiteam.qmui.widget.roundwidget.QMUIRoundLinearLayout> | |||||
| <com.qmuiteam.qmui.widget.roundwidget.QMUIRoundButton | |||||
| android:id="@+id/allBtn" | |||||
| style="@style/home_status_btn" | |||||
| android:text="全部" | |||||
| android:textColor="@color/white" | |||||
| app:qmui_backgroundColor="#3ca0e9" | |||||
| android:layout_marginStart="50dp" | |||||
| 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" /> | |||||
| </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:layout_weight="1.5" | |||||
| 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_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> | |||||
| </LinearLayout> | |||||
| @@ -0,0 +1,277 @@ | |||||
| <?xml version="1.0" encoding="utf-8"?> | |||||
| <LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" | |||||
| xmlns:tools="http://schemas.android.com/tools" | |||||
| android:layout_width="match_parent" | |||||
| android:layout_height="match_parent" | |||||
| xmlns:app="http://schemas.android.com/apk/res-auto" | |||||
| android:background="@color/backgroundColor" | |||||
| android:orientation="vertical" | |||||
| tools:context=".fragment.HomeFragment"> | |||||
| <RelativeLayout | |||||
| android:id="@+id/sysExitBtn" | |||||
| android:layout_width="match_parent" | |||||
| android:layout_height="wrap_content" | |||||
| android:background="@color/white" | |||||
| android:gravity="center_vertical" | |||||
| android:orientation="horizontal" | |||||
| android:padding="10dp"> | |||||
| <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" /> | |||||
| <TextView | |||||
| android:layout_width="wrap_content" | |||||
| android:layout_height="wrap_content" | |||||
| android:layout_centerInParent="true" | |||||
| android:text="用户信息" | |||||
| android:textColor="@color/colorPrimary" | |||||
| android:textSize="@dimen/sp20" | |||||
| android:textStyle="bold" | |||||
| android:visibility="gone"/> | |||||
| </RelativeLayout> | |||||
| <androidx.appcompat.widget.LinearLayoutCompat | |||||
| android:layout_width="match_parent" | |||||
| android:layout_height="0dp" | |||||
| android:layout_marginTop="@dimen/d_20" | |||||
| android:layout_weight="1" | |||||
| android:background="@color/white" | |||||
| android:gravity="center_horizontal" | |||||
| android:orientation="vertical"> | |||||
| <androidx.appcompat.widget.LinearLayoutCompat | |||||
| android:layout_width="1000dp" | |||||
| android:layout_height="wrap_content" | |||||
| android:layout_marginTop="80dp" | |||||
| android:orientation="vertical"> | |||||
| <androidx.appcompat.widget.LinearLayoutCompat | |||||
| android:layout_width="match_parent" | |||||
| android:layout_height="wrap_content" | |||||
| android:orientation="horizontal" | |||||
| android:weightSum="5"> | |||||
| <TextView | |||||
| android:layout_width="0dp" | |||||
| android:layout_height="wrap_content" | |||||
| android:layout_weight="2" | |||||
| android:text="个人信息" | |||||
| android:textSize="@dimen/sp20" | |||||
| android:textStyle="bold" /> | |||||
| <androidx.appcompat.widget.LinearLayoutCompat | |||||
| android:layout_width="0dp" | |||||
| android:layout_height="wrap_content" | |||||
| android:layout_weight="3" | |||||
| android:orientation="vertical"> | |||||
| <androidx.appcompat.widget.LinearLayoutCompat | |||||
| android:layout_width="match_parent" | |||||
| android:layout_height="wrap_content" | |||||
| android:orientation="horizontal"> | |||||
| <TextView | |||||
| style="@style/my_info_title" | |||||
| android:text="姓名" /> | |||||
| <TextView | |||||
| android:id="@+id/userName" | |||||
| style="@style/my_info_content" | |||||
| tools:text="平台助手" /> | |||||
| </androidx.appcompat.widget.LinearLayoutCompat> | |||||
| <androidx.appcompat.widget.LinearLayoutCompat | |||||
| android:layout_width="match_parent" | |||||
| android:layout_height="wrap_content" | |||||
| android:layout_marginTop="@dimen/d_20" | |||||
| android:orientation="horizontal"> | |||||
| <TextView | |||||
| style="@style/my_info_title" | |||||
| android:text="性别" /> | |||||
| <TextView | |||||
| android:id="@+id/sex" | |||||
| style="@style/my_info_content" | |||||
| tools:text="平台助手" /> | |||||
| </androidx.appcompat.widget.LinearLayoutCompat> | |||||
| <androidx.appcompat.widget.LinearLayoutCompat | |||||
| android:layout_width="match_parent" | |||||
| android:layout_height="wrap_content" | |||||
| android:layout_marginTop="@dimen/d_20" | |||||
| android:orientation="horizontal"> | |||||
| <TextView | |||||
| style="@style/my_info_title" | |||||
| android:text="手机号" /> | |||||
| <TextView | |||||
| android:id="@+id/phone" | |||||
| style="@style/my_info_content" | |||||
| tools:text="身份证号" /> | |||||
| </androidx.appcompat.widget.LinearLayoutCompat> | |||||
| <androidx.appcompat.widget.LinearLayoutCompat | |||||
| android:layout_width="match_parent" | |||||
| android:layout_height="wrap_content" | |||||
| android:layout_marginTop="@dimen/d_20" | |||||
| android:orientation="horizontal"> | |||||
| <TextView | |||||
| style="@style/my_info_title" | |||||
| android:text="身份证号" /> | |||||
| <TextView | |||||
| android:id="@+id/idCard" | |||||
| style="@style/my_info_content" | |||||
| tools:text="身份证号" /> | |||||
| </androidx.appcompat.widget.LinearLayoutCompat> | |||||
| </androidx.appcompat.widget.LinearLayoutCompat> | |||||
| </androidx.appcompat.widget.LinearLayoutCompat> | |||||
| </androidx.appcompat.widget.LinearLayoutCompat> | |||||
| <View | |||||
| android:layout_width="1000dp" | |||||
| android:layout_height="2px" | |||||
| android:layout_marginTop="@dimen/dp_40" | |||||
| android:background="@color/backgroundColor" /> | |||||
| <androidx.appcompat.widget.LinearLayoutCompat | |||||
| android:layout_width="1000dp" | |||||
| android:layout_height="wrap_content" | |||||
| android:layout_marginTop="@dimen/dp_40" | |||||
| android:orientation="vertical"> | |||||
| <androidx.appcompat.widget.LinearLayoutCompat | |||||
| android:layout_width="match_parent" | |||||
| android:layout_height="wrap_content" | |||||
| android:orientation="horizontal" | |||||
| android:weightSum="5"> | |||||
| <TextView | |||||
| android:layout_width="0dp" | |||||
| android:layout_height="wrap_content" | |||||
| android:layout_weight="2" | |||||
| android:text="单位信息" | |||||
| android:textSize="@dimen/sp20" | |||||
| android:textStyle="bold" /> | |||||
| <androidx.appcompat.widget.LinearLayoutCompat | |||||
| android:layout_width="0dp" | |||||
| android:layout_height="wrap_content" | |||||
| android:layout_weight="3" | |||||
| android:orientation="vertical"> | |||||
| <androidx.appcompat.widget.LinearLayoutCompat | |||||
| android:layout_width="match_parent" | |||||
| android:layout_height="wrap_content" | |||||
| android:orientation="horizontal"> | |||||
| <TextView | |||||
| style="@style/my_info_title" | |||||
| android:text="单位" /> | |||||
| <TextView | |||||
| android:id="@+id/unitName" | |||||
| style="@style/my_info_content" | |||||
| tools:text="平台助手" /> | |||||
| </androidx.appcompat.widget.LinearLayoutCompat> | |||||
| <androidx.appcompat.widget.LinearLayoutCompat | |||||
| android:layout_width="match_parent" | |||||
| android:layout_height="wrap_content" | |||||
| android:layout_marginTop="@dimen/d_20" | |||||
| android:orientation="horizontal"> | |||||
| <TextView | |||||
| style="@style/my_info_title" | |||||
| android:text="部门" /> | |||||
| <TextView | |||||
| android:id="@+id/groupName" | |||||
| style="@style/my_info_content" | |||||
| tools:text="岗位类别" /> | |||||
| </androidx.appcompat.widget.LinearLayoutCompat> | |||||
| <androidx.appcompat.widget.LinearLayoutCompat | |||||
| android:layout_width="match_parent" | |||||
| android:layout_height="wrap_content" | |||||
| android:layout_marginTop="@dimen/d_20" | |||||
| android:orientation="horizontal"> | |||||
| <TextView | |||||
| style="@style/my_info_title" | |||||
| android:text="部门" /> | |||||
| <TextView | |||||
| android:id="@+id/jobType" | |||||
| style="@style/my_info_content" | |||||
| tools:text="岗位类别" /> | |||||
| </androidx.appcompat.widget.LinearLayoutCompat> | |||||
| <androidx.appcompat.widget.LinearLayoutCompat | |||||
| android:layout_width="match_parent" | |||||
| android:layout_height="wrap_content" | |||||
| android:layout_marginTop="@dimen/d_20" | |||||
| android:orientation="horizontal"> | |||||
| <TextView | |||||
| style="@style/my_info_title" | |||||
| android:text="是否领导岗位" /> | |||||
| <TextView | |||||
| android:id="@+id/isLeader" | |||||
| style="@style/my_info_content" | |||||
| tools:text="身份证号" /> | |||||
| </androidx.appcompat.widget.LinearLayoutCompat> | |||||
| <androidx.appcompat.widget.LinearLayoutCompat | |||||
| android:layout_width="match_parent" | |||||
| android:layout_height="wrap_content" | |||||
| android:layout_marginTop="@dimen/d_20" | |||||
| android:orientation="horizontal"> | |||||
| <TextView | |||||
| style="@style/my_info_title" | |||||
| android:text="职务名称" /> | |||||
| <TextView | |||||
| android:id="@+id/jobName" | |||||
| style="@style/my_info_content" | |||||
| tools:text="身份证号" /> | |||||
| <TextView | |||||
| android:id="@+id/density" | |||||
| style="@style/my_info_content" | |||||
| tools:text="身份证号" | |||||
| android:visibility="gone"/> | |||||
| </androidx.appcompat.widget.LinearLayoutCompat> | |||||
| </androidx.appcompat.widget.LinearLayoutCompat> | |||||
| </androidx.appcompat.widget.LinearLayoutCompat> | |||||
| </androidx.appcompat.widget.LinearLayoutCompat> | |||||
| <com.qmuiteam.qmui.widget.roundwidget.QMUIRoundButton | |||||
| android:id="@+id/logoutBtn" | |||||
| android:layout_width="300dp" | |||||
| android:layout_height="80dp" | |||||
| android:layout_gravity="center_horizontal" | |||||
| android:layout_marginTop="80dp" | |||||
| android:layout_marginBottom="@dimen/d_20" | |||||
| android:padding="@dimen/d_10" | |||||
| android:text="退出登录" | |||||
| android:textSize="@dimen/sp20" | |||||
| android:textColor="@color/black" | |||||
| app:qmui_borderColor="@color/gray" | |||||
| app:qmui_radius="@dimen/dp_40" /> | |||||
| </androidx.appcompat.widget.LinearLayoutCompat> | |||||
| </LinearLayout> | |||||
| @@ -0,0 +1,14 @@ | |||||
| <?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:orientation="vertical" | |||||
| android:layout_width="match_parent" | |||||
| android:layout_height="match_parent"> | |||||
| <com.qmuiteam.qmui.widget.QMUIEmptyView | |||||
| android:layout_width="match_parent" | |||||
| android:layout_height="match_parent" | |||||
| app:qmui_show_loading="true" | |||||
| app:qmui_title_text="数据加载中"/> | |||||
| </LinearLayout> | |||||
| @@ -0,0 +1,112 @@ | |||||
| <?xml version="1.0" encoding="utf-8"?> | |||||
| <LinearLayout xmlns:app="http://schemas.android.com/apk/res-auto" | |||||
| xmlns:android="http://schemas.android.com/apk/res/android" | |||||
| xmlns:tools="http://schemas.android.com/tools" | |||||
| android:layout_width="match_parent" | |||||
| android:layout_height="wrap_content" | |||||
| android:orientation="horizontal"> | |||||
| <LinearLayout | |||||
| android:layout_width="wrap_content" | |||||
| android:layout_height="match_parent" | |||||
| android:orientation="vertical" | |||||
| android:gravity="center_horizontal"> | |||||
| <View | |||||
| android:id="@+id/line1" | |||||
| android:layout_width="1px" | |||||
| android:layout_height="8dp" | |||||
| android:background="@color/gray_1" /> | |||||
| <com.qmuiteam.qmui.widget.roundwidget.QMUIRoundFrameLayout | |||||
| android:layout_width="@dimen/d_6" | |||||
| android:layout_height="@dimen/d_6" | |||||
| app:qmui_backgroundColor="#3ca0e9" | |||||
| app:qmui_radius="@dimen/d_3"/> | |||||
| <View | |||||
| android:id="@+id/line2" | |||||
| android:layout_width="1px" | |||||
| android:layout_height="0dp" | |||||
| android:layout_weight="1" | |||||
| android:background="@color/gray_1" /> | |||||
| </LinearLayout> | |||||
| <LinearLayout | |||||
| android:id="@+id/contentLayout" | |||||
| android:layout_width="0dp" | |||||
| android:layout_height="match_parent" | |||||
| android:orientation="vertical" | |||||
| android:layout_weight="1" | |||||
| android:layout_marginStart="@dimen/d_20" | |||||
| android:paddingBottom="@dimen/dp_40"> | |||||
| <androidx.appcompat.widget.LinearLayoutCompat | |||||
| android:layout_width="match_parent" | |||||
| android:layout_height="wrap_content" | |||||
| android:orientation="horizontal"> | |||||
| <TextView | |||||
| android:id="@+id/addUserName" | |||||
| android:layout_width="wrap_content" | |||||
| android:layout_height="wrap_content" | |||||
| android:textSize="@dimen/sp20" | |||||
| tools:text="王大仙" | |||||
| android:textStyle="bold" /> | |||||
| <TextView | |||||
| android:id="@+id/addUserTypeName" | |||||
| android:layout_width="wrap_content" | |||||
| android:layout_height="wrap_content" | |||||
| android:textColor="@color/colorPrimary" | |||||
| android:textSize="@dimen/sp20" | |||||
| tools:text="(学生家长)" | |||||
| android:textStyle="bold" /> | |||||
| <TextView | |||||
| android:id="@+id/activityName" | |||||
| android:layout_width="wrap_content" | |||||
| android:layout_height="wrap_content" | |||||
| android:textSize="@dimen/sp20" | |||||
| tools:text="提交申请" | |||||
| android:textStyle="bold" /> | |||||
| <TextView | |||||
| android:id="@+id/statusName" | |||||
| android:layout_width="wrap_content" | |||||
| android:layout_height="wrap_content" | |||||
| android:textSize="@dimen/sp20" | |||||
| tools:text="提交申请" | |||||
| android:textStyle="bold" /> | |||||
| </androidx.appcompat.widget.LinearLayoutCompat> | |||||
| <TextView | |||||
| android:id="@+id/approvalComments" | |||||
| android:layout_width="match_parent" | |||||
| android:layout_height="wrap_content" | |||||
| tools:text="审批人:颜小华。允许出校,请放行" | |||||
| android:textSize="@dimen/sp20" | |||||
| android:layout_marginTop="@dimen/dp_10" /> | |||||
| <androidx.appcompat.widget.LinearLayoutCompat | |||||
| android:layout_width="match_parent" | |||||
| android:layout_height="wrap_content" | |||||
| android:orientation="horizontal" | |||||
| android:gravity="bottom" | |||||
| android:layout_marginTop="@dimen/dp_10"> | |||||
| <ImageView | |||||
| android:id="@+id/signImg" | |||||
| android:layout_width="150dp" | |||||
| android:layout_height="75dp" | |||||
| android:background="@color/white" | |||||
| android:layout_marginEnd="@dimen/dp_10"/> | |||||
| <TextView | |||||
| android:id="@+id/stepTime" | |||||
| android:layout_width="wrap_content" | |||||
| android:layout_height="wrap_content" | |||||
| tools:text="2022-4-21 15:50:42" | |||||
| android:textSize="@dimen/sp20" | |||||
| android:textColor="@color/gray" /> | |||||
| </androidx.appcompat.widget.LinearLayoutCompat> | |||||
| </LinearLayout> | |||||
| </LinearLayout> | |||||
| @@ -0,0 +1,89 @@ | |||||
| <?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:text="请假学生" | |||||
| android:paddingStart="@dimen/dp_40"/> | |||||
| <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_corner_radius="@dimen/d_5" | |||||
| app:qmui_border_color="@color/white"/> | |||||
| <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" /> | |||||
| <TextView | |||||
| android:id="@+id/durationStrName" | |||||
| style="@style/table_cell" | |||||
| android:layout_weight="1.5" | |||||
| android:text="请假学生" /> | |||||
| <TextView | |||||
| android:id="@+id/statusName" | |||||
| style="@style/table_cell" | |||||
| android:text="请假单状态" /> | |||||
| <TextView | |||||
| android:id="@+id/applyTime" | |||||
| 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> | |||||
| @@ -0,0 +1,6 @@ | |||||
| <?xml version="1.0" encoding="utf-8"?> | |||||
| <temp_root xmlns:android="http://schemas.android.com/apk/res/android" | |||||
| android:layout_width="match_parent" | |||||
| android:layout_height="match_parent"> | |||||
| </temp_root> | |||||
| @@ -1,6 +1,6 @@ | |||||
| <?xml version="1.0" encoding="utf-8"?> | <?xml version="1.0" encoding="utf-8"?> | ||||
| <resources> | <resources> | ||||
| <color name="colorPrimary">#008577</color> | |||||
| <color name="colorPrimary">#3ca0e9</color> | |||||
| <color name="colorPrimaryDark">#00574B</color> | <color name="colorPrimaryDark">#00574B</color> | ||||
| <color name="colorAccent">#D81B60</color> | <color name="colorAccent">#D81B60</color> | ||||
| <color name="white">#FFFFFF</color> | <color name="white">#FFFFFF</color> | ||||
| @@ -12,14 +12,18 @@ | |||||
| <color name="colorBlack80">#cc000000</color> | <color name="colorBlack80">#cc000000</color> | ||||
| <color name="black_11">#11333333</color> | <color name="black_11">#11333333</color> | ||||
| <color name="black_1">#222222</color> | <color name="black_1">#222222</color> | ||||
| <color name="black_3">#333333</color> | |||||
| <color name="gray">#666666</color> | <color name="gray">#666666</color> | ||||
| <color name="gray_80">#808080</color> | |||||
| <color name="gray_1">#999999</color> | <color name="gray_1">#999999</color> | ||||
| <color name="gray_2">#cccccc</color> | <color name="gray_2">#cccccc</color> | ||||
| <color name="line_color">#D8D8D8</color> | <color name="line_color">#D8D8D8</color> | ||||
| <color name="backgroundColor">#f8f8f8</color> | <color name="backgroundColor">#f8f8f8</color> | ||||
| <color name="red">#ff4444</color> | <color name="red">#ff4444</color> | ||||
| <color name="green">#54b3b3</color> | <color name="green">#54b3b3</color> | ||||
| <color name="green2">#53a051</color> | |||||
| <color name="blue">#4d92dc</color> | <color name="blue">#4d92dc</color> | ||||
| <color name="blue2">#3ca0e9</color> | |||||
| <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> | ||||
| @@ -39,6 +39,7 @@ | |||||
| <dimen name="d_28">28dp</dimen> | <dimen name="d_28">28dp</dimen> | ||||
| <dimen name="d_29">29dp</dimen> | <dimen name="d_29">29dp</dimen> | ||||
| <dimen name="d_30">30dp</dimen> | <dimen name="d_30">30dp</dimen> | ||||
| <dimen name="d_70">70dp</dimen> | |||||
| <!-- Default screen margins, per the Android Design guidelines. --> | <!-- Default screen margins, per the Android Design guidelines. --> | ||||
| @@ -1,12 +1,15 @@ | |||||
| <resources> | <resources> | ||||
| <!-- Base application theme. --> | <!-- Base application theme. --> | ||||
| <style name="AppTheme" parent="Theme.AppCompat.Light.NoActionBar"> | |||||
| <style name="AppTheme" parent="QMUI.Compat"> | |||||
| <!-- Customize your theme here. --> | <!-- Customize your theme here. --> | ||||
| <item name="windowActionBar">false</item> | |||||
| <item name="windowNoTitle">true</item> | |||||
| <item name="colorPrimary">@color/colorPrimary</item> | <item name="colorPrimary">@color/colorPrimary</item> | ||||
| <item name="colorPrimaryDark">@color/colorPrimaryDark</item> | <item name="colorPrimaryDark">@color/colorPrimaryDark</item> | ||||
| <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> | |||||
| </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> | ||||
| @@ -138,4 +141,65 @@ | |||||
| <item name="android:paddingStart">5dp</item> | <item name="android:paddingStart">5dp</item> | ||||
| <item name="android:paddingEnd">5dp</item> | <item name="android:paddingEnd">5dp</item> | ||||
| </style> | </style> | ||||
| <style name="table_header"> | |||||
| <item name="android:layout_height">wrap_content</item> | |||||
| <item name="android:layout_width">0dp</item> | |||||
| <item name="android:textStyle">bold</item> | |||||
| <item name="android:textColor">#333</item> | |||||
| <item name="android:layout_weight">2</item> | |||||
| <item name="android:textSize">@dimen/sp18</item> | |||||
| </style> | |||||
| <style name="table_cell" parent="table_header"> | |||||
| <item name="android:textStyle">normal</item> | |||||
| </style> | |||||
| <style name="leave_dialog_title"> | |||||
| <item name="android:layout_width">232dp</item> | |||||
| <item name="android:layout_height">wrap_content</item> | |||||
| <item name="android:gravity">start</item> | |||||
| <item name="android:paddingStart">100dp</item> | |||||
| <item name="android:textColor">@color/black</item> | |||||
| <item name="android:textStyle">bold</item> | |||||
| <item name="android:textSize">@dimen/sp20</item> | |||||
| </style> | |||||
| <style name="leave_dialog_row"> | |||||
| <item name="android:layout_width">match_parent</item> | |||||
| <item name="android:layout_height">wrap_content</item> | |||||
| <item name="android:orientation">horizontal</item> | |||||
| <item name="android:layout_marginTop">@dimen/dp_40</item> | |||||
| <item name="android:textSize">@dimen/sp20</item> | |||||
| </style> | |||||
| <style name="my_info_title"> | |||||
| <item name="android:layout_width">200dp</item> | |||||
| <item name="android:layout_height">wrap_content</item> | |||||
| <item name="android:textColor">#808080</item> | |||||
| <item name="android:textSize">@dimen/sp20</item> | |||||
| </style> | |||||
| <style name="my_info_content"> | |||||
| <item name="android:layout_width">0dp</item> | |||||
| <item name="android:layout_weight">1</item> | |||||
| <item name="android:layout_height">wrap_content</item> | |||||
| <item name="android:textSize">@dimen/sp20</item> | |||||
| </style> | |||||
| <style name="home_status_btn"> | |||||
| <item name="android:layout_width">160dp</item> | |||||
| <item name="android:layout_height">60dp</item> | |||||
| <item name="android:layout_marginLeft">@dimen/d_30</item> | |||||
| <item name="android:paddingTop">@dimen/d_5</item> | |||||
| <item name="android:paddingBottom">@dimen/d_5</item> | |||||
| <item name="android:textSize">@dimen/sp20</item> | |||||
| </style> | |||||
| <style name="leave_dialog_left_content"> | |||||
| <item name="android:layout_width">wrap_content</item> | |||||
| <item name="android:layout_height">wrap_content</item> | |||||
| <item name="android:textColor">@color/black_3</item> | |||||
| <item name="android:textSize">@dimen/sp20</item> | |||||
| </style> | |||||
| </resources> | </resources> | ||||
| @@ -7,6 +7,7 @@ buildscript { | |||||
| repositories { | repositories { | ||||
| google() | google() | ||||
| jcenter() | jcenter() | ||||
| mavenCentral() | |||||
| maven { url 'https://jitpack.io' } | maven { url 'https://jitpack.io' } | ||||
| maven { url 'https://dl.bintray.com/umsdk/release' } | maven { url 'https://dl.bintray.com/umsdk/release' } | ||||
| } | } | ||||
| @@ -23,6 +24,7 @@ allprojects { | |||||
| repositories { | repositories { | ||||
| google() | google() | ||||
| jcenter() | jcenter() | ||||
| mavenCentral() | |||||
| maven { url 'https://jitpack.io' } | maven { url 'https://jitpack.io' } | ||||
| maven { url 'https://dl.bintray.com/umsdk/release' } | maven { url 'https://dl.bintray.com/umsdk/release' } | ||||
| } | } | ||||
| @@ -101,3 +101,15 @@ | |||||
| public static **[] values(); | public static **[] values(); | ||||
| public static ** valueOf(java.lang.String); | public static ** valueOf(java.lang.String); | ||||
| } | } | ||||
| # x5 | |||||
| -dontwarn dalvik.** | |||||
| -dontwarn com.tencent.smtt.** | |||||
| -keep class com.tencent.smtt.** { | |||||
| *; | |||||
| } | |||||
| -keep class com.tencent.tbs.** { | |||||
| *; | |||||
| } | |||||