diff --git a/app/build.gradle b/app/build.gradle index 296fb6f..c18c251 100644 --- a/app/build.gradle +++ b/app/build.gradle @@ -40,10 +40,6 @@ // VIVO 相关应用参数 VIVO_APP_ID : "105749048", VIVO_APP_KEY : "e460fbf2c689e0f8c58ecc6aa62e1803", - - // 小米相关应用参数 -// XIAOMI_APP_ID : "", -// XIAOMI_APP_KEY : "", ] // 版本名后面添加一句话,意思就是flavor dimension 它的维度就是该版本号,多渠道打包很重要 @@ -107,7 +103,7 @@ dependencies { implementation fileTree(dir: 'libs', include: ['*.jar']) //基础依赖库 - implementation 'com.github.AndroidCoderPeng:Kotlin-lite-lib:1.0.10' + implementation 'com.github.AndroidCoderPeng:Kotlin-lite-lib:1.1.0' implementation 'androidx.appcompat:appcompat:1.6.1' implementation 'androidx.core:core-ktx:1.9.0' implementation 'androidx.constraintlayout:constraintlayout:2.1.4' @@ -165,8 +161,6 @@ implementation 'commons-codec:commons-codec:1.15' implementation 'com.android.support:support-annotations:28.0.0' implementation 'com.assist-v3:vivo:3.1.2' // vivo -// implementation 'com.getui.opt:xmp:3.3.1' // 小米 - //数据库框架 implementation 'org.greenrobot:greendao:3.3.0' //数据库升级 diff --git a/app/build.gradle b/app/build.gradle index 296fb6f..c18c251 100644 --- a/app/build.gradle +++ b/app/build.gradle @@ -40,10 +40,6 @@ // VIVO 相关应用参数 VIVO_APP_ID : "105749048", VIVO_APP_KEY : "e460fbf2c689e0f8c58ecc6aa62e1803", - - // 小米相关应用参数 -// XIAOMI_APP_ID : "", -// XIAOMI_APP_KEY : "", ] // 版本名后面添加一句话,意思就是flavor dimension 它的维度就是该版本号,多渠道打包很重要 @@ -107,7 +103,7 @@ dependencies { implementation fileTree(dir: 'libs', include: ['*.jar']) //基础依赖库 - implementation 'com.github.AndroidCoderPeng:Kotlin-lite-lib:1.0.10' + implementation 'com.github.AndroidCoderPeng:Kotlin-lite-lib:1.1.0' implementation 'androidx.appcompat:appcompat:1.6.1' implementation 'androidx.core:core-ktx:1.9.0' implementation 'androidx.constraintlayout:constraintlayout:2.1.4' @@ -165,8 +161,6 @@ implementation 'commons-codec:commons-codec:1.15' implementation 'com.android.support:support-annotations:28.0.0' implementation 'com.assist-v3:vivo:3.1.2' // vivo -// implementation 'com.getui.opt:xmp:3.3.1' // 小米 - //数据库框架 implementation 'org.greenrobot:greendao:3.3.0' //数据库升级 diff --git a/app/src/main/AndroidManifest.xml b/app/src/main/AndroidManifest.xml index c0af158..e0519bf 100644 --- a/app/src/main/AndroidManifest.xml +++ b/app/src/main/AndroidManifest.xml @@ -90,10 +90,10 @@ - + + android:value="ee96d8b5e12de3fbb29949efd57418a8" /> - + + android:value="ee96d8b5e12de3fbb29949efd57418a8" /> - + + android:value="ee96d8b5e12de3fbb29949efd57418a8" /> - + + android:value="ee96d8b5e12de3fbb29949efd57418a8" /> () @@ -150,7 +158,7 @@ val cameraPosition = CameraPosition(centerLatLng, 14f, 0f, 0f) val cameraUpdate = CameraUpdateFactory.newCameraPosition(cameraPosition) withContext(Dispatchers.Main) { - LoadingDialogHub.dismiss() + LoadingDialog.dismiss() aMap.animateCamera(cameraUpdate, 1500, null) } } @@ -239,11 +247,6 @@ } override fun initEvent() { - binding.rightOptionView.setOnClickListener { - val x = binding.rightOptionView.width - easyPopupWindow.width - easyPopupWindow.showAsDropDown(binding.rightOptionView, x, 0) - } - //撤防点位 binding.unDeployedLayout.setOnClickListener { requireContext().navigatePageTo() @@ -263,11 +266,11 @@ override fun observeRequestState() { wellViewModel.loadState.observe(this) { when (it) { - is LoadState.Loading -> LoadingDialogHub.show( + is LoadState.Loading -> LoadingDialog.show( requireActivity(), "数据加载中,请稍后..." ) - else -> LoadingDialogHub.dismiss() + else -> LoadingDialog.dismiss() } } } @@ -376,7 +379,7 @@ }).build().show() } }) - infoPopup.showAsDropDown(binding.rightOptionView) +// infoPopup.showAsDropDown(binding.rightOptionView) } override fun onCameraChange(p0: CameraPosition?) { diff --git a/app/build.gradle b/app/build.gradle index 296fb6f..c18c251 100644 --- a/app/build.gradle +++ b/app/build.gradle @@ -40,10 +40,6 @@ // VIVO 相关应用参数 VIVO_APP_ID : "105749048", VIVO_APP_KEY : "e460fbf2c689e0f8c58ecc6aa62e1803", - - // 小米相关应用参数 -// XIAOMI_APP_ID : "", -// XIAOMI_APP_KEY : "", ] // 版本名后面添加一句话,意思就是flavor dimension 它的维度就是该版本号,多渠道打包很重要 @@ -107,7 +103,7 @@ dependencies { implementation fileTree(dir: 'libs', include: ['*.jar']) //基础依赖库 - implementation 'com.github.AndroidCoderPeng:Kotlin-lite-lib:1.0.10' + implementation 'com.github.AndroidCoderPeng:Kotlin-lite-lib:1.1.0' implementation 'androidx.appcompat:appcompat:1.6.1' implementation 'androidx.core:core-ktx:1.9.0' implementation 'androidx.constraintlayout:constraintlayout:2.1.4' @@ -165,8 +161,6 @@ implementation 'commons-codec:commons-codec:1.15' implementation 'com.android.support:support-annotations:28.0.0' implementation 'com.assist-v3:vivo:3.1.2' // vivo -// implementation 'com.getui.opt:xmp:3.3.1' // 小米 - //数据库框架 implementation 'org.greenrobot:greendao:3.3.0' //数据库升级 diff --git a/app/src/main/AndroidManifest.xml b/app/src/main/AndroidManifest.xml index c0af158..e0519bf 100644 --- a/app/src/main/AndroidManifest.xml +++ b/app/src/main/AndroidManifest.xml @@ -90,10 +90,10 @@ - + + android:value="ee96d8b5e12de3fbb29949efd57418a8" /> () @@ -150,7 +158,7 @@ val cameraPosition = CameraPosition(centerLatLng, 14f, 0f, 0f) val cameraUpdate = CameraUpdateFactory.newCameraPosition(cameraPosition) withContext(Dispatchers.Main) { - LoadingDialogHub.dismiss() + LoadingDialog.dismiss() aMap.animateCamera(cameraUpdate, 1500, null) } } @@ -239,11 +247,6 @@ } override fun initEvent() { - binding.rightOptionView.setOnClickListener { - val x = binding.rightOptionView.width - easyPopupWindow.width - easyPopupWindow.showAsDropDown(binding.rightOptionView, x, 0) - } - //撤防点位 binding.unDeployedLayout.setOnClickListener { requireContext().navigatePageTo() @@ -263,11 +266,11 @@ override fun observeRequestState() { wellViewModel.loadState.observe(this) { when (it) { - is LoadState.Loading -> LoadingDialogHub.show( + is LoadState.Loading -> LoadingDialog.show( requireActivity(), "数据加载中,请稍后..." ) - else -> LoadingDialogHub.dismiss() + else -> LoadingDialog.dismiss() } } } @@ -376,7 +379,7 @@ }).build().show() } }) - infoPopup.showAsDropDown(binding.rightOptionView) +// infoPopup.showAsDropDown(binding.rightOptionView) } override fun onCameraChange(p0: CameraPosition?) { diff --git a/app/src/main/java/com/casic/app/smartwell/fragment/HomePageNoClusterFragment.kt b/app/src/main/java/com/casic/app/smartwell/fragment/HomePageNoClusterFragment.kt index 802426a..b25f743 100644 --- a/app/src/main/java/com/casic/app/smartwell/fragment/HomePageNoClusterFragment.kt +++ b/app/src/main/java/com/casic/app/smartwell/fragment/HomePageNoClusterFragment.kt @@ -38,8 +38,9 @@ import com.pengxh.kt.lite.extensions.navigatePageTo import com.pengxh.kt.lite.extensions.show import com.pengxh.kt.lite.utils.LoadState -import com.pengxh.kt.lite.utils.LoadingDialogHub +import com.pengxh.kt.lite.utils.LoadingDialog import com.pengxh.kt.lite.widget.EasyPopupWindow +import com.pengxh.kt.lite.widget.TitleBarView import com.pengxh.kt.lite.widget.dialog.AlertControlDialog import kotlinx.coroutines.Dispatchers import kotlinx.coroutines.launch @@ -78,7 +79,15 @@ override fun setupTopBarLayout() { binding.rootView.initImmersionBar(this, false, R.color.mainThemeColor) - binding.titleView.text = "首页" + binding.titleView.setOnClickListener(object : TitleBarView.OnClickListener { + override fun onLeftClick() { + + } + + override fun onRightClick() { + easyPopupWindow.showAsDropDown(binding.titleView, binding.titleView.width, 0) + } + }) } override fun initOnCreate(savedInstanceState: Bundle?) { @@ -112,7 +121,7 @@ //渲染井位置 lifecycleScope.launch(Dispatchers.Main) { - LoadingDialogHub.show(requireActivity(), "数据加载中,请稍后") + LoadingDialog.show(requireActivity(), "数据加载中,请稍后") withContext(Dispatchers.IO) { //取Well缓存 val allMarkerOptions = ArrayList() @@ -144,7 +153,7 @@ val cameraPosition = CameraPosition(centerLatLng, 14f, 0f, 0f) val cameraUpdate = CameraUpdateFactory.newCameraPosition(cameraPosition) withContext(Dispatchers.Main) { - LoadingDialogHub.dismiss() + LoadingDialog.dismiss() aMap.animateCamera(cameraUpdate, 1500, null) } } @@ -238,11 +247,6 @@ } override fun initEvent() { - binding.rightOptionView.setOnClickListener { - val x = binding.rightOptionView.width - easyPopupWindow.width - easyPopupWindow.showAsDropDown(binding.rightOptionView, x, 0) - } - //撤防点位 binding.unDeployedLayout.setOnClickListener { requireContext().navigatePageTo() @@ -262,11 +266,11 @@ override fun observeRequestState() { wellViewModel.loadState.observe(this) { when (it) { - is LoadState.Loading -> LoadingDialogHub.show( + is LoadState.Loading -> LoadingDialog.show( requireActivity(), "数据加载中,请稍后..." ) - else -> LoadingDialogHub.dismiss() + else -> LoadingDialog.dismiss() } } } diff --git a/app/build.gradle b/app/build.gradle index 296fb6f..c18c251 100644 --- a/app/build.gradle +++ b/app/build.gradle @@ -40,10 +40,6 @@ // VIVO 相关应用参数 VIVO_APP_ID : "105749048", VIVO_APP_KEY : "e460fbf2c689e0f8c58ecc6aa62e1803", - - // 小米相关应用参数 -// XIAOMI_APP_ID : "", -// XIAOMI_APP_KEY : "", ] // 版本名后面添加一句话,意思就是flavor dimension 它的维度就是该版本号,多渠道打包很重要 @@ -107,7 +103,7 @@ dependencies { implementation fileTree(dir: 'libs', include: ['*.jar']) //基础依赖库 - implementation 'com.github.AndroidCoderPeng:Kotlin-lite-lib:1.0.10' + implementation 'com.github.AndroidCoderPeng:Kotlin-lite-lib:1.1.0' implementation 'androidx.appcompat:appcompat:1.6.1' implementation 'androidx.core:core-ktx:1.9.0' implementation 'androidx.constraintlayout:constraintlayout:2.1.4' @@ -165,8 +161,6 @@ implementation 'commons-codec:commons-codec:1.15' implementation 'com.android.support:support-annotations:28.0.0' implementation 'com.assist-v3:vivo:3.1.2' // vivo -// implementation 'com.getui.opt:xmp:3.3.1' // 小米 - //数据库框架 implementation 'org.greenrobot:greendao:3.3.0' //数据库升级 diff --git a/app/src/main/AndroidManifest.xml b/app/src/main/AndroidManifest.xml index c0af158..e0519bf 100644 --- a/app/src/main/AndroidManifest.xml +++ b/app/src/main/AndroidManifest.xml @@ -90,10 +90,10 @@ - + + android:value="ee96d8b5e12de3fbb29949efd57418a8" /> () @@ -150,7 +158,7 @@ val cameraPosition = CameraPosition(centerLatLng, 14f, 0f, 0f) val cameraUpdate = CameraUpdateFactory.newCameraPosition(cameraPosition) withContext(Dispatchers.Main) { - LoadingDialogHub.dismiss() + LoadingDialog.dismiss() aMap.animateCamera(cameraUpdate, 1500, null) } } @@ -239,11 +247,6 @@ } override fun initEvent() { - binding.rightOptionView.setOnClickListener { - val x = binding.rightOptionView.width - easyPopupWindow.width - easyPopupWindow.showAsDropDown(binding.rightOptionView, x, 0) - } - //撤防点位 binding.unDeployedLayout.setOnClickListener { requireContext().navigatePageTo() @@ -263,11 +266,11 @@ override fun observeRequestState() { wellViewModel.loadState.observe(this) { when (it) { - is LoadState.Loading -> LoadingDialogHub.show( + is LoadState.Loading -> LoadingDialog.show( requireActivity(), "数据加载中,请稍后..." ) - else -> LoadingDialogHub.dismiss() + else -> LoadingDialog.dismiss() } } } @@ -376,7 +379,7 @@ }).build().show() } }) - infoPopup.showAsDropDown(binding.rightOptionView) +// infoPopup.showAsDropDown(binding.rightOptionView) } override fun onCameraChange(p0: CameraPosition?) { diff --git a/app/src/main/java/com/casic/app/smartwell/fragment/HomePageNoClusterFragment.kt b/app/src/main/java/com/casic/app/smartwell/fragment/HomePageNoClusterFragment.kt index 802426a..b25f743 100644 --- a/app/src/main/java/com/casic/app/smartwell/fragment/HomePageNoClusterFragment.kt +++ b/app/src/main/java/com/casic/app/smartwell/fragment/HomePageNoClusterFragment.kt @@ -38,8 +38,9 @@ import com.pengxh.kt.lite.extensions.navigatePageTo import com.pengxh.kt.lite.extensions.show import com.pengxh.kt.lite.utils.LoadState -import com.pengxh.kt.lite.utils.LoadingDialogHub +import com.pengxh.kt.lite.utils.LoadingDialog import com.pengxh.kt.lite.widget.EasyPopupWindow +import com.pengxh.kt.lite.widget.TitleBarView import com.pengxh.kt.lite.widget.dialog.AlertControlDialog import kotlinx.coroutines.Dispatchers import kotlinx.coroutines.launch @@ -78,7 +79,15 @@ override fun setupTopBarLayout() { binding.rootView.initImmersionBar(this, false, R.color.mainThemeColor) - binding.titleView.text = "首页" + binding.titleView.setOnClickListener(object : TitleBarView.OnClickListener { + override fun onLeftClick() { + + } + + override fun onRightClick() { + easyPopupWindow.showAsDropDown(binding.titleView, binding.titleView.width, 0) + } + }) } override fun initOnCreate(savedInstanceState: Bundle?) { @@ -112,7 +121,7 @@ //渲染井位置 lifecycleScope.launch(Dispatchers.Main) { - LoadingDialogHub.show(requireActivity(), "数据加载中,请稍后") + LoadingDialog.show(requireActivity(), "数据加载中,请稍后") withContext(Dispatchers.IO) { //取Well缓存 val allMarkerOptions = ArrayList() @@ -144,7 +153,7 @@ val cameraPosition = CameraPosition(centerLatLng, 14f, 0f, 0f) val cameraUpdate = CameraUpdateFactory.newCameraPosition(cameraPosition) withContext(Dispatchers.Main) { - LoadingDialogHub.dismiss() + LoadingDialog.dismiss() aMap.animateCamera(cameraUpdate, 1500, null) } } @@ -238,11 +247,6 @@ } override fun initEvent() { - binding.rightOptionView.setOnClickListener { - val x = binding.rightOptionView.width - easyPopupWindow.width - easyPopupWindow.showAsDropDown(binding.rightOptionView, x, 0) - } - //撤防点位 binding.unDeployedLayout.setOnClickListener { requireContext().navigatePageTo() @@ -262,11 +266,11 @@ override fun observeRequestState() { wellViewModel.loadState.observe(this) { when (it) { - is LoadState.Loading -> LoadingDialogHub.show( + is LoadState.Loading -> LoadingDialog.show( requireActivity(), "数据加载中,请稍后..." ) - else -> LoadingDialogHub.dismiss() + else -> LoadingDialog.dismiss() } } } diff --git a/app/src/main/java/com/casic/app/smartwell/fragment/MinePageFragment.kt b/app/src/main/java/com/casic/app/smartwell/fragment/MinePageFragment.kt index 09a570c..dcb48f8 100644 --- a/app/src/main/java/com/casic/app/smartwell/fragment/MinePageFragment.kt +++ b/app/src/main/java/com/casic/app/smartwell/fragment/MinePageFragment.kt @@ -35,7 +35,7 @@ import com.pengxh.kt.lite.utils.ActivityStackManager import com.pengxh.kt.lite.utils.FileDownloadManager import com.pengxh.kt.lite.utils.LoadState -import com.pengxh.kt.lite.utils.LoadingDialogHub +import com.pengxh.kt.lite.utils.LoadingDialog import com.pengxh.kt.lite.widget.dialog.AlertControlDialog import com.pengxh.kt.lite.widget.dialog.BottomActionSheet import kotlinx.coroutines.Dispatchers @@ -60,7 +60,6 @@ override fun setupTopBarLayout() { binding.rootView.initImmersionBar(this, false, R.color.mainThemeColor) - binding.titleInclude.titleView.text = "我的" } override fun initOnCreate(savedInstanceState: Bundle?) { @@ -155,27 +154,27 @@ override fun observeRequestState() { userViewModel.loadState.observe(this) { when (it) { - is LoadState.Loading -> LoadingDialogHub.show( + is LoadState.Loading -> LoadingDialog.show( requireActivity(), "检查版本中,请稍后" ) - else -> LoadingDialogHub.dismiss() + else -> LoadingDialog.dismiss() } } wellViewModel.loadState.observe(this) { when (it) { - is LoadState.Loading -> LoadingDialogHub.show( + is LoadState.Loading -> LoadingDialog.show( requireActivity(), "数据更新中,请稍后" ) is LoadState.Fail -> { - LoadingDialogHub.dismiss() + LoadingDialog.dismiss() "数据更新超时".show(requireContext()) } else -> { - LoadingDialogHub.dismiss() + LoadingDialog.dismiss() AlertControlDialog.Builder().setContext(requireContext()).setTitle("温馨提示") .setMessage("数据更新成功,请重启应用").setNegativeButton("取消") .setPositiveButton("确定").setOnDialogButtonClickListener(object : @@ -197,17 +196,17 @@ lineViewModel.loadState.observe(this) { when (it) { - is LoadState.Loading -> LoadingDialogHub.show( + is LoadState.Loading -> LoadingDialog.show( requireActivity(), "数据更新中,请稍后" ) is LoadState.Fail -> { - LoadingDialogHub.dismiss() + LoadingDialog.dismiss() "数据更新超时".show(requireContext()) } else -> { - LoadingDialogHub.dismiss() + LoadingDialog.dismiss() AlertControlDialog.Builder().setContext(requireContext()).setTitle("温馨提示") .setMessage("数据更新成功,请重启应用").setNegativeButton("取消") .setPositiveButton("确定").setOnDialogButtonClickListener(object : diff --git a/app/build.gradle b/app/build.gradle index 296fb6f..c18c251 100644 --- a/app/build.gradle +++ b/app/build.gradle @@ -40,10 +40,6 @@ // VIVO 相关应用参数 VIVO_APP_ID : "105749048", VIVO_APP_KEY : "e460fbf2c689e0f8c58ecc6aa62e1803", - - // 小米相关应用参数 -// XIAOMI_APP_ID : "", -// XIAOMI_APP_KEY : "", ] // 版本名后面添加一句话,意思就是flavor dimension 它的维度就是该版本号,多渠道打包很重要 @@ -107,7 +103,7 @@ dependencies { implementation fileTree(dir: 'libs', include: ['*.jar']) //基础依赖库 - implementation 'com.github.AndroidCoderPeng:Kotlin-lite-lib:1.0.10' + implementation 'com.github.AndroidCoderPeng:Kotlin-lite-lib:1.1.0' implementation 'androidx.appcompat:appcompat:1.6.1' implementation 'androidx.core:core-ktx:1.9.0' implementation 'androidx.constraintlayout:constraintlayout:2.1.4' @@ -165,8 +161,6 @@ implementation 'commons-codec:commons-codec:1.15' implementation 'com.android.support:support-annotations:28.0.0' implementation 'com.assist-v3:vivo:3.1.2' // vivo -// implementation 'com.getui.opt:xmp:3.3.1' // 小米 - //数据库框架 implementation 'org.greenrobot:greendao:3.3.0' //数据库升级 diff --git a/app/src/main/AndroidManifest.xml b/app/src/main/AndroidManifest.xml index c0af158..e0519bf 100644 --- a/app/src/main/AndroidManifest.xml +++ b/app/src/main/AndroidManifest.xml @@ -90,10 +90,10 @@ - + + android:value="ee96d8b5e12de3fbb29949efd57418a8" /> () @@ -150,7 +158,7 @@ val cameraPosition = CameraPosition(centerLatLng, 14f, 0f, 0f) val cameraUpdate = CameraUpdateFactory.newCameraPosition(cameraPosition) withContext(Dispatchers.Main) { - LoadingDialogHub.dismiss() + LoadingDialog.dismiss() aMap.animateCamera(cameraUpdate, 1500, null) } } @@ -239,11 +247,6 @@ } override fun initEvent() { - binding.rightOptionView.setOnClickListener { - val x = binding.rightOptionView.width - easyPopupWindow.width - easyPopupWindow.showAsDropDown(binding.rightOptionView, x, 0) - } - //撤防点位 binding.unDeployedLayout.setOnClickListener { requireContext().navigatePageTo() @@ -263,11 +266,11 @@ override fun observeRequestState() { wellViewModel.loadState.observe(this) { when (it) { - is LoadState.Loading -> LoadingDialogHub.show( + is LoadState.Loading -> LoadingDialog.show( requireActivity(), "数据加载中,请稍后..." ) - else -> LoadingDialogHub.dismiss() + else -> LoadingDialog.dismiss() } } } @@ -376,7 +379,7 @@ }).build().show() } }) - infoPopup.showAsDropDown(binding.rightOptionView) +// infoPopup.showAsDropDown(binding.rightOptionView) } override fun onCameraChange(p0: CameraPosition?) { diff --git a/app/src/main/java/com/casic/app/smartwell/fragment/HomePageNoClusterFragment.kt b/app/src/main/java/com/casic/app/smartwell/fragment/HomePageNoClusterFragment.kt index 802426a..b25f743 100644 --- a/app/src/main/java/com/casic/app/smartwell/fragment/HomePageNoClusterFragment.kt +++ b/app/src/main/java/com/casic/app/smartwell/fragment/HomePageNoClusterFragment.kt @@ -38,8 +38,9 @@ import com.pengxh.kt.lite.extensions.navigatePageTo import com.pengxh.kt.lite.extensions.show import com.pengxh.kt.lite.utils.LoadState -import com.pengxh.kt.lite.utils.LoadingDialogHub +import com.pengxh.kt.lite.utils.LoadingDialog import com.pengxh.kt.lite.widget.EasyPopupWindow +import com.pengxh.kt.lite.widget.TitleBarView import com.pengxh.kt.lite.widget.dialog.AlertControlDialog import kotlinx.coroutines.Dispatchers import kotlinx.coroutines.launch @@ -78,7 +79,15 @@ override fun setupTopBarLayout() { binding.rootView.initImmersionBar(this, false, R.color.mainThemeColor) - binding.titleView.text = "首页" + binding.titleView.setOnClickListener(object : TitleBarView.OnClickListener { + override fun onLeftClick() { + + } + + override fun onRightClick() { + easyPopupWindow.showAsDropDown(binding.titleView, binding.titleView.width, 0) + } + }) } override fun initOnCreate(savedInstanceState: Bundle?) { @@ -112,7 +121,7 @@ //渲染井位置 lifecycleScope.launch(Dispatchers.Main) { - LoadingDialogHub.show(requireActivity(), "数据加载中,请稍后") + LoadingDialog.show(requireActivity(), "数据加载中,请稍后") withContext(Dispatchers.IO) { //取Well缓存 val allMarkerOptions = ArrayList() @@ -144,7 +153,7 @@ val cameraPosition = CameraPosition(centerLatLng, 14f, 0f, 0f) val cameraUpdate = CameraUpdateFactory.newCameraPosition(cameraPosition) withContext(Dispatchers.Main) { - LoadingDialogHub.dismiss() + LoadingDialog.dismiss() aMap.animateCamera(cameraUpdate, 1500, null) } } @@ -238,11 +247,6 @@ } override fun initEvent() { - binding.rightOptionView.setOnClickListener { - val x = binding.rightOptionView.width - easyPopupWindow.width - easyPopupWindow.showAsDropDown(binding.rightOptionView, x, 0) - } - //撤防点位 binding.unDeployedLayout.setOnClickListener { requireContext().navigatePageTo() @@ -262,11 +266,11 @@ override fun observeRequestState() { wellViewModel.loadState.observe(this) { when (it) { - is LoadState.Loading -> LoadingDialogHub.show( + is LoadState.Loading -> LoadingDialog.show( requireActivity(), "数据加载中,请稍后..." ) - else -> LoadingDialogHub.dismiss() + else -> LoadingDialog.dismiss() } } } diff --git a/app/src/main/java/com/casic/app/smartwell/fragment/MinePageFragment.kt b/app/src/main/java/com/casic/app/smartwell/fragment/MinePageFragment.kt index 09a570c..dcb48f8 100644 --- a/app/src/main/java/com/casic/app/smartwell/fragment/MinePageFragment.kt +++ b/app/src/main/java/com/casic/app/smartwell/fragment/MinePageFragment.kt @@ -35,7 +35,7 @@ import com.pengxh.kt.lite.utils.ActivityStackManager import com.pengxh.kt.lite.utils.FileDownloadManager import com.pengxh.kt.lite.utils.LoadState -import com.pengxh.kt.lite.utils.LoadingDialogHub +import com.pengxh.kt.lite.utils.LoadingDialog import com.pengxh.kt.lite.widget.dialog.AlertControlDialog import com.pengxh.kt.lite.widget.dialog.BottomActionSheet import kotlinx.coroutines.Dispatchers @@ -60,7 +60,6 @@ override fun setupTopBarLayout() { binding.rootView.initImmersionBar(this, false, R.color.mainThemeColor) - binding.titleInclude.titleView.text = "我的" } override fun initOnCreate(savedInstanceState: Bundle?) { @@ -155,27 +154,27 @@ override fun observeRequestState() { userViewModel.loadState.observe(this) { when (it) { - is LoadState.Loading -> LoadingDialogHub.show( + is LoadState.Loading -> LoadingDialog.show( requireActivity(), "检查版本中,请稍后" ) - else -> LoadingDialogHub.dismiss() + else -> LoadingDialog.dismiss() } } wellViewModel.loadState.observe(this) { when (it) { - is LoadState.Loading -> LoadingDialogHub.show( + is LoadState.Loading -> LoadingDialog.show( requireActivity(), "数据更新中,请稍后" ) is LoadState.Fail -> { - LoadingDialogHub.dismiss() + LoadingDialog.dismiss() "数据更新超时".show(requireContext()) } else -> { - LoadingDialogHub.dismiss() + LoadingDialog.dismiss() AlertControlDialog.Builder().setContext(requireContext()).setTitle("温馨提示") .setMessage("数据更新成功,请重启应用").setNegativeButton("取消") .setPositiveButton("确定").setOnDialogButtonClickListener(object : @@ -197,17 +196,17 @@ lineViewModel.loadState.observe(this) { when (it) { - is LoadState.Loading -> LoadingDialogHub.show( + is LoadState.Loading -> LoadingDialog.show( requireActivity(), "数据更新中,请稍后" ) is LoadState.Fail -> { - LoadingDialogHub.dismiss() + LoadingDialog.dismiss() "数据更新超时".show(requireContext()) } else -> { - LoadingDialogHub.dismiss() + LoadingDialog.dismiss() AlertControlDialog.Builder().setContext(requireContext()).setTitle("温馨提示") .setMessage("数据更新成功,请重启应用").setNegativeButton("取消") .setPositiveButton("确定").setOnDialogButtonClickListener(object : diff --git a/app/src/main/java/com/casic/app/smartwell/fragment/NoticePageFragment.kt b/app/src/main/java/com/casic/app/smartwell/fragment/NoticePageFragment.kt index 171b555..3c93f54 100644 --- a/app/src/main/java/com/casic/app/smartwell/fragment/NoticePageFragment.kt +++ b/app/src/main/java/com/casic/app/smartwell/fragment/NoticePageFragment.kt @@ -48,7 +48,6 @@ override fun setupTopBarLayout() { binding.rootView.initImmersionBar(this, false, R.color.mainThemeColor) - binding.titleInclude.titleView.text = "消息" } override fun initOnCreate(savedInstanceState: Bundle?) { diff --git a/app/build.gradle b/app/build.gradle index 296fb6f..c18c251 100644 --- a/app/build.gradle +++ b/app/build.gradle @@ -40,10 +40,6 @@ // VIVO 相关应用参数 VIVO_APP_ID : "105749048", VIVO_APP_KEY : "e460fbf2c689e0f8c58ecc6aa62e1803", - - // 小米相关应用参数 -// XIAOMI_APP_ID : "", -// XIAOMI_APP_KEY : "", ] // 版本名后面添加一句话,意思就是flavor dimension 它的维度就是该版本号,多渠道打包很重要 @@ -107,7 +103,7 @@ dependencies { implementation fileTree(dir: 'libs', include: ['*.jar']) //基础依赖库 - implementation 'com.github.AndroidCoderPeng:Kotlin-lite-lib:1.0.10' + implementation 'com.github.AndroidCoderPeng:Kotlin-lite-lib:1.1.0' implementation 'androidx.appcompat:appcompat:1.6.1' implementation 'androidx.core:core-ktx:1.9.0' implementation 'androidx.constraintlayout:constraintlayout:2.1.4' @@ -165,8 +161,6 @@ implementation 'commons-codec:commons-codec:1.15' implementation 'com.android.support:support-annotations:28.0.0' implementation 'com.assist-v3:vivo:3.1.2' // vivo -// implementation 'com.getui.opt:xmp:3.3.1' // 小米 - //数据库框架 implementation 'org.greenrobot:greendao:3.3.0' //数据库升级 diff --git a/app/src/main/AndroidManifest.xml b/app/src/main/AndroidManifest.xml index c0af158..e0519bf 100644 --- a/app/src/main/AndroidManifest.xml +++ b/app/src/main/AndroidManifest.xml @@ -90,10 +90,10 @@ - + + android:value="ee96d8b5e12de3fbb29949efd57418a8" /> () @@ -150,7 +158,7 @@ val cameraPosition = CameraPosition(centerLatLng, 14f, 0f, 0f) val cameraUpdate = CameraUpdateFactory.newCameraPosition(cameraPosition) withContext(Dispatchers.Main) { - LoadingDialogHub.dismiss() + LoadingDialog.dismiss() aMap.animateCamera(cameraUpdate, 1500, null) } } @@ -239,11 +247,6 @@ } override fun initEvent() { - binding.rightOptionView.setOnClickListener { - val x = binding.rightOptionView.width - easyPopupWindow.width - easyPopupWindow.showAsDropDown(binding.rightOptionView, x, 0) - } - //撤防点位 binding.unDeployedLayout.setOnClickListener { requireContext().navigatePageTo() @@ -263,11 +266,11 @@ override fun observeRequestState() { wellViewModel.loadState.observe(this) { when (it) { - is LoadState.Loading -> LoadingDialogHub.show( + is LoadState.Loading -> LoadingDialog.show( requireActivity(), "数据加载中,请稍后..." ) - else -> LoadingDialogHub.dismiss() + else -> LoadingDialog.dismiss() } } } @@ -376,7 +379,7 @@ }).build().show() } }) - infoPopup.showAsDropDown(binding.rightOptionView) +// infoPopup.showAsDropDown(binding.rightOptionView) } override fun onCameraChange(p0: CameraPosition?) { diff --git a/app/src/main/java/com/casic/app/smartwell/fragment/HomePageNoClusterFragment.kt b/app/src/main/java/com/casic/app/smartwell/fragment/HomePageNoClusterFragment.kt index 802426a..b25f743 100644 --- a/app/src/main/java/com/casic/app/smartwell/fragment/HomePageNoClusterFragment.kt +++ b/app/src/main/java/com/casic/app/smartwell/fragment/HomePageNoClusterFragment.kt @@ -38,8 +38,9 @@ import com.pengxh.kt.lite.extensions.navigatePageTo import com.pengxh.kt.lite.extensions.show import com.pengxh.kt.lite.utils.LoadState -import com.pengxh.kt.lite.utils.LoadingDialogHub +import com.pengxh.kt.lite.utils.LoadingDialog import com.pengxh.kt.lite.widget.EasyPopupWindow +import com.pengxh.kt.lite.widget.TitleBarView import com.pengxh.kt.lite.widget.dialog.AlertControlDialog import kotlinx.coroutines.Dispatchers import kotlinx.coroutines.launch @@ -78,7 +79,15 @@ override fun setupTopBarLayout() { binding.rootView.initImmersionBar(this, false, R.color.mainThemeColor) - binding.titleView.text = "首页" + binding.titleView.setOnClickListener(object : TitleBarView.OnClickListener { + override fun onLeftClick() { + + } + + override fun onRightClick() { + easyPopupWindow.showAsDropDown(binding.titleView, binding.titleView.width, 0) + } + }) } override fun initOnCreate(savedInstanceState: Bundle?) { @@ -112,7 +121,7 @@ //渲染井位置 lifecycleScope.launch(Dispatchers.Main) { - LoadingDialogHub.show(requireActivity(), "数据加载中,请稍后") + LoadingDialog.show(requireActivity(), "数据加载中,请稍后") withContext(Dispatchers.IO) { //取Well缓存 val allMarkerOptions = ArrayList() @@ -144,7 +153,7 @@ val cameraPosition = CameraPosition(centerLatLng, 14f, 0f, 0f) val cameraUpdate = CameraUpdateFactory.newCameraPosition(cameraPosition) withContext(Dispatchers.Main) { - LoadingDialogHub.dismiss() + LoadingDialog.dismiss() aMap.animateCamera(cameraUpdate, 1500, null) } } @@ -238,11 +247,6 @@ } override fun initEvent() { - binding.rightOptionView.setOnClickListener { - val x = binding.rightOptionView.width - easyPopupWindow.width - easyPopupWindow.showAsDropDown(binding.rightOptionView, x, 0) - } - //撤防点位 binding.unDeployedLayout.setOnClickListener { requireContext().navigatePageTo() @@ -262,11 +266,11 @@ override fun observeRequestState() { wellViewModel.loadState.observe(this) { when (it) { - is LoadState.Loading -> LoadingDialogHub.show( + is LoadState.Loading -> LoadingDialog.show( requireActivity(), "数据加载中,请稍后..." ) - else -> LoadingDialogHub.dismiss() + else -> LoadingDialog.dismiss() } } } diff --git a/app/src/main/java/com/casic/app/smartwell/fragment/MinePageFragment.kt b/app/src/main/java/com/casic/app/smartwell/fragment/MinePageFragment.kt index 09a570c..dcb48f8 100644 --- a/app/src/main/java/com/casic/app/smartwell/fragment/MinePageFragment.kt +++ b/app/src/main/java/com/casic/app/smartwell/fragment/MinePageFragment.kt @@ -35,7 +35,7 @@ import com.pengxh.kt.lite.utils.ActivityStackManager import com.pengxh.kt.lite.utils.FileDownloadManager import com.pengxh.kt.lite.utils.LoadState -import com.pengxh.kt.lite.utils.LoadingDialogHub +import com.pengxh.kt.lite.utils.LoadingDialog import com.pengxh.kt.lite.widget.dialog.AlertControlDialog import com.pengxh.kt.lite.widget.dialog.BottomActionSheet import kotlinx.coroutines.Dispatchers @@ -60,7 +60,6 @@ override fun setupTopBarLayout() { binding.rootView.initImmersionBar(this, false, R.color.mainThemeColor) - binding.titleInclude.titleView.text = "我的" } override fun initOnCreate(savedInstanceState: Bundle?) { @@ -155,27 +154,27 @@ override fun observeRequestState() { userViewModel.loadState.observe(this) { when (it) { - is LoadState.Loading -> LoadingDialogHub.show( + is LoadState.Loading -> LoadingDialog.show( requireActivity(), "检查版本中,请稍后" ) - else -> LoadingDialogHub.dismiss() + else -> LoadingDialog.dismiss() } } wellViewModel.loadState.observe(this) { when (it) { - is LoadState.Loading -> LoadingDialogHub.show( + is LoadState.Loading -> LoadingDialog.show( requireActivity(), "数据更新中,请稍后" ) is LoadState.Fail -> { - LoadingDialogHub.dismiss() + LoadingDialog.dismiss() "数据更新超时".show(requireContext()) } else -> { - LoadingDialogHub.dismiss() + LoadingDialog.dismiss() AlertControlDialog.Builder().setContext(requireContext()).setTitle("温馨提示") .setMessage("数据更新成功,请重启应用").setNegativeButton("取消") .setPositiveButton("确定").setOnDialogButtonClickListener(object : @@ -197,17 +196,17 @@ lineViewModel.loadState.observe(this) { when (it) { - is LoadState.Loading -> LoadingDialogHub.show( + is LoadState.Loading -> LoadingDialog.show( requireActivity(), "数据更新中,请稍后" ) is LoadState.Fail -> { - LoadingDialogHub.dismiss() + LoadingDialog.dismiss() "数据更新超时".show(requireContext()) } else -> { - LoadingDialogHub.dismiss() + LoadingDialog.dismiss() AlertControlDialog.Builder().setContext(requireContext()).setTitle("温馨提示") .setMessage("数据更新成功,请重启应用").setNegativeButton("取消") .setPositiveButton("确定").setOnDialogButtonClickListener(object : diff --git a/app/src/main/java/com/casic/app/smartwell/fragment/NoticePageFragment.kt b/app/src/main/java/com/casic/app/smartwell/fragment/NoticePageFragment.kt index 171b555..3c93f54 100644 --- a/app/src/main/java/com/casic/app/smartwell/fragment/NoticePageFragment.kt +++ b/app/src/main/java/com/casic/app/smartwell/fragment/NoticePageFragment.kt @@ -48,7 +48,6 @@ override fun setupTopBarLayout() { binding.rootView.initImmersionBar(this, false, R.color.mainThemeColor) - binding.titleInclude.titleView.text = "消息" } override fun initOnCreate(savedInstanceState: Bundle?) { diff --git a/app/src/main/java/com/casic/app/smartwell/fragment/OrderListFragment.kt b/app/src/main/java/com/casic/app/smartwell/fragment/OrderListFragment.kt index 93ff35b..5e38acb 100644 --- a/app/src/main/java/com/casic/app/smartwell/fragment/OrderListFragment.kt +++ b/app/src/main/java/com/casic/app/smartwell/fragment/OrderListFragment.kt @@ -12,6 +12,7 @@ import com.casic.app.smartwell.view.SearchOrderActivity import com.pengxh.kt.lite.base.KotlinBaseFragment import com.pengxh.kt.lite.extensions.navigatePageTo +import com.pengxh.kt.lite.widget.TitleBarView class OrderListFragment : KotlinBaseFragment() { @@ -25,15 +26,22 @@ } override fun initViewBinding( - inflater: LayoutInflater, - container: ViewGroup? + inflater: LayoutInflater, container: ViewGroup? ): FragmentOrderBinding { return FragmentOrderBinding.inflate(inflater, container, false) } override fun setupTopBarLayout() { binding.rootView.initImmersionBar(this, false, R.color.mainThemeColor) - binding.titleView.text = "工单" + binding.titleView.setOnClickListener(object : TitleBarView.OnClickListener { + override fun onLeftClick() { + + } + + override fun onRightClick() { + requireContext().navigatePageTo() + } + }) } override fun initOnCreate(savedInstanceState: Bundle?) { @@ -51,8 +59,6 @@ } override fun initEvent() { - binding.rightOptionView.setOnClickListener { - requireContext().navigatePageTo() - } + } } \ No newline at end of file diff --git a/app/build.gradle b/app/build.gradle index 296fb6f..c18c251 100644 --- a/app/build.gradle +++ b/app/build.gradle @@ -40,10 +40,6 @@ // VIVO 相关应用参数 VIVO_APP_ID : "105749048", VIVO_APP_KEY : "e460fbf2c689e0f8c58ecc6aa62e1803", - - // 小米相关应用参数 -// XIAOMI_APP_ID : "", -// XIAOMI_APP_KEY : "", ] // 版本名后面添加一句话,意思就是flavor dimension 它的维度就是该版本号,多渠道打包很重要 @@ -107,7 +103,7 @@ dependencies { implementation fileTree(dir: 'libs', include: ['*.jar']) //基础依赖库 - implementation 'com.github.AndroidCoderPeng:Kotlin-lite-lib:1.0.10' + implementation 'com.github.AndroidCoderPeng:Kotlin-lite-lib:1.1.0' implementation 'androidx.appcompat:appcompat:1.6.1' implementation 'androidx.core:core-ktx:1.9.0' implementation 'androidx.constraintlayout:constraintlayout:2.1.4' @@ -165,8 +161,6 @@ implementation 'commons-codec:commons-codec:1.15' implementation 'com.android.support:support-annotations:28.0.0' implementation 'com.assist-v3:vivo:3.1.2' // vivo -// implementation 'com.getui.opt:xmp:3.3.1' // 小米 - //数据库框架 implementation 'org.greenrobot:greendao:3.3.0' //数据库升级 diff --git a/app/src/main/AndroidManifest.xml b/app/src/main/AndroidManifest.xml index c0af158..e0519bf 100644 --- a/app/src/main/AndroidManifest.xml +++ b/app/src/main/AndroidManifest.xml @@ -90,10 +90,10 @@ - + + android:value="ee96d8b5e12de3fbb29949efd57418a8" /> () @@ -150,7 +158,7 @@ val cameraPosition = CameraPosition(centerLatLng, 14f, 0f, 0f) val cameraUpdate = CameraUpdateFactory.newCameraPosition(cameraPosition) withContext(Dispatchers.Main) { - LoadingDialogHub.dismiss() + LoadingDialog.dismiss() aMap.animateCamera(cameraUpdate, 1500, null) } } @@ -239,11 +247,6 @@ } override fun initEvent() { - binding.rightOptionView.setOnClickListener { - val x = binding.rightOptionView.width - easyPopupWindow.width - easyPopupWindow.showAsDropDown(binding.rightOptionView, x, 0) - } - //撤防点位 binding.unDeployedLayout.setOnClickListener { requireContext().navigatePageTo() @@ -263,11 +266,11 @@ override fun observeRequestState() { wellViewModel.loadState.observe(this) { when (it) { - is LoadState.Loading -> LoadingDialogHub.show( + is LoadState.Loading -> LoadingDialog.show( requireActivity(), "数据加载中,请稍后..." ) - else -> LoadingDialogHub.dismiss() + else -> LoadingDialog.dismiss() } } } @@ -376,7 +379,7 @@ }).build().show() } }) - infoPopup.showAsDropDown(binding.rightOptionView) +// infoPopup.showAsDropDown(binding.rightOptionView) } override fun onCameraChange(p0: CameraPosition?) { diff --git a/app/src/main/java/com/casic/app/smartwell/fragment/HomePageNoClusterFragment.kt b/app/src/main/java/com/casic/app/smartwell/fragment/HomePageNoClusterFragment.kt index 802426a..b25f743 100644 --- a/app/src/main/java/com/casic/app/smartwell/fragment/HomePageNoClusterFragment.kt +++ b/app/src/main/java/com/casic/app/smartwell/fragment/HomePageNoClusterFragment.kt @@ -38,8 +38,9 @@ import com.pengxh.kt.lite.extensions.navigatePageTo import com.pengxh.kt.lite.extensions.show import com.pengxh.kt.lite.utils.LoadState -import com.pengxh.kt.lite.utils.LoadingDialogHub +import com.pengxh.kt.lite.utils.LoadingDialog import com.pengxh.kt.lite.widget.EasyPopupWindow +import com.pengxh.kt.lite.widget.TitleBarView import com.pengxh.kt.lite.widget.dialog.AlertControlDialog import kotlinx.coroutines.Dispatchers import kotlinx.coroutines.launch @@ -78,7 +79,15 @@ override fun setupTopBarLayout() { binding.rootView.initImmersionBar(this, false, R.color.mainThemeColor) - binding.titleView.text = "首页" + binding.titleView.setOnClickListener(object : TitleBarView.OnClickListener { + override fun onLeftClick() { + + } + + override fun onRightClick() { + easyPopupWindow.showAsDropDown(binding.titleView, binding.titleView.width, 0) + } + }) } override fun initOnCreate(savedInstanceState: Bundle?) { @@ -112,7 +121,7 @@ //渲染井位置 lifecycleScope.launch(Dispatchers.Main) { - LoadingDialogHub.show(requireActivity(), "数据加载中,请稍后") + LoadingDialog.show(requireActivity(), "数据加载中,请稍后") withContext(Dispatchers.IO) { //取Well缓存 val allMarkerOptions = ArrayList() @@ -144,7 +153,7 @@ val cameraPosition = CameraPosition(centerLatLng, 14f, 0f, 0f) val cameraUpdate = CameraUpdateFactory.newCameraPosition(cameraPosition) withContext(Dispatchers.Main) { - LoadingDialogHub.dismiss() + LoadingDialog.dismiss() aMap.animateCamera(cameraUpdate, 1500, null) } } @@ -238,11 +247,6 @@ } override fun initEvent() { - binding.rightOptionView.setOnClickListener { - val x = binding.rightOptionView.width - easyPopupWindow.width - easyPopupWindow.showAsDropDown(binding.rightOptionView, x, 0) - } - //撤防点位 binding.unDeployedLayout.setOnClickListener { requireContext().navigatePageTo() @@ -262,11 +266,11 @@ override fun observeRequestState() { wellViewModel.loadState.observe(this) { when (it) { - is LoadState.Loading -> LoadingDialogHub.show( + is LoadState.Loading -> LoadingDialog.show( requireActivity(), "数据加载中,请稍后..." ) - else -> LoadingDialogHub.dismiss() + else -> LoadingDialog.dismiss() } } } diff --git a/app/src/main/java/com/casic/app/smartwell/fragment/MinePageFragment.kt b/app/src/main/java/com/casic/app/smartwell/fragment/MinePageFragment.kt index 09a570c..dcb48f8 100644 --- a/app/src/main/java/com/casic/app/smartwell/fragment/MinePageFragment.kt +++ b/app/src/main/java/com/casic/app/smartwell/fragment/MinePageFragment.kt @@ -35,7 +35,7 @@ import com.pengxh.kt.lite.utils.ActivityStackManager import com.pengxh.kt.lite.utils.FileDownloadManager import com.pengxh.kt.lite.utils.LoadState -import com.pengxh.kt.lite.utils.LoadingDialogHub +import com.pengxh.kt.lite.utils.LoadingDialog import com.pengxh.kt.lite.widget.dialog.AlertControlDialog import com.pengxh.kt.lite.widget.dialog.BottomActionSheet import kotlinx.coroutines.Dispatchers @@ -60,7 +60,6 @@ override fun setupTopBarLayout() { binding.rootView.initImmersionBar(this, false, R.color.mainThemeColor) - binding.titleInclude.titleView.text = "我的" } override fun initOnCreate(savedInstanceState: Bundle?) { @@ -155,27 +154,27 @@ override fun observeRequestState() { userViewModel.loadState.observe(this) { when (it) { - is LoadState.Loading -> LoadingDialogHub.show( + is LoadState.Loading -> LoadingDialog.show( requireActivity(), "检查版本中,请稍后" ) - else -> LoadingDialogHub.dismiss() + else -> LoadingDialog.dismiss() } } wellViewModel.loadState.observe(this) { when (it) { - is LoadState.Loading -> LoadingDialogHub.show( + is LoadState.Loading -> LoadingDialog.show( requireActivity(), "数据更新中,请稍后" ) is LoadState.Fail -> { - LoadingDialogHub.dismiss() + LoadingDialog.dismiss() "数据更新超时".show(requireContext()) } else -> { - LoadingDialogHub.dismiss() + LoadingDialog.dismiss() AlertControlDialog.Builder().setContext(requireContext()).setTitle("温馨提示") .setMessage("数据更新成功,请重启应用").setNegativeButton("取消") .setPositiveButton("确定").setOnDialogButtonClickListener(object : @@ -197,17 +196,17 @@ lineViewModel.loadState.observe(this) { when (it) { - is LoadState.Loading -> LoadingDialogHub.show( + is LoadState.Loading -> LoadingDialog.show( requireActivity(), "数据更新中,请稍后" ) is LoadState.Fail -> { - LoadingDialogHub.dismiss() + LoadingDialog.dismiss() "数据更新超时".show(requireContext()) } else -> { - LoadingDialogHub.dismiss() + LoadingDialog.dismiss() AlertControlDialog.Builder().setContext(requireContext()).setTitle("温馨提示") .setMessage("数据更新成功,请重启应用").setNegativeButton("取消") .setPositiveButton("确定").setOnDialogButtonClickListener(object : diff --git a/app/src/main/java/com/casic/app/smartwell/fragment/NoticePageFragment.kt b/app/src/main/java/com/casic/app/smartwell/fragment/NoticePageFragment.kt index 171b555..3c93f54 100644 --- a/app/src/main/java/com/casic/app/smartwell/fragment/NoticePageFragment.kt +++ b/app/src/main/java/com/casic/app/smartwell/fragment/NoticePageFragment.kt @@ -48,7 +48,6 @@ override fun setupTopBarLayout() { binding.rootView.initImmersionBar(this, false, R.color.mainThemeColor) - binding.titleInclude.titleView.text = "消息" } override fun initOnCreate(savedInstanceState: Bundle?) { diff --git a/app/src/main/java/com/casic/app/smartwell/fragment/OrderListFragment.kt b/app/src/main/java/com/casic/app/smartwell/fragment/OrderListFragment.kt index 93ff35b..5e38acb 100644 --- a/app/src/main/java/com/casic/app/smartwell/fragment/OrderListFragment.kt +++ b/app/src/main/java/com/casic/app/smartwell/fragment/OrderListFragment.kt @@ -12,6 +12,7 @@ import com.casic.app.smartwell.view.SearchOrderActivity import com.pengxh.kt.lite.base.KotlinBaseFragment import com.pengxh.kt.lite.extensions.navigatePageTo +import com.pengxh.kt.lite.widget.TitleBarView class OrderListFragment : KotlinBaseFragment() { @@ -25,15 +26,22 @@ } override fun initViewBinding( - inflater: LayoutInflater, - container: ViewGroup? + inflater: LayoutInflater, container: ViewGroup? ): FragmentOrderBinding { return FragmentOrderBinding.inflate(inflater, container, false) } override fun setupTopBarLayout() { binding.rootView.initImmersionBar(this, false, R.color.mainThemeColor) - binding.titleView.text = "工单" + binding.titleView.setOnClickListener(object : TitleBarView.OnClickListener { + override fun onLeftClick() { + + } + + override fun onRightClick() { + requireContext().navigatePageTo() + } + }) } override fun initOnCreate(savedInstanceState: Bundle?) { @@ -51,8 +59,6 @@ } override fun initEvent() { - binding.rightOptionView.setOnClickListener { - requireContext().navigatePageTo() - } + } } \ No newline at end of file diff --git a/app/src/main/java/com/casic/app/smartwell/fragment/OrderNotProcessedFragment.kt b/app/src/main/java/com/casic/app/smartwell/fragment/OrderNotProcessedFragment.kt index 0b3d09d..2b6f21d 100644 --- a/app/src/main/java/com/casic/app/smartwell/fragment/OrderNotProcessedFragment.kt +++ b/app/src/main/java/com/casic/app/smartwell/fragment/OrderNotProcessedFragment.kt @@ -18,7 +18,7 @@ import com.pengxh.kt.lite.extensions.navigatePageTo import com.pengxh.kt.lite.extensions.show import com.pengxh.kt.lite.utils.LoadState -import com.pengxh.kt.lite.utils.LoadingDialogHub +import com.pengxh.kt.lite.utils.LoadingDialog import com.pengxh.kt.lite.utils.WeakReferenceHandler import com.pengxh.kt.lite.widget.dialog.AlertControlDialog @@ -78,8 +78,8 @@ operationViewModel = ViewModelProvider(this)[OperationViewModel::class.java] - binding.notProcessedView.addItemDecoration( - RecyclerViewItemOffsets(0, 5, 0, 5) + binding.recyclerView.addItemDecoration( + RecyclerViewItemOffsets(0, 7, 0, 7) ) } @@ -87,9 +87,9 @@ //接单状态处理 operationViewModel.loadState.observe(this) { when (it) { - is LoadState.Loading -> LoadingDialogHub.show(requireActivity(), "接单中,请稍后") + is LoadState.Loading -> LoadingDialog.show(requireActivity(), "接单中,请稍后") is LoadState.Success -> { - LoadingDialogHub.dismiss() + LoadingDialog.dismiss() //接单成功之后刷新列表 dataBeans.removeAt(clickedPosition) notProcessedAdapter.notifyItemRemoved(clickedPosition) @@ -98,7 +98,7 @@ ) } - else -> LoadingDialogHub.dismiss() + else -> LoadingDialog.dismiss() } } } @@ -131,7 +131,7 @@ } else { binding.emptyInclude.emptyView.hide() notProcessedAdapter = OrderNotProcessedAdapter(requireContext(), dataBeans) - binding.notProcessedView.adapter = notProcessedAdapter + binding.recyclerView.adapter = notProcessedAdapter notProcessedAdapter.setOnItemClickListener(object : OrderNotProcessedAdapter.OnItemClickListener { override fun onClicked(position: Int) { diff --git a/app/build.gradle b/app/build.gradle index 296fb6f..c18c251 100644 --- a/app/build.gradle +++ b/app/build.gradle @@ -40,10 +40,6 @@ // VIVO 相关应用参数 VIVO_APP_ID : "105749048", VIVO_APP_KEY : "e460fbf2c689e0f8c58ecc6aa62e1803", - - // 小米相关应用参数 -// XIAOMI_APP_ID : "", -// XIAOMI_APP_KEY : "", ] // 版本名后面添加一句话,意思就是flavor dimension 它的维度就是该版本号,多渠道打包很重要 @@ -107,7 +103,7 @@ dependencies { implementation fileTree(dir: 'libs', include: ['*.jar']) //基础依赖库 - implementation 'com.github.AndroidCoderPeng:Kotlin-lite-lib:1.0.10' + implementation 'com.github.AndroidCoderPeng:Kotlin-lite-lib:1.1.0' implementation 'androidx.appcompat:appcompat:1.6.1' implementation 'androidx.core:core-ktx:1.9.0' implementation 'androidx.constraintlayout:constraintlayout:2.1.4' @@ -165,8 +161,6 @@ implementation 'commons-codec:commons-codec:1.15' implementation 'com.android.support:support-annotations:28.0.0' implementation 'com.assist-v3:vivo:3.1.2' // vivo -// implementation 'com.getui.opt:xmp:3.3.1' // 小米 - //数据库框架 implementation 'org.greenrobot:greendao:3.3.0' //数据库升级 diff --git a/app/src/main/AndroidManifest.xml b/app/src/main/AndroidManifest.xml index c0af158..e0519bf 100644 --- a/app/src/main/AndroidManifest.xml +++ b/app/src/main/AndroidManifest.xml @@ -90,10 +90,10 @@ - + + android:value="ee96d8b5e12de3fbb29949efd57418a8" /> () @@ -150,7 +158,7 @@ val cameraPosition = CameraPosition(centerLatLng, 14f, 0f, 0f) val cameraUpdate = CameraUpdateFactory.newCameraPosition(cameraPosition) withContext(Dispatchers.Main) { - LoadingDialogHub.dismiss() + LoadingDialog.dismiss() aMap.animateCamera(cameraUpdate, 1500, null) } } @@ -239,11 +247,6 @@ } override fun initEvent() { - binding.rightOptionView.setOnClickListener { - val x = binding.rightOptionView.width - easyPopupWindow.width - easyPopupWindow.showAsDropDown(binding.rightOptionView, x, 0) - } - //撤防点位 binding.unDeployedLayout.setOnClickListener { requireContext().navigatePageTo() @@ -263,11 +266,11 @@ override fun observeRequestState() { wellViewModel.loadState.observe(this) { when (it) { - is LoadState.Loading -> LoadingDialogHub.show( + is LoadState.Loading -> LoadingDialog.show( requireActivity(), "数据加载中,请稍后..." ) - else -> LoadingDialogHub.dismiss() + else -> LoadingDialog.dismiss() } } } @@ -376,7 +379,7 @@ }).build().show() } }) - infoPopup.showAsDropDown(binding.rightOptionView) +// infoPopup.showAsDropDown(binding.rightOptionView) } override fun onCameraChange(p0: CameraPosition?) { diff --git a/app/src/main/java/com/casic/app/smartwell/fragment/HomePageNoClusterFragment.kt b/app/src/main/java/com/casic/app/smartwell/fragment/HomePageNoClusterFragment.kt index 802426a..b25f743 100644 --- a/app/src/main/java/com/casic/app/smartwell/fragment/HomePageNoClusterFragment.kt +++ b/app/src/main/java/com/casic/app/smartwell/fragment/HomePageNoClusterFragment.kt @@ -38,8 +38,9 @@ import com.pengxh.kt.lite.extensions.navigatePageTo import com.pengxh.kt.lite.extensions.show import com.pengxh.kt.lite.utils.LoadState -import com.pengxh.kt.lite.utils.LoadingDialogHub +import com.pengxh.kt.lite.utils.LoadingDialog import com.pengxh.kt.lite.widget.EasyPopupWindow +import com.pengxh.kt.lite.widget.TitleBarView import com.pengxh.kt.lite.widget.dialog.AlertControlDialog import kotlinx.coroutines.Dispatchers import kotlinx.coroutines.launch @@ -78,7 +79,15 @@ override fun setupTopBarLayout() { binding.rootView.initImmersionBar(this, false, R.color.mainThemeColor) - binding.titleView.text = "首页" + binding.titleView.setOnClickListener(object : TitleBarView.OnClickListener { + override fun onLeftClick() { + + } + + override fun onRightClick() { + easyPopupWindow.showAsDropDown(binding.titleView, binding.titleView.width, 0) + } + }) } override fun initOnCreate(savedInstanceState: Bundle?) { @@ -112,7 +121,7 @@ //渲染井位置 lifecycleScope.launch(Dispatchers.Main) { - LoadingDialogHub.show(requireActivity(), "数据加载中,请稍后") + LoadingDialog.show(requireActivity(), "数据加载中,请稍后") withContext(Dispatchers.IO) { //取Well缓存 val allMarkerOptions = ArrayList() @@ -144,7 +153,7 @@ val cameraPosition = CameraPosition(centerLatLng, 14f, 0f, 0f) val cameraUpdate = CameraUpdateFactory.newCameraPosition(cameraPosition) withContext(Dispatchers.Main) { - LoadingDialogHub.dismiss() + LoadingDialog.dismiss() aMap.animateCamera(cameraUpdate, 1500, null) } } @@ -238,11 +247,6 @@ } override fun initEvent() { - binding.rightOptionView.setOnClickListener { - val x = binding.rightOptionView.width - easyPopupWindow.width - easyPopupWindow.showAsDropDown(binding.rightOptionView, x, 0) - } - //撤防点位 binding.unDeployedLayout.setOnClickListener { requireContext().navigatePageTo() @@ -262,11 +266,11 @@ override fun observeRequestState() { wellViewModel.loadState.observe(this) { when (it) { - is LoadState.Loading -> LoadingDialogHub.show( + is LoadState.Loading -> LoadingDialog.show( requireActivity(), "数据加载中,请稍后..." ) - else -> LoadingDialogHub.dismiss() + else -> LoadingDialog.dismiss() } } } diff --git a/app/src/main/java/com/casic/app/smartwell/fragment/MinePageFragment.kt b/app/src/main/java/com/casic/app/smartwell/fragment/MinePageFragment.kt index 09a570c..dcb48f8 100644 --- a/app/src/main/java/com/casic/app/smartwell/fragment/MinePageFragment.kt +++ b/app/src/main/java/com/casic/app/smartwell/fragment/MinePageFragment.kt @@ -35,7 +35,7 @@ import com.pengxh.kt.lite.utils.ActivityStackManager import com.pengxh.kt.lite.utils.FileDownloadManager import com.pengxh.kt.lite.utils.LoadState -import com.pengxh.kt.lite.utils.LoadingDialogHub +import com.pengxh.kt.lite.utils.LoadingDialog import com.pengxh.kt.lite.widget.dialog.AlertControlDialog import com.pengxh.kt.lite.widget.dialog.BottomActionSheet import kotlinx.coroutines.Dispatchers @@ -60,7 +60,6 @@ override fun setupTopBarLayout() { binding.rootView.initImmersionBar(this, false, R.color.mainThemeColor) - binding.titleInclude.titleView.text = "我的" } override fun initOnCreate(savedInstanceState: Bundle?) { @@ -155,27 +154,27 @@ override fun observeRequestState() { userViewModel.loadState.observe(this) { when (it) { - is LoadState.Loading -> LoadingDialogHub.show( + is LoadState.Loading -> LoadingDialog.show( requireActivity(), "检查版本中,请稍后" ) - else -> LoadingDialogHub.dismiss() + else -> LoadingDialog.dismiss() } } wellViewModel.loadState.observe(this) { when (it) { - is LoadState.Loading -> LoadingDialogHub.show( + is LoadState.Loading -> LoadingDialog.show( requireActivity(), "数据更新中,请稍后" ) is LoadState.Fail -> { - LoadingDialogHub.dismiss() + LoadingDialog.dismiss() "数据更新超时".show(requireContext()) } else -> { - LoadingDialogHub.dismiss() + LoadingDialog.dismiss() AlertControlDialog.Builder().setContext(requireContext()).setTitle("温馨提示") .setMessage("数据更新成功,请重启应用").setNegativeButton("取消") .setPositiveButton("确定").setOnDialogButtonClickListener(object : @@ -197,17 +196,17 @@ lineViewModel.loadState.observe(this) { when (it) { - is LoadState.Loading -> LoadingDialogHub.show( + is LoadState.Loading -> LoadingDialog.show( requireActivity(), "数据更新中,请稍后" ) is LoadState.Fail -> { - LoadingDialogHub.dismiss() + LoadingDialog.dismiss() "数据更新超时".show(requireContext()) } else -> { - LoadingDialogHub.dismiss() + LoadingDialog.dismiss() AlertControlDialog.Builder().setContext(requireContext()).setTitle("温馨提示") .setMessage("数据更新成功,请重启应用").setNegativeButton("取消") .setPositiveButton("确定").setOnDialogButtonClickListener(object : diff --git a/app/src/main/java/com/casic/app/smartwell/fragment/NoticePageFragment.kt b/app/src/main/java/com/casic/app/smartwell/fragment/NoticePageFragment.kt index 171b555..3c93f54 100644 --- a/app/src/main/java/com/casic/app/smartwell/fragment/NoticePageFragment.kt +++ b/app/src/main/java/com/casic/app/smartwell/fragment/NoticePageFragment.kt @@ -48,7 +48,6 @@ override fun setupTopBarLayout() { binding.rootView.initImmersionBar(this, false, R.color.mainThemeColor) - binding.titleInclude.titleView.text = "消息" } override fun initOnCreate(savedInstanceState: Bundle?) { diff --git a/app/src/main/java/com/casic/app/smartwell/fragment/OrderListFragment.kt b/app/src/main/java/com/casic/app/smartwell/fragment/OrderListFragment.kt index 93ff35b..5e38acb 100644 --- a/app/src/main/java/com/casic/app/smartwell/fragment/OrderListFragment.kt +++ b/app/src/main/java/com/casic/app/smartwell/fragment/OrderListFragment.kt @@ -12,6 +12,7 @@ import com.casic.app.smartwell.view.SearchOrderActivity import com.pengxh.kt.lite.base.KotlinBaseFragment import com.pengxh.kt.lite.extensions.navigatePageTo +import com.pengxh.kt.lite.widget.TitleBarView class OrderListFragment : KotlinBaseFragment() { @@ -25,15 +26,22 @@ } override fun initViewBinding( - inflater: LayoutInflater, - container: ViewGroup? + inflater: LayoutInflater, container: ViewGroup? ): FragmentOrderBinding { return FragmentOrderBinding.inflate(inflater, container, false) } override fun setupTopBarLayout() { binding.rootView.initImmersionBar(this, false, R.color.mainThemeColor) - binding.titleView.text = "工单" + binding.titleView.setOnClickListener(object : TitleBarView.OnClickListener { + override fun onLeftClick() { + + } + + override fun onRightClick() { + requireContext().navigatePageTo() + } + }) } override fun initOnCreate(savedInstanceState: Bundle?) { @@ -51,8 +59,6 @@ } override fun initEvent() { - binding.rightOptionView.setOnClickListener { - requireContext().navigatePageTo() - } + } } \ No newline at end of file diff --git a/app/src/main/java/com/casic/app/smartwell/fragment/OrderNotProcessedFragment.kt b/app/src/main/java/com/casic/app/smartwell/fragment/OrderNotProcessedFragment.kt index 0b3d09d..2b6f21d 100644 --- a/app/src/main/java/com/casic/app/smartwell/fragment/OrderNotProcessedFragment.kt +++ b/app/src/main/java/com/casic/app/smartwell/fragment/OrderNotProcessedFragment.kt @@ -18,7 +18,7 @@ import com.pengxh.kt.lite.extensions.navigatePageTo import com.pengxh.kt.lite.extensions.show import com.pengxh.kt.lite.utils.LoadState -import com.pengxh.kt.lite.utils.LoadingDialogHub +import com.pengxh.kt.lite.utils.LoadingDialog import com.pengxh.kt.lite.utils.WeakReferenceHandler import com.pengxh.kt.lite.widget.dialog.AlertControlDialog @@ -78,8 +78,8 @@ operationViewModel = ViewModelProvider(this)[OperationViewModel::class.java] - binding.notProcessedView.addItemDecoration( - RecyclerViewItemOffsets(0, 5, 0, 5) + binding.recyclerView.addItemDecoration( + RecyclerViewItemOffsets(0, 7, 0, 7) ) } @@ -87,9 +87,9 @@ //接单状态处理 operationViewModel.loadState.observe(this) { when (it) { - is LoadState.Loading -> LoadingDialogHub.show(requireActivity(), "接单中,请稍后") + is LoadState.Loading -> LoadingDialog.show(requireActivity(), "接单中,请稍后") is LoadState.Success -> { - LoadingDialogHub.dismiss() + LoadingDialog.dismiss() //接单成功之后刷新列表 dataBeans.removeAt(clickedPosition) notProcessedAdapter.notifyItemRemoved(clickedPosition) @@ -98,7 +98,7 @@ ) } - else -> LoadingDialogHub.dismiss() + else -> LoadingDialog.dismiss() } } } @@ -131,7 +131,7 @@ } else { binding.emptyInclude.emptyView.hide() notProcessedAdapter = OrderNotProcessedAdapter(requireContext(), dataBeans) - binding.notProcessedView.adapter = notProcessedAdapter + binding.recyclerView.adapter = notProcessedAdapter notProcessedAdapter.setOnItemClickListener(object : OrderNotProcessedAdapter.OnItemClickListener { override fun onClicked(position: Int) { diff --git a/app/src/main/java/com/casic/app/smartwell/fragment/OvertimeNotAcceptFragment.kt b/app/src/main/java/com/casic/app/smartwell/fragment/OvertimeNotAcceptFragment.kt index a198545..9b318ca 100644 --- a/app/src/main/java/com/casic/app/smartwell/fragment/OvertimeNotAcceptFragment.kt +++ b/app/src/main/java/com/casic/app/smartwell/fragment/OvertimeNotAcceptFragment.kt @@ -18,7 +18,7 @@ import com.pengxh.kt.lite.extensions.navigatePageTo import com.pengxh.kt.lite.extensions.show import com.pengxh.kt.lite.utils.LoadState -import com.pengxh.kt.lite.utils.LoadingDialogHub +import com.pengxh.kt.lite.utils.LoadingDialog import com.pengxh.kt.lite.utils.WeakReferenceHandler import com.pengxh.kt.lite.widget.dialog.AlertControlDialog @@ -81,8 +81,8 @@ operationViewModel = ViewModelProvider(this)[OperationViewModel::class.java] - binding.notProcessedView.addItemDecoration( - RecyclerViewItemOffsets(0, 5, 0, 5) + binding.recyclerView.addItemDecoration( + RecyclerViewItemOffsets(0, 7, 0, 7) ) } @@ -90,9 +90,9 @@ //接单状态处理 operationViewModel.loadState.observe(this) { when (it) { - is LoadState.Loading -> LoadingDialogHub.show(requireActivity(), "接单中,请稍后") + is LoadState.Loading -> LoadingDialog.show(requireActivity(), "接单中,请稍后") is LoadState.Success -> { - LoadingDialogHub.dismiss() + LoadingDialog.dismiss() //接单成功之后刷新列表 dataBeans.removeAt(clickedPosition) notProcessedAdapter.notifyItemRemoved(clickedPosition) @@ -101,7 +101,7 @@ ) } - else -> LoadingDialogHub.dismiss() + else -> LoadingDialog.dismiss() } } } @@ -134,7 +134,7 @@ } else { binding.emptyInclude.emptyView.hide() notProcessedAdapter = OrderNotProcessedAdapter(requireContext(), dataBeans) - binding.notProcessedView.adapter = notProcessedAdapter + binding.recyclerView.adapter = notProcessedAdapter notProcessedAdapter.setOnItemClickListener(object : OrderNotProcessedAdapter.OnItemClickListener { override fun onClicked(position: Int) { diff --git a/app/build.gradle b/app/build.gradle index 296fb6f..c18c251 100644 --- a/app/build.gradle +++ b/app/build.gradle @@ -40,10 +40,6 @@ // VIVO 相关应用参数 VIVO_APP_ID : "105749048", VIVO_APP_KEY : "e460fbf2c689e0f8c58ecc6aa62e1803", - - // 小米相关应用参数 -// XIAOMI_APP_ID : "", -// XIAOMI_APP_KEY : "", ] // 版本名后面添加一句话,意思就是flavor dimension 它的维度就是该版本号,多渠道打包很重要 @@ -107,7 +103,7 @@ dependencies { implementation fileTree(dir: 'libs', include: ['*.jar']) //基础依赖库 - implementation 'com.github.AndroidCoderPeng:Kotlin-lite-lib:1.0.10' + implementation 'com.github.AndroidCoderPeng:Kotlin-lite-lib:1.1.0' implementation 'androidx.appcompat:appcompat:1.6.1' implementation 'androidx.core:core-ktx:1.9.0' implementation 'androidx.constraintlayout:constraintlayout:2.1.4' @@ -165,8 +161,6 @@ implementation 'commons-codec:commons-codec:1.15' implementation 'com.android.support:support-annotations:28.0.0' implementation 'com.assist-v3:vivo:3.1.2' // vivo -// implementation 'com.getui.opt:xmp:3.3.1' // 小米 - //数据库框架 implementation 'org.greenrobot:greendao:3.3.0' //数据库升级 diff --git a/app/src/main/AndroidManifest.xml b/app/src/main/AndroidManifest.xml index c0af158..e0519bf 100644 --- a/app/src/main/AndroidManifest.xml +++ b/app/src/main/AndroidManifest.xml @@ -90,10 +90,10 @@ - + + android:value="ee96d8b5e12de3fbb29949efd57418a8" /> () @@ -150,7 +158,7 @@ val cameraPosition = CameraPosition(centerLatLng, 14f, 0f, 0f) val cameraUpdate = CameraUpdateFactory.newCameraPosition(cameraPosition) withContext(Dispatchers.Main) { - LoadingDialogHub.dismiss() + LoadingDialog.dismiss() aMap.animateCamera(cameraUpdate, 1500, null) } } @@ -239,11 +247,6 @@ } override fun initEvent() { - binding.rightOptionView.setOnClickListener { - val x = binding.rightOptionView.width - easyPopupWindow.width - easyPopupWindow.showAsDropDown(binding.rightOptionView, x, 0) - } - //撤防点位 binding.unDeployedLayout.setOnClickListener { requireContext().navigatePageTo() @@ -263,11 +266,11 @@ override fun observeRequestState() { wellViewModel.loadState.observe(this) { when (it) { - is LoadState.Loading -> LoadingDialogHub.show( + is LoadState.Loading -> LoadingDialog.show( requireActivity(), "数据加载中,请稍后..." ) - else -> LoadingDialogHub.dismiss() + else -> LoadingDialog.dismiss() } } } @@ -376,7 +379,7 @@ }).build().show() } }) - infoPopup.showAsDropDown(binding.rightOptionView) +// infoPopup.showAsDropDown(binding.rightOptionView) } override fun onCameraChange(p0: CameraPosition?) { diff --git a/app/src/main/java/com/casic/app/smartwell/fragment/HomePageNoClusterFragment.kt b/app/src/main/java/com/casic/app/smartwell/fragment/HomePageNoClusterFragment.kt index 802426a..b25f743 100644 --- a/app/src/main/java/com/casic/app/smartwell/fragment/HomePageNoClusterFragment.kt +++ b/app/src/main/java/com/casic/app/smartwell/fragment/HomePageNoClusterFragment.kt @@ -38,8 +38,9 @@ import com.pengxh.kt.lite.extensions.navigatePageTo import com.pengxh.kt.lite.extensions.show import com.pengxh.kt.lite.utils.LoadState -import com.pengxh.kt.lite.utils.LoadingDialogHub +import com.pengxh.kt.lite.utils.LoadingDialog import com.pengxh.kt.lite.widget.EasyPopupWindow +import com.pengxh.kt.lite.widget.TitleBarView import com.pengxh.kt.lite.widget.dialog.AlertControlDialog import kotlinx.coroutines.Dispatchers import kotlinx.coroutines.launch @@ -78,7 +79,15 @@ override fun setupTopBarLayout() { binding.rootView.initImmersionBar(this, false, R.color.mainThemeColor) - binding.titleView.text = "首页" + binding.titleView.setOnClickListener(object : TitleBarView.OnClickListener { + override fun onLeftClick() { + + } + + override fun onRightClick() { + easyPopupWindow.showAsDropDown(binding.titleView, binding.titleView.width, 0) + } + }) } override fun initOnCreate(savedInstanceState: Bundle?) { @@ -112,7 +121,7 @@ //渲染井位置 lifecycleScope.launch(Dispatchers.Main) { - LoadingDialogHub.show(requireActivity(), "数据加载中,请稍后") + LoadingDialog.show(requireActivity(), "数据加载中,请稍后") withContext(Dispatchers.IO) { //取Well缓存 val allMarkerOptions = ArrayList() @@ -144,7 +153,7 @@ val cameraPosition = CameraPosition(centerLatLng, 14f, 0f, 0f) val cameraUpdate = CameraUpdateFactory.newCameraPosition(cameraPosition) withContext(Dispatchers.Main) { - LoadingDialogHub.dismiss() + LoadingDialog.dismiss() aMap.animateCamera(cameraUpdate, 1500, null) } } @@ -238,11 +247,6 @@ } override fun initEvent() { - binding.rightOptionView.setOnClickListener { - val x = binding.rightOptionView.width - easyPopupWindow.width - easyPopupWindow.showAsDropDown(binding.rightOptionView, x, 0) - } - //撤防点位 binding.unDeployedLayout.setOnClickListener { requireContext().navigatePageTo() @@ -262,11 +266,11 @@ override fun observeRequestState() { wellViewModel.loadState.observe(this) { when (it) { - is LoadState.Loading -> LoadingDialogHub.show( + is LoadState.Loading -> LoadingDialog.show( requireActivity(), "数据加载中,请稍后..." ) - else -> LoadingDialogHub.dismiss() + else -> LoadingDialog.dismiss() } } } diff --git a/app/src/main/java/com/casic/app/smartwell/fragment/MinePageFragment.kt b/app/src/main/java/com/casic/app/smartwell/fragment/MinePageFragment.kt index 09a570c..dcb48f8 100644 --- a/app/src/main/java/com/casic/app/smartwell/fragment/MinePageFragment.kt +++ b/app/src/main/java/com/casic/app/smartwell/fragment/MinePageFragment.kt @@ -35,7 +35,7 @@ import com.pengxh.kt.lite.utils.ActivityStackManager import com.pengxh.kt.lite.utils.FileDownloadManager import com.pengxh.kt.lite.utils.LoadState -import com.pengxh.kt.lite.utils.LoadingDialogHub +import com.pengxh.kt.lite.utils.LoadingDialog import com.pengxh.kt.lite.widget.dialog.AlertControlDialog import com.pengxh.kt.lite.widget.dialog.BottomActionSheet import kotlinx.coroutines.Dispatchers @@ -60,7 +60,6 @@ override fun setupTopBarLayout() { binding.rootView.initImmersionBar(this, false, R.color.mainThemeColor) - binding.titleInclude.titleView.text = "我的" } override fun initOnCreate(savedInstanceState: Bundle?) { @@ -155,27 +154,27 @@ override fun observeRequestState() { userViewModel.loadState.observe(this) { when (it) { - is LoadState.Loading -> LoadingDialogHub.show( + is LoadState.Loading -> LoadingDialog.show( requireActivity(), "检查版本中,请稍后" ) - else -> LoadingDialogHub.dismiss() + else -> LoadingDialog.dismiss() } } wellViewModel.loadState.observe(this) { when (it) { - is LoadState.Loading -> LoadingDialogHub.show( + is LoadState.Loading -> LoadingDialog.show( requireActivity(), "数据更新中,请稍后" ) is LoadState.Fail -> { - LoadingDialogHub.dismiss() + LoadingDialog.dismiss() "数据更新超时".show(requireContext()) } else -> { - LoadingDialogHub.dismiss() + LoadingDialog.dismiss() AlertControlDialog.Builder().setContext(requireContext()).setTitle("温馨提示") .setMessage("数据更新成功,请重启应用").setNegativeButton("取消") .setPositiveButton("确定").setOnDialogButtonClickListener(object : @@ -197,17 +196,17 @@ lineViewModel.loadState.observe(this) { when (it) { - is LoadState.Loading -> LoadingDialogHub.show( + is LoadState.Loading -> LoadingDialog.show( requireActivity(), "数据更新中,请稍后" ) is LoadState.Fail -> { - LoadingDialogHub.dismiss() + LoadingDialog.dismiss() "数据更新超时".show(requireContext()) } else -> { - LoadingDialogHub.dismiss() + LoadingDialog.dismiss() AlertControlDialog.Builder().setContext(requireContext()).setTitle("温馨提示") .setMessage("数据更新成功,请重启应用").setNegativeButton("取消") .setPositiveButton("确定").setOnDialogButtonClickListener(object : diff --git a/app/src/main/java/com/casic/app/smartwell/fragment/NoticePageFragment.kt b/app/src/main/java/com/casic/app/smartwell/fragment/NoticePageFragment.kt index 171b555..3c93f54 100644 --- a/app/src/main/java/com/casic/app/smartwell/fragment/NoticePageFragment.kt +++ b/app/src/main/java/com/casic/app/smartwell/fragment/NoticePageFragment.kt @@ -48,7 +48,6 @@ override fun setupTopBarLayout() { binding.rootView.initImmersionBar(this, false, R.color.mainThemeColor) - binding.titleInclude.titleView.text = "消息" } override fun initOnCreate(savedInstanceState: Bundle?) { diff --git a/app/src/main/java/com/casic/app/smartwell/fragment/OrderListFragment.kt b/app/src/main/java/com/casic/app/smartwell/fragment/OrderListFragment.kt index 93ff35b..5e38acb 100644 --- a/app/src/main/java/com/casic/app/smartwell/fragment/OrderListFragment.kt +++ b/app/src/main/java/com/casic/app/smartwell/fragment/OrderListFragment.kt @@ -12,6 +12,7 @@ import com.casic.app.smartwell.view.SearchOrderActivity import com.pengxh.kt.lite.base.KotlinBaseFragment import com.pengxh.kt.lite.extensions.navigatePageTo +import com.pengxh.kt.lite.widget.TitleBarView class OrderListFragment : KotlinBaseFragment() { @@ -25,15 +26,22 @@ } override fun initViewBinding( - inflater: LayoutInflater, - container: ViewGroup? + inflater: LayoutInflater, container: ViewGroup? ): FragmentOrderBinding { return FragmentOrderBinding.inflate(inflater, container, false) } override fun setupTopBarLayout() { binding.rootView.initImmersionBar(this, false, R.color.mainThemeColor) - binding.titleView.text = "工单" + binding.titleView.setOnClickListener(object : TitleBarView.OnClickListener { + override fun onLeftClick() { + + } + + override fun onRightClick() { + requireContext().navigatePageTo() + } + }) } override fun initOnCreate(savedInstanceState: Bundle?) { @@ -51,8 +59,6 @@ } override fun initEvent() { - binding.rightOptionView.setOnClickListener { - requireContext().navigatePageTo() - } + } } \ No newline at end of file diff --git a/app/src/main/java/com/casic/app/smartwell/fragment/OrderNotProcessedFragment.kt b/app/src/main/java/com/casic/app/smartwell/fragment/OrderNotProcessedFragment.kt index 0b3d09d..2b6f21d 100644 --- a/app/src/main/java/com/casic/app/smartwell/fragment/OrderNotProcessedFragment.kt +++ b/app/src/main/java/com/casic/app/smartwell/fragment/OrderNotProcessedFragment.kt @@ -18,7 +18,7 @@ import com.pengxh.kt.lite.extensions.navigatePageTo import com.pengxh.kt.lite.extensions.show import com.pengxh.kt.lite.utils.LoadState -import com.pengxh.kt.lite.utils.LoadingDialogHub +import com.pengxh.kt.lite.utils.LoadingDialog import com.pengxh.kt.lite.utils.WeakReferenceHandler import com.pengxh.kt.lite.widget.dialog.AlertControlDialog @@ -78,8 +78,8 @@ operationViewModel = ViewModelProvider(this)[OperationViewModel::class.java] - binding.notProcessedView.addItemDecoration( - RecyclerViewItemOffsets(0, 5, 0, 5) + binding.recyclerView.addItemDecoration( + RecyclerViewItemOffsets(0, 7, 0, 7) ) } @@ -87,9 +87,9 @@ //接单状态处理 operationViewModel.loadState.observe(this) { when (it) { - is LoadState.Loading -> LoadingDialogHub.show(requireActivity(), "接单中,请稍后") + is LoadState.Loading -> LoadingDialog.show(requireActivity(), "接单中,请稍后") is LoadState.Success -> { - LoadingDialogHub.dismiss() + LoadingDialog.dismiss() //接单成功之后刷新列表 dataBeans.removeAt(clickedPosition) notProcessedAdapter.notifyItemRemoved(clickedPosition) @@ -98,7 +98,7 @@ ) } - else -> LoadingDialogHub.dismiss() + else -> LoadingDialog.dismiss() } } } @@ -131,7 +131,7 @@ } else { binding.emptyInclude.emptyView.hide() notProcessedAdapter = OrderNotProcessedAdapter(requireContext(), dataBeans) - binding.notProcessedView.adapter = notProcessedAdapter + binding.recyclerView.adapter = notProcessedAdapter notProcessedAdapter.setOnItemClickListener(object : OrderNotProcessedAdapter.OnItemClickListener { override fun onClicked(position: Int) { diff --git a/app/src/main/java/com/casic/app/smartwell/fragment/OvertimeNotAcceptFragment.kt b/app/src/main/java/com/casic/app/smartwell/fragment/OvertimeNotAcceptFragment.kt index a198545..9b318ca 100644 --- a/app/src/main/java/com/casic/app/smartwell/fragment/OvertimeNotAcceptFragment.kt +++ b/app/src/main/java/com/casic/app/smartwell/fragment/OvertimeNotAcceptFragment.kt @@ -18,7 +18,7 @@ import com.pengxh.kt.lite.extensions.navigatePageTo import com.pengxh.kt.lite.extensions.show import com.pengxh.kt.lite.utils.LoadState -import com.pengxh.kt.lite.utils.LoadingDialogHub +import com.pengxh.kt.lite.utils.LoadingDialog import com.pengxh.kt.lite.utils.WeakReferenceHandler import com.pengxh.kt.lite.widget.dialog.AlertControlDialog @@ -81,8 +81,8 @@ operationViewModel = ViewModelProvider(this)[OperationViewModel::class.java] - binding.notProcessedView.addItemDecoration( - RecyclerViewItemOffsets(0, 5, 0, 5) + binding.recyclerView.addItemDecoration( + RecyclerViewItemOffsets(0, 7, 0, 7) ) } @@ -90,9 +90,9 @@ //接单状态处理 operationViewModel.loadState.observe(this) { when (it) { - is LoadState.Loading -> LoadingDialogHub.show(requireActivity(), "接单中,请稍后") + is LoadState.Loading -> LoadingDialog.show(requireActivity(), "接单中,请稍后") is LoadState.Success -> { - LoadingDialogHub.dismiss() + LoadingDialog.dismiss() //接单成功之后刷新列表 dataBeans.removeAt(clickedPosition) notProcessedAdapter.notifyItemRemoved(clickedPosition) @@ -101,7 +101,7 @@ ) } - else -> LoadingDialogHub.dismiss() + else -> LoadingDialog.dismiss() } } } @@ -134,7 +134,7 @@ } else { binding.emptyInclude.emptyView.hide() notProcessedAdapter = OrderNotProcessedAdapter(requireContext(), dataBeans) - binding.notProcessedView.adapter = notProcessedAdapter + binding.recyclerView.adapter = notProcessedAdapter notProcessedAdapter.setOnItemClickListener(object : OrderNotProcessedAdapter.OnItemClickListener { override fun onClicked(position: Int) { diff --git a/app/src/main/java/com/casic/app/smartwell/greendao/DaoMaster.java b/app/src/main/java/com/casic/app/smartwell/greendao/DaoMaster.java index fdcf3a7..1e52b74 100644 --- a/app/src/main/java/com/casic/app/smartwell/greendao/DaoMaster.java +++ b/app/src/main/java/com/casic/app/smartwell/greendao/DaoMaster.java @@ -13,25 +13,20 @@ // THIS CODE IS GENERATED BY greenDAO, DO NOT EDIT. - /** * Master of DAO (schema version 4): knows all DAOs. */ public class DaoMaster extends AbstractDaoMaster { public static final int SCHEMA_VERSION = 4; - /** - * Creates underlying database table using DAOs. - */ + /** Creates underlying database table using DAOs. */ public static void createAllTables(Database db, boolean ifNotExists) { MapWellLocalBeanDao.createTable(db, ifNotExists); NoticeLocaleBeanDao.createTable(db, ifNotExists); PipeLocalBeanDao.createTable(db, ifNotExists); } - /** - * Drops underlying database table using DAOs. - */ + /** Drops underlying database table using DAOs. */ public static void dropAllTables(Database db, boolean ifExists) { MapWellLocalBeanDao.dropTable(db, ifExists); NoticeLocaleBeanDao.dropTable(db, ifExists); @@ -86,9 +81,7 @@ } } - /** - * WARNING: Drops all table on Upgrade! Use only during development. - */ + /** WARNING: Drops all table on Upgrade! Use only during development. */ public static class DevOpenHelper extends OpenHelper { public DevOpenHelper(Context context, String name) { super(context, name); diff --git a/app/build.gradle b/app/build.gradle index 296fb6f..c18c251 100644 --- a/app/build.gradle +++ b/app/build.gradle @@ -40,10 +40,6 @@ // VIVO 相关应用参数 VIVO_APP_ID : "105749048", VIVO_APP_KEY : "e460fbf2c689e0f8c58ecc6aa62e1803", - - // 小米相关应用参数 -// XIAOMI_APP_ID : "", -// XIAOMI_APP_KEY : "", ] // 版本名后面添加一句话,意思就是flavor dimension 它的维度就是该版本号,多渠道打包很重要 @@ -107,7 +103,7 @@ dependencies { implementation fileTree(dir: 'libs', include: ['*.jar']) //基础依赖库 - implementation 'com.github.AndroidCoderPeng:Kotlin-lite-lib:1.0.10' + implementation 'com.github.AndroidCoderPeng:Kotlin-lite-lib:1.1.0' implementation 'androidx.appcompat:appcompat:1.6.1' implementation 'androidx.core:core-ktx:1.9.0' implementation 'androidx.constraintlayout:constraintlayout:2.1.4' @@ -165,8 +161,6 @@ implementation 'commons-codec:commons-codec:1.15' implementation 'com.android.support:support-annotations:28.0.0' implementation 'com.assist-v3:vivo:3.1.2' // vivo -// implementation 'com.getui.opt:xmp:3.3.1' // 小米 - //数据库框架 implementation 'org.greenrobot:greendao:3.3.0' //数据库升级 diff --git a/app/src/main/AndroidManifest.xml b/app/src/main/AndroidManifest.xml index c0af158..e0519bf 100644 --- a/app/src/main/AndroidManifest.xml +++ b/app/src/main/AndroidManifest.xml @@ -90,10 +90,10 @@ - + + android:value="ee96d8b5e12de3fbb29949efd57418a8" /> () @@ -150,7 +158,7 @@ val cameraPosition = CameraPosition(centerLatLng, 14f, 0f, 0f) val cameraUpdate = CameraUpdateFactory.newCameraPosition(cameraPosition) withContext(Dispatchers.Main) { - LoadingDialogHub.dismiss() + LoadingDialog.dismiss() aMap.animateCamera(cameraUpdate, 1500, null) } } @@ -239,11 +247,6 @@ } override fun initEvent() { - binding.rightOptionView.setOnClickListener { - val x = binding.rightOptionView.width - easyPopupWindow.width - easyPopupWindow.showAsDropDown(binding.rightOptionView, x, 0) - } - //撤防点位 binding.unDeployedLayout.setOnClickListener { requireContext().navigatePageTo() @@ -263,11 +266,11 @@ override fun observeRequestState() { wellViewModel.loadState.observe(this) { when (it) { - is LoadState.Loading -> LoadingDialogHub.show( + is LoadState.Loading -> LoadingDialog.show( requireActivity(), "数据加载中,请稍后..." ) - else -> LoadingDialogHub.dismiss() + else -> LoadingDialog.dismiss() } } } @@ -376,7 +379,7 @@ }).build().show() } }) - infoPopup.showAsDropDown(binding.rightOptionView) +// infoPopup.showAsDropDown(binding.rightOptionView) } override fun onCameraChange(p0: CameraPosition?) { diff --git a/app/src/main/java/com/casic/app/smartwell/fragment/HomePageNoClusterFragment.kt b/app/src/main/java/com/casic/app/smartwell/fragment/HomePageNoClusterFragment.kt index 802426a..b25f743 100644 --- a/app/src/main/java/com/casic/app/smartwell/fragment/HomePageNoClusterFragment.kt +++ b/app/src/main/java/com/casic/app/smartwell/fragment/HomePageNoClusterFragment.kt @@ -38,8 +38,9 @@ import com.pengxh.kt.lite.extensions.navigatePageTo import com.pengxh.kt.lite.extensions.show import com.pengxh.kt.lite.utils.LoadState -import com.pengxh.kt.lite.utils.LoadingDialogHub +import com.pengxh.kt.lite.utils.LoadingDialog import com.pengxh.kt.lite.widget.EasyPopupWindow +import com.pengxh.kt.lite.widget.TitleBarView import com.pengxh.kt.lite.widget.dialog.AlertControlDialog import kotlinx.coroutines.Dispatchers import kotlinx.coroutines.launch @@ -78,7 +79,15 @@ override fun setupTopBarLayout() { binding.rootView.initImmersionBar(this, false, R.color.mainThemeColor) - binding.titleView.text = "首页" + binding.titleView.setOnClickListener(object : TitleBarView.OnClickListener { + override fun onLeftClick() { + + } + + override fun onRightClick() { + easyPopupWindow.showAsDropDown(binding.titleView, binding.titleView.width, 0) + } + }) } override fun initOnCreate(savedInstanceState: Bundle?) { @@ -112,7 +121,7 @@ //渲染井位置 lifecycleScope.launch(Dispatchers.Main) { - LoadingDialogHub.show(requireActivity(), "数据加载中,请稍后") + LoadingDialog.show(requireActivity(), "数据加载中,请稍后") withContext(Dispatchers.IO) { //取Well缓存 val allMarkerOptions = ArrayList() @@ -144,7 +153,7 @@ val cameraPosition = CameraPosition(centerLatLng, 14f, 0f, 0f) val cameraUpdate = CameraUpdateFactory.newCameraPosition(cameraPosition) withContext(Dispatchers.Main) { - LoadingDialogHub.dismiss() + LoadingDialog.dismiss() aMap.animateCamera(cameraUpdate, 1500, null) } } @@ -238,11 +247,6 @@ } override fun initEvent() { - binding.rightOptionView.setOnClickListener { - val x = binding.rightOptionView.width - easyPopupWindow.width - easyPopupWindow.showAsDropDown(binding.rightOptionView, x, 0) - } - //撤防点位 binding.unDeployedLayout.setOnClickListener { requireContext().navigatePageTo() @@ -262,11 +266,11 @@ override fun observeRequestState() { wellViewModel.loadState.observe(this) { when (it) { - is LoadState.Loading -> LoadingDialogHub.show( + is LoadState.Loading -> LoadingDialog.show( requireActivity(), "数据加载中,请稍后..." ) - else -> LoadingDialogHub.dismiss() + else -> LoadingDialog.dismiss() } } } diff --git a/app/src/main/java/com/casic/app/smartwell/fragment/MinePageFragment.kt b/app/src/main/java/com/casic/app/smartwell/fragment/MinePageFragment.kt index 09a570c..dcb48f8 100644 --- a/app/src/main/java/com/casic/app/smartwell/fragment/MinePageFragment.kt +++ b/app/src/main/java/com/casic/app/smartwell/fragment/MinePageFragment.kt @@ -35,7 +35,7 @@ import com.pengxh.kt.lite.utils.ActivityStackManager import com.pengxh.kt.lite.utils.FileDownloadManager import com.pengxh.kt.lite.utils.LoadState -import com.pengxh.kt.lite.utils.LoadingDialogHub +import com.pengxh.kt.lite.utils.LoadingDialog import com.pengxh.kt.lite.widget.dialog.AlertControlDialog import com.pengxh.kt.lite.widget.dialog.BottomActionSheet import kotlinx.coroutines.Dispatchers @@ -60,7 +60,6 @@ override fun setupTopBarLayout() { binding.rootView.initImmersionBar(this, false, R.color.mainThemeColor) - binding.titleInclude.titleView.text = "我的" } override fun initOnCreate(savedInstanceState: Bundle?) { @@ -155,27 +154,27 @@ override fun observeRequestState() { userViewModel.loadState.observe(this) { when (it) { - is LoadState.Loading -> LoadingDialogHub.show( + is LoadState.Loading -> LoadingDialog.show( requireActivity(), "检查版本中,请稍后" ) - else -> LoadingDialogHub.dismiss() + else -> LoadingDialog.dismiss() } } wellViewModel.loadState.observe(this) { when (it) { - is LoadState.Loading -> LoadingDialogHub.show( + is LoadState.Loading -> LoadingDialog.show( requireActivity(), "数据更新中,请稍后" ) is LoadState.Fail -> { - LoadingDialogHub.dismiss() + LoadingDialog.dismiss() "数据更新超时".show(requireContext()) } else -> { - LoadingDialogHub.dismiss() + LoadingDialog.dismiss() AlertControlDialog.Builder().setContext(requireContext()).setTitle("温馨提示") .setMessage("数据更新成功,请重启应用").setNegativeButton("取消") .setPositiveButton("确定").setOnDialogButtonClickListener(object : @@ -197,17 +196,17 @@ lineViewModel.loadState.observe(this) { when (it) { - is LoadState.Loading -> LoadingDialogHub.show( + is LoadState.Loading -> LoadingDialog.show( requireActivity(), "数据更新中,请稍后" ) is LoadState.Fail -> { - LoadingDialogHub.dismiss() + LoadingDialog.dismiss() "数据更新超时".show(requireContext()) } else -> { - LoadingDialogHub.dismiss() + LoadingDialog.dismiss() AlertControlDialog.Builder().setContext(requireContext()).setTitle("温馨提示") .setMessage("数据更新成功,请重启应用").setNegativeButton("取消") .setPositiveButton("确定").setOnDialogButtonClickListener(object : diff --git a/app/src/main/java/com/casic/app/smartwell/fragment/NoticePageFragment.kt b/app/src/main/java/com/casic/app/smartwell/fragment/NoticePageFragment.kt index 171b555..3c93f54 100644 --- a/app/src/main/java/com/casic/app/smartwell/fragment/NoticePageFragment.kt +++ b/app/src/main/java/com/casic/app/smartwell/fragment/NoticePageFragment.kt @@ -48,7 +48,6 @@ override fun setupTopBarLayout() { binding.rootView.initImmersionBar(this, false, R.color.mainThemeColor) - binding.titleInclude.titleView.text = "消息" } override fun initOnCreate(savedInstanceState: Bundle?) { diff --git a/app/src/main/java/com/casic/app/smartwell/fragment/OrderListFragment.kt b/app/src/main/java/com/casic/app/smartwell/fragment/OrderListFragment.kt index 93ff35b..5e38acb 100644 --- a/app/src/main/java/com/casic/app/smartwell/fragment/OrderListFragment.kt +++ b/app/src/main/java/com/casic/app/smartwell/fragment/OrderListFragment.kt @@ -12,6 +12,7 @@ import com.casic.app.smartwell.view.SearchOrderActivity import com.pengxh.kt.lite.base.KotlinBaseFragment import com.pengxh.kt.lite.extensions.navigatePageTo +import com.pengxh.kt.lite.widget.TitleBarView class OrderListFragment : KotlinBaseFragment() { @@ -25,15 +26,22 @@ } override fun initViewBinding( - inflater: LayoutInflater, - container: ViewGroup? + inflater: LayoutInflater, container: ViewGroup? ): FragmentOrderBinding { return FragmentOrderBinding.inflate(inflater, container, false) } override fun setupTopBarLayout() { binding.rootView.initImmersionBar(this, false, R.color.mainThemeColor) - binding.titleView.text = "工单" + binding.titleView.setOnClickListener(object : TitleBarView.OnClickListener { + override fun onLeftClick() { + + } + + override fun onRightClick() { + requireContext().navigatePageTo() + } + }) } override fun initOnCreate(savedInstanceState: Bundle?) { @@ -51,8 +59,6 @@ } override fun initEvent() { - binding.rightOptionView.setOnClickListener { - requireContext().navigatePageTo() - } + } } \ No newline at end of file diff --git a/app/src/main/java/com/casic/app/smartwell/fragment/OrderNotProcessedFragment.kt b/app/src/main/java/com/casic/app/smartwell/fragment/OrderNotProcessedFragment.kt index 0b3d09d..2b6f21d 100644 --- a/app/src/main/java/com/casic/app/smartwell/fragment/OrderNotProcessedFragment.kt +++ b/app/src/main/java/com/casic/app/smartwell/fragment/OrderNotProcessedFragment.kt @@ -18,7 +18,7 @@ import com.pengxh.kt.lite.extensions.navigatePageTo import com.pengxh.kt.lite.extensions.show import com.pengxh.kt.lite.utils.LoadState -import com.pengxh.kt.lite.utils.LoadingDialogHub +import com.pengxh.kt.lite.utils.LoadingDialog import com.pengxh.kt.lite.utils.WeakReferenceHandler import com.pengxh.kt.lite.widget.dialog.AlertControlDialog @@ -78,8 +78,8 @@ operationViewModel = ViewModelProvider(this)[OperationViewModel::class.java] - binding.notProcessedView.addItemDecoration( - RecyclerViewItemOffsets(0, 5, 0, 5) + binding.recyclerView.addItemDecoration( + RecyclerViewItemOffsets(0, 7, 0, 7) ) } @@ -87,9 +87,9 @@ //接单状态处理 operationViewModel.loadState.observe(this) { when (it) { - is LoadState.Loading -> LoadingDialogHub.show(requireActivity(), "接单中,请稍后") + is LoadState.Loading -> LoadingDialog.show(requireActivity(), "接单中,请稍后") is LoadState.Success -> { - LoadingDialogHub.dismiss() + LoadingDialog.dismiss() //接单成功之后刷新列表 dataBeans.removeAt(clickedPosition) notProcessedAdapter.notifyItemRemoved(clickedPosition) @@ -98,7 +98,7 @@ ) } - else -> LoadingDialogHub.dismiss() + else -> LoadingDialog.dismiss() } } } @@ -131,7 +131,7 @@ } else { binding.emptyInclude.emptyView.hide() notProcessedAdapter = OrderNotProcessedAdapter(requireContext(), dataBeans) - binding.notProcessedView.adapter = notProcessedAdapter + binding.recyclerView.adapter = notProcessedAdapter notProcessedAdapter.setOnItemClickListener(object : OrderNotProcessedAdapter.OnItemClickListener { override fun onClicked(position: Int) { diff --git a/app/src/main/java/com/casic/app/smartwell/fragment/OvertimeNotAcceptFragment.kt b/app/src/main/java/com/casic/app/smartwell/fragment/OvertimeNotAcceptFragment.kt index a198545..9b318ca 100644 --- a/app/src/main/java/com/casic/app/smartwell/fragment/OvertimeNotAcceptFragment.kt +++ b/app/src/main/java/com/casic/app/smartwell/fragment/OvertimeNotAcceptFragment.kt @@ -18,7 +18,7 @@ import com.pengxh.kt.lite.extensions.navigatePageTo import com.pengxh.kt.lite.extensions.show import com.pengxh.kt.lite.utils.LoadState -import com.pengxh.kt.lite.utils.LoadingDialogHub +import com.pengxh.kt.lite.utils.LoadingDialog import com.pengxh.kt.lite.utils.WeakReferenceHandler import com.pengxh.kt.lite.widget.dialog.AlertControlDialog @@ -81,8 +81,8 @@ operationViewModel = ViewModelProvider(this)[OperationViewModel::class.java] - binding.notProcessedView.addItemDecoration( - RecyclerViewItemOffsets(0, 5, 0, 5) + binding.recyclerView.addItemDecoration( + RecyclerViewItemOffsets(0, 7, 0, 7) ) } @@ -90,9 +90,9 @@ //接单状态处理 operationViewModel.loadState.observe(this) { when (it) { - is LoadState.Loading -> LoadingDialogHub.show(requireActivity(), "接单中,请稍后") + is LoadState.Loading -> LoadingDialog.show(requireActivity(), "接单中,请稍后") is LoadState.Success -> { - LoadingDialogHub.dismiss() + LoadingDialog.dismiss() //接单成功之后刷新列表 dataBeans.removeAt(clickedPosition) notProcessedAdapter.notifyItemRemoved(clickedPosition) @@ -101,7 +101,7 @@ ) } - else -> LoadingDialogHub.dismiss() + else -> LoadingDialog.dismiss() } } } @@ -134,7 +134,7 @@ } else { binding.emptyInclude.emptyView.hide() notProcessedAdapter = OrderNotProcessedAdapter(requireContext(), dataBeans) - binding.notProcessedView.adapter = notProcessedAdapter + binding.recyclerView.adapter = notProcessedAdapter notProcessedAdapter.setOnItemClickListener(object : OrderNotProcessedAdapter.OnItemClickListener { override fun onClicked(position: Int) { diff --git a/app/src/main/java/com/casic/app/smartwell/greendao/DaoMaster.java b/app/src/main/java/com/casic/app/smartwell/greendao/DaoMaster.java index fdcf3a7..1e52b74 100644 --- a/app/src/main/java/com/casic/app/smartwell/greendao/DaoMaster.java +++ b/app/src/main/java/com/casic/app/smartwell/greendao/DaoMaster.java @@ -13,25 +13,20 @@ // THIS CODE IS GENERATED BY greenDAO, DO NOT EDIT. - /** * Master of DAO (schema version 4): knows all DAOs. */ public class DaoMaster extends AbstractDaoMaster { public static final int SCHEMA_VERSION = 4; - /** - * Creates underlying database table using DAOs. - */ + /** Creates underlying database table using DAOs. */ public static void createAllTables(Database db, boolean ifNotExists) { MapWellLocalBeanDao.createTable(db, ifNotExists); NoticeLocaleBeanDao.createTable(db, ifNotExists); PipeLocalBeanDao.createTable(db, ifNotExists); } - /** - * Drops underlying database table using DAOs. - */ + /** Drops underlying database table using DAOs. */ public static void dropAllTables(Database db, boolean ifExists) { MapWellLocalBeanDao.dropTable(db, ifExists); NoticeLocaleBeanDao.dropTable(db, ifExists); @@ -86,9 +81,7 @@ } } - /** - * WARNING: Drops all table on Upgrade! Use only during development. - */ + /** WARNING: Drops all table on Upgrade! Use only during development. */ public static class DevOpenHelper extends OpenHelper { public DevOpenHelper(Context context, String name) { super(context, name); diff --git a/app/src/main/java/com/casic/app/smartwell/greendao/DaoSession.java b/app/src/main/java/com/casic/app/smartwell/greendao/DaoSession.java index 0b36d17..3e40e3b 100644 --- a/app/src/main/java/com/casic/app/smartwell/greendao/DaoSession.java +++ b/app/src/main/java/com/casic/app/smartwell/greendao/DaoSession.java @@ -16,7 +16,7 @@ /** * {@inheritDoc} - * + * * @see org.greenrobot.greendao.AbstractDaoSession */ public class DaoSession extends AbstractDaoSession { @@ -50,7 +50,7 @@ registerDao(NoticeLocaleBean.class, noticeLocaleBeanDao); registerDao(PipeLocalBean.class, pipeLocalBeanDao); } - + public void clear() { mapWellLocalBeanDaoConfig.clearIdentityScope(); noticeLocaleBeanDaoConfig.clearIdentityScope(); diff --git a/app/build.gradle b/app/build.gradle index 296fb6f..c18c251 100644 --- a/app/build.gradle +++ b/app/build.gradle @@ -40,10 +40,6 @@ // VIVO 相关应用参数 VIVO_APP_ID : "105749048", VIVO_APP_KEY : "e460fbf2c689e0f8c58ecc6aa62e1803", - - // 小米相关应用参数 -// XIAOMI_APP_ID : "", -// XIAOMI_APP_KEY : "", ] // 版本名后面添加一句话,意思就是flavor dimension 它的维度就是该版本号,多渠道打包很重要 @@ -107,7 +103,7 @@ dependencies { implementation fileTree(dir: 'libs', include: ['*.jar']) //基础依赖库 - implementation 'com.github.AndroidCoderPeng:Kotlin-lite-lib:1.0.10' + implementation 'com.github.AndroidCoderPeng:Kotlin-lite-lib:1.1.0' implementation 'androidx.appcompat:appcompat:1.6.1' implementation 'androidx.core:core-ktx:1.9.0' implementation 'androidx.constraintlayout:constraintlayout:2.1.4' @@ -165,8 +161,6 @@ implementation 'commons-codec:commons-codec:1.15' implementation 'com.android.support:support-annotations:28.0.0' implementation 'com.assist-v3:vivo:3.1.2' // vivo -// implementation 'com.getui.opt:xmp:3.3.1' // 小米 - //数据库框架 implementation 'org.greenrobot:greendao:3.3.0' //数据库升级 diff --git a/app/src/main/AndroidManifest.xml b/app/src/main/AndroidManifest.xml index c0af158..e0519bf 100644 --- a/app/src/main/AndroidManifest.xml +++ b/app/src/main/AndroidManifest.xml @@ -90,10 +90,10 @@ - + + android:value="ee96d8b5e12de3fbb29949efd57418a8" /> () @@ -150,7 +158,7 @@ val cameraPosition = CameraPosition(centerLatLng, 14f, 0f, 0f) val cameraUpdate = CameraUpdateFactory.newCameraPosition(cameraPosition) withContext(Dispatchers.Main) { - LoadingDialogHub.dismiss() + LoadingDialog.dismiss() aMap.animateCamera(cameraUpdate, 1500, null) } } @@ -239,11 +247,6 @@ } override fun initEvent() { - binding.rightOptionView.setOnClickListener { - val x = binding.rightOptionView.width - easyPopupWindow.width - easyPopupWindow.showAsDropDown(binding.rightOptionView, x, 0) - } - //撤防点位 binding.unDeployedLayout.setOnClickListener { requireContext().navigatePageTo() @@ -263,11 +266,11 @@ override fun observeRequestState() { wellViewModel.loadState.observe(this) { when (it) { - is LoadState.Loading -> LoadingDialogHub.show( + is LoadState.Loading -> LoadingDialog.show( requireActivity(), "数据加载中,请稍后..." ) - else -> LoadingDialogHub.dismiss() + else -> LoadingDialog.dismiss() } } } @@ -376,7 +379,7 @@ }).build().show() } }) - infoPopup.showAsDropDown(binding.rightOptionView) +// infoPopup.showAsDropDown(binding.rightOptionView) } override fun onCameraChange(p0: CameraPosition?) { diff --git a/app/src/main/java/com/casic/app/smartwell/fragment/HomePageNoClusterFragment.kt b/app/src/main/java/com/casic/app/smartwell/fragment/HomePageNoClusterFragment.kt index 802426a..b25f743 100644 --- a/app/src/main/java/com/casic/app/smartwell/fragment/HomePageNoClusterFragment.kt +++ b/app/src/main/java/com/casic/app/smartwell/fragment/HomePageNoClusterFragment.kt @@ -38,8 +38,9 @@ import com.pengxh.kt.lite.extensions.navigatePageTo import com.pengxh.kt.lite.extensions.show import com.pengxh.kt.lite.utils.LoadState -import com.pengxh.kt.lite.utils.LoadingDialogHub +import com.pengxh.kt.lite.utils.LoadingDialog import com.pengxh.kt.lite.widget.EasyPopupWindow +import com.pengxh.kt.lite.widget.TitleBarView import com.pengxh.kt.lite.widget.dialog.AlertControlDialog import kotlinx.coroutines.Dispatchers import kotlinx.coroutines.launch @@ -78,7 +79,15 @@ override fun setupTopBarLayout() { binding.rootView.initImmersionBar(this, false, R.color.mainThemeColor) - binding.titleView.text = "首页" + binding.titleView.setOnClickListener(object : TitleBarView.OnClickListener { + override fun onLeftClick() { + + } + + override fun onRightClick() { + easyPopupWindow.showAsDropDown(binding.titleView, binding.titleView.width, 0) + } + }) } override fun initOnCreate(savedInstanceState: Bundle?) { @@ -112,7 +121,7 @@ //渲染井位置 lifecycleScope.launch(Dispatchers.Main) { - LoadingDialogHub.show(requireActivity(), "数据加载中,请稍后") + LoadingDialog.show(requireActivity(), "数据加载中,请稍后") withContext(Dispatchers.IO) { //取Well缓存 val allMarkerOptions = ArrayList() @@ -144,7 +153,7 @@ val cameraPosition = CameraPosition(centerLatLng, 14f, 0f, 0f) val cameraUpdate = CameraUpdateFactory.newCameraPosition(cameraPosition) withContext(Dispatchers.Main) { - LoadingDialogHub.dismiss() + LoadingDialog.dismiss() aMap.animateCamera(cameraUpdate, 1500, null) } } @@ -238,11 +247,6 @@ } override fun initEvent() { - binding.rightOptionView.setOnClickListener { - val x = binding.rightOptionView.width - easyPopupWindow.width - easyPopupWindow.showAsDropDown(binding.rightOptionView, x, 0) - } - //撤防点位 binding.unDeployedLayout.setOnClickListener { requireContext().navigatePageTo() @@ -262,11 +266,11 @@ override fun observeRequestState() { wellViewModel.loadState.observe(this) { when (it) { - is LoadState.Loading -> LoadingDialogHub.show( + is LoadState.Loading -> LoadingDialog.show( requireActivity(), "数据加载中,请稍后..." ) - else -> LoadingDialogHub.dismiss() + else -> LoadingDialog.dismiss() } } } diff --git a/app/src/main/java/com/casic/app/smartwell/fragment/MinePageFragment.kt b/app/src/main/java/com/casic/app/smartwell/fragment/MinePageFragment.kt index 09a570c..dcb48f8 100644 --- a/app/src/main/java/com/casic/app/smartwell/fragment/MinePageFragment.kt +++ b/app/src/main/java/com/casic/app/smartwell/fragment/MinePageFragment.kt @@ -35,7 +35,7 @@ import com.pengxh.kt.lite.utils.ActivityStackManager import com.pengxh.kt.lite.utils.FileDownloadManager import com.pengxh.kt.lite.utils.LoadState -import com.pengxh.kt.lite.utils.LoadingDialogHub +import com.pengxh.kt.lite.utils.LoadingDialog import com.pengxh.kt.lite.widget.dialog.AlertControlDialog import com.pengxh.kt.lite.widget.dialog.BottomActionSheet import kotlinx.coroutines.Dispatchers @@ -60,7 +60,6 @@ override fun setupTopBarLayout() { binding.rootView.initImmersionBar(this, false, R.color.mainThemeColor) - binding.titleInclude.titleView.text = "我的" } override fun initOnCreate(savedInstanceState: Bundle?) { @@ -155,27 +154,27 @@ override fun observeRequestState() { userViewModel.loadState.observe(this) { when (it) { - is LoadState.Loading -> LoadingDialogHub.show( + is LoadState.Loading -> LoadingDialog.show( requireActivity(), "检查版本中,请稍后" ) - else -> LoadingDialogHub.dismiss() + else -> LoadingDialog.dismiss() } } wellViewModel.loadState.observe(this) { when (it) { - is LoadState.Loading -> LoadingDialogHub.show( + is LoadState.Loading -> LoadingDialog.show( requireActivity(), "数据更新中,请稍后" ) is LoadState.Fail -> { - LoadingDialogHub.dismiss() + LoadingDialog.dismiss() "数据更新超时".show(requireContext()) } else -> { - LoadingDialogHub.dismiss() + LoadingDialog.dismiss() AlertControlDialog.Builder().setContext(requireContext()).setTitle("温馨提示") .setMessage("数据更新成功,请重启应用").setNegativeButton("取消") .setPositiveButton("确定").setOnDialogButtonClickListener(object : @@ -197,17 +196,17 @@ lineViewModel.loadState.observe(this) { when (it) { - is LoadState.Loading -> LoadingDialogHub.show( + is LoadState.Loading -> LoadingDialog.show( requireActivity(), "数据更新中,请稍后" ) is LoadState.Fail -> { - LoadingDialogHub.dismiss() + LoadingDialog.dismiss() "数据更新超时".show(requireContext()) } else -> { - LoadingDialogHub.dismiss() + LoadingDialog.dismiss() AlertControlDialog.Builder().setContext(requireContext()).setTitle("温馨提示") .setMessage("数据更新成功,请重启应用").setNegativeButton("取消") .setPositiveButton("确定").setOnDialogButtonClickListener(object : diff --git a/app/src/main/java/com/casic/app/smartwell/fragment/NoticePageFragment.kt b/app/src/main/java/com/casic/app/smartwell/fragment/NoticePageFragment.kt index 171b555..3c93f54 100644 --- a/app/src/main/java/com/casic/app/smartwell/fragment/NoticePageFragment.kt +++ b/app/src/main/java/com/casic/app/smartwell/fragment/NoticePageFragment.kt @@ -48,7 +48,6 @@ override fun setupTopBarLayout() { binding.rootView.initImmersionBar(this, false, R.color.mainThemeColor) - binding.titleInclude.titleView.text = "消息" } override fun initOnCreate(savedInstanceState: Bundle?) { diff --git a/app/src/main/java/com/casic/app/smartwell/fragment/OrderListFragment.kt b/app/src/main/java/com/casic/app/smartwell/fragment/OrderListFragment.kt index 93ff35b..5e38acb 100644 --- a/app/src/main/java/com/casic/app/smartwell/fragment/OrderListFragment.kt +++ b/app/src/main/java/com/casic/app/smartwell/fragment/OrderListFragment.kt @@ -12,6 +12,7 @@ import com.casic.app.smartwell.view.SearchOrderActivity import com.pengxh.kt.lite.base.KotlinBaseFragment import com.pengxh.kt.lite.extensions.navigatePageTo +import com.pengxh.kt.lite.widget.TitleBarView class OrderListFragment : KotlinBaseFragment() { @@ -25,15 +26,22 @@ } override fun initViewBinding( - inflater: LayoutInflater, - container: ViewGroup? + inflater: LayoutInflater, container: ViewGroup? ): FragmentOrderBinding { return FragmentOrderBinding.inflate(inflater, container, false) } override fun setupTopBarLayout() { binding.rootView.initImmersionBar(this, false, R.color.mainThemeColor) - binding.titleView.text = "工单" + binding.titleView.setOnClickListener(object : TitleBarView.OnClickListener { + override fun onLeftClick() { + + } + + override fun onRightClick() { + requireContext().navigatePageTo() + } + }) } override fun initOnCreate(savedInstanceState: Bundle?) { @@ -51,8 +59,6 @@ } override fun initEvent() { - binding.rightOptionView.setOnClickListener { - requireContext().navigatePageTo() - } + } } \ No newline at end of file diff --git a/app/src/main/java/com/casic/app/smartwell/fragment/OrderNotProcessedFragment.kt b/app/src/main/java/com/casic/app/smartwell/fragment/OrderNotProcessedFragment.kt index 0b3d09d..2b6f21d 100644 --- a/app/src/main/java/com/casic/app/smartwell/fragment/OrderNotProcessedFragment.kt +++ b/app/src/main/java/com/casic/app/smartwell/fragment/OrderNotProcessedFragment.kt @@ -18,7 +18,7 @@ import com.pengxh.kt.lite.extensions.navigatePageTo import com.pengxh.kt.lite.extensions.show import com.pengxh.kt.lite.utils.LoadState -import com.pengxh.kt.lite.utils.LoadingDialogHub +import com.pengxh.kt.lite.utils.LoadingDialog import com.pengxh.kt.lite.utils.WeakReferenceHandler import com.pengxh.kt.lite.widget.dialog.AlertControlDialog @@ -78,8 +78,8 @@ operationViewModel = ViewModelProvider(this)[OperationViewModel::class.java] - binding.notProcessedView.addItemDecoration( - RecyclerViewItemOffsets(0, 5, 0, 5) + binding.recyclerView.addItemDecoration( + RecyclerViewItemOffsets(0, 7, 0, 7) ) } @@ -87,9 +87,9 @@ //接单状态处理 operationViewModel.loadState.observe(this) { when (it) { - is LoadState.Loading -> LoadingDialogHub.show(requireActivity(), "接单中,请稍后") + is LoadState.Loading -> LoadingDialog.show(requireActivity(), "接单中,请稍后") is LoadState.Success -> { - LoadingDialogHub.dismiss() + LoadingDialog.dismiss() //接单成功之后刷新列表 dataBeans.removeAt(clickedPosition) notProcessedAdapter.notifyItemRemoved(clickedPosition) @@ -98,7 +98,7 @@ ) } - else -> LoadingDialogHub.dismiss() + else -> LoadingDialog.dismiss() } } } @@ -131,7 +131,7 @@ } else { binding.emptyInclude.emptyView.hide() notProcessedAdapter = OrderNotProcessedAdapter(requireContext(), dataBeans) - binding.notProcessedView.adapter = notProcessedAdapter + binding.recyclerView.adapter = notProcessedAdapter notProcessedAdapter.setOnItemClickListener(object : OrderNotProcessedAdapter.OnItemClickListener { override fun onClicked(position: Int) { diff --git a/app/src/main/java/com/casic/app/smartwell/fragment/OvertimeNotAcceptFragment.kt b/app/src/main/java/com/casic/app/smartwell/fragment/OvertimeNotAcceptFragment.kt index a198545..9b318ca 100644 --- a/app/src/main/java/com/casic/app/smartwell/fragment/OvertimeNotAcceptFragment.kt +++ b/app/src/main/java/com/casic/app/smartwell/fragment/OvertimeNotAcceptFragment.kt @@ -18,7 +18,7 @@ import com.pengxh.kt.lite.extensions.navigatePageTo import com.pengxh.kt.lite.extensions.show import com.pengxh.kt.lite.utils.LoadState -import com.pengxh.kt.lite.utils.LoadingDialogHub +import com.pengxh.kt.lite.utils.LoadingDialog import com.pengxh.kt.lite.utils.WeakReferenceHandler import com.pengxh.kt.lite.widget.dialog.AlertControlDialog @@ -81,8 +81,8 @@ operationViewModel = ViewModelProvider(this)[OperationViewModel::class.java] - binding.notProcessedView.addItemDecoration( - RecyclerViewItemOffsets(0, 5, 0, 5) + binding.recyclerView.addItemDecoration( + RecyclerViewItemOffsets(0, 7, 0, 7) ) } @@ -90,9 +90,9 @@ //接单状态处理 operationViewModel.loadState.observe(this) { when (it) { - is LoadState.Loading -> LoadingDialogHub.show(requireActivity(), "接单中,请稍后") + is LoadState.Loading -> LoadingDialog.show(requireActivity(), "接单中,请稍后") is LoadState.Success -> { - LoadingDialogHub.dismiss() + LoadingDialog.dismiss() //接单成功之后刷新列表 dataBeans.removeAt(clickedPosition) notProcessedAdapter.notifyItemRemoved(clickedPosition) @@ -101,7 +101,7 @@ ) } - else -> LoadingDialogHub.dismiss() + else -> LoadingDialog.dismiss() } } } @@ -134,7 +134,7 @@ } else { binding.emptyInclude.emptyView.hide() notProcessedAdapter = OrderNotProcessedAdapter(requireContext(), dataBeans) - binding.notProcessedView.adapter = notProcessedAdapter + binding.recyclerView.adapter = notProcessedAdapter notProcessedAdapter.setOnItemClickListener(object : OrderNotProcessedAdapter.OnItemClickListener { override fun onClicked(position: Int) { diff --git a/app/src/main/java/com/casic/app/smartwell/greendao/DaoMaster.java b/app/src/main/java/com/casic/app/smartwell/greendao/DaoMaster.java index fdcf3a7..1e52b74 100644 --- a/app/src/main/java/com/casic/app/smartwell/greendao/DaoMaster.java +++ b/app/src/main/java/com/casic/app/smartwell/greendao/DaoMaster.java @@ -13,25 +13,20 @@ // THIS CODE IS GENERATED BY greenDAO, DO NOT EDIT. - /** * Master of DAO (schema version 4): knows all DAOs. */ public class DaoMaster extends AbstractDaoMaster { public static final int SCHEMA_VERSION = 4; - /** - * Creates underlying database table using DAOs. - */ + /** Creates underlying database table using DAOs. */ public static void createAllTables(Database db, boolean ifNotExists) { MapWellLocalBeanDao.createTable(db, ifNotExists); NoticeLocaleBeanDao.createTable(db, ifNotExists); PipeLocalBeanDao.createTable(db, ifNotExists); } - /** - * Drops underlying database table using DAOs. - */ + /** Drops underlying database table using DAOs. */ public static void dropAllTables(Database db, boolean ifExists) { MapWellLocalBeanDao.dropTable(db, ifExists); NoticeLocaleBeanDao.dropTable(db, ifExists); @@ -86,9 +81,7 @@ } } - /** - * WARNING: Drops all table on Upgrade! Use only during development. - */ + /** WARNING: Drops all table on Upgrade! Use only during development. */ public static class DevOpenHelper extends OpenHelper { public DevOpenHelper(Context context, String name) { super(context, name); diff --git a/app/src/main/java/com/casic/app/smartwell/greendao/DaoSession.java b/app/src/main/java/com/casic/app/smartwell/greendao/DaoSession.java index 0b36d17..3e40e3b 100644 --- a/app/src/main/java/com/casic/app/smartwell/greendao/DaoSession.java +++ b/app/src/main/java/com/casic/app/smartwell/greendao/DaoSession.java @@ -16,7 +16,7 @@ /** * {@inheritDoc} - * + * * @see org.greenrobot.greendao.AbstractDaoSession */ public class DaoSession extends AbstractDaoSession { @@ -50,7 +50,7 @@ registerDao(NoticeLocaleBean.class, noticeLocaleBeanDao); registerDao(PipeLocalBean.class, pipeLocalBeanDao); } - + public void clear() { mapWellLocalBeanDaoConfig.clearIdentityScope(); noticeLocaleBeanDaoConfig.clearIdentityScope(); diff --git a/app/src/main/java/com/casic/app/smartwell/greendao/MapWellLocalBeanDao.java b/app/src/main/java/com/casic/app/smartwell/greendao/MapWellLocalBeanDao.java index 8908fda..407bc92 100644 --- a/app/src/main/java/com/casic/app/smartwell/greendao/MapWellLocalBeanDao.java +++ b/app/src/main/java/com/casic/app/smartwell/greendao/MapWellLocalBeanDao.java @@ -12,10 +12,9 @@ import org.greenrobot.greendao.internal.DaoConfig; // THIS CODE IS GENERATED BY greenDAO, DO NOT EDIT. - -/** +/** * DAO for table "MAP_WELL_LOCAL_BEAN". - */ +*/ public class MapWellLocalBeanDao extends AbstractDao { public static final String TABLENAME = "MAP_WELL_LOCAL_BEAN"; @@ -57,16 +56,14 @@ public MapWellLocalBeanDao(DaoConfig config) { super(config); } - + public MapWellLocalBeanDao(DaoConfig config, DaoSession daoSession) { super(config, daoSession); } - /** - * Creates the underlying database table. - */ + /** Creates the underlying database table. */ public static void createTable(Database db, boolean ifNotExists) { - String constraint = ifNotExists ? "IF NOT EXISTS " : ""; + String constraint = ifNotExists? "IF NOT EXISTS ": ""; db.execSQL("CREATE TABLE " + constraint + "\"MAP_WELL_LOCAL_BEAN\" (" + // "\"_id\" INTEGER PRIMARY KEY AUTOINCREMENT ," + // 0: kId "\"AREA\" TEXT," + // 1: area @@ -96,9 +93,7 @@ "\"WELL_TYPE_NAME\" TEXT);"); // 25: wellTypeName } - /** - * Drops the underlying database table. - */ + /** Drops the underlying database table. */ public static void dropTable(Database db, boolean ifExists) { String sql = "DROP TABLE " + (ifExists ? "IF EXISTS " : "") + "\"MAP_WELL_LOCAL_BEAN\""; db.execSQL(sql); @@ -107,132 +102,132 @@ @Override protected final void bindValues(DatabaseStatement stmt, MapWellLocalBean entity) { stmt.clearBindings(); - + Long kId = entity.getKId(); if (kId != null) { stmt.bindLong(1, kId); } - + String area = entity.getArea(); if (area != null) { stmt.bindString(2, area); } - + String bfzt = entity.getBfzt(); if (bfzt != null) { stmt.bindString(3, bfzt); } - + String bfztName = entity.getBfztName(); if (bfztName != null) { stmt.bindString(4, bfztName); } - + String coordinateX = entity.getCoordinateX(); if (coordinateX != null) { stmt.bindString(5, coordinateX); } - + String coordinateY = entity.getCoordinateY(); if (coordinateY != null) { stmt.bindString(6, coordinateY); } - + String deep = entity.getDeep(); if (deep != null) { stmt.bindString(7, deep); } - + String deptName = entity.getDeptName(); if (deptName != null) { stmt.bindString(8, deptName); } - + String deptid = entity.getDeptid(); if (deptid != null) { stmt.bindString(9, deptid); } - + String id = entity.getId(); if (id != null) { stmt.bindString(10, id); } - + String latBaidu = entity.getLatBaidu(); if (latBaidu != null) { stmt.bindString(11, latBaidu); } - + String latGaode = entity.getLatGaode(); if (latGaode != null) { stmt.bindString(12, latGaode); } - + String lngBaidu = entity.getLngBaidu(); if (lngBaidu != null) { stmt.bindString(13, lngBaidu); } - + String lngGaode = entity.getLngGaode(); if (lngGaode != null) { stmt.bindString(14, lngGaode); } - + String notes = entity.getNotes(); if (notes != null) { stmt.bindString(15, notes); } - + String photos = entity.getPhotos(); if (photos != null) { stmt.bindString(16, photos); } - + String position = entity.getPosition(); if (position != null) { stmt.bindString(17, position); } - + String staff = entity.getStaff(); if (staff != null) { stmt.bindString(18, staff); } - + String tel = entity.getTel(); if (tel != null) { stmt.bindString(19, tel); } - + String ts = entity.getTs(); if (ts != null) { stmt.bindString(20, ts); } - + String valid = entity.getValid(); if (valid != null) { stmt.bindString(21, valid); } - + String watchData = entity.getWatchData(); if (watchData != null) { stmt.bindString(22, watchData); } - + String wellCode = entity.getWellCode(); if (wellCode != null) { stmt.bindString(23, wellCode); } - + String wellName = entity.getWellName(); if (wellName != null) { stmt.bindString(24, wellName); } - + String wellType = entity.getWellType(); if (wellType != null) { stmt.bindString(25, wellType); } - + String wellTypeName = entity.getWellTypeName(); if (wellTypeName != null) { stmt.bindString(26, wellTypeName); @@ -242,132 +237,132 @@ @Override protected final void bindValues(SQLiteStatement stmt, MapWellLocalBean entity) { stmt.clearBindings(); - + Long kId = entity.getKId(); if (kId != null) { stmt.bindLong(1, kId); } - + String area = entity.getArea(); if (area != null) { stmt.bindString(2, area); } - + String bfzt = entity.getBfzt(); if (bfzt != null) { stmt.bindString(3, bfzt); } - + String bfztName = entity.getBfztName(); if (bfztName != null) { stmt.bindString(4, bfztName); } - + String coordinateX = entity.getCoordinateX(); if (coordinateX != null) { stmt.bindString(5, coordinateX); } - + String coordinateY = entity.getCoordinateY(); if (coordinateY != null) { stmt.bindString(6, coordinateY); } - + String deep = entity.getDeep(); if (deep != null) { stmt.bindString(7, deep); } - + String deptName = entity.getDeptName(); if (deptName != null) { stmt.bindString(8, deptName); } - + String deptid = entity.getDeptid(); if (deptid != null) { stmt.bindString(9, deptid); } - + String id = entity.getId(); if (id != null) { stmt.bindString(10, id); } - + String latBaidu = entity.getLatBaidu(); if (latBaidu != null) { stmt.bindString(11, latBaidu); } - + String latGaode = entity.getLatGaode(); if (latGaode != null) { stmt.bindString(12, latGaode); } - + String lngBaidu = entity.getLngBaidu(); if (lngBaidu != null) { stmt.bindString(13, lngBaidu); } - + String lngGaode = entity.getLngGaode(); if (lngGaode != null) { stmt.bindString(14, lngGaode); } - + String notes = entity.getNotes(); if (notes != null) { stmt.bindString(15, notes); } - + String photos = entity.getPhotos(); if (photos != null) { stmt.bindString(16, photos); } - + String position = entity.getPosition(); if (position != null) { stmt.bindString(17, position); } - + String staff = entity.getStaff(); if (staff != null) { stmt.bindString(18, staff); } - + String tel = entity.getTel(); if (tel != null) { stmt.bindString(19, tel); } - + String ts = entity.getTs(); if (ts != null) { stmt.bindString(20, ts); } - + String valid = entity.getValid(); if (valid != null) { stmt.bindString(21, valid); } - + String watchData = entity.getWatchData(); if (watchData != null) { stmt.bindString(22, watchData); } - + String wellCode = entity.getWellCode(); if (wellCode != null) { stmt.bindString(23, wellCode); } - + String wellName = entity.getWellName(); if (wellName != null) { stmt.bindString(24, wellName); } - + String wellType = entity.getWellType(); if (wellType != null) { stmt.bindString(25, wellType); } - + String wellTypeName = entity.getWellTypeName(); if (wellTypeName != null) { stmt.bindString(26, wellTypeName); @@ -377,41 +372,41 @@ @Override public Long readKey(Cursor cursor, int offset) { return cursor.isNull(offset + 0) ? null : cursor.getLong(offset + 0); - } + } @Override public MapWellLocalBean readEntity(Cursor cursor, int offset) { MapWellLocalBean entity = new MapWellLocalBean( // - cursor.isNull(offset + 0) ? null : cursor.getLong(offset + 0), // kId - cursor.isNull(offset + 1) ? null : cursor.getString(offset + 1), // area - cursor.isNull(offset + 2) ? null : cursor.getString(offset + 2), // bfzt - cursor.isNull(offset + 3) ? null : cursor.getString(offset + 3), // bfztName - cursor.isNull(offset + 4) ? null : cursor.getString(offset + 4), // coordinateX - cursor.isNull(offset + 5) ? null : cursor.getString(offset + 5), // coordinateY - cursor.isNull(offset + 6) ? null : cursor.getString(offset + 6), // deep - cursor.isNull(offset + 7) ? null : cursor.getString(offset + 7), // deptName - cursor.isNull(offset + 8) ? null : cursor.getString(offset + 8), // deptid - cursor.isNull(offset + 9) ? null : cursor.getString(offset + 9), // id - cursor.isNull(offset + 10) ? null : cursor.getString(offset + 10), // latBaidu - cursor.isNull(offset + 11) ? null : cursor.getString(offset + 11), // latGaode - cursor.isNull(offset + 12) ? null : cursor.getString(offset + 12), // lngBaidu - cursor.isNull(offset + 13) ? null : cursor.getString(offset + 13), // lngGaode - cursor.isNull(offset + 14) ? null : cursor.getString(offset + 14), // notes - cursor.isNull(offset + 15) ? null : cursor.getString(offset + 15), // photos - cursor.isNull(offset + 16) ? null : cursor.getString(offset + 16), // position - cursor.isNull(offset + 17) ? null : cursor.getString(offset + 17), // staff - cursor.isNull(offset + 18) ? null : cursor.getString(offset + 18), // tel - cursor.isNull(offset + 19) ? null : cursor.getString(offset + 19), // ts - cursor.isNull(offset + 20) ? null : cursor.getString(offset + 20), // valid - cursor.isNull(offset + 21) ? null : cursor.getString(offset + 21), // watchData - cursor.isNull(offset + 22) ? null : cursor.getString(offset + 22), // wellCode - cursor.isNull(offset + 23) ? null : cursor.getString(offset + 23), // wellName - cursor.isNull(offset + 24) ? null : cursor.getString(offset + 24), // wellType - cursor.isNull(offset + 25) ? null : cursor.getString(offset + 25) // wellTypeName + cursor.isNull(offset + 0) ? null : cursor.getLong(offset + 0), // kId + cursor.isNull(offset + 1) ? null : cursor.getString(offset + 1), // area + cursor.isNull(offset + 2) ? null : cursor.getString(offset + 2), // bfzt + cursor.isNull(offset + 3) ? null : cursor.getString(offset + 3), // bfztName + cursor.isNull(offset + 4) ? null : cursor.getString(offset + 4), // coordinateX + cursor.isNull(offset + 5) ? null : cursor.getString(offset + 5), // coordinateY + cursor.isNull(offset + 6) ? null : cursor.getString(offset + 6), // deep + cursor.isNull(offset + 7) ? null : cursor.getString(offset + 7), // deptName + cursor.isNull(offset + 8) ? null : cursor.getString(offset + 8), // deptid + cursor.isNull(offset + 9) ? null : cursor.getString(offset + 9), // id + cursor.isNull(offset + 10) ? null : cursor.getString(offset + 10), // latBaidu + cursor.isNull(offset + 11) ? null : cursor.getString(offset + 11), // latGaode + cursor.isNull(offset + 12) ? null : cursor.getString(offset + 12), // lngBaidu + cursor.isNull(offset + 13) ? null : cursor.getString(offset + 13), // lngGaode + cursor.isNull(offset + 14) ? null : cursor.getString(offset + 14), // notes + cursor.isNull(offset + 15) ? null : cursor.getString(offset + 15), // photos + cursor.isNull(offset + 16) ? null : cursor.getString(offset + 16), // position + cursor.isNull(offset + 17) ? null : cursor.getString(offset + 17), // staff + cursor.isNull(offset + 18) ? null : cursor.getString(offset + 18), // tel + cursor.isNull(offset + 19) ? null : cursor.getString(offset + 19), // ts + cursor.isNull(offset + 20) ? null : cursor.getString(offset + 20), // valid + cursor.isNull(offset + 21) ? null : cursor.getString(offset + 21), // watchData + cursor.isNull(offset + 22) ? null : cursor.getString(offset + 22), // wellCode + cursor.isNull(offset + 23) ? null : cursor.getString(offset + 23), // wellName + cursor.isNull(offset + 24) ? null : cursor.getString(offset + 24), // wellType + cursor.isNull(offset + 25) ? null : cursor.getString(offset + 25) // wellTypeName ); return entity; } - + @Override public void readEntity(Cursor cursor, MapWellLocalBean entity, int offset) { entity.setKId(cursor.isNull(offset + 0) ? null : cursor.getLong(offset + 0)); @@ -440,17 +435,17 @@ entity.setWellName(cursor.isNull(offset + 23) ? null : cursor.getString(offset + 23)); entity.setWellType(cursor.isNull(offset + 24) ? null : cursor.getString(offset + 24)); entity.setWellTypeName(cursor.isNull(offset + 25) ? null : cursor.getString(offset + 25)); - } - + } + @Override protected final Long updateKeyAfterInsert(MapWellLocalBean entity, long rowId) { entity.setKId(rowId); return rowId; } - + @Override public Long getKey(MapWellLocalBean entity) { - if (entity != null) { + if(entity != null) { return entity.getKId(); } else { return null; @@ -466,5 +461,5 @@ protected final boolean isEntityUpdateable() { return true; } - + } diff --git a/app/build.gradle b/app/build.gradle index 296fb6f..c18c251 100644 --- a/app/build.gradle +++ b/app/build.gradle @@ -40,10 +40,6 @@ // VIVO 相关应用参数 VIVO_APP_ID : "105749048", VIVO_APP_KEY : "e460fbf2c689e0f8c58ecc6aa62e1803", - - // 小米相关应用参数 -// XIAOMI_APP_ID : "", -// XIAOMI_APP_KEY : "", ] // 版本名后面添加一句话,意思就是flavor dimension 它的维度就是该版本号,多渠道打包很重要 @@ -107,7 +103,7 @@ dependencies { implementation fileTree(dir: 'libs', include: ['*.jar']) //基础依赖库 - implementation 'com.github.AndroidCoderPeng:Kotlin-lite-lib:1.0.10' + implementation 'com.github.AndroidCoderPeng:Kotlin-lite-lib:1.1.0' implementation 'androidx.appcompat:appcompat:1.6.1' implementation 'androidx.core:core-ktx:1.9.0' implementation 'androidx.constraintlayout:constraintlayout:2.1.4' @@ -165,8 +161,6 @@ implementation 'commons-codec:commons-codec:1.15' implementation 'com.android.support:support-annotations:28.0.0' implementation 'com.assist-v3:vivo:3.1.2' // vivo -// implementation 'com.getui.opt:xmp:3.3.1' // 小米 - //数据库框架 implementation 'org.greenrobot:greendao:3.3.0' //数据库升级 diff --git a/app/src/main/AndroidManifest.xml b/app/src/main/AndroidManifest.xml index c0af158..e0519bf 100644 --- a/app/src/main/AndroidManifest.xml +++ b/app/src/main/AndroidManifest.xml @@ -90,10 +90,10 @@ - + + android:value="ee96d8b5e12de3fbb29949efd57418a8" /> () @@ -150,7 +158,7 @@ val cameraPosition = CameraPosition(centerLatLng, 14f, 0f, 0f) val cameraUpdate = CameraUpdateFactory.newCameraPosition(cameraPosition) withContext(Dispatchers.Main) { - LoadingDialogHub.dismiss() + LoadingDialog.dismiss() aMap.animateCamera(cameraUpdate, 1500, null) } } @@ -239,11 +247,6 @@ } override fun initEvent() { - binding.rightOptionView.setOnClickListener { - val x = binding.rightOptionView.width - easyPopupWindow.width - easyPopupWindow.showAsDropDown(binding.rightOptionView, x, 0) - } - //撤防点位 binding.unDeployedLayout.setOnClickListener { requireContext().navigatePageTo() @@ -263,11 +266,11 @@ override fun observeRequestState() { wellViewModel.loadState.observe(this) { when (it) { - is LoadState.Loading -> LoadingDialogHub.show( + is LoadState.Loading -> LoadingDialog.show( requireActivity(), "数据加载中,请稍后..." ) - else -> LoadingDialogHub.dismiss() + else -> LoadingDialog.dismiss() } } } @@ -376,7 +379,7 @@ }).build().show() } }) - infoPopup.showAsDropDown(binding.rightOptionView) +// infoPopup.showAsDropDown(binding.rightOptionView) } override fun onCameraChange(p0: CameraPosition?) { diff --git a/app/src/main/java/com/casic/app/smartwell/fragment/HomePageNoClusterFragment.kt b/app/src/main/java/com/casic/app/smartwell/fragment/HomePageNoClusterFragment.kt index 802426a..b25f743 100644 --- a/app/src/main/java/com/casic/app/smartwell/fragment/HomePageNoClusterFragment.kt +++ b/app/src/main/java/com/casic/app/smartwell/fragment/HomePageNoClusterFragment.kt @@ -38,8 +38,9 @@ import com.pengxh.kt.lite.extensions.navigatePageTo import com.pengxh.kt.lite.extensions.show import com.pengxh.kt.lite.utils.LoadState -import com.pengxh.kt.lite.utils.LoadingDialogHub +import com.pengxh.kt.lite.utils.LoadingDialog import com.pengxh.kt.lite.widget.EasyPopupWindow +import com.pengxh.kt.lite.widget.TitleBarView import com.pengxh.kt.lite.widget.dialog.AlertControlDialog import kotlinx.coroutines.Dispatchers import kotlinx.coroutines.launch @@ -78,7 +79,15 @@ override fun setupTopBarLayout() { binding.rootView.initImmersionBar(this, false, R.color.mainThemeColor) - binding.titleView.text = "首页" + binding.titleView.setOnClickListener(object : TitleBarView.OnClickListener { + override fun onLeftClick() { + + } + + override fun onRightClick() { + easyPopupWindow.showAsDropDown(binding.titleView, binding.titleView.width, 0) + } + }) } override fun initOnCreate(savedInstanceState: Bundle?) { @@ -112,7 +121,7 @@ //渲染井位置 lifecycleScope.launch(Dispatchers.Main) { - LoadingDialogHub.show(requireActivity(), "数据加载中,请稍后") + LoadingDialog.show(requireActivity(), "数据加载中,请稍后") withContext(Dispatchers.IO) { //取Well缓存 val allMarkerOptions = ArrayList() @@ -144,7 +153,7 @@ val cameraPosition = CameraPosition(centerLatLng, 14f, 0f, 0f) val cameraUpdate = CameraUpdateFactory.newCameraPosition(cameraPosition) withContext(Dispatchers.Main) { - LoadingDialogHub.dismiss() + LoadingDialog.dismiss() aMap.animateCamera(cameraUpdate, 1500, null) } } @@ -238,11 +247,6 @@ } override fun initEvent() { - binding.rightOptionView.setOnClickListener { - val x = binding.rightOptionView.width - easyPopupWindow.width - easyPopupWindow.showAsDropDown(binding.rightOptionView, x, 0) - } - //撤防点位 binding.unDeployedLayout.setOnClickListener { requireContext().navigatePageTo() @@ -262,11 +266,11 @@ override fun observeRequestState() { wellViewModel.loadState.observe(this) { when (it) { - is LoadState.Loading -> LoadingDialogHub.show( + is LoadState.Loading -> LoadingDialog.show( requireActivity(), "数据加载中,请稍后..." ) - else -> LoadingDialogHub.dismiss() + else -> LoadingDialog.dismiss() } } } diff --git a/app/src/main/java/com/casic/app/smartwell/fragment/MinePageFragment.kt b/app/src/main/java/com/casic/app/smartwell/fragment/MinePageFragment.kt index 09a570c..dcb48f8 100644 --- a/app/src/main/java/com/casic/app/smartwell/fragment/MinePageFragment.kt +++ b/app/src/main/java/com/casic/app/smartwell/fragment/MinePageFragment.kt @@ -35,7 +35,7 @@ import com.pengxh.kt.lite.utils.ActivityStackManager import com.pengxh.kt.lite.utils.FileDownloadManager import com.pengxh.kt.lite.utils.LoadState -import com.pengxh.kt.lite.utils.LoadingDialogHub +import com.pengxh.kt.lite.utils.LoadingDialog import com.pengxh.kt.lite.widget.dialog.AlertControlDialog import com.pengxh.kt.lite.widget.dialog.BottomActionSheet import kotlinx.coroutines.Dispatchers @@ -60,7 +60,6 @@ override fun setupTopBarLayout() { binding.rootView.initImmersionBar(this, false, R.color.mainThemeColor) - binding.titleInclude.titleView.text = "我的" } override fun initOnCreate(savedInstanceState: Bundle?) { @@ -155,27 +154,27 @@ override fun observeRequestState() { userViewModel.loadState.observe(this) { when (it) { - is LoadState.Loading -> LoadingDialogHub.show( + is LoadState.Loading -> LoadingDialog.show( requireActivity(), "检查版本中,请稍后" ) - else -> LoadingDialogHub.dismiss() + else -> LoadingDialog.dismiss() } } wellViewModel.loadState.observe(this) { when (it) { - is LoadState.Loading -> LoadingDialogHub.show( + is LoadState.Loading -> LoadingDialog.show( requireActivity(), "数据更新中,请稍后" ) is LoadState.Fail -> { - LoadingDialogHub.dismiss() + LoadingDialog.dismiss() "数据更新超时".show(requireContext()) } else -> { - LoadingDialogHub.dismiss() + LoadingDialog.dismiss() AlertControlDialog.Builder().setContext(requireContext()).setTitle("温馨提示") .setMessage("数据更新成功,请重启应用").setNegativeButton("取消") .setPositiveButton("确定").setOnDialogButtonClickListener(object : @@ -197,17 +196,17 @@ lineViewModel.loadState.observe(this) { when (it) { - is LoadState.Loading -> LoadingDialogHub.show( + is LoadState.Loading -> LoadingDialog.show( requireActivity(), "数据更新中,请稍后" ) is LoadState.Fail -> { - LoadingDialogHub.dismiss() + LoadingDialog.dismiss() "数据更新超时".show(requireContext()) } else -> { - LoadingDialogHub.dismiss() + LoadingDialog.dismiss() AlertControlDialog.Builder().setContext(requireContext()).setTitle("温馨提示") .setMessage("数据更新成功,请重启应用").setNegativeButton("取消") .setPositiveButton("确定").setOnDialogButtonClickListener(object : diff --git a/app/src/main/java/com/casic/app/smartwell/fragment/NoticePageFragment.kt b/app/src/main/java/com/casic/app/smartwell/fragment/NoticePageFragment.kt index 171b555..3c93f54 100644 --- a/app/src/main/java/com/casic/app/smartwell/fragment/NoticePageFragment.kt +++ b/app/src/main/java/com/casic/app/smartwell/fragment/NoticePageFragment.kt @@ -48,7 +48,6 @@ override fun setupTopBarLayout() { binding.rootView.initImmersionBar(this, false, R.color.mainThemeColor) - binding.titleInclude.titleView.text = "消息" } override fun initOnCreate(savedInstanceState: Bundle?) { diff --git a/app/src/main/java/com/casic/app/smartwell/fragment/OrderListFragment.kt b/app/src/main/java/com/casic/app/smartwell/fragment/OrderListFragment.kt index 93ff35b..5e38acb 100644 --- a/app/src/main/java/com/casic/app/smartwell/fragment/OrderListFragment.kt +++ b/app/src/main/java/com/casic/app/smartwell/fragment/OrderListFragment.kt @@ -12,6 +12,7 @@ import com.casic.app.smartwell.view.SearchOrderActivity import com.pengxh.kt.lite.base.KotlinBaseFragment import com.pengxh.kt.lite.extensions.navigatePageTo +import com.pengxh.kt.lite.widget.TitleBarView class OrderListFragment : KotlinBaseFragment() { @@ -25,15 +26,22 @@ } override fun initViewBinding( - inflater: LayoutInflater, - container: ViewGroup? + inflater: LayoutInflater, container: ViewGroup? ): FragmentOrderBinding { return FragmentOrderBinding.inflate(inflater, container, false) } override fun setupTopBarLayout() { binding.rootView.initImmersionBar(this, false, R.color.mainThemeColor) - binding.titleView.text = "工单" + binding.titleView.setOnClickListener(object : TitleBarView.OnClickListener { + override fun onLeftClick() { + + } + + override fun onRightClick() { + requireContext().navigatePageTo() + } + }) } override fun initOnCreate(savedInstanceState: Bundle?) { @@ -51,8 +59,6 @@ } override fun initEvent() { - binding.rightOptionView.setOnClickListener { - requireContext().navigatePageTo() - } + } } \ No newline at end of file diff --git a/app/src/main/java/com/casic/app/smartwell/fragment/OrderNotProcessedFragment.kt b/app/src/main/java/com/casic/app/smartwell/fragment/OrderNotProcessedFragment.kt index 0b3d09d..2b6f21d 100644 --- a/app/src/main/java/com/casic/app/smartwell/fragment/OrderNotProcessedFragment.kt +++ b/app/src/main/java/com/casic/app/smartwell/fragment/OrderNotProcessedFragment.kt @@ -18,7 +18,7 @@ import com.pengxh.kt.lite.extensions.navigatePageTo import com.pengxh.kt.lite.extensions.show import com.pengxh.kt.lite.utils.LoadState -import com.pengxh.kt.lite.utils.LoadingDialogHub +import com.pengxh.kt.lite.utils.LoadingDialog import com.pengxh.kt.lite.utils.WeakReferenceHandler import com.pengxh.kt.lite.widget.dialog.AlertControlDialog @@ -78,8 +78,8 @@ operationViewModel = ViewModelProvider(this)[OperationViewModel::class.java] - binding.notProcessedView.addItemDecoration( - RecyclerViewItemOffsets(0, 5, 0, 5) + binding.recyclerView.addItemDecoration( + RecyclerViewItemOffsets(0, 7, 0, 7) ) } @@ -87,9 +87,9 @@ //接单状态处理 operationViewModel.loadState.observe(this) { when (it) { - is LoadState.Loading -> LoadingDialogHub.show(requireActivity(), "接单中,请稍后") + is LoadState.Loading -> LoadingDialog.show(requireActivity(), "接单中,请稍后") is LoadState.Success -> { - LoadingDialogHub.dismiss() + LoadingDialog.dismiss() //接单成功之后刷新列表 dataBeans.removeAt(clickedPosition) notProcessedAdapter.notifyItemRemoved(clickedPosition) @@ -98,7 +98,7 @@ ) } - else -> LoadingDialogHub.dismiss() + else -> LoadingDialog.dismiss() } } } @@ -131,7 +131,7 @@ } else { binding.emptyInclude.emptyView.hide() notProcessedAdapter = OrderNotProcessedAdapter(requireContext(), dataBeans) - binding.notProcessedView.adapter = notProcessedAdapter + binding.recyclerView.adapter = notProcessedAdapter notProcessedAdapter.setOnItemClickListener(object : OrderNotProcessedAdapter.OnItemClickListener { override fun onClicked(position: Int) { diff --git a/app/src/main/java/com/casic/app/smartwell/fragment/OvertimeNotAcceptFragment.kt b/app/src/main/java/com/casic/app/smartwell/fragment/OvertimeNotAcceptFragment.kt index a198545..9b318ca 100644 --- a/app/src/main/java/com/casic/app/smartwell/fragment/OvertimeNotAcceptFragment.kt +++ b/app/src/main/java/com/casic/app/smartwell/fragment/OvertimeNotAcceptFragment.kt @@ -18,7 +18,7 @@ import com.pengxh.kt.lite.extensions.navigatePageTo import com.pengxh.kt.lite.extensions.show import com.pengxh.kt.lite.utils.LoadState -import com.pengxh.kt.lite.utils.LoadingDialogHub +import com.pengxh.kt.lite.utils.LoadingDialog import com.pengxh.kt.lite.utils.WeakReferenceHandler import com.pengxh.kt.lite.widget.dialog.AlertControlDialog @@ -81,8 +81,8 @@ operationViewModel = ViewModelProvider(this)[OperationViewModel::class.java] - binding.notProcessedView.addItemDecoration( - RecyclerViewItemOffsets(0, 5, 0, 5) + binding.recyclerView.addItemDecoration( + RecyclerViewItemOffsets(0, 7, 0, 7) ) } @@ -90,9 +90,9 @@ //接单状态处理 operationViewModel.loadState.observe(this) { when (it) { - is LoadState.Loading -> LoadingDialogHub.show(requireActivity(), "接单中,请稍后") + is LoadState.Loading -> LoadingDialog.show(requireActivity(), "接单中,请稍后") is LoadState.Success -> { - LoadingDialogHub.dismiss() + LoadingDialog.dismiss() //接单成功之后刷新列表 dataBeans.removeAt(clickedPosition) notProcessedAdapter.notifyItemRemoved(clickedPosition) @@ -101,7 +101,7 @@ ) } - else -> LoadingDialogHub.dismiss() + else -> LoadingDialog.dismiss() } } } @@ -134,7 +134,7 @@ } else { binding.emptyInclude.emptyView.hide() notProcessedAdapter = OrderNotProcessedAdapter(requireContext(), dataBeans) - binding.notProcessedView.adapter = notProcessedAdapter + binding.recyclerView.adapter = notProcessedAdapter notProcessedAdapter.setOnItemClickListener(object : OrderNotProcessedAdapter.OnItemClickListener { override fun onClicked(position: Int) { diff --git a/app/src/main/java/com/casic/app/smartwell/greendao/DaoMaster.java b/app/src/main/java/com/casic/app/smartwell/greendao/DaoMaster.java index fdcf3a7..1e52b74 100644 --- a/app/src/main/java/com/casic/app/smartwell/greendao/DaoMaster.java +++ b/app/src/main/java/com/casic/app/smartwell/greendao/DaoMaster.java @@ -13,25 +13,20 @@ // THIS CODE IS GENERATED BY greenDAO, DO NOT EDIT. - /** * Master of DAO (schema version 4): knows all DAOs. */ public class DaoMaster extends AbstractDaoMaster { public static final int SCHEMA_VERSION = 4; - /** - * Creates underlying database table using DAOs. - */ + /** Creates underlying database table using DAOs. */ public static void createAllTables(Database db, boolean ifNotExists) { MapWellLocalBeanDao.createTable(db, ifNotExists); NoticeLocaleBeanDao.createTable(db, ifNotExists); PipeLocalBeanDao.createTable(db, ifNotExists); } - /** - * Drops underlying database table using DAOs. - */ + /** Drops underlying database table using DAOs. */ public static void dropAllTables(Database db, boolean ifExists) { MapWellLocalBeanDao.dropTable(db, ifExists); NoticeLocaleBeanDao.dropTable(db, ifExists); @@ -86,9 +81,7 @@ } } - /** - * WARNING: Drops all table on Upgrade! Use only during development. - */ + /** WARNING: Drops all table on Upgrade! Use only during development. */ public static class DevOpenHelper extends OpenHelper { public DevOpenHelper(Context context, String name) { super(context, name); diff --git a/app/src/main/java/com/casic/app/smartwell/greendao/DaoSession.java b/app/src/main/java/com/casic/app/smartwell/greendao/DaoSession.java index 0b36d17..3e40e3b 100644 --- a/app/src/main/java/com/casic/app/smartwell/greendao/DaoSession.java +++ b/app/src/main/java/com/casic/app/smartwell/greendao/DaoSession.java @@ -16,7 +16,7 @@ /** * {@inheritDoc} - * + * * @see org.greenrobot.greendao.AbstractDaoSession */ public class DaoSession extends AbstractDaoSession { @@ -50,7 +50,7 @@ registerDao(NoticeLocaleBean.class, noticeLocaleBeanDao); registerDao(PipeLocalBean.class, pipeLocalBeanDao); } - + public void clear() { mapWellLocalBeanDaoConfig.clearIdentityScope(); noticeLocaleBeanDaoConfig.clearIdentityScope(); diff --git a/app/src/main/java/com/casic/app/smartwell/greendao/MapWellLocalBeanDao.java b/app/src/main/java/com/casic/app/smartwell/greendao/MapWellLocalBeanDao.java index 8908fda..407bc92 100644 --- a/app/src/main/java/com/casic/app/smartwell/greendao/MapWellLocalBeanDao.java +++ b/app/src/main/java/com/casic/app/smartwell/greendao/MapWellLocalBeanDao.java @@ -12,10 +12,9 @@ import org.greenrobot.greendao.internal.DaoConfig; // THIS CODE IS GENERATED BY greenDAO, DO NOT EDIT. - -/** +/** * DAO for table "MAP_WELL_LOCAL_BEAN". - */ +*/ public class MapWellLocalBeanDao extends AbstractDao { public static final String TABLENAME = "MAP_WELL_LOCAL_BEAN"; @@ -57,16 +56,14 @@ public MapWellLocalBeanDao(DaoConfig config) { super(config); } - + public MapWellLocalBeanDao(DaoConfig config, DaoSession daoSession) { super(config, daoSession); } - /** - * Creates the underlying database table. - */ + /** Creates the underlying database table. */ public static void createTable(Database db, boolean ifNotExists) { - String constraint = ifNotExists ? "IF NOT EXISTS " : ""; + String constraint = ifNotExists? "IF NOT EXISTS ": ""; db.execSQL("CREATE TABLE " + constraint + "\"MAP_WELL_LOCAL_BEAN\" (" + // "\"_id\" INTEGER PRIMARY KEY AUTOINCREMENT ," + // 0: kId "\"AREA\" TEXT," + // 1: area @@ -96,9 +93,7 @@ "\"WELL_TYPE_NAME\" TEXT);"); // 25: wellTypeName } - /** - * Drops the underlying database table. - */ + /** Drops the underlying database table. */ public static void dropTable(Database db, boolean ifExists) { String sql = "DROP TABLE " + (ifExists ? "IF EXISTS " : "") + "\"MAP_WELL_LOCAL_BEAN\""; db.execSQL(sql); @@ -107,132 +102,132 @@ @Override protected final void bindValues(DatabaseStatement stmt, MapWellLocalBean entity) { stmt.clearBindings(); - + Long kId = entity.getKId(); if (kId != null) { stmt.bindLong(1, kId); } - + String area = entity.getArea(); if (area != null) { stmt.bindString(2, area); } - + String bfzt = entity.getBfzt(); if (bfzt != null) { stmt.bindString(3, bfzt); } - + String bfztName = entity.getBfztName(); if (bfztName != null) { stmt.bindString(4, bfztName); } - + String coordinateX = entity.getCoordinateX(); if (coordinateX != null) { stmt.bindString(5, coordinateX); } - + String coordinateY = entity.getCoordinateY(); if (coordinateY != null) { stmt.bindString(6, coordinateY); } - + String deep = entity.getDeep(); if (deep != null) { stmt.bindString(7, deep); } - + String deptName = entity.getDeptName(); if (deptName != null) { stmt.bindString(8, deptName); } - + String deptid = entity.getDeptid(); if (deptid != null) { stmt.bindString(9, deptid); } - + String id = entity.getId(); if (id != null) { stmt.bindString(10, id); } - + String latBaidu = entity.getLatBaidu(); if (latBaidu != null) { stmt.bindString(11, latBaidu); } - + String latGaode = entity.getLatGaode(); if (latGaode != null) { stmt.bindString(12, latGaode); } - + String lngBaidu = entity.getLngBaidu(); if (lngBaidu != null) { stmt.bindString(13, lngBaidu); } - + String lngGaode = entity.getLngGaode(); if (lngGaode != null) { stmt.bindString(14, lngGaode); } - + String notes = entity.getNotes(); if (notes != null) { stmt.bindString(15, notes); } - + String photos = entity.getPhotos(); if (photos != null) { stmt.bindString(16, photos); } - + String position = entity.getPosition(); if (position != null) { stmt.bindString(17, position); } - + String staff = entity.getStaff(); if (staff != null) { stmt.bindString(18, staff); } - + String tel = entity.getTel(); if (tel != null) { stmt.bindString(19, tel); } - + String ts = entity.getTs(); if (ts != null) { stmt.bindString(20, ts); } - + String valid = entity.getValid(); if (valid != null) { stmt.bindString(21, valid); } - + String watchData = entity.getWatchData(); if (watchData != null) { stmt.bindString(22, watchData); } - + String wellCode = entity.getWellCode(); if (wellCode != null) { stmt.bindString(23, wellCode); } - + String wellName = entity.getWellName(); if (wellName != null) { stmt.bindString(24, wellName); } - + String wellType = entity.getWellType(); if (wellType != null) { stmt.bindString(25, wellType); } - + String wellTypeName = entity.getWellTypeName(); if (wellTypeName != null) { stmt.bindString(26, wellTypeName); @@ -242,132 +237,132 @@ @Override protected final void bindValues(SQLiteStatement stmt, MapWellLocalBean entity) { stmt.clearBindings(); - + Long kId = entity.getKId(); if (kId != null) { stmt.bindLong(1, kId); } - + String area = entity.getArea(); if (area != null) { stmt.bindString(2, area); } - + String bfzt = entity.getBfzt(); if (bfzt != null) { stmt.bindString(3, bfzt); } - + String bfztName = entity.getBfztName(); if (bfztName != null) { stmt.bindString(4, bfztName); } - + String coordinateX = entity.getCoordinateX(); if (coordinateX != null) { stmt.bindString(5, coordinateX); } - + String coordinateY = entity.getCoordinateY(); if (coordinateY != null) { stmt.bindString(6, coordinateY); } - + String deep = entity.getDeep(); if (deep != null) { stmt.bindString(7, deep); } - + String deptName = entity.getDeptName(); if (deptName != null) { stmt.bindString(8, deptName); } - + String deptid = entity.getDeptid(); if (deptid != null) { stmt.bindString(9, deptid); } - + String id = entity.getId(); if (id != null) { stmt.bindString(10, id); } - + String latBaidu = entity.getLatBaidu(); if (latBaidu != null) { stmt.bindString(11, latBaidu); } - + String latGaode = entity.getLatGaode(); if (latGaode != null) { stmt.bindString(12, latGaode); } - + String lngBaidu = entity.getLngBaidu(); if (lngBaidu != null) { stmt.bindString(13, lngBaidu); } - + String lngGaode = entity.getLngGaode(); if (lngGaode != null) { stmt.bindString(14, lngGaode); } - + String notes = entity.getNotes(); if (notes != null) { stmt.bindString(15, notes); } - + String photos = entity.getPhotos(); if (photos != null) { stmt.bindString(16, photos); } - + String position = entity.getPosition(); if (position != null) { stmt.bindString(17, position); } - + String staff = entity.getStaff(); if (staff != null) { stmt.bindString(18, staff); } - + String tel = entity.getTel(); if (tel != null) { stmt.bindString(19, tel); } - + String ts = entity.getTs(); if (ts != null) { stmt.bindString(20, ts); } - + String valid = entity.getValid(); if (valid != null) { stmt.bindString(21, valid); } - + String watchData = entity.getWatchData(); if (watchData != null) { stmt.bindString(22, watchData); } - + String wellCode = entity.getWellCode(); if (wellCode != null) { stmt.bindString(23, wellCode); } - + String wellName = entity.getWellName(); if (wellName != null) { stmt.bindString(24, wellName); } - + String wellType = entity.getWellType(); if (wellType != null) { stmt.bindString(25, wellType); } - + String wellTypeName = entity.getWellTypeName(); if (wellTypeName != null) { stmt.bindString(26, wellTypeName); @@ -377,41 +372,41 @@ @Override public Long readKey(Cursor cursor, int offset) { return cursor.isNull(offset + 0) ? null : cursor.getLong(offset + 0); - } + } @Override public MapWellLocalBean readEntity(Cursor cursor, int offset) { MapWellLocalBean entity = new MapWellLocalBean( // - cursor.isNull(offset + 0) ? null : cursor.getLong(offset + 0), // kId - cursor.isNull(offset + 1) ? null : cursor.getString(offset + 1), // area - cursor.isNull(offset + 2) ? null : cursor.getString(offset + 2), // bfzt - cursor.isNull(offset + 3) ? null : cursor.getString(offset + 3), // bfztName - cursor.isNull(offset + 4) ? null : cursor.getString(offset + 4), // coordinateX - cursor.isNull(offset + 5) ? null : cursor.getString(offset + 5), // coordinateY - cursor.isNull(offset + 6) ? null : cursor.getString(offset + 6), // deep - cursor.isNull(offset + 7) ? null : cursor.getString(offset + 7), // deptName - cursor.isNull(offset + 8) ? null : cursor.getString(offset + 8), // deptid - cursor.isNull(offset + 9) ? null : cursor.getString(offset + 9), // id - cursor.isNull(offset + 10) ? null : cursor.getString(offset + 10), // latBaidu - cursor.isNull(offset + 11) ? null : cursor.getString(offset + 11), // latGaode - cursor.isNull(offset + 12) ? null : cursor.getString(offset + 12), // lngBaidu - cursor.isNull(offset + 13) ? null : cursor.getString(offset + 13), // lngGaode - cursor.isNull(offset + 14) ? null : cursor.getString(offset + 14), // notes - cursor.isNull(offset + 15) ? null : cursor.getString(offset + 15), // photos - cursor.isNull(offset + 16) ? null : cursor.getString(offset + 16), // position - cursor.isNull(offset + 17) ? null : cursor.getString(offset + 17), // staff - cursor.isNull(offset + 18) ? null : cursor.getString(offset + 18), // tel - cursor.isNull(offset + 19) ? null : cursor.getString(offset + 19), // ts - cursor.isNull(offset + 20) ? null : cursor.getString(offset + 20), // valid - cursor.isNull(offset + 21) ? null : cursor.getString(offset + 21), // watchData - cursor.isNull(offset + 22) ? null : cursor.getString(offset + 22), // wellCode - cursor.isNull(offset + 23) ? null : cursor.getString(offset + 23), // wellName - cursor.isNull(offset + 24) ? null : cursor.getString(offset + 24), // wellType - cursor.isNull(offset + 25) ? null : cursor.getString(offset + 25) // wellTypeName + cursor.isNull(offset + 0) ? null : cursor.getLong(offset + 0), // kId + cursor.isNull(offset + 1) ? null : cursor.getString(offset + 1), // area + cursor.isNull(offset + 2) ? null : cursor.getString(offset + 2), // bfzt + cursor.isNull(offset + 3) ? null : cursor.getString(offset + 3), // bfztName + cursor.isNull(offset + 4) ? null : cursor.getString(offset + 4), // coordinateX + cursor.isNull(offset + 5) ? null : cursor.getString(offset + 5), // coordinateY + cursor.isNull(offset + 6) ? null : cursor.getString(offset + 6), // deep + cursor.isNull(offset + 7) ? null : cursor.getString(offset + 7), // deptName + cursor.isNull(offset + 8) ? null : cursor.getString(offset + 8), // deptid + cursor.isNull(offset + 9) ? null : cursor.getString(offset + 9), // id + cursor.isNull(offset + 10) ? null : cursor.getString(offset + 10), // latBaidu + cursor.isNull(offset + 11) ? null : cursor.getString(offset + 11), // latGaode + cursor.isNull(offset + 12) ? null : cursor.getString(offset + 12), // lngBaidu + cursor.isNull(offset + 13) ? null : cursor.getString(offset + 13), // lngGaode + cursor.isNull(offset + 14) ? null : cursor.getString(offset + 14), // notes + cursor.isNull(offset + 15) ? null : cursor.getString(offset + 15), // photos + cursor.isNull(offset + 16) ? null : cursor.getString(offset + 16), // position + cursor.isNull(offset + 17) ? null : cursor.getString(offset + 17), // staff + cursor.isNull(offset + 18) ? null : cursor.getString(offset + 18), // tel + cursor.isNull(offset + 19) ? null : cursor.getString(offset + 19), // ts + cursor.isNull(offset + 20) ? null : cursor.getString(offset + 20), // valid + cursor.isNull(offset + 21) ? null : cursor.getString(offset + 21), // watchData + cursor.isNull(offset + 22) ? null : cursor.getString(offset + 22), // wellCode + cursor.isNull(offset + 23) ? null : cursor.getString(offset + 23), // wellName + cursor.isNull(offset + 24) ? null : cursor.getString(offset + 24), // wellType + cursor.isNull(offset + 25) ? null : cursor.getString(offset + 25) // wellTypeName ); return entity; } - + @Override public void readEntity(Cursor cursor, MapWellLocalBean entity, int offset) { entity.setKId(cursor.isNull(offset + 0) ? null : cursor.getLong(offset + 0)); @@ -440,17 +435,17 @@ entity.setWellName(cursor.isNull(offset + 23) ? null : cursor.getString(offset + 23)); entity.setWellType(cursor.isNull(offset + 24) ? null : cursor.getString(offset + 24)); entity.setWellTypeName(cursor.isNull(offset + 25) ? null : cursor.getString(offset + 25)); - } - + } + @Override protected final Long updateKeyAfterInsert(MapWellLocalBean entity, long rowId) { entity.setKId(rowId); return rowId; } - + @Override public Long getKey(MapWellLocalBean entity) { - if (entity != null) { + if(entity != null) { return entity.getKId(); } else { return null; @@ -466,5 +461,5 @@ protected final boolean isEntityUpdateable() { return true; } - + } diff --git a/app/src/main/java/com/casic/app/smartwell/greendao/NoticeLocaleBeanDao.java b/app/src/main/java/com/casic/app/smartwell/greendao/NoticeLocaleBeanDao.java index 64312ed..deb2d49 100644 --- a/app/src/main/java/com/casic/app/smartwell/greendao/NoticeLocaleBeanDao.java +++ b/app/src/main/java/com/casic/app/smartwell/greendao/NoticeLocaleBeanDao.java @@ -12,10 +12,9 @@ import org.greenrobot.greendao.internal.DaoConfig; // THIS CODE IS GENERATED BY greenDAO, DO NOT EDIT. - -/** +/** * DAO for table "NOTICE_LOCALE_BEAN". - */ +*/ public class NoticeLocaleBeanDao extends AbstractDao { public static final String TABLENAME = "NOTICE_LOCALE_BEAN"; @@ -43,16 +42,14 @@ public NoticeLocaleBeanDao(DaoConfig config) { super(config); } - + public NoticeLocaleBeanDao(DaoConfig config, DaoSession daoSession) { super(config, daoSession); } - /** - * Creates the underlying database table. - */ + /** Creates the underlying database table. */ public static void createTable(Database db, boolean ifNotExists) { - String constraint = ifNotExists ? "IF NOT EXISTS " : ""; + String constraint = ifNotExists? "IF NOT EXISTS ": ""; db.execSQL("CREATE TABLE " + constraint + "\"NOTICE_LOCALE_BEAN\" (" + // "\"_id\" INTEGER PRIMARY KEY AUTOINCREMENT ," + // 0: id "\"MESSAGE_ID\" TEXT UNIQUE ," + // 1: messageId @@ -68,9 +65,7 @@ "\"NOTICE_TIME\" TEXT);"); // 11: noticeTime } - /** - * Drops the underlying database table. - */ + /** Drops the underlying database table. */ public static void dropTable(Database db, boolean ifExists) { String sql = "DROP TABLE " + (ifExists ? "IF EXISTS " : "") + "\"NOTICE_LOCALE_BEAN\""; db.execSQL(sql); @@ -79,62 +74,62 @@ @Override protected final void bindValues(DatabaseStatement stmt, NoticeLocaleBean entity) { stmt.clearBindings(); - + Long id = entity.getId(); if (id != null) { stmt.bindLong(1, id); } - + String messageId = entity.getMessageId(); if (messageId != null) { stmt.bindString(2, messageId); } - + String appid = entity.getAppid(); if (appid != null) { stmt.bindString(3, appid); } - + String clientId = entity.getClientId(); if (clientId != null) { stmt.bindString(4, clientId); } - + String taskId = entity.getTaskId(); if (taskId != null) { stmt.bindString(5, taskId); } - + String userId = entity.getUserId(); if (userId != null) { stmt.bindString(6, userId); } - + String title = entity.getTitle(); if (title != null) { stmt.bindString(7, title); } - + String content = entity.getContent(); if (content != null) { stmt.bindString(8, content); } - + String deviceCode = entity.getDeviceCode(); if (deviceCode != null) { stmt.bindString(9, deviceCode); } - + String jobId = entity.getJobId(); if (jobId != null) { stmt.bindString(10, jobId); } - + String isRead = entity.getIsRead(); if (isRead != null) { stmt.bindString(11, isRead); } - + String noticeTime = entity.getNoticeTime(); if (noticeTime != null) { stmt.bindString(12, noticeTime); @@ -144,62 +139,62 @@ @Override protected final void bindValues(SQLiteStatement stmt, NoticeLocaleBean entity) { stmt.clearBindings(); - + Long id = entity.getId(); if (id != null) { stmt.bindLong(1, id); } - + String messageId = entity.getMessageId(); if (messageId != null) { stmt.bindString(2, messageId); } - + String appid = entity.getAppid(); if (appid != null) { stmt.bindString(3, appid); } - + String clientId = entity.getClientId(); if (clientId != null) { stmt.bindString(4, clientId); } - + String taskId = entity.getTaskId(); if (taskId != null) { stmt.bindString(5, taskId); } - + String userId = entity.getUserId(); if (userId != null) { stmt.bindString(6, userId); } - + String title = entity.getTitle(); if (title != null) { stmt.bindString(7, title); } - + String content = entity.getContent(); if (content != null) { stmt.bindString(8, content); } - + String deviceCode = entity.getDeviceCode(); if (deviceCode != null) { stmt.bindString(9, deviceCode); } - + String jobId = entity.getJobId(); if (jobId != null) { stmt.bindString(10, jobId); } - + String isRead = entity.getIsRead(); if (isRead != null) { stmt.bindString(11, isRead); } - + String noticeTime = entity.getNoticeTime(); if (noticeTime != null) { stmt.bindString(12, noticeTime); @@ -209,27 +204,27 @@ @Override public Long readKey(Cursor cursor, int offset) { return cursor.isNull(offset + 0) ? null : cursor.getLong(offset + 0); - } + } @Override public NoticeLocaleBean readEntity(Cursor cursor, int offset) { NoticeLocaleBean entity = new NoticeLocaleBean( // - cursor.isNull(offset + 0) ? null : cursor.getLong(offset + 0), // id - cursor.isNull(offset + 1) ? null : cursor.getString(offset + 1), // messageId - cursor.isNull(offset + 2) ? null : cursor.getString(offset + 2), // appid - cursor.isNull(offset + 3) ? null : cursor.getString(offset + 3), // clientId - cursor.isNull(offset + 4) ? null : cursor.getString(offset + 4), // taskId - cursor.isNull(offset + 5) ? null : cursor.getString(offset + 5), // userId - cursor.isNull(offset + 6) ? null : cursor.getString(offset + 6), // title - cursor.isNull(offset + 7) ? null : cursor.getString(offset + 7), // content - cursor.isNull(offset + 8) ? null : cursor.getString(offset + 8), // deviceCode - cursor.isNull(offset + 9) ? null : cursor.getString(offset + 9), // jobId - cursor.isNull(offset + 10) ? null : cursor.getString(offset + 10), // isRead - cursor.isNull(offset + 11) ? null : cursor.getString(offset + 11) // noticeTime + cursor.isNull(offset + 0) ? null : cursor.getLong(offset + 0), // id + cursor.isNull(offset + 1) ? null : cursor.getString(offset + 1), // messageId + cursor.isNull(offset + 2) ? null : cursor.getString(offset + 2), // appid + cursor.isNull(offset + 3) ? null : cursor.getString(offset + 3), // clientId + cursor.isNull(offset + 4) ? null : cursor.getString(offset + 4), // taskId + cursor.isNull(offset + 5) ? null : cursor.getString(offset + 5), // userId + cursor.isNull(offset + 6) ? null : cursor.getString(offset + 6), // title + cursor.isNull(offset + 7) ? null : cursor.getString(offset + 7), // content + cursor.isNull(offset + 8) ? null : cursor.getString(offset + 8), // deviceCode + cursor.isNull(offset + 9) ? null : cursor.getString(offset + 9), // jobId + cursor.isNull(offset + 10) ? null : cursor.getString(offset + 10), // isRead + cursor.isNull(offset + 11) ? null : cursor.getString(offset + 11) // noticeTime ); return entity; } - + @Override public void readEntity(Cursor cursor, NoticeLocaleBean entity, int offset) { entity.setId(cursor.isNull(offset + 0) ? null : cursor.getLong(offset + 0)); @@ -244,17 +239,17 @@ entity.setJobId(cursor.isNull(offset + 9) ? null : cursor.getString(offset + 9)); entity.setIsRead(cursor.isNull(offset + 10) ? null : cursor.getString(offset + 10)); entity.setNoticeTime(cursor.isNull(offset + 11) ? null : cursor.getString(offset + 11)); - } - + } + @Override protected final Long updateKeyAfterInsert(NoticeLocaleBean entity, long rowId) { entity.setId(rowId); return rowId; } - + @Override public Long getKey(NoticeLocaleBean entity) { - if (entity != null) { + if(entity != null) { return entity.getId(); } else { return null; @@ -270,5 +265,5 @@ protected final boolean isEntityUpdateable() { return true; } - + } diff --git a/app/build.gradle b/app/build.gradle index 296fb6f..c18c251 100644 --- a/app/build.gradle +++ b/app/build.gradle @@ -40,10 +40,6 @@ // VIVO 相关应用参数 VIVO_APP_ID : "105749048", VIVO_APP_KEY : "e460fbf2c689e0f8c58ecc6aa62e1803", - - // 小米相关应用参数 -// XIAOMI_APP_ID : "", -// XIAOMI_APP_KEY : "", ] // 版本名后面添加一句话,意思就是flavor dimension 它的维度就是该版本号,多渠道打包很重要 @@ -107,7 +103,7 @@ dependencies { implementation fileTree(dir: 'libs', include: ['*.jar']) //基础依赖库 - implementation 'com.github.AndroidCoderPeng:Kotlin-lite-lib:1.0.10' + implementation 'com.github.AndroidCoderPeng:Kotlin-lite-lib:1.1.0' implementation 'androidx.appcompat:appcompat:1.6.1' implementation 'androidx.core:core-ktx:1.9.0' implementation 'androidx.constraintlayout:constraintlayout:2.1.4' @@ -165,8 +161,6 @@ implementation 'commons-codec:commons-codec:1.15' implementation 'com.android.support:support-annotations:28.0.0' implementation 'com.assist-v3:vivo:3.1.2' // vivo -// implementation 'com.getui.opt:xmp:3.3.1' // 小米 - //数据库框架 implementation 'org.greenrobot:greendao:3.3.0' //数据库升级 diff --git a/app/src/main/AndroidManifest.xml b/app/src/main/AndroidManifest.xml index c0af158..e0519bf 100644 --- a/app/src/main/AndroidManifest.xml +++ b/app/src/main/AndroidManifest.xml @@ -90,10 +90,10 @@ - + + android:value="ee96d8b5e12de3fbb29949efd57418a8" /> () @@ -150,7 +158,7 @@ val cameraPosition = CameraPosition(centerLatLng, 14f, 0f, 0f) val cameraUpdate = CameraUpdateFactory.newCameraPosition(cameraPosition) withContext(Dispatchers.Main) { - LoadingDialogHub.dismiss() + LoadingDialog.dismiss() aMap.animateCamera(cameraUpdate, 1500, null) } } @@ -239,11 +247,6 @@ } override fun initEvent() { - binding.rightOptionView.setOnClickListener { - val x = binding.rightOptionView.width - easyPopupWindow.width - easyPopupWindow.showAsDropDown(binding.rightOptionView, x, 0) - } - //撤防点位 binding.unDeployedLayout.setOnClickListener { requireContext().navigatePageTo() @@ -263,11 +266,11 @@ override fun observeRequestState() { wellViewModel.loadState.observe(this) { when (it) { - is LoadState.Loading -> LoadingDialogHub.show( + is LoadState.Loading -> LoadingDialog.show( requireActivity(), "数据加载中,请稍后..." ) - else -> LoadingDialogHub.dismiss() + else -> LoadingDialog.dismiss() } } } @@ -376,7 +379,7 @@ }).build().show() } }) - infoPopup.showAsDropDown(binding.rightOptionView) +// infoPopup.showAsDropDown(binding.rightOptionView) } override fun onCameraChange(p0: CameraPosition?) { diff --git a/app/src/main/java/com/casic/app/smartwell/fragment/HomePageNoClusterFragment.kt b/app/src/main/java/com/casic/app/smartwell/fragment/HomePageNoClusterFragment.kt index 802426a..b25f743 100644 --- a/app/src/main/java/com/casic/app/smartwell/fragment/HomePageNoClusterFragment.kt +++ b/app/src/main/java/com/casic/app/smartwell/fragment/HomePageNoClusterFragment.kt @@ -38,8 +38,9 @@ import com.pengxh.kt.lite.extensions.navigatePageTo import com.pengxh.kt.lite.extensions.show import com.pengxh.kt.lite.utils.LoadState -import com.pengxh.kt.lite.utils.LoadingDialogHub +import com.pengxh.kt.lite.utils.LoadingDialog import com.pengxh.kt.lite.widget.EasyPopupWindow +import com.pengxh.kt.lite.widget.TitleBarView import com.pengxh.kt.lite.widget.dialog.AlertControlDialog import kotlinx.coroutines.Dispatchers import kotlinx.coroutines.launch @@ -78,7 +79,15 @@ override fun setupTopBarLayout() { binding.rootView.initImmersionBar(this, false, R.color.mainThemeColor) - binding.titleView.text = "首页" + binding.titleView.setOnClickListener(object : TitleBarView.OnClickListener { + override fun onLeftClick() { + + } + + override fun onRightClick() { + easyPopupWindow.showAsDropDown(binding.titleView, binding.titleView.width, 0) + } + }) } override fun initOnCreate(savedInstanceState: Bundle?) { @@ -112,7 +121,7 @@ //渲染井位置 lifecycleScope.launch(Dispatchers.Main) { - LoadingDialogHub.show(requireActivity(), "数据加载中,请稍后") + LoadingDialog.show(requireActivity(), "数据加载中,请稍后") withContext(Dispatchers.IO) { //取Well缓存 val allMarkerOptions = ArrayList() @@ -144,7 +153,7 @@ val cameraPosition = CameraPosition(centerLatLng, 14f, 0f, 0f) val cameraUpdate = CameraUpdateFactory.newCameraPosition(cameraPosition) withContext(Dispatchers.Main) { - LoadingDialogHub.dismiss() + LoadingDialog.dismiss() aMap.animateCamera(cameraUpdate, 1500, null) } } @@ -238,11 +247,6 @@ } override fun initEvent() { - binding.rightOptionView.setOnClickListener { - val x = binding.rightOptionView.width - easyPopupWindow.width - easyPopupWindow.showAsDropDown(binding.rightOptionView, x, 0) - } - //撤防点位 binding.unDeployedLayout.setOnClickListener { requireContext().navigatePageTo() @@ -262,11 +266,11 @@ override fun observeRequestState() { wellViewModel.loadState.observe(this) { when (it) { - is LoadState.Loading -> LoadingDialogHub.show( + is LoadState.Loading -> LoadingDialog.show( requireActivity(), "数据加载中,请稍后..." ) - else -> LoadingDialogHub.dismiss() + else -> LoadingDialog.dismiss() } } } diff --git a/app/src/main/java/com/casic/app/smartwell/fragment/MinePageFragment.kt b/app/src/main/java/com/casic/app/smartwell/fragment/MinePageFragment.kt index 09a570c..dcb48f8 100644 --- a/app/src/main/java/com/casic/app/smartwell/fragment/MinePageFragment.kt +++ b/app/src/main/java/com/casic/app/smartwell/fragment/MinePageFragment.kt @@ -35,7 +35,7 @@ import com.pengxh.kt.lite.utils.ActivityStackManager import com.pengxh.kt.lite.utils.FileDownloadManager import com.pengxh.kt.lite.utils.LoadState -import com.pengxh.kt.lite.utils.LoadingDialogHub +import com.pengxh.kt.lite.utils.LoadingDialog import com.pengxh.kt.lite.widget.dialog.AlertControlDialog import com.pengxh.kt.lite.widget.dialog.BottomActionSheet import kotlinx.coroutines.Dispatchers @@ -60,7 +60,6 @@ override fun setupTopBarLayout() { binding.rootView.initImmersionBar(this, false, R.color.mainThemeColor) - binding.titleInclude.titleView.text = "我的" } override fun initOnCreate(savedInstanceState: Bundle?) { @@ -155,27 +154,27 @@ override fun observeRequestState() { userViewModel.loadState.observe(this) { when (it) { - is LoadState.Loading -> LoadingDialogHub.show( + is LoadState.Loading -> LoadingDialog.show( requireActivity(), "检查版本中,请稍后" ) - else -> LoadingDialogHub.dismiss() + else -> LoadingDialog.dismiss() } } wellViewModel.loadState.observe(this) { when (it) { - is LoadState.Loading -> LoadingDialogHub.show( + is LoadState.Loading -> LoadingDialog.show( requireActivity(), "数据更新中,请稍后" ) is LoadState.Fail -> { - LoadingDialogHub.dismiss() + LoadingDialog.dismiss() "数据更新超时".show(requireContext()) } else -> { - LoadingDialogHub.dismiss() + LoadingDialog.dismiss() AlertControlDialog.Builder().setContext(requireContext()).setTitle("温馨提示") .setMessage("数据更新成功,请重启应用").setNegativeButton("取消") .setPositiveButton("确定").setOnDialogButtonClickListener(object : @@ -197,17 +196,17 @@ lineViewModel.loadState.observe(this) { when (it) { - is LoadState.Loading -> LoadingDialogHub.show( + is LoadState.Loading -> LoadingDialog.show( requireActivity(), "数据更新中,请稍后" ) is LoadState.Fail -> { - LoadingDialogHub.dismiss() + LoadingDialog.dismiss() "数据更新超时".show(requireContext()) } else -> { - LoadingDialogHub.dismiss() + LoadingDialog.dismiss() AlertControlDialog.Builder().setContext(requireContext()).setTitle("温馨提示") .setMessage("数据更新成功,请重启应用").setNegativeButton("取消") .setPositiveButton("确定").setOnDialogButtonClickListener(object : diff --git a/app/src/main/java/com/casic/app/smartwell/fragment/NoticePageFragment.kt b/app/src/main/java/com/casic/app/smartwell/fragment/NoticePageFragment.kt index 171b555..3c93f54 100644 --- a/app/src/main/java/com/casic/app/smartwell/fragment/NoticePageFragment.kt +++ b/app/src/main/java/com/casic/app/smartwell/fragment/NoticePageFragment.kt @@ -48,7 +48,6 @@ override fun setupTopBarLayout() { binding.rootView.initImmersionBar(this, false, R.color.mainThemeColor) - binding.titleInclude.titleView.text = "消息" } override fun initOnCreate(savedInstanceState: Bundle?) { diff --git a/app/src/main/java/com/casic/app/smartwell/fragment/OrderListFragment.kt b/app/src/main/java/com/casic/app/smartwell/fragment/OrderListFragment.kt index 93ff35b..5e38acb 100644 --- a/app/src/main/java/com/casic/app/smartwell/fragment/OrderListFragment.kt +++ b/app/src/main/java/com/casic/app/smartwell/fragment/OrderListFragment.kt @@ -12,6 +12,7 @@ import com.casic.app.smartwell.view.SearchOrderActivity import com.pengxh.kt.lite.base.KotlinBaseFragment import com.pengxh.kt.lite.extensions.navigatePageTo +import com.pengxh.kt.lite.widget.TitleBarView class OrderListFragment : KotlinBaseFragment() { @@ -25,15 +26,22 @@ } override fun initViewBinding( - inflater: LayoutInflater, - container: ViewGroup? + inflater: LayoutInflater, container: ViewGroup? ): FragmentOrderBinding { return FragmentOrderBinding.inflate(inflater, container, false) } override fun setupTopBarLayout() { binding.rootView.initImmersionBar(this, false, R.color.mainThemeColor) - binding.titleView.text = "工单" + binding.titleView.setOnClickListener(object : TitleBarView.OnClickListener { + override fun onLeftClick() { + + } + + override fun onRightClick() { + requireContext().navigatePageTo() + } + }) } override fun initOnCreate(savedInstanceState: Bundle?) { @@ -51,8 +59,6 @@ } override fun initEvent() { - binding.rightOptionView.setOnClickListener { - requireContext().navigatePageTo() - } + } } \ No newline at end of file diff --git a/app/src/main/java/com/casic/app/smartwell/fragment/OrderNotProcessedFragment.kt b/app/src/main/java/com/casic/app/smartwell/fragment/OrderNotProcessedFragment.kt index 0b3d09d..2b6f21d 100644 --- a/app/src/main/java/com/casic/app/smartwell/fragment/OrderNotProcessedFragment.kt +++ b/app/src/main/java/com/casic/app/smartwell/fragment/OrderNotProcessedFragment.kt @@ -18,7 +18,7 @@ import com.pengxh.kt.lite.extensions.navigatePageTo import com.pengxh.kt.lite.extensions.show import com.pengxh.kt.lite.utils.LoadState -import com.pengxh.kt.lite.utils.LoadingDialogHub +import com.pengxh.kt.lite.utils.LoadingDialog import com.pengxh.kt.lite.utils.WeakReferenceHandler import com.pengxh.kt.lite.widget.dialog.AlertControlDialog @@ -78,8 +78,8 @@ operationViewModel = ViewModelProvider(this)[OperationViewModel::class.java] - binding.notProcessedView.addItemDecoration( - RecyclerViewItemOffsets(0, 5, 0, 5) + binding.recyclerView.addItemDecoration( + RecyclerViewItemOffsets(0, 7, 0, 7) ) } @@ -87,9 +87,9 @@ //接单状态处理 operationViewModel.loadState.observe(this) { when (it) { - is LoadState.Loading -> LoadingDialogHub.show(requireActivity(), "接单中,请稍后") + is LoadState.Loading -> LoadingDialog.show(requireActivity(), "接单中,请稍后") is LoadState.Success -> { - LoadingDialogHub.dismiss() + LoadingDialog.dismiss() //接单成功之后刷新列表 dataBeans.removeAt(clickedPosition) notProcessedAdapter.notifyItemRemoved(clickedPosition) @@ -98,7 +98,7 @@ ) } - else -> LoadingDialogHub.dismiss() + else -> LoadingDialog.dismiss() } } } @@ -131,7 +131,7 @@ } else { binding.emptyInclude.emptyView.hide() notProcessedAdapter = OrderNotProcessedAdapter(requireContext(), dataBeans) - binding.notProcessedView.adapter = notProcessedAdapter + binding.recyclerView.adapter = notProcessedAdapter notProcessedAdapter.setOnItemClickListener(object : OrderNotProcessedAdapter.OnItemClickListener { override fun onClicked(position: Int) { diff --git a/app/src/main/java/com/casic/app/smartwell/fragment/OvertimeNotAcceptFragment.kt b/app/src/main/java/com/casic/app/smartwell/fragment/OvertimeNotAcceptFragment.kt index a198545..9b318ca 100644 --- a/app/src/main/java/com/casic/app/smartwell/fragment/OvertimeNotAcceptFragment.kt +++ b/app/src/main/java/com/casic/app/smartwell/fragment/OvertimeNotAcceptFragment.kt @@ -18,7 +18,7 @@ import com.pengxh.kt.lite.extensions.navigatePageTo import com.pengxh.kt.lite.extensions.show import com.pengxh.kt.lite.utils.LoadState -import com.pengxh.kt.lite.utils.LoadingDialogHub +import com.pengxh.kt.lite.utils.LoadingDialog import com.pengxh.kt.lite.utils.WeakReferenceHandler import com.pengxh.kt.lite.widget.dialog.AlertControlDialog @@ -81,8 +81,8 @@ operationViewModel = ViewModelProvider(this)[OperationViewModel::class.java] - binding.notProcessedView.addItemDecoration( - RecyclerViewItemOffsets(0, 5, 0, 5) + binding.recyclerView.addItemDecoration( + RecyclerViewItemOffsets(0, 7, 0, 7) ) } @@ -90,9 +90,9 @@ //接单状态处理 operationViewModel.loadState.observe(this) { when (it) { - is LoadState.Loading -> LoadingDialogHub.show(requireActivity(), "接单中,请稍后") + is LoadState.Loading -> LoadingDialog.show(requireActivity(), "接单中,请稍后") is LoadState.Success -> { - LoadingDialogHub.dismiss() + LoadingDialog.dismiss() //接单成功之后刷新列表 dataBeans.removeAt(clickedPosition) notProcessedAdapter.notifyItemRemoved(clickedPosition) @@ -101,7 +101,7 @@ ) } - else -> LoadingDialogHub.dismiss() + else -> LoadingDialog.dismiss() } } } @@ -134,7 +134,7 @@ } else { binding.emptyInclude.emptyView.hide() notProcessedAdapter = OrderNotProcessedAdapter(requireContext(), dataBeans) - binding.notProcessedView.adapter = notProcessedAdapter + binding.recyclerView.adapter = notProcessedAdapter notProcessedAdapter.setOnItemClickListener(object : OrderNotProcessedAdapter.OnItemClickListener { override fun onClicked(position: Int) { diff --git a/app/src/main/java/com/casic/app/smartwell/greendao/DaoMaster.java b/app/src/main/java/com/casic/app/smartwell/greendao/DaoMaster.java index fdcf3a7..1e52b74 100644 --- a/app/src/main/java/com/casic/app/smartwell/greendao/DaoMaster.java +++ b/app/src/main/java/com/casic/app/smartwell/greendao/DaoMaster.java @@ -13,25 +13,20 @@ // THIS CODE IS GENERATED BY greenDAO, DO NOT EDIT. - /** * Master of DAO (schema version 4): knows all DAOs. */ public class DaoMaster extends AbstractDaoMaster { public static final int SCHEMA_VERSION = 4; - /** - * Creates underlying database table using DAOs. - */ + /** Creates underlying database table using DAOs. */ public static void createAllTables(Database db, boolean ifNotExists) { MapWellLocalBeanDao.createTable(db, ifNotExists); NoticeLocaleBeanDao.createTable(db, ifNotExists); PipeLocalBeanDao.createTable(db, ifNotExists); } - /** - * Drops underlying database table using DAOs. - */ + /** Drops underlying database table using DAOs. */ public static void dropAllTables(Database db, boolean ifExists) { MapWellLocalBeanDao.dropTable(db, ifExists); NoticeLocaleBeanDao.dropTable(db, ifExists); @@ -86,9 +81,7 @@ } } - /** - * WARNING: Drops all table on Upgrade! Use only during development. - */ + /** WARNING: Drops all table on Upgrade! Use only during development. */ public static class DevOpenHelper extends OpenHelper { public DevOpenHelper(Context context, String name) { super(context, name); diff --git a/app/src/main/java/com/casic/app/smartwell/greendao/DaoSession.java b/app/src/main/java/com/casic/app/smartwell/greendao/DaoSession.java index 0b36d17..3e40e3b 100644 --- a/app/src/main/java/com/casic/app/smartwell/greendao/DaoSession.java +++ b/app/src/main/java/com/casic/app/smartwell/greendao/DaoSession.java @@ -16,7 +16,7 @@ /** * {@inheritDoc} - * + * * @see org.greenrobot.greendao.AbstractDaoSession */ public class DaoSession extends AbstractDaoSession { @@ -50,7 +50,7 @@ registerDao(NoticeLocaleBean.class, noticeLocaleBeanDao); registerDao(PipeLocalBean.class, pipeLocalBeanDao); } - + public void clear() { mapWellLocalBeanDaoConfig.clearIdentityScope(); noticeLocaleBeanDaoConfig.clearIdentityScope(); diff --git a/app/src/main/java/com/casic/app/smartwell/greendao/MapWellLocalBeanDao.java b/app/src/main/java/com/casic/app/smartwell/greendao/MapWellLocalBeanDao.java index 8908fda..407bc92 100644 --- a/app/src/main/java/com/casic/app/smartwell/greendao/MapWellLocalBeanDao.java +++ b/app/src/main/java/com/casic/app/smartwell/greendao/MapWellLocalBeanDao.java @@ -12,10 +12,9 @@ import org.greenrobot.greendao.internal.DaoConfig; // THIS CODE IS GENERATED BY greenDAO, DO NOT EDIT. - -/** +/** * DAO for table "MAP_WELL_LOCAL_BEAN". - */ +*/ public class MapWellLocalBeanDao extends AbstractDao { public static final String TABLENAME = "MAP_WELL_LOCAL_BEAN"; @@ -57,16 +56,14 @@ public MapWellLocalBeanDao(DaoConfig config) { super(config); } - + public MapWellLocalBeanDao(DaoConfig config, DaoSession daoSession) { super(config, daoSession); } - /** - * Creates the underlying database table. - */ + /** Creates the underlying database table. */ public static void createTable(Database db, boolean ifNotExists) { - String constraint = ifNotExists ? "IF NOT EXISTS " : ""; + String constraint = ifNotExists? "IF NOT EXISTS ": ""; db.execSQL("CREATE TABLE " + constraint + "\"MAP_WELL_LOCAL_BEAN\" (" + // "\"_id\" INTEGER PRIMARY KEY AUTOINCREMENT ," + // 0: kId "\"AREA\" TEXT," + // 1: area @@ -96,9 +93,7 @@ "\"WELL_TYPE_NAME\" TEXT);"); // 25: wellTypeName } - /** - * Drops the underlying database table. - */ + /** Drops the underlying database table. */ public static void dropTable(Database db, boolean ifExists) { String sql = "DROP TABLE " + (ifExists ? "IF EXISTS " : "") + "\"MAP_WELL_LOCAL_BEAN\""; db.execSQL(sql); @@ -107,132 +102,132 @@ @Override protected final void bindValues(DatabaseStatement stmt, MapWellLocalBean entity) { stmt.clearBindings(); - + Long kId = entity.getKId(); if (kId != null) { stmt.bindLong(1, kId); } - + String area = entity.getArea(); if (area != null) { stmt.bindString(2, area); } - + String bfzt = entity.getBfzt(); if (bfzt != null) { stmt.bindString(3, bfzt); } - + String bfztName = entity.getBfztName(); if (bfztName != null) { stmt.bindString(4, bfztName); } - + String coordinateX = entity.getCoordinateX(); if (coordinateX != null) { stmt.bindString(5, coordinateX); } - + String coordinateY = entity.getCoordinateY(); if (coordinateY != null) { stmt.bindString(6, coordinateY); } - + String deep = entity.getDeep(); if (deep != null) { stmt.bindString(7, deep); } - + String deptName = entity.getDeptName(); if (deptName != null) { stmt.bindString(8, deptName); } - + String deptid = entity.getDeptid(); if (deptid != null) { stmt.bindString(9, deptid); } - + String id = entity.getId(); if (id != null) { stmt.bindString(10, id); } - + String latBaidu = entity.getLatBaidu(); if (latBaidu != null) { stmt.bindString(11, latBaidu); } - + String latGaode = entity.getLatGaode(); if (latGaode != null) { stmt.bindString(12, latGaode); } - + String lngBaidu = entity.getLngBaidu(); if (lngBaidu != null) { stmt.bindString(13, lngBaidu); } - + String lngGaode = entity.getLngGaode(); if (lngGaode != null) { stmt.bindString(14, lngGaode); } - + String notes = entity.getNotes(); if (notes != null) { stmt.bindString(15, notes); } - + String photos = entity.getPhotos(); if (photos != null) { stmt.bindString(16, photos); } - + String position = entity.getPosition(); if (position != null) { stmt.bindString(17, position); } - + String staff = entity.getStaff(); if (staff != null) { stmt.bindString(18, staff); } - + String tel = entity.getTel(); if (tel != null) { stmt.bindString(19, tel); } - + String ts = entity.getTs(); if (ts != null) { stmt.bindString(20, ts); } - + String valid = entity.getValid(); if (valid != null) { stmt.bindString(21, valid); } - + String watchData = entity.getWatchData(); if (watchData != null) { stmt.bindString(22, watchData); } - + String wellCode = entity.getWellCode(); if (wellCode != null) { stmt.bindString(23, wellCode); } - + String wellName = entity.getWellName(); if (wellName != null) { stmt.bindString(24, wellName); } - + String wellType = entity.getWellType(); if (wellType != null) { stmt.bindString(25, wellType); } - + String wellTypeName = entity.getWellTypeName(); if (wellTypeName != null) { stmt.bindString(26, wellTypeName); @@ -242,132 +237,132 @@ @Override protected final void bindValues(SQLiteStatement stmt, MapWellLocalBean entity) { stmt.clearBindings(); - + Long kId = entity.getKId(); if (kId != null) { stmt.bindLong(1, kId); } - + String area = entity.getArea(); if (area != null) { stmt.bindString(2, area); } - + String bfzt = entity.getBfzt(); if (bfzt != null) { stmt.bindString(3, bfzt); } - + String bfztName = entity.getBfztName(); if (bfztName != null) { stmt.bindString(4, bfztName); } - + String coordinateX = entity.getCoordinateX(); if (coordinateX != null) { stmt.bindString(5, coordinateX); } - + String coordinateY = entity.getCoordinateY(); if (coordinateY != null) { stmt.bindString(6, coordinateY); } - + String deep = entity.getDeep(); if (deep != null) { stmt.bindString(7, deep); } - + String deptName = entity.getDeptName(); if (deptName != null) { stmt.bindString(8, deptName); } - + String deptid = entity.getDeptid(); if (deptid != null) { stmt.bindString(9, deptid); } - + String id = entity.getId(); if (id != null) { stmt.bindString(10, id); } - + String latBaidu = entity.getLatBaidu(); if (latBaidu != null) { stmt.bindString(11, latBaidu); } - + String latGaode = entity.getLatGaode(); if (latGaode != null) { stmt.bindString(12, latGaode); } - + String lngBaidu = entity.getLngBaidu(); if (lngBaidu != null) { stmt.bindString(13, lngBaidu); } - + String lngGaode = entity.getLngGaode(); if (lngGaode != null) { stmt.bindString(14, lngGaode); } - + String notes = entity.getNotes(); if (notes != null) { stmt.bindString(15, notes); } - + String photos = entity.getPhotos(); if (photos != null) { stmt.bindString(16, photos); } - + String position = entity.getPosition(); if (position != null) { stmt.bindString(17, position); } - + String staff = entity.getStaff(); if (staff != null) { stmt.bindString(18, staff); } - + String tel = entity.getTel(); if (tel != null) { stmt.bindString(19, tel); } - + String ts = entity.getTs(); if (ts != null) { stmt.bindString(20, ts); } - + String valid = entity.getValid(); if (valid != null) { stmt.bindString(21, valid); } - + String watchData = entity.getWatchData(); if (watchData != null) { stmt.bindString(22, watchData); } - + String wellCode = entity.getWellCode(); if (wellCode != null) { stmt.bindString(23, wellCode); } - + String wellName = entity.getWellName(); if (wellName != null) { stmt.bindString(24, wellName); } - + String wellType = entity.getWellType(); if (wellType != null) { stmt.bindString(25, wellType); } - + String wellTypeName = entity.getWellTypeName(); if (wellTypeName != null) { stmt.bindString(26, wellTypeName); @@ -377,41 +372,41 @@ @Override public Long readKey(Cursor cursor, int offset) { return cursor.isNull(offset + 0) ? null : cursor.getLong(offset + 0); - } + } @Override public MapWellLocalBean readEntity(Cursor cursor, int offset) { MapWellLocalBean entity = new MapWellLocalBean( // - cursor.isNull(offset + 0) ? null : cursor.getLong(offset + 0), // kId - cursor.isNull(offset + 1) ? null : cursor.getString(offset + 1), // area - cursor.isNull(offset + 2) ? null : cursor.getString(offset + 2), // bfzt - cursor.isNull(offset + 3) ? null : cursor.getString(offset + 3), // bfztName - cursor.isNull(offset + 4) ? null : cursor.getString(offset + 4), // coordinateX - cursor.isNull(offset + 5) ? null : cursor.getString(offset + 5), // coordinateY - cursor.isNull(offset + 6) ? null : cursor.getString(offset + 6), // deep - cursor.isNull(offset + 7) ? null : cursor.getString(offset + 7), // deptName - cursor.isNull(offset + 8) ? null : cursor.getString(offset + 8), // deptid - cursor.isNull(offset + 9) ? null : cursor.getString(offset + 9), // id - cursor.isNull(offset + 10) ? null : cursor.getString(offset + 10), // latBaidu - cursor.isNull(offset + 11) ? null : cursor.getString(offset + 11), // latGaode - cursor.isNull(offset + 12) ? null : cursor.getString(offset + 12), // lngBaidu - cursor.isNull(offset + 13) ? null : cursor.getString(offset + 13), // lngGaode - cursor.isNull(offset + 14) ? null : cursor.getString(offset + 14), // notes - cursor.isNull(offset + 15) ? null : cursor.getString(offset + 15), // photos - cursor.isNull(offset + 16) ? null : cursor.getString(offset + 16), // position - cursor.isNull(offset + 17) ? null : cursor.getString(offset + 17), // staff - cursor.isNull(offset + 18) ? null : cursor.getString(offset + 18), // tel - cursor.isNull(offset + 19) ? null : cursor.getString(offset + 19), // ts - cursor.isNull(offset + 20) ? null : cursor.getString(offset + 20), // valid - cursor.isNull(offset + 21) ? null : cursor.getString(offset + 21), // watchData - cursor.isNull(offset + 22) ? null : cursor.getString(offset + 22), // wellCode - cursor.isNull(offset + 23) ? null : cursor.getString(offset + 23), // wellName - cursor.isNull(offset + 24) ? null : cursor.getString(offset + 24), // wellType - cursor.isNull(offset + 25) ? null : cursor.getString(offset + 25) // wellTypeName + cursor.isNull(offset + 0) ? null : cursor.getLong(offset + 0), // kId + cursor.isNull(offset + 1) ? null : cursor.getString(offset + 1), // area + cursor.isNull(offset + 2) ? null : cursor.getString(offset + 2), // bfzt + cursor.isNull(offset + 3) ? null : cursor.getString(offset + 3), // bfztName + cursor.isNull(offset + 4) ? null : cursor.getString(offset + 4), // coordinateX + cursor.isNull(offset + 5) ? null : cursor.getString(offset + 5), // coordinateY + cursor.isNull(offset + 6) ? null : cursor.getString(offset + 6), // deep + cursor.isNull(offset + 7) ? null : cursor.getString(offset + 7), // deptName + cursor.isNull(offset + 8) ? null : cursor.getString(offset + 8), // deptid + cursor.isNull(offset + 9) ? null : cursor.getString(offset + 9), // id + cursor.isNull(offset + 10) ? null : cursor.getString(offset + 10), // latBaidu + cursor.isNull(offset + 11) ? null : cursor.getString(offset + 11), // latGaode + cursor.isNull(offset + 12) ? null : cursor.getString(offset + 12), // lngBaidu + cursor.isNull(offset + 13) ? null : cursor.getString(offset + 13), // lngGaode + cursor.isNull(offset + 14) ? null : cursor.getString(offset + 14), // notes + cursor.isNull(offset + 15) ? null : cursor.getString(offset + 15), // photos + cursor.isNull(offset + 16) ? null : cursor.getString(offset + 16), // position + cursor.isNull(offset + 17) ? null : cursor.getString(offset + 17), // staff + cursor.isNull(offset + 18) ? null : cursor.getString(offset + 18), // tel + cursor.isNull(offset + 19) ? null : cursor.getString(offset + 19), // ts + cursor.isNull(offset + 20) ? null : cursor.getString(offset + 20), // valid + cursor.isNull(offset + 21) ? null : cursor.getString(offset + 21), // watchData + cursor.isNull(offset + 22) ? null : cursor.getString(offset + 22), // wellCode + cursor.isNull(offset + 23) ? null : cursor.getString(offset + 23), // wellName + cursor.isNull(offset + 24) ? null : cursor.getString(offset + 24), // wellType + cursor.isNull(offset + 25) ? null : cursor.getString(offset + 25) // wellTypeName ); return entity; } - + @Override public void readEntity(Cursor cursor, MapWellLocalBean entity, int offset) { entity.setKId(cursor.isNull(offset + 0) ? null : cursor.getLong(offset + 0)); @@ -440,17 +435,17 @@ entity.setWellName(cursor.isNull(offset + 23) ? null : cursor.getString(offset + 23)); entity.setWellType(cursor.isNull(offset + 24) ? null : cursor.getString(offset + 24)); entity.setWellTypeName(cursor.isNull(offset + 25) ? null : cursor.getString(offset + 25)); - } - + } + @Override protected final Long updateKeyAfterInsert(MapWellLocalBean entity, long rowId) { entity.setKId(rowId); return rowId; } - + @Override public Long getKey(MapWellLocalBean entity) { - if (entity != null) { + if(entity != null) { return entity.getKId(); } else { return null; @@ -466,5 +461,5 @@ protected final boolean isEntityUpdateable() { return true; } - + } diff --git a/app/src/main/java/com/casic/app/smartwell/greendao/NoticeLocaleBeanDao.java b/app/src/main/java/com/casic/app/smartwell/greendao/NoticeLocaleBeanDao.java index 64312ed..deb2d49 100644 --- a/app/src/main/java/com/casic/app/smartwell/greendao/NoticeLocaleBeanDao.java +++ b/app/src/main/java/com/casic/app/smartwell/greendao/NoticeLocaleBeanDao.java @@ -12,10 +12,9 @@ import org.greenrobot.greendao.internal.DaoConfig; // THIS CODE IS GENERATED BY greenDAO, DO NOT EDIT. - -/** +/** * DAO for table "NOTICE_LOCALE_BEAN". - */ +*/ public class NoticeLocaleBeanDao extends AbstractDao { public static final String TABLENAME = "NOTICE_LOCALE_BEAN"; @@ -43,16 +42,14 @@ public NoticeLocaleBeanDao(DaoConfig config) { super(config); } - + public NoticeLocaleBeanDao(DaoConfig config, DaoSession daoSession) { super(config, daoSession); } - /** - * Creates the underlying database table. - */ + /** Creates the underlying database table. */ public static void createTable(Database db, boolean ifNotExists) { - String constraint = ifNotExists ? "IF NOT EXISTS " : ""; + String constraint = ifNotExists? "IF NOT EXISTS ": ""; db.execSQL("CREATE TABLE " + constraint + "\"NOTICE_LOCALE_BEAN\" (" + // "\"_id\" INTEGER PRIMARY KEY AUTOINCREMENT ," + // 0: id "\"MESSAGE_ID\" TEXT UNIQUE ," + // 1: messageId @@ -68,9 +65,7 @@ "\"NOTICE_TIME\" TEXT);"); // 11: noticeTime } - /** - * Drops the underlying database table. - */ + /** Drops the underlying database table. */ public static void dropTable(Database db, boolean ifExists) { String sql = "DROP TABLE " + (ifExists ? "IF EXISTS " : "") + "\"NOTICE_LOCALE_BEAN\""; db.execSQL(sql); @@ -79,62 +74,62 @@ @Override protected final void bindValues(DatabaseStatement stmt, NoticeLocaleBean entity) { stmt.clearBindings(); - + Long id = entity.getId(); if (id != null) { stmt.bindLong(1, id); } - + String messageId = entity.getMessageId(); if (messageId != null) { stmt.bindString(2, messageId); } - + String appid = entity.getAppid(); if (appid != null) { stmt.bindString(3, appid); } - + String clientId = entity.getClientId(); if (clientId != null) { stmt.bindString(4, clientId); } - + String taskId = entity.getTaskId(); if (taskId != null) { stmt.bindString(5, taskId); } - + String userId = entity.getUserId(); if (userId != null) { stmt.bindString(6, userId); } - + String title = entity.getTitle(); if (title != null) { stmt.bindString(7, title); } - + String content = entity.getContent(); if (content != null) { stmt.bindString(8, content); } - + String deviceCode = entity.getDeviceCode(); if (deviceCode != null) { stmt.bindString(9, deviceCode); } - + String jobId = entity.getJobId(); if (jobId != null) { stmt.bindString(10, jobId); } - + String isRead = entity.getIsRead(); if (isRead != null) { stmt.bindString(11, isRead); } - + String noticeTime = entity.getNoticeTime(); if (noticeTime != null) { stmt.bindString(12, noticeTime); @@ -144,62 +139,62 @@ @Override protected final void bindValues(SQLiteStatement stmt, NoticeLocaleBean entity) { stmt.clearBindings(); - + Long id = entity.getId(); if (id != null) { stmt.bindLong(1, id); } - + String messageId = entity.getMessageId(); if (messageId != null) { stmt.bindString(2, messageId); } - + String appid = entity.getAppid(); if (appid != null) { stmt.bindString(3, appid); } - + String clientId = entity.getClientId(); if (clientId != null) { stmt.bindString(4, clientId); } - + String taskId = entity.getTaskId(); if (taskId != null) { stmt.bindString(5, taskId); } - + String userId = entity.getUserId(); if (userId != null) { stmt.bindString(6, userId); } - + String title = entity.getTitle(); if (title != null) { stmt.bindString(7, title); } - + String content = entity.getContent(); if (content != null) { stmt.bindString(8, content); } - + String deviceCode = entity.getDeviceCode(); if (deviceCode != null) { stmt.bindString(9, deviceCode); } - + String jobId = entity.getJobId(); if (jobId != null) { stmt.bindString(10, jobId); } - + String isRead = entity.getIsRead(); if (isRead != null) { stmt.bindString(11, isRead); } - + String noticeTime = entity.getNoticeTime(); if (noticeTime != null) { stmt.bindString(12, noticeTime); @@ -209,27 +204,27 @@ @Override public Long readKey(Cursor cursor, int offset) { return cursor.isNull(offset + 0) ? null : cursor.getLong(offset + 0); - } + } @Override public NoticeLocaleBean readEntity(Cursor cursor, int offset) { NoticeLocaleBean entity = new NoticeLocaleBean( // - cursor.isNull(offset + 0) ? null : cursor.getLong(offset + 0), // id - cursor.isNull(offset + 1) ? null : cursor.getString(offset + 1), // messageId - cursor.isNull(offset + 2) ? null : cursor.getString(offset + 2), // appid - cursor.isNull(offset + 3) ? null : cursor.getString(offset + 3), // clientId - cursor.isNull(offset + 4) ? null : cursor.getString(offset + 4), // taskId - cursor.isNull(offset + 5) ? null : cursor.getString(offset + 5), // userId - cursor.isNull(offset + 6) ? null : cursor.getString(offset + 6), // title - cursor.isNull(offset + 7) ? null : cursor.getString(offset + 7), // content - cursor.isNull(offset + 8) ? null : cursor.getString(offset + 8), // deviceCode - cursor.isNull(offset + 9) ? null : cursor.getString(offset + 9), // jobId - cursor.isNull(offset + 10) ? null : cursor.getString(offset + 10), // isRead - cursor.isNull(offset + 11) ? null : cursor.getString(offset + 11) // noticeTime + cursor.isNull(offset + 0) ? null : cursor.getLong(offset + 0), // id + cursor.isNull(offset + 1) ? null : cursor.getString(offset + 1), // messageId + cursor.isNull(offset + 2) ? null : cursor.getString(offset + 2), // appid + cursor.isNull(offset + 3) ? null : cursor.getString(offset + 3), // clientId + cursor.isNull(offset + 4) ? null : cursor.getString(offset + 4), // taskId + cursor.isNull(offset + 5) ? null : cursor.getString(offset + 5), // userId + cursor.isNull(offset + 6) ? null : cursor.getString(offset + 6), // title + cursor.isNull(offset + 7) ? null : cursor.getString(offset + 7), // content + cursor.isNull(offset + 8) ? null : cursor.getString(offset + 8), // deviceCode + cursor.isNull(offset + 9) ? null : cursor.getString(offset + 9), // jobId + cursor.isNull(offset + 10) ? null : cursor.getString(offset + 10), // isRead + cursor.isNull(offset + 11) ? null : cursor.getString(offset + 11) // noticeTime ); return entity; } - + @Override public void readEntity(Cursor cursor, NoticeLocaleBean entity, int offset) { entity.setId(cursor.isNull(offset + 0) ? null : cursor.getLong(offset + 0)); @@ -244,17 +239,17 @@ entity.setJobId(cursor.isNull(offset + 9) ? null : cursor.getString(offset + 9)); entity.setIsRead(cursor.isNull(offset + 10) ? null : cursor.getString(offset + 10)); entity.setNoticeTime(cursor.isNull(offset + 11) ? null : cursor.getString(offset + 11)); - } - + } + @Override protected final Long updateKeyAfterInsert(NoticeLocaleBean entity, long rowId) { entity.setId(rowId); return rowId; } - + @Override public Long getKey(NoticeLocaleBean entity) { - if (entity != null) { + if(entity != null) { return entity.getId(); } else { return null; @@ -270,5 +265,5 @@ protected final boolean isEntityUpdateable() { return true; } - + } diff --git a/app/src/main/java/com/casic/app/smartwell/greendao/PipeLocalBeanDao.java b/app/src/main/java/com/casic/app/smartwell/greendao/PipeLocalBeanDao.java index aab4d3f..df5515a 100644 --- a/app/src/main/java/com/casic/app/smartwell/greendao/PipeLocalBeanDao.java +++ b/app/src/main/java/com/casic/app/smartwell/greendao/PipeLocalBeanDao.java @@ -12,10 +12,9 @@ import org.greenrobot.greendao.internal.DaoConfig; // THIS CODE IS GENERATED BY greenDAO, DO NOT EDIT. - -/** +/** * DAO for table "PIPE_LOCAL_BEAN". - */ +*/ public class PipeLocalBeanDao extends AbstractDao { public static final String TABLENAME = "PIPE_LOCAL_BEAN"; @@ -37,16 +36,14 @@ public PipeLocalBeanDao(DaoConfig config) { super(config); } - + public PipeLocalBeanDao(DaoConfig config, DaoSession daoSession) { super(config, daoSession); } - /** - * Creates the underlying database table. - */ + /** Creates the underlying database table. */ public static void createTable(Database db, boolean ifNotExists) { - String constraint = ifNotExists ? "IF NOT EXISTS " : ""; + String constraint = ifNotExists? "IF NOT EXISTS ": ""; db.execSQL("CREATE TABLE " + constraint + "\"PIPE_LOCAL_BEAN\" (" + // "\"_id\" INTEGER PRIMARY KEY AUTOINCREMENT ," + // 0: id "\"PIPE_CODE\" TEXT," + // 1: pipeCode @@ -56,9 +53,7 @@ "\"START_LONGITUDE_GD\" TEXT);"); // 5: startLongitudeGd } - /** - * Drops the underlying database table. - */ + /** Drops the underlying database table. */ public static void dropTable(Database db, boolean ifExists) { String sql = "DROP TABLE " + (ifExists ? "IF EXISTS " : "") + "\"PIPE_LOCAL_BEAN\""; db.execSQL(sql); @@ -67,32 +62,32 @@ @Override protected final void bindValues(DatabaseStatement stmt, PipeLocalBean entity) { stmt.clearBindings(); - + Long id = entity.getId(); if (id != null) { stmt.bindLong(1, id); } - + String pipeCode = entity.getPipeCode(); if (pipeCode != null) { stmt.bindString(2, pipeCode); } - + String endLatitudeGd = entity.getEndLatitudeGd(); if (endLatitudeGd != null) { stmt.bindString(3, endLatitudeGd); } - + String endLongitudeGd = entity.getEndLongitudeGd(); if (endLongitudeGd != null) { stmt.bindString(4, endLongitudeGd); } - + String startLatitudeGd = entity.getStartLatitudeGd(); if (startLatitudeGd != null) { stmt.bindString(5, startLatitudeGd); } - + String startLongitudeGd = entity.getStartLongitudeGd(); if (startLongitudeGd != null) { stmt.bindString(6, startLongitudeGd); @@ -102,32 +97,32 @@ @Override protected final void bindValues(SQLiteStatement stmt, PipeLocalBean entity) { stmt.clearBindings(); - + Long id = entity.getId(); if (id != null) { stmt.bindLong(1, id); } - + String pipeCode = entity.getPipeCode(); if (pipeCode != null) { stmt.bindString(2, pipeCode); } - + String endLatitudeGd = entity.getEndLatitudeGd(); if (endLatitudeGd != null) { stmt.bindString(3, endLatitudeGd); } - + String endLongitudeGd = entity.getEndLongitudeGd(); if (endLongitudeGd != null) { stmt.bindString(4, endLongitudeGd); } - + String startLatitudeGd = entity.getStartLatitudeGd(); if (startLatitudeGd != null) { stmt.bindString(5, startLatitudeGd); } - + String startLongitudeGd = entity.getStartLongitudeGd(); if (startLongitudeGd != null) { stmt.bindString(6, startLongitudeGd); @@ -137,21 +132,21 @@ @Override public Long readKey(Cursor cursor, int offset) { return cursor.isNull(offset + 0) ? null : cursor.getLong(offset + 0); - } + } @Override public PipeLocalBean readEntity(Cursor cursor, int offset) { PipeLocalBean entity = new PipeLocalBean( // - cursor.isNull(offset + 0) ? null : cursor.getLong(offset + 0), // id - cursor.isNull(offset + 1) ? null : cursor.getString(offset + 1), // pipeCode - cursor.isNull(offset + 2) ? null : cursor.getString(offset + 2), // endLatitudeGd - cursor.isNull(offset + 3) ? null : cursor.getString(offset + 3), // endLongitudeGd - cursor.isNull(offset + 4) ? null : cursor.getString(offset + 4), // startLatitudeGd - cursor.isNull(offset + 5) ? null : cursor.getString(offset + 5) // startLongitudeGd + cursor.isNull(offset + 0) ? null : cursor.getLong(offset + 0), // id + cursor.isNull(offset + 1) ? null : cursor.getString(offset + 1), // pipeCode + cursor.isNull(offset + 2) ? null : cursor.getString(offset + 2), // endLatitudeGd + cursor.isNull(offset + 3) ? null : cursor.getString(offset + 3), // endLongitudeGd + cursor.isNull(offset + 4) ? null : cursor.getString(offset + 4), // startLatitudeGd + cursor.isNull(offset + 5) ? null : cursor.getString(offset + 5) // startLongitudeGd ); return entity; } - + @Override public void readEntity(Cursor cursor, PipeLocalBean entity, int offset) { entity.setId(cursor.isNull(offset + 0) ? null : cursor.getLong(offset + 0)); @@ -160,17 +155,17 @@ entity.setEndLongitudeGd(cursor.isNull(offset + 3) ? null : cursor.getString(offset + 3)); entity.setStartLatitudeGd(cursor.isNull(offset + 4) ? null : cursor.getString(offset + 4)); entity.setStartLongitudeGd(cursor.isNull(offset + 5) ? null : cursor.getString(offset + 5)); - } - + } + @Override protected final Long updateKeyAfterInsert(PipeLocalBean entity, long rowId) { entity.setId(rowId); return rowId; } - + @Override public Long getKey(PipeLocalBean entity) { - if (entity != null) { + if(entity != null) { return entity.getId(); } else { return null; @@ -186,5 +181,5 @@ protected final boolean isEntityUpdateable() { return true; } - + } diff --git a/app/build.gradle b/app/build.gradle index 296fb6f..c18c251 100644 --- a/app/build.gradle +++ b/app/build.gradle @@ -40,10 +40,6 @@ // VIVO 相关应用参数 VIVO_APP_ID : "105749048", VIVO_APP_KEY : "e460fbf2c689e0f8c58ecc6aa62e1803", - - // 小米相关应用参数 -// XIAOMI_APP_ID : "", -// XIAOMI_APP_KEY : "", ] // 版本名后面添加一句话,意思就是flavor dimension 它的维度就是该版本号,多渠道打包很重要 @@ -107,7 +103,7 @@ dependencies { implementation fileTree(dir: 'libs', include: ['*.jar']) //基础依赖库 - implementation 'com.github.AndroidCoderPeng:Kotlin-lite-lib:1.0.10' + implementation 'com.github.AndroidCoderPeng:Kotlin-lite-lib:1.1.0' implementation 'androidx.appcompat:appcompat:1.6.1' implementation 'androidx.core:core-ktx:1.9.0' implementation 'androidx.constraintlayout:constraintlayout:2.1.4' @@ -165,8 +161,6 @@ implementation 'commons-codec:commons-codec:1.15' implementation 'com.android.support:support-annotations:28.0.0' implementation 'com.assist-v3:vivo:3.1.2' // vivo -// implementation 'com.getui.opt:xmp:3.3.1' // 小米 - //数据库框架 implementation 'org.greenrobot:greendao:3.3.0' //数据库升级 diff --git a/app/src/main/AndroidManifest.xml b/app/src/main/AndroidManifest.xml index c0af158..e0519bf 100644 --- a/app/src/main/AndroidManifest.xml +++ b/app/src/main/AndroidManifest.xml @@ -90,10 +90,10 @@ - + + android:value="ee96d8b5e12de3fbb29949efd57418a8" /> () @@ -150,7 +158,7 @@ val cameraPosition = CameraPosition(centerLatLng, 14f, 0f, 0f) val cameraUpdate = CameraUpdateFactory.newCameraPosition(cameraPosition) withContext(Dispatchers.Main) { - LoadingDialogHub.dismiss() + LoadingDialog.dismiss() aMap.animateCamera(cameraUpdate, 1500, null) } } @@ -239,11 +247,6 @@ } override fun initEvent() { - binding.rightOptionView.setOnClickListener { - val x = binding.rightOptionView.width - easyPopupWindow.width - easyPopupWindow.showAsDropDown(binding.rightOptionView, x, 0) - } - //撤防点位 binding.unDeployedLayout.setOnClickListener { requireContext().navigatePageTo() @@ -263,11 +266,11 @@ override fun observeRequestState() { wellViewModel.loadState.observe(this) { when (it) { - is LoadState.Loading -> LoadingDialogHub.show( + is LoadState.Loading -> LoadingDialog.show( requireActivity(), "数据加载中,请稍后..." ) - else -> LoadingDialogHub.dismiss() + else -> LoadingDialog.dismiss() } } } @@ -376,7 +379,7 @@ }).build().show() } }) - infoPopup.showAsDropDown(binding.rightOptionView) +// infoPopup.showAsDropDown(binding.rightOptionView) } override fun onCameraChange(p0: CameraPosition?) { diff --git a/app/src/main/java/com/casic/app/smartwell/fragment/HomePageNoClusterFragment.kt b/app/src/main/java/com/casic/app/smartwell/fragment/HomePageNoClusterFragment.kt index 802426a..b25f743 100644 --- a/app/src/main/java/com/casic/app/smartwell/fragment/HomePageNoClusterFragment.kt +++ b/app/src/main/java/com/casic/app/smartwell/fragment/HomePageNoClusterFragment.kt @@ -38,8 +38,9 @@ import com.pengxh.kt.lite.extensions.navigatePageTo import com.pengxh.kt.lite.extensions.show import com.pengxh.kt.lite.utils.LoadState -import com.pengxh.kt.lite.utils.LoadingDialogHub +import com.pengxh.kt.lite.utils.LoadingDialog import com.pengxh.kt.lite.widget.EasyPopupWindow +import com.pengxh.kt.lite.widget.TitleBarView import com.pengxh.kt.lite.widget.dialog.AlertControlDialog import kotlinx.coroutines.Dispatchers import kotlinx.coroutines.launch @@ -78,7 +79,15 @@ override fun setupTopBarLayout() { binding.rootView.initImmersionBar(this, false, R.color.mainThemeColor) - binding.titleView.text = "首页" + binding.titleView.setOnClickListener(object : TitleBarView.OnClickListener { + override fun onLeftClick() { + + } + + override fun onRightClick() { + easyPopupWindow.showAsDropDown(binding.titleView, binding.titleView.width, 0) + } + }) } override fun initOnCreate(savedInstanceState: Bundle?) { @@ -112,7 +121,7 @@ //渲染井位置 lifecycleScope.launch(Dispatchers.Main) { - LoadingDialogHub.show(requireActivity(), "数据加载中,请稍后") + LoadingDialog.show(requireActivity(), "数据加载中,请稍后") withContext(Dispatchers.IO) { //取Well缓存 val allMarkerOptions = ArrayList() @@ -144,7 +153,7 @@ val cameraPosition = CameraPosition(centerLatLng, 14f, 0f, 0f) val cameraUpdate = CameraUpdateFactory.newCameraPosition(cameraPosition) withContext(Dispatchers.Main) { - LoadingDialogHub.dismiss() + LoadingDialog.dismiss() aMap.animateCamera(cameraUpdate, 1500, null) } } @@ -238,11 +247,6 @@ } override fun initEvent() { - binding.rightOptionView.setOnClickListener { - val x = binding.rightOptionView.width - easyPopupWindow.width - easyPopupWindow.showAsDropDown(binding.rightOptionView, x, 0) - } - //撤防点位 binding.unDeployedLayout.setOnClickListener { requireContext().navigatePageTo() @@ -262,11 +266,11 @@ override fun observeRequestState() { wellViewModel.loadState.observe(this) { when (it) { - is LoadState.Loading -> LoadingDialogHub.show( + is LoadState.Loading -> LoadingDialog.show( requireActivity(), "数据加载中,请稍后..." ) - else -> LoadingDialogHub.dismiss() + else -> LoadingDialog.dismiss() } } } diff --git a/app/src/main/java/com/casic/app/smartwell/fragment/MinePageFragment.kt b/app/src/main/java/com/casic/app/smartwell/fragment/MinePageFragment.kt index 09a570c..dcb48f8 100644 --- a/app/src/main/java/com/casic/app/smartwell/fragment/MinePageFragment.kt +++ b/app/src/main/java/com/casic/app/smartwell/fragment/MinePageFragment.kt @@ -35,7 +35,7 @@ import com.pengxh.kt.lite.utils.ActivityStackManager import com.pengxh.kt.lite.utils.FileDownloadManager import com.pengxh.kt.lite.utils.LoadState -import com.pengxh.kt.lite.utils.LoadingDialogHub +import com.pengxh.kt.lite.utils.LoadingDialog import com.pengxh.kt.lite.widget.dialog.AlertControlDialog import com.pengxh.kt.lite.widget.dialog.BottomActionSheet import kotlinx.coroutines.Dispatchers @@ -60,7 +60,6 @@ override fun setupTopBarLayout() { binding.rootView.initImmersionBar(this, false, R.color.mainThemeColor) - binding.titleInclude.titleView.text = "我的" } override fun initOnCreate(savedInstanceState: Bundle?) { @@ -155,27 +154,27 @@ override fun observeRequestState() { userViewModel.loadState.observe(this) { when (it) { - is LoadState.Loading -> LoadingDialogHub.show( + is LoadState.Loading -> LoadingDialog.show( requireActivity(), "检查版本中,请稍后" ) - else -> LoadingDialogHub.dismiss() + else -> LoadingDialog.dismiss() } } wellViewModel.loadState.observe(this) { when (it) { - is LoadState.Loading -> LoadingDialogHub.show( + is LoadState.Loading -> LoadingDialog.show( requireActivity(), "数据更新中,请稍后" ) is LoadState.Fail -> { - LoadingDialogHub.dismiss() + LoadingDialog.dismiss() "数据更新超时".show(requireContext()) } else -> { - LoadingDialogHub.dismiss() + LoadingDialog.dismiss() AlertControlDialog.Builder().setContext(requireContext()).setTitle("温馨提示") .setMessage("数据更新成功,请重启应用").setNegativeButton("取消") .setPositiveButton("确定").setOnDialogButtonClickListener(object : @@ -197,17 +196,17 @@ lineViewModel.loadState.observe(this) { when (it) { - is LoadState.Loading -> LoadingDialogHub.show( + is LoadState.Loading -> LoadingDialog.show( requireActivity(), "数据更新中,请稍后" ) is LoadState.Fail -> { - LoadingDialogHub.dismiss() + LoadingDialog.dismiss() "数据更新超时".show(requireContext()) } else -> { - LoadingDialogHub.dismiss() + LoadingDialog.dismiss() AlertControlDialog.Builder().setContext(requireContext()).setTitle("温馨提示") .setMessage("数据更新成功,请重启应用").setNegativeButton("取消") .setPositiveButton("确定").setOnDialogButtonClickListener(object : diff --git a/app/src/main/java/com/casic/app/smartwell/fragment/NoticePageFragment.kt b/app/src/main/java/com/casic/app/smartwell/fragment/NoticePageFragment.kt index 171b555..3c93f54 100644 --- a/app/src/main/java/com/casic/app/smartwell/fragment/NoticePageFragment.kt +++ b/app/src/main/java/com/casic/app/smartwell/fragment/NoticePageFragment.kt @@ -48,7 +48,6 @@ override fun setupTopBarLayout() { binding.rootView.initImmersionBar(this, false, R.color.mainThemeColor) - binding.titleInclude.titleView.text = "消息" } override fun initOnCreate(savedInstanceState: Bundle?) { diff --git a/app/src/main/java/com/casic/app/smartwell/fragment/OrderListFragment.kt b/app/src/main/java/com/casic/app/smartwell/fragment/OrderListFragment.kt index 93ff35b..5e38acb 100644 --- a/app/src/main/java/com/casic/app/smartwell/fragment/OrderListFragment.kt +++ b/app/src/main/java/com/casic/app/smartwell/fragment/OrderListFragment.kt @@ -12,6 +12,7 @@ import com.casic.app.smartwell.view.SearchOrderActivity import com.pengxh.kt.lite.base.KotlinBaseFragment import com.pengxh.kt.lite.extensions.navigatePageTo +import com.pengxh.kt.lite.widget.TitleBarView class OrderListFragment : KotlinBaseFragment() { @@ -25,15 +26,22 @@ } override fun initViewBinding( - inflater: LayoutInflater, - container: ViewGroup? + inflater: LayoutInflater, container: ViewGroup? ): FragmentOrderBinding { return FragmentOrderBinding.inflate(inflater, container, false) } override fun setupTopBarLayout() { binding.rootView.initImmersionBar(this, false, R.color.mainThemeColor) - binding.titleView.text = "工单" + binding.titleView.setOnClickListener(object : TitleBarView.OnClickListener { + override fun onLeftClick() { + + } + + override fun onRightClick() { + requireContext().navigatePageTo() + } + }) } override fun initOnCreate(savedInstanceState: Bundle?) { @@ -51,8 +59,6 @@ } override fun initEvent() { - binding.rightOptionView.setOnClickListener { - requireContext().navigatePageTo() - } + } } \ No newline at end of file diff --git a/app/src/main/java/com/casic/app/smartwell/fragment/OrderNotProcessedFragment.kt b/app/src/main/java/com/casic/app/smartwell/fragment/OrderNotProcessedFragment.kt index 0b3d09d..2b6f21d 100644 --- a/app/src/main/java/com/casic/app/smartwell/fragment/OrderNotProcessedFragment.kt +++ b/app/src/main/java/com/casic/app/smartwell/fragment/OrderNotProcessedFragment.kt @@ -18,7 +18,7 @@ import com.pengxh.kt.lite.extensions.navigatePageTo import com.pengxh.kt.lite.extensions.show import com.pengxh.kt.lite.utils.LoadState -import com.pengxh.kt.lite.utils.LoadingDialogHub +import com.pengxh.kt.lite.utils.LoadingDialog import com.pengxh.kt.lite.utils.WeakReferenceHandler import com.pengxh.kt.lite.widget.dialog.AlertControlDialog @@ -78,8 +78,8 @@ operationViewModel = ViewModelProvider(this)[OperationViewModel::class.java] - binding.notProcessedView.addItemDecoration( - RecyclerViewItemOffsets(0, 5, 0, 5) + binding.recyclerView.addItemDecoration( + RecyclerViewItemOffsets(0, 7, 0, 7) ) } @@ -87,9 +87,9 @@ //接单状态处理 operationViewModel.loadState.observe(this) { when (it) { - is LoadState.Loading -> LoadingDialogHub.show(requireActivity(), "接单中,请稍后") + is LoadState.Loading -> LoadingDialog.show(requireActivity(), "接单中,请稍后") is LoadState.Success -> { - LoadingDialogHub.dismiss() + LoadingDialog.dismiss() //接单成功之后刷新列表 dataBeans.removeAt(clickedPosition) notProcessedAdapter.notifyItemRemoved(clickedPosition) @@ -98,7 +98,7 @@ ) } - else -> LoadingDialogHub.dismiss() + else -> LoadingDialog.dismiss() } } } @@ -131,7 +131,7 @@ } else { binding.emptyInclude.emptyView.hide() notProcessedAdapter = OrderNotProcessedAdapter(requireContext(), dataBeans) - binding.notProcessedView.adapter = notProcessedAdapter + binding.recyclerView.adapter = notProcessedAdapter notProcessedAdapter.setOnItemClickListener(object : OrderNotProcessedAdapter.OnItemClickListener { override fun onClicked(position: Int) { diff --git a/app/src/main/java/com/casic/app/smartwell/fragment/OvertimeNotAcceptFragment.kt b/app/src/main/java/com/casic/app/smartwell/fragment/OvertimeNotAcceptFragment.kt index a198545..9b318ca 100644 --- a/app/src/main/java/com/casic/app/smartwell/fragment/OvertimeNotAcceptFragment.kt +++ b/app/src/main/java/com/casic/app/smartwell/fragment/OvertimeNotAcceptFragment.kt @@ -18,7 +18,7 @@ import com.pengxh.kt.lite.extensions.navigatePageTo import com.pengxh.kt.lite.extensions.show import com.pengxh.kt.lite.utils.LoadState -import com.pengxh.kt.lite.utils.LoadingDialogHub +import com.pengxh.kt.lite.utils.LoadingDialog import com.pengxh.kt.lite.utils.WeakReferenceHandler import com.pengxh.kt.lite.widget.dialog.AlertControlDialog @@ -81,8 +81,8 @@ operationViewModel = ViewModelProvider(this)[OperationViewModel::class.java] - binding.notProcessedView.addItemDecoration( - RecyclerViewItemOffsets(0, 5, 0, 5) + binding.recyclerView.addItemDecoration( + RecyclerViewItemOffsets(0, 7, 0, 7) ) } @@ -90,9 +90,9 @@ //接单状态处理 operationViewModel.loadState.observe(this) { when (it) { - is LoadState.Loading -> LoadingDialogHub.show(requireActivity(), "接单中,请稍后") + is LoadState.Loading -> LoadingDialog.show(requireActivity(), "接单中,请稍后") is LoadState.Success -> { - LoadingDialogHub.dismiss() + LoadingDialog.dismiss() //接单成功之后刷新列表 dataBeans.removeAt(clickedPosition) notProcessedAdapter.notifyItemRemoved(clickedPosition) @@ -101,7 +101,7 @@ ) } - else -> LoadingDialogHub.dismiss() + else -> LoadingDialog.dismiss() } } } @@ -134,7 +134,7 @@ } else { binding.emptyInclude.emptyView.hide() notProcessedAdapter = OrderNotProcessedAdapter(requireContext(), dataBeans) - binding.notProcessedView.adapter = notProcessedAdapter + binding.recyclerView.adapter = notProcessedAdapter notProcessedAdapter.setOnItemClickListener(object : OrderNotProcessedAdapter.OnItemClickListener { override fun onClicked(position: Int) { diff --git a/app/src/main/java/com/casic/app/smartwell/greendao/DaoMaster.java b/app/src/main/java/com/casic/app/smartwell/greendao/DaoMaster.java index fdcf3a7..1e52b74 100644 --- a/app/src/main/java/com/casic/app/smartwell/greendao/DaoMaster.java +++ b/app/src/main/java/com/casic/app/smartwell/greendao/DaoMaster.java @@ -13,25 +13,20 @@ // THIS CODE IS GENERATED BY greenDAO, DO NOT EDIT. - /** * Master of DAO (schema version 4): knows all DAOs. */ public class DaoMaster extends AbstractDaoMaster { public static final int SCHEMA_VERSION = 4; - /** - * Creates underlying database table using DAOs. - */ + /** Creates underlying database table using DAOs. */ public static void createAllTables(Database db, boolean ifNotExists) { MapWellLocalBeanDao.createTable(db, ifNotExists); NoticeLocaleBeanDao.createTable(db, ifNotExists); PipeLocalBeanDao.createTable(db, ifNotExists); } - /** - * Drops underlying database table using DAOs. - */ + /** Drops underlying database table using DAOs. */ public static void dropAllTables(Database db, boolean ifExists) { MapWellLocalBeanDao.dropTable(db, ifExists); NoticeLocaleBeanDao.dropTable(db, ifExists); @@ -86,9 +81,7 @@ } } - /** - * WARNING: Drops all table on Upgrade! Use only during development. - */ + /** WARNING: Drops all table on Upgrade! Use only during development. */ public static class DevOpenHelper extends OpenHelper { public DevOpenHelper(Context context, String name) { super(context, name); diff --git a/app/src/main/java/com/casic/app/smartwell/greendao/DaoSession.java b/app/src/main/java/com/casic/app/smartwell/greendao/DaoSession.java index 0b36d17..3e40e3b 100644 --- a/app/src/main/java/com/casic/app/smartwell/greendao/DaoSession.java +++ b/app/src/main/java/com/casic/app/smartwell/greendao/DaoSession.java @@ -16,7 +16,7 @@ /** * {@inheritDoc} - * + * * @see org.greenrobot.greendao.AbstractDaoSession */ public class DaoSession extends AbstractDaoSession { @@ -50,7 +50,7 @@ registerDao(NoticeLocaleBean.class, noticeLocaleBeanDao); registerDao(PipeLocalBean.class, pipeLocalBeanDao); } - + public void clear() { mapWellLocalBeanDaoConfig.clearIdentityScope(); noticeLocaleBeanDaoConfig.clearIdentityScope(); diff --git a/app/src/main/java/com/casic/app/smartwell/greendao/MapWellLocalBeanDao.java b/app/src/main/java/com/casic/app/smartwell/greendao/MapWellLocalBeanDao.java index 8908fda..407bc92 100644 --- a/app/src/main/java/com/casic/app/smartwell/greendao/MapWellLocalBeanDao.java +++ b/app/src/main/java/com/casic/app/smartwell/greendao/MapWellLocalBeanDao.java @@ -12,10 +12,9 @@ import org.greenrobot.greendao.internal.DaoConfig; // THIS CODE IS GENERATED BY greenDAO, DO NOT EDIT. - -/** +/** * DAO for table "MAP_WELL_LOCAL_BEAN". - */ +*/ public class MapWellLocalBeanDao extends AbstractDao { public static final String TABLENAME = "MAP_WELL_LOCAL_BEAN"; @@ -57,16 +56,14 @@ public MapWellLocalBeanDao(DaoConfig config) { super(config); } - + public MapWellLocalBeanDao(DaoConfig config, DaoSession daoSession) { super(config, daoSession); } - /** - * Creates the underlying database table. - */ + /** Creates the underlying database table. */ public static void createTable(Database db, boolean ifNotExists) { - String constraint = ifNotExists ? "IF NOT EXISTS " : ""; + String constraint = ifNotExists? "IF NOT EXISTS ": ""; db.execSQL("CREATE TABLE " + constraint + "\"MAP_WELL_LOCAL_BEAN\" (" + // "\"_id\" INTEGER PRIMARY KEY AUTOINCREMENT ," + // 0: kId "\"AREA\" TEXT," + // 1: area @@ -96,9 +93,7 @@ "\"WELL_TYPE_NAME\" TEXT);"); // 25: wellTypeName } - /** - * Drops the underlying database table. - */ + /** Drops the underlying database table. */ public static void dropTable(Database db, boolean ifExists) { String sql = "DROP TABLE " + (ifExists ? "IF EXISTS " : "") + "\"MAP_WELL_LOCAL_BEAN\""; db.execSQL(sql); @@ -107,132 +102,132 @@ @Override protected final void bindValues(DatabaseStatement stmt, MapWellLocalBean entity) { stmt.clearBindings(); - + Long kId = entity.getKId(); if (kId != null) { stmt.bindLong(1, kId); } - + String area = entity.getArea(); if (area != null) { stmt.bindString(2, area); } - + String bfzt = entity.getBfzt(); if (bfzt != null) { stmt.bindString(3, bfzt); } - + String bfztName = entity.getBfztName(); if (bfztName != null) { stmt.bindString(4, bfztName); } - + String coordinateX = entity.getCoordinateX(); if (coordinateX != null) { stmt.bindString(5, coordinateX); } - + String coordinateY = entity.getCoordinateY(); if (coordinateY != null) { stmt.bindString(6, coordinateY); } - + String deep = entity.getDeep(); if (deep != null) { stmt.bindString(7, deep); } - + String deptName = entity.getDeptName(); if (deptName != null) { stmt.bindString(8, deptName); } - + String deptid = entity.getDeptid(); if (deptid != null) { stmt.bindString(9, deptid); } - + String id = entity.getId(); if (id != null) { stmt.bindString(10, id); } - + String latBaidu = entity.getLatBaidu(); if (latBaidu != null) { stmt.bindString(11, latBaidu); } - + String latGaode = entity.getLatGaode(); if (latGaode != null) { stmt.bindString(12, latGaode); } - + String lngBaidu = entity.getLngBaidu(); if (lngBaidu != null) { stmt.bindString(13, lngBaidu); } - + String lngGaode = entity.getLngGaode(); if (lngGaode != null) { stmt.bindString(14, lngGaode); } - + String notes = entity.getNotes(); if (notes != null) { stmt.bindString(15, notes); } - + String photos = entity.getPhotos(); if (photos != null) { stmt.bindString(16, photos); } - + String position = entity.getPosition(); if (position != null) { stmt.bindString(17, position); } - + String staff = entity.getStaff(); if (staff != null) { stmt.bindString(18, staff); } - + String tel = entity.getTel(); if (tel != null) { stmt.bindString(19, tel); } - + String ts = entity.getTs(); if (ts != null) { stmt.bindString(20, ts); } - + String valid = entity.getValid(); if (valid != null) { stmt.bindString(21, valid); } - + String watchData = entity.getWatchData(); if (watchData != null) { stmt.bindString(22, watchData); } - + String wellCode = entity.getWellCode(); if (wellCode != null) { stmt.bindString(23, wellCode); } - + String wellName = entity.getWellName(); if (wellName != null) { stmt.bindString(24, wellName); } - + String wellType = entity.getWellType(); if (wellType != null) { stmt.bindString(25, wellType); } - + String wellTypeName = entity.getWellTypeName(); if (wellTypeName != null) { stmt.bindString(26, wellTypeName); @@ -242,132 +237,132 @@ @Override protected final void bindValues(SQLiteStatement stmt, MapWellLocalBean entity) { stmt.clearBindings(); - + Long kId = entity.getKId(); if (kId != null) { stmt.bindLong(1, kId); } - + String area = entity.getArea(); if (area != null) { stmt.bindString(2, area); } - + String bfzt = entity.getBfzt(); if (bfzt != null) { stmt.bindString(3, bfzt); } - + String bfztName = entity.getBfztName(); if (bfztName != null) { stmt.bindString(4, bfztName); } - + String coordinateX = entity.getCoordinateX(); if (coordinateX != null) { stmt.bindString(5, coordinateX); } - + String coordinateY = entity.getCoordinateY(); if (coordinateY != null) { stmt.bindString(6, coordinateY); } - + String deep = entity.getDeep(); if (deep != null) { stmt.bindString(7, deep); } - + String deptName = entity.getDeptName(); if (deptName != null) { stmt.bindString(8, deptName); } - + String deptid = entity.getDeptid(); if (deptid != null) { stmt.bindString(9, deptid); } - + String id = entity.getId(); if (id != null) { stmt.bindString(10, id); } - + String latBaidu = entity.getLatBaidu(); if (latBaidu != null) { stmt.bindString(11, latBaidu); } - + String latGaode = entity.getLatGaode(); if (latGaode != null) { stmt.bindString(12, latGaode); } - + String lngBaidu = entity.getLngBaidu(); if (lngBaidu != null) { stmt.bindString(13, lngBaidu); } - + String lngGaode = entity.getLngGaode(); if (lngGaode != null) { stmt.bindString(14, lngGaode); } - + String notes = entity.getNotes(); if (notes != null) { stmt.bindString(15, notes); } - + String photos = entity.getPhotos(); if (photos != null) { stmt.bindString(16, photos); } - + String position = entity.getPosition(); if (position != null) { stmt.bindString(17, position); } - + String staff = entity.getStaff(); if (staff != null) { stmt.bindString(18, staff); } - + String tel = entity.getTel(); if (tel != null) { stmt.bindString(19, tel); } - + String ts = entity.getTs(); if (ts != null) { stmt.bindString(20, ts); } - + String valid = entity.getValid(); if (valid != null) { stmt.bindString(21, valid); } - + String watchData = entity.getWatchData(); if (watchData != null) { stmt.bindString(22, watchData); } - + String wellCode = entity.getWellCode(); if (wellCode != null) { stmt.bindString(23, wellCode); } - + String wellName = entity.getWellName(); if (wellName != null) { stmt.bindString(24, wellName); } - + String wellType = entity.getWellType(); if (wellType != null) { stmt.bindString(25, wellType); } - + String wellTypeName = entity.getWellTypeName(); if (wellTypeName != null) { stmt.bindString(26, wellTypeName); @@ -377,41 +372,41 @@ @Override public Long readKey(Cursor cursor, int offset) { return cursor.isNull(offset + 0) ? null : cursor.getLong(offset + 0); - } + } @Override public MapWellLocalBean readEntity(Cursor cursor, int offset) { MapWellLocalBean entity = new MapWellLocalBean( // - cursor.isNull(offset + 0) ? null : cursor.getLong(offset + 0), // kId - cursor.isNull(offset + 1) ? null : cursor.getString(offset + 1), // area - cursor.isNull(offset + 2) ? null : cursor.getString(offset + 2), // bfzt - cursor.isNull(offset + 3) ? null : cursor.getString(offset + 3), // bfztName - cursor.isNull(offset + 4) ? null : cursor.getString(offset + 4), // coordinateX - cursor.isNull(offset + 5) ? null : cursor.getString(offset + 5), // coordinateY - cursor.isNull(offset + 6) ? null : cursor.getString(offset + 6), // deep - cursor.isNull(offset + 7) ? null : cursor.getString(offset + 7), // deptName - cursor.isNull(offset + 8) ? null : cursor.getString(offset + 8), // deptid - cursor.isNull(offset + 9) ? null : cursor.getString(offset + 9), // id - cursor.isNull(offset + 10) ? null : cursor.getString(offset + 10), // latBaidu - cursor.isNull(offset + 11) ? null : cursor.getString(offset + 11), // latGaode - cursor.isNull(offset + 12) ? null : cursor.getString(offset + 12), // lngBaidu - cursor.isNull(offset + 13) ? null : cursor.getString(offset + 13), // lngGaode - cursor.isNull(offset + 14) ? null : cursor.getString(offset + 14), // notes - cursor.isNull(offset + 15) ? null : cursor.getString(offset + 15), // photos - cursor.isNull(offset + 16) ? null : cursor.getString(offset + 16), // position - cursor.isNull(offset + 17) ? null : cursor.getString(offset + 17), // staff - cursor.isNull(offset + 18) ? null : cursor.getString(offset + 18), // tel - cursor.isNull(offset + 19) ? null : cursor.getString(offset + 19), // ts - cursor.isNull(offset + 20) ? null : cursor.getString(offset + 20), // valid - cursor.isNull(offset + 21) ? null : cursor.getString(offset + 21), // watchData - cursor.isNull(offset + 22) ? null : cursor.getString(offset + 22), // wellCode - cursor.isNull(offset + 23) ? null : cursor.getString(offset + 23), // wellName - cursor.isNull(offset + 24) ? null : cursor.getString(offset + 24), // wellType - cursor.isNull(offset + 25) ? null : cursor.getString(offset + 25) // wellTypeName + cursor.isNull(offset + 0) ? null : cursor.getLong(offset + 0), // kId + cursor.isNull(offset + 1) ? null : cursor.getString(offset + 1), // area + cursor.isNull(offset + 2) ? null : cursor.getString(offset + 2), // bfzt + cursor.isNull(offset + 3) ? null : cursor.getString(offset + 3), // bfztName + cursor.isNull(offset + 4) ? null : cursor.getString(offset + 4), // coordinateX + cursor.isNull(offset + 5) ? null : cursor.getString(offset + 5), // coordinateY + cursor.isNull(offset + 6) ? null : cursor.getString(offset + 6), // deep + cursor.isNull(offset + 7) ? null : cursor.getString(offset + 7), // deptName + cursor.isNull(offset + 8) ? null : cursor.getString(offset + 8), // deptid + cursor.isNull(offset + 9) ? null : cursor.getString(offset + 9), // id + cursor.isNull(offset + 10) ? null : cursor.getString(offset + 10), // latBaidu + cursor.isNull(offset + 11) ? null : cursor.getString(offset + 11), // latGaode + cursor.isNull(offset + 12) ? null : cursor.getString(offset + 12), // lngBaidu + cursor.isNull(offset + 13) ? null : cursor.getString(offset + 13), // lngGaode + cursor.isNull(offset + 14) ? null : cursor.getString(offset + 14), // notes + cursor.isNull(offset + 15) ? null : cursor.getString(offset + 15), // photos + cursor.isNull(offset + 16) ? null : cursor.getString(offset + 16), // position + cursor.isNull(offset + 17) ? null : cursor.getString(offset + 17), // staff + cursor.isNull(offset + 18) ? null : cursor.getString(offset + 18), // tel + cursor.isNull(offset + 19) ? null : cursor.getString(offset + 19), // ts + cursor.isNull(offset + 20) ? null : cursor.getString(offset + 20), // valid + cursor.isNull(offset + 21) ? null : cursor.getString(offset + 21), // watchData + cursor.isNull(offset + 22) ? null : cursor.getString(offset + 22), // wellCode + cursor.isNull(offset + 23) ? null : cursor.getString(offset + 23), // wellName + cursor.isNull(offset + 24) ? null : cursor.getString(offset + 24), // wellType + cursor.isNull(offset + 25) ? null : cursor.getString(offset + 25) // wellTypeName ); return entity; } - + @Override public void readEntity(Cursor cursor, MapWellLocalBean entity, int offset) { entity.setKId(cursor.isNull(offset + 0) ? null : cursor.getLong(offset + 0)); @@ -440,17 +435,17 @@ entity.setWellName(cursor.isNull(offset + 23) ? null : cursor.getString(offset + 23)); entity.setWellType(cursor.isNull(offset + 24) ? null : cursor.getString(offset + 24)); entity.setWellTypeName(cursor.isNull(offset + 25) ? null : cursor.getString(offset + 25)); - } - + } + @Override protected final Long updateKeyAfterInsert(MapWellLocalBean entity, long rowId) { entity.setKId(rowId); return rowId; } - + @Override public Long getKey(MapWellLocalBean entity) { - if (entity != null) { + if(entity != null) { return entity.getKId(); } else { return null; @@ -466,5 +461,5 @@ protected final boolean isEntityUpdateable() { return true; } - + } diff --git a/app/src/main/java/com/casic/app/smartwell/greendao/NoticeLocaleBeanDao.java b/app/src/main/java/com/casic/app/smartwell/greendao/NoticeLocaleBeanDao.java index 64312ed..deb2d49 100644 --- a/app/src/main/java/com/casic/app/smartwell/greendao/NoticeLocaleBeanDao.java +++ b/app/src/main/java/com/casic/app/smartwell/greendao/NoticeLocaleBeanDao.java @@ -12,10 +12,9 @@ import org.greenrobot.greendao.internal.DaoConfig; // THIS CODE IS GENERATED BY greenDAO, DO NOT EDIT. - -/** +/** * DAO for table "NOTICE_LOCALE_BEAN". - */ +*/ public class NoticeLocaleBeanDao extends AbstractDao { public static final String TABLENAME = "NOTICE_LOCALE_BEAN"; @@ -43,16 +42,14 @@ public NoticeLocaleBeanDao(DaoConfig config) { super(config); } - + public NoticeLocaleBeanDao(DaoConfig config, DaoSession daoSession) { super(config, daoSession); } - /** - * Creates the underlying database table. - */ + /** Creates the underlying database table. */ public static void createTable(Database db, boolean ifNotExists) { - String constraint = ifNotExists ? "IF NOT EXISTS " : ""; + String constraint = ifNotExists? "IF NOT EXISTS ": ""; db.execSQL("CREATE TABLE " + constraint + "\"NOTICE_LOCALE_BEAN\" (" + // "\"_id\" INTEGER PRIMARY KEY AUTOINCREMENT ," + // 0: id "\"MESSAGE_ID\" TEXT UNIQUE ," + // 1: messageId @@ -68,9 +65,7 @@ "\"NOTICE_TIME\" TEXT);"); // 11: noticeTime } - /** - * Drops the underlying database table. - */ + /** Drops the underlying database table. */ public static void dropTable(Database db, boolean ifExists) { String sql = "DROP TABLE " + (ifExists ? "IF EXISTS " : "") + "\"NOTICE_LOCALE_BEAN\""; db.execSQL(sql); @@ -79,62 +74,62 @@ @Override protected final void bindValues(DatabaseStatement stmt, NoticeLocaleBean entity) { stmt.clearBindings(); - + Long id = entity.getId(); if (id != null) { stmt.bindLong(1, id); } - + String messageId = entity.getMessageId(); if (messageId != null) { stmt.bindString(2, messageId); } - + String appid = entity.getAppid(); if (appid != null) { stmt.bindString(3, appid); } - + String clientId = entity.getClientId(); if (clientId != null) { stmt.bindString(4, clientId); } - + String taskId = entity.getTaskId(); if (taskId != null) { stmt.bindString(5, taskId); } - + String userId = entity.getUserId(); if (userId != null) { stmt.bindString(6, userId); } - + String title = entity.getTitle(); if (title != null) { stmt.bindString(7, title); } - + String content = entity.getContent(); if (content != null) { stmt.bindString(8, content); } - + String deviceCode = entity.getDeviceCode(); if (deviceCode != null) { stmt.bindString(9, deviceCode); } - + String jobId = entity.getJobId(); if (jobId != null) { stmt.bindString(10, jobId); } - + String isRead = entity.getIsRead(); if (isRead != null) { stmt.bindString(11, isRead); } - + String noticeTime = entity.getNoticeTime(); if (noticeTime != null) { stmt.bindString(12, noticeTime); @@ -144,62 +139,62 @@ @Override protected final void bindValues(SQLiteStatement stmt, NoticeLocaleBean entity) { stmt.clearBindings(); - + Long id = entity.getId(); if (id != null) { stmt.bindLong(1, id); } - + String messageId = entity.getMessageId(); if (messageId != null) { stmt.bindString(2, messageId); } - + String appid = entity.getAppid(); if (appid != null) { stmt.bindString(3, appid); } - + String clientId = entity.getClientId(); if (clientId != null) { stmt.bindString(4, clientId); } - + String taskId = entity.getTaskId(); if (taskId != null) { stmt.bindString(5, taskId); } - + String userId = entity.getUserId(); if (userId != null) { stmt.bindString(6, userId); } - + String title = entity.getTitle(); if (title != null) { stmt.bindString(7, title); } - + String content = entity.getContent(); if (content != null) { stmt.bindString(8, content); } - + String deviceCode = entity.getDeviceCode(); if (deviceCode != null) { stmt.bindString(9, deviceCode); } - + String jobId = entity.getJobId(); if (jobId != null) { stmt.bindString(10, jobId); } - + String isRead = entity.getIsRead(); if (isRead != null) { stmt.bindString(11, isRead); } - + String noticeTime = entity.getNoticeTime(); if (noticeTime != null) { stmt.bindString(12, noticeTime); @@ -209,27 +204,27 @@ @Override public Long readKey(Cursor cursor, int offset) { return cursor.isNull(offset + 0) ? null : cursor.getLong(offset + 0); - } + } @Override public NoticeLocaleBean readEntity(Cursor cursor, int offset) { NoticeLocaleBean entity = new NoticeLocaleBean( // - cursor.isNull(offset + 0) ? null : cursor.getLong(offset + 0), // id - cursor.isNull(offset + 1) ? null : cursor.getString(offset + 1), // messageId - cursor.isNull(offset + 2) ? null : cursor.getString(offset + 2), // appid - cursor.isNull(offset + 3) ? null : cursor.getString(offset + 3), // clientId - cursor.isNull(offset + 4) ? null : cursor.getString(offset + 4), // taskId - cursor.isNull(offset + 5) ? null : cursor.getString(offset + 5), // userId - cursor.isNull(offset + 6) ? null : cursor.getString(offset + 6), // title - cursor.isNull(offset + 7) ? null : cursor.getString(offset + 7), // content - cursor.isNull(offset + 8) ? null : cursor.getString(offset + 8), // deviceCode - cursor.isNull(offset + 9) ? null : cursor.getString(offset + 9), // jobId - cursor.isNull(offset + 10) ? null : cursor.getString(offset + 10), // isRead - cursor.isNull(offset + 11) ? null : cursor.getString(offset + 11) // noticeTime + cursor.isNull(offset + 0) ? null : cursor.getLong(offset + 0), // id + cursor.isNull(offset + 1) ? null : cursor.getString(offset + 1), // messageId + cursor.isNull(offset + 2) ? null : cursor.getString(offset + 2), // appid + cursor.isNull(offset + 3) ? null : cursor.getString(offset + 3), // clientId + cursor.isNull(offset + 4) ? null : cursor.getString(offset + 4), // taskId + cursor.isNull(offset + 5) ? null : cursor.getString(offset + 5), // userId + cursor.isNull(offset + 6) ? null : cursor.getString(offset + 6), // title + cursor.isNull(offset + 7) ? null : cursor.getString(offset + 7), // content + cursor.isNull(offset + 8) ? null : cursor.getString(offset + 8), // deviceCode + cursor.isNull(offset + 9) ? null : cursor.getString(offset + 9), // jobId + cursor.isNull(offset + 10) ? null : cursor.getString(offset + 10), // isRead + cursor.isNull(offset + 11) ? null : cursor.getString(offset + 11) // noticeTime ); return entity; } - + @Override public void readEntity(Cursor cursor, NoticeLocaleBean entity, int offset) { entity.setId(cursor.isNull(offset + 0) ? null : cursor.getLong(offset + 0)); @@ -244,17 +239,17 @@ entity.setJobId(cursor.isNull(offset + 9) ? null : cursor.getString(offset + 9)); entity.setIsRead(cursor.isNull(offset + 10) ? null : cursor.getString(offset + 10)); entity.setNoticeTime(cursor.isNull(offset + 11) ? null : cursor.getString(offset + 11)); - } - + } + @Override protected final Long updateKeyAfterInsert(NoticeLocaleBean entity, long rowId) { entity.setId(rowId); return rowId; } - + @Override public Long getKey(NoticeLocaleBean entity) { - if (entity != null) { + if(entity != null) { return entity.getId(); } else { return null; @@ -270,5 +265,5 @@ protected final boolean isEntityUpdateable() { return true; } - + } diff --git a/app/src/main/java/com/casic/app/smartwell/greendao/PipeLocalBeanDao.java b/app/src/main/java/com/casic/app/smartwell/greendao/PipeLocalBeanDao.java index aab4d3f..df5515a 100644 --- a/app/src/main/java/com/casic/app/smartwell/greendao/PipeLocalBeanDao.java +++ b/app/src/main/java/com/casic/app/smartwell/greendao/PipeLocalBeanDao.java @@ -12,10 +12,9 @@ import org.greenrobot.greendao.internal.DaoConfig; // THIS CODE IS GENERATED BY greenDAO, DO NOT EDIT. - -/** +/** * DAO for table "PIPE_LOCAL_BEAN". - */ +*/ public class PipeLocalBeanDao extends AbstractDao { public static final String TABLENAME = "PIPE_LOCAL_BEAN"; @@ -37,16 +36,14 @@ public PipeLocalBeanDao(DaoConfig config) { super(config); } - + public PipeLocalBeanDao(DaoConfig config, DaoSession daoSession) { super(config, daoSession); } - /** - * Creates the underlying database table. - */ + /** Creates the underlying database table. */ public static void createTable(Database db, boolean ifNotExists) { - String constraint = ifNotExists ? "IF NOT EXISTS " : ""; + String constraint = ifNotExists? "IF NOT EXISTS ": ""; db.execSQL("CREATE TABLE " + constraint + "\"PIPE_LOCAL_BEAN\" (" + // "\"_id\" INTEGER PRIMARY KEY AUTOINCREMENT ," + // 0: id "\"PIPE_CODE\" TEXT," + // 1: pipeCode @@ -56,9 +53,7 @@ "\"START_LONGITUDE_GD\" TEXT);"); // 5: startLongitudeGd } - /** - * Drops the underlying database table. - */ + /** Drops the underlying database table. */ public static void dropTable(Database db, boolean ifExists) { String sql = "DROP TABLE " + (ifExists ? "IF EXISTS " : "") + "\"PIPE_LOCAL_BEAN\""; db.execSQL(sql); @@ -67,32 +62,32 @@ @Override protected final void bindValues(DatabaseStatement stmt, PipeLocalBean entity) { stmt.clearBindings(); - + Long id = entity.getId(); if (id != null) { stmt.bindLong(1, id); } - + String pipeCode = entity.getPipeCode(); if (pipeCode != null) { stmt.bindString(2, pipeCode); } - + String endLatitudeGd = entity.getEndLatitudeGd(); if (endLatitudeGd != null) { stmt.bindString(3, endLatitudeGd); } - + String endLongitudeGd = entity.getEndLongitudeGd(); if (endLongitudeGd != null) { stmt.bindString(4, endLongitudeGd); } - + String startLatitudeGd = entity.getStartLatitudeGd(); if (startLatitudeGd != null) { stmt.bindString(5, startLatitudeGd); } - + String startLongitudeGd = entity.getStartLongitudeGd(); if (startLongitudeGd != null) { stmt.bindString(6, startLongitudeGd); @@ -102,32 +97,32 @@ @Override protected final void bindValues(SQLiteStatement stmt, PipeLocalBean entity) { stmt.clearBindings(); - + Long id = entity.getId(); if (id != null) { stmt.bindLong(1, id); } - + String pipeCode = entity.getPipeCode(); if (pipeCode != null) { stmt.bindString(2, pipeCode); } - + String endLatitudeGd = entity.getEndLatitudeGd(); if (endLatitudeGd != null) { stmt.bindString(3, endLatitudeGd); } - + String endLongitudeGd = entity.getEndLongitudeGd(); if (endLongitudeGd != null) { stmt.bindString(4, endLongitudeGd); } - + String startLatitudeGd = entity.getStartLatitudeGd(); if (startLatitudeGd != null) { stmt.bindString(5, startLatitudeGd); } - + String startLongitudeGd = entity.getStartLongitudeGd(); if (startLongitudeGd != null) { stmt.bindString(6, startLongitudeGd); @@ -137,21 +132,21 @@ @Override public Long readKey(Cursor cursor, int offset) { return cursor.isNull(offset + 0) ? null : cursor.getLong(offset + 0); - } + } @Override public PipeLocalBean readEntity(Cursor cursor, int offset) { PipeLocalBean entity = new PipeLocalBean( // - cursor.isNull(offset + 0) ? null : cursor.getLong(offset + 0), // id - cursor.isNull(offset + 1) ? null : cursor.getString(offset + 1), // pipeCode - cursor.isNull(offset + 2) ? null : cursor.getString(offset + 2), // endLatitudeGd - cursor.isNull(offset + 3) ? null : cursor.getString(offset + 3), // endLongitudeGd - cursor.isNull(offset + 4) ? null : cursor.getString(offset + 4), // startLatitudeGd - cursor.isNull(offset + 5) ? null : cursor.getString(offset + 5) // startLongitudeGd + cursor.isNull(offset + 0) ? null : cursor.getLong(offset + 0), // id + cursor.isNull(offset + 1) ? null : cursor.getString(offset + 1), // pipeCode + cursor.isNull(offset + 2) ? null : cursor.getString(offset + 2), // endLatitudeGd + cursor.isNull(offset + 3) ? null : cursor.getString(offset + 3), // endLongitudeGd + cursor.isNull(offset + 4) ? null : cursor.getString(offset + 4), // startLatitudeGd + cursor.isNull(offset + 5) ? null : cursor.getString(offset + 5) // startLongitudeGd ); return entity; } - + @Override public void readEntity(Cursor cursor, PipeLocalBean entity, int offset) { entity.setId(cursor.isNull(offset + 0) ? null : cursor.getLong(offset + 0)); @@ -160,17 +155,17 @@ entity.setEndLongitudeGd(cursor.isNull(offset + 3) ? null : cursor.getString(offset + 3)); entity.setStartLatitudeGd(cursor.isNull(offset + 4) ? null : cursor.getString(offset + 4)); entity.setStartLongitudeGd(cursor.isNull(offset + 5) ? null : cursor.getString(offset + 5)); - } - + } + @Override protected final Long updateKeyAfterInsert(PipeLocalBean entity, long rowId) { entity.setId(rowId); return rowId; } - + @Override public Long getKey(PipeLocalBean entity) { - if (entity != null) { + if(entity != null) { return entity.getId(); } else { return null; @@ -186,5 +181,5 @@ protected final boolean isEntityUpdateable() { return true; } - + } diff --git a/app/src/main/java/com/casic/app/smartwell/view/ChangePasswordActivity.kt b/app/src/main/java/com/casic/app/smartwell/view/ChangePasswordActivity.kt index 8e41039..9f1dd40 100644 --- a/app/src/main/java/com/casic/app/smartwell/view/ChangePasswordActivity.kt +++ b/app/src/main/java/com/casic/app/smartwell/view/ChangePasswordActivity.kt @@ -14,7 +14,7 @@ import com.pengxh.kt.lite.extensions.show import com.pengxh.kt.lite.utils.ActivityStackManager import com.pengxh.kt.lite.utils.LoadState -import com.pengxh.kt.lite.utils.LoadingDialogHub +import com.pengxh.kt.lite.utils.LoadingDialog import com.pengxh.kt.lite.widget.TitleBarView import java.nio.charset.StandardCharsets @@ -46,15 +46,15 @@ override fun observeRequestState() { userViewModel.loadState.observe(this) { when (it) { - is LoadState.Loading -> LoadingDialogHub.show(this, "修改中,请稍后") + is LoadState.Loading -> LoadingDialog.show(this, "修改中,请稍后") is LoadState.Success -> { - LoadingDialogHub.dismiss() + LoadingDialog.dismiss() AuthenticationHelper.removeToken() this.navigatePageTo() ActivityStackManager.finishAllActivity() } - else -> LoadingDialogHub.dismiss() + else -> LoadingDialog.dismiss() } } } diff --git a/app/build.gradle b/app/build.gradle index 296fb6f..c18c251 100644 --- a/app/build.gradle +++ b/app/build.gradle @@ -40,10 +40,6 @@ // VIVO 相关应用参数 VIVO_APP_ID : "105749048", VIVO_APP_KEY : "e460fbf2c689e0f8c58ecc6aa62e1803", - - // 小米相关应用参数 -// XIAOMI_APP_ID : "", -// XIAOMI_APP_KEY : "", ] // 版本名后面添加一句话,意思就是flavor dimension 它的维度就是该版本号,多渠道打包很重要 @@ -107,7 +103,7 @@ dependencies { implementation fileTree(dir: 'libs', include: ['*.jar']) //基础依赖库 - implementation 'com.github.AndroidCoderPeng:Kotlin-lite-lib:1.0.10' + implementation 'com.github.AndroidCoderPeng:Kotlin-lite-lib:1.1.0' implementation 'androidx.appcompat:appcompat:1.6.1' implementation 'androidx.core:core-ktx:1.9.0' implementation 'androidx.constraintlayout:constraintlayout:2.1.4' @@ -165,8 +161,6 @@ implementation 'commons-codec:commons-codec:1.15' implementation 'com.android.support:support-annotations:28.0.0' implementation 'com.assist-v3:vivo:3.1.2' // vivo -// implementation 'com.getui.opt:xmp:3.3.1' // 小米 - //数据库框架 implementation 'org.greenrobot:greendao:3.3.0' //数据库升级 diff --git a/app/src/main/AndroidManifest.xml b/app/src/main/AndroidManifest.xml index c0af158..e0519bf 100644 --- a/app/src/main/AndroidManifest.xml +++ b/app/src/main/AndroidManifest.xml @@ -90,10 +90,10 @@ - + + android:value="ee96d8b5e12de3fbb29949efd57418a8" /> () @@ -150,7 +158,7 @@ val cameraPosition = CameraPosition(centerLatLng, 14f, 0f, 0f) val cameraUpdate = CameraUpdateFactory.newCameraPosition(cameraPosition) withContext(Dispatchers.Main) { - LoadingDialogHub.dismiss() + LoadingDialog.dismiss() aMap.animateCamera(cameraUpdate, 1500, null) } } @@ -239,11 +247,6 @@ } override fun initEvent() { - binding.rightOptionView.setOnClickListener { - val x = binding.rightOptionView.width - easyPopupWindow.width - easyPopupWindow.showAsDropDown(binding.rightOptionView, x, 0) - } - //撤防点位 binding.unDeployedLayout.setOnClickListener { requireContext().navigatePageTo() @@ -263,11 +266,11 @@ override fun observeRequestState() { wellViewModel.loadState.observe(this) { when (it) { - is LoadState.Loading -> LoadingDialogHub.show( + is LoadState.Loading -> LoadingDialog.show( requireActivity(), "数据加载中,请稍后..." ) - else -> LoadingDialogHub.dismiss() + else -> LoadingDialog.dismiss() } } } @@ -376,7 +379,7 @@ }).build().show() } }) - infoPopup.showAsDropDown(binding.rightOptionView) +// infoPopup.showAsDropDown(binding.rightOptionView) } override fun onCameraChange(p0: CameraPosition?) { diff --git a/app/src/main/java/com/casic/app/smartwell/fragment/HomePageNoClusterFragment.kt b/app/src/main/java/com/casic/app/smartwell/fragment/HomePageNoClusterFragment.kt index 802426a..b25f743 100644 --- a/app/src/main/java/com/casic/app/smartwell/fragment/HomePageNoClusterFragment.kt +++ b/app/src/main/java/com/casic/app/smartwell/fragment/HomePageNoClusterFragment.kt @@ -38,8 +38,9 @@ import com.pengxh.kt.lite.extensions.navigatePageTo import com.pengxh.kt.lite.extensions.show import com.pengxh.kt.lite.utils.LoadState -import com.pengxh.kt.lite.utils.LoadingDialogHub +import com.pengxh.kt.lite.utils.LoadingDialog import com.pengxh.kt.lite.widget.EasyPopupWindow +import com.pengxh.kt.lite.widget.TitleBarView import com.pengxh.kt.lite.widget.dialog.AlertControlDialog import kotlinx.coroutines.Dispatchers import kotlinx.coroutines.launch @@ -78,7 +79,15 @@ override fun setupTopBarLayout() { binding.rootView.initImmersionBar(this, false, R.color.mainThemeColor) - binding.titleView.text = "首页" + binding.titleView.setOnClickListener(object : TitleBarView.OnClickListener { + override fun onLeftClick() { + + } + + override fun onRightClick() { + easyPopupWindow.showAsDropDown(binding.titleView, binding.titleView.width, 0) + } + }) } override fun initOnCreate(savedInstanceState: Bundle?) { @@ -112,7 +121,7 @@ //渲染井位置 lifecycleScope.launch(Dispatchers.Main) { - LoadingDialogHub.show(requireActivity(), "数据加载中,请稍后") + LoadingDialog.show(requireActivity(), "数据加载中,请稍后") withContext(Dispatchers.IO) { //取Well缓存 val allMarkerOptions = ArrayList() @@ -144,7 +153,7 @@ val cameraPosition = CameraPosition(centerLatLng, 14f, 0f, 0f) val cameraUpdate = CameraUpdateFactory.newCameraPosition(cameraPosition) withContext(Dispatchers.Main) { - LoadingDialogHub.dismiss() + LoadingDialog.dismiss() aMap.animateCamera(cameraUpdate, 1500, null) } } @@ -238,11 +247,6 @@ } override fun initEvent() { - binding.rightOptionView.setOnClickListener { - val x = binding.rightOptionView.width - easyPopupWindow.width - easyPopupWindow.showAsDropDown(binding.rightOptionView, x, 0) - } - //撤防点位 binding.unDeployedLayout.setOnClickListener { requireContext().navigatePageTo() @@ -262,11 +266,11 @@ override fun observeRequestState() { wellViewModel.loadState.observe(this) { when (it) { - is LoadState.Loading -> LoadingDialogHub.show( + is LoadState.Loading -> LoadingDialog.show( requireActivity(), "数据加载中,请稍后..." ) - else -> LoadingDialogHub.dismiss() + else -> LoadingDialog.dismiss() } } } diff --git a/app/src/main/java/com/casic/app/smartwell/fragment/MinePageFragment.kt b/app/src/main/java/com/casic/app/smartwell/fragment/MinePageFragment.kt index 09a570c..dcb48f8 100644 --- a/app/src/main/java/com/casic/app/smartwell/fragment/MinePageFragment.kt +++ b/app/src/main/java/com/casic/app/smartwell/fragment/MinePageFragment.kt @@ -35,7 +35,7 @@ import com.pengxh.kt.lite.utils.ActivityStackManager import com.pengxh.kt.lite.utils.FileDownloadManager import com.pengxh.kt.lite.utils.LoadState -import com.pengxh.kt.lite.utils.LoadingDialogHub +import com.pengxh.kt.lite.utils.LoadingDialog import com.pengxh.kt.lite.widget.dialog.AlertControlDialog import com.pengxh.kt.lite.widget.dialog.BottomActionSheet import kotlinx.coroutines.Dispatchers @@ -60,7 +60,6 @@ override fun setupTopBarLayout() { binding.rootView.initImmersionBar(this, false, R.color.mainThemeColor) - binding.titleInclude.titleView.text = "我的" } override fun initOnCreate(savedInstanceState: Bundle?) { @@ -155,27 +154,27 @@ override fun observeRequestState() { userViewModel.loadState.observe(this) { when (it) { - is LoadState.Loading -> LoadingDialogHub.show( + is LoadState.Loading -> LoadingDialog.show( requireActivity(), "检查版本中,请稍后" ) - else -> LoadingDialogHub.dismiss() + else -> LoadingDialog.dismiss() } } wellViewModel.loadState.observe(this) { when (it) { - is LoadState.Loading -> LoadingDialogHub.show( + is LoadState.Loading -> LoadingDialog.show( requireActivity(), "数据更新中,请稍后" ) is LoadState.Fail -> { - LoadingDialogHub.dismiss() + LoadingDialog.dismiss() "数据更新超时".show(requireContext()) } else -> { - LoadingDialogHub.dismiss() + LoadingDialog.dismiss() AlertControlDialog.Builder().setContext(requireContext()).setTitle("温馨提示") .setMessage("数据更新成功,请重启应用").setNegativeButton("取消") .setPositiveButton("确定").setOnDialogButtonClickListener(object : @@ -197,17 +196,17 @@ lineViewModel.loadState.observe(this) { when (it) { - is LoadState.Loading -> LoadingDialogHub.show( + is LoadState.Loading -> LoadingDialog.show( requireActivity(), "数据更新中,请稍后" ) is LoadState.Fail -> { - LoadingDialogHub.dismiss() + LoadingDialog.dismiss() "数据更新超时".show(requireContext()) } else -> { - LoadingDialogHub.dismiss() + LoadingDialog.dismiss() AlertControlDialog.Builder().setContext(requireContext()).setTitle("温馨提示") .setMessage("数据更新成功,请重启应用").setNegativeButton("取消") .setPositiveButton("确定").setOnDialogButtonClickListener(object : diff --git a/app/src/main/java/com/casic/app/smartwell/fragment/NoticePageFragment.kt b/app/src/main/java/com/casic/app/smartwell/fragment/NoticePageFragment.kt index 171b555..3c93f54 100644 --- a/app/src/main/java/com/casic/app/smartwell/fragment/NoticePageFragment.kt +++ b/app/src/main/java/com/casic/app/smartwell/fragment/NoticePageFragment.kt @@ -48,7 +48,6 @@ override fun setupTopBarLayout() { binding.rootView.initImmersionBar(this, false, R.color.mainThemeColor) - binding.titleInclude.titleView.text = "消息" } override fun initOnCreate(savedInstanceState: Bundle?) { diff --git a/app/src/main/java/com/casic/app/smartwell/fragment/OrderListFragment.kt b/app/src/main/java/com/casic/app/smartwell/fragment/OrderListFragment.kt index 93ff35b..5e38acb 100644 --- a/app/src/main/java/com/casic/app/smartwell/fragment/OrderListFragment.kt +++ b/app/src/main/java/com/casic/app/smartwell/fragment/OrderListFragment.kt @@ -12,6 +12,7 @@ import com.casic.app.smartwell.view.SearchOrderActivity import com.pengxh.kt.lite.base.KotlinBaseFragment import com.pengxh.kt.lite.extensions.navigatePageTo +import com.pengxh.kt.lite.widget.TitleBarView class OrderListFragment : KotlinBaseFragment() { @@ -25,15 +26,22 @@ } override fun initViewBinding( - inflater: LayoutInflater, - container: ViewGroup? + inflater: LayoutInflater, container: ViewGroup? ): FragmentOrderBinding { return FragmentOrderBinding.inflate(inflater, container, false) } override fun setupTopBarLayout() { binding.rootView.initImmersionBar(this, false, R.color.mainThemeColor) - binding.titleView.text = "工单" + binding.titleView.setOnClickListener(object : TitleBarView.OnClickListener { + override fun onLeftClick() { + + } + + override fun onRightClick() { + requireContext().navigatePageTo() + } + }) } override fun initOnCreate(savedInstanceState: Bundle?) { @@ -51,8 +59,6 @@ } override fun initEvent() { - binding.rightOptionView.setOnClickListener { - requireContext().navigatePageTo() - } + } } \ No newline at end of file diff --git a/app/src/main/java/com/casic/app/smartwell/fragment/OrderNotProcessedFragment.kt b/app/src/main/java/com/casic/app/smartwell/fragment/OrderNotProcessedFragment.kt index 0b3d09d..2b6f21d 100644 --- a/app/src/main/java/com/casic/app/smartwell/fragment/OrderNotProcessedFragment.kt +++ b/app/src/main/java/com/casic/app/smartwell/fragment/OrderNotProcessedFragment.kt @@ -18,7 +18,7 @@ import com.pengxh.kt.lite.extensions.navigatePageTo import com.pengxh.kt.lite.extensions.show import com.pengxh.kt.lite.utils.LoadState -import com.pengxh.kt.lite.utils.LoadingDialogHub +import com.pengxh.kt.lite.utils.LoadingDialog import com.pengxh.kt.lite.utils.WeakReferenceHandler import com.pengxh.kt.lite.widget.dialog.AlertControlDialog @@ -78,8 +78,8 @@ operationViewModel = ViewModelProvider(this)[OperationViewModel::class.java] - binding.notProcessedView.addItemDecoration( - RecyclerViewItemOffsets(0, 5, 0, 5) + binding.recyclerView.addItemDecoration( + RecyclerViewItemOffsets(0, 7, 0, 7) ) } @@ -87,9 +87,9 @@ //接单状态处理 operationViewModel.loadState.observe(this) { when (it) { - is LoadState.Loading -> LoadingDialogHub.show(requireActivity(), "接单中,请稍后") + is LoadState.Loading -> LoadingDialog.show(requireActivity(), "接单中,请稍后") is LoadState.Success -> { - LoadingDialogHub.dismiss() + LoadingDialog.dismiss() //接单成功之后刷新列表 dataBeans.removeAt(clickedPosition) notProcessedAdapter.notifyItemRemoved(clickedPosition) @@ -98,7 +98,7 @@ ) } - else -> LoadingDialogHub.dismiss() + else -> LoadingDialog.dismiss() } } } @@ -131,7 +131,7 @@ } else { binding.emptyInclude.emptyView.hide() notProcessedAdapter = OrderNotProcessedAdapter(requireContext(), dataBeans) - binding.notProcessedView.adapter = notProcessedAdapter + binding.recyclerView.adapter = notProcessedAdapter notProcessedAdapter.setOnItemClickListener(object : OrderNotProcessedAdapter.OnItemClickListener { override fun onClicked(position: Int) { diff --git a/app/src/main/java/com/casic/app/smartwell/fragment/OvertimeNotAcceptFragment.kt b/app/src/main/java/com/casic/app/smartwell/fragment/OvertimeNotAcceptFragment.kt index a198545..9b318ca 100644 --- a/app/src/main/java/com/casic/app/smartwell/fragment/OvertimeNotAcceptFragment.kt +++ b/app/src/main/java/com/casic/app/smartwell/fragment/OvertimeNotAcceptFragment.kt @@ -18,7 +18,7 @@ import com.pengxh.kt.lite.extensions.navigatePageTo import com.pengxh.kt.lite.extensions.show import com.pengxh.kt.lite.utils.LoadState -import com.pengxh.kt.lite.utils.LoadingDialogHub +import com.pengxh.kt.lite.utils.LoadingDialog import com.pengxh.kt.lite.utils.WeakReferenceHandler import com.pengxh.kt.lite.widget.dialog.AlertControlDialog @@ -81,8 +81,8 @@ operationViewModel = ViewModelProvider(this)[OperationViewModel::class.java] - binding.notProcessedView.addItemDecoration( - RecyclerViewItemOffsets(0, 5, 0, 5) + binding.recyclerView.addItemDecoration( + RecyclerViewItemOffsets(0, 7, 0, 7) ) } @@ -90,9 +90,9 @@ //接单状态处理 operationViewModel.loadState.observe(this) { when (it) { - is LoadState.Loading -> LoadingDialogHub.show(requireActivity(), "接单中,请稍后") + is LoadState.Loading -> LoadingDialog.show(requireActivity(), "接单中,请稍后") is LoadState.Success -> { - LoadingDialogHub.dismiss() + LoadingDialog.dismiss() //接单成功之后刷新列表 dataBeans.removeAt(clickedPosition) notProcessedAdapter.notifyItemRemoved(clickedPosition) @@ -101,7 +101,7 @@ ) } - else -> LoadingDialogHub.dismiss() + else -> LoadingDialog.dismiss() } } } @@ -134,7 +134,7 @@ } else { binding.emptyInclude.emptyView.hide() notProcessedAdapter = OrderNotProcessedAdapter(requireContext(), dataBeans) - binding.notProcessedView.adapter = notProcessedAdapter + binding.recyclerView.adapter = notProcessedAdapter notProcessedAdapter.setOnItemClickListener(object : OrderNotProcessedAdapter.OnItemClickListener { override fun onClicked(position: Int) { diff --git a/app/src/main/java/com/casic/app/smartwell/greendao/DaoMaster.java b/app/src/main/java/com/casic/app/smartwell/greendao/DaoMaster.java index fdcf3a7..1e52b74 100644 --- a/app/src/main/java/com/casic/app/smartwell/greendao/DaoMaster.java +++ b/app/src/main/java/com/casic/app/smartwell/greendao/DaoMaster.java @@ -13,25 +13,20 @@ // THIS CODE IS GENERATED BY greenDAO, DO NOT EDIT. - /** * Master of DAO (schema version 4): knows all DAOs. */ public class DaoMaster extends AbstractDaoMaster { public static final int SCHEMA_VERSION = 4; - /** - * Creates underlying database table using DAOs. - */ + /** Creates underlying database table using DAOs. */ public static void createAllTables(Database db, boolean ifNotExists) { MapWellLocalBeanDao.createTable(db, ifNotExists); NoticeLocaleBeanDao.createTable(db, ifNotExists); PipeLocalBeanDao.createTable(db, ifNotExists); } - /** - * Drops underlying database table using DAOs. - */ + /** Drops underlying database table using DAOs. */ public static void dropAllTables(Database db, boolean ifExists) { MapWellLocalBeanDao.dropTable(db, ifExists); NoticeLocaleBeanDao.dropTable(db, ifExists); @@ -86,9 +81,7 @@ } } - /** - * WARNING: Drops all table on Upgrade! Use only during development. - */ + /** WARNING: Drops all table on Upgrade! Use only during development. */ public static class DevOpenHelper extends OpenHelper { public DevOpenHelper(Context context, String name) { super(context, name); diff --git a/app/src/main/java/com/casic/app/smartwell/greendao/DaoSession.java b/app/src/main/java/com/casic/app/smartwell/greendao/DaoSession.java index 0b36d17..3e40e3b 100644 --- a/app/src/main/java/com/casic/app/smartwell/greendao/DaoSession.java +++ b/app/src/main/java/com/casic/app/smartwell/greendao/DaoSession.java @@ -16,7 +16,7 @@ /** * {@inheritDoc} - * + * * @see org.greenrobot.greendao.AbstractDaoSession */ public class DaoSession extends AbstractDaoSession { @@ -50,7 +50,7 @@ registerDao(NoticeLocaleBean.class, noticeLocaleBeanDao); registerDao(PipeLocalBean.class, pipeLocalBeanDao); } - + public void clear() { mapWellLocalBeanDaoConfig.clearIdentityScope(); noticeLocaleBeanDaoConfig.clearIdentityScope(); diff --git a/app/src/main/java/com/casic/app/smartwell/greendao/MapWellLocalBeanDao.java b/app/src/main/java/com/casic/app/smartwell/greendao/MapWellLocalBeanDao.java index 8908fda..407bc92 100644 --- a/app/src/main/java/com/casic/app/smartwell/greendao/MapWellLocalBeanDao.java +++ b/app/src/main/java/com/casic/app/smartwell/greendao/MapWellLocalBeanDao.java @@ -12,10 +12,9 @@ import org.greenrobot.greendao.internal.DaoConfig; // THIS CODE IS GENERATED BY greenDAO, DO NOT EDIT. - -/** +/** * DAO for table "MAP_WELL_LOCAL_BEAN". - */ +*/ public class MapWellLocalBeanDao extends AbstractDao { public static final String TABLENAME = "MAP_WELL_LOCAL_BEAN"; @@ -57,16 +56,14 @@ public MapWellLocalBeanDao(DaoConfig config) { super(config); } - + public MapWellLocalBeanDao(DaoConfig config, DaoSession daoSession) { super(config, daoSession); } - /** - * Creates the underlying database table. - */ + /** Creates the underlying database table. */ public static void createTable(Database db, boolean ifNotExists) { - String constraint = ifNotExists ? "IF NOT EXISTS " : ""; + String constraint = ifNotExists? "IF NOT EXISTS ": ""; db.execSQL("CREATE TABLE " + constraint + "\"MAP_WELL_LOCAL_BEAN\" (" + // "\"_id\" INTEGER PRIMARY KEY AUTOINCREMENT ," + // 0: kId "\"AREA\" TEXT," + // 1: area @@ -96,9 +93,7 @@ "\"WELL_TYPE_NAME\" TEXT);"); // 25: wellTypeName } - /** - * Drops the underlying database table. - */ + /** Drops the underlying database table. */ public static void dropTable(Database db, boolean ifExists) { String sql = "DROP TABLE " + (ifExists ? "IF EXISTS " : "") + "\"MAP_WELL_LOCAL_BEAN\""; db.execSQL(sql); @@ -107,132 +102,132 @@ @Override protected final void bindValues(DatabaseStatement stmt, MapWellLocalBean entity) { stmt.clearBindings(); - + Long kId = entity.getKId(); if (kId != null) { stmt.bindLong(1, kId); } - + String area = entity.getArea(); if (area != null) { stmt.bindString(2, area); } - + String bfzt = entity.getBfzt(); if (bfzt != null) { stmt.bindString(3, bfzt); } - + String bfztName = entity.getBfztName(); if (bfztName != null) { stmt.bindString(4, bfztName); } - + String coordinateX = entity.getCoordinateX(); if (coordinateX != null) { stmt.bindString(5, coordinateX); } - + String coordinateY = entity.getCoordinateY(); if (coordinateY != null) { stmt.bindString(6, coordinateY); } - + String deep = entity.getDeep(); if (deep != null) { stmt.bindString(7, deep); } - + String deptName = entity.getDeptName(); if (deptName != null) { stmt.bindString(8, deptName); } - + String deptid = entity.getDeptid(); if (deptid != null) { stmt.bindString(9, deptid); } - + String id = entity.getId(); if (id != null) { stmt.bindString(10, id); } - + String latBaidu = entity.getLatBaidu(); if (latBaidu != null) { stmt.bindString(11, latBaidu); } - + String latGaode = entity.getLatGaode(); if (latGaode != null) { stmt.bindString(12, latGaode); } - + String lngBaidu = entity.getLngBaidu(); if (lngBaidu != null) { stmt.bindString(13, lngBaidu); } - + String lngGaode = entity.getLngGaode(); if (lngGaode != null) { stmt.bindString(14, lngGaode); } - + String notes = entity.getNotes(); if (notes != null) { stmt.bindString(15, notes); } - + String photos = entity.getPhotos(); if (photos != null) { stmt.bindString(16, photos); } - + String position = entity.getPosition(); if (position != null) { stmt.bindString(17, position); } - + String staff = entity.getStaff(); if (staff != null) { stmt.bindString(18, staff); } - + String tel = entity.getTel(); if (tel != null) { stmt.bindString(19, tel); } - + String ts = entity.getTs(); if (ts != null) { stmt.bindString(20, ts); } - + String valid = entity.getValid(); if (valid != null) { stmt.bindString(21, valid); } - + String watchData = entity.getWatchData(); if (watchData != null) { stmt.bindString(22, watchData); } - + String wellCode = entity.getWellCode(); if (wellCode != null) { stmt.bindString(23, wellCode); } - + String wellName = entity.getWellName(); if (wellName != null) { stmt.bindString(24, wellName); } - + String wellType = entity.getWellType(); if (wellType != null) { stmt.bindString(25, wellType); } - + String wellTypeName = entity.getWellTypeName(); if (wellTypeName != null) { stmt.bindString(26, wellTypeName); @@ -242,132 +237,132 @@ @Override protected final void bindValues(SQLiteStatement stmt, MapWellLocalBean entity) { stmt.clearBindings(); - + Long kId = entity.getKId(); if (kId != null) { stmt.bindLong(1, kId); } - + String area = entity.getArea(); if (area != null) { stmt.bindString(2, area); } - + String bfzt = entity.getBfzt(); if (bfzt != null) { stmt.bindString(3, bfzt); } - + String bfztName = entity.getBfztName(); if (bfztName != null) { stmt.bindString(4, bfztName); } - + String coordinateX = entity.getCoordinateX(); if (coordinateX != null) { stmt.bindString(5, coordinateX); } - + String coordinateY = entity.getCoordinateY(); if (coordinateY != null) { stmt.bindString(6, coordinateY); } - + String deep = entity.getDeep(); if (deep != null) { stmt.bindString(7, deep); } - + String deptName = entity.getDeptName(); if (deptName != null) { stmt.bindString(8, deptName); } - + String deptid = entity.getDeptid(); if (deptid != null) { stmt.bindString(9, deptid); } - + String id = entity.getId(); if (id != null) { stmt.bindString(10, id); } - + String latBaidu = entity.getLatBaidu(); if (latBaidu != null) { stmt.bindString(11, latBaidu); } - + String latGaode = entity.getLatGaode(); if (latGaode != null) { stmt.bindString(12, latGaode); } - + String lngBaidu = entity.getLngBaidu(); if (lngBaidu != null) { stmt.bindString(13, lngBaidu); } - + String lngGaode = entity.getLngGaode(); if (lngGaode != null) { stmt.bindString(14, lngGaode); } - + String notes = entity.getNotes(); if (notes != null) { stmt.bindString(15, notes); } - + String photos = entity.getPhotos(); if (photos != null) { stmt.bindString(16, photos); } - + String position = entity.getPosition(); if (position != null) { stmt.bindString(17, position); } - + String staff = entity.getStaff(); if (staff != null) { stmt.bindString(18, staff); } - + String tel = entity.getTel(); if (tel != null) { stmt.bindString(19, tel); } - + String ts = entity.getTs(); if (ts != null) { stmt.bindString(20, ts); } - + String valid = entity.getValid(); if (valid != null) { stmt.bindString(21, valid); } - + String watchData = entity.getWatchData(); if (watchData != null) { stmt.bindString(22, watchData); } - + String wellCode = entity.getWellCode(); if (wellCode != null) { stmt.bindString(23, wellCode); } - + String wellName = entity.getWellName(); if (wellName != null) { stmt.bindString(24, wellName); } - + String wellType = entity.getWellType(); if (wellType != null) { stmt.bindString(25, wellType); } - + String wellTypeName = entity.getWellTypeName(); if (wellTypeName != null) { stmt.bindString(26, wellTypeName); @@ -377,41 +372,41 @@ @Override public Long readKey(Cursor cursor, int offset) { return cursor.isNull(offset + 0) ? null : cursor.getLong(offset + 0); - } + } @Override public MapWellLocalBean readEntity(Cursor cursor, int offset) { MapWellLocalBean entity = new MapWellLocalBean( // - cursor.isNull(offset + 0) ? null : cursor.getLong(offset + 0), // kId - cursor.isNull(offset + 1) ? null : cursor.getString(offset + 1), // area - cursor.isNull(offset + 2) ? null : cursor.getString(offset + 2), // bfzt - cursor.isNull(offset + 3) ? null : cursor.getString(offset + 3), // bfztName - cursor.isNull(offset + 4) ? null : cursor.getString(offset + 4), // coordinateX - cursor.isNull(offset + 5) ? null : cursor.getString(offset + 5), // coordinateY - cursor.isNull(offset + 6) ? null : cursor.getString(offset + 6), // deep - cursor.isNull(offset + 7) ? null : cursor.getString(offset + 7), // deptName - cursor.isNull(offset + 8) ? null : cursor.getString(offset + 8), // deptid - cursor.isNull(offset + 9) ? null : cursor.getString(offset + 9), // id - cursor.isNull(offset + 10) ? null : cursor.getString(offset + 10), // latBaidu - cursor.isNull(offset + 11) ? null : cursor.getString(offset + 11), // latGaode - cursor.isNull(offset + 12) ? null : cursor.getString(offset + 12), // lngBaidu - cursor.isNull(offset + 13) ? null : cursor.getString(offset + 13), // lngGaode - cursor.isNull(offset + 14) ? null : cursor.getString(offset + 14), // notes - cursor.isNull(offset + 15) ? null : cursor.getString(offset + 15), // photos - cursor.isNull(offset + 16) ? null : cursor.getString(offset + 16), // position - cursor.isNull(offset + 17) ? null : cursor.getString(offset + 17), // staff - cursor.isNull(offset + 18) ? null : cursor.getString(offset + 18), // tel - cursor.isNull(offset + 19) ? null : cursor.getString(offset + 19), // ts - cursor.isNull(offset + 20) ? null : cursor.getString(offset + 20), // valid - cursor.isNull(offset + 21) ? null : cursor.getString(offset + 21), // watchData - cursor.isNull(offset + 22) ? null : cursor.getString(offset + 22), // wellCode - cursor.isNull(offset + 23) ? null : cursor.getString(offset + 23), // wellName - cursor.isNull(offset + 24) ? null : cursor.getString(offset + 24), // wellType - cursor.isNull(offset + 25) ? null : cursor.getString(offset + 25) // wellTypeName + cursor.isNull(offset + 0) ? null : cursor.getLong(offset + 0), // kId + cursor.isNull(offset + 1) ? null : cursor.getString(offset + 1), // area + cursor.isNull(offset + 2) ? null : cursor.getString(offset + 2), // bfzt + cursor.isNull(offset + 3) ? null : cursor.getString(offset + 3), // bfztName + cursor.isNull(offset + 4) ? null : cursor.getString(offset + 4), // coordinateX + cursor.isNull(offset + 5) ? null : cursor.getString(offset + 5), // coordinateY + cursor.isNull(offset + 6) ? null : cursor.getString(offset + 6), // deep + cursor.isNull(offset + 7) ? null : cursor.getString(offset + 7), // deptName + cursor.isNull(offset + 8) ? null : cursor.getString(offset + 8), // deptid + cursor.isNull(offset + 9) ? null : cursor.getString(offset + 9), // id + cursor.isNull(offset + 10) ? null : cursor.getString(offset + 10), // latBaidu + cursor.isNull(offset + 11) ? null : cursor.getString(offset + 11), // latGaode + cursor.isNull(offset + 12) ? null : cursor.getString(offset + 12), // lngBaidu + cursor.isNull(offset + 13) ? null : cursor.getString(offset + 13), // lngGaode + cursor.isNull(offset + 14) ? null : cursor.getString(offset + 14), // notes + cursor.isNull(offset + 15) ? null : cursor.getString(offset + 15), // photos + cursor.isNull(offset + 16) ? null : cursor.getString(offset + 16), // position + cursor.isNull(offset + 17) ? null : cursor.getString(offset + 17), // staff + cursor.isNull(offset + 18) ? null : cursor.getString(offset + 18), // tel + cursor.isNull(offset + 19) ? null : cursor.getString(offset + 19), // ts + cursor.isNull(offset + 20) ? null : cursor.getString(offset + 20), // valid + cursor.isNull(offset + 21) ? null : cursor.getString(offset + 21), // watchData + cursor.isNull(offset + 22) ? null : cursor.getString(offset + 22), // wellCode + cursor.isNull(offset + 23) ? null : cursor.getString(offset + 23), // wellName + cursor.isNull(offset + 24) ? null : cursor.getString(offset + 24), // wellType + cursor.isNull(offset + 25) ? null : cursor.getString(offset + 25) // wellTypeName ); return entity; } - + @Override public void readEntity(Cursor cursor, MapWellLocalBean entity, int offset) { entity.setKId(cursor.isNull(offset + 0) ? null : cursor.getLong(offset + 0)); @@ -440,17 +435,17 @@ entity.setWellName(cursor.isNull(offset + 23) ? null : cursor.getString(offset + 23)); entity.setWellType(cursor.isNull(offset + 24) ? null : cursor.getString(offset + 24)); entity.setWellTypeName(cursor.isNull(offset + 25) ? null : cursor.getString(offset + 25)); - } - + } + @Override protected final Long updateKeyAfterInsert(MapWellLocalBean entity, long rowId) { entity.setKId(rowId); return rowId; } - + @Override public Long getKey(MapWellLocalBean entity) { - if (entity != null) { + if(entity != null) { return entity.getKId(); } else { return null; @@ -466,5 +461,5 @@ protected final boolean isEntityUpdateable() { return true; } - + } diff --git a/app/src/main/java/com/casic/app/smartwell/greendao/NoticeLocaleBeanDao.java b/app/src/main/java/com/casic/app/smartwell/greendao/NoticeLocaleBeanDao.java index 64312ed..deb2d49 100644 --- a/app/src/main/java/com/casic/app/smartwell/greendao/NoticeLocaleBeanDao.java +++ b/app/src/main/java/com/casic/app/smartwell/greendao/NoticeLocaleBeanDao.java @@ -12,10 +12,9 @@ import org.greenrobot.greendao.internal.DaoConfig; // THIS CODE IS GENERATED BY greenDAO, DO NOT EDIT. - -/** +/** * DAO for table "NOTICE_LOCALE_BEAN". - */ +*/ public class NoticeLocaleBeanDao extends AbstractDao { public static final String TABLENAME = "NOTICE_LOCALE_BEAN"; @@ -43,16 +42,14 @@ public NoticeLocaleBeanDao(DaoConfig config) { super(config); } - + public NoticeLocaleBeanDao(DaoConfig config, DaoSession daoSession) { super(config, daoSession); } - /** - * Creates the underlying database table. - */ + /** Creates the underlying database table. */ public static void createTable(Database db, boolean ifNotExists) { - String constraint = ifNotExists ? "IF NOT EXISTS " : ""; + String constraint = ifNotExists? "IF NOT EXISTS ": ""; db.execSQL("CREATE TABLE " + constraint + "\"NOTICE_LOCALE_BEAN\" (" + // "\"_id\" INTEGER PRIMARY KEY AUTOINCREMENT ," + // 0: id "\"MESSAGE_ID\" TEXT UNIQUE ," + // 1: messageId @@ -68,9 +65,7 @@ "\"NOTICE_TIME\" TEXT);"); // 11: noticeTime } - /** - * Drops the underlying database table. - */ + /** Drops the underlying database table. */ public static void dropTable(Database db, boolean ifExists) { String sql = "DROP TABLE " + (ifExists ? "IF EXISTS " : "") + "\"NOTICE_LOCALE_BEAN\""; db.execSQL(sql); @@ -79,62 +74,62 @@ @Override protected final void bindValues(DatabaseStatement stmt, NoticeLocaleBean entity) { stmt.clearBindings(); - + Long id = entity.getId(); if (id != null) { stmt.bindLong(1, id); } - + String messageId = entity.getMessageId(); if (messageId != null) { stmt.bindString(2, messageId); } - + String appid = entity.getAppid(); if (appid != null) { stmt.bindString(3, appid); } - + String clientId = entity.getClientId(); if (clientId != null) { stmt.bindString(4, clientId); } - + String taskId = entity.getTaskId(); if (taskId != null) { stmt.bindString(5, taskId); } - + String userId = entity.getUserId(); if (userId != null) { stmt.bindString(6, userId); } - + String title = entity.getTitle(); if (title != null) { stmt.bindString(7, title); } - + String content = entity.getContent(); if (content != null) { stmt.bindString(8, content); } - + String deviceCode = entity.getDeviceCode(); if (deviceCode != null) { stmt.bindString(9, deviceCode); } - + String jobId = entity.getJobId(); if (jobId != null) { stmt.bindString(10, jobId); } - + String isRead = entity.getIsRead(); if (isRead != null) { stmt.bindString(11, isRead); } - + String noticeTime = entity.getNoticeTime(); if (noticeTime != null) { stmt.bindString(12, noticeTime); @@ -144,62 +139,62 @@ @Override protected final void bindValues(SQLiteStatement stmt, NoticeLocaleBean entity) { stmt.clearBindings(); - + Long id = entity.getId(); if (id != null) { stmt.bindLong(1, id); } - + String messageId = entity.getMessageId(); if (messageId != null) { stmt.bindString(2, messageId); } - + String appid = entity.getAppid(); if (appid != null) { stmt.bindString(3, appid); } - + String clientId = entity.getClientId(); if (clientId != null) { stmt.bindString(4, clientId); } - + String taskId = entity.getTaskId(); if (taskId != null) { stmt.bindString(5, taskId); } - + String userId = entity.getUserId(); if (userId != null) { stmt.bindString(6, userId); } - + String title = entity.getTitle(); if (title != null) { stmt.bindString(7, title); } - + String content = entity.getContent(); if (content != null) { stmt.bindString(8, content); } - + String deviceCode = entity.getDeviceCode(); if (deviceCode != null) { stmt.bindString(9, deviceCode); } - + String jobId = entity.getJobId(); if (jobId != null) { stmt.bindString(10, jobId); } - + String isRead = entity.getIsRead(); if (isRead != null) { stmt.bindString(11, isRead); } - + String noticeTime = entity.getNoticeTime(); if (noticeTime != null) { stmt.bindString(12, noticeTime); @@ -209,27 +204,27 @@ @Override public Long readKey(Cursor cursor, int offset) { return cursor.isNull(offset + 0) ? null : cursor.getLong(offset + 0); - } + } @Override public NoticeLocaleBean readEntity(Cursor cursor, int offset) { NoticeLocaleBean entity = new NoticeLocaleBean( // - cursor.isNull(offset + 0) ? null : cursor.getLong(offset + 0), // id - cursor.isNull(offset + 1) ? null : cursor.getString(offset + 1), // messageId - cursor.isNull(offset + 2) ? null : cursor.getString(offset + 2), // appid - cursor.isNull(offset + 3) ? null : cursor.getString(offset + 3), // clientId - cursor.isNull(offset + 4) ? null : cursor.getString(offset + 4), // taskId - cursor.isNull(offset + 5) ? null : cursor.getString(offset + 5), // userId - cursor.isNull(offset + 6) ? null : cursor.getString(offset + 6), // title - cursor.isNull(offset + 7) ? null : cursor.getString(offset + 7), // content - cursor.isNull(offset + 8) ? null : cursor.getString(offset + 8), // deviceCode - cursor.isNull(offset + 9) ? null : cursor.getString(offset + 9), // jobId - cursor.isNull(offset + 10) ? null : cursor.getString(offset + 10), // isRead - cursor.isNull(offset + 11) ? null : cursor.getString(offset + 11) // noticeTime + cursor.isNull(offset + 0) ? null : cursor.getLong(offset + 0), // id + cursor.isNull(offset + 1) ? null : cursor.getString(offset + 1), // messageId + cursor.isNull(offset + 2) ? null : cursor.getString(offset + 2), // appid + cursor.isNull(offset + 3) ? null : cursor.getString(offset + 3), // clientId + cursor.isNull(offset + 4) ? null : cursor.getString(offset + 4), // taskId + cursor.isNull(offset + 5) ? null : cursor.getString(offset + 5), // userId + cursor.isNull(offset + 6) ? null : cursor.getString(offset + 6), // title + cursor.isNull(offset + 7) ? null : cursor.getString(offset + 7), // content + cursor.isNull(offset + 8) ? null : cursor.getString(offset + 8), // deviceCode + cursor.isNull(offset + 9) ? null : cursor.getString(offset + 9), // jobId + cursor.isNull(offset + 10) ? null : cursor.getString(offset + 10), // isRead + cursor.isNull(offset + 11) ? null : cursor.getString(offset + 11) // noticeTime ); return entity; } - + @Override public void readEntity(Cursor cursor, NoticeLocaleBean entity, int offset) { entity.setId(cursor.isNull(offset + 0) ? null : cursor.getLong(offset + 0)); @@ -244,17 +239,17 @@ entity.setJobId(cursor.isNull(offset + 9) ? null : cursor.getString(offset + 9)); entity.setIsRead(cursor.isNull(offset + 10) ? null : cursor.getString(offset + 10)); entity.setNoticeTime(cursor.isNull(offset + 11) ? null : cursor.getString(offset + 11)); - } - + } + @Override protected final Long updateKeyAfterInsert(NoticeLocaleBean entity, long rowId) { entity.setId(rowId); return rowId; } - + @Override public Long getKey(NoticeLocaleBean entity) { - if (entity != null) { + if(entity != null) { return entity.getId(); } else { return null; @@ -270,5 +265,5 @@ protected final boolean isEntityUpdateable() { return true; } - + } diff --git a/app/src/main/java/com/casic/app/smartwell/greendao/PipeLocalBeanDao.java b/app/src/main/java/com/casic/app/smartwell/greendao/PipeLocalBeanDao.java index aab4d3f..df5515a 100644 --- a/app/src/main/java/com/casic/app/smartwell/greendao/PipeLocalBeanDao.java +++ b/app/src/main/java/com/casic/app/smartwell/greendao/PipeLocalBeanDao.java @@ -12,10 +12,9 @@ import org.greenrobot.greendao.internal.DaoConfig; // THIS CODE IS GENERATED BY greenDAO, DO NOT EDIT. - -/** +/** * DAO for table "PIPE_LOCAL_BEAN". - */ +*/ public class PipeLocalBeanDao extends AbstractDao { public static final String TABLENAME = "PIPE_LOCAL_BEAN"; @@ -37,16 +36,14 @@ public PipeLocalBeanDao(DaoConfig config) { super(config); } - + public PipeLocalBeanDao(DaoConfig config, DaoSession daoSession) { super(config, daoSession); } - /** - * Creates the underlying database table. - */ + /** Creates the underlying database table. */ public static void createTable(Database db, boolean ifNotExists) { - String constraint = ifNotExists ? "IF NOT EXISTS " : ""; + String constraint = ifNotExists? "IF NOT EXISTS ": ""; db.execSQL("CREATE TABLE " + constraint + "\"PIPE_LOCAL_BEAN\" (" + // "\"_id\" INTEGER PRIMARY KEY AUTOINCREMENT ," + // 0: id "\"PIPE_CODE\" TEXT," + // 1: pipeCode @@ -56,9 +53,7 @@ "\"START_LONGITUDE_GD\" TEXT);"); // 5: startLongitudeGd } - /** - * Drops the underlying database table. - */ + /** Drops the underlying database table. */ public static void dropTable(Database db, boolean ifExists) { String sql = "DROP TABLE " + (ifExists ? "IF EXISTS " : "") + "\"PIPE_LOCAL_BEAN\""; db.execSQL(sql); @@ -67,32 +62,32 @@ @Override protected final void bindValues(DatabaseStatement stmt, PipeLocalBean entity) { stmt.clearBindings(); - + Long id = entity.getId(); if (id != null) { stmt.bindLong(1, id); } - + String pipeCode = entity.getPipeCode(); if (pipeCode != null) { stmt.bindString(2, pipeCode); } - + String endLatitudeGd = entity.getEndLatitudeGd(); if (endLatitudeGd != null) { stmt.bindString(3, endLatitudeGd); } - + String endLongitudeGd = entity.getEndLongitudeGd(); if (endLongitudeGd != null) { stmt.bindString(4, endLongitudeGd); } - + String startLatitudeGd = entity.getStartLatitudeGd(); if (startLatitudeGd != null) { stmt.bindString(5, startLatitudeGd); } - + String startLongitudeGd = entity.getStartLongitudeGd(); if (startLongitudeGd != null) { stmt.bindString(6, startLongitudeGd); @@ -102,32 +97,32 @@ @Override protected final void bindValues(SQLiteStatement stmt, PipeLocalBean entity) { stmt.clearBindings(); - + Long id = entity.getId(); if (id != null) { stmt.bindLong(1, id); } - + String pipeCode = entity.getPipeCode(); if (pipeCode != null) { stmt.bindString(2, pipeCode); } - + String endLatitudeGd = entity.getEndLatitudeGd(); if (endLatitudeGd != null) { stmt.bindString(3, endLatitudeGd); } - + String endLongitudeGd = entity.getEndLongitudeGd(); if (endLongitudeGd != null) { stmt.bindString(4, endLongitudeGd); } - + String startLatitudeGd = entity.getStartLatitudeGd(); if (startLatitudeGd != null) { stmt.bindString(5, startLatitudeGd); } - + String startLongitudeGd = entity.getStartLongitudeGd(); if (startLongitudeGd != null) { stmt.bindString(6, startLongitudeGd); @@ -137,21 +132,21 @@ @Override public Long readKey(Cursor cursor, int offset) { return cursor.isNull(offset + 0) ? null : cursor.getLong(offset + 0); - } + } @Override public PipeLocalBean readEntity(Cursor cursor, int offset) { PipeLocalBean entity = new PipeLocalBean( // - cursor.isNull(offset + 0) ? null : cursor.getLong(offset + 0), // id - cursor.isNull(offset + 1) ? null : cursor.getString(offset + 1), // pipeCode - cursor.isNull(offset + 2) ? null : cursor.getString(offset + 2), // endLatitudeGd - cursor.isNull(offset + 3) ? null : cursor.getString(offset + 3), // endLongitudeGd - cursor.isNull(offset + 4) ? null : cursor.getString(offset + 4), // startLatitudeGd - cursor.isNull(offset + 5) ? null : cursor.getString(offset + 5) // startLongitudeGd + cursor.isNull(offset + 0) ? null : cursor.getLong(offset + 0), // id + cursor.isNull(offset + 1) ? null : cursor.getString(offset + 1), // pipeCode + cursor.isNull(offset + 2) ? null : cursor.getString(offset + 2), // endLatitudeGd + cursor.isNull(offset + 3) ? null : cursor.getString(offset + 3), // endLongitudeGd + cursor.isNull(offset + 4) ? null : cursor.getString(offset + 4), // startLatitudeGd + cursor.isNull(offset + 5) ? null : cursor.getString(offset + 5) // startLongitudeGd ); return entity; } - + @Override public void readEntity(Cursor cursor, PipeLocalBean entity, int offset) { entity.setId(cursor.isNull(offset + 0) ? null : cursor.getLong(offset + 0)); @@ -160,17 +155,17 @@ entity.setEndLongitudeGd(cursor.isNull(offset + 3) ? null : cursor.getString(offset + 3)); entity.setStartLatitudeGd(cursor.isNull(offset + 4) ? null : cursor.getString(offset + 4)); entity.setStartLongitudeGd(cursor.isNull(offset + 5) ? null : cursor.getString(offset + 5)); - } - + } + @Override protected final Long updateKeyAfterInsert(PipeLocalBean entity, long rowId) { entity.setId(rowId); return rowId; } - + @Override public Long getKey(PipeLocalBean entity) { - if (entity != null) { + if(entity != null) { return entity.getId(); } else { return null; @@ -186,5 +181,5 @@ protected final boolean isEntityUpdateable() { return true; } - + } diff --git a/app/src/main/java/com/casic/app/smartwell/view/ChangePasswordActivity.kt b/app/src/main/java/com/casic/app/smartwell/view/ChangePasswordActivity.kt index 8e41039..9f1dd40 100644 --- a/app/src/main/java/com/casic/app/smartwell/view/ChangePasswordActivity.kt +++ b/app/src/main/java/com/casic/app/smartwell/view/ChangePasswordActivity.kt @@ -14,7 +14,7 @@ import com.pengxh.kt.lite.extensions.show import com.pengxh.kt.lite.utils.ActivityStackManager import com.pengxh.kt.lite.utils.LoadState -import com.pengxh.kt.lite.utils.LoadingDialogHub +import com.pengxh.kt.lite.utils.LoadingDialog import com.pengxh.kt.lite.widget.TitleBarView import java.nio.charset.StandardCharsets @@ -46,15 +46,15 @@ override fun observeRequestState() { userViewModel.loadState.observe(this) { when (it) { - is LoadState.Loading -> LoadingDialogHub.show(this, "修改中,请稍后") + is LoadState.Loading -> LoadingDialog.show(this, "修改中,请稍后") is LoadState.Success -> { - LoadingDialogHub.dismiss() + LoadingDialog.dismiss() AuthenticationHelper.removeToken() this.navigatePageTo() ActivityStackManager.finishAllActivity() } - else -> LoadingDialogHub.dismiss() + else -> LoadingDialog.dismiss() } } } diff --git a/app/src/main/java/com/casic/app/smartwell/view/DeployedWellActivity.kt b/app/src/main/java/com/casic/app/smartwell/view/DeployedWellActivity.kt index fb4339c..28a5078 100644 --- a/app/src/main/java/com/casic/app/smartwell/view/DeployedWellActivity.kt +++ b/app/src/main/java/com/casic/app/smartwell/view/DeployedWellActivity.kt @@ -83,8 +83,8 @@ } //添加分割线 - binding.deployedListView.addItemDecoration( - RecyclerViewItemOffsets(0, 5, 0, 5) + binding.recyclerView.addItemDecoration( + RecyclerViewItemOffsets(0, 7, 0, 7) ) } @@ -149,12 +149,11 @@ } else { item.deep.toString() + "m" } - viewHolder.setText(R.id.wellNameView, item.wellName) + viewHolder.setText(R.id.wellTypeView, item.wellTypeName) .setText(R.id.wellDepthView, "深:${deep}") .setText(R.id.wellCodeView, "点位编号:${item.wellCode}") - .setText(R.id.wellTypeView, "点位类型:${item.wellTypeName}") .setText(R.id.ownerShipView, "权属单位:${item.deptName}") - .setText(R.id.wellLocationView, "点位置:${item.position}") + .setText(R.id.wellLocationView, "点位位置:${item.position}") .setOnClickListener( R.id.operationButton, object : View.OnClickListener { override fun onClick(v: View?) { @@ -207,7 +206,7 @@ }) } } - binding.deployedListView.adapter = deployAdapter + binding.recyclerView.adapter = deployAdapter deployAdapter.setOnItemClickedListener(object : NormalRecyclerAdapter.OnItemClickedListener { override fun onItemClicked(position: Int, t: WellListModel.DataBean.RowsBean) { diff --git a/app/build.gradle b/app/build.gradle index 296fb6f..c18c251 100644 --- a/app/build.gradle +++ b/app/build.gradle @@ -40,10 +40,6 @@ // VIVO 相关应用参数 VIVO_APP_ID : "105749048", VIVO_APP_KEY : "e460fbf2c689e0f8c58ecc6aa62e1803", - - // 小米相关应用参数 -// XIAOMI_APP_ID : "", -// XIAOMI_APP_KEY : "", ] // 版本名后面添加一句话,意思就是flavor dimension 它的维度就是该版本号,多渠道打包很重要 @@ -107,7 +103,7 @@ dependencies { implementation fileTree(dir: 'libs', include: ['*.jar']) //基础依赖库 - implementation 'com.github.AndroidCoderPeng:Kotlin-lite-lib:1.0.10' + implementation 'com.github.AndroidCoderPeng:Kotlin-lite-lib:1.1.0' implementation 'androidx.appcompat:appcompat:1.6.1' implementation 'androidx.core:core-ktx:1.9.0' implementation 'androidx.constraintlayout:constraintlayout:2.1.4' @@ -165,8 +161,6 @@ implementation 'commons-codec:commons-codec:1.15' implementation 'com.android.support:support-annotations:28.0.0' implementation 'com.assist-v3:vivo:3.1.2' // vivo -// implementation 'com.getui.opt:xmp:3.3.1' // 小米 - //数据库框架 implementation 'org.greenrobot:greendao:3.3.0' //数据库升级 diff --git a/app/src/main/AndroidManifest.xml b/app/src/main/AndroidManifest.xml index c0af158..e0519bf 100644 --- a/app/src/main/AndroidManifest.xml +++ b/app/src/main/AndroidManifest.xml @@ -90,10 +90,10 @@ - + + android:value="ee96d8b5e12de3fbb29949efd57418a8" /> () @@ -150,7 +158,7 @@ val cameraPosition = CameraPosition(centerLatLng, 14f, 0f, 0f) val cameraUpdate = CameraUpdateFactory.newCameraPosition(cameraPosition) withContext(Dispatchers.Main) { - LoadingDialogHub.dismiss() + LoadingDialog.dismiss() aMap.animateCamera(cameraUpdate, 1500, null) } } @@ -239,11 +247,6 @@ } override fun initEvent() { - binding.rightOptionView.setOnClickListener { - val x = binding.rightOptionView.width - easyPopupWindow.width - easyPopupWindow.showAsDropDown(binding.rightOptionView, x, 0) - } - //撤防点位 binding.unDeployedLayout.setOnClickListener { requireContext().navigatePageTo() @@ -263,11 +266,11 @@ override fun observeRequestState() { wellViewModel.loadState.observe(this) { when (it) { - is LoadState.Loading -> LoadingDialogHub.show( + is LoadState.Loading -> LoadingDialog.show( requireActivity(), "数据加载中,请稍后..." ) - else -> LoadingDialogHub.dismiss() + else -> LoadingDialog.dismiss() } } } @@ -376,7 +379,7 @@ }).build().show() } }) - infoPopup.showAsDropDown(binding.rightOptionView) +// infoPopup.showAsDropDown(binding.rightOptionView) } override fun onCameraChange(p0: CameraPosition?) { diff --git a/app/src/main/java/com/casic/app/smartwell/fragment/HomePageNoClusterFragment.kt b/app/src/main/java/com/casic/app/smartwell/fragment/HomePageNoClusterFragment.kt index 802426a..b25f743 100644 --- a/app/src/main/java/com/casic/app/smartwell/fragment/HomePageNoClusterFragment.kt +++ b/app/src/main/java/com/casic/app/smartwell/fragment/HomePageNoClusterFragment.kt @@ -38,8 +38,9 @@ import com.pengxh.kt.lite.extensions.navigatePageTo import com.pengxh.kt.lite.extensions.show import com.pengxh.kt.lite.utils.LoadState -import com.pengxh.kt.lite.utils.LoadingDialogHub +import com.pengxh.kt.lite.utils.LoadingDialog import com.pengxh.kt.lite.widget.EasyPopupWindow +import com.pengxh.kt.lite.widget.TitleBarView import com.pengxh.kt.lite.widget.dialog.AlertControlDialog import kotlinx.coroutines.Dispatchers import kotlinx.coroutines.launch @@ -78,7 +79,15 @@ override fun setupTopBarLayout() { binding.rootView.initImmersionBar(this, false, R.color.mainThemeColor) - binding.titleView.text = "首页" + binding.titleView.setOnClickListener(object : TitleBarView.OnClickListener { + override fun onLeftClick() { + + } + + override fun onRightClick() { + easyPopupWindow.showAsDropDown(binding.titleView, binding.titleView.width, 0) + } + }) } override fun initOnCreate(savedInstanceState: Bundle?) { @@ -112,7 +121,7 @@ //渲染井位置 lifecycleScope.launch(Dispatchers.Main) { - LoadingDialogHub.show(requireActivity(), "数据加载中,请稍后") + LoadingDialog.show(requireActivity(), "数据加载中,请稍后") withContext(Dispatchers.IO) { //取Well缓存 val allMarkerOptions = ArrayList() @@ -144,7 +153,7 @@ val cameraPosition = CameraPosition(centerLatLng, 14f, 0f, 0f) val cameraUpdate = CameraUpdateFactory.newCameraPosition(cameraPosition) withContext(Dispatchers.Main) { - LoadingDialogHub.dismiss() + LoadingDialog.dismiss() aMap.animateCamera(cameraUpdate, 1500, null) } } @@ -238,11 +247,6 @@ } override fun initEvent() { - binding.rightOptionView.setOnClickListener { - val x = binding.rightOptionView.width - easyPopupWindow.width - easyPopupWindow.showAsDropDown(binding.rightOptionView, x, 0) - } - //撤防点位 binding.unDeployedLayout.setOnClickListener { requireContext().navigatePageTo() @@ -262,11 +266,11 @@ override fun observeRequestState() { wellViewModel.loadState.observe(this) { when (it) { - is LoadState.Loading -> LoadingDialogHub.show( + is LoadState.Loading -> LoadingDialog.show( requireActivity(), "数据加载中,请稍后..." ) - else -> LoadingDialogHub.dismiss() + else -> LoadingDialog.dismiss() } } } diff --git a/app/src/main/java/com/casic/app/smartwell/fragment/MinePageFragment.kt b/app/src/main/java/com/casic/app/smartwell/fragment/MinePageFragment.kt index 09a570c..dcb48f8 100644 --- a/app/src/main/java/com/casic/app/smartwell/fragment/MinePageFragment.kt +++ b/app/src/main/java/com/casic/app/smartwell/fragment/MinePageFragment.kt @@ -35,7 +35,7 @@ import com.pengxh.kt.lite.utils.ActivityStackManager import com.pengxh.kt.lite.utils.FileDownloadManager import com.pengxh.kt.lite.utils.LoadState -import com.pengxh.kt.lite.utils.LoadingDialogHub +import com.pengxh.kt.lite.utils.LoadingDialog import com.pengxh.kt.lite.widget.dialog.AlertControlDialog import com.pengxh.kt.lite.widget.dialog.BottomActionSheet import kotlinx.coroutines.Dispatchers @@ -60,7 +60,6 @@ override fun setupTopBarLayout() { binding.rootView.initImmersionBar(this, false, R.color.mainThemeColor) - binding.titleInclude.titleView.text = "我的" } override fun initOnCreate(savedInstanceState: Bundle?) { @@ -155,27 +154,27 @@ override fun observeRequestState() { userViewModel.loadState.observe(this) { when (it) { - is LoadState.Loading -> LoadingDialogHub.show( + is LoadState.Loading -> LoadingDialog.show( requireActivity(), "检查版本中,请稍后" ) - else -> LoadingDialogHub.dismiss() + else -> LoadingDialog.dismiss() } } wellViewModel.loadState.observe(this) { when (it) { - is LoadState.Loading -> LoadingDialogHub.show( + is LoadState.Loading -> LoadingDialog.show( requireActivity(), "数据更新中,请稍后" ) is LoadState.Fail -> { - LoadingDialogHub.dismiss() + LoadingDialog.dismiss() "数据更新超时".show(requireContext()) } else -> { - LoadingDialogHub.dismiss() + LoadingDialog.dismiss() AlertControlDialog.Builder().setContext(requireContext()).setTitle("温馨提示") .setMessage("数据更新成功,请重启应用").setNegativeButton("取消") .setPositiveButton("确定").setOnDialogButtonClickListener(object : @@ -197,17 +196,17 @@ lineViewModel.loadState.observe(this) { when (it) { - is LoadState.Loading -> LoadingDialogHub.show( + is LoadState.Loading -> LoadingDialog.show( requireActivity(), "数据更新中,请稍后" ) is LoadState.Fail -> { - LoadingDialogHub.dismiss() + LoadingDialog.dismiss() "数据更新超时".show(requireContext()) } else -> { - LoadingDialogHub.dismiss() + LoadingDialog.dismiss() AlertControlDialog.Builder().setContext(requireContext()).setTitle("温馨提示") .setMessage("数据更新成功,请重启应用").setNegativeButton("取消") .setPositiveButton("确定").setOnDialogButtonClickListener(object : diff --git a/app/src/main/java/com/casic/app/smartwell/fragment/NoticePageFragment.kt b/app/src/main/java/com/casic/app/smartwell/fragment/NoticePageFragment.kt index 171b555..3c93f54 100644 --- a/app/src/main/java/com/casic/app/smartwell/fragment/NoticePageFragment.kt +++ b/app/src/main/java/com/casic/app/smartwell/fragment/NoticePageFragment.kt @@ -48,7 +48,6 @@ override fun setupTopBarLayout() { binding.rootView.initImmersionBar(this, false, R.color.mainThemeColor) - binding.titleInclude.titleView.text = "消息" } override fun initOnCreate(savedInstanceState: Bundle?) { diff --git a/app/src/main/java/com/casic/app/smartwell/fragment/OrderListFragment.kt b/app/src/main/java/com/casic/app/smartwell/fragment/OrderListFragment.kt index 93ff35b..5e38acb 100644 --- a/app/src/main/java/com/casic/app/smartwell/fragment/OrderListFragment.kt +++ b/app/src/main/java/com/casic/app/smartwell/fragment/OrderListFragment.kt @@ -12,6 +12,7 @@ import com.casic.app.smartwell.view.SearchOrderActivity import com.pengxh.kt.lite.base.KotlinBaseFragment import com.pengxh.kt.lite.extensions.navigatePageTo +import com.pengxh.kt.lite.widget.TitleBarView class OrderListFragment : KotlinBaseFragment() { @@ -25,15 +26,22 @@ } override fun initViewBinding( - inflater: LayoutInflater, - container: ViewGroup? + inflater: LayoutInflater, container: ViewGroup? ): FragmentOrderBinding { return FragmentOrderBinding.inflate(inflater, container, false) } override fun setupTopBarLayout() { binding.rootView.initImmersionBar(this, false, R.color.mainThemeColor) - binding.titleView.text = "工单" + binding.titleView.setOnClickListener(object : TitleBarView.OnClickListener { + override fun onLeftClick() { + + } + + override fun onRightClick() { + requireContext().navigatePageTo() + } + }) } override fun initOnCreate(savedInstanceState: Bundle?) { @@ -51,8 +59,6 @@ } override fun initEvent() { - binding.rightOptionView.setOnClickListener { - requireContext().navigatePageTo() - } + } } \ No newline at end of file diff --git a/app/src/main/java/com/casic/app/smartwell/fragment/OrderNotProcessedFragment.kt b/app/src/main/java/com/casic/app/smartwell/fragment/OrderNotProcessedFragment.kt index 0b3d09d..2b6f21d 100644 --- a/app/src/main/java/com/casic/app/smartwell/fragment/OrderNotProcessedFragment.kt +++ b/app/src/main/java/com/casic/app/smartwell/fragment/OrderNotProcessedFragment.kt @@ -18,7 +18,7 @@ import com.pengxh.kt.lite.extensions.navigatePageTo import com.pengxh.kt.lite.extensions.show import com.pengxh.kt.lite.utils.LoadState -import com.pengxh.kt.lite.utils.LoadingDialogHub +import com.pengxh.kt.lite.utils.LoadingDialog import com.pengxh.kt.lite.utils.WeakReferenceHandler import com.pengxh.kt.lite.widget.dialog.AlertControlDialog @@ -78,8 +78,8 @@ operationViewModel = ViewModelProvider(this)[OperationViewModel::class.java] - binding.notProcessedView.addItemDecoration( - RecyclerViewItemOffsets(0, 5, 0, 5) + binding.recyclerView.addItemDecoration( + RecyclerViewItemOffsets(0, 7, 0, 7) ) } @@ -87,9 +87,9 @@ //接单状态处理 operationViewModel.loadState.observe(this) { when (it) { - is LoadState.Loading -> LoadingDialogHub.show(requireActivity(), "接单中,请稍后") + is LoadState.Loading -> LoadingDialog.show(requireActivity(), "接单中,请稍后") is LoadState.Success -> { - LoadingDialogHub.dismiss() + LoadingDialog.dismiss() //接单成功之后刷新列表 dataBeans.removeAt(clickedPosition) notProcessedAdapter.notifyItemRemoved(clickedPosition) @@ -98,7 +98,7 @@ ) } - else -> LoadingDialogHub.dismiss() + else -> LoadingDialog.dismiss() } } } @@ -131,7 +131,7 @@ } else { binding.emptyInclude.emptyView.hide() notProcessedAdapter = OrderNotProcessedAdapter(requireContext(), dataBeans) - binding.notProcessedView.adapter = notProcessedAdapter + binding.recyclerView.adapter = notProcessedAdapter notProcessedAdapter.setOnItemClickListener(object : OrderNotProcessedAdapter.OnItemClickListener { override fun onClicked(position: Int) { diff --git a/app/src/main/java/com/casic/app/smartwell/fragment/OvertimeNotAcceptFragment.kt b/app/src/main/java/com/casic/app/smartwell/fragment/OvertimeNotAcceptFragment.kt index a198545..9b318ca 100644 --- a/app/src/main/java/com/casic/app/smartwell/fragment/OvertimeNotAcceptFragment.kt +++ b/app/src/main/java/com/casic/app/smartwell/fragment/OvertimeNotAcceptFragment.kt @@ -18,7 +18,7 @@ import com.pengxh.kt.lite.extensions.navigatePageTo import com.pengxh.kt.lite.extensions.show import com.pengxh.kt.lite.utils.LoadState -import com.pengxh.kt.lite.utils.LoadingDialogHub +import com.pengxh.kt.lite.utils.LoadingDialog import com.pengxh.kt.lite.utils.WeakReferenceHandler import com.pengxh.kt.lite.widget.dialog.AlertControlDialog @@ -81,8 +81,8 @@ operationViewModel = ViewModelProvider(this)[OperationViewModel::class.java] - binding.notProcessedView.addItemDecoration( - RecyclerViewItemOffsets(0, 5, 0, 5) + binding.recyclerView.addItemDecoration( + RecyclerViewItemOffsets(0, 7, 0, 7) ) } @@ -90,9 +90,9 @@ //接单状态处理 operationViewModel.loadState.observe(this) { when (it) { - is LoadState.Loading -> LoadingDialogHub.show(requireActivity(), "接单中,请稍后") + is LoadState.Loading -> LoadingDialog.show(requireActivity(), "接单中,请稍后") is LoadState.Success -> { - LoadingDialogHub.dismiss() + LoadingDialog.dismiss() //接单成功之后刷新列表 dataBeans.removeAt(clickedPosition) notProcessedAdapter.notifyItemRemoved(clickedPosition) @@ -101,7 +101,7 @@ ) } - else -> LoadingDialogHub.dismiss() + else -> LoadingDialog.dismiss() } } } @@ -134,7 +134,7 @@ } else { binding.emptyInclude.emptyView.hide() notProcessedAdapter = OrderNotProcessedAdapter(requireContext(), dataBeans) - binding.notProcessedView.adapter = notProcessedAdapter + binding.recyclerView.adapter = notProcessedAdapter notProcessedAdapter.setOnItemClickListener(object : OrderNotProcessedAdapter.OnItemClickListener { override fun onClicked(position: Int) { diff --git a/app/src/main/java/com/casic/app/smartwell/greendao/DaoMaster.java b/app/src/main/java/com/casic/app/smartwell/greendao/DaoMaster.java index fdcf3a7..1e52b74 100644 --- a/app/src/main/java/com/casic/app/smartwell/greendao/DaoMaster.java +++ b/app/src/main/java/com/casic/app/smartwell/greendao/DaoMaster.java @@ -13,25 +13,20 @@ // THIS CODE IS GENERATED BY greenDAO, DO NOT EDIT. - /** * Master of DAO (schema version 4): knows all DAOs. */ public class DaoMaster extends AbstractDaoMaster { public static final int SCHEMA_VERSION = 4; - /** - * Creates underlying database table using DAOs. - */ + /** Creates underlying database table using DAOs. */ public static void createAllTables(Database db, boolean ifNotExists) { MapWellLocalBeanDao.createTable(db, ifNotExists); NoticeLocaleBeanDao.createTable(db, ifNotExists); PipeLocalBeanDao.createTable(db, ifNotExists); } - /** - * Drops underlying database table using DAOs. - */ + /** Drops underlying database table using DAOs. */ public static void dropAllTables(Database db, boolean ifExists) { MapWellLocalBeanDao.dropTable(db, ifExists); NoticeLocaleBeanDao.dropTable(db, ifExists); @@ -86,9 +81,7 @@ } } - /** - * WARNING: Drops all table on Upgrade! Use only during development. - */ + /** WARNING: Drops all table on Upgrade! Use only during development. */ public static class DevOpenHelper extends OpenHelper { public DevOpenHelper(Context context, String name) { super(context, name); diff --git a/app/src/main/java/com/casic/app/smartwell/greendao/DaoSession.java b/app/src/main/java/com/casic/app/smartwell/greendao/DaoSession.java index 0b36d17..3e40e3b 100644 --- a/app/src/main/java/com/casic/app/smartwell/greendao/DaoSession.java +++ b/app/src/main/java/com/casic/app/smartwell/greendao/DaoSession.java @@ -16,7 +16,7 @@ /** * {@inheritDoc} - * + * * @see org.greenrobot.greendao.AbstractDaoSession */ public class DaoSession extends AbstractDaoSession { @@ -50,7 +50,7 @@ registerDao(NoticeLocaleBean.class, noticeLocaleBeanDao); registerDao(PipeLocalBean.class, pipeLocalBeanDao); } - + public void clear() { mapWellLocalBeanDaoConfig.clearIdentityScope(); noticeLocaleBeanDaoConfig.clearIdentityScope(); diff --git a/app/src/main/java/com/casic/app/smartwell/greendao/MapWellLocalBeanDao.java b/app/src/main/java/com/casic/app/smartwell/greendao/MapWellLocalBeanDao.java index 8908fda..407bc92 100644 --- a/app/src/main/java/com/casic/app/smartwell/greendao/MapWellLocalBeanDao.java +++ b/app/src/main/java/com/casic/app/smartwell/greendao/MapWellLocalBeanDao.java @@ -12,10 +12,9 @@ import org.greenrobot.greendao.internal.DaoConfig; // THIS CODE IS GENERATED BY greenDAO, DO NOT EDIT. - -/** +/** * DAO for table "MAP_WELL_LOCAL_BEAN". - */ +*/ public class MapWellLocalBeanDao extends AbstractDao { public static final String TABLENAME = "MAP_WELL_LOCAL_BEAN"; @@ -57,16 +56,14 @@ public MapWellLocalBeanDao(DaoConfig config) { super(config); } - + public MapWellLocalBeanDao(DaoConfig config, DaoSession daoSession) { super(config, daoSession); } - /** - * Creates the underlying database table. - */ + /** Creates the underlying database table. */ public static void createTable(Database db, boolean ifNotExists) { - String constraint = ifNotExists ? "IF NOT EXISTS " : ""; + String constraint = ifNotExists? "IF NOT EXISTS ": ""; db.execSQL("CREATE TABLE " + constraint + "\"MAP_WELL_LOCAL_BEAN\" (" + // "\"_id\" INTEGER PRIMARY KEY AUTOINCREMENT ," + // 0: kId "\"AREA\" TEXT," + // 1: area @@ -96,9 +93,7 @@ "\"WELL_TYPE_NAME\" TEXT);"); // 25: wellTypeName } - /** - * Drops the underlying database table. - */ + /** Drops the underlying database table. */ public static void dropTable(Database db, boolean ifExists) { String sql = "DROP TABLE " + (ifExists ? "IF EXISTS " : "") + "\"MAP_WELL_LOCAL_BEAN\""; db.execSQL(sql); @@ -107,132 +102,132 @@ @Override protected final void bindValues(DatabaseStatement stmt, MapWellLocalBean entity) { stmt.clearBindings(); - + Long kId = entity.getKId(); if (kId != null) { stmt.bindLong(1, kId); } - + String area = entity.getArea(); if (area != null) { stmt.bindString(2, area); } - + String bfzt = entity.getBfzt(); if (bfzt != null) { stmt.bindString(3, bfzt); } - + String bfztName = entity.getBfztName(); if (bfztName != null) { stmt.bindString(4, bfztName); } - + String coordinateX = entity.getCoordinateX(); if (coordinateX != null) { stmt.bindString(5, coordinateX); } - + String coordinateY = entity.getCoordinateY(); if (coordinateY != null) { stmt.bindString(6, coordinateY); } - + String deep = entity.getDeep(); if (deep != null) { stmt.bindString(7, deep); } - + String deptName = entity.getDeptName(); if (deptName != null) { stmt.bindString(8, deptName); } - + String deptid = entity.getDeptid(); if (deptid != null) { stmt.bindString(9, deptid); } - + String id = entity.getId(); if (id != null) { stmt.bindString(10, id); } - + String latBaidu = entity.getLatBaidu(); if (latBaidu != null) { stmt.bindString(11, latBaidu); } - + String latGaode = entity.getLatGaode(); if (latGaode != null) { stmt.bindString(12, latGaode); } - + String lngBaidu = entity.getLngBaidu(); if (lngBaidu != null) { stmt.bindString(13, lngBaidu); } - + String lngGaode = entity.getLngGaode(); if (lngGaode != null) { stmt.bindString(14, lngGaode); } - + String notes = entity.getNotes(); if (notes != null) { stmt.bindString(15, notes); } - + String photos = entity.getPhotos(); if (photos != null) { stmt.bindString(16, photos); } - + String position = entity.getPosition(); if (position != null) { stmt.bindString(17, position); } - + String staff = entity.getStaff(); if (staff != null) { stmt.bindString(18, staff); } - + String tel = entity.getTel(); if (tel != null) { stmt.bindString(19, tel); } - + String ts = entity.getTs(); if (ts != null) { stmt.bindString(20, ts); } - + String valid = entity.getValid(); if (valid != null) { stmt.bindString(21, valid); } - + String watchData = entity.getWatchData(); if (watchData != null) { stmt.bindString(22, watchData); } - + String wellCode = entity.getWellCode(); if (wellCode != null) { stmt.bindString(23, wellCode); } - + String wellName = entity.getWellName(); if (wellName != null) { stmt.bindString(24, wellName); } - + String wellType = entity.getWellType(); if (wellType != null) { stmt.bindString(25, wellType); } - + String wellTypeName = entity.getWellTypeName(); if (wellTypeName != null) { stmt.bindString(26, wellTypeName); @@ -242,132 +237,132 @@ @Override protected final void bindValues(SQLiteStatement stmt, MapWellLocalBean entity) { stmt.clearBindings(); - + Long kId = entity.getKId(); if (kId != null) { stmt.bindLong(1, kId); } - + String area = entity.getArea(); if (area != null) { stmt.bindString(2, area); } - + String bfzt = entity.getBfzt(); if (bfzt != null) { stmt.bindString(3, bfzt); } - + String bfztName = entity.getBfztName(); if (bfztName != null) { stmt.bindString(4, bfztName); } - + String coordinateX = entity.getCoordinateX(); if (coordinateX != null) { stmt.bindString(5, coordinateX); } - + String coordinateY = entity.getCoordinateY(); if (coordinateY != null) { stmt.bindString(6, coordinateY); } - + String deep = entity.getDeep(); if (deep != null) { stmt.bindString(7, deep); } - + String deptName = entity.getDeptName(); if (deptName != null) { stmt.bindString(8, deptName); } - + String deptid = entity.getDeptid(); if (deptid != null) { stmt.bindString(9, deptid); } - + String id = entity.getId(); if (id != null) { stmt.bindString(10, id); } - + String latBaidu = entity.getLatBaidu(); if (latBaidu != null) { stmt.bindString(11, latBaidu); } - + String latGaode = entity.getLatGaode(); if (latGaode != null) { stmt.bindString(12, latGaode); } - + String lngBaidu = entity.getLngBaidu(); if (lngBaidu != null) { stmt.bindString(13, lngBaidu); } - + String lngGaode = entity.getLngGaode(); if (lngGaode != null) { stmt.bindString(14, lngGaode); } - + String notes = entity.getNotes(); if (notes != null) { stmt.bindString(15, notes); } - + String photos = entity.getPhotos(); if (photos != null) { stmt.bindString(16, photos); } - + String position = entity.getPosition(); if (position != null) { stmt.bindString(17, position); } - + String staff = entity.getStaff(); if (staff != null) { stmt.bindString(18, staff); } - + String tel = entity.getTel(); if (tel != null) { stmt.bindString(19, tel); } - + String ts = entity.getTs(); if (ts != null) { stmt.bindString(20, ts); } - + String valid = entity.getValid(); if (valid != null) { stmt.bindString(21, valid); } - + String watchData = entity.getWatchData(); if (watchData != null) { stmt.bindString(22, watchData); } - + String wellCode = entity.getWellCode(); if (wellCode != null) { stmt.bindString(23, wellCode); } - + String wellName = entity.getWellName(); if (wellName != null) { stmt.bindString(24, wellName); } - + String wellType = entity.getWellType(); if (wellType != null) { stmt.bindString(25, wellType); } - + String wellTypeName = entity.getWellTypeName(); if (wellTypeName != null) { stmt.bindString(26, wellTypeName); @@ -377,41 +372,41 @@ @Override public Long readKey(Cursor cursor, int offset) { return cursor.isNull(offset + 0) ? null : cursor.getLong(offset + 0); - } + } @Override public MapWellLocalBean readEntity(Cursor cursor, int offset) { MapWellLocalBean entity = new MapWellLocalBean( // - cursor.isNull(offset + 0) ? null : cursor.getLong(offset + 0), // kId - cursor.isNull(offset + 1) ? null : cursor.getString(offset + 1), // area - cursor.isNull(offset + 2) ? null : cursor.getString(offset + 2), // bfzt - cursor.isNull(offset + 3) ? null : cursor.getString(offset + 3), // bfztName - cursor.isNull(offset + 4) ? null : cursor.getString(offset + 4), // coordinateX - cursor.isNull(offset + 5) ? null : cursor.getString(offset + 5), // coordinateY - cursor.isNull(offset + 6) ? null : cursor.getString(offset + 6), // deep - cursor.isNull(offset + 7) ? null : cursor.getString(offset + 7), // deptName - cursor.isNull(offset + 8) ? null : cursor.getString(offset + 8), // deptid - cursor.isNull(offset + 9) ? null : cursor.getString(offset + 9), // id - cursor.isNull(offset + 10) ? null : cursor.getString(offset + 10), // latBaidu - cursor.isNull(offset + 11) ? null : cursor.getString(offset + 11), // latGaode - cursor.isNull(offset + 12) ? null : cursor.getString(offset + 12), // lngBaidu - cursor.isNull(offset + 13) ? null : cursor.getString(offset + 13), // lngGaode - cursor.isNull(offset + 14) ? null : cursor.getString(offset + 14), // notes - cursor.isNull(offset + 15) ? null : cursor.getString(offset + 15), // photos - cursor.isNull(offset + 16) ? null : cursor.getString(offset + 16), // position - cursor.isNull(offset + 17) ? null : cursor.getString(offset + 17), // staff - cursor.isNull(offset + 18) ? null : cursor.getString(offset + 18), // tel - cursor.isNull(offset + 19) ? null : cursor.getString(offset + 19), // ts - cursor.isNull(offset + 20) ? null : cursor.getString(offset + 20), // valid - cursor.isNull(offset + 21) ? null : cursor.getString(offset + 21), // watchData - cursor.isNull(offset + 22) ? null : cursor.getString(offset + 22), // wellCode - cursor.isNull(offset + 23) ? null : cursor.getString(offset + 23), // wellName - cursor.isNull(offset + 24) ? null : cursor.getString(offset + 24), // wellType - cursor.isNull(offset + 25) ? null : cursor.getString(offset + 25) // wellTypeName + cursor.isNull(offset + 0) ? null : cursor.getLong(offset + 0), // kId + cursor.isNull(offset + 1) ? null : cursor.getString(offset + 1), // area + cursor.isNull(offset + 2) ? null : cursor.getString(offset + 2), // bfzt + cursor.isNull(offset + 3) ? null : cursor.getString(offset + 3), // bfztName + cursor.isNull(offset + 4) ? null : cursor.getString(offset + 4), // coordinateX + cursor.isNull(offset + 5) ? null : cursor.getString(offset + 5), // coordinateY + cursor.isNull(offset + 6) ? null : cursor.getString(offset + 6), // deep + cursor.isNull(offset + 7) ? null : cursor.getString(offset + 7), // deptName + cursor.isNull(offset + 8) ? null : cursor.getString(offset + 8), // deptid + cursor.isNull(offset + 9) ? null : cursor.getString(offset + 9), // id + cursor.isNull(offset + 10) ? null : cursor.getString(offset + 10), // latBaidu + cursor.isNull(offset + 11) ? null : cursor.getString(offset + 11), // latGaode + cursor.isNull(offset + 12) ? null : cursor.getString(offset + 12), // lngBaidu + cursor.isNull(offset + 13) ? null : cursor.getString(offset + 13), // lngGaode + cursor.isNull(offset + 14) ? null : cursor.getString(offset + 14), // notes + cursor.isNull(offset + 15) ? null : cursor.getString(offset + 15), // photos + cursor.isNull(offset + 16) ? null : cursor.getString(offset + 16), // position + cursor.isNull(offset + 17) ? null : cursor.getString(offset + 17), // staff + cursor.isNull(offset + 18) ? null : cursor.getString(offset + 18), // tel + cursor.isNull(offset + 19) ? null : cursor.getString(offset + 19), // ts + cursor.isNull(offset + 20) ? null : cursor.getString(offset + 20), // valid + cursor.isNull(offset + 21) ? null : cursor.getString(offset + 21), // watchData + cursor.isNull(offset + 22) ? null : cursor.getString(offset + 22), // wellCode + cursor.isNull(offset + 23) ? null : cursor.getString(offset + 23), // wellName + cursor.isNull(offset + 24) ? null : cursor.getString(offset + 24), // wellType + cursor.isNull(offset + 25) ? null : cursor.getString(offset + 25) // wellTypeName ); return entity; } - + @Override public void readEntity(Cursor cursor, MapWellLocalBean entity, int offset) { entity.setKId(cursor.isNull(offset + 0) ? null : cursor.getLong(offset + 0)); @@ -440,17 +435,17 @@ entity.setWellName(cursor.isNull(offset + 23) ? null : cursor.getString(offset + 23)); entity.setWellType(cursor.isNull(offset + 24) ? null : cursor.getString(offset + 24)); entity.setWellTypeName(cursor.isNull(offset + 25) ? null : cursor.getString(offset + 25)); - } - + } + @Override protected final Long updateKeyAfterInsert(MapWellLocalBean entity, long rowId) { entity.setKId(rowId); return rowId; } - + @Override public Long getKey(MapWellLocalBean entity) { - if (entity != null) { + if(entity != null) { return entity.getKId(); } else { return null; @@ -466,5 +461,5 @@ protected final boolean isEntityUpdateable() { return true; } - + } diff --git a/app/src/main/java/com/casic/app/smartwell/greendao/NoticeLocaleBeanDao.java b/app/src/main/java/com/casic/app/smartwell/greendao/NoticeLocaleBeanDao.java index 64312ed..deb2d49 100644 --- a/app/src/main/java/com/casic/app/smartwell/greendao/NoticeLocaleBeanDao.java +++ b/app/src/main/java/com/casic/app/smartwell/greendao/NoticeLocaleBeanDao.java @@ -12,10 +12,9 @@ import org.greenrobot.greendao.internal.DaoConfig; // THIS CODE IS GENERATED BY greenDAO, DO NOT EDIT. - -/** +/** * DAO for table "NOTICE_LOCALE_BEAN". - */ +*/ public class NoticeLocaleBeanDao extends AbstractDao { public static final String TABLENAME = "NOTICE_LOCALE_BEAN"; @@ -43,16 +42,14 @@ public NoticeLocaleBeanDao(DaoConfig config) { super(config); } - + public NoticeLocaleBeanDao(DaoConfig config, DaoSession daoSession) { super(config, daoSession); } - /** - * Creates the underlying database table. - */ + /** Creates the underlying database table. */ public static void createTable(Database db, boolean ifNotExists) { - String constraint = ifNotExists ? "IF NOT EXISTS " : ""; + String constraint = ifNotExists? "IF NOT EXISTS ": ""; db.execSQL("CREATE TABLE " + constraint + "\"NOTICE_LOCALE_BEAN\" (" + // "\"_id\" INTEGER PRIMARY KEY AUTOINCREMENT ," + // 0: id "\"MESSAGE_ID\" TEXT UNIQUE ," + // 1: messageId @@ -68,9 +65,7 @@ "\"NOTICE_TIME\" TEXT);"); // 11: noticeTime } - /** - * Drops the underlying database table. - */ + /** Drops the underlying database table. */ public static void dropTable(Database db, boolean ifExists) { String sql = "DROP TABLE " + (ifExists ? "IF EXISTS " : "") + "\"NOTICE_LOCALE_BEAN\""; db.execSQL(sql); @@ -79,62 +74,62 @@ @Override protected final void bindValues(DatabaseStatement stmt, NoticeLocaleBean entity) { stmt.clearBindings(); - + Long id = entity.getId(); if (id != null) { stmt.bindLong(1, id); } - + String messageId = entity.getMessageId(); if (messageId != null) { stmt.bindString(2, messageId); } - + String appid = entity.getAppid(); if (appid != null) { stmt.bindString(3, appid); } - + String clientId = entity.getClientId(); if (clientId != null) { stmt.bindString(4, clientId); } - + String taskId = entity.getTaskId(); if (taskId != null) { stmt.bindString(5, taskId); } - + String userId = entity.getUserId(); if (userId != null) { stmt.bindString(6, userId); } - + String title = entity.getTitle(); if (title != null) { stmt.bindString(7, title); } - + String content = entity.getContent(); if (content != null) { stmt.bindString(8, content); } - + String deviceCode = entity.getDeviceCode(); if (deviceCode != null) { stmt.bindString(9, deviceCode); } - + String jobId = entity.getJobId(); if (jobId != null) { stmt.bindString(10, jobId); } - + String isRead = entity.getIsRead(); if (isRead != null) { stmt.bindString(11, isRead); } - + String noticeTime = entity.getNoticeTime(); if (noticeTime != null) { stmt.bindString(12, noticeTime); @@ -144,62 +139,62 @@ @Override protected final void bindValues(SQLiteStatement stmt, NoticeLocaleBean entity) { stmt.clearBindings(); - + Long id = entity.getId(); if (id != null) { stmt.bindLong(1, id); } - + String messageId = entity.getMessageId(); if (messageId != null) { stmt.bindString(2, messageId); } - + String appid = entity.getAppid(); if (appid != null) { stmt.bindString(3, appid); } - + String clientId = entity.getClientId(); if (clientId != null) { stmt.bindString(4, clientId); } - + String taskId = entity.getTaskId(); if (taskId != null) { stmt.bindString(5, taskId); } - + String userId = entity.getUserId(); if (userId != null) { stmt.bindString(6, userId); } - + String title = entity.getTitle(); if (title != null) { stmt.bindString(7, title); } - + String content = entity.getContent(); if (content != null) { stmt.bindString(8, content); } - + String deviceCode = entity.getDeviceCode(); if (deviceCode != null) { stmt.bindString(9, deviceCode); } - + String jobId = entity.getJobId(); if (jobId != null) { stmt.bindString(10, jobId); } - + String isRead = entity.getIsRead(); if (isRead != null) { stmt.bindString(11, isRead); } - + String noticeTime = entity.getNoticeTime(); if (noticeTime != null) { stmt.bindString(12, noticeTime); @@ -209,27 +204,27 @@ @Override public Long readKey(Cursor cursor, int offset) { return cursor.isNull(offset + 0) ? null : cursor.getLong(offset + 0); - } + } @Override public NoticeLocaleBean readEntity(Cursor cursor, int offset) { NoticeLocaleBean entity = new NoticeLocaleBean( // - cursor.isNull(offset + 0) ? null : cursor.getLong(offset + 0), // id - cursor.isNull(offset + 1) ? null : cursor.getString(offset + 1), // messageId - cursor.isNull(offset + 2) ? null : cursor.getString(offset + 2), // appid - cursor.isNull(offset + 3) ? null : cursor.getString(offset + 3), // clientId - cursor.isNull(offset + 4) ? null : cursor.getString(offset + 4), // taskId - cursor.isNull(offset + 5) ? null : cursor.getString(offset + 5), // userId - cursor.isNull(offset + 6) ? null : cursor.getString(offset + 6), // title - cursor.isNull(offset + 7) ? null : cursor.getString(offset + 7), // content - cursor.isNull(offset + 8) ? null : cursor.getString(offset + 8), // deviceCode - cursor.isNull(offset + 9) ? null : cursor.getString(offset + 9), // jobId - cursor.isNull(offset + 10) ? null : cursor.getString(offset + 10), // isRead - cursor.isNull(offset + 11) ? null : cursor.getString(offset + 11) // noticeTime + cursor.isNull(offset + 0) ? null : cursor.getLong(offset + 0), // id + cursor.isNull(offset + 1) ? null : cursor.getString(offset + 1), // messageId + cursor.isNull(offset + 2) ? null : cursor.getString(offset + 2), // appid + cursor.isNull(offset + 3) ? null : cursor.getString(offset + 3), // clientId + cursor.isNull(offset + 4) ? null : cursor.getString(offset + 4), // taskId + cursor.isNull(offset + 5) ? null : cursor.getString(offset + 5), // userId + cursor.isNull(offset + 6) ? null : cursor.getString(offset + 6), // title + cursor.isNull(offset + 7) ? null : cursor.getString(offset + 7), // content + cursor.isNull(offset + 8) ? null : cursor.getString(offset + 8), // deviceCode + cursor.isNull(offset + 9) ? null : cursor.getString(offset + 9), // jobId + cursor.isNull(offset + 10) ? null : cursor.getString(offset + 10), // isRead + cursor.isNull(offset + 11) ? null : cursor.getString(offset + 11) // noticeTime ); return entity; } - + @Override public void readEntity(Cursor cursor, NoticeLocaleBean entity, int offset) { entity.setId(cursor.isNull(offset + 0) ? null : cursor.getLong(offset + 0)); @@ -244,17 +239,17 @@ entity.setJobId(cursor.isNull(offset + 9) ? null : cursor.getString(offset + 9)); entity.setIsRead(cursor.isNull(offset + 10) ? null : cursor.getString(offset + 10)); entity.setNoticeTime(cursor.isNull(offset + 11) ? null : cursor.getString(offset + 11)); - } - + } + @Override protected final Long updateKeyAfterInsert(NoticeLocaleBean entity, long rowId) { entity.setId(rowId); return rowId; } - + @Override public Long getKey(NoticeLocaleBean entity) { - if (entity != null) { + if(entity != null) { return entity.getId(); } else { return null; @@ -270,5 +265,5 @@ protected final boolean isEntityUpdateable() { return true; } - + } diff --git a/app/src/main/java/com/casic/app/smartwell/greendao/PipeLocalBeanDao.java b/app/src/main/java/com/casic/app/smartwell/greendao/PipeLocalBeanDao.java index aab4d3f..df5515a 100644 --- a/app/src/main/java/com/casic/app/smartwell/greendao/PipeLocalBeanDao.java +++ b/app/src/main/java/com/casic/app/smartwell/greendao/PipeLocalBeanDao.java @@ -12,10 +12,9 @@ import org.greenrobot.greendao.internal.DaoConfig; // THIS CODE IS GENERATED BY greenDAO, DO NOT EDIT. - -/** +/** * DAO for table "PIPE_LOCAL_BEAN". - */ +*/ public class PipeLocalBeanDao extends AbstractDao { public static final String TABLENAME = "PIPE_LOCAL_BEAN"; @@ -37,16 +36,14 @@ public PipeLocalBeanDao(DaoConfig config) { super(config); } - + public PipeLocalBeanDao(DaoConfig config, DaoSession daoSession) { super(config, daoSession); } - /** - * Creates the underlying database table. - */ + /** Creates the underlying database table. */ public static void createTable(Database db, boolean ifNotExists) { - String constraint = ifNotExists ? "IF NOT EXISTS " : ""; + String constraint = ifNotExists? "IF NOT EXISTS ": ""; db.execSQL("CREATE TABLE " + constraint + "\"PIPE_LOCAL_BEAN\" (" + // "\"_id\" INTEGER PRIMARY KEY AUTOINCREMENT ," + // 0: id "\"PIPE_CODE\" TEXT," + // 1: pipeCode @@ -56,9 +53,7 @@ "\"START_LONGITUDE_GD\" TEXT);"); // 5: startLongitudeGd } - /** - * Drops the underlying database table. - */ + /** Drops the underlying database table. */ public static void dropTable(Database db, boolean ifExists) { String sql = "DROP TABLE " + (ifExists ? "IF EXISTS " : "") + "\"PIPE_LOCAL_BEAN\""; db.execSQL(sql); @@ -67,32 +62,32 @@ @Override protected final void bindValues(DatabaseStatement stmt, PipeLocalBean entity) { stmt.clearBindings(); - + Long id = entity.getId(); if (id != null) { stmt.bindLong(1, id); } - + String pipeCode = entity.getPipeCode(); if (pipeCode != null) { stmt.bindString(2, pipeCode); } - + String endLatitudeGd = entity.getEndLatitudeGd(); if (endLatitudeGd != null) { stmt.bindString(3, endLatitudeGd); } - + String endLongitudeGd = entity.getEndLongitudeGd(); if (endLongitudeGd != null) { stmt.bindString(4, endLongitudeGd); } - + String startLatitudeGd = entity.getStartLatitudeGd(); if (startLatitudeGd != null) { stmt.bindString(5, startLatitudeGd); } - + String startLongitudeGd = entity.getStartLongitudeGd(); if (startLongitudeGd != null) { stmt.bindString(6, startLongitudeGd); @@ -102,32 +97,32 @@ @Override protected final void bindValues(SQLiteStatement stmt, PipeLocalBean entity) { stmt.clearBindings(); - + Long id = entity.getId(); if (id != null) { stmt.bindLong(1, id); } - + String pipeCode = entity.getPipeCode(); if (pipeCode != null) { stmt.bindString(2, pipeCode); } - + String endLatitudeGd = entity.getEndLatitudeGd(); if (endLatitudeGd != null) { stmt.bindString(3, endLatitudeGd); } - + String endLongitudeGd = entity.getEndLongitudeGd(); if (endLongitudeGd != null) { stmt.bindString(4, endLongitudeGd); } - + String startLatitudeGd = entity.getStartLatitudeGd(); if (startLatitudeGd != null) { stmt.bindString(5, startLatitudeGd); } - + String startLongitudeGd = entity.getStartLongitudeGd(); if (startLongitudeGd != null) { stmt.bindString(6, startLongitudeGd); @@ -137,21 +132,21 @@ @Override public Long readKey(Cursor cursor, int offset) { return cursor.isNull(offset + 0) ? null : cursor.getLong(offset + 0); - } + } @Override public PipeLocalBean readEntity(Cursor cursor, int offset) { PipeLocalBean entity = new PipeLocalBean( // - cursor.isNull(offset + 0) ? null : cursor.getLong(offset + 0), // id - cursor.isNull(offset + 1) ? null : cursor.getString(offset + 1), // pipeCode - cursor.isNull(offset + 2) ? null : cursor.getString(offset + 2), // endLatitudeGd - cursor.isNull(offset + 3) ? null : cursor.getString(offset + 3), // endLongitudeGd - cursor.isNull(offset + 4) ? null : cursor.getString(offset + 4), // startLatitudeGd - cursor.isNull(offset + 5) ? null : cursor.getString(offset + 5) // startLongitudeGd + cursor.isNull(offset + 0) ? null : cursor.getLong(offset + 0), // id + cursor.isNull(offset + 1) ? null : cursor.getString(offset + 1), // pipeCode + cursor.isNull(offset + 2) ? null : cursor.getString(offset + 2), // endLatitudeGd + cursor.isNull(offset + 3) ? null : cursor.getString(offset + 3), // endLongitudeGd + cursor.isNull(offset + 4) ? null : cursor.getString(offset + 4), // startLatitudeGd + cursor.isNull(offset + 5) ? null : cursor.getString(offset + 5) // startLongitudeGd ); return entity; } - + @Override public void readEntity(Cursor cursor, PipeLocalBean entity, int offset) { entity.setId(cursor.isNull(offset + 0) ? null : cursor.getLong(offset + 0)); @@ -160,17 +155,17 @@ entity.setEndLongitudeGd(cursor.isNull(offset + 3) ? null : cursor.getString(offset + 3)); entity.setStartLatitudeGd(cursor.isNull(offset + 4) ? null : cursor.getString(offset + 4)); entity.setStartLongitudeGd(cursor.isNull(offset + 5) ? null : cursor.getString(offset + 5)); - } - + } + @Override protected final Long updateKeyAfterInsert(PipeLocalBean entity, long rowId) { entity.setId(rowId); return rowId; } - + @Override public Long getKey(PipeLocalBean entity) { - if (entity != null) { + if(entity != null) { return entity.getId(); } else { return null; @@ -186,5 +181,5 @@ protected final boolean isEntityUpdateable() { return true; } - + } diff --git a/app/src/main/java/com/casic/app/smartwell/view/ChangePasswordActivity.kt b/app/src/main/java/com/casic/app/smartwell/view/ChangePasswordActivity.kt index 8e41039..9f1dd40 100644 --- a/app/src/main/java/com/casic/app/smartwell/view/ChangePasswordActivity.kt +++ b/app/src/main/java/com/casic/app/smartwell/view/ChangePasswordActivity.kt @@ -14,7 +14,7 @@ import com.pengxh.kt.lite.extensions.show import com.pengxh.kt.lite.utils.ActivityStackManager import com.pengxh.kt.lite.utils.LoadState -import com.pengxh.kt.lite.utils.LoadingDialogHub +import com.pengxh.kt.lite.utils.LoadingDialog import com.pengxh.kt.lite.widget.TitleBarView import java.nio.charset.StandardCharsets @@ -46,15 +46,15 @@ override fun observeRequestState() { userViewModel.loadState.observe(this) { when (it) { - is LoadState.Loading -> LoadingDialogHub.show(this, "修改中,请稍后") + is LoadState.Loading -> LoadingDialog.show(this, "修改中,请稍后") is LoadState.Success -> { - LoadingDialogHub.dismiss() + LoadingDialog.dismiss() AuthenticationHelper.removeToken() this.navigatePageTo() ActivityStackManager.finishAllActivity() } - else -> LoadingDialogHub.dismiss() + else -> LoadingDialog.dismiss() } } } diff --git a/app/src/main/java/com/casic/app/smartwell/view/DeployedWellActivity.kt b/app/src/main/java/com/casic/app/smartwell/view/DeployedWellActivity.kt index fb4339c..28a5078 100644 --- a/app/src/main/java/com/casic/app/smartwell/view/DeployedWellActivity.kt +++ b/app/src/main/java/com/casic/app/smartwell/view/DeployedWellActivity.kt @@ -83,8 +83,8 @@ } //添加分割线 - binding.deployedListView.addItemDecoration( - RecyclerViewItemOffsets(0, 5, 0, 5) + binding.recyclerView.addItemDecoration( + RecyclerViewItemOffsets(0, 7, 0, 7) ) } @@ -149,12 +149,11 @@ } else { item.deep.toString() + "m" } - viewHolder.setText(R.id.wellNameView, item.wellName) + viewHolder.setText(R.id.wellTypeView, item.wellTypeName) .setText(R.id.wellDepthView, "深:${deep}") .setText(R.id.wellCodeView, "点位编号:${item.wellCode}") - .setText(R.id.wellTypeView, "点位类型:${item.wellTypeName}") .setText(R.id.ownerShipView, "权属单位:${item.deptName}") - .setText(R.id.wellLocationView, "点位置:${item.position}") + .setText(R.id.wellLocationView, "点位位置:${item.position}") .setOnClickListener( R.id.operationButton, object : View.OnClickListener { override fun onClick(v: View?) { @@ -207,7 +206,7 @@ }) } } - binding.deployedListView.adapter = deployAdapter + binding.recyclerView.adapter = deployAdapter deployAdapter.setOnItemClickedListener(object : NormalRecyclerAdapter.OnItemClickedListener { override fun onItemClicked(position: Int, t: WellListModel.DataBean.RowsBean) { diff --git a/app/src/main/java/com/casic/app/smartwell/view/LoginActivity.kt b/app/src/main/java/com/casic/app/smartwell/view/LoginActivity.kt index e4bb0e3..834527b 100644 --- a/app/src/main/java/com/casic/app/smartwell/view/LoginActivity.kt +++ b/app/src/main/java/com/casic/app/smartwell/view/LoginActivity.kt @@ -21,7 +21,7 @@ import com.pengxh.kt.lite.extensions.navigatePageTo import com.pengxh.kt.lite.extensions.readAssetsFile import com.pengxh.kt.lite.extensions.show -import com.pengxh.kt.lite.utils.LoadingDialogHub +import com.pengxh.kt.lite.utils.LoadingDialog import com.pengxh.kt.lite.utils.SaveKeyValues import kotlinx.coroutines.Dispatchers import kotlinx.coroutines.launch @@ -106,11 +106,11 @@ override fun observeRequestState() { authenticateViewModel.loadState.observe(this) { - LoadingDialogHub.show(this, "登录中,请稍后") + LoadingDialog.show(this, "登录中,请稍后") } loginViewModel.loadState.observe(this) { - LoadingDialogHub.dismiss() + LoadingDialog.dismiss() } } diff --git a/app/build.gradle b/app/build.gradle index 296fb6f..c18c251 100644 --- a/app/build.gradle +++ b/app/build.gradle @@ -40,10 +40,6 @@ // VIVO 相关应用参数 VIVO_APP_ID : "105749048", VIVO_APP_KEY : "e460fbf2c689e0f8c58ecc6aa62e1803", - - // 小米相关应用参数 -// XIAOMI_APP_ID : "", -// XIAOMI_APP_KEY : "", ] // 版本名后面添加一句话,意思就是flavor dimension 它的维度就是该版本号,多渠道打包很重要 @@ -107,7 +103,7 @@ dependencies { implementation fileTree(dir: 'libs', include: ['*.jar']) //基础依赖库 - implementation 'com.github.AndroidCoderPeng:Kotlin-lite-lib:1.0.10' + implementation 'com.github.AndroidCoderPeng:Kotlin-lite-lib:1.1.0' implementation 'androidx.appcompat:appcompat:1.6.1' implementation 'androidx.core:core-ktx:1.9.0' implementation 'androidx.constraintlayout:constraintlayout:2.1.4' @@ -165,8 +161,6 @@ implementation 'commons-codec:commons-codec:1.15' implementation 'com.android.support:support-annotations:28.0.0' implementation 'com.assist-v3:vivo:3.1.2' // vivo -// implementation 'com.getui.opt:xmp:3.3.1' // 小米 - //数据库框架 implementation 'org.greenrobot:greendao:3.3.0' //数据库升级 diff --git a/app/src/main/AndroidManifest.xml b/app/src/main/AndroidManifest.xml index c0af158..e0519bf 100644 --- a/app/src/main/AndroidManifest.xml +++ b/app/src/main/AndroidManifest.xml @@ -90,10 +90,10 @@ - + + android:value="ee96d8b5e12de3fbb29949efd57418a8" /> () @@ -150,7 +158,7 @@ val cameraPosition = CameraPosition(centerLatLng, 14f, 0f, 0f) val cameraUpdate = CameraUpdateFactory.newCameraPosition(cameraPosition) withContext(Dispatchers.Main) { - LoadingDialogHub.dismiss() + LoadingDialog.dismiss() aMap.animateCamera(cameraUpdate, 1500, null) } } @@ -239,11 +247,6 @@ } override fun initEvent() { - binding.rightOptionView.setOnClickListener { - val x = binding.rightOptionView.width - easyPopupWindow.width - easyPopupWindow.showAsDropDown(binding.rightOptionView, x, 0) - } - //撤防点位 binding.unDeployedLayout.setOnClickListener { requireContext().navigatePageTo() @@ -263,11 +266,11 @@ override fun observeRequestState() { wellViewModel.loadState.observe(this) { when (it) { - is LoadState.Loading -> LoadingDialogHub.show( + is LoadState.Loading -> LoadingDialog.show( requireActivity(), "数据加载中,请稍后..." ) - else -> LoadingDialogHub.dismiss() + else -> LoadingDialog.dismiss() } } } @@ -376,7 +379,7 @@ }).build().show() } }) - infoPopup.showAsDropDown(binding.rightOptionView) +// infoPopup.showAsDropDown(binding.rightOptionView) } override fun onCameraChange(p0: CameraPosition?) { diff --git a/app/src/main/java/com/casic/app/smartwell/fragment/HomePageNoClusterFragment.kt b/app/src/main/java/com/casic/app/smartwell/fragment/HomePageNoClusterFragment.kt index 802426a..b25f743 100644 --- a/app/src/main/java/com/casic/app/smartwell/fragment/HomePageNoClusterFragment.kt +++ b/app/src/main/java/com/casic/app/smartwell/fragment/HomePageNoClusterFragment.kt @@ -38,8 +38,9 @@ import com.pengxh.kt.lite.extensions.navigatePageTo import com.pengxh.kt.lite.extensions.show import com.pengxh.kt.lite.utils.LoadState -import com.pengxh.kt.lite.utils.LoadingDialogHub +import com.pengxh.kt.lite.utils.LoadingDialog import com.pengxh.kt.lite.widget.EasyPopupWindow +import com.pengxh.kt.lite.widget.TitleBarView import com.pengxh.kt.lite.widget.dialog.AlertControlDialog import kotlinx.coroutines.Dispatchers import kotlinx.coroutines.launch @@ -78,7 +79,15 @@ override fun setupTopBarLayout() { binding.rootView.initImmersionBar(this, false, R.color.mainThemeColor) - binding.titleView.text = "首页" + binding.titleView.setOnClickListener(object : TitleBarView.OnClickListener { + override fun onLeftClick() { + + } + + override fun onRightClick() { + easyPopupWindow.showAsDropDown(binding.titleView, binding.titleView.width, 0) + } + }) } override fun initOnCreate(savedInstanceState: Bundle?) { @@ -112,7 +121,7 @@ //渲染井位置 lifecycleScope.launch(Dispatchers.Main) { - LoadingDialogHub.show(requireActivity(), "数据加载中,请稍后") + LoadingDialog.show(requireActivity(), "数据加载中,请稍后") withContext(Dispatchers.IO) { //取Well缓存 val allMarkerOptions = ArrayList() @@ -144,7 +153,7 @@ val cameraPosition = CameraPosition(centerLatLng, 14f, 0f, 0f) val cameraUpdate = CameraUpdateFactory.newCameraPosition(cameraPosition) withContext(Dispatchers.Main) { - LoadingDialogHub.dismiss() + LoadingDialog.dismiss() aMap.animateCamera(cameraUpdate, 1500, null) } } @@ -238,11 +247,6 @@ } override fun initEvent() { - binding.rightOptionView.setOnClickListener { - val x = binding.rightOptionView.width - easyPopupWindow.width - easyPopupWindow.showAsDropDown(binding.rightOptionView, x, 0) - } - //撤防点位 binding.unDeployedLayout.setOnClickListener { requireContext().navigatePageTo() @@ -262,11 +266,11 @@ override fun observeRequestState() { wellViewModel.loadState.observe(this) { when (it) { - is LoadState.Loading -> LoadingDialogHub.show( + is LoadState.Loading -> LoadingDialog.show( requireActivity(), "数据加载中,请稍后..." ) - else -> LoadingDialogHub.dismiss() + else -> LoadingDialog.dismiss() } } } diff --git a/app/src/main/java/com/casic/app/smartwell/fragment/MinePageFragment.kt b/app/src/main/java/com/casic/app/smartwell/fragment/MinePageFragment.kt index 09a570c..dcb48f8 100644 --- a/app/src/main/java/com/casic/app/smartwell/fragment/MinePageFragment.kt +++ b/app/src/main/java/com/casic/app/smartwell/fragment/MinePageFragment.kt @@ -35,7 +35,7 @@ import com.pengxh.kt.lite.utils.ActivityStackManager import com.pengxh.kt.lite.utils.FileDownloadManager import com.pengxh.kt.lite.utils.LoadState -import com.pengxh.kt.lite.utils.LoadingDialogHub +import com.pengxh.kt.lite.utils.LoadingDialog import com.pengxh.kt.lite.widget.dialog.AlertControlDialog import com.pengxh.kt.lite.widget.dialog.BottomActionSheet import kotlinx.coroutines.Dispatchers @@ -60,7 +60,6 @@ override fun setupTopBarLayout() { binding.rootView.initImmersionBar(this, false, R.color.mainThemeColor) - binding.titleInclude.titleView.text = "我的" } override fun initOnCreate(savedInstanceState: Bundle?) { @@ -155,27 +154,27 @@ override fun observeRequestState() { userViewModel.loadState.observe(this) { when (it) { - is LoadState.Loading -> LoadingDialogHub.show( + is LoadState.Loading -> LoadingDialog.show( requireActivity(), "检查版本中,请稍后" ) - else -> LoadingDialogHub.dismiss() + else -> LoadingDialog.dismiss() } } wellViewModel.loadState.observe(this) { when (it) { - is LoadState.Loading -> LoadingDialogHub.show( + is LoadState.Loading -> LoadingDialog.show( requireActivity(), "数据更新中,请稍后" ) is LoadState.Fail -> { - LoadingDialogHub.dismiss() + LoadingDialog.dismiss() "数据更新超时".show(requireContext()) } else -> { - LoadingDialogHub.dismiss() + LoadingDialog.dismiss() AlertControlDialog.Builder().setContext(requireContext()).setTitle("温馨提示") .setMessage("数据更新成功,请重启应用").setNegativeButton("取消") .setPositiveButton("确定").setOnDialogButtonClickListener(object : @@ -197,17 +196,17 @@ lineViewModel.loadState.observe(this) { when (it) { - is LoadState.Loading -> LoadingDialogHub.show( + is LoadState.Loading -> LoadingDialog.show( requireActivity(), "数据更新中,请稍后" ) is LoadState.Fail -> { - LoadingDialogHub.dismiss() + LoadingDialog.dismiss() "数据更新超时".show(requireContext()) } else -> { - LoadingDialogHub.dismiss() + LoadingDialog.dismiss() AlertControlDialog.Builder().setContext(requireContext()).setTitle("温馨提示") .setMessage("数据更新成功,请重启应用").setNegativeButton("取消") .setPositiveButton("确定").setOnDialogButtonClickListener(object : diff --git a/app/src/main/java/com/casic/app/smartwell/fragment/NoticePageFragment.kt b/app/src/main/java/com/casic/app/smartwell/fragment/NoticePageFragment.kt index 171b555..3c93f54 100644 --- a/app/src/main/java/com/casic/app/smartwell/fragment/NoticePageFragment.kt +++ b/app/src/main/java/com/casic/app/smartwell/fragment/NoticePageFragment.kt @@ -48,7 +48,6 @@ override fun setupTopBarLayout() { binding.rootView.initImmersionBar(this, false, R.color.mainThemeColor) - binding.titleInclude.titleView.text = "消息" } override fun initOnCreate(savedInstanceState: Bundle?) { diff --git a/app/src/main/java/com/casic/app/smartwell/fragment/OrderListFragment.kt b/app/src/main/java/com/casic/app/smartwell/fragment/OrderListFragment.kt index 93ff35b..5e38acb 100644 --- a/app/src/main/java/com/casic/app/smartwell/fragment/OrderListFragment.kt +++ b/app/src/main/java/com/casic/app/smartwell/fragment/OrderListFragment.kt @@ -12,6 +12,7 @@ import com.casic.app.smartwell.view.SearchOrderActivity import com.pengxh.kt.lite.base.KotlinBaseFragment import com.pengxh.kt.lite.extensions.navigatePageTo +import com.pengxh.kt.lite.widget.TitleBarView class OrderListFragment : KotlinBaseFragment() { @@ -25,15 +26,22 @@ } override fun initViewBinding( - inflater: LayoutInflater, - container: ViewGroup? + inflater: LayoutInflater, container: ViewGroup? ): FragmentOrderBinding { return FragmentOrderBinding.inflate(inflater, container, false) } override fun setupTopBarLayout() { binding.rootView.initImmersionBar(this, false, R.color.mainThemeColor) - binding.titleView.text = "工单" + binding.titleView.setOnClickListener(object : TitleBarView.OnClickListener { + override fun onLeftClick() { + + } + + override fun onRightClick() { + requireContext().navigatePageTo() + } + }) } override fun initOnCreate(savedInstanceState: Bundle?) { @@ -51,8 +59,6 @@ } override fun initEvent() { - binding.rightOptionView.setOnClickListener { - requireContext().navigatePageTo() - } + } } \ No newline at end of file diff --git a/app/src/main/java/com/casic/app/smartwell/fragment/OrderNotProcessedFragment.kt b/app/src/main/java/com/casic/app/smartwell/fragment/OrderNotProcessedFragment.kt index 0b3d09d..2b6f21d 100644 --- a/app/src/main/java/com/casic/app/smartwell/fragment/OrderNotProcessedFragment.kt +++ b/app/src/main/java/com/casic/app/smartwell/fragment/OrderNotProcessedFragment.kt @@ -18,7 +18,7 @@ import com.pengxh.kt.lite.extensions.navigatePageTo import com.pengxh.kt.lite.extensions.show import com.pengxh.kt.lite.utils.LoadState -import com.pengxh.kt.lite.utils.LoadingDialogHub +import com.pengxh.kt.lite.utils.LoadingDialog import com.pengxh.kt.lite.utils.WeakReferenceHandler import com.pengxh.kt.lite.widget.dialog.AlertControlDialog @@ -78,8 +78,8 @@ operationViewModel = ViewModelProvider(this)[OperationViewModel::class.java] - binding.notProcessedView.addItemDecoration( - RecyclerViewItemOffsets(0, 5, 0, 5) + binding.recyclerView.addItemDecoration( + RecyclerViewItemOffsets(0, 7, 0, 7) ) } @@ -87,9 +87,9 @@ //接单状态处理 operationViewModel.loadState.observe(this) { when (it) { - is LoadState.Loading -> LoadingDialogHub.show(requireActivity(), "接单中,请稍后") + is LoadState.Loading -> LoadingDialog.show(requireActivity(), "接单中,请稍后") is LoadState.Success -> { - LoadingDialogHub.dismiss() + LoadingDialog.dismiss() //接单成功之后刷新列表 dataBeans.removeAt(clickedPosition) notProcessedAdapter.notifyItemRemoved(clickedPosition) @@ -98,7 +98,7 @@ ) } - else -> LoadingDialogHub.dismiss() + else -> LoadingDialog.dismiss() } } } @@ -131,7 +131,7 @@ } else { binding.emptyInclude.emptyView.hide() notProcessedAdapter = OrderNotProcessedAdapter(requireContext(), dataBeans) - binding.notProcessedView.adapter = notProcessedAdapter + binding.recyclerView.adapter = notProcessedAdapter notProcessedAdapter.setOnItemClickListener(object : OrderNotProcessedAdapter.OnItemClickListener { override fun onClicked(position: Int) { diff --git a/app/src/main/java/com/casic/app/smartwell/fragment/OvertimeNotAcceptFragment.kt b/app/src/main/java/com/casic/app/smartwell/fragment/OvertimeNotAcceptFragment.kt index a198545..9b318ca 100644 --- a/app/src/main/java/com/casic/app/smartwell/fragment/OvertimeNotAcceptFragment.kt +++ b/app/src/main/java/com/casic/app/smartwell/fragment/OvertimeNotAcceptFragment.kt @@ -18,7 +18,7 @@ import com.pengxh.kt.lite.extensions.navigatePageTo import com.pengxh.kt.lite.extensions.show import com.pengxh.kt.lite.utils.LoadState -import com.pengxh.kt.lite.utils.LoadingDialogHub +import com.pengxh.kt.lite.utils.LoadingDialog import com.pengxh.kt.lite.utils.WeakReferenceHandler import com.pengxh.kt.lite.widget.dialog.AlertControlDialog @@ -81,8 +81,8 @@ operationViewModel = ViewModelProvider(this)[OperationViewModel::class.java] - binding.notProcessedView.addItemDecoration( - RecyclerViewItemOffsets(0, 5, 0, 5) + binding.recyclerView.addItemDecoration( + RecyclerViewItemOffsets(0, 7, 0, 7) ) } @@ -90,9 +90,9 @@ //接单状态处理 operationViewModel.loadState.observe(this) { when (it) { - is LoadState.Loading -> LoadingDialogHub.show(requireActivity(), "接单中,请稍后") + is LoadState.Loading -> LoadingDialog.show(requireActivity(), "接单中,请稍后") is LoadState.Success -> { - LoadingDialogHub.dismiss() + LoadingDialog.dismiss() //接单成功之后刷新列表 dataBeans.removeAt(clickedPosition) notProcessedAdapter.notifyItemRemoved(clickedPosition) @@ -101,7 +101,7 @@ ) } - else -> LoadingDialogHub.dismiss() + else -> LoadingDialog.dismiss() } } } @@ -134,7 +134,7 @@ } else { binding.emptyInclude.emptyView.hide() notProcessedAdapter = OrderNotProcessedAdapter(requireContext(), dataBeans) - binding.notProcessedView.adapter = notProcessedAdapter + binding.recyclerView.adapter = notProcessedAdapter notProcessedAdapter.setOnItemClickListener(object : OrderNotProcessedAdapter.OnItemClickListener { override fun onClicked(position: Int) { diff --git a/app/src/main/java/com/casic/app/smartwell/greendao/DaoMaster.java b/app/src/main/java/com/casic/app/smartwell/greendao/DaoMaster.java index fdcf3a7..1e52b74 100644 --- a/app/src/main/java/com/casic/app/smartwell/greendao/DaoMaster.java +++ b/app/src/main/java/com/casic/app/smartwell/greendao/DaoMaster.java @@ -13,25 +13,20 @@ // THIS CODE IS GENERATED BY greenDAO, DO NOT EDIT. - /** * Master of DAO (schema version 4): knows all DAOs. */ public class DaoMaster extends AbstractDaoMaster { public static final int SCHEMA_VERSION = 4; - /** - * Creates underlying database table using DAOs. - */ + /** Creates underlying database table using DAOs. */ public static void createAllTables(Database db, boolean ifNotExists) { MapWellLocalBeanDao.createTable(db, ifNotExists); NoticeLocaleBeanDao.createTable(db, ifNotExists); PipeLocalBeanDao.createTable(db, ifNotExists); } - /** - * Drops underlying database table using DAOs. - */ + /** Drops underlying database table using DAOs. */ public static void dropAllTables(Database db, boolean ifExists) { MapWellLocalBeanDao.dropTable(db, ifExists); NoticeLocaleBeanDao.dropTable(db, ifExists); @@ -86,9 +81,7 @@ } } - /** - * WARNING: Drops all table on Upgrade! Use only during development. - */ + /** WARNING: Drops all table on Upgrade! Use only during development. */ public static class DevOpenHelper extends OpenHelper { public DevOpenHelper(Context context, String name) { super(context, name); diff --git a/app/src/main/java/com/casic/app/smartwell/greendao/DaoSession.java b/app/src/main/java/com/casic/app/smartwell/greendao/DaoSession.java index 0b36d17..3e40e3b 100644 --- a/app/src/main/java/com/casic/app/smartwell/greendao/DaoSession.java +++ b/app/src/main/java/com/casic/app/smartwell/greendao/DaoSession.java @@ -16,7 +16,7 @@ /** * {@inheritDoc} - * + * * @see org.greenrobot.greendao.AbstractDaoSession */ public class DaoSession extends AbstractDaoSession { @@ -50,7 +50,7 @@ registerDao(NoticeLocaleBean.class, noticeLocaleBeanDao); registerDao(PipeLocalBean.class, pipeLocalBeanDao); } - + public void clear() { mapWellLocalBeanDaoConfig.clearIdentityScope(); noticeLocaleBeanDaoConfig.clearIdentityScope(); diff --git a/app/src/main/java/com/casic/app/smartwell/greendao/MapWellLocalBeanDao.java b/app/src/main/java/com/casic/app/smartwell/greendao/MapWellLocalBeanDao.java index 8908fda..407bc92 100644 --- a/app/src/main/java/com/casic/app/smartwell/greendao/MapWellLocalBeanDao.java +++ b/app/src/main/java/com/casic/app/smartwell/greendao/MapWellLocalBeanDao.java @@ -12,10 +12,9 @@ import org.greenrobot.greendao.internal.DaoConfig; // THIS CODE IS GENERATED BY greenDAO, DO NOT EDIT. - -/** +/** * DAO for table "MAP_WELL_LOCAL_BEAN". - */ +*/ public class MapWellLocalBeanDao extends AbstractDao { public static final String TABLENAME = "MAP_WELL_LOCAL_BEAN"; @@ -57,16 +56,14 @@ public MapWellLocalBeanDao(DaoConfig config) { super(config); } - + public MapWellLocalBeanDao(DaoConfig config, DaoSession daoSession) { super(config, daoSession); } - /** - * Creates the underlying database table. - */ + /** Creates the underlying database table. */ public static void createTable(Database db, boolean ifNotExists) { - String constraint = ifNotExists ? "IF NOT EXISTS " : ""; + String constraint = ifNotExists? "IF NOT EXISTS ": ""; db.execSQL("CREATE TABLE " + constraint + "\"MAP_WELL_LOCAL_BEAN\" (" + // "\"_id\" INTEGER PRIMARY KEY AUTOINCREMENT ," + // 0: kId "\"AREA\" TEXT," + // 1: area @@ -96,9 +93,7 @@ "\"WELL_TYPE_NAME\" TEXT);"); // 25: wellTypeName } - /** - * Drops the underlying database table. - */ + /** Drops the underlying database table. */ public static void dropTable(Database db, boolean ifExists) { String sql = "DROP TABLE " + (ifExists ? "IF EXISTS " : "") + "\"MAP_WELL_LOCAL_BEAN\""; db.execSQL(sql); @@ -107,132 +102,132 @@ @Override protected final void bindValues(DatabaseStatement stmt, MapWellLocalBean entity) { stmt.clearBindings(); - + Long kId = entity.getKId(); if (kId != null) { stmt.bindLong(1, kId); } - + String area = entity.getArea(); if (area != null) { stmt.bindString(2, area); } - + String bfzt = entity.getBfzt(); if (bfzt != null) { stmt.bindString(3, bfzt); } - + String bfztName = entity.getBfztName(); if (bfztName != null) { stmt.bindString(4, bfztName); } - + String coordinateX = entity.getCoordinateX(); if (coordinateX != null) { stmt.bindString(5, coordinateX); } - + String coordinateY = entity.getCoordinateY(); if (coordinateY != null) { stmt.bindString(6, coordinateY); } - + String deep = entity.getDeep(); if (deep != null) { stmt.bindString(7, deep); } - + String deptName = entity.getDeptName(); if (deptName != null) { stmt.bindString(8, deptName); } - + String deptid = entity.getDeptid(); if (deptid != null) { stmt.bindString(9, deptid); } - + String id = entity.getId(); if (id != null) { stmt.bindString(10, id); } - + String latBaidu = entity.getLatBaidu(); if (latBaidu != null) { stmt.bindString(11, latBaidu); } - + String latGaode = entity.getLatGaode(); if (latGaode != null) { stmt.bindString(12, latGaode); } - + String lngBaidu = entity.getLngBaidu(); if (lngBaidu != null) { stmt.bindString(13, lngBaidu); } - + String lngGaode = entity.getLngGaode(); if (lngGaode != null) { stmt.bindString(14, lngGaode); } - + String notes = entity.getNotes(); if (notes != null) { stmt.bindString(15, notes); } - + String photos = entity.getPhotos(); if (photos != null) { stmt.bindString(16, photos); } - + String position = entity.getPosition(); if (position != null) { stmt.bindString(17, position); } - + String staff = entity.getStaff(); if (staff != null) { stmt.bindString(18, staff); } - + String tel = entity.getTel(); if (tel != null) { stmt.bindString(19, tel); } - + String ts = entity.getTs(); if (ts != null) { stmt.bindString(20, ts); } - + String valid = entity.getValid(); if (valid != null) { stmt.bindString(21, valid); } - + String watchData = entity.getWatchData(); if (watchData != null) { stmt.bindString(22, watchData); } - + String wellCode = entity.getWellCode(); if (wellCode != null) { stmt.bindString(23, wellCode); } - + String wellName = entity.getWellName(); if (wellName != null) { stmt.bindString(24, wellName); } - + String wellType = entity.getWellType(); if (wellType != null) { stmt.bindString(25, wellType); } - + String wellTypeName = entity.getWellTypeName(); if (wellTypeName != null) { stmt.bindString(26, wellTypeName); @@ -242,132 +237,132 @@ @Override protected final void bindValues(SQLiteStatement stmt, MapWellLocalBean entity) { stmt.clearBindings(); - + Long kId = entity.getKId(); if (kId != null) { stmt.bindLong(1, kId); } - + String area = entity.getArea(); if (area != null) { stmt.bindString(2, area); } - + String bfzt = entity.getBfzt(); if (bfzt != null) { stmt.bindString(3, bfzt); } - + String bfztName = entity.getBfztName(); if (bfztName != null) { stmt.bindString(4, bfztName); } - + String coordinateX = entity.getCoordinateX(); if (coordinateX != null) { stmt.bindString(5, coordinateX); } - + String coordinateY = entity.getCoordinateY(); if (coordinateY != null) { stmt.bindString(6, coordinateY); } - + String deep = entity.getDeep(); if (deep != null) { stmt.bindString(7, deep); } - + String deptName = entity.getDeptName(); if (deptName != null) { stmt.bindString(8, deptName); } - + String deptid = entity.getDeptid(); if (deptid != null) { stmt.bindString(9, deptid); } - + String id = entity.getId(); if (id != null) { stmt.bindString(10, id); } - + String latBaidu = entity.getLatBaidu(); if (latBaidu != null) { stmt.bindString(11, latBaidu); } - + String latGaode = entity.getLatGaode(); if (latGaode != null) { stmt.bindString(12, latGaode); } - + String lngBaidu = entity.getLngBaidu(); if (lngBaidu != null) { stmt.bindString(13, lngBaidu); } - + String lngGaode = entity.getLngGaode(); if (lngGaode != null) { stmt.bindString(14, lngGaode); } - + String notes = entity.getNotes(); if (notes != null) { stmt.bindString(15, notes); } - + String photos = entity.getPhotos(); if (photos != null) { stmt.bindString(16, photos); } - + String position = entity.getPosition(); if (position != null) { stmt.bindString(17, position); } - + String staff = entity.getStaff(); if (staff != null) { stmt.bindString(18, staff); } - + String tel = entity.getTel(); if (tel != null) { stmt.bindString(19, tel); } - + String ts = entity.getTs(); if (ts != null) { stmt.bindString(20, ts); } - + String valid = entity.getValid(); if (valid != null) { stmt.bindString(21, valid); } - + String watchData = entity.getWatchData(); if (watchData != null) { stmt.bindString(22, watchData); } - + String wellCode = entity.getWellCode(); if (wellCode != null) { stmt.bindString(23, wellCode); } - + String wellName = entity.getWellName(); if (wellName != null) { stmt.bindString(24, wellName); } - + String wellType = entity.getWellType(); if (wellType != null) { stmt.bindString(25, wellType); } - + String wellTypeName = entity.getWellTypeName(); if (wellTypeName != null) { stmt.bindString(26, wellTypeName); @@ -377,41 +372,41 @@ @Override public Long readKey(Cursor cursor, int offset) { return cursor.isNull(offset + 0) ? null : cursor.getLong(offset + 0); - } + } @Override public MapWellLocalBean readEntity(Cursor cursor, int offset) { MapWellLocalBean entity = new MapWellLocalBean( // - cursor.isNull(offset + 0) ? null : cursor.getLong(offset + 0), // kId - cursor.isNull(offset + 1) ? null : cursor.getString(offset + 1), // area - cursor.isNull(offset + 2) ? null : cursor.getString(offset + 2), // bfzt - cursor.isNull(offset + 3) ? null : cursor.getString(offset + 3), // bfztName - cursor.isNull(offset + 4) ? null : cursor.getString(offset + 4), // coordinateX - cursor.isNull(offset + 5) ? null : cursor.getString(offset + 5), // coordinateY - cursor.isNull(offset + 6) ? null : cursor.getString(offset + 6), // deep - cursor.isNull(offset + 7) ? null : cursor.getString(offset + 7), // deptName - cursor.isNull(offset + 8) ? null : cursor.getString(offset + 8), // deptid - cursor.isNull(offset + 9) ? null : cursor.getString(offset + 9), // id - cursor.isNull(offset + 10) ? null : cursor.getString(offset + 10), // latBaidu - cursor.isNull(offset + 11) ? null : cursor.getString(offset + 11), // latGaode - cursor.isNull(offset + 12) ? null : cursor.getString(offset + 12), // lngBaidu - cursor.isNull(offset + 13) ? null : cursor.getString(offset + 13), // lngGaode - cursor.isNull(offset + 14) ? null : cursor.getString(offset + 14), // notes - cursor.isNull(offset + 15) ? null : cursor.getString(offset + 15), // photos - cursor.isNull(offset + 16) ? null : cursor.getString(offset + 16), // position - cursor.isNull(offset + 17) ? null : cursor.getString(offset + 17), // staff - cursor.isNull(offset + 18) ? null : cursor.getString(offset + 18), // tel - cursor.isNull(offset + 19) ? null : cursor.getString(offset + 19), // ts - cursor.isNull(offset + 20) ? null : cursor.getString(offset + 20), // valid - cursor.isNull(offset + 21) ? null : cursor.getString(offset + 21), // watchData - cursor.isNull(offset + 22) ? null : cursor.getString(offset + 22), // wellCode - cursor.isNull(offset + 23) ? null : cursor.getString(offset + 23), // wellName - cursor.isNull(offset + 24) ? null : cursor.getString(offset + 24), // wellType - cursor.isNull(offset + 25) ? null : cursor.getString(offset + 25) // wellTypeName + cursor.isNull(offset + 0) ? null : cursor.getLong(offset + 0), // kId + cursor.isNull(offset + 1) ? null : cursor.getString(offset + 1), // area + cursor.isNull(offset + 2) ? null : cursor.getString(offset + 2), // bfzt + cursor.isNull(offset + 3) ? null : cursor.getString(offset + 3), // bfztName + cursor.isNull(offset + 4) ? null : cursor.getString(offset + 4), // coordinateX + cursor.isNull(offset + 5) ? null : cursor.getString(offset + 5), // coordinateY + cursor.isNull(offset + 6) ? null : cursor.getString(offset + 6), // deep + cursor.isNull(offset + 7) ? null : cursor.getString(offset + 7), // deptName + cursor.isNull(offset + 8) ? null : cursor.getString(offset + 8), // deptid + cursor.isNull(offset + 9) ? null : cursor.getString(offset + 9), // id + cursor.isNull(offset + 10) ? null : cursor.getString(offset + 10), // latBaidu + cursor.isNull(offset + 11) ? null : cursor.getString(offset + 11), // latGaode + cursor.isNull(offset + 12) ? null : cursor.getString(offset + 12), // lngBaidu + cursor.isNull(offset + 13) ? null : cursor.getString(offset + 13), // lngGaode + cursor.isNull(offset + 14) ? null : cursor.getString(offset + 14), // notes + cursor.isNull(offset + 15) ? null : cursor.getString(offset + 15), // photos + cursor.isNull(offset + 16) ? null : cursor.getString(offset + 16), // position + cursor.isNull(offset + 17) ? null : cursor.getString(offset + 17), // staff + cursor.isNull(offset + 18) ? null : cursor.getString(offset + 18), // tel + cursor.isNull(offset + 19) ? null : cursor.getString(offset + 19), // ts + cursor.isNull(offset + 20) ? null : cursor.getString(offset + 20), // valid + cursor.isNull(offset + 21) ? null : cursor.getString(offset + 21), // watchData + cursor.isNull(offset + 22) ? null : cursor.getString(offset + 22), // wellCode + cursor.isNull(offset + 23) ? null : cursor.getString(offset + 23), // wellName + cursor.isNull(offset + 24) ? null : cursor.getString(offset + 24), // wellType + cursor.isNull(offset + 25) ? null : cursor.getString(offset + 25) // wellTypeName ); return entity; } - + @Override public void readEntity(Cursor cursor, MapWellLocalBean entity, int offset) { entity.setKId(cursor.isNull(offset + 0) ? null : cursor.getLong(offset + 0)); @@ -440,17 +435,17 @@ entity.setWellName(cursor.isNull(offset + 23) ? null : cursor.getString(offset + 23)); entity.setWellType(cursor.isNull(offset + 24) ? null : cursor.getString(offset + 24)); entity.setWellTypeName(cursor.isNull(offset + 25) ? null : cursor.getString(offset + 25)); - } - + } + @Override protected final Long updateKeyAfterInsert(MapWellLocalBean entity, long rowId) { entity.setKId(rowId); return rowId; } - + @Override public Long getKey(MapWellLocalBean entity) { - if (entity != null) { + if(entity != null) { return entity.getKId(); } else { return null; @@ -466,5 +461,5 @@ protected final boolean isEntityUpdateable() { return true; } - + } diff --git a/app/src/main/java/com/casic/app/smartwell/greendao/NoticeLocaleBeanDao.java b/app/src/main/java/com/casic/app/smartwell/greendao/NoticeLocaleBeanDao.java index 64312ed..deb2d49 100644 --- a/app/src/main/java/com/casic/app/smartwell/greendao/NoticeLocaleBeanDao.java +++ b/app/src/main/java/com/casic/app/smartwell/greendao/NoticeLocaleBeanDao.java @@ -12,10 +12,9 @@ import org.greenrobot.greendao.internal.DaoConfig; // THIS CODE IS GENERATED BY greenDAO, DO NOT EDIT. - -/** +/** * DAO for table "NOTICE_LOCALE_BEAN". - */ +*/ public class NoticeLocaleBeanDao extends AbstractDao { public static final String TABLENAME = "NOTICE_LOCALE_BEAN"; @@ -43,16 +42,14 @@ public NoticeLocaleBeanDao(DaoConfig config) { super(config); } - + public NoticeLocaleBeanDao(DaoConfig config, DaoSession daoSession) { super(config, daoSession); } - /** - * Creates the underlying database table. - */ + /** Creates the underlying database table. */ public static void createTable(Database db, boolean ifNotExists) { - String constraint = ifNotExists ? "IF NOT EXISTS " : ""; + String constraint = ifNotExists? "IF NOT EXISTS ": ""; db.execSQL("CREATE TABLE " + constraint + "\"NOTICE_LOCALE_BEAN\" (" + // "\"_id\" INTEGER PRIMARY KEY AUTOINCREMENT ," + // 0: id "\"MESSAGE_ID\" TEXT UNIQUE ," + // 1: messageId @@ -68,9 +65,7 @@ "\"NOTICE_TIME\" TEXT);"); // 11: noticeTime } - /** - * Drops the underlying database table. - */ + /** Drops the underlying database table. */ public static void dropTable(Database db, boolean ifExists) { String sql = "DROP TABLE " + (ifExists ? "IF EXISTS " : "") + "\"NOTICE_LOCALE_BEAN\""; db.execSQL(sql); @@ -79,62 +74,62 @@ @Override protected final void bindValues(DatabaseStatement stmt, NoticeLocaleBean entity) { stmt.clearBindings(); - + Long id = entity.getId(); if (id != null) { stmt.bindLong(1, id); } - + String messageId = entity.getMessageId(); if (messageId != null) { stmt.bindString(2, messageId); } - + String appid = entity.getAppid(); if (appid != null) { stmt.bindString(3, appid); } - + String clientId = entity.getClientId(); if (clientId != null) { stmt.bindString(4, clientId); } - + String taskId = entity.getTaskId(); if (taskId != null) { stmt.bindString(5, taskId); } - + String userId = entity.getUserId(); if (userId != null) { stmt.bindString(6, userId); } - + String title = entity.getTitle(); if (title != null) { stmt.bindString(7, title); } - + String content = entity.getContent(); if (content != null) { stmt.bindString(8, content); } - + String deviceCode = entity.getDeviceCode(); if (deviceCode != null) { stmt.bindString(9, deviceCode); } - + String jobId = entity.getJobId(); if (jobId != null) { stmt.bindString(10, jobId); } - + String isRead = entity.getIsRead(); if (isRead != null) { stmt.bindString(11, isRead); } - + String noticeTime = entity.getNoticeTime(); if (noticeTime != null) { stmt.bindString(12, noticeTime); @@ -144,62 +139,62 @@ @Override protected final void bindValues(SQLiteStatement stmt, NoticeLocaleBean entity) { stmt.clearBindings(); - + Long id = entity.getId(); if (id != null) { stmt.bindLong(1, id); } - + String messageId = entity.getMessageId(); if (messageId != null) { stmt.bindString(2, messageId); } - + String appid = entity.getAppid(); if (appid != null) { stmt.bindString(3, appid); } - + String clientId = entity.getClientId(); if (clientId != null) { stmt.bindString(4, clientId); } - + String taskId = entity.getTaskId(); if (taskId != null) { stmt.bindString(5, taskId); } - + String userId = entity.getUserId(); if (userId != null) { stmt.bindString(6, userId); } - + String title = entity.getTitle(); if (title != null) { stmt.bindString(7, title); } - + String content = entity.getContent(); if (content != null) { stmt.bindString(8, content); } - + String deviceCode = entity.getDeviceCode(); if (deviceCode != null) { stmt.bindString(9, deviceCode); } - + String jobId = entity.getJobId(); if (jobId != null) { stmt.bindString(10, jobId); } - + String isRead = entity.getIsRead(); if (isRead != null) { stmt.bindString(11, isRead); } - + String noticeTime = entity.getNoticeTime(); if (noticeTime != null) { stmt.bindString(12, noticeTime); @@ -209,27 +204,27 @@ @Override public Long readKey(Cursor cursor, int offset) { return cursor.isNull(offset + 0) ? null : cursor.getLong(offset + 0); - } + } @Override public NoticeLocaleBean readEntity(Cursor cursor, int offset) { NoticeLocaleBean entity = new NoticeLocaleBean( // - cursor.isNull(offset + 0) ? null : cursor.getLong(offset + 0), // id - cursor.isNull(offset + 1) ? null : cursor.getString(offset + 1), // messageId - cursor.isNull(offset + 2) ? null : cursor.getString(offset + 2), // appid - cursor.isNull(offset + 3) ? null : cursor.getString(offset + 3), // clientId - cursor.isNull(offset + 4) ? null : cursor.getString(offset + 4), // taskId - cursor.isNull(offset + 5) ? null : cursor.getString(offset + 5), // userId - cursor.isNull(offset + 6) ? null : cursor.getString(offset + 6), // title - cursor.isNull(offset + 7) ? null : cursor.getString(offset + 7), // content - cursor.isNull(offset + 8) ? null : cursor.getString(offset + 8), // deviceCode - cursor.isNull(offset + 9) ? null : cursor.getString(offset + 9), // jobId - cursor.isNull(offset + 10) ? null : cursor.getString(offset + 10), // isRead - cursor.isNull(offset + 11) ? null : cursor.getString(offset + 11) // noticeTime + cursor.isNull(offset + 0) ? null : cursor.getLong(offset + 0), // id + cursor.isNull(offset + 1) ? null : cursor.getString(offset + 1), // messageId + cursor.isNull(offset + 2) ? null : cursor.getString(offset + 2), // appid + cursor.isNull(offset + 3) ? null : cursor.getString(offset + 3), // clientId + cursor.isNull(offset + 4) ? null : cursor.getString(offset + 4), // taskId + cursor.isNull(offset + 5) ? null : cursor.getString(offset + 5), // userId + cursor.isNull(offset + 6) ? null : cursor.getString(offset + 6), // title + cursor.isNull(offset + 7) ? null : cursor.getString(offset + 7), // content + cursor.isNull(offset + 8) ? null : cursor.getString(offset + 8), // deviceCode + cursor.isNull(offset + 9) ? null : cursor.getString(offset + 9), // jobId + cursor.isNull(offset + 10) ? null : cursor.getString(offset + 10), // isRead + cursor.isNull(offset + 11) ? null : cursor.getString(offset + 11) // noticeTime ); return entity; } - + @Override public void readEntity(Cursor cursor, NoticeLocaleBean entity, int offset) { entity.setId(cursor.isNull(offset + 0) ? null : cursor.getLong(offset + 0)); @@ -244,17 +239,17 @@ entity.setJobId(cursor.isNull(offset + 9) ? null : cursor.getString(offset + 9)); entity.setIsRead(cursor.isNull(offset + 10) ? null : cursor.getString(offset + 10)); entity.setNoticeTime(cursor.isNull(offset + 11) ? null : cursor.getString(offset + 11)); - } - + } + @Override protected final Long updateKeyAfterInsert(NoticeLocaleBean entity, long rowId) { entity.setId(rowId); return rowId; } - + @Override public Long getKey(NoticeLocaleBean entity) { - if (entity != null) { + if(entity != null) { return entity.getId(); } else { return null; @@ -270,5 +265,5 @@ protected final boolean isEntityUpdateable() { return true; } - + } diff --git a/app/src/main/java/com/casic/app/smartwell/greendao/PipeLocalBeanDao.java b/app/src/main/java/com/casic/app/smartwell/greendao/PipeLocalBeanDao.java index aab4d3f..df5515a 100644 --- a/app/src/main/java/com/casic/app/smartwell/greendao/PipeLocalBeanDao.java +++ b/app/src/main/java/com/casic/app/smartwell/greendao/PipeLocalBeanDao.java @@ -12,10 +12,9 @@ import org.greenrobot.greendao.internal.DaoConfig; // THIS CODE IS GENERATED BY greenDAO, DO NOT EDIT. - -/** +/** * DAO for table "PIPE_LOCAL_BEAN". - */ +*/ public class PipeLocalBeanDao extends AbstractDao { public static final String TABLENAME = "PIPE_LOCAL_BEAN"; @@ -37,16 +36,14 @@ public PipeLocalBeanDao(DaoConfig config) { super(config); } - + public PipeLocalBeanDao(DaoConfig config, DaoSession daoSession) { super(config, daoSession); } - /** - * Creates the underlying database table. - */ + /** Creates the underlying database table. */ public static void createTable(Database db, boolean ifNotExists) { - String constraint = ifNotExists ? "IF NOT EXISTS " : ""; + String constraint = ifNotExists? "IF NOT EXISTS ": ""; db.execSQL("CREATE TABLE " + constraint + "\"PIPE_LOCAL_BEAN\" (" + // "\"_id\" INTEGER PRIMARY KEY AUTOINCREMENT ," + // 0: id "\"PIPE_CODE\" TEXT," + // 1: pipeCode @@ -56,9 +53,7 @@ "\"START_LONGITUDE_GD\" TEXT);"); // 5: startLongitudeGd } - /** - * Drops the underlying database table. - */ + /** Drops the underlying database table. */ public static void dropTable(Database db, boolean ifExists) { String sql = "DROP TABLE " + (ifExists ? "IF EXISTS " : "") + "\"PIPE_LOCAL_BEAN\""; db.execSQL(sql); @@ -67,32 +62,32 @@ @Override protected final void bindValues(DatabaseStatement stmt, PipeLocalBean entity) { stmt.clearBindings(); - + Long id = entity.getId(); if (id != null) { stmt.bindLong(1, id); } - + String pipeCode = entity.getPipeCode(); if (pipeCode != null) { stmt.bindString(2, pipeCode); } - + String endLatitudeGd = entity.getEndLatitudeGd(); if (endLatitudeGd != null) { stmt.bindString(3, endLatitudeGd); } - + String endLongitudeGd = entity.getEndLongitudeGd(); if (endLongitudeGd != null) { stmt.bindString(4, endLongitudeGd); } - + String startLatitudeGd = entity.getStartLatitudeGd(); if (startLatitudeGd != null) { stmt.bindString(5, startLatitudeGd); } - + String startLongitudeGd = entity.getStartLongitudeGd(); if (startLongitudeGd != null) { stmt.bindString(6, startLongitudeGd); @@ -102,32 +97,32 @@ @Override protected final void bindValues(SQLiteStatement stmt, PipeLocalBean entity) { stmt.clearBindings(); - + Long id = entity.getId(); if (id != null) { stmt.bindLong(1, id); } - + String pipeCode = entity.getPipeCode(); if (pipeCode != null) { stmt.bindString(2, pipeCode); } - + String endLatitudeGd = entity.getEndLatitudeGd(); if (endLatitudeGd != null) { stmt.bindString(3, endLatitudeGd); } - + String endLongitudeGd = entity.getEndLongitudeGd(); if (endLongitudeGd != null) { stmt.bindString(4, endLongitudeGd); } - + String startLatitudeGd = entity.getStartLatitudeGd(); if (startLatitudeGd != null) { stmt.bindString(5, startLatitudeGd); } - + String startLongitudeGd = entity.getStartLongitudeGd(); if (startLongitudeGd != null) { stmt.bindString(6, startLongitudeGd); @@ -137,21 +132,21 @@ @Override public Long readKey(Cursor cursor, int offset) { return cursor.isNull(offset + 0) ? null : cursor.getLong(offset + 0); - } + } @Override public PipeLocalBean readEntity(Cursor cursor, int offset) { PipeLocalBean entity = new PipeLocalBean( // - cursor.isNull(offset + 0) ? null : cursor.getLong(offset + 0), // id - cursor.isNull(offset + 1) ? null : cursor.getString(offset + 1), // pipeCode - cursor.isNull(offset + 2) ? null : cursor.getString(offset + 2), // endLatitudeGd - cursor.isNull(offset + 3) ? null : cursor.getString(offset + 3), // endLongitudeGd - cursor.isNull(offset + 4) ? null : cursor.getString(offset + 4), // startLatitudeGd - cursor.isNull(offset + 5) ? null : cursor.getString(offset + 5) // startLongitudeGd + cursor.isNull(offset + 0) ? null : cursor.getLong(offset + 0), // id + cursor.isNull(offset + 1) ? null : cursor.getString(offset + 1), // pipeCode + cursor.isNull(offset + 2) ? null : cursor.getString(offset + 2), // endLatitudeGd + cursor.isNull(offset + 3) ? null : cursor.getString(offset + 3), // endLongitudeGd + cursor.isNull(offset + 4) ? null : cursor.getString(offset + 4), // startLatitudeGd + cursor.isNull(offset + 5) ? null : cursor.getString(offset + 5) // startLongitudeGd ); return entity; } - + @Override public void readEntity(Cursor cursor, PipeLocalBean entity, int offset) { entity.setId(cursor.isNull(offset + 0) ? null : cursor.getLong(offset + 0)); @@ -160,17 +155,17 @@ entity.setEndLongitudeGd(cursor.isNull(offset + 3) ? null : cursor.getString(offset + 3)); entity.setStartLatitudeGd(cursor.isNull(offset + 4) ? null : cursor.getString(offset + 4)); entity.setStartLongitudeGd(cursor.isNull(offset + 5) ? null : cursor.getString(offset + 5)); - } - + } + @Override protected final Long updateKeyAfterInsert(PipeLocalBean entity, long rowId) { entity.setId(rowId); return rowId; } - + @Override public Long getKey(PipeLocalBean entity) { - if (entity != null) { + if(entity != null) { return entity.getId(); } else { return null; @@ -186,5 +181,5 @@ protected final boolean isEntityUpdateable() { return true; } - + } diff --git a/app/src/main/java/com/casic/app/smartwell/view/ChangePasswordActivity.kt b/app/src/main/java/com/casic/app/smartwell/view/ChangePasswordActivity.kt index 8e41039..9f1dd40 100644 --- a/app/src/main/java/com/casic/app/smartwell/view/ChangePasswordActivity.kt +++ b/app/src/main/java/com/casic/app/smartwell/view/ChangePasswordActivity.kt @@ -14,7 +14,7 @@ import com.pengxh.kt.lite.extensions.show import com.pengxh.kt.lite.utils.ActivityStackManager import com.pengxh.kt.lite.utils.LoadState -import com.pengxh.kt.lite.utils.LoadingDialogHub +import com.pengxh.kt.lite.utils.LoadingDialog import com.pengxh.kt.lite.widget.TitleBarView import java.nio.charset.StandardCharsets @@ -46,15 +46,15 @@ override fun observeRequestState() { userViewModel.loadState.observe(this) { when (it) { - is LoadState.Loading -> LoadingDialogHub.show(this, "修改中,请稍后") + is LoadState.Loading -> LoadingDialog.show(this, "修改中,请稍后") is LoadState.Success -> { - LoadingDialogHub.dismiss() + LoadingDialog.dismiss() AuthenticationHelper.removeToken() this.navigatePageTo() ActivityStackManager.finishAllActivity() } - else -> LoadingDialogHub.dismiss() + else -> LoadingDialog.dismiss() } } } diff --git a/app/src/main/java/com/casic/app/smartwell/view/DeployedWellActivity.kt b/app/src/main/java/com/casic/app/smartwell/view/DeployedWellActivity.kt index fb4339c..28a5078 100644 --- a/app/src/main/java/com/casic/app/smartwell/view/DeployedWellActivity.kt +++ b/app/src/main/java/com/casic/app/smartwell/view/DeployedWellActivity.kt @@ -83,8 +83,8 @@ } //添加分割线 - binding.deployedListView.addItemDecoration( - RecyclerViewItemOffsets(0, 5, 0, 5) + binding.recyclerView.addItemDecoration( + RecyclerViewItemOffsets(0, 7, 0, 7) ) } @@ -149,12 +149,11 @@ } else { item.deep.toString() + "m" } - viewHolder.setText(R.id.wellNameView, item.wellName) + viewHolder.setText(R.id.wellTypeView, item.wellTypeName) .setText(R.id.wellDepthView, "深:${deep}") .setText(R.id.wellCodeView, "点位编号:${item.wellCode}") - .setText(R.id.wellTypeView, "点位类型:${item.wellTypeName}") .setText(R.id.ownerShipView, "权属单位:${item.deptName}") - .setText(R.id.wellLocationView, "点位置:${item.position}") + .setText(R.id.wellLocationView, "点位位置:${item.position}") .setOnClickListener( R.id.operationButton, object : View.OnClickListener { override fun onClick(v: View?) { @@ -207,7 +206,7 @@ }) } } - binding.deployedListView.adapter = deployAdapter + binding.recyclerView.adapter = deployAdapter deployAdapter.setOnItemClickedListener(object : NormalRecyclerAdapter.OnItemClickedListener { override fun onItemClicked(position: Int, t: WellListModel.DataBean.RowsBean) { diff --git a/app/src/main/java/com/casic/app/smartwell/view/LoginActivity.kt b/app/src/main/java/com/casic/app/smartwell/view/LoginActivity.kt index e4bb0e3..834527b 100644 --- a/app/src/main/java/com/casic/app/smartwell/view/LoginActivity.kt +++ b/app/src/main/java/com/casic/app/smartwell/view/LoginActivity.kt @@ -21,7 +21,7 @@ import com.pengxh.kt.lite.extensions.navigatePageTo import com.pengxh.kt.lite.extensions.readAssetsFile import com.pengxh.kt.lite.extensions.show -import com.pengxh.kt.lite.utils.LoadingDialogHub +import com.pengxh.kt.lite.utils.LoadingDialog import com.pengxh.kt.lite.utils.SaveKeyValues import kotlinx.coroutines.Dispatchers import kotlinx.coroutines.launch @@ -106,11 +106,11 @@ override fun observeRequestState() { authenticateViewModel.loadState.observe(this) { - LoadingDialogHub.show(this, "登录中,请稍后") + LoadingDialog.show(this, "登录中,请稍后") } loginViewModel.loadState.observe(this) { - LoadingDialogHub.dismiss() + LoadingDialog.dismiss() } } diff --git a/app/src/main/java/com/casic/app/smartwell/view/OrderCompletedDetailActivity.kt b/app/src/main/java/com/casic/app/smartwell/view/OrderCompletedDetailActivity.kt index db8ad1f..75cd905 100644 --- a/app/src/main/java/com/casic/app/smartwell/view/OrderCompletedDetailActivity.kt +++ b/app/src/main/java/com/casic/app/smartwell/view/OrderCompletedDetailActivity.kt @@ -17,7 +17,7 @@ import com.pengxh.kt.lite.extensions.show import com.pengxh.kt.lite.utils.Constant import com.pengxh.kt.lite.utils.LoadState -import com.pengxh.kt.lite.utils.LoadingDialogHub +import com.pengxh.kt.lite.utils.LoadingDialog import com.pengxh.kt.lite.widget.TitleBarView import com.pengxh.kt.lite.widget.dialog.AlertMessageDialog @@ -44,7 +44,7 @@ } override fun initOnCreate(savedInstanceState: Bundle?) { - val jobId = intent.getStringExtra(Constant.INTENT_PARAM)!! + val jobId = intent.getStringExtra(Constant.INTENT_PARAM_KEY)!! orderViewModel = ViewModelProvider(this)[OrderViewModel::class.java] orderViewModel.getWorkOrderDetail(jobId) orderViewModel.detailModel.observe(this) { @@ -154,8 +154,8 @@ override fun observeRequestState() { orderViewModel.loadState.observe(this) { when (it) { - is LoadState.Loading -> LoadingDialogHub.show(this, "数据加载中,请稍后") - else -> LoadingDialogHub.dismiss() + is LoadState.Loading -> LoadingDialog.show(this, "数据加载中,请稍后") + else -> LoadingDialog.dismiss() } } } diff --git a/app/build.gradle b/app/build.gradle index 296fb6f..c18c251 100644 --- a/app/build.gradle +++ b/app/build.gradle @@ -40,10 +40,6 @@ // VIVO 相关应用参数 VIVO_APP_ID : "105749048", VIVO_APP_KEY : "e460fbf2c689e0f8c58ecc6aa62e1803", - - // 小米相关应用参数 -// XIAOMI_APP_ID : "", -// XIAOMI_APP_KEY : "", ] // 版本名后面添加一句话,意思就是flavor dimension 它的维度就是该版本号,多渠道打包很重要 @@ -107,7 +103,7 @@ dependencies { implementation fileTree(dir: 'libs', include: ['*.jar']) //基础依赖库 - implementation 'com.github.AndroidCoderPeng:Kotlin-lite-lib:1.0.10' + implementation 'com.github.AndroidCoderPeng:Kotlin-lite-lib:1.1.0' implementation 'androidx.appcompat:appcompat:1.6.1' implementation 'androidx.core:core-ktx:1.9.0' implementation 'androidx.constraintlayout:constraintlayout:2.1.4' @@ -165,8 +161,6 @@ implementation 'commons-codec:commons-codec:1.15' implementation 'com.android.support:support-annotations:28.0.0' implementation 'com.assist-v3:vivo:3.1.2' // vivo -// implementation 'com.getui.opt:xmp:3.3.1' // 小米 - //数据库框架 implementation 'org.greenrobot:greendao:3.3.0' //数据库升级 diff --git a/app/src/main/AndroidManifest.xml b/app/src/main/AndroidManifest.xml index c0af158..e0519bf 100644 --- a/app/src/main/AndroidManifest.xml +++ b/app/src/main/AndroidManifest.xml @@ -90,10 +90,10 @@ - + + android:value="ee96d8b5e12de3fbb29949efd57418a8" /> () @@ -150,7 +158,7 @@ val cameraPosition = CameraPosition(centerLatLng, 14f, 0f, 0f) val cameraUpdate = CameraUpdateFactory.newCameraPosition(cameraPosition) withContext(Dispatchers.Main) { - LoadingDialogHub.dismiss() + LoadingDialog.dismiss() aMap.animateCamera(cameraUpdate, 1500, null) } } @@ -239,11 +247,6 @@ } override fun initEvent() { - binding.rightOptionView.setOnClickListener { - val x = binding.rightOptionView.width - easyPopupWindow.width - easyPopupWindow.showAsDropDown(binding.rightOptionView, x, 0) - } - //撤防点位 binding.unDeployedLayout.setOnClickListener { requireContext().navigatePageTo() @@ -263,11 +266,11 @@ override fun observeRequestState() { wellViewModel.loadState.observe(this) { when (it) { - is LoadState.Loading -> LoadingDialogHub.show( + is LoadState.Loading -> LoadingDialog.show( requireActivity(), "数据加载中,请稍后..." ) - else -> LoadingDialogHub.dismiss() + else -> LoadingDialog.dismiss() } } } @@ -376,7 +379,7 @@ }).build().show() } }) - infoPopup.showAsDropDown(binding.rightOptionView) +// infoPopup.showAsDropDown(binding.rightOptionView) } override fun onCameraChange(p0: CameraPosition?) { diff --git a/app/src/main/java/com/casic/app/smartwell/fragment/HomePageNoClusterFragment.kt b/app/src/main/java/com/casic/app/smartwell/fragment/HomePageNoClusterFragment.kt index 802426a..b25f743 100644 --- a/app/src/main/java/com/casic/app/smartwell/fragment/HomePageNoClusterFragment.kt +++ b/app/src/main/java/com/casic/app/smartwell/fragment/HomePageNoClusterFragment.kt @@ -38,8 +38,9 @@ import com.pengxh.kt.lite.extensions.navigatePageTo import com.pengxh.kt.lite.extensions.show import com.pengxh.kt.lite.utils.LoadState -import com.pengxh.kt.lite.utils.LoadingDialogHub +import com.pengxh.kt.lite.utils.LoadingDialog import com.pengxh.kt.lite.widget.EasyPopupWindow +import com.pengxh.kt.lite.widget.TitleBarView import com.pengxh.kt.lite.widget.dialog.AlertControlDialog import kotlinx.coroutines.Dispatchers import kotlinx.coroutines.launch @@ -78,7 +79,15 @@ override fun setupTopBarLayout() { binding.rootView.initImmersionBar(this, false, R.color.mainThemeColor) - binding.titleView.text = "首页" + binding.titleView.setOnClickListener(object : TitleBarView.OnClickListener { + override fun onLeftClick() { + + } + + override fun onRightClick() { + easyPopupWindow.showAsDropDown(binding.titleView, binding.titleView.width, 0) + } + }) } override fun initOnCreate(savedInstanceState: Bundle?) { @@ -112,7 +121,7 @@ //渲染井位置 lifecycleScope.launch(Dispatchers.Main) { - LoadingDialogHub.show(requireActivity(), "数据加载中,请稍后") + LoadingDialog.show(requireActivity(), "数据加载中,请稍后") withContext(Dispatchers.IO) { //取Well缓存 val allMarkerOptions = ArrayList() @@ -144,7 +153,7 @@ val cameraPosition = CameraPosition(centerLatLng, 14f, 0f, 0f) val cameraUpdate = CameraUpdateFactory.newCameraPosition(cameraPosition) withContext(Dispatchers.Main) { - LoadingDialogHub.dismiss() + LoadingDialog.dismiss() aMap.animateCamera(cameraUpdate, 1500, null) } } @@ -238,11 +247,6 @@ } override fun initEvent() { - binding.rightOptionView.setOnClickListener { - val x = binding.rightOptionView.width - easyPopupWindow.width - easyPopupWindow.showAsDropDown(binding.rightOptionView, x, 0) - } - //撤防点位 binding.unDeployedLayout.setOnClickListener { requireContext().navigatePageTo() @@ -262,11 +266,11 @@ override fun observeRequestState() { wellViewModel.loadState.observe(this) { when (it) { - is LoadState.Loading -> LoadingDialogHub.show( + is LoadState.Loading -> LoadingDialog.show( requireActivity(), "数据加载中,请稍后..." ) - else -> LoadingDialogHub.dismiss() + else -> LoadingDialog.dismiss() } } } diff --git a/app/src/main/java/com/casic/app/smartwell/fragment/MinePageFragment.kt b/app/src/main/java/com/casic/app/smartwell/fragment/MinePageFragment.kt index 09a570c..dcb48f8 100644 --- a/app/src/main/java/com/casic/app/smartwell/fragment/MinePageFragment.kt +++ b/app/src/main/java/com/casic/app/smartwell/fragment/MinePageFragment.kt @@ -35,7 +35,7 @@ import com.pengxh.kt.lite.utils.ActivityStackManager import com.pengxh.kt.lite.utils.FileDownloadManager import com.pengxh.kt.lite.utils.LoadState -import com.pengxh.kt.lite.utils.LoadingDialogHub +import com.pengxh.kt.lite.utils.LoadingDialog import com.pengxh.kt.lite.widget.dialog.AlertControlDialog import com.pengxh.kt.lite.widget.dialog.BottomActionSheet import kotlinx.coroutines.Dispatchers @@ -60,7 +60,6 @@ override fun setupTopBarLayout() { binding.rootView.initImmersionBar(this, false, R.color.mainThemeColor) - binding.titleInclude.titleView.text = "我的" } override fun initOnCreate(savedInstanceState: Bundle?) { @@ -155,27 +154,27 @@ override fun observeRequestState() { userViewModel.loadState.observe(this) { when (it) { - is LoadState.Loading -> LoadingDialogHub.show( + is LoadState.Loading -> LoadingDialog.show( requireActivity(), "检查版本中,请稍后" ) - else -> LoadingDialogHub.dismiss() + else -> LoadingDialog.dismiss() } } wellViewModel.loadState.observe(this) { when (it) { - is LoadState.Loading -> LoadingDialogHub.show( + is LoadState.Loading -> LoadingDialog.show( requireActivity(), "数据更新中,请稍后" ) is LoadState.Fail -> { - LoadingDialogHub.dismiss() + LoadingDialog.dismiss() "数据更新超时".show(requireContext()) } else -> { - LoadingDialogHub.dismiss() + LoadingDialog.dismiss() AlertControlDialog.Builder().setContext(requireContext()).setTitle("温馨提示") .setMessage("数据更新成功,请重启应用").setNegativeButton("取消") .setPositiveButton("确定").setOnDialogButtonClickListener(object : @@ -197,17 +196,17 @@ lineViewModel.loadState.observe(this) { when (it) { - is LoadState.Loading -> LoadingDialogHub.show( + is LoadState.Loading -> LoadingDialog.show( requireActivity(), "数据更新中,请稍后" ) is LoadState.Fail -> { - LoadingDialogHub.dismiss() + LoadingDialog.dismiss() "数据更新超时".show(requireContext()) } else -> { - LoadingDialogHub.dismiss() + LoadingDialog.dismiss() AlertControlDialog.Builder().setContext(requireContext()).setTitle("温馨提示") .setMessage("数据更新成功,请重启应用").setNegativeButton("取消") .setPositiveButton("确定").setOnDialogButtonClickListener(object : diff --git a/app/src/main/java/com/casic/app/smartwell/fragment/NoticePageFragment.kt b/app/src/main/java/com/casic/app/smartwell/fragment/NoticePageFragment.kt index 171b555..3c93f54 100644 --- a/app/src/main/java/com/casic/app/smartwell/fragment/NoticePageFragment.kt +++ b/app/src/main/java/com/casic/app/smartwell/fragment/NoticePageFragment.kt @@ -48,7 +48,6 @@ override fun setupTopBarLayout() { binding.rootView.initImmersionBar(this, false, R.color.mainThemeColor) - binding.titleInclude.titleView.text = "消息" } override fun initOnCreate(savedInstanceState: Bundle?) { diff --git a/app/src/main/java/com/casic/app/smartwell/fragment/OrderListFragment.kt b/app/src/main/java/com/casic/app/smartwell/fragment/OrderListFragment.kt index 93ff35b..5e38acb 100644 --- a/app/src/main/java/com/casic/app/smartwell/fragment/OrderListFragment.kt +++ b/app/src/main/java/com/casic/app/smartwell/fragment/OrderListFragment.kt @@ -12,6 +12,7 @@ import com.casic.app.smartwell.view.SearchOrderActivity import com.pengxh.kt.lite.base.KotlinBaseFragment import com.pengxh.kt.lite.extensions.navigatePageTo +import com.pengxh.kt.lite.widget.TitleBarView class OrderListFragment : KotlinBaseFragment() { @@ -25,15 +26,22 @@ } override fun initViewBinding( - inflater: LayoutInflater, - container: ViewGroup? + inflater: LayoutInflater, container: ViewGroup? ): FragmentOrderBinding { return FragmentOrderBinding.inflate(inflater, container, false) } override fun setupTopBarLayout() { binding.rootView.initImmersionBar(this, false, R.color.mainThemeColor) - binding.titleView.text = "工单" + binding.titleView.setOnClickListener(object : TitleBarView.OnClickListener { + override fun onLeftClick() { + + } + + override fun onRightClick() { + requireContext().navigatePageTo() + } + }) } override fun initOnCreate(savedInstanceState: Bundle?) { @@ -51,8 +59,6 @@ } override fun initEvent() { - binding.rightOptionView.setOnClickListener { - requireContext().navigatePageTo() - } + } } \ No newline at end of file diff --git a/app/src/main/java/com/casic/app/smartwell/fragment/OrderNotProcessedFragment.kt b/app/src/main/java/com/casic/app/smartwell/fragment/OrderNotProcessedFragment.kt index 0b3d09d..2b6f21d 100644 --- a/app/src/main/java/com/casic/app/smartwell/fragment/OrderNotProcessedFragment.kt +++ b/app/src/main/java/com/casic/app/smartwell/fragment/OrderNotProcessedFragment.kt @@ -18,7 +18,7 @@ import com.pengxh.kt.lite.extensions.navigatePageTo import com.pengxh.kt.lite.extensions.show import com.pengxh.kt.lite.utils.LoadState -import com.pengxh.kt.lite.utils.LoadingDialogHub +import com.pengxh.kt.lite.utils.LoadingDialog import com.pengxh.kt.lite.utils.WeakReferenceHandler import com.pengxh.kt.lite.widget.dialog.AlertControlDialog @@ -78,8 +78,8 @@ operationViewModel = ViewModelProvider(this)[OperationViewModel::class.java] - binding.notProcessedView.addItemDecoration( - RecyclerViewItemOffsets(0, 5, 0, 5) + binding.recyclerView.addItemDecoration( + RecyclerViewItemOffsets(0, 7, 0, 7) ) } @@ -87,9 +87,9 @@ //接单状态处理 operationViewModel.loadState.observe(this) { when (it) { - is LoadState.Loading -> LoadingDialogHub.show(requireActivity(), "接单中,请稍后") + is LoadState.Loading -> LoadingDialog.show(requireActivity(), "接单中,请稍后") is LoadState.Success -> { - LoadingDialogHub.dismiss() + LoadingDialog.dismiss() //接单成功之后刷新列表 dataBeans.removeAt(clickedPosition) notProcessedAdapter.notifyItemRemoved(clickedPosition) @@ -98,7 +98,7 @@ ) } - else -> LoadingDialogHub.dismiss() + else -> LoadingDialog.dismiss() } } } @@ -131,7 +131,7 @@ } else { binding.emptyInclude.emptyView.hide() notProcessedAdapter = OrderNotProcessedAdapter(requireContext(), dataBeans) - binding.notProcessedView.adapter = notProcessedAdapter + binding.recyclerView.adapter = notProcessedAdapter notProcessedAdapter.setOnItemClickListener(object : OrderNotProcessedAdapter.OnItemClickListener { override fun onClicked(position: Int) { diff --git a/app/src/main/java/com/casic/app/smartwell/fragment/OvertimeNotAcceptFragment.kt b/app/src/main/java/com/casic/app/smartwell/fragment/OvertimeNotAcceptFragment.kt index a198545..9b318ca 100644 --- a/app/src/main/java/com/casic/app/smartwell/fragment/OvertimeNotAcceptFragment.kt +++ b/app/src/main/java/com/casic/app/smartwell/fragment/OvertimeNotAcceptFragment.kt @@ -18,7 +18,7 @@ import com.pengxh.kt.lite.extensions.navigatePageTo import com.pengxh.kt.lite.extensions.show import com.pengxh.kt.lite.utils.LoadState -import com.pengxh.kt.lite.utils.LoadingDialogHub +import com.pengxh.kt.lite.utils.LoadingDialog import com.pengxh.kt.lite.utils.WeakReferenceHandler import com.pengxh.kt.lite.widget.dialog.AlertControlDialog @@ -81,8 +81,8 @@ operationViewModel = ViewModelProvider(this)[OperationViewModel::class.java] - binding.notProcessedView.addItemDecoration( - RecyclerViewItemOffsets(0, 5, 0, 5) + binding.recyclerView.addItemDecoration( + RecyclerViewItemOffsets(0, 7, 0, 7) ) } @@ -90,9 +90,9 @@ //接单状态处理 operationViewModel.loadState.observe(this) { when (it) { - is LoadState.Loading -> LoadingDialogHub.show(requireActivity(), "接单中,请稍后") + is LoadState.Loading -> LoadingDialog.show(requireActivity(), "接单中,请稍后") is LoadState.Success -> { - LoadingDialogHub.dismiss() + LoadingDialog.dismiss() //接单成功之后刷新列表 dataBeans.removeAt(clickedPosition) notProcessedAdapter.notifyItemRemoved(clickedPosition) @@ -101,7 +101,7 @@ ) } - else -> LoadingDialogHub.dismiss() + else -> LoadingDialog.dismiss() } } } @@ -134,7 +134,7 @@ } else { binding.emptyInclude.emptyView.hide() notProcessedAdapter = OrderNotProcessedAdapter(requireContext(), dataBeans) - binding.notProcessedView.adapter = notProcessedAdapter + binding.recyclerView.adapter = notProcessedAdapter notProcessedAdapter.setOnItemClickListener(object : OrderNotProcessedAdapter.OnItemClickListener { override fun onClicked(position: Int) { diff --git a/app/src/main/java/com/casic/app/smartwell/greendao/DaoMaster.java b/app/src/main/java/com/casic/app/smartwell/greendao/DaoMaster.java index fdcf3a7..1e52b74 100644 --- a/app/src/main/java/com/casic/app/smartwell/greendao/DaoMaster.java +++ b/app/src/main/java/com/casic/app/smartwell/greendao/DaoMaster.java @@ -13,25 +13,20 @@ // THIS CODE IS GENERATED BY greenDAO, DO NOT EDIT. - /** * Master of DAO (schema version 4): knows all DAOs. */ public class DaoMaster extends AbstractDaoMaster { public static final int SCHEMA_VERSION = 4; - /** - * Creates underlying database table using DAOs. - */ + /** Creates underlying database table using DAOs. */ public static void createAllTables(Database db, boolean ifNotExists) { MapWellLocalBeanDao.createTable(db, ifNotExists); NoticeLocaleBeanDao.createTable(db, ifNotExists); PipeLocalBeanDao.createTable(db, ifNotExists); } - /** - * Drops underlying database table using DAOs. - */ + /** Drops underlying database table using DAOs. */ public static void dropAllTables(Database db, boolean ifExists) { MapWellLocalBeanDao.dropTable(db, ifExists); NoticeLocaleBeanDao.dropTable(db, ifExists); @@ -86,9 +81,7 @@ } } - /** - * WARNING: Drops all table on Upgrade! Use only during development. - */ + /** WARNING: Drops all table on Upgrade! Use only during development. */ public static class DevOpenHelper extends OpenHelper { public DevOpenHelper(Context context, String name) { super(context, name); diff --git a/app/src/main/java/com/casic/app/smartwell/greendao/DaoSession.java b/app/src/main/java/com/casic/app/smartwell/greendao/DaoSession.java index 0b36d17..3e40e3b 100644 --- a/app/src/main/java/com/casic/app/smartwell/greendao/DaoSession.java +++ b/app/src/main/java/com/casic/app/smartwell/greendao/DaoSession.java @@ -16,7 +16,7 @@ /** * {@inheritDoc} - * + * * @see org.greenrobot.greendao.AbstractDaoSession */ public class DaoSession extends AbstractDaoSession { @@ -50,7 +50,7 @@ registerDao(NoticeLocaleBean.class, noticeLocaleBeanDao); registerDao(PipeLocalBean.class, pipeLocalBeanDao); } - + public void clear() { mapWellLocalBeanDaoConfig.clearIdentityScope(); noticeLocaleBeanDaoConfig.clearIdentityScope(); diff --git a/app/src/main/java/com/casic/app/smartwell/greendao/MapWellLocalBeanDao.java b/app/src/main/java/com/casic/app/smartwell/greendao/MapWellLocalBeanDao.java index 8908fda..407bc92 100644 --- a/app/src/main/java/com/casic/app/smartwell/greendao/MapWellLocalBeanDao.java +++ b/app/src/main/java/com/casic/app/smartwell/greendao/MapWellLocalBeanDao.java @@ -12,10 +12,9 @@ import org.greenrobot.greendao.internal.DaoConfig; // THIS CODE IS GENERATED BY greenDAO, DO NOT EDIT. - -/** +/** * DAO for table "MAP_WELL_LOCAL_BEAN". - */ +*/ public class MapWellLocalBeanDao extends AbstractDao { public static final String TABLENAME = "MAP_WELL_LOCAL_BEAN"; @@ -57,16 +56,14 @@ public MapWellLocalBeanDao(DaoConfig config) { super(config); } - + public MapWellLocalBeanDao(DaoConfig config, DaoSession daoSession) { super(config, daoSession); } - /** - * Creates the underlying database table. - */ + /** Creates the underlying database table. */ public static void createTable(Database db, boolean ifNotExists) { - String constraint = ifNotExists ? "IF NOT EXISTS " : ""; + String constraint = ifNotExists? "IF NOT EXISTS ": ""; db.execSQL("CREATE TABLE " + constraint + "\"MAP_WELL_LOCAL_BEAN\" (" + // "\"_id\" INTEGER PRIMARY KEY AUTOINCREMENT ," + // 0: kId "\"AREA\" TEXT," + // 1: area @@ -96,9 +93,7 @@ "\"WELL_TYPE_NAME\" TEXT);"); // 25: wellTypeName } - /** - * Drops the underlying database table. - */ + /** Drops the underlying database table. */ public static void dropTable(Database db, boolean ifExists) { String sql = "DROP TABLE " + (ifExists ? "IF EXISTS " : "") + "\"MAP_WELL_LOCAL_BEAN\""; db.execSQL(sql); @@ -107,132 +102,132 @@ @Override protected final void bindValues(DatabaseStatement stmt, MapWellLocalBean entity) { stmt.clearBindings(); - + Long kId = entity.getKId(); if (kId != null) { stmt.bindLong(1, kId); } - + String area = entity.getArea(); if (area != null) { stmt.bindString(2, area); } - + String bfzt = entity.getBfzt(); if (bfzt != null) { stmt.bindString(3, bfzt); } - + String bfztName = entity.getBfztName(); if (bfztName != null) { stmt.bindString(4, bfztName); } - + String coordinateX = entity.getCoordinateX(); if (coordinateX != null) { stmt.bindString(5, coordinateX); } - + String coordinateY = entity.getCoordinateY(); if (coordinateY != null) { stmt.bindString(6, coordinateY); } - + String deep = entity.getDeep(); if (deep != null) { stmt.bindString(7, deep); } - + String deptName = entity.getDeptName(); if (deptName != null) { stmt.bindString(8, deptName); } - + String deptid = entity.getDeptid(); if (deptid != null) { stmt.bindString(9, deptid); } - + String id = entity.getId(); if (id != null) { stmt.bindString(10, id); } - + String latBaidu = entity.getLatBaidu(); if (latBaidu != null) { stmt.bindString(11, latBaidu); } - + String latGaode = entity.getLatGaode(); if (latGaode != null) { stmt.bindString(12, latGaode); } - + String lngBaidu = entity.getLngBaidu(); if (lngBaidu != null) { stmt.bindString(13, lngBaidu); } - + String lngGaode = entity.getLngGaode(); if (lngGaode != null) { stmt.bindString(14, lngGaode); } - + String notes = entity.getNotes(); if (notes != null) { stmt.bindString(15, notes); } - + String photos = entity.getPhotos(); if (photos != null) { stmt.bindString(16, photos); } - + String position = entity.getPosition(); if (position != null) { stmt.bindString(17, position); } - + String staff = entity.getStaff(); if (staff != null) { stmt.bindString(18, staff); } - + String tel = entity.getTel(); if (tel != null) { stmt.bindString(19, tel); } - + String ts = entity.getTs(); if (ts != null) { stmt.bindString(20, ts); } - + String valid = entity.getValid(); if (valid != null) { stmt.bindString(21, valid); } - + String watchData = entity.getWatchData(); if (watchData != null) { stmt.bindString(22, watchData); } - + String wellCode = entity.getWellCode(); if (wellCode != null) { stmt.bindString(23, wellCode); } - + String wellName = entity.getWellName(); if (wellName != null) { stmt.bindString(24, wellName); } - + String wellType = entity.getWellType(); if (wellType != null) { stmt.bindString(25, wellType); } - + String wellTypeName = entity.getWellTypeName(); if (wellTypeName != null) { stmt.bindString(26, wellTypeName); @@ -242,132 +237,132 @@ @Override protected final void bindValues(SQLiteStatement stmt, MapWellLocalBean entity) { stmt.clearBindings(); - + Long kId = entity.getKId(); if (kId != null) { stmt.bindLong(1, kId); } - + String area = entity.getArea(); if (area != null) { stmt.bindString(2, area); } - + String bfzt = entity.getBfzt(); if (bfzt != null) { stmt.bindString(3, bfzt); } - + String bfztName = entity.getBfztName(); if (bfztName != null) { stmt.bindString(4, bfztName); } - + String coordinateX = entity.getCoordinateX(); if (coordinateX != null) { stmt.bindString(5, coordinateX); } - + String coordinateY = entity.getCoordinateY(); if (coordinateY != null) { stmt.bindString(6, coordinateY); } - + String deep = entity.getDeep(); if (deep != null) { stmt.bindString(7, deep); } - + String deptName = entity.getDeptName(); if (deptName != null) { stmt.bindString(8, deptName); } - + String deptid = entity.getDeptid(); if (deptid != null) { stmt.bindString(9, deptid); } - + String id = entity.getId(); if (id != null) { stmt.bindString(10, id); } - + String latBaidu = entity.getLatBaidu(); if (latBaidu != null) { stmt.bindString(11, latBaidu); } - + String latGaode = entity.getLatGaode(); if (latGaode != null) { stmt.bindString(12, latGaode); } - + String lngBaidu = entity.getLngBaidu(); if (lngBaidu != null) { stmt.bindString(13, lngBaidu); } - + String lngGaode = entity.getLngGaode(); if (lngGaode != null) { stmt.bindString(14, lngGaode); } - + String notes = entity.getNotes(); if (notes != null) { stmt.bindString(15, notes); } - + String photos = entity.getPhotos(); if (photos != null) { stmt.bindString(16, photos); } - + String position = entity.getPosition(); if (position != null) { stmt.bindString(17, position); } - + String staff = entity.getStaff(); if (staff != null) { stmt.bindString(18, staff); } - + String tel = entity.getTel(); if (tel != null) { stmt.bindString(19, tel); } - + String ts = entity.getTs(); if (ts != null) { stmt.bindString(20, ts); } - + String valid = entity.getValid(); if (valid != null) { stmt.bindString(21, valid); } - + String watchData = entity.getWatchData(); if (watchData != null) { stmt.bindString(22, watchData); } - + String wellCode = entity.getWellCode(); if (wellCode != null) { stmt.bindString(23, wellCode); } - + String wellName = entity.getWellName(); if (wellName != null) { stmt.bindString(24, wellName); } - + String wellType = entity.getWellType(); if (wellType != null) { stmt.bindString(25, wellType); } - + String wellTypeName = entity.getWellTypeName(); if (wellTypeName != null) { stmt.bindString(26, wellTypeName); @@ -377,41 +372,41 @@ @Override public Long readKey(Cursor cursor, int offset) { return cursor.isNull(offset + 0) ? null : cursor.getLong(offset + 0); - } + } @Override public MapWellLocalBean readEntity(Cursor cursor, int offset) { MapWellLocalBean entity = new MapWellLocalBean( // - cursor.isNull(offset + 0) ? null : cursor.getLong(offset + 0), // kId - cursor.isNull(offset + 1) ? null : cursor.getString(offset + 1), // area - cursor.isNull(offset + 2) ? null : cursor.getString(offset + 2), // bfzt - cursor.isNull(offset + 3) ? null : cursor.getString(offset + 3), // bfztName - cursor.isNull(offset + 4) ? null : cursor.getString(offset + 4), // coordinateX - cursor.isNull(offset + 5) ? null : cursor.getString(offset + 5), // coordinateY - cursor.isNull(offset + 6) ? null : cursor.getString(offset + 6), // deep - cursor.isNull(offset + 7) ? null : cursor.getString(offset + 7), // deptName - cursor.isNull(offset + 8) ? null : cursor.getString(offset + 8), // deptid - cursor.isNull(offset + 9) ? null : cursor.getString(offset + 9), // id - cursor.isNull(offset + 10) ? null : cursor.getString(offset + 10), // latBaidu - cursor.isNull(offset + 11) ? null : cursor.getString(offset + 11), // latGaode - cursor.isNull(offset + 12) ? null : cursor.getString(offset + 12), // lngBaidu - cursor.isNull(offset + 13) ? null : cursor.getString(offset + 13), // lngGaode - cursor.isNull(offset + 14) ? null : cursor.getString(offset + 14), // notes - cursor.isNull(offset + 15) ? null : cursor.getString(offset + 15), // photos - cursor.isNull(offset + 16) ? null : cursor.getString(offset + 16), // position - cursor.isNull(offset + 17) ? null : cursor.getString(offset + 17), // staff - cursor.isNull(offset + 18) ? null : cursor.getString(offset + 18), // tel - cursor.isNull(offset + 19) ? null : cursor.getString(offset + 19), // ts - cursor.isNull(offset + 20) ? null : cursor.getString(offset + 20), // valid - cursor.isNull(offset + 21) ? null : cursor.getString(offset + 21), // watchData - cursor.isNull(offset + 22) ? null : cursor.getString(offset + 22), // wellCode - cursor.isNull(offset + 23) ? null : cursor.getString(offset + 23), // wellName - cursor.isNull(offset + 24) ? null : cursor.getString(offset + 24), // wellType - cursor.isNull(offset + 25) ? null : cursor.getString(offset + 25) // wellTypeName + cursor.isNull(offset + 0) ? null : cursor.getLong(offset + 0), // kId + cursor.isNull(offset + 1) ? null : cursor.getString(offset + 1), // area + cursor.isNull(offset + 2) ? null : cursor.getString(offset + 2), // bfzt + cursor.isNull(offset + 3) ? null : cursor.getString(offset + 3), // bfztName + cursor.isNull(offset + 4) ? null : cursor.getString(offset + 4), // coordinateX + cursor.isNull(offset + 5) ? null : cursor.getString(offset + 5), // coordinateY + cursor.isNull(offset + 6) ? null : cursor.getString(offset + 6), // deep + cursor.isNull(offset + 7) ? null : cursor.getString(offset + 7), // deptName + cursor.isNull(offset + 8) ? null : cursor.getString(offset + 8), // deptid + cursor.isNull(offset + 9) ? null : cursor.getString(offset + 9), // id + cursor.isNull(offset + 10) ? null : cursor.getString(offset + 10), // latBaidu + cursor.isNull(offset + 11) ? null : cursor.getString(offset + 11), // latGaode + cursor.isNull(offset + 12) ? null : cursor.getString(offset + 12), // lngBaidu + cursor.isNull(offset + 13) ? null : cursor.getString(offset + 13), // lngGaode + cursor.isNull(offset + 14) ? null : cursor.getString(offset + 14), // notes + cursor.isNull(offset + 15) ? null : cursor.getString(offset + 15), // photos + cursor.isNull(offset + 16) ? null : cursor.getString(offset + 16), // position + cursor.isNull(offset + 17) ? null : cursor.getString(offset + 17), // staff + cursor.isNull(offset + 18) ? null : cursor.getString(offset + 18), // tel + cursor.isNull(offset + 19) ? null : cursor.getString(offset + 19), // ts + cursor.isNull(offset + 20) ? null : cursor.getString(offset + 20), // valid + cursor.isNull(offset + 21) ? null : cursor.getString(offset + 21), // watchData + cursor.isNull(offset + 22) ? null : cursor.getString(offset + 22), // wellCode + cursor.isNull(offset + 23) ? null : cursor.getString(offset + 23), // wellName + cursor.isNull(offset + 24) ? null : cursor.getString(offset + 24), // wellType + cursor.isNull(offset + 25) ? null : cursor.getString(offset + 25) // wellTypeName ); return entity; } - + @Override public void readEntity(Cursor cursor, MapWellLocalBean entity, int offset) { entity.setKId(cursor.isNull(offset + 0) ? null : cursor.getLong(offset + 0)); @@ -440,17 +435,17 @@ entity.setWellName(cursor.isNull(offset + 23) ? null : cursor.getString(offset + 23)); entity.setWellType(cursor.isNull(offset + 24) ? null : cursor.getString(offset + 24)); entity.setWellTypeName(cursor.isNull(offset + 25) ? null : cursor.getString(offset + 25)); - } - + } + @Override protected final Long updateKeyAfterInsert(MapWellLocalBean entity, long rowId) { entity.setKId(rowId); return rowId; } - + @Override public Long getKey(MapWellLocalBean entity) { - if (entity != null) { + if(entity != null) { return entity.getKId(); } else { return null; @@ -466,5 +461,5 @@ protected final boolean isEntityUpdateable() { return true; } - + } diff --git a/app/src/main/java/com/casic/app/smartwell/greendao/NoticeLocaleBeanDao.java b/app/src/main/java/com/casic/app/smartwell/greendao/NoticeLocaleBeanDao.java index 64312ed..deb2d49 100644 --- a/app/src/main/java/com/casic/app/smartwell/greendao/NoticeLocaleBeanDao.java +++ b/app/src/main/java/com/casic/app/smartwell/greendao/NoticeLocaleBeanDao.java @@ -12,10 +12,9 @@ import org.greenrobot.greendao.internal.DaoConfig; // THIS CODE IS GENERATED BY greenDAO, DO NOT EDIT. - -/** +/** * DAO for table "NOTICE_LOCALE_BEAN". - */ +*/ public class NoticeLocaleBeanDao extends AbstractDao { public static final String TABLENAME = "NOTICE_LOCALE_BEAN"; @@ -43,16 +42,14 @@ public NoticeLocaleBeanDao(DaoConfig config) { super(config); } - + public NoticeLocaleBeanDao(DaoConfig config, DaoSession daoSession) { super(config, daoSession); } - /** - * Creates the underlying database table. - */ + /** Creates the underlying database table. */ public static void createTable(Database db, boolean ifNotExists) { - String constraint = ifNotExists ? "IF NOT EXISTS " : ""; + String constraint = ifNotExists? "IF NOT EXISTS ": ""; db.execSQL("CREATE TABLE " + constraint + "\"NOTICE_LOCALE_BEAN\" (" + // "\"_id\" INTEGER PRIMARY KEY AUTOINCREMENT ," + // 0: id "\"MESSAGE_ID\" TEXT UNIQUE ," + // 1: messageId @@ -68,9 +65,7 @@ "\"NOTICE_TIME\" TEXT);"); // 11: noticeTime } - /** - * Drops the underlying database table. - */ + /** Drops the underlying database table. */ public static void dropTable(Database db, boolean ifExists) { String sql = "DROP TABLE " + (ifExists ? "IF EXISTS " : "") + "\"NOTICE_LOCALE_BEAN\""; db.execSQL(sql); @@ -79,62 +74,62 @@ @Override protected final void bindValues(DatabaseStatement stmt, NoticeLocaleBean entity) { stmt.clearBindings(); - + Long id = entity.getId(); if (id != null) { stmt.bindLong(1, id); } - + String messageId = entity.getMessageId(); if (messageId != null) { stmt.bindString(2, messageId); } - + String appid = entity.getAppid(); if (appid != null) { stmt.bindString(3, appid); } - + String clientId = entity.getClientId(); if (clientId != null) { stmt.bindString(4, clientId); } - + String taskId = entity.getTaskId(); if (taskId != null) { stmt.bindString(5, taskId); } - + String userId = entity.getUserId(); if (userId != null) { stmt.bindString(6, userId); } - + String title = entity.getTitle(); if (title != null) { stmt.bindString(7, title); } - + String content = entity.getContent(); if (content != null) { stmt.bindString(8, content); } - + String deviceCode = entity.getDeviceCode(); if (deviceCode != null) { stmt.bindString(9, deviceCode); } - + String jobId = entity.getJobId(); if (jobId != null) { stmt.bindString(10, jobId); } - + String isRead = entity.getIsRead(); if (isRead != null) { stmt.bindString(11, isRead); } - + String noticeTime = entity.getNoticeTime(); if (noticeTime != null) { stmt.bindString(12, noticeTime); @@ -144,62 +139,62 @@ @Override protected final void bindValues(SQLiteStatement stmt, NoticeLocaleBean entity) { stmt.clearBindings(); - + Long id = entity.getId(); if (id != null) { stmt.bindLong(1, id); } - + String messageId = entity.getMessageId(); if (messageId != null) { stmt.bindString(2, messageId); } - + String appid = entity.getAppid(); if (appid != null) { stmt.bindString(3, appid); } - + String clientId = entity.getClientId(); if (clientId != null) { stmt.bindString(4, clientId); } - + String taskId = entity.getTaskId(); if (taskId != null) { stmt.bindString(5, taskId); } - + String userId = entity.getUserId(); if (userId != null) { stmt.bindString(6, userId); } - + String title = entity.getTitle(); if (title != null) { stmt.bindString(7, title); } - + String content = entity.getContent(); if (content != null) { stmt.bindString(8, content); } - + String deviceCode = entity.getDeviceCode(); if (deviceCode != null) { stmt.bindString(9, deviceCode); } - + String jobId = entity.getJobId(); if (jobId != null) { stmt.bindString(10, jobId); } - + String isRead = entity.getIsRead(); if (isRead != null) { stmt.bindString(11, isRead); } - + String noticeTime = entity.getNoticeTime(); if (noticeTime != null) { stmt.bindString(12, noticeTime); @@ -209,27 +204,27 @@ @Override public Long readKey(Cursor cursor, int offset) { return cursor.isNull(offset + 0) ? null : cursor.getLong(offset + 0); - } + } @Override public NoticeLocaleBean readEntity(Cursor cursor, int offset) { NoticeLocaleBean entity = new NoticeLocaleBean( // - cursor.isNull(offset + 0) ? null : cursor.getLong(offset + 0), // id - cursor.isNull(offset + 1) ? null : cursor.getString(offset + 1), // messageId - cursor.isNull(offset + 2) ? null : cursor.getString(offset + 2), // appid - cursor.isNull(offset + 3) ? null : cursor.getString(offset + 3), // clientId - cursor.isNull(offset + 4) ? null : cursor.getString(offset + 4), // taskId - cursor.isNull(offset + 5) ? null : cursor.getString(offset + 5), // userId - cursor.isNull(offset + 6) ? null : cursor.getString(offset + 6), // title - cursor.isNull(offset + 7) ? null : cursor.getString(offset + 7), // content - cursor.isNull(offset + 8) ? null : cursor.getString(offset + 8), // deviceCode - cursor.isNull(offset + 9) ? null : cursor.getString(offset + 9), // jobId - cursor.isNull(offset + 10) ? null : cursor.getString(offset + 10), // isRead - cursor.isNull(offset + 11) ? null : cursor.getString(offset + 11) // noticeTime + cursor.isNull(offset + 0) ? null : cursor.getLong(offset + 0), // id + cursor.isNull(offset + 1) ? null : cursor.getString(offset + 1), // messageId + cursor.isNull(offset + 2) ? null : cursor.getString(offset + 2), // appid + cursor.isNull(offset + 3) ? null : cursor.getString(offset + 3), // clientId + cursor.isNull(offset + 4) ? null : cursor.getString(offset + 4), // taskId + cursor.isNull(offset + 5) ? null : cursor.getString(offset + 5), // userId + cursor.isNull(offset + 6) ? null : cursor.getString(offset + 6), // title + cursor.isNull(offset + 7) ? null : cursor.getString(offset + 7), // content + cursor.isNull(offset + 8) ? null : cursor.getString(offset + 8), // deviceCode + cursor.isNull(offset + 9) ? null : cursor.getString(offset + 9), // jobId + cursor.isNull(offset + 10) ? null : cursor.getString(offset + 10), // isRead + cursor.isNull(offset + 11) ? null : cursor.getString(offset + 11) // noticeTime ); return entity; } - + @Override public void readEntity(Cursor cursor, NoticeLocaleBean entity, int offset) { entity.setId(cursor.isNull(offset + 0) ? null : cursor.getLong(offset + 0)); @@ -244,17 +239,17 @@ entity.setJobId(cursor.isNull(offset + 9) ? null : cursor.getString(offset + 9)); entity.setIsRead(cursor.isNull(offset + 10) ? null : cursor.getString(offset + 10)); entity.setNoticeTime(cursor.isNull(offset + 11) ? null : cursor.getString(offset + 11)); - } - + } + @Override protected final Long updateKeyAfterInsert(NoticeLocaleBean entity, long rowId) { entity.setId(rowId); return rowId; } - + @Override public Long getKey(NoticeLocaleBean entity) { - if (entity != null) { + if(entity != null) { return entity.getId(); } else { return null; @@ -270,5 +265,5 @@ protected final boolean isEntityUpdateable() { return true; } - + } diff --git a/app/src/main/java/com/casic/app/smartwell/greendao/PipeLocalBeanDao.java b/app/src/main/java/com/casic/app/smartwell/greendao/PipeLocalBeanDao.java index aab4d3f..df5515a 100644 --- a/app/src/main/java/com/casic/app/smartwell/greendao/PipeLocalBeanDao.java +++ b/app/src/main/java/com/casic/app/smartwell/greendao/PipeLocalBeanDao.java @@ -12,10 +12,9 @@ import org.greenrobot.greendao.internal.DaoConfig; // THIS CODE IS GENERATED BY greenDAO, DO NOT EDIT. - -/** +/** * DAO for table "PIPE_LOCAL_BEAN". - */ +*/ public class PipeLocalBeanDao extends AbstractDao { public static final String TABLENAME = "PIPE_LOCAL_BEAN"; @@ -37,16 +36,14 @@ public PipeLocalBeanDao(DaoConfig config) { super(config); } - + public PipeLocalBeanDao(DaoConfig config, DaoSession daoSession) { super(config, daoSession); } - /** - * Creates the underlying database table. - */ + /** Creates the underlying database table. */ public static void createTable(Database db, boolean ifNotExists) { - String constraint = ifNotExists ? "IF NOT EXISTS " : ""; + String constraint = ifNotExists? "IF NOT EXISTS ": ""; db.execSQL("CREATE TABLE " + constraint + "\"PIPE_LOCAL_BEAN\" (" + // "\"_id\" INTEGER PRIMARY KEY AUTOINCREMENT ," + // 0: id "\"PIPE_CODE\" TEXT," + // 1: pipeCode @@ -56,9 +53,7 @@ "\"START_LONGITUDE_GD\" TEXT);"); // 5: startLongitudeGd } - /** - * Drops the underlying database table. - */ + /** Drops the underlying database table. */ public static void dropTable(Database db, boolean ifExists) { String sql = "DROP TABLE " + (ifExists ? "IF EXISTS " : "") + "\"PIPE_LOCAL_BEAN\""; db.execSQL(sql); @@ -67,32 +62,32 @@ @Override protected final void bindValues(DatabaseStatement stmt, PipeLocalBean entity) { stmt.clearBindings(); - + Long id = entity.getId(); if (id != null) { stmt.bindLong(1, id); } - + String pipeCode = entity.getPipeCode(); if (pipeCode != null) { stmt.bindString(2, pipeCode); } - + String endLatitudeGd = entity.getEndLatitudeGd(); if (endLatitudeGd != null) { stmt.bindString(3, endLatitudeGd); } - + String endLongitudeGd = entity.getEndLongitudeGd(); if (endLongitudeGd != null) { stmt.bindString(4, endLongitudeGd); } - + String startLatitudeGd = entity.getStartLatitudeGd(); if (startLatitudeGd != null) { stmt.bindString(5, startLatitudeGd); } - + String startLongitudeGd = entity.getStartLongitudeGd(); if (startLongitudeGd != null) { stmt.bindString(6, startLongitudeGd); @@ -102,32 +97,32 @@ @Override protected final void bindValues(SQLiteStatement stmt, PipeLocalBean entity) { stmt.clearBindings(); - + Long id = entity.getId(); if (id != null) { stmt.bindLong(1, id); } - + String pipeCode = entity.getPipeCode(); if (pipeCode != null) { stmt.bindString(2, pipeCode); } - + String endLatitudeGd = entity.getEndLatitudeGd(); if (endLatitudeGd != null) { stmt.bindString(3, endLatitudeGd); } - + String endLongitudeGd = entity.getEndLongitudeGd(); if (endLongitudeGd != null) { stmt.bindString(4, endLongitudeGd); } - + String startLatitudeGd = entity.getStartLatitudeGd(); if (startLatitudeGd != null) { stmt.bindString(5, startLatitudeGd); } - + String startLongitudeGd = entity.getStartLongitudeGd(); if (startLongitudeGd != null) { stmt.bindString(6, startLongitudeGd); @@ -137,21 +132,21 @@ @Override public Long readKey(Cursor cursor, int offset) { return cursor.isNull(offset + 0) ? null : cursor.getLong(offset + 0); - } + } @Override public PipeLocalBean readEntity(Cursor cursor, int offset) { PipeLocalBean entity = new PipeLocalBean( // - cursor.isNull(offset + 0) ? null : cursor.getLong(offset + 0), // id - cursor.isNull(offset + 1) ? null : cursor.getString(offset + 1), // pipeCode - cursor.isNull(offset + 2) ? null : cursor.getString(offset + 2), // endLatitudeGd - cursor.isNull(offset + 3) ? null : cursor.getString(offset + 3), // endLongitudeGd - cursor.isNull(offset + 4) ? null : cursor.getString(offset + 4), // startLatitudeGd - cursor.isNull(offset + 5) ? null : cursor.getString(offset + 5) // startLongitudeGd + cursor.isNull(offset + 0) ? null : cursor.getLong(offset + 0), // id + cursor.isNull(offset + 1) ? null : cursor.getString(offset + 1), // pipeCode + cursor.isNull(offset + 2) ? null : cursor.getString(offset + 2), // endLatitudeGd + cursor.isNull(offset + 3) ? null : cursor.getString(offset + 3), // endLongitudeGd + cursor.isNull(offset + 4) ? null : cursor.getString(offset + 4), // startLatitudeGd + cursor.isNull(offset + 5) ? null : cursor.getString(offset + 5) // startLongitudeGd ); return entity; } - + @Override public void readEntity(Cursor cursor, PipeLocalBean entity, int offset) { entity.setId(cursor.isNull(offset + 0) ? null : cursor.getLong(offset + 0)); @@ -160,17 +155,17 @@ entity.setEndLongitudeGd(cursor.isNull(offset + 3) ? null : cursor.getString(offset + 3)); entity.setStartLatitudeGd(cursor.isNull(offset + 4) ? null : cursor.getString(offset + 4)); entity.setStartLongitudeGd(cursor.isNull(offset + 5) ? null : cursor.getString(offset + 5)); - } - + } + @Override protected final Long updateKeyAfterInsert(PipeLocalBean entity, long rowId) { entity.setId(rowId); return rowId; } - + @Override public Long getKey(PipeLocalBean entity) { - if (entity != null) { + if(entity != null) { return entity.getId(); } else { return null; @@ -186,5 +181,5 @@ protected final boolean isEntityUpdateable() { return true; } - + } diff --git a/app/src/main/java/com/casic/app/smartwell/view/ChangePasswordActivity.kt b/app/src/main/java/com/casic/app/smartwell/view/ChangePasswordActivity.kt index 8e41039..9f1dd40 100644 --- a/app/src/main/java/com/casic/app/smartwell/view/ChangePasswordActivity.kt +++ b/app/src/main/java/com/casic/app/smartwell/view/ChangePasswordActivity.kt @@ -14,7 +14,7 @@ import com.pengxh.kt.lite.extensions.show import com.pengxh.kt.lite.utils.ActivityStackManager import com.pengxh.kt.lite.utils.LoadState -import com.pengxh.kt.lite.utils.LoadingDialogHub +import com.pengxh.kt.lite.utils.LoadingDialog import com.pengxh.kt.lite.widget.TitleBarView import java.nio.charset.StandardCharsets @@ -46,15 +46,15 @@ override fun observeRequestState() { userViewModel.loadState.observe(this) { when (it) { - is LoadState.Loading -> LoadingDialogHub.show(this, "修改中,请稍后") + is LoadState.Loading -> LoadingDialog.show(this, "修改中,请稍后") is LoadState.Success -> { - LoadingDialogHub.dismiss() + LoadingDialog.dismiss() AuthenticationHelper.removeToken() this.navigatePageTo() ActivityStackManager.finishAllActivity() } - else -> LoadingDialogHub.dismiss() + else -> LoadingDialog.dismiss() } } } diff --git a/app/src/main/java/com/casic/app/smartwell/view/DeployedWellActivity.kt b/app/src/main/java/com/casic/app/smartwell/view/DeployedWellActivity.kt index fb4339c..28a5078 100644 --- a/app/src/main/java/com/casic/app/smartwell/view/DeployedWellActivity.kt +++ b/app/src/main/java/com/casic/app/smartwell/view/DeployedWellActivity.kt @@ -83,8 +83,8 @@ } //添加分割线 - binding.deployedListView.addItemDecoration( - RecyclerViewItemOffsets(0, 5, 0, 5) + binding.recyclerView.addItemDecoration( + RecyclerViewItemOffsets(0, 7, 0, 7) ) } @@ -149,12 +149,11 @@ } else { item.deep.toString() + "m" } - viewHolder.setText(R.id.wellNameView, item.wellName) + viewHolder.setText(R.id.wellTypeView, item.wellTypeName) .setText(R.id.wellDepthView, "深:${deep}") .setText(R.id.wellCodeView, "点位编号:${item.wellCode}") - .setText(R.id.wellTypeView, "点位类型:${item.wellTypeName}") .setText(R.id.ownerShipView, "权属单位:${item.deptName}") - .setText(R.id.wellLocationView, "点位置:${item.position}") + .setText(R.id.wellLocationView, "点位位置:${item.position}") .setOnClickListener( R.id.operationButton, object : View.OnClickListener { override fun onClick(v: View?) { @@ -207,7 +206,7 @@ }) } } - binding.deployedListView.adapter = deployAdapter + binding.recyclerView.adapter = deployAdapter deployAdapter.setOnItemClickedListener(object : NormalRecyclerAdapter.OnItemClickedListener { override fun onItemClicked(position: Int, t: WellListModel.DataBean.RowsBean) { diff --git a/app/src/main/java/com/casic/app/smartwell/view/LoginActivity.kt b/app/src/main/java/com/casic/app/smartwell/view/LoginActivity.kt index e4bb0e3..834527b 100644 --- a/app/src/main/java/com/casic/app/smartwell/view/LoginActivity.kt +++ b/app/src/main/java/com/casic/app/smartwell/view/LoginActivity.kt @@ -21,7 +21,7 @@ import com.pengxh.kt.lite.extensions.navigatePageTo import com.pengxh.kt.lite.extensions.readAssetsFile import com.pengxh.kt.lite.extensions.show -import com.pengxh.kt.lite.utils.LoadingDialogHub +import com.pengxh.kt.lite.utils.LoadingDialog import com.pengxh.kt.lite.utils.SaveKeyValues import kotlinx.coroutines.Dispatchers import kotlinx.coroutines.launch @@ -106,11 +106,11 @@ override fun observeRequestState() { authenticateViewModel.loadState.observe(this) { - LoadingDialogHub.show(this, "登录中,请稍后") + LoadingDialog.show(this, "登录中,请稍后") } loginViewModel.loadState.observe(this) { - LoadingDialogHub.dismiss() + LoadingDialog.dismiss() } } diff --git a/app/src/main/java/com/casic/app/smartwell/view/OrderCompletedDetailActivity.kt b/app/src/main/java/com/casic/app/smartwell/view/OrderCompletedDetailActivity.kt index db8ad1f..75cd905 100644 --- a/app/src/main/java/com/casic/app/smartwell/view/OrderCompletedDetailActivity.kt +++ b/app/src/main/java/com/casic/app/smartwell/view/OrderCompletedDetailActivity.kt @@ -17,7 +17,7 @@ import com.pengxh.kt.lite.extensions.show import com.pengxh.kt.lite.utils.Constant import com.pengxh.kt.lite.utils.LoadState -import com.pengxh.kt.lite.utils.LoadingDialogHub +import com.pengxh.kt.lite.utils.LoadingDialog import com.pengxh.kt.lite.widget.TitleBarView import com.pengxh.kt.lite.widget.dialog.AlertMessageDialog @@ -44,7 +44,7 @@ } override fun initOnCreate(savedInstanceState: Bundle?) { - val jobId = intent.getStringExtra(Constant.INTENT_PARAM)!! + val jobId = intent.getStringExtra(Constant.INTENT_PARAM_KEY)!! orderViewModel = ViewModelProvider(this)[OrderViewModel::class.java] orderViewModel.getWorkOrderDetail(jobId) orderViewModel.detailModel.observe(this) { @@ -154,8 +154,8 @@ override fun observeRequestState() { orderViewModel.loadState.observe(this) { when (it) { - is LoadState.Loading -> LoadingDialogHub.show(this, "数据加载中,请稍后") - else -> LoadingDialogHub.dismiss() + is LoadState.Loading -> LoadingDialog.show(this, "数据加载中,请稍后") + else -> LoadingDialog.dismiss() } } } diff --git a/app/src/main/java/com/casic/app/smartwell/view/OrderInHandleDetailActivity.kt b/app/src/main/java/com/casic/app/smartwell/view/OrderInHandleDetailActivity.kt index d70a979..04a7d5d 100644 --- a/app/src/main/java/com/casic/app/smartwell/view/OrderInHandleDetailActivity.kt +++ b/app/src/main/java/com/casic/app/smartwell/view/OrderInHandleDetailActivity.kt @@ -38,7 +38,7 @@ import com.pengxh.kt.lite.extensions.show import com.pengxh.kt.lite.utils.Constant import com.pengxh.kt.lite.utils.LoadState -import com.pengxh.kt.lite.utils.LoadingDialogHub +import com.pengxh.kt.lite.utils.LoadingDialog import com.pengxh.kt.lite.widget.TitleBarView import com.pengxh.kt.lite.widget.dialog.AlertControlDialog import com.pengxh.kt.lite.widget.dialog.AlertMessageDialog @@ -93,7 +93,7 @@ ) binding.addImageRecyclerView.adapter = imageAdapter - val jobId = intent.getStringExtra(Constant.INTENT_PARAM)!!//初始化图片九宫格 + val jobId = intent.getStringExtra(Constant.INTENT_PARAM_KEY)!!//初始化图片九宫格 orderViewModel.getWorkOrderDetail(jobId) orderViewModel.detailModel.observe(this) { if (it.code == 200) { @@ -312,41 +312,41 @@ override fun observeRequestState() { orderViewModel.loadState.observe(this) { when (it) { - is LoadState.Loading -> LoadingDialogHub.show(this, "数据加载中,请稍后") - else -> LoadingDialogHub.dismiss() + is LoadState.Loading -> LoadingDialog.show(this, "数据加载中,请稍后") + else -> LoadingDialog.dismiss() } } uploadImageViewModel.loadState.observe(this) { when (it) { - LoadState.Loading -> LoadingDialogHub.show(this, "图片上传中,请稍后...") - else -> LoadingDialogHub.dismiss() + LoadState.Loading -> LoadingDialog.show(this, "图片上传中,请稍后...") + else -> LoadingDialog.dismiss() } } //转单状态处理 operationViewModel.loadState.observe(this) { when (it) { - is LoadState.Loading -> LoadingDialogHub.show(this, "转单中,请稍后") + is LoadState.Loading -> LoadingDialog.show(this, "转单中,请稍后") is LoadState.Success -> { - LoadingDialogHub.dismiss() + LoadingDialog.dismiss() this.finish() } - else -> LoadingDialogHub.dismiss() + else -> LoadingDialog.dismiss() } } //处理完成工单状态处理 operationViewModel.loadState.observe(this) { when (it) { - is LoadState.Loading -> LoadingDialogHub.show(this, "处理中,请稍后") + is LoadState.Loading -> LoadingDialog.show(this, "处理中,请稍后") is LoadState.Success -> { - LoadingDialogHub.dismiss() + LoadingDialog.dismiss() this.finish() } - else -> LoadingDialogHub.dismiss() + else -> LoadingDialog.dismiss() } } } diff --git a/app/build.gradle b/app/build.gradle index 296fb6f..c18c251 100644 --- a/app/build.gradle +++ b/app/build.gradle @@ -40,10 +40,6 @@ // VIVO 相关应用参数 VIVO_APP_ID : "105749048", VIVO_APP_KEY : "e460fbf2c689e0f8c58ecc6aa62e1803", - - // 小米相关应用参数 -// XIAOMI_APP_ID : "", -// XIAOMI_APP_KEY : "", ] // 版本名后面添加一句话,意思就是flavor dimension 它的维度就是该版本号,多渠道打包很重要 @@ -107,7 +103,7 @@ dependencies { implementation fileTree(dir: 'libs', include: ['*.jar']) //基础依赖库 - implementation 'com.github.AndroidCoderPeng:Kotlin-lite-lib:1.0.10' + implementation 'com.github.AndroidCoderPeng:Kotlin-lite-lib:1.1.0' implementation 'androidx.appcompat:appcompat:1.6.1' implementation 'androidx.core:core-ktx:1.9.0' implementation 'androidx.constraintlayout:constraintlayout:2.1.4' @@ -165,8 +161,6 @@ implementation 'commons-codec:commons-codec:1.15' implementation 'com.android.support:support-annotations:28.0.0' implementation 'com.assist-v3:vivo:3.1.2' // vivo -// implementation 'com.getui.opt:xmp:3.3.1' // 小米 - //数据库框架 implementation 'org.greenrobot:greendao:3.3.0' //数据库升级 diff --git a/app/src/main/AndroidManifest.xml b/app/src/main/AndroidManifest.xml index c0af158..e0519bf 100644 --- a/app/src/main/AndroidManifest.xml +++ b/app/src/main/AndroidManifest.xml @@ -90,10 +90,10 @@ - + + android:value="ee96d8b5e12de3fbb29949efd57418a8" /> () @@ -150,7 +158,7 @@ val cameraPosition = CameraPosition(centerLatLng, 14f, 0f, 0f) val cameraUpdate = CameraUpdateFactory.newCameraPosition(cameraPosition) withContext(Dispatchers.Main) { - LoadingDialogHub.dismiss() + LoadingDialog.dismiss() aMap.animateCamera(cameraUpdate, 1500, null) } } @@ -239,11 +247,6 @@ } override fun initEvent() { - binding.rightOptionView.setOnClickListener { - val x = binding.rightOptionView.width - easyPopupWindow.width - easyPopupWindow.showAsDropDown(binding.rightOptionView, x, 0) - } - //撤防点位 binding.unDeployedLayout.setOnClickListener { requireContext().navigatePageTo() @@ -263,11 +266,11 @@ override fun observeRequestState() { wellViewModel.loadState.observe(this) { when (it) { - is LoadState.Loading -> LoadingDialogHub.show( + is LoadState.Loading -> LoadingDialog.show( requireActivity(), "数据加载中,请稍后..." ) - else -> LoadingDialogHub.dismiss() + else -> LoadingDialog.dismiss() } } } @@ -376,7 +379,7 @@ }).build().show() } }) - infoPopup.showAsDropDown(binding.rightOptionView) +// infoPopup.showAsDropDown(binding.rightOptionView) } override fun onCameraChange(p0: CameraPosition?) { diff --git a/app/src/main/java/com/casic/app/smartwell/fragment/HomePageNoClusterFragment.kt b/app/src/main/java/com/casic/app/smartwell/fragment/HomePageNoClusterFragment.kt index 802426a..b25f743 100644 --- a/app/src/main/java/com/casic/app/smartwell/fragment/HomePageNoClusterFragment.kt +++ b/app/src/main/java/com/casic/app/smartwell/fragment/HomePageNoClusterFragment.kt @@ -38,8 +38,9 @@ import com.pengxh.kt.lite.extensions.navigatePageTo import com.pengxh.kt.lite.extensions.show import com.pengxh.kt.lite.utils.LoadState -import com.pengxh.kt.lite.utils.LoadingDialogHub +import com.pengxh.kt.lite.utils.LoadingDialog import com.pengxh.kt.lite.widget.EasyPopupWindow +import com.pengxh.kt.lite.widget.TitleBarView import com.pengxh.kt.lite.widget.dialog.AlertControlDialog import kotlinx.coroutines.Dispatchers import kotlinx.coroutines.launch @@ -78,7 +79,15 @@ override fun setupTopBarLayout() { binding.rootView.initImmersionBar(this, false, R.color.mainThemeColor) - binding.titleView.text = "首页" + binding.titleView.setOnClickListener(object : TitleBarView.OnClickListener { + override fun onLeftClick() { + + } + + override fun onRightClick() { + easyPopupWindow.showAsDropDown(binding.titleView, binding.titleView.width, 0) + } + }) } override fun initOnCreate(savedInstanceState: Bundle?) { @@ -112,7 +121,7 @@ //渲染井位置 lifecycleScope.launch(Dispatchers.Main) { - LoadingDialogHub.show(requireActivity(), "数据加载中,请稍后") + LoadingDialog.show(requireActivity(), "数据加载中,请稍后") withContext(Dispatchers.IO) { //取Well缓存 val allMarkerOptions = ArrayList() @@ -144,7 +153,7 @@ val cameraPosition = CameraPosition(centerLatLng, 14f, 0f, 0f) val cameraUpdate = CameraUpdateFactory.newCameraPosition(cameraPosition) withContext(Dispatchers.Main) { - LoadingDialogHub.dismiss() + LoadingDialog.dismiss() aMap.animateCamera(cameraUpdate, 1500, null) } } @@ -238,11 +247,6 @@ } override fun initEvent() { - binding.rightOptionView.setOnClickListener { - val x = binding.rightOptionView.width - easyPopupWindow.width - easyPopupWindow.showAsDropDown(binding.rightOptionView, x, 0) - } - //撤防点位 binding.unDeployedLayout.setOnClickListener { requireContext().navigatePageTo() @@ -262,11 +266,11 @@ override fun observeRequestState() { wellViewModel.loadState.observe(this) { when (it) { - is LoadState.Loading -> LoadingDialogHub.show( + is LoadState.Loading -> LoadingDialog.show( requireActivity(), "数据加载中,请稍后..." ) - else -> LoadingDialogHub.dismiss() + else -> LoadingDialog.dismiss() } } } diff --git a/app/src/main/java/com/casic/app/smartwell/fragment/MinePageFragment.kt b/app/src/main/java/com/casic/app/smartwell/fragment/MinePageFragment.kt index 09a570c..dcb48f8 100644 --- a/app/src/main/java/com/casic/app/smartwell/fragment/MinePageFragment.kt +++ b/app/src/main/java/com/casic/app/smartwell/fragment/MinePageFragment.kt @@ -35,7 +35,7 @@ import com.pengxh.kt.lite.utils.ActivityStackManager import com.pengxh.kt.lite.utils.FileDownloadManager import com.pengxh.kt.lite.utils.LoadState -import com.pengxh.kt.lite.utils.LoadingDialogHub +import com.pengxh.kt.lite.utils.LoadingDialog import com.pengxh.kt.lite.widget.dialog.AlertControlDialog import com.pengxh.kt.lite.widget.dialog.BottomActionSheet import kotlinx.coroutines.Dispatchers @@ -60,7 +60,6 @@ override fun setupTopBarLayout() { binding.rootView.initImmersionBar(this, false, R.color.mainThemeColor) - binding.titleInclude.titleView.text = "我的" } override fun initOnCreate(savedInstanceState: Bundle?) { @@ -155,27 +154,27 @@ override fun observeRequestState() { userViewModel.loadState.observe(this) { when (it) { - is LoadState.Loading -> LoadingDialogHub.show( + is LoadState.Loading -> LoadingDialog.show( requireActivity(), "检查版本中,请稍后" ) - else -> LoadingDialogHub.dismiss() + else -> LoadingDialog.dismiss() } } wellViewModel.loadState.observe(this) { when (it) { - is LoadState.Loading -> LoadingDialogHub.show( + is LoadState.Loading -> LoadingDialog.show( requireActivity(), "数据更新中,请稍后" ) is LoadState.Fail -> { - LoadingDialogHub.dismiss() + LoadingDialog.dismiss() "数据更新超时".show(requireContext()) } else -> { - LoadingDialogHub.dismiss() + LoadingDialog.dismiss() AlertControlDialog.Builder().setContext(requireContext()).setTitle("温馨提示") .setMessage("数据更新成功,请重启应用").setNegativeButton("取消") .setPositiveButton("确定").setOnDialogButtonClickListener(object : @@ -197,17 +196,17 @@ lineViewModel.loadState.observe(this) { when (it) { - is LoadState.Loading -> LoadingDialogHub.show( + is LoadState.Loading -> LoadingDialog.show( requireActivity(), "数据更新中,请稍后" ) is LoadState.Fail -> { - LoadingDialogHub.dismiss() + LoadingDialog.dismiss() "数据更新超时".show(requireContext()) } else -> { - LoadingDialogHub.dismiss() + LoadingDialog.dismiss() AlertControlDialog.Builder().setContext(requireContext()).setTitle("温馨提示") .setMessage("数据更新成功,请重启应用").setNegativeButton("取消") .setPositiveButton("确定").setOnDialogButtonClickListener(object : diff --git a/app/src/main/java/com/casic/app/smartwell/fragment/NoticePageFragment.kt b/app/src/main/java/com/casic/app/smartwell/fragment/NoticePageFragment.kt index 171b555..3c93f54 100644 --- a/app/src/main/java/com/casic/app/smartwell/fragment/NoticePageFragment.kt +++ b/app/src/main/java/com/casic/app/smartwell/fragment/NoticePageFragment.kt @@ -48,7 +48,6 @@ override fun setupTopBarLayout() { binding.rootView.initImmersionBar(this, false, R.color.mainThemeColor) - binding.titleInclude.titleView.text = "消息" } override fun initOnCreate(savedInstanceState: Bundle?) { diff --git a/app/src/main/java/com/casic/app/smartwell/fragment/OrderListFragment.kt b/app/src/main/java/com/casic/app/smartwell/fragment/OrderListFragment.kt index 93ff35b..5e38acb 100644 --- a/app/src/main/java/com/casic/app/smartwell/fragment/OrderListFragment.kt +++ b/app/src/main/java/com/casic/app/smartwell/fragment/OrderListFragment.kt @@ -12,6 +12,7 @@ import com.casic.app.smartwell.view.SearchOrderActivity import com.pengxh.kt.lite.base.KotlinBaseFragment import com.pengxh.kt.lite.extensions.navigatePageTo +import com.pengxh.kt.lite.widget.TitleBarView class OrderListFragment : KotlinBaseFragment() { @@ -25,15 +26,22 @@ } override fun initViewBinding( - inflater: LayoutInflater, - container: ViewGroup? + inflater: LayoutInflater, container: ViewGroup? ): FragmentOrderBinding { return FragmentOrderBinding.inflate(inflater, container, false) } override fun setupTopBarLayout() { binding.rootView.initImmersionBar(this, false, R.color.mainThemeColor) - binding.titleView.text = "工单" + binding.titleView.setOnClickListener(object : TitleBarView.OnClickListener { + override fun onLeftClick() { + + } + + override fun onRightClick() { + requireContext().navigatePageTo() + } + }) } override fun initOnCreate(savedInstanceState: Bundle?) { @@ -51,8 +59,6 @@ } override fun initEvent() { - binding.rightOptionView.setOnClickListener { - requireContext().navigatePageTo() - } + } } \ No newline at end of file diff --git a/app/src/main/java/com/casic/app/smartwell/fragment/OrderNotProcessedFragment.kt b/app/src/main/java/com/casic/app/smartwell/fragment/OrderNotProcessedFragment.kt index 0b3d09d..2b6f21d 100644 --- a/app/src/main/java/com/casic/app/smartwell/fragment/OrderNotProcessedFragment.kt +++ b/app/src/main/java/com/casic/app/smartwell/fragment/OrderNotProcessedFragment.kt @@ -18,7 +18,7 @@ import com.pengxh.kt.lite.extensions.navigatePageTo import com.pengxh.kt.lite.extensions.show import com.pengxh.kt.lite.utils.LoadState -import com.pengxh.kt.lite.utils.LoadingDialogHub +import com.pengxh.kt.lite.utils.LoadingDialog import com.pengxh.kt.lite.utils.WeakReferenceHandler import com.pengxh.kt.lite.widget.dialog.AlertControlDialog @@ -78,8 +78,8 @@ operationViewModel = ViewModelProvider(this)[OperationViewModel::class.java] - binding.notProcessedView.addItemDecoration( - RecyclerViewItemOffsets(0, 5, 0, 5) + binding.recyclerView.addItemDecoration( + RecyclerViewItemOffsets(0, 7, 0, 7) ) } @@ -87,9 +87,9 @@ //接单状态处理 operationViewModel.loadState.observe(this) { when (it) { - is LoadState.Loading -> LoadingDialogHub.show(requireActivity(), "接单中,请稍后") + is LoadState.Loading -> LoadingDialog.show(requireActivity(), "接单中,请稍后") is LoadState.Success -> { - LoadingDialogHub.dismiss() + LoadingDialog.dismiss() //接单成功之后刷新列表 dataBeans.removeAt(clickedPosition) notProcessedAdapter.notifyItemRemoved(clickedPosition) @@ -98,7 +98,7 @@ ) } - else -> LoadingDialogHub.dismiss() + else -> LoadingDialog.dismiss() } } } @@ -131,7 +131,7 @@ } else { binding.emptyInclude.emptyView.hide() notProcessedAdapter = OrderNotProcessedAdapter(requireContext(), dataBeans) - binding.notProcessedView.adapter = notProcessedAdapter + binding.recyclerView.adapter = notProcessedAdapter notProcessedAdapter.setOnItemClickListener(object : OrderNotProcessedAdapter.OnItemClickListener { override fun onClicked(position: Int) { diff --git a/app/src/main/java/com/casic/app/smartwell/fragment/OvertimeNotAcceptFragment.kt b/app/src/main/java/com/casic/app/smartwell/fragment/OvertimeNotAcceptFragment.kt index a198545..9b318ca 100644 --- a/app/src/main/java/com/casic/app/smartwell/fragment/OvertimeNotAcceptFragment.kt +++ b/app/src/main/java/com/casic/app/smartwell/fragment/OvertimeNotAcceptFragment.kt @@ -18,7 +18,7 @@ import com.pengxh.kt.lite.extensions.navigatePageTo import com.pengxh.kt.lite.extensions.show import com.pengxh.kt.lite.utils.LoadState -import com.pengxh.kt.lite.utils.LoadingDialogHub +import com.pengxh.kt.lite.utils.LoadingDialog import com.pengxh.kt.lite.utils.WeakReferenceHandler import com.pengxh.kt.lite.widget.dialog.AlertControlDialog @@ -81,8 +81,8 @@ operationViewModel = ViewModelProvider(this)[OperationViewModel::class.java] - binding.notProcessedView.addItemDecoration( - RecyclerViewItemOffsets(0, 5, 0, 5) + binding.recyclerView.addItemDecoration( + RecyclerViewItemOffsets(0, 7, 0, 7) ) } @@ -90,9 +90,9 @@ //接单状态处理 operationViewModel.loadState.observe(this) { when (it) { - is LoadState.Loading -> LoadingDialogHub.show(requireActivity(), "接单中,请稍后") + is LoadState.Loading -> LoadingDialog.show(requireActivity(), "接单中,请稍后") is LoadState.Success -> { - LoadingDialogHub.dismiss() + LoadingDialog.dismiss() //接单成功之后刷新列表 dataBeans.removeAt(clickedPosition) notProcessedAdapter.notifyItemRemoved(clickedPosition) @@ -101,7 +101,7 @@ ) } - else -> LoadingDialogHub.dismiss() + else -> LoadingDialog.dismiss() } } } @@ -134,7 +134,7 @@ } else { binding.emptyInclude.emptyView.hide() notProcessedAdapter = OrderNotProcessedAdapter(requireContext(), dataBeans) - binding.notProcessedView.adapter = notProcessedAdapter + binding.recyclerView.adapter = notProcessedAdapter notProcessedAdapter.setOnItemClickListener(object : OrderNotProcessedAdapter.OnItemClickListener { override fun onClicked(position: Int) { diff --git a/app/src/main/java/com/casic/app/smartwell/greendao/DaoMaster.java b/app/src/main/java/com/casic/app/smartwell/greendao/DaoMaster.java index fdcf3a7..1e52b74 100644 --- a/app/src/main/java/com/casic/app/smartwell/greendao/DaoMaster.java +++ b/app/src/main/java/com/casic/app/smartwell/greendao/DaoMaster.java @@ -13,25 +13,20 @@ // THIS CODE IS GENERATED BY greenDAO, DO NOT EDIT. - /** * Master of DAO (schema version 4): knows all DAOs. */ public class DaoMaster extends AbstractDaoMaster { public static final int SCHEMA_VERSION = 4; - /** - * Creates underlying database table using DAOs. - */ + /** Creates underlying database table using DAOs. */ public static void createAllTables(Database db, boolean ifNotExists) { MapWellLocalBeanDao.createTable(db, ifNotExists); NoticeLocaleBeanDao.createTable(db, ifNotExists); PipeLocalBeanDao.createTable(db, ifNotExists); } - /** - * Drops underlying database table using DAOs. - */ + /** Drops underlying database table using DAOs. */ public static void dropAllTables(Database db, boolean ifExists) { MapWellLocalBeanDao.dropTable(db, ifExists); NoticeLocaleBeanDao.dropTable(db, ifExists); @@ -86,9 +81,7 @@ } } - /** - * WARNING: Drops all table on Upgrade! Use only during development. - */ + /** WARNING: Drops all table on Upgrade! Use only during development. */ public static class DevOpenHelper extends OpenHelper { public DevOpenHelper(Context context, String name) { super(context, name); diff --git a/app/src/main/java/com/casic/app/smartwell/greendao/DaoSession.java b/app/src/main/java/com/casic/app/smartwell/greendao/DaoSession.java index 0b36d17..3e40e3b 100644 --- a/app/src/main/java/com/casic/app/smartwell/greendao/DaoSession.java +++ b/app/src/main/java/com/casic/app/smartwell/greendao/DaoSession.java @@ -16,7 +16,7 @@ /** * {@inheritDoc} - * + * * @see org.greenrobot.greendao.AbstractDaoSession */ public class DaoSession extends AbstractDaoSession { @@ -50,7 +50,7 @@ registerDao(NoticeLocaleBean.class, noticeLocaleBeanDao); registerDao(PipeLocalBean.class, pipeLocalBeanDao); } - + public void clear() { mapWellLocalBeanDaoConfig.clearIdentityScope(); noticeLocaleBeanDaoConfig.clearIdentityScope(); diff --git a/app/src/main/java/com/casic/app/smartwell/greendao/MapWellLocalBeanDao.java b/app/src/main/java/com/casic/app/smartwell/greendao/MapWellLocalBeanDao.java index 8908fda..407bc92 100644 --- a/app/src/main/java/com/casic/app/smartwell/greendao/MapWellLocalBeanDao.java +++ b/app/src/main/java/com/casic/app/smartwell/greendao/MapWellLocalBeanDao.java @@ -12,10 +12,9 @@ import org.greenrobot.greendao.internal.DaoConfig; // THIS CODE IS GENERATED BY greenDAO, DO NOT EDIT. - -/** +/** * DAO for table "MAP_WELL_LOCAL_BEAN". - */ +*/ public class MapWellLocalBeanDao extends AbstractDao { public static final String TABLENAME = "MAP_WELL_LOCAL_BEAN"; @@ -57,16 +56,14 @@ public MapWellLocalBeanDao(DaoConfig config) { super(config); } - + public MapWellLocalBeanDao(DaoConfig config, DaoSession daoSession) { super(config, daoSession); } - /** - * Creates the underlying database table. - */ + /** Creates the underlying database table. */ public static void createTable(Database db, boolean ifNotExists) { - String constraint = ifNotExists ? "IF NOT EXISTS " : ""; + String constraint = ifNotExists? "IF NOT EXISTS ": ""; db.execSQL("CREATE TABLE " + constraint + "\"MAP_WELL_LOCAL_BEAN\" (" + // "\"_id\" INTEGER PRIMARY KEY AUTOINCREMENT ," + // 0: kId "\"AREA\" TEXT," + // 1: area @@ -96,9 +93,7 @@ "\"WELL_TYPE_NAME\" TEXT);"); // 25: wellTypeName } - /** - * Drops the underlying database table. - */ + /** Drops the underlying database table. */ public static void dropTable(Database db, boolean ifExists) { String sql = "DROP TABLE " + (ifExists ? "IF EXISTS " : "") + "\"MAP_WELL_LOCAL_BEAN\""; db.execSQL(sql); @@ -107,132 +102,132 @@ @Override protected final void bindValues(DatabaseStatement stmt, MapWellLocalBean entity) { stmt.clearBindings(); - + Long kId = entity.getKId(); if (kId != null) { stmt.bindLong(1, kId); } - + String area = entity.getArea(); if (area != null) { stmt.bindString(2, area); } - + String bfzt = entity.getBfzt(); if (bfzt != null) { stmt.bindString(3, bfzt); } - + String bfztName = entity.getBfztName(); if (bfztName != null) { stmt.bindString(4, bfztName); } - + String coordinateX = entity.getCoordinateX(); if (coordinateX != null) { stmt.bindString(5, coordinateX); } - + String coordinateY = entity.getCoordinateY(); if (coordinateY != null) { stmt.bindString(6, coordinateY); } - + String deep = entity.getDeep(); if (deep != null) { stmt.bindString(7, deep); } - + String deptName = entity.getDeptName(); if (deptName != null) { stmt.bindString(8, deptName); } - + String deptid = entity.getDeptid(); if (deptid != null) { stmt.bindString(9, deptid); } - + String id = entity.getId(); if (id != null) { stmt.bindString(10, id); } - + String latBaidu = entity.getLatBaidu(); if (latBaidu != null) { stmt.bindString(11, latBaidu); } - + String latGaode = entity.getLatGaode(); if (latGaode != null) { stmt.bindString(12, latGaode); } - + String lngBaidu = entity.getLngBaidu(); if (lngBaidu != null) { stmt.bindString(13, lngBaidu); } - + String lngGaode = entity.getLngGaode(); if (lngGaode != null) { stmt.bindString(14, lngGaode); } - + String notes = entity.getNotes(); if (notes != null) { stmt.bindString(15, notes); } - + String photos = entity.getPhotos(); if (photos != null) { stmt.bindString(16, photos); } - + String position = entity.getPosition(); if (position != null) { stmt.bindString(17, position); } - + String staff = entity.getStaff(); if (staff != null) { stmt.bindString(18, staff); } - + String tel = entity.getTel(); if (tel != null) { stmt.bindString(19, tel); } - + String ts = entity.getTs(); if (ts != null) { stmt.bindString(20, ts); } - + String valid = entity.getValid(); if (valid != null) { stmt.bindString(21, valid); } - + String watchData = entity.getWatchData(); if (watchData != null) { stmt.bindString(22, watchData); } - + String wellCode = entity.getWellCode(); if (wellCode != null) { stmt.bindString(23, wellCode); } - + String wellName = entity.getWellName(); if (wellName != null) { stmt.bindString(24, wellName); } - + String wellType = entity.getWellType(); if (wellType != null) { stmt.bindString(25, wellType); } - + String wellTypeName = entity.getWellTypeName(); if (wellTypeName != null) { stmt.bindString(26, wellTypeName); @@ -242,132 +237,132 @@ @Override protected final void bindValues(SQLiteStatement stmt, MapWellLocalBean entity) { stmt.clearBindings(); - + Long kId = entity.getKId(); if (kId != null) { stmt.bindLong(1, kId); } - + String area = entity.getArea(); if (area != null) { stmt.bindString(2, area); } - + String bfzt = entity.getBfzt(); if (bfzt != null) { stmt.bindString(3, bfzt); } - + String bfztName = entity.getBfztName(); if (bfztName != null) { stmt.bindString(4, bfztName); } - + String coordinateX = entity.getCoordinateX(); if (coordinateX != null) { stmt.bindString(5, coordinateX); } - + String coordinateY = entity.getCoordinateY(); if (coordinateY != null) { stmt.bindString(6, coordinateY); } - + String deep = entity.getDeep(); if (deep != null) { stmt.bindString(7, deep); } - + String deptName = entity.getDeptName(); if (deptName != null) { stmt.bindString(8, deptName); } - + String deptid = entity.getDeptid(); if (deptid != null) { stmt.bindString(9, deptid); } - + String id = entity.getId(); if (id != null) { stmt.bindString(10, id); } - + String latBaidu = entity.getLatBaidu(); if (latBaidu != null) { stmt.bindString(11, latBaidu); } - + String latGaode = entity.getLatGaode(); if (latGaode != null) { stmt.bindString(12, latGaode); } - + String lngBaidu = entity.getLngBaidu(); if (lngBaidu != null) { stmt.bindString(13, lngBaidu); } - + String lngGaode = entity.getLngGaode(); if (lngGaode != null) { stmt.bindString(14, lngGaode); } - + String notes = entity.getNotes(); if (notes != null) { stmt.bindString(15, notes); } - + String photos = entity.getPhotos(); if (photos != null) { stmt.bindString(16, photos); } - + String position = entity.getPosition(); if (position != null) { stmt.bindString(17, position); } - + String staff = entity.getStaff(); if (staff != null) { stmt.bindString(18, staff); } - + String tel = entity.getTel(); if (tel != null) { stmt.bindString(19, tel); } - + String ts = entity.getTs(); if (ts != null) { stmt.bindString(20, ts); } - + String valid = entity.getValid(); if (valid != null) { stmt.bindString(21, valid); } - + String watchData = entity.getWatchData(); if (watchData != null) { stmt.bindString(22, watchData); } - + String wellCode = entity.getWellCode(); if (wellCode != null) { stmt.bindString(23, wellCode); } - + String wellName = entity.getWellName(); if (wellName != null) { stmt.bindString(24, wellName); } - + String wellType = entity.getWellType(); if (wellType != null) { stmt.bindString(25, wellType); } - + String wellTypeName = entity.getWellTypeName(); if (wellTypeName != null) { stmt.bindString(26, wellTypeName); @@ -377,41 +372,41 @@ @Override public Long readKey(Cursor cursor, int offset) { return cursor.isNull(offset + 0) ? null : cursor.getLong(offset + 0); - } + } @Override public MapWellLocalBean readEntity(Cursor cursor, int offset) { MapWellLocalBean entity = new MapWellLocalBean( // - cursor.isNull(offset + 0) ? null : cursor.getLong(offset + 0), // kId - cursor.isNull(offset + 1) ? null : cursor.getString(offset + 1), // area - cursor.isNull(offset + 2) ? null : cursor.getString(offset + 2), // bfzt - cursor.isNull(offset + 3) ? null : cursor.getString(offset + 3), // bfztName - cursor.isNull(offset + 4) ? null : cursor.getString(offset + 4), // coordinateX - cursor.isNull(offset + 5) ? null : cursor.getString(offset + 5), // coordinateY - cursor.isNull(offset + 6) ? null : cursor.getString(offset + 6), // deep - cursor.isNull(offset + 7) ? null : cursor.getString(offset + 7), // deptName - cursor.isNull(offset + 8) ? null : cursor.getString(offset + 8), // deptid - cursor.isNull(offset + 9) ? null : cursor.getString(offset + 9), // id - cursor.isNull(offset + 10) ? null : cursor.getString(offset + 10), // latBaidu - cursor.isNull(offset + 11) ? null : cursor.getString(offset + 11), // latGaode - cursor.isNull(offset + 12) ? null : cursor.getString(offset + 12), // lngBaidu - cursor.isNull(offset + 13) ? null : cursor.getString(offset + 13), // lngGaode - cursor.isNull(offset + 14) ? null : cursor.getString(offset + 14), // notes - cursor.isNull(offset + 15) ? null : cursor.getString(offset + 15), // photos - cursor.isNull(offset + 16) ? null : cursor.getString(offset + 16), // position - cursor.isNull(offset + 17) ? null : cursor.getString(offset + 17), // staff - cursor.isNull(offset + 18) ? null : cursor.getString(offset + 18), // tel - cursor.isNull(offset + 19) ? null : cursor.getString(offset + 19), // ts - cursor.isNull(offset + 20) ? null : cursor.getString(offset + 20), // valid - cursor.isNull(offset + 21) ? null : cursor.getString(offset + 21), // watchData - cursor.isNull(offset + 22) ? null : cursor.getString(offset + 22), // wellCode - cursor.isNull(offset + 23) ? null : cursor.getString(offset + 23), // wellName - cursor.isNull(offset + 24) ? null : cursor.getString(offset + 24), // wellType - cursor.isNull(offset + 25) ? null : cursor.getString(offset + 25) // wellTypeName + cursor.isNull(offset + 0) ? null : cursor.getLong(offset + 0), // kId + cursor.isNull(offset + 1) ? null : cursor.getString(offset + 1), // area + cursor.isNull(offset + 2) ? null : cursor.getString(offset + 2), // bfzt + cursor.isNull(offset + 3) ? null : cursor.getString(offset + 3), // bfztName + cursor.isNull(offset + 4) ? null : cursor.getString(offset + 4), // coordinateX + cursor.isNull(offset + 5) ? null : cursor.getString(offset + 5), // coordinateY + cursor.isNull(offset + 6) ? null : cursor.getString(offset + 6), // deep + cursor.isNull(offset + 7) ? null : cursor.getString(offset + 7), // deptName + cursor.isNull(offset + 8) ? null : cursor.getString(offset + 8), // deptid + cursor.isNull(offset + 9) ? null : cursor.getString(offset + 9), // id + cursor.isNull(offset + 10) ? null : cursor.getString(offset + 10), // latBaidu + cursor.isNull(offset + 11) ? null : cursor.getString(offset + 11), // latGaode + cursor.isNull(offset + 12) ? null : cursor.getString(offset + 12), // lngBaidu + cursor.isNull(offset + 13) ? null : cursor.getString(offset + 13), // lngGaode + cursor.isNull(offset + 14) ? null : cursor.getString(offset + 14), // notes + cursor.isNull(offset + 15) ? null : cursor.getString(offset + 15), // photos + cursor.isNull(offset + 16) ? null : cursor.getString(offset + 16), // position + cursor.isNull(offset + 17) ? null : cursor.getString(offset + 17), // staff + cursor.isNull(offset + 18) ? null : cursor.getString(offset + 18), // tel + cursor.isNull(offset + 19) ? null : cursor.getString(offset + 19), // ts + cursor.isNull(offset + 20) ? null : cursor.getString(offset + 20), // valid + cursor.isNull(offset + 21) ? null : cursor.getString(offset + 21), // watchData + cursor.isNull(offset + 22) ? null : cursor.getString(offset + 22), // wellCode + cursor.isNull(offset + 23) ? null : cursor.getString(offset + 23), // wellName + cursor.isNull(offset + 24) ? null : cursor.getString(offset + 24), // wellType + cursor.isNull(offset + 25) ? null : cursor.getString(offset + 25) // wellTypeName ); return entity; } - + @Override public void readEntity(Cursor cursor, MapWellLocalBean entity, int offset) { entity.setKId(cursor.isNull(offset + 0) ? null : cursor.getLong(offset + 0)); @@ -440,17 +435,17 @@ entity.setWellName(cursor.isNull(offset + 23) ? null : cursor.getString(offset + 23)); entity.setWellType(cursor.isNull(offset + 24) ? null : cursor.getString(offset + 24)); entity.setWellTypeName(cursor.isNull(offset + 25) ? null : cursor.getString(offset + 25)); - } - + } + @Override protected final Long updateKeyAfterInsert(MapWellLocalBean entity, long rowId) { entity.setKId(rowId); return rowId; } - + @Override public Long getKey(MapWellLocalBean entity) { - if (entity != null) { + if(entity != null) { return entity.getKId(); } else { return null; @@ -466,5 +461,5 @@ protected final boolean isEntityUpdateable() { return true; } - + } diff --git a/app/src/main/java/com/casic/app/smartwell/greendao/NoticeLocaleBeanDao.java b/app/src/main/java/com/casic/app/smartwell/greendao/NoticeLocaleBeanDao.java index 64312ed..deb2d49 100644 --- a/app/src/main/java/com/casic/app/smartwell/greendao/NoticeLocaleBeanDao.java +++ b/app/src/main/java/com/casic/app/smartwell/greendao/NoticeLocaleBeanDao.java @@ -12,10 +12,9 @@ import org.greenrobot.greendao.internal.DaoConfig; // THIS CODE IS GENERATED BY greenDAO, DO NOT EDIT. - -/** +/** * DAO for table "NOTICE_LOCALE_BEAN". - */ +*/ public class NoticeLocaleBeanDao extends AbstractDao { public static final String TABLENAME = "NOTICE_LOCALE_BEAN"; @@ -43,16 +42,14 @@ public NoticeLocaleBeanDao(DaoConfig config) { super(config); } - + public NoticeLocaleBeanDao(DaoConfig config, DaoSession daoSession) { super(config, daoSession); } - /** - * Creates the underlying database table. - */ + /** Creates the underlying database table. */ public static void createTable(Database db, boolean ifNotExists) { - String constraint = ifNotExists ? "IF NOT EXISTS " : ""; + String constraint = ifNotExists? "IF NOT EXISTS ": ""; db.execSQL("CREATE TABLE " + constraint + "\"NOTICE_LOCALE_BEAN\" (" + // "\"_id\" INTEGER PRIMARY KEY AUTOINCREMENT ," + // 0: id "\"MESSAGE_ID\" TEXT UNIQUE ," + // 1: messageId @@ -68,9 +65,7 @@ "\"NOTICE_TIME\" TEXT);"); // 11: noticeTime } - /** - * Drops the underlying database table. - */ + /** Drops the underlying database table. */ public static void dropTable(Database db, boolean ifExists) { String sql = "DROP TABLE " + (ifExists ? "IF EXISTS " : "") + "\"NOTICE_LOCALE_BEAN\""; db.execSQL(sql); @@ -79,62 +74,62 @@ @Override protected final void bindValues(DatabaseStatement stmt, NoticeLocaleBean entity) { stmt.clearBindings(); - + Long id = entity.getId(); if (id != null) { stmt.bindLong(1, id); } - + String messageId = entity.getMessageId(); if (messageId != null) { stmt.bindString(2, messageId); } - + String appid = entity.getAppid(); if (appid != null) { stmt.bindString(3, appid); } - + String clientId = entity.getClientId(); if (clientId != null) { stmt.bindString(4, clientId); } - + String taskId = entity.getTaskId(); if (taskId != null) { stmt.bindString(5, taskId); } - + String userId = entity.getUserId(); if (userId != null) { stmt.bindString(6, userId); } - + String title = entity.getTitle(); if (title != null) { stmt.bindString(7, title); } - + String content = entity.getContent(); if (content != null) { stmt.bindString(8, content); } - + String deviceCode = entity.getDeviceCode(); if (deviceCode != null) { stmt.bindString(9, deviceCode); } - + String jobId = entity.getJobId(); if (jobId != null) { stmt.bindString(10, jobId); } - + String isRead = entity.getIsRead(); if (isRead != null) { stmt.bindString(11, isRead); } - + String noticeTime = entity.getNoticeTime(); if (noticeTime != null) { stmt.bindString(12, noticeTime); @@ -144,62 +139,62 @@ @Override protected final void bindValues(SQLiteStatement stmt, NoticeLocaleBean entity) { stmt.clearBindings(); - + Long id = entity.getId(); if (id != null) { stmt.bindLong(1, id); } - + String messageId = entity.getMessageId(); if (messageId != null) { stmt.bindString(2, messageId); } - + String appid = entity.getAppid(); if (appid != null) { stmt.bindString(3, appid); } - + String clientId = entity.getClientId(); if (clientId != null) { stmt.bindString(4, clientId); } - + String taskId = entity.getTaskId(); if (taskId != null) { stmt.bindString(5, taskId); } - + String userId = entity.getUserId(); if (userId != null) { stmt.bindString(6, userId); } - + String title = entity.getTitle(); if (title != null) { stmt.bindString(7, title); } - + String content = entity.getContent(); if (content != null) { stmt.bindString(8, content); } - + String deviceCode = entity.getDeviceCode(); if (deviceCode != null) { stmt.bindString(9, deviceCode); } - + String jobId = entity.getJobId(); if (jobId != null) { stmt.bindString(10, jobId); } - + String isRead = entity.getIsRead(); if (isRead != null) { stmt.bindString(11, isRead); } - + String noticeTime = entity.getNoticeTime(); if (noticeTime != null) { stmt.bindString(12, noticeTime); @@ -209,27 +204,27 @@ @Override public Long readKey(Cursor cursor, int offset) { return cursor.isNull(offset + 0) ? null : cursor.getLong(offset + 0); - } + } @Override public NoticeLocaleBean readEntity(Cursor cursor, int offset) { NoticeLocaleBean entity = new NoticeLocaleBean( // - cursor.isNull(offset + 0) ? null : cursor.getLong(offset + 0), // id - cursor.isNull(offset + 1) ? null : cursor.getString(offset + 1), // messageId - cursor.isNull(offset + 2) ? null : cursor.getString(offset + 2), // appid - cursor.isNull(offset + 3) ? null : cursor.getString(offset + 3), // clientId - cursor.isNull(offset + 4) ? null : cursor.getString(offset + 4), // taskId - cursor.isNull(offset + 5) ? null : cursor.getString(offset + 5), // userId - cursor.isNull(offset + 6) ? null : cursor.getString(offset + 6), // title - cursor.isNull(offset + 7) ? null : cursor.getString(offset + 7), // content - cursor.isNull(offset + 8) ? null : cursor.getString(offset + 8), // deviceCode - cursor.isNull(offset + 9) ? null : cursor.getString(offset + 9), // jobId - cursor.isNull(offset + 10) ? null : cursor.getString(offset + 10), // isRead - cursor.isNull(offset + 11) ? null : cursor.getString(offset + 11) // noticeTime + cursor.isNull(offset + 0) ? null : cursor.getLong(offset + 0), // id + cursor.isNull(offset + 1) ? null : cursor.getString(offset + 1), // messageId + cursor.isNull(offset + 2) ? null : cursor.getString(offset + 2), // appid + cursor.isNull(offset + 3) ? null : cursor.getString(offset + 3), // clientId + cursor.isNull(offset + 4) ? null : cursor.getString(offset + 4), // taskId + cursor.isNull(offset + 5) ? null : cursor.getString(offset + 5), // userId + cursor.isNull(offset + 6) ? null : cursor.getString(offset + 6), // title + cursor.isNull(offset + 7) ? null : cursor.getString(offset + 7), // content + cursor.isNull(offset + 8) ? null : cursor.getString(offset + 8), // deviceCode + cursor.isNull(offset + 9) ? null : cursor.getString(offset + 9), // jobId + cursor.isNull(offset + 10) ? null : cursor.getString(offset + 10), // isRead + cursor.isNull(offset + 11) ? null : cursor.getString(offset + 11) // noticeTime ); return entity; } - + @Override public void readEntity(Cursor cursor, NoticeLocaleBean entity, int offset) { entity.setId(cursor.isNull(offset + 0) ? null : cursor.getLong(offset + 0)); @@ -244,17 +239,17 @@ entity.setJobId(cursor.isNull(offset + 9) ? null : cursor.getString(offset + 9)); entity.setIsRead(cursor.isNull(offset + 10) ? null : cursor.getString(offset + 10)); entity.setNoticeTime(cursor.isNull(offset + 11) ? null : cursor.getString(offset + 11)); - } - + } + @Override protected final Long updateKeyAfterInsert(NoticeLocaleBean entity, long rowId) { entity.setId(rowId); return rowId; } - + @Override public Long getKey(NoticeLocaleBean entity) { - if (entity != null) { + if(entity != null) { return entity.getId(); } else { return null; @@ -270,5 +265,5 @@ protected final boolean isEntityUpdateable() { return true; } - + } diff --git a/app/src/main/java/com/casic/app/smartwell/greendao/PipeLocalBeanDao.java b/app/src/main/java/com/casic/app/smartwell/greendao/PipeLocalBeanDao.java index aab4d3f..df5515a 100644 --- a/app/src/main/java/com/casic/app/smartwell/greendao/PipeLocalBeanDao.java +++ b/app/src/main/java/com/casic/app/smartwell/greendao/PipeLocalBeanDao.java @@ -12,10 +12,9 @@ import org.greenrobot.greendao.internal.DaoConfig; // THIS CODE IS GENERATED BY greenDAO, DO NOT EDIT. - -/** +/** * DAO for table "PIPE_LOCAL_BEAN". - */ +*/ public class PipeLocalBeanDao extends AbstractDao { public static final String TABLENAME = "PIPE_LOCAL_BEAN"; @@ -37,16 +36,14 @@ public PipeLocalBeanDao(DaoConfig config) { super(config); } - + public PipeLocalBeanDao(DaoConfig config, DaoSession daoSession) { super(config, daoSession); } - /** - * Creates the underlying database table. - */ + /** Creates the underlying database table. */ public static void createTable(Database db, boolean ifNotExists) { - String constraint = ifNotExists ? "IF NOT EXISTS " : ""; + String constraint = ifNotExists? "IF NOT EXISTS ": ""; db.execSQL("CREATE TABLE " + constraint + "\"PIPE_LOCAL_BEAN\" (" + // "\"_id\" INTEGER PRIMARY KEY AUTOINCREMENT ," + // 0: id "\"PIPE_CODE\" TEXT," + // 1: pipeCode @@ -56,9 +53,7 @@ "\"START_LONGITUDE_GD\" TEXT);"); // 5: startLongitudeGd } - /** - * Drops the underlying database table. - */ + /** Drops the underlying database table. */ public static void dropTable(Database db, boolean ifExists) { String sql = "DROP TABLE " + (ifExists ? "IF EXISTS " : "") + "\"PIPE_LOCAL_BEAN\""; db.execSQL(sql); @@ -67,32 +62,32 @@ @Override protected final void bindValues(DatabaseStatement stmt, PipeLocalBean entity) { stmt.clearBindings(); - + Long id = entity.getId(); if (id != null) { stmt.bindLong(1, id); } - + String pipeCode = entity.getPipeCode(); if (pipeCode != null) { stmt.bindString(2, pipeCode); } - + String endLatitudeGd = entity.getEndLatitudeGd(); if (endLatitudeGd != null) { stmt.bindString(3, endLatitudeGd); } - + String endLongitudeGd = entity.getEndLongitudeGd(); if (endLongitudeGd != null) { stmt.bindString(4, endLongitudeGd); } - + String startLatitudeGd = entity.getStartLatitudeGd(); if (startLatitudeGd != null) { stmt.bindString(5, startLatitudeGd); } - + String startLongitudeGd = entity.getStartLongitudeGd(); if (startLongitudeGd != null) { stmt.bindString(6, startLongitudeGd); @@ -102,32 +97,32 @@ @Override protected final void bindValues(SQLiteStatement stmt, PipeLocalBean entity) { stmt.clearBindings(); - + Long id = entity.getId(); if (id != null) { stmt.bindLong(1, id); } - + String pipeCode = entity.getPipeCode(); if (pipeCode != null) { stmt.bindString(2, pipeCode); } - + String endLatitudeGd = entity.getEndLatitudeGd(); if (endLatitudeGd != null) { stmt.bindString(3, endLatitudeGd); } - + String endLongitudeGd = entity.getEndLongitudeGd(); if (endLongitudeGd != null) { stmt.bindString(4, endLongitudeGd); } - + String startLatitudeGd = entity.getStartLatitudeGd(); if (startLatitudeGd != null) { stmt.bindString(5, startLatitudeGd); } - + String startLongitudeGd = entity.getStartLongitudeGd(); if (startLongitudeGd != null) { stmt.bindString(6, startLongitudeGd); @@ -137,21 +132,21 @@ @Override public Long readKey(Cursor cursor, int offset) { return cursor.isNull(offset + 0) ? null : cursor.getLong(offset + 0); - } + } @Override public PipeLocalBean readEntity(Cursor cursor, int offset) { PipeLocalBean entity = new PipeLocalBean( // - cursor.isNull(offset + 0) ? null : cursor.getLong(offset + 0), // id - cursor.isNull(offset + 1) ? null : cursor.getString(offset + 1), // pipeCode - cursor.isNull(offset + 2) ? null : cursor.getString(offset + 2), // endLatitudeGd - cursor.isNull(offset + 3) ? null : cursor.getString(offset + 3), // endLongitudeGd - cursor.isNull(offset + 4) ? null : cursor.getString(offset + 4), // startLatitudeGd - cursor.isNull(offset + 5) ? null : cursor.getString(offset + 5) // startLongitudeGd + cursor.isNull(offset + 0) ? null : cursor.getLong(offset + 0), // id + cursor.isNull(offset + 1) ? null : cursor.getString(offset + 1), // pipeCode + cursor.isNull(offset + 2) ? null : cursor.getString(offset + 2), // endLatitudeGd + cursor.isNull(offset + 3) ? null : cursor.getString(offset + 3), // endLongitudeGd + cursor.isNull(offset + 4) ? null : cursor.getString(offset + 4), // startLatitudeGd + cursor.isNull(offset + 5) ? null : cursor.getString(offset + 5) // startLongitudeGd ); return entity; } - + @Override public void readEntity(Cursor cursor, PipeLocalBean entity, int offset) { entity.setId(cursor.isNull(offset + 0) ? null : cursor.getLong(offset + 0)); @@ -160,17 +155,17 @@ entity.setEndLongitudeGd(cursor.isNull(offset + 3) ? null : cursor.getString(offset + 3)); entity.setStartLatitudeGd(cursor.isNull(offset + 4) ? null : cursor.getString(offset + 4)); entity.setStartLongitudeGd(cursor.isNull(offset + 5) ? null : cursor.getString(offset + 5)); - } - + } + @Override protected final Long updateKeyAfterInsert(PipeLocalBean entity, long rowId) { entity.setId(rowId); return rowId; } - + @Override public Long getKey(PipeLocalBean entity) { - if (entity != null) { + if(entity != null) { return entity.getId(); } else { return null; @@ -186,5 +181,5 @@ protected final boolean isEntityUpdateable() { return true; } - + } diff --git a/app/src/main/java/com/casic/app/smartwell/view/ChangePasswordActivity.kt b/app/src/main/java/com/casic/app/smartwell/view/ChangePasswordActivity.kt index 8e41039..9f1dd40 100644 --- a/app/src/main/java/com/casic/app/smartwell/view/ChangePasswordActivity.kt +++ b/app/src/main/java/com/casic/app/smartwell/view/ChangePasswordActivity.kt @@ -14,7 +14,7 @@ import com.pengxh.kt.lite.extensions.show import com.pengxh.kt.lite.utils.ActivityStackManager import com.pengxh.kt.lite.utils.LoadState -import com.pengxh.kt.lite.utils.LoadingDialogHub +import com.pengxh.kt.lite.utils.LoadingDialog import com.pengxh.kt.lite.widget.TitleBarView import java.nio.charset.StandardCharsets @@ -46,15 +46,15 @@ override fun observeRequestState() { userViewModel.loadState.observe(this) { when (it) { - is LoadState.Loading -> LoadingDialogHub.show(this, "修改中,请稍后") + is LoadState.Loading -> LoadingDialog.show(this, "修改中,请稍后") is LoadState.Success -> { - LoadingDialogHub.dismiss() + LoadingDialog.dismiss() AuthenticationHelper.removeToken() this.navigatePageTo() ActivityStackManager.finishAllActivity() } - else -> LoadingDialogHub.dismiss() + else -> LoadingDialog.dismiss() } } } diff --git a/app/src/main/java/com/casic/app/smartwell/view/DeployedWellActivity.kt b/app/src/main/java/com/casic/app/smartwell/view/DeployedWellActivity.kt index fb4339c..28a5078 100644 --- a/app/src/main/java/com/casic/app/smartwell/view/DeployedWellActivity.kt +++ b/app/src/main/java/com/casic/app/smartwell/view/DeployedWellActivity.kt @@ -83,8 +83,8 @@ } //添加分割线 - binding.deployedListView.addItemDecoration( - RecyclerViewItemOffsets(0, 5, 0, 5) + binding.recyclerView.addItemDecoration( + RecyclerViewItemOffsets(0, 7, 0, 7) ) } @@ -149,12 +149,11 @@ } else { item.deep.toString() + "m" } - viewHolder.setText(R.id.wellNameView, item.wellName) + viewHolder.setText(R.id.wellTypeView, item.wellTypeName) .setText(R.id.wellDepthView, "深:${deep}") .setText(R.id.wellCodeView, "点位编号:${item.wellCode}") - .setText(R.id.wellTypeView, "点位类型:${item.wellTypeName}") .setText(R.id.ownerShipView, "权属单位:${item.deptName}") - .setText(R.id.wellLocationView, "点位置:${item.position}") + .setText(R.id.wellLocationView, "点位位置:${item.position}") .setOnClickListener( R.id.operationButton, object : View.OnClickListener { override fun onClick(v: View?) { @@ -207,7 +206,7 @@ }) } } - binding.deployedListView.adapter = deployAdapter + binding.recyclerView.adapter = deployAdapter deployAdapter.setOnItemClickedListener(object : NormalRecyclerAdapter.OnItemClickedListener { override fun onItemClicked(position: Int, t: WellListModel.DataBean.RowsBean) { diff --git a/app/src/main/java/com/casic/app/smartwell/view/LoginActivity.kt b/app/src/main/java/com/casic/app/smartwell/view/LoginActivity.kt index e4bb0e3..834527b 100644 --- a/app/src/main/java/com/casic/app/smartwell/view/LoginActivity.kt +++ b/app/src/main/java/com/casic/app/smartwell/view/LoginActivity.kt @@ -21,7 +21,7 @@ import com.pengxh.kt.lite.extensions.navigatePageTo import com.pengxh.kt.lite.extensions.readAssetsFile import com.pengxh.kt.lite.extensions.show -import com.pengxh.kt.lite.utils.LoadingDialogHub +import com.pengxh.kt.lite.utils.LoadingDialog import com.pengxh.kt.lite.utils.SaveKeyValues import kotlinx.coroutines.Dispatchers import kotlinx.coroutines.launch @@ -106,11 +106,11 @@ override fun observeRequestState() { authenticateViewModel.loadState.observe(this) { - LoadingDialogHub.show(this, "登录中,请稍后") + LoadingDialog.show(this, "登录中,请稍后") } loginViewModel.loadState.observe(this) { - LoadingDialogHub.dismiss() + LoadingDialog.dismiss() } } diff --git a/app/src/main/java/com/casic/app/smartwell/view/OrderCompletedDetailActivity.kt b/app/src/main/java/com/casic/app/smartwell/view/OrderCompletedDetailActivity.kt index db8ad1f..75cd905 100644 --- a/app/src/main/java/com/casic/app/smartwell/view/OrderCompletedDetailActivity.kt +++ b/app/src/main/java/com/casic/app/smartwell/view/OrderCompletedDetailActivity.kt @@ -17,7 +17,7 @@ import com.pengxh.kt.lite.extensions.show import com.pengxh.kt.lite.utils.Constant import com.pengxh.kt.lite.utils.LoadState -import com.pengxh.kt.lite.utils.LoadingDialogHub +import com.pengxh.kt.lite.utils.LoadingDialog import com.pengxh.kt.lite.widget.TitleBarView import com.pengxh.kt.lite.widget.dialog.AlertMessageDialog @@ -44,7 +44,7 @@ } override fun initOnCreate(savedInstanceState: Bundle?) { - val jobId = intent.getStringExtra(Constant.INTENT_PARAM)!! + val jobId = intent.getStringExtra(Constant.INTENT_PARAM_KEY)!! orderViewModel = ViewModelProvider(this)[OrderViewModel::class.java] orderViewModel.getWorkOrderDetail(jobId) orderViewModel.detailModel.observe(this) { @@ -154,8 +154,8 @@ override fun observeRequestState() { orderViewModel.loadState.observe(this) { when (it) { - is LoadState.Loading -> LoadingDialogHub.show(this, "数据加载中,请稍后") - else -> LoadingDialogHub.dismiss() + is LoadState.Loading -> LoadingDialog.show(this, "数据加载中,请稍后") + else -> LoadingDialog.dismiss() } } } diff --git a/app/src/main/java/com/casic/app/smartwell/view/OrderInHandleDetailActivity.kt b/app/src/main/java/com/casic/app/smartwell/view/OrderInHandleDetailActivity.kt index d70a979..04a7d5d 100644 --- a/app/src/main/java/com/casic/app/smartwell/view/OrderInHandleDetailActivity.kt +++ b/app/src/main/java/com/casic/app/smartwell/view/OrderInHandleDetailActivity.kt @@ -38,7 +38,7 @@ import com.pengxh.kt.lite.extensions.show import com.pengxh.kt.lite.utils.Constant import com.pengxh.kt.lite.utils.LoadState -import com.pengxh.kt.lite.utils.LoadingDialogHub +import com.pengxh.kt.lite.utils.LoadingDialog import com.pengxh.kt.lite.widget.TitleBarView import com.pengxh.kt.lite.widget.dialog.AlertControlDialog import com.pengxh.kt.lite.widget.dialog.AlertMessageDialog @@ -93,7 +93,7 @@ ) binding.addImageRecyclerView.adapter = imageAdapter - val jobId = intent.getStringExtra(Constant.INTENT_PARAM)!!//初始化图片九宫格 + val jobId = intent.getStringExtra(Constant.INTENT_PARAM_KEY)!!//初始化图片九宫格 orderViewModel.getWorkOrderDetail(jobId) orderViewModel.detailModel.observe(this) { if (it.code == 200) { @@ -312,41 +312,41 @@ override fun observeRequestState() { orderViewModel.loadState.observe(this) { when (it) { - is LoadState.Loading -> LoadingDialogHub.show(this, "数据加载中,请稍后") - else -> LoadingDialogHub.dismiss() + is LoadState.Loading -> LoadingDialog.show(this, "数据加载中,请稍后") + else -> LoadingDialog.dismiss() } } uploadImageViewModel.loadState.observe(this) { when (it) { - LoadState.Loading -> LoadingDialogHub.show(this, "图片上传中,请稍后...") - else -> LoadingDialogHub.dismiss() + LoadState.Loading -> LoadingDialog.show(this, "图片上传中,请稍后...") + else -> LoadingDialog.dismiss() } } //转单状态处理 operationViewModel.loadState.observe(this) { when (it) { - is LoadState.Loading -> LoadingDialogHub.show(this, "转单中,请稍后") + is LoadState.Loading -> LoadingDialog.show(this, "转单中,请稍后") is LoadState.Success -> { - LoadingDialogHub.dismiss() + LoadingDialog.dismiss() this.finish() } - else -> LoadingDialogHub.dismiss() + else -> LoadingDialog.dismiss() } } //处理完成工单状态处理 operationViewModel.loadState.observe(this) { when (it) { - is LoadState.Loading -> LoadingDialogHub.show(this, "处理中,请稍后") + is LoadState.Loading -> LoadingDialog.show(this, "处理中,请稍后") is LoadState.Success -> { - LoadingDialogHub.dismiss() + LoadingDialog.dismiss() this.finish() } - else -> LoadingDialogHub.dismiss() + else -> LoadingDialog.dismiss() } } } diff --git a/app/src/main/java/com/casic/app/smartwell/view/OrderNotConfirmedDetailActivity.kt b/app/src/main/java/com/casic/app/smartwell/view/OrderNotConfirmedDetailActivity.kt index 8e036d2..687ec86 100644 --- a/app/src/main/java/com/casic/app/smartwell/view/OrderNotConfirmedDetailActivity.kt +++ b/app/src/main/java/com/casic/app/smartwell/view/OrderNotConfirmedDetailActivity.kt @@ -36,7 +36,7 @@ import com.pengxh.kt.lite.extensions.show import com.pengxh.kt.lite.utils.Constant import com.pengxh.kt.lite.utils.LoadState -import com.pengxh.kt.lite.utils.LoadingDialogHub +import com.pengxh.kt.lite.utils.LoadingDialog import com.pengxh.kt.lite.widget.TitleBarView import com.pengxh.kt.lite.widget.dialog.AlertControlDialog import com.pengxh.kt.lite.widget.dialog.AlertMessageDialog @@ -80,7 +80,7 @@ } override fun initOnCreate(savedInstanceState: Bundle?) { - val jobId = intent.getStringExtra(Constant.INTENT_PARAM)!! + val jobId = intent.getStringExtra(Constant.INTENT_PARAM_KEY)!! //初始化图片九宫格 //左外边距,左内边距,右内边距,右外边距 val viewWidth = getScreenWidth() - (10 + 10 + 10 + 10).dp2px(this) @@ -263,41 +263,41 @@ //数据加载状态处理 orderViewModel.loadState.observe(this) { when (it) { - is LoadState.Loading -> LoadingDialogHub.show(this, "数据加载中,请稍后") - else -> LoadingDialogHub.dismiss() + is LoadState.Loading -> LoadingDialog.show(this, "数据加载中,请稍后") + else -> LoadingDialog.dismiss() } } uploadImageViewModel.loadState.observe(this) { when (it) { - LoadState.Loading -> LoadingDialogHub.show(this, "图片上传中,请稍后") - else -> LoadingDialogHub.dismiss() + LoadState.Loading -> LoadingDialog.show(this, "图片上传中,请稍后") + else -> LoadingDialog.dismiss() } } //转单状态处理 operationViewModel.loadState.observe(this) { when (it) { - is LoadState.Loading -> LoadingDialogHub.show(this, "转单中,请稍后") + is LoadState.Loading -> LoadingDialog.show(this, "转单中,请稍后") is LoadState.Success -> { - LoadingDialogHub.dismiss() + LoadingDialog.dismiss() this.finish() } - else -> LoadingDialogHub.dismiss() + else -> LoadingDialog.dismiss() } } //确认工单状态处理 operationViewModel.loadState.observe(this) { when (it) { - is LoadState.Loading -> LoadingDialogHub.show(this, "处理中,请稍后") + is LoadState.Loading -> LoadingDialog.show(this, "处理中,请稍后") is LoadState.Success -> { - LoadingDialogHub.dismiss() + LoadingDialog.dismiss() this.finish() } - else -> LoadingDialogHub.dismiss() + else -> LoadingDialog.dismiss() } } } diff --git a/app/build.gradle b/app/build.gradle index 296fb6f..c18c251 100644 --- a/app/build.gradle +++ b/app/build.gradle @@ -40,10 +40,6 @@ // VIVO 相关应用参数 VIVO_APP_ID : "105749048", VIVO_APP_KEY : "e460fbf2c689e0f8c58ecc6aa62e1803", - - // 小米相关应用参数 -// XIAOMI_APP_ID : "", -// XIAOMI_APP_KEY : "", ] // 版本名后面添加一句话,意思就是flavor dimension 它的维度就是该版本号,多渠道打包很重要 @@ -107,7 +103,7 @@ dependencies { implementation fileTree(dir: 'libs', include: ['*.jar']) //基础依赖库 - implementation 'com.github.AndroidCoderPeng:Kotlin-lite-lib:1.0.10' + implementation 'com.github.AndroidCoderPeng:Kotlin-lite-lib:1.1.0' implementation 'androidx.appcompat:appcompat:1.6.1' implementation 'androidx.core:core-ktx:1.9.0' implementation 'androidx.constraintlayout:constraintlayout:2.1.4' @@ -165,8 +161,6 @@ implementation 'commons-codec:commons-codec:1.15' implementation 'com.android.support:support-annotations:28.0.0' implementation 'com.assist-v3:vivo:3.1.2' // vivo -// implementation 'com.getui.opt:xmp:3.3.1' // 小米 - //数据库框架 implementation 'org.greenrobot:greendao:3.3.0' //数据库升级 diff --git a/app/src/main/AndroidManifest.xml b/app/src/main/AndroidManifest.xml index c0af158..e0519bf 100644 --- a/app/src/main/AndroidManifest.xml +++ b/app/src/main/AndroidManifest.xml @@ -90,10 +90,10 @@ - + + android:value="ee96d8b5e12de3fbb29949efd57418a8" /> () @@ -150,7 +158,7 @@ val cameraPosition = CameraPosition(centerLatLng, 14f, 0f, 0f) val cameraUpdate = CameraUpdateFactory.newCameraPosition(cameraPosition) withContext(Dispatchers.Main) { - LoadingDialogHub.dismiss() + LoadingDialog.dismiss() aMap.animateCamera(cameraUpdate, 1500, null) } } @@ -239,11 +247,6 @@ } override fun initEvent() { - binding.rightOptionView.setOnClickListener { - val x = binding.rightOptionView.width - easyPopupWindow.width - easyPopupWindow.showAsDropDown(binding.rightOptionView, x, 0) - } - //撤防点位 binding.unDeployedLayout.setOnClickListener { requireContext().navigatePageTo() @@ -263,11 +266,11 @@ override fun observeRequestState() { wellViewModel.loadState.observe(this) { when (it) { - is LoadState.Loading -> LoadingDialogHub.show( + is LoadState.Loading -> LoadingDialog.show( requireActivity(), "数据加载中,请稍后..." ) - else -> LoadingDialogHub.dismiss() + else -> LoadingDialog.dismiss() } } } @@ -376,7 +379,7 @@ }).build().show() } }) - infoPopup.showAsDropDown(binding.rightOptionView) +// infoPopup.showAsDropDown(binding.rightOptionView) } override fun onCameraChange(p0: CameraPosition?) { diff --git a/app/src/main/java/com/casic/app/smartwell/fragment/HomePageNoClusterFragment.kt b/app/src/main/java/com/casic/app/smartwell/fragment/HomePageNoClusterFragment.kt index 802426a..b25f743 100644 --- a/app/src/main/java/com/casic/app/smartwell/fragment/HomePageNoClusterFragment.kt +++ b/app/src/main/java/com/casic/app/smartwell/fragment/HomePageNoClusterFragment.kt @@ -38,8 +38,9 @@ import com.pengxh.kt.lite.extensions.navigatePageTo import com.pengxh.kt.lite.extensions.show import com.pengxh.kt.lite.utils.LoadState -import com.pengxh.kt.lite.utils.LoadingDialogHub +import com.pengxh.kt.lite.utils.LoadingDialog import com.pengxh.kt.lite.widget.EasyPopupWindow +import com.pengxh.kt.lite.widget.TitleBarView import com.pengxh.kt.lite.widget.dialog.AlertControlDialog import kotlinx.coroutines.Dispatchers import kotlinx.coroutines.launch @@ -78,7 +79,15 @@ override fun setupTopBarLayout() { binding.rootView.initImmersionBar(this, false, R.color.mainThemeColor) - binding.titleView.text = "首页" + binding.titleView.setOnClickListener(object : TitleBarView.OnClickListener { + override fun onLeftClick() { + + } + + override fun onRightClick() { + easyPopupWindow.showAsDropDown(binding.titleView, binding.titleView.width, 0) + } + }) } override fun initOnCreate(savedInstanceState: Bundle?) { @@ -112,7 +121,7 @@ //渲染井位置 lifecycleScope.launch(Dispatchers.Main) { - LoadingDialogHub.show(requireActivity(), "数据加载中,请稍后") + LoadingDialog.show(requireActivity(), "数据加载中,请稍后") withContext(Dispatchers.IO) { //取Well缓存 val allMarkerOptions = ArrayList() @@ -144,7 +153,7 @@ val cameraPosition = CameraPosition(centerLatLng, 14f, 0f, 0f) val cameraUpdate = CameraUpdateFactory.newCameraPosition(cameraPosition) withContext(Dispatchers.Main) { - LoadingDialogHub.dismiss() + LoadingDialog.dismiss() aMap.animateCamera(cameraUpdate, 1500, null) } } @@ -238,11 +247,6 @@ } override fun initEvent() { - binding.rightOptionView.setOnClickListener { - val x = binding.rightOptionView.width - easyPopupWindow.width - easyPopupWindow.showAsDropDown(binding.rightOptionView, x, 0) - } - //撤防点位 binding.unDeployedLayout.setOnClickListener { requireContext().navigatePageTo() @@ -262,11 +266,11 @@ override fun observeRequestState() { wellViewModel.loadState.observe(this) { when (it) { - is LoadState.Loading -> LoadingDialogHub.show( + is LoadState.Loading -> LoadingDialog.show( requireActivity(), "数据加载中,请稍后..." ) - else -> LoadingDialogHub.dismiss() + else -> LoadingDialog.dismiss() } } } diff --git a/app/src/main/java/com/casic/app/smartwell/fragment/MinePageFragment.kt b/app/src/main/java/com/casic/app/smartwell/fragment/MinePageFragment.kt index 09a570c..dcb48f8 100644 --- a/app/src/main/java/com/casic/app/smartwell/fragment/MinePageFragment.kt +++ b/app/src/main/java/com/casic/app/smartwell/fragment/MinePageFragment.kt @@ -35,7 +35,7 @@ import com.pengxh.kt.lite.utils.ActivityStackManager import com.pengxh.kt.lite.utils.FileDownloadManager import com.pengxh.kt.lite.utils.LoadState -import com.pengxh.kt.lite.utils.LoadingDialogHub +import com.pengxh.kt.lite.utils.LoadingDialog import com.pengxh.kt.lite.widget.dialog.AlertControlDialog import com.pengxh.kt.lite.widget.dialog.BottomActionSheet import kotlinx.coroutines.Dispatchers @@ -60,7 +60,6 @@ override fun setupTopBarLayout() { binding.rootView.initImmersionBar(this, false, R.color.mainThemeColor) - binding.titleInclude.titleView.text = "我的" } override fun initOnCreate(savedInstanceState: Bundle?) { @@ -155,27 +154,27 @@ override fun observeRequestState() { userViewModel.loadState.observe(this) { when (it) { - is LoadState.Loading -> LoadingDialogHub.show( + is LoadState.Loading -> LoadingDialog.show( requireActivity(), "检查版本中,请稍后" ) - else -> LoadingDialogHub.dismiss() + else -> LoadingDialog.dismiss() } } wellViewModel.loadState.observe(this) { when (it) { - is LoadState.Loading -> LoadingDialogHub.show( + is LoadState.Loading -> LoadingDialog.show( requireActivity(), "数据更新中,请稍后" ) is LoadState.Fail -> { - LoadingDialogHub.dismiss() + LoadingDialog.dismiss() "数据更新超时".show(requireContext()) } else -> { - LoadingDialogHub.dismiss() + LoadingDialog.dismiss() AlertControlDialog.Builder().setContext(requireContext()).setTitle("温馨提示") .setMessage("数据更新成功,请重启应用").setNegativeButton("取消") .setPositiveButton("确定").setOnDialogButtonClickListener(object : @@ -197,17 +196,17 @@ lineViewModel.loadState.observe(this) { when (it) { - is LoadState.Loading -> LoadingDialogHub.show( + is LoadState.Loading -> LoadingDialog.show( requireActivity(), "数据更新中,请稍后" ) is LoadState.Fail -> { - LoadingDialogHub.dismiss() + LoadingDialog.dismiss() "数据更新超时".show(requireContext()) } else -> { - LoadingDialogHub.dismiss() + LoadingDialog.dismiss() AlertControlDialog.Builder().setContext(requireContext()).setTitle("温馨提示") .setMessage("数据更新成功,请重启应用").setNegativeButton("取消") .setPositiveButton("确定").setOnDialogButtonClickListener(object : diff --git a/app/src/main/java/com/casic/app/smartwell/fragment/NoticePageFragment.kt b/app/src/main/java/com/casic/app/smartwell/fragment/NoticePageFragment.kt index 171b555..3c93f54 100644 --- a/app/src/main/java/com/casic/app/smartwell/fragment/NoticePageFragment.kt +++ b/app/src/main/java/com/casic/app/smartwell/fragment/NoticePageFragment.kt @@ -48,7 +48,6 @@ override fun setupTopBarLayout() { binding.rootView.initImmersionBar(this, false, R.color.mainThemeColor) - binding.titleInclude.titleView.text = "消息" } override fun initOnCreate(savedInstanceState: Bundle?) { diff --git a/app/src/main/java/com/casic/app/smartwell/fragment/OrderListFragment.kt b/app/src/main/java/com/casic/app/smartwell/fragment/OrderListFragment.kt index 93ff35b..5e38acb 100644 --- a/app/src/main/java/com/casic/app/smartwell/fragment/OrderListFragment.kt +++ b/app/src/main/java/com/casic/app/smartwell/fragment/OrderListFragment.kt @@ -12,6 +12,7 @@ import com.casic.app.smartwell.view.SearchOrderActivity import com.pengxh.kt.lite.base.KotlinBaseFragment import com.pengxh.kt.lite.extensions.navigatePageTo +import com.pengxh.kt.lite.widget.TitleBarView class OrderListFragment : KotlinBaseFragment() { @@ -25,15 +26,22 @@ } override fun initViewBinding( - inflater: LayoutInflater, - container: ViewGroup? + inflater: LayoutInflater, container: ViewGroup? ): FragmentOrderBinding { return FragmentOrderBinding.inflate(inflater, container, false) } override fun setupTopBarLayout() { binding.rootView.initImmersionBar(this, false, R.color.mainThemeColor) - binding.titleView.text = "工单" + binding.titleView.setOnClickListener(object : TitleBarView.OnClickListener { + override fun onLeftClick() { + + } + + override fun onRightClick() { + requireContext().navigatePageTo() + } + }) } override fun initOnCreate(savedInstanceState: Bundle?) { @@ -51,8 +59,6 @@ } override fun initEvent() { - binding.rightOptionView.setOnClickListener { - requireContext().navigatePageTo() - } + } } \ No newline at end of file diff --git a/app/src/main/java/com/casic/app/smartwell/fragment/OrderNotProcessedFragment.kt b/app/src/main/java/com/casic/app/smartwell/fragment/OrderNotProcessedFragment.kt index 0b3d09d..2b6f21d 100644 --- a/app/src/main/java/com/casic/app/smartwell/fragment/OrderNotProcessedFragment.kt +++ b/app/src/main/java/com/casic/app/smartwell/fragment/OrderNotProcessedFragment.kt @@ -18,7 +18,7 @@ import com.pengxh.kt.lite.extensions.navigatePageTo import com.pengxh.kt.lite.extensions.show import com.pengxh.kt.lite.utils.LoadState -import com.pengxh.kt.lite.utils.LoadingDialogHub +import com.pengxh.kt.lite.utils.LoadingDialog import com.pengxh.kt.lite.utils.WeakReferenceHandler import com.pengxh.kt.lite.widget.dialog.AlertControlDialog @@ -78,8 +78,8 @@ operationViewModel = ViewModelProvider(this)[OperationViewModel::class.java] - binding.notProcessedView.addItemDecoration( - RecyclerViewItemOffsets(0, 5, 0, 5) + binding.recyclerView.addItemDecoration( + RecyclerViewItemOffsets(0, 7, 0, 7) ) } @@ -87,9 +87,9 @@ //接单状态处理 operationViewModel.loadState.observe(this) { when (it) { - is LoadState.Loading -> LoadingDialogHub.show(requireActivity(), "接单中,请稍后") + is LoadState.Loading -> LoadingDialog.show(requireActivity(), "接单中,请稍后") is LoadState.Success -> { - LoadingDialogHub.dismiss() + LoadingDialog.dismiss() //接单成功之后刷新列表 dataBeans.removeAt(clickedPosition) notProcessedAdapter.notifyItemRemoved(clickedPosition) @@ -98,7 +98,7 @@ ) } - else -> LoadingDialogHub.dismiss() + else -> LoadingDialog.dismiss() } } } @@ -131,7 +131,7 @@ } else { binding.emptyInclude.emptyView.hide() notProcessedAdapter = OrderNotProcessedAdapter(requireContext(), dataBeans) - binding.notProcessedView.adapter = notProcessedAdapter + binding.recyclerView.adapter = notProcessedAdapter notProcessedAdapter.setOnItemClickListener(object : OrderNotProcessedAdapter.OnItemClickListener { override fun onClicked(position: Int) { diff --git a/app/src/main/java/com/casic/app/smartwell/fragment/OvertimeNotAcceptFragment.kt b/app/src/main/java/com/casic/app/smartwell/fragment/OvertimeNotAcceptFragment.kt index a198545..9b318ca 100644 --- a/app/src/main/java/com/casic/app/smartwell/fragment/OvertimeNotAcceptFragment.kt +++ b/app/src/main/java/com/casic/app/smartwell/fragment/OvertimeNotAcceptFragment.kt @@ -18,7 +18,7 @@ import com.pengxh.kt.lite.extensions.navigatePageTo import com.pengxh.kt.lite.extensions.show import com.pengxh.kt.lite.utils.LoadState -import com.pengxh.kt.lite.utils.LoadingDialogHub +import com.pengxh.kt.lite.utils.LoadingDialog import com.pengxh.kt.lite.utils.WeakReferenceHandler import com.pengxh.kt.lite.widget.dialog.AlertControlDialog @@ -81,8 +81,8 @@ operationViewModel = ViewModelProvider(this)[OperationViewModel::class.java] - binding.notProcessedView.addItemDecoration( - RecyclerViewItemOffsets(0, 5, 0, 5) + binding.recyclerView.addItemDecoration( + RecyclerViewItemOffsets(0, 7, 0, 7) ) } @@ -90,9 +90,9 @@ //接单状态处理 operationViewModel.loadState.observe(this) { when (it) { - is LoadState.Loading -> LoadingDialogHub.show(requireActivity(), "接单中,请稍后") + is LoadState.Loading -> LoadingDialog.show(requireActivity(), "接单中,请稍后") is LoadState.Success -> { - LoadingDialogHub.dismiss() + LoadingDialog.dismiss() //接单成功之后刷新列表 dataBeans.removeAt(clickedPosition) notProcessedAdapter.notifyItemRemoved(clickedPosition) @@ -101,7 +101,7 @@ ) } - else -> LoadingDialogHub.dismiss() + else -> LoadingDialog.dismiss() } } } @@ -134,7 +134,7 @@ } else { binding.emptyInclude.emptyView.hide() notProcessedAdapter = OrderNotProcessedAdapter(requireContext(), dataBeans) - binding.notProcessedView.adapter = notProcessedAdapter + binding.recyclerView.adapter = notProcessedAdapter notProcessedAdapter.setOnItemClickListener(object : OrderNotProcessedAdapter.OnItemClickListener { override fun onClicked(position: Int) { diff --git a/app/src/main/java/com/casic/app/smartwell/greendao/DaoMaster.java b/app/src/main/java/com/casic/app/smartwell/greendao/DaoMaster.java index fdcf3a7..1e52b74 100644 --- a/app/src/main/java/com/casic/app/smartwell/greendao/DaoMaster.java +++ b/app/src/main/java/com/casic/app/smartwell/greendao/DaoMaster.java @@ -13,25 +13,20 @@ // THIS CODE IS GENERATED BY greenDAO, DO NOT EDIT. - /** * Master of DAO (schema version 4): knows all DAOs. */ public class DaoMaster extends AbstractDaoMaster { public static final int SCHEMA_VERSION = 4; - /** - * Creates underlying database table using DAOs. - */ + /** Creates underlying database table using DAOs. */ public static void createAllTables(Database db, boolean ifNotExists) { MapWellLocalBeanDao.createTable(db, ifNotExists); NoticeLocaleBeanDao.createTable(db, ifNotExists); PipeLocalBeanDao.createTable(db, ifNotExists); } - /** - * Drops underlying database table using DAOs. - */ + /** Drops underlying database table using DAOs. */ public static void dropAllTables(Database db, boolean ifExists) { MapWellLocalBeanDao.dropTable(db, ifExists); NoticeLocaleBeanDao.dropTable(db, ifExists); @@ -86,9 +81,7 @@ } } - /** - * WARNING: Drops all table on Upgrade! Use only during development. - */ + /** WARNING: Drops all table on Upgrade! Use only during development. */ public static class DevOpenHelper extends OpenHelper { public DevOpenHelper(Context context, String name) { super(context, name); diff --git a/app/src/main/java/com/casic/app/smartwell/greendao/DaoSession.java b/app/src/main/java/com/casic/app/smartwell/greendao/DaoSession.java index 0b36d17..3e40e3b 100644 --- a/app/src/main/java/com/casic/app/smartwell/greendao/DaoSession.java +++ b/app/src/main/java/com/casic/app/smartwell/greendao/DaoSession.java @@ -16,7 +16,7 @@ /** * {@inheritDoc} - * + * * @see org.greenrobot.greendao.AbstractDaoSession */ public class DaoSession extends AbstractDaoSession { @@ -50,7 +50,7 @@ registerDao(NoticeLocaleBean.class, noticeLocaleBeanDao); registerDao(PipeLocalBean.class, pipeLocalBeanDao); } - + public void clear() { mapWellLocalBeanDaoConfig.clearIdentityScope(); noticeLocaleBeanDaoConfig.clearIdentityScope(); diff --git a/app/src/main/java/com/casic/app/smartwell/greendao/MapWellLocalBeanDao.java b/app/src/main/java/com/casic/app/smartwell/greendao/MapWellLocalBeanDao.java index 8908fda..407bc92 100644 --- a/app/src/main/java/com/casic/app/smartwell/greendao/MapWellLocalBeanDao.java +++ b/app/src/main/java/com/casic/app/smartwell/greendao/MapWellLocalBeanDao.java @@ -12,10 +12,9 @@ import org.greenrobot.greendao.internal.DaoConfig; // THIS CODE IS GENERATED BY greenDAO, DO NOT EDIT. - -/** +/** * DAO for table "MAP_WELL_LOCAL_BEAN". - */ +*/ public class MapWellLocalBeanDao extends AbstractDao { public static final String TABLENAME = "MAP_WELL_LOCAL_BEAN"; @@ -57,16 +56,14 @@ public MapWellLocalBeanDao(DaoConfig config) { super(config); } - + public MapWellLocalBeanDao(DaoConfig config, DaoSession daoSession) { super(config, daoSession); } - /** - * Creates the underlying database table. - */ + /** Creates the underlying database table. */ public static void createTable(Database db, boolean ifNotExists) { - String constraint = ifNotExists ? "IF NOT EXISTS " : ""; + String constraint = ifNotExists? "IF NOT EXISTS ": ""; db.execSQL("CREATE TABLE " + constraint + "\"MAP_WELL_LOCAL_BEAN\" (" + // "\"_id\" INTEGER PRIMARY KEY AUTOINCREMENT ," + // 0: kId "\"AREA\" TEXT," + // 1: area @@ -96,9 +93,7 @@ "\"WELL_TYPE_NAME\" TEXT);"); // 25: wellTypeName } - /** - * Drops the underlying database table. - */ + /** Drops the underlying database table. */ public static void dropTable(Database db, boolean ifExists) { String sql = "DROP TABLE " + (ifExists ? "IF EXISTS " : "") + "\"MAP_WELL_LOCAL_BEAN\""; db.execSQL(sql); @@ -107,132 +102,132 @@ @Override protected final void bindValues(DatabaseStatement stmt, MapWellLocalBean entity) { stmt.clearBindings(); - + Long kId = entity.getKId(); if (kId != null) { stmt.bindLong(1, kId); } - + String area = entity.getArea(); if (area != null) { stmt.bindString(2, area); } - + String bfzt = entity.getBfzt(); if (bfzt != null) { stmt.bindString(3, bfzt); } - + String bfztName = entity.getBfztName(); if (bfztName != null) { stmt.bindString(4, bfztName); } - + String coordinateX = entity.getCoordinateX(); if (coordinateX != null) { stmt.bindString(5, coordinateX); } - + String coordinateY = entity.getCoordinateY(); if (coordinateY != null) { stmt.bindString(6, coordinateY); } - + String deep = entity.getDeep(); if (deep != null) { stmt.bindString(7, deep); } - + String deptName = entity.getDeptName(); if (deptName != null) { stmt.bindString(8, deptName); } - + String deptid = entity.getDeptid(); if (deptid != null) { stmt.bindString(9, deptid); } - + String id = entity.getId(); if (id != null) { stmt.bindString(10, id); } - + String latBaidu = entity.getLatBaidu(); if (latBaidu != null) { stmt.bindString(11, latBaidu); } - + String latGaode = entity.getLatGaode(); if (latGaode != null) { stmt.bindString(12, latGaode); } - + String lngBaidu = entity.getLngBaidu(); if (lngBaidu != null) { stmt.bindString(13, lngBaidu); } - + String lngGaode = entity.getLngGaode(); if (lngGaode != null) { stmt.bindString(14, lngGaode); } - + String notes = entity.getNotes(); if (notes != null) { stmt.bindString(15, notes); } - + String photos = entity.getPhotos(); if (photos != null) { stmt.bindString(16, photos); } - + String position = entity.getPosition(); if (position != null) { stmt.bindString(17, position); } - + String staff = entity.getStaff(); if (staff != null) { stmt.bindString(18, staff); } - + String tel = entity.getTel(); if (tel != null) { stmt.bindString(19, tel); } - + String ts = entity.getTs(); if (ts != null) { stmt.bindString(20, ts); } - + String valid = entity.getValid(); if (valid != null) { stmt.bindString(21, valid); } - + String watchData = entity.getWatchData(); if (watchData != null) { stmt.bindString(22, watchData); } - + String wellCode = entity.getWellCode(); if (wellCode != null) { stmt.bindString(23, wellCode); } - + String wellName = entity.getWellName(); if (wellName != null) { stmt.bindString(24, wellName); } - + String wellType = entity.getWellType(); if (wellType != null) { stmt.bindString(25, wellType); } - + String wellTypeName = entity.getWellTypeName(); if (wellTypeName != null) { stmt.bindString(26, wellTypeName); @@ -242,132 +237,132 @@ @Override protected final void bindValues(SQLiteStatement stmt, MapWellLocalBean entity) { stmt.clearBindings(); - + Long kId = entity.getKId(); if (kId != null) { stmt.bindLong(1, kId); } - + String area = entity.getArea(); if (area != null) { stmt.bindString(2, area); } - + String bfzt = entity.getBfzt(); if (bfzt != null) { stmt.bindString(3, bfzt); } - + String bfztName = entity.getBfztName(); if (bfztName != null) { stmt.bindString(4, bfztName); } - + String coordinateX = entity.getCoordinateX(); if (coordinateX != null) { stmt.bindString(5, coordinateX); } - + String coordinateY = entity.getCoordinateY(); if (coordinateY != null) { stmt.bindString(6, coordinateY); } - + String deep = entity.getDeep(); if (deep != null) { stmt.bindString(7, deep); } - + String deptName = entity.getDeptName(); if (deptName != null) { stmt.bindString(8, deptName); } - + String deptid = entity.getDeptid(); if (deptid != null) { stmt.bindString(9, deptid); } - + String id = entity.getId(); if (id != null) { stmt.bindString(10, id); } - + String latBaidu = entity.getLatBaidu(); if (latBaidu != null) { stmt.bindString(11, latBaidu); } - + String latGaode = entity.getLatGaode(); if (latGaode != null) { stmt.bindString(12, latGaode); } - + String lngBaidu = entity.getLngBaidu(); if (lngBaidu != null) { stmt.bindString(13, lngBaidu); } - + String lngGaode = entity.getLngGaode(); if (lngGaode != null) { stmt.bindString(14, lngGaode); } - + String notes = entity.getNotes(); if (notes != null) { stmt.bindString(15, notes); } - + String photos = entity.getPhotos(); if (photos != null) { stmt.bindString(16, photos); } - + String position = entity.getPosition(); if (position != null) { stmt.bindString(17, position); } - + String staff = entity.getStaff(); if (staff != null) { stmt.bindString(18, staff); } - + String tel = entity.getTel(); if (tel != null) { stmt.bindString(19, tel); } - + String ts = entity.getTs(); if (ts != null) { stmt.bindString(20, ts); } - + String valid = entity.getValid(); if (valid != null) { stmt.bindString(21, valid); } - + String watchData = entity.getWatchData(); if (watchData != null) { stmt.bindString(22, watchData); } - + String wellCode = entity.getWellCode(); if (wellCode != null) { stmt.bindString(23, wellCode); } - + String wellName = entity.getWellName(); if (wellName != null) { stmt.bindString(24, wellName); } - + String wellType = entity.getWellType(); if (wellType != null) { stmt.bindString(25, wellType); } - + String wellTypeName = entity.getWellTypeName(); if (wellTypeName != null) { stmt.bindString(26, wellTypeName); @@ -377,41 +372,41 @@ @Override public Long readKey(Cursor cursor, int offset) { return cursor.isNull(offset + 0) ? null : cursor.getLong(offset + 0); - } + } @Override public MapWellLocalBean readEntity(Cursor cursor, int offset) { MapWellLocalBean entity = new MapWellLocalBean( // - cursor.isNull(offset + 0) ? null : cursor.getLong(offset + 0), // kId - cursor.isNull(offset + 1) ? null : cursor.getString(offset + 1), // area - cursor.isNull(offset + 2) ? null : cursor.getString(offset + 2), // bfzt - cursor.isNull(offset + 3) ? null : cursor.getString(offset + 3), // bfztName - cursor.isNull(offset + 4) ? null : cursor.getString(offset + 4), // coordinateX - cursor.isNull(offset + 5) ? null : cursor.getString(offset + 5), // coordinateY - cursor.isNull(offset + 6) ? null : cursor.getString(offset + 6), // deep - cursor.isNull(offset + 7) ? null : cursor.getString(offset + 7), // deptName - cursor.isNull(offset + 8) ? null : cursor.getString(offset + 8), // deptid - cursor.isNull(offset + 9) ? null : cursor.getString(offset + 9), // id - cursor.isNull(offset + 10) ? null : cursor.getString(offset + 10), // latBaidu - cursor.isNull(offset + 11) ? null : cursor.getString(offset + 11), // latGaode - cursor.isNull(offset + 12) ? null : cursor.getString(offset + 12), // lngBaidu - cursor.isNull(offset + 13) ? null : cursor.getString(offset + 13), // lngGaode - cursor.isNull(offset + 14) ? null : cursor.getString(offset + 14), // notes - cursor.isNull(offset + 15) ? null : cursor.getString(offset + 15), // photos - cursor.isNull(offset + 16) ? null : cursor.getString(offset + 16), // position - cursor.isNull(offset + 17) ? null : cursor.getString(offset + 17), // staff - cursor.isNull(offset + 18) ? null : cursor.getString(offset + 18), // tel - cursor.isNull(offset + 19) ? null : cursor.getString(offset + 19), // ts - cursor.isNull(offset + 20) ? null : cursor.getString(offset + 20), // valid - cursor.isNull(offset + 21) ? null : cursor.getString(offset + 21), // watchData - cursor.isNull(offset + 22) ? null : cursor.getString(offset + 22), // wellCode - cursor.isNull(offset + 23) ? null : cursor.getString(offset + 23), // wellName - cursor.isNull(offset + 24) ? null : cursor.getString(offset + 24), // wellType - cursor.isNull(offset + 25) ? null : cursor.getString(offset + 25) // wellTypeName + cursor.isNull(offset + 0) ? null : cursor.getLong(offset + 0), // kId + cursor.isNull(offset + 1) ? null : cursor.getString(offset + 1), // area + cursor.isNull(offset + 2) ? null : cursor.getString(offset + 2), // bfzt + cursor.isNull(offset + 3) ? null : cursor.getString(offset + 3), // bfztName + cursor.isNull(offset + 4) ? null : cursor.getString(offset + 4), // coordinateX + cursor.isNull(offset + 5) ? null : cursor.getString(offset + 5), // coordinateY + cursor.isNull(offset + 6) ? null : cursor.getString(offset + 6), // deep + cursor.isNull(offset + 7) ? null : cursor.getString(offset + 7), // deptName + cursor.isNull(offset + 8) ? null : cursor.getString(offset + 8), // deptid + cursor.isNull(offset + 9) ? null : cursor.getString(offset + 9), // id + cursor.isNull(offset + 10) ? null : cursor.getString(offset + 10), // latBaidu + cursor.isNull(offset + 11) ? null : cursor.getString(offset + 11), // latGaode + cursor.isNull(offset + 12) ? null : cursor.getString(offset + 12), // lngBaidu + cursor.isNull(offset + 13) ? null : cursor.getString(offset + 13), // lngGaode + cursor.isNull(offset + 14) ? null : cursor.getString(offset + 14), // notes + cursor.isNull(offset + 15) ? null : cursor.getString(offset + 15), // photos + cursor.isNull(offset + 16) ? null : cursor.getString(offset + 16), // position + cursor.isNull(offset + 17) ? null : cursor.getString(offset + 17), // staff + cursor.isNull(offset + 18) ? null : cursor.getString(offset + 18), // tel + cursor.isNull(offset + 19) ? null : cursor.getString(offset + 19), // ts + cursor.isNull(offset + 20) ? null : cursor.getString(offset + 20), // valid + cursor.isNull(offset + 21) ? null : cursor.getString(offset + 21), // watchData + cursor.isNull(offset + 22) ? null : cursor.getString(offset + 22), // wellCode + cursor.isNull(offset + 23) ? null : cursor.getString(offset + 23), // wellName + cursor.isNull(offset + 24) ? null : cursor.getString(offset + 24), // wellType + cursor.isNull(offset + 25) ? null : cursor.getString(offset + 25) // wellTypeName ); return entity; } - + @Override public void readEntity(Cursor cursor, MapWellLocalBean entity, int offset) { entity.setKId(cursor.isNull(offset + 0) ? null : cursor.getLong(offset + 0)); @@ -440,17 +435,17 @@ entity.setWellName(cursor.isNull(offset + 23) ? null : cursor.getString(offset + 23)); entity.setWellType(cursor.isNull(offset + 24) ? null : cursor.getString(offset + 24)); entity.setWellTypeName(cursor.isNull(offset + 25) ? null : cursor.getString(offset + 25)); - } - + } + @Override protected final Long updateKeyAfterInsert(MapWellLocalBean entity, long rowId) { entity.setKId(rowId); return rowId; } - + @Override public Long getKey(MapWellLocalBean entity) { - if (entity != null) { + if(entity != null) { return entity.getKId(); } else { return null; @@ -466,5 +461,5 @@ protected final boolean isEntityUpdateable() { return true; } - + } diff --git a/app/src/main/java/com/casic/app/smartwell/greendao/NoticeLocaleBeanDao.java b/app/src/main/java/com/casic/app/smartwell/greendao/NoticeLocaleBeanDao.java index 64312ed..deb2d49 100644 --- a/app/src/main/java/com/casic/app/smartwell/greendao/NoticeLocaleBeanDao.java +++ b/app/src/main/java/com/casic/app/smartwell/greendao/NoticeLocaleBeanDao.java @@ -12,10 +12,9 @@ import org.greenrobot.greendao.internal.DaoConfig; // THIS CODE IS GENERATED BY greenDAO, DO NOT EDIT. - -/** +/** * DAO for table "NOTICE_LOCALE_BEAN". - */ +*/ public class NoticeLocaleBeanDao extends AbstractDao { public static final String TABLENAME = "NOTICE_LOCALE_BEAN"; @@ -43,16 +42,14 @@ public NoticeLocaleBeanDao(DaoConfig config) { super(config); } - + public NoticeLocaleBeanDao(DaoConfig config, DaoSession daoSession) { super(config, daoSession); } - /** - * Creates the underlying database table. - */ + /** Creates the underlying database table. */ public static void createTable(Database db, boolean ifNotExists) { - String constraint = ifNotExists ? "IF NOT EXISTS " : ""; + String constraint = ifNotExists? "IF NOT EXISTS ": ""; db.execSQL("CREATE TABLE " + constraint + "\"NOTICE_LOCALE_BEAN\" (" + // "\"_id\" INTEGER PRIMARY KEY AUTOINCREMENT ," + // 0: id "\"MESSAGE_ID\" TEXT UNIQUE ," + // 1: messageId @@ -68,9 +65,7 @@ "\"NOTICE_TIME\" TEXT);"); // 11: noticeTime } - /** - * Drops the underlying database table. - */ + /** Drops the underlying database table. */ public static void dropTable(Database db, boolean ifExists) { String sql = "DROP TABLE " + (ifExists ? "IF EXISTS " : "") + "\"NOTICE_LOCALE_BEAN\""; db.execSQL(sql); @@ -79,62 +74,62 @@ @Override protected final void bindValues(DatabaseStatement stmt, NoticeLocaleBean entity) { stmt.clearBindings(); - + Long id = entity.getId(); if (id != null) { stmt.bindLong(1, id); } - + String messageId = entity.getMessageId(); if (messageId != null) { stmt.bindString(2, messageId); } - + String appid = entity.getAppid(); if (appid != null) { stmt.bindString(3, appid); } - + String clientId = entity.getClientId(); if (clientId != null) { stmt.bindString(4, clientId); } - + String taskId = entity.getTaskId(); if (taskId != null) { stmt.bindString(5, taskId); } - + String userId = entity.getUserId(); if (userId != null) { stmt.bindString(6, userId); } - + String title = entity.getTitle(); if (title != null) { stmt.bindString(7, title); } - + String content = entity.getContent(); if (content != null) { stmt.bindString(8, content); } - + String deviceCode = entity.getDeviceCode(); if (deviceCode != null) { stmt.bindString(9, deviceCode); } - + String jobId = entity.getJobId(); if (jobId != null) { stmt.bindString(10, jobId); } - + String isRead = entity.getIsRead(); if (isRead != null) { stmt.bindString(11, isRead); } - + String noticeTime = entity.getNoticeTime(); if (noticeTime != null) { stmt.bindString(12, noticeTime); @@ -144,62 +139,62 @@ @Override protected final void bindValues(SQLiteStatement stmt, NoticeLocaleBean entity) { stmt.clearBindings(); - + Long id = entity.getId(); if (id != null) { stmt.bindLong(1, id); } - + String messageId = entity.getMessageId(); if (messageId != null) { stmt.bindString(2, messageId); } - + String appid = entity.getAppid(); if (appid != null) { stmt.bindString(3, appid); } - + String clientId = entity.getClientId(); if (clientId != null) { stmt.bindString(4, clientId); } - + String taskId = entity.getTaskId(); if (taskId != null) { stmt.bindString(5, taskId); } - + String userId = entity.getUserId(); if (userId != null) { stmt.bindString(6, userId); } - + String title = entity.getTitle(); if (title != null) { stmt.bindString(7, title); } - + String content = entity.getContent(); if (content != null) { stmt.bindString(8, content); } - + String deviceCode = entity.getDeviceCode(); if (deviceCode != null) { stmt.bindString(9, deviceCode); } - + String jobId = entity.getJobId(); if (jobId != null) { stmt.bindString(10, jobId); } - + String isRead = entity.getIsRead(); if (isRead != null) { stmt.bindString(11, isRead); } - + String noticeTime = entity.getNoticeTime(); if (noticeTime != null) { stmt.bindString(12, noticeTime); @@ -209,27 +204,27 @@ @Override public Long readKey(Cursor cursor, int offset) { return cursor.isNull(offset + 0) ? null : cursor.getLong(offset + 0); - } + } @Override public NoticeLocaleBean readEntity(Cursor cursor, int offset) { NoticeLocaleBean entity = new NoticeLocaleBean( // - cursor.isNull(offset + 0) ? null : cursor.getLong(offset + 0), // id - cursor.isNull(offset + 1) ? null : cursor.getString(offset + 1), // messageId - cursor.isNull(offset + 2) ? null : cursor.getString(offset + 2), // appid - cursor.isNull(offset + 3) ? null : cursor.getString(offset + 3), // clientId - cursor.isNull(offset + 4) ? null : cursor.getString(offset + 4), // taskId - cursor.isNull(offset + 5) ? null : cursor.getString(offset + 5), // userId - cursor.isNull(offset + 6) ? null : cursor.getString(offset + 6), // title - cursor.isNull(offset + 7) ? null : cursor.getString(offset + 7), // content - cursor.isNull(offset + 8) ? null : cursor.getString(offset + 8), // deviceCode - cursor.isNull(offset + 9) ? null : cursor.getString(offset + 9), // jobId - cursor.isNull(offset + 10) ? null : cursor.getString(offset + 10), // isRead - cursor.isNull(offset + 11) ? null : cursor.getString(offset + 11) // noticeTime + cursor.isNull(offset + 0) ? null : cursor.getLong(offset + 0), // id + cursor.isNull(offset + 1) ? null : cursor.getString(offset + 1), // messageId + cursor.isNull(offset + 2) ? null : cursor.getString(offset + 2), // appid + cursor.isNull(offset + 3) ? null : cursor.getString(offset + 3), // clientId + cursor.isNull(offset + 4) ? null : cursor.getString(offset + 4), // taskId + cursor.isNull(offset + 5) ? null : cursor.getString(offset + 5), // userId + cursor.isNull(offset + 6) ? null : cursor.getString(offset + 6), // title + cursor.isNull(offset + 7) ? null : cursor.getString(offset + 7), // content + cursor.isNull(offset + 8) ? null : cursor.getString(offset + 8), // deviceCode + cursor.isNull(offset + 9) ? null : cursor.getString(offset + 9), // jobId + cursor.isNull(offset + 10) ? null : cursor.getString(offset + 10), // isRead + cursor.isNull(offset + 11) ? null : cursor.getString(offset + 11) // noticeTime ); return entity; } - + @Override public void readEntity(Cursor cursor, NoticeLocaleBean entity, int offset) { entity.setId(cursor.isNull(offset + 0) ? null : cursor.getLong(offset + 0)); @@ -244,17 +239,17 @@ entity.setJobId(cursor.isNull(offset + 9) ? null : cursor.getString(offset + 9)); entity.setIsRead(cursor.isNull(offset + 10) ? null : cursor.getString(offset + 10)); entity.setNoticeTime(cursor.isNull(offset + 11) ? null : cursor.getString(offset + 11)); - } - + } + @Override protected final Long updateKeyAfterInsert(NoticeLocaleBean entity, long rowId) { entity.setId(rowId); return rowId; } - + @Override public Long getKey(NoticeLocaleBean entity) { - if (entity != null) { + if(entity != null) { return entity.getId(); } else { return null; @@ -270,5 +265,5 @@ protected final boolean isEntityUpdateable() { return true; } - + } diff --git a/app/src/main/java/com/casic/app/smartwell/greendao/PipeLocalBeanDao.java b/app/src/main/java/com/casic/app/smartwell/greendao/PipeLocalBeanDao.java index aab4d3f..df5515a 100644 --- a/app/src/main/java/com/casic/app/smartwell/greendao/PipeLocalBeanDao.java +++ b/app/src/main/java/com/casic/app/smartwell/greendao/PipeLocalBeanDao.java @@ -12,10 +12,9 @@ import org.greenrobot.greendao.internal.DaoConfig; // THIS CODE IS GENERATED BY greenDAO, DO NOT EDIT. - -/** +/** * DAO for table "PIPE_LOCAL_BEAN". - */ +*/ public class PipeLocalBeanDao extends AbstractDao { public static final String TABLENAME = "PIPE_LOCAL_BEAN"; @@ -37,16 +36,14 @@ public PipeLocalBeanDao(DaoConfig config) { super(config); } - + public PipeLocalBeanDao(DaoConfig config, DaoSession daoSession) { super(config, daoSession); } - /** - * Creates the underlying database table. - */ + /** Creates the underlying database table. */ public static void createTable(Database db, boolean ifNotExists) { - String constraint = ifNotExists ? "IF NOT EXISTS " : ""; + String constraint = ifNotExists? "IF NOT EXISTS ": ""; db.execSQL("CREATE TABLE " + constraint + "\"PIPE_LOCAL_BEAN\" (" + // "\"_id\" INTEGER PRIMARY KEY AUTOINCREMENT ," + // 0: id "\"PIPE_CODE\" TEXT," + // 1: pipeCode @@ -56,9 +53,7 @@ "\"START_LONGITUDE_GD\" TEXT);"); // 5: startLongitudeGd } - /** - * Drops the underlying database table. - */ + /** Drops the underlying database table. */ public static void dropTable(Database db, boolean ifExists) { String sql = "DROP TABLE " + (ifExists ? "IF EXISTS " : "") + "\"PIPE_LOCAL_BEAN\""; db.execSQL(sql); @@ -67,32 +62,32 @@ @Override protected final void bindValues(DatabaseStatement stmt, PipeLocalBean entity) { stmt.clearBindings(); - + Long id = entity.getId(); if (id != null) { stmt.bindLong(1, id); } - + String pipeCode = entity.getPipeCode(); if (pipeCode != null) { stmt.bindString(2, pipeCode); } - + String endLatitudeGd = entity.getEndLatitudeGd(); if (endLatitudeGd != null) { stmt.bindString(3, endLatitudeGd); } - + String endLongitudeGd = entity.getEndLongitudeGd(); if (endLongitudeGd != null) { stmt.bindString(4, endLongitudeGd); } - + String startLatitudeGd = entity.getStartLatitudeGd(); if (startLatitudeGd != null) { stmt.bindString(5, startLatitudeGd); } - + String startLongitudeGd = entity.getStartLongitudeGd(); if (startLongitudeGd != null) { stmt.bindString(6, startLongitudeGd); @@ -102,32 +97,32 @@ @Override protected final void bindValues(SQLiteStatement stmt, PipeLocalBean entity) { stmt.clearBindings(); - + Long id = entity.getId(); if (id != null) { stmt.bindLong(1, id); } - + String pipeCode = entity.getPipeCode(); if (pipeCode != null) { stmt.bindString(2, pipeCode); } - + String endLatitudeGd = entity.getEndLatitudeGd(); if (endLatitudeGd != null) { stmt.bindString(3, endLatitudeGd); } - + String endLongitudeGd = entity.getEndLongitudeGd(); if (endLongitudeGd != null) { stmt.bindString(4, endLongitudeGd); } - + String startLatitudeGd = entity.getStartLatitudeGd(); if (startLatitudeGd != null) { stmt.bindString(5, startLatitudeGd); } - + String startLongitudeGd = entity.getStartLongitudeGd(); if (startLongitudeGd != null) { stmt.bindString(6, startLongitudeGd); @@ -137,21 +132,21 @@ @Override public Long readKey(Cursor cursor, int offset) { return cursor.isNull(offset + 0) ? null : cursor.getLong(offset + 0); - } + } @Override public PipeLocalBean readEntity(Cursor cursor, int offset) { PipeLocalBean entity = new PipeLocalBean( // - cursor.isNull(offset + 0) ? null : cursor.getLong(offset + 0), // id - cursor.isNull(offset + 1) ? null : cursor.getString(offset + 1), // pipeCode - cursor.isNull(offset + 2) ? null : cursor.getString(offset + 2), // endLatitudeGd - cursor.isNull(offset + 3) ? null : cursor.getString(offset + 3), // endLongitudeGd - cursor.isNull(offset + 4) ? null : cursor.getString(offset + 4), // startLatitudeGd - cursor.isNull(offset + 5) ? null : cursor.getString(offset + 5) // startLongitudeGd + cursor.isNull(offset + 0) ? null : cursor.getLong(offset + 0), // id + cursor.isNull(offset + 1) ? null : cursor.getString(offset + 1), // pipeCode + cursor.isNull(offset + 2) ? null : cursor.getString(offset + 2), // endLatitudeGd + cursor.isNull(offset + 3) ? null : cursor.getString(offset + 3), // endLongitudeGd + cursor.isNull(offset + 4) ? null : cursor.getString(offset + 4), // startLatitudeGd + cursor.isNull(offset + 5) ? null : cursor.getString(offset + 5) // startLongitudeGd ); return entity; } - + @Override public void readEntity(Cursor cursor, PipeLocalBean entity, int offset) { entity.setId(cursor.isNull(offset + 0) ? null : cursor.getLong(offset + 0)); @@ -160,17 +155,17 @@ entity.setEndLongitudeGd(cursor.isNull(offset + 3) ? null : cursor.getString(offset + 3)); entity.setStartLatitudeGd(cursor.isNull(offset + 4) ? null : cursor.getString(offset + 4)); entity.setStartLongitudeGd(cursor.isNull(offset + 5) ? null : cursor.getString(offset + 5)); - } - + } + @Override protected final Long updateKeyAfterInsert(PipeLocalBean entity, long rowId) { entity.setId(rowId); return rowId; } - + @Override public Long getKey(PipeLocalBean entity) { - if (entity != null) { + if(entity != null) { return entity.getId(); } else { return null; @@ -186,5 +181,5 @@ protected final boolean isEntityUpdateable() { return true; } - + } diff --git a/app/src/main/java/com/casic/app/smartwell/view/ChangePasswordActivity.kt b/app/src/main/java/com/casic/app/smartwell/view/ChangePasswordActivity.kt index 8e41039..9f1dd40 100644 --- a/app/src/main/java/com/casic/app/smartwell/view/ChangePasswordActivity.kt +++ b/app/src/main/java/com/casic/app/smartwell/view/ChangePasswordActivity.kt @@ -14,7 +14,7 @@ import com.pengxh.kt.lite.extensions.show import com.pengxh.kt.lite.utils.ActivityStackManager import com.pengxh.kt.lite.utils.LoadState -import com.pengxh.kt.lite.utils.LoadingDialogHub +import com.pengxh.kt.lite.utils.LoadingDialog import com.pengxh.kt.lite.widget.TitleBarView import java.nio.charset.StandardCharsets @@ -46,15 +46,15 @@ override fun observeRequestState() { userViewModel.loadState.observe(this) { when (it) { - is LoadState.Loading -> LoadingDialogHub.show(this, "修改中,请稍后") + is LoadState.Loading -> LoadingDialog.show(this, "修改中,请稍后") is LoadState.Success -> { - LoadingDialogHub.dismiss() + LoadingDialog.dismiss() AuthenticationHelper.removeToken() this.navigatePageTo() ActivityStackManager.finishAllActivity() } - else -> LoadingDialogHub.dismiss() + else -> LoadingDialog.dismiss() } } } diff --git a/app/src/main/java/com/casic/app/smartwell/view/DeployedWellActivity.kt b/app/src/main/java/com/casic/app/smartwell/view/DeployedWellActivity.kt index fb4339c..28a5078 100644 --- a/app/src/main/java/com/casic/app/smartwell/view/DeployedWellActivity.kt +++ b/app/src/main/java/com/casic/app/smartwell/view/DeployedWellActivity.kt @@ -83,8 +83,8 @@ } //添加分割线 - binding.deployedListView.addItemDecoration( - RecyclerViewItemOffsets(0, 5, 0, 5) + binding.recyclerView.addItemDecoration( + RecyclerViewItemOffsets(0, 7, 0, 7) ) } @@ -149,12 +149,11 @@ } else { item.deep.toString() + "m" } - viewHolder.setText(R.id.wellNameView, item.wellName) + viewHolder.setText(R.id.wellTypeView, item.wellTypeName) .setText(R.id.wellDepthView, "深:${deep}") .setText(R.id.wellCodeView, "点位编号:${item.wellCode}") - .setText(R.id.wellTypeView, "点位类型:${item.wellTypeName}") .setText(R.id.ownerShipView, "权属单位:${item.deptName}") - .setText(R.id.wellLocationView, "点位置:${item.position}") + .setText(R.id.wellLocationView, "点位位置:${item.position}") .setOnClickListener( R.id.operationButton, object : View.OnClickListener { override fun onClick(v: View?) { @@ -207,7 +206,7 @@ }) } } - binding.deployedListView.adapter = deployAdapter + binding.recyclerView.adapter = deployAdapter deployAdapter.setOnItemClickedListener(object : NormalRecyclerAdapter.OnItemClickedListener { override fun onItemClicked(position: Int, t: WellListModel.DataBean.RowsBean) { diff --git a/app/src/main/java/com/casic/app/smartwell/view/LoginActivity.kt b/app/src/main/java/com/casic/app/smartwell/view/LoginActivity.kt index e4bb0e3..834527b 100644 --- a/app/src/main/java/com/casic/app/smartwell/view/LoginActivity.kt +++ b/app/src/main/java/com/casic/app/smartwell/view/LoginActivity.kt @@ -21,7 +21,7 @@ import com.pengxh.kt.lite.extensions.navigatePageTo import com.pengxh.kt.lite.extensions.readAssetsFile import com.pengxh.kt.lite.extensions.show -import com.pengxh.kt.lite.utils.LoadingDialogHub +import com.pengxh.kt.lite.utils.LoadingDialog import com.pengxh.kt.lite.utils.SaveKeyValues import kotlinx.coroutines.Dispatchers import kotlinx.coroutines.launch @@ -106,11 +106,11 @@ override fun observeRequestState() { authenticateViewModel.loadState.observe(this) { - LoadingDialogHub.show(this, "登录中,请稍后") + LoadingDialog.show(this, "登录中,请稍后") } loginViewModel.loadState.observe(this) { - LoadingDialogHub.dismiss() + LoadingDialog.dismiss() } } diff --git a/app/src/main/java/com/casic/app/smartwell/view/OrderCompletedDetailActivity.kt b/app/src/main/java/com/casic/app/smartwell/view/OrderCompletedDetailActivity.kt index db8ad1f..75cd905 100644 --- a/app/src/main/java/com/casic/app/smartwell/view/OrderCompletedDetailActivity.kt +++ b/app/src/main/java/com/casic/app/smartwell/view/OrderCompletedDetailActivity.kt @@ -17,7 +17,7 @@ import com.pengxh.kt.lite.extensions.show import com.pengxh.kt.lite.utils.Constant import com.pengxh.kt.lite.utils.LoadState -import com.pengxh.kt.lite.utils.LoadingDialogHub +import com.pengxh.kt.lite.utils.LoadingDialog import com.pengxh.kt.lite.widget.TitleBarView import com.pengxh.kt.lite.widget.dialog.AlertMessageDialog @@ -44,7 +44,7 @@ } override fun initOnCreate(savedInstanceState: Bundle?) { - val jobId = intent.getStringExtra(Constant.INTENT_PARAM)!! + val jobId = intent.getStringExtra(Constant.INTENT_PARAM_KEY)!! orderViewModel = ViewModelProvider(this)[OrderViewModel::class.java] orderViewModel.getWorkOrderDetail(jobId) orderViewModel.detailModel.observe(this) { @@ -154,8 +154,8 @@ override fun observeRequestState() { orderViewModel.loadState.observe(this) { when (it) { - is LoadState.Loading -> LoadingDialogHub.show(this, "数据加载中,请稍后") - else -> LoadingDialogHub.dismiss() + is LoadState.Loading -> LoadingDialog.show(this, "数据加载中,请稍后") + else -> LoadingDialog.dismiss() } } } diff --git a/app/src/main/java/com/casic/app/smartwell/view/OrderInHandleDetailActivity.kt b/app/src/main/java/com/casic/app/smartwell/view/OrderInHandleDetailActivity.kt index d70a979..04a7d5d 100644 --- a/app/src/main/java/com/casic/app/smartwell/view/OrderInHandleDetailActivity.kt +++ b/app/src/main/java/com/casic/app/smartwell/view/OrderInHandleDetailActivity.kt @@ -38,7 +38,7 @@ import com.pengxh.kt.lite.extensions.show import com.pengxh.kt.lite.utils.Constant import com.pengxh.kt.lite.utils.LoadState -import com.pengxh.kt.lite.utils.LoadingDialogHub +import com.pengxh.kt.lite.utils.LoadingDialog import com.pengxh.kt.lite.widget.TitleBarView import com.pengxh.kt.lite.widget.dialog.AlertControlDialog import com.pengxh.kt.lite.widget.dialog.AlertMessageDialog @@ -93,7 +93,7 @@ ) binding.addImageRecyclerView.adapter = imageAdapter - val jobId = intent.getStringExtra(Constant.INTENT_PARAM)!!//初始化图片九宫格 + val jobId = intent.getStringExtra(Constant.INTENT_PARAM_KEY)!!//初始化图片九宫格 orderViewModel.getWorkOrderDetail(jobId) orderViewModel.detailModel.observe(this) { if (it.code == 200) { @@ -312,41 +312,41 @@ override fun observeRequestState() { orderViewModel.loadState.observe(this) { when (it) { - is LoadState.Loading -> LoadingDialogHub.show(this, "数据加载中,请稍后") - else -> LoadingDialogHub.dismiss() + is LoadState.Loading -> LoadingDialog.show(this, "数据加载中,请稍后") + else -> LoadingDialog.dismiss() } } uploadImageViewModel.loadState.observe(this) { when (it) { - LoadState.Loading -> LoadingDialogHub.show(this, "图片上传中,请稍后...") - else -> LoadingDialogHub.dismiss() + LoadState.Loading -> LoadingDialog.show(this, "图片上传中,请稍后...") + else -> LoadingDialog.dismiss() } } //转单状态处理 operationViewModel.loadState.observe(this) { when (it) { - is LoadState.Loading -> LoadingDialogHub.show(this, "转单中,请稍后") + is LoadState.Loading -> LoadingDialog.show(this, "转单中,请稍后") is LoadState.Success -> { - LoadingDialogHub.dismiss() + LoadingDialog.dismiss() this.finish() } - else -> LoadingDialogHub.dismiss() + else -> LoadingDialog.dismiss() } } //处理完成工单状态处理 operationViewModel.loadState.observe(this) { when (it) { - is LoadState.Loading -> LoadingDialogHub.show(this, "处理中,请稍后") + is LoadState.Loading -> LoadingDialog.show(this, "处理中,请稍后") is LoadState.Success -> { - LoadingDialogHub.dismiss() + LoadingDialog.dismiss() this.finish() } - else -> LoadingDialogHub.dismiss() + else -> LoadingDialog.dismiss() } } } diff --git a/app/src/main/java/com/casic/app/smartwell/view/OrderNotConfirmedDetailActivity.kt b/app/src/main/java/com/casic/app/smartwell/view/OrderNotConfirmedDetailActivity.kt index 8e036d2..687ec86 100644 --- a/app/src/main/java/com/casic/app/smartwell/view/OrderNotConfirmedDetailActivity.kt +++ b/app/src/main/java/com/casic/app/smartwell/view/OrderNotConfirmedDetailActivity.kt @@ -36,7 +36,7 @@ import com.pengxh.kt.lite.extensions.show import com.pengxh.kt.lite.utils.Constant import com.pengxh.kt.lite.utils.LoadState -import com.pengxh.kt.lite.utils.LoadingDialogHub +import com.pengxh.kt.lite.utils.LoadingDialog import com.pengxh.kt.lite.widget.TitleBarView import com.pengxh.kt.lite.widget.dialog.AlertControlDialog import com.pengxh.kt.lite.widget.dialog.AlertMessageDialog @@ -80,7 +80,7 @@ } override fun initOnCreate(savedInstanceState: Bundle?) { - val jobId = intent.getStringExtra(Constant.INTENT_PARAM)!! + val jobId = intent.getStringExtra(Constant.INTENT_PARAM_KEY)!! //初始化图片九宫格 //左外边距,左内边距,右内边距,右外边距 val viewWidth = getScreenWidth() - (10 + 10 + 10 + 10).dp2px(this) @@ -263,41 +263,41 @@ //数据加载状态处理 orderViewModel.loadState.observe(this) { when (it) { - is LoadState.Loading -> LoadingDialogHub.show(this, "数据加载中,请稍后") - else -> LoadingDialogHub.dismiss() + is LoadState.Loading -> LoadingDialog.show(this, "数据加载中,请稍后") + else -> LoadingDialog.dismiss() } } uploadImageViewModel.loadState.observe(this) { when (it) { - LoadState.Loading -> LoadingDialogHub.show(this, "图片上传中,请稍后") - else -> LoadingDialogHub.dismiss() + LoadState.Loading -> LoadingDialog.show(this, "图片上传中,请稍后") + else -> LoadingDialog.dismiss() } } //转单状态处理 operationViewModel.loadState.observe(this) { when (it) { - is LoadState.Loading -> LoadingDialogHub.show(this, "转单中,请稍后") + is LoadState.Loading -> LoadingDialog.show(this, "转单中,请稍后") is LoadState.Success -> { - LoadingDialogHub.dismiss() + LoadingDialog.dismiss() this.finish() } - else -> LoadingDialogHub.dismiss() + else -> LoadingDialog.dismiss() } } //确认工单状态处理 operationViewModel.loadState.observe(this) { when (it) { - is LoadState.Loading -> LoadingDialogHub.show(this, "处理中,请稍后") + is LoadState.Loading -> LoadingDialog.show(this, "处理中,请稍后") is LoadState.Success -> { - LoadingDialogHub.dismiss() + LoadingDialog.dismiss() this.finish() } - else -> LoadingDialogHub.dismiss() + else -> LoadingDialog.dismiss() } } } diff --git a/app/src/main/java/com/casic/app/smartwell/view/OrderNotProcessedDetailActivity.kt b/app/src/main/java/com/casic/app/smartwell/view/OrderNotProcessedDetailActivity.kt index d3f22dc..0c97a52 100644 --- a/app/src/main/java/com/casic/app/smartwell/view/OrderNotProcessedDetailActivity.kt +++ b/app/src/main/java/com/casic/app/smartwell/view/OrderNotProcessedDetailActivity.kt @@ -18,7 +18,7 @@ import com.pengxh.kt.lite.extensions.show import com.pengxh.kt.lite.utils.Constant import com.pengxh.kt.lite.utils.LoadState -import com.pengxh.kt.lite.utils.LoadingDialogHub +import com.pengxh.kt.lite.utils.LoadingDialog import com.pengxh.kt.lite.widget.TitleBarView import com.pengxh.kt.lite.widget.dialog.AlertControlDialog import com.pengxh.kt.lite.widget.dialog.AlertMessageDialog @@ -50,7 +50,7 @@ } override fun initOnCreate(savedInstanceState: Bundle?) { - this.jobId = intent.getStringExtra(Constant.INTENT_PARAM)!! + this.jobId = intent.getStringExtra(Constant.INTENT_PARAM_KEY)!! orderViewModel = ViewModelProvider(this)[OrderViewModel::class.java] operationViewModel = ViewModelProvider(this)[OperationViewModel::class.java] wellViewModel = ViewModelProvider(this)[WellViewModel::class.java] @@ -162,21 +162,21 @@ //数据加载状态处理 orderViewModel.loadState.observe(this) { when (it) { - is LoadState.Loading -> LoadingDialogHub.show(this, "数据加载中,请稍后") - else -> LoadingDialogHub.dismiss() + is LoadState.Loading -> LoadingDialog.show(this, "数据加载中,请稍后") + else -> LoadingDialog.dismiss() } } //接单状态处理 operationViewModel.loadState.observe(this) { when (it) { - is LoadState.Loading -> LoadingDialogHub.show(this, "接单中,请稍后") + is LoadState.Loading -> LoadingDialog.show(this, "接单中,请稍后") is LoadState.Success -> { - LoadingDialogHub.dismiss() + LoadingDialog.dismiss() this.finish() } - else -> LoadingDialogHub.dismiss() + else -> LoadingDialog.dismiss() } } } diff --git a/app/build.gradle b/app/build.gradle index 296fb6f..c18c251 100644 --- a/app/build.gradle +++ b/app/build.gradle @@ -40,10 +40,6 @@ // VIVO 相关应用参数 VIVO_APP_ID : "105749048", VIVO_APP_KEY : "e460fbf2c689e0f8c58ecc6aa62e1803", - - // 小米相关应用参数 -// XIAOMI_APP_ID : "", -// XIAOMI_APP_KEY : "", ] // 版本名后面添加一句话,意思就是flavor dimension 它的维度就是该版本号,多渠道打包很重要 @@ -107,7 +103,7 @@ dependencies { implementation fileTree(dir: 'libs', include: ['*.jar']) //基础依赖库 - implementation 'com.github.AndroidCoderPeng:Kotlin-lite-lib:1.0.10' + implementation 'com.github.AndroidCoderPeng:Kotlin-lite-lib:1.1.0' implementation 'androidx.appcompat:appcompat:1.6.1' implementation 'androidx.core:core-ktx:1.9.0' implementation 'androidx.constraintlayout:constraintlayout:2.1.4' @@ -165,8 +161,6 @@ implementation 'commons-codec:commons-codec:1.15' implementation 'com.android.support:support-annotations:28.0.0' implementation 'com.assist-v3:vivo:3.1.2' // vivo -// implementation 'com.getui.opt:xmp:3.3.1' // 小米 - //数据库框架 implementation 'org.greenrobot:greendao:3.3.0' //数据库升级 diff --git a/app/src/main/AndroidManifest.xml b/app/src/main/AndroidManifest.xml index c0af158..e0519bf 100644 --- a/app/src/main/AndroidManifest.xml +++ b/app/src/main/AndroidManifest.xml @@ -90,10 +90,10 @@ - + + android:value="ee96d8b5e12de3fbb29949efd57418a8" /> () @@ -150,7 +158,7 @@ val cameraPosition = CameraPosition(centerLatLng, 14f, 0f, 0f) val cameraUpdate = CameraUpdateFactory.newCameraPosition(cameraPosition) withContext(Dispatchers.Main) { - LoadingDialogHub.dismiss() + LoadingDialog.dismiss() aMap.animateCamera(cameraUpdate, 1500, null) } } @@ -239,11 +247,6 @@ } override fun initEvent() { - binding.rightOptionView.setOnClickListener { - val x = binding.rightOptionView.width - easyPopupWindow.width - easyPopupWindow.showAsDropDown(binding.rightOptionView, x, 0) - } - //撤防点位 binding.unDeployedLayout.setOnClickListener { requireContext().navigatePageTo() @@ -263,11 +266,11 @@ override fun observeRequestState() { wellViewModel.loadState.observe(this) { when (it) { - is LoadState.Loading -> LoadingDialogHub.show( + is LoadState.Loading -> LoadingDialog.show( requireActivity(), "数据加载中,请稍后..." ) - else -> LoadingDialogHub.dismiss() + else -> LoadingDialog.dismiss() } } } @@ -376,7 +379,7 @@ }).build().show() } }) - infoPopup.showAsDropDown(binding.rightOptionView) +// infoPopup.showAsDropDown(binding.rightOptionView) } override fun onCameraChange(p0: CameraPosition?) { diff --git a/app/src/main/java/com/casic/app/smartwell/fragment/HomePageNoClusterFragment.kt b/app/src/main/java/com/casic/app/smartwell/fragment/HomePageNoClusterFragment.kt index 802426a..b25f743 100644 --- a/app/src/main/java/com/casic/app/smartwell/fragment/HomePageNoClusterFragment.kt +++ b/app/src/main/java/com/casic/app/smartwell/fragment/HomePageNoClusterFragment.kt @@ -38,8 +38,9 @@ import com.pengxh.kt.lite.extensions.navigatePageTo import com.pengxh.kt.lite.extensions.show import com.pengxh.kt.lite.utils.LoadState -import com.pengxh.kt.lite.utils.LoadingDialogHub +import com.pengxh.kt.lite.utils.LoadingDialog import com.pengxh.kt.lite.widget.EasyPopupWindow +import com.pengxh.kt.lite.widget.TitleBarView import com.pengxh.kt.lite.widget.dialog.AlertControlDialog import kotlinx.coroutines.Dispatchers import kotlinx.coroutines.launch @@ -78,7 +79,15 @@ override fun setupTopBarLayout() { binding.rootView.initImmersionBar(this, false, R.color.mainThemeColor) - binding.titleView.text = "首页" + binding.titleView.setOnClickListener(object : TitleBarView.OnClickListener { + override fun onLeftClick() { + + } + + override fun onRightClick() { + easyPopupWindow.showAsDropDown(binding.titleView, binding.titleView.width, 0) + } + }) } override fun initOnCreate(savedInstanceState: Bundle?) { @@ -112,7 +121,7 @@ //渲染井位置 lifecycleScope.launch(Dispatchers.Main) { - LoadingDialogHub.show(requireActivity(), "数据加载中,请稍后") + LoadingDialog.show(requireActivity(), "数据加载中,请稍后") withContext(Dispatchers.IO) { //取Well缓存 val allMarkerOptions = ArrayList() @@ -144,7 +153,7 @@ val cameraPosition = CameraPosition(centerLatLng, 14f, 0f, 0f) val cameraUpdate = CameraUpdateFactory.newCameraPosition(cameraPosition) withContext(Dispatchers.Main) { - LoadingDialogHub.dismiss() + LoadingDialog.dismiss() aMap.animateCamera(cameraUpdate, 1500, null) } } @@ -238,11 +247,6 @@ } override fun initEvent() { - binding.rightOptionView.setOnClickListener { - val x = binding.rightOptionView.width - easyPopupWindow.width - easyPopupWindow.showAsDropDown(binding.rightOptionView, x, 0) - } - //撤防点位 binding.unDeployedLayout.setOnClickListener { requireContext().navigatePageTo() @@ -262,11 +266,11 @@ override fun observeRequestState() { wellViewModel.loadState.observe(this) { when (it) { - is LoadState.Loading -> LoadingDialogHub.show( + is LoadState.Loading -> LoadingDialog.show( requireActivity(), "数据加载中,请稍后..." ) - else -> LoadingDialogHub.dismiss() + else -> LoadingDialog.dismiss() } } } diff --git a/app/src/main/java/com/casic/app/smartwell/fragment/MinePageFragment.kt b/app/src/main/java/com/casic/app/smartwell/fragment/MinePageFragment.kt index 09a570c..dcb48f8 100644 --- a/app/src/main/java/com/casic/app/smartwell/fragment/MinePageFragment.kt +++ b/app/src/main/java/com/casic/app/smartwell/fragment/MinePageFragment.kt @@ -35,7 +35,7 @@ import com.pengxh.kt.lite.utils.ActivityStackManager import com.pengxh.kt.lite.utils.FileDownloadManager import com.pengxh.kt.lite.utils.LoadState -import com.pengxh.kt.lite.utils.LoadingDialogHub +import com.pengxh.kt.lite.utils.LoadingDialog import com.pengxh.kt.lite.widget.dialog.AlertControlDialog import com.pengxh.kt.lite.widget.dialog.BottomActionSheet import kotlinx.coroutines.Dispatchers @@ -60,7 +60,6 @@ override fun setupTopBarLayout() { binding.rootView.initImmersionBar(this, false, R.color.mainThemeColor) - binding.titleInclude.titleView.text = "我的" } override fun initOnCreate(savedInstanceState: Bundle?) { @@ -155,27 +154,27 @@ override fun observeRequestState() { userViewModel.loadState.observe(this) { when (it) { - is LoadState.Loading -> LoadingDialogHub.show( + is LoadState.Loading -> LoadingDialog.show( requireActivity(), "检查版本中,请稍后" ) - else -> LoadingDialogHub.dismiss() + else -> LoadingDialog.dismiss() } } wellViewModel.loadState.observe(this) { when (it) { - is LoadState.Loading -> LoadingDialogHub.show( + is LoadState.Loading -> LoadingDialog.show( requireActivity(), "数据更新中,请稍后" ) is LoadState.Fail -> { - LoadingDialogHub.dismiss() + LoadingDialog.dismiss() "数据更新超时".show(requireContext()) } else -> { - LoadingDialogHub.dismiss() + LoadingDialog.dismiss() AlertControlDialog.Builder().setContext(requireContext()).setTitle("温馨提示") .setMessage("数据更新成功,请重启应用").setNegativeButton("取消") .setPositiveButton("确定").setOnDialogButtonClickListener(object : @@ -197,17 +196,17 @@ lineViewModel.loadState.observe(this) { when (it) { - is LoadState.Loading -> LoadingDialogHub.show( + is LoadState.Loading -> LoadingDialog.show( requireActivity(), "数据更新中,请稍后" ) is LoadState.Fail -> { - LoadingDialogHub.dismiss() + LoadingDialog.dismiss() "数据更新超时".show(requireContext()) } else -> { - LoadingDialogHub.dismiss() + LoadingDialog.dismiss() AlertControlDialog.Builder().setContext(requireContext()).setTitle("温馨提示") .setMessage("数据更新成功,请重启应用").setNegativeButton("取消") .setPositiveButton("确定").setOnDialogButtonClickListener(object : diff --git a/app/src/main/java/com/casic/app/smartwell/fragment/NoticePageFragment.kt b/app/src/main/java/com/casic/app/smartwell/fragment/NoticePageFragment.kt index 171b555..3c93f54 100644 --- a/app/src/main/java/com/casic/app/smartwell/fragment/NoticePageFragment.kt +++ b/app/src/main/java/com/casic/app/smartwell/fragment/NoticePageFragment.kt @@ -48,7 +48,6 @@ override fun setupTopBarLayout() { binding.rootView.initImmersionBar(this, false, R.color.mainThemeColor) - binding.titleInclude.titleView.text = "消息" } override fun initOnCreate(savedInstanceState: Bundle?) { diff --git a/app/src/main/java/com/casic/app/smartwell/fragment/OrderListFragment.kt b/app/src/main/java/com/casic/app/smartwell/fragment/OrderListFragment.kt index 93ff35b..5e38acb 100644 --- a/app/src/main/java/com/casic/app/smartwell/fragment/OrderListFragment.kt +++ b/app/src/main/java/com/casic/app/smartwell/fragment/OrderListFragment.kt @@ -12,6 +12,7 @@ import com.casic.app.smartwell.view.SearchOrderActivity import com.pengxh.kt.lite.base.KotlinBaseFragment import com.pengxh.kt.lite.extensions.navigatePageTo +import com.pengxh.kt.lite.widget.TitleBarView class OrderListFragment : KotlinBaseFragment() { @@ -25,15 +26,22 @@ } override fun initViewBinding( - inflater: LayoutInflater, - container: ViewGroup? + inflater: LayoutInflater, container: ViewGroup? ): FragmentOrderBinding { return FragmentOrderBinding.inflate(inflater, container, false) } override fun setupTopBarLayout() { binding.rootView.initImmersionBar(this, false, R.color.mainThemeColor) - binding.titleView.text = "工单" + binding.titleView.setOnClickListener(object : TitleBarView.OnClickListener { + override fun onLeftClick() { + + } + + override fun onRightClick() { + requireContext().navigatePageTo() + } + }) } override fun initOnCreate(savedInstanceState: Bundle?) { @@ -51,8 +59,6 @@ } override fun initEvent() { - binding.rightOptionView.setOnClickListener { - requireContext().navigatePageTo() - } + } } \ No newline at end of file diff --git a/app/src/main/java/com/casic/app/smartwell/fragment/OrderNotProcessedFragment.kt b/app/src/main/java/com/casic/app/smartwell/fragment/OrderNotProcessedFragment.kt index 0b3d09d..2b6f21d 100644 --- a/app/src/main/java/com/casic/app/smartwell/fragment/OrderNotProcessedFragment.kt +++ b/app/src/main/java/com/casic/app/smartwell/fragment/OrderNotProcessedFragment.kt @@ -18,7 +18,7 @@ import com.pengxh.kt.lite.extensions.navigatePageTo import com.pengxh.kt.lite.extensions.show import com.pengxh.kt.lite.utils.LoadState -import com.pengxh.kt.lite.utils.LoadingDialogHub +import com.pengxh.kt.lite.utils.LoadingDialog import com.pengxh.kt.lite.utils.WeakReferenceHandler import com.pengxh.kt.lite.widget.dialog.AlertControlDialog @@ -78,8 +78,8 @@ operationViewModel = ViewModelProvider(this)[OperationViewModel::class.java] - binding.notProcessedView.addItemDecoration( - RecyclerViewItemOffsets(0, 5, 0, 5) + binding.recyclerView.addItemDecoration( + RecyclerViewItemOffsets(0, 7, 0, 7) ) } @@ -87,9 +87,9 @@ //接单状态处理 operationViewModel.loadState.observe(this) { when (it) { - is LoadState.Loading -> LoadingDialogHub.show(requireActivity(), "接单中,请稍后") + is LoadState.Loading -> LoadingDialog.show(requireActivity(), "接单中,请稍后") is LoadState.Success -> { - LoadingDialogHub.dismiss() + LoadingDialog.dismiss() //接单成功之后刷新列表 dataBeans.removeAt(clickedPosition) notProcessedAdapter.notifyItemRemoved(clickedPosition) @@ -98,7 +98,7 @@ ) } - else -> LoadingDialogHub.dismiss() + else -> LoadingDialog.dismiss() } } } @@ -131,7 +131,7 @@ } else { binding.emptyInclude.emptyView.hide() notProcessedAdapter = OrderNotProcessedAdapter(requireContext(), dataBeans) - binding.notProcessedView.adapter = notProcessedAdapter + binding.recyclerView.adapter = notProcessedAdapter notProcessedAdapter.setOnItemClickListener(object : OrderNotProcessedAdapter.OnItemClickListener { override fun onClicked(position: Int) { diff --git a/app/src/main/java/com/casic/app/smartwell/fragment/OvertimeNotAcceptFragment.kt b/app/src/main/java/com/casic/app/smartwell/fragment/OvertimeNotAcceptFragment.kt index a198545..9b318ca 100644 --- a/app/src/main/java/com/casic/app/smartwell/fragment/OvertimeNotAcceptFragment.kt +++ b/app/src/main/java/com/casic/app/smartwell/fragment/OvertimeNotAcceptFragment.kt @@ -18,7 +18,7 @@ import com.pengxh.kt.lite.extensions.navigatePageTo import com.pengxh.kt.lite.extensions.show import com.pengxh.kt.lite.utils.LoadState -import com.pengxh.kt.lite.utils.LoadingDialogHub +import com.pengxh.kt.lite.utils.LoadingDialog import com.pengxh.kt.lite.utils.WeakReferenceHandler import com.pengxh.kt.lite.widget.dialog.AlertControlDialog @@ -81,8 +81,8 @@ operationViewModel = ViewModelProvider(this)[OperationViewModel::class.java] - binding.notProcessedView.addItemDecoration( - RecyclerViewItemOffsets(0, 5, 0, 5) + binding.recyclerView.addItemDecoration( + RecyclerViewItemOffsets(0, 7, 0, 7) ) } @@ -90,9 +90,9 @@ //接单状态处理 operationViewModel.loadState.observe(this) { when (it) { - is LoadState.Loading -> LoadingDialogHub.show(requireActivity(), "接单中,请稍后") + is LoadState.Loading -> LoadingDialog.show(requireActivity(), "接单中,请稍后") is LoadState.Success -> { - LoadingDialogHub.dismiss() + LoadingDialog.dismiss() //接单成功之后刷新列表 dataBeans.removeAt(clickedPosition) notProcessedAdapter.notifyItemRemoved(clickedPosition) @@ -101,7 +101,7 @@ ) } - else -> LoadingDialogHub.dismiss() + else -> LoadingDialog.dismiss() } } } @@ -134,7 +134,7 @@ } else { binding.emptyInclude.emptyView.hide() notProcessedAdapter = OrderNotProcessedAdapter(requireContext(), dataBeans) - binding.notProcessedView.adapter = notProcessedAdapter + binding.recyclerView.adapter = notProcessedAdapter notProcessedAdapter.setOnItemClickListener(object : OrderNotProcessedAdapter.OnItemClickListener { override fun onClicked(position: Int) { diff --git a/app/src/main/java/com/casic/app/smartwell/greendao/DaoMaster.java b/app/src/main/java/com/casic/app/smartwell/greendao/DaoMaster.java index fdcf3a7..1e52b74 100644 --- a/app/src/main/java/com/casic/app/smartwell/greendao/DaoMaster.java +++ b/app/src/main/java/com/casic/app/smartwell/greendao/DaoMaster.java @@ -13,25 +13,20 @@ // THIS CODE IS GENERATED BY greenDAO, DO NOT EDIT. - /** * Master of DAO (schema version 4): knows all DAOs. */ public class DaoMaster extends AbstractDaoMaster { public static final int SCHEMA_VERSION = 4; - /** - * Creates underlying database table using DAOs. - */ + /** Creates underlying database table using DAOs. */ public static void createAllTables(Database db, boolean ifNotExists) { MapWellLocalBeanDao.createTable(db, ifNotExists); NoticeLocaleBeanDao.createTable(db, ifNotExists); PipeLocalBeanDao.createTable(db, ifNotExists); } - /** - * Drops underlying database table using DAOs. - */ + /** Drops underlying database table using DAOs. */ public static void dropAllTables(Database db, boolean ifExists) { MapWellLocalBeanDao.dropTable(db, ifExists); NoticeLocaleBeanDao.dropTable(db, ifExists); @@ -86,9 +81,7 @@ } } - /** - * WARNING: Drops all table on Upgrade! Use only during development. - */ + /** WARNING: Drops all table on Upgrade! Use only during development. */ public static class DevOpenHelper extends OpenHelper { public DevOpenHelper(Context context, String name) { super(context, name); diff --git a/app/src/main/java/com/casic/app/smartwell/greendao/DaoSession.java b/app/src/main/java/com/casic/app/smartwell/greendao/DaoSession.java index 0b36d17..3e40e3b 100644 --- a/app/src/main/java/com/casic/app/smartwell/greendao/DaoSession.java +++ b/app/src/main/java/com/casic/app/smartwell/greendao/DaoSession.java @@ -16,7 +16,7 @@ /** * {@inheritDoc} - * + * * @see org.greenrobot.greendao.AbstractDaoSession */ public class DaoSession extends AbstractDaoSession { @@ -50,7 +50,7 @@ registerDao(NoticeLocaleBean.class, noticeLocaleBeanDao); registerDao(PipeLocalBean.class, pipeLocalBeanDao); } - + public void clear() { mapWellLocalBeanDaoConfig.clearIdentityScope(); noticeLocaleBeanDaoConfig.clearIdentityScope(); diff --git a/app/src/main/java/com/casic/app/smartwell/greendao/MapWellLocalBeanDao.java b/app/src/main/java/com/casic/app/smartwell/greendao/MapWellLocalBeanDao.java index 8908fda..407bc92 100644 --- a/app/src/main/java/com/casic/app/smartwell/greendao/MapWellLocalBeanDao.java +++ b/app/src/main/java/com/casic/app/smartwell/greendao/MapWellLocalBeanDao.java @@ -12,10 +12,9 @@ import org.greenrobot.greendao.internal.DaoConfig; // THIS CODE IS GENERATED BY greenDAO, DO NOT EDIT. - -/** +/** * DAO for table "MAP_WELL_LOCAL_BEAN". - */ +*/ public class MapWellLocalBeanDao extends AbstractDao { public static final String TABLENAME = "MAP_WELL_LOCAL_BEAN"; @@ -57,16 +56,14 @@ public MapWellLocalBeanDao(DaoConfig config) { super(config); } - + public MapWellLocalBeanDao(DaoConfig config, DaoSession daoSession) { super(config, daoSession); } - /** - * Creates the underlying database table. - */ + /** Creates the underlying database table. */ public static void createTable(Database db, boolean ifNotExists) { - String constraint = ifNotExists ? "IF NOT EXISTS " : ""; + String constraint = ifNotExists? "IF NOT EXISTS ": ""; db.execSQL("CREATE TABLE " + constraint + "\"MAP_WELL_LOCAL_BEAN\" (" + // "\"_id\" INTEGER PRIMARY KEY AUTOINCREMENT ," + // 0: kId "\"AREA\" TEXT," + // 1: area @@ -96,9 +93,7 @@ "\"WELL_TYPE_NAME\" TEXT);"); // 25: wellTypeName } - /** - * Drops the underlying database table. - */ + /** Drops the underlying database table. */ public static void dropTable(Database db, boolean ifExists) { String sql = "DROP TABLE " + (ifExists ? "IF EXISTS " : "") + "\"MAP_WELL_LOCAL_BEAN\""; db.execSQL(sql); @@ -107,132 +102,132 @@ @Override protected final void bindValues(DatabaseStatement stmt, MapWellLocalBean entity) { stmt.clearBindings(); - + Long kId = entity.getKId(); if (kId != null) { stmt.bindLong(1, kId); } - + String area = entity.getArea(); if (area != null) { stmt.bindString(2, area); } - + String bfzt = entity.getBfzt(); if (bfzt != null) { stmt.bindString(3, bfzt); } - + String bfztName = entity.getBfztName(); if (bfztName != null) { stmt.bindString(4, bfztName); } - + String coordinateX = entity.getCoordinateX(); if (coordinateX != null) { stmt.bindString(5, coordinateX); } - + String coordinateY = entity.getCoordinateY(); if (coordinateY != null) { stmt.bindString(6, coordinateY); } - + String deep = entity.getDeep(); if (deep != null) { stmt.bindString(7, deep); } - + String deptName = entity.getDeptName(); if (deptName != null) { stmt.bindString(8, deptName); } - + String deptid = entity.getDeptid(); if (deptid != null) { stmt.bindString(9, deptid); } - + String id = entity.getId(); if (id != null) { stmt.bindString(10, id); } - + String latBaidu = entity.getLatBaidu(); if (latBaidu != null) { stmt.bindString(11, latBaidu); } - + String latGaode = entity.getLatGaode(); if (latGaode != null) { stmt.bindString(12, latGaode); } - + String lngBaidu = entity.getLngBaidu(); if (lngBaidu != null) { stmt.bindString(13, lngBaidu); } - + String lngGaode = entity.getLngGaode(); if (lngGaode != null) { stmt.bindString(14, lngGaode); } - + String notes = entity.getNotes(); if (notes != null) { stmt.bindString(15, notes); } - + String photos = entity.getPhotos(); if (photos != null) { stmt.bindString(16, photos); } - + String position = entity.getPosition(); if (position != null) { stmt.bindString(17, position); } - + String staff = entity.getStaff(); if (staff != null) { stmt.bindString(18, staff); } - + String tel = entity.getTel(); if (tel != null) { stmt.bindString(19, tel); } - + String ts = entity.getTs(); if (ts != null) { stmt.bindString(20, ts); } - + String valid = entity.getValid(); if (valid != null) { stmt.bindString(21, valid); } - + String watchData = entity.getWatchData(); if (watchData != null) { stmt.bindString(22, watchData); } - + String wellCode = entity.getWellCode(); if (wellCode != null) { stmt.bindString(23, wellCode); } - + String wellName = entity.getWellName(); if (wellName != null) { stmt.bindString(24, wellName); } - + String wellType = entity.getWellType(); if (wellType != null) { stmt.bindString(25, wellType); } - + String wellTypeName = entity.getWellTypeName(); if (wellTypeName != null) { stmt.bindString(26, wellTypeName); @@ -242,132 +237,132 @@ @Override protected final void bindValues(SQLiteStatement stmt, MapWellLocalBean entity) { stmt.clearBindings(); - + Long kId = entity.getKId(); if (kId != null) { stmt.bindLong(1, kId); } - + String area = entity.getArea(); if (area != null) { stmt.bindString(2, area); } - + String bfzt = entity.getBfzt(); if (bfzt != null) { stmt.bindString(3, bfzt); } - + String bfztName = entity.getBfztName(); if (bfztName != null) { stmt.bindString(4, bfztName); } - + String coordinateX = entity.getCoordinateX(); if (coordinateX != null) { stmt.bindString(5, coordinateX); } - + String coordinateY = entity.getCoordinateY(); if (coordinateY != null) { stmt.bindString(6, coordinateY); } - + String deep = entity.getDeep(); if (deep != null) { stmt.bindString(7, deep); } - + String deptName = entity.getDeptName(); if (deptName != null) { stmt.bindString(8, deptName); } - + String deptid = entity.getDeptid(); if (deptid != null) { stmt.bindString(9, deptid); } - + String id = entity.getId(); if (id != null) { stmt.bindString(10, id); } - + String latBaidu = entity.getLatBaidu(); if (latBaidu != null) { stmt.bindString(11, latBaidu); } - + String latGaode = entity.getLatGaode(); if (latGaode != null) { stmt.bindString(12, latGaode); } - + String lngBaidu = entity.getLngBaidu(); if (lngBaidu != null) { stmt.bindString(13, lngBaidu); } - + String lngGaode = entity.getLngGaode(); if (lngGaode != null) { stmt.bindString(14, lngGaode); } - + String notes = entity.getNotes(); if (notes != null) { stmt.bindString(15, notes); } - + String photos = entity.getPhotos(); if (photos != null) { stmt.bindString(16, photos); } - + String position = entity.getPosition(); if (position != null) { stmt.bindString(17, position); } - + String staff = entity.getStaff(); if (staff != null) { stmt.bindString(18, staff); } - + String tel = entity.getTel(); if (tel != null) { stmt.bindString(19, tel); } - + String ts = entity.getTs(); if (ts != null) { stmt.bindString(20, ts); } - + String valid = entity.getValid(); if (valid != null) { stmt.bindString(21, valid); } - + String watchData = entity.getWatchData(); if (watchData != null) { stmt.bindString(22, watchData); } - + String wellCode = entity.getWellCode(); if (wellCode != null) { stmt.bindString(23, wellCode); } - + String wellName = entity.getWellName(); if (wellName != null) { stmt.bindString(24, wellName); } - + String wellType = entity.getWellType(); if (wellType != null) { stmt.bindString(25, wellType); } - + String wellTypeName = entity.getWellTypeName(); if (wellTypeName != null) { stmt.bindString(26, wellTypeName); @@ -377,41 +372,41 @@ @Override public Long readKey(Cursor cursor, int offset) { return cursor.isNull(offset + 0) ? null : cursor.getLong(offset + 0); - } + } @Override public MapWellLocalBean readEntity(Cursor cursor, int offset) { MapWellLocalBean entity = new MapWellLocalBean( // - cursor.isNull(offset + 0) ? null : cursor.getLong(offset + 0), // kId - cursor.isNull(offset + 1) ? null : cursor.getString(offset + 1), // area - cursor.isNull(offset + 2) ? null : cursor.getString(offset + 2), // bfzt - cursor.isNull(offset + 3) ? null : cursor.getString(offset + 3), // bfztName - cursor.isNull(offset + 4) ? null : cursor.getString(offset + 4), // coordinateX - cursor.isNull(offset + 5) ? null : cursor.getString(offset + 5), // coordinateY - cursor.isNull(offset + 6) ? null : cursor.getString(offset + 6), // deep - cursor.isNull(offset + 7) ? null : cursor.getString(offset + 7), // deptName - cursor.isNull(offset + 8) ? null : cursor.getString(offset + 8), // deptid - cursor.isNull(offset + 9) ? null : cursor.getString(offset + 9), // id - cursor.isNull(offset + 10) ? null : cursor.getString(offset + 10), // latBaidu - cursor.isNull(offset + 11) ? null : cursor.getString(offset + 11), // latGaode - cursor.isNull(offset + 12) ? null : cursor.getString(offset + 12), // lngBaidu - cursor.isNull(offset + 13) ? null : cursor.getString(offset + 13), // lngGaode - cursor.isNull(offset + 14) ? null : cursor.getString(offset + 14), // notes - cursor.isNull(offset + 15) ? null : cursor.getString(offset + 15), // photos - cursor.isNull(offset + 16) ? null : cursor.getString(offset + 16), // position - cursor.isNull(offset + 17) ? null : cursor.getString(offset + 17), // staff - cursor.isNull(offset + 18) ? null : cursor.getString(offset + 18), // tel - cursor.isNull(offset + 19) ? null : cursor.getString(offset + 19), // ts - cursor.isNull(offset + 20) ? null : cursor.getString(offset + 20), // valid - cursor.isNull(offset + 21) ? null : cursor.getString(offset + 21), // watchData - cursor.isNull(offset + 22) ? null : cursor.getString(offset + 22), // wellCode - cursor.isNull(offset + 23) ? null : cursor.getString(offset + 23), // wellName - cursor.isNull(offset + 24) ? null : cursor.getString(offset + 24), // wellType - cursor.isNull(offset + 25) ? null : cursor.getString(offset + 25) // wellTypeName + cursor.isNull(offset + 0) ? null : cursor.getLong(offset + 0), // kId + cursor.isNull(offset + 1) ? null : cursor.getString(offset + 1), // area + cursor.isNull(offset + 2) ? null : cursor.getString(offset + 2), // bfzt + cursor.isNull(offset + 3) ? null : cursor.getString(offset + 3), // bfztName + cursor.isNull(offset + 4) ? null : cursor.getString(offset + 4), // coordinateX + cursor.isNull(offset + 5) ? null : cursor.getString(offset + 5), // coordinateY + cursor.isNull(offset + 6) ? null : cursor.getString(offset + 6), // deep + cursor.isNull(offset + 7) ? null : cursor.getString(offset + 7), // deptName + cursor.isNull(offset + 8) ? null : cursor.getString(offset + 8), // deptid + cursor.isNull(offset + 9) ? null : cursor.getString(offset + 9), // id + cursor.isNull(offset + 10) ? null : cursor.getString(offset + 10), // latBaidu + cursor.isNull(offset + 11) ? null : cursor.getString(offset + 11), // latGaode + cursor.isNull(offset + 12) ? null : cursor.getString(offset + 12), // lngBaidu + cursor.isNull(offset + 13) ? null : cursor.getString(offset + 13), // lngGaode + cursor.isNull(offset + 14) ? null : cursor.getString(offset + 14), // notes + cursor.isNull(offset + 15) ? null : cursor.getString(offset + 15), // photos + cursor.isNull(offset + 16) ? null : cursor.getString(offset + 16), // position + cursor.isNull(offset + 17) ? null : cursor.getString(offset + 17), // staff + cursor.isNull(offset + 18) ? null : cursor.getString(offset + 18), // tel + cursor.isNull(offset + 19) ? null : cursor.getString(offset + 19), // ts + cursor.isNull(offset + 20) ? null : cursor.getString(offset + 20), // valid + cursor.isNull(offset + 21) ? null : cursor.getString(offset + 21), // watchData + cursor.isNull(offset + 22) ? null : cursor.getString(offset + 22), // wellCode + cursor.isNull(offset + 23) ? null : cursor.getString(offset + 23), // wellName + cursor.isNull(offset + 24) ? null : cursor.getString(offset + 24), // wellType + cursor.isNull(offset + 25) ? null : cursor.getString(offset + 25) // wellTypeName ); return entity; } - + @Override public void readEntity(Cursor cursor, MapWellLocalBean entity, int offset) { entity.setKId(cursor.isNull(offset + 0) ? null : cursor.getLong(offset + 0)); @@ -440,17 +435,17 @@ entity.setWellName(cursor.isNull(offset + 23) ? null : cursor.getString(offset + 23)); entity.setWellType(cursor.isNull(offset + 24) ? null : cursor.getString(offset + 24)); entity.setWellTypeName(cursor.isNull(offset + 25) ? null : cursor.getString(offset + 25)); - } - + } + @Override protected final Long updateKeyAfterInsert(MapWellLocalBean entity, long rowId) { entity.setKId(rowId); return rowId; } - + @Override public Long getKey(MapWellLocalBean entity) { - if (entity != null) { + if(entity != null) { return entity.getKId(); } else { return null; @@ -466,5 +461,5 @@ protected final boolean isEntityUpdateable() { return true; } - + } diff --git a/app/src/main/java/com/casic/app/smartwell/greendao/NoticeLocaleBeanDao.java b/app/src/main/java/com/casic/app/smartwell/greendao/NoticeLocaleBeanDao.java index 64312ed..deb2d49 100644 --- a/app/src/main/java/com/casic/app/smartwell/greendao/NoticeLocaleBeanDao.java +++ b/app/src/main/java/com/casic/app/smartwell/greendao/NoticeLocaleBeanDao.java @@ -12,10 +12,9 @@ import org.greenrobot.greendao.internal.DaoConfig; // THIS CODE IS GENERATED BY greenDAO, DO NOT EDIT. - -/** +/** * DAO for table "NOTICE_LOCALE_BEAN". - */ +*/ public class NoticeLocaleBeanDao extends AbstractDao { public static final String TABLENAME = "NOTICE_LOCALE_BEAN"; @@ -43,16 +42,14 @@ public NoticeLocaleBeanDao(DaoConfig config) { super(config); } - + public NoticeLocaleBeanDao(DaoConfig config, DaoSession daoSession) { super(config, daoSession); } - /** - * Creates the underlying database table. - */ + /** Creates the underlying database table. */ public static void createTable(Database db, boolean ifNotExists) { - String constraint = ifNotExists ? "IF NOT EXISTS " : ""; + String constraint = ifNotExists? "IF NOT EXISTS ": ""; db.execSQL("CREATE TABLE " + constraint + "\"NOTICE_LOCALE_BEAN\" (" + // "\"_id\" INTEGER PRIMARY KEY AUTOINCREMENT ," + // 0: id "\"MESSAGE_ID\" TEXT UNIQUE ," + // 1: messageId @@ -68,9 +65,7 @@ "\"NOTICE_TIME\" TEXT);"); // 11: noticeTime } - /** - * Drops the underlying database table. - */ + /** Drops the underlying database table. */ public static void dropTable(Database db, boolean ifExists) { String sql = "DROP TABLE " + (ifExists ? "IF EXISTS " : "") + "\"NOTICE_LOCALE_BEAN\""; db.execSQL(sql); @@ -79,62 +74,62 @@ @Override protected final void bindValues(DatabaseStatement stmt, NoticeLocaleBean entity) { stmt.clearBindings(); - + Long id = entity.getId(); if (id != null) { stmt.bindLong(1, id); } - + String messageId = entity.getMessageId(); if (messageId != null) { stmt.bindString(2, messageId); } - + String appid = entity.getAppid(); if (appid != null) { stmt.bindString(3, appid); } - + String clientId = entity.getClientId(); if (clientId != null) { stmt.bindString(4, clientId); } - + String taskId = entity.getTaskId(); if (taskId != null) { stmt.bindString(5, taskId); } - + String userId = entity.getUserId(); if (userId != null) { stmt.bindString(6, userId); } - + String title = entity.getTitle(); if (title != null) { stmt.bindString(7, title); } - + String content = entity.getContent(); if (content != null) { stmt.bindString(8, content); } - + String deviceCode = entity.getDeviceCode(); if (deviceCode != null) { stmt.bindString(9, deviceCode); } - + String jobId = entity.getJobId(); if (jobId != null) { stmt.bindString(10, jobId); } - + String isRead = entity.getIsRead(); if (isRead != null) { stmt.bindString(11, isRead); } - + String noticeTime = entity.getNoticeTime(); if (noticeTime != null) { stmt.bindString(12, noticeTime); @@ -144,62 +139,62 @@ @Override protected final void bindValues(SQLiteStatement stmt, NoticeLocaleBean entity) { stmt.clearBindings(); - + Long id = entity.getId(); if (id != null) { stmt.bindLong(1, id); } - + String messageId = entity.getMessageId(); if (messageId != null) { stmt.bindString(2, messageId); } - + String appid = entity.getAppid(); if (appid != null) { stmt.bindString(3, appid); } - + String clientId = entity.getClientId(); if (clientId != null) { stmt.bindString(4, clientId); } - + String taskId = entity.getTaskId(); if (taskId != null) { stmt.bindString(5, taskId); } - + String userId = entity.getUserId(); if (userId != null) { stmt.bindString(6, userId); } - + String title = entity.getTitle(); if (title != null) { stmt.bindString(7, title); } - + String content = entity.getContent(); if (content != null) { stmt.bindString(8, content); } - + String deviceCode = entity.getDeviceCode(); if (deviceCode != null) { stmt.bindString(9, deviceCode); } - + String jobId = entity.getJobId(); if (jobId != null) { stmt.bindString(10, jobId); } - + String isRead = entity.getIsRead(); if (isRead != null) { stmt.bindString(11, isRead); } - + String noticeTime = entity.getNoticeTime(); if (noticeTime != null) { stmt.bindString(12, noticeTime); @@ -209,27 +204,27 @@ @Override public Long readKey(Cursor cursor, int offset) { return cursor.isNull(offset + 0) ? null : cursor.getLong(offset + 0); - } + } @Override public NoticeLocaleBean readEntity(Cursor cursor, int offset) { NoticeLocaleBean entity = new NoticeLocaleBean( // - cursor.isNull(offset + 0) ? null : cursor.getLong(offset + 0), // id - cursor.isNull(offset + 1) ? null : cursor.getString(offset + 1), // messageId - cursor.isNull(offset + 2) ? null : cursor.getString(offset + 2), // appid - cursor.isNull(offset + 3) ? null : cursor.getString(offset + 3), // clientId - cursor.isNull(offset + 4) ? null : cursor.getString(offset + 4), // taskId - cursor.isNull(offset + 5) ? null : cursor.getString(offset + 5), // userId - cursor.isNull(offset + 6) ? null : cursor.getString(offset + 6), // title - cursor.isNull(offset + 7) ? null : cursor.getString(offset + 7), // content - cursor.isNull(offset + 8) ? null : cursor.getString(offset + 8), // deviceCode - cursor.isNull(offset + 9) ? null : cursor.getString(offset + 9), // jobId - cursor.isNull(offset + 10) ? null : cursor.getString(offset + 10), // isRead - cursor.isNull(offset + 11) ? null : cursor.getString(offset + 11) // noticeTime + cursor.isNull(offset + 0) ? null : cursor.getLong(offset + 0), // id + cursor.isNull(offset + 1) ? null : cursor.getString(offset + 1), // messageId + cursor.isNull(offset + 2) ? null : cursor.getString(offset + 2), // appid + cursor.isNull(offset + 3) ? null : cursor.getString(offset + 3), // clientId + cursor.isNull(offset + 4) ? null : cursor.getString(offset + 4), // taskId + cursor.isNull(offset + 5) ? null : cursor.getString(offset + 5), // userId + cursor.isNull(offset + 6) ? null : cursor.getString(offset + 6), // title + cursor.isNull(offset + 7) ? null : cursor.getString(offset + 7), // content + cursor.isNull(offset + 8) ? null : cursor.getString(offset + 8), // deviceCode + cursor.isNull(offset + 9) ? null : cursor.getString(offset + 9), // jobId + cursor.isNull(offset + 10) ? null : cursor.getString(offset + 10), // isRead + cursor.isNull(offset + 11) ? null : cursor.getString(offset + 11) // noticeTime ); return entity; } - + @Override public void readEntity(Cursor cursor, NoticeLocaleBean entity, int offset) { entity.setId(cursor.isNull(offset + 0) ? null : cursor.getLong(offset + 0)); @@ -244,17 +239,17 @@ entity.setJobId(cursor.isNull(offset + 9) ? null : cursor.getString(offset + 9)); entity.setIsRead(cursor.isNull(offset + 10) ? null : cursor.getString(offset + 10)); entity.setNoticeTime(cursor.isNull(offset + 11) ? null : cursor.getString(offset + 11)); - } - + } + @Override protected final Long updateKeyAfterInsert(NoticeLocaleBean entity, long rowId) { entity.setId(rowId); return rowId; } - + @Override public Long getKey(NoticeLocaleBean entity) { - if (entity != null) { + if(entity != null) { return entity.getId(); } else { return null; @@ -270,5 +265,5 @@ protected final boolean isEntityUpdateable() { return true; } - + } diff --git a/app/src/main/java/com/casic/app/smartwell/greendao/PipeLocalBeanDao.java b/app/src/main/java/com/casic/app/smartwell/greendao/PipeLocalBeanDao.java index aab4d3f..df5515a 100644 --- a/app/src/main/java/com/casic/app/smartwell/greendao/PipeLocalBeanDao.java +++ b/app/src/main/java/com/casic/app/smartwell/greendao/PipeLocalBeanDao.java @@ -12,10 +12,9 @@ import org.greenrobot.greendao.internal.DaoConfig; // THIS CODE IS GENERATED BY greenDAO, DO NOT EDIT. - -/** +/** * DAO for table "PIPE_LOCAL_BEAN". - */ +*/ public class PipeLocalBeanDao extends AbstractDao { public static final String TABLENAME = "PIPE_LOCAL_BEAN"; @@ -37,16 +36,14 @@ public PipeLocalBeanDao(DaoConfig config) { super(config); } - + public PipeLocalBeanDao(DaoConfig config, DaoSession daoSession) { super(config, daoSession); } - /** - * Creates the underlying database table. - */ + /** Creates the underlying database table. */ public static void createTable(Database db, boolean ifNotExists) { - String constraint = ifNotExists ? "IF NOT EXISTS " : ""; + String constraint = ifNotExists? "IF NOT EXISTS ": ""; db.execSQL("CREATE TABLE " + constraint + "\"PIPE_LOCAL_BEAN\" (" + // "\"_id\" INTEGER PRIMARY KEY AUTOINCREMENT ," + // 0: id "\"PIPE_CODE\" TEXT," + // 1: pipeCode @@ -56,9 +53,7 @@ "\"START_LONGITUDE_GD\" TEXT);"); // 5: startLongitudeGd } - /** - * Drops the underlying database table. - */ + /** Drops the underlying database table. */ public static void dropTable(Database db, boolean ifExists) { String sql = "DROP TABLE " + (ifExists ? "IF EXISTS " : "") + "\"PIPE_LOCAL_BEAN\""; db.execSQL(sql); @@ -67,32 +62,32 @@ @Override protected final void bindValues(DatabaseStatement stmt, PipeLocalBean entity) { stmt.clearBindings(); - + Long id = entity.getId(); if (id != null) { stmt.bindLong(1, id); } - + String pipeCode = entity.getPipeCode(); if (pipeCode != null) { stmt.bindString(2, pipeCode); } - + String endLatitudeGd = entity.getEndLatitudeGd(); if (endLatitudeGd != null) { stmt.bindString(3, endLatitudeGd); } - + String endLongitudeGd = entity.getEndLongitudeGd(); if (endLongitudeGd != null) { stmt.bindString(4, endLongitudeGd); } - + String startLatitudeGd = entity.getStartLatitudeGd(); if (startLatitudeGd != null) { stmt.bindString(5, startLatitudeGd); } - + String startLongitudeGd = entity.getStartLongitudeGd(); if (startLongitudeGd != null) { stmt.bindString(6, startLongitudeGd); @@ -102,32 +97,32 @@ @Override protected final void bindValues(SQLiteStatement stmt, PipeLocalBean entity) { stmt.clearBindings(); - + Long id = entity.getId(); if (id != null) { stmt.bindLong(1, id); } - + String pipeCode = entity.getPipeCode(); if (pipeCode != null) { stmt.bindString(2, pipeCode); } - + String endLatitudeGd = entity.getEndLatitudeGd(); if (endLatitudeGd != null) { stmt.bindString(3, endLatitudeGd); } - + String endLongitudeGd = entity.getEndLongitudeGd(); if (endLongitudeGd != null) { stmt.bindString(4, endLongitudeGd); } - + String startLatitudeGd = entity.getStartLatitudeGd(); if (startLatitudeGd != null) { stmt.bindString(5, startLatitudeGd); } - + String startLongitudeGd = entity.getStartLongitudeGd(); if (startLongitudeGd != null) { stmt.bindString(6, startLongitudeGd); @@ -137,21 +132,21 @@ @Override public Long readKey(Cursor cursor, int offset) { return cursor.isNull(offset + 0) ? null : cursor.getLong(offset + 0); - } + } @Override public PipeLocalBean readEntity(Cursor cursor, int offset) { PipeLocalBean entity = new PipeLocalBean( // - cursor.isNull(offset + 0) ? null : cursor.getLong(offset + 0), // id - cursor.isNull(offset + 1) ? null : cursor.getString(offset + 1), // pipeCode - cursor.isNull(offset + 2) ? null : cursor.getString(offset + 2), // endLatitudeGd - cursor.isNull(offset + 3) ? null : cursor.getString(offset + 3), // endLongitudeGd - cursor.isNull(offset + 4) ? null : cursor.getString(offset + 4), // startLatitudeGd - cursor.isNull(offset + 5) ? null : cursor.getString(offset + 5) // startLongitudeGd + cursor.isNull(offset + 0) ? null : cursor.getLong(offset + 0), // id + cursor.isNull(offset + 1) ? null : cursor.getString(offset + 1), // pipeCode + cursor.isNull(offset + 2) ? null : cursor.getString(offset + 2), // endLatitudeGd + cursor.isNull(offset + 3) ? null : cursor.getString(offset + 3), // endLongitudeGd + cursor.isNull(offset + 4) ? null : cursor.getString(offset + 4), // startLatitudeGd + cursor.isNull(offset + 5) ? null : cursor.getString(offset + 5) // startLongitudeGd ); return entity; } - + @Override public void readEntity(Cursor cursor, PipeLocalBean entity, int offset) { entity.setId(cursor.isNull(offset + 0) ? null : cursor.getLong(offset + 0)); @@ -160,17 +155,17 @@ entity.setEndLongitudeGd(cursor.isNull(offset + 3) ? null : cursor.getString(offset + 3)); entity.setStartLatitudeGd(cursor.isNull(offset + 4) ? null : cursor.getString(offset + 4)); entity.setStartLongitudeGd(cursor.isNull(offset + 5) ? null : cursor.getString(offset + 5)); - } - + } + @Override protected final Long updateKeyAfterInsert(PipeLocalBean entity, long rowId) { entity.setId(rowId); return rowId; } - + @Override public Long getKey(PipeLocalBean entity) { - if (entity != null) { + if(entity != null) { return entity.getId(); } else { return null; @@ -186,5 +181,5 @@ protected final boolean isEntityUpdateable() { return true; } - + } diff --git a/app/src/main/java/com/casic/app/smartwell/view/ChangePasswordActivity.kt b/app/src/main/java/com/casic/app/smartwell/view/ChangePasswordActivity.kt index 8e41039..9f1dd40 100644 --- a/app/src/main/java/com/casic/app/smartwell/view/ChangePasswordActivity.kt +++ b/app/src/main/java/com/casic/app/smartwell/view/ChangePasswordActivity.kt @@ -14,7 +14,7 @@ import com.pengxh.kt.lite.extensions.show import com.pengxh.kt.lite.utils.ActivityStackManager import com.pengxh.kt.lite.utils.LoadState -import com.pengxh.kt.lite.utils.LoadingDialogHub +import com.pengxh.kt.lite.utils.LoadingDialog import com.pengxh.kt.lite.widget.TitleBarView import java.nio.charset.StandardCharsets @@ -46,15 +46,15 @@ override fun observeRequestState() { userViewModel.loadState.observe(this) { when (it) { - is LoadState.Loading -> LoadingDialogHub.show(this, "修改中,请稍后") + is LoadState.Loading -> LoadingDialog.show(this, "修改中,请稍后") is LoadState.Success -> { - LoadingDialogHub.dismiss() + LoadingDialog.dismiss() AuthenticationHelper.removeToken() this.navigatePageTo() ActivityStackManager.finishAllActivity() } - else -> LoadingDialogHub.dismiss() + else -> LoadingDialog.dismiss() } } } diff --git a/app/src/main/java/com/casic/app/smartwell/view/DeployedWellActivity.kt b/app/src/main/java/com/casic/app/smartwell/view/DeployedWellActivity.kt index fb4339c..28a5078 100644 --- a/app/src/main/java/com/casic/app/smartwell/view/DeployedWellActivity.kt +++ b/app/src/main/java/com/casic/app/smartwell/view/DeployedWellActivity.kt @@ -83,8 +83,8 @@ } //添加分割线 - binding.deployedListView.addItemDecoration( - RecyclerViewItemOffsets(0, 5, 0, 5) + binding.recyclerView.addItemDecoration( + RecyclerViewItemOffsets(0, 7, 0, 7) ) } @@ -149,12 +149,11 @@ } else { item.deep.toString() + "m" } - viewHolder.setText(R.id.wellNameView, item.wellName) + viewHolder.setText(R.id.wellTypeView, item.wellTypeName) .setText(R.id.wellDepthView, "深:${deep}") .setText(R.id.wellCodeView, "点位编号:${item.wellCode}") - .setText(R.id.wellTypeView, "点位类型:${item.wellTypeName}") .setText(R.id.ownerShipView, "权属单位:${item.deptName}") - .setText(R.id.wellLocationView, "点位置:${item.position}") + .setText(R.id.wellLocationView, "点位位置:${item.position}") .setOnClickListener( R.id.operationButton, object : View.OnClickListener { override fun onClick(v: View?) { @@ -207,7 +206,7 @@ }) } } - binding.deployedListView.adapter = deployAdapter + binding.recyclerView.adapter = deployAdapter deployAdapter.setOnItemClickedListener(object : NormalRecyclerAdapter.OnItemClickedListener { override fun onItemClicked(position: Int, t: WellListModel.DataBean.RowsBean) { diff --git a/app/src/main/java/com/casic/app/smartwell/view/LoginActivity.kt b/app/src/main/java/com/casic/app/smartwell/view/LoginActivity.kt index e4bb0e3..834527b 100644 --- a/app/src/main/java/com/casic/app/smartwell/view/LoginActivity.kt +++ b/app/src/main/java/com/casic/app/smartwell/view/LoginActivity.kt @@ -21,7 +21,7 @@ import com.pengxh.kt.lite.extensions.navigatePageTo import com.pengxh.kt.lite.extensions.readAssetsFile import com.pengxh.kt.lite.extensions.show -import com.pengxh.kt.lite.utils.LoadingDialogHub +import com.pengxh.kt.lite.utils.LoadingDialog import com.pengxh.kt.lite.utils.SaveKeyValues import kotlinx.coroutines.Dispatchers import kotlinx.coroutines.launch @@ -106,11 +106,11 @@ override fun observeRequestState() { authenticateViewModel.loadState.observe(this) { - LoadingDialogHub.show(this, "登录中,请稍后") + LoadingDialog.show(this, "登录中,请稍后") } loginViewModel.loadState.observe(this) { - LoadingDialogHub.dismiss() + LoadingDialog.dismiss() } } diff --git a/app/src/main/java/com/casic/app/smartwell/view/OrderCompletedDetailActivity.kt b/app/src/main/java/com/casic/app/smartwell/view/OrderCompletedDetailActivity.kt index db8ad1f..75cd905 100644 --- a/app/src/main/java/com/casic/app/smartwell/view/OrderCompletedDetailActivity.kt +++ b/app/src/main/java/com/casic/app/smartwell/view/OrderCompletedDetailActivity.kt @@ -17,7 +17,7 @@ import com.pengxh.kt.lite.extensions.show import com.pengxh.kt.lite.utils.Constant import com.pengxh.kt.lite.utils.LoadState -import com.pengxh.kt.lite.utils.LoadingDialogHub +import com.pengxh.kt.lite.utils.LoadingDialog import com.pengxh.kt.lite.widget.TitleBarView import com.pengxh.kt.lite.widget.dialog.AlertMessageDialog @@ -44,7 +44,7 @@ } override fun initOnCreate(savedInstanceState: Bundle?) { - val jobId = intent.getStringExtra(Constant.INTENT_PARAM)!! + val jobId = intent.getStringExtra(Constant.INTENT_PARAM_KEY)!! orderViewModel = ViewModelProvider(this)[OrderViewModel::class.java] orderViewModel.getWorkOrderDetail(jobId) orderViewModel.detailModel.observe(this) { @@ -154,8 +154,8 @@ override fun observeRequestState() { orderViewModel.loadState.observe(this) { when (it) { - is LoadState.Loading -> LoadingDialogHub.show(this, "数据加载中,请稍后") - else -> LoadingDialogHub.dismiss() + is LoadState.Loading -> LoadingDialog.show(this, "数据加载中,请稍后") + else -> LoadingDialog.dismiss() } } } diff --git a/app/src/main/java/com/casic/app/smartwell/view/OrderInHandleDetailActivity.kt b/app/src/main/java/com/casic/app/smartwell/view/OrderInHandleDetailActivity.kt index d70a979..04a7d5d 100644 --- a/app/src/main/java/com/casic/app/smartwell/view/OrderInHandleDetailActivity.kt +++ b/app/src/main/java/com/casic/app/smartwell/view/OrderInHandleDetailActivity.kt @@ -38,7 +38,7 @@ import com.pengxh.kt.lite.extensions.show import com.pengxh.kt.lite.utils.Constant import com.pengxh.kt.lite.utils.LoadState -import com.pengxh.kt.lite.utils.LoadingDialogHub +import com.pengxh.kt.lite.utils.LoadingDialog import com.pengxh.kt.lite.widget.TitleBarView import com.pengxh.kt.lite.widget.dialog.AlertControlDialog import com.pengxh.kt.lite.widget.dialog.AlertMessageDialog @@ -93,7 +93,7 @@ ) binding.addImageRecyclerView.adapter = imageAdapter - val jobId = intent.getStringExtra(Constant.INTENT_PARAM)!!//初始化图片九宫格 + val jobId = intent.getStringExtra(Constant.INTENT_PARAM_KEY)!!//初始化图片九宫格 orderViewModel.getWorkOrderDetail(jobId) orderViewModel.detailModel.observe(this) { if (it.code == 200) { @@ -312,41 +312,41 @@ override fun observeRequestState() { orderViewModel.loadState.observe(this) { when (it) { - is LoadState.Loading -> LoadingDialogHub.show(this, "数据加载中,请稍后") - else -> LoadingDialogHub.dismiss() + is LoadState.Loading -> LoadingDialog.show(this, "数据加载中,请稍后") + else -> LoadingDialog.dismiss() } } uploadImageViewModel.loadState.observe(this) { when (it) { - LoadState.Loading -> LoadingDialogHub.show(this, "图片上传中,请稍后...") - else -> LoadingDialogHub.dismiss() + LoadState.Loading -> LoadingDialog.show(this, "图片上传中,请稍后...") + else -> LoadingDialog.dismiss() } } //转单状态处理 operationViewModel.loadState.observe(this) { when (it) { - is LoadState.Loading -> LoadingDialogHub.show(this, "转单中,请稍后") + is LoadState.Loading -> LoadingDialog.show(this, "转单中,请稍后") is LoadState.Success -> { - LoadingDialogHub.dismiss() + LoadingDialog.dismiss() this.finish() } - else -> LoadingDialogHub.dismiss() + else -> LoadingDialog.dismiss() } } //处理完成工单状态处理 operationViewModel.loadState.observe(this) { when (it) { - is LoadState.Loading -> LoadingDialogHub.show(this, "处理中,请稍后") + is LoadState.Loading -> LoadingDialog.show(this, "处理中,请稍后") is LoadState.Success -> { - LoadingDialogHub.dismiss() + LoadingDialog.dismiss() this.finish() } - else -> LoadingDialogHub.dismiss() + else -> LoadingDialog.dismiss() } } } diff --git a/app/src/main/java/com/casic/app/smartwell/view/OrderNotConfirmedDetailActivity.kt b/app/src/main/java/com/casic/app/smartwell/view/OrderNotConfirmedDetailActivity.kt index 8e036d2..687ec86 100644 --- a/app/src/main/java/com/casic/app/smartwell/view/OrderNotConfirmedDetailActivity.kt +++ b/app/src/main/java/com/casic/app/smartwell/view/OrderNotConfirmedDetailActivity.kt @@ -36,7 +36,7 @@ import com.pengxh.kt.lite.extensions.show import com.pengxh.kt.lite.utils.Constant import com.pengxh.kt.lite.utils.LoadState -import com.pengxh.kt.lite.utils.LoadingDialogHub +import com.pengxh.kt.lite.utils.LoadingDialog import com.pengxh.kt.lite.widget.TitleBarView import com.pengxh.kt.lite.widget.dialog.AlertControlDialog import com.pengxh.kt.lite.widget.dialog.AlertMessageDialog @@ -80,7 +80,7 @@ } override fun initOnCreate(savedInstanceState: Bundle?) { - val jobId = intent.getStringExtra(Constant.INTENT_PARAM)!! + val jobId = intent.getStringExtra(Constant.INTENT_PARAM_KEY)!! //初始化图片九宫格 //左外边距,左内边距,右内边距,右外边距 val viewWidth = getScreenWidth() - (10 + 10 + 10 + 10).dp2px(this) @@ -263,41 +263,41 @@ //数据加载状态处理 orderViewModel.loadState.observe(this) { when (it) { - is LoadState.Loading -> LoadingDialogHub.show(this, "数据加载中,请稍后") - else -> LoadingDialogHub.dismiss() + is LoadState.Loading -> LoadingDialog.show(this, "数据加载中,请稍后") + else -> LoadingDialog.dismiss() } } uploadImageViewModel.loadState.observe(this) { when (it) { - LoadState.Loading -> LoadingDialogHub.show(this, "图片上传中,请稍后") - else -> LoadingDialogHub.dismiss() + LoadState.Loading -> LoadingDialog.show(this, "图片上传中,请稍后") + else -> LoadingDialog.dismiss() } } //转单状态处理 operationViewModel.loadState.observe(this) { when (it) { - is LoadState.Loading -> LoadingDialogHub.show(this, "转单中,请稍后") + is LoadState.Loading -> LoadingDialog.show(this, "转单中,请稍后") is LoadState.Success -> { - LoadingDialogHub.dismiss() + LoadingDialog.dismiss() this.finish() } - else -> LoadingDialogHub.dismiss() + else -> LoadingDialog.dismiss() } } //确认工单状态处理 operationViewModel.loadState.observe(this) { when (it) { - is LoadState.Loading -> LoadingDialogHub.show(this, "处理中,请稍后") + is LoadState.Loading -> LoadingDialog.show(this, "处理中,请稍后") is LoadState.Success -> { - LoadingDialogHub.dismiss() + LoadingDialog.dismiss() this.finish() } - else -> LoadingDialogHub.dismiss() + else -> LoadingDialog.dismiss() } } } diff --git a/app/src/main/java/com/casic/app/smartwell/view/OrderNotProcessedDetailActivity.kt b/app/src/main/java/com/casic/app/smartwell/view/OrderNotProcessedDetailActivity.kt index d3f22dc..0c97a52 100644 --- a/app/src/main/java/com/casic/app/smartwell/view/OrderNotProcessedDetailActivity.kt +++ b/app/src/main/java/com/casic/app/smartwell/view/OrderNotProcessedDetailActivity.kt @@ -18,7 +18,7 @@ import com.pengxh.kt.lite.extensions.show import com.pengxh.kt.lite.utils.Constant import com.pengxh.kt.lite.utils.LoadState -import com.pengxh.kt.lite.utils.LoadingDialogHub +import com.pengxh.kt.lite.utils.LoadingDialog import com.pengxh.kt.lite.widget.TitleBarView import com.pengxh.kt.lite.widget.dialog.AlertControlDialog import com.pengxh.kt.lite.widget.dialog.AlertMessageDialog @@ -50,7 +50,7 @@ } override fun initOnCreate(savedInstanceState: Bundle?) { - this.jobId = intent.getStringExtra(Constant.INTENT_PARAM)!! + this.jobId = intent.getStringExtra(Constant.INTENT_PARAM_KEY)!! orderViewModel = ViewModelProvider(this)[OrderViewModel::class.java] operationViewModel = ViewModelProvider(this)[OperationViewModel::class.java] wellViewModel = ViewModelProvider(this)[WellViewModel::class.java] @@ -162,21 +162,21 @@ //数据加载状态处理 orderViewModel.loadState.observe(this) { when (it) { - is LoadState.Loading -> LoadingDialogHub.show(this, "数据加载中,请稍后") - else -> LoadingDialogHub.dismiss() + is LoadState.Loading -> LoadingDialog.show(this, "数据加载中,请稍后") + else -> LoadingDialog.dismiss() } } //接单状态处理 operationViewModel.loadState.observe(this) { when (it) { - is LoadState.Loading -> LoadingDialogHub.show(this, "接单中,请稍后") + is LoadState.Loading -> LoadingDialog.show(this, "接单中,请稍后") is LoadState.Success -> { - LoadingDialogHub.dismiss() + LoadingDialog.dismiss() this.finish() } - else -> LoadingDialogHub.dismiss() + else -> LoadingDialog.dismiss() } } } diff --git a/app/src/main/java/com/casic/app/smartwell/view/SearchResultActivity.kt b/app/src/main/java/com/casic/app/smartwell/view/SearchResultActivity.kt index 6a92917..4f3a674 100644 --- a/app/src/main/java/com/casic/app/smartwell/view/SearchResultActivity.kt +++ b/app/src/main/java/com/casic/app/smartwell/view/SearchResultActivity.kt @@ -19,7 +19,7 @@ import com.pengxh.kt.lite.extensions.show import com.pengxh.kt.lite.utils.Constant import com.pengxh.kt.lite.utils.LoadState -import com.pengxh.kt.lite.utils.LoadingDialogHub +import com.pengxh.kt.lite.utils.LoadingDialog import com.pengxh.kt.lite.utils.WeakReferenceHandler import com.pengxh.kt.lite.widget.TitleBarView import com.pengxh.kt.lite.widget.dialog.AlertControlDialog @@ -56,7 +56,7 @@ } override fun initOnCreate(savedInstanceState: Bundle?) { - args = intent.getStringArrayListExtra(Constant.INTENT_PARAM)!! + args = intent.getStringArrayListExtra(Constant.INTENT_PARAM_KEY)!! orderViewModel = ViewModelProvider(this)[OrderViewModel::class.java] operationViewModel = ViewModelProvider(this)[OperationViewModel::class.java] @@ -101,24 +101,24 @@ } } - binding.resultRecyclerView.addItemDecoration( - RecyclerViewItemOffsets(0, 5, 0, 5) + binding.recyclerView.addItemDecoration( + RecyclerViewItemOffsets(0, 7, 0, 7) ) } override fun observeRequestState() { orderViewModel.loadState.observe(this) { when (it) { - is LoadState.Loading -> LoadingDialogHub.show(this, "数据加载中,请稍后") - else -> LoadingDialogHub.dismiss() + is LoadState.Loading -> LoadingDialog.show(this, "数据加载中,请稍后") + else -> LoadingDialog.dismiss() } } //接单状态处理 operationViewModel.loadState.observe(this) { when (it) { - is LoadState.Loading -> LoadingDialogHub.show(this, "接单中,请稍后") + is LoadState.Loading -> LoadingDialog.show(this, "接单中,请稍后") is LoadState.Success -> { - LoadingDialogHub.dismiss() + LoadingDialog.dismiss() //接单成功之后刷新列表 dataBeans.removeAt(clickedPosition) searchResultAdapter.notifyItemRemoved(clickedPosition) @@ -127,7 +127,7 @@ ) } - else -> LoadingDialogHub.dismiss() + else -> LoadingDialog.dismiss() } } } @@ -162,7 +162,7 @@ } else { binding.emptyInclude.emptyView.hide() searchResultAdapter = SearchResultAdapter(this, dataBeans) - binding.resultRecyclerView.adapter = searchResultAdapter + binding.recyclerView.adapter = searchResultAdapter searchResultAdapter.setOnItemClickListener(object : SearchResultAdapter.OnItemClickListener { override fun onClicked(position: Int) { diff --git a/app/build.gradle b/app/build.gradle index 296fb6f..c18c251 100644 --- a/app/build.gradle +++ b/app/build.gradle @@ -40,10 +40,6 @@ // VIVO 相关应用参数 VIVO_APP_ID : "105749048", VIVO_APP_KEY : "e460fbf2c689e0f8c58ecc6aa62e1803", - - // 小米相关应用参数 -// XIAOMI_APP_ID : "", -// XIAOMI_APP_KEY : "", ] // 版本名后面添加一句话,意思就是flavor dimension 它的维度就是该版本号,多渠道打包很重要 @@ -107,7 +103,7 @@ dependencies { implementation fileTree(dir: 'libs', include: ['*.jar']) //基础依赖库 - implementation 'com.github.AndroidCoderPeng:Kotlin-lite-lib:1.0.10' + implementation 'com.github.AndroidCoderPeng:Kotlin-lite-lib:1.1.0' implementation 'androidx.appcompat:appcompat:1.6.1' implementation 'androidx.core:core-ktx:1.9.0' implementation 'androidx.constraintlayout:constraintlayout:2.1.4' @@ -165,8 +161,6 @@ implementation 'commons-codec:commons-codec:1.15' implementation 'com.android.support:support-annotations:28.0.0' implementation 'com.assist-v3:vivo:3.1.2' // vivo -// implementation 'com.getui.opt:xmp:3.3.1' // 小米 - //数据库框架 implementation 'org.greenrobot:greendao:3.3.0' //数据库升级 diff --git a/app/src/main/AndroidManifest.xml b/app/src/main/AndroidManifest.xml index c0af158..e0519bf 100644 --- a/app/src/main/AndroidManifest.xml +++ b/app/src/main/AndroidManifest.xml @@ -90,10 +90,10 @@ - + + android:value="ee96d8b5e12de3fbb29949efd57418a8" /> () @@ -150,7 +158,7 @@ val cameraPosition = CameraPosition(centerLatLng, 14f, 0f, 0f) val cameraUpdate = CameraUpdateFactory.newCameraPosition(cameraPosition) withContext(Dispatchers.Main) { - LoadingDialogHub.dismiss() + LoadingDialog.dismiss() aMap.animateCamera(cameraUpdate, 1500, null) } } @@ -239,11 +247,6 @@ } override fun initEvent() { - binding.rightOptionView.setOnClickListener { - val x = binding.rightOptionView.width - easyPopupWindow.width - easyPopupWindow.showAsDropDown(binding.rightOptionView, x, 0) - } - //撤防点位 binding.unDeployedLayout.setOnClickListener { requireContext().navigatePageTo() @@ -263,11 +266,11 @@ override fun observeRequestState() { wellViewModel.loadState.observe(this) { when (it) { - is LoadState.Loading -> LoadingDialogHub.show( + is LoadState.Loading -> LoadingDialog.show( requireActivity(), "数据加载中,请稍后..." ) - else -> LoadingDialogHub.dismiss() + else -> LoadingDialog.dismiss() } } } @@ -376,7 +379,7 @@ }).build().show() } }) - infoPopup.showAsDropDown(binding.rightOptionView) +// infoPopup.showAsDropDown(binding.rightOptionView) } override fun onCameraChange(p0: CameraPosition?) { diff --git a/app/src/main/java/com/casic/app/smartwell/fragment/HomePageNoClusterFragment.kt b/app/src/main/java/com/casic/app/smartwell/fragment/HomePageNoClusterFragment.kt index 802426a..b25f743 100644 --- a/app/src/main/java/com/casic/app/smartwell/fragment/HomePageNoClusterFragment.kt +++ b/app/src/main/java/com/casic/app/smartwell/fragment/HomePageNoClusterFragment.kt @@ -38,8 +38,9 @@ import com.pengxh.kt.lite.extensions.navigatePageTo import com.pengxh.kt.lite.extensions.show import com.pengxh.kt.lite.utils.LoadState -import com.pengxh.kt.lite.utils.LoadingDialogHub +import com.pengxh.kt.lite.utils.LoadingDialog import com.pengxh.kt.lite.widget.EasyPopupWindow +import com.pengxh.kt.lite.widget.TitleBarView import com.pengxh.kt.lite.widget.dialog.AlertControlDialog import kotlinx.coroutines.Dispatchers import kotlinx.coroutines.launch @@ -78,7 +79,15 @@ override fun setupTopBarLayout() { binding.rootView.initImmersionBar(this, false, R.color.mainThemeColor) - binding.titleView.text = "首页" + binding.titleView.setOnClickListener(object : TitleBarView.OnClickListener { + override fun onLeftClick() { + + } + + override fun onRightClick() { + easyPopupWindow.showAsDropDown(binding.titleView, binding.titleView.width, 0) + } + }) } override fun initOnCreate(savedInstanceState: Bundle?) { @@ -112,7 +121,7 @@ //渲染井位置 lifecycleScope.launch(Dispatchers.Main) { - LoadingDialogHub.show(requireActivity(), "数据加载中,请稍后") + LoadingDialog.show(requireActivity(), "数据加载中,请稍后") withContext(Dispatchers.IO) { //取Well缓存 val allMarkerOptions = ArrayList() @@ -144,7 +153,7 @@ val cameraPosition = CameraPosition(centerLatLng, 14f, 0f, 0f) val cameraUpdate = CameraUpdateFactory.newCameraPosition(cameraPosition) withContext(Dispatchers.Main) { - LoadingDialogHub.dismiss() + LoadingDialog.dismiss() aMap.animateCamera(cameraUpdate, 1500, null) } } @@ -238,11 +247,6 @@ } override fun initEvent() { - binding.rightOptionView.setOnClickListener { - val x = binding.rightOptionView.width - easyPopupWindow.width - easyPopupWindow.showAsDropDown(binding.rightOptionView, x, 0) - } - //撤防点位 binding.unDeployedLayout.setOnClickListener { requireContext().navigatePageTo() @@ -262,11 +266,11 @@ override fun observeRequestState() { wellViewModel.loadState.observe(this) { when (it) { - is LoadState.Loading -> LoadingDialogHub.show( + is LoadState.Loading -> LoadingDialog.show( requireActivity(), "数据加载中,请稍后..." ) - else -> LoadingDialogHub.dismiss() + else -> LoadingDialog.dismiss() } } } diff --git a/app/src/main/java/com/casic/app/smartwell/fragment/MinePageFragment.kt b/app/src/main/java/com/casic/app/smartwell/fragment/MinePageFragment.kt index 09a570c..dcb48f8 100644 --- a/app/src/main/java/com/casic/app/smartwell/fragment/MinePageFragment.kt +++ b/app/src/main/java/com/casic/app/smartwell/fragment/MinePageFragment.kt @@ -35,7 +35,7 @@ import com.pengxh.kt.lite.utils.ActivityStackManager import com.pengxh.kt.lite.utils.FileDownloadManager import com.pengxh.kt.lite.utils.LoadState -import com.pengxh.kt.lite.utils.LoadingDialogHub +import com.pengxh.kt.lite.utils.LoadingDialog import com.pengxh.kt.lite.widget.dialog.AlertControlDialog import com.pengxh.kt.lite.widget.dialog.BottomActionSheet import kotlinx.coroutines.Dispatchers @@ -60,7 +60,6 @@ override fun setupTopBarLayout() { binding.rootView.initImmersionBar(this, false, R.color.mainThemeColor) - binding.titleInclude.titleView.text = "我的" } override fun initOnCreate(savedInstanceState: Bundle?) { @@ -155,27 +154,27 @@ override fun observeRequestState() { userViewModel.loadState.observe(this) { when (it) { - is LoadState.Loading -> LoadingDialogHub.show( + is LoadState.Loading -> LoadingDialog.show( requireActivity(), "检查版本中,请稍后" ) - else -> LoadingDialogHub.dismiss() + else -> LoadingDialog.dismiss() } } wellViewModel.loadState.observe(this) { when (it) { - is LoadState.Loading -> LoadingDialogHub.show( + is LoadState.Loading -> LoadingDialog.show( requireActivity(), "数据更新中,请稍后" ) is LoadState.Fail -> { - LoadingDialogHub.dismiss() + LoadingDialog.dismiss() "数据更新超时".show(requireContext()) } else -> { - LoadingDialogHub.dismiss() + LoadingDialog.dismiss() AlertControlDialog.Builder().setContext(requireContext()).setTitle("温馨提示") .setMessage("数据更新成功,请重启应用").setNegativeButton("取消") .setPositiveButton("确定").setOnDialogButtonClickListener(object : @@ -197,17 +196,17 @@ lineViewModel.loadState.observe(this) { when (it) { - is LoadState.Loading -> LoadingDialogHub.show( + is LoadState.Loading -> LoadingDialog.show( requireActivity(), "数据更新中,请稍后" ) is LoadState.Fail -> { - LoadingDialogHub.dismiss() + LoadingDialog.dismiss() "数据更新超时".show(requireContext()) } else -> { - LoadingDialogHub.dismiss() + LoadingDialog.dismiss() AlertControlDialog.Builder().setContext(requireContext()).setTitle("温馨提示") .setMessage("数据更新成功,请重启应用").setNegativeButton("取消") .setPositiveButton("确定").setOnDialogButtonClickListener(object : diff --git a/app/src/main/java/com/casic/app/smartwell/fragment/NoticePageFragment.kt b/app/src/main/java/com/casic/app/smartwell/fragment/NoticePageFragment.kt index 171b555..3c93f54 100644 --- a/app/src/main/java/com/casic/app/smartwell/fragment/NoticePageFragment.kt +++ b/app/src/main/java/com/casic/app/smartwell/fragment/NoticePageFragment.kt @@ -48,7 +48,6 @@ override fun setupTopBarLayout() { binding.rootView.initImmersionBar(this, false, R.color.mainThemeColor) - binding.titleInclude.titleView.text = "消息" } override fun initOnCreate(savedInstanceState: Bundle?) { diff --git a/app/src/main/java/com/casic/app/smartwell/fragment/OrderListFragment.kt b/app/src/main/java/com/casic/app/smartwell/fragment/OrderListFragment.kt index 93ff35b..5e38acb 100644 --- a/app/src/main/java/com/casic/app/smartwell/fragment/OrderListFragment.kt +++ b/app/src/main/java/com/casic/app/smartwell/fragment/OrderListFragment.kt @@ -12,6 +12,7 @@ import com.casic.app.smartwell.view.SearchOrderActivity import com.pengxh.kt.lite.base.KotlinBaseFragment import com.pengxh.kt.lite.extensions.navigatePageTo +import com.pengxh.kt.lite.widget.TitleBarView class OrderListFragment : KotlinBaseFragment() { @@ -25,15 +26,22 @@ } override fun initViewBinding( - inflater: LayoutInflater, - container: ViewGroup? + inflater: LayoutInflater, container: ViewGroup? ): FragmentOrderBinding { return FragmentOrderBinding.inflate(inflater, container, false) } override fun setupTopBarLayout() { binding.rootView.initImmersionBar(this, false, R.color.mainThemeColor) - binding.titleView.text = "工单" + binding.titleView.setOnClickListener(object : TitleBarView.OnClickListener { + override fun onLeftClick() { + + } + + override fun onRightClick() { + requireContext().navigatePageTo() + } + }) } override fun initOnCreate(savedInstanceState: Bundle?) { @@ -51,8 +59,6 @@ } override fun initEvent() { - binding.rightOptionView.setOnClickListener { - requireContext().navigatePageTo() - } + } } \ No newline at end of file diff --git a/app/src/main/java/com/casic/app/smartwell/fragment/OrderNotProcessedFragment.kt b/app/src/main/java/com/casic/app/smartwell/fragment/OrderNotProcessedFragment.kt index 0b3d09d..2b6f21d 100644 --- a/app/src/main/java/com/casic/app/smartwell/fragment/OrderNotProcessedFragment.kt +++ b/app/src/main/java/com/casic/app/smartwell/fragment/OrderNotProcessedFragment.kt @@ -18,7 +18,7 @@ import com.pengxh.kt.lite.extensions.navigatePageTo import com.pengxh.kt.lite.extensions.show import com.pengxh.kt.lite.utils.LoadState -import com.pengxh.kt.lite.utils.LoadingDialogHub +import com.pengxh.kt.lite.utils.LoadingDialog import com.pengxh.kt.lite.utils.WeakReferenceHandler import com.pengxh.kt.lite.widget.dialog.AlertControlDialog @@ -78,8 +78,8 @@ operationViewModel = ViewModelProvider(this)[OperationViewModel::class.java] - binding.notProcessedView.addItemDecoration( - RecyclerViewItemOffsets(0, 5, 0, 5) + binding.recyclerView.addItemDecoration( + RecyclerViewItemOffsets(0, 7, 0, 7) ) } @@ -87,9 +87,9 @@ //接单状态处理 operationViewModel.loadState.observe(this) { when (it) { - is LoadState.Loading -> LoadingDialogHub.show(requireActivity(), "接单中,请稍后") + is LoadState.Loading -> LoadingDialog.show(requireActivity(), "接单中,请稍后") is LoadState.Success -> { - LoadingDialogHub.dismiss() + LoadingDialog.dismiss() //接单成功之后刷新列表 dataBeans.removeAt(clickedPosition) notProcessedAdapter.notifyItemRemoved(clickedPosition) @@ -98,7 +98,7 @@ ) } - else -> LoadingDialogHub.dismiss() + else -> LoadingDialog.dismiss() } } } @@ -131,7 +131,7 @@ } else { binding.emptyInclude.emptyView.hide() notProcessedAdapter = OrderNotProcessedAdapter(requireContext(), dataBeans) - binding.notProcessedView.adapter = notProcessedAdapter + binding.recyclerView.adapter = notProcessedAdapter notProcessedAdapter.setOnItemClickListener(object : OrderNotProcessedAdapter.OnItemClickListener { override fun onClicked(position: Int) { diff --git a/app/src/main/java/com/casic/app/smartwell/fragment/OvertimeNotAcceptFragment.kt b/app/src/main/java/com/casic/app/smartwell/fragment/OvertimeNotAcceptFragment.kt index a198545..9b318ca 100644 --- a/app/src/main/java/com/casic/app/smartwell/fragment/OvertimeNotAcceptFragment.kt +++ b/app/src/main/java/com/casic/app/smartwell/fragment/OvertimeNotAcceptFragment.kt @@ -18,7 +18,7 @@ import com.pengxh.kt.lite.extensions.navigatePageTo import com.pengxh.kt.lite.extensions.show import com.pengxh.kt.lite.utils.LoadState -import com.pengxh.kt.lite.utils.LoadingDialogHub +import com.pengxh.kt.lite.utils.LoadingDialog import com.pengxh.kt.lite.utils.WeakReferenceHandler import com.pengxh.kt.lite.widget.dialog.AlertControlDialog @@ -81,8 +81,8 @@ operationViewModel = ViewModelProvider(this)[OperationViewModel::class.java] - binding.notProcessedView.addItemDecoration( - RecyclerViewItemOffsets(0, 5, 0, 5) + binding.recyclerView.addItemDecoration( + RecyclerViewItemOffsets(0, 7, 0, 7) ) } @@ -90,9 +90,9 @@ //接单状态处理 operationViewModel.loadState.observe(this) { when (it) { - is LoadState.Loading -> LoadingDialogHub.show(requireActivity(), "接单中,请稍后") + is LoadState.Loading -> LoadingDialog.show(requireActivity(), "接单中,请稍后") is LoadState.Success -> { - LoadingDialogHub.dismiss() + LoadingDialog.dismiss() //接单成功之后刷新列表 dataBeans.removeAt(clickedPosition) notProcessedAdapter.notifyItemRemoved(clickedPosition) @@ -101,7 +101,7 @@ ) } - else -> LoadingDialogHub.dismiss() + else -> LoadingDialog.dismiss() } } } @@ -134,7 +134,7 @@ } else { binding.emptyInclude.emptyView.hide() notProcessedAdapter = OrderNotProcessedAdapter(requireContext(), dataBeans) - binding.notProcessedView.adapter = notProcessedAdapter + binding.recyclerView.adapter = notProcessedAdapter notProcessedAdapter.setOnItemClickListener(object : OrderNotProcessedAdapter.OnItemClickListener { override fun onClicked(position: Int) { diff --git a/app/src/main/java/com/casic/app/smartwell/greendao/DaoMaster.java b/app/src/main/java/com/casic/app/smartwell/greendao/DaoMaster.java index fdcf3a7..1e52b74 100644 --- a/app/src/main/java/com/casic/app/smartwell/greendao/DaoMaster.java +++ b/app/src/main/java/com/casic/app/smartwell/greendao/DaoMaster.java @@ -13,25 +13,20 @@ // THIS CODE IS GENERATED BY greenDAO, DO NOT EDIT. - /** * Master of DAO (schema version 4): knows all DAOs. */ public class DaoMaster extends AbstractDaoMaster { public static final int SCHEMA_VERSION = 4; - /** - * Creates underlying database table using DAOs. - */ + /** Creates underlying database table using DAOs. */ public static void createAllTables(Database db, boolean ifNotExists) { MapWellLocalBeanDao.createTable(db, ifNotExists); NoticeLocaleBeanDao.createTable(db, ifNotExists); PipeLocalBeanDao.createTable(db, ifNotExists); } - /** - * Drops underlying database table using DAOs. - */ + /** Drops underlying database table using DAOs. */ public static void dropAllTables(Database db, boolean ifExists) { MapWellLocalBeanDao.dropTable(db, ifExists); NoticeLocaleBeanDao.dropTable(db, ifExists); @@ -86,9 +81,7 @@ } } - /** - * WARNING: Drops all table on Upgrade! Use only during development. - */ + /** WARNING: Drops all table on Upgrade! Use only during development. */ public static class DevOpenHelper extends OpenHelper { public DevOpenHelper(Context context, String name) { super(context, name); diff --git a/app/src/main/java/com/casic/app/smartwell/greendao/DaoSession.java b/app/src/main/java/com/casic/app/smartwell/greendao/DaoSession.java index 0b36d17..3e40e3b 100644 --- a/app/src/main/java/com/casic/app/smartwell/greendao/DaoSession.java +++ b/app/src/main/java/com/casic/app/smartwell/greendao/DaoSession.java @@ -16,7 +16,7 @@ /** * {@inheritDoc} - * + * * @see org.greenrobot.greendao.AbstractDaoSession */ public class DaoSession extends AbstractDaoSession { @@ -50,7 +50,7 @@ registerDao(NoticeLocaleBean.class, noticeLocaleBeanDao); registerDao(PipeLocalBean.class, pipeLocalBeanDao); } - + public void clear() { mapWellLocalBeanDaoConfig.clearIdentityScope(); noticeLocaleBeanDaoConfig.clearIdentityScope(); diff --git a/app/src/main/java/com/casic/app/smartwell/greendao/MapWellLocalBeanDao.java b/app/src/main/java/com/casic/app/smartwell/greendao/MapWellLocalBeanDao.java index 8908fda..407bc92 100644 --- a/app/src/main/java/com/casic/app/smartwell/greendao/MapWellLocalBeanDao.java +++ b/app/src/main/java/com/casic/app/smartwell/greendao/MapWellLocalBeanDao.java @@ -12,10 +12,9 @@ import org.greenrobot.greendao.internal.DaoConfig; // THIS CODE IS GENERATED BY greenDAO, DO NOT EDIT. - -/** +/** * DAO for table "MAP_WELL_LOCAL_BEAN". - */ +*/ public class MapWellLocalBeanDao extends AbstractDao { public static final String TABLENAME = "MAP_WELL_LOCAL_BEAN"; @@ -57,16 +56,14 @@ public MapWellLocalBeanDao(DaoConfig config) { super(config); } - + public MapWellLocalBeanDao(DaoConfig config, DaoSession daoSession) { super(config, daoSession); } - /** - * Creates the underlying database table. - */ + /** Creates the underlying database table. */ public static void createTable(Database db, boolean ifNotExists) { - String constraint = ifNotExists ? "IF NOT EXISTS " : ""; + String constraint = ifNotExists? "IF NOT EXISTS ": ""; db.execSQL("CREATE TABLE " + constraint + "\"MAP_WELL_LOCAL_BEAN\" (" + // "\"_id\" INTEGER PRIMARY KEY AUTOINCREMENT ," + // 0: kId "\"AREA\" TEXT," + // 1: area @@ -96,9 +93,7 @@ "\"WELL_TYPE_NAME\" TEXT);"); // 25: wellTypeName } - /** - * Drops the underlying database table. - */ + /** Drops the underlying database table. */ public static void dropTable(Database db, boolean ifExists) { String sql = "DROP TABLE " + (ifExists ? "IF EXISTS " : "") + "\"MAP_WELL_LOCAL_BEAN\""; db.execSQL(sql); @@ -107,132 +102,132 @@ @Override protected final void bindValues(DatabaseStatement stmt, MapWellLocalBean entity) { stmt.clearBindings(); - + Long kId = entity.getKId(); if (kId != null) { stmt.bindLong(1, kId); } - + String area = entity.getArea(); if (area != null) { stmt.bindString(2, area); } - + String bfzt = entity.getBfzt(); if (bfzt != null) { stmt.bindString(3, bfzt); } - + String bfztName = entity.getBfztName(); if (bfztName != null) { stmt.bindString(4, bfztName); } - + String coordinateX = entity.getCoordinateX(); if (coordinateX != null) { stmt.bindString(5, coordinateX); } - + String coordinateY = entity.getCoordinateY(); if (coordinateY != null) { stmt.bindString(6, coordinateY); } - + String deep = entity.getDeep(); if (deep != null) { stmt.bindString(7, deep); } - + String deptName = entity.getDeptName(); if (deptName != null) { stmt.bindString(8, deptName); } - + String deptid = entity.getDeptid(); if (deptid != null) { stmt.bindString(9, deptid); } - + String id = entity.getId(); if (id != null) { stmt.bindString(10, id); } - + String latBaidu = entity.getLatBaidu(); if (latBaidu != null) { stmt.bindString(11, latBaidu); } - + String latGaode = entity.getLatGaode(); if (latGaode != null) { stmt.bindString(12, latGaode); } - + String lngBaidu = entity.getLngBaidu(); if (lngBaidu != null) { stmt.bindString(13, lngBaidu); } - + String lngGaode = entity.getLngGaode(); if (lngGaode != null) { stmt.bindString(14, lngGaode); } - + String notes = entity.getNotes(); if (notes != null) { stmt.bindString(15, notes); } - + String photos = entity.getPhotos(); if (photos != null) { stmt.bindString(16, photos); } - + String position = entity.getPosition(); if (position != null) { stmt.bindString(17, position); } - + String staff = entity.getStaff(); if (staff != null) { stmt.bindString(18, staff); } - + String tel = entity.getTel(); if (tel != null) { stmt.bindString(19, tel); } - + String ts = entity.getTs(); if (ts != null) { stmt.bindString(20, ts); } - + String valid = entity.getValid(); if (valid != null) { stmt.bindString(21, valid); } - + String watchData = entity.getWatchData(); if (watchData != null) { stmt.bindString(22, watchData); } - + String wellCode = entity.getWellCode(); if (wellCode != null) { stmt.bindString(23, wellCode); } - + String wellName = entity.getWellName(); if (wellName != null) { stmt.bindString(24, wellName); } - + String wellType = entity.getWellType(); if (wellType != null) { stmt.bindString(25, wellType); } - + String wellTypeName = entity.getWellTypeName(); if (wellTypeName != null) { stmt.bindString(26, wellTypeName); @@ -242,132 +237,132 @@ @Override protected final void bindValues(SQLiteStatement stmt, MapWellLocalBean entity) { stmt.clearBindings(); - + Long kId = entity.getKId(); if (kId != null) { stmt.bindLong(1, kId); } - + String area = entity.getArea(); if (area != null) { stmt.bindString(2, area); } - + String bfzt = entity.getBfzt(); if (bfzt != null) { stmt.bindString(3, bfzt); } - + String bfztName = entity.getBfztName(); if (bfztName != null) { stmt.bindString(4, bfztName); } - + String coordinateX = entity.getCoordinateX(); if (coordinateX != null) { stmt.bindString(5, coordinateX); } - + String coordinateY = entity.getCoordinateY(); if (coordinateY != null) { stmt.bindString(6, coordinateY); } - + String deep = entity.getDeep(); if (deep != null) { stmt.bindString(7, deep); } - + String deptName = entity.getDeptName(); if (deptName != null) { stmt.bindString(8, deptName); } - + String deptid = entity.getDeptid(); if (deptid != null) { stmt.bindString(9, deptid); } - + String id = entity.getId(); if (id != null) { stmt.bindString(10, id); } - + String latBaidu = entity.getLatBaidu(); if (latBaidu != null) { stmt.bindString(11, latBaidu); } - + String latGaode = entity.getLatGaode(); if (latGaode != null) { stmt.bindString(12, latGaode); } - + String lngBaidu = entity.getLngBaidu(); if (lngBaidu != null) { stmt.bindString(13, lngBaidu); } - + String lngGaode = entity.getLngGaode(); if (lngGaode != null) { stmt.bindString(14, lngGaode); } - + String notes = entity.getNotes(); if (notes != null) { stmt.bindString(15, notes); } - + String photos = entity.getPhotos(); if (photos != null) { stmt.bindString(16, photos); } - + String position = entity.getPosition(); if (position != null) { stmt.bindString(17, position); } - + String staff = entity.getStaff(); if (staff != null) { stmt.bindString(18, staff); } - + String tel = entity.getTel(); if (tel != null) { stmt.bindString(19, tel); } - + String ts = entity.getTs(); if (ts != null) { stmt.bindString(20, ts); } - + String valid = entity.getValid(); if (valid != null) { stmt.bindString(21, valid); } - + String watchData = entity.getWatchData(); if (watchData != null) { stmt.bindString(22, watchData); } - + String wellCode = entity.getWellCode(); if (wellCode != null) { stmt.bindString(23, wellCode); } - + String wellName = entity.getWellName(); if (wellName != null) { stmt.bindString(24, wellName); } - + String wellType = entity.getWellType(); if (wellType != null) { stmt.bindString(25, wellType); } - + String wellTypeName = entity.getWellTypeName(); if (wellTypeName != null) { stmt.bindString(26, wellTypeName); @@ -377,41 +372,41 @@ @Override public Long readKey(Cursor cursor, int offset) { return cursor.isNull(offset + 0) ? null : cursor.getLong(offset + 0); - } + } @Override public MapWellLocalBean readEntity(Cursor cursor, int offset) { MapWellLocalBean entity = new MapWellLocalBean( // - cursor.isNull(offset + 0) ? null : cursor.getLong(offset + 0), // kId - cursor.isNull(offset + 1) ? null : cursor.getString(offset + 1), // area - cursor.isNull(offset + 2) ? null : cursor.getString(offset + 2), // bfzt - cursor.isNull(offset + 3) ? null : cursor.getString(offset + 3), // bfztName - cursor.isNull(offset + 4) ? null : cursor.getString(offset + 4), // coordinateX - cursor.isNull(offset + 5) ? null : cursor.getString(offset + 5), // coordinateY - cursor.isNull(offset + 6) ? null : cursor.getString(offset + 6), // deep - cursor.isNull(offset + 7) ? null : cursor.getString(offset + 7), // deptName - cursor.isNull(offset + 8) ? null : cursor.getString(offset + 8), // deptid - cursor.isNull(offset + 9) ? null : cursor.getString(offset + 9), // id - cursor.isNull(offset + 10) ? null : cursor.getString(offset + 10), // latBaidu - cursor.isNull(offset + 11) ? null : cursor.getString(offset + 11), // latGaode - cursor.isNull(offset + 12) ? null : cursor.getString(offset + 12), // lngBaidu - cursor.isNull(offset + 13) ? null : cursor.getString(offset + 13), // lngGaode - cursor.isNull(offset + 14) ? null : cursor.getString(offset + 14), // notes - cursor.isNull(offset + 15) ? null : cursor.getString(offset + 15), // photos - cursor.isNull(offset + 16) ? null : cursor.getString(offset + 16), // position - cursor.isNull(offset + 17) ? null : cursor.getString(offset + 17), // staff - cursor.isNull(offset + 18) ? null : cursor.getString(offset + 18), // tel - cursor.isNull(offset + 19) ? null : cursor.getString(offset + 19), // ts - cursor.isNull(offset + 20) ? null : cursor.getString(offset + 20), // valid - cursor.isNull(offset + 21) ? null : cursor.getString(offset + 21), // watchData - cursor.isNull(offset + 22) ? null : cursor.getString(offset + 22), // wellCode - cursor.isNull(offset + 23) ? null : cursor.getString(offset + 23), // wellName - cursor.isNull(offset + 24) ? null : cursor.getString(offset + 24), // wellType - cursor.isNull(offset + 25) ? null : cursor.getString(offset + 25) // wellTypeName + cursor.isNull(offset + 0) ? null : cursor.getLong(offset + 0), // kId + cursor.isNull(offset + 1) ? null : cursor.getString(offset + 1), // area + cursor.isNull(offset + 2) ? null : cursor.getString(offset + 2), // bfzt + cursor.isNull(offset + 3) ? null : cursor.getString(offset + 3), // bfztName + cursor.isNull(offset + 4) ? null : cursor.getString(offset + 4), // coordinateX + cursor.isNull(offset + 5) ? null : cursor.getString(offset + 5), // coordinateY + cursor.isNull(offset + 6) ? null : cursor.getString(offset + 6), // deep + cursor.isNull(offset + 7) ? null : cursor.getString(offset + 7), // deptName + cursor.isNull(offset + 8) ? null : cursor.getString(offset + 8), // deptid + cursor.isNull(offset + 9) ? null : cursor.getString(offset + 9), // id + cursor.isNull(offset + 10) ? null : cursor.getString(offset + 10), // latBaidu + cursor.isNull(offset + 11) ? null : cursor.getString(offset + 11), // latGaode + cursor.isNull(offset + 12) ? null : cursor.getString(offset + 12), // lngBaidu + cursor.isNull(offset + 13) ? null : cursor.getString(offset + 13), // lngGaode + cursor.isNull(offset + 14) ? null : cursor.getString(offset + 14), // notes + cursor.isNull(offset + 15) ? null : cursor.getString(offset + 15), // photos + cursor.isNull(offset + 16) ? null : cursor.getString(offset + 16), // position + cursor.isNull(offset + 17) ? null : cursor.getString(offset + 17), // staff + cursor.isNull(offset + 18) ? null : cursor.getString(offset + 18), // tel + cursor.isNull(offset + 19) ? null : cursor.getString(offset + 19), // ts + cursor.isNull(offset + 20) ? null : cursor.getString(offset + 20), // valid + cursor.isNull(offset + 21) ? null : cursor.getString(offset + 21), // watchData + cursor.isNull(offset + 22) ? null : cursor.getString(offset + 22), // wellCode + cursor.isNull(offset + 23) ? null : cursor.getString(offset + 23), // wellName + cursor.isNull(offset + 24) ? null : cursor.getString(offset + 24), // wellType + cursor.isNull(offset + 25) ? null : cursor.getString(offset + 25) // wellTypeName ); return entity; } - + @Override public void readEntity(Cursor cursor, MapWellLocalBean entity, int offset) { entity.setKId(cursor.isNull(offset + 0) ? null : cursor.getLong(offset + 0)); @@ -440,17 +435,17 @@ entity.setWellName(cursor.isNull(offset + 23) ? null : cursor.getString(offset + 23)); entity.setWellType(cursor.isNull(offset + 24) ? null : cursor.getString(offset + 24)); entity.setWellTypeName(cursor.isNull(offset + 25) ? null : cursor.getString(offset + 25)); - } - + } + @Override protected final Long updateKeyAfterInsert(MapWellLocalBean entity, long rowId) { entity.setKId(rowId); return rowId; } - + @Override public Long getKey(MapWellLocalBean entity) { - if (entity != null) { + if(entity != null) { return entity.getKId(); } else { return null; @@ -466,5 +461,5 @@ protected final boolean isEntityUpdateable() { return true; } - + } diff --git a/app/src/main/java/com/casic/app/smartwell/greendao/NoticeLocaleBeanDao.java b/app/src/main/java/com/casic/app/smartwell/greendao/NoticeLocaleBeanDao.java index 64312ed..deb2d49 100644 --- a/app/src/main/java/com/casic/app/smartwell/greendao/NoticeLocaleBeanDao.java +++ b/app/src/main/java/com/casic/app/smartwell/greendao/NoticeLocaleBeanDao.java @@ -12,10 +12,9 @@ import org.greenrobot.greendao.internal.DaoConfig; // THIS CODE IS GENERATED BY greenDAO, DO NOT EDIT. - -/** +/** * DAO for table "NOTICE_LOCALE_BEAN". - */ +*/ public class NoticeLocaleBeanDao extends AbstractDao { public static final String TABLENAME = "NOTICE_LOCALE_BEAN"; @@ -43,16 +42,14 @@ public NoticeLocaleBeanDao(DaoConfig config) { super(config); } - + public NoticeLocaleBeanDao(DaoConfig config, DaoSession daoSession) { super(config, daoSession); } - /** - * Creates the underlying database table. - */ + /** Creates the underlying database table. */ public static void createTable(Database db, boolean ifNotExists) { - String constraint = ifNotExists ? "IF NOT EXISTS " : ""; + String constraint = ifNotExists? "IF NOT EXISTS ": ""; db.execSQL("CREATE TABLE " + constraint + "\"NOTICE_LOCALE_BEAN\" (" + // "\"_id\" INTEGER PRIMARY KEY AUTOINCREMENT ," + // 0: id "\"MESSAGE_ID\" TEXT UNIQUE ," + // 1: messageId @@ -68,9 +65,7 @@ "\"NOTICE_TIME\" TEXT);"); // 11: noticeTime } - /** - * Drops the underlying database table. - */ + /** Drops the underlying database table. */ public static void dropTable(Database db, boolean ifExists) { String sql = "DROP TABLE " + (ifExists ? "IF EXISTS " : "") + "\"NOTICE_LOCALE_BEAN\""; db.execSQL(sql); @@ -79,62 +74,62 @@ @Override protected final void bindValues(DatabaseStatement stmt, NoticeLocaleBean entity) { stmt.clearBindings(); - + Long id = entity.getId(); if (id != null) { stmt.bindLong(1, id); } - + String messageId = entity.getMessageId(); if (messageId != null) { stmt.bindString(2, messageId); } - + String appid = entity.getAppid(); if (appid != null) { stmt.bindString(3, appid); } - + String clientId = entity.getClientId(); if (clientId != null) { stmt.bindString(4, clientId); } - + String taskId = entity.getTaskId(); if (taskId != null) { stmt.bindString(5, taskId); } - + String userId = entity.getUserId(); if (userId != null) { stmt.bindString(6, userId); } - + String title = entity.getTitle(); if (title != null) { stmt.bindString(7, title); } - + String content = entity.getContent(); if (content != null) { stmt.bindString(8, content); } - + String deviceCode = entity.getDeviceCode(); if (deviceCode != null) { stmt.bindString(9, deviceCode); } - + String jobId = entity.getJobId(); if (jobId != null) { stmt.bindString(10, jobId); } - + String isRead = entity.getIsRead(); if (isRead != null) { stmt.bindString(11, isRead); } - + String noticeTime = entity.getNoticeTime(); if (noticeTime != null) { stmt.bindString(12, noticeTime); @@ -144,62 +139,62 @@ @Override protected final void bindValues(SQLiteStatement stmt, NoticeLocaleBean entity) { stmt.clearBindings(); - + Long id = entity.getId(); if (id != null) { stmt.bindLong(1, id); } - + String messageId = entity.getMessageId(); if (messageId != null) { stmt.bindString(2, messageId); } - + String appid = entity.getAppid(); if (appid != null) { stmt.bindString(3, appid); } - + String clientId = entity.getClientId(); if (clientId != null) { stmt.bindString(4, clientId); } - + String taskId = entity.getTaskId(); if (taskId != null) { stmt.bindString(5, taskId); } - + String userId = entity.getUserId(); if (userId != null) { stmt.bindString(6, userId); } - + String title = entity.getTitle(); if (title != null) { stmt.bindString(7, title); } - + String content = entity.getContent(); if (content != null) { stmt.bindString(8, content); } - + String deviceCode = entity.getDeviceCode(); if (deviceCode != null) { stmt.bindString(9, deviceCode); } - + String jobId = entity.getJobId(); if (jobId != null) { stmt.bindString(10, jobId); } - + String isRead = entity.getIsRead(); if (isRead != null) { stmt.bindString(11, isRead); } - + String noticeTime = entity.getNoticeTime(); if (noticeTime != null) { stmt.bindString(12, noticeTime); @@ -209,27 +204,27 @@ @Override public Long readKey(Cursor cursor, int offset) { return cursor.isNull(offset + 0) ? null : cursor.getLong(offset + 0); - } + } @Override public NoticeLocaleBean readEntity(Cursor cursor, int offset) { NoticeLocaleBean entity = new NoticeLocaleBean( // - cursor.isNull(offset + 0) ? null : cursor.getLong(offset + 0), // id - cursor.isNull(offset + 1) ? null : cursor.getString(offset + 1), // messageId - cursor.isNull(offset + 2) ? null : cursor.getString(offset + 2), // appid - cursor.isNull(offset + 3) ? null : cursor.getString(offset + 3), // clientId - cursor.isNull(offset + 4) ? null : cursor.getString(offset + 4), // taskId - cursor.isNull(offset + 5) ? null : cursor.getString(offset + 5), // userId - cursor.isNull(offset + 6) ? null : cursor.getString(offset + 6), // title - cursor.isNull(offset + 7) ? null : cursor.getString(offset + 7), // content - cursor.isNull(offset + 8) ? null : cursor.getString(offset + 8), // deviceCode - cursor.isNull(offset + 9) ? null : cursor.getString(offset + 9), // jobId - cursor.isNull(offset + 10) ? null : cursor.getString(offset + 10), // isRead - cursor.isNull(offset + 11) ? null : cursor.getString(offset + 11) // noticeTime + cursor.isNull(offset + 0) ? null : cursor.getLong(offset + 0), // id + cursor.isNull(offset + 1) ? null : cursor.getString(offset + 1), // messageId + cursor.isNull(offset + 2) ? null : cursor.getString(offset + 2), // appid + cursor.isNull(offset + 3) ? null : cursor.getString(offset + 3), // clientId + cursor.isNull(offset + 4) ? null : cursor.getString(offset + 4), // taskId + cursor.isNull(offset + 5) ? null : cursor.getString(offset + 5), // userId + cursor.isNull(offset + 6) ? null : cursor.getString(offset + 6), // title + cursor.isNull(offset + 7) ? null : cursor.getString(offset + 7), // content + cursor.isNull(offset + 8) ? null : cursor.getString(offset + 8), // deviceCode + cursor.isNull(offset + 9) ? null : cursor.getString(offset + 9), // jobId + cursor.isNull(offset + 10) ? null : cursor.getString(offset + 10), // isRead + cursor.isNull(offset + 11) ? null : cursor.getString(offset + 11) // noticeTime ); return entity; } - + @Override public void readEntity(Cursor cursor, NoticeLocaleBean entity, int offset) { entity.setId(cursor.isNull(offset + 0) ? null : cursor.getLong(offset + 0)); @@ -244,17 +239,17 @@ entity.setJobId(cursor.isNull(offset + 9) ? null : cursor.getString(offset + 9)); entity.setIsRead(cursor.isNull(offset + 10) ? null : cursor.getString(offset + 10)); entity.setNoticeTime(cursor.isNull(offset + 11) ? null : cursor.getString(offset + 11)); - } - + } + @Override protected final Long updateKeyAfterInsert(NoticeLocaleBean entity, long rowId) { entity.setId(rowId); return rowId; } - + @Override public Long getKey(NoticeLocaleBean entity) { - if (entity != null) { + if(entity != null) { return entity.getId(); } else { return null; @@ -270,5 +265,5 @@ protected final boolean isEntityUpdateable() { return true; } - + } diff --git a/app/src/main/java/com/casic/app/smartwell/greendao/PipeLocalBeanDao.java b/app/src/main/java/com/casic/app/smartwell/greendao/PipeLocalBeanDao.java index aab4d3f..df5515a 100644 --- a/app/src/main/java/com/casic/app/smartwell/greendao/PipeLocalBeanDao.java +++ b/app/src/main/java/com/casic/app/smartwell/greendao/PipeLocalBeanDao.java @@ -12,10 +12,9 @@ import org.greenrobot.greendao.internal.DaoConfig; // THIS CODE IS GENERATED BY greenDAO, DO NOT EDIT. - -/** +/** * DAO for table "PIPE_LOCAL_BEAN". - */ +*/ public class PipeLocalBeanDao extends AbstractDao { public static final String TABLENAME = "PIPE_LOCAL_BEAN"; @@ -37,16 +36,14 @@ public PipeLocalBeanDao(DaoConfig config) { super(config); } - + public PipeLocalBeanDao(DaoConfig config, DaoSession daoSession) { super(config, daoSession); } - /** - * Creates the underlying database table. - */ + /** Creates the underlying database table. */ public static void createTable(Database db, boolean ifNotExists) { - String constraint = ifNotExists ? "IF NOT EXISTS " : ""; + String constraint = ifNotExists? "IF NOT EXISTS ": ""; db.execSQL("CREATE TABLE " + constraint + "\"PIPE_LOCAL_BEAN\" (" + // "\"_id\" INTEGER PRIMARY KEY AUTOINCREMENT ," + // 0: id "\"PIPE_CODE\" TEXT," + // 1: pipeCode @@ -56,9 +53,7 @@ "\"START_LONGITUDE_GD\" TEXT);"); // 5: startLongitudeGd } - /** - * Drops the underlying database table. - */ + /** Drops the underlying database table. */ public static void dropTable(Database db, boolean ifExists) { String sql = "DROP TABLE " + (ifExists ? "IF EXISTS " : "") + "\"PIPE_LOCAL_BEAN\""; db.execSQL(sql); @@ -67,32 +62,32 @@ @Override protected final void bindValues(DatabaseStatement stmt, PipeLocalBean entity) { stmt.clearBindings(); - + Long id = entity.getId(); if (id != null) { stmt.bindLong(1, id); } - + String pipeCode = entity.getPipeCode(); if (pipeCode != null) { stmt.bindString(2, pipeCode); } - + String endLatitudeGd = entity.getEndLatitudeGd(); if (endLatitudeGd != null) { stmt.bindString(3, endLatitudeGd); } - + String endLongitudeGd = entity.getEndLongitudeGd(); if (endLongitudeGd != null) { stmt.bindString(4, endLongitudeGd); } - + String startLatitudeGd = entity.getStartLatitudeGd(); if (startLatitudeGd != null) { stmt.bindString(5, startLatitudeGd); } - + String startLongitudeGd = entity.getStartLongitudeGd(); if (startLongitudeGd != null) { stmt.bindString(6, startLongitudeGd); @@ -102,32 +97,32 @@ @Override protected final void bindValues(SQLiteStatement stmt, PipeLocalBean entity) { stmt.clearBindings(); - + Long id = entity.getId(); if (id != null) { stmt.bindLong(1, id); } - + String pipeCode = entity.getPipeCode(); if (pipeCode != null) { stmt.bindString(2, pipeCode); } - + String endLatitudeGd = entity.getEndLatitudeGd(); if (endLatitudeGd != null) { stmt.bindString(3, endLatitudeGd); } - + String endLongitudeGd = entity.getEndLongitudeGd(); if (endLongitudeGd != null) { stmt.bindString(4, endLongitudeGd); } - + String startLatitudeGd = entity.getStartLatitudeGd(); if (startLatitudeGd != null) { stmt.bindString(5, startLatitudeGd); } - + String startLongitudeGd = entity.getStartLongitudeGd(); if (startLongitudeGd != null) { stmt.bindString(6, startLongitudeGd); @@ -137,21 +132,21 @@ @Override public Long readKey(Cursor cursor, int offset) { return cursor.isNull(offset + 0) ? null : cursor.getLong(offset + 0); - } + } @Override public PipeLocalBean readEntity(Cursor cursor, int offset) { PipeLocalBean entity = new PipeLocalBean( // - cursor.isNull(offset + 0) ? null : cursor.getLong(offset + 0), // id - cursor.isNull(offset + 1) ? null : cursor.getString(offset + 1), // pipeCode - cursor.isNull(offset + 2) ? null : cursor.getString(offset + 2), // endLatitudeGd - cursor.isNull(offset + 3) ? null : cursor.getString(offset + 3), // endLongitudeGd - cursor.isNull(offset + 4) ? null : cursor.getString(offset + 4), // startLatitudeGd - cursor.isNull(offset + 5) ? null : cursor.getString(offset + 5) // startLongitudeGd + cursor.isNull(offset + 0) ? null : cursor.getLong(offset + 0), // id + cursor.isNull(offset + 1) ? null : cursor.getString(offset + 1), // pipeCode + cursor.isNull(offset + 2) ? null : cursor.getString(offset + 2), // endLatitudeGd + cursor.isNull(offset + 3) ? null : cursor.getString(offset + 3), // endLongitudeGd + cursor.isNull(offset + 4) ? null : cursor.getString(offset + 4), // startLatitudeGd + cursor.isNull(offset + 5) ? null : cursor.getString(offset + 5) // startLongitudeGd ); return entity; } - + @Override public void readEntity(Cursor cursor, PipeLocalBean entity, int offset) { entity.setId(cursor.isNull(offset + 0) ? null : cursor.getLong(offset + 0)); @@ -160,17 +155,17 @@ entity.setEndLongitudeGd(cursor.isNull(offset + 3) ? null : cursor.getString(offset + 3)); entity.setStartLatitudeGd(cursor.isNull(offset + 4) ? null : cursor.getString(offset + 4)); entity.setStartLongitudeGd(cursor.isNull(offset + 5) ? null : cursor.getString(offset + 5)); - } - + } + @Override protected final Long updateKeyAfterInsert(PipeLocalBean entity, long rowId) { entity.setId(rowId); return rowId; } - + @Override public Long getKey(PipeLocalBean entity) { - if (entity != null) { + if(entity != null) { return entity.getId(); } else { return null; @@ -186,5 +181,5 @@ protected final boolean isEntityUpdateable() { return true; } - + } diff --git a/app/src/main/java/com/casic/app/smartwell/view/ChangePasswordActivity.kt b/app/src/main/java/com/casic/app/smartwell/view/ChangePasswordActivity.kt index 8e41039..9f1dd40 100644 --- a/app/src/main/java/com/casic/app/smartwell/view/ChangePasswordActivity.kt +++ b/app/src/main/java/com/casic/app/smartwell/view/ChangePasswordActivity.kt @@ -14,7 +14,7 @@ import com.pengxh.kt.lite.extensions.show import com.pengxh.kt.lite.utils.ActivityStackManager import com.pengxh.kt.lite.utils.LoadState -import com.pengxh.kt.lite.utils.LoadingDialogHub +import com.pengxh.kt.lite.utils.LoadingDialog import com.pengxh.kt.lite.widget.TitleBarView import java.nio.charset.StandardCharsets @@ -46,15 +46,15 @@ override fun observeRequestState() { userViewModel.loadState.observe(this) { when (it) { - is LoadState.Loading -> LoadingDialogHub.show(this, "修改中,请稍后") + is LoadState.Loading -> LoadingDialog.show(this, "修改中,请稍后") is LoadState.Success -> { - LoadingDialogHub.dismiss() + LoadingDialog.dismiss() AuthenticationHelper.removeToken() this.navigatePageTo() ActivityStackManager.finishAllActivity() } - else -> LoadingDialogHub.dismiss() + else -> LoadingDialog.dismiss() } } } diff --git a/app/src/main/java/com/casic/app/smartwell/view/DeployedWellActivity.kt b/app/src/main/java/com/casic/app/smartwell/view/DeployedWellActivity.kt index fb4339c..28a5078 100644 --- a/app/src/main/java/com/casic/app/smartwell/view/DeployedWellActivity.kt +++ b/app/src/main/java/com/casic/app/smartwell/view/DeployedWellActivity.kt @@ -83,8 +83,8 @@ } //添加分割线 - binding.deployedListView.addItemDecoration( - RecyclerViewItemOffsets(0, 5, 0, 5) + binding.recyclerView.addItemDecoration( + RecyclerViewItemOffsets(0, 7, 0, 7) ) } @@ -149,12 +149,11 @@ } else { item.deep.toString() + "m" } - viewHolder.setText(R.id.wellNameView, item.wellName) + viewHolder.setText(R.id.wellTypeView, item.wellTypeName) .setText(R.id.wellDepthView, "深:${deep}") .setText(R.id.wellCodeView, "点位编号:${item.wellCode}") - .setText(R.id.wellTypeView, "点位类型:${item.wellTypeName}") .setText(R.id.ownerShipView, "权属单位:${item.deptName}") - .setText(R.id.wellLocationView, "点位置:${item.position}") + .setText(R.id.wellLocationView, "点位位置:${item.position}") .setOnClickListener( R.id.operationButton, object : View.OnClickListener { override fun onClick(v: View?) { @@ -207,7 +206,7 @@ }) } } - binding.deployedListView.adapter = deployAdapter + binding.recyclerView.adapter = deployAdapter deployAdapter.setOnItemClickedListener(object : NormalRecyclerAdapter.OnItemClickedListener { override fun onItemClicked(position: Int, t: WellListModel.DataBean.RowsBean) { diff --git a/app/src/main/java/com/casic/app/smartwell/view/LoginActivity.kt b/app/src/main/java/com/casic/app/smartwell/view/LoginActivity.kt index e4bb0e3..834527b 100644 --- a/app/src/main/java/com/casic/app/smartwell/view/LoginActivity.kt +++ b/app/src/main/java/com/casic/app/smartwell/view/LoginActivity.kt @@ -21,7 +21,7 @@ import com.pengxh.kt.lite.extensions.navigatePageTo import com.pengxh.kt.lite.extensions.readAssetsFile import com.pengxh.kt.lite.extensions.show -import com.pengxh.kt.lite.utils.LoadingDialogHub +import com.pengxh.kt.lite.utils.LoadingDialog import com.pengxh.kt.lite.utils.SaveKeyValues import kotlinx.coroutines.Dispatchers import kotlinx.coroutines.launch @@ -106,11 +106,11 @@ override fun observeRequestState() { authenticateViewModel.loadState.observe(this) { - LoadingDialogHub.show(this, "登录中,请稍后") + LoadingDialog.show(this, "登录中,请稍后") } loginViewModel.loadState.observe(this) { - LoadingDialogHub.dismiss() + LoadingDialog.dismiss() } } diff --git a/app/src/main/java/com/casic/app/smartwell/view/OrderCompletedDetailActivity.kt b/app/src/main/java/com/casic/app/smartwell/view/OrderCompletedDetailActivity.kt index db8ad1f..75cd905 100644 --- a/app/src/main/java/com/casic/app/smartwell/view/OrderCompletedDetailActivity.kt +++ b/app/src/main/java/com/casic/app/smartwell/view/OrderCompletedDetailActivity.kt @@ -17,7 +17,7 @@ import com.pengxh.kt.lite.extensions.show import com.pengxh.kt.lite.utils.Constant import com.pengxh.kt.lite.utils.LoadState -import com.pengxh.kt.lite.utils.LoadingDialogHub +import com.pengxh.kt.lite.utils.LoadingDialog import com.pengxh.kt.lite.widget.TitleBarView import com.pengxh.kt.lite.widget.dialog.AlertMessageDialog @@ -44,7 +44,7 @@ } override fun initOnCreate(savedInstanceState: Bundle?) { - val jobId = intent.getStringExtra(Constant.INTENT_PARAM)!! + val jobId = intent.getStringExtra(Constant.INTENT_PARAM_KEY)!! orderViewModel = ViewModelProvider(this)[OrderViewModel::class.java] orderViewModel.getWorkOrderDetail(jobId) orderViewModel.detailModel.observe(this) { @@ -154,8 +154,8 @@ override fun observeRequestState() { orderViewModel.loadState.observe(this) { when (it) { - is LoadState.Loading -> LoadingDialogHub.show(this, "数据加载中,请稍后") - else -> LoadingDialogHub.dismiss() + is LoadState.Loading -> LoadingDialog.show(this, "数据加载中,请稍后") + else -> LoadingDialog.dismiss() } } } diff --git a/app/src/main/java/com/casic/app/smartwell/view/OrderInHandleDetailActivity.kt b/app/src/main/java/com/casic/app/smartwell/view/OrderInHandleDetailActivity.kt index d70a979..04a7d5d 100644 --- a/app/src/main/java/com/casic/app/smartwell/view/OrderInHandleDetailActivity.kt +++ b/app/src/main/java/com/casic/app/smartwell/view/OrderInHandleDetailActivity.kt @@ -38,7 +38,7 @@ import com.pengxh.kt.lite.extensions.show import com.pengxh.kt.lite.utils.Constant import com.pengxh.kt.lite.utils.LoadState -import com.pengxh.kt.lite.utils.LoadingDialogHub +import com.pengxh.kt.lite.utils.LoadingDialog import com.pengxh.kt.lite.widget.TitleBarView import com.pengxh.kt.lite.widget.dialog.AlertControlDialog import com.pengxh.kt.lite.widget.dialog.AlertMessageDialog @@ -93,7 +93,7 @@ ) binding.addImageRecyclerView.adapter = imageAdapter - val jobId = intent.getStringExtra(Constant.INTENT_PARAM)!!//初始化图片九宫格 + val jobId = intent.getStringExtra(Constant.INTENT_PARAM_KEY)!!//初始化图片九宫格 orderViewModel.getWorkOrderDetail(jobId) orderViewModel.detailModel.observe(this) { if (it.code == 200) { @@ -312,41 +312,41 @@ override fun observeRequestState() { orderViewModel.loadState.observe(this) { when (it) { - is LoadState.Loading -> LoadingDialogHub.show(this, "数据加载中,请稍后") - else -> LoadingDialogHub.dismiss() + is LoadState.Loading -> LoadingDialog.show(this, "数据加载中,请稍后") + else -> LoadingDialog.dismiss() } } uploadImageViewModel.loadState.observe(this) { when (it) { - LoadState.Loading -> LoadingDialogHub.show(this, "图片上传中,请稍后...") - else -> LoadingDialogHub.dismiss() + LoadState.Loading -> LoadingDialog.show(this, "图片上传中,请稍后...") + else -> LoadingDialog.dismiss() } } //转单状态处理 operationViewModel.loadState.observe(this) { when (it) { - is LoadState.Loading -> LoadingDialogHub.show(this, "转单中,请稍后") + is LoadState.Loading -> LoadingDialog.show(this, "转单中,请稍后") is LoadState.Success -> { - LoadingDialogHub.dismiss() + LoadingDialog.dismiss() this.finish() } - else -> LoadingDialogHub.dismiss() + else -> LoadingDialog.dismiss() } } //处理完成工单状态处理 operationViewModel.loadState.observe(this) { when (it) { - is LoadState.Loading -> LoadingDialogHub.show(this, "处理中,请稍后") + is LoadState.Loading -> LoadingDialog.show(this, "处理中,请稍后") is LoadState.Success -> { - LoadingDialogHub.dismiss() + LoadingDialog.dismiss() this.finish() } - else -> LoadingDialogHub.dismiss() + else -> LoadingDialog.dismiss() } } } diff --git a/app/src/main/java/com/casic/app/smartwell/view/OrderNotConfirmedDetailActivity.kt b/app/src/main/java/com/casic/app/smartwell/view/OrderNotConfirmedDetailActivity.kt index 8e036d2..687ec86 100644 --- a/app/src/main/java/com/casic/app/smartwell/view/OrderNotConfirmedDetailActivity.kt +++ b/app/src/main/java/com/casic/app/smartwell/view/OrderNotConfirmedDetailActivity.kt @@ -36,7 +36,7 @@ import com.pengxh.kt.lite.extensions.show import com.pengxh.kt.lite.utils.Constant import com.pengxh.kt.lite.utils.LoadState -import com.pengxh.kt.lite.utils.LoadingDialogHub +import com.pengxh.kt.lite.utils.LoadingDialog import com.pengxh.kt.lite.widget.TitleBarView import com.pengxh.kt.lite.widget.dialog.AlertControlDialog import com.pengxh.kt.lite.widget.dialog.AlertMessageDialog @@ -80,7 +80,7 @@ } override fun initOnCreate(savedInstanceState: Bundle?) { - val jobId = intent.getStringExtra(Constant.INTENT_PARAM)!! + val jobId = intent.getStringExtra(Constant.INTENT_PARAM_KEY)!! //初始化图片九宫格 //左外边距,左内边距,右内边距,右外边距 val viewWidth = getScreenWidth() - (10 + 10 + 10 + 10).dp2px(this) @@ -263,41 +263,41 @@ //数据加载状态处理 orderViewModel.loadState.observe(this) { when (it) { - is LoadState.Loading -> LoadingDialogHub.show(this, "数据加载中,请稍后") - else -> LoadingDialogHub.dismiss() + is LoadState.Loading -> LoadingDialog.show(this, "数据加载中,请稍后") + else -> LoadingDialog.dismiss() } } uploadImageViewModel.loadState.observe(this) { when (it) { - LoadState.Loading -> LoadingDialogHub.show(this, "图片上传中,请稍后") - else -> LoadingDialogHub.dismiss() + LoadState.Loading -> LoadingDialog.show(this, "图片上传中,请稍后") + else -> LoadingDialog.dismiss() } } //转单状态处理 operationViewModel.loadState.observe(this) { when (it) { - is LoadState.Loading -> LoadingDialogHub.show(this, "转单中,请稍后") + is LoadState.Loading -> LoadingDialog.show(this, "转单中,请稍后") is LoadState.Success -> { - LoadingDialogHub.dismiss() + LoadingDialog.dismiss() this.finish() } - else -> LoadingDialogHub.dismiss() + else -> LoadingDialog.dismiss() } } //确认工单状态处理 operationViewModel.loadState.observe(this) { when (it) { - is LoadState.Loading -> LoadingDialogHub.show(this, "处理中,请稍后") + is LoadState.Loading -> LoadingDialog.show(this, "处理中,请稍后") is LoadState.Success -> { - LoadingDialogHub.dismiss() + LoadingDialog.dismiss() this.finish() } - else -> LoadingDialogHub.dismiss() + else -> LoadingDialog.dismiss() } } } diff --git a/app/src/main/java/com/casic/app/smartwell/view/OrderNotProcessedDetailActivity.kt b/app/src/main/java/com/casic/app/smartwell/view/OrderNotProcessedDetailActivity.kt index d3f22dc..0c97a52 100644 --- a/app/src/main/java/com/casic/app/smartwell/view/OrderNotProcessedDetailActivity.kt +++ b/app/src/main/java/com/casic/app/smartwell/view/OrderNotProcessedDetailActivity.kt @@ -18,7 +18,7 @@ import com.pengxh.kt.lite.extensions.show import com.pengxh.kt.lite.utils.Constant import com.pengxh.kt.lite.utils.LoadState -import com.pengxh.kt.lite.utils.LoadingDialogHub +import com.pengxh.kt.lite.utils.LoadingDialog import com.pengxh.kt.lite.widget.TitleBarView import com.pengxh.kt.lite.widget.dialog.AlertControlDialog import com.pengxh.kt.lite.widget.dialog.AlertMessageDialog @@ -50,7 +50,7 @@ } override fun initOnCreate(savedInstanceState: Bundle?) { - this.jobId = intent.getStringExtra(Constant.INTENT_PARAM)!! + this.jobId = intent.getStringExtra(Constant.INTENT_PARAM_KEY)!! orderViewModel = ViewModelProvider(this)[OrderViewModel::class.java] operationViewModel = ViewModelProvider(this)[OperationViewModel::class.java] wellViewModel = ViewModelProvider(this)[WellViewModel::class.java] @@ -162,21 +162,21 @@ //数据加载状态处理 orderViewModel.loadState.observe(this) { when (it) { - is LoadState.Loading -> LoadingDialogHub.show(this, "数据加载中,请稍后") - else -> LoadingDialogHub.dismiss() + is LoadState.Loading -> LoadingDialog.show(this, "数据加载中,请稍后") + else -> LoadingDialog.dismiss() } } //接单状态处理 operationViewModel.loadState.observe(this) { when (it) { - is LoadState.Loading -> LoadingDialogHub.show(this, "接单中,请稍后") + is LoadState.Loading -> LoadingDialog.show(this, "接单中,请稍后") is LoadState.Success -> { - LoadingDialogHub.dismiss() + LoadingDialog.dismiss() this.finish() } - else -> LoadingDialogHub.dismiss() + else -> LoadingDialog.dismiss() } } } diff --git a/app/src/main/java/com/casic/app/smartwell/view/SearchResultActivity.kt b/app/src/main/java/com/casic/app/smartwell/view/SearchResultActivity.kt index 6a92917..4f3a674 100644 --- a/app/src/main/java/com/casic/app/smartwell/view/SearchResultActivity.kt +++ b/app/src/main/java/com/casic/app/smartwell/view/SearchResultActivity.kt @@ -19,7 +19,7 @@ import com.pengxh.kt.lite.extensions.show import com.pengxh.kt.lite.utils.Constant import com.pengxh.kt.lite.utils.LoadState -import com.pengxh.kt.lite.utils.LoadingDialogHub +import com.pengxh.kt.lite.utils.LoadingDialog import com.pengxh.kt.lite.utils.WeakReferenceHandler import com.pengxh.kt.lite.widget.TitleBarView import com.pengxh.kt.lite.widget.dialog.AlertControlDialog @@ -56,7 +56,7 @@ } override fun initOnCreate(savedInstanceState: Bundle?) { - args = intent.getStringArrayListExtra(Constant.INTENT_PARAM)!! + args = intent.getStringArrayListExtra(Constant.INTENT_PARAM_KEY)!! orderViewModel = ViewModelProvider(this)[OrderViewModel::class.java] operationViewModel = ViewModelProvider(this)[OperationViewModel::class.java] @@ -101,24 +101,24 @@ } } - binding.resultRecyclerView.addItemDecoration( - RecyclerViewItemOffsets(0, 5, 0, 5) + binding.recyclerView.addItemDecoration( + RecyclerViewItemOffsets(0, 7, 0, 7) ) } override fun observeRequestState() { orderViewModel.loadState.observe(this) { when (it) { - is LoadState.Loading -> LoadingDialogHub.show(this, "数据加载中,请稍后") - else -> LoadingDialogHub.dismiss() + is LoadState.Loading -> LoadingDialog.show(this, "数据加载中,请稍后") + else -> LoadingDialog.dismiss() } } //接单状态处理 operationViewModel.loadState.observe(this) { when (it) { - is LoadState.Loading -> LoadingDialogHub.show(this, "接单中,请稍后") + is LoadState.Loading -> LoadingDialog.show(this, "接单中,请稍后") is LoadState.Success -> { - LoadingDialogHub.dismiss() + LoadingDialog.dismiss() //接单成功之后刷新列表 dataBeans.removeAt(clickedPosition) searchResultAdapter.notifyItemRemoved(clickedPosition) @@ -127,7 +127,7 @@ ) } - else -> LoadingDialogHub.dismiss() + else -> LoadingDialog.dismiss() } } } @@ -162,7 +162,7 @@ } else { binding.emptyInclude.emptyView.hide() searchResultAdapter = SearchResultAdapter(this, dataBeans) - binding.resultRecyclerView.adapter = searchResultAdapter + binding.recyclerView.adapter = searchResultAdapter searchResultAdapter.setOnItemClickListener(object : SearchResultAdapter.OnItemClickListener { override fun onClicked(position: Int) { diff --git a/app/src/main/java/com/casic/app/smartwell/view/UnDeployWellActivity.kt b/app/src/main/java/com/casic/app/smartwell/view/UnDeployWellActivity.kt index 7f7cd3c..555c278 100644 --- a/app/src/main/java/com/casic/app/smartwell/view/UnDeployWellActivity.kt +++ b/app/src/main/java/com/casic/app/smartwell/view/UnDeployWellActivity.kt @@ -81,8 +81,8 @@ } } - binding.undeployListView.addItemDecoration( - RecyclerViewItemOffsets(0, 5, 0, 5) + binding.recyclerView.addItemDecoration( + RecyclerViewItemOffsets(0, 7, 0, 7) ) } @@ -147,12 +147,11 @@ } else { item.deep.toString() + "m" } - viewHolder.setText(R.id.wellNameView, item.wellName) + viewHolder.setText(R.id.wellTypeView, item.wellTypeName) .setText(R.id.wellDepthView, "深:${deep}") .setText(R.id.wellCodeView, "点位编号:${item.wellCode}") - .setText(R.id.wellTypeView, "点位类型:${item.wellTypeName}") .setText(R.id.ownerShipView, "权属单位:${item.deptName}") - .setText(R.id.wellLocationView, "点位置:${item.position}") + .setText(R.id.wellLocationView, "点位位置:${item.position}") .setOnClickListener( R.id.operationButton, object : View.OnClickListener { override fun onClick(v: View?) { @@ -185,7 +184,7 @@ ) } } - binding.undeployListView.adapter = unDeployAdapter + binding.recyclerView.adapter = unDeployAdapter unDeployAdapter.setOnItemClickedListener(object : NormalRecyclerAdapter.OnItemClickedListener { override fun onItemClicked(position: Int, t: WellListModel.DataBean.RowsBean) { diff --git a/app/build.gradle b/app/build.gradle index 296fb6f..c18c251 100644 --- a/app/build.gradle +++ b/app/build.gradle @@ -40,10 +40,6 @@ // VIVO 相关应用参数 VIVO_APP_ID : "105749048", VIVO_APP_KEY : "e460fbf2c689e0f8c58ecc6aa62e1803", - - // 小米相关应用参数 -// XIAOMI_APP_ID : "", -// XIAOMI_APP_KEY : "", ] // 版本名后面添加一句话,意思就是flavor dimension 它的维度就是该版本号,多渠道打包很重要 @@ -107,7 +103,7 @@ dependencies { implementation fileTree(dir: 'libs', include: ['*.jar']) //基础依赖库 - implementation 'com.github.AndroidCoderPeng:Kotlin-lite-lib:1.0.10' + implementation 'com.github.AndroidCoderPeng:Kotlin-lite-lib:1.1.0' implementation 'androidx.appcompat:appcompat:1.6.1' implementation 'androidx.core:core-ktx:1.9.0' implementation 'androidx.constraintlayout:constraintlayout:2.1.4' @@ -165,8 +161,6 @@ implementation 'commons-codec:commons-codec:1.15' implementation 'com.android.support:support-annotations:28.0.0' implementation 'com.assist-v3:vivo:3.1.2' // vivo -// implementation 'com.getui.opt:xmp:3.3.1' // 小米 - //数据库框架 implementation 'org.greenrobot:greendao:3.3.0' //数据库升级 diff --git a/app/src/main/AndroidManifest.xml b/app/src/main/AndroidManifest.xml index c0af158..e0519bf 100644 --- a/app/src/main/AndroidManifest.xml +++ b/app/src/main/AndroidManifest.xml @@ -90,10 +90,10 @@ - + + android:value="ee96d8b5e12de3fbb29949efd57418a8" /> () @@ -150,7 +158,7 @@ val cameraPosition = CameraPosition(centerLatLng, 14f, 0f, 0f) val cameraUpdate = CameraUpdateFactory.newCameraPosition(cameraPosition) withContext(Dispatchers.Main) { - LoadingDialogHub.dismiss() + LoadingDialog.dismiss() aMap.animateCamera(cameraUpdate, 1500, null) } } @@ -239,11 +247,6 @@ } override fun initEvent() { - binding.rightOptionView.setOnClickListener { - val x = binding.rightOptionView.width - easyPopupWindow.width - easyPopupWindow.showAsDropDown(binding.rightOptionView, x, 0) - } - //撤防点位 binding.unDeployedLayout.setOnClickListener { requireContext().navigatePageTo() @@ -263,11 +266,11 @@ override fun observeRequestState() { wellViewModel.loadState.observe(this) { when (it) { - is LoadState.Loading -> LoadingDialogHub.show( + is LoadState.Loading -> LoadingDialog.show( requireActivity(), "数据加载中,请稍后..." ) - else -> LoadingDialogHub.dismiss() + else -> LoadingDialog.dismiss() } } } @@ -376,7 +379,7 @@ }).build().show() } }) - infoPopup.showAsDropDown(binding.rightOptionView) +// infoPopup.showAsDropDown(binding.rightOptionView) } override fun onCameraChange(p0: CameraPosition?) { diff --git a/app/src/main/java/com/casic/app/smartwell/fragment/HomePageNoClusterFragment.kt b/app/src/main/java/com/casic/app/smartwell/fragment/HomePageNoClusterFragment.kt index 802426a..b25f743 100644 --- a/app/src/main/java/com/casic/app/smartwell/fragment/HomePageNoClusterFragment.kt +++ b/app/src/main/java/com/casic/app/smartwell/fragment/HomePageNoClusterFragment.kt @@ -38,8 +38,9 @@ import com.pengxh.kt.lite.extensions.navigatePageTo import com.pengxh.kt.lite.extensions.show import com.pengxh.kt.lite.utils.LoadState -import com.pengxh.kt.lite.utils.LoadingDialogHub +import com.pengxh.kt.lite.utils.LoadingDialog import com.pengxh.kt.lite.widget.EasyPopupWindow +import com.pengxh.kt.lite.widget.TitleBarView import com.pengxh.kt.lite.widget.dialog.AlertControlDialog import kotlinx.coroutines.Dispatchers import kotlinx.coroutines.launch @@ -78,7 +79,15 @@ override fun setupTopBarLayout() { binding.rootView.initImmersionBar(this, false, R.color.mainThemeColor) - binding.titleView.text = "首页" + binding.titleView.setOnClickListener(object : TitleBarView.OnClickListener { + override fun onLeftClick() { + + } + + override fun onRightClick() { + easyPopupWindow.showAsDropDown(binding.titleView, binding.titleView.width, 0) + } + }) } override fun initOnCreate(savedInstanceState: Bundle?) { @@ -112,7 +121,7 @@ //渲染井位置 lifecycleScope.launch(Dispatchers.Main) { - LoadingDialogHub.show(requireActivity(), "数据加载中,请稍后") + LoadingDialog.show(requireActivity(), "数据加载中,请稍后") withContext(Dispatchers.IO) { //取Well缓存 val allMarkerOptions = ArrayList() @@ -144,7 +153,7 @@ val cameraPosition = CameraPosition(centerLatLng, 14f, 0f, 0f) val cameraUpdate = CameraUpdateFactory.newCameraPosition(cameraPosition) withContext(Dispatchers.Main) { - LoadingDialogHub.dismiss() + LoadingDialog.dismiss() aMap.animateCamera(cameraUpdate, 1500, null) } } @@ -238,11 +247,6 @@ } override fun initEvent() { - binding.rightOptionView.setOnClickListener { - val x = binding.rightOptionView.width - easyPopupWindow.width - easyPopupWindow.showAsDropDown(binding.rightOptionView, x, 0) - } - //撤防点位 binding.unDeployedLayout.setOnClickListener { requireContext().navigatePageTo() @@ -262,11 +266,11 @@ override fun observeRequestState() { wellViewModel.loadState.observe(this) { when (it) { - is LoadState.Loading -> LoadingDialogHub.show( + is LoadState.Loading -> LoadingDialog.show( requireActivity(), "数据加载中,请稍后..." ) - else -> LoadingDialogHub.dismiss() + else -> LoadingDialog.dismiss() } } } diff --git a/app/src/main/java/com/casic/app/smartwell/fragment/MinePageFragment.kt b/app/src/main/java/com/casic/app/smartwell/fragment/MinePageFragment.kt index 09a570c..dcb48f8 100644 --- a/app/src/main/java/com/casic/app/smartwell/fragment/MinePageFragment.kt +++ b/app/src/main/java/com/casic/app/smartwell/fragment/MinePageFragment.kt @@ -35,7 +35,7 @@ import com.pengxh.kt.lite.utils.ActivityStackManager import com.pengxh.kt.lite.utils.FileDownloadManager import com.pengxh.kt.lite.utils.LoadState -import com.pengxh.kt.lite.utils.LoadingDialogHub +import com.pengxh.kt.lite.utils.LoadingDialog import com.pengxh.kt.lite.widget.dialog.AlertControlDialog import com.pengxh.kt.lite.widget.dialog.BottomActionSheet import kotlinx.coroutines.Dispatchers @@ -60,7 +60,6 @@ override fun setupTopBarLayout() { binding.rootView.initImmersionBar(this, false, R.color.mainThemeColor) - binding.titleInclude.titleView.text = "我的" } override fun initOnCreate(savedInstanceState: Bundle?) { @@ -155,27 +154,27 @@ override fun observeRequestState() { userViewModel.loadState.observe(this) { when (it) { - is LoadState.Loading -> LoadingDialogHub.show( + is LoadState.Loading -> LoadingDialog.show( requireActivity(), "检查版本中,请稍后" ) - else -> LoadingDialogHub.dismiss() + else -> LoadingDialog.dismiss() } } wellViewModel.loadState.observe(this) { when (it) { - is LoadState.Loading -> LoadingDialogHub.show( + is LoadState.Loading -> LoadingDialog.show( requireActivity(), "数据更新中,请稍后" ) is LoadState.Fail -> { - LoadingDialogHub.dismiss() + LoadingDialog.dismiss() "数据更新超时".show(requireContext()) } else -> { - LoadingDialogHub.dismiss() + LoadingDialog.dismiss() AlertControlDialog.Builder().setContext(requireContext()).setTitle("温馨提示") .setMessage("数据更新成功,请重启应用").setNegativeButton("取消") .setPositiveButton("确定").setOnDialogButtonClickListener(object : @@ -197,17 +196,17 @@ lineViewModel.loadState.observe(this) { when (it) { - is LoadState.Loading -> LoadingDialogHub.show( + is LoadState.Loading -> LoadingDialog.show( requireActivity(), "数据更新中,请稍后" ) is LoadState.Fail -> { - LoadingDialogHub.dismiss() + LoadingDialog.dismiss() "数据更新超时".show(requireContext()) } else -> { - LoadingDialogHub.dismiss() + LoadingDialog.dismiss() AlertControlDialog.Builder().setContext(requireContext()).setTitle("温馨提示") .setMessage("数据更新成功,请重启应用").setNegativeButton("取消") .setPositiveButton("确定").setOnDialogButtonClickListener(object : diff --git a/app/src/main/java/com/casic/app/smartwell/fragment/NoticePageFragment.kt b/app/src/main/java/com/casic/app/smartwell/fragment/NoticePageFragment.kt index 171b555..3c93f54 100644 --- a/app/src/main/java/com/casic/app/smartwell/fragment/NoticePageFragment.kt +++ b/app/src/main/java/com/casic/app/smartwell/fragment/NoticePageFragment.kt @@ -48,7 +48,6 @@ override fun setupTopBarLayout() { binding.rootView.initImmersionBar(this, false, R.color.mainThemeColor) - binding.titleInclude.titleView.text = "消息" } override fun initOnCreate(savedInstanceState: Bundle?) { diff --git a/app/src/main/java/com/casic/app/smartwell/fragment/OrderListFragment.kt b/app/src/main/java/com/casic/app/smartwell/fragment/OrderListFragment.kt index 93ff35b..5e38acb 100644 --- a/app/src/main/java/com/casic/app/smartwell/fragment/OrderListFragment.kt +++ b/app/src/main/java/com/casic/app/smartwell/fragment/OrderListFragment.kt @@ -12,6 +12,7 @@ import com.casic.app.smartwell.view.SearchOrderActivity import com.pengxh.kt.lite.base.KotlinBaseFragment import com.pengxh.kt.lite.extensions.navigatePageTo +import com.pengxh.kt.lite.widget.TitleBarView class OrderListFragment : KotlinBaseFragment() { @@ -25,15 +26,22 @@ } override fun initViewBinding( - inflater: LayoutInflater, - container: ViewGroup? + inflater: LayoutInflater, container: ViewGroup? ): FragmentOrderBinding { return FragmentOrderBinding.inflate(inflater, container, false) } override fun setupTopBarLayout() { binding.rootView.initImmersionBar(this, false, R.color.mainThemeColor) - binding.titleView.text = "工单" + binding.titleView.setOnClickListener(object : TitleBarView.OnClickListener { + override fun onLeftClick() { + + } + + override fun onRightClick() { + requireContext().navigatePageTo() + } + }) } override fun initOnCreate(savedInstanceState: Bundle?) { @@ -51,8 +59,6 @@ } override fun initEvent() { - binding.rightOptionView.setOnClickListener { - requireContext().navigatePageTo() - } + } } \ No newline at end of file diff --git a/app/src/main/java/com/casic/app/smartwell/fragment/OrderNotProcessedFragment.kt b/app/src/main/java/com/casic/app/smartwell/fragment/OrderNotProcessedFragment.kt index 0b3d09d..2b6f21d 100644 --- a/app/src/main/java/com/casic/app/smartwell/fragment/OrderNotProcessedFragment.kt +++ b/app/src/main/java/com/casic/app/smartwell/fragment/OrderNotProcessedFragment.kt @@ -18,7 +18,7 @@ import com.pengxh.kt.lite.extensions.navigatePageTo import com.pengxh.kt.lite.extensions.show import com.pengxh.kt.lite.utils.LoadState -import com.pengxh.kt.lite.utils.LoadingDialogHub +import com.pengxh.kt.lite.utils.LoadingDialog import com.pengxh.kt.lite.utils.WeakReferenceHandler import com.pengxh.kt.lite.widget.dialog.AlertControlDialog @@ -78,8 +78,8 @@ operationViewModel = ViewModelProvider(this)[OperationViewModel::class.java] - binding.notProcessedView.addItemDecoration( - RecyclerViewItemOffsets(0, 5, 0, 5) + binding.recyclerView.addItemDecoration( + RecyclerViewItemOffsets(0, 7, 0, 7) ) } @@ -87,9 +87,9 @@ //接单状态处理 operationViewModel.loadState.observe(this) { when (it) { - is LoadState.Loading -> LoadingDialogHub.show(requireActivity(), "接单中,请稍后") + is LoadState.Loading -> LoadingDialog.show(requireActivity(), "接单中,请稍后") is LoadState.Success -> { - LoadingDialogHub.dismiss() + LoadingDialog.dismiss() //接单成功之后刷新列表 dataBeans.removeAt(clickedPosition) notProcessedAdapter.notifyItemRemoved(clickedPosition) @@ -98,7 +98,7 @@ ) } - else -> LoadingDialogHub.dismiss() + else -> LoadingDialog.dismiss() } } } @@ -131,7 +131,7 @@ } else { binding.emptyInclude.emptyView.hide() notProcessedAdapter = OrderNotProcessedAdapter(requireContext(), dataBeans) - binding.notProcessedView.adapter = notProcessedAdapter + binding.recyclerView.adapter = notProcessedAdapter notProcessedAdapter.setOnItemClickListener(object : OrderNotProcessedAdapter.OnItemClickListener { override fun onClicked(position: Int) { diff --git a/app/src/main/java/com/casic/app/smartwell/fragment/OvertimeNotAcceptFragment.kt b/app/src/main/java/com/casic/app/smartwell/fragment/OvertimeNotAcceptFragment.kt index a198545..9b318ca 100644 --- a/app/src/main/java/com/casic/app/smartwell/fragment/OvertimeNotAcceptFragment.kt +++ b/app/src/main/java/com/casic/app/smartwell/fragment/OvertimeNotAcceptFragment.kt @@ -18,7 +18,7 @@ import com.pengxh.kt.lite.extensions.navigatePageTo import com.pengxh.kt.lite.extensions.show import com.pengxh.kt.lite.utils.LoadState -import com.pengxh.kt.lite.utils.LoadingDialogHub +import com.pengxh.kt.lite.utils.LoadingDialog import com.pengxh.kt.lite.utils.WeakReferenceHandler import com.pengxh.kt.lite.widget.dialog.AlertControlDialog @@ -81,8 +81,8 @@ operationViewModel = ViewModelProvider(this)[OperationViewModel::class.java] - binding.notProcessedView.addItemDecoration( - RecyclerViewItemOffsets(0, 5, 0, 5) + binding.recyclerView.addItemDecoration( + RecyclerViewItemOffsets(0, 7, 0, 7) ) } @@ -90,9 +90,9 @@ //接单状态处理 operationViewModel.loadState.observe(this) { when (it) { - is LoadState.Loading -> LoadingDialogHub.show(requireActivity(), "接单中,请稍后") + is LoadState.Loading -> LoadingDialog.show(requireActivity(), "接单中,请稍后") is LoadState.Success -> { - LoadingDialogHub.dismiss() + LoadingDialog.dismiss() //接单成功之后刷新列表 dataBeans.removeAt(clickedPosition) notProcessedAdapter.notifyItemRemoved(clickedPosition) @@ -101,7 +101,7 @@ ) } - else -> LoadingDialogHub.dismiss() + else -> LoadingDialog.dismiss() } } } @@ -134,7 +134,7 @@ } else { binding.emptyInclude.emptyView.hide() notProcessedAdapter = OrderNotProcessedAdapter(requireContext(), dataBeans) - binding.notProcessedView.adapter = notProcessedAdapter + binding.recyclerView.adapter = notProcessedAdapter notProcessedAdapter.setOnItemClickListener(object : OrderNotProcessedAdapter.OnItemClickListener { override fun onClicked(position: Int) { diff --git a/app/src/main/java/com/casic/app/smartwell/greendao/DaoMaster.java b/app/src/main/java/com/casic/app/smartwell/greendao/DaoMaster.java index fdcf3a7..1e52b74 100644 --- a/app/src/main/java/com/casic/app/smartwell/greendao/DaoMaster.java +++ b/app/src/main/java/com/casic/app/smartwell/greendao/DaoMaster.java @@ -13,25 +13,20 @@ // THIS CODE IS GENERATED BY greenDAO, DO NOT EDIT. - /** * Master of DAO (schema version 4): knows all DAOs. */ public class DaoMaster extends AbstractDaoMaster { public static final int SCHEMA_VERSION = 4; - /** - * Creates underlying database table using DAOs. - */ + /** Creates underlying database table using DAOs. */ public static void createAllTables(Database db, boolean ifNotExists) { MapWellLocalBeanDao.createTable(db, ifNotExists); NoticeLocaleBeanDao.createTable(db, ifNotExists); PipeLocalBeanDao.createTable(db, ifNotExists); } - /** - * Drops underlying database table using DAOs. - */ + /** Drops underlying database table using DAOs. */ public static void dropAllTables(Database db, boolean ifExists) { MapWellLocalBeanDao.dropTable(db, ifExists); NoticeLocaleBeanDao.dropTable(db, ifExists); @@ -86,9 +81,7 @@ } } - /** - * WARNING: Drops all table on Upgrade! Use only during development. - */ + /** WARNING: Drops all table on Upgrade! Use only during development. */ public static class DevOpenHelper extends OpenHelper { public DevOpenHelper(Context context, String name) { super(context, name); diff --git a/app/src/main/java/com/casic/app/smartwell/greendao/DaoSession.java b/app/src/main/java/com/casic/app/smartwell/greendao/DaoSession.java index 0b36d17..3e40e3b 100644 --- a/app/src/main/java/com/casic/app/smartwell/greendao/DaoSession.java +++ b/app/src/main/java/com/casic/app/smartwell/greendao/DaoSession.java @@ -16,7 +16,7 @@ /** * {@inheritDoc} - * + * * @see org.greenrobot.greendao.AbstractDaoSession */ public class DaoSession extends AbstractDaoSession { @@ -50,7 +50,7 @@ registerDao(NoticeLocaleBean.class, noticeLocaleBeanDao); registerDao(PipeLocalBean.class, pipeLocalBeanDao); } - + public void clear() { mapWellLocalBeanDaoConfig.clearIdentityScope(); noticeLocaleBeanDaoConfig.clearIdentityScope(); diff --git a/app/src/main/java/com/casic/app/smartwell/greendao/MapWellLocalBeanDao.java b/app/src/main/java/com/casic/app/smartwell/greendao/MapWellLocalBeanDao.java index 8908fda..407bc92 100644 --- a/app/src/main/java/com/casic/app/smartwell/greendao/MapWellLocalBeanDao.java +++ b/app/src/main/java/com/casic/app/smartwell/greendao/MapWellLocalBeanDao.java @@ -12,10 +12,9 @@ import org.greenrobot.greendao.internal.DaoConfig; // THIS CODE IS GENERATED BY greenDAO, DO NOT EDIT. - -/** +/** * DAO for table "MAP_WELL_LOCAL_BEAN". - */ +*/ public class MapWellLocalBeanDao extends AbstractDao { public static final String TABLENAME = "MAP_WELL_LOCAL_BEAN"; @@ -57,16 +56,14 @@ public MapWellLocalBeanDao(DaoConfig config) { super(config); } - + public MapWellLocalBeanDao(DaoConfig config, DaoSession daoSession) { super(config, daoSession); } - /** - * Creates the underlying database table. - */ + /** Creates the underlying database table. */ public static void createTable(Database db, boolean ifNotExists) { - String constraint = ifNotExists ? "IF NOT EXISTS " : ""; + String constraint = ifNotExists? "IF NOT EXISTS ": ""; db.execSQL("CREATE TABLE " + constraint + "\"MAP_WELL_LOCAL_BEAN\" (" + // "\"_id\" INTEGER PRIMARY KEY AUTOINCREMENT ," + // 0: kId "\"AREA\" TEXT," + // 1: area @@ -96,9 +93,7 @@ "\"WELL_TYPE_NAME\" TEXT);"); // 25: wellTypeName } - /** - * Drops the underlying database table. - */ + /** Drops the underlying database table. */ public static void dropTable(Database db, boolean ifExists) { String sql = "DROP TABLE " + (ifExists ? "IF EXISTS " : "") + "\"MAP_WELL_LOCAL_BEAN\""; db.execSQL(sql); @@ -107,132 +102,132 @@ @Override protected final void bindValues(DatabaseStatement stmt, MapWellLocalBean entity) { stmt.clearBindings(); - + Long kId = entity.getKId(); if (kId != null) { stmt.bindLong(1, kId); } - + String area = entity.getArea(); if (area != null) { stmt.bindString(2, area); } - + String bfzt = entity.getBfzt(); if (bfzt != null) { stmt.bindString(3, bfzt); } - + String bfztName = entity.getBfztName(); if (bfztName != null) { stmt.bindString(4, bfztName); } - + String coordinateX = entity.getCoordinateX(); if (coordinateX != null) { stmt.bindString(5, coordinateX); } - + String coordinateY = entity.getCoordinateY(); if (coordinateY != null) { stmt.bindString(6, coordinateY); } - + String deep = entity.getDeep(); if (deep != null) { stmt.bindString(7, deep); } - + String deptName = entity.getDeptName(); if (deptName != null) { stmt.bindString(8, deptName); } - + String deptid = entity.getDeptid(); if (deptid != null) { stmt.bindString(9, deptid); } - + String id = entity.getId(); if (id != null) { stmt.bindString(10, id); } - + String latBaidu = entity.getLatBaidu(); if (latBaidu != null) { stmt.bindString(11, latBaidu); } - + String latGaode = entity.getLatGaode(); if (latGaode != null) { stmt.bindString(12, latGaode); } - + String lngBaidu = entity.getLngBaidu(); if (lngBaidu != null) { stmt.bindString(13, lngBaidu); } - + String lngGaode = entity.getLngGaode(); if (lngGaode != null) { stmt.bindString(14, lngGaode); } - + String notes = entity.getNotes(); if (notes != null) { stmt.bindString(15, notes); } - + String photos = entity.getPhotos(); if (photos != null) { stmt.bindString(16, photos); } - + String position = entity.getPosition(); if (position != null) { stmt.bindString(17, position); } - + String staff = entity.getStaff(); if (staff != null) { stmt.bindString(18, staff); } - + String tel = entity.getTel(); if (tel != null) { stmt.bindString(19, tel); } - + String ts = entity.getTs(); if (ts != null) { stmt.bindString(20, ts); } - + String valid = entity.getValid(); if (valid != null) { stmt.bindString(21, valid); } - + String watchData = entity.getWatchData(); if (watchData != null) { stmt.bindString(22, watchData); } - + String wellCode = entity.getWellCode(); if (wellCode != null) { stmt.bindString(23, wellCode); } - + String wellName = entity.getWellName(); if (wellName != null) { stmt.bindString(24, wellName); } - + String wellType = entity.getWellType(); if (wellType != null) { stmt.bindString(25, wellType); } - + String wellTypeName = entity.getWellTypeName(); if (wellTypeName != null) { stmt.bindString(26, wellTypeName); @@ -242,132 +237,132 @@ @Override protected final void bindValues(SQLiteStatement stmt, MapWellLocalBean entity) { stmt.clearBindings(); - + Long kId = entity.getKId(); if (kId != null) { stmt.bindLong(1, kId); } - + String area = entity.getArea(); if (area != null) { stmt.bindString(2, area); } - + String bfzt = entity.getBfzt(); if (bfzt != null) { stmt.bindString(3, bfzt); } - + String bfztName = entity.getBfztName(); if (bfztName != null) { stmt.bindString(4, bfztName); } - + String coordinateX = entity.getCoordinateX(); if (coordinateX != null) { stmt.bindString(5, coordinateX); } - + String coordinateY = entity.getCoordinateY(); if (coordinateY != null) { stmt.bindString(6, coordinateY); } - + String deep = entity.getDeep(); if (deep != null) { stmt.bindString(7, deep); } - + String deptName = entity.getDeptName(); if (deptName != null) { stmt.bindString(8, deptName); } - + String deptid = entity.getDeptid(); if (deptid != null) { stmt.bindString(9, deptid); } - + String id = entity.getId(); if (id != null) { stmt.bindString(10, id); } - + String latBaidu = entity.getLatBaidu(); if (latBaidu != null) { stmt.bindString(11, latBaidu); } - + String latGaode = entity.getLatGaode(); if (latGaode != null) { stmt.bindString(12, latGaode); } - + String lngBaidu = entity.getLngBaidu(); if (lngBaidu != null) { stmt.bindString(13, lngBaidu); } - + String lngGaode = entity.getLngGaode(); if (lngGaode != null) { stmt.bindString(14, lngGaode); } - + String notes = entity.getNotes(); if (notes != null) { stmt.bindString(15, notes); } - + String photos = entity.getPhotos(); if (photos != null) { stmt.bindString(16, photos); } - + String position = entity.getPosition(); if (position != null) { stmt.bindString(17, position); } - + String staff = entity.getStaff(); if (staff != null) { stmt.bindString(18, staff); } - + String tel = entity.getTel(); if (tel != null) { stmt.bindString(19, tel); } - + String ts = entity.getTs(); if (ts != null) { stmt.bindString(20, ts); } - + String valid = entity.getValid(); if (valid != null) { stmt.bindString(21, valid); } - + String watchData = entity.getWatchData(); if (watchData != null) { stmt.bindString(22, watchData); } - + String wellCode = entity.getWellCode(); if (wellCode != null) { stmt.bindString(23, wellCode); } - + String wellName = entity.getWellName(); if (wellName != null) { stmt.bindString(24, wellName); } - + String wellType = entity.getWellType(); if (wellType != null) { stmt.bindString(25, wellType); } - + String wellTypeName = entity.getWellTypeName(); if (wellTypeName != null) { stmt.bindString(26, wellTypeName); @@ -377,41 +372,41 @@ @Override public Long readKey(Cursor cursor, int offset) { return cursor.isNull(offset + 0) ? null : cursor.getLong(offset + 0); - } + } @Override public MapWellLocalBean readEntity(Cursor cursor, int offset) { MapWellLocalBean entity = new MapWellLocalBean( // - cursor.isNull(offset + 0) ? null : cursor.getLong(offset + 0), // kId - cursor.isNull(offset + 1) ? null : cursor.getString(offset + 1), // area - cursor.isNull(offset + 2) ? null : cursor.getString(offset + 2), // bfzt - cursor.isNull(offset + 3) ? null : cursor.getString(offset + 3), // bfztName - cursor.isNull(offset + 4) ? null : cursor.getString(offset + 4), // coordinateX - cursor.isNull(offset + 5) ? null : cursor.getString(offset + 5), // coordinateY - cursor.isNull(offset + 6) ? null : cursor.getString(offset + 6), // deep - cursor.isNull(offset + 7) ? null : cursor.getString(offset + 7), // deptName - cursor.isNull(offset + 8) ? null : cursor.getString(offset + 8), // deptid - cursor.isNull(offset + 9) ? null : cursor.getString(offset + 9), // id - cursor.isNull(offset + 10) ? null : cursor.getString(offset + 10), // latBaidu - cursor.isNull(offset + 11) ? null : cursor.getString(offset + 11), // latGaode - cursor.isNull(offset + 12) ? null : cursor.getString(offset + 12), // lngBaidu - cursor.isNull(offset + 13) ? null : cursor.getString(offset + 13), // lngGaode - cursor.isNull(offset + 14) ? null : cursor.getString(offset + 14), // notes - cursor.isNull(offset + 15) ? null : cursor.getString(offset + 15), // photos - cursor.isNull(offset + 16) ? null : cursor.getString(offset + 16), // position - cursor.isNull(offset + 17) ? null : cursor.getString(offset + 17), // staff - cursor.isNull(offset + 18) ? null : cursor.getString(offset + 18), // tel - cursor.isNull(offset + 19) ? null : cursor.getString(offset + 19), // ts - cursor.isNull(offset + 20) ? null : cursor.getString(offset + 20), // valid - cursor.isNull(offset + 21) ? null : cursor.getString(offset + 21), // watchData - cursor.isNull(offset + 22) ? null : cursor.getString(offset + 22), // wellCode - cursor.isNull(offset + 23) ? null : cursor.getString(offset + 23), // wellName - cursor.isNull(offset + 24) ? null : cursor.getString(offset + 24), // wellType - cursor.isNull(offset + 25) ? null : cursor.getString(offset + 25) // wellTypeName + cursor.isNull(offset + 0) ? null : cursor.getLong(offset + 0), // kId + cursor.isNull(offset + 1) ? null : cursor.getString(offset + 1), // area + cursor.isNull(offset + 2) ? null : cursor.getString(offset + 2), // bfzt + cursor.isNull(offset + 3) ? null : cursor.getString(offset + 3), // bfztName + cursor.isNull(offset + 4) ? null : cursor.getString(offset + 4), // coordinateX + cursor.isNull(offset + 5) ? null : cursor.getString(offset + 5), // coordinateY + cursor.isNull(offset + 6) ? null : cursor.getString(offset + 6), // deep + cursor.isNull(offset + 7) ? null : cursor.getString(offset + 7), // deptName + cursor.isNull(offset + 8) ? null : cursor.getString(offset + 8), // deptid + cursor.isNull(offset + 9) ? null : cursor.getString(offset + 9), // id + cursor.isNull(offset + 10) ? null : cursor.getString(offset + 10), // latBaidu + cursor.isNull(offset + 11) ? null : cursor.getString(offset + 11), // latGaode + cursor.isNull(offset + 12) ? null : cursor.getString(offset + 12), // lngBaidu + cursor.isNull(offset + 13) ? null : cursor.getString(offset + 13), // lngGaode + cursor.isNull(offset + 14) ? null : cursor.getString(offset + 14), // notes + cursor.isNull(offset + 15) ? null : cursor.getString(offset + 15), // photos + cursor.isNull(offset + 16) ? null : cursor.getString(offset + 16), // position + cursor.isNull(offset + 17) ? null : cursor.getString(offset + 17), // staff + cursor.isNull(offset + 18) ? null : cursor.getString(offset + 18), // tel + cursor.isNull(offset + 19) ? null : cursor.getString(offset + 19), // ts + cursor.isNull(offset + 20) ? null : cursor.getString(offset + 20), // valid + cursor.isNull(offset + 21) ? null : cursor.getString(offset + 21), // watchData + cursor.isNull(offset + 22) ? null : cursor.getString(offset + 22), // wellCode + cursor.isNull(offset + 23) ? null : cursor.getString(offset + 23), // wellName + cursor.isNull(offset + 24) ? null : cursor.getString(offset + 24), // wellType + cursor.isNull(offset + 25) ? null : cursor.getString(offset + 25) // wellTypeName ); return entity; } - + @Override public void readEntity(Cursor cursor, MapWellLocalBean entity, int offset) { entity.setKId(cursor.isNull(offset + 0) ? null : cursor.getLong(offset + 0)); @@ -440,17 +435,17 @@ entity.setWellName(cursor.isNull(offset + 23) ? null : cursor.getString(offset + 23)); entity.setWellType(cursor.isNull(offset + 24) ? null : cursor.getString(offset + 24)); entity.setWellTypeName(cursor.isNull(offset + 25) ? null : cursor.getString(offset + 25)); - } - + } + @Override protected final Long updateKeyAfterInsert(MapWellLocalBean entity, long rowId) { entity.setKId(rowId); return rowId; } - + @Override public Long getKey(MapWellLocalBean entity) { - if (entity != null) { + if(entity != null) { return entity.getKId(); } else { return null; @@ -466,5 +461,5 @@ protected final boolean isEntityUpdateable() { return true; } - + } diff --git a/app/src/main/java/com/casic/app/smartwell/greendao/NoticeLocaleBeanDao.java b/app/src/main/java/com/casic/app/smartwell/greendao/NoticeLocaleBeanDao.java index 64312ed..deb2d49 100644 --- a/app/src/main/java/com/casic/app/smartwell/greendao/NoticeLocaleBeanDao.java +++ b/app/src/main/java/com/casic/app/smartwell/greendao/NoticeLocaleBeanDao.java @@ -12,10 +12,9 @@ import org.greenrobot.greendao.internal.DaoConfig; // THIS CODE IS GENERATED BY greenDAO, DO NOT EDIT. - -/** +/** * DAO for table "NOTICE_LOCALE_BEAN". - */ +*/ public class NoticeLocaleBeanDao extends AbstractDao { public static final String TABLENAME = "NOTICE_LOCALE_BEAN"; @@ -43,16 +42,14 @@ public NoticeLocaleBeanDao(DaoConfig config) { super(config); } - + public NoticeLocaleBeanDao(DaoConfig config, DaoSession daoSession) { super(config, daoSession); } - /** - * Creates the underlying database table. - */ + /** Creates the underlying database table. */ public static void createTable(Database db, boolean ifNotExists) { - String constraint = ifNotExists ? "IF NOT EXISTS " : ""; + String constraint = ifNotExists? "IF NOT EXISTS ": ""; db.execSQL("CREATE TABLE " + constraint + "\"NOTICE_LOCALE_BEAN\" (" + // "\"_id\" INTEGER PRIMARY KEY AUTOINCREMENT ," + // 0: id "\"MESSAGE_ID\" TEXT UNIQUE ," + // 1: messageId @@ -68,9 +65,7 @@ "\"NOTICE_TIME\" TEXT);"); // 11: noticeTime } - /** - * Drops the underlying database table. - */ + /** Drops the underlying database table. */ public static void dropTable(Database db, boolean ifExists) { String sql = "DROP TABLE " + (ifExists ? "IF EXISTS " : "") + "\"NOTICE_LOCALE_BEAN\""; db.execSQL(sql); @@ -79,62 +74,62 @@ @Override protected final void bindValues(DatabaseStatement stmt, NoticeLocaleBean entity) { stmt.clearBindings(); - + Long id = entity.getId(); if (id != null) { stmt.bindLong(1, id); } - + String messageId = entity.getMessageId(); if (messageId != null) { stmt.bindString(2, messageId); } - + String appid = entity.getAppid(); if (appid != null) { stmt.bindString(3, appid); } - + String clientId = entity.getClientId(); if (clientId != null) { stmt.bindString(4, clientId); } - + String taskId = entity.getTaskId(); if (taskId != null) { stmt.bindString(5, taskId); } - + String userId = entity.getUserId(); if (userId != null) { stmt.bindString(6, userId); } - + String title = entity.getTitle(); if (title != null) { stmt.bindString(7, title); } - + String content = entity.getContent(); if (content != null) { stmt.bindString(8, content); } - + String deviceCode = entity.getDeviceCode(); if (deviceCode != null) { stmt.bindString(9, deviceCode); } - + String jobId = entity.getJobId(); if (jobId != null) { stmt.bindString(10, jobId); } - + String isRead = entity.getIsRead(); if (isRead != null) { stmt.bindString(11, isRead); } - + String noticeTime = entity.getNoticeTime(); if (noticeTime != null) { stmt.bindString(12, noticeTime); @@ -144,62 +139,62 @@ @Override protected final void bindValues(SQLiteStatement stmt, NoticeLocaleBean entity) { stmt.clearBindings(); - + Long id = entity.getId(); if (id != null) { stmt.bindLong(1, id); } - + String messageId = entity.getMessageId(); if (messageId != null) { stmt.bindString(2, messageId); } - + String appid = entity.getAppid(); if (appid != null) { stmt.bindString(3, appid); } - + String clientId = entity.getClientId(); if (clientId != null) { stmt.bindString(4, clientId); } - + String taskId = entity.getTaskId(); if (taskId != null) { stmt.bindString(5, taskId); } - + String userId = entity.getUserId(); if (userId != null) { stmt.bindString(6, userId); } - + String title = entity.getTitle(); if (title != null) { stmt.bindString(7, title); } - + String content = entity.getContent(); if (content != null) { stmt.bindString(8, content); } - + String deviceCode = entity.getDeviceCode(); if (deviceCode != null) { stmt.bindString(9, deviceCode); } - + String jobId = entity.getJobId(); if (jobId != null) { stmt.bindString(10, jobId); } - + String isRead = entity.getIsRead(); if (isRead != null) { stmt.bindString(11, isRead); } - + String noticeTime = entity.getNoticeTime(); if (noticeTime != null) { stmt.bindString(12, noticeTime); @@ -209,27 +204,27 @@ @Override public Long readKey(Cursor cursor, int offset) { return cursor.isNull(offset + 0) ? null : cursor.getLong(offset + 0); - } + } @Override public NoticeLocaleBean readEntity(Cursor cursor, int offset) { NoticeLocaleBean entity = new NoticeLocaleBean( // - cursor.isNull(offset + 0) ? null : cursor.getLong(offset + 0), // id - cursor.isNull(offset + 1) ? null : cursor.getString(offset + 1), // messageId - cursor.isNull(offset + 2) ? null : cursor.getString(offset + 2), // appid - cursor.isNull(offset + 3) ? null : cursor.getString(offset + 3), // clientId - cursor.isNull(offset + 4) ? null : cursor.getString(offset + 4), // taskId - cursor.isNull(offset + 5) ? null : cursor.getString(offset + 5), // userId - cursor.isNull(offset + 6) ? null : cursor.getString(offset + 6), // title - cursor.isNull(offset + 7) ? null : cursor.getString(offset + 7), // content - cursor.isNull(offset + 8) ? null : cursor.getString(offset + 8), // deviceCode - cursor.isNull(offset + 9) ? null : cursor.getString(offset + 9), // jobId - cursor.isNull(offset + 10) ? null : cursor.getString(offset + 10), // isRead - cursor.isNull(offset + 11) ? null : cursor.getString(offset + 11) // noticeTime + cursor.isNull(offset + 0) ? null : cursor.getLong(offset + 0), // id + cursor.isNull(offset + 1) ? null : cursor.getString(offset + 1), // messageId + cursor.isNull(offset + 2) ? null : cursor.getString(offset + 2), // appid + cursor.isNull(offset + 3) ? null : cursor.getString(offset + 3), // clientId + cursor.isNull(offset + 4) ? null : cursor.getString(offset + 4), // taskId + cursor.isNull(offset + 5) ? null : cursor.getString(offset + 5), // userId + cursor.isNull(offset + 6) ? null : cursor.getString(offset + 6), // title + cursor.isNull(offset + 7) ? null : cursor.getString(offset + 7), // content + cursor.isNull(offset + 8) ? null : cursor.getString(offset + 8), // deviceCode + cursor.isNull(offset + 9) ? null : cursor.getString(offset + 9), // jobId + cursor.isNull(offset + 10) ? null : cursor.getString(offset + 10), // isRead + cursor.isNull(offset + 11) ? null : cursor.getString(offset + 11) // noticeTime ); return entity; } - + @Override public void readEntity(Cursor cursor, NoticeLocaleBean entity, int offset) { entity.setId(cursor.isNull(offset + 0) ? null : cursor.getLong(offset + 0)); @@ -244,17 +239,17 @@ entity.setJobId(cursor.isNull(offset + 9) ? null : cursor.getString(offset + 9)); entity.setIsRead(cursor.isNull(offset + 10) ? null : cursor.getString(offset + 10)); entity.setNoticeTime(cursor.isNull(offset + 11) ? null : cursor.getString(offset + 11)); - } - + } + @Override protected final Long updateKeyAfterInsert(NoticeLocaleBean entity, long rowId) { entity.setId(rowId); return rowId; } - + @Override public Long getKey(NoticeLocaleBean entity) { - if (entity != null) { + if(entity != null) { return entity.getId(); } else { return null; @@ -270,5 +265,5 @@ protected final boolean isEntityUpdateable() { return true; } - + } diff --git a/app/src/main/java/com/casic/app/smartwell/greendao/PipeLocalBeanDao.java b/app/src/main/java/com/casic/app/smartwell/greendao/PipeLocalBeanDao.java index aab4d3f..df5515a 100644 --- a/app/src/main/java/com/casic/app/smartwell/greendao/PipeLocalBeanDao.java +++ b/app/src/main/java/com/casic/app/smartwell/greendao/PipeLocalBeanDao.java @@ -12,10 +12,9 @@ import org.greenrobot.greendao.internal.DaoConfig; // THIS CODE IS GENERATED BY greenDAO, DO NOT EDIT. - -/** +/** * DAO for table "PIPE_LOCAL_BEAN". - */ +*/ public class PipeLocalBeanDao extends AbstractDao { public static final String TABLENAME = "PIPE_LOCAL_BEAN"; @@ -37,16 +36,14 @@ public PipeLocalBeanDao(DaoConfig config) { super(config); } - + public PipeLocalBeanDao(DaoConfig config, DaoSession daoSession) { super(config, daoSession); } - /** - * Creates the underlying database table. - */ + /** Creates the underlying database table. */ public static void createTable(Database db, boolean ifNotExists) { - String constraint = ifNotExists ? "IF NOT EXISTS " : ""; + String constraint = ifNotExists? "IF NOT EXISTS ": ""; db.execSQL("CREATE TABLE " + constraint + "\"PIPE_LOCAL_BEAN\" (" + // "\"_id\" INTEGER PRIMARY KEY AUTOINCREMENT ," + // 0: id "\"PIPE_CODE\" TEXT," + // 1: pipeCode @@ -56,9 +53,7 @@ "\"START_LONGITUDE_GD\" TEXT);"); // 5: startLongitudeGd } - /** - * Drops the underlying database table. - */ + /** Drops the underlying database table. */ public static void dropTable(Database db, boolean ifExists) { String sql = "DROP TABLE " + (ifExists ? "IF EXISTS " : "") + "\"PIPE_LOCAL_BEAN\""; db.execSQL(sql); @@ -67,32 +62,32 @@ @Override protected final void bindValues(DatabaseStatement stmt, PipeLocalBean entity) { stmt.clearBindings(); - + Long id = entity.getId(); if (id != null) { stmt.bindLong(1, id); } - + String pipeCode = entity.getPipeCode(); if (pipeCode != null) { stmt.bindString(2, pipeCode); } - + String endLatitudeGd = entity.getEndLatitudeGd(); if (endLatitudeGd != null) { stmt.bindString(3, endLatitudeGd); } - + String endLongitudeGd = entity.getEndLongitudeGd(); if (endLongitudeGd != null) { stmt.bindString(4, endLongitudeGd); } - + String startLatitudeGd = entity.getStartLatitudeGd(); if (startLatitudeGd != null) { stmt.bindString(5, startLatitudeGd); } - + String startLongitudeGd = entity.getStartLongitudeGd(); if (startLongitudeGd != null) { stmt.bindString(6, startLongitudeGd); @@ -102,32 +97,32 @@ @Override protected final void bindValues(SQLiteStatement stmt, PipeLocalBean entity) { stmt.clearBindings(); - + Long id = entity.getId(); if (id != null) { stmt.bindLong(1, id); } - + String pipeCode = entity.getPipeCode(); if (pipeCode != null) { stmt.bindString(2, pipeCode); } - + String endLatitudeGd = entity.getEndLatitudeGd(); if (endLatitudeGd != null) { stmt.bindString(3, endLatitudeGd); } - + String endLongitudeGd = entity.getEndLongitudeGd(); if (endLongitudeGd != null) { stmt.bindString(4, endLongitudeGd); } - + String startLatitudeGd = entity.getStartLatitudeGd(); if (startLatitudeGd != null) { stmt.bindString(5, startLatitudeGd); } - + String startLongitudeGd = entity.getStartLongitudeGd(); if (startLongitudeGd != null) { stmt.bindString(6, startLongitudeGd); @@ -137,21 +132,21 @@ @Override public Long readKey(Cursor cursor, int offset) { return cursor.isNull(offset + 0) ? null : cursor.getLong(offset + 0); - } + } @Override public PipeLocalBean readEntity(Cursor cursor, int offset) { PipeLocalBean entity = new PipeLocalBean( // - cursor.isNull(offset + 0) ? null : cursor.getLong(offset + 0), // id - cursor.isNull(offset + 1) ? null : cursor.getString(offset + 1), // pipeCode - cursor.isNull(offset + 2) ? null : cursor.getString(offset + 2), // endLatitudeGd - cursor.isNull(offset + 3) ? null : cursor.getString(offset + 3), // endLongitudeGd - cursor.isNull(offset + 4) ? null : cursor.getString(offset + 4), // startLatitudeGd - cursor.isNull(offset + 5) ? null : cursor.getString(offset + 5) // startLongitudeGd + cursor.isNull(offset + 0) ? null : cursor.getLong(offset + 0), // id + cursor.isNull(offset + 1) ? null : cursor.getString(offset + 1), // pipeCode + cursor.isNull(offset + 2) ? null : cursor.getString(offset + 2), // endLatitudeGd + cursor.isNull(offset + 3) ? null : cursor.getString(offset + 3), // endLongitudeGd + cursor.isNull(offset + 4) ? null : cursor.getString(offset + 4), // startLatitudeGd + cursor.isNull(offset + 5) ? null : cursor.getString(offset + 5) // startLongitudeGd ); return entity; } - + @Override public void readEntity(Cursor cursor, PipeLocalBean entity, int offset) { entity.setId(cursor.isNull(offset + 0) ? null : cursor.getLong(offset + 0)); @@ -160,17 +155,17 @@ entity.setEndLongitudeGd(cursor.isNull(offset + 3) ? null : cursor.getString(offset + 3)); entity.setStartLatitudeGd(cursor.isNull(offset + 4) ? null : cursor.getString(offset + 4)); entity.setStartLongitudeGd(cursor.isNull(offset + 5) ? null : cursor.getString(offset + 5)); - } - + } + @Override protected final Long updateKeyAfterInsert(PipeLocalBean entity, long rowId) { entity.setId(rowId); return rowId; } - + @Override public Long getKey(PipeLocalBean entity) { - if (entity != null) { + if(entity != null) { return entity.getId(); } else { return null; @@ -186,5 +181,5 @@ protected final boolean isEntityUpdateable() { return true; } - + } diff --git a/app/src/main/java/com/casic/app/smartwell/view/ChangePasswordActivity.kt b/app/src/main/java/com/casic/app/smartwell/view/ChangePasswordActivity.kt index 8e41039..9f1dd40 100644 --- a/app/src/main/java/com/casic/app/smartwell/view/ChangePasswordActivity.kt +++ b/app/src/main/java/com/casic/app/smartwell/view/ChangePasswordActivity.kt @@ -14,7 +14,7 @@ import com.pengxh.kt.lite.extensions.show import com.pengxh.kt.lite.utils.ActivityStackManager import com.pengxh.kt.lite.utils.LoadState -import com.pengxh.kt.lite.utils.LoadingDialogHub +import com.pengxh.kt.lite.utils.LoadingDialog import com.pengxh.kt.lite.widget.TitleBarView import java.nio.charset.StandardCharsets @@ -46,15 +46,15 @@ override fun observeRequestState() { userViewModel.loadState.observe(this) { when (it) { - is LoadState.Loading -> LoadingDialogHub.show(this, "修改中,请稍后") + is LoadState.Loading -> LoadingDialog.show(this, "修改中,请稍后") is LoadState.Success -> { - LoadingDialogHub.dismiss() + LoadingDialog.dismiss() AuthenticationHelper.removeToken() this.navigatePageTo() ActivityStackManager.finishAllActivity() } - else -> LoadingDialogHub.dismiss() + else -> LoadingDialog.dismiss() } } } diff --git a/app/src/main/java/com/casic/app/smartwell/view/DeployedWellActivity.kt b/app/src/main/java/com/casic/app/smartwell/view/DeployedWellActivity.kt index fb4339c..28a5078 100644 --- a/app/src/main/java/com/casic/app/smartwell/view/DeployedWellActivity.kt +++ b/app/src/main/java/com/casic/app/smartwell/view/DeployedWellActivity.kt @@ -83,8 +83,8 @@ } //添加分割线 - binding.deployedListView.addItemDecoration( - RecyclerViewItemOffsets(0, 5, 0, 5) + binding.recyclerView.addItemDecoration( + RecyclerViewItemOffsets(0, 7, 0, 7) ) } @@ -149,12 +149,11 @@ } else { item.deep.toString() + "m" } - viewHolder.setText(R.id.wellNameView, item.wellName) + viewHolder.setText(R.id.wellTypeView, item.wellTypeName) .setText(R.id.wellDepthView, "深:${deep}") .setText(R.id.wellCodeView, "点位编号:${item.wellCode}") - .setText(R.id.wellTypeView, "点位类型:${item.wellTypeName}") .setText(R.id.ownerShipView, "权属单位:${item.deptName}") - .setText(R.id.wellLocationView, "点位置:${item.position}") + .setText(R.id.wellLocationView, "点位位置:${item.position}") .setOnClickListener( R.id.operationButton, object : View.OnClickListener { override fun onClick(v: View?) { @@ -207,7 +206,7 @@ }) } } - binding.deployedListView.adapter = deployAdapter + binding.recyclerView.adapter = deployAdapter deployAdapter.setOnItemClickedListener(object : NormalRecyclerAdapter.OnItemClickedListener { override fun onItemClicked(position: Int, t: WellListModel.DataBean.RowsBean) { diff --git a/app/src/main/java/com/casic/app/smartwell/view/LoginActivity.kt b/app/src/main/java/com/casic/app/smartwell/view/LoginActivity.kt index e4bb0e3..834527b 100644 --- a/app/src/main/java/com/casic/app/smartwell/view/LoginActivity.kt +++ b/app/src/main/java/com/casic/app/smartwell/view/LoginActivity.kt @@ -21,7 +21,7 @@ import com.pengxh.kt.lite.extensions.navigatePageTo import com.pengxh.kt.lite.extensions.readAssetsFile import com.pengxh.kt.lite.extensions.show -import com.pengxh.kt.lite.utils.LoadingDialogHub +import com.pengxh.kt.lite.utils.LoadingDialog import com.pengxh.kt.lite.utils.SaveKeyValues import kotlinx.coroutines.Dispatchers import kotlinx.coroutines.launch @@ -106,11 +106,11 @@ override fun observeRequestState() { authenticateViewModel.loadState.observe(this) { - LoadingDialogHub.show(this, "登录中,请稍后") + LoadingDialog.show(this, "登录中,请稍后") } loginViewModel.loadState.observe(this) { - LoadingDialogHub.dismiss() + LoadingDialog.dismiss() } } diff --git a/app/src/main/java/com/casic/app/smartwell/view/OrderCompletedDetailActivity.kt b/app/src/main/java/com/casic/app/smartwell/view/OrderCompletedDetailActivity.kt index db8ad1f..75cd905 100644 --- a/app/src/main/java/com/casic/app/smartwell/view/OrderCompletedDetailActivity.kt +++ b/app/src/main/java/com/casic/app/smartwell/view/OrderCompletedDetailActivity.kt @@ -17,7 +17,7 @@ import com.pengxh.kt.lite.extensions.show import com.pengxh.kt.lite.utils.Constant import com.pengxh.kt.lite.utils.LoadState -import com.pengxh.kt.lite.utils.LoadingDialogHub +import com.pengxh.kt.lite.utils.LoadingDialog import com.pengxh.kt.lite.widget.TitleBarView import com.pengxh.kt.lite.widget.dialog.AlertMessageDialog @@ -44,7 +44,7 @@ } override fun initOnCreate(savedInstanceState: Bundle?) { - val jobId = intent.getStringExtra(Constant.INTENT_PARAM)!! + val jobId = intent.getStringExtra(Constant.INTENT_PARAM_KEY)!! orderViewModel = ViewModelProvider(this)[OrderViewModel::class.java] orderViewModel.getWorkOrderDetail(jobId) orderViewModel.detailModel.observe(this) { @@ -154,8 +154,8 @@ override fun observeRequestState() { orderViewModel.loadState.observe(this) { when (it) { - is LoadState.Loading -> LoadingDialogHub.show(this, "数据加载中,请稍后") - else -> LoadingDialogHub.dismiss() + is LoadState.Loading -> LoadingDialog.show(this, "数据加载中,请稍后") + else -> LoadingDialog.dismiss() } } } diff --git a/app/src/main/java/com/casic/app/smartwell/view/OrderInHandleDetailActivity.kt b/app/src/main/java/com/casic/app/smartwell/view/OrderInHandleDetailActivity.kt index d70a979..04a7d5d 100644 --- a/app/src/main/java/com/casic/app/smartwell/view/OrderInHandleDetailActivity.kt +++ b/app/src/main/java/com/casic/app/smartwell/view/OrderInHandleDetailActivity.kt @@ -38,7 +38,7 @@ import com.pengxh.kt.lite.extensions.show import com.pengxh.kt.lite.utils.Constant import com.pengxh.kt.lite.utils.LoadState -import com.pengxh.kt.lite.utils.LoadingDialogHub +import com.pengxh.kt.lite.utils.LoadingDialog import com.pengxh.kt.lite.widget.TitleBarView import com.pengxh.kt.lite.widget.dialog.AlertControlDialog import com.pengxh.kt.lite.widget.dialog.AlertMessageDialog @@ -93,7 +93,7 @@ ) binding.addImageRecyclerView.adapter = imageAdapter - val jobId = intent.getStringExtra(Constant.INTENT_PARAM)!!//初始化图片九宫格 + val jobId = intent.getStringExtra(Constant.INTENT_PARAM_KEY)!!//初始化图片九宫格 orderViewModel.getWorkOrderDetail(jobId) orderViewModel.detailModel.observe(this) { if (it.code == 200) { @@ -312,41 +312,41 @@ override fun observeRequestState() { orderViewModel.loadState.observe(this) { when (it) { - is LoadState.Loading -> LoadingDialogHub.show(this, "数据加载中,请稍后") - else -> LoadingDialogHub.dismiss() + is LoadState.Loading -> LoadingDialog.show(this, "数据加载中,请稍后") + else -> LoadingDialog.dismiss() } } uploadImageViewModel.loadState.observe(this) { when (it) { - LoadState.Loading -> LoadingDialogHub.show(this, "图片上传中,请稍后...") - else -> LoadingDialogHub.dismiss() + LoadState.Loading -> LoadingDialog.show(this, "图片上传中,请稍后...") + else -> LoadingDialog.dismiss() } } //转单状态处理 operationViewModel.loadState.observe(this) { when (it) { - is LoadState.Loading -> LoadingDialogHub.show(this, "转单中,请稍后") + is LoadState.Loading -> LoadingDialog.show(this, "转单中,请稍后") is LoadState.Success -> { - LoadingDialogHub.dismiss() + LoadingDialog.dismiss() this.finish() } - else -> LoadingDialogHub.dismiss() + else -> LoadingDialog.dismiss() } } //处理完成工单状态处理 operationViewModel.loadState.observe(this) { when (it) { - is LoadState.Loading -> LoadingDialogHub.show(this, "处理中,请稍后") + is LoadState.Loading -> LoadingDialog.show(this, "处理中,请稍后") is LoadState.Success -> { - LoadingDialogHub.dismiss() + LoadingDialog.dismiss() this.finish() } - else -> LoadingDialogHub.dismiss() + else -> LoadingDialog.dismiss() } } } diff --git a/app/src/main/java/com/casic/app/smartwell/view/OrderNotConfirmedDetailActivity.kt b/app/src/main/java/com/casic/app/smartwell/view/OrderNotConfirmedDetailActivity.kt index 8e036d2..687ec86 100644 --- a/app/src/main/java/com/casic/app/smartwell/view/OrderNotConfirmedDetailActivity.kt +++ b/app/src/main/java/com/casic/app/smartwell/view/OrderNotConfirmedDetailActivity.kt @@ -36,7 +36,7 @@ import com.pengxh.kt.lite.extensions.show import com.pengxh.kt.lite.utils.Constant import com.pengxh.kt.lite.utils.LoadState -import com.pengxh.kt.lite.utils.LoadingDialogHub +import com.pengxh.kt.lite.utils.LoadingDialog import com.pengxh.kt.lite.widget.TitleBarView import com.pengxh.kt.lite.widget.dialog.AlertControlDialog import com.pengxh.kt.lite.widget.dialog.AlertMessageDialog @@ -80,7 +80,7 @@ } override fun initOnCreate(savedInstanceState: Bundle?) { - val jobId = intent.getStringExtra(Constant.INTENT_PARAM)!! + val jobId = intent.getStringExtra(Constant.INTENT_PARAM_KEY)!! //初始化图片九宫格 //左外边距,左内边距,右内边距,右外边距 val viewWidth = getScreenWidth() - (10 + 10 + 10 + 10).dp2px(this) @@ -263,41 +263,41 @@ //数据加载状态处理 orderViewModel.loadState.observe(this) { when (it) { - is LoadState.Loading -> LoadingDialogHub.show(this, "数据加载中,请稍后") - else -> LoadingDialogHub.dismiss() + is LoadState.Loading -> LoadingDialog.show(this, "数据加载中,请稍后") + else -> LoadingDialog.dismiss() } } uploadImageViewModel.loadState.observe(this) { when (it) { - LoadState.Loading -> LoadingDialogHub.show(this, "图片上传中,请稍后") - else -> LoadingDialogHub.dismiss() + LoadState.Loading -> LoadingDialog.show(this, "图片上传中,请稍后") + else -> LoadingDialog.dismiss() } } //转单状态处理 operationViewModel.loadState.observe(this) { when (it) { - is LoadState.Loading -> LoadingDialogHub.show(this, "转单中,请稍后") + is LoadState.Loading -> LoadingDialog.show(this, "转单中,请稍后") is LoadState.Success -> { - LoadingDialogHub.dismiss() + LoadingDialog.dismiss() this.finish() } - else -> LoadingDialogHub.dismiss() + else -> LoadingDialog.dismiss() } } //确认工单状态处理 operationViewModel.loadState.observe(this) { when (it) { - is LoadState.Loading -> LoadingDialogHub.show(this, "处理中,请稍后") + is LoadState.Loading -> LoadingDialog.show(this, "处理中,请稍后") is LoadState.Success -> { - LoadingDialogHub.dismiss() + LoadingDialog.dismiss() this.finish() } - else -> LoadingDialogHub.dismiss() + else -> LoadingDialog.dismiss() } } } diff --git a/app/src/main/java/com/casic/app/smartwell/view/OrderNotProcessedDetailActivity.kt b/app/src/main/java/com/casic/app/smartwell/view/OrderNotProcessedDetailActivity.kt index d3f22dc..0c97a52 100644 --- a/app/src/main/java/com/casic/app/smartwell/view/OrderNotProcessedDetailActivity.kt +++ b/app/src/main/java/com/casic/app/smartwell/view/OrderNotProcessedDetailActivity.kt @@ -18,7 +18,7 @@ import com.pengxh.kt.lite.extensions.show import com.pengxh.kt.lite.utils.Constant import com.pengxh.kt.lite.utils.LoadState -import com.pengxh.kt.lite.utils.LoadingDialogHub +import com.pengxh.kt.lite.utils.LoadingDialog import com.pengxh.kt.lite.widget.TitleBarView import com.pengxh.kt.lite.widget.dialog.AlertControlDialog import com.pengxh.kt.lite.widget.dialog.AlertMessageDialog @@ -50,7 +50,7 @@ } override fun initOnCreate(savedInstanceState: Bundle?) { - this.jobId = intent.getStringExtra(Constant.INTENT_PARAM)!! + this.jobId = intent.getStringExtra(Constant.INTENT_PARAM_KEY)!! orderViewModel = ViewModelProvider(this)[OrderViewModel::class.java] operationViewModel = ViewModelProvider(this)[OperationViewModel::class.java] wellViewModel = ViewModelProvider(this)[WellViewModel::class.java] @@ -162,21 +162,21 @@ //数据加载状态处理 orderViewModel.loadState.observe(this) { when (it) { - is LoadState.Loading -> LoadingDialogHub.show(this, "数据加载中,请稍后") - else -> LoadingDialogHub.dismiss() + is LoadState.Loading -> LoadingDialog.show(this, "数据加载中,请稍后") + else -> LoadingDialog.dismiss() } } //接单状态处理 operationViewModel.loadState.observe(this) { when (it) { - is LoadState.Loading -> LoadingDialogHub.show(this, "接单中,请稍后") + is LoadState.Loading -> LoadingDialog.show(this, "接单中,请稍后") is LoadState.Success -> { - LoadingDialogHub.dismiss() + LoadingDialog.dismiss() this.finish() } - else -> LoadingDialogHub.dismiss() + else -> LoadingDialog.dismiss() } } } diff --git a/app/src/main/java/com/casic/app/smartwell/view/SearchResultActivity.kt b/app/src/main/java/com/casic/app/smartwell/view/SearchResultActivity.kt index 6a92917..4f3a674 100644 --- a/app/src/main/java/com/casic/app/smartwell/view/SearchResultActivity.kt +++ b/app/src/main/java/com/casic/app/smartwell/view/SearchResultActivity.kt @@ -19,7 +19,7 @@ import com.pengxh.kt.lite.extensions.show import com.pengxh.kt.lite.utils.Constant import com.pengxh.kt.lite.utils.LoadState -import com.pengxh.kt.lite.utils.LoadingDialogHub +import com.pengxh.kt.lite.utils.LoadingDialog import com.pengxh.kt.lite.utils.WeakReferenceHandler import com.pengxh.kt.lite.widget.TitleBarView import com.pengxh.kt.lite.widget.dialog.AlertControlDialog @@ -56,7 +56,7 @@ } override fun initOnCreate(savedInstanceState: Bundle?) { - args = intent.getStringArrayListExtra(Constant.INTENT_PARAM)!! + args = intent.getStringArrayListExtra(Constant.INTENT_PARAM_KEY)!! orderViewModel = ViewModelProvider(this)[OrderViewModel::class.java] operationViewModel = ViewModelProvider(this)[OperationViewModel::class.java] @@ -101,24 +101,24 @@ } } - binding.resultRecyclerView.addItemDecoration( - RecyclerViewItemOffsets(0, 5, 0, 5) + binding.recyclerView.addItemDecoration( + RecyclerViewItemOffsets(0, 7, 0, 7) ) } override fun observeRequestState() { orderViewModel.loadState.observe(this) { when (it) { - is LoadState.Loading -> LoadingDialogHub.show(this, "数据加载中,请稍后") - else -> LoadingDialogHub.dismiss() + is LoadState.Loading -> LoadingDialog.show(this, "数据加载中,请稍后") + else -> LoadingDialog.dismiss() } } //接单状态处理 operationViewModel.loadState.observe(this) { when (it) { - is LoadState.Loading -> LoadingDialogHub.show(this, "接单中,请稍后") + is LoadState.Loading -> LoadingDialog.show(this, "接单中,请稍后") is LoadState.Success -> { - LoadingDialogHub.dismiss() + LoadingDialog.dismiss() //接单成功之后刷新列表 dataBeans.removeAt(clickedPosition) searchResultAdapter.notifyItemRemoved(clickedPosition) @@ -127,7 +127,7 @@ ) } - else -> LoadingDialogHub.dismiss() + else -> LoadingDialog.dismiss() } } } @@ -162,7 +162,7 @@ } else { binding.emptyInclude.emptyView.hide() searchResultAdapter = SearchResultAdapter(this, dataBeans) - binding.resultRecyclerView.adapter = searchResultAdapter + binding.recyclerView.adapter = searchResultAdapter searchResultAdapter.setOnItemClickListener(object : SearchResultAdapter.OnItemClickListener { override fun onClicked(position: Int) { diff --git a/app/src/main/java/com/casic/app/smartwell/view/UnDeployWellActivity.kt b/app/src/main/java/com/casic/app/smartwell/view/UnDeployWellActivity.kt index 7f7cd3c..555c278 100644 --- a/app/src/main/java/com/casic/app/smartwell/view/UnDeployWellActivity.kt +++ b/app/src/main/java/com/casic/app/smartwell/view/UnDeployWellActivity.kt @@ -81,8 +81,8 @@ } } - binding.undeployListView.addItemDecoration( - RecyclerViewItemOffsets(0, 5, 0, 5) + binding.recyclerView.addItemDecoration( + RecyclerViewItemOffsets(0, 7, 0, 7) ) } @@ -147,12 +147,11 @@ } else { item.deep.toString() + "m" } - viewHolder.setText(R.id.wellNameView, item.wellName) + viewHolder.setText(R.id.wellTypeView, item.wellTypeName) .setText(R.id.wellDepthView, "深:${deep}") .setText(R.id.wellCodeView, "点位编号:${item.wellCode}") - .setText(R.id.wellTypeView, "点位类型:${item.wellTypeName}") .setText(R.id.ownerShipView, "权属单位:${item.deptName}") - .setText(R.id.wellLocationView, "点位置:${item.position}") + .setText(R.id.wellLocationView, "点位位置:${item.position}") .setOnClickListener( R.id.operationButton, object : View.OnClickListener { override fun onClick(v: View?) { @@ -185,7 +184,7 @@ ) } } - binding.undeployListView.adapter = unDeployAdapter + binding.recyclerView.adapter = unDeployAdapter unDeployAdapter.setOnItemClickedListener(object : NormalRecyclerAdapter.OnItemClickedListener { override fun onItemClicked(position: Int, t: WellListModel.DataBean.RowsBean) { diff --git a/app/src/main/java/com/casic/app/smartwell/view/WellDetailActivity.kt b/app/src/main/java/com/casic/app/smartwell/view/WellDetailActivity.kt index b50d067..eb8b468 100644 --- a/app/src/main/java/com/casic/app/smartwell/view/WellDetailActivity.kt +++ b/app/src/main/java/com/casic/app/smartwell/view/WellDetailActivity.kt @@ -16,7 +16,7 @@ import com.pengxh.kt.lite.extensions.show import com.pengxh.kt.lite.utils.Constant import com.pengxh.kt.lite.utils.LoadState -import com.pengxh.kt.lite.utils.LoadingDialogHub +import com.pengxh.kt.lite.utils.LoadingDialog import com.pengxh.kt.lite.widget.TitleBarView import com.pengxh.kt.lite.widget.dialog.AlertMessageDialog @@ -44,7 +44,7 @@ } override fun initOnCreate(savedInstanceState: Bundle?) { - val wellId = intent.getStringExtra(Constant.INTENT_PARAM)!! + val wellId = intent.getStringExtra(Constant.INTENT_PARAM_KEY)!! wellViewModel = ViewModelProvider(this)[WellViewModel::class.java] wellViewModel.getWellDetail(wellId) wellViewModel.wellDetailModel.observe(this) { @@ -132,8 +132,8 @@ override fun observeRequestState() { wellViewModel.loadState.observe(this) { when (it) { - is LoadState.Loading -> LoadingDialogHub.show(this, "数据加载中,请稍后") - else -> LoadingDialogHub.dismiss() + is LoadState.Loading -> LoadingDialog.show(this, "数据加载中,请稍后") + else -> LoadingDialog.dismiss() } } } diff --git a/app/build.gradle b/app/build.gradle index 296fb6f..c18c251 100644 --- a/app/build.gradle +++ b/app/build.gradle @@ -40,10 +40,6 @@ // VIVO 相关应用参数 VIVO_APP_ID : "105749048", VIVO_APP_KEY : "e460fbf2c689e0f8c58ecc6aa62e1803", - - // 小米相关应用参数 -// XIAOMI_APP_ID : "", -// XIAOMI_APP_KEY : "", ] // 版本名后面添加一句话,意思就是flavor dimension 它的维度就是该版本号,多渠道打包很重要 @@ -107,7 +103,7 @@ dependencies { implementation fileTree(dir: 'libs', include: ['*.jar']) //基础依赖库 - implementation 'com.github.AndroidCoderPeng:Kotlin-lite-lib:1.0.10' + implementation 'com.github.AndroidCoderPeng:Kotlin-lite-lib:1.1.0' implementation 'androidx.appcompat:appcompat:1.6.1' implementation 'androidx.core:core-ktx:1.9.0' implementation 'androidx.constraintlayout:constraintlayout:2.1.4' @@ -165,8 +161,6 @@ implementation 'commons-codec:commons-codec:1.15' implementation 'com.android.support:support-annotations:28.0.0' implementation 'com.assist-v3:vivo:3.1.2' // vivo -// implementation 'com.getui.opt:xmp:3.3.1' // 小米 - //数据库框架 implementation 'org.greenrobot:greendao:3.3.0' //数据库升级 diff --git a/app/src/main/AndroidManifest.xml b/app/src/main/AndroidManifest.xml index c0af158..e0519bf 100644 --- a/app/src/main/AndroidManifest.xml +++ b/app/src/main/AndroidManifest.xml @@ -90,10 +90,10 @@ - + + android:value="ee96d8b5e12de3fbb29949efd57418a8" /> () @@ -150,7 +158,7 @@ val cameraPosition = CameraPosition(centerLatLng, 14f, 0f, 0f) val cameraUpdate = CameraUpdateFactory.newCameraPosition(cameraPosition) withContext(Dispatchers.Main) { - LoadingDialogHub.dismiss() + LoadingDialog.dismiss() aMap.animateCamera(cameraUpdate, 1500, null) } } @@ -239,11 +247,6 @@ } override fun initEvent() { - binding.rightOptionView.setOnClickListener { - val x = binding.rightOptionView.width - easyPopupWindow.width - easyPopupWindow.showAsDropDown(binding.rightOptionView, x, 0) - } - //撤防点位 binding.unDeployedLayout.setOnClickListener { requireContext().navigatePageTo() @@ -263,11 +266,11 @@ override fun observeRequestState() { wellViewModel.loadState.observe(this) { when (it) { - is LoadState.Loading -> LoadingDialogHub.show( + is LoadState.Loading -> LoadingDialog.show( requireActivity(), "数据加载中,请稍后..." ) - else -> LoadingDialogHub.dismiss() + else -> LoadingDialog.dismiss() } } } @@ -376,7 +379,7 @@ }).build().show() } }) - infoPopup.showAsDropDown(binding.rightOptionView) +// infoPopup.showAsDropDown(binding.rightOptionView) } override fun onCameraChange(p0: CameraPosition?) { diff --git a/app/src/main/java/com/casic/app/smartwell/fragment/HomePageNoClusterFragment.kt b/app/src/main/java/com/casic/app/smartwell/fragment/HomePageNoClusterFragment.kt index 802426a..b25f743 100644 --- a/app/src/main/java/com/casic/app/smartwell/fragment/HomePageNoClusterFragment.kt +++ b/app/src/main/java/com/casic/app/smartwell/fragment/HomePageNoClusterFragment.kt @@ -38,8 +38,9 @@ import com.pengxh.kt.lite.extensions.navigatePageTo import com.pengxh.kt.lite.extensions.show import com.pengxh.kt.lite.utils.LoadState -import com.pengxh.kt.lite.utils.LoadingDialogHub +import com.pengxh.kt.lite.utils.LoadingDialog import com.pengxh.kt.lite.widget.EasyPopupWindow +import com.pengxh.kt.lite.widget.TitleBarView import com.pengxh.kt.lite.widget.dialog.AlertControlDialog import kotlinx.coroutines.Dispatchers import kotlinx.coroutines.launch @@ -78,7 +79,15 @@ override fun setupTopBarLayout() { binding.rootView.initImmersionBar(this, false, R.color.mainThemeColor) - binding.titleView.text = "首页" + binding.titleView.setOnClickListener(object : TitleBarView.OnClickListener { + override fun onLeftClick() { + + } + + override fun onRightClick() { + easyPopupWindow.showAsDropDown(binding.titleView, binding.titleView.width, 0) + } + }) } override fun initOnCreate(savedInstanceState: Bundle?) { @@ -112,7 +121,7 @@ //渲染井位置 lifecycleScope.launch(Dispatchers.Main) { - LoadingDialogHub.show(requireActivity(), "数据加载中,请稍后") + LoadingDialog.show(requireActivity(), "数据加载中,请稍后") withContext(Dispatchers.IO) { //取Well缓存 val allMarkerOptions = ArrayList() @@ -144,7 +153,7 @@ val cameraPosition = CameraPosition(centerLatLng, 14f, 0f, 0f) val cameraUpdate = CameraUpdateFactory.newCameraPosition(cameraPosition) withContext(Dispatchers.Main) { - LoadingDialogHub.dismiss() + LoadingDialog.dismiss() aMap.animateCamera(cameraUpdate, 1500, null) } } @@ -238,11 +247,6 @@ } override fun initEvent() { - binding.rightOptionView.setOnClickListener { - val x = binding.rightOptionView.width - easyPopupWindow.width - easyPopupWindow.showAsDropDown(binding.rightOptionView, x, 0) - } - //撤防点位 binding.unDeployedLayout.setOnClickListener { requireContext().navigatePageTo() @@ -262,11 +266,11 @@ override fun observeRequestState() { wellViewModel.loadState.observe(this) { when (it) { - is LoadState.Loading -> LoadingDialogHub.show( + is LoadState.Loading -> LoadingDialog.show( requireActivity(), "数据加载中,请稍后..." ) - else -> LoadingDialogHub.dismiss() + else -> LoadingDialog.dismiss() } } } diff --git a/app/src/main/java/com/casic/app/smartwell/fragment/MinePageFragment.kt b/app/src/main/java/com/casic/app/smartwell/fragment/MinePageFragment.kt index 09a570c..dcb48f8 100644 --- a/app/src/main/java/com/casic/app/smartwell/fragment/MinePageFragment.kt +++ b/app/src/main/java/com/casic/app/smartwell/fragment/MinePageFragment.kt @@ -35,7 +35,7 @@ import com.pengxh.kt.lite.utils.ActivityStackManager import com.pengxh.kt.lite.utils.FileDownloadManager import com.pengxh.kt.lite.utils.LoadState -import com.pengxh.kt.lite.utils.LoadingDialogHub +import com.pengxh.kt.lite.utils.LoadingDialog import com.pengxh.kt.lite.widget.dialog.AlertControlDialog import com.pengxh.kt.lite.widget.dialog.BottomActionSheet import kotlinx.coroutines.Dispatchers @@ -60,7 +60,6 @@ override fun setupTopBarLayout() { binding.rootView.initImmersionBar(this, false, R.color.mainThemeColor) - binding.titleInclude.titleView.text = "我的" } override fun initOnCreate(savedInstanceState: Bundle?) { @@ -155,27 +154,27 @@ override fun observeRequestState() { userViewModel.loadState.observe(this) { when (it) { - is LoadState.Loading -> LoadingDialogHub.show( + is LoadState.Loading -> LoadingDialog.show( requireActivity(), "检查版本中,请稍后" ) - else -> LoadingDialogHub.dismiss() + else -> LoadingDialog.dismiss() } } wellViewModel.loadState.observe(this) { when (it) { - is LoadState.Loading -> LoadingDialogHub.show( + is LoadState.Loading -> LoadingDialog.show( requireActivity(), "数据更新中,请稍后" ) is LoadState.Fail -> { - LoadingDialogHub.dismiss() + LoadingDialog.dismiss() "数据更新超时".show(requireContext()) } else -> { - LoadingDialogHub.dismiss() + LoadingDialog.dismiss() AlertControlDialog.Builder().setContext(requireContext()).setTitle("温馨提示") .setMessage("数据更新成功,请重启应用").setNegativeButton("取消") .setPositiveButton("确定").setOnDialogButtonClickListener(object : @@ -197,17 +196,17 @@ lineViewModel.loadState.observe(this) { when (it) { - is LoadState.Loading -> LoadingDialogHub.show( + is LoadState.Loading -> LoadingDialog.show( requireActivity(), "数据更新中,请稍后" ) is LoadState.Fail -> { - LoadingDialogHub.dismiss() + LoadingDialog.dismiss() "数据更新超时".show(requireContext()) } else -> { - LoadingDialogHub.dismiss() + LoadingDialog.dismiss() AlertControlDialog.Builder().setContext(requireContext()).setTitle("温馨提示") .setMessage("数据更新成功,请重启应用").setNegativeButton("取消") .setPositiveButton("确定").setOnDialogButtonClickListener(object : diff --git a/app/src/main/java/com/casic/app/smartwell/fragment/NoticePageFragment.kt b/app/src/main/java/com/casic/app/smartwell/fragment/NoticePageFragment.kt index 171b555..3c93f54 100644 --- a/app/src/main/java/com/casic/app/smartwell/fragment/NoticePageFragment.kt +++ b/app/src/main/java/com/casic/app/smartwell/fragment/NoticePageFragment.kt @@ -48,7 +48,6 @@ override fun setupTopBarLayout() { binding.rootView.initImmersionBar(this, false, R.color.mainThemeColor) - binding.titleInclude.titleView.text = "消息" } override fun initOnCreate(savedInstanceState: Bundle?) { diff --git a/app/src/main/java/com/casic/app/smartwell/fragment/OrderListFragment.kt b/app/src/main/java/com/casic/app/smartwell/fragment/OrderListFragment.kt index 93ff35b..5e38acb 100644 --- a/app/src/main/java/com/casic/app/smartwell/fragment/OrderListFragment.kt +++ b/app/src/main/java/com/casic/app/smartwell/fragment/OrderListFragment.kt @@ -12,6 +12,7 @@ import com.casic.app.smartwell.view.SearchOrderActivity import com.pengxh.kt.lite.base.KotlinBaseFragment import com.pengxh.kt.lite.extensions.navigatePageTo +import com.pengxh.kt.lite.widget.TitleBarView class OrderListFragment : KotlinBaseFragment() { @@ -25,15 +26,22 @@ } override fun initViewBinding( - inflater: LayoutInflater, - container: ViewGroup? + inflater: LayoutInflater, container: ViewGroup? ): FragmentOrderBinding { return FragmentOrderBinding.inflate(inflater, container, false) } override fun setupTopBarLayout() { binding.rootView.initImmersionBar(this, false, R.color.mainThemeColor) - binding.titleView.text = "工单" + binding.titleView.setOnClickListener(object : TitleBarView.OnClickListener { + override fun onLeftClick() { + + } + + override fun onRightClick() { + requireContext().navigatePageTo() + } + }) } override fun initOnCreate(savedInstanceState: Bundle?) { @@ -51,8 +59,6 @@ } override fun initEvent() { - binding.rightOptionView.setOnClickListener { - requireContext().navigatePageTo() - } + } } \ No newline at end of file diff --git a/app/src/main/java/com/casic/app/smartwell/fragment/OrderNotProcessedFragment.kt b/app/src/main/java/com/casic/app/smartwell/fragment/OrderNotProcessedFragment.kt index 0b3d09d..2b6f21d 100644 --- a/app/src/main/java/com/casic/app/smartwell/fragment/OrderNotProcessedFragment.kt +++ b/app/src/main/java/com/casic/app/smartwell/fragment/OrderNotProcessedFragment.kt @@ -18,7 +18,7 @@ import com.pengxh.kt.lite.extensions.navigatePageTo import com.pengxh.kt.lite.extensions.show import com.pengxh.kt.lite.utils.LoadState -import com.pengxh.kt.lite.utils.LoadingDialogHub +import com.pengxh.kt.lite.utils.LoadingDialog import com.pengxh.kt.lite.utils.WeakReferenceHandler import com.pengxh.kt.lite.widget.dialog.AlertControlDialog @@ -78,8 +78,8 @@ operationViewModel = ViewModelProvider(this)[OperationViewModel::class.java] - binding.notProcessedView.addItemDecoration( - RecyclerViewItemOffsets(0, 5, 0, 5) + binding.recyclerView.addItemDecoration( + RecyclerViewItemOffsets(0, 7, 0, 7) ) } @@ -87,9 +87,9 @@ //接单状态处理 operationViewModel.loadState.observe(this) { when (it) { - is LoadState.Loading -> LoadingDialogHub.show(requireActivity(), "接单中,请稍后") + is LoadState.Loading -> LoadingDialog.show(requireActivity(), "接单中,请稍后") is LoadState.Success -> { - LoadingDialogHub.dismiss() + LoadingDialog.dismiss() //接单成功之后刷新列表 dataBeans.removeAt(clickedPosition) notProcessedAdapter.notifyItemRemoved(clickedPosition) @@ -98,7 +98,7 @@ ) } - else -> LoadingDialogHub.dismiss() + else -> LoadingDialog.dismiss() } } } @@ -131,7 +131,7 @@ } else { binding.emptyInclude.emptyView.hide() notProcessedAdapter = OrderNotProcessedAdapter(requireContext(), dataBeans) - binding.notProcessedView.adapter = notProcessedAdapter + binding.recyclerView.adapter = notProcessedAdapter notProcessedAdapter.setOnItemClickListener(object : OrderNotProcessedAdapter.OnItemClickListener { override fun onClicked(position: Int) { diff --git a/app/src/main/java/com/casic/app/smartwell/fragment/OvertimeNotAcceptFragment.kt b/app/src/main/java/com/casic/app/smartwell/fragment/OvertimeNotAcceptFragment.kt index a198545..9b318ca 100644 --- a/app/src/main/java/com/casic/app/smartwell/fragment/OvertimeNotAcceptFragment.kt +++ b/app/src/main/java/com/casic/app/smartwell/fragment/OvertimeNotAcceptFragment.kt @@ -18,7 +18,7 @@ import com.pengxh.kt.lite.extensions.navigatePageTo import com.pengxh.kt.lite.extensions.show import com.pengxh.kt.lite.utils.LoadState -import com.pengxh.kt.lite.utils.LoadingDialogHub +import com.pengxh.kt.lite.utils.LoadingDialog import com.pengxh.kt.lite.utils.WeakReferenceHandler import com.pengxh.kt.lite.widget.dialog.AlertControlDialog @@ -81,8 +81,8 @@ operationViewModel = ViewModelProvider(this)[OperationViewModel::class.java] - binding.notProcessedView.addItemDecoration( - RecyclerViewItemOffsets(0, 5, 0, 5) + binding.recyclerView.addItemDecoration( + RecyclerViewItemOffsets(0, 7, 0, 7) ) } @@ -90,9 +90,9 @@ //接单状态处理 operationViewModel.loadState.observe(this) { when (it) { - is LoadState.Loading -> LoadingDialogHub.show(requireActivity(), "接单中,请稍后") + is LoadState.Loading -> LoadingDialog.show(requireActivity(), "接单中,请稍后") is LoadState.Success -> { - LoadingDialogHub.dismiss() + LoadingDialog.dismiss() //接单成功之后刷新列表 dataBeans.removeAt(clickedPosition) notProcessedAdapter.notifyItemRemoved(clickedPosition) @@ -101,7 +101,7 @@ ) } - else -> LoadingDialogHub.dismiss() + else -> LoadingDialog.dismiss() } } } @@ -134,7 +134,7 @@ } else { binding.emptyInclude.emptyView.hide() notProcessedAdapter = OrderNotProcessedAdapter(requireContext(), dataBeans) - binding.notProcessedView.adapter = notProcessedAdapter + binding.recyclerView.adapter = notProcessedAdapter notProcessedAdapter.setOnItemClickListener(object : OrderNotProcessedAdapter.OnItemClickListener { override fun onClicked(position: Int) { diff --git a/app/src/main/java/com/casic/app/smartwell/greendao/DaoMaster.java b/app/src/main/java/com/casic/app/smartwell/greendao/DaoMaster.java index fdcf3a7..1e52b74 100644 --- a/app/src/main/java/com/casic/app/smartwell/greendao/DaoMaster.java +++ b/app/src/main/java/com/casic/app/smartwell/greendao/DaoMaster.java @@ -13,25 +13,20 @@ // THIS CODE IS GENERATED BY greenDAO, DO NOT EDIT. - /** * Master of DAO (schema version 4): knows all DAOs. */ public class DaoMaster extends AbstractDaoMaster { public static final int SCHEMA_VERSION = 4; - /** - * Creates underlying database table using DAOs. - */ + /** Creates underlying database table using DAOs. */ public static void createAllTables(Database db, boolean ifNotExists) { MapWellLocalBeanDao.createTable(db, ifNotExists); NoticeLocaleBeanDao.createTable(db, ifNotExists); PipeLocalBeanDao.createTable(db, ifNotExists); } - /** - * Drops underlying database table using DAOs. - */ + /** Drops underlying database table using DAOs. */ public static void dropAllTables(Database db, boolean ifExists) { MapWellLocalBeanDao.dropTable(db, ifExists); NoticeLocaleBeanDao.dropTable(db, ifExists); @@ -86,9 +81,7 @@ } } - /** - * WARNING: Drops all table on Upgrade! Use only during development. - */ + /** WARNING: Drops all table on Upgrade! Use only during development. */ public static class DevOpenHelper extends OpenHelper { public DevOpenHelper(Context context, String name) { super(context, name); diff --git a/app/src/main/java/com/casic/app/smartwell/greendao/DaoSession.java b/app/src/main/java/com/casic/app/smartwell/greendao/DaoSession.java index 0b36d17..3e40e3b 100644 --- a/app/src/main/java/com/casic/app/smartwell/greendao/DaoSession.java +++ b/app/src/main/java/com/casic/app/smartwell/greendao/DaoSession.java @@ -16,7 +16,7 @@ /** * {@inheritDoc} - * + * * @see org.greenrobot.greendao.AbstractDaoSession */ public class DaoSession extends AbstractDaoSession { @@ -50,7 +50,7 @@ registerDao(NoticeLocaleBean.class, noticeLocaleBeanDao); registerDao(PipeLocalBean.class, pipeLocalBeanDao); } - + public void clear() { mapWellLocalBeanDaoConfig.clearIdentityScope(); noticeLocaleBeanDaoConfig.clearIdentityScope(); diff --git a/app/src/main/java/com/casic/app/smartwell/greendao/MapWellLocalBeanDao.java b/app/src/main/java/com/casic/app/smartwell/greendao/MapWellLocalBeanDao.java index 8908fda..407bc92 100644 --- a/app/src/main/java/com/casic/app/smartwell/greendao/MapWellLocalBeanDao.java +++ b/app/src/main/java/com/casic/app/smartwell/greendao/MapWellLocalBeanDao.java @@ -12,10 +12,9 @@ import org.greenrobot.greendao.internal.DaoConfig; // THIS CODE IS GENERATED BY greenDAO, DO NOT EDIT. - -/** +/** * DAO for table "MAP_WELL_LOCAL_BEAN". - */ +*/ public class MapWellLocalBeanDao extends AbstractDao { public static final String TABLENAME = "MAP_WELL_LOCAL_BEAN"; @@ -57,16 +56,14 @@ public MapWellLocalBeanDao(DaoConfig config) { super(config); } - + public MapWellLocalBeanDao(DaoConfig config, DaoSession daoSession) { super(config, daoSession); } - /** - * Creates the underlying database table. - */ + /** Creates the underlying database table. */ public static void createTable(Database db, boolean ifNotExists) { - String constraint = ifNotExists ? "IF NOT EXISTS " : ""; + String constraint = ifNotExists? "IF NOT EXISTS ": ""; db.execSQL("CREATE TABLE " + constraint + "\"MAP_WELL_LOCAL_BEAN\" (" + // "\"_id\" INTEGER PRIMARY KEY AUTOINCREMENT ," + // 0: kId "\"AREA\" TEXT," + // 1: area @@ -96,9 +93,7 @@ "\"WELL_TYPE_NAME\" TEXT);"); // 25: wellTypeName } - /** - * Drops the underlying database table. - */ + /** Drops the underlying database table. */ public static void dropTable(Database db, boolean ifExists) { String sql = "DROP TABLE " + (ifExists ? "IF EXISTS " : "") + "\"MAP_WELL_LOCAL_BEAN\""; db.execSQL(sql); @@ -107,132 +102,132 @@ @Override protected final void bindValues(DatabaseStatement stmt, MapWellLocalBean entity) { stmt.clearBindings(); - + Long kId = entity.getKId(); if (kId != null) { stmt.bindLong(1, kId); } - + String area = entity.getArea(); if (area != null) { stmt.bindString(2, area); } - + String bfzt = entity.getBfzt(); if (bfzt != null) { stmt.bindString(3, bfzt); } - + String bfztName = entity.getBfztName(); if (bfztName != null) { stmt.bindString(4, bfztName); } - + String coordinateX = entity.getCoordinateX(); if (coordinateX != null) { stmt.bindString(5, coordinateX); } - + String coordinateY = entity.getCoordinateY(); if (coordinateY != null) { stmt.bindString(6, coordinateY); } - + String deep = entity.getDeep(); if (deep != null) { stmt.bindString(7, deep); } - + String deptName = entity.getDeptName(); if (deptName != null) { stmt.bindString(8, deptName); } - + String deptid = entity.getDeptid(); if (deptid != null) { stmt.bindString(9, deptid); } - + String id = entity.getId(); if (id != null) { stmt.bindString(10, id); } - + String latBaidu = entity.getLatBaidu(); if (latBaidu != null) { stmt.bindString(11, latBaidu); } - + String latGaode = entity.getLatGaode(); if (latGaode != null) { stmt.bindString(12, latGaode); } - + String lngBaidu = entity.getLngBaidu(); if (lngBaidu != null) { stmt.bindString(13, lngBaidu); } - + String lngGaode = entity.getLngGaode(); if (lngGaode != null) { stmt.bindString(14, lngGaode); } - + String notes = entity.getNotes(); if (notes != null) { stmt.bindString(15, notes); } - + String photos = entity.getPhotos(); if (photos != null) { stmt.bindString(16, photos); } - + String position = entity.getPosition(); if (position != null) { stmt.bindString(17, position); } - + String staff = entity.getStaff(); if (staff != null) { stmt.bindString(18, staff); } - + String tel = entity.getTel(); if (tel != null) { stmt.bindString(19, tel); } - + String ts = entity.getTs(); if (ts != null) { stmt.bindString(20, ts); } - + String valid = entity.getValid(); if (valid != null) { stmt.bindString(21, valid); } - + String watchData = entity.getWatchData(); if (watchData != null) { stmt.bindString(22, watchData); } - + String wellCode = entity.getWellCode(); if (wellCode != null) { stmt.bindString(23, wellCode); } - + String wellName = entity.getWellName(); if (wellName != null) { stmt.bindString(24, wellName); } - + String wellType = entity.getWellType(); if (wellType != null) { stmt.bindString(25, wellType); } - + String wellTypeName = entity.getWellTypeName(); if (wellTypeName != null) { stmt.bindString(26, wellTypeName); @@ -242,132 +237,132 @@ @Override protected final void bindValues(SQLiteStatement stmt, MapWellLocalBean entity) { stmt.clearBindings(); - + Long kId = entity.getKId(); if (kId != null) { stmt.bindLong(1, kId); } - + String area = entity.getArea(); if (area != null) { stmt.bindString(2, area); } - + String bfzt = entity.getBfzt(); if (bfzt != null) { stmt.bindString(3, bfzt); } - + String bfztName = entity.getBfztName(); if (bfztName != null) { stmt.bindString(4, bfztName); } - + String coordinateX = entity.getCoordinateX(); if (coordinateX != null) { stmt.bindString(5, coordinateX); } - + String coordinateY = entity.getCoordinateY(); if (coordinateY != null) { stmt.bindString(6, coordinateY); } - + String deep = entity.getDeep(); if (deep != null) { stmt.bindString(7, deep); } - + String deptName = entity.getDeptName(); if (deptName != null) { stmt.bindString(8, deptName); } - + String deptid = entity.getDeptid(); if (deptid != null) { stmt.bindString(9, deptid); } - + String id = entity.getId(); if (id != null) { stmt.bindString(10, id); } - + String latBaidu = entity.getLatBaidu(); if (latBaidu != null) { stmt.bindString(11, latBaidu); } - + String latGaode = entity.getLatGaode(); if (latGaode != null) { stmt.bindString(12, latGaode); } - + String lngBaidu = entity.getLngBaidu(); if (lngBaidu != null) { stmt.bindString(13, lngBaidu); } - + String lngGaode = entity.getLngGaode(); if (lngGaode != null) { stmt.bindString(14, lngGaode); } - + String notes = entity.getNotes(); if (notes != null) { stmt.bindString(15, notes); } - + String photos = entity.getPhotos(); if (photos != null) { stmt.bindString(16, photos); } - + String position = entity.getPosition(); if (position != null) { stmt.bindString(17, position); } - + String staff = entity.getStaff(); if (staff != null) { stmt.bindString(18, staff); } - + String tel = entity.getTel(); if (tel != null) { stmt.bindString(19, tel); } - + String ts = entity.getTs(); if (ts != null) { stmt.bindString(20, ts); } - + String valid = entity.getValid(); if (valid != null) { stmt.bindString(21, valid); } - + String watchData = entity.getWatchData(); if (watchData != null) { stmt.bindString(22, watchData); } - + String wellCode = entity.getWellCode(); if (wellCode != null) { stmt.bindString(23, wellCode); } - + String wellName = entity.getWellName(); if (wellName != null) { stmt.bindString(24, wellName); } - + String wellType = entity.getWellType(); if (wellType != null) { stmt.bindString(25, wellType); } - + String wellTypeName = entity.getWellTypeName(); if (wellTypeName != null) { stmt.bindString(26, wellTypeName); @@ -377,41 +372,41 @@ @Override public Long readKey(Cursor cursor, int offset) { return cursor.isNull(offset + 0) ? null : cursor.getLong(offset + 0); - } + } @Override public MapWellLocalBean readEntity(Cursor cursor, int offset) { MapWellLocalBean entity = new MapWellLocalBean( // - cursor.isNull(offset + 0) ? null : cursor.getLong(offset + 0), // kId - cursor.isNull(offset + 1) ? null : cursor.getString(offset + 1), // area - cursor.isNull(offset + 2) ? null : cursor.getString(offset + 2), // bfzt - cursor.isNull(offset + 3) ? null : cursor.getString(offset + 3), // bfztName - cursor.isNull(offset + 4) ? null : cursor.getString(offset + 4), // coordinateX - cursor.isNull(offset + 5) ? null : cursor.getString(offset + 5), // coordinateY - cursor.isNull(offset + 6) ? null : cursor.getString(offset + 6), // deep - cursor.isNull(offset + 7) ? null : cursor.getString(offset + 7), // deptName - cursor.isNull(offset + 8) ? null : cursor.getString(offset + 8), // deptid - cursor.isNull(offset + 9) ? null : cursor.getString(offset + 9), // id - cursor.isNull(offset + 10) ? null : cursor.getString(offset + 10), // latBaidu - cursor.isNull(offset + 11) ? null : cursor.getString(offset + 11), // latGaode - cursor.isNull(offset + 12) ? null : cursor.getString(offset + 12), // lngBaidu - cursor.isNull(offset + 13) ? null : cursor.getString(offset + 13), // lngGaode - cursor.isNull(offset + 14) ? null : cursor.getString(offset + 14), // notes - cursor.isNull(offset + 15) ? null : cursor.getString(offset + 15), // photos - cursor.isNull(offset + 16) ? null : cursor.getString(offset + 16), // position - cursor.isNull(offset + 17) ? null : cursor.getString(offset + 17), // staff - cursor.isNull(offset + 18) ? null : cursor.getString(offset + 18), // tel - cursor.isNull(offset + 19) ? null : cursor.getString(offset + 19), // ts - cursor.isNull(offset + 20) ? null : cursor.getString(offset + 20), // valid - cursor.isNull(offset + 21) ? null : cursor.getString(offset + 21), // watchData - cursor.isNull(offset + 22) ? null : cursor.getString(offset + 22), // wellCode - cursor.isNull(offset + 23) ? null : cursor.getString(offset + 23), // wellName - cursor.isNull(offset + 24) ? null : cursor.getString(offset + 24), // wellType - cursor.isNull(offset + 25) ? null : cursor.getString(offset + 25) // wellTypeName + cursor.isNull(offset + 0) ? null : cursor.getLong(offset + 0), // kId + cursor.isNull(offset + 1) ? null : cursor.getString(offset + 1), // area + cursor.isNull(offset + 2) ? null : cursor.getString(offset + 2), // bfzt + cursor.isNull(offset + 3) ? null : cursor.getString(offset + 3), // bfztName + cursor.isNull(offset + 4) ? null : cursor.getString(offset + 4), // coordinateX + cursor.isNull(offset + 5) ? null : cursor.getString(offset + 5), // coordinateY + cursor.isNull(offset + 6) ? null : cursor.getString(offset + 6), // deep + cursor.isNull(offset + 7) ? null : cursor.getString(offset + 7), // deptName + cursor.isNull(offset + 8) ? null : cursor.getString(offset + 8), // deptid + cursor.isNull(offset + 9) ? null : cursor.getString(offset + 9), // id + cursor.isNull(offset + 10) ? null : cursor.getString(offset + 10), // latBaidu + cursor.isNull(offset + 11) ? null : cursor.getString(offset + 11), // latGaode + cursor.isNull(offset + 12) ? null : cursor.getString(offset + 12), // lngBaidu + cursor.isNull(offset + 13) ? null : cursor.getString(offset + 13), // lngGaode + cursor.isNull(offset + 14) ? null : cursor.getString(offset + 14), // notes + cursor.isNull(offset + 15) ? null : cursor.getString(offset + 15), // photos + cursor.isNull(offset + 16) ? null : cursor.getString(offset + 16), // position + cursor.isNull(offset + 17) ? null : cursor.getString(offset + 17), // staff + cursor.isNull(offset + 18) ? null : cursor.getString(offset + 18), // tel + cursor.isNull(offset + 19) ? null : cursor.getString(offset + 19), // ts + cursor.isNull(offset + 20) ? null : cursor.getString(offset + 20), // valid + cursor.isNull(offset + 21) ? null : cursor.getString(offset + 21), // watchData + cursor.isNull(offset + 22) ? null : cursor.getString(offset + 22), // wellCode + cursor.isNull(offset + 23) ? null : cursor.getString(offset + 23), // wellName + cursor.isNull(offset + 24) ? null : cursor.getString(offset + 24), // wellType + cursor.isNull(offset + 25) ? null : cursor.getString(offset + 25) // wellTypeName ); return entity; } - + @Override public void readEntity(Cursor cursor, MapWellLocalBean entity, int offset) { entity.setKId(cursor.isNull(offset + 0) ? null : cursor.getLong(offset + 0)); @@ -440,17 +435,17 @@ entity.setWellName(cursor.isNull(offset + 23) ? null : cursor.getString(offset + 23)); entity.setWellType(cursor.isNull(offset + 24) ? null : cursor.getString(offset + 24)); entity.setWellTypeName(cursor.isNull(offset + 25) ? null : cursor.getString(offset + 25)); - } - + } + @Override protected final Long updateKeyAfterInsert(MapWellLocalBean entity, long rowId) { entity.setKId(rowId); return rowId; } - + @Override public Long getKey(MapWellLocalBean entity) { - if (entity != null) { + if(entity != null) { return entity.getKId(); } else { return null; @@ -466,5 +461,5 @@ protected final boolean isEntityUpdateable() { return true; } - + } diff --git a/app/src/main/java/com/casic/app/smartwell/greendao/NoticeLocaleBeanDao.java b/app/src/main/java/com/casic/app/smartwell/greendao/NoticeLocaleBeanDao.java index 64312ed..deb2d49 100644 --- a/app/src/main/java/com/casic/app/smartwell/greendao/NoticeLocaleBeanDao.java +++ b/app/src/main/java/com/casic/app/smartwell/greendao/NoticeLocaleBeanDao.java @@ -12,10 +12,9 @@ import org.greenrobot.greendao.internal.DaoConfig; // THIS CODE IS GENERATED BY greenDAO, DO NOT EDIT. - -/** +/** * DAO for table "NOTICE_LOCALE_BEAN". - */ +*/ public class NoticeLocaleBeanDao extends AbstractDao { public static final String TABLENAME = "NOTICE_LOCALE_BEAN"; @@ -43,16 +42,14 @@ public NoticeLocaleBeanDao(DaoConfig config) { super(config); } - + public NoticeLocaleBeanDao(DaoConfig config, DaoSession daoSession) { super(config, daoSession); } - /** - * Creates the underlying database table. - */ + /** Creates the underlying database table. */ public static void createTable(Database db, boolean ifNotExists) { - String constraint = ifNotExists ? "IF NOT EXISTS " : ""; + String constraint = ifNotExists? "IF NOT EXISTS ": ""; db.execSQL("CREATE TABLE " + constraint + "\"NOTICE_LOCALE_BEAN\" (" + // "\"_id\" INTEGER PRIMARY KEY AUTOINCREMENT ," + // 0: id "\"MESSAGE_ID\" TEXT UNIQUE ," + // 1: messageId @@ -68,9 +65,7 @@ "\"NOTICE_TIME\" TEXT);"); // 11: noticeTime } - /** - * Drops the underlying database table. - */ + /** Drops the underlying database table. */ public static void dropTable(Database db, boolean ifExists) { String sql = "DROP TABLE " + (ifExists ? "IF EXISTS " : "") + "\"NOTICE_LOCALE_BEAN\""; db.execSQL(sql); @@ -79,62 +74,62 @@ @Override protected final void bindValues(DatabaseStatement stmt, NoticeLocaleBean entity) { stmt.clearBindings(); - + Long id = entity.getId(); if (id != null) { stmt.bindLong(1, id); } - + String messageId = entity.getMessageId(); if (messageId != null) { stmt.bindString(2, messageId); } - + String appid = entity.getAppid(); if (appid != null) { stmt.bindString(3, appid); } - + String clientId = entity.getClientId(); if (clientId != null) { stmt.bindString(4, clientId); } - + String taskId = entity.getTaskId(); if (taskId != null) { stmt.bindString(5, taskId); } - + String userId = entity.getUserId(); if (userId != null) { stmt.bindString(6, userId); } - + String title = entity.getTitle(); if (title != null) { stmt.bindString(7, title); } - + String content = entity.getContent(); if (content != null) { stmt.bindString(8, content); } - + String deviceCode = entity.getDeviceCode(); if (deviceCode != null) { stmt.bindString(9, deviceCode); } - + String jobId = entity.getJobId(); if (jobId != null) { stmt.bindString(10, jobId); } - + String isRead = entity.getIsRead(); if (isRead != null) { stmt.bindString(11, isRead); } - + String noticeTime = entity.getNoticeTime(); if (noticeTime != null) { stmt.bindString(12, noticeTime); @@ -144,62 +139,62 @@ @Override protected final void bindValues(SQLiteStatement stmt, NoticeLocaleBean entity) { stmt.clearBindings(); - + Long id = entity.getId(); if (id != null) { stmt.bindLong(1, id); } - + String messageId = entity.getMessageId(); if (messageId != null) { stmt.bindString(2, messageId); } - + String appid = entity.getAppid(); if (appid != null) { stmt.bindString(3, appid); } - + String clientId = entity.getClientId(); if (clientId != null) { stmt.bindString(4, clientId); } - + String taskId = entity.getTaskId(); if (taskId != null) { stmt.bindString(5, taskId); } - + String userId = entity.getUserId(); if (userId != null) { stmt.bindString(6, userId); } - + String title = entity.getTitle(); if (title != null) { stmt.bindString(7, title); } - + String content = entity.getContent(); if (content != null) { stmt.bindString(8, content); } - + String deviceCode = entity.getDeviceCode(); if (deviceCode != null) { stmt.bindString(9, deviceCode); } - + String jobId = entity.getJobId(); if (jobId != null) { stmt.bindString(10, jobId); } - + String isRead = entity.getIsRead(); if (isRead != null) { stmt.bindString(11, isRead); } - + String noticeTime = entity.getNoticeTime(); if (noticeTime != null) { stmt.bindString(12, noticeTime); @@ -209,27 +204,27 @@ @Override public Long readKey(Cursor cursor, int offset) { return cursor.isNull(offset + 0) ? null : cursor.getLong(offset + 0); - } + } @Override public NoticeLocaleBean readEntity(Cursor cursor, int offset) { NoticeLocaleBean entity = new NoticeLocaleBean( // - cursor.isNull(offset + 0) ? null : cursor.getLong(offset + 0), // id - cursor.isNull(offset + 1) ? null : cursor.getString(offset + 1), // messageId - cursor.isNull(offset + 2) ? null : cursor.getString(offset + 2), // appid - cursor.isNull(offset + 3) ? null : cursor.getString(offset + 3), // clientId - cursor.isNull(offset + 4) ? null : cursor.getString(offset + 4), // taskId - cursor.isNull(offset + 5) ? null : cursor.getString(offset + 5), // userId - cursor.isNull(offset + 6) ? null : cursor.getString(offset + 6), // title - cursor.isNull(offset + 7) ? null : cursor.getString(offset + 7), // content - cursor.isNull(offset + 8) ? null : cursor.getString(offset + 8), // deviceCode - cursor.isNull(offset + 9) ? null : cursor.getString(offset + 9), // jobId - cursor.isNull(offset + 10) ? null : cursor.getString(offset + 10), // isRead - cursor.isNull(offset + 11) ? null : cursor.getString(offset + 11) // noticeTime + cursor.isNull(offset + 0) ? null : cursor.getLong(offset + 0), // id + cursor.isNull(offset + 1) ? null : cursor.getString(offset + 1), // messageId + cursor.isNull(offset + 2) ? null : cursor.getString(offset + 2), // appid + cursor.isNull(offset + 3) ? null : cursor.getString(offset + 3), // clientId + cursor.isNull(offset + 4) ? null : cursor.getString(offset + 4), // taskId + cursor.isNull(offset + 5) ? null : cursor.getString(offset + 5), // userId + cursor.isNull(offset + 6) ? null : cursor.getString(offset + 6), // title + cursor.isNull(offset + 7) ? null : cursor.getString(offset + 7), // content + cursor.isNull(offset + 8) ? null : cursor.getString(offset + 8), // deviceCode + cursor.isNull(offset + 9) ? null : cursor.getString(offset + 9), // jobId + cursor.isNull(offset + 10) ? null : cursor.getString(offset + 10), // isRead + cursor.isNull(offset + 11) ? null : cursor.getString(offset + 11) // noticeTime ); return entity; } - + @Override public void readEntity(Cursor cursor, NoticeLocaleBean entity, int offset) { entity.setId(cursor.isNull(offset + 0) ? null : cursor.getLong(offset + 0)); @@ -244,17 +239,17 @@ entity.setJobId(cursor.isNull(offset + 9) ? null : cursor.getString(offset + 9)); entity.setIsRead(cursor.isNull(offset + 10) ? null : cursor.getString(offset + 10)); entity.setNoticeTime(cursor.isNull(offset + 11) ? null : cursor.getString(offset + 11)); - } - + } + @Override protected final Long updateKeyAfterInsert(NoticeLocaleBean entity, long rowId) { entity.setId(rowId); return rowId; } - + @Override public Long getKey(NoticeLocaleBean entity) { - if (entity != null) { + if(entity != null) { return entity.getId(); } else { return null; @@ -270,5 +265,5 @@ protected final boolean isEntityUpdateable() { return true; } - + } diff --git a/app/src/main/java/com/casic/app/smartwell/greendao/PipeLocalBeanDao.java b/app/src/main/java/com/casic/app/smartwell/greendao/PipeLocalBeanDao.java index aab4d3f..df5515a 100644 --- a/app/src/main/java/com/casic/app/smartwell/greendao/PipeLocalBeanDao.java +++ b/app/src/main/java/com/casic/app/smartwell/greendao/PipeLocalBeanDao.java @@ -12,10 +12,9 @@ import org.greenrobot.greendao.internal.DaoConfig; // THIS CODE IS GENERATED BY greenDAO, DO NOT EDIT. - -/** +/** * DAO for table "PIPE_LOCAL_BEAN". - */ +*/ public class PipeLocalBeanDao extends AbstractDao { public static final String TABLENAME = "PIPE_LOCAL_BEAN"; @@ -37,16 +36,14 @@ public PipeLocalBeanDao(DaoConfig config) { super(config); } - + public PipeLocalBeanDao(DaoConfig config, DaoSession daoSession) { super(config, daoSession); } - /** - * Creates the underlying database table. - */ + /** Creates the underlying database table. */ public static void createTable(Database db, boolean ifNotExists) { - String constraint = ifNotExists ? "IF NOT EXISTS " : ""; + String constraint = ifNotExists? "IF NOT EXISTS ": ""; db.execSQL("CREATE TABLE " + constraint + "\"PIPE_LOCAL_BEAN\" (" + // "\"_id\" INTEGER PRIMARY KEY AUTOINCREMENT ," + // 0: id "\"PIPE_CODE\" TEXT," + // 1: pipeCode @@ -56,9 +53,7 @@ "\"START_LONGITUDE_GD\" TEXT);"); // 5: startLongitudeGd } - /** - * Drops the underlying database table. - */ + /** Drops the underlying database table. */ public static void dropTable(Database db, boolean ifExists) { String sql = "DROP TABLE " + (ifExists ? "IF EXISTS " : "") + "\"PIPE_LOCAL_BEAN\""; db.execSQL(sql); @@ -67,32 +62,32 @@ @Override protected final void bindValues(DatabaseStatement stmt, PipeLocalBean entity) { stmt.clearBindings(); - + Long id = entity.getId(); if (id != null) { stmt.bindLong(1, id); } - + String pipeCode = entity.getPipeCode(); if (pipeCode != null) { stmt.bindString(2, pipeCode); } - + String endLatitudeGd = entity.getEndLatitudeGd(); if (endLatitudeGd != null) { stmt.bindString(3, endLatitudeGd); } - + String endLongitudeGd = entity.getEndLongitudeGd(); if (endLongitudeGd != null) { stmt.bindString(4, endLongitudeGd); } - + String startLatitudeGd = entity.getStartLatitudeGd(); if (startLatitudeGd != null) { stmt.bindString(5, startLatitudeGd); } - + String startLongitudeGd = entity.getStartLongitudeGd(); if (startLongitudeGd != null) { stmt.bindString(6, startLongitudeGd); @@ -102,32 +97,32 @@ @Override protected final void bindValues(SQLiteStatement stmt, PipeLocalBean entity) { stmt.clearBindings(); - + Long id = entity.getId(); if (id != null) { stmt.bindLong(1, id); } - + String pipeCode = entity.getPipeCode(); if (pipeCode != null) { stmt.bindString(2, pipeCode); } - + String endLatitudeGd = entity.getEndLatitudeGd(); if (endLatitudeGd != null) { stmt.bindString(3, endLatitudeGd); } - + String endLongitudeGd = entity.getEndLongitudeGd(); if (endLongitudeGd != null) { stmt.bindString(4, endLongitudeGd); } - + String startLatitudeGd = entity.getStartLatitudeGd(); if (startLatitudeGd != null) { stmt.bindString(5, startLatitudeGd); } - + String startLongitudeGd = entity.getStartLongitudeGd(); if (startLongitudeGd != null) { stmt.bindString(6, startLongitudeGd); @@ -137,21 +132,21 @@ @Override public Long readKey(Cursor cursor, int offset) { return cursor.isNull(offset + 0) ? null : cursor.getLong(offset + 0); - } + } @Override public PipeLocalBean readEntity(Cursor cursor, int offset) { PipeLocalBean entity = new PipeLocalBean( // - cursor.isNull(offset + 0) ? null : cursor.getLong(offset + 0), // id - cursor.isNull(offset + 1) ? null : cursor.getString(offset + 1), // pipeCode - cursor.isNull(offset + 2) ? null : cursor.getString(offset + 2), // endLatitudeGd - cursor.isNull(offset + 3) ? null : cursor.getString(offset + 3), // endLongitudeGd - cursor.isNull(offset + 4) ? null : cursor.getString(offset + 4), // startLatitudeGd - cursor.isNull(offset + 5) ? null : cursor.getString(offset + 5) // startLongitudeGd + cursor.isNull(offset + 0) ? null : cursor.getLong(offset + 0), // id + cursor.isNull(offset + 1) ? null : cursor.getString(offset + 1), // pipeCode + cursor.isNull(offset + 2) ? null : cursor.getString(offset + 2), // endLatitudeGd + cursor.isNull(offset + 3) ? null : cursor.getString(offset + 3), // endLongitudeGd + cursor.isNull(offset + 4) ? null : cursor.getString(offset + 4), // startLatitudeGd + cursor.isNull(offset + 5) ? null : cursor.getString(offset + 5) // startLongitudeGd ); return entity; } - + @Override public void readEntity(Cursor cursor, PipeLocalBean entity, int offset) { entity.setId(cursor.isNull(offset + 0) ? null : cursor.getLong(offset + 0)); @@ -160,17 +155,17 @@ entity.setEndLongitudeGd(cursor.isNull(offset + 3) ? null : cursor.getString(offset + 3)); entity.setStartLatitudeGd(cursor.isNull(offset + 4) ? null : cursor.getString(offset + 4)); entity.setStartLongitudeGd(cursor.isNull(offset + 5) ? null : cursor.getString(offset + 5)); - } - + } + @Override protected final Long updateKeyAfterInsert(PipeLocalBean entity, long rowId) { entity.setId(rowId); return rowId; } - + @Override public Long getKey(PipeLocalBean entity) { - if (entity != null) { + if(entity != null) { return entity.getId(); } else { return null; @@ -186,5 +181,5 @@ protected final boolean isEntityUpdateable() { return true; } - + } diff --git a/app/src/main/java/com/casic/app/smartwell/view/ChangePasswordActivity.kt b/app/src/main/java/com/casic/app/smartwell/view/ChangePasswordActivity.kt index 8e41039..9f1dd40 100644 --- a/app/src/main/java/com/casic/app/smartwell/view/ChangePasswordActivity.kt +++ b/app/src/main/java/com/casic/app/smartwell/view/ChangePasswordActivity.kt @@ -14,7 +14,7 @@ import com.pengxh.kt.lite.extensions.show import com.pengxh.kt.lite.utils.ActivityStackManager import com.pengxh.kt.lite.utils.LoadState -import com.pengxh.kt.lite.utils.LoadingDialogHub +import com.pengxh.kt.lite.utils.LoadingDialog import com.pengxh.kt.lite.widget.TitleBarView import java.nio.charset.StandardCharsets @@ -46,15 +46,15 @@ override fun observeRequestState() { userViewModel.loadState.observe(this) { when (it) { - is LoadState.Loading -> LoadingDialogHub.show(this, "修改中,请稍后") + is LoadState.Loading -> LoadingDialog.show(this, "修改中,请稍后") is LoadState.Success -> { - LoadingDialogHub.dismiss() + LoadingDialog.dismiss() AuthenticationHelper.removeToken() this.navigatePageTo() ActivityStackManager.finishAllActivity() } - else -> LoadingDialogHub.dismiss() + else -> LoadingDialog.dismiss() } } } diff --git a/app/src/main/java/com/casic/app/smartwell/view/DeployedWellActivity.kt b/app/src/main/java/com/casic/app/smartwell/view/DeployedWellActivity.kt index fb4339c..28a5078 100644 --- a/app/src/main/java/com/casic/app/smartwell/view/DeployedWellActivity.kt +++ b/app/src/main/java/com/casic/app/smartwell/view/DeployedWellActivity.kt @@ -83,8 +83,8 @@ } //添加分割线 - binding.deployedListView.addItemDecoration( - RecyclerViewItemOffsets(0, 5, 0, 5) + binding.recyclerView.addItemDecoration( + RecyclerViewItemOffsets(0, 7, 0, 7) ) } @@ -149,12 +149,11 @@ } else { item.deep.toString() + "m" } - viewHolder.setText(R.id.wellNameView, item.wellName) + viewHolder.setText(R.id.wellTypeView, item.wellTypeName) .setText(R.id.wellDepthView, "深:${deep}") .setText(R.id.wellCodeView, "点位编号:${item.wellCode}") - .setText(R.id.wellTypeView, "点位类型:${item.wellTypeName}") .setText(R.id.ownerShipView, "权属单位:${item.deptName}") - .setText(R.id.wellLocationView, "点位置:${item.position}") + .setText(R.id.wellLocationView, "点位位置:${item.position}") .setOnClickListener( R.id.operationButton, object : View.OnClickListener { override fun onClick(v: View?) { @@ -207,7 +206,7 @@ }) } } - binding.deployedListView.adapter = deployAdapter + binding.recyclerView.adapter = deployAdapter deployAdapter.setOnItemClickedListener(object : NormalRecyclerAdapter.OnItemClickedListener { override fun onItemClicked(position: Int, t: WellListModel.DataBean.RowsBean) { diff --git a/app/src/main/java/com/casic/app/smartwell/view/LoginActivity.kt b/app/src/main/java/com/casic/app/smartwell/view/LoginActivity.kt index e4bb0e3..834527b 100644 --- a/app/src/main/java/com/casic/app/smartwell/view/LoginActivity.kt +++ b/app/src/main/java/com/casic/app/smartwell/view/LoginActivity.kt @@ -21,7 +21,7 @@ import com.pengxh.kt.lite.extensions.navigatePageTo import com.pengxh.kt.lite.extensions.readAssetsFile import com.pengxh.kt.lite.extensions.show -import com.pengxh.kt.lite.utils.LoadingDialogHub +import com.pengxh.kt.lite.utils.LoadingDialog import com.pengxh.kt.lite.utils.SaveKeyValues import kotlinx.coroutines.Dispatchers import kotlinx.coroutines.launch @@ -106,11 +106,11 @@ override fun observeRequestState() { authenticateViewModel.loadState.observe(this) { - LoadingDialogHub.show(this, "登录中,请稍后") + LoadingDialog.show(this, "登录中,请稍后") } loginViewModel.loadState.observe(this) { - LoadingDialogHub.dismiss() + LoadingDialog.dismiss() } } diff --git a/app/src/main/java/com/casic/app/smartwell/view/OrderCompletedDetailActivity.kt b/app/src/main/java/com/casic/app/smartwell/view/OrderCompletedDetailActivity.kt index db8ad1f..75cd905 100644 --- a/app/src/main/java/com/casic/app/smartwell/view/OrderCompletedDetailActivity.kt +++ b/app/src/main/java/com/casic/app/smartwell/view/OrderCompletedDetailActivity.kt @@ -17,7 +17,7 @@ import com.pengxh.kt.lite.extensions.show import com.pengxh.kt.lite.utils.Constant import com.pengxh.kt.lite.utils.LoadState -import com.pengxh.kt.lite.utils.LoadingDialogHub +import com.pengxh.kt.lite.utils.LoadingDialog import com.pengxh.kt.lite.widget.TitleBarView import com.pengxh.kt.lite.widget.dialog.AlertMessageDialog @@ -44,7 +44,7 @@ } override fun initOnCreate(savedInstanceState: Bundle?) { - val jobId = intent.getStringExtra(Constant.INTENT_PARAM)!! + val jobId = intent.getStringExtra(Constant.INTENT_PARAM_KEY)!! orderViewModel = ViewModelProvider(this)[OrderViewModel::class.java] orderViewModel.getWorkOrderDetail(jobId) orderViewModel.detailModel.observe(this) { @@ -154,8 +154,8 @@ override fun observeRequestState() { orderViewModel.loadState.observe(this) { when (it) { - is LoadState.Loading -> LoadingDialogHub.show(this, "数据加载中,请稍后") - else -> LoadingDialogHub.dismiss() + is LoadState.Loading -> LoadingDialog.show(this, "数据加载中,请稍后") + else -> LoadingDialog.dismiss() } } } diff --git a/app/src/main/java/com/casic/app/smartwell/view/OrderInHandleDetailActivity.kt b/app/src/main/java/com/casic/app/smartwell/view/OrderInHandleDetailActivity.kt index d70a979..04a7d5d 100644 --- a/app/src/main/java/com/casic/app/smartwell/view/OrderInHandleDetailActivity.kt +++ b/app/src/main/java/com/casic/app/smartwell/view/OrderInHandleDetailActivity.kt @@ -38,7 +38,7 @@ import com.pengxh.kt.lite.extensions.show import com.pengxh.kt.lite.utils.Constant import com.pengxh.kt.lite.utils.LoadState -import com.pengxh.kt.lite.utils.LoadingDialogHub +import com.pengxh.kt.lite.utils.LoadingDialog import com.pengxh.kt.lite.widget.TitleBarView import com.pengxh.kt.lite.widget.dialog.AlertControlDialog import com.pengxh.kt.lite.widget.dialog.AlertMessageDialog @@ -93,7 +93,7 @@ ) binding.addImageRecyclerView.adapter = imageAdapter - val jobId = intent.getStringExtra(Constant.INTENT_PARAM)!!//初始化图片九宫格 + val jobId = intent.getStringExtra(Constant.INTENT_PARAM_KEY)!!//初始化图片九宫格 orderViewModel.getWorkOrderDetail(jobId) orderViewModel.detailModel.observe(this) { if (it.code == 200) { @@ -312,41 +312,41 @@ override fun observeRequestState() { orderViewModel.loadState.observe(this) { when (it) { - is LoadState.Loading -> LoadingDialogHub.show(this, "数据加载中,请稍后") - else -> LoadingDialogHub.dismiss() + is LoadState.Loading -> LoadingDialog.show(this, "数据加载中,请稍后") + else -> LoadingDialog.dismiss() } } uploadImageViewModel.loadState.observe(this) { when (it) { - LoadState.Loading -> LoadingDialogHub.show(this, "图片上传中,请稍后...") - else -> LoadingDialogHub.dismiss() + LoadState.Loading -> LoadingDialog.show(this, "图片上传中,请稍后...") + else -> LoadingDialog.dismiss() } } //转单状态处理 operationViewModel.loadState.observe(this) { when (it) { - is LoadState.Loading -> LoadingDialogHub.show(this, "转单中,请稍后") + is LoadState.Loading -> LoadingDialog.show(this, "转单中,请稍后") is LoadState.Success -> { - LoadingDialogHub.dismiss() + LoadingDialog.dismiss() this.finish() } - else -> LoadingDialogHub.dismiss() + else -> LoadingDialog.dismiss() } } //处理完成工单状态处理 operationViewModel.loadState.observe(this) { when (it) { - is LoadState.Loading -> LoadingDialogHub.show(this, "处理中,请稍后") + is LoadState.Loading -> LoadingDialog.show(this, "处理中,请稍后") is LoadState.Success -> { - LoadingDialogHub.dismiss() + LoadingDialog.dismiss() this.finish() } - else -> LoadingDialogHub.dismiss() + else -> LoadingDialog.dismiss() } } } diff --git a/app/src/main/java/com/casic/app/smartwell/view/OrderNotConfirmedDetailActivity.kt b/app/src/main/java/com/casic/app/smartwell/view/OrderNotConfirmedDetailActivity.kt index 8e036d2..687ec86 100644 --- a/app/src/main/java/com/casic/app/smartwell/view/OrderNotConfirmedDetailActivity.kt +++ b/app/src/main/java/com/casic/app/smartwell/view/OrderNotConfirmedDetailActivity.kt @@ -36,7 +36,7 @@ import com.pengxh.kt.lite.extensions.show import com.pengxh.kt.lite.utils.Constant import com.pengxh.kt.lite.utils.LoadState -import com.pengxh.kt.lite.utils.LoadingDialogHub +import com.pengxh.kt.lite.utils.LoadingDialog import com.pengxh.kt.lite.widget.TitleBarView import com.pengxh.kt.lite.widget.dialog.AlertControlDialog import com.pengxh.kt.lite.widget.dialog.AlertMessageDialog @@ -80,7 +80,7 @@ } override fun initOnCreate(savedInstanceState: Bundle?) { - val jobId = intent.getStringExtra(Constant.INTENT_PARAM)!! + val jobId = intent.getStringExtra(Constant.INTENT_PARAM_KEY)!! //初始化图片九宫格 //左外边距,左内边距,右内边距,右外边距 val viewWidth = getScreenWidth() - (10 + 10 + 10 + 10).dp2px(this) @@ -263,41 +263,41 @@ //数据加载状态处理 orderViewModel.loadState.observe(this) { when (it) { - is LoadState.Loading -> LoadingDialogHub.show(this, "数据加载中,请稍后") - else -> LoadingDialogHub.dismiss() + is LoadState.Loading -> LoadingDialog.show(this, "数据加载中,请稍后") + else -> LoadingDialog.dismiss() } } uploadImageViewModel.loadState.observe(this) { when (it) { - LoadState.Loading -> LoadingDialogHub.show(this, "图片上传中,请稍后") - else -> LoadingDialogHub.dismiss() + LoadState.Loading -> LoadingDialog.show(this, "图片上传中,请稍后") + else -> LoadingDialog.dismiss() } } //转单状态处理 operationViewModel.loadState.observe(this) { when (it) { - is LoadState.Loading -> LoadingDialogHub.show(this, "转单中,请稍后") + is LoadState.Loading -> LoadingDialog.show(this, "转单中,请稍后") is LoadState.Success -> { - LoadingDialogHub.dismiss() + LoadingDialog.dismiss() this.finish() } - else -> LoadingDialogHub.dismiss() + else -> LoadingDialog.dismiss() } } //确认工单状态处理 operationViewModel.loadState.observe(this) { when (it) { - is LoadState.Loading -> LoadingDialogHub.show(this, "处理中,请稍后") + is LoadState.Loading -> LoadingDialog.show(this, "处理中,请稍后") is LoadState.Success -> { - LoadingDialogHub.dismiss() + LoadingDialog.dismiss() this.finish() } - else -> LoadingDialogHub.dismiss() + else -> LoadingDialog.dismiss() } } } diff --git a/app/src/main/java/com/casic/app/smartwell/view/OrderNotProcessedDetailActivity.kt b/app/src/main/java/com/casic/app/smartwell/view/OrderNotProcessedDetailActivity.kt index d3f22dc..0c97a52 100644 --- a/app/src/main/java/com/casic/app/smartwell/view/OrderNotProcessedDetailActivity.kt +++ b/app/src/main/java/com/casic/app/smartwell/view/OrderNotProcessedDetailActivity.kt @@ -18,7 +18,7 @@ import com.pengxh.kt.lite.extensions.show import com.pengxh.kt.lite.utils.Constant import com.pengxh.kt.lite.utils.LoadState -import com.pengxh.kt.lite.utils.LoadingDialogHub +import com.pengxh.kt.lite.utils.LoadingDialog import com.pengxh.kt.lite.widget.TitleBarView import com.pengxh.kt.lite.widget.dialog.AlertControlDialog import com.pengxh.kt.lite.widget.dialog.AlertMessageDialog @@ -50,7 +50,7 @@ } override fun initOnCreate(savedInstanceState: Bundle?) { - this.jobId = intent.getStringExtra(Constant.INTENT_PARAM)!! + this.jobId = intent.getStringExtra(Constant.INTENT_PARAM_KEY)!! orderViewModel = ViewModelProvider(this)[OrderViewModel::class.java] operationViewModel = ViewModelProvider(this)[OperationViewModel::class.java] wellViewModel = ViewModelProvider(this)[WellViewModel::class.java] @@ -162,21 +162,21 @@ //数据加载状态处理 orderViewModel.loadState.observe(this) { when (it) { - is LoadState.Loading -> LoadingDialogHub.show(this, "数据加载中,请稍后") - else -> LoadingDialogHub.dismiss() + is LoadState.Loading -> LoadingDialog.show(this, "数据加载中,请稍后") + else -> LoadingDialog.dismiss() } } //接单状态处理 operationViewModel.loadState.observe(this) { when (it) { - is LoadState.Loading -> LoadingDialogHub.show(this, "接单中,请稍后") + is LoadState.Loading -> LoadingDialog.show(this, "接单中,请稍后") is LoadState.Success -> { - LoadingDialogHub.dismiss() + LoadingDialog.dismiss() this.finish() } - else -> LoadingDialogHub.dismiss() + else -> LoadingDialog.dismiss() } } } diff --git a/app/src/main/java/com/casic/app/smartwell/view/SearchResultActivity.kt b/app/src/main/java/com/casic/app/smartwell/view/SearchResultActivity.kt index 6a92917..4f3a674 100644 --- a/app/src/main/java/com/casic/app/smartwell/view/SearchResultActivity.kt +++ b/app/src/main/java/com/casic/app/smartwell/view/SearchResultActivity.kt @@ -19,7 +19,7 @@ import com.pengxh.kt.lite.extensions.show import com.pengxh.kt.lite.utils.Constant import com.pengxh.kt.lite.utils.LoadState -import com.pengxh.kt.lite.utils.LoadingDialogHub +import com.pengxh.kt.lite.utils.LoadingDialog import com.pengxh.kt.lite.utils.WeakReferenceHandler import com.pengxh.kt.lite.widget.TitleBarView import com.pengxh.kt.lite.widget.dialog.AlertControlDialog @@ -56,7 +56,7 @@ } override fun initOnCreate(savedInstanceState: Bundle?) { - args = intent.getStringArrayListExtra(Constant.INTENT_PARAM)!! + args = intent.getStringArrayListExtra(Constant.INTENT_PARAM_KEY)!! orderViewModel = ViewModelProvider(this)[OrderViewModel::class.java] operationViewModel = ViewModelProvider(this)[OperationViewModel::class.java] @@ -101,24 +101,24 @@ } } - binding.resultRecyclerView.addItemDecoration( - RecyclerViewItemOffsets(0, 5, 0, 5) + binding.recyclerView.addItemDecoration( + RecyclerViewItemOffsets(0, 7, 0, 7) ) } override fun observeRequestState() { orderViewModel.loadState.observe(this) { when (it) { - is LoadState.Loading -> LoadingDialogHub.show(this, "数据加载中,请稍后") - else -> LoadingDialogHub.dismiss() + is LoadState.Loading -> LoadingDialog.show(this, "数据加载中,请稍后") + else -> LoadingDialog.dismiss() } } //接单状态处理 operationViewModel.loadState.observe(this) { when (it) { - is LoadState.Loading -> LoadingDialogHub.show(this, "接单中,请稍后") + is LoadState.Loading -> LoadingDialog.show(this, "接单中,请稍后") is LoadState.Success -> { - LoadingDialogHub.dismiss() + LoadingDialog.dismiss() //接单成功之后刷新列表 dataBeans.removeAt(clickedPosition) searchResultAdapter.notifyItemRemoved(clickedPosition) @@ -127,7 +127,7 @@ ) } - else -> LoadingDialogHub.dismiss() + else -> LoadingDialog.dismiss() } } } @@ -162,7 +162,7 @@ } else { binding.emptyInclude.emptyView.hide() searchResultAdapter = SearchResultAdapter(this, dataBeans) - binding.resultRecyclerView.adapter = searchResultAdapter + binding.recyclerView.adapter = searchResultAdapter searchResultAdapter.setOnItemClickListener(object : SearchResultAdapter.OnItemClickListener { override fun onClicked(position: Int) { diff --git a/app/src/main/java/com/casic/app/smartwell/view/UnDeployWellActivity.kt b/app/src/main/java/com/casic/app/smartwell/view/UnDeployWellActivity.kt index 7f7cd3c..555c278 100644 --- a/app/src/main/java/com/casic/app/smartwell/view/UnDeployWellActivity.kt +++ b/app/src/main/java/com/casic/app/smartwell/view/UnDeployWellActivity.kt @@ -81,8 +81,8 @@ } } - binding.undeployListView.addItemDecoration( - RecyclerViewItemOffsets(0, 5, 0, 5) + binding.recyclerView.addItemDecoration( + RecyclerViewItemOffsets(0, 7, 0, 7) ) } @@ -147,12 +147,11 @@ } else { item.deep.toString() + "m" } - viewHolder.setText(R.id.wellNameView, item.wellName) + viewHolder.setText(R.id.wellTypeView, item.wellTypeName) .setText(R.id.wellDepthView, "深:${deep}") .setText(R.id.wellCodeView, "点位编号:${item.wellCode}") - .setText(R.id.wellTypeView, "点位类型:${item.wellTypeName}") .setText(R.id.ownerShipView, "权属单位:${item.deptName}") - .setText(R.id.wellLocationView, "点位置:${item.position}") + .setText(R.id.wellLocationView, "点位位置:${item.position}") .setOnClickListener( R.id.operationButton, object : View.OnClickListener { override fun onClick(v: View?) { @@ -185,7 +184,7 @@ ) } } - binding.undeployListView.adapter = unDeployAdapter + binding.recyclerView.adapter = unDeployAdapter unDeployAdapter.setOnItemClickedListener(object : NormalRecyclerAdapter.OnItemClickedListener { override fun onItemClicked(position: Int, t: WellListModel.DataBean.RowsBean) { diff --git a/app/src/main/java/com/casic/app/smartwell/view/WellDetailActivity.kt b/app/src/main/java/com/casic/app/smartwell/view/WellDetailActivity.kt index b50d067..eb8b468 100644 --- a/app/src/main/java/com/casic/app/smartwell/view/WellDetailActivity.kt +++ b/app/src/main/java/com/casic/app/smartwell/view/WellDetailActivity.kt @@ -16,7 +16,7 @@ import com.pengxh.kt.lite.extensions.show import com.pengxh.kt.lite.utils.Constant import com.pengxh.kt.lite.utils.LoadState -import com.pengxh.kt.lite.utils.LoadingDialogHub +import com.pengxh.kt.lite.utils.LoadingDialog import com.pengxh.kt.lite.widget.TitleBarView import com.pengxh.kt.lite.widget.dialog.AlertMessageDialog @@ -44,7 +44,7 @@ } override fun initOnCreate(savedInstanceState: Bundle?) { - val wellId = intent.getStringExtra(Constant.INTENT_PARAM)!! + val wellId = intent.getStringExtra(Constant.INTENT_PARAM_KEY)!! wellViewModel = ViewModelProvider(this)[WellViewModel::class.java] wellViewModel.getWellDetail(wellId) wellViewModel.wellDetailModel.observe(this) { @@ -132,8 +132,8 @@ override fun observeRequestState() { wellViewModel.loadState.observe(this) { when (it) { - is LoadState.Loading -> LoadingDialogHub.show(this, "数据加载中,请稍后") - else -> LoadingDialogHub.dismiss() + is LoadState.Loading -> LoadingDialog.show(this, "数据加载中,请稍后") + else -> LoadingDialog.dismiss() } } } diff --git a/app/src/main/java/com/casic/app/smartwell/view/WellManagementActivity.kt b/app/src/main/java/com/casic/app/smartwell/view/WellManagementActivity.kt index 084da95..457096b 100644 --- a/app/src/main/java/com/casic/app/smartwell/view/WellManagementActivity.kt +++ b/app/src/main/java/com/casic/app/smartwell/view/WellManagementActivity.kt @@ -94,8 +94,8 @@ } } - binding.wellListView.addItemDecoration( - RecyclerViewItemOffsets(0, 5, 0, 5) + binding.recyclerView.addItemDecoration( + RecyclerViewItemOffsets(0, 7, 0, 7) ) } @@ -175,13 +175,12 @@ } else { item.deep.toString() + "m" } - viewHolder.setText(R.id.wellNameView, item.wellName) + viewHolder.setText(R.id.wellTypeView, item.wellTypeName) .setText(R.id.wellStateView, "已${item.bfztName}") .setText(R.id.wellDepthView, "深:${deep}") .setText(R.id.wellCodeView, "点位编号:${item.wellCode}") - .setText(R.id.wellTypeView, "点位类型:${item.wellTypeName}") .setText(R.id.ownerShipView, "权属单位:${item.deptName}") - .setText(R.id.wellLocationView, "点位置:${item.position}") + .setText(R.id.wellLocationView, "点位位置:${item.position}") .setOnClickListener( R.id.navigationButton, object : View.OnClickListener { override fun onClick(v: View?) { @@ -200,7 +199,7 @@ ) } } - binding.wellListView.adapter = wellListAdapter + binding.recyclerView.adapter = wellListAdapter wellListAdapter.setOnItemClickedListener(object : NormalRecyclerAdapter.OnItemClickedListener { override fun onItemClicked(position: Int, t: WellListModel.DataBean.RowsBean) { diff --git a/app/build.gradle b/app/build.gradle index 296fb6f..c18c251 100644 --- a/app/build.gradle +++ b/app/build.gradle @@ -40,10 +40,6 @@ // VIVO 相关应用参数 VIVO_APP_ID : "105749048", VIVO_APP_KEY : "e460fbf2c689e0f8c58ecc6aa62e1803", - - // 小米相关应用参数 -// XIAOMI_APP_ID : "", -// XIAOMI_APP_KEY : "", ] // 版本名后面添加一句话,意思就是flavor dimension 它的维度就是该版本号,多渠道打包很重要 @@ -107,7 +103,7 @@ dependencies { implementation fileTree(dir: 'libs', include: ['*.jar']) //基础依赖库 - implementation 'com.github.AndroidCoderPeng:Kotlin-lite-lib:1.0.10' + implementation 'com.github.AndroidCoderPeng:Kotlin-lite-lib:1.1.0' implementation 'androidx.appcompat:appcompat:1.6.1' implementation 'androidx.core:core-ktx:1.9.0' implementation 'androidx.constraintlayout:constraintlayout:2.1.4' @@ -165,8 +161,6 @@ implementation 'commons-codec:commons-codec:1.15' implementation 'com.android.support:support-annotations:28.0.0' implementation 'com.assist-v3:vivo:3.1.2' // vivo -// implementation 'com.getui.opt:xmp:3.3.1' // 小米 - //数据库框架 implementation 'org.greenrobot:greendao:3.3.0' //数据库升级 diff --git a/app/src/main/AndroidManifest.xml b/app/src/main/AndroidManifest.xml index c0af158..e0519bf 100644 --- a/app/src/main/AndroidManifest.xml +++ b/app/src/main/AndroidManifest.xml @@ -90,10 +90,10 @@ - + + android:value="ee96d8b5e12de3fbb29949efd57418a8" /> () @@ -150,7 +158,7 @@ val cameraPosition = CameraPosition(centerLatLng, 14f, 0f, 0f) val cameraUpdate = CameraUpdateFactory.newCameraPosition(cameraPosition) withContext(Dispatchers.Main) { - LoadingDialogHub.dismiss() + LoadingDialog.dismiss() aMap.animateCamera(cameraUpdate, 1500, null) } } @@ -239,11 +247,6 @@ } override fun initEvent() { - binding.rightOptionView.setOnClickListener { - val x = binding.rightOptionView.width - easyPopupWindow.width - easyPopupWindow.showAsDropDown(binding.rightOptionView, x, 0) - } - //撤防点位 binding.unDeployedLayout.setOnClickListener { requireContext().navigatePageTo() @@ -263,11 +266,11 @@ override fun observeRequestState() { wellViewModel.loadState.observe(this) { when (it) { - is LoadState.Loading -> LoadingDialogHub.show( + is LoadState.Loading -> LoadingDialog.show( requireActivity(), "数据加载中,请稍后..." ) - else -> LoadingDialogHub.dismiss() + else -> LoadingDialog.dismiss() } } } @@ -376,7 +379,7 @@ }).build().show() } }) - infoPopup.showAsDropDown(binding.rightOptionView) +// infoPopup.showAsDropDown(binding.rightOptionView) } override fun onCameraChange(p0: CameraPosition?) { diff --git a/app/src/main/java/com/casic/app/smartwell/fragment/HomePageNoClusterFragment.kt b/app/src/main/java/com/casic/app/smartwell/fragment/HomePageNoClusterFragment.kt index 802426a..b25f743 100644 --- a/app/src/main/java/com/casic/app/smartwell/fragment/HomePageNoClusterFragment.kt +++ b/app/src/main/java/com/casic/app/smartwell/fragment/HomePageNoClusterFragment.kt @@ -38,8 +38,9 @@ import com.pengxh.kt.lite.extensions.navigatePageTo import com.pengxh.kt.lite.extensions.show import com.pengxh.kt.lite.utils.LoadState -import com.pengxh.kt.lite.utils.LoadingDialogHub +import com.pengxh.kt.lite.utils.LoadingDialog import com.pengxh.kt.lite.widget.EasyPopupWindow +import com.pengxh.kt.lite.widget.TitleBarView import com.pengxh.kt.lite.widget.dialog.AlertControlDialog import kotlinx.coroutines.Dispatchers import kotlinx.coroutines.launch @@ -78,7 +79,15 @@ override fun setupTopBarLayout() { binding.rootView.initImmersionBar(this, false, R.color.mainThemeColor) - binding.titleView.text = "首页" + binding.titleView.setOnClickListener(object : TitleBarView.OnClickListener { + override fun onLeftClick() { + + } + + override fun onRightClick() { + easyPopupWindow.showAsDropDown(binding.titleView, binding.titleView.width, 0) + } + }) } override fun initOnCreate(savedInstanceState: Bundle?) { @@ -112,7 +121,7 @@ //渲染井位置 lifecycleScope.launch(Dispatchers.Main) { - LoadingDialogHub.show(requireActivity(), "数据加载中,请稍后") + LoadingDialog.show(requireActivity(), "数据加载中,请稍后") withContext(Dispatchers.IO) { //取Well缓存 val allMarkerOptions = ArrayList() @@ -144,7 +153,7 @@ val cameraPosition = CameraPosition(centerLatLng, 14f, 0f, 0f) val cameraUpdate = CameraUpdateFactory.newCameraPosition(cameraPosition) withContext(Dispatchers.Main) { - LoadingDialogHub.dismiss() + LoadingDialog.dismiss() aMap.animateCamera(cameraUpdate, 1500, null) } } @@ -238,11 +247,6 @@ } override fun initEvent() { - binding.rightOptionView.setOnClickListener { - val x = binding.rightOptionView.width - easyPopupWindow.width - easyPopupWindow.showAsDropDown(binding.rightOptionView, x, 0) - } - //撤防点位 binding.unDeployedLayout.setOnClickListener { requireContext().navigatePageTo() @@ -262,11 +266,11 @@ override fun observeRequestState() { wellViewModel.loadState.observe(this) { when (it) { - is LoadState.Loading -> LoadingDialogHub.show( + is LoadState.Loading -> LoadingDialog.show( requireActivity(), "数据加载中,请稍后..." ) - else -> LoadingDialogHub.dismiss() + else -> LoadingDialog.dismiss() } } } diff --git a/app/src/main/java/com/casic/app/smartwell/fragment/MinePageFragment.kt b/app/src/main/java/com/casic/app/smartwell/fragment/MinePageFragment.kt index 09a570c..dcb48f8 100644 --- a/app/src/main/java/com/casic/app/smartwell/fragment/MinePageFragment.kt +++ b/app/src/main/java/com/casic/app/smartwell/fragment/MinePageFragment.kt @@ -35,7 +35,7 @@ import com.pengxh.kt.lite.utils.ActivityStackManager import com.pengxh.kt.lite.utils.FileDownloadManager import com.pengxh.kt.lite.utils.LoadState -import com.pengxh.kt.lite.utils.LoadingDialogHub +import com.pengxh.kt.lite.utils.LoadingDialog import com.pengxh.kt.lite.widget.dialog.AlertControlDialog import com.pengxh.kt.lite.widget.dialog.BottomActionSheet import kotlinx.coroutines.Dispatchers @@ -60,7 +60,6 @@ override fun setupTopBarLayout() { binding.rootView.initImmersionBar(this, false, R.color.mainThemeColor) - binding.titleInclude.titleView.text = "我的" } override fun initOnCreate(savedInstanceState: Bundle?) { @@ -155,27 +154,27 @@ override fun observeRequestState() { userViewModel.loadState.observe(this) { when (it) { - is LoadState.Loading -> LoadingDialogHub.show( + is LoadState.Loading -> LoadingDialog.show( requireActivity(), "检查版本中,请稍后" ) - else -> LoadingDialogHub.dismiss() + else -> LoadingDialog.dismiss() } } wellViewModel.loadState.observe(this) { when (it) { - is LoadState.Loading -> LoadingDialogHub.show( + is LoadState.Loading -> LoadingDialog.show( requireActivity(), "数据更新中,请稍后" ) is LoadState.Fail -> { - LoadingDialogHub.dismiss() + LoadingDialog.dismiss() "数据更新超时".show(requireContext()) } else -> { - LoadingDialogHub.dismiss() + LoadingDialog.dismiss() AlertControlDialog.Builder().setContext(requireContext()).setTitle("温馨提示") .setMessage("数据更新成功,请重启应用").setNegativeButton("取消") .setPositiveButton("确定").setOnDialogButtonClickListener(object : @@ -197,17 +196,17 @@ lineViewModel.loadState.observe(this) { when (it) { - is LoadState.Loading -> LoadingDialogHub.show( + is LoadState.Loading -> LoadingDialog.show( requireActivity(), "数据更新中,请稍后" ) is LoadState.Fail -> { - LoadingDialogHub.dismiss() + LoadingDialog.dismiss() "数据更新超时".show(requireContext()) } else -> { - LoadingDialogHub.dismiss() + LoadingDialog.dismiss() AlertControlDialog.Builder().setContext(requireContext()).setTitle("温馨提示") .setMessage("数据更新成功,请重启应用").setNegativeButton("取消") .setPositiveButton("确定").setOnDialogButtonClickListener(object : diff --git a/app/src/main/java/com/casic/app/smartwell/fragment/NoticePageFragment.kt b/app/src/main/java/com/casic/app/smartwell/fragment/NoticePageFragment.kt index 171b555..3c93f54 100644 --- a/app/src/main/java/com/casic/app/smartwell/fragment/NoticePageFragment.kt +++ b/app/src/main/java/com/casic/app/smartwell/fragment/NoticePageFragment.kt @@ -48,7 +48,6 @@ override fun setupTopBarLayout() { binding.rootView.initImmersionBar(this, false, R.color.mainThemeColor) - binding.titleInclude.titleView.text = "消息" } override fun initOnCreate(savedInstanceState: Bundle?) { diff --git a/app/src/main/java/com/casic/app/smartwell/fragment/OrderListFragment.kt b/app/src/main/java/com/casic/app/smartwell/fragment/OrderListFragment.kt index 93ff35b..5e38acb 100644 --- a/app/src/main/java/com/casic/app/smartwell/fragment/OrderListFragment.kt +++ b/app/src/main/java/com/casic/app/smartwell/fragment/OrderListFragment.kt @@ -12,6 +12,7 @@ import com.casic.app.smartwell.view.SearchOrderActivity import com.pengxh.kt.lite.base.KotlinBaseFragment import com.pengxh.kt.lite.extensions.navigatePageTo +import com.pengxh.kt.lite.widget.TitleBarView class OrderListFragment : KotlinBaseFragment() { @@ -25,15 +26,22 @@ } override fun initViewBinding( - inflater: LayoutInflater, - container: ViewGroup? + inflater: LayoutInflater, container: ViewGroup? ): FragmentOrderBinding { return FragmentOrderBinding.inflate(inflater, container, false) } override fun setupTopBarLayout() { binding.rootView.initImmersionBar(this, false, R.color.mainThemeColor) - binding.titleView.text = "工单" + binding.titleView.setOnClickListener(object : TitleBarView.OnClickListener { + override fun onLeftClick() { + + } + + override fun onRightClick() { + requireContext().navigatePageTo() + } + }) } override fun initOnCreate(savedInstanceState: Bundle?) { @@ -51,8 +59,6 @@ } override fun initEvent() { - binding.rightOptionView.setOnClickListener { - requireContext().navigatePageTo() - } + } } \ No newline at end of file diff --git a/app/src/main/java/com/casic/app/smartwell/fragment/OrderNotProcessedFragment.kt b/app/src/main/java/com/casic/app/smartwell/fragment/OrderNotProcessedFragment.kt index 0b3d09d..2b6f21d 100644 --- a/app/src/main/java/com/casic/app/smartwell/fragment/OrderNotProcessedFragment.kt +++ b/app/src/main/java/com/casic/app/smartwell/fragment/OrderNotProcessedFragment.kt @@ -18,7 +18,7 @@ import com.pengxh.kt.lite.extensions.navigatePageTo import com.pengxh.kt.lite.extensions.show import com.pengxh.kt.lite.utils.LoadState -import com.pengxh.kt.lite.utils.LoadingDialogHub +import com.pengxh.kt.lite.utils.LoadingDialog import com.pengxh.kt.lite.utils.WeakReferenceHandler import com.pengxh.kt.lite.widget.dialog.AlertControlDialog @@ -78,8 +78,8 @@ operationViewModel = ViewModelProvider(this)[OperationViewModel::class.java] - binding.notProcessedView.addItemDecoration( - RecyclerViewItemOffsets(0, 5, 0, 5) + binding.recyclerView.addItemDecoration( + RecyclerViewItemOffsets(0, 7, 0, 7) ) } @@ -87,9 +87,9 @@ //接单状态处理 operationViewModel.loadState.observe(this) { when (it) { - is LoadState.Loading -> LoadingDialogHub.show(requireActivity(), "接单中,请稍后") + is LoadState.Loading -> LoadingDialog.show(requireActivity(), "接单中,请稍后") is LoadState.Success -> { - LoadingDialogHub.dismiss() + LoadingDialog.dismiss() //接单成功之后刷新列表 dataBeans.removeAt(clickedPosition) notProcessedAdapter.notifyItemRemoved(clickedPosition) @@ -98,7 +98,7 @@ ) } - else -> LoadingDialogHub.dismiss() + else -> LoadingDialog.dismiss() } } } @@ -131,7 +131,7 @@ } else { binding.emptyInclude.emptyView.hide() notProcessedAdapter = OrderNotProcessedAdapter(requireContext(), dataBeans) - binding.notProcessedView.adapter = notProcessedAdapter + binding.recyclerView.adapter = notProcessedAdapter notProcessedAdapter.setOnItemClickListener(object : OrderNotProcessedAdapter.OnItemClickListener { override fun onClicked(position: Int) { diff --git a/app/src/main/java/com/casic/app/smartwell/fragment/OvertimeNotAcceptFragment.kt b/app/src/main/java/com/casic/app/smartwell/fragment/OvertimeNotAcceptFragment.kt index a198545..9b318ca 100644 --- a/app/src/main/java/com/casic/app/smartwell/fragment/OvertimeNotAcceptFragment.kt +++ b/app/src/main/java/com/casic/app/smartwell/fragment/OvertimeNotAcceptFragment.kt @@ -18,7 +18,7 @@ import com.pengxh.kt.lite.extensions.navigatePageTo import com.pengxh.kt.lite.extensions.show import com.pengxh.kt.lite.utils.LoadState -import com.pengxh.kt.lite.utils.LoadingDialogHub +import com.pengxh.kt.lite.utils.LoadingDialog import com.pengxh.kt.lite.utils.WeakReferenceHandler import com.pengxh.kt.lite.widget.dialog.AlertControlDialog @@ -81,8 +81,8 @@ operationViewModel = ViewModelProvider(this)[OperationViewModel::class.java] - binding.notProcessedView.addItemDecoration( - RecyclerViewItemOffsets(0, 5, 0, 5) + binding.recyclerView.addItemDecoration( + RecyclerViewItemOffsets(0, 7, 0, 7) ) } @@ -90,9 +90,9 @@ //接单状态处理 operationViewModel.loadState.observe(this) { when (it) { - is LoadState.Loading -> LoadingDialogHub.show(requireActivity(), "接单中,请稍后") + is LoadState.Loading -> LoadingDialog.show(requireActivity(), "接单中,请稍后") is LoadState.Success -> { - LoadingDialogHub.dismiss() + LoadingDialog.dismiss() //接单成功之后刷新列表 dataBeans.removeAt(clickedPosition) notProcessedAdapter.notifyItemRemoved(clickedPosition) @@ -101,7 +101,7 @@ ) } - else -> LoadingDialogHub.dismiss() + else -> LoadingDialog.dismiss() } } } @@ -134,7 +134,7 @@ } else { binding.emptyInclude.emptyView.hide() notProcessedAdapter = OrderNotProcessedAdapter(requireContext(), dataBeans) - binding.notProcessedView.adapter = notProcessedAdapter + binding.recyclerView.adapter = notProcessedAdapter notProcessedAdapter.setOnItemClickListener(object : OrderNotProcessedAdapter.OnItemClickListener { override fun onClicked(position: Int) { diff --git a/app/src/main/java/com/casic/app/smartwell/greendao/DaoMaster.java b/app/src/main/java/com/casic/app/smartwell/greendao/DaoMaster.java index fdcf3a7..1e52b74 100644 --- a/app/src/main/java/com/casic/app/smartwell/greendao/DaoMaster.java +++ b/app/src/main/java/com/casic/app/smartwell/greendao/DaoMaster.java @@ -13,25 +13,20 @@ // THIS CODE IS GENERATED BY greenDAO, DO NOT EDIT. - /** * Master of DAO (schema version 4): knows all DAOs. */ public class DaoMaster extends AbstractDaoMaster { public static final int SCHEMA_VERSION = 4; - /** - * Creates underlying database table using DAOs. - */ + /** Creates underlying database table using DAOs. */ public static void createAllTables(Database db, boolean ifNotExists) { MapWellLocalBeanDao.createTable(db, ifNotExists); NoticeLocaleBeanDao.createTable(db, ifNotExists); PipeLocalBeanDao.createTable(db, ifNotExists); } - /** - * Drops underlying database table using DAOs. - */ + /** Drops underlying database table using DAOs. */ public static void dropAllTables(Database db, boolean ifExists) { MapWellLocalBeanDao.dropTable(db, ifExists); NoticeLocaleBeanDao.dropTable(db, ifExists); @@ -86,9 +81,7 @@ } } - /** - * WARNING: Drops all table on Upgrade! Use only during development. - */ + /** WARNING: Drops all table on Upgrade! Use only during development. */ public static class DevOpenHelper extends OpenHelper { public DevOpenHelper(Context context, String name) { super(context, name); diff --git a/app/src/main/java/com/casic/app/smartwell/greendao/DaoSession.java b/app/src/main/java/com/casic/app/smartwell/greendao/DaoSession.java index 0b36d17..3e40e3b 100644 --- a/app/src/main/java/com/casic/app/smartwell/greendao/DaoSession.java +++ b/app/src/main/java/com/casic/app/smartwell/greendao/DaoSession.java @@ -16,7 +16,7 @@ /** * {@inheritDoc} - * + * * @see org.greenrobot.greendao.AbstractDaoSession */ public class DaoSession extends AbstractDaoSession { @@ -50,7 +50,7 @@ registerDao(NoticeLocaleBean.class, noticeLocaleBeanDao); registerDao(PipeLocalBean.class, pipeLocalBeanDao); } - + public void clear() { mapWellLocalBeanDaoConfig.clearIdentityScope(); noticeLocaleBeanDaoConfig.clearIdentityScope(); diff --git a/app/src/main/java/com/casic/app/smartwell/greendao/MapWellLocalBeanDao.java b/app/src/main/java/com/casic/app/smartwell/greendao/MapWellLocalBeanDao.java index 8908fda..407bc92 100644 --- a/app/src/main/java/com/casic/app/smartwell/greendao/MapWellLocalBeanDao.java +++ b/app/src/main/java/com/casic/app/smartwell/greendao/MapWellLocalBeanDao.java @@ -12,10 +12,9 @@ import org.greenrobot.greendao.internal.DaoConfig; // THIS CODE IS GENERATED BY greenDAO, DO NOT EDIT. - -/** +/** * DAO for table "MAP_WELL_LOCAL_BEAN". - */ +*/ public class MapWellLocalBeanDao extends AbstractDao { public static final String TABLENAME = "MAP_WELL_LOCAL_BEAN"; @@ -57,16 +56,14 @@ public MapWellLocalBeanDao(DaoConfig config) { super(config); } - + public MapWellLocalBeanDao(DaoConfig config, DaoSession daoSession) { super(config, daoSession); } - /** - * Creates the underlying database table. - */ + /** Creates the underlying database table. */ public static void createTable(Database db, boolean ifNotExists) { - String constraint = ifNotExists ? "IF NOT EXISTS " : ""; + String constraint = ifNotExists? "IF NOT EXISTS ": ""; db.execSQL("CREATE TABLE " + constraint + "\"MAP_WELL_LOCAL_BEAN\" (" + // "\"_id\" INTEGER PRIMARY KEY AUTOINCREMENT ," + // 0: kId "\"AREA\" TEXT," + // 1: area @@ -96,9 +93,7 @@ "\"WELL_TYPE_NAME\" TEXT);"); // 25: wellTypeName } - /** - * Drops the underlying database table. - */ + /** Drops the underlying database table. */ public static void dropTable(Database db, boolean ifExists) { String sql = "DROP TABLE " + (ifExists ? "IF EXISTS " : "") + "\"MAP_WELL_LOCAL_BEAN\""; db.execSQL(sql); @@ -107,132 +102,132 @@ @Override protected final void bindValues(DatabaseStatement stmt, MapWellLocalBean entity) { stmt.clearBindings(); - + Long kId = entity.getKId(); if (kId != null) { stmt.bindLong(1, kId); } - + String area = entity.getArea(); if (area != null) { stmt.bindString(2, area); } - + String bfzt = entity.getBfzt(); if (bfzt != null) { stmt.bindString(3, bfzt); } - + String bfztName = entity.getBfztName(); if (bfztName != null) { stmt.bindString(4, bfztName); } - + String coordinateX = entity.getCoordinateX(); if (coordinateX != null) { stmt.bindString(5, coordinateX); } - + String coordinateY = entity.getCoordinateY(); if (coordinateY != null) { stmt.bindString(6, coordinateY); } - + String deep = entity.getDeep(); if (deep != null) { stmt.bindString(7, deep); } - + String deptName = entity.getDeptName(); if (deptName != null) { stmt.bindString(8, deptName); } - + String deptid = entity.getDeptid(); if (deptid != null) { stmt.bindString(9, deptid); } - + String id = entity.getId(); if (id != null) { stmt.bindString(10, id); } - + String latBaidu = entity.getLatBaidu(); if (latBaidu != null) { stmt.bindString(11, latBaidu); } - + String latGaode = entity.getLatGaode(); if (latGaode != null) { stmt.bindString(12, latGaode); } - + String lngBaidu = entity.getLngBaidu(); if (lngBaidu != null) { stmt.bindString(13, lngBaidu); } - + String lngGaode = entity.getLngGaode(); if (lngGaode != null) { stmt.bindString(14, lngGaode); } - + String notes = entity.getNotes(); if (notes != null) { stmt.bindString(15, notes); } - + String photos = entity.getPhotos(); if (photos != null) { stmt.bindString(16, photos); } - + String position = entity.getPosition(); if (position != null) { stmt.bindString(17, position); } - + String staff = entity.getStaff(); if (staff != null) { stmt.bindString(18, staff); } - + String tel = entity.getTel(); if (tel != null) { stmt.bindString(19, tel); } - + String ts = entity.getTs(); if (ts != null) { stmt.bindString(20, ts); } - + String valid = entity.getValid(); if (valid != null) { stmt.bindString(21, valid); } - + String watchData = entity.getWatchData(); if (watchData != null) { stmt.bindString(22, watchData); } - + String wellCode = entity.getWellCode(); if (wellCode != null) { stmt.bindString(23, wellCode); } - + String wellName = entity.getWellName(); if (wellName != null) { stmt.bindString(24, wellName); } - + String wellType = entity.getWellType(); if (wellType != null) { stmt.bindString(25, wellType); } - + String wellTypeName = entity.getWellTypeName(); if (wellTypeName != null) { stmt.bindString(26, wellTypeName); @@ -242,132 +237,132 @@ @Override protected final void bindValues(SQLiteStatement stmt, MapWellLocalBean entity) { stmt.clearBindings(); - + Long kId = entity.getKId(); if (kId != null) { stmt.bindLong(1, kId); } - + String area = entity.getArea(); if (area != null) { stmt.bindString(2, area); } - + String bfzt = entity.getBfzt(); if (bfzt != null) { stmt.bindString(3, bfzt); } - + String bfztName = entity.getBfztName(); if (bfztName != null) { stmt.bindString(4, bfztName); } - + String coordinateX = entity.getCoordinateX(); if (coordinateX != null) { stmt.bindString(5, coordinateX); } - + String coordinateY = entity.getCoordinateY(); if (coordinateY != null) { stmt.bindString(6, coordinateY); } - + String deep = entity.getDeep(); if (deep != null) { stmt.bindString(7, deep); } - + String deptName = entity.getDeptName(); if (deptName != null) { stmt.bindString(8, deptName); } - + String deptid = entity.getDeptid(); if (deptid != null) { stmt.bindString(9, deptid); } - + String id = entity.getId(); if (id != null) { stmt.bindString(10, id); } - + String latBaidu = entity.getLatBaidu(); if (latBaidu != null) { stmt.bindString(11, latBaidu); } - + String latGaode = entity.getLatGaode(); if (latGaode != null) { stmt.bindString(12, latGaode); } - + String lngBaidu = entity.getLngBaidu(); if (lngBaidu != null) { stmt.bindString(13, lngBaidu); } - + String lngGaode = entity.getLngGaode(); if (lngGaode != null) { stmt.bindString(14, lngGaode); } - + String notes = entity.getNotes(); if (notes != null) { stmt.bindString(15, notes); } - + String photos = entity.getPhotos(); if (photos != null) { stmt.bindString(16, photos); } - + String position = entity.getPosition(); if (position != null) { stmt.bindString(17, position); } - + String staff = entity.getStaff(); if (staff != null) { stmt.bindString(18, staff); } - + String tel = entity.getTel(); if (tel != null) { stmt.bindString(19, tel); } - + String ts = entity.getTs(); if (ts != null) { stmt.bindString(20, ts); } - + String valid = entity.getValid(); if (valid != null) { stmt.bindString(21, valid); } - + String watchData = entity.getWatchData(); if (watchData != null) { stmt.bindString(22, watchData); } - + String wellCode = entity.getWellCode(); if (wellCode != null) { stmt.bindString(23, wellCode); } - + String wellName = entity.getWellName(); if (wellName != null) { stmt.bindString(24, wellName); } - + String wellType = entity.getWellType(); if (wellType != null) { stmt.bindString(25, wellType); } - + String wellTypeName = entity.getWellTypeName(); if (wellTypeName != null) { stmt.bindString(26, wellTypeName); @@ -377,41 +372,41 @@ @Override public Long readKey(Cursor cursor, int offset) { return cursor.isNull(offset + 0) ? null : cursor.getLong(offset + 0); - } + } @Override public MapWellLocalBean readEntity(Cursor cursor, int offset) { MapWellLocalBean entity = new MapWellLocalBean( // - cursor.isNull(offset + 0) ? null : cursor.getLong(offset + 0), // kId - cursor.isNull(offset + 1) ? null : cursor.getString(offset + 1), // area - cursor.isNull(offset + 2) ? null : cursor.getString(offset + 2), // bfzt - cursor.isNull(offset + 3) ? null : cursor.getString(offset + 3), // bfztName - cursor.isNull(offset + 4) ? null : cursor.getString(offset + 4), // coordinateX - cursor.isNull(offset + 5) ? null : cursor.getString(offset + 5), // coordinateY - cursor.isNull(offset + 6) ? null : cursor.getString(offset + 6), // deep - cursor.isNull(offset + 7) ? null : cursor.getString(offset + 7), // deptName - cursor.isNull(offset + 8) ? null : cursor.getString(offset + 8), // deptid - cursor.isNull(offset + 9) ? null : cursor.getString(offset + 9), // id - cursor.isNull(offset + 10) ? null : cursor.getString(offset + 10), // latBaidu - cursor.isNull(offset + 11) ? null : cursor.getString(offset + 11), // latGaode - cursor.isNull(offset + 12) ? null : cursor.getString(offset + 12), // lngBaidu - cursor.isNull(offset + 13) ? null : cursor.getString(offset + 13), // lngGaode - cursor.isNull(offset + 14) ? null : cursor.getString(offset + 14), // notes - cursor.isNull(offset + 15) ? null : cursor.getString(offset + 15), // photos - cursor.isNull(offset + 16) ? null : cursor.getString(offset + 16), // position - cursor.isNull(offset + 17) ? null : cursor.getString(offset + 17), // staff - cursor.isNull(offset + 18) ? null : cursor.getString(offset + 18), // tel - cursor.isNull(offset + 19) ? null : cursor.getString(offset + 19), // ts - cursor.isNull(offset + 20) ? null : cursor.getString(offset + 20), // valid - cursor.isNull(offset + 21) ? null : cursor.getString(offset + 21), // watchData - cursor.isNull(offset + 22) ? null : cursor.getString(offset + 22), // wellCode - cursor.isNull(offset + 23) ? null : cursor.getString(offset + 23), // wellName - cursor.isNull(offset + 24) ? null : cursor.getString(offset + 24), // wellType - cursor.isNull(offset + 25) ? null : cursor.getString(offset + 25) // wellTypeName + cursor.isNull(offset + 0) ? null : cursor.getLong(offset + 0), // kId + cursor.isNull(offset + 1) ? null : cursor.getString(offset + 1), // area + cursor.isNull(offset + 2) ? null : cursor.getString(offset + 2), // bfzt + cursor.isNull(offset + 3) ? null : cursor.getString(offset + 3), // bfztName + cursor.isNull(offset + 4) ? null : cursor.getString(offset + 4), // coordinateX + cursor.isNull(offset + 5) ? null : cursor.getString(offset + 5), // coordinateY + cursor.isNull(offset + 6) ? null : cursor.getString(offset + 6), // deep + cursor.isNull(offset + 7) ? null : cursor.getString(offset + 7), // deptName + cursor.isNull(offset + 8) ? null : cursor.getString(offset + 8), // deptid + cursor.isNull(offset + 9) ? null : cursor.getString(offset + 9), // id + cursor.isNull(offset + 10) ? null : cursor.getString(offset + 10), // latBaidu + cursor.isNull(offset + 11) ? null : cursor.getString(offset + 11), // latGaode + cursor.isNull(offset + 12) ? null : cursor.getString(offset + 12), // lngBaidu + cursor.isNull(offset + 13) ? null : cursor.getString(offset + 13), // lngGaode + cursor.isNull(offset + 14) ? null : cursor.getString(offset + 14), // notes + cursor.isNull(offset + 15) ? null : cursor.getString(offset + 15), // photos + cursor.isNull(offset + 16) ? null : cursor.getString(offset + 16), // position + cursor.isNull(offset + 17) ? null : cursor.getString(offset + 17), // staff + cursor.isNull(offset + 18) ? null : cursor.getString(offset + 18), // tel + cursor.isNull(offset + 19) ? null : cursor.getString(offset + 19), // ts + cursor.isNull(offset + 20) ? null : cursor.getString(offset + 20), // valid + cursor.isNull(offset + 21) ? null : cursor.getString(offset + 21), // watchData + cursor.isNull(offset + 22) ? null : cursor.getString(offset + 22), // wellCode + cursor.isNull(offset + 23) ? null : cursor.getString(offset + 23), // wellName + cursor.isNull(offset + 24) ? null : cursor.getString(offset + 24), // wellType + cursor.isNull(offset + 25) ? null : cursor.getString(offset + 25) // wellTypeName ); return entity; } - + @Override public void readEntity(Cursor cursor, MapWellLocalBean entity, int offset) { entity.setKId(cursor.isNull(offset + 0) ? null : cursor.getLong(offset + 0)); @@ -440,17 +435,17 @@ entity.setWellName(cursor.isNull(offset + 23) ? null : cursor.getString(offset + 23)); entity.setWellType(cursor.isNull(offset + 24) ? null : cursor.getString(offset + 24)); entity.setWellTypeName(cursor.isNull(offset + 25) ? null : cursor.getString(offset + 25)); - } - + } + @Override protected final Long updateKeyAfterInsert(MapWellLocalBean entity, long rowId) { entity.setKId(rowId); return rowId; } - + @Override public Long getKey(MapWellLocalBean entity) { - if (entity != null) { + if(entity != null) { return entity.getKId(); } else { return null; @@ -466,5 +461,5 @@ protected final boolean isEntityUpdateable() { return true; } - + } diff --git a/app/src/main/java/com/casic/app/smartwell/greendao/NoticeLocaleBeanDao.java b/app/src/main/java/com/casic/app/smartwell/greendao/NoticeLocaleBeanDao.java index 64312ed..deb2d49 100644 --- a/app/src/main/java/com/casic/app/smartwell/greendao/NoticeLocaleBeanDao.java +++ b/app/src/main/java/com/casic/app/smartwell/greendao/NoticeLocaleBeanDao.java @@ -12,10 +12,9 @@ import org.greenrobot.greendao.internal.DaoConfig; // THIS CODE IS GENERATED BY greenDAO, DO NOT EDIT. - -/** +/** * DAO for table "NOTICE_LOCALE_BEAN". - */ +*/ public class NoticeLocaleBeanDao extends AbstractDao { public static final String TABLENAME = "NOTICE_LOCALE_BEAN"; @@ -43,16 +42,14 @@ public NoticeLocaleBeanDao(DaoConfig config) { super(config); } - + public NoticeLocaleBeanDao(DaoConfig config, DaoSession daoSession) { super(config, daoSession); } - /** - * Creates the underlying database table. - */ + /** Creates the underlying database table. */ public static void createTable(Database db, boolean ifNotExists) { - String constraint = ifNotExists ? "IF NOT EXISTS " : ""; + String constraint = ifNotExists? "IF NOT EXISTS ": ""; db.execSQL("CREATE TABLE " + constraint + "\"NOTICE_LOCALE_BEAN\" (" + // "\"_id\" INTEGER PRIMARY KEY AUTOINCREMENT ," + // 0: id "\"MESSAGE_ID\" TEXT UNIQUE ," + // 1: messageId @@ -68,9 +65,7 @@ "\"NOTICE_TIME\" TEXT);"); // 11: noticeTime } - /** - * Drops the underlying database table. - */ + /** Drops the underlying database table. */ public static void dropTable(Database db, boolean ifExists) { String sql = "DROP TABLE " + (ifExists ? "IF EXISTS " : "") + "\"NOTICE_LOCALE_BEAN\""; db.execSQL(sql); @@ -79,62 +74,62 @@ @Override protected final void bindValues(DatabaseStatement stmt, NoticeLocaleBean entity) { stmt.clearBindings(); - + Long id = entity.getId(); if (id != null) { stmt.bindLong(1, id); } - + String messageId = entity.getMessageId(); if (messageId != null) { stmt.bindString(2, messageId); } - + String appid = entity.getAppid(); if (appid != null) { stmt.bindString(3, appid); } - + String clientId = entity.getClientId(); if (clientId != null) { stmt.bindString(4, clientId); } - + String taskId = entity.getTaskId(); if (taskId != null) { stmt.bindString(5, taskId); } - + String userId = entity.getUserId(); if (userId != null) { stmt.bindString(6, userId); } - + String title = entity.getTitle(); if (title != null) { stmt.bindString(7, title); } - + String content = entity.getContent(); if (content != null) { stmt.bindString(8, content); } - + String deviceCode = entity.getDeviceCode(); if (deviceCode != null) { stmt.bindString(9, deviceCode); } - + String jobId = entity.getJobId(); if (jobId != null) { stmt.bindString(10, jobId); } - + String isRead = entity.getIsRead(); if (isRead != null) { stmt.bindString(11, isRead); } - + String noticeTime = entity.getNoticeTime(); if (noticeTime != null) { stmt.bindString(12, noticeTime); @@ -144,62 +139,62 @@ @Override protected final void bindValues(SQLiteStatement stmt, NoticeLocaleBean entity) { stmt.clearBindings(); - + Long id = entity.getId(); if (id != null) { stmt.bindLong(1, id); } - + String messageId = entity.getMessageId(); if (messageId != null) { stmt.bindString(2, messageId); } - + String appid = entity.getAppid(); if (appid != null) { stmt.bindString(3, appid); } - + String clientId = entity.getClientId(); if (clientId != null) { stmt.bindString(4, clientId); } - + String taskId = entity.getTaskId(); if (taskId != null) { stmt.bindString(5, taskId); } - + String userId = entity.getUserId(); if (userId != null) { stmt.bindString(6, userId); } - + String title = entity.getTitle(); if (title != null) { stmt.bindString(7, title); } - + String content = entity.getContent(); if (content != null) { stmt.bindString(8, content); } - + String deviceCode = entity.getDeviceCode(); if (deviceCode != null) { stmt.bindString(9, deviceCode); } - + String jobId = entity.getJobId(); if (jobId != null) { stmt.bindString(10, jobId); } - + String isRead = entity.getIsRead(); if (isRead != null) { stmt.bindString(11, isRead); } - + String noticeTime = entity.getNoticeTime(); if (noticeTime != null) { stmt.bindString(12, noticeTime); @@ -209,27 +204,27 @@ @Override public Long readKey(Cursor cursor, int offset) { return cursor.isNull(offset + 0) ? null : cursor.getLong(offset + 0); - } + } @Override public NoticeLocaleBean readEntity(Cursor cursor, int offset) { NoticeLocaleBean entity = new NoticeLocaleBean( // - cursor.isNull(offset + 0) ? null : cursor.getLong(offset + 0), // id - cursor.isNull(offset + 1) ? null : cursor.getString(offset + 1), // messageId - cursor.isNull(offset + 2) ? null : cursor.getString(offset + 2), // appid - cursor.isNull(offset + 3) ? null : cursor.getString(offset + 3), // clientId - cursor.isNull(offset + 4) ? null : cursor.getString(offset + 4), // taskId - cursor.isNull(offset + 5) ? null : cursor.getString(offset + 5), // userId - cursor.isNull(offset + 6) ? null : cursor.getString(offset + 6), // title - cursor.isNull(offset + 7) ? null : cursor.getString(offset + 7), // content - cursor.isNull(offset + 8) ? null : cursor.getString(offset + 8), // deviceCode - cursor.isNull(offset + 9) ? null : cursor.getString(offset + 9), // jobId - cursor.isNull(offset + 10) ? null : cursor.getString(offset + 10), // isRead - cursor.isNull(offset + 11) ? null : cursor.getString(offset + 11) // noticeTime + cursor.isNull(offset + 0) ? null : cursor.getLong(offset + 0), // id + cursor.isNull(offset + 1) ? null : cursor.getString(offset + 1), // messageId + cursor.isNull(offset + 2) ? null : cursor.getString(offset + 2), // appid + cursor.isNull(offset + 3) ? null : cursor.getString(offset + 3), // clientId + cursor.isNull(offset + 4) ? null : cursor.getString(offset + 4), // taskId + cursor.isNull(offset + 5) ? null : cursor.getString(offset + 5), // userId + cursor.isNull(offset + 6) ? null : cursor.getString(offset + 6), // title + cursor.isNull(offset + 7) ? null : cursor.getString(offset + 7), // content + cursor.isNull(offset + 8) ? null : cursor.getString(offset + 8), // deviceCode + cursor.isNull(offset + 9) ? null : cursor.getString(offset + 9), // jobId + cursor.isNull(offset + 10) ? null : cursor.getString(offset + 10), // isRead + cursor.isNull(offset + 11) ? null : cursor.getString(offset + 11) // noticeTime ); return entity; } - + @Override public void readEntity(Cursor cursor, NoticeLocaleBean entity, int offset) { entity.setId(cursor.isNull(offset + 0) ? null : cursor.getLong(offset + 0)); @@ -244,17 +239,17 @@ entity.setJobId(cursor.isNull(offset + 9) ? null : cursor.getString(offset + 9)); entity.setIsRead(cursor.isNull(offset + 10) ? null : cursor.getString(offset + 10)); entity.setNoticeTime(cursor.isNull(offset + 11) ? null : cursor.getString(offset + 11)); - } - + } + @Override protected final Long updateKeyAfterInsert(NoticeLocaleBean entity, long rowId) { entity.setId(rowId); return rowId; } - + @Override public Long getKey(NoticeLocaleBean entity) { - if (entity != null) { + if(entity != null) { return entity.getId(); } else { return null; @@ -270,5 +265,5 @@ protected final boolean isEntityUpdateable() { return true; } - + } diff --git a/app/src/main/java/com/casic/app/smartwell/greendao/PipeLocalBeanDao.java b/app/src/main/java/com/casic/app/smartwell/greendao/PipeLocalBeanDao.java index aab4d3f..df5515a 100644 --- a/app/src/main/java/com/casic/app/smartwell/greendao/PipeLocalBeanDao.java +++ b/app/src/main/java/com/casic/app/smartwell/greendao/PipeLocalBeanDao.java @@ -12,10 +12,9 @@ import org.greenrobot.greendao.internal.DaoConfig; // THIS CODE IS GENERATED BY greenDAO, DO NOT EDIT. - -/** +/** * DAO for table "PIPE_LOCAL_BEAN". - */ +*/ public class PipeLocalBeanDao extends AbstractDao { public static final String TABLENAME = "PIPE_LOCAL_BEAN"; @@ -37,16 +36,14 @@ public PipeLocalBeanDao(DaoConfig config) { super(config); } - + public PipeLocalBeanDao(DaoConfig config, DaoSession daoSession) { super(config, daoSession); } - /** - * Creates the underlying database table. - */ + /** Creates the underlying database table. */ public static void createTable(Database db, boolean ifNotExists) { - String constraint = ifNotExists ? "IF NOT EXISTS " : ""; + String constraint = ifNotExists? "IF NOT EXISTS ": ""; db.execSQL("CREATE TABLE " + constraint + "\"PIPE_LOCAL_BEAN\" (" + // "\"_id\" INTEGER PRIMARY KEY AUTOINCREMENT ," + // 0: id "\"PIPE_CODE\" TEXT," + // 1: pipeCode @@ -56,9 +53,7 @@ "\"START_LONGITUDE_GD\" TEXT);"); // 5: startLongitudeGd } - /** - * Drops the underlying database table. - */ + /** Drops the underlying database table. */ public static void dropTable(Database db, boolean ifExists) { String sql = "DROP TABLE " + (ifExists ? "IF EXISTS " : "") + "\"PIPE_LOCAL_BEAN\""; db.execSQL(sql); @@ -67,32 +62,32 @@ @Override protected final void bindValues(DatabaseStatement stmt, PipeLocalBean entity) { stmt.clearBindings(); - + Long id = entity.getId(); if (id != null) { stmt.bindLong(1, id); } - + String pipeCode = entity.getPipeCode(); if (pipeCode != null) { stmt.bindString(2, pipeCode); } - + String endLatitudeGd = entity.getEndLatitudeGd(); if (endLatitudeGd != null) { stmt.bindString(3, endLatitudeGd); } - + String endLongitudeGd = entity.getEndLongitudeGd(); if (endLongitudeGd != null) { stmt.bindString(4, endLongitudeGd); } - + String startLatitudeGd = entity.getStartLatitudeGd(); if (startLatitudeGd != null) { stmt.bindString(5, startLatitudeGd); } - + String startLongitudeGd = entity.getStartLongitudeGd(); if (startLongitudeGd != null) { stmt.bindString(6, startLongitudeGd); @@ -102,32 +97,32 @@ @Override protected final void bindValues(SQLiteStatement stmt, PipeLocalBean entity) { stmt.clearBindings(); - + Long id = entity.getId(); if (id != null) { stmt.bindLong(1, id); } - + String pipeCode = entity.getPipeCode(); if (pipeCode != null) { stmt.bindString(2, pipeCode); } - + String endLatitudeGd = entity.getEndLatitudeGd(); if (endLatitudeGd != null) { stmt.bindString(3, endLatitudeGd); } - + String endLongitudeGd = entity.getEndLongitudeGd(); if (endLongitudeGd != null) { stmt.bindString(4, endLongitudeGd); } - + String startLatitudeGd = entity.getStartLatitudeGd(); if (startLatitudeGd != null) { stmt.bindString(5, startLatitudeGd); } - + String startLongitudeGd = entity.getStartLongitudeGd(); if (startLongitudeGd != null) { stmt.bindString(6, startLongitudeGd); @@ -137,21 +132,21 @@ @Override public Long readKey(Cursor cursor, int offset) { return cursor.isNull(offset + 0) ? null : cursor.getLong(offset + 0); - } + } @Override public PipeLocalBean readEntity(Cursor cursor, int offset) { PipeLocalBean entity = new PipeLocalBean( // - cursor.isNull(offset + 0) ? null : cursor.getLong(offset + 0), // id - cursor.isNull(offset + 1) ? null : cursor.getString(offset + 1), // pipeCode - cursor.isNull(offset + 2) ? null : cursor.getString(offset + 2), // endLatitudeGd - cursor.isNull(offset + 3) ? null : cursor.getString(offset + 3), // endLongitudeGd - cursor.isNull(offset + 4) ? null : cursor.getString(offset + 4), // startLatitudeGd - cursor.isNull(offset + 5) ? null : cursor.getString(offset + 5) // startLongitudeGd + cursor.isNull(offset + 0) ? null : cursor.getLong(offset + 0), // id + cursor.isNull(offset + 1) ? null : cursor.getString(offset + 1), // pipeCode + cursor.isNull(offset + 2) ? null : cursor.getString(offset + 2), // endLatitudeGd + cursor.isNull(offset + 3) ? null : cursor.getString(offset + 3), // endLongitudeGd + cursor.isNull(offset + 4) ? null : cursor.getString(offset + 4), // startLatitudeGd + cursor.isNull(offset + 5) ? null : cursor.getString(offset + 5) // startLongitudeGd ); return entity; } - + @Override public void readEntity(Cursor cursor, PipeLocalBean entity, int offset) { entity.setId(cursor.isNull(offset + 0) ? null : cursor.getLong(offset + 0)); @@ -160,17 +155,17 @@ entity.setEndLongitudeGd(cursor.isNull(offset + 3) ? null : cursor.getString(offset + 3)); entity.setStartLatitudeGd(cursor.isNull(offset + 4) ? null : cursor.getString(offset + 4)); entity.setStartLongitudeGd(cursor.isNull(offset + 5) ? null : cursor.getString(offset + 5)); - } - + } + @Override protected final Long updateKeyAfterInsert(PipeLocalBean entity, long rowId) { entity.setId(rowId); return rowId; } - + @Override public Long getKey(PipeLocalBean entity) { - if (entity != null) { + if(entity != null) { return entity.getId(); } else { return null; @@ -186,5 +181,5 @@ protected final boolean isEntityUpdateable() { return true; } - + } diff --git a/app/src/main/java/com/casic/app/smartwell/view/ChangePasswordActivity.kt b/app/src/main/java/com/casic/app/smartwell/view/ChangePasswordActivity.kt index 8e41039..9f1dd40 100644 --- a/app/src/main/java/com/casic/app/smartwell/view/ChangePasswordActivity.kt +++ b/app/src/main/java/com/casic/app/smartwell/view/ChangePasswordActivity.kt @@ -14,7 +14,7 @@ import com.pengxh.kt.lite.extensions.show import com.pengxh.kt.lite.utils.ActivityStackManager import com.pengxh.kt.lite.utils.LoadState -import com.pengxh.kt.lite.utils.LoadingDialogHub +import com.pengxh.kt.lite.utils.LoadingDialog import com.pengxh.kt.lite.widget.TitleBarView import java.nio.charset.StandardCharsets @@ -46,15 +46,15 @@ override fun observeRequestState() { userViewModel.loadState.observe(this) { when (it) { - is LoadState.Loading -> LoadingDialogHub.show(this, "修改中,请稍后") + is LoadState.Loading -> LoadingDialog.show(this, "修改中,请稍后") is LoadState.Success -> { - LoadingDialogHub.dismiss() + LoadingDialog.dismiss() AuthenticationHelper.removeToken() this.navigatePageTo() ActivityStackManager.finishAllActivity() } - else -> LoadingDialogHub.dismiss() + else -> LoadingDialog.dismiss() } } } diff --git a/app/src/main/java/com/casic/app/smartwell/view/DeployedWellActivity.kt b/app/src/main/java/com/casic/app/smartwell/view/DeployedWellActivity.kt index fb4339c..28a5078 100644 --- a/app/src/main/java/com/casic/app/smartwell/view/DeployedWellActivity.kt +++ b/app/src/main/java/com/casic/app/smartwell/view/DeployedWellActivity.kt @@ -83,8 +83,8 @@ } //添加分割线 - binding.deployedListView.addItemDecoration( - RecyclerViewItemOffsets(0, 5, 0, 5) + binding.recyclerView.addItemDecoration( + RecyclerViewItemOffsets(0, 7, 0, 7) ) } @@ -149,12 +149,11 @@ } else { item.deep.toString() + "m" } - viewHolder.setText(R.id.wellNameView, item.wellName) + viewHolder.setText(R.id.wellTypeView, item.wellTypeName) .setText(R.id.wellDepthView, "深:${deep}") .setText(R.id.wellCodeView, "点位编号:${item.wellCode}") - .setText(R.id.wellTypeView, "点位类型:${item.wellTypeName}") .setText(R.id.ownerShipView, "权属单位:${item.deptName}") - .setText(R.id.wellLocationView, "点位置:${item.position}") + .setText(R.id.wellLocationView, "点位位置:${item.position}") .setOnClickListener( R.id.operationButton, object : View.OnClickListener { override fun onClick(v: View?) { @@ -207,7 +206,7 @@ }) } } - binding.deployedListView.adapter = deployAdapter + binding.recyclerView.adapter = deployAdapter deployAdapter.setOnItemClickedListener(object : NormalRecyclerAdapter.OnItemClickedListener { override fun onItemClicked(position: Int, t: WellListModel.DataBean.RowsBean) { diff --git a/app/src/main/java/com/casic/app/smartwell/view/LoginActivity.kt b/app/src/main/java/com/casic/app/smartwell/view/LoginActivity.kt index e4bb0e3..834527b 100644 --- a/app/src/main/java/com/casic/app/smartwell/view/LoginActivity.kt +++ b/app/src/main/java/com/casic/app/smartwell/view/LoginActivity.kt @@ -21,7 +21,7 @@ import com.pengxh.kt.lite.extensions.navigatePageTo import com.pengxh.kt.lite.extensions.readAssetsFile import com.pengxh.kt.lite.extensions.show -import com.pengxh.kt.lite.utils.LoadingDialogHub +import com.pengxh.kt.lite.utils.LoadingDialog import com.pengxh.kt.lite.utils.SaveKeyValues import kotlinx.coroutines.Dispatchers import kotlinx.coroutines.launch @@ -106,11 +106,11 @@ override fun observeRequestState() { authenticateViewModel.loadState.observe(this) { - LoadingDialogHub.show(this, "登录中,请稍后") + LoadingDialog.show(this, "登录中,请稍后") } loginViewModel.loadState.observe(this) { - LoadingDialogHub.dismiss() + LoadingDialog.dismiss() } } diff --git a/app/src/main/java/com/casic/app/smartwell/view/OrderCompletedDetailActivity.kt b/app/src/main/java/com/casic/app/smartwell/view/OrderCompletedDetailActivity.kt index db8ad1f..75cd905 100644 --- a/app/src/main/java/com/casic/app/smartwell/view/OrderCompletedDetailActivity.kt +++ b/app/src/main/java/com/casic/app/smartwell/view/OrderCompletedDetailActivity.kt @@ -17,7 +17,7 @@ import com.pengxh.kt.lite.extensions.show import com.pengxh.kt.lite.utils.Constant import com.pengxh.kt.lite.utils.LoadState -import com.pengxh.kt.lite.utils.LoadingDialogHub +import com.pengxh.kt.lite.utils.LoadingDialog import com.pengxh.kt.lite.widget.TitleBarView import com.pengxh.kt.lite.widget.dialog.AlertMessageDialog @@ -44,7 +44,7 @@ } override fun initOnCreate(savedInstanceState: Bundle?) { - val jobId = intent.getStringExtra(Constant.INTENT_PARAM)!! + val jobId = intent.getStringExtra(Constant.INTENT_PARAM_KEY)!! orderViewModel = ViewModelProvider(this)[OrderViewModel::class.java] orderViewModel.getWorkOrderDetail(jobId) orderViewModel.detailModel.observe(this) { @@ -154,8 +154,8 @@ override fun observeRequestState() { orderViewModel.loadState.observe(this) { when (it) { - is LoadState.Loading -> LoadingDialogHub.show(this, "数据加载中,请稍后") - else -> LoadingDialogHub.dismiss() + is LoadState.Loading -> LoadingDialog.show(this, "数据加载中,请稍后") + else -> LoadingDialog.dismiss() } } } diff --git a/app/src/main/java/com/casic/app/smartwell/view/OrderInHandleDetailActivity.kt b/app/src/main/java/com/casic/app/smartwell/view/OrderInHandleDetailActivity.kt index d70a979..04a7d5d 100644 --- a/app/src/main/java/com/casic/app/smartwell/view/OrderInHandleDetailActivity.kt +++ b/app/src/main/java/com/casic/app/smartwell/view/OrderInHandleDetailActivity.kt @@ -38,7 +38,7 @@ import com.pengxh.kt.lite.extensions.show import com.pengxh.kt.lite.utils.Constant import com.pengxh.kt.lite.utils.LoadState -import com.pengxh.kt.lite.utils.LoadingDialogHub +import com.pengxh.kt.lite.utils.LoadingDialog import com.pengxh.kt.lite.widget.TitleBarView import com.pengxh.kt.lite.widget.dialog.AlertControlDialog import com.pengxh.kt.lite.widget.dialog.AlertMessageDialog @@ -93,7 +93,7 @@ ) binding.addImageRecyclerView.adapter = imageAdapter - val jobId = intent.getStringExtra(Constant.INTENT_PARAM)!!//初始化图片九宫格 + val jobId = intent.getStringExtra(Constant.INTENT_PARAM_KEY)!!//初始化图片九宫格 orderViewModel.getWorkOrderDetail(jobId) orderViewModel.detailModel.observe(this) { if (it.code == 200) { @@ -312,41 +312,41 @@ override fun observeRequestState() { orderViewModel.loadState.observe(this) { when (it) { - is LoadState.Loading -> LoadingDialogHub.show(this, "数据加载中,请稍后") - else -> LoadingDialogHub.dismiss() + is LoadState.Loading -> LoadingDialog.show(this, "数据加载中,请稍后") + else -> LoadingDialog.dismiss() } } uploadImageViewModel.loadState.observe(this) { when (it) { - LoadState.Loading -> LoadingDialogHub.show(this, "图片上传中,请稍后...") - else -> LoadingDialogHub.dismiss() + LoadState.Loading -> LoadingDialog.show(this, "图片上传中,请稍后...") + else -> LoadingDialog.dismiss() } } //转单状态处理 operationViewModel.loadState.observe(this) { when (it) { - is LoadState.Loading -> LoadingDialogHub.show(this, "转单中,请稍后") + is LoadState.Loading -> LoadingDialog.show(this, "转单中,请稍后") is LoadState.Success -> { - LoadingDialogHub.dismiss() + LoadingDialog.dismiss() this.finish() } - else -> LoadingDialogHub.dismiss() + else -> LoadingDialog.dismiss() } } //处理完成工单状态处理 operationViewModel.loadState.observe(this) { when (it) { - is LoadState.Loading -> LoadingDialogHub.show(this, "处理中,请稍后") + is LoadState.Loading -> LoadingDialog.show(this, "处理中,请稍后") is LoadState.Success -> { - LoadingDialogHub.dismiss() + LoadingDialog.dismiss() this.finish() } - else -> LoadingDialogHub.dismiss() + else -> LoadingDialog.dismiss() } } } diff --git a/app/src/main/java/com/casic/app/smartwell/view/OrderNotConfirmedDetailActivity.kt b/app/src/main/java/com/casic/app/smartwell/view/OrderNotConfirmedDetailActivity.kt index 8e036d2..687ec86 100644 --- a/app/src/main/java/com/casic/app/smartwell/view/OrderNotConfirmedDetailActivity.kt +++ b/app/src/main/java/com/casic/app/smartwell/view/OrderNotConfirmedDetailActivity.kt @@ -36,7 +36,7 @@ import com.pengxh.kt.lite.extensions.show import com.pengxh.kt.lite.utils.Constant import com.pengxh.kt.lite.utils.LoadState -import com.pengxh.kt.lite.utils.LoadingDialogHub +import com.pengxh.kt.lite.utils.LoadingDialog import com.pengxh.kt.lite.widget.TitleBarView import com.pengxh.kt.lite.widget.dialog.AlertControlDialog import com.pengxh.kt.lite.widget.dialog.AlertMessageDialog @@ -80,7 +80,7 @@ } override fun initOnCreate(savedInstanceState: Bundle?) { - val jobId = intent.getStringExtra(Constant.INTENT_PARAM)!! + val jobId = intent.getStringExtra(Constant.INTENT_PARAM_KEY)!! //初始化图片九宫格 //左外边距,左内边距,右内边距,右外边距 val viewWidth = getScreenWidth() - (10 + 10 + 10 + 10).dp2px(this) @@ -263,41 +263,41 @@ //数据加载状态处理 orderViewModel.loadState.observe(this) { when (it) { - is LoadState.Loading -> LoadingDialogHub.show(this, "数据加载中,请稍后") - else -> LoadingDialogHub.dismiss() + is LoadState.Loading -> LoadingDialog.show(this, "数据加载中,请稍后") + else -> LoadingDialog.dismiss() } } uploadImageViewModel.loadState.observe(this) { when (it) { - LoadState.Loading -> LoadingDialogHub.show(this, "图片上传中,请稍后") - else -> LoadingDialogHub.dismiss() + LoadState.Loading -> LoadingDialog.show(this, "图片上传中,请稍后") + else -> LoadingDialog.dismiss() } } //转单状态处理 operationViewModel.loadState.observe(this) { when (it) { - is LoadState.Loading -> LoadingDialogHub.show(this, "转单中,请稍后") + is LoadState.Loading -> LoadingDialog.show(this, "转单中,请稍后") is LoadState.Success -> { - LoadingDialogHub.dismiss() + LoadingDialog.dismiss() this.finish() } - else -> LoadingDialogHub.dismiss() + else -> LoadingDialog.dismiss() } } //确认工单状态处理 operationViewModel.loadState.observe(this) { when (it) { - is LoadState.Loading -> LoadingDialogHub.show(this, "处理中,请稍后") + is LoadState.Loading -> LoadingDialog.show(this, "处理中,请稍后") is LoadState.Success -> { - LoadingDialogHub.dismiss() + LoadingDialog.dismiss() this.finish() } - else -> LoadingDialogHub.dismiss() + else -> LoadingDialog.dismiss() } } } diff --git a/app/src/main/java/com/casic/app/smartwell/view/OrderNotProcessedDetailActivity.kt b/app/src/main/java/com/casic/app/smartwell/view/OrderNotProcessedDetailActivity.kt index d3f22dc..0c97a52 100644 --- a/app/src/main/java/com/casic/app/smartwell/view/OrderNotProcessedDetailActivity.kt +++ b/app/src/main/java/com/casic/app/smartwell/view/OrderNotProcessedDetailActivity.kt @@ -18,7 +18,7 @@ import com.pengxh.kt.lite.extensions.show import com.pengxh.kt.lite.utils.Constant import com.pengxh.kt.lite.utils.LoadState -import com.pengxh.kt.lite.utils.LoadingDialogHub +import com.pengxh.kt.lite.utils.LoadingDialog import com.pengxh.kt.lite.widget.TitleBarView import com.pengxh.kt.lite.widget.dialog.AlertControlDialog import com.pengxh.kt.lite.widget.dialog.AlertMessageDialog @@ -50,7 +50,7 @@ } override fun initOnCreate(savedInstanceState: Bundle?) { - this.jobId = intent.getStringExtra(Constant.INTENT_PARAM)!! + this.jobId = intent.getStringExtra(Constant.INTENT_PARAM_KEY)!! orderViewModel = ViewModelProvider(this)[OrderViewModel::class.java] operationViewModel = ViewModelProvider(this)[OperationViewModel::class.java] wellViewModel = ViewModelProvider(this)[WellViewModel::class.java] @@ -162,21 +162,21 @@ //数据加载状态处理 orderViewModel.loadState.observe(this) { when (it) { - is LoadState.Loading -> LoadingDialogHub.show(this, "数据加载中,请稍后") - else -> LoadingDialogHub.dismiss() + is LoadState.Loading -> LoadingDialog.show(this, "数据加载中,请稍后") + else -> LoadingDialog.dismiss() } } //接单状态处理 operationViewModel.loadState.observe(this) { when (it) { - is LoadState.Loading -> LoadingDialogHub.show(this, "接单中,请稍后") + is LoadState.Loading -> LoadingDialog.show(this, "接单中,请稍后") is LoadState.Success -> { - LoadingDialogHub.dismiss() + LoadingDialog.dismiss() this.finish() } - else -> LoadingDialogHub.dismiss() + else -> LoadingDialog.dismiss() } } } diff --git a/app/src/main/java/com/casic/app/smartwell/view/SearchResultActivity.kt b/app/src/main/java/com/casic/app/smartwell/view/SearchResultActivity.kt index 6a92917..4f3a674 100644 --- a/app/src/main/java/com/casic/app/smartwell/view/SearchResultActivity.kt +++ b/app/src/main/java/com/casic/app/smartwell/view/SearchResultActivity.kt @@ -19,7 +19,7 @@ import com.pengxh.kt.lite.extensions.show import com.pengxh.kt.lite.utils.Constant import com.pengxh.kt.lite.utils.LoadState -import com.pengxh.kt.lite.utils.LoadingDialogHub +import com.pengxh.kt.lite.utils.LoadingDialog import com.pengxh.kt.lite.utils.WeakReferenceHandler import com.pengxh.kt.lite.widget.TitleBarView import com.pengxh.kt.lite.widget.dialog.AlertControlDialog @@ -56,7 +56,7 @@ } override fun initOnCreate(savedInstanceState: Bundle?) { - args = intent.getStringArrayListExtra(Constant.INTENT_PARAM)!! + args = intent.getStringArrayListExtra(Constant.INTENT_PARAM_KEY)!! orderViewModel = ViewModelProvider(this)[OrderViewModel::class.java] operationViewModel = ViewModelProvider(this)[OperationViewModel::class.java] @@ -101,24 +101,24 @@ } } - binding.resultRecyclerView.addItemDecoration( - RecyclerViewItemOffsets(0, 5, 0, 5) + binding.recyclerView.addItemDecoration( + RecyclerViewItemOffsets(0, 7, 0, 7) ) } override fun observeRequestState() { orderViewModel.loadState.observe(this) { when (it) { - is LoadState.Loading -> LoadingDialogHub.show(this, "数据加载中,请稍后") - else -> LoadingDialogHub.dismiss() + is LoadState.Loading -> LoadingDialog.show(this, "数据加载中,请稍后") + else -> LoadingDialog.dismiss() } } //接单状态处理 operationViewModel.loadState.observe(this) { when (it) { - is LoadState.Loading -> LoadingDialogHub.show(this, "接单中,请稍后") + is LoadState.Loading -> LoadingDialog.show(this, "接单中,请稍后") is LoadState.Success -> { - LoadingDialogHub.dismiss() + LoadingDialog.dismiss() //接单成功之后刷新列表 dataBeans.removeAt(clickedPosition) searchResultAdapter.notifyItemRemoved(clickedPosition) @@ -127,7 +127,7 @@ ) } - else -> LoadingDialogHub.dismiss() + else -> LoadingDialog.dismiss() } } } @@ -162,7 +162,7 @@ } else { binding.emptyInclude.emptyView.hide() searchResultAdapter = SearchResultAdapter(this, dataBeans) - binding.resultRecyclerView.adapter = searchResultAdapter + binding.recyclerView.adapter = searchResultAdapter searchResultAdapter.setOnItemClickListener(object : SearchResultAdapter.OnItemClickListener { override fun onClicked(position: Int) { diff --git a/app/src/main/java/com/casic/app/smartwell/view/UnDeployWellActivity.kt b/app/src/main/java/com/casic/app/smartwell/view/UnDeployWellActivity.kt index 7f7cd3c..555c278 100644 --- a/app/src/main/java/com/casic/app/smartwell/view/UnDeployWellActivity.kt +++ b/app/src/main/java/com/casic/app/smartwell/view/UnDeployWellActivity.kt @@ -81,8 +81,8 @@ } } - binding.undeployListView.addItemDecoration( - RecyclerViewItemOffsets(0, 5, 0, 5) + binding.recyclerView.addItemDecoration( + RecyclerViewItemOffsets(0, 7, 0, 7) ) } @@ -147,12 +147,11 @@ } else { item.deep.toString() + "m" } - viewHolder.setText(R.id.wellNameView, item.wellName) + viewHolder.setText(R.id.wellTypeView, item.wellTypeName) .setText(R.id.wellDepthView, "深:${deep}") .setText(R.id.wellCodeView, "点位编号:${item.wellCode}") - .setText(R.id.wellTypeView, "点位类型:${item.wellTypeName}") .setText(R.id.ownerShipView, "权属单位:${item.deptName}") - .setText(R.id.wellLocationView, "点位置:${item.position}") + .setText(R.id.wellLocationView, "点位位置:${item.position}") .setOnClickListener( R.id.operationButton, object : View.OnClickListener { override fun onClick(v: View?) { @@ -185,7 +184,7 @@ ) } } - binding.undeployListView.adapter = unDeployAdapter + binding.recyclerView.adapter = unDeployAdapter unDeployAdapter.setOnItemClickedListener(object : NormalRecyclerAdapter.OnItemClickedListener { override fun onItemClicked(position: Int, t: WellListModel.DataBean.RowsBean) { diff --git a/app/src/main/java/com/casic/app/smartwell/view/WellDetailActivity.kt b/app/src/main/java/com/casic/app/smartwell/view/WellDetailActivity.kt index b50d067..eb8b468 100644 --- a/app/src/main/java/com/casic/app/smartwell/view/WellDetailActivity.kt +++ b/app/src/main/java/com/casic/app/smartwell/view/WellDetailActivity.kt @@ -16,7 +16,7 @@ import com.pengxh.kt.lite.extensions.show import com.pengxh.kt.lite.utils.Constant import com.pengxh.kt.lite.utils.LoadState -import com.pengxh.kt.lite.utils.LoadingDialogHub +import com.pengxh.kt.lite.utils.LoadingDialog import com.pengxh.kt.lite.widget.TitleBarView import com.pengxh.kt.lite.widget.dialog.AlertMessageDialog @@ -44,7 +44,7 @@ } override fun initOnCreate(savedInstanceState: Bundle?) { - val wellId = intent.getStringExtra(Constant.INTENT_PARAM)!! + val wellId = intent.getStringExtra(Constant.INTENT_PARAM_KEY)!! wellViewModel = ViewModelProvider(this)[WellViewModel::class.java] wellViewModel.getWellDetail(wellId) wellViewModel.wellDetailModel.observe(this) { @@ -132,8 +132,8 @@ override fun observeRequestState() { wellViewModel.loadState.observe(this) { when (it) { - is LoadState.Loading -> LoadingDialogHub.show(this, "数据加载中,请稍后") - else -> LoadingDialogHub.dismiss() + is LoadState.Loading -> LoadingDialog.show(this, "数据加载中,请稍后") + else -> LoadingDialog.dismiss() } } } diff --git a/app/src/main/java/com/casic/app/smartwell/view/WellManagementActivity.kt b/app/src/main/java/com/casic/app/smartwell/view/WellManagementActivity.kt index 084da95..457096b 100644 --- a/app/src/main/java/com/casic/app/smartwell/view/WellManagementActivity.kt +++ b/app/src/main/java/com/casic/app/smartwell/view/WellManagementActivity.kt @@ -94,8 +94,8 @@ } } - binding.wellListView.addItemDecoration( - RecyclerViewItemOffsets(0, 5, 0, 5) + binding.recyclerView.addItemDecoration( + RecyclerViewItemOffsets(0, 7, 0, 7) ) } @@ -175,13 +175,12 @@ } else { item.deep.toString() + "m" } - viewHolder.setText(R.id.wellNameView, item.wellName) + viewHolder.setText(R.id.wellTypeView, item.wellTypeName) .setText(R.id.wellStateView, "已${item.bfztName}") .setText(R.id.wellDepthView, "深:${deep}") .setText(R.id.wellCodeView, "点位编号:${item.wellCode}") - .setText(R.id.wellTypeView, "点位类型:${item.wellTypeName}") .setText(R.id.ownerShipView, "权属单位:${item.deptName}") - .setText(R.id.wellLocationView, "点位置:${item.position}") + .setText(R.id.wellLocationView, "点位位置:${item.position}") .setOnClickListener( R.id.navigationButton, object : View.OnClickListener { override fun onClick(v: View?) { @@ -200,7 +199,7 @@ ) } } - binding.wellListView.adapter = wellListAdapter + binding.recyclerView.adapter = wellListAdapter wellListAdapter.setOnItemClickedListener(object : NormalRecyclerAdapter.OnItemClickedListener { override fun onItemClicked(position: Int, t: WellListModel.DataBean.RowsBean) { diff --git a/app/src/main/java/com/casic/app/smartwell/view/WellMonitorActivity.kt b/app/src/main/java/com/casic/app/smartwell/view/WellMonitorActivity.kt index e3573eb..b87bdb7 100644 --- a/app/src/main/java/com/casic/app/smartwell/view/WellMonitorActivity.kt +++ b/app/src/main/java/com/casic/app/smartwell/view/WellMonitorActivity.kt @@ -11,7 +11,7 @@ import com.pengxh.kt.lite.base.KotlinBaseActivity import com.pengxh.kt.lite.utils.Constant import com.pengxh.kt.lite.utils.LoadState -import com.pengxh.kt.lite.utils.LoadingDialogHub +import com.pengxh.kt.lite.utils.LoadingDialog import com.pengxh.kt.lite.widget.TitleBarView class WellMonitorActivity : KotlinBaseActivity() { @@ -36,7 +36,7 @@ } override fun initOnCreate(savedInstanceState: Bundle?) { - val wellId = intent.getStringExtra(Constant.INTENT_PARAM)!! + val wellId = intent.getStringExtra(Constant.INTENT_PARAM_KEY)!! wellViewModel = ViewModelProvider(this)[WellViewModel::class.java] wellViewModel.getMonitorResult(wellId) wellViewModel.monitorModel.observe(this) { @@ -56,8 +56,8 @@ override fun observeRequestState() { wellViewModel.loadState.observe(this) { when (it) { - is LoadState.Loading -> LoadingDialogHub.show(this, "数据加载中,请稍后") - else -> LoadingDialogHub.dismiss() + is LoadState.Loading -> LoadingDialog.show(this, "数据加载中,请稍后") + else -> LoadingDialog.dismiss() } } } diff --git a/app/build.gradle b/app/build.gradle index 296fb6f..c18c251 100644 --- a/app/build.gradle +++ b/app/build.gradle @@ -40,10 +40,6 @@ // VIVO 相关应用参数 VIVO_APP_ID : "105749048", VIVO_APP_KEY : "e460fbf2c689e0f8c58ecc6aa62e1803", - - // 小米相关应用参数 -// XIAOMI_APP_ID : "", -// XIAOMI_APP_KEY : "", ] // 版本名后面添加一句话,意思就是flavor dimension 它的维度就是该版本号,多渠道打包很重要 @@ -107,7 +103,7 @@ dependencies { implementation fileTree(dir: 'libs', include: ['*.jar']) //基础依赖库 - implementation 'com.github.AndroidCoderPeng:Kotlin-lite-lib:1.0.10' + implementation 'com.github.AndroidCoderPeng:Kotlin-lite-lib:1.1.0' implementation 'androidx.appcompat:appcompat:1.6.1' implementation 'androidx.core:core-ktx:1.9.0' implementation 'androidx.constraintlayout:constraintlayout:2.1.4' @@ -165,8 +161,6 @@ implementation 'commons-codec:commons-codec:1.15' implementation 'com.android.support:support-annotations:28.0.0' implementation 'com.assist-v3:vivo:3.1.2' // vivo -// implementation 'com.getui.opt:xmp:3.3.1' // 小米 - //数据库框架 implementation 'org.greenrobot:greendao:3.3.0' //数据库升级 diff --git a/app/src/main/AndroidManifest.xml b/app/src/main/AndroidManifest.xml index c0af158..e0519bf 100644 --- a/app/src/main/AndroidManifest.xml +++ b/app/src/main/AndroidManifest.xml @@ -90,10 +90,10 @@ - + + android:value="ee96d8b5e12de3fbb29949efd57418a8" /> () @@ -150,7 +158,7 @@ val cameraPosition = CameraPosition(centerLatLng, 14f, 0f, 0f) val cameraUpdate = CameraUpdateFactory.newCameraPosition(cameraPosition) withContext(Dispatchers.Main) { - LoadingDialogHub.dismiss() + LoadingDialog.dismiss() aMap.animateCamera(cameraUpdate, 1500, null) } } @@ -239,11 +247,6 @@ } override fun initEvent() { - binding.rightOptionView.setOnClickListener { - val x = binding.rightOptionView.width - easyPopupWindow.width - easyPopupWindow.showAsDropDown(binding.rightOptionView, x, 0) - } - //撤防点位 binding.unDeployedLayout.setOnClickListener { requireContext().navigatePageTo() @@ -263,11 +266,11 @@ override fun observeRequestState() { wellViewModel.loadState.observe(this) { when (it) { - is LoadState.Loading -> LoadingDialogHub.show( + is LoadState.Loading -> LoadingDialog.show( requireActivity(), "数据加载中,请稍后..." ) - else -> LoadingDialogHub.dismiss() + else -> LoadingDialog.dismiss() } } } @@ -376,7 +379,7 @@ }).build().show() } }) - infoPopup.showAsDropDown(binding.rightOptionView) +// infoPopup.showAsDropDown(binding.rightOptionView) } override fun onCameraChange(p0: CameraPosition?) { diff --git a/app/src/main/java/com/casic/app/smartwell/fragment/HomePageNoClusterFragment.kt b/app/src/main/java/com/casic/app/smartwell/fragment/HomePageNoClusterFragment.kt index 802426a..b25f743 100644 --- a/app/src/main/java/com/casic/app/smartwell/fragment/HomePageNoClusterFragment.kt +++ b/app/src/main/java/com/casic/app/smartwell/fragment/HomePageNoClusterFragment.kt @@ -38,8 +38,9 @@ import com.pengxh.kt.lite.extensions.navigatePageTo import com.pengxh.kt.lite.extensions.show import com.pengxh.kt.lite.utils.LoadState -import com.pengxh.kt.lite.utils.LoadingDialogHub +import com.pengxh.kt.lite.utils.LoadingDialog import com.pengxh.kt.lite.widget.EasyPopupWindow +import com.pengxh.kt.lite.widget.TitleBarView import com.pengxh.kt.lite.widget.dialog.AlertControlDialog import kotlinx.coroutines.Dispatchers import kotlinx.coroutines.launch @@ -78,7 +79,15 @@ override fun setupTopBarLayout() { binding.rootView.initImmersionBar(this, false, R.color.mainThemeColor) - binding.titleView.text = "首页" + binding.titleView.setOnClickListener(object : TitleBarView.OnClickListener { + override fun onLeftClick() { + + } + + override fun onRightClick() { + easyPopupWindow.showAsDropDown(binding.titleView, binding.titleView.width, 0) + } + }) } override fun initOnCreate(savedInstanceState: Bundle?) { @@ -112,7 +121,7 @@ //渲染井位置 lifecycleScope.launch(Dispatchers.Main) { - LoadingDialogHub.show(requireActivity(), "数据加载中,请稍后") + LoadingDialog.show(requireActivity(), "数据加载中,请稍后") withContext(Dispatchers.IO) { //取Well缓存 val allMarkerOptions = ArrayList() @@ -144,7 +153,7 @@ val cameraPosition = CameraPosition(centerLatLng, 14f, 0f, 0f) val cameraUpdate = CameraUpdateFactory.newCameraPosition(cameraPosition) withContext(Dispatchers.Main) { - LoadingDialogHub.dismiss() + LoadingDialog.dismiss() aMap.animateCamera(cameraUpdate, 1500, null) } } @@ -238,11 +247,6 @@ } override fun initEvent() { - binding.rightOptionView.setOnClickListener { - val x = binding.rightOptionView.width - easyPopupWindow.width - easyPopupWindow.showAsDropDown(binding.rightOptionView, x, 0) - } - //撤防点位 binding.unDeployedLayout.setOnClickListener { requireContext().navigatePageTo() @@ -262,11 +266,11 @@ override fun observeRequestState() { wellViewModel.loadState.observe(this) { when (it) { - is LoadState.Loading -> LoadingDialogHub.show( + is LoadState.Loading -> LoadingDialog.show( requireActivity(), "数据加载中,请稍后..." ) - else -> LoadingDialogHub.dismiss() + else -> LoadingDialog.dismiss() } } } diff --git a/app/src/main/java/com/casic/app/smartwell/fragment/MinePageFragment.kt b/app/src/main/java/com/casic/app/smartwell/fragment/MinePageFragment.kt index 09a570c..dcb48f8 100644 --- a/app/src/main/java/com/casic/app/smartwell/fragment/MinePageFragment.kt +++ b/app/src/main/java/com/casic/app/smartwell/fragment/MinePageFragment.kt @@ -35,7 +35,7 @@ import com.pengxh.kt.lite.utils.ActivityStackManager import com.pengxh.kt.lite.utils.FileDownloadManager import com.pengxh.kt.lite.utils.LoadState -import com.pengxh.kt.lite.utils.LoadingDialogHub +import com.pengxh.kt.lite.utils.LoadingDialog import com.pengxh.kt.lite.widget.dialog.AlertControlDialog import com.pengxh.kt.lite.widget.dialog.BottomActionSheet import kotlinx.coroutines.Dispatchers @@ -60,7 +60,6 @@ override fun setupTopBarLayout() { binding.rootView.initImmersionBar(this, false, R.color.mainThemeColor) - binding.titleInclude.titleView.text = "我的" } override fun initOnCreate(savedInstanceState: Bundle?) { @@ -155,27 +154,27 @@ override fun observeRequestState() { userViewModel.loadState.observe(this) { when (it) { - is LoadState.Loading -> LoadingDialogHub.show( + is LoadState.Loading -> LoadingDialog.show( requireActivity(), "检查版本中,请稍后" ) - else -> LoadingDialogHub.dismiss() + else -> LoadingDialog.dismiss() } } wellViewModel.loadState.observe(this) { when (it) { - is LoadState.Loading -> LoadingDialogHub.show( + is LoadState.Loading -> LoadingDialog.show( requireActivity(), "数据更新中,请稍后" ) is LoadState.Fail -> { - LoadingDialogHub.dismiss() + LoadingDialog.dismiss() "数据更新超时".show(requireContext()) } else -> { - LoadingDialogHub.dismiss() + LoadingDialog.dismiss() AlertControlDialog.Builder().setContext(requireContext()).setTitle("温馨提示") .setMessage("数据更新成功,请重启应用").setNegativeButton("取消") .setPositiveButton("确定").setOnDialogButtonClickListener(object : @@ -197,17 +196,17 @@ lineViewModel.loadState.observe(this) { when (it) { - is LoadState.Loading -> LoadingDialogHub.show( + is LoadState.Loading -> LoadingDialog.show( requireActivity(), "数据更新中,请稍后" ) is LoadState.Fail -> { - LoadingDialogHub.dismiss() + LoadingDialog.dismiss() "数据更新超时".show(requireContext()) } else -> { - LoadingDialogHub.dismiss() + LoadingDialog.dismiss() AlertControlDialog.Builder().setContext(requireContext()).setTitle("温馨提示") .setMessage("数据更新成功,请重启应用").setNegativeButton("取消") .setPositiveButton("确定").setOnDialogButtonClickListener(object : diff --git a/app/src/main/java/com/casic/app/smartwell/fragment/NoticePageFragment.kt b/app/src/main/java/com/casic/app/smartwell/fragment/NoticePageFragment.kt index 171b555..3c93f54 100644 --- a/app/src/main/java/com/casic/app/smartwell/fragment/NoticePageFragment.kt +++ b/app/src/main/java/com/casic/app/smartwell/fragment/NoticePageFragment.kt @@ -48,7 +48,6 @@ override fun setupTopBarLayout() { binding.rootView.initImmersionBar(this, false, R.color.mainThemeColor) - binding.titleInclude.titleView.text = "消息" } override fun initOnCreate(savedInstanceState: Bundle?) { diff --git a/app/src/main/java/com/casic/app/smartwell/fragment/OrderListFragment.kt b/app/src/main/java/com/casic/app/smartwell/fragment/OrderListFragment.kt index 93ff35b..5e38acb 100644 --- a/app/src/main/java/com/casic/app/smartwell/fragment/OrderListFragment.kt +++ b/app/src/main/java/com/casic/app/smartwell/fragment/OrderListFragment.kt @@ -12,6 +12,7 @@ import com.casic.app.smartwell.view.SearchOrderActivity import com.pengxh.kt.lite.base.KotlinBaseFragment import com.pengxh.kt.lite.extensions.navigatePageTo +import com.pengxh.kt.lite.widget.TitleBarView class OrderListFragment : KotlinBaseFragment() { @@ -25,15 +26,22 @@ } override fun initViewBinding( - inflater: LayoutInflater, - container: ViewGroup? + inflater: LayoutInflater, container: ViewGroup? ): FragmentOrderBinding { return FragmentOrderBinding.inflate(inflater, container, false) } override fun setupTopBarLayout() { binding.rootView.initImmersionBar(this, false, R.color.mainThemeColor) - binding.titleView.text = "工单" + binding.titleView.setOnClickListener(object : TitleBarView.OnClickListener { + override fun onLeftClick() { + + } + + override fun onRightClick() { + requireContext().navigatePageTo() + } + }) } override fun initOnCreate(savedInstanceState: Bundle?) { @@ -51,8 +59,6 @@ } override fun initEvent() { - binding.rightOptionView.setOnClickListener { - requireContext().navigatePageTo() - } + } } \ No newline at end of file diff --git a/app/src/main/java/com/casic/app/smartwell/fragment/OrderNotProcessedFragment.kt b/app/src/main/java/com/casic/app/smartwell/fragment/OrderNotProcessedFragment.kt index 0b3d09d..2b6f21d 100644 --- a/app/src/main/java/com/casic/app/smartwell/fragment/OrderNotProcessedFragment.kt +++ b/app/src/main/java/com/casic/app/smartwell/fragment/OrderNotProcessedFragment.kt @@ -18,7 +18,7 @@ import com.pengxh.kt.lite.extensions.navigatePageTo import com.pengxh.kt.lite.extensions.show import com.pengxh.kt.lite.utils.LoadState -import com.pengxh.kt.lite.utils.LoadingDialogHub +import com.pengxh.kt.lite.utils.LoadingDialog import com.pengxh.kt.lite.utils.WeakReferenceHandler import com.pengxh.kt.lite.widget.dialog.AlertControlDialog @@ -78,8 +78,8 @@ operationViewModel = ViewModelProvider(this)[OperationViewModel::class.java] - binding.notProcessedView.addItemDecoration( - RecyclerViewItemOffsets(0, 5, 0, 5) + binding.recyclerView.addItemDecoration( + RecyclerViewItemOffsets(0, 7, 0, 7) ) } @@ -87,9 +87,9 @@ //接单状态处理 operationViewModel.loadState.observe(this) { when (it) { - is LoadState.Loading -> LoadingDialogHub.show(requireActivity(), "接单中,请稍后") + is LoadState.Loading -> LoadingDialog.show(requireActivity(), "接单中,请稍后") is LoadState.Success -> { - LoadingDialogHub.dismiss() + LoadingDialog.dismiss() //接单成功之后刷新列表 dataBeans.removeAt(clickedPosition) notProcessedAdapter.notifyItemRemoved(clickedPosition) @@ -98,7 +98,7 @@ ) } - else -> LoadingDialogHub.dismiss() + else -> LoadingDialog.dismiss() } } } @@ -131,7 +131,7 @@ } else { binding.emptyInclude.emptyView.hide() notProcessedAdapter = OrderNotProcessedAdapter(requireContext(), dataBeans) - binding.notProcessedView.adapter = notProcessedAdapter + binding.recyclerView.adapter = notProcessedAdapter notProcessedAdapter.setOnItemClickListener(object : OrderNotProcessedAdapter.OnItemClickListener { override fun onClicked(position: Int) { diff --git a/app/src/main/java/com/casic/app/smartwell/fragment/OvertimeNotAcceptFragment.kt b/app/src/main/java/com/casic/app/smartwell/fragment/OvertimeNotAcceptFragment.kt index a198545..9b318ca 100644 --- a/app/src/main/java/com/casic/app/smartwell/fragment/OvertimeNotAcceptFragment.kt +++ b/app/src/main/java/com/casic/app/smartwell/fragment/OvertimeNotAcceptFragment.kt @@ -18,7 +18,7 @@ import com.pengxh.kt.lite.extensions.navigatePageTo import com.pengxh.kt.lite.extensions.show import com.pengxh.kt.lite.utils.LoadState -import com.pengxh.kt.lite.utils.LoadingDialogHub +import com.pengxh.kt.lite.utils.LoadingDialog import com.pengxh.kt.lite.utils.WeakReferenceHandler import com.pengxh.kt.lite.widget.dialog.AlertControlDialog @@ -81,8 +81,8 @@ operationViewModel = ViewModelProvider(this)[OperationViewModel::class.java] - binding.notProcessedView.addItemDecoration( - RecyclerViewItemOffsets(0, 5, 0, 5) + binding.recyclerView.addItemDecoration( + RecyclerViewItemOffsets(0, 7, 0, 7) ) } @@ -90,9 +90,9 @@ //接单状态处理 operationViewModel.loadState.observe(this) { when (it) { - is LoadState.Loading -> LoadingDialogHub.show(requireActivity(), "接单中,请稍后") + is LoadState.Loading -> LoadingDialog.show(requireActivity(), "接单中,请稍后") is LoadState.Success -> { - LoadingDialogHub.dismiss() + LoadingDialog.dismiss() //接单成功之后刷新列表 dataBeans.removeAt(clickedPosition) notProcessedAdapter.notifyItemRemoved(clickedPosition) @@ -101,7 +101,7 @@ ) } - else -> LoadingDialogHub.dismiss() + else -> LoadingDialog.dismiss() } } } @@ -134,7 +134,7 @@ } else { binding.emptyInclude.emptyView.hide() notProcessedAdapter = OrderNotProcessedAdapter(requireContext(), dataBeans) - binding.notProcessedView.adapter = notProcessedAdapter + binding.recyclerView.adapter = notProcessedAdapter notProcessedAdapter.setOnItemClickListener(object : OrderNotProcessedAdapter.OnItemClickListener { override fun onClicked(position: Int) { diff --git a/app/src/main/java/com/casic/app/smartwell/greendao/DaoMaster.java b/app/src/main/java/com/casic/app/smartwell/greendao/DaoMaster.java index fdcf3a7..1e52b74 100644 --- a/app/src/main/java/com/casic/app/smartwell/greendao/DaoMaster.java +++ b/app/src/main/java/com/casic/app/smartwell/greendao/DaoMaster.java @@ -13,25 +13,20 @@ // THIS CODE IS GENERATED BY greenDAO, DO NOT EDIT. - /** * Master of DAO (schema version 4): knows all DAOs. */ public class DaoMaster extends AbstractDaoMaster { public static final int SCHEMA_VERSION = 4; - /** - * Creates underlying database table using DAOs. - */ + /** Creates underlying database table using DAOs. */ public static void createAllTables(Database db, boolean ifNotExists) { MapWellLocalBeanDao.createTable(db, ifNotExists); NoticeLocaleBeanDao.createTable(db, ifNotExists); PipeLocalBeanDao.createTable(db, ifNotExists); } - /** - * Drops underlying database table using DAOs. - */ + /** Drops underlying database table using DAOs. */ public static void dropAllTables(Database db, boolean ifExists) { MapWellLocalBeanDao.dropTable(db, ifExists); NoticeLocaleBeanDao.dropTable(db, ifExists); @@ -86,9 +81,7 @@ } } - /** - * WARNING: Drops all table on Upgrade! Use only during development. - */ + /** WARNING: Drops all table on Upgrade! Use only during development. */ public static class DevOpenHelper extends OpenHelper { public DevOpenHelper(Context context, String name) { super(context, name); diff --git a/app/src/main/java/com/casic/app/smartwell/greendao/DaoSession.java b/app/src/main/java/com/casic/app/smartwell/greendao/DaoSession.java index 0b36d17..3e40e3b 100644 --- a/app/src/main/java/com/casic/app/smartwell/greendao/DaoSession.java +++ b/app/src/main/java/com/casic/app/smartwell/greendao/DaoSession.java @@ -16,7 +16,7 @@ /** * {@inheritDoc} - * + * * @see org.greenrobot.greendao.AbstractDaoSession */ public class DaoSession extends AbstractDaoSession { @@ -50,7 +50,7 @@ registerDao(NoticeLocaleBean.class, noticeLocaleBeanDao); registerDao(PipeLocalBean.class, pipeLocalBeanDao); } - + public void clear() { mapWellLocalBeanDaoConfig.clearIdentityScope(); noticeLocaleBeanDaoConfig.clearIdentityScope(); diff --git a/app/src/main/java/com/casic/app/smartwell/greendao/MapWellLocalBeanDao.java b/app/src/main/java/com/casic/app/smartwell/greendao/MapWellLocalBeanDao.java index 8908fda..407bc92 100644 --- a/app/src/main/java/com/casic/app/smartwell/greendao/MapWellLocalBeanDao.java +++ b/app/src/main/java/com/casic/app/smartwell/greendao/MapWellLocalBeanDao.java @@ -12,10 +12,9 @@ import org.greenrobot.greendao.internal.DaoConfig; // THIS CODE IS GENERATED BY greenDAO, DO NOT EDIT. - -/** +/** * DAO for table "MAP_WELL_LOCAL_BEAN". - */ +*/ public class MapWellLocalBeanDao extends AbstractDao { public static final String TABLENAME = "MAP_WELL_LOCAL_BEAN"; @@ -57,16 +56,14 @@ public MapWellLocalBeanDao(DaoConfig config) { super(config); } - + public MapWellLocalBeanDao(DaoConfig config, DaoSession daoSession) { super(config, daoSession); } - /** - * Creates the underlying database table. - */ + /** Creates the underlying database table. */ public static void createTable(Database db, boolean ifNotExists) { - String constraint = ifNotExists ? "IF NOT EXISTS " : ""; + String constraint = ifNotExists? "IF NOT EXISTS ": ""; db.execSQL("CREATE TABLE " + constraint + "\"MAP_WELL_LOCAL_BEAN\" (" + // "\"_id\" INTEGER PRIMARY KEY AUTOINCREMENT ," + // 0: kId "\"AREA\" TEXT," + // 1: area @@ -96,9 +93,7 @@ "\"WELL_TYPE_NAME\" TEXT);"); // 25: wellTypeName } - /** - * Drops the underlying database table. - */ + /** Drops the underlying database table. */ public static void dropTable(Database db, boolean ifExists) { String sql = "DROP TABLE " + (ifExists ? "IF EXISTS " : "") + "\"MAP_WELL_LOCAL_BEAN\""; db.execSQL(sql); @@ -107,132 +102,132 @@ @Override protected final void bindValues(DatabaseStatement stmt, MapWellLocalBean entity) { stmt.clearBindings(); - + Long kId = entity.getKId(); if (kId != null) { stmt.bindLong(1, kId); } - + String area = entity.getArea(); if (area != null) { stmt.bindString(2, area); } - + String bfzt = entity.getBfzt(); if (bfzt != null) { stmt.bindString(3, bfzt); } - + String bfztName = entity.getBfztName(); if (bfztName != null) { stmt.bindString(4, bfztName); } - + String coordinateX = entity.getCoordinateX(); if (coordinateX != null) { stmt.bindString(5, coordinateX); } - + String coordinateY = entity.getCoordinateY(); if (coordinateY != null) { stmt.bindString(6, coordinateY); } - + String deep = entity.getDeep(); if (deep != null) { stmt.bindString(7, deep); } - + String deptName = entity.getDeptName(); if (deptName != null) { stmt.bindString(8, deptName); } - + String deptid = entity.getDeptid(); if (deptid != null) { stmt.bindString(9, deptid); } - + String id = entity.getId(); if (id != null) { stmt.bindString(10, id); } - + String latBaidu = entity.getLatBaidu(); if (latBaidu != null) { stmt.bindString(11, latBaidu); } - + String latGaode = entity.getLatGaode(); if (latGaode != null) { stmt.bindString(12, latGaode); } - + String lngBaidu = entity.getLngBaidu(); if (lngBaidu != null) { stmt.bindString(13, lngBaidu); } - + String lngGaode = entity.getLngGaode(); if (lngGaode != null) { stmt.bindString(14, lngGaode); } - + String notes = entity.getNotes(); if (notes != null) { stmt.bindString(15, notes); } - + String photos = entity.getPhotos(); if (photos != null) { stmt.bindString(16, photos); } - + String position = entity.getPosition(); if (position != null) { stmt.bindString(17, position); } - + String staff = entity.getStaff(); if (staff != null) { stmt.bindString(18, staff); } - + String tel = entity.getTel(); if (tel != null) { stmt.bindString(19, tel); } - + String ts = entity.getTs(); if (ts != null) { stmt.bindString(20, ts); } - + String valid = entity.getValid(); if (valid != null) { stmt.bindString(21, valid); } - + String watchData = entity.getWatchData(); if (watchData != null) { stmt.bindString(22, watchData); } - + String wellCode = entity.getWellCode(); if (wellCode != null) { stmt.bindString(23, wellCode); } - + String wellName = entity.getWellName(); if (wellName != null) { stmt.bindString(24, wellName); } - + String wellType = entity.getWellType(); if (wellType != null) { stmt.bindString(25, wellType); } - + String wellTypeName = entity.getWellTypeName(); if (wellTypeName != null) { stmt.bindString(26, wellTypeName); @@ -242,132 +237,132 @@ @Override protected final void bindValues(SQLiteStatement stmt, MapWellLocalBean entity) { stmt.clearBindings(); - + Long kId = entity.getKId(); if (kId != null) { stmt.bindLong(1, kId); } - + String area = entity.getArea(); if (area != null) { stmt.bindString(2, area); } - + String bfzt = entity.getBfzt(); if (bfzt != null) { stmt.bindString(3, bfzt); } - + String bfztName = entity.getBfztName(); if (bfztName != null) { stmt.bindString(4, bfztName); } - + String coordinateX = entity.getCoordinateX(); if (coordinateX != null) { stmt.bindString(5, coordinateX); } - + String coordinateY = entity.getCoordinateY(); if (coordinateY != null) { stmt.bindString(6, coordinateY); } - + String deep = entity.getDeep(); if (deep != null) { stmt.bindString(7, deep); } - + String deptName = entity.getDeptName(); if (deptName != null) { stmt.bindString(8, deptName); } - + String deptid = entity.getDeptid(); if (deptid != null) { stmt.bindString(9, deptid); } - + String id = entity.getId(); if (id != null) { stmt.bindString(10, id); } - + String latBaidu = entity.getLatBaidu(); if (latBaidu != null) { stmt.bindString(11, latBaidu); } - + String latGaode = entity.getLatGaode(); if (latGaode != null) { stmt.bindString(12, latGaode); } - + String lngBaidu = entity.getLngBaidu(); if (lngBaidu != null) { stmt.bindString(13, lngBaidu); } - + String lngGaode = entity.getLngGaode(); if (lngGaode != null) { stmt.bindString(14, lngGaode); } - + String notes = entity.getNotes(); if (notes != null) { stmt.bindString(15, notes); } - + String photos = entity.getPhotos(); if (photos != null) { stmt.bindString(16, photos); } - + String position = entity.getPosition(); if (position != null) { stmt.bindString(17, position); } - + String staff = entity.getStaff(); if (staff != null) { stmt.bindString(18, staff); } - + String tel = entity.getTel(); if (tel != null) { stmt.bindString(19, tel); } - + String ts = entity.getTs(); if (ts != null) { stmt.bindString(20, ts); } - + String valid = entity.getValid(); if (valid != null) { stmt.bindString(21, valid); } - + String watchData = entity.getWatchData(); if (watchData != null) { stmt.bindString(22, watchData); } - + String wellCode = entity.getWellCode(); if (wellCode != null) { stmt.bindString(23, wellCode); } - + String wellName = entity.getWellName(); if (wellName != null) { stmt.bindString(24, wellName); } - + String wellType = entity.getWellType(); if (wellType != null) { stmt.bindString(25, wellType); } - + String wellTypeName = entity.getWellTypeName(); if (wellTypeName != null) { stmt.bindString(26, wellTypeName); @@ -377,41 +372,41 @@ @Override public Long readKey(Cursor cursor, int offset) { return cursor.isNull(offset + 0) ? null : cursor.getLong(offset + 0); - } + } @Override public MapWellLocalBean readEntity(Cursor cursor, int offset) { MapWellLocalBean entity = new MapWellLocalBean( // - cursor.isNull(offset + 0) ? null : cursor.getLong(offset + 0), // kId - cursor.isNull(offset + 1) ? null : cursor.getString(offset + 1), // area - cursor.isNull(offset + 2) ? null : cursor.getString(offset + 2), // bfzt - cursor.isNull(offset + 3) ? null : cursor.getString(offset + 3), // bfztName - cursor.isNull(offset + 4) ? null : cursor.getString(offset + 4), // coordinateX - cursor.isNull(offset + 5) ? null : cursor.getString(offset + 5), // coordinateY - cursor.isNull(offset + 6) ? null : cursor.getString(offset + 6), // deep - cursor.isNull(offset + 7) ? null : cursor.getString(offset + 7), // deptName - cursor.isNull(offset + 8) ? null : cursor.getString(offset + 8), // deptid - cursor.isNull(offset + 9) ? null : cursor.getString(offset + 9), // id - cursor.isNull(offset + 10) ? null : cursor.getString(offset + 10), // latBaidu - cursor.isNull(offset + 11) ? null : cursor.getString(offset + 11), // latGaode - cursor.isNull(offset + 12) ? null : cursor.getString(offset + 12), // lngBaidu - cursor.isNull(offset + 13) ? null : cursor.getString(offset + 13), // lngGaode - cursor.isNull(offset + 14) ? null : cursor.getString(offset + 14), // notes - cursor.isNull(offset + 15) ? null : cursor.getString(offset + 15), // photos - cursor.isNull(offset + 16) ? null : cursor.getString(offset + 16), // position - cursor.isNull(offset + 17) ? null : cursor.getString(offset + 17), // staff - cursor.isNull(offset + 18) ? null : cursor.getString(offset + 18), // tel - cursor.isNull(offset + 19) ? null : cursor.getString(offset + 19), // ts - cursor.isNull(offset + 20) ? null : cursor.getString(offset + 20), // valid - cursor.isNull(offset + 21) ? null : cursor.getString(offset + 21), // watchData - cursor.isNull(offset + 22) ? null : cursor.getString(offset + 22), // wellCode - cursor.isNull(offset + 23) ? null : cursor.getString(offset + 23), // wellName - cursor.isNull(offset + 24) ? null : cursor.getString(offset + 24), // wellType - cursor.isNull(offset + 25) ? null : cursor.getString(offset + 25) // wellTypeName + cursor.isNull(offset + 0) ? null : cursor.getLong(offset + 0), // kId + cursor.isNull(offset + 1) ? null : cursor.getString(offset + 1), // area + cursor.isNull(offset + 2) ? null : cursor.getString(offset + 2), // bfzt + cursor.isNull(offset + 3) ? null : cursor.getString(offset + 3), // bfztName + cursor.isNull(offset + 4) ? null : cursor.getString(offset + 4), // coordinateX + cursor.isNull(offset + 5) ? null : cursor.getString(offset + 5), // coordinateY + cursor.isNull(offset + 6) ? null : cursor.getString(offset + 6), // deep + cursor.isNull(offset + 7) ? null : cursor.getString(offset + 7), // deptName + cursor.isNull(offset + 8) ? null : cursor.getString(offset + 8), // deptid + cursor.isNull(offset + 9) ? null : cursor.getString(offset + 9), // id + cursor.isNull(offset + 10) ? null : cursor.getString(offset + 10), // latBaidu + cursor.isNull(offset + 11) ? null : cursor.getString(offset + 11), // latGaode + cursor.isNull(offset + 12) ? null : cursor.getString(offset + 12), // lngBaidu + cursor.isNull(offset + 13) ? null : cursor.getString(offset + 13), // lngGaode + cursor.isNull(offset + 14) ? null : cursor.getString(offset + 14), // notes + cursor.isNull(offset + 15) ? null : cursor.getString(offset + 15), // photos + cursor.isNull(offset + 16) ? null : cursor.getString(offset + 16), // position + cursor.isNull(offset + 17) ? null : cursor.getString(offset + 17), // staff + cursor.isNull(offset + 18) ? null : cursor.getString(offset + 18), // tel + cursor.isNull(offset + 19) ? null : cursor.getString(offset + 19), // ts + cursor.isNull(offset + 20) ? null : cursor.getString(offset + 20), // valid + cursor.isNull(offset + 21) ? null : cursor.getString(offset + 21), // watchData + cursor.isNull(offset + 22) ? null : cursor.getString(offset + 22), // wellCode + cursor.isNull(offset + 23) ? null : cursor.getString(offset + 23), // wellName + cursor.isNull(offset + 24) ? null : cursor.getString(offset + 24), // wellType + cursor.isNull(offset + 25) ? null : cursor.getString(offset + 25) // wellTypeName ); return entity; } - + @Override public void readEntity(Cursor cursor, MapWellLocalBean entity, int offset) { entity.setKId(cursor.isNull(offset + 0) ? null : cursor.getLong(offset + 0)); @@ -440,17 +435,17 @@ entity.setWellName(cursor.isNull(offset + 23) ? null : cursor.getString(offset + 23)); entity.setWellType(cursor.isNull(offset + 24) ? null : cursor.getString(offset + 24)); entity.setWellTypeName(cursor.isNull(offset + 25) ? null : cursor.getString(offset + 25)); - } - + } + @Override protected final Long updateKeyAfterInsert(MapWellLocalBean entity, long rowId) { entity.setKId(rowId); return rowId; } - + @Override public Long getKey(MapWellLocalBean entity) { - if (entity != null) { + if(entity != null) { return entity.getKId(); } else { return null; @@ -466,5 +461,5 @@ protected final boolean isEntityUpdateable() { return true; } - + } diff --git a/app/src/main/java/com/casic/app/smartwell/greendao/NoticeLocaleBeanDao.java b/app/src/main/java/com/casic/app/smartwell/greendao/NoticeLocaleBeanDao.java index 64312ed..deb2d49 100644 --- a/app/src/main/java/com/casic/app/smartwell/greendao/NoticeLocaleBeanDao.java +++ b/app/src/main/java/com/casic/app/smartwell/greendao/NoticeLocaleBeanDao.java @@ -12,10 +12,9 @@ import org.greenrobot.greendao.internal.DaoConfig; // THIS CODE IS GENERATED BY greenDAO, DO NOT EDIT. - -/** +/** * DAO for table "NOTICE_LOCALE_BEAN". - */ +*/ public class NoticeLocaleBeanDao extends AbstractDao { public static final String TABLENAME = "NOTICE_LOCALE_BEAN"; @@ -43,16 +42,14 @@ public NoticeLocaleBeanDao(DaoConfig config) { super(config); } - + public NoticeLocaleBeanDao(DaoConfig config, DaoSession daoSession) { super(config, daoSession); } - /** - * Creates the underlying database table. - */ + /** Creates the underlying database table. */ public static void createTable(Database db, boolean ifNotExists) { - String constraint = ifNotExists ? "IF NOT EXISTS " : ""; + String constraint = ifNotExists? "IF NOT EXISTS ": ""; db.execSQL("CREATE TABLE " + constraint + "\"NOTICE_LOCALE_BEAN\" (" + // "\"_id\" INTEGER PRIMARY KEY AUTOINCREMENT ," + // 0: id "\"MESSAGE_ID\" TEXT UNIQUE ," + // 1: messageId @@ -68,9 +65,7 @@ "\"NOTICE_TIME\" TEXT);"); // 11: noticeTime } - /** - * Drops the underlying database table. - */ + /** Drops the underlying database table. */ public static void dropTable(Database db, boolean ifExists) { String sql = "DROP TABLE " + (ifExists ? "IF EXISTS " : "") + "\"NOTICE_LOCALE_BEAN\""; db.execSQL(sql); @@ -79,62 +74,62 @@ @Override protected final void bindValues(DatabaseStatement stmt, NoticeLocaleBean entity) { stmt.clearBindings(); - + Long id = entity.getId(); if (id != null) { stmt.bindLong(1, id); } - + String messageId = entity.getMessageId(); if (messageId != null) { stmt.bindString(2, messageId); } - + String appid = entity.getAppid(); if (appid != null) { stmt.bindString(3, appid); } - + String clientId = entity.getClientId(); if (clientId != null) { stmt.bindString(4, clientId); } - + String taskId = entity.getTaskId(); if (taskId != null) { stmt.bindString(5, taskId); } - + String userId = entity.getUserId(); if (userId != null) { stmt.bindString(6, userId); } - + String title = entity.getTitle(); if (title != null) { stmt.bindString(7, title); } - + String content = entity.getContent(); if (content != null) { stmt.bindString(8, content); } - + String deviceCode = entity.getDeviceCode(); if (deviceCode != null) { stmt.bindString(9, deviceCode); } - + String jobId = entity.getJobId(); if (jobId != null) { stmt.bindString(10, jobId); } - + String isRead = entity.getIsRead(); if (isRead != null) { stmt.bindString(11, isRead); } - + String noticeTime = entity.getNoticeTime(); if (noticeTime != null) { stmt.bindString(12, noticeTime); @@ -144,62 +139,62 @@ @Override protected final void bindValues(SQLiteStatement stmt, NoticeLocaleBean entity) { stmt.clearBindings(); - + Long id = entity.getId(); if (id != null) { stmt.bindLong(1, id); } - + String messageId = entity.getMessageId(); if (messageId != null) { stmt.bindString(2, messageId); } - + String appid = entity.getAppid(); if (appid != null) { stmt.bindString(3, appid); } - + String clientId = entity.getClientId(); if (clientId != null) { stmt.bindString(4, clientId); } - + String taskId = entity.getTaskId(); if (taskId != null) { stmt.bindString(5, taskId); } - + String userId = entity.getUserId(); if (userId != null) { stmt.bindString(6, userId); } - + String title = entity.getTitle(); if (title != null) { stmt.bindString(7, title); } - + String content = entity.getContent(); if (content != null) { stmt.bindString(8, content); } - + String deviceCode = entity.getDeviceCode(); if (deviceCode != null) { stmt.bindString(9, deviceCode); } - + String jobId = entity.getJobId(); if (jobId != null) { stmt.bindString(10, jobId); } - + String isRead = entity.getIsRead(); if (isRead != null) { stmt.bindString(11, isRead); } - + String noticeTime = entity.getNoticeTime(); if (noticeTime != null) { stmt.bindString(12, noticeTime); @@ -209,27 +204,27 @@ @Override public Long readKey(Cursor cursor, int offset) { return cursor.isNull(offset + 0) ? null : cursor.getLong(offset + 0); - } + } @Override public NoticeLocaleBean readEntity(Cursor cursor, int offset) { NoticeLocaleBean entity = new NoticeLocaleBean( // - cursor.isNull(offset + 0) ? null : cursor.getLong(offset + 0), // id - cursor.isNull(offset + 1) ? null : cursor.getString(offset + 1), // messageId - cursor.isNull(offset + 2) ? null : cursor.getString(offset + 2), // appid - cursor.isNull(offset + 3) ? null : cursor.getString(offset + 3), // clientId - cursor.isNull(offset + 4) ? null : cursor.getString(offset + 4), // taskId - cursor.isNull(offset + 5) ? null : cursor.getString(offset + 5), // userId - cursor.isNull(offset + 6) ? null : cursor.getString(offset + 6), // title - cursor.isNull(offset + 7) ? null : cursor.getString(offset + 7), // content - cursor.isNull(offset + 8) ? null : cursor.getString(offset + 8), // deviceCode - cursor.isNull(offset + 9) ? null : cursor.getString(offset + 9), // jobId - cursor.isNull(offset + 10) ? null : cursor.getString(offset + 10), // isRead - cursor.isNull(offset + 11) ? null : cursor.getString(offset + 11) // noticeTime + cursor.isNull(offset + 0) ? null : cursor.getLong(offset + 0), // id + cursor.isNull(offset + 1) ? null : cursor.getString(offset + 1), // messageId + cursor.isNull(offset + 2) ? null : cursor.getString(offset + 2), // appid + cursor.isNull(offset + 3) ? null : cursor.getString(offset + 3), // clientId + cursor.isNull(offset + 4) ? null : cursor.getString(offset + 4), // taskId + cursor.isNull(offset + 5) ? null : cursor.getString(offset + 5), // userId + cursor.isNull(offset + 6) ? null : cursor.getString(offset + 6), // title + cursor.isNull(offset + 7) ? null : cursor.getString(offset + 7), // content + cursor.isNull(offset + 8) ? null : cursor.getString(offset + 8), // deviceCode + cursor.isNull(offset + 9) ? null : cursor.getString(offset + 9), // jobId + cursor.isNull(offset + 10) ? null : cursor.getString(offset + 10), // isRead + cursor.isNull(offset + 11) ? null : cursor.getString(offset + 11) // noticeTime ); return entity; } - + @Override public void readEntity(Cursor cursor, NoticeLocaleBean entity, int offset) { entity.setId(cursor.isNull(offset + 0) ? null : cursor.getLong(offset + 0)); @@ -244,17 +239,17 @@ entity.setJobId(cursor.isNull(offset + 9) ? null : cursor.getString(offset + 9)); entity.setIsRead(cursor.isNull(offset + 10) ? null : cursor.getString(offset + 10)); entity.setNoticeTime(cursor.isNull(offset + 11) ? null : cursor.getString(offset + 11)); - } - + } + @Override protected final Long updateKeyAfterInsert(NoticeLocaleBean entity, long rowId) { entity.setId(rowId); return rowId; } - + @Override public Long getKey(NoticeLocaleBean entity) { - if (entity != null) { + if(entity != null) { return entity.getId(); } else { return null; @@ -270,5 +265,5 @@ protected final boolean isEntityUpdateable() { return true; } - + } diff --git a/app/src/main/java/com/casic/app/smartwell/greendao/PipeLocalBeanDao.java b/app/src/main/java/com/casic/app/smartwell/greendao/PipeLocalBeanDao.java index aab4d3f..df5515a 100644 --- a/app/src/main/java/com/casic/app/smartwell/greendao/PipeLocalBeanDao.java +++ b/app/src/main/java/com/casic/app/smartwell/greendao/PipeLocalBeanDao.java @@ -12,10 +12,9 @@ import org.greenrobot.greendao.internal.DaoConfig; // THIS CODE IS GENERATED BY greenDAO, DO NOT EDIT. - -/** +/** * DAO for table "PIPE_LOCAL_BEAN". - */ +*/ public class PipeLocalBeanDao extends AbstractDao { public static final String TABLENAME = "PIPE_LOCAL_BEAN"; @@ -37,16 +36,14 @@ public PipeLocalBeanDao(DaoConfig config) { super(config); } - + public PipeLocalBeanDao(DaoConfig config, DaoSession daoSession) { super(config, daoSession); } - /** - * Creates the underlying database table. - */ + /** Creates the underlying database table. */ public static void createTable(Database db, boolean ifNotExists) { - String constraint = ifNotExists ? "IF NOT EXISTS " : ""; + String constraint = ifNotExists? "IF NOT EXISTS ": ""; db.execSQL("CREATE TABLE " + constraint + "\"PIPE_LOCAL_BEAN\" (" + // "\"_id\" INTEGER PRIMARY KEY AUTOINCREMENT ," + // 0: id "\"PIPE_CODE\" TEXT," + // 1: pipeCode @@ -56,9 +53,7 @@ "\"START_LONGITUDE_GD\" TEXT);"); // 5: startLongitudeGd } - /** - * Drops the underlying database table. - */ + /** Drops the underlying database table. */ public static void dropTable(Database db, boolean ifExists) { String sql = "DROP TABLE " + (ifExists ? "IF EXISTS " : "") + "\"PIPE_LOCAL_BEAN\""; db.execSQL(sql); @@ -67,32 +62,32 @@ @Override protected final void bindValues(DatabaseStatement stmt, PipeLocalBean entity) { stmt.clearBindings(); - + Long id = entity.getId(); if (id != null) { stmt.bindLong(1, id); } - + String pipeCode = entity.getPipeCode(); if (pipeCode != null) { stmt.bindString(2, pipeCode); } - + String endLatitudeGd = entity.getEndLatitudeGd(); if (endLatitudeGd != null) { stmt.bindString(3, endLatitudeGd); } - + String endLongitudeGd = entity.getEndLongitudeGd(); if (endLongitudeGd != null) { stmt.bindString(4, endLongitudeGd); } - + String startLatitudeGd = entity.getStartLatitudeGd(); if (startLatitudeGd != null) { stmt.bindString(5, startLatitudeGd); } - + String startLongitudeGd = entity.getStartLongitudeGd(); if (startLongitudeGd != null) { stmt.bindString(6, startLongitudeGd); @@ -102,32 +97,32 @@ @Override protected final void bindValues(SQLiteStatement stmt, PipeLocalBean entity) { stmt.clearBindings(); - + Long id = entity.getId(); if (id != null) { stmt.bindLong(1, id); } - + String pipeCode = entity.getPipeCode(); if (pipeCode != null) { stmt.bindString(2, pipeCode); } - + String endLatitudeGd = entity.getEndLatitudeGd(); if (endLatitudeGd != null) { stmt.bindString(3, endLatitudeGd); } - + String endLongitudeGd = entity.getEndLongitudeGd(); if (endLongitudeGd != null) { stmt.bindString(4, endLongitudeGd); } - + String startLatitudeGd = entity.getStartLatitudeGd(); if (startLatitudeGd != null) { stmt.bindString(5, startLatitudeGd); } - + String startLongitudeGd = entity.getStartLongitudeGd(); if (startLongitudeGd != null) { stmt.bindString(6, startLongitudeGd); @@ -137,21 +132,21 @@ @Override public Long readKey(Cursor cursor, int offset) { return cursor.isNull(offset + 0) ? null : cursor.getLong(offset + 0); - } + } @Override public PipeLocalBean readEntity(Cursor cursor, int offset) { PipeLocalBean entity = new PipeLocalBean( // - cursor.isNull(offset + 0) ? null : cursor.getLong(offset + 0), // id - cursor.isNull(offset + 1) ? null : cursor.getString(offset + 1), // pipeCode - cursor.isNull(offset + 2) ? null : cursor.getString(offset + 2), // endLatitudeGd - cursor.isNull(offset + 3) ? null : cursor.getString(offset + 3), // endLongitudeGd - cursor.isNull(offset + 4) ? null : cursor.getString(offset + 4), // startLatitudeGd - cursor.isNull(offset + 5) ? null : cursor.getString(offset + 5) // startLongitudeGd + cursor.isNull(offset + 0) ? null : cursor.getLong(offset + 0), // id + cursor.isNull(offset + 1) ? null : cursor.getString(offset + 1), // pipeCode + cursor.isNull(offset + 2) ? null : cursor.getString(offset + 2), // endLatitudeGd + cursor.isNull(offset + 3) ? null : cursor.getString(offset + 3), // endLongitudeGd + cursor.isNull(offset + 4) ? null : cursor.getString(offset + 4), // startLatitudeGd + cursor.isNull(offset + 5) ? null : cursor.getString(offset + 5) // startLongitudeGd ); return entity; } - + @Override public void readEntity(Cursor cursor, PipeLocalBean entity, int offset) { entity.setId(cursor.isNull(offset + 0) ? null : cursor.getLong(offset + 0)); @@ -160,17 +155,17 @@ entity.setEndLongitudeGd(cursor.isNull(offset + 3) ? null : cursor.getString(offset + 3)); entity.setStartLatitudeGd(cursor.isNull(offset + 4) ? null : cursor.getString(offset + 4)); entity.setStartLongitudeGd(cursor.isNull(offset + 5) ? null : cursor.getString(offset + 5)); - } - + } + @Override protected final Long updateKeyAfterInsert(PipeLocalBean entity, long rowId) { entity.setId(rowId); return rowId; } - + @Override public Long getKey(PipeLocalBean entity) { - if (entity != null) { + if(entity != null) { return entity.getId(); } else { return null; @@ -186,5 +181,5 @@ protected final boolean isEntityUpdateable() { return true; } - + } diff --git a/app/src/main/java/com/casic/app/smartwell/view/ChangePasswordActivity.kt b/app/src/main/java/com/casic/app/smartwell/view/ChangePasswordActivity.kt index 8e41039..9f1dd40 100644 --- a/app/src/main/java/com/casic/app/smartwell/view/ChangePasswordActivity.kt +++ b/app/src/main/java/com/casic/app/smartwell/view/ChangePasswordActivity.kt @@ -14,7 +14,7 @@ import com.pengxh.kt.lite.extensions.show import com.pengxh.kt.lite.utils.ActivityStackManager import com.pengxh.kt.lite.utils.LoadState -import com.pengxh.kt.lite.utils.LoadingDialogHub +import com.pengxh.kt.lite.utils.LoadingDialog import com.pengxh.kt.lite.widget.TitleBarView import java.nio.charset.StandardCharsets @@ -46,15 +46,15 @@ override fun observeRequestState() { userViewModel.loadState.observe(this) { when (it) { - is LoadState.Loading -> LoadingDialogHub.show(this, "修改中,请稍后") + is LoadState.Loading -> LoadingDialog.show(this, "修改中,请稍后") is LoadState.Success -> { - LoadingDialogHub.dismiss() + LoadingDialog.dismiss() AuthenticationHelper.removeToken() this.navigatePageTo() ActivityStackManager.finishAllActivity() } - else -> LoadingDialogHub.dismiss() + else -> LoadingDialog.dismiss() } } } diff --git a/app/src/main/java/com/casic/app/smartwell/view/DeployedWellActivity.kt b/app/src/main/java/com/casic/app/smartwell/view/DeployedWellActivity.kt index fb4339c..28a5078 100644 --- a/app/src/main/java/com/casic/app/smartwell/view/DeployedWellActivity.kt +++ b/app/src/main/java/com/casic/app/smartwell/view/DeployedWellActivity.kt @@ -83,8 +83,8 @@ } //添加分割线 - binding.deployedListView.addItemDecoration( - RecyclerViewItemOffsets(0, 5, 0, 5) + binding.recyclerView.addItemDecoration( + RecyclerViewItemOffsets(0, 7, 0, 7) ) } @@ -149,12 +149,11 @@ } else { item.deep.toString() + "m" } - viewHolder.setText(R.id.wellNameView, item.wellName) + viewHolder.setText(R.id.wellTypeView, item.wellTypeName) .setText(R.id.wellDepthView, "深:${deep}") .setText(R.id.wellCodeView, "点位编号:${item.wellCode}") - .setText(R.id.wellTypeView, "点位类型:${item.wellTypeName}") .setText(R.id.ownerShipView, "权属单位:${item.deptName}") - .setText(R.id.wellLocationView, "点位置:${item.position}") + .setText(R.id.wellLocationView, "点位位置:${item.position}") .setOnClickListener( R.id.operationButton, object : View.OnClickListener { override fun onClick(v: View?) { @@ -207,7 +206,7 @@ }) } } - binding.deployedListView.adapter = deployAdapter + binding.recyclerView.adapter = deployAdapter deployAdapter.setOnItemClickedListener(object : NormalRecyclerAdapter.OnItemClickedListener { override fun onItemClicked(position: Int, t: WellListModel.DataBean.RowsBean) { diff --git a/app/src/main/java/com/casic/app/smartwell/view/LoginActivity.kt b/app/src/main/java/com/casic/app/smartwell/view/LoginActivity.kt index e4bb0e3..834527b 100644 --- a/app/src/main/java/com/casic/app/smartwell/view/LoginActivity.kt +++ b/app/src/main/java/com/casic/app/smartwell/view/LoginActivity.kt @@ -21,7 +21,7 @@ import com.pengxh.kt.lite.extensions.navigatePageTo import com.pengxh.kt.lite.extensions.readAssetsFile import com.pengxh.kt.lite.extensions.show -import com.pengxh.kt.lite.utils.LoadingDialogHub +import com.pengxh.kt.lite.utils.LoadingDialog import com.pengxh.kt.lite.utils.SaveKeyValues import kotlinx.coroutines.Dispatchers import kotlinx.coroutines.launch @@ -106,11 +106,11 @@ override fun observeRequestState() { authenticateViewModel.loadState.observe(this) { - LoadingDialogHub.show(this, "登录中,请稍后") + LoadingDialog.show(this, "登录中,请稍后") } loginViewModel.loadState.observe(this) { - LoadingDialogHub.dismiss() + LoadingDialog.dismiss() } } diff --git a/app/src/main/java/com/casic/app/smartwell/view/OrderCompletedDetailActivity.kt b/app/src/main/java/com/casic/app/smartwell/view/OrderCompletedDetailActivity.kt index db8ad1f..75cd905 100644 --- a/app/src/main/java/com/casic/app/smartwell/view/OrderCompletedDetailActivity.kt +++ b/app/src/main/java/com/casic/app/smartwell/view/OrderCompletedDetailActivity.kt @@ -17,7 +17,7 @@ import com.pengxh.kt.lite.extensions.show import com.pengxh.kt.lite.utils.Constant import com.pengxh.kt.lite.utils.LoadState -import com.pengxh.kt.lite.utils.LoadingDialogHub +import com.pengxh.kt.lite.utils.LoadingDialog import com.pengxh.kt.lite.widget.TitleBarView import com.pengxh.kt.lite.widget.dialog.AlertMessageDialog @@ -44,7 +44,7 @@ } override fun initOnCreate(savedInstanceState: Bundle?) { - val jobId = intent.getStringExtra(Constant.INTENT_PARAM)!! + val jobId = intent.getStringExtra(Constant.INTENT_PARAM_KEY)!! orderViewModel = ViewModelProvider(this)[OrderViewModel::class.java] orderViewModel.getWorkOrderDetail(jobId) orderViewModel.detailModel.observe(this) { @@ -154,8 +154,8 @@ override fun observeRequestState() { orderViewModel.loadState.observe(this) { when (it) { - is LoadState.Loading -> LoadingDialogHub.show(this, "数据加载中,请稍后") - else -> LoadingDialogHub.dismiss() + is LoadState.Loading -> LoadingDialog.show(this, "数据加载中,请稍后") + else -> LoadingDialog.dismiss() } } } diff --git a/app/src/main/java/com/casic/app/smartwell/view/OrderInHandleDetailActivity.kt b/app/src/main/java/com/casic/app/smartwell/view/OrderInHandleDetailActivity.kt index d70a979..04a7d5d 100644 --- a/app/src/main/java/com/casic/app/smartwell/view/OrderInHandleDetailActivity.kt +++ b/app/src/main/java/com/casic/app/smartwell/view/OrderInHandleDetailActivity.kt @@ -38,7 +38,7 @@ import com.pengxh.kt.lite.extensions.show import com.pengxh.kt.lite.utils.Constant import com.pengxh.kt.lite.utils.LoadState -import com.pengxh.kt.lite.utils.LoadingDialogHub +import com.pengxh.kt.lite.utils.LoadingDialog import com.pengxh.kt.lite.widget.TitleBarView import com.pengxh.kt.lite.widget.dialog.AlertControlDialog import com.pengxh.kt.lite.widget.dialog.AlertMessageDialog @@ -93,7 +93,7 @@ ) binding.addImageRecyclerView.adapter = imageAdapter - val jobId = intent.getStringExtra(Constant.INTENT_PARAM)!!//初始化图片九宫格 + val jobId = intent.getStringExtra(Constant.INTENT_PARAM_KEY)!!//初始化图片九宫格 orderViewModel.getWorkOrderDetail(jobId) orderViewModel.detailModel.observe(this) { if (it.code == 200) { @@ -312,41 +312,41 @@ override fun observeRequestState() { orderViewModel.loadState.observe(this) { when (it) { - is LoadState.Loading -> LoadingDialogHub.show(this, "数据加载中,请稍后") - else -> LoadingDialogHub.dismiss() + is LoadState.Loading -> LoadingDialog.show(this, "数据加载中,请稍后") + else -> LoadingDialog.dismiss() } } uploadImageViewModel.loadState.observe(this) { when (it) { - LoadState.Loading -> LoadingDialogHub.show(this, "图片上传中,请稍后...") - else -> LoadingDialogHub.dismiss() + LoadState.Loading -> LoadingDialog.show(this, "图片上传中,请稍后...") + else -> LoadingDialog.dismiss() } } //转单状态处理 operationViewModel.loadState.observe(this) { when (it) { - is LoadState.Loading -> LoadingDialogHub.show(this, "转单中,请稍后") + is LoadState.Loading -> LoadingDialog.show(this, "转单中,请稍后") is LoadState.Success -> { - LoadingDialogHub.dismiss() + LoadingDialog.dismiss() this.finish() } - else -> LoadingDialogHub.dismiss() + else -> LoadingDialog.dismiss() } } //处理完成工单状态处理 operationViewModel.loadState.observe(this) { when (it) { - is LoadState.Loading -> LoadingDialogHub.show(this, "处理中,请稍后") + is LoadState.Loading -> LoadingDialog.show(this, "处理中,请稍后") is LoadState.Success -> { - LoadingDialogHub.dismiss() + LoadingDialog.dismiss() this.finish() } - else -> LoadingDialogHub.dismiss() + else -> LoadingDialog.dismiss() } } } diff --git a/app/src/main/java/com/casic/app/smartwell/view/OrderNotConfirmedDetailActivity.kt b/app/src/main/java/com/casic/app/smartwell/view/OrderNotConfirmedDetailActivity.kt index 8e036d2..687ec86 100644 --- a/app/src/main/java/com/casic/app/smartwell/view/OrderNotConfirmedDetailActivity.kt +++ b/app/src/main/java/com/casic/app/smartwell/view/OrderNotConfirmedDetailActivity.kt @@ -36,7 +36,7 @@ import com.pengxh.kt.lite.extensions.show import com.pengxh.kt.lite.utils.Constant import com.pengxh.kt.lite.utils.LoadState -import com.pengxh.kt.lite.utils.LoadingDialogHub +import com.pengxh.kt.lite.utils.LoadingDialog import com.pengxh.kt.lite.widget.TitleBarView import com.pengxh.kt.lite.widget.dialog.AlertControlDialog import com.pengxh.kt.lite.widget.dialog.AlertMessageDialog @@ -80,7 +80,7 @@ } override fun initOnCreate(savedInstanceState: Bundle?) { - val jobId = intent.getStringExtra(Constant.INTENT_PARAM)!! + val jobId = intent.getStringExtra(Constant.INTENT_PARAM_KEY)!! //初始化图片九宫格 //左外边距,左内边距,右内边距,右外边距 val viewWidth = getScreenWidth() - (10 + 10 + 10 + 10).dp2px(this) @@ -263,41 +263,41 @@ //数据加载状态处理 orderViewModel.loadState.observe(this) { when (it) { - is LoadState.Loading -> LoadingDialogHub.show(this, "数据加载中,请稍后") - else -> LoadingDialogHub.dismiss() + is LoadState.Loading -> LoadingDialog.show(this, "数据加载中,请稍后") + else -> LoadingDialog.dismiss() } } uploadImageViewModel.loadState.observe(this) { when (it) { - LoadState.Loading -> LoadingDialogHub.show(this, "图片上传中,请稍后") - else -> LoadingDialogHub.dismiss() + LoadState.Loading -> LoadingDialog.show(this, "图片上传中,请稍后") + else -> LoadingDialog.dismiss() } } //转单状态处理 operationViewModel.loadState.observe(this) { when (it) { - is LoadState.Loading -> LoadingDialogHub.show(this, "转单中,请稍后") + is LoadState.Loading -> LoadingDialog.show(this, "转单中,请稍后") is LoadState.Success -> { - LoadingDialogHub.dismiss() + LoadingDialog.dismiss() this.finish() } - else -> LoadingDialogHub.dismiss() + else -> LoadingDialog.dismiss() } } //确认工单状态处理 operationViewModel.loadState.observe(this) { when (it) { - is LoadState.Loading -> LoadingDialogHub.show(this, "处理中,请稍后") + is LoadState.Loading -> LoadingDialog.show(this, "处理中,请稍后") is LoadState.Success -> { - LoadingDialogHub.dismiss() + LoadingDialog.dismiss() this.finish() } - else -> LoadingDialogHub.dismiss() + else -> LoadingDialog.dismiss() } } } diff --git a/app/src/main/java/com/casic/app/smartwell/view/OrderNotProcessedDetailActivity.kt b/app/src/main/java/com/casic/app/smartwell/view/OrderNotProcessedDetailActivity.kt index d3f22dc..0c97a52 100644 --- a/app/src/main/java/com/casic/app/smartwell/view/OrderNotProcessedDetailActivity.kt +++ b/app/src/main/java/com/casic/app/smartwell/view/OrderNotProcessedDetailActivity.kt @@ -18,7 +18,7 @@ import com.pengxh.kt.lite.extensions.show import com.pengxh.kt.lite.utils.Constant import com.pengxh.kt.lite.utils.LoadState -import com.pengxh.kt.lite.utils.LoadingDialogHub +import com.pengxh.kt.lite.utils.LoadingDialog import com.pengxh.kt.lite.widget.TitleBarView import com.pengxh.kt.lite.widget.dialog.AlertControlDialog import com.pengxh.kt.lite.widget.dialog.AlertMessageDialog @@ -50,7 +50,7 @@ } override fun initOnCreate(savedInstanceState: Bundle?) { - this.jobId = intent.getStringExtra(Constant.INTENT_PARAM)!! + this.jobId = intent.getStringExtra(Constant.INTENT_PARAM_KEY)!! orderViewModel = ViewModelProvider(this)[OrderViewModel::class.java] operationViewModel = ViewModelProvider(this)[OperationViewModel::class.java] wellViewModel = ViewModelProvider(this)[WellViewModel::class.java] @@ -162,21 +162,21 @@ //数据加载状态处理 orderViewModel.loadState.observe(this) { when (it) { - is LoadState.Loading -> LoadingDialogHub.show(this, "数据加载中,请稍后") - else -> LoadingDialogHub.dismiss() + is LoadState.Loading -> LoadingDialog.show(this, "数据加载中,请稍后") + else -> LoadingDialog.dismiss() } } //接单状态处理 operationViewModel.loadState.observe(this) { when (it) { - is LoadState.Loading -> LoadingDialogHub.show(this, "接单中,请稍后") + is LoadState.Loading -> LoadingDialog.show(this, "接单中,请稍后") is LoadState.Success -> { - LoadingDialogHub.dismiss() + LoadingDialog.dismiss() this.finish() } - else -> LoadingDialogHub.dismiss() + else -> LoadingDialog.dismiss() } } } diff --git a/app/src/main/java/com/casic/app/smartwell/view/SearchResultActivity.kt b/app/src/main/java/com/casic/app/smartwell/view/SearchResultActivity.kt index 6a92917..4f3a674 100644 --- a/app/src/main/java/com/casic/app/smartwell/view/SearchResultActivity.kt +++ b/app/src/main/java/com/casic/app/smartwell/view/SearchResultActivity.kt @@ -19,7 +19,7 @@ import com.pengxh.kt.lite.extensions.show import com.pengxh.kt.lite.utils.Constant import com.pengxh.kt.lite.utils.LoadState -import com.pengxh.kt.lite.utils.LoadingDialogHub +import com.pengxh.kt.lite.utils.LoadingDialog import com.pengxh.kt.lite.utils.WeakReferenceHandler import com.pengxh.kt.lite.widget.TitleBarView import com.pengxh.kt.lite.widget.dialog.AlertControlDialog @@ -56,7 +56,7 @@ } override fun initOnCreate(savedInstanceState: Bundle?) { - args = intent.getStringArrayListExtra(Constant.INTENT_PARAM)!! + args = intent.getStringArrayListExtra(Constant.INTENT_PARAM_KEY)!! orderViewModel = ViewModelProvider(this)[OrderViewModel::class.java] operationViewModel = ViewModelProvider(this)[OperationViewModel::class.java] @@ -101,24 +101,24 @@ } } - binding.resultRecyclerView.addItemDecoration( - RecyclerViewItemOffsets(0, 5, 0, 5) + binding.recyclerView.addItemDecoration( + RecyclerViewItemOffsets(0, 7, 0, 7) ) } override fun observeRequestState() { orderViewModel.loadState.observe(this) { when (it) { - is LoadState.Loading -> LoadingDialogHub.show(this, "数据加载中,请稍后") - else -> LoadingDialogHub.dismiss() + is LoadState.Loading -> LoadingDialog.show(this, "数据加载中,请稍后") + else -> LoadingDialog.dismiss() } } //接单状态处理 operationViewModel.loadState.observe(this) { when (it) { - is LoadState.Loading -> LoadingDialogHub.show(this, "接单中,请稍后") + is LoadState.Loading -> LoadingDialog.show(this, "接单中,请稍后") is LoadState.Success -> { - LoadingDialogHub.dismiss() + LoadingDialog.dismiss() //接单成功之后刷新列表 dataBeans.removeAt(clickedPosition) searchResultAdapter.notifyItemRemoved(clickedPosition) @@ -127,7 +127,7 @@ ) } - else -> LoadingDialogHub.dismiss() + else -> LoadingDialog.dismiss() } } } @@ -162,7 +162,7 @@ } else { binding.emptyInclude.emptyView.hide() searchResultAdapter = SearchResultAdapter(this, dataBeans) - binding.resultRecyclerView.adapter = searchResultAdapter + binding.recyclerView.adapter = searchResultAdapter searchResultAdapter.setOnItemClickListener(object : SearchResultAdapter.OnItemClickListener { override fun onClicked(position: Int) { diff --git a/app/src/main/java/com/casic/app/smartwell/view/UnDeployWellActivity.kt b/app/src/main/java/com/casic/app/smartwell/view/UnDeployWellActivity.kt index 7f7cd3c..555c278 100644 --- a/app/src/main/java/com/casic/app/smartwell/view/UnDeployWellActivity.kt +++ b/app/src/main/java/com/casic/app/smartwell/view/UnDeployWellActivity.kt @@ -81,8 +81,8 @@ } } - binding.undeployListView.addItemDecoration( - RecyclerViewItemOffsets(0, 5, 0, 5) + binding.recyclerView.addItemDecoration( + RecyclerViewItemOffsets(0, 7, 0, 7) ) } @@ -147,12 +147,11 @@ } else { item.deep.toString() + "m" } - viewHolder.setText(R.id.wellNameView, item.wellName) + viewHolder.setText(R.id.wellTypeView, item.wellTypeName) .setText(R.id.wellDepthView, "深:${deep}") .setText(R.id.wellCodeView, "点位编号:${item.wellCode}") - .setText(R.id.wellTypeView, "点位类型:${item.wellTypeName}") .setText(R.id.ownerShipView, "权属单位:${item.deptName}") - .setText(R.id.wellLocationView, "点位置:${item.position}") + .setText(R.id.wellLocationView, "点位位置:${item.position}") .setOnClickListener( R.id.operationButton, object : View.OnClickListener { override fun onClick(v: View?) { @@ -185,7 +184,7 @@ ) } } - binding.undeployListView.adapter = unDeployAdapter + binding.recyclerView.adapter = unDeployAdapter unDeployAdapter.setOnItemClickedListener(object : NormalRecyclerAdapter.OnItemClickedListener { override fun onItemClicked(position: Int, t: WellListModel.DataBean.RowsBean) { diff --git a/app/src/main/java/com/casic/app/smartwell/view/WellDetailActivity.kt b/app/src/main/java/com/casic/app/smartwell/view/WellDetailActivity.kt index b50d067..eb8b468 100644 --- a/app/src/main/java/com/casic/app/smartwell/view/WellDetailActivity.kt +++ b/app/src/main/java/com/casic/app/smartwell/view/WellDetailActivity.kt @@ -16,7 +16,7 @@ import com.pengxh.kt.lite.extensions.show import com.pengxh.kt.lite.utils.Constant import com.pengxh.kt.lite.utils.LoadState -import com.pengxh.kt.lite.utils.LoadingDialogHub +import com.pengxh.kt.lite.utils.LoadingDialog import com.pengxh.kt.lite.widget.TitleBarView import com.pengxh.kt.lite.widget.dialog.AlertMessageDialog @@ -44,7 +44,7 @@ } override fun initOnCreate(savedInstanceState: Bundle?) { - val wellId = intent.getStringExtra(Constant.INTENT_PARAM)!! + val wellId = intent.getStringExtra(Constant.INTENT_PARAM_KEY)!! wellViewModel = ViewModelProvider(this)[WellViewModel::class.java] wellViewModel.getWellDetail(wellId) wellViewModel.wellDetailModel.observe(this) { @@ -132,8 +132,8 @@ override fun observeRequestState() { wellViewModel.loadState.observe(this) { when (it) { - is LoadState.Loading -> LoadingDialogHub.show(this, "数据加载中,请稍后") - else -> LoadingDialogHub.dismiss() + is LoadState.Loading -> LoadingDialog.show(this, "数据加载中,请稍后") + else -> LoadingDialog.dismiss() } } } diff --git a/app/src/main/java/com/casic/app/smartwell/view/WellManagementActivity.kt b/app/src/main/java/com/casic/app/smartwell/view/WellManagementActivity.kt index 084da95..457096b 100644 --- a/app/src/main/java/com/casic/app/smartwell/view/WellManagementActivity.kt +++ b/app/src/main/java/com/casic/app/smartwell/view/WellManagementActivity.kt @@ -94,8 +94,8 @@ } } - binding.wellListView.addItemDecoration( - RecyclerViewItemOffsets(0, 5, 0, 5) + binding.recyclerView.addItemDecoration( + RecyclerViewItemOffsets(0, 7, 0, 7) ) } @@ -175,13 +175,12 @@ } else { item.deep.toString() + "m" } - viewHolder.setText(R.id.wellNameView, item.wellName) + viewHolder.setText(R.id.wellTypeView, item.wellTypeName) .setText(R.id.wellStateView, "已${item.bfztName}") .setText(R.id.wellDepthView, "深:${deep}") .setText(R.id.wellCodeView, "点位编号:${item.wellCode}") - .setText(R.id.wellTypeView, "点位类型:${item.wellTypeName}") .setText(R.id.ownerShipView, "权属单位:${item.deptName}") - .setText(R.id.wellLocationView, "点位置:${item.position}") + .setText(R.id.wellLocationView, "点位位置:${item.position}") .setOnClickListener( R.id.navigationButton, object : View.OnClickListener { override fun onClick(v: View?) { @@ -200,7 +199,7 @@ ) } } - binding.wellListView.adapter = wellListAdapter + binding.recyclerView.adapter = wellListAdapter wellListAdapter.setOnItemClickedListener(object : NormalRecyclerAdapter.OnItemClickedListener { override fun onItemClicked(position: Int, t: WellListModel.DataBean.RowsBean) { diff --git a/app/src/main/java/com/casic/app/smartwell/view/WellMonitorActivity.kt b/app/src/main/java/com/casic/app/smartwell/view/WellMonitorActivity.kt index e3573eb..b87bdb7 100644 --- a/app/src/main/java/com/casic/app/smartwell/view/WellMonitorActivity.kt +++ b/app/src/main/java/com/casic/app/smartwell/view/WellMonitorActivity.kt @@ -11,7 +11,7 @@ import com.pengxh.kt.lite.base.KotlinBaseActivity import com.pengxh.kt.lite.utils.Constant import com.pengxh.kt.lite.utils.LoadState -import com.pengxh.kt.lite.utils.LoadingDialogHub +import com.pengxh.kt.lite.utils.LoadingDialog import com.pengxh.kt.lite.widget.TitleBarView class WellMonitorActivity : KotlinBaseActivity() { @@ -36,7 +36,7 @@ } override fun initOnCreate(savedInstanceState: Bundle?) { - val wellId = intent.getStringExtra(Constant.INTENT_PARAM)!! + val wellId = intent.getStringExtra(Constant.INTENT_PARAM_KEY)!! wellViewModel = ViewModelProvider(this)[WellViewModel::class.java] wellViewModel.getMonitorResult(wellId) wellViewModel.monitorModel.observe(this) { @@ -56,8 +56,8 @@ override fun observeRequestState() { wellViewModel.loadState.observe(this) { when (it) { - is LoadState.Loading -> LoadingDialogHub.show(this, "数据加载中,请稍后") - else -> LoadingDialogHub.dismiss() + is LoadState.Loading -> LoadingDialog.show(this, "数据加载中,请稍后") + else -> LoadingDialog.dismiss() } } } diff --git a/app/src/main/java/com/casic/app/smartwell/view/WellOperationActivity.kt b/app/src/main/java/com/casic/app/smartwell/view/WellOperationActivity.kt index 8d333bf..347ebb6 100644 --- a/app/src/main/java/com/casic/app/smartwell/view/WellOperationActivity.kt +++ b/app/src/main/java/com/casic/app/smartwell/view/WellOperationActivity.kt @@ -23,7 +23,7 @@ import com.pengxh.kt.lite.extensions.navigatePageTo import com.pengxh.kt.lite.extensions.show import com.pengxh.kt.lite.utils.LoadState -import com.pengxh.kt.lite.utils.LoadingDialogHub +import com.pengxh.kt.lite.utils.LoadingDialog import com.pengxh.kt.lite.utils.WeakReferenceHandler import com.pengxh.kt.lite.widget.dialog.AlertControlDialog @@ -109,8 +109,8 @@ } } - binding.operationListView.addItemDecoration( - RecyclerViewItemOffsets(0, 5, 0, 5) + binding.recyclerView.addItemDecoration( + RecyclerViewItemOffsets(0, 7, 0, 7) ) } @@ -123,13 +123,13 @@ override fun observeRequestState() { wellViewModel.loadState.observe(this) { when (it) { - is LoadState.Loading -> LoadingDialogHub.show(this, "处理中,请稍后") + is LoadState.Loading -> LoadingDialog.show(this, "处理中,请稍后") is LoadState.Success -> { - LoadingDialogHub.dismiss() + LoadingDialog.dismiss() wellOperationAdapter.notifyItemChanged(clickedPosition) } - else -> LoadingDialogHub.dismiss() + else -> LoadingDialog.dismiss() } } } @@ -203,24 +203,23 @@ if (item.bfztName == "布防") { viewHolder.setImageResource( R.id.wellStateView, R.drawable.bg_solid_text_green_radius_5 - ).setText(R.id.wellStateView, "撤防") + ).setText(R.id.operationButton, "撤防") } else { viewHolder.setImageResource( R.id.wellStateView, R.drawable.bg_solid_text_red_radius_5 - ).setText(R.id.wellStateView, "布防") + ).setText(R.id.operationButton, "布防") } val deep = if (item.deep.toString().isBlank()) { "未知" } else { item.deep.toString() + "m" } - viewHolder.setText(R.id.wellNameView, item.wellName) + viewHolder.setText(R.id.wellTypeView, item.wellTypeName) .setText(R.id.wellStateView, "已${item.bfztName}") .setText(R.id.wellDepthView, "深:${deep}") .setText(R.id.wellCodeView, "点位编号:${item.wellCode}") - .setText(R.id.wellTypeView, "点位类型:${item.wellTypeName}") .setText(R.id.ownerShipView, "权属单位:${item.deptName}") - .setText(R.id.wellLocationView, "点位置:${item.position}") + .setText(R.id.wellLocationView, "点位位置:${item.position}") .setOnClickListener( R.id.operationButton, object : View.OnClickListener { override fun onClick(v: View?) { @@ -280,7 +279,7 @@ ) } } - binding.operationListView.adapter = wellOperationAdapter + binding.recyclerView.adapter = wellOperationAdapter wellOperationAdapter.setOnItemClickedListener(object : NormalRecyclerAdapter.OnItemClickedListener { override fun onItemClicked(position: Int, t: WellListModel.DataBean.RowsBean) { diff --git a/app/build.gradle b/app/build.gradle index 296fb6f..c18c251 100644 --- a/app/build.gradle +++ b/app/build.gradle @@ -40,10 +40,6 @@ // VIVO 相关应用参数 VIVO_APP_ID : "105749048", VIVO_APP_KEY : "e460fbf2c689e0f8c58ecc6aa62e1803", - - // 小米相关应用参数 -// XIAOMI_APP_ID : "", -// XIAOMI_APP_KEY : "", ] // 版本名后面添加一句话,意思就是flavor dimension 它的维度就是该版本号,多渠道打包很重要 @@ -107,7 +103,7 @@ dependencies { implementation fileTree(dir: 'libs', include: ['*.jar']) //基础依赖库 - implementation 'com.github.AndroidCoderPeng:Kotlin-lite-lib:1.0.10' + implementation 'com.github.AndroidCoderPeng:Kotlin-lite-lib:1.1.0' implementation 'androidx.appcompat:appcompat:1.6.1' implementation 'androidx.core:core-ktx:1.9.0' implementation 'androidx.constraintlayout:constraintlayout:2.1.4' @@ -165,8 +161,6 @@ implementation 'commons-codec:commons-codec:1.15' implementation 'com.android.support:support-annotations:28.0.0' implementation 'com.assist-v3:vivo:3.1.2' // vivo -// implementation 'com.getui.opt:xmp:3.3.1' // 小米 - //数据库框架 implementation 'org.greenrobot:greendao:3.3.0' //数据库升级 diff --git a/app/src/main/AndroidManifest.xml b/app/src/main/AndroidManifest.xml index c0af158..e0519bf 100644 --- a/app/src/main/AndroidManifest.xml +++ b/app/src/main/AndroidManifest.xml @@ -90,10 +90,10 @@ - + + android:value="ee96d8b5e12de3fbb29949efd57418a8" /> () @@ -150,7 +158,7 @@ val cameraPosition = CameraPosition(centerLatLng, 14f, 0f, 0f) val cameraUpdate = CameraUpdateFactory.newCameraPosition(cameraPosition) withContext(Dispatchers.Main) { - LoadingDialogHub.dismiss() + LoadingDialog.dismiss() aMap.animateCamera(cameraUpdate, 1500, null) } } @@ -239,11 +247,6 @@ } override fun initEvent() { - binding.rightOptionView.setOnClickListener { - val x = binding.rightOptionView.width - easyPopupWindow.width - easyPopupWindow.showAsDropDown(binding.rightOptionView, x, 0) - } - //撤防点位 binding.unDeployedLayout.setOnClickListener { requireContext().navigatePageTo() @@ -263,11 +266,11 @@ override fun observeRequestState() { wellViewModel.loadState.observe(this) { when (it) { - is LoadState.Loading -> LoadingDialogHub.show( + is LoadState.Loading -> LoadingDialog.show( requireActivity(), "数据加载中,请稍后..." ) - else -> LoadingDialogHub.dismiss() + else -> LoadingDialog.dismiss() } } } @@ -376,7 +379,7 @@ }).build().show() } }) - infoPopup.showAsDropDown(binding.rightOptionView) +// infoPopup.showAsDropDown(binding.rightOptionView) } override fun onCameraChange(p0: CameraPosition?) { diff --git a/app/src/main/java/com/casic/app/smartwell/fragment/HomePageNoClusterFragment.kt b/app/src/main/java/com/casic/app/smartwell/fragment/HomePageNoClusterFragment.kt index 802426a..b25f743 100644 --- a/app/src/main/java/com/casic/app/smartwell/fragment/HomePageNoClusterFragment.kt +++ b/app/src/main/java/com/casic/app/smartwell/fragment/HomePageNoClusterFragment.kt @@ -38,8 +38,9 @@ import com.pengxh.kt.lite.extensions.navigatePageTo import com.pengxh.kt.lite.extensions.show import com.pengxh.kt.lite.utils.LoadState -import com.pengxh.kt.lite.utils.LoadingDialogHub +import com.pengxh.kt.lite.utils.LoadingDialog import com.pengxh.kt.lite.widget.EasyPopupWindow +import com.pengxh.kt.lite.widget.TitleBarView import com.pengxh.kt.lite.widget.dialog.AlertControlDialog import kotlinx.coroutines.Dispatchers import kotlinx.coroutines.launch @@ -78,7 +79,15 @@ override fun setupTopBarLayout() { binding.rootView.initImmersionBar(this, false, R.color.mainThemeColor) - binding.titleView.text = "首页" + binding.titleView.setOnClickListener(object : TitleBarView.OnClickListener { + override fun onLeftClick() { + + } + + override fun onRightClick() { + easyPopupWindow.showAsDropDown(binding.titleView, binding.titleView.width, 0) + } + }) } override fun initOnCreate(savedInstanceState: Bundle?) { @@ -112,7 +121,7 @@ //渲染井位置 lifecycleScope.launch(Dispatchers.Main) { - LoadingDialogHub.show(requireActivity(), "数据加载中,请稍后") + LoadingDialog.show(requireActivity(), "数据加载中,请稍后") withContext(Dispatchers.IO) { //取Well缓存 val allMarkerOptions = ArrayList() @@ -144,7 +153,7 @@ val cameraPosition = CameraPosition(centerLatLng, 14f, 0f, 0f) val cameraUpdate = CameraUpdateFactory.newCameraPosition(cameraPosition) withContext(Dispatchers.Main) { - LoadingDialogHub.dismiss() + LoadingDialog.dismiss() aMap.animateCamera(cameraUpdate, 1500, null) } } @@ -238,11 +247,6 @@ } override fun initEvent() { - binding.rightOptionView.setOnClickListener { - val x = binding.rightOptionView.width - easyPopupWindow.width - easyPopupWindow.showAsDropDown(binding.rightOptionView, x, 0) - } - //撤防点位 binding.unDeployedLayout.setOnClickListener { requireContext().navigatePageTo() @@ -262,11 +266,11 @@ override fun observeRequestState() { wellViewModel.loadState.observe(this) { when (it) { - is LoadState.Loading -> LoadingDialogHub.show( + is LoadState.Loading -> LoadingDialog.show( requireActivity(), "数据加载中,请稍后..." ) - else -> LoadingDialogHub.dismiss() + else -> LoadingDialog.dismiss() } } } diff --git a/app/src/main/java/com/casic/app/smartwell/fragment/MinePageFragment.kt b/app/src/main/java/com/casic/app/smartwell/fragment/MinePageFragment.kt index 09a570c..dcb48f8 100644 --- a/app/src/main/java/com/casic/app/smartwell/fragment/MinePageFragment.kt +++ b/app/src/main/java/com/casic/app/smartwell/fragment/MinePageFragment.kt @@ -35,7 +35,7 @@ import com.pengxh.kt.lite.utils.ActivityStackManager import com.pengxh.kt.lite.utils.FileDownloadManager import com.pengxh.kt.lite.utils.LoadState -import com.pengxh.kt.lite.utils.LoadingDialogHub +import com.pengxh.kt.lite.utils.LoadingDialog import com.pengxh.kt.lite.widget.dialog.AlertControlDialog import com.pengxh.kt.lite.widget.dialog.BottomActionSheet import kotlinx.coroutines.Dispatchers @@ -60,7 +60,6 @@ override fun setupTopBarLayout() { binding.rootView.initImmersionBar(this, false, R.color.mainThemeColor) - binding.titleInclude.titleView.text = "我的" } override fun initOnCreate(savedInstanceState: Bundle?) { @@ -155,27 +154,27 @@ override fun observeRequestState() { userViewModel.loadState.observe(this) { when (it) { - is LoadState.Loading -> LoadingDialogHub.show( + is LoadState.Loading -> LoadingDialog.show( requireActivity(), "检查版本中,请稍后" ) - else -> LoadingDialogHub.dismiss() + else -> LoadingDialog.dismiss() } } wellViewModel.loadState.observe(this) { when (it) { - is LoadState.Loading -> LoadingDialogHub.show( + is LoadState.Loading -> LoadingDialog.show( requireActivity(), "数据更新中,请稍后" ) is LoadState.Fail -> { - LoadingDialogHub.dismiss() + LoadingDialog.dismiss() "数据更新超时".show(requireContext()) } else -> { - LoadingDialogHub.dismiss() + LoadingDialog.dismiss() AlertControlDialog.Builder().setContext(requireContext()).setTitle("温馨提示") .setMessage("数据更新成功,请重启应用").setNegativeButton("取消") .setPositiveButton("确定").setOnDialogButtonClickListener(object : @@ -197,17 +196,17 @@ lineViewModel.loadState.observe(this) { when (it) { - is LoadState.Loading -> LoadingDialogHub.show( + is LoadState.Loading -> LoadingDialog.show( requireActivity(), "数据更新中,请稍后" ) is LoadState.Fail -> { - LoadingDialogHub.dismiss() + LoadingDialog.dismiss() "数据更新超时".show(requireContext()) } else -> { - LoadingDialogHub.dismiss() + LoadingDialog.dismiss() AlertControlDialog.Builder().setContext(requireContext()).setTitle("温馨提示") .setMessage("数据更新成功,请重启应用").setNegativeButton("取消") .setPositiveButton("确定").setOnDialogButtonClickListener(object : diff --git a/app/src/main/java/com/casic/app/smartwell/fragment/NoticePageFragment.kt b/app/src/main/java/com/casic/app/smartwell/fragment/NoticePageFragment.kt index 171b555..3c93f54 100644 --- a/app/src/main/java/com/casic/app/smartwell/fragment/NoticePageFragment.kt +++ b/app/src/main/java/com/casic/app/smartwell/fragment/NoticePageFragment.kt @@ -48,7 +48,6 @@ override fun setupTopBarLayout() { binding.rootView.initImmersionBar(this, false, R.color.mainThemeColor) - binding.titleInclude.titleView.text = "消息" } override fun initOnCreate(savedInstanceState: Bundle?) { diff --git a/app/src/main/java/com/casic/app/smartwell/fragment/OrderListFragment.kt b/app/src/main/java/com/casic/app/smartwell/fragment/OrderListFragment.kt index 93ff35b..5e38acb 100644 --- a/app/src/main/java/com/casic/app/smartwell/fragment/OrderListFragment.kt +++ b/app/src/main/java/com/casic/app/smartwell/fragment/OrderListFragment.kt @@ -12,6 +12,7 @@ import com.casic.app.smartwell.view.SearchOrderActivity import com.pengxh.kt.lite.base.KotlinBaseFragment import com.pengxh.kt.lite.extensions.navigatePageTo +import com.pengxh.kt.lite.widget.TitleBarView class OrderListFragment : KotlinBaseFragment() { @@ -25,15 +26,22 @@ } override fun initViewBinding( - inflater: LayoutInflater, - container: ViewGroup? + inflater: LayoutInflater, container: ViewGroup? ): FragmentOrderBinding { return FragmentOrderBinding.inflate(inflater, container, false) } override fun setupTopBarLayout() { binding.rootView.initImmersionBar(this, false, R.color.mainThemeColor) - binding.titleView.text = "工单" + binding.titleView.setOnClickListener(object : TitleBarView.OnClickListener { + override fun onLeftClick() { + + } + + override fun onRightClick() { + requireContext().navigatePageTo() + } + }) } override fun initOnCreate(savedInstanceState: Bundle?) { @@ -51,8 +59,6 @@ } override fun initEvent() { - binding.rightOptionView.setOnClickListener { - requireContext().navigatePageTo() - } + } } \ No newline at end of file diff --git a/app/src/main/java/com/casic/app/smartwell/fragment/OrderNotProcessedFragment.kt b/app/src/main/java/com/casic/app/smartwell/fragment/OrderNotProcessedFragment.kt index 0b3d09d..2b6f21d 100644 --- a/app/src/main/java/com/casic/app/smartwell/fragment/OrderNotProcessedFragment.kt +++ b/app/src/main/java/com/casic/app/smartwell/fragment/OrderNotProcessedFragment.kt @@ -18,7 +18,7 @@ import com.pengxh.kt.lite.extensions.navigatePageTo import com.pengxh.kt.lite.extensions.show import com.pengxh.kt.lite.utils.LoadState -import com.pengxh.kt.lite.utils.LoadingDialogHub +import com.pengxh.kt.lite.utils.LoadingDialog import com.pengxh.kt.lite.utils.WeakReferenceHandler import com.pengxh.kt.lite.widget.dialog.AlertControlDialog @@ -78,8 +78,8 @@ operationViewModel = ViewModelProvider(this)[OperationViewModel::class.java] - binding.notProcessedView.addItemDecoration( - RecyclerViewItemOffsets(0, 5, 0, 5) + binding.recyclerView.addItemDecoration( + RecyclerViewItemOffsets(0, 7, 0, 7) ) } @@ -87,9 +87,9 @@ //接单状态处理 operationViewModel.loadState.observe(this) { when (it) { - is LoadState.Loading -> LoadingDialogHub.show(requireActivity(), "接单中,请稍后") + is LoadState.Loading -> LoadingDialog.show(requireActivity(), "接单中,请稍后") is LoadState.Success -> { - LoadingDialogHub.dismiss() + LoadingDialog.dismiss() //接单成功之后刷新列表 dataBeans.removeAt(clickedPosition) notProcessedAdapter.notifyItemRemoved(clickedPosition) @@ -98,7 +98,7 @@ ) } - else -> LoadingDialogHub.dismiss() + else -> LoadingDialog.dismiss() } } } @@ -131,7 +131,7 @@ } else { binding.emptyInclude.emptyView.hide() notProcessedAdapter = OrderNotProcessedAdapter(requireContext(), dataBeans) - binding.notProcessedView.adapter = notProcessedAdapter + binding.recyclerView.adapter = notProcessedAdapter notProcessedAdapter.setOnItemClickListener(object : OrderNotProcessedAdapter.OnItemClickListener { override fun onClicked(position: Int) { diff --git a/app/src/main/java/com/casic/app/smartwell/fragment/OvertimeNotAcceptFragment.kt b/app/src/main/java/com/casic/app/smartwell/fragment/OvertimeNotAcceptFragment.kt index a198545..9b318ca 100644 --- a/app/src/main/java/com/casic/app/smartwell/fragment/OvertimeNotAcceptFragment.kt +++ b/app/src/main/java/com/casic/app/smartwell/fragment/OvertimeNotAcceptFragment.kt @@ -18,7 +18,7 @@ import com.pengxh.kt.lite.extensions.navigatePageTo import com.pengxh.kt.lite.extensions.show import com.pengxh.kt.lite.utils.LoadState -import com.pengxh.kt.lite.utils.LoadingDialogHub +import com.pengxh.kt.lite.utils.LoadingDialog import com.pengxh.kt.lite.utils.WeakReferenceHandler import com.pengxh.kt.lite.widget.dialog.AlertControlDialog @@ -81,8 +81,8 @@ operationViewModel = ViewModelProvider(this)[OperationViewModel::class.java] - binding.notProcessedView.addItemDecoration( - RecyclerViewItemOffsets(0, 5, 0, 5) + binding.recyclerView.addItemDecoration( + RecyclerViewItemOffsets(0, 7, 0, 7) ) } @@ -90,9 +90,9 @@ //接单状态处理 operationViewModel.loadState.observe(this) { when (it) { - is LoadState.Loading -> LoadingDialogHub.show(requireActivity(), "接单中,请稍后") + is LoadState.Loading -> LoadingDialog.show(requireActivity(), "接单中,请稍后") is LoadState.Success -> { - LoadingDialogHub.dismiss() + LoadingDialog.dismiss() //接单成功之后刷新列表 dataBeans.removeAt(clickedPosition) notProcessedAdapter.notifyItemRemoved(clickedPosition) @@ -101,7 +101,7 @@ ) } - else -> LoadingDialogHub.dismiss() + else -> LoadingDialog.dismiss() } } } @@ -134,7 +134,7 @@ } else { binding.emptyInclude.emptyView.hide() notProcessedAdapter = OrderNotProcessedAdapter(requireContext(), dataBeans) - binding.notProcessedView.adapter = notProcessedAdapter + binding.recyclerView.adapter = notProcessedAdapter notProcessedAdapter.setOnItemClickListener(object : OrderNotProcessedAdapter.OnItemClickListener { override fun onClicked(position: Int) { diff --git a/app/src/main/java/com/casic/app/smartwell/greendao/DaoMaster.java b/app/src/main/java/com/casic/app/smartwell/greendao/DaoMaster.java index fdcf3a7..1e52b74 100644 --- a/app/src/main/java/com/casic/app/smartwell/greendao/DaoMaster.java +++ b/app/src/main/java/com/casic/app/smartwell/greendao/DaoMaster.java @@ -13,25 +13,20 @@ // THIS CODE IS GENERATED BY greenDAO, DO NOT EDIT. - /** * Master of DAO (schema version 4): knows all DAOs. */ public class DaoMaster extends AbstractDaoMaster { public static final int SCHEMA_VERSION = 4; - /** - * Creates underlying database table using DAOs. - */ + /** Creates underlying database table using DAOs. */ public static void createAllTables(Database db, boolean ifNotExists) { MapWellLocalBeanDao.createTable(db, ifNotExists); NoticeLocaleBeanDao.createTable(db, ifNotExists); PipeLocalBeanDao.createTable(db, ifNotExists); } - /** - * Drops underlying database table using DAOs. - */ + /** Drops underlying database table using DAOs. */ public static void dropAllTables(Database db, boolean ifExists) { MapWellLocalBeanDao.dropTable(db, ifExists); NoticeLocaleBeanDao.dropTable(db, ifExists); @@ -86,9 +81,7 @@ } } - /** - * WARNING: Drops all table on Upgrade! Use only during development. - */ + /** WARNING: Drops all table on Upgrade! Use only during development. */ public static class DevOpenHelper extends OpenHelper { public DevOpenHelper(Context context, String name) { super(context, name); diff --git a/app/src/main/java/com/casic/app/smartwell/greendao/DaoSession.java b/app/src/main/java/com/casic/app/smartwell/greendao/DaoSession.java index 0b36d17..3e40e3b 100644 --- a/app/src/main/java/com/casic/app/smartwell/greendao/DaoSession.java +++ b/app/src/main/java/com/casic/app/smartwell/greendao/DaoSession.java @@ -16,7 +16,7 @@ /** * {@inheritDoc} - * + * * @see org.greenrobot.greendao.AbstractDaoSession */ public class DaoSession extends AbstractDaoSession { @@ -50,7 +50,7 @@ registerDao(NoticeLocaleBean.class, noticeLocaleBeanDao); registerDao(PipeLocalBean.class, pipeLocalBeanDao); } - + public void clear() { mapWellLocalBeanDaoConfig.clearIdentityScope(); noticeLocaleBeanDaoConfig.clearIdentityScope(); diff --git a/app/src/main/java/com/casic/app/smartwell/greendao/MapWellLocalBeanDao.java b/app/src/main/java/com/casic/app/smartwell/greendao/MapWellLocalBeanDao.java index 8908fda..407bc92 100644 --- a/app/src/main/java/com/casic/app/smartwell/greendao/MapWellLocalBeanDao.java +++ b/app/src/main/java/com/casic/app/smartwell/greendao/MapWellLocalBeanDao.java @@ -12,10 +12,9 @@ import org.greenrobot.greendao.internal.DaoConfig; // THIS CODE IS GENERATED BY greenDAO, DO NOT EDIT. - -/** +/** * DAO for table "MAP_WELL_LOCAL_BEAN". - */ +*/ public class MapWellLocalBeanDao extends AbstractDao { public static final String TABLENAME = "MAP_WELL_LOCAL_BEAN"; @@ -57,16 +56,14 @@ public MapWellLocalBeanDao(DaoConfig config) { super(config); } - + public MapWellLocalBeanDao(DaoConfig config, DaoSession daoSession) { super(config, daoSession); } - /** - * Creates the underlying database table. - */ + /** Creates the underlying database table. */ public static void createTable(Database db, boolean ifNotExists) { - String constraint = ifNotExists ? "IF NOT EXISTS " : ""; + String constraint = ifNotExists? "IF NOT EXISTS ": ""; db.execSQL("CREATE TABLE " + constraint + "\"MAP_WELL_LOCAL_BEAN\" (" + // "\"_id\" INTEGER PRIMARY KEY AUTOINCREMENT ," + // 0: kId "\"AREA\" TEXT," + // 1: area @@ -96,9 +93,7 @@ "\"WELL_TYPE_NAME\" TEXT);"); // 25: wellTypeName } - /** - * Drops the underlying database table. - */ + /** Drops the underlying database table. */ public static void dropTable(Database db, boolean ifExists) { String sql = "DROP TABLE " + (ifExists ? "IF EXISTS " : "") + "\"MAP_WELL_LOCAL_BEAN\""; db.execSQL(sql); @@ -107,132 +102,132 @@ @Override protected final void bindValues(DatabaseStatement stmt, MapWellLocalBean entity) { stmt.clearBindings(); - + Long kId = entity.getKId(); if (kId != null) { stmt.bindLong(1, kId); } - + String area = entity.getArea(); if (area != null) { stmt.bindString(2, area); } - + String bfzt = entity.getBfzt(); if (bfzt != null) { stmt.bindString(3, bfzt); } - + String bfztName = entity.getBfztName(); if (bfztName != null) { stmt.bindString(4, bfztName); } - + String coordinateX = entity.getCoordinateX(); if (coordinateX != null) { stmt.bindString(5, coordinateX); } - + String coordinateY = entity.getCoordinateY(); if (coordinateY != null) { stmt.bindString(6, coordinateY); } - + String deep = entity.getDeep(); if (deep != null) { stmt.bindString(7, deep); } - + String deptName = entity.getDeptName(); if (deptName != null) { stmt.bindString(8, deptName); } - + String deptid = entity.getDeptid(); if (deptid != null) { stmt.bindString(9, deptid); } - + String id = entity.getId(); if (id != null) { stmt.bindString(10, id); } - + String latBaidu = entity.getLatBaidu(); if (latBaidu != null) { stmt.bindString(11, latBaidu); } - + String latGaode = entity.getLatGaode(); if (latGaode != null) { stmt.bindString(12, latGaode); } - + String lngBaidu = entity.getLngBaidu(); if (lngBaidu != null) { stmt.bindString(13, lngBaidu); } - + String lngGaode = entity.getLngGaode(); if (lngGaode != null) { stmt.bindString(14, lngGaode); } - + String notes = entity.getNotes(); if (notes != null) { stmt.bindString(15, notes); } - + String photos = entity.getPhotos(); if (photos != null) { stmt.bindString(16, photos); } - + String position = entity.getPosition(); if (position != null) { stmt.bindString(17, position); } - + String staff = entity.getStaff(); if (staff != null) { stmt.bindString(18, staff); } - + String tel = entity.getTel(); if (tel != null) { stmt.bindString(19, tel); } - + String ts = entity.getTs(); if (ts != null) { stmt.bindString(20, ts); } - + String valid = entity.getValid(); if (valid != null) { stmt.bindString(21, valid); } - + String watchData = entity.getWatchData(); if (watchData != null) { stmt.bindString(22, watchData); } - + String wellCode = entity.getWellCode(); if (wellCode != null) { stmt.bindString(23, wellCode); } - + String wellName = entity.getWellName(); if (wellName != null) { stmt.bindString(24, wellName); } - + String wellType = entity.getWellType(); if (wellType != null) { stmt.bindString(25, wellType); } - + String wellTypeName = entity.getWellTypeName(); if (wellTypeName != null) { stmt.bindString(26, wellTypeName); @@ -242,132 +237,132 @@ @Override protected final void bindValues(SQLiteStatement stmt, MapWellLocalBean entity) { stmt.clearBindings(); - + Long kId = entity.getKId(); if (kId != null) { stmt.bindLong(1, kId); } - + String area = entity.getArea(); if (area != null) { stmt.bindString(2, area); } - + String bfzt = entity.getBfzt(); if (bfzt != null) { stmt.bindString(3, bfzt); } - + String bfztName = entity.getBfztName(); if (bfztName != null) { stmt.bindString(4, bfztName); } - + String coordinateX = entity.getCoordinateX(); if (coordinateX != null) { stmt.bindString(5, coordinateX); } - + String coordinateY = entity.getCoordinateY(); if (coordinateY != null) { stmt.bindString(6, coordinateY); } - + String deep = entity.getDeep(); if (deep != null) { stmt.bindString(7, deep); } - + String deptName = entity.getDeptName(); if (deptName != null) { stmt.bindString(8, deptName); } - + String deptid = entity.getDeptid(); if (deptid != null) { stmt.bindString(9, deptid); } - + String id = entity.getId(); if (id != null) { stmt.bindString(10, id); } - + String latBaidu = entity.getLatBaidu(); if (latBaidu != null) { stmt.bindString(11, latBaidu); } - + String latGaode = entity.getLatGaode(); if (latGaode != null) { stmt.bindString(12, latGaode); } - + String lngBaidu = entity.getLngBaidu(); if (lngBaidu != null) { stmt.bindString(13, lngBaidu); } - + String lngGaode = entity.getLngGaode(); if (lngGaode != null) { stmt.bindString(14, lngGaode); } - + String notes = entity.getNotes(); if (notes != null) { stmt.bindString(15, notes); } - + String photos = entity.getPhotos(); if (photos != null) { stmt.bindString(16, photos); } - + String position = entity.getPosition(); if (position != null) { stmt.bindString(17, position); } - + String staff = entity.getStaff(); if (staff != null) { stmt.bindString(18, staff); } - + String tel = entity.getTel(); if (tel != null) { stmt.bindString(19, tel); } - + String ts = entity.getTs(); if (ts != null) { stmt.bindString(20, ts); } - + String valid = entity.getValid(); if (valid != null) { stmt.bindString(21, valid); } - + String watchData = entity.getWatchData(); if (watchData != null) { stmt.bindString(22, watchData); } - + String wellCode = entity.getWellCode(); if (wellCode != null) { stmt.bindString(23, wellCode); } - + String wellName = entity.getWellName(); if (wellName != null) { stmt.bindString(24, wellName); } - + String wellType = entity.getWellType(); if (wellType != null) { stmt.bindString(25, wellType); } - + String wellTypeName = entity.getWellTypeName(); if (wellTypeName != null) { stmt.bindString(26, wellTypeName); @@ -377,41 +372,41 @@ @Override public Long readKey(Cursor cursor, int offset) { return cursor.isNull(offset + 0) ? null : cursor.getLong(offset + 0); - } + } @Override public MapWellLocalBean readEntity(Cursor cursor, int offset) { MapWellLocalBean entity = new MapWellLocalBean( // - cursor.isNull(offset + 0) ? null : cursor.getLong(offset + 0), // kId - cursor.isNull(offset + 1) ? null : cursor.getString(offset + 1), // area - cursor.isNull(offset + 2) ? null : cursor.getString(offset + 2), // bfzt - cursor.isNull(offset + 3) ? null : cursor.getString(offset + 3), // bfztName - cursor.isNull(offset + 4) ? null : cursor.getString(offset + 4), // coordinateX - cursor.isNull(offset + 5) ? null : cursor.getString(offset + 5), // coordinateY - cursor.isNull(offset + 6) ? null : cursor.getString(offset + 6), // deep - cursor.isNull(offset + 7) ? null : cursor.getString(offset + 7), // deptName - cursor.isNull(offset + 8) ? null : cursor.getString(offset + 8), // deptid - cursor.isNull(offset + 9) ? null : cursor.getString(offset + 9), // id - cursor.isNull(offset + 10) ? null : cursor.getString(offset + 10), // latBaidu - cursor.isNull(offset + 11) ? null : cursor.getString(offset + 11), // latGaode - cursor.isNull(offset + 12) ? null : cursor.getString(offset + 12), // lngBaidu - cursor.isNull(offset + 13) ? null : cursor.getString(offset + 13), // lngGaode - cursor.isNull(offset + 14) ? null : cursor.getString(offset + 14), // notes - cursor.isNull(offset + 15) ? null : cursor.getString(offset + 15), // photos - cursor.isNull(offset + 16) ? null : cursor.getString(offset + 16), // position - cursor.isNull(offset + 17) ? null : cursor.getString(offset + 17), // staff - cursor.isNull(offset + 18) ? null : cursor.getString(offset + 18), // tel - cursor.isNull(offset + 19) ? null : cursor.getString(offset + 19), // ts - cursor.isNull(offset + 20) ? null : cursor.getString(offset + 20), // valid - cursor.isNull(offset + 21) ? null : cursor.getString(offset + 21), // watchData - cursor.isNull(offset + 22) ? null : cursor.getString(offset + 22), // wellCode - cursor.isNull(offset + 23) ? null : cursor.getString(offset + 23), // wellName - cursor.isNull(offset + 24) ? null : cursor.getString(offset + 24), // wellType - cursor.isNull(offset + 25) ? null : cursor.getString(offset + 25) // wellTypeName + cursor.isNull(offset + 0) ? null : cursor.getLong(offset + 0), // kId + cursor.isNull(offset + 1) ? null : cursor.getString(offset + 1), // area + cursor.isNull(offset + 2) ? null : cursor.getString(offset + 2), // bfzt + cursor.isNull(offset + 3) ? null : cursor.getString(offset + 3), // bfztName + cursor.isNull(offset + 4) ? null : cursor.getString(offset + 4), // coordinateX + cursor.isNull(offset + 5) ? null : cursor.getString(offset + 5), // coordinateY + cursor.isNull(offset + 6) ? null : cursor.getString(offset + 6), // deep + cursor.isNull(offset + 7) ? null : cursor.getString(offset + 7), // deptName + cursor.isNull(offset + 8) ? null : cursor.getString(offset + 8), // deptid + cursor.isNull(offset + 9) ? null : cursor.getString(offset + 9), // id + cursor.isNull(offset + 10) ? null : cursor.getString(offset + 10), // latBaidu + cursor.isNull(offset + 11) ? null : cursor.getString(offset + 11), // latGaode + cursor.isNull(offset + 12) ? null : cursor.getString(offset + 12), // lngBaidu + cursor.isNull(offset + 13) ? null : cursor.getString(offset + 13), // lngGaode + cursor.isNull(offset + 14) ? null : cursor.getString(offset + 14), // notes + cursor.isNull(offset + 15) ? null : cursor.getString(offset + 15), // photos + cursor.isNull(offset + 16) ? null : cursor.getString(offset + 16), // position + cursor.isNull(offset + 17) ? null : cursor.getString(offset + 17), // staff + cursor.isNull(offset + 18) ? null : cursor.getString(offset + 18), // tel + cursor.isNull(offset + 19) ? null : cursor.getString(offset + 19), // ts + cursor.isNull(offset + 20) ? null : cursor.getString(offset + 20), // valid + cursor.isNull(offset + 21) ? null : cursor.getString(offset + 21), // watchData + cursor.isNull(offset + 22) ? null : cursor.getString(offset + 22), // wellCode + cursor.isNull(offset + 23) ? null : cursor.getString(offset + 23), // wellName + cursor.isNull(offset + 24) ? null : cursor.getString(offset + 24), // wellType + cursor.isNull(offset + 25) ? null : cursor.getString(offset + 25) // wellTypeName ); return entity; } - + @Override public void readEntity(Cursor cursor, MapWellLocalBean entity, int offset) { entity.setKId(cursor.isNull(offset + 0) ? null : cursor.getLong(offset + 0)); @@ -440,17 +435,17 @@ entity.setWellName(cursor.isNull(offset + 23) ? null : cursor.getString(offset + 23)); entity.setWellType(cursor.isNull(offset + 24) ? null : cursor.getString(offset + 24)); entity.setWellTypeName(cursor.isNull(offset + 25) ? null : cursor.getString(offset + 25)); - } - + } + @Override protected final Long updateKeyAfterInsert(MapWellLocalBean entity, long rowId) { entity.setKId(rowId); return rowId; } - + @Override public Long getKey(MapWellLocalBean entity) { - if (entity != null) { + if(entity != null) { return entity.getKId(); } else { return null; @@ -466,5 +461,5 @@ protected final boolean isEntityUpdateable() { return true; } - + } diff --git a/app/src/main/java/com/casic/app/smartwell/greendao/NoticeLocaleBeanDao.java b/app/src/main/java/com/casic/app/smartwell/greendao/NoticeLocaleBeanDao.java index 64312ed..deb2d49 100644 --- a/app/src/main/java/com/casic/app/smartwell/greendao/NoticeLocaleBeanDao.java +++ b/app/src/main/java/com/casic/app/smartwell/greendao/NoticeLocaleBeanDao.java @@ -12,10 +12,9 @@ import org.greenrobot.greendao.internal.DaoConfig; // THIS CODE IS GENERATED BY greenDAO, DO NOT EDIT. - -/** +/** * DAO for table "NOTICE_LOCALE_BEAN". - */ +*/ public class NoticeLocaleBeanDao extends AbstractDao { public static final String TABLENAME = "NOTICE_LOCALE_BEAN"; @@ -43,16 +42,14 @@ public NoticeLocaleBeanDao(DaoConfig config) { super(config); } - + public NoticeLocaleBeanDao(DaoConfig config, DaoSession daoSession) { super(config, daoSession); } - /** - * Creates the underlying database table. - */ + /** Creates the underlying database table. */ public static void createTable(Database db, boolean ifNotExists) { - String constraint = ifNotExists ? "IF NOT EXISTS " : ""; + String constraint = ifNotExists? "IF NOT EXISTS ": ""; db.execSQL("CREATE TABLE " + constraint + "\"NOTICE_LOCALE_BEAN\" (" + // "\"_id\" INTEGER PRIMARY KEY AUTOINCREMENT ," + // 0: id "\"MESSAGE_ID\" TEXT UNIQUE ," + // 1: messageId @@ -68,9 +65,7 @@ "\"NOTICE_TIME\" TEXT);"); // 11: noticeTime } - /** - * Drops the underlying database table. - */ + /** Drops the underlying database table. */ public static void dropTable(Database db, boolean ifExists) { String sql = "DROP TABLE " + (ifExists ? "IF EXISTS " : "") + "\"NOTICE_LOCALE_BEAN\""; db.execSQL(sql); @@ -79,62 +74,62 @@ @Override protected final void bindValues(DatabaseStatement stmt, NoticeLocaleBean entity) { stmt.clearBindings(); - + Long id = entity.getId(); if (id != null) { stmt.bindLong(1, id); } - + String messageId = entity.getMessageId(); if (messageId != null) { stmt.bindString(2, messageId); } - + String appid = entity.getAppid(); if (appid != null) { stmt.bindString(3, appid); } - + String clientId = entity.getClientId(); if (clientId != null) { stmt.bindString(4, clientId); } - + String taskId = entity.getTaskId(); if (taskId != null) { stmt.bindString(5, taskId); } - + String userId = entity.getUserId(); if (userId != null) { stmt.bindString(6, userId); } - + String title = entity.getTitle(); if (title != null) { stmt.bindString(7, title); } - + String content = entity.getContent(); if (content != null) { stmt.bindString(8, content); } - + String deviceCode = entity.getDeviceCode(); if (deviceCode != null) { stmt.bindString(9, deviceCode); } - + String jobId = entity.getJobId(); if (jobId != null) { stmt.bindString(10, jobId); } - + String isRead = entity.getIsRead(); if (isRead != null) { stmt.bindString(11, isRead); } - + String noticeTime = entity.getNoticeTime(); if (noticeTime != null) { stmt.bindString(12, noticeTime); @@ -144,62 +139,62 @@ @Override protected final void bindValues(SQLiteStatement stmt, NoticeLocaleBean entity) { stmt.clearBindings(); - + Long id = entity.getId(); if (id != null) { stmt.bindLong(1, id); } - + String messageId = entity.getMessageId(); if (messageId != null) { stmt.bindString(2, messageId); } - + String appid = entity.getAppid(); if (appid != null) { stmt.bindString(3, appid); } - + String clientId = entity.getClientId(); if (clientId != null) { stmt.bindString(4, clientId); } - + String taskId = entity.getTaskId(); if (taskId != null) { stmt.bindString(5, taskId); } - + String userId = entity.getUserId(); if (userId != null) { stmt.bindString(6, userId); } - + String title = entity.getTitle(); if (title != null) { stmt.bindString(7, title); } - + String content = entity.getContent(); if (content != null) { stmt.bindString(8, content); } - + String deviceCode = entity.getDeviceCode(); if (deviceCode != null) { stmt.bindString(9, deviceCode); } - + String jobId = entity.getJobId(); if (jobId != null) { stmt.bindString(10, jobId); } - + String isRead = entity.getIsRead(); if (isRead != null) { stmt.bindString(11, isRead); } - + String noticeTime = entity.getNoticeTime(); if (noticeTime != null) { stmt.bindString(12, noticeTime); @@ -209,27 +204,27 @@ @Override public Long readKey(Cursor cursor, int offset) { return cursor.isNull(offset + 0) ? null : cursor.getLong(offset + 0); - } + } @Override public NoticeLocaleBean readEntity(Cursor cursor, int offset) { NoticeLocaleBean entity = new NoticeLocaleBean( // - cursor.isNull(offset + 0) ? null : cursor.getLong(offset + 0), // id - cursor.isNull(offset + 1) ? null : cursor.getString(offset + 1), // messageId - cursor.isNull(offset + 2) ? null : cursor.getString(offset + 2), // appid - cursor.isNull(offset + 3) ? null : cursor.getString(offset + 3), // clientId - cursor.isNull(offset + 4) ? null : cursor.getString(offset + 4), // taskId - cursor.isNull(offset + 5) ? null : cursor.getString(offset + 5), // userId - cursor.isNull(offset + 6) ? null : cursor.getString(offset + 6), // title - cursor.isNull(offset + 7) ? null : cursor.getString(offset + 7), // content - cursor.isNull(offset + 8) ? null : cursor.getString(offset + 8), // deviceCode - cursor.isNull(offset + 9) ? null : cursor.getString(offset + 9), // jobId - cursor.isNull(offset + 10) ? null : cursor.getString(offset + 10), // isRead - cursor.isNull(offset + 11) ? null : cursor.getString(offset + 11) // noticeTime + cursor.isNull(offset + 0) ? null : cursor.getLong(offset + 0), // id + cursor.isNull(offset + 1) ? null : cursor.getString(offset + 1), // messageId + cursor.isNull(offset + 2) ? null : cursor.getString(offset + 2), // appid + cursor.isNull(offset + 3) ? null : cursor.getString(offset + 3), // clientId + cursor.isNull(offset + 4) ? null : cursor.getString(offset + 4), // taskId + cursor.isNull(offset + 5) ? null : cursor.getString(offset + 5), // userId + cursor.isNull(offset + 6) ? null : cursor.getString(offset + 6), // title + cursor.isNull(offset + 7) ? null : cursor.getString(offset + 7), // content + cursor.isNull(offset + 8) ? null : cursor.getString(offset + 8), // deviceCode + cursor.isNull(offset + 9) ? null : cursor.getString(offset + 9), // jobId + cursor.isNull(offset + 10) ? null : cursor.getString(offset + 10), // isRead + cursor.isNull(offset + 11) ? null : cursor.getString(offset + 11) // noticeTime ); return entity; } - + @Override public void readEntity(Cursor cursor, NoticeLocaleBean entity, int offset) { entity.setId(cursor.isNull(offset + 0) ? null : cursor.getLong(offset + 0)); @@ -244,17 +239,17 @@ entity.setJobId(cursor.isNull(offset + 9) ? null : cursor.getString(offset + 9)); entity.setIsRead(cursor.isNull(offset + 10) ? null : cursor.getString(offset + 10)); entity.setNoticeTime(cursor.isNull(offset + 11) ? null : cursor.getString(offset + 11)); - } - + } + @Override protected final Long updateKeyAfterInsert(NoticeLocaleBean entity, long rowId) { entity.setId(rowId); return rowId; } - + @Override public Long getKey(NoticeLocaleBean entity) { - if (entity != null) { + if(entity != null) { return entity.getId(); } else { return null; @@ -270,5 +265,5 @@ protected final boolean isEntityUpdateable() { return true; } - + } diff --git a/app/src/main/java/com/casic/app/smartwell/greendao/PipeLocalBeanDao.java b/app/src/main/java/com/casic/app/smartwell/greendao/PipeLocalBeanDao.java index aab4d3f..df5515a 100644 --- a/app/src/main/java/com/casic/app/smartwell/greendao/PipeLocalBeanDao.java +++ b/app/src/main/java/com/casic/app/smartwell/greendao/PipeLocalBeanDao.java @@ -12,10 +12,9 @@ import org.greenrobot.greendao.internal.DaoConfig; // THIS CODE IS GENERATED BY greenDAO, DO NOT EDIT. - -/** +/** * DAO for table "PIPE_LOCAL_BEAN". - */ +*/ public class PipeLocalBeanDao extends AbstractDao { public static final String TABLENAME = "PIPE_LOCAL_BEAN"; @@ -37,16 +36,14 @@ public PipeLocalBeanDao(DaoConfig config) { super(config); } - + public PipeLocalBeanDao(DaoConfig config, DaoSession daoSession) { super(config, daoSession); } - /** - * Creates the underlying database table. - */ + /** Creates the underlying database table. */ public static void createTable(Database db, boolean ifNotExists) { - String constraint = ifNotExists ? "IF NOT EXISTS " : ""; + String constraint = ifNotExists? "IF NOT EXISTS ": ""; db.execSQL("CREATE TABLE " + constraint + "\"PIPE_LOCAL_BEAN\" (" + // "\"_id\" INTEGER PRIMARY KEY AUTOINCREMENT ," + // 0: id "\"PIPE_CODE\" TEXT," + // 1: pipeCode @@ -56,9 +53,7 @@ "\"START_LONGITUDE_GD\" TEXT);"); // 5: startLongitudeGd } - /** - * Drops the underlying database table. - */ + /** Drops the underlying database table. */ public static void dropTable(Database db, boolean ifExists) { String sql = "DROP TABLE " + (ifExists ? "IF EXISTS " : "") + "\"PIPE_LOCAL_BEAN\""; db.execSQL(sql); @@ -67,32 +62,32 @@ @Override protected final void bindValues(DatabaseStatement stmt, PipeLocalBean entity) { stmt.clearBindings(); - + Long id = entity.getId(); if (id != null) { stmt.bindLong(1, id); } - + String pipeCode = entity.getPipeCode(); if (pipeCode != null) { stmt.bindString(2, pipeCode); } - + String endLatitudeGd = entity.getEndLatitudeGd(); if (endLatitudeGd != null) { stmt.bindString(3, endLatitudeGd); } - + String endLongitudeGd = entity.getEndLongitudeGd(); if (endLongitudeGd != null) { stmt.bindString(4, endLongitudeGd); } - + String startLatitudeGd = entity.getStartLatitudeGd(); if (startLatitudeGd != null) { stmt.bindString(5, startLatitudeGd); } - + String startLongitudeGd = entity.getStartLongitudeGd(); if (startLongitudeGd != null) { stmt.bindString(6, startLongitudeGd); @@ -102,32 +97,32 @@ @Override protected final void bindValues(SQLiteStatement stmt, PipeLocalBean entity) { stmt.clearBindings(); - + Long id = entity.getId(); if (id != null) { stmt.bindLong(1, id); } - + String pipeCode = entity.getPipeCode(); if (pipeCode != null) { stmt.bindString(2, pipeCode); } - + String endLatitudeGd = entity.getEndLatitudeGd(); if (endLatitudeGd != null) { stmt.bindString(3, endLatitudeGd); } - + String endLongitudeGd = entity.getEndLongitudeGd(); if (endLongitudeGd != null) { stmt.bindString(4, endLongitudeGd); } - + String startLatitudeGd = entity.getStartLatitudeGd(); if (startLatitudeGd != null) { stmt.bindString(5, startLatitudeGd); } - + String startLongitudeGd = entity.getStartLongitudeGd(); if (startLongitudeGd != null) { stmt.bindString(6, startLongitudeGd); @@ -137,21 +132,21 @@ @Override public Long readKey(Cursor cursor, int offset) { return cursor.isNull(offset + 0) ? null : cursor.getLong(offset + 0); - } + } @Override public PipeLocalBean readEntity(Cursor cursor, int offset) { PipeLocalBean entity = new PipeLocalBean( // - cursor.isNull(offset + 0) ? null : cursor.getLong(offset + 0), // id - cursor.isNull(offset + 1) ? null : cursor.getString(offset + 1), // pipeCode - cursor.isNull(offset + 2) ? null : cursor.getString(offset + 2), // endLatitudeGd - cursor.isNull(offset + 3) ? null : cursor.getString(offset + 3), // endLongitudeGd - cursor.isNull(offset + 4) ? null : cursor.getString(offset + 4), // startLatitudeGd - cursor.isNull(offset + 5) ? null : cursor.getString(offset + 5) // startLongitudeGd + cursor.isNull(offset + 0) ? null : cursor.getLong(offset + 0), // id + cursor.isNull(offset + 1) ? null : cursor.getString(offset + 1), // pipeCode + cursor.isNull(offset + 2) ? null : cursor.getString(offset + 2), // endLatitudeGd + cursor.isNull(offset + 3) ? null : cursor.getString(offset + 3), // endLongitudeGd + cursor.isNull(offset + 4) ? null : cursor.getString(offset + 4), // startLatitudeGd + cursor.isNull(offset + 5) ? null : cursor.getString(offset + 5) // startLongitudeGd ); return entity; } - + @Override public void readEntity(Cursor cursor, PipeLocalBean entity, int offset) { entity.setId(cursor.isNull(offset + 0) ? null : cursor.getLong(offset + 0)); @@ -160,17 +155,17 @@ entity.setEndLongitudeGd(cursor.isNull(offset + 3) ? null : cursor.getString(offset + 3)); entity.setStartLatitudeGd(cursor.isNull(offset + 4) ? null : cursor.getString(offset + 4)); entity.setStartLongitudeGd(cursor.isNull(offset + 5) ? null : cursor.getString(offset + 5)); - } - + } + @Override protected final Long updateKeyAfterInsert(PipeLocalBean entity, long rowId) { entity.setId(rowId); return rowId; } - + @Override public Long getKey(PipeLocalBean entity) { - if (entity != null) { + if(entity != null) { return entity.getId(); } else { return null; @@ -186,5 +181,5 @@ protected final boolean isEntityUpdateable() { return true; } - + } diff --git a/app/src/main/java/com/casic/app/smartwell/view/ChangePasswordActivity.kt b/app/src/main/java/com/casic/app/smartwell/view/ChangePasswordActivity.kt index 8e41039..9f1dd40 100644 --- a/app/src/main/java/com/casic/app/smartwell/view/ChangePasswordActivity.kt +++ b/app/src/main/java/com/casic/app/smartwell/view/ChangePasswordActivity.kt @@ -14,7 +14,7 @@ import com.pengxh.kt.lite.extensions.show import com.pengxh.kt.lite.utils.ActivityStackManager import com.pengxh.kt.lite.utils.LoadState -import com.pengxh.kt.lite.utils.LoadingDialogHub +import com.pengxh.kt.lite.utils.LoadingDialog import com.pengxh.kt.lite.widget.TitleBarView import java.nio.charset.StandardCharsets @@ -46,15 +46,15 @@ override fun observeRequestState() { userViewModel.loadState.observe(this) { when (it) { - is LoadState.Loading -> LoadingDialogHub.show(this, "修改中,请稍后") + is LoadState.Loading -> LoadingDialog.show(this, "修改中,请稍后") is LoadState.Success -> { - LoadingDialogHub.dismiss() + LoadingDialog.dismiss() AuthenticationHelper.removeToken() this.navigatePageTo() ActivityStackManager.finishAllActivity() } - else -> LoadingDialogHub.dismiss() + else -> LoadingDialog.dismiss() } } } diff --git a/app/src/main/java/com/casic/app/smartwell/view/DeployedWellActivity.kt b/app/src/main/java/com/casic/app/smartwell/view/DeployedWellActivity.kt index fb4339c..28a5078 100644 --- a/app/src/main/java/com/casic/app/smartwell/view/DeployedWellActivity.kt +++ b/app/src/main/java/com/casic/app/smartwell/view/DeployedWellActivity.kt @@ -83,8 +83,8 @@ } //添加分割线 - binding.deployedListView.addItemDecoration( - RecyclerViewItemOffsets(0, 5, 0, 5) + binding.recyclerView.addItemDecoration( + RecyclerViewItemOffsets(0, 7, 0, 7) ) } @@ -149,12 +149,11 @@ } else { item.deep.toString() + "m" } - viewHolder.setText(R.id.wellNameView, item.wellName) + viewHolder.setText(R.id.wellTypeView, item.wellTypeName) .setText(R.id.wellDepthView, "深:${deep}") .setText(R.id.wellCodeView, "点位编号:${item.wellCode}") - .setText(R.id.wellTypeView, "点位类型:${item.wellTypeName}") .setText(R.id.ownerShipView, "权属单位:${item.deptName}") - .setText(R.id.wellLocationView, "点位置:${item.position}") + .setText(R.id.wellLocationView, "点位位置:${item.position}") .setOnClickListener( R.id.operationButton, object : View.OnClickListener { override fun onClick(v: View?) { @@ -207,7 +206,7 @@ }) } } - binding.deployedListView.adapter = deployAdapter + binding.recyclerView.adapter = deployAdapter deployAdapter.setOnItemClickedListener(object : NormalRecyclerAdapter.OnItemClickedListener { override fun onItemClicked(position: Int, t: WellListModel.DataBean.RowsBean) { diff --git a/app/src/main/java/com/casic/app/smartwell/view/LoginActivity.kt b/app/src/main/java/com/casic/app/smartwell/view/LoginActivity.kt index e4bb0e3..834527b 100644 --- a/app/src/main/java/com/casic/app/smartwell/view/LoginActivity.kt +++ b/app/src/main/java/com/casic/app/smartwell/view/LoginActivity.kt @@ -21,7 +21,7 @@ import com.pengxh.kt.lite.extensions.navigatePageTo import com.pengxh.kt.lite.extensions.readAssetsFile import com.pengxh.kt.lite.extensions.show -import com.pengxh.kt.lite.utils.LoadingDialogHub +import com.pengxh.kt.lite.utils.LoadingDialog import com.pengxh.kt.lite.utils.SaveKeyValues import kotlinx.coroutines.Dispatchers import kotlinx.coroutines.launch @@ -106,11 +106,11 @@ override fun observeRequestState() { authenticateViewModel.loadState.observe(this) { - LoadingDialogHub.show(this, "登录中,请稍后") + LoadingDialog.show(this, "登录中,请稍后") } loginViewModel.loadState.observe(this) { - LoadingDialogHub.dismiss() + LoadingDialog.dismiss() } } diff --git a/app/src/main/java/com/casic/app/smartwell/view/OrderCompletedDetailActivity.kt b/app/src/main/java/com/casic/app/smartwell/view/OrderCompletedDetailActivity.kt index db8ad1f..75cd905 100644 --- a/app/src/main/java/com/casic/app/smartwell/view/OrderCompletedDetailActivity.kt +++ b/app/src/main/java/com/casic/app/smartwell/view/OrderCompletedDetailActivity.kt @@ -17,7 +17,7 @@ import com.pengxh.kt.lite.extensions.show import com.pengxh.kt.lite.utils.Constant import com.pengxh.kt.lite.utils.LoadState -import com.pengxh.kt.lite.utils.LoadingDialogHub +import com.pengxh.kt.lite.utils.LoadingDialog import com.pengxh.kt.lite.widget.TitleBarView import com.pengxh.kt.lite.widget.dialog.AlertMessageDialog @@ -44,7 +44,7 @@ } override fun initOnCreate(savedInstanceState: Bundle?) { - val jobId = intent.getStringExtra(Constant.INTENT_PARAM)!! + val jobId = intent.getStringExtra(Constant.INTENT_PARAM_KEY)!! orderViewModel = ViewModelProvider(this)[OrderViewModel::class.java] orderViewModel.getWorkOrderDetail(jobId) orderViewModel.detailModel.observe(this) { @@ -154,8 +154,8 @@ override fun observeRequestState() { orderViewModel.loadState.observe(this) { when (it) { - is LoadState.Loading -> LoadingDialogHub.show(this, "数据加载中,请稍后") - else -> LoadingDialogHub.dismiss() + is LoadState.Loading -> LoadingDialog.show(this, "数据加载中,请稍后") + else -> LoadingDialog.dismiss() } } } diff --git a/app/src/main/java/com/casic/app/smartwell/view/OrderInHandleDetailActivity.kt b/app/src/main/java/com/casic/app/smartwell/view/OrderInHandleDetailActivity.kt index d70a979..04a7d5d 100644 --- a/app/src/main/java/com/casic/app/smartwell/view/OrderInHandleDetailActivity.kt +++ b/app/src/main/java/com/casic/app/smartwell/view/OrderInHandleDetailActivity.kt @@ -38,7 +38,7 @@ import com.pengxh.kt.lite.extensions.show import com.pengxh.kt.lite.utils.Constant import com.pengxh.kt.lite.utils.LoadState -import com.pengxh.kt.lite.utils.LoadingDialogHub +import com.pengxh.kt.lite.utils.LoadingDialog import com.pengxh.kt.lite.widget.TitleBarView import com.pengxh.kt.lite.widget.dialog.AlertControlDialog import com.pengxh.kt.lite.widget.dialog.AlertMessageDialog @@ -93,7 +93,7 @@ ) binding.addImageRecyclerView.adapter = imageAdapter - val jobId = intent.getStringExtra(Constant.INTENT_PARAM)!!//初始化图片九宫格 + val jobId = intent.getStringExtra(Constant.INTENT_PARAM_KEY)!!//初始化图片九宫格 orderViewModel.getWorkOrderDetail(jobId) orderViewModel.detailModel.observe(this) { if (it.code == 200) { @@ -312,41 +312,41 @@ override fun observeRequestState() { orderViewModel.loadState.observe(this) { when (it) { - is LoadState.Loading -> LoadingDialogHub.show(this, "数据加载中,请稍后") - else -> LoadingDialogHub.dismiss() + is LoadState.Loading -> LoadingDialog.show(this, "数据加载中,请稍后") + else -> LoadingDialog.dismiss() } } uploadImageViewModel.loadState.observe(this) { when (it) { - LoadState.Loading -> LoadingDialogHub.show(this, "图片上传中,请稍后...") - else -> LoadingDialogHub.dismiss() + LoadState.Loading -> LoadingDialog.show(this, "图片上传中,请稍后...") + else -> LoadingDialog.dismiss() } } //转单状态处理 operationViewModel.loadState.observe(this) { when (it) { - is LoadState.Loading -> LoadingDialogHub.show(this, "转单中,请稍后") + is LoadState.Loading -> LoadingDialog.show(this, "转单中,请稍后") is LoadState.Success -> { - LoadingDialogHub.dismiss() + LoadingDialog.dismiss() this.finish() } - else -> LoadingDialogHub.dismiss() + else -> LoadingDialog.dismiss() } } //处理完成工单状态处理 operationViewModel.loadState.observe(this) { when (it) { - is LoadState.Loading -> LoadingDialogHub.show(this, "处理中,请稍后") + is LoadState.Loading -> LoadingDialog.show(this, "处理中,请稍后") is LoadState.Success -> { - LoadingDialogHub.dismiss() + LoadingDialog.dismiss() this.finish() } - else -> LoadingDialogHub.dismiss() + else -> LoadingDialog.dismiss() } } } diff --git a/app/src/main/java/com/casic/app/smartwell/view/OrderNotConfirmedDetailActivity.kt b/app/src/main/java/com/casic/app/smartwell/view/OrderNotConfirmedDetailActivity.kt index 8e036d2..687ec86 100644 --- a/app/src/main/java/com/casic/app/smartwell/view/OrderNotConfirmedDetailActivity.kt +++ b/app/src/main/java/com/casic/app/smartwell/view/OrderNotConfirmedDetailActivity.kt @@ -36,7 +36,7 @@ import com.pengxh.kt.lite.extensions.show import com.pengxh.kt.lite.utils.Constant import com.pengxh.kt.lite.utils.LoadState -import com.pengxh.kt.lite.utils.LoadingDialogHub +import com.pengxh.kt.lite.utils.LoadingDialog import com.pengxh.kt.lite.widget.TitleBarView import com.pengxh.kt.lite.widget.dialog.AlertControlDialog import com.pengxh.kt.lite.widget.dialog.AlertMessageDialog @@ -80,7 +80,7 @@ } override fun initOnCreate(savedInstanceState: Bundle?) { - val jobId = intent.getStringExtra(Constant.INTENT_PARAM)!! + val jobId = intent.getStringExtra(Constant.INTENT_PARAM_KEY)!! //初始化图片九宫格 //左外边距,左内边距,右内边距,右外边距 val viewWidth = getScreenWidth() - (10 + 10 + 10 + 10).dp2px(this) @@ -263,41 +263,41 @@ //数据加载状态处理 orderViewModel.loadState.observe(this) { when (it) { - is LoadState.Loading -> LoadingDialogHub.show(this, "数据加载中,请稍后") - else -> LoadingDialogHub.dismiss() + is LoadState.Loading -> LoadingDialog.show(this, "数据加载中,请稍后") + else -> LoadingDialog.dismiss() } } uploadImageViewModel.loadState.observe(this) { when (it) { - LoadState.Loading -> LoadingDialogHub.show(this, "图片上传中,请稍后") - else -> LoadingDialogHub.dismiss() + LoadState.Loading -> LoadingDialog.show(this, "图片上传中,请稍后") + else -> LoadingDialog.dismiss() } } //转单状态处理 operationViewModel.loadState.observe(this) { when (it) { - is LoadState.Loading -> LoadingDialogHub.show(this, "转单中,请稍后") + is LoadState.Loading -> LoadingDialog.show(this, "转单中,请稍后") is LoadState.Success -> { - LoadingDialogHub.dismiss() + LoadingDialog.dismiss() this.finish() } - else -> LoadingDialogHub.dismiss() + else -> LoadingDialog.dismiss() } } //确认工单状态处理 operationViewModel.loadState.observe(this) { when (it) { - is LoadState.Loading -> LoadingDialogHub.show(this, "处理中,请稍后") + is LoadState.Loading -> LoadingDialog.show(this, "处理中,请稍后") is LoadState.Success -> { - LoadingDialogHub.dismiss() + LoadingDialog.dismiss() this.finish() } - else -> LoadingDialogHub.dismiss() + else -> LoadingDialog.dismiss() } } } diff --git a/app/src/main/java/com/casic/app/smartwell/view/OrderNotProcessedDetailActivity.kt b/app/src/main/java/com/casic/app/smartwell/view/OrderNotProcessedDetailActivity.kt index d3f22dc..0c97a52 100644 --- a/app/src/main/java/com/casic/app/smartwell/view/OrderNotProcessedDetailActivity.kt +++ b/app/src/main/java/com/casic/app/smartwell/view/OrderNotProcessedDetailActivity.kt @@ -18,7 +18,7 @@ import com.pengxh.kt.lite.extensions.show import com.pengxh.kt.lite.utils.Constant import com.pengxh.kt.lite.utils.LoadState -import com.pengxh.kt.lite.utils.LoadingDialogHub +import com.pengxh.kt.lite.utils.LoadingDialog import com.pengxh.kt.lite.widget.TitleBarView import com.pengxh.kt.lite.widget.dialog.AlertControlDialog import com.pengxh.kt.lite.widget.dialog.AlertMessageDialog @@ -50,7 +50,7 @@ } override fun initOnCreate(savedInstanceState: Bundle?) { - this.jobId = intent.getStringExtra(Constant.INTENT_PARAM)!! + this.jobId = intent.getStringExtra(Constant.INTENT_PARAM_KEY)!! orderViewModel = ViewModelProvider(this)[OrderViewModel::class.java] operationViewModel = ViewModelProvider(this)[OperationViewModel::class.java] wellViewModel = ViewModelProvider(this)[WellViewModel::class.java] @@ -162,21 +162,21 @@ //数据加载状态处理 orderViewModel.loadState.observe(this) { when (it) { - is LoadState.Loading -> LoadingDialogHub.show(this, "数据加载中,请稍后") - else -> LoadingDialogHub.dismiss() + is LoadState.Loading -> LoadingDialog.show(this, "数据加载中,请稍后") + else -> LoadingDialog.dismiss() } } //接单状态处理 operationViewModel.loadState.observe(this) { when (it) { - is LoadState.Loading -> LoadingDialogHub.show(this, "接单中,请稍后") + is LoadState.Loading -> LoadingDialog.show(this, "接单中,请稍后") is LoadState.Success -> { - LoadingDialogHub.dismiss() + LoadingDialog.dismiss() this.finish() } - else -> LoadingDialogHub.dismiss() + else -> LoadingDialog.dismiss() } } } diff --git a/app/src/main/java/com/casic/app/smartwell/view/SearchResultActivity.kt b/app/src/main/java/com/casic/app/smartwell/view/SearchResultActivity.kt index 6a92917..4f3a674 100644 --- a/app/src/main/java/com/casic/app/smartwell/view/SearchResultActivity.kt +++ b/app/src/main/java/com/casic/app/smartwell/view/SearchResultActivity.kt @@ -19,7 +19,7 @@ import com.pengxh.kt.lite.extensions.show import com.pengxh.kt.lite.utils.Constant import com.pengxh.kt.lite.utils.LoadState -import com.pengxh.kt.lite.utils.LoadingDialogHub +import com.pengxh.kt.lite.utils.LoadingDialog import com.pengxh.kt.lite.utils.WeakReferenceHandler import com.pengxh.kt.lite.widget.TitleBarView import com.pengxh.kt.lite.widget.dialog.AlertControlDialog @@ -56,7 +56,7 @@ } override fun initOnCreate(savedInstanceState: Bundle?) { - args = intent.getStringArrayListExtra(Constant.INTENT_PARAM)!! + args = intent.getStringArrayListExtra(Constant.INTENT_PARAM_KEY)!! orderViewModel = ViewModelProvider(this)[OrderViewModel::class.java] operationViewModel = ViewModelProvider(this)[OperationViewModel::class.java] @@ -101,24 +101,24 @@ } } - binding.resultRecyclerView.addItemDecoration( - RecyclerViewItemOffsets(0, 5, 0, 5) + binding.recyclerView.addItemDecoration( + RecyclerViewItemOffsets(0, 7, 0, 7) ) } override fun observeRequestState() { orderViewModel.loadState.observe(this) { when (it) { - is LoadState.Loading -> LoadingDialogHub.show(this, "数据加载中,请稍后") - else -> LoadingDialogHub.dismiss() + is LoadState.Loading -> LoadingDialog.show(this, "数据加载中,请稍后") + else -> LoadingDialog.dismiss() } } //接单状态处理 operationViewModel.loadState.observe(this) { when (it) { - is LoadState.Loading -> LoadingDialogHub.show(this, "接单中,请稍后") + is LoadState.Loading -> LoadingDialog.show(this, "接单中,请稍后") is LoadState.Success -> { - LoadingDialogHub.dismiss() + LoadingDialog.dismiss() //接单成功之后刷新列表 dataBeans.removeAt(clickedPosition) searchResultAdapter.notifyItemRemoved(clickedPosition) @@ -127,7 +127,7 @@ ) } - else -> LoadingDialogHub.dismiss() + else -> LoadingDialog.dismiss() } } } @@ -162,7 +162,7 @@ } else { binding.emptyInclude.emptyView.hide() searchResultAdapter = SearchResultAdapter(this, dataBeans) - binding.resultRecyclerView.adapter = searchResultAdapter + binding.recyclerView.adapter = searchResultAdapter searchResultAdapter.setOnItemClickListener(object : SearchResultAdapter.OnItemClickListener { override fun onClicked(position: Int) { diff --git a/app/src/main/java/com/casic/app/smartwell/view/UnDeployWellActivity.kt b/app/src/main/java/com/casic/app/smartwell/view/UnDeployWellActivity.kt index 7f7cd3c..555c278 100644 --- a/app/src/main/java/com/casic/app/smartwell/view/UnDeployWellActivity.kt +++ b/app/src/main/java/com/casic/app/smartwell/view/UnDeployWellActivity.kt @@ -81,8 +81,8 @@ } } - binding.undeployListView.addItemDecoration( - RecyclerViewItemOffsets(0, 5, 0, 5) + binding.recyclerView.addItemDecoration( + RecyclerViewItemOffsets(0, 7, 0, 7) ) } @@ -147,12 +147,11 @@ } else { item.deep.toString() + "m" } - viewHolder.setText(R.id.wellNameView, item.wellName) + viewHolder.setText(R.id.wellTypeView, item.wellTypeName) .setText(R.id.wellDepthView, "深:${deep}") .setText(R.id.wellCodeView, "点位编号:${item.wellCode}") - .setText(R.id.wellTypeView, "点位类型:${item.wellTypeName}") .setText(R.id.ownerShipView, "权属单位:${item.deptName}") - .setText(R.id.wellLocationView, "点位置:${item.position}") + .setText(R.id.wellLocationView, "点位位置:${item.position}") .setOnClickListener( R.id.operationButton, object : View.OnClickListener { override fun onClick(v: View?) { @@ -185,7 +184,7 @@ ) } } - binding.undeployListView.adapter = unDeployAdapter + binding.recyclerView.adapter = unDeployAdapter unDeployAdapter.setOnItemClickedListener(object : NormalRecyclerAdapter.OnItemClickedListener { override fun onItemClicked(position: Int, t: WellListModel.DataBean.RowsBean) { diff --git a/app/src/main/java/com/casic/app/smartwell/view/WellDetailActivity.kt b/app/src/main/java/com/casic/app/smartwell/view/WellDetailActivity.kt index b50d067..eb8b468 100644 --- a/app/src/main/java/com/casic/app/smartwell/view/WellDetailActivity.kt +++ b/app/src/main/java/com/casic/app/smartwell/view/WellDetailActivity.kt @@ -16,7 +16,7 @@ import com.pengxh.kt.lite.extensions.show import com.pengxh.kt.lite.utils.Constant import com.pengxh.kt.lite.utils.LoadState -import com.pengxh.kt.lite.utils.LoadingDialogHub +import com.pengxh.kt.lite.utils.LoadingDialog import com.pengxh.kt.lite.widget.TitleBarView import com.pengxh.kt.lite.widget.dialog.AlertMessageDialog @@ -44,7 +44,7 @@ } override fun initOnCreate(savedInstanceState: Bundle?) { - val wellId = intent.getStringExtra(Constant.INTENT_PARAM)!! + val wellId = intent.getStringExtra(Constant.INTENT_PARAM_KEY)!! wellViewModel = ViewModelProvider(this)[WellViewModel::class.java] wellViewModel.getWellDetail(wellId) wellViewModel.wellDetailModel.observe(this) { @@ -132,8 +132,8 @@ override fun observeRequestState() { wellViewModel.loadState.observe(this) { when (it) { - is LoadState.Loading -> LoadingDialogHub.show(this, "数据加载中,请稍后") - else -> LoadingDialogHub.dismiss() + is LoadState.Loading -> LoadingDialog.show(this, "数据加载中,请稍后") + else -> LoadingDialog.dismiss() } } } diff --git a/app/src/main/java/com/casic/app/smartwell/view/WellManagementActivity.kt b/app/src/main/java/com/casic/app/smartwell/view/WellManagementActivity.kt index 084da95..457096b 100644 --- a/app/src/main/java/com/casic/app/smartwell/view/WellManagementActivity.kt +++ b/app/src/main/java/com/casic/app/smartwell/view/WellManagementActivity.kt @@ -94,8 +94,8 @@ } } - binding.wellListView.addItemDecoration( - RecyclerViewItemOffsets(0, 5, 0, 5) + binding.recyclerView.addItemDecoration( + RecyclerViewItemOffsets(0, 7, 0, 7) ) } @@ -175,13 +175,12 @@ } else { item.deep.toString() + "m" } - viewHolder.setText(R.id.wellNameView, item.wellName) + viewHolder.setText(R.id.wellTypeView, item.wellTypeName) .setText(R.id.wellStateView, "已${item.bfztName}") .setText(R.id.wellDepthView, "深:${deep}") .setText(R.id.wellCodeView, "点位编号:${item.wellCode}") - .setText(R.id.wellTypeView, "点位类型:${item.wellTypeName}") .setText(R.id.ownerShipView, "权属单位:${item.deptName}") - .setText(R.id.wellLocationView, "点位置:${item.position}") + .setText(R.id.wellLocationView, "点位位置:${item.position}") .setOnClickListener( R.id.navigationButton, object : View.OnClickListener { override fun onClick(v: View?) { @@ -200,7 +199,7 @@ ) } } - binding.wellListView.adapter = wellListAdapter + binding.recyclerView.adapter = wellListAdapter wellListAdapter.setOnItemClickedListener(object : NormalRecyclerAdapter.OnItemClickedListener { override fun onItemClicked(position: Int, t: WellListModel.DataBean.RowsBean) { diff --git a/app/src/main/java/com/casic/app/smartwell/view/WellMonitorActivity.kt b/app/src/main/java/com/casic/app/smartwell/view/WellMonitorActivity.kt index e3573eb..b87bdb7 100644 --- a/app/src/main/java/com/casic/app/smartwell/view/WellMonitorActivity.kt +++ b/app/src/main/java/com/casic/app/smartwell/view/WellMonitorActivity.kt @@ -11,7 +11,7 @@ import com.pengxh.kt.lite.base.KotlinBaseActivity import com.pengxh.kt.lite.utils.Constant import com.pengxh.kt.lite.utils.LoadState -import com.pengxh.kt.lite.utils.LoadingDialogHub +import com.pengxh.kt.lite.utils.LoadingDialog import com.pengxh.kt.lite.widget.TitleBarView class WellMonitorActivity : KotlinBaseActivity() { @@ -36,7 +36,7 @@ } override fun initOnCreate(savedInstanceState: Bundle?) { - val wellId = intent.getStringExtra(Constant.INTENT_PARAM)!! + val wellId = intent.getStringExtra(Constant.INTENT_PARAM_KEY)!! wellViewModel = ViewModelProvider(this)[WellViewModel::class.java] wellViewModel.getMonitorResult(wellId) wellViewModel.monitorModel.observe(this) { @@ -56,8 +56,8 @@ override fun observeRequestState() { wellViewModel.loadState.observe(this) { when (it) { - is LoadState.Loading -> LoadingDialogHub.show(this, "数据加载中,请稍后") - else -> LoadingDialogHub.dismiss() + is LoadState.Loading -> LoadingDialog.show(this, "数据加载中,请稍后") + else -> LoadingDialog.dismiss() } } } diff --git a/app/src/main/java/com/casic/app/smartwell/view/WellOperationActivity.kt b/app/src/main/java/com/casic/app/smartwell/view/WellOperationActivity.kt index 8d333bf..347ebb6 100644 --- a/app/src/main/java/com/casic/app/smartwell/view/WellOperationActivity.kt +++ b/app/src/main/java/com/casic/app/smartwell/view/WellOperationActivity.kt @@ -23,7 +23,7 @@ import com.pengxh.kt.lite.extensions.navigatePageTo import com.pengxh.kt.lite.extensions.show import com.pengxh.kt.lite.utils.LoadState -import com.pengxh.kt.lite.utils.LoadingDialogHub +import com.pengxh.kt.lite.utils.LoadingDialog import com.pengxh.kt.lite.utils.WeakReferenceHandler import com.pengxh.kt.lite.widget.dialog.AlertControlDialog @@ -109,8 +109,8 @@ } } - binding.operationListView.addItemDecoration( - RecyclerViewItemOffsets(0, 5, 0, 5) + binding.recyclerView.addItemDecoration( + RecyclerViewItemOffsets(0, 7, 0, 7) ) } @@ -123,13 +123,13 @@ override fun observeRequestState() { wellViewModel.loadState.observe(this) { when (it) { - is LoadState.Loading -> LoadingDialogHub.show(this, "处理中,请稍后") + is LoadState.Loading -> LoadingDialog.show(this, "处理中,请稍后") is LoadState.Success -> { - LoadingDialogHub.dismiss() + LoadingDialog.dismiss() wellOperationAdapter.notifyItemChanged(clickedPosition) } - else -> LoadingDialogHub.dismiss() + else -> LoadingDialog.dismiss() } } } @@ -203,24 +203,23 @@ if (item.bfztName == "布防") { viewHolder.setImageResource( R.id.wellStateView, R.drawable.bg_solid_text_green_radius_5 - ).setText(R.id.wellStateView, "撤防") + ).setText(R.id.operationButton, "撤防") } else { viewHolder.setImageResource( R.id.wellStateView, R.drawable.bg_solid_text_red_radius_5 - ).setText(R.id.wellStateView, "布防") + ).setText(R.id.operationButton, "布防") } val deep = if (item.deep.toString().isBlank()) { "未知" } else { item.deep.toString() + "m" } - viewHolder.setText(R.id.wellNameView, item.wellName) + viewHolder.setText(R.id.wellTypeView, item.wellTypeName) .setText(R.id.wellStateView, "已${item.bfztName}") .setText(R.id.wellDepthView, "深:${deep}") .setText(R.id.wellCodeView, "点位编号:${item.wellCode}") - .setText(R.id.wellTypeView, "点位类型:${item.wellTypeName}") .setText(R.id.ownerShipView, "权属单位:${item.deptName}") - .setText(R.id.wellLocationView, "点位置:${item.position}") + .setText(R.id.wellLocationView, "点位位置:${item.position}") .setOnClickListener( R.id.operationButton, object : View.OnClickListener { override fun onClick(v: View?) { @@ -280,7 +279,7 @@ ) } } - binding.operationListView.adapter = wellOperationAdapter + binding.recyclerView.adapter = wellOperationAdapter wellOperationAdapter.setOnItemClickedListener(object : NormalRecyclerAdapter.OnItemClickedListener { override fun onItemClicked(position: Int, t: WellListModel.DataBean.RowsBean) { diff --git a/app/src/main/res/drawable/ic_down.xml b/app/src/main/res/drawable/ic_down.xml index 20e6476..6987e6c 100644 --- a/app/src/main/res/drawable/ic_down.xml +++ b/app/src/main/res/drawable/ic_down.xml @@ -1,6 +1,6 @@ - + + android:value="ee96d8b5e12de3fbb29949efd57418a8" /> () @@ -150,7 +158,7 @@ val cameraPosition = CameraPosition(centerLatLng, 14f, 0f, 0f) val cameraUpdate = CameraUpdateFactory.newCameraPosition(cameraPosition) withContext(Dispatchers.Main) { - LoadingDialogHub.dismiss() + LoadingDialog.dismiss() aMap.animateCamera(cameraUpdate, 1500, null) } } @@ -239,11 +247,6 @@ } override fun initEvent() { - binding.rightOptionView.setOnClickListener { - val x = binding.rightOptionView.width - easyPopupWindow.width - easyPopupWindow.showAsDropDown(binding.rightOptionView, x, 0) - } - //撤防点位 binding.unDeployedLayout.setOnClickListener { requireContext().navigatePageTo() @@ -263,11 +266,11 @@ override fun observeRequestState() { wellViewModel.loadState.observe(this) { when (it) { - is LoadState.Loading -> LoadingDialogHub.show( + is LoadState.Loading -> LoadingDialog.show( requireActivity(), "数据加载中,请稍后..." ) - else -> LoadingDialogHub.dismiss() + else -> LoadingDialog.dismiss() } } } @@ -376,7 +379,7 @@ }).build().show() } }) - infoPopup.showAsDropDown(binding.rightOptionView) +// infoPopup.showAsDropDown(binding.rightOptionView) } override fun onCameraChange(p0: CameraPosition?) { diff --git a/app/src/main/java/com/casic/app/smartwell/fragment/HomePageNoClusterFragment.kt b/app/src/main/java/com/casic/app/smartwell/fragment/HomePageNoClusterFragment.kt index 802426a..b25f743 100644 --- a/app/src/main/java/com/casic/app/smartwell/fragment/HomePageNoClusterFragment.kt +++ b/app/src/main/java/com/casic/app/smartwell/fragment/HomePageNoClusterFragment.kt @@ -38,8 +38,9 @@ import com.pengxh.kt.lite.extensions.navigatePageTo import com.pengxh.kt.lite.extensions.show import com.pengxh.kt.lite.utils.LoadState -import com.pengxh.kt.lite.utils.LoadingDialogHub +import com.pengxh.kt.lite.utils.LoadingDialog import com.pengxh.kt.lite.widget.EasyPopupWindow +import com.pengxh.kt.lite.widget.TitleBarView import com.pengxh.kt.lite.widget.dialog.AlertControlDialog import kotlinx.coroutines.Dispatchers import kotlinx.coroutines.launch @@ -78,7 +79,15 @@ override fun setupTopBarLayout() { binding.rootView.initImmersionBar(this, false, R.color.mainThemeColor) - binding.titleView.text = "首页" + binding.titleView.setOnClickListener(object : TitleBarView.OnClickListener { + override fun onLeftClick() { + + } + + override fun onRightClick() { + easyPopupWindow.showAsDropDown(binding.titleView, binding.titleView.width, 0) + } + }) } override fun initOnCreate(savedInstanceState: Bundle?) { @@ -112,7 +121,7 @@ //渲染井位置 lifecycleScope.launch(Dispatchers.Main) { - LoadingDialogHub.show(requireActivity(), "数据加载中,请稍后") + LoadingDialog.show(requireActivity(), "数据加载中,请稍后") withContext(Dispatchers.IO) { //取Well缓存 val allMarkerOptions = ArrayList() @@ -144,7 +153,7 @@ val cameraPosition = CameraPosition(centerLatLng, 14f, 0f, 0f) val cameraUpdate = CameraUpdateFactory.newCameraPosition(cameraPosition) withContext(Dispatchers.Main) { - LoadingDialogHub.dismiss() + LoadingDialog.dismiss() aMap.animateCamera(cameraUpdate, 1500, null) } } @@ -238,11 +247,6 @@ } override fun initEvent() { - binding.rightOptionView.setOnClickListener { - val x = binding.rightOptionView.width - easyPopupWindow.width - easyPopupWindow.showAsDropDown(binding.rightOptionView, x, 0) - } - //撤防点位 binding.unDeployedLayout.setOnClickListener { requireContext().navigatePageTo() @@ -262,11 +266,11 @@ override fun observeRequestState() { wellViewModel.loadState.observe(this) { when (it) { - is LoadState.Loading -> LoadingDialogHub.show( + is LoadState.Loading -> LoadingDialog.show( requireActivity(), "数据加载中,请稍后..." ) - else -> LoadingDialogHub.dismiss() + else -> LoadingDialog.dismiss() } } } diff --git a/app/src/main/java/com/casic/app/smartwell/fragment/MinePageFragment.kt b/app/src/main/java/com/casic/app/smartwell/fragment/MinePageFragment.kt index 09a570c..dcb48f8 100644 --- a/app/src/main/java/com/casic/app/smartwell/fragment/MinePageFragment.kt +++ b/app/src/main/java/com/casic/app/smartwell/fragment/MinePageFragment.kt @@ -35,7 +35,7 @@ import com.pengxh.kt.lite.utils.ActivityStackManager import com.pengxh.kt.lite.utils.FileDownloadManager import com.pengxh.kt.lite.utils.LoadState -import com.pengxh.kt.lite.utils.LoadingDialogHub +import com.pengxh.kt.lite.utils.LoadingDialog import com.pengxh.kt.lite.widget.dialog.AlertControlDialog import com.pengxh.kt.lite.widget.dialog.BottomActionSheet import kotlinx.coroutines.Dispatchers @@ -60,7 +60,6 @@ override fun setupTopBarLayout() { binding.rootView.initImmersionBar(this, false, R.color.mainThemeColor) - binding.titleInclude.titleView.text = "我的" } override fun initOnCreate(savedInstanceState: Bundle?) { @@ -155,27 +154,27 @@ override fun observeRequestState() { userViewModel.loadState.observe(this) { when (it) { - is LoadState.Loading -> LoadingDialogHub.show( + is LoadState.Loading -> LoadingDialog.show( requireActivity(), "检查版本中,请稍后" ) - else -> LoadingDialogHub.dismiss() + else -> LoadingDialog.dismiss() } } wellViewModel.loadState.observe(this) { when (it) { - is LoadState.Loading -> LoadingDialogHub.show( + is LoadState.Loading -> LoadingDialog.show( requireActivity(), "数据更新中,请稍后" ) is LoadState.Fail -> { - LoadingDialogHub.dismiss() + LoadingDialog.dismiss() "数据更新超时".show(requireContext()) } else -> { - LoadingDialogHub.dismiss() + LoadingDialog.dismiss() AlertControlDialog.Builder().setContext(requireContext()).setTitle("温馨提示") .setMessage("数据更新成功,请重启应用").setNegativeButton("取消") .setPositiveButton("确定").setOnDialogButtonClickListener(object : @@ -197,17 +196,17 @@ lineViewModel.loadState.observe(this) { when (it) { - is LoadState.Loading -> LoadingDialogHub.show( + is LoadState.Loading -> LoadingDialog.show( requireActivity(), "数据更新中,请稍后" ) is LoadState.Fail -> { - LoadingDialogHub.dismiss() + LoadingDialog.dismiss() "数据更新超时".show(requireContext()) } else -> { - LoadingDialogHub.dismiss() + LoadingDialog.dismiss() AlertControlDialog.Builder().setContext(requireContext()).setTitle("温馨提示") .setMessage("数据更新成功,请重启应用").setNegativeButton("取消") .setPositiveButton("确定").setOnDialogButtonClickListener(object : diff --git a/app/src/main/java/com/casic/app/smartwell/fragment/NoticePageFragment.kt b/app/src/main/java/com/casic/app/smartwell/fragment/NoticePageFragment.kt index 171b555..3c93f54 100644 --- a/app/src/main/java/com/casic/app/smartwell/fragment/NoticePageFragment.kt +++ b/app/src/main/java/com/casic/app/smartwell/fragment/NoticePageFragment.kt @@ -48,7 +48,6 @@ override fun setupTopBarLayout() { binding.rootView.initImmersionBar(this, false, R.color.mainThemeColor) - binding.titleInclude.titleView.text = "消息" } override fun initOnCreate(savedInstanceState: Bundle?) { diff --git a/app/src/main/java/com/casic/app/smartwell/fragment/OrderListFragment.kt b/app/src/main/java/com/casic/app/smartwell/fragment/OrderListFragment.kt index 93ff35b..5e38acb 100644 --- a/app/src/main/java/com/casic/app/smartwell/fragment/OrderListFragment.kt +++ b/app/src/main/java/com/casic/app/smartwell/fragment/OrderListFragment.kt @@ -12,6 +12,7 @@ import com.casic.app.smartwell.view.SearchOrderActivity import com.pengxh.kt.lite.base.KotlinBaseFragment import com.pengxh.kt.lite.extensions.navigatePageTo +import com.pengxh.kt.lite.widget.TitleBarView class OrderListFragment : KotlinBaseFragment() { @@ -25,15 +26,22 @@ } override fun initViewBinding( - inflater: LayoutInflater, - container: ViewGroup? + inflater: LayoutInflater, container: ViewGroup? ): FragmentOrderBinding { return FragmentOrderBinding.inflate(inflater, container, false) } override fun setupTopBarLayout() { binding.rootView.initImmersionBar(this, false, R.color.mainThemeColor) - binding.titleView.text = "工单" + binding.titleView.setOnClickListener(object : TitleBarView.OnClickListener { + override fun onLeftClick() { + + } + + override fun onRightClick() { + requireContext().navigatePageTo() + } + }) } override fun initOnCreate(savedInstanceState: Bundle?) { @@ -51,8 +59,6 @@ } override fun initEvent() { - binding.rightOptionView.setOnClickListener { - requireContext().navigatePageTo() - } + } } \ No newline at end of file diff --git a/app/src/main/java/com/casic/app/smartwell/fragment/OrderNotProcessedFragment.kt b/app/src/main/java/com/casic/app/smartwell/fragment/OrderNotProcessedFragment.kt index 0b3d09d..2b6f21d 100644 --- a/app/src/main/java/com/casic/app/smartwell/fragment/OrderNotProcessedFragment.kt +++ b/app/src/main/java/com/casic/app/smartwell/fragment/OrderNotProcessedFragment.kt @@ -18,7 +18,7 @@ import com.pengxh.kt.lite.extensions.navigatePageTo import com.pengxh.kt.lite.extensions.show import com.pengxh.kt.lite.utils.LoadState -import com.pengxh.kt.lite.utils.LoadingDialogHub +import com.pengxh.kt.lite.utils.LoadingDialog import com.pengxh.kt.lite.utils.WeakReferenceHandler import com.pengxh.kt.lite.widget.dialog.AlertControlDialog @@ -78,8 +78,8 @@ operationViewModel = ViewModelProvider(this)[OperationViewModel::class.java] - binding.notProcessedView.addItemDecoration( - RecyclerViewItemOffsets(0, 5, 0, 5) + binding.recyclerView.addItemDecoration( + RecyclerViewItemOffsets(0, 7, 0, 7) ) } @@ -87,9 +87,9 @@ //接单状态处理 operationViewModel.loadState.observe(this) { when (it) { - is LoadState.Loading -> LoadingDialogHub.show(requireActivity(), "接单中,请稍后") + is LoadState.Loading -> LoadingDialog.show(requireActivity(), "接单中,请稍后") is LoadState.Success -> { - LoadingDialogHub.dismiss() + LoadingDialog.dismiss() //接单成功之后刷新列表 dataBeans.removeAt(clickedPosition) notProcessedAdapter.notifyItemRemoved(clickedPosition) @@ -98,7 +98,7 @@ ) } - else -> LoadingDialogHub.dismiss() + else -> LoadingDialog.dismiss() } } } @@ -131,7 +131,7 @@ } else { binding.emptyInclude.emptyView.hide() notProcessedAdapter = OrderNotProcessedAdapter(requireContext(), dataBeans) - binding.notProcessedView.adapter = notProcessedAdapter + binding.recyclerView.adapter = notProcessedAdapter notProcessedAdapter.setOnItemClickListener(object : OrderNotProcessedAdapter.OnItemClickListener { override fun onClicked(position: Int) { diff --git a/app/src/main/java/com/casic/app/smartwell/fragment/OvertimeNotAcceptFragment.kt b/app/src/main/java/com/casic/app/smartwell/fragment/OvertimeNotAcceptFragment.kt index a198545..9b318ca 100644 --- a/app/src/main/java/com/casic/app/smartwell/fragment/OvertimeNotAcceptFragment.kt +++ b/app/src/main/java/com/casic/app/smartwell/fragment/OvertimeNotAcceptFragment.kt @@ -18,7 +18,7 @@ import com.pengxh.kt.lite.extensions.navigatePageTo import com.pengxh.kt.lite.extensions.show import com.pengxh.kt.lite.utils.LoadState -import com.pengxh.kt.lite.utils.LoadingDialogHub +import com.pengxh.kt.lite.utils.LoadingDialog import com.pengxh.kt.lite.utils.WeakReferenceHandler import com.pengxh.kt.lite.widget.dialog.AlertControlDialog @@ -81,8 +81,8 @@ operationViewModel = ViewModelProvider(this)[OperationViewModel::class.java] - binding.notProcessedView.addItemDecoration( - RecyclerViewItemOffsets(0, 5, 0, 5) + binding.recyclerView.addItemDecoration( + RecyclerViewItemOffsets(0, 7, 0, 7) ) } @@ -90,9 +90,9 @@ //接单状态处理 operationViewModel.loadState.observe(this) { when (it) { - is LoadState.Loading -> LoadingDialogHub.show(requireActivity(), "接单中,请稍后") + is LoadState.Loading -> LoadingDialog.show(requireActivity(), "接单中,请稍后") is LoadState.Success -> { - LoadingDialogHub.dismiss() + LoadingDialog.dismiss() //接单成功之后刷新列表 dataBeans.removeAt(clickedPosition) notProcessedAdapter.notifyItemRemoved(clickedPosition) @@ -101,7 +101,7 @@ ) } - else -> LoadingDialogHub.dismiss() + else -> LoadingDialog.dismiss() } } } @@ -134,7 +134,7 @@ } else { binding.emptyInclude.emptyView.hide() notProcessedAdapter = OrderNotProcessedAdapter(requireContext(), dataBeans) - binding.notProcessedView.adapter = notProcessedAdapter + binding.recyclerView.adapter = notProcessedAdapter notProcessedAdapter.setOnItemClickListener(object : OrderNotProcessedAdapter.OnItemClickListener { override fun onClicked(position: Int) { diff --git a/app/src/main/java/com/casic/app/smartwell/greendao/DaoMaster.java b/app/src/main/java/com/casic/app/smartwell/greendao/DaoMaster.java index fdcf3a7..1e52b74 100644 --- a/app/src/main/java/com/casic/app/smartwell/greendao/DaoMaster.java +++ b/app/src/main/java/com/casic/app/smartwell/greendao/DaoMaster.java @@ -13,25 +13,20 @@ // THIS CODE IS GENERATED BY greenDAO, DO NOT EDIT. - /** * Master of DAO (schema version 4): knows all DAOs. */ public class DaoMaster extends AbstractDaoMaster { public static final int SCHEMA_VERSION = 4; - /** - * Creates underlying database table using DAOs. - */ + /** Creates underlying database table using DAOs. */ public static void createAllTables(Database db, boolean ifNotExists) { MapWellLocalBeanDao.createTable(db, ifNotExists); NoticeLocaleBeanDao.createTable(db, ifNotExists); PipeLocalBeanDao.createTable(db, ifNotExists); } - /** - * Drops underlying database table using DAOs. - */ + /** Drops underlying database table using DAOs. */ public static void dropAllTables(Database db, boolean ifExists) { MapWellLocalBeanDao.dropTable(db, ifExists); NoticeLocaleBeanDao.dropTable(db, ifExists); @@ -86,9 +81,7 @@ } } - /** - * WARNING: Drops all table on Upgrade! Use only during development. - */ + /** WARNING: Drops all table on Upgrade! Use only during development. */ public static class DevOpenHelper extends OpenHelper { public DevOpenHelper(Context context, String name) { super(context, name); diff --git a/app/src/main/java/com/casic/app/smartwell/greendao/DaoSession.java b/app/src/main/java/com/casic/app/smartwell/greendao/DaoSession.java index 0b36d17..3e40e3b 100644 --- a/app/src/main/java/com/casic/app/smartwell/greendao/DaoSession.java +++ b/app/src/main/java/com/casic/app/smartwell/greendao/DaoSession.java @@ -16,7 +16,7 @@ /** * {@inheritDoc} - * + * * @see org.greenrobot.greendao.AbstractDaoSession */ public class DaoSession extends AbstractDaoSession { @@ -50,7 +50,7 @@ registerDao(NoticeLocaleBean.class, noticeLocaleBeanDao); registerDao(PipeLocalBean.class, pipeLocalBeanDao); } - + public void clear() { mapWellLocalBeanDaoConfig.clearIdentityScope(); noticeLocaleBeanDaoConfig.clearIdentityScope(); diff --git a/app/src/main/java/com/casic/app/smartwell/greendao/MapWellLocalBeanDao.java b/app/src/main/java/com/casic/app/smartwell/greendao/MapWellLocalBeanDao.java index 8908fda..407bc92 100644 --- a/app/src/main/java/com/casic/app/smartwell/greendao/MapWellLocalBeanDao.java +++ b/app/src/main/java/com/casic/app/smartwell/greendao/MapWellLocalBeanDao.java @@ -12,10 +12,9 @@ import org.greenrobot.greendao.internal.DaoConfig; // THIS CODE IS GENERATED BY greenDAO, DO NOT EDIT. - -/** +/** * DAO for table "MAP_WELL_LOCAL_BEAN". - */ +*/ public class MapWellLocalBeanDao extends AbstractDao { public static final String TABLENAME = "MAP_WELL_LOCAL_BEAN"; @@ -57,16 +56,14 @@ public MapWellLocalBeanDao(DaoConfig config) { super(config); } - + public MapWellLocalBeanDao(DaoConfig config, DaoSession daoSession) { super(config, daoSession); } - /** - * Creates the underlying database table. - */ + /** Creates the underlying database table. */ public static void createTable(Database db, boolean ifNotExists) { - String constraint = ifNotExists ? "IF NOT EXISTS " : ""; + String constraint = ifNotExists? "IF NOT EXISTS ": ""; db.execSQL("CREATE TABLE " + constraint + "\"MAP_WELL_LOCAL_BEAN\" (" + // "\"_id\" INTEGER PRIMARY KEY AUTOINCREMENT ," + // 0: kId "\"AREA\" TEXT," + // 1: area @@ -96,9 +93,7 @@ "\"WELL_TYPE_NAME\" TEXT);"); // 25: wellTypeName } - /** - * Drops the underlying database table. - */ + /** Drops the underlying database table. */ public static void dropTable(Database db, boolean ifExists) { String sql = "DROP TABLE " + (ifExists ? "IF EXISTS " : "") + "\"MAP_WELL_LOCAL_BEAN\""; db.execSQL(sql); @@ -107,132 +102,132 @@ @Override protected final void bindValues(DatabaseStatement stmt, MapWellLocalBean entity) { stmt.clearBindings(); - + Long kId = entity.getKId(); if (kId != null) { stmt.bindLong(1, kId); } - + String area = entity.getArea(); if (area != null) { stmt.bindString(2, area); } - + String bfzt = entity.getBfzt(); if (bfzt != null) { stmt.bindString(3, bfzt); } - + String bfztName = entity.getBfztName(); if (bfztName != null) { stmt.bindString(4, bfztName); } - + String coordinateX = entity.getCoordinateX(); if (coordinateX != null) { stmt.bindString(5, coordinateX); } - + String coordinateY = entity.getCoordinateY(); if (coordinateY != null) { stmt.bindString(6, coordinateY); } - + String deep = entity.getDeep(); if (deep != null) { stmt.bindString(7, deep); } - + String deptName = entity.getDeptName(); if (deptName != null) { stmt.bindString(8, deptName); } - + String deptid = entity.getDeptid(); if (deptid != null) { stmt.bindString(9, deptid); } - + String id = entity.getId(); if (id != null) { stmt.bindString(10, id); } - + String latBaidu = entity.getLatBaidu(); if (latBaidu != null) { stmt.bindString(11, latBaidu); } - + String latGaode = entity.getLatGaode(); if (latGaode != null) { stmt.bindString(12, latGaode); } - + String lngBaidu = entity.getLngBaidu(); if (lngBaidu != null) { stmt.bindString(13, lngBaidu); } - + String lngGaode = entity.getLngGaode(); if (lngGaode != null) { stmt.bindString(14, lngGaode); } - + String notes = entity.getNotes(); if (notes != null) { stmt.bindString(15, notes); } - + String photos = entity.getPhotos(); if (photos != null) { stmt.bindString(16, photos); } - + String position = entity.getPosition(); if (position != null) { stmt.bindString(17, position); } - + String staff = entity.getStaff(); if (staff != null) { stmt.bindString(18, staff); } - + String tel = entity.getTel(); if (tel != null) { stmt.bindString(19, tel); } - + String ts = entity.getTs(); if (ts != null) { stmt.bindString(20, ts); } - + String valid = entity.getValid(); if (valid != null) { stmt.bindString(21, valid); } - + String watchData = entity.getWatchData(); if (watchData != null) { stmt.bindString(22, watchData); } - + String wellCode = entity.getWellCode(); if (wellCode != null) { stmt.bindString(23, wellCode); } - + String wellName = entity.getWellName(); if (wellName != null) { stmt.bindString(24, wellName); } - + String wellType = entity.getWellType(); if (wellType != null) { stmt.bindString(25, wellType); } - + String wellTypeName = entity.getWellTypeName(); if (wellTypeName != null) { stmt.bindString(26, wellTypeName); @@ -242,132 +237,132 @@ @Override protected final void bindValues(SQLiteStatement stmt, MapWellLocalBean entity) { stmt.clearBindings(); - + Long kId = entity.getKId(); if (kId != null) { stmt.bindLong(1, kId); } - + String area = entity.getArea(); if (area != null) { stmt.bindString(2, area); } - + String bfzt = entity.getBfzt(); if (bfzt != null) { stmt.bindString(3, bfzt); } - + String bfztName = entity.getBfztName(); if (bfztName != null) { stmt.bindString(4, bfztName); } - + String coordinateX = entity.getCoordinateX(); if (coordinateX != null) { stmt.bindString(5, coordinateX); } - + String coordinateY = entity.getCoordinateY(); if (coordinateY != null) { stmt.bindString(6, coordinateY); } - + String deep = entity.getDeep(); if (deep != null) { stmt.bindString(7, deep); } - + String deptName = entity.getDeptName(); if (deptName != null) { stmt.bindString(8, deptName); } - + String deptid = entity.getDeptid(); if (deptid != null) { stmt.bindString(9, deptid); } - + String id = entity.getId(); if (id != null) { stmt.bindString(10, id); } - + String latBaidu = entity.getLatBaidu(); if (latBaidu != null) { stmt.bindString(11, latBaidu); } - + String latGaode = entity.getLatGaode(); if (latGaode != null) { stmt.bindString(12, latGaode); } - + String lngBaidu = entity.getLngBaidu(); if (lngBaidu != null) { stmt.bindString(13, lngBaidu); } - + String lngGaode = entity.getLngGaode(); if (lngGaode != null) { stmt.bindString(14, lngGaode); } - + String notes = entity.getNotes(); if (notes != null) { stmt.bindString(15, notes); } - + String photos = entity.getPhotos(); if (photos != null) { stmt.bindString(16, photos); } - + String position = entity.getPosition(); if (position != null) { stmt.bindString(17, position); } - + String staff = entity.getStaff(); if (staff != null) { stmt.bindString(18, staff); } - + String tel = entity.getTel(); if (tel != null) { stmt.bindString(19, tel); } - + String ts = entity.getTs(); if (ts != null) { stmt.bindString(20, ts); } - + String valid = entity.getValid(); if (valid != null) { stmt.bindString(21, valid); } - + String watchData = entity.getWatchData(); if (watchData != null) { stmt.bindString(22, watchData); } - + String wellCode = entity.getWellCode(); if (wellCode != null) { stmt.bindString(23, wellCode); } - + String wellName = entity.getWellName(); if (wellName != null) { stmt.bindString(24, wellName); } - + String wellType = entity.getWellType(); if (wellType != null) { stmt.bindString(25, wellType); } - + String wellTypeName = entity.getWellTypeName(); if (wellTypeName != null) { stmt.bindString(26, wellTypeName); @@ -377,41 +372,41 @@ @Override public Long readKey(Cursor cursor, int offset) { return cursor.isNull(offset + 0) ? null : cursor.getLong(offset + 0); - } + } @Override public MapWellLocalBean readEntity(Cursor cursor, int offset) { MapWellLocalBean entity = new MapWellLocalBean( // - cursor.isNull(offset + 0) ? null : cursor.getLong(offset + 0), // kId - cursor.isNull(offset + 1) ? null : cursor.getString(offset + 1), // area - cursor.isNull(offset + 2) ? null : cursor.getString(offset + 2), // bfzt - cursor.isNull(offset + 3) ? null : cursor.getString(offset + 3), // bfztName - cursor.isNull(offset + 4) ? null : cursor.getString(offset + 4), // coordinateX - cursor.isNull(offset + 5) ? null : cursor.getString(offset + 5), // coordinateY - cursor.isNull(offset + 6) ? null : cursor.getString(offset + 6), // deep - cursor.isNull(offset + 7) ? null : cursor.getString(offset + 7), // deptName - cursor.isNull(offset + 8) ? null : cursor.getString(offset + 8), // deptid - cursor.isNull(offset + 9) ? null : cursor.getString(offset + 9), // id - cursor.isNull(offset + 10) ? null : cursor.getString(offset + 10), // latBaidu - cursor.isNull(offset + 11) ? null : cursor.getString(offset + 11), // latGaode - cursor.isNull(offset + 12) ? null : cursor.getString(offset + 12), // lngBaidu - cursor.isNull(offset + 13) ? null : cursor.getString(offset + 13), // lngGaode - cursor.isNull(offset + 14) ? null : cursor.getString(offset + 14), // notes - cursor.isNull(offset + 15) ? null : cursor.getString(offset + 15), // photos - cursor.isNull(offset + 16) ? null : cursor.getString(offset + 16), // position - cursor.isNull(offset + 17) ? null : cursor.getString(offset + 17), // staff - cursor.isNull(offset + 18) ? null : cursor.getString(offset + 18), // tel - cursor.isNull(offset + 19) ? null : cursor.getString(offset + 19), // ts - cursor.isNull(offset + 20) ? null : cursor.getString(offset + 20), // valid - cursor.isNull(offset + 21) ? null : cursor.getString(offset + 21), // watchData - cursor.isNull(offset + 22) ? null : cursor.getString(offset + 22), // wellCode - cursor.isNull(offset + 23) ? null : cursor.getString(offset + 23), // wellName - cursor.isNull(offset + 24) ? null : cursor.getString(offset + 24), // wellType - cursor.isNull(offset + 25) ? null : cursor.getString(offset + 25) // wellTypeName + cursor.isNull(offset + 0) ? null : cursor.getLong(offset + 0), // kId + cursor.isNull(offset + 1) ? null : cursor.getString(offset + 1), // area + cursor.isNull(offset + 2) ? null : cursor.getString(offset + 2), // bfzt + cursor.isNull(offset + 3) ? null : cursor.getString(offset + 3), // bfztName + cursor.isNull(offset + 4) ? null : cursor.getString(offset + 4), // coordinateX + cursor.isNull(offset + 5) ? null : cursor.getString(offset + 5), // coordinateY + cursor.isNull(offset + 6) ? null : cursor.getString(offset + 6), // deep + cursor.isNull(offset + 7) ? null : cursor.getString(offset + 7), // deptName + cursor.isNull(offset + 8) ? null : cursor.getString(offset + 8), // deptid + cursor.isNull(offset + 9) ? null : cursor.getString(offset + 9), // id + cursor.isNull(offset + 10) ? null : cursor.getString(offset + 10), // latBaidu + cursor.isNull(offset + 11) ? null : cursor.getString(offset + 11), // latGaode + cursor.isNull(offset + 12) ? null : cursor.getString(offset + 12), // lngBaidu + cursor.isNull(offset + 13) ? null : cursor.getString(offset + 13), // lngGaode + cursor.isNull(offset + 14) ? null : cursor.getString(offset + 14), // notes + cursor.isNull(offset + 15) ? null : cursor.getString(offset + 15), // photos + cursor.isNull(offset + 16) ? null : cursor.getString(offset + 16), // position + cursor.isNull(offset + 17) ? null : cursor.getString(offset + 17), // staff + cursor.isNull(offset + 18) ? null : cursor.getString(offset + 18), // tel + cursor.isNull(offset + 19) ? null : cursor.getString(offset + 19), // ts + cursor.isNull(offset + 20) ? null : cursor.getString(offset + 20), // valid + cursor.isNull(offset + 21) ? null : cursor.getString(offset + 21), // watchData + cursor.isNull(offset + 22) ? null : cursor.getString(offset + 22), // wellCode + cursor.isNull(offset + 23) ? null : cursor.getString(offset + 23), // wellName + cursor.isNull(offset + 24) ? null : cursor.getString(offset + 24), // wellType + cursor.isNull(offset + 25) ? null : cursor.getString(offset + 25) // wellTypeName ); return entity; } - + @Override public void readEntity(Cursor cursor, MapWellLocalBean entity, int offset) { entity.setKId(cursor.isNull(offset + 0) ? null : cursor.getLong(offset + 0)); @@ -440,17 +435,17 @@ entity.setWellName(cursor.isNull(offset + 23) ? null : cursor.getString(offset + 23)); entity.setWellType(cursor.isNull(offset + 24) ? null : cursor.getString(offset + 24)); entity.setWellTypeName(cursor.isNull(offset + 25) ? null : cursor.getString(offset + 25)); - } - + } + @Override protected final Long updateKeyAfterInsert(MapWellLocalBean entity, long rowId) { entity.setKId(rowId); return rowId; } - + @Override public Long getKey(MapWellLocalBean entity) { - if (entity != null) { + if(entity != null) { return entity.getKId(); } else { return null; @@ -466,5 +461,5 @@ protected final boolean isEntityUpdateable() { return true; } - + } diff --git a/app/src/main/java/com/casic/app/smartwell/greendao/NoticeLocaleBeanDao.java b/app/src/main/java/com/casic/app/smartwell/greendao/NoticeLocaleBeanDao.java index 64312ed..deb2d49 100644 --- a/app/src/main/java/com/casic/app/smartwell/greendao/NoticeLocaleBeanDao.java +++ b/app/src/main/java/com/casic/app/smartwell/greendao/NoticeLocaleBeanDao.java @@ -12,10 +12,9 @@ import org.greenrobot.greendao.internal.DaoConfig; // THIS CODE IS GENERATED BY greenDAO, DO NOT EDIT. - -/** +/** * DAO for table "NOTICE_LOCALE_BEAN". - */ +*/ public class NoticeLocaleBeanDao extends AbstractDao { public static final String TABLENAME = "NOTICE_LOCALE_BEAN"; @@ -43,16 +42,14 @@ public NoticeLocaleBeanDao(DaoConfig config) { super(config); } - + public NoticeLocaleBeanDao(DaoConfig config, DaoSession daoSession) { super(config, daoSession); } - /** - * Creates the underlying database table. - */ + /** Creates the underlying database table. */ public static void createTable(Database db, boolean ifNotExists) { - String constraint = ifNotExists ? "IF NOT EXISTS " : ""; + String constraint = ifNotExists? "IF NOT EXISTS ": ""; db.execSQL("CREATE TABLE " + constraint + "\"NOTICE_LOCALE_BEAN\" (" + // "\"_id\" INTEGER PRIMARY KEY AUTOINCREMENT ," + // 0: id "\"MESSAGE_ID\" TEXT UNIQUE ," + // 1: messageId @@ -68,9 +65,7 @@ "\"NOTICE_TIME\" TEXT);"); // 11: noticeTime } - /** - * Drops the underlying database table. - */ + /** Drops the underlying database table. */ public static void dropTable(Database db, boolean ifExists) { String sql = "DROP TABLE " + (ifExists ? "IF EXISTS " : "") + "\"NOTICE_LOCALE_BEAN\""; db.execSQL(sql); @@ -79,62 +74,62 @@ @Override protected final void bindValues(DatabaseStatement stmt, NoticeLocaleBean entity) { stmt.clearBindings(); - + Long id = entity.getId(); if (id != null) { stmt.bindLong(1, id); } - + String messageId = entity.getMessageId(); if (messageId != null) { stmt.bindString(2, messageId); } - + String appid = entity.getAppid(); if (appid != null) { stmt.bindString(3, appid); } - + String clientId = entity.getClientId(); if (clientId != null) { stmt.bindString(4, clientId); } - + String taskId = entity.getTaskId(); if (taskId != null) { stmt.bindString(5, taskId); } - + String userId = entity.getUserId(); if (userId != null) { stmt.bindString(6, userId); } - + String title = entity.getTitle(); if (title != null) { stmt.bindString(7, title); } - + String content = entity.getContent(); if (content != null) { stmt.bindString(8, content); } - + String deviceCode = entity.getDeviceCode(); if (deviceCode != null) { stmt.bindString(9, deviceCode); } - + String jobId = entity.getJobId(); if (jobId != null) { stmt.bindString(10, jobId); } - + String isRead = entity.getIsRead(); if (isRead != null) { stmt.bindString(11, isRead); } - + String noticeTime = entity.getNoticeTime(); if (noticeTime != null) { stmt.bindString(12, noticeTime); @@ -144,62 +139,62 @@ @Override protected final void bindValues(SQLiteStatement stmt, NoticeLocaleBean entity) { stmt.clearBindings(); - + Long id = entity.getId(); if (id != null) { stmt.bindLong(1, id); } - + String messageId = entity.getMessageId(); if (messageId != null) { stmt.bindString(2, messageId); } - + String appid = entity.getAppid(); if (appid != null) { stmt.bindString(3, appid); } - + String clientId = entity.getClientId(); if (clientId != null) { stmt.bindString(4, clientId); } - + String taskId = entity.getTaskId(); if (taskId != null) { stmt.bindString(5, taskId); } - + String userId = entity.getUserId(); if (userId != null) { stmt.bindString(6, userId); } - + String title = entity.getTitle(); if (title != null) { stmt.bindString(7, title); } - + String content = entity.getContent(); if (content != null) { stmt.bindString(8, content); } - + String deviceCode = entity.getDeviceCode(); if (deviceCode != null) { stmt.bindString(9, deviceCode); } - + String jobId = entity.getJobId(); if (jobId != null) { stmt.bindString(10, jobId); } - + String isRead = entity.getIsRead(); if (isRead != null) { stmt.bindString(11, isRead); } - + String noticeTime = entity.getNoticeTime(); if (noticeTime != null) { stmt.bindString(12, noticeTime); @@ -209,27 +204,27 @@ @Override public Long readKey(Cursor cursor, int offset) { return cursor.isNull(offset + 0) ? null : cursor.getLong(offset + 0); - } + } @Override public NoticeLocaleBean readEntity(Cursor cursor, int offset) { NoticeLocaleBean entity = new NoticeLocaleBean( // - cursor.isNull(offset + 0) ? null : cursor.getLong(offset + 0), // id - cursor.isNull(offset + 1) ? null : cursor.getString(offset + 1), // messageId - cursor.isNull(offset + 2) ? null : cursor.getString(offset + 2), // appid - cursor.isNull(offset + 3) ? null : cursor.getString(offset + 3), // clientId - cursor.isNull(offset + 4) ? null : cursor.getString(offset + 4), // taskId - cursor.isNull(offset + 5) ? null : cursor.getString(offset + 5), // userId - cursor.isNull(offset + 6) ? null : cursor.getString(offset + 6), // title - cursor.isNull(offset + 7) ? null : cursor.getString(offset + 7), // content - cursor.isNull(offset + 8) ? null : cursor.getString(offset + 8), // deviceCode - cursor.isNull(offset + 9) ? null : cursor.getString(offset + 9), // jobId - cursor.isNull(offset + 10) ? null : cursor.getString(offset + 10), // isRead - cursor.isNull(offset + 11) ? null : cursor.getString(offset + 11) // noticeTime + cursor.isNull(offset + 0) ? null : cursor.getLong(offset + 0), // id + cursor.isNull(offset + 1) ? null : cursor.getString(offset + 1), // messageId + cursor.isNull(offset + 2) ? null : cursor.getString(offset + 2), // appid + cursor.isNull(offset + 3) ? null : cursor.getString(offset + 3), // clientId + cursor.isNull(offset + 4) ? null : cursor.getString(offset + 4), // taskId + cursor.isNull(offset + 5) ? null : cursor.getString(offset + 5), // userId + cursor.isNull(offset + 6) ? null : cursor.getString(offset + 6), // title + cursor.isNull(offset + 7) ? null : cursor.getString(offset + 7), // content + cursor.isNull(offset + 8) ? null : cursor.getString(offset + 8), // deviceCode + cursor.isNull(offset + 9) ? null : cursor.getString(offset + 9), // jobId + cursor.isNull(offset + 10) ? null : cursor.getString(offset + 10), // isRead + cursor.isNull(offset + 11) ? null : cursor.getString(offset + 11) // noticeTime ); return entity; } - + @Override public void readEntity(Cursor cursor, NoticeLocaleBean entity, int offset) { entity.setId(cursor.isNull(offset + 0) ? null : cursor.getLong(offset + 0)); @@ -244,17 +239,17 @@ entity.setJobId(cursor.isNull(offset + 9) ? null : cursor.getString(offset + 9)); entity.setIsRead(cursor.isNull(offset + 10) ? null : cursor.getString(offset + 10)); entity.setNoticeTime(cursor.isNull(offset + 11) ? null : cursor.getString(offset + 11)); - } - + } + @Override protected final Long updateKeyAfterInsert(NoticeLocaleBean entity, long rowId) { entity.setId(rowId); return rowId; } - + @Override public Long getKey(NoticeLocaleBean entity) { - if (entity != null) { + if(entity != null) { return entity.getId(); } else { return null; @@ -270,5 +265,5 @@ protected final boolean isEntityUpdateable() { return true; } - + } diff --git a/app/src/main/java/com/casic/app/smartwell/greendao/PipeLocalBeanDao.java b/app/src/main/java/com/casic/app/smartwell/greendao/PipeLocalBeanDao.java index aab4d3f..df5515a 100644 --- a/app/src/main/java/com/casic/app/smartwell/greendao/PipeLocalBeanDao.java +++ b/app/src/main/java/com/casic/app/smartwell/greendao/PipeLocalBeanDao.java @@ -12,10 +12,9 @@ import org.greenrobot.greendao.internal.DaoConfig; // THIS CODE IS GENERATED BY greenDAO, DO NOT EDIT. - -/** +/** * DAO for table "PIPE_LOCAL_BEAN". - */ +*/ public class PipeLocalBeanDao extends AbstractDao { public static final String TABLENAME = "PIPE_LOCAL_BEAN"; @@ -37,16 +36,14 @@ public PipeLocalBeanDao(DaoConfig config) { super(config); } - + public PipeLocalBeanDao(DaoConfig config, DaoSession daoSession) { super(config, daoSession); } - /** - * Creates the underlying database table. - */ + /** Creates the underlying database table. */ public static void createTable(Database db, boolean ifNotExists) { - String constraint = ifNotExists ? "IF NOT EXISTS " : ""; + String constraint = ifNotExists? "IF NOT EXISTS ": ""; db.execSQL("CREATE TABLE " + constraint + "\"PIPE_LOCAL_BEAN\" (" + // "\"_id\" INTEGER PRIMARY KEY AUTOINCREMENT ," + // 0: id "\"PIPE_CODE\" TEXT," + // 1: pipeCode @@ -56,9 +53,7 @@ "\"START_LONGITUDE_GD\" TEXT);"); // 5: startLongitudeGd } - /** - * Drops the underlying database table. - */ + /** Drops the underlying database table. */ public static void dropTable(Database db, boolean ifExists) { String sql = "DROP TABLE " + (ifExists ? "IF EXISTS " : "") + "\"PIPE_LOCAL_BEAN\""; db.execSQL(sql); @@ -67,32 +62,32 @@ @Override protected final void bindValues(DatabaseStatement stmt, PipeLocalBean entity) { stmt.clearBindings(); - + Long id = entity.getId(); if (id != null) { stmt.bindLong(1, id); } - + String pipeCode = entity.getPipeCode(); if (pipeCode != null) { stmt.bindString(2, pipeCode); } - + String endLatitudeGd = entity.getEndLatitudeGd(); if (endLatitudeGd != null) { stmt.bindString(3, endLatitudeGd); } - + String endLongitudeGd = entity.getEndLongitudeGd(); if (endLongitudeGd != null) { stmt.bindString(4, endLongitudeGd); } - + String startLatitudeGd = entity.getStartLatitudeGd(); if (startLatitudeGd != null) { stmt.bindString(5, startLatitudeGd); } - + String startLongitudeGd = entity.getStartLongitudeGd(); if (startLongitudeGd != null) { stmt.bindString(6, startLongitudeGd); @@ -102,32 +97,32 @@ @Override protected final void bindValues(SQLiteStatement stmt, PipeLocalBean entity) { stmt.clearBindings(); - + Long id = entity.getId(); if (id != null) { stmt.bindLong(1, id); } - + String pipeCode = entity.getPipeCode(); if (pipeCode != null) { stmt.bindString(2, pipeCode); } - + String endLatitudeGd = entity.getEndLatitudeGd(); if (endLatitudeGd != null) { stmt.bindString(3, endLatitudeGd); } - + String endLongitudeGd = entity.getEndLongitudeGd(); if (endLongitudeGd != null) { stmt.bindString(4, endLongitudeGd); } - + String startLatitudeGd = entity.getStartLatitudeGd(); if (startLatitudeGd != null) { stmt.bindString(5, startLatitudeGd); } - + String startLongitudeGd = entity.getStartLongitudeGd(); if (startLongitudeGd != null) { stmt.bindString(6, startLongitudeGd); @@ -137,21 +132,21 @@ @Override public Long readKey(Cursor cursor, int offset) { return cursor.isNull(offset + 0) ? null : cursor.getLong(offset + 0); - } + } @Override public PipeLocalBean readEntity(Cursor cursor, int offset) { PipeLocalBean entity = new PipeLocalBean( // - cursor.isNull(offset + 0) ? null : cursor.getLong(offset + 0), // id - cursor.isNull(offset + 1) ? null : cursor.getString(offset + 1), // pipeCode - cursor.isNull(offset + 2) ? null : cursor.getString(offset + 2), // endLatitudeGd - cursor.isNull(offset + 3) ? null : cursor.getString(offset + 3), // endLongitudeGd - cursor.isNull(offset + 4) ? null : cursor.getString(offset + 4), // startLatitudeGd - cursor.isNull(offset + 5) ? null : cursor.getString(offset + 5) // startLongitudeGd + cursor.isNull(offset + 0) ? null : cursor.getLong(offset + 0), // id + cursor.isNull(offset + 1) ? null : cursor.getString(offset + 1), // pipeCode + cursor.isNull(offset + 2) ? null : cursor.getString(offset + 2), // endLatitudeGd + cursor.isNull(offset + 3) ? null : cursor.getString(offset + 3), // endLongitudeGd + cursor.isNull(offset + 4) ? null : cursor.getString(offset + 4), // startLatitudeGd + cursor.isNull(offset + 5) ? null : cursor.getString(offset + 5) // startLongitudeGd ); return entity; } - + @Override public void readEntity(Cursor cursor, PipeLocalBean entity, int offset) { entity.setId(cursor.isNull(offset + 0) ? null : cursor.getLong(offset + 0)); @@ -160,17 +155,17 @@ entity.setEndLongitudeGd(cursor.isNull(offset + 3) ? null : cursor.getString(offset + 3)); entity.setStartLatitudeGd(cursor.isNull(offset + 4) ? null : cursor.getString(offset + 4)); entity.setStartLongitudeGd(cursor.isNull(offset + 5) ? null : cursor.getString(offset + 5)); - } - + } + @Override protected final Long updateKeyAfterInsert(PipeLocalBean entity, long rowId) { entity.setId(rowId); return rowId; } - + @Override public Long getKey(PipeLocalBean entity) { - if (entity != null) { + if(entity != null) { return entity.getId(); } else { return null; @@ -186,5 +181,5 @@ protected final boolean isEntityUpdateable() { return true; } - + } diff --git a/app/src/main/java/com/casic/app/smartwell/view/ChangePasswordActivity.kt b/app/src/main/java/com/casic/app/smartwell/view/ChangePasswordActivity.kt index 8e41039..9f1dd40 100644 --- a/app/src/main/java/com/casic/app/smartwell/view/ChangePasswordActivity.kt +++ b/app/src/main/java/com/casic/app/smartwell/view/ChangePasswordActivity.kt @@ -14,7 +14,7 @@ import com.pengxh.kt.lite.extensions.show import com.pengxh.kt.lite.utils.ActivityStackManager import com.pengxh.kt.lite.utils.LoadState -import com.pengxh.kt.lite.utils.LoadingDialogHub +import com.pengxh.kt.lite.utils.LoadingDialog import com.pengxh.kt.lite.widget.TitleBarView import java.nio.charset.StandardCharsets @@ -46,15 +46,15 @@ override fun observeRequestState() { userViewModel.loadState.observe(this) { when (it) { - is LoadState.Loading -> LoadingDialogHub.show(this, "修改中,请稍后") + is LoadState.Loading -> LoadingDialog.show(this, "修改中,请稍后") is LoadState.Success -> { - LoadingDialogHub.dismiss() + LoadingDialog.dismiss() AuthenticationHelper.removeToken() this.navigatePageTo() ActivityStackManager.finishAllActivity() } - else -> LoadingDialogHub.dismiss() + else -> LoadingDialog.dismiss() } } } diff --git a/app/src/main/java/com/casic/app/smartwell/view/DeployedWellActivity.kt b/app/src/main/java/com/casic/app/smartwell/view/DeployedWellActivity.kt index fb4339c..28a5078 100644 --- a/app/src/main/java/com/casic/app/smartwell/view/DeployedWellActivity.kt +++ b/app/src/main/java/com/casic/app/smartwell/view/DeployedWellActivity.kt @@ -83,8 +83,8 @@ } //添加分割线 - binding.deployedListView.addItemDecoration( - RecyclerViewItemOffsets(0, 5, 0, 5) + binding.recyclerView.addItemDecoration( + RecyclerViewItemOffsets(0, 7, 0, 7) ) } @@ -149,12 +149,11 @@ } else { item.deep.toString() + "m" } - viewHolder.setText(R.id.wellNameView, item.wellName) + viewHolder.setText(R.id.wellTypeView, item.wellTypeName) .setText(R.id.wellDepthView, "深:${deep}") .setText(R.id.wellCodeView, "点位编号:${item.wellCode}") - .setText(R.id.wellTypeView, "点位类型:${item.wellTypeName}") .setText(R.id.ownerShipView, "权属单位:${item.deptName}") - .setText(R.id.wellLocationView, "点位置:${item.position}") + .setText(R.id.wellLocationView, "点位位置:${item.position}") .setOnClickListener( R.id.operationButton, object : View.OnClickListener { override fun onClick(v: View?) { @@ -207,7 +206,7 @@ }) } } - binding.deployedListView.adapter = deployAdapter + binding.recyclerView.adapter = deployAdapter deployAdapter.setOnItemClickedListener(object : NormalRecyclerAdapter.OnItemClickedListener { override fun onItemClicked(position: Int, t: WellListModel.DataBean.RowsBean) { diff --git a/app/src/main/java/com/casic/app/smartwell/view/LoginActivity.kt b/app/src/main/java/com/casic/app/smartwell/view/LoginActivity.kt index e4bb0e3..834527b 100644 --- a/app/src/main/java/com/casic/app/smartwell/view/LoginActivity.kt +++ b/app/src/main/java/com/casic/app/smartwell/view/LoginActivity.kt @@ -21,7 +21,7 @@ import com.pengxh.kt.lite.extensions.navigatePageTo import com.pengxh.kt.lite.extensions.readAssetsFile import com.pengxh.kt.lite.extensions.show -import com.pengxh.kt.lite.utils.LoadingDialogHub +import com.pengxh.kt.lite.utils.LoadingDialog import com.pengxh.kt.lite.utils.SaveKeyValues import kotlinx.coroutines.Dispatchers import kotlinx.coroutines.launch @@ -106,11 +106,11 @@ override fun observeRequestState() { authenticateViewModel.loadState.observe(this) { - LoadingDialogHub.show(this, "登录中,请稍后") + LoadingDialog.show(this, "登录中,请稍后") } loginViewModel.loadState.observe(this) { - LoadingDialogHub.dismiss() + LoadingDialog.dismiss() } } diff --git a/app/src/main/java/com/casic/app/smartwell/view/OrderCompletedDetailActivity.kt b/app/src/main/java/com/casic/app/smartwell/view/OrderCompletedDetailActivity.kt index db8ad1f..75cd905 100644 --- a/app/src/main/java/com/casic/app/smartwell/view/OrderCompletedDetailActivity.kt +++ b/app/src/main/java/com/casic/app/smartwell/view/OrderCompletedDetailActivity.kt @@ -17,7 +17,7 @@ import com.pengxh.kt.lite.extensions.show import com.pengxh.kt.lite.utils.Constant import com.pengxh.kt.lite.utils.LoadState -import com.pengxh.kt.lite.utils.LoadingDialogHub +import com.pengxh.kt.lite.utils.LoadingDialog import com.pengxh.kt.lite.widget.TitleBarView import com.pengxh.kt.lite.widget.dialog.AlertMessageDialog @@ -44,7 +44,7 @@ } override fun initOnCreate(savedInstanceState: Bundle?) { - val jobId = intent.getStringExtra(Constant.INTENT_PARAM)!! + val jobId = intent.getStringExtra(Constant.INTENT_PARAM_KEY)!! orderViewModel = ViewModelProvider(this)[OrderViewModel::class.java] orderViewModel.getWorkOrderDetail(jobId) orderViewModel.detailModel.observe(this) { @@ -154,8 +154,8 @@ override fun observeRequestState() { orderViewModel.loadState.observe(this) { when (it) { - is LoadState.Loading -> LoadingDialogHub.show(this, "数据加载中,请稍后") - else -> LoadingDialogHub.dismiss() + is LoadState.Loading -> LoadingDialog.show(this, "数据加载中,请稍后") + else -> LoadingDialog.dismiss() } } } diff --git a/app/src/main/java/com/casic/app/smartwell/view/OrderInHandleDetailActivity.kt b/app/src/main/java/com/casic/app/smartwell/view/OrderInHandleDetailActivity.kt index d70a979..04a7d5d 100644 --- a/app/src/main/java/com/casic/app/smartwell/view/OrderInHandleDetailActivity.kt +++ b/app/src/main/java/com/casic/app/smartwell/view/OrderInHandleDetailActivity.kt @@ -38,7 +38,7 @@ import com.pengxh.kt.lite.extensions.show import com.pengxh.kt.lite.utils.Constant import com.pengxh.kt.lite.utils.LoadState -import com.pengxh.kt.lite.utils.LoadingDialogHub +import com.pengxh.kt.lite.utils.LoadingDialog import com.pengxh.kt.lite.widget.TitleBarView import com.pengxh.kt.lite.widget.dialog.AlertControlDialog import com.pengxh.kt.lite.widget.dialog.AlertMessageDialog @@ -93,7 +93,7 @@ ) binding.addImageRecyclerView.adapter = imageAdapter - val jobId = intent.getStringExtra(Constant.INTENT_PARAM)!!//初始化图片九宫格 + val jobId = intent.getStringExtra(Constant.INTENT_PARAM_KEY)!!//初始化图片九宫格 orderViewModel.getWorkOrderDetail(jobId) orderViewModel.detailModel.observe(this) { if (it.code == 200) { @@ -312,41 +312,41 @@ override fun observeRequestState() { orderViewModel.loadState.observe(this) { when (it) { - is LoadState.Loading -> LoadingDialogHub.show(this, "数据加载中,请稍后") - else -> LoadingDialogHub.dismiss() + is LoadState.Loading -> LoadingDialog.show(this, "数据加载中,请稍后") + else -> LoadingDialog.dismiss() } } uploadImageViewModel.loadState.observe(this) { when (it) { - LoadState.Loading -> LoadingDialogHub.show(this, "图片上传中,请稍后...") - else -> LoadingDialogHub.dismiss() + LoadState.Loading -> LoadingDialog.show(this, "图片上传中,请稍后...") + else -> LoadingDialog.dismiss() } } //转单状态处理 operationViewModel.loadState.observe(this) { when (it) { - is LoadState.Loading -> LoadingDialogHub.show(this, "转单中,请稍后") + is LoadState.Loading -> LoadingDialog.show(this, "转单中,请稍后") is LoadState.Success -> { - LoadingDialogHub.dismiss() + LoadingDialog.dismiss() this.finish() } - else -> LoadingDialogHub.dismiss() + else -> LoadingDialog.dismiss() } } //处理完成工单状态处理 operationViewModel.loadState.observe(this) { when (it) { - is LoadState.Loading -> LoadingDialogHub.show(this, "处理中,请稍后") + is LoadState.Loading -> LoadingDialog.show(this, "处理中,请稍后") is LoadState.Success -> { - LoadingDialogHub.dismiss() + LoadingDialog.dismiss() this.finish() } - else -> LoadingDialogHub.dismiss() + else -> LoadingDialog.dismiss() } } } diff --git a/app/src/main/java/com/casic/app/smartwell/view/OrderNotConfirmedDetailActivity.kt b/app/src/main/java/com/casic/app/smartwell/view/OrderNotConfirmedDetailActivity.kt index 8e036d2..687ec86 100644 --- a/app/src/main/java/com/casic/app/smartwell/view/OrderNotConfirmedDetailActivity.kt +++ b/app/src/main/java/com/casic/app/smartwell/view/OrderNotConfirmedDetailActivity.kt @@ -36,7 +36,7 @@ import com.pengxh.kt.lite.extensions.show import com.pengxh.kt.lite.utils.Constant import com.pengxh.kt.lite.utils.LoadState -import com.pengxh.kt.lite.utils.LoadingDialogHub +import com.pengxh.kt.lite.utils.LoadingDialog import com.pengxh.kt.lite.widget.TitleBarView import com.pengxh.kt.lite.widget.dialog.AlertControlDialog import com.pengxh.kt.lite.widget.dialog.AlertMessageDialog @@ -80,7 +80,7 @@ } override fun initOnCreate(savedInstanceState: Bundle?) { - val jobId = intent.getStringExtra(Constant.INTENT_PARAM)!! + val jobId = intent.getStringExtra(Constant.INTENT_PARAM_KEY)!! //初始化图片九宫格 //左外边距,左内边距,右内边距,右外边距 val viewWidth = getScreenWidth() - (10 + 10 + 10 + 10).dp2px(this) @@ -263,41 +263,41 @@ //数据加载状态处理 orderViewModel.loadState.observe(this) { when (it) { - is LoadState.Loading -> LoadingDialogHub.show(this, "数据加载中,请稍后") - else -> LoadingDialogHub.dismiss() + is LoadState.Loading -> LoadingDialog.show(this, "数据加载中,请稍后") + else -> LoadingDialog.dismiss() } } uploadImageViewModel.loadState.observe(this) { when (it) { - LoadState.Loading -> LoadingDialogHub.show(this, "图片上传中,请稍后") - else -> LoadingDialogHub.dismiss() + LoadState.Loading -> LoadingDialog.show(this, "图片上传中,请稍后") + else -> LoadingDialog.dismiss() } } //转单状态处理 operationViewModel.loadState.observe(this) { when (it) { - is LoadState.Loading -> LoadingDialogHub.show(this, "转单中,请稍后") + is LoadState.Loading -> LoadingDialog.show(this, "转单中,请稍后") is LoadState.Success -> { - LoadingDialogHub.dismiss() + LoadingDialog.dismiss() this.finish() } - else -> LoadingDialogHub.dismiss() + else -> LoadingDialog.dismiss() } } //确认工单状态处理 operationViewModel.loadState.observe(this) { when (it) { - is LoadState.Loading -> LoadingDialogHub.show(this, "处理中,请稍后") + is LoadState.Loading -> LoadingDialog.show(this, "处理中,请稍后") is LoadState.Success -> { - LoadingDialogHub.dismiss() + LoadingDialog.dismiss() this.finish() } - else -> LoadingDialogHub.dismiss() + else -> LoadingDialog.dismiss() } } } diff --git a/app/src/main/java/com/casic/app/smartwell/view/OrderNotProcessedDetailActivity.kt b/app/src/main/java/com/casic/app/smartwell/view/OrderNotProcessedDetailActivity.kt index d3f22dc..0c97a52 100644 --- a/app/src/main/java/com/casic/app/smartwell/view/OrderNotProcessedDetailActivity.kt +++ b/app/src/main/java/com/casic/app/smartwell/view/OrderNotProcessedDetailActivity.kt @@ -18,7 +18,7 @@ import com.pengxh.kt.lite.extensions.show import com.pengxh.kt.lite.utils.Constant import com.pengxh.kt.lite.utils.LoadState -import com.pengxh.kt.lite.utils.LoadingDialogHub +import com.pengxh.kt.lite.utils.LoadingDialog import com.pengxh.kt.lite.widget.TitleBarView import com.pengxh.kt.lite.widget.dialog.AlertControlDialog import com.pengxh.kt.lite.widget.dialog.AlertMessageDialog @@ -50,7 +50,7 @@ } override fun initOnCreate(savedInstanceState: Bundle?) { - this.jobId = intent.getStringExtra(Constant.INTENT_PARAM)!! + this.jobId = intent.getStringExtra(Constant.INTENT_PARAM_KEY)!! orderViewModel = ViewModelProvider(this)[OrderViewModel::class.java] operationViewModel = ViewModelProvider(this)[OperationViewModel::class.java] wellViewModel = ViewModelProvider(this)[WellViewModel::class.java] @@ -162,21 +162,21 @@ //数据加载状态处理 orderViewModel.loadState.observe(this) { when (it) { - is LoadState.Loading -> LoadingDialogHub.show(this, "数据加载中,请稍后") - else -> LoadingDialogHub.dismiss() + is LoadState.Loading -> LoadingDialog.show(this, "数据加载中,请稍后") + else -> LoadingDialog.dismiss() } } //接单状态处理 operationViewModel.loadState.observe(this) { when (it) { - is LoadState.Loading -> LoadingDialogHub.show(this, "接单中,请稍后") + is LoadState.Loading -> LoadingDialog.show(this, "接单中,请稍后") is LoadState.Success -> { - LoadingDialogHub.dismiss() + LoadingDialog.dismiss() this.finish() } - else -> LoadingDialogHub.dismiss() + else -> LoadingDialog.dismiss() } } } diff --git a/app/src/main/java/com/casic/app/smartwell/view/SearchResultActivity.kt b/app/src/main/java/com/casic/app/smartwell/view/SearchResultActivity.kt index 6a92917..4f3a674 100644 --- a/app/src/main/java/com/casic/app/smartwell/view/SearchResultActivity.kt +++ b/app/src/main/java/com/casic/app/smartwell/view/SearchResultActivity.kt @@ -19,7 +19,7 @@ import com.pengxh.kt.lite.extensions.show import com.pengxh.kt.lite.utils.Constant import com.pengxh.kt.lite.utils.LoadState -import com.pengxh.kt.lite.utils.LoadingDialogHub +import com.pengxh.kt.lite.utils.LoadingDialog import com.pengxh.kt.lite.utils.WeakReferenceHandler import com.pengxh.kt.lite.widget.TitleBarView import com.pengxh.kt.lite.widget.dialog.AlertControlDialog @@ -56,7 +56,7 @@ } override fun initOnCreate(savedInstanceState: Bundle?) { - args = intent.getStringArrayListExtra(Constant.INTENT_PARAM)!! + args = intent.getStringArrayListExtra(Constant.INTENT_PARAM_KEY)!! orderViewModel = ViewModelProvider(this)[OrderViewModel::class.java] operationViewModel = ViewModelProvider(this)[OperationViewModel::class.java] @@ -101,24 +101,24 @@ } } - binding.resultRecyclerView.addItemDecoration( - RecyclerViewItemOffsets(0, 5, 0, 5) + binding.recyclerView.addItemDecoration( + RecyclerViewItemOffsets(0, 7, 0, 7) ) } override fun observeRequestState() { orderViewModel.loadState.observe(this) { when (it) { - is LoadState.Loading -> LoadingDialogHub.show(this, "数据加载中,请稍后") - else -> LoadingDialogHub.dismiss() + is LoadState.Loading -> LoadingDialog.show(this, "数据加载中,请稍后") + else -> LoadingDialog.dismiss() } } //接单状态处理 operationViewModel.loadState.observe(this) { when (it) { - is LoadState.Loading -> LoadingDialogHub.show(this, "接单中,请稍后") + is LoadState.Loading -> LoadingDialog.show(this, "接单中,请稍后") is LoadState.Success -> { - LoadingDialogHub.dismiss() + LoadingDialog.dismiss() //接单成功之后刷新列表 dataBeans.removeAt(clickedPosition) searchResultAdapter.notifyItemRemoved(clickedPosition) @@ -127,7 +127,7 @@ ) } - else -> LoadingDialogHub.dismiss() + else -> LoadingDialog.dismiss() } } } @@ -162,7 +162,7 @@ } else { binding.emptyInclude.emptyView.hide() searchResultAdapter = SearchResultAdapter(this, dataBeans) - binding.resultRecyclerView.adapter = searchResultAdapter + binding.recyclerView.adapter = searchResultAdapter searchResultAdapter.setOnItemClickListener(object : SearchResultAdapter.OnItemClickListener { override fun onClicked(position: Int) { diff --git a/app/src/main/java/com/casic/app/smartwell/view/UnDeployWellActivity.kt b/app/src/main/java/com/casic/app/smartwell/view/UnDeployWellActivity.kt index 7f7cd3c..555c278 100644 --- a/app/src/main/java/com/casic/app/smartwell/view/UnDeployWellActivity.kt +++ b/app/src/main/java/com/casic/app/smartwell/view/UnDeployWellActivity.kt @@ -81,8 +81,8 @@ } } - binding.undeployListView.addItemDecoration( - RecyclerViewItemOffsets(0, 5, 0, 5) + binding.recyclerView.addItemDecoration( + RecyclerViewItemOffsets(0, 7, 0, 7) ) } @@ -147,12 +147,11 @@ } else { item.deep.toString() + "m" } - viewHolder.setText(R.id.wellNameView, item.wellName) + viewHolder.setText(R.id.wellTypeView, item.wellTypeName) .setText(R.id.wellDepthView, "深:${deep}") .setText(R.id.wellCodeView, "点位编号:${item.wellCode}") - .setText(R.id.wellTypeView, "点位类型:${item.wellTypeName}") .setText(R.id.ownerShipView, "权属单位:${item.deptName}") - .setText(R.id.wellLocationView, "点位置:${item.position}") + .setText(R.id.wellLocationView, "点位位置:${item.position}") .setOnClickListener( R.id.operationButton, object : View.OnClickListener { override fun onClick(v: View?) { @@ -185,7 +184,7 @@ ) } } - binding.undeployListView.adapter = unDeployAdapter + binding.recyclerView.adapter = unDeployAdapter unDeployAdapter.setOnItemClickedListener(object : NormalRecyclerAdapter.OnItemClickedListener { override fun onItemClicked(position: Int, t: WellListModel.DataBean.RowsBean) { diff --git a/app/src/main/java/com/casic/app/smartwell/view/WellDetailActivity.kt b/app/src/main/java/com/casic/app/smartwell/view/WellDetailActivity.kt index b50d067..eb8b468 100644 --- a/app/src/main/java/com/casic/app/smartwell/view/WellDetailActivity.kt +++ b/app/src/main/java/com/casic/app/smartwell/view/WellDetailActivity.kt @@ -16,7 +16,7 @@ import com.pengxh.kt.lite.extensions.show import com.pengxh.kt.lite.utils.Constant import com.pengxh.kt.lite.utils.LoadState -import com.pengxh.kt.lite.utils.LoadingDialogHub +import com.pengxh.kt.lite.utils.LoadingDialog import com.pengxh.kt.lite.widget.TitleBarView import com.pengxh.kt.lite.widget.dialog.AlertMessageDialog @@ -44,7 +44,7 @@ } override fun initOnCreate(savedInstanceState: Bundle?) { - val wellId = intent.getStringExtra(Constant.INTENT_PARAM)!! + val wellId = intent.getStringExtra(Constant.INTENT_PARAM_KEY)!! wellViewModel = ViewModelProvider(this)[WellViewModel::class.java] wellViewModel.getWellDetail(wellId) wellViewModel.wellDetailModel.observe(this) { @@ -132,8 +132,8 @@ override fun observeRequestState() { wellViewModel.loadState.observe(this) { when (it) { - is LoadState.Loading -> LoadingDialogHub.show(this, "数据加载中,请稍后") - else -> LoadingDialogHub.dismiss() + is LoadState.Loading -> LoadingDialog.show(this, "数据加载中,请稍后") + else -> LoadingDialog.dismiss() } } } diff --git a/app/src/main/java/com/casic/app/smartwell/view/WellManagementActivity.kt b/app/src/main/java/com/casic/app/smartwell/view/WellManagementActivity.kt index 084da95..457096b 100644 --- a/app/src/main/java/com/casic/app/smartwell/view/WellManagementActivity.kt +++ b/app/src/main/java/com/casic/app/smartwell/view/WellManagementActivity.kt @@ -94,8 +94,8 @@ } } - binding.wellListView.addItemDecoration( - RecyclerViewItemOffsets(0, 5, 0, 5) + binding.recyclerView.addItemDecoration( + RecyclerViewItemOffsets(0, 7, 0, 7) ) } @@ -175,13 +175,12 @@ } else { item.deep.toString() + "m" } - viewHolder.setText(R.id.wellNameView, item.wellName) + viewHolder.setText(R.id.wellTypeView, item.wellTypeName) .setText(R.id.wellStateView, "已${item.bfztName}") .setText(R.id.wellDepthView, "深:${deep}") .setText(R.id.wellCodeView, "点位编号:${item.wellCode}") - .setText(R.id.wellTypeView, "点位类型:${item.wellTypeName}") .setText(R.id.ownerShipView, "权属单位:${item.deptName}") - .setText(R.id.wellLocationView, "点位置:${item.position}") + .setText(R.id.wellLocationView, "点位位置:${item.position}") .setOnClickListener( R.id.navigationButton, object : View.OnClickListener { override fun onClick(v: View?) { @@ -200,7 +199,7 @@ ) } } - binding.wellListView.adapter = wellListAdapter + binding.recyclerView.adapter = wellListAdapter wellListAdapter.setOnItemClickedListener(object : NormalRecyclerAdapter.OnItemClickedListener { override fun onItemClicked(position: Int, t: WellListModel.DataBean.RowsBean) { diff --git a/app/src/main/java/com/casic/app/smartwell/view/WellMonitorActivity.kt b/app/src/main/java/com/casic/app/smartwell/view/WellMonitorActivity.kt index e3573eb..b87bdb7 100644 --- a/app/src/main/java/com/casic/app/smartwell/view/WellMonitorActivity.kt +++ b/app/src/main/java/com/casic/app/smartwell/view/WellMonitorActivity.kt @@ -11,7 +11,7 @@ import com.pengxh.kt.lite.base.KotlinBaseActivity import com.pengxh.kt.lite.utils.Constant import com.pengxh.kt.lite.utils.LoadState -import com.pengxh.kt.lite.utils.LoadingDialogHub +import com.pengxh.kt.lite.utils.LoadingDialog import com.pengxh.kt.lite.widget.TitleBarView class WellMonitorActivity : KotlinBaseActivity() { @@ -36,7 +36,7 @@ } override fun initOnCreate(savedInstanceState: Bundle?) { - val wellId = intent.getStringExtra(Constant.INTENT_PARAM)!! + val wellId = intent.getStringExtra(Constant.INTENT_PARAM_KEY)!! wellViewModel = ViewModelProvider(this)[WellViewModel::class.java] wellViewModel.getMonitorResult(wellId) wellViewModel.monitorModel.observe(this) { @@ -56,8 +56,8 @@ override fun observeRequestState() { wellViewModel.loadState.observe(this) { when (it) { - is LoadState.Loading -> LoadingDialogHub.show(this, "数据加载中,请稍后") - else -> LoadingDialogHub.dismiss() + is LoadState.Loading -> LoadingDialog.show(this, "数据加载中,请稍后") + else -> LoadingDialog.dismiss() } } } diff --git a/app/src/main/java/com/casic/app/smartwell/view/WellOperationActivity.kt b/app/src/main/java/com/casic/app/smartwell/view/WellOperationActivity.kt index 8d333bf..347ebb6 100644 --- a/app/src/main/java/com/casic/app/smartwell/view/WellOperationActivity.kt +++ b/app/src/main/java/com/casic/app/smartwell/view/WellOperationActivity.kt @@ -23,7 +23,7 @@ import com.pengxh.kt.lite.extensions.navigatePageTo import com.pengxh.kt.lite.extensions.show import com.pengxh.kt.lite.utils.LoadState -import com.pengxh.kt.lite.utils.LoadingDialogHub +import com.pengxh.kt.lite.utils.LoadingDialog import com.pengxh.kt.lite.utils.WeakReferenceHandler import com.pengxh.kt.lite.widget.dialog.AlertControlDialog @@ -109,8 +109,8 @@ } } - binding.operationListView.addItemDecoration( - RecyclerViewItemOffsets(0, 5, 0, 5) + binding.recyclerView.addItemDecoration( + RecyclerViewItemOffsets(0, 7, 0, 7) ) } @@ -123,13 +123,13 @@ override fun observeRequestState() { wellViewModel.loadState.observe(this) { when (it) { - is LoadState.Loading -> LoadingDialogHub.show(this, "处理中,请稍后") + is LoadState.Loading -> LoadingDialog.show(this, "处理中,请稍后") is LoadState.Success -> { - LoadingDialogHub.dismiss() + LoadingDialog.dismiss() wellOperationAdapter.notifyItemChanged(clickedPosition) } - else -> LoadingDialogHub.dismiss() + else -> LoadingDialog.dismiss() } } } @@ -203,24 +203,23 @@ if (item.bfztName == "布防") { viewHolder.setImageResource( R.id.wellStateView, R.drawable.bg_solid_text_green_radius_5 - ).setText(R.id.wellStateView, "撤防") + ).setText(R.id.operationButton, "撤防") } else { viewHolder.setImageResource( R.id.wellStateView, R.drawable.bg_solid_text_red_radius_5 - ).setText(R.id.wellStateView, "布防") + ).setText(R.id.operationButton, "布防") } val deep = if (item.deep.toString().isBlank()) { "未知" } else { item.deep.toString() + "m" } - viewHolder.setText(R.id.wellNameView, item.wellName) + viewHolder.setText(R.id.wellTypeView, item.wellTypeName) .setText(R.id.wellStateView, "已${item.bfztName}") .setText(R.id.wellDepthView, "深:${deep}") .setText(R.id.wellCodeView, "点位编号:${item.wellCode}") - .setText(R.id.wellTypeView, "点位类型:${item.wellTypeName}") .setText(R.id.ownerShipView, "权属单位:${item.deptName}") - .setText(R.id.wellLocationView, "点位置:${item.position}") + .setText(R.id.wellLocationView, "点位位置:${item.position}") .setOnClickListener( R.id.operationButton, object : View.OnClickListener { override fun onClick(v: View?) { @@ -280,7 +279,7 @@ ) } } - binding.operationListView.adapter = wellOperationAdapter + binding.recyclerView.adapter = wellOperationAdapter wellOperationAdapter.setOnItemClickedListener(object : NormalRecyclerAdapter.OnItemClickedListener { override fun onItemClicked(position: Int, t: WellListModel.DataBean.RowsBean) { diff --git a/app/src/main/res/drawable/ic_down.xml b/app/src/main/res/drawable/ic_down.xml index 20e6476..6987e6c 100644 --- a/app/src/main/res/drawable/ic_down.xml +++ b/app/src/main/res/drawable/ic_down.xml @@ -1,6 +1,6 @@ + + diff --git a/app/build.gradle b/app/build.gradle index 296fb6f..c18c251 100644 --- a/app/build.gradle +++ b/app/build.gradle @@ -40,10 +40,6 @@ // VIVO 相关应用参数 VIVO_APP_ID : "105749048", VIVO_APP_KEY : "e460fbf2c689e0f8c58ecc6aa62e1803", - - // 小米相关应用参数 -// XIAOMI_APP_ID : "", -// XIAOMI_APP_KEY : "", ] // 版本名后面添加一句话,意思就是flavor dimension 它的维度就是该版本号,多渠道打包很重要 @@ -107,7 +103,7 @@ dependencies { implementation fileTree(dir: 'libs', include: ['*.jar']) //基础依赖库 - implementation 'com.github.AndroidCoderPeng:Kotlin-lite-lib:1.0.10' + implementation 'com.github.AndroidCoderPeng:Kotlin-lite-lib:1.1.0' implementation 'androidx.appcompat:appcompat:1.6.1' implementation 'androidx.core:core-ktx:1.9.0' implementation 'androidx.constraintlayout:constraintlayout:2.1.4' @@ -165,8 +161,6 @@ implementation 'commons-codec:commons-codec:1.15' implementation 'com.android.support:support-annotations:28.0.0' implementation 'com.assist-v3:vivo:3.1.2' // vivo -// implementation 'com.getui.opt:xmp:3.3.1' // 小米 - //数据库框架 implementation 'org.greenrobot:greendao:3.3.0' //数据库升级 diff --git a/app/src/main/AndroidManifest.xml b/app/src/main/AndroidManifest.xml index c0af158..e0519bf 100644 --- a/app/src/main/AndroidManifest.xml +++ b/app/src/main/AndroidManifest.xml @@ -90,10 +90,10 @@ - + + android:value="ee96d8b5e12de3fbb29949efd57418a8" /> () @@ -150,7 +158,7 @@ val cameraPosition = CameraPosition(centerLatLng, 14f, 0f, 0f) val cameraUpdate = CameraUpdateFactory.newCameraPosition(cameraPosition) withContext(Dispatchers.Main) { - LoadingDialogHub.dismiss() + LoadingDialog.dismiss() aMap.animateCamera(cameraUpdate, 1500, null) } } @@ -239,11 +247,6 @@ } override fun initEvent() { - binding.rightOptionView.setOnClickListener { - val x = binding.rightOptionView.width - easyPopupWindow.width - easyPopupWindow.showAsDropDown(binding.rightOptionView, x, 0) - } - //撤防点位 binding.unDeployedLayout.setOnClickListener { requireContext().navigatePageTo() @@ -263,11 +266,11 @@ override fun observeRequestState() { wellViewModel.loadState.observe(this) { when (it) { - is LoadState.Loading -> LoadingDialogHub.show( + is LoadState.Loading -> LoadingDialog.show( requireActivity(), "数据加载中,请稍后..." ) - else -> LoadingDialogHub.dismiss() + else -> LoadingDialog.dismiss() } } } @@ -376,7 +379,7 @@ }).build().show() } }) - infoPopup.showAsDropDown(binding.rightOptionView) +// infoPopup.showAsDropDown(binding.rightOptionView) } override fun onCameraChange(p0: CameraPosition?) { diff --git a/app/src/main/java/com/casic/app/smartwell/fragment/HomePageNoClusterFragment.kt b/app/src/main/java/com/casic/app/smartwell/fragment/HomePageNoClusterFragment.kt index 802426a..b25f743 100644 --- a/app/src/main/java/com/casic/app/smartwell/fragment/HomePageNoClusterFragment.kt +++ b/app/src/main/java/com/casic/app/smartwell/fragment/HomePageNoClusterFragment.kt @@ -38,8 +38,9 @@ import com.pengxh.kt.lite.extensions.navigatePageTo import com.pengxh.kt.lite.extensions.show import com.pengxh.kt.lite.utils.LoadState -import com.pengxh.kt.lite.utils.LoadingDialogHub +import com.pengxh.kt.lite.utils.LoadingDialog import com.pengxh.kt.lite.widget.EasyPopupWindow +import com.pengxh.kt.lite.widget.TitleBarView import com.pengxh.kt.lite.widget.dialog.AlertControlDialog import kotlinx.coroutines.Dispatchers import kotlinx.coroutines.launch @@ -78,7 +79,15 @@ override fun setupTopBarLayout() { binding.rootView.initImmersionBar(this, false, R.color.mainThemeColor) - binding.titleView.text = "首页" + binding.titleView.setOnClickListener(object : TitleBarView.OnClickListener { + override fun onLeftClick() { + + } + + override fun onRightClick() { + easyPopupWindow.showAsDropDown(binding.titleView, binding.titleView.width, 0) + } + }) } override fun initOnCreate(savedInstanceState: Bundle?) { @@ -112,7 +121,7 @@ //渲染井位置 lifecycleScope.launch(Dispatchers.Main) { - LoadingDialogHub.show(requireActivity(), "数据加载中,请稍后") + LoadingDialog.show(requireActivity(), "数据加载中,请稍后") withContext(Dispatchers.IO) { //取Well缓存 val allMarkerOptions = ArrayList() @@ -144,7 +153,7 @@ val cameraPosition = CameraPosition(centerLatLng, 14f, 0f, 0f) val cameraUpdate = CameraUpdateFactory.newCameraPosition(cameraPosition) withContext(Dispatchers.Main) { - LoadingDialogHub.dismiss() + LoadingDialog.dismiss() aMap.animateCamera(cameraUpdate, 1500, null) } } @@ -238,11 +247,6 @@ } override fun initEvent() { - binding.rightOptionView.setOnClickListener { - val x = binding.rightOptionView.width - easyPopupWindow.width - easyPopupWindow.showAsDropDown(binding.rightOptionView, x, 0) - } - //撤防点位 binding.unDeployedLayout.setOnClickListener { requireContext().navigatePageTo() @@ -262,11 +266,11 @@ override fun observeRequestState() { wellViewModel.loadState.observe(this) { when (it) { - is LoadState.Loading -> LoadingDialogHub.show( + is LoadState.Loading -> LoadingDialog.show( requireActivity(), "数据加载中,请稍后..." ) - else -> LoadingDialogHub.dismiss() + else -> LoadingDialog.dismiss() } } } diff --git a/app/src/main/java/com/casic/app/smartwell/fragment/MinePageFragment.kt b/app/src/main/java/com/casic/app/smartwell/fragment/MinePageFragment.kt index 09a570c..dcb48f8 100644 --- a/app/src/main/java/com/casic/app/smartwell/fragment/MinePageFragment.kt +++ b/app/src/main/java/com/casic/app/smartwell/fragment/MinePageFragment.kt @@ -35,7 +35,7 @@ import com.pengxh.kt.lite.utils.ActivityStackManager import com.pengxh.kt.lite.utils.FileDownloadManager import com.pengxh.kt.lite.utils.LoadState -import com.pengxh.kt.lite.utils.LoadingDialogHub +import com.pengxh.kt.lite.utils.LoadingDialog import com.pengxh.kt.lite.widget.dialog.AlertControlDialog import com.pengxh.kt.lite.widget.dialog.BottomActionSheet import kotlinx.coroutines.Dispatchers @@ -60,7 +60,6 @@ override fun setupTopBarLayout() { binding.rootView.initImmersionBar(this, false, R.color.mainThemeColor) - binding.titleInclude.titleView.text = "我的" } override fun initOnCreate(savedInstanceState: Bundle?) { @@ -155,27 +154,27 @@ override fun observeRequestState() { userViewModel.loadState.observe(this) { when (it) { - is LoadState.Loading -> LoadingDialogHub.show( + is LoadState.Loading -> LoadingDialog.show( requireActivity(), "检查版本中,请稍后" ) - else -> LoadingDialogHub.dismiss() + else -> LoadingDialog.dismiss() } } wellViewModel.loadState.observe(this) { when (it) { - is LoadState.Loading -> LoadingDialogHub.show( + is LoadState.Loading -> LoadingDialog.show( requireActivity(), "数据更新中,请稍后" ) is LoadState.Fail -> { - LoadingDialogHub.dismiss() + LoadingDialog.dismiss() "数据更新超时".show(requireContext()) } else -> { - LoadingDialogHub.dismiss() + LoadingDialog.dismiss() AlertControlDialog.Builder().setContext(requireContext()).setTitle("温馨提示") .setMessage("数据更新成功,请重启应用").setNegativeButton("取消") .setPositiveButton("确定").setOnDialogButtonClickListener(object : @@ -197,17 +196,17 @@ lineViewModel.loadState.observe(this) { when (it) { - is LoadState.Loading -> LoadingDialogHub.show( + is LoadState.Loading -> LoadingDialog.show( requireActivity(), "数据更新中,请稍后" ) is LoadState.Fail -> { - LoadingDialogHub.dismiss() + LoadingDialog.dismiss() "数据更新超时".show(requireContext()) } else -> { - LoadingDialogHub.dismiss() + LoadingDialog.dismiss() AlertControlDialog.Builder().setContext(requireContext()).setTitle("温馨提示") .setMessage("数据更新成功,请重启应用").setNegativeButton("取消") .setPositiveButton("确定").setOnDialogButtonClickListener(object : diff --git a/app/src/main/java/com/casic/app/smartwell/fragment/NoticePageFragment.kt b/app/src/main/java/com/casic/app/smartwell/fragment/NoticePageFragment.kt index 171b555..3c93f54 100644 --- a/app/src/main/java/com/casic/app/smartwell/fragment/NoticePageFragment.kt +++ b/app/src/main/java/com/casic/app/smartwell/fragment/NoticePageFragment.kt @@ -48,7 +48,6 @@ override fun setupTopBarLayout() { binding.rootView.initImmersionBar(this, false, R.color.mainThemeColor) - binding.titleInclude.titleView.text = "消息" } override fun initOnCreate(savedInstanceState: Bundle?) { diff --git a/app/src/main/java/com/casic/app/smartwell/fragment/OrderListFragment.kt b/app/src/main/java/com/casic/app/smartwell/fragment/OrderListFragment.kt index 93ff35b..5e38acb 100644 --- a/app/src/main/java/com/casic/app/smartwell/fragment/OrderListFragment.kt +++ b/app/src/main/java/com/casic/app/smartwell/fragment/OrderListFragment.kt @@ -12,6 +12,7 @@ import com.casic.app.smartwell.view.SearchOrderActivity import com.pengxh.kt.lite.base.KotlinBaseFragment import com.pengxh.kt.lite.extensions.navigatePageTo +import com.pengxh.kt.lite.widget.TitleBarView class OrderListFragment : KotlinBaseFragment() { @@ -25,15 +26,22 @@ } override fun initViewBinding( - inflater: LayoutInflater, - container: ViewGroup? + inflater: LayoutInflater, container: ViewGroup? ): FragmentOrderBinding { return FragmentOrderBinding.inflate(inflater, container, false) } override fun setupTopBarLayout() { binding.rootView.initImmersionBar(this, false, R.color.mainThemeColor) - binding.titleView.text = "工单" + binding.titleView.setOnClickListener(object : TitleBarView.OnClickListener { + override fun onLeftClick() { + + } + + override fun onRightClick() { + requireContext().navigatePageTo() + } + }) } override fun initOnCreate(savedInstanceState: Bundle?) { @@ -51,8 +59,6 @@ } override fun initEvent() { - binding.rightOptionView.setOnClickListener { - requireContext().navigatePageTo() - } + } } \ No newline at end of file diff --git a/app/src/main/java/com/casic/app/smartwell/fragment/OrderNotProcessedFragment.kt b/app/src/main/java/com/casic/app/smartwell/fragment/OrderNotProcessedFragment.kt index 0b3d09d..2b6f21d 100644 --- a/app/src/main/java/com/casic/app/smartwell/fragment/OrderNotProcessedFragment.kt +++ b/app/src/main/java/com/casic/app/smartwell/fragment/OrderNotProcessedFragment.kt @@ -18,7 +18,7 @@ import com.pengxh.kt.lite.extensions.navigatePageTo import com.pengxh.kt.lite.extensions.show import com.pengxh.kt.lite.utils.LoadState -import com.pengxh.kt.lite.utils.LoadingDialogHub +import com.pengxh.kt.lite.utils.LoadingDialog import com.pengxh.kt.lite.utils.WeakReferenceHandler import com.pengxh.kt.lite.widget.dialog.AlertControlDialog @@ -78,8 +78,8 @@ operationViewModel = ViewModelProvider(this)[OperationViewModel::class.java] - binding.notProcessedView.addItemDecoration( - RecyclerViewItemOffsets(0, 5, 0, 5) + binding.recyclerView.addItemDecoration( + RecyclerViewItemOffsets(0, 7, 0, 7) ) } @@ -87,9 +87,9 @@ //接单状态处理 operationViewModel.loadState.observe(this) { when (it) { - is LoadState.Loading -> LoadingDialogHub.show(requireActivity(), "接单中,请稍后") + is LoadState.Loading -> LoadingDialog.show(requireActivity(), "接单中,请稍后") is LoadState.Success -> { - LoadingDialogHub.dismiss() + LoadingDialog.dismiss() //接单成功之后刷新列表 dataBeans.removeAt(clickedPosition) notProcessedAdapter.notifyItemRemoved(clickedPosition) @@ -98,7 +98,7 @@ ) } - else -> LoadingDialogHub.dismiss() + else -> LoadingDialog.dismiss() } } } @@ -131,7 +131,7 @@ } else { binding.emptyInclude.emptyView.hide() notProcessedAdapter = OrderNotProcessedAdapter(requireContext(), dataBeans) - binding.notProcessedView.adapter = notProcessedAdapter + binding.recyclerView.adapter = notProcessedAdapter notProcessedAdapter.setOnItemClickListener(object : OrderNotProcessedAdapter.OnItemClickListener { override fun onClicked(position: Int) { diff --git a/app/src/main/java/com/casic/app/smartwell/fragment/OvertimeNotAcceptFragment.kt b/app/src/main/java/com/casic/app/smartwell/fragment/OvertimeNotAcceptFragment.kt index a198545..9b318ca 100644 --- a/app/src/main/java/com/casic/app/smartwell/fragment/OvertimeNotAcceptFragment.kt +++ b/app/src/main/java/com/casic/app/smartwell/fragment/OvertimeNotAcceptFragment.kt @@ -18,7 +18,7 @@ import com.pengxh.kt.lite.extensions.navigatePageTo import com.pengxh.kt.lite.extensions.show import com.pengxh.kt.lite.utils.LoadState -import com.pengxh.kt.lite.utils.LoadingDialogHub +import com.pengxh.kt.lite.utils.LoadingDialog import com.pengxh.kt.lite.utils.WeakReferenceHandler import com.pengxh.kt.lite.widget.dialog.AlertControlDialog @@ -81,8 +81,8 @@ operationViewModel = ViewModelProvider(this)[OperationViewModel::class.java] - binding.notProcessedView.addItemDecoration( - RecyclerViewItemOffsets(0, 5, 0, 5) + binding.recyclerView.addItemDecoration( + RecyclerViewItemOffsets(0, 7, 0, 7) ) } @@ -90,9 +90,9 @@ //接单状态处理 operationViewModel.loadState.observe(this) { when (it) { - is LoadState.Loading -> LoadingDialogHub.show(requireActivity(), "接单中,请稍后") + is LoadState.Loading -> LoadingDialog.show(requireActivity(), "接单中,请稍后") is LoadState.Success -> { - LoadingDialogHub.dismiss() + LoadingDialog.dismiss() //接单成功之后刷新列表 dataBeans.removeAt(clickedPosition) notProcessedAdapter.notifyItemRemoved(clickedPosition) @@ -101,7 +101,7 @@ ) } - else -> LoadingDialogHub.dismiss() + else -> LoadingDialog.dismiss() } } } @@ -134,7 +134,7 @@ } else { binding.emptyInclude.emptyView.hide() notProcessedAdapter = OrderNotProcessedAdapter(requireContext(), dataBeans) - binding.notProcessedView.adapter = notProcessedAdapter + binding.recyclerView.adapter = notProcessedAdapter notProcessedAdapter.setOnItemClickListener(object : OrderNotProcessedAdapter.OnItemClickListener { override fun onClicked(position: Int) { diff --git a/app/src/main/java/com/casic/app/smartwell/greendao/DaoMaster.java b/app/src/main/java/com/casic/app/smartwell/greendao/DaoMaster.java index fdcf3a7..1e52b74 100644 --- a/app/src/main/java/com/casic/app/smartwell/greendao/DaoMaster.java +++ b/app/src/main/java/com/casic/app/smartwell/greendao/DaoMaster.java @@ -13,25 +13,20 @@ // THIS CODE IS GENERATED BY greenDAO, DO NOT EDIT. - /** * Master of DAO (schema version 4): knows all DAOs. */ public class DaoMaster extends AbstractDaoMaster { public static final int SCHEMA_VERSION = 4; - /** - * Creates underlying database table using DAOs. - */ + /** Creates underlying database table using DAOs. */ public static void createAllTables(Database db, boolean ifNotExists) { MapWellLocalBeanDao.createTable(db, ifNotExists); NoticeLocaleBeanDao.createTable(db, ifNotExists); PipeLocalBeanDao.createTable(db, ifNotExists); } - /** - * Drops underlying database table using DAOs. - */ + /** Drops underlying database table using DAOs. */ public static void dropAllTables(Database db, boolean ifExists) { MapWellLocalBeanDao.dropTable(db, ifExists); NoticeLocaleBeanDao.dropTable(db, ifExists); @@ -86,9 +81,7 @@ } } - /** - * WARNING: Drops all table on Upgrade! Use only during development. - */ + /** WARNING: Drops all table on Upgrade! Use only during development. */ public static class DevOpenHelper extends OpenHelper { public DevOpenHelper(Context context, String name) { super(context, name); diff --git a/app/src/main/java/com/casic/app/smartwell/greendao/DaoSession.java b/app/src/main/java/com/casic/app/smartwell/greendao/DaoSession.java index 0b36d17..3e40e3b 100644 --- a/app/src/main/java/com/casic/app/smartwell/greendao/DaoSession.java +++ b/app/src/main/java/com/casic/app/smartwell/greendao/DaoSession.java @@ -16,7 +16,7 @@ /** * {@inheritDoc} - * + * * @see org.greenrobot.greendao.AbstractDaoSession */ public class DaoSession extends AbstractDaoSession { @@ -50,7 +50,7 @@ registerDao(NoticeLocaleBean.class, noticeLocaleBeanDao); registerDao(PipeLocalBean.class, pipeLocalBeanDao); } - + public void clear() { mapWellLocalBeanDaoConfig.clearIdentityScope(); noticeLocaleBeanDaoConfig.clearIdentityScope(); diff --git a/app/src/main/java/com/casic/app/smartwell/greendao/MapWellLocalBeanDao.java b/app/src/main/java/com/casic/app/smartwell/greendao/MapWellLocalBeanDao.java index 8908fda..407bc92 100644 --- a/app/src/main/java/com/casic/app/smartwell/greendao/MapWellLocalBeanDao.java +++ b/app/src/main/java/com/casic/app/smartwell/greendao/MapWellLocalBeanDao.java @@ -12,10 +12,9 @@ import org.greenrobot.greendao.internal.DaoConfig; // THIS CODE IS GENERATED BY greenDAO, DO NOT EDIT. - -/** +/** * DAO for table "MAP_WELL_LOCAL_BEAN". - */ +*/ public class MapWellLocalBeanDao extends AbstractDao { public static final String TABLENAME = "MAP_WELL_LOCAL_BEAN"; @@ -57,16 +56,14 @@ public MapWellLocalBeanDao(DaoConfig config) { super(config); } - + public MapWellLocalBeanDao(DaoConfig config, DaoSession daoSession) { super(config, daoSession); } - /** - * Creates the underlying database table. - */ + /** Creates the underlying database table. */ public static void createTable(Database db, boolean ifNotExists) { - String constraint = ifNotExists ? "IF NOT EXISTS " : ""; + String constraint = ifNotExists? "IF NOT EXISTS ": ""; db.execSQL("CREATE TABLE " + constraint + "\"MAP_WELL_LOCAL_BEAN\" (" + // "\"_id\" INTEGER PRIMARY KEY AUTOINCREMENT ," + // 0: kId "\"AREA\" TEXT," + // 1: area @@ -96,9 +93,7 @@ "\"WELL_TYPE_NAME\" TEXT);"); // 25: wellTypeName } - /** - * Drops the underlying database table. - */ + /** Drops the underlying database table. */ public static void dropTable(Database db, boolean ifExists) { String sql = "DROP TABLE " + (ifExists ? "IF EXISTS " : "") + "\"MAP_WELL_LOCAL_BEAN\""; db.execSQL(sql); @@ -107,132 +102,132 @@ @Override protected final void bindValues(DatabaseStatement stmt, MapWellLocalBean entity) { stmt.clearBindings(); - + Long kId = entity.getKId(); if (kId != null) { stmt.bindLong(1, kId); } - + String area = entity.getArea(); if (area != null) { stmt.bindString(2, area); } - + String bfzt = entity.getBfzt(); if (bfzt != null) { stmt.bindString(3, bfzt); } - + String bfztName = entity.getBfztName(); if (bfztName != null) { stmt.bindString(4, bfztName); } - + String coordinateX = entity.getCoordinateX(); if (coordinateX != null) { stmt.bindString(5, coordinateX); } - + String coordinateY = entity.getCoordinateY(); if (coordinateY != null) { stmt.bindString(6, coordinateY); } - + String deep = entity.getDeep(); if (deep != null) { stmt.bindString(7, deep); } - + String deptName = entity.getDeptName(); if (deptName != null) { stmt.bindString(8, deptName); } - + String deptid = entity.getDeptid(); if (deptid != null) { stmt.bindString(9, deptid); } - + String id = entity.getId(); if (id != null) { stmt.bindString(10, id); } - + String latBaidu = entity.getLatBaidu(); if (latBaidu != null) { stmt.bindString(11, latBaidu); } - + String latGaode = entity.getLatGaode(); if (latGaode != null) { stmt.bindString(12, latGaode); } - + String lngBaidu = entity.getLngBaidu(); if (lngBaidu != null) { stmt.bindString(13, lngBaidu); } - + String lngGaode = entity.getLngGaode(); if (lngGaode != null) { stmt.bindString(14, lngGaode); } - + String notes = entity.getNotes(); if (notes != null) { stmt.bindString(15, notes); } - + String photos = entity.getPhotos(); if (photos != null) { stmt.bindString(16, photos); } - + String position = entity.getPosition(); if (position != null) { stmt.bindString(17, position); } - + String staff = entity.getStaff(); if (staff != null) { stmt.bindString(18, staff); } - + String tel = entity.getTel(); if (tel != null) { stmt.bindString(19, tel); } - + String ts = entity.getTs(); if (ts != null) { stmt.bindString(20, ts); } - + String valid = entity.getValid(); if (valid != null) { stmt.bindString(21, valid); } - + String watchData = entity.getWatchData(); if (watchData != null) { stmt.bindString(22, watchData); } - + String wellCode = entity.getWellCode(); if (wellCode != null) { stmt.bindString(23, wellCode); } - + String wellName = entity.getWellName(); if (wellName != null) { stmt.bindString(24, wellName); } - + String wellType = entity.getWellType(); if (wellType != null) { stmt.bindString(25, wellType); } - + String wellTypeName = entity.getWellTypeName(); if (wellTypeName != null) { stmt.bindString(26, wellTypeName); @@ -242,132 +237,132 @@ @Override protected final void bindValues(SQLiteStatement stmt, MapWellLocalBean entity) { stmt.clearBindings(); - + Long kId = entity.getKId(); if (kId != null) { stmt.bindLong(1, kId); } - + String area = entity.getArea(); if (area != null) { stmt.bindString(2, area); } - + String bfzt = entity.getBfzt(); if (bfzt != null) { stmt.bindString(3, bfzt); } - + String bfztName = entity.getBfztName(); if (bfztName != null) { stmt.bindString(4, bfztName); } - + String coordinateX = entity.getCoordinateX(); if (coordinateX != null) { stmt.bindString(5, coordinateX); } - + String coordinateY = entity.getCoordinateY(); if (coordinateY != null) { stmt.bindString(6, coordinateY); } - + String deep = entity.getDeep(); if (deep != null) { stmt.bindString(7, deep); } - + String deptName = entity.getDeptName(); if (deptName != null) { stmt.bindString(8, deptName); } - + String deptid = entity.getDeptid(); if (deptid != null) { stmt.bindString(9, deptid); } - + String id = entity.getId(); if (id != null) { stmt.bindString(10, id); } - + String latBaidu = entity.getLatBaidu(); if (latBaidu != null) { stmt.bindString(11, latBaidu); } - + String latGaode = entity.getLatGaode(); if (latGaode != null) { stmt.bindString(12, latGaode); } - + String lngBaidu = entity.getLngBaidu(); if (lngBaidu != null) { stmt.bindString(13, lngBaidu); } - + String lngGaode = entity.getLngGaode(); if (lngGaode != null) { stmt.bindString(14, lngGaode); } - + String notes = entity.getNotes(); if (notes != null) { stmt.bindString(15, notes); } - + String photos = entity.getPhotos(); if (photos != null) { stmt.bindString(16, photos); } - + String position = entity.getPosition(); if (position != null) { stmt.bindString(17, position); } - + String staff = entity.getStaff(); if (staff != null) { stmt.bindString(18, staff); } - + String tel = entity.getTel(); if (tel != null) { stmt.bindString(19, tel); } - + String ts = entity.getTs(); if (ts != null) { stmt.bindString(20, ts); } - + String valid = entity.getValid(); if (valid != null) { stmt.bindString(21, valid); } - + String watchData = entity.getWatchData(); if (watchData != null) { stmt.bindString(22, watchData); } - + String wellCode = entity.getWellCode(); if (wellCode != null) { stmt.bindString(23, wellCode); } - + String wellName = entity.getWellName(); if (wellName != null) { stmt.bindString(24, wellName); } - + String wellType = entity.getWellType(); if (wellType != null) { stmt.bindString(25, wellType); } - + String wellTypeName = entity.getWellTypeName(); if (wellTypeName != null) { stmt.bindString(26, wellTypeName); @@ -377,41 +372,41 @@ @Override public Long readKey(Cursor cursor, int offset) { return cursor.isNull(offset + 0) ? null : cursor.getLong(offset + 0); - } + } @Override public MapWellLocalBean readEntity(Cursor cursor, int offset) { MapWellLocalBean entity = new MapWellLocalBean( // - cursor.isNull(offset + 0) ? null : cursor.getLong(offset + 0), // kId - cursor.isNull(offset + 1) ? null : cursor.getString(offset + 1), // area - cursor.isNull(offset + 2) ? null : cursor.getString(offset + 2), // bfzt - cursor.isNull(offset + 3) ? null : cursor.getString(offset + 3), // bfztName - cursor.isNull(offset + 4) ? null : cursor.getString(offset + 4), // coordinateX - cursor.isNull(offset + 5) ? null : cursor.getString(offset + 5), // coordinateY - cursor.isNull(offset + 6) ? null : cursor.getString(offset + 6), // deep - cursor.isNull(offset + 7) ? null : cursor.getString(offset + 7), // deptName - cursor.isNull(offset + 8) ? null : cursor.getString(offset + 8), // deptid - cursor.isNull(offset + 9) ? null : cursor.getString(offset + 9), // id - cursor.isNull(offset + 10) ? null : cursor.getString(offset + 10), // latBaidu - cursor.isNull(offset + 11) ? null : cursor.getString(offset + 11), // latGaode - cursor.isNull(offset + 12) ? null : cursor.getString(offset + 12), // lngBaidu - cursor.isNull(offset + 13) ? null : cursor.getString(offset + 13), // lngGaode - cursor.isNull(offset + 14) ? null : cursor.getString(offset + 14), // notes - cursor.isNull(offset + 15) ? null : cursor.getString(offset + 15), // photos - cursor.isNull(offset + 16) ? null : cursor.getString(offset + 16), // position - cursor.isNull(offset + 17) ? null : cursor.getString(offset + 17), // staff - cursor.isNull(offset + 18) ? null : cursor.getString(offset + 18), // tel - cursor.isNull(offset + 19) ? null : cursor.getString(offset + 19), // ts - cursor.isNull(offset + 20) ? null : cursor.getString(offset + 20), // valid - cursor.isNull(offset + 21) ? null : cursor.getString(offset + 21), // watchData - cursor.isNull(offset + 22) ? null : cursor.getString(offset + 22), // wellCode - cursor.isNull(offset + 23) ? null : cursor.getString(offset + 23), // wellName - cursor.isNull(offset + 24) ? null : cursor.getString(offset + 24), // wellType - cursor.isNull(offset + 25) ? null : cursor.getString(offset + 25) // wellTypeName + cursor.isNull(offset + 0) ? null : cursor.getLong(offset + 0), // kId + cursor.isNull(offset + 1) ? null : cursor.getString(offset + 1), // area + cursor.isNull(offset + 2) ? null : cursor.getString(offset + 2), // bfzt + cursor.isNull(offset + 3) ? null : cursor.getString(offset + 3), // bfztName + cursor.isNull(offset + 4) ? null : cursor.getString(offset + 4), // coordinateX + cursor.isNull(offset + 5) ? null : cursor.getString(offset + 5), // coordinateY + cursor.isNull(offset + 6) ? null : cursor.getString(offset + 6), // deep + cursor.isNull(offset + 7) ? null : cursor.getString(offset + 7), // deptName + cursor.isNull(offset + 8) ? null : cursor.getString(offset + 8), // deptid + cursor.isNull(offset + 9) ? null : cursor.getString(offset + 9), // id + cursor.isNull(offset + 10) ? null : cursor.getString(offset + 10), // latBaidu + cursor.isNull(offset + 11) ? null : cursor.getString(offset + 11), // latGaode + cursor.isNull(offset + 12) ? null : cursor.getString(offset + 12), // lngBaidu + cursor.isNull(offset + 13) ? null : cursor.getString(offset + 13), // lngGaode + cursor.isNull(offset + 14) ? null : cursor.getString(offset + 14), // notes + cursor.isNull(offset + 15) ? null : cursor.getString(offset + 15), // photos + cursor.isNull(offset + 16) ? null : cursor.getString(offset + 16), // position + cursor.isNull(offset + 17) ? null : cursor.getString(offset + 17), // staff + cursor.isNull(offset + 18) ? null : cursor.getString(offset + 18), // tel + cursor.isNull(offset + 19) ? null : cursor.getString(offset + 19), // ts + cursor.isNull(offset + 20) ? null : cursor.getString(offset + 20), // valid + cursor.isNull(offset + 21) ? null : cursor.getString(offset + 21), // watchData + cursor.isNull(offset + 22) ? null : cursor.getString(offset + 22), // wellCode + cursor.isNull(offset + 23) ? null : cursor.getString(offset + 23), // wellName + cursor.isNull(offset + 24) ? null : cursor.getString(offset + 24), // wellType + cursor.isNull(offset + 25) ? null : cursor.getString(offset + 25) // wellTypeName ); return entity; } - + @Override public void readEntity(Cursor cursor, MapWellLocalBean entity, int offset) { entity.setKId(cursor.isNull(offset + 0) ? null : cursor.getLong(offset + 0)); @@ -440,17 +435,17 @@ entity.setWellName(cursor.isNull(offset + 23) ? null : cursor.getString(offset + 23)); entity.setWellType(cursor.isNull(offset + 24) ? null : cursor.getString(offset + 24)); entity.setWellTypeName(cursor.isNull(offset + 25) ? null : cursor.getString(offset + 25)); - } - + } + @Override protected final Long updateKeyAfterInsert(MapWellLocalBean entity, long rowId) { entity.setKId(rowId); return rowId; } - + @Override public Long getKey(MapWellLocalBean entity) { - if (entity != null) { + if(entity != null) { return entity.getKId(); } else { return null; @@ -466,5 +461,5 @@ protected final boolean isEntityUpdateable() { return true; } - + } diff --git a/app/src/main/java/com/casic/app/smartwell/greendao/NoticeLocaleBeanDao.java b/app/src/main/java/com/casic/app/smartwell/greendao/NoticeLocaleBeanDao.java index 64312ed..deb2d49 100644 --- a/app/src/main/java/com/casic/app/smartwell/greendao/NoticeLocaleBeanDao.java +++ b/app/src/main/java/com/casic/app/smartwell/greendao/NoticeLocaleBeanDao.java @@ -12,10 +12,9 @@ import org.greenrobot.greendao.internal.DaoConfig; // THIS CODE IS GENERATED BY greenDAO, DO NOT EDIT. - -/** +/** * DAO for table "NOTICE_LOCALE_BEAN". - */ +*/ public class NoticeLocaleBeanDao extends AbstractDao { public static final String TABLENAME = "NOTICE_LOCALE_BEAN"; @@ -43,16 +42,14 @@ public NoticeLocaleBeanDao(DaoConfig config) { super(config); } - + public NoticeLocaleBeanDao(DaoConfig config, DaoSession daoSession) { super(config, daoSession); } - /** - * Creates the underlying database table. - */ + /** Creates the underlying database table. */ public static void createTable(Database db, boolean ifNotExists) { - String constraint = ifNotExists ? "IF NOT EXISTS " : ""; + String constraint = ifNotExists? "IF NOT EXISTS ": ""; db.execSQL("CREATE TABLE " + constraint + "\"NOTICE_LOCALE_BEAN\" (" + // "\"_id\" INTEGER PRIMARY KEY AUTOINCREMENT ," + // 0: id "\"MESSAGE_ID\" TEXT UNIQUE ," + // 1: messageId @@ -68,9 +65,7 @@ "\"NOTICE_TIME\" TEXT);"); // 11: noticeTime } - /** - * Drops the underlying database table. - */ + /** Drops the underlying database table. */ public static void dropTable(Database db, boolean ifExists) { String sql = "DROP TABLE " + (ifExists ? "IF EXISTS " : "") + "\"NOTICE_LOCALE_BEAN\""; db.execSQL(sql); @@ -79,62 +74,62 @@ @Override protected final void bindValues(DatabaseStatement stmt, NoticeLocaleBean entity) { stmt.clearBindings(); - + Long id = entity.getId(); if (id != null) { stmt.bindLong(1, id); } - + String messageId = entity.getMessageId(); if (messageId != null) { stmt.bindString(2, messageId); } - + String appid = entity.getAppid(); if (appid != null) { stmt.bindString(3, appid); } - + String clientId = entity.getClientId(); if (clientId != null) { stmt.bindString(4, clientId); } - + String taskId = entity.getTaskId(); if (taskId != null) { stmt.bindString(5, taskId); } - + String userId = entity.getUserId(); if (userId != null) { stmt.bindString(6, userId); } - + String title = entity.getTitle(); if (title != null) { stmt.bindString(7, title); } - + String content = entity.getContent(); if (content != null) { stmt.bindString(8, content); } - + String deviceCode = entity.getDeviceCode(); if (deviceCode != null) { stmt.bindString(9, deviceCode); } - + String jobId = entity.getJobId(); if (jobId != null) { stmt.bindString(10, jobId); } - + String isRead = entity.getIsRead(); if (isRead != null) { stmt.bindString(11, isRead); } - + String noticeTime = entity.getNoticeTime(); if (noticeTime != null) { stmt.bindString(12, noticeTime); @@ -144,62 +139,62 @@ @Override protected final void bindValues(SQLiteStatement stmt, NoticeLocaleBean entity) { stmt.clearBindings(); - + Long id = entity.getId(); if (id != null) { stmt.bindLong(1, id); } - + String messageId = entity.getMessageId(); if (messageId != null) { stmt.bindString(2, messageId); } - + String appid = entity.getAppid(); if (appid != null) { stmt.bindString(3, appid); } - + String clientId = entity.getClientId(); if (clientId != null) { stmt.bindString(4, clientId); } - + String taskId = entity.getTaskId(); if (taskId != null) { stmt.bindString(5, taskId); } - + String userId = entity.getUserId(); if (userId != null) { stmt.bindString(6, userId); } - + String title = entity.getTitle(); if (title != null) { stmt.bindString(7, title); } - + String content = entity.getContent(); if (content != null) { stmt.bindString(8, content); } - + String deviceCode = entity.getDeviceCode(); if (deviceCode != null) { stmt.bindString(9, deviceCode); } - + String jobId = entity.getJobId(); if (jobId != null) { stmt.bindString(10, jobId); } - + String isRead = entity.getIsRead(); if (isRead != null) { stmt.bindString(11, isRead); } - + String noticeTime = entity.getNoticeTime(); if (noticeTime != null) { stmt.bindString(12, noticeTime); @@ -209,27 +204,27 @@ @Override public Long readKey(Cursor cursor, int offset) { return cursor.isNull(offset + 0) ? null : cursor.getLong(offset + 0); - } + } @Override public NoticeLocaleBean readEntity(Cursor cursor, int offset) { NoticeLocaleBean entity = new NoticeLocaleBean( // - cursor.isNull(offset + 0) ? null : cursor.getLong(offset + 0), // id - cursor.isNull(offset + 1) ? null : cursor.getString(offset + 1), // messageId - cursor.isNull(offset + 2) ? null : cursor.getString(offset + 2), // appid - cursor.isNull(offset + 3) ? null : cursor.getString(offset + 3), // clientId - cursor.isNull(offset + 4) ? null : cursor.getString(offset + 4), // taskId - cursor.isNull(offset + 5) ? null : cursor.getString(offset + 5), // userId - cursor.isNull(offset + 6) ? null : cursor.getString(offset + 6), // title - cursor.isNull(offset + 7) ? null : cursor.getString(offset + 7), // content - cursor.isNull(offset + 8) ? null : cursor.getString(offset + 8), // deviceCode - cursor.isNull(offset + 9) ? null : cursor.getString(offset + 9), // jobId - cursor.isNull(offset + 10) ? null : cursor.getString(offset + 10), // isRead - cursor.isNull(offset + 11) ? null : cursor.getString(offset + 11) // noticeTime + cursor.isNull(offset + 0) ? null : cursor.getLong(offset + 0), // id + cursor.isNull(offset + 1) ? null : cursor.getString(offset + 1), // messageId + cursor.isNull(offset + 2) ? null : cursor.getString(offset + 2), // appid + cursor.isNull(offset + 3) ? null : cursor.getString(offset + 3), // clientId + cursor.isNull(offset + 4) ? null : cursor.getString(offset + 4), // taskId + cursor.isNull(offset + 5) ? null : cursor.getString(offset + 5), // userId + cursor.isNull(offset + 6) ? null : cursor.getString(offset + 6), // title + cursor.isNull(offset + 7) ? null : cursor.getString(offset + 7), // content + cursor.isNull(offset + 8) ? null : cursor.getString(offset + 8), // deviceCode + cursor.isNull(offset + 9) ? null : cursor.getString(offset + 9), // jobId + cursor.isNull(offset + 10) ? null : cursor.getString(offset + 10), // isRead + cursor.isNull(offset + 11) ? null : cursor.getString(offset + 11) // noticeTime ); return entity; } - + @Override public void readEntity(Cursor cursor, NoticeLocaleBean entity, int offset) { entity.setId(cursor.isNull(offset + 0) ? null : cursor.getLong(offset + 0)); @@ -244,17 +239,17 @@ entity.setJobId(cursor.isNull(offset + 9) ? null : cursor.getString(offset + 9)); entity.setIsRead(cursor.isNull(offset + 10) ? null : cursor.getString(offset + 10)); entity.setNoticeTime(cursor.isNull(offset + 11) ? null : cursor.getString(offset + 11)); - } - + } + @Override protected final Long updateKeyAfterInsert(NoticeLocaleBean entity, long rowId) { entity.setId(rowId); return rowId; } - + @Override public Long getKey(NoticeLocaleBean entity) { - if (entity != null) { + if(entity != null) { return entity.getId(); } else { return null; @@ -270,5 +265,5 @@ protected final boolean isEntityUpdateable() { return true; } - + } diff --git a/app/src/main/java/com/casic/app/smartwell/greendao/PipeLocalBeanDao.java b/app/src/main/java/com/casic/app/smartwell/greendao/PipeLocalBeanDao.java index aab4d3f..df5515a 100644 --- a/app/src/main/java/com/casic/app/smartwell/greendao/PipeLocalBeanDao.java +++ b/app/src/main/java/com/casic/app/smartwell/greendao/PipeLocalBeanDao.java @@ -12,10 +12,9 @@ import org.greenrobot.greendao.internal.DaoConfig; // THIS CODE IS GENERATED BY greenDAO, DO NOT EDIT. - -/** +/** * DAO for table "PIPE_LOCAL_BEAN". - */ +*/ public class PipeLocalBeanDao extends AbstractDao { public static final String TABLENAME = "PIPE_LOCAL_BEAN"; @@ -37,16 +36,14 @@ public PipeLocalBeanDao(DaoConfig config) { super(config); } - + public PipeLocalBeanDao(DaoConfig config, DaoSession daoSession) { super(config, daoSession); } - /** - * Creates the underlying database table. - */ + /** Creates the underlying database table. */ public static void createTable(Database db, boolean ifNotExists) { - String constraint = ifNotExists ? "IF NOT EXISTS " : ""; + String constraint = ifNotExists? "IF NOT EXISTS ": ""; db.execSQL("CREATE TABLE " + constraint + "\"PIPE_LOCAL_BEAN\" (" + // "\"_id\" INTEGER PRIMARY KEY AUTOINCREMENT ," + // 0: id "\"PIPE_CODE\" TEXT," + // 1: pipeCode @@ -56,9 +53,7 @@ "\"START_LONGITUDE_GD\" TEXT);"); // 5: startLongitudeGd } - /** - * Drops the underlying database table. - */ + /** Drops the underlying database table. */ public static void dropTable(Database db, boolean ifExists) { String sql = "DROP TABLE " + (ifExists ? "IF EXISTS " : "") + "\"PIPE_LOCAL_BEAN\""; db.execSQL(sql); @@ -67,32 +62,32 @@ @Override protected final void bindValues(DatabaseStatement stmt, PipeLocalBean entity) { stmt.clearBindings(); - + Long id = entity.getId(); if (id != null) { stmt.bindLong(1, id); } - + String pipeCode = entity.getPipeCode(); if (pipeCode != null) { stmt.bindString(2, pipeCode); } - + String endLatitudeGd = entity.getEndLatitudeGd(); if (endLatitudeGd != null) { stmt.bindString(3, endLatitudeGd); } - + String endLongitudeGd = entity.getEndLongitudeGd(); if (endLongitudeGd != null) { stmt.bindString(4, endLongitudeGd); } - + String startLatitudeGd = entity.getStartLatitudeGd(); if (startLatitudeGd != null) { stmt.bindString(5, startLatitudeGd); } - + String startLongitudeGd = entity.getStartLongitudeGd(); if (startLongitudeGd != null) { stmt.bindString(6, startLongitudeGd); @@ -102,32 +97,32 @@ @Override protected final void bindValues(SQLiteStatement stmt, PipeLocalBean entity) { stmt.clearBindings(); - + Long id = entity.getId(); if (id != null) { stmt.bindLong(1, id); } - + String pipeCode = entity.getPipeCode(); if (pipeCode != null) { stmt.bindString(2, pipeCode); } - + String endLatitudeGd = entity.getEndLatitudeGd(); if (endLatitudeGd != null) { stmt.bindString(3, endLatitudeGd); } - + String endLongitudeGd = entity.getEndLongitudeGd(); if (endLongitudeGd != null) { stmt.bindString(4, endLongitudeGd); } - + String startLatitudeGd = entity.getStartLatitudeGd(); if (startLatitudeGd != null) { stmt.bindString(5, startLatitudeGd); } - + String startLongitudeGd = entity.getStartLongitudeGd(); if (startLongitudeGd != null) { stmt.bindString(6, startLongitudeGd); @@ -137,21 +132,21 @@ @Override public Long readKey(Cursor cursor, int offset) { return cursor.isNull(offset + 0) ? null : cursor.getLong(offset + 0); - } + } @Override public PipeLocalBean readEntity(Cursor cursor, int offset) { PipeLocalBean entity = new PipeLocalBean( // - cursor.isNull(offset + 0) ? null : cursor.getLong(offset + 0), // id - cursor.isNull(offset + 1) ? null : cursor.getString(offset + 1), // pipeCode - cursor.isNull(offset + 2) ? null : cursor.getString(offset + 2), // endLatitudeGd - cursor.isNull(offset + 3) ? null : cursor.getString(offset + 3), // endLongitudeGd - cursor.isNull(offset + 4) ? null : cursor.getString(offset + 4), // startLatitudeGd - cursor.isNull(offset + 5) ? null : cursor.getString(offset + 5) // startLongitudeGd + cursor.isNull(offset + 0) ? null : cursor.getLong(offset + 0), // id + cursor.isNull(offset + 1) ? null : cursor.getString(offset + 1), // pipeCode + cursor.isNull(offset + 2) ? null : cursor.getString(offset + 2), // endLatitudeGd + cursor.isNull(offset + 3) ? null : cursor.getString(offset + 3), // endLongitudeGd + cursor.isNull(offset + 4) ? null : cursor.getString(offset + 4), // startLatitudeGd + cursor.isNull(offset + 5) ? null : cursor.getString(offset + 5) // startLongitudeGd ); return entity; } - + @Override public void readEntity(Cursor cursor, PipeLocalBean entity, int offset) { entity.setId(cursor.isNull(offset + 0) ? null : cursor.getLong(offset + 0)); @@ -160,17 +155,17 @@ entity.setEndLongitudeGd(cursor.isNull(offset + 3) ? null : cursor.getString(offset + 3)); entity.setStartLatitudeGd(cursor.isNull(offset + 4) ? null : cursor.getString(offset + 4)); entity.setStartLongitudeGd(cursor.isNull(offset + 5) ? null : cursor.getString(offset + 5)); - } - + } + @Override protected final Long updateKeyAfterInsert(PipeLocalBean entity, long rowId) { entity.setId(rowId); return rowId; } - + @Override public Long getKey(PipeLocalBean entity) { - if (entity != null) { + if(entity != null) { return entity.getId(); } else { return null; @@ -186,5 +181,5 @@ protected final boolean isEntityUpdateable() { return true; } - + } diff --git a/app/src/main/java/com/casic/app/smartwell/view/ChangePasswordActivity.kt b/app/src/main/java/com/casic/app/smartwell/view/ChangePasswordActivity.kt index 8e41039..9f1dd40 100644 --- a/app/src/main/java/com/casic/app/smartwell/view/ChangePasswordActivity.kt +++ b/app/src/main/java/com/casic/app/smartwell/view/ChangePasswordActivity.kt @@ -14,7 +14,7 @@ import com.pengxh.kt.lite.extensions.show import com.pengxh.kt.lite.utils.ActivityStackManager import com.pengxh.kt.lite.utils.LoadState -import com.pengxh.kt.lite.utils.LoadingDialogHub +import com.pengxh.kt.lite.utils.LoadingDialog import com.pengxh.kt.lite.widget.TitleBarView import java.nio.charset.StandardCharsets @@ -46,15 +46,15 @@ override fun observeRequestState() { userViewModel.loadState.observe(this) { when (it) { - is LoadState.Loading -> LoadingDialogHub.show(this, "修改中,请稍后") + is LoadState.Loading -> LoadingDialog.show(this, "修改中,请稍后") is LoadState.Success -> { - LoadingDialogHub.dismiss() + LoadingDialog.dismiss() AuthenticationHelper.removeToken() this.navigatePageTo() ActivityStackManager.finishAllActivity() } - else -> LoadingDialogHub.dismiss() + else -> LoadingDialog.dismiss() } } } diff --git a/app/src/main/java/com/casic/app/smartwell/view/DeployedWellActivity.kt b/app/src/main/java/com/casic/app/smartwell/view/DeployedWellActivity.kt index fb4339c..28a5078 100644 --- a/app/src/main/java/com/casic/app/smartwell/view/DeployedWellActivity.kt +++ b/app/src/main/java/com/casic/app/smartwell/view/DeployedWellActivity.kt @@ -83,8 +83,8 @@ } //添加分割线 - binding.deployedListView.addItemDecoration( - RecyclerViewItemOffsets(0, 5, 0, 5) + binding.recyclerView.addItemDecoration( + RecyclerViewItemOffsets(0, 7, 0, 7) ) } @@ -149,12 +149,11 @@ } else { item.deep.toString() + "m" } - viewHolder.setText(R.id.wellNameView, item.wellName) + viewHolder.setText(R.id.wellTypeView, item.wellTypeName) .setText(R.id.wellDepthView, "深:${deep}") .setText(R.id.wellCodeView, "点位编号:${item.wellCode}") - .setText(R.id.wellTypeView, "点位类型:${item.wellTypeName}") .setText(R.id.ownerShipView, "权属单位:${item.deptName}") - .setText(R.id.wellLocationView, "点位置:${item.position}") + .setText(R.id.wellLocationView, "点位位置:${item.position}") .setOnClickListener( R.id.operationButton, object : View.OnClickListener { override fun onClick(v: View?) { @@ -207,7 +206,7 @@ }) } } - binding.deployedListView.adapter = deployAdapter + binding.recyclerView.adapter = deployAdapter deployAdapter.setOnItemClickedListener(object : NormalRecyclerAdapter.OnItemClickedListener { override fun onItemClicked(position: Int, t: WellListModel.DataBean.RowsBean) { diff --git a/app/src/main/java/com/casic/app/smartwell/view/LoginActivity.kt b/app/src/main/java/com/casic/app/smartwell/view/LoginActivity.kt index e4bb0e3..834527b 100644 --- a/app/src/main/java/com/casic/app/smartwell/view/LoginActivity.kt +++ b/app/src/main/java/com/casic/app/smartwell/view/LoginActivity.kt @@ -21,7 +21,7 @@ import com.pengxh.kt.lite.extensions.navigatePageTo import com.pengxh.kt.lite.extensions.readAssetsFile import com.pengxh.kt.lite.extensions.show -import com.pengxh.kt.lite.utils.LoadingDialogHub +import com.pengxh.kt.lite.utils.LoadingDialog import com.pengxh.kt.lite.utils.SaveKeyValues import kotlinx.coroutines.Dispatchers import kotlinx.coroutines.launch @@ -106,11 +106,11 @@ override fun observeRequestState() { authenticateViewModel.loadState.observe(this) { - LoadingDialogHub.show(this, "登录中,请稍后") + LoadingDialog.show(this, "登录中,请稍后") } loginViewModel.loadState.observe(this) { - LoadingDialogHub.dismiss() + LoadingDialog.dismiss() } } diff --git a/app/src/main/java/com/casic/app/smartwell/view/OrderCompletedDetailActivity.kt b/app/src/main/java/com/casic/app/smartwell/view/OrderCompletedDetailActivity.kt index db8ad1f..75cd905 100644 --- a/app/src/main/java/com/casic/app/smartwell/view/OrderCompletedDetailActivity.kt +++ b/app/src/main/java/com/casic/app/smartwell/view/OrderCompletedDetailActivity.kt @@ -17,7 +17,7 @@ import com.pengxh.kt.lite.extensions.show import com.pengxh.kt.lite.utils.Constant import com.pengxh.kt.lite.utils.LoadState -import com.pengxh.kt.lite.utils.LoadingDialogHub +import com.pengxh.kt.lite.utils.LoadingDialog import com.pengxh.kt.lite.widget.TitleBarView import com.pengxh.kt.lite.widget.dialog.AlertMessageDialog @@ -44,7 +44,7 @@ } override fun initOnCreate(savedInstanceState: Bundle?) { - val jobId = intent.getStringExtra(Constant.INTENT_PARAM)!! + val jobId = intent.getStringExtra(Constant.INTENT_PARAM_KEY)!! orderViewModel = ViewModelProvider(this)[OrderViewModel::class.java] orderViewModel.getWorkOrderDetail(jobId) orderViewModel.detailModel.observe(this) { @@ -154,8 +154,8 @@ override fun observeRequestState() { orderViewModel.loadState.observe(this) { when (it) { - is LoadState.Loading -> LoadingDialogHub.show(this, "数据加载中,请稍后") - else -> LoadingDialogHub.dismiss() + is LoadState.Loading -> LoadingDialog.show(this, "数据加载中,请稍后") + else -> LoadingDialog.dismiss() } } } diff --git a/app/src/main/java/com/casic/app/smartwell/view/OrderInHandleDetailActivity.kt b/app/src/main/java/com/casic/app/smartwell/view/OrderInHandleDetailActivity.kt index d70a979..04a7d5d 100644 --- a/app/src/main/java/com/casic/app/smartwell/view/OrderInHandleDetailActivity.kt +++ b/app/src/main/java/com/casic/app/smartwell/view/OrderInHandleDetailActivity.kt @@ -38,7 +38,7 @@ import com.pengxh.kt.lite.extensions.show import com.pengxh.kt.lite.utils.Constant import com.pengxh.kt.lite.utils.LoadState -import com.pengxh.kt.lite.utils.LoadingDialogHub +import com.pengxh.kt.lite.utils.LoadingDialog import com.pengxh.kt.lite.widget.TitleBarView import com.pengxh.kt.lite.widget.dialog.AlertControlDialog import com.pengxh.kt.lite.widget.dialog.AlertMessageDialog @@ -93,7 +93,7 @@ ) binding.addImageRecyclerView.adapter = imageAdapter - val jobId = intent.getStringExtra(Constant.INTENT_PARAM)!!//初始化图片九宫格 + val jobId = intent.getStringExtra(Constant.INTENT_PARAM_KEY)!!//初始化图片九宫格 orderViewModel.getWorkOrderDetail(jobId) orderViewModel.detailModel.observe(this) { if (it.code == 200) { @@ -312,41 +312,41 @@ override fun observeRequestState() { orderViewModel.loadState.observe(this) { when (it) { - is LoadState.Loading -> LoadingDialogHub.show(this, "数据加载中,请稍后") - else -> LoadingDialogHub.dismiss() + is LoadState.Loading -> LoadingDialog.show(this, "数据加载中,请稍后") + else -> LoadingDialog.dismiss() } } uploadImageViewModel.loadState.observe(this) { when (it) { - LoadState.Loading -> LoadingDialogHub.show(this, "图片上传中,请稍后...") - else -> LoadingDialogHub.dismiss() + LoadState.Loading -> LoadingDialog.show(this, "图片上传中,请稍后...") + else -> LoadingDialog.dismiss() } } //转单状态处理 operationViewModel.loadState.observe(this) { when (it) { - is LoadState.Loading -> LoadingDialogHub.show(this, "转单中,请稍后") + is LoadState.Loading -> LoadingDialog.show(this, "转单中,请稍后") is LoadState.Success -> { - LoadingDialogHub.dismiss() + LoadingDialog.dismiss() this.finish() } - else -> LoadingDialogHub.dismiss() + else -> LoadingDialog.dismiss() } } //处理完成工单状态处理 operationViewModel.loadState.observe(this) { when (it) { - is LoadState.Loading -> LoadingDialogHub.show(this, "处理中,请稍后") + is LoadState.Loading -> LoadingDialog.show(this, "处理中,请稍后") is LoadState.Success -> { - LoadingDialogHub.dismiss() + LoadingDialog.dismiss() this.finish() } - else -> LoadingDialogHub.dismiss() + else -> LoadingDialog.dismiss() } } } diff --git a/app/src/main/java/com/casic/app/smartwell/view/OrderNotConfirmedDetailActivity.kt b/app/src/main/java/com/casic/app/smartwell/view/OrderNotConfirmedDetailActivity.kt index 8e036d2..687ec86 100644 --- a/app/src/main/java/com/casic/app/smartwell/view/OrderNotConfirmedDetailActivity.kt +++ b/app/src/main/java/com/casic/app/smartwell/view/OrderNotConfirmedDetailActivity.kt @@ -36,7 +36,7 @@ import com.pengxh.kt.lite.extensions.show import com.pengxh.kt.lite.utils.Constant import com.pengxh.kt.lite.utils.LoadState -import com.pengxh.kt.lite.utils.LoadingDialogHub +import com.pengxh.kt.lite.utils.LoadingDialog import com.pengxh.kt.lite.widget.TitleBarView import com.pengxh.kt.lite.widget.dialog.AlertControlDialog import com.pengxh.kt.lite.widget.dialog.AlertMessageDialog @@ -80,7 +80,7 @@ } override fun initOnCreate(savedInstanceState: Bundle?) { - val jobId = intent.getStringExtra(Constant.INTENT_PARAM)!! + val jobId = intent.getStringExtra(Constant.INTENT_PARAM_KEY)!! //初始化图片九宫格 //左外边距,左内边距,右内边距,右外边距 val viewWidth = getScreenWidth() - (10 + 10 + 10 + 10).dp2px(this) @@ -263,41 +263,41 @@ //数据加载状态处理 orderViewModel.loadState.observe(this) { when (it) { - is LoadState.Loading -> LoadingDialogHub.show(this, "数据加载中,请稍后") - else -> LoadingDialogHub.dismiss() + is LoadState.Loading -> LoadingDialog.show(this, "数据加载中,请稍后") + else -> LoadingDialog.dismiss() } } uploadImageViewModel.loadState.observe(this) { when (it) { - LoadState.Loading -> LoadingDialogHub.show(this, "图片上传中,请稍后") - else -> LoadingDialogHub.dismiss() + LoadState.Loading -> LoadingDialog.show(this, "图片上传中,请稍后") + else -> LoadingDialog.dismiss() } } //转单状态处理 operationViewModel.loadState.observe(this) { when (it) { - is LoadState.Loading -> LoadingDialogHub.show(this, "转单中,请稍后") + is LoadState.Loading -> LoadingDialog.show(this, "转单中,请稍后") is LoadState.Success -> { - LoadingDialogHub.dismiss() + LoadingDialog.dismiss() this.finish() } - else -> LoadingDialogHub.dismiss() + else -> LoadingDialog.dismiss() } } //确认工单状态处理 operationViewModel.loadState.observe(this) { when (it) { - is LoadState.Loading -> LoadingDialogHub.show(this, "处理中,请稍后") + is LoadState.Loading -> LoadingDialog.show(this, "处理中,请稍后") is LoadState.Success -> { - LoadingDialogHub.dismiss() + LoadingDialog.dismiss() this.finish() } - else -> LoadingDialogHub.dismiss() + else -> LoadingDialog.dismiss() } } } diff --git a/app/src/main/java/com/casic/app/smartwell/view/OrderNotProcessedDetailActivity.kt b/app/src/main/java/com/casic/app/smartwell/view/OrderNotProcessedDetailActivity.kt index d3f22dc..0c97a52 100644 --- a/app/src/main/java/com/casic/app/smartwell/view/OrderNotProcessedDetailActivity.kt +++ b/app/src/main/java/com/casic/app/smartwell/view/OrderNotProcessedDetailActivity.kt @@ -18,7 +18,7 @@ import com.pengxh.kt.lite.extensions.show import com.pengxh.kt.lite.utils.Constant import com.pengxh.kt.lite.utils.LoadState -import com.pengxh.kt.lite.utils.LoadingDialogHub +import com.pengxh.kt.lite.utils.LoadingDialog import com.pengxh.kt.lite.widget.TitleBarView import com.pengxh.kt.lite.widget.dialog.AlertControlDialog import com.pengxh.kt.lite.widget.dialog.AlertMessageDialog @@ -50,7 +50,7 @@ } override fun initOnCreate(savedInstanceState: Bundle?) { - this.jobId = intent.getStringExtra(Constant.INTENT_PARAM)!! + this.jobId = intent.getStringExtra(Constant.INTENT_PARAM_KEY)!! orderViewModel = ViewModelProvider(this)[OrderViewModel::class.java] operationViewModel = ViewModelProvider(this)[OperationViewModel::class.java] wellViewModel = ViewModelProvider(this)[WellViewModel::class.java] @@ -162,21 +162,21 @@ //数据加载状态处理 orderViewModel.loadState.observe(this) { when (it) { - is LoadState.Loading -> LoadingDialogHub.show(this, "数据加载中,请稍后") - else -> LoadingDialogHub.dismiss() + is LoadState.Loading -> LoadingDialog.show(this, "数据加载中,请稍后") + else -> LoadingDialog.dismiss() } } //接单状态处理 operationViewModel.loadState.observe(this) { when (it) { - is LoadState.Loading -> LoadingDialogHub.show(this, "接单中,请稍后") + is LoadState.Loading -> LoadingDialog.show(this, "接单中,请稍后") is LoadState.Success -> { - LoadingDialogHub.dismiss() + LoadingDialog.dismiss() this.finish() } - else -> LoadingDialogHub.dismiss() + else -> LoadingDialog.dismiss() } } } diff --git a/app/src/main/java/com/casic/app/smartwell/view/SearchResultActivity.kt b/app/src/main/java/com/casic/app/smartwell/view/SearchResultActivity.kt index 6a92917..4f3a674 100644 --- a/app/src/main/java/com/casic/app/smartwell/view/SearchResultActivity.kt +++ b/app/src/main/java/com/casic/app/smartwell/view/SearchResultActivity.kt @@ -19,7 +19,7 @@ import com.pengxh.kt.lite.extensions.show import com.pengxh.kt.lite.utils.Constant import com.pengxh.kt.lite.utils.LoadState -import com.pengxh.kt.lite.utils.LoadingDialogHub +import com.pengxh.kt.lite.utils.LoadingDialog import com.pengxh.kt.lite.utils.WeakReferenceHandler import com.pengxh.kt.lite.widget.TitleBarView import com.pengxh.kt.lite.widget.dialog.AlertControlDialog @@ -56,7 +56,7 @@ } override fun initOnCreate(savedInstanceState: Bundle?) { - args = intent.getStringArrayListExtra(Constant.INTENT_PARAM)!! + args = intent.getStringArrayListExtra(Constant.INTENT_PARAM_KEY)!! orderViewModel = ViewModelProvider(this)[OrderViewModel::class.java] operationViewModel = ViewModelProvider(this)[OperationViewModel::class.java] @@ -101,24 +101,24 @@ } } - binding.resultRecyclerView.addItemDecoration( - RecyclerViewItemOffsets(0, 5, 0, 5) + binding.recyclerView.addItemDecoration( + RecyclerViewItemOffsets(0, 7, 0, 7) ) } override fun observeRequestState() { orderViewModel.loadState.observe(this) { when (it) { - is LoadState.Loading -> LoadingDialogHub.show(this, "数据加载中,请稍后") - else -> LoadingDialogHub.dismiss() + is LoadState.Loading -> LoadingDialog.show(this, "数据加载中,请稍后") + else -> LoadingDialog.dismiss() } } //接单状态处理 operationViewModel.loadState.observe(this) { when (it) { - is LoadState.Loading -> LoadingDialogHub.show(this, "接单中,请稍后") + is LoadState.Loading -> LoadingDialog.show(this, "接单中,请稍后") is LoadState.Success -> { - LoadingDialogHub.dismiss() + LoadingDialog.dismiss() //接单成功之后刷新列表 dataBeans.removeAt(clickedPosition) searchResultAdapter.notifyItemRemoved(clickedPosition) @@ -127,7 +127,7 @@ ) } - else -> LoadingDialogHub.dismiss() + else -> LoadingDialog.dismiss() } } } @@ -162,7 +162,7 @@ } else { binding.emptyInclude.emptyView.hide() searchResultAdapter = SearchResultAdapter(this, dataBeans) - binding.resultRecyclerView.adapter = searchResultAdapter + binding.recyclerView.adapter = searchResultAdapter searchResultAdapter.setOnItemClickListener(object : SearchResultAdapter.OnItemClickListener { override fun onClicked(position: Int) { diff --git a/app/src/main/java/com/casic/app/smartwell/view/UnDeployWellActivity.kt b/app/src/main/java/com/casic/app/smartwell/view/UnDeployWellActivity.kt index 7f7cd3c..555c278 100644 --- a/app/src/main/java/com/casic/app/smartwell/view/UnDeployWellActivity.kt +++ b/app/src/main/java/com/casic/app/smartwell/view/UnDeployWellActivity.kt @@ -81,8 +81,8 @@ } } - binding.undeployListView.addItemDecoration( - RecyclerViewItemOffsets(0, 5, 0, 5) + binding.recyclerView.addItemDecoration( + RecyclerViewItemOffsets(0, 7, 0, 7) ) } @@ -147,12 +147,11 @@ } else { item.deep.toString() + "m" } - viewHolder.setText(R.id.wellNameView, item.wellName) + viewHolder.setText(R.id.wellTypeView, item.wellTypeName) .setText(R.id.wellDepthView, "深:${deep}") .setText(R.id.wellCodeView, "点位编号:${item.wellCode}") - .setText(R.id.wellTypeView, "点位类型:${item.wellTypeName}") .setText(R.id.ownerShipView, "权属单位:${item.deptName}") - .setText(R.id.wellLocationView, "点位置:${item.position}") + .setText(R.id.wellLocationView, "点位位置:${item.position}") .setOnClickListener( R.id.operationButton, object : View.OnClickListener { override fun onClick(v: View?) { @@ -185,7 +184,7 @@ ) } } - binding.undeployListView.adapter = unDeployAdapter + binding.recyclerView.adapter = unDeployAdapter unDeployAdapter.setOnItemClickedListener(object : NormalRecyclerAdapter.OnItemClickedListener { override fun onItemClicked(position: Int, t: WellListModel.DataBean.RowsBean) { diff --git a/app/src/main/java/com/casic/app/smartwell/view/WellDetailActivity.kt b/app/src/main/java/com/casic/app/smartwell/view/WellDetailActivity.kt index b50d067..eb8b468 100644 --- a/app/src/main/java/com/casic/app/smartwell/view/WellDetailActivity.kt +++ b/app/src/main/java/com/casic/app/smartwell/view/WellDetailActivity.kt @@ -16,7 +16,7 @@ import com.pengxh.kt.lite.extensions.show import com.pengxh.kt.lite.utils.Constant import com.pengxh.kt.lite.utils.LoadState -import com.pengxh.kt.lite.utils.LoadingDialogHub +import com.pengxh.kt.lite.utils.LoadingDialog import com.pengxh.kt.lite.widget.TitleBarView import com.pengxh.kt.lite.widget.dialog.AlertMessageDialog @@ -44,7 +44,7 @@ } override fun initOnCreate(savedInstanceState: Bundle?) { - val wellId = intent.getStringExtra(Constant.INTENT_PARAM)!! + val wellId = intent.getStringExtra(Constant.INTENT_PARAM_KEY)!! wellViewModel = ViewModelProvider(this)[WellViewModel::class.java] wellViewModel.getWellDetail(wellId) wellViewModel.wellDetailModel.observe(this) { @@ -132,8 +132,8 @@ override fun observeRequestState() { wellViewModel.loadState.observe(this) { when (it) { - is LoadState.Loading -> LoadingDialogHub.show(this, "数据加载中,请稍后") - else -> LoadingDialogHub.dismiss() + is LoadState.Loading -> LoadingDialog.show(this, "数据加载中,请稍后") + else -> LoadingDialog.dismiss() } } } diff --git a/app/src/main/java/com/casic/app/smartwell/view/WellManagementActivity.kt b/app/src/main/java/com/casic/app/smartwell/view/WellManagementActivity.kt index 084da95..457096b 100644 --- a/app/src/main/java/com/casic/app/smartwell/view/WellManagementActivity.kt +++ b/app/src/main/java/com/casic/app/smartwell/view/WellManagementActivity.kt @@ -94,8 +94,8 @@ } } - binding.wellListView.addItemDecoration( - RecyclerViewItemOffsets(0, 5, 0, 5) + binding.recyclerView.addItemDecoration( + RecyclerViewItemOffsets(0, 7, 0, 7) ) } @@ -175,13 +175,12 @@ } else { item.deep.toString() + "m" } - viewHolder.setText(R.id.wellNameView, item.wellName) + viewHolder.setText(R.id.wellTypeView, item.wellTypeName) .setText(R.id.wellStateView, "已${item.bfztName}") .setText(R.id.wellDepthView, "深:${deep}") .setText(R.id.wellCodeView, "点位编号:${item.wellCode}") - .setText(R.id.wellTypeView, "点位类型:${item.wellTypeName}") .setText(R.id.ownerShipView, "权属单位:${item.deptName}") - .setText(R.id.wellLocationView, "点位置:${item.position}") + .setText(R.id.wellLocationView, "点位位置:${item.position}") .setOnClickListener( R.id.navigationButton, object : View.OnClickListener { override fun onClick(v: View?) { @@ -200,7 +199,7 @@ ) } } - binding.wellListView.adapter = wellListAdapter + binding.recyclerView.adapter = wellListAdapter wellListAdapter.setOnItemClickedListener(object : NormalRecyclerAdapter.OnItemClickedListener { override fun onItemClicked(position: Int, t: WellListModel.DataBean.RowsBean) { diff --git a/app/src/main/java/com/casic/app/smartwell/view/WellMonitorActivity.kt b/app/src/main/java/com/casic/app/smartwell/view/WellMonitorActivity.kt index e3573eb..b87bdb7 100644 --- a/app/src/main/java/com/casic/app/smartwell/view/WellMonitorActivity.kt +++ b/app/src/main/java/com/casic/app/smartwell/view/WellMonitorActivity.kt @@ -11,7 +11,7 @@ import com.pengxh.kt.lite.base.KotlinBaseActivity import com.pengxh.kt.lite.utils.Constant import com.pengxh.kt.lite.utils.LoadState -import com.pengxh.kt.lite.utils.LoadingDialogHub +import com.pengxh.kt.lite.utils.LoadingDialog import com.pengxh.kt.lite.widget.TitleBarView class WellMonitorActivity : KotlinBaseActivity() { @@ -36,7 +36,7 @@ } override fun initOnCreate(savedInstanceState: Bundle?) { - val wellId = intent.getStringExtra(Constant.INTENT_PARAM)!! + val wellId = intent.getStringExtra(Constant.INTENT_PARAM_KEY)!! wellViewModel = ViewModelProvider(this)[WellViewModel::class.java] wellViewModel.getMonitorResult(wellId) wellViewModel.monitorModel.observe(this) { @@ -56,8 +56,8 @@ override fun observeRequestState() { wellViewModel.loadState.observe(this) { when (it) { - is LoadState.Loading -> LoadingDialogHub.show(this, "数据加载中,请稍后") - else -> LoadingDialogHub.dismiss() + is LoadState.Loading -> LoadingDialog.show(this, "数据加载中,请稍后") + else -> LoadingDialog.dismiss() } } } diff --git a/app/src/main/java/com/casic/app/smartwell/view/WellOperationActivity.kt b/app/src/main/java/com/casic/app/smartwell/view/WellOperationActivity.kt index 8d333bf..347ebb6 100644 --- a/app/src/main/java/com/casic/app/smartwell/view/WellOperationActivity.kt +++ b/app/src/main/java/com/casic/app/smartwell/view/WellOperationActivity.kt @@ -23,7 +23,7 @@ import com.pengxh.kt.lite.extensions.navigatePageTo import com.pengxh.kt.lite.extensions.show import com.pengxh.kt.lite.utils.LoadState -import com.pengxh.kt.lite.utils.LoadingDialogHub +import com.pengxh.kt.lite.utils.LoadingDialog import com.pengxh.kt.lite.utils.WeakReferenceHandler import com.pengxh.kt.lite.widget.dialog.AlertControlDialog @@ -109,8 +109,8 @@ } } - binding.operationListView.addItemDecoration( - RecyclerViewItemOffsets(0, 5, 0, 5) + binding.recyclerView.addItemDecoration( + RecyclerViewItemOffsets(0, 7, 0, 7) ) } @@ -123,13 +123,13 @@ override fun observeRequestState() { wellViewModel.loadState.observe(this) { when (it) { - is LoadState.Loading -> LoadingDialogHub.show(this, "处理中,请稍后") + is LoadState.Loading -> LoadingDialog.show(this, "处理中,请稍后") is LoadState.Success -> { - LoadingDialogHub.dismiss() + LoadingDialog.dismiss() wellOperationAdapter.notifyItemChanged(clickedPosition) } - else -> LoadingDialogHub.dismiss() + else -> LoadingDialog.dismiss() } } } @@ -203,24 +203,23 @@ if (item.bfztName == "布防") { viewHolder.setImageResource( R.id.wellStateView, R.drawable.bg_solid_text_green_radius_5 - ).setText(R.id.wellStateView, "撤防") + ).setText(R.id.operationButton, "撤防") } else { viewHolder.setImageResource( R.id.wellStateView, R.drawable.bg_solid_text_red_radius_5 - ).setText(R.id.wellStateView, "布防") + ).setText(R.id.operationButton, "布防") } val deep = if (item.deep.toString().isBlank()) { "未知" } else { item.deep.toString() + "m" } - viewHolder.setText(R.id.wellNameView, item.wellName) + viewHolder.setText(R.id.wellTypeView, item.wellTypeName) .setText(R.id.wellStateView, "已${item.bfztName}") .setText(R.id.wellDepthView, "深:${deep}") .setText(R.id.wellCodeView, "点位编号:${item.wellCode}") - .setText(R.id.wellTypeView, "点位类型:${item.wellTypeName}") .setText(R.id.ownerShipView, "权属单位:${item.deptName}") - .setText(R.id.wellLocationView, "点位置:${item.position}") + .setText(R.id.wellLocationView, "点位位置:${item.position}") .setOnClickListener( R.id.operationButton, object : View.OnClickListener { override fun onClick(v: View?) { @@ -280,7 +279,7 @@ ) } } - binding.operationListView.adapter = wellOperationAdapter + binding.recyclerView.adapter = wellOperationAdapter wellOperationAdapter.setOnItemClickedListener(object : NormalRecyclerAdapter.OnItemClickedListener { override fun onItemClicked(position: Int, t: WellListModel.DataBean.RowsBean) { diff --git a/app/src/main/res/drawable/ic_down.xml b/app/src/main/res/drawable/ic_down.xml index 20e6476..6987e6c 100644 --- a/app/src/main/res/drawable/ic_down.xml +++ b/app/src/main/res/drawable/ic_down.xml @@ -1,6 +1,6 @@ + + diff --git a/app/src/main/res/layout/activity_about_us.xml b/app/src/main/res/layout/activity_about_us.xml index 9091a00..d5fbd0d 100644 --- a/app/src/main/res/layout/activity_about_us.xml +++ b/app/src/main/res/layout/activity_about_us.xml @@ -12,13 +12,7 @@ android:layout_width="match_parent" android:layout_height="wrap_content" android:background="@color/mainThemeColor" - app:tbv_left_image="@drawable/ic_title_left" - app:tbv_only_show_title="false" - app:tbv_show_left_image="true" - app:tbv_show_right_image="false" - app:tbv_text="关于我们" - app:tbv_text_color="@color/white" - app:tbv_text_size="@dimen/sp_18" /> + app:tbv_text="关于我们" /> - + + android:value="ee96d8b5e12de3fbb29949efd57418a8" /> () @@ -150,7 +158,7 @@ val cameraPosition = CameraPosition(centerLatLng, 14f, 0f, 0f) val cameraUpdate = CameraUpdateFactory.newCameraPosition(cameraPosition) withContext(Dispatchers.Main) { - LoadingDialogHub.dismiss() + LoadingDialog.dismiss() aMap.animateCamera(cameraUpdate, 1500, null) } } @@ -239,11 +247,6 @@ } override fun initEvent() { - binding.rightOptionView.setOnClickListener { - val x = binding.rightOptionView.width - easyPopupWindow.width - easyPopupWindow.showAsDropDown(binding.rightOptionView, x, 0) - } - //撤防点位 binding.unDeployedLayout.setOnClickListener { requireContext().navigatePageTo() @@ -263,11 +266,11 @@ override fun observeRequestState() { wellViewModel.loadState.observe(this) { when (it) { - is LoadState.Loading -> LoadingDialogHub.show( + is LoadState.Loading -> LoadingDialog.show( requireActivity(), "数据加载中,请稍后..." ) - else -> LoadingDialogHub.dismiss() + else -> LoadingDialog.dismiss() } } } @@ -376,7 +379,7 @@ }).build().show() } }) - infoPopup.showAsDropDown(binding.rightOptionView) +// infoPopup.showAsDropDown(binding.rightOptionView) } override fun onCameraChange(p0: CameraPosition?) { diff --git a/app/src/main/java/com/casic/app/smartwell/fragment/HomePageNoClusterFragment.kt b/app/src/main/java/com/casic/app/smartwell/fragment/HomePageNoClusterFragment.kt index 802426a..b25f743 100644 --- a/app/src/main/java/com/casic/app/smartwell/fragment/HomePageNoClusterFragment.kt +++ b/app/src/main/java/com/casic/app/smartwell/fragment/HomePageNoClusterFragment.kt @@ -38,8 +38,9 @@ import com.pengxh.kt.lite.extensions.navigatePageTo import com.pengxh.kt.lite.extensions.show import com.pengxh.kt.lite.utils.LoadState -import com.pengxh.kt.lite.utils.LoadingDialogHub +import com.pengxh.kt.lite.utils.LoadingDialog import com.pengxh.kt.lite.widget.EasyPopupWindow +import com.pengxh.kt.lite.widget.TitleBarView import com.pengxh.kt.lite.widget.dialog.AlertControlDialog import kotlinx.coroutines.Dispatchers import kotlinx.coroutines.launch @@ -78,7 +79,15 @@ override fun setupTopBarLayout() { binding.rootView.initImmersionBar(this, false, R.color.mainThemeColor) - binding.titleView.text = "首页" + binding.titleView.setOnClickListener(object : TitleBarView.OnClickListener { + override fun onLeftClick() { + + } + + override fun onRightClick() { + easyPopupWindow.showAsDropDown(binding.titleView, binding.titleView.width, 0) + } + }) } override fun initOnCreate(savedInstanceState: Bundle?) { @@ -112,7 +121,7 @@ //渲染井位置 lifecycleScope.launch(Dispatchers.Main) { - LoadingDialogHub.show(requireActivity(), "数据加载中,请稍后") + LoadingDialog.show(requireActivity(), "数据加载中,请稍后") withContext(Dispatchers.IO) { //取Well缓存 val allMarkerOptions = ArrayList() @@ -144,7 +153,7 @@ val cameraPosition = CameraPosition(centerLatLng, 14f, 0f, 0f) val cameraUpdate = CameraUpdateFactory.newCameraPosition(cameraPosition) withContext(Dispatchers.Main) { - LoadingDialogHub.dismiss() + LoadingDialog.dismiss() aMap.animateCamera(cameraUpdate, 1500, null) } } @@ -238,11 +247,6 @@ } override fun initEvent() { - binding.rightOptionView.setOnClickListener { - val x = binding.rightOptionView.width - easyPopupWindow.width - easyPopupWindow.showAsDropDown(binding.rightOptionView, x, 0) - } - //撤防点位 binding.unDeployedLayout.setOnClickListener { requireContext().navigatePageTo() @@ -262,11 +266,11 @@ override fun observeRequestState() { wellViewModel.loadState.observe(this) { when (it) { - is LoadState.Loading -> LoadingDialogHub.show( + is LoadState.Loading -> LoadingDialog.show( requireActivity(), "数据加载中,请稍后..." ) - else -> LoadingDialogHub.dismiss() + else -> LoadingDialog.dismiss() } } } diff --git a/app/src/main/java/com/casic/app/smartwell/fragment/MinePageFragment.kt b/app/src/main/java/com/casic/app/smartwell/fragment/MinePageFragment.kt index 09a570c..dcb48f8 100644 --- a/app/src/main/java/com/casic/app/smartwell/fragment/MinePageFragment.kt +++ b/app/src/main/java/com/casic/app/smartwell/fragment/MinePageFragment.kt @@ -35,7 +35,7 @@ import com.pengxh.kt.lite.utils.ActivityStackManager import com.pengxh.kt.lite.utils.FileDownloadManager import com.pengxh.kt.lite.utils.LoadState -import com.pengxh.kt.lite.utils.LoadingDialogHub +import com.pengxh.kt.lite.utils.LoadingDialog import com.pengxh.kt.lite.widget.dialog.AlertControlDialog import com.pengxh.kt.lite.widget.dialog.BottomActionSheet import kotlinx.coroutines.Dispatchers @@ -60,7 +60,6 @@ override fun setupTopBarLayout() { binding.rootView.initImmersionBar(this, false, R.color.mainThemeColor) - binding.titleInclude.titleView.text = "我的" } override fun initOnCreate(savedInstanceState: Bundle?) { @@ -155,27 +154,27 @@ override fun observeRequestState() { userViewModel.loadState.observe(this) { when (it) { - is LoadState.Loading -> LoadingDialogHub.show( + is LoadState.Loading -> LoadingDialog.show( requireActivity(), "检查版本中,请稍后" ) - else -> LoadingDialogHub.dismiss() + else -> LoadingDialog.dismiss() } } wellViewModel.loadState.observe(this) { when (it) { - is LoadState.Loading -> LoadingDialogHub.show( + is LoadState.Loading -> LoadingDialog.show( requireActivity(), "数据更新中,请稍后" ) is LoadState.Fail -> { - LoadingDialogHub.dismiss() + LoadingDialog.dismiss() "数据更新超时".show(requireContext()) } else -> { - LoadingDialogHub.dismiss() + LoadingDialog.dismiss() AlertControlDialog.Builder().setContext(requireContext()).setTitle("温馨提示") .setMessage("数据更新成功,请重启应用").setNegativeButton("取消") .setPositiveButton("确定").setOnDialogButtonClickListener(object : @@ -197,17 +196,17 @@ lineViewModel.loadState.observe(this) { when (it) { - is LoadState.Loading -> LoadingDialogHub.show( + is LoadState.Loading -> LoadingDialog.show( requireActivity(), "数据更新中,请稍后" ) is LoadState.Fail -> { - LoadingDialogHub.dismiss() + LoadingDialog.dismiss() "数据更新超时".show(requireContext()) } else -> { - LoadingDialogHub.dismiss() + LoadingDialog.dismiss() AlertControlDialog.Builder().setContext(requireContext()).setTitle("温馨提示") .setMessage("数据更新成功,请重启应用").setNegativeButton("取消") .setPositiveButton("确定").setOnDialogButtonClickListener(object : diff --git a/app/src/main/java/com/casic/app/smartwell/fragment/NoticePageFragment.kt b/app/src/main/java/com/casic/app/smartwell/fragment/NoticePageFragment.kt index 171b555..3c93f54 100644 --- a/app/src/main/java/com/casic/app/smartwell/fragment/NoticePageFragment.kt +++ b/app/src/main/java/com/casic/app/smartwell/fragment/NoticePageFragment.kt @@ -48,7 +48,6 @@ override fun setupTopBarLayout() { binding.rootView.initImmersionBar(this, false, R.color.mainThemeColor) - binding.titleInclude.titleView.text = "消息" } override fun initOnCreate(savedInstanceState: Bundle?) { diff --git a/app/src/main/java/com/casic/app/smartwell/fragment/OrderListFragment.kt b/app/src/main/java/com/casic/app/smartwell/fragment/OrderListFragment.kt index 93ff35b..5e38acb 100644 --- a/app/src/main/java/com/casic/app/smartwell/fragment/OrderListFragment.kt +++ b/app/src/main/java/com/casic/app/smartwell/fragment/OrderListFragment.kt @@ -12,6 +12,7 @@ import com.casic.app.smartwell.view.SearchOrderActivity import com.pengxh.kt.lite.base.KotlinBaseFragment import com.pengxh.kt.lite.extensions.navigatePageTo +import com.pengxh.kt.lite.widget.TitleBarView class OrderListFragment : KotlinBaseFragment() { @@ -25,15 +26,22 @@ } override fun initViewBinding( - inflater: LayoutInflater, - container: ViewGroup? + inflater: LayoutInflater, container: ViewGroup? ): FragmentOrderBinding { return FragmentOrderBinding.inflate(inflater, container, false) } override fun setupTopBarLayout() { binding.rootView.initImmersionBar(this, false, R.color.mainThemeColor) - binding.titleView.text = "工单" + binding.titleView.setOnClickListener(object : TitleBarView.OnClickListener { + override fun onLeftClick() { + + } + + override fun onRightClick() { + requireContext().navigatePageTo() + } + }) } override fun initOnCreate(savedInstanceState: Bundle?) { @@ -51,8 +59,6 @@ } override fun initEvent() { - binding.rightOptionView.setOnClickListener { - requireContext().navigatePageTo() - } + } } \ No newline at end of file diff --git a/app/src/main/java/com/casic/app/smartwell/fragment/OrderNotProcessedFragment.kt b/app/src/main/java/com/casic/app/smartwell/fragment/OrderNotProcessedFragment.kt index 0b3d09d..2b6f21d 100644 --- a/app/src/main/java/com/casic/app/smartwell/fragment/OrderNotProcessedFragment.kt +++ b/app/src/main/java/com/casic/app/smartwell/fragment/OrderNotProcessedFragment.kt @@ -18,7 +18,7 @@ import com.pengxh.kt.lite.extensions.navigatePageTo import com.pengxh.kt.lite.extensions.show import com.pengxh.kt.lite.utils.LoadState -import com.pengxh.kt.lite.utils.LoadingDialogHub +import com.pengxh.kt.lite.utils.LoadingDialog import com.pengxh.kt.lite.utils.WeakReferenceHandler import com.pengxh.kt.lite.widget.dialog.AlertControlDialog @@ -78,8 +78,8 @@ operationViewModel = ViewModelProvider(this)[OperationViewModel::class.java] - binding.notProcessedView.addItemDecoration( - RecyclerViewItemOffsets(0, 5, 0, 5) + binding.recyclerView.addItemDecoration( + RecyclerViewItemOffsets(0, 7, 0, 7) ) } @@ -87,9 +87,9 @@ //接单状态处理 operationViewModel.loadState.observe(this) { when (it) { - is LoadState.Loading -> LoadingDialogHub.show(requireActivity(), "接单中,请稍后") + is LoadState.Loading -> LoadingDialog.show(requireActivity(), "接单中,请稍后") is LoadState.Success -> { - LoadingDialogHub.dismiss() + LoadingDialog.dismiss() //接单成功之后刷新列表 dataBeans.removeAt(clickedPosition) notProcessedAdapter.notifyItemRemoved(clickedPosition) @@ -98,7 +98,7 @@ ) } - else -> LoadingDialogHub.dismiss() + else -> LoadingDialog.dismiss() } } } @@ -131,7 +131,7 @@ } else { binding.emptyInclude.emptyView.hide() notProcessedAdapter = OrderNotProcessedAdapter(requireContext(), dataBeans) - binding.notProcessedView.adapter = notProcessedAdapter + binding.recyclerView.adapter = notProcessedAdapter notProcessedAdapter.setOnItemClickListener(object : OrderNotProcessedAdapter.OnItemClickListener { override fun onClicked(position: Int) { diff --git a/app/src/main/java/com/casic/app/smartwell/fragment/OvertimeNotAcceptFragment.kt b/app/src/main/java/com/casic/app/smartwell/fragment/OvertimeNotAcceptFragment.kt index a198545..9b318ca 100644 --- a/app/src/main/java/com/casic/app/smartwell/fragment/OvertimeNotAcceptFragment.kt +++ b/app/src/main/java/com/casic/app/smartwell/fragment/OvertimeNotAcceptFragment.kt @@ -18,7 +18,7 @@ import com.pengxh.kt.lite.extensions.navigatePageTo import com.pengxh.kt.lite.extensions.show import com.pengxh.kt.lite.utils.LoadState -import com.pengxh.kt.lite.utils.LoadingDialogHub +import com.pengxh.kt.lite.utils.LoadingDialog import com.pengxh.kt.lite.utils.WeakReferenceHandler import com.pengxh.kt.lite.widget.dialog.AlertControlDialog @@ -81,8 +81,8 @@ operationViewModel = ViewModelProvider(this)[OperationViewModel::class.java] - binding.notProcessedView.addItemDecoration( - RecyclerViewItemOffsets(0, 5, 0, 5) + binding.recyclerView.addItemDecoration( + RecyclerViewItemOffsets(0, 7, 0, 7) ) } @@ -90,9 +90,9 @@ //接单状态处理 operationViewModel.loadState.observe(this) { when (it) { - is LoadState.Loading -> LoadingDialogHub.show(requireActivity(), "接单中,请稍后") + is LoadState.Loading -> LoadingDialog.show(requireActivity(), "接单中,请稍后") is LoadState.Success -> { - LoadingDialogHub.dismiss() + LoadingDialog.dismiss() //接单成功之后刷新列表 dataBeans.removeAt(clickedPosition) notProcessedAdapter.notifyItemRemoved(clickedPosition) @@ -101,7 +101,7 @@ ) } - else -> LoadingDialogHub.dismiss() + else -> LoadingDialog.dismiss() } } } @@ -134,7 +134,7 @@ } else { binding.emptyInclude.emptyView.hide() notProcessedAdapter = OrderNotProcessedAdapter(requireContext(), dataBeans) - binding.notProcessedView.adapter = notProcessedAdapter + binding.recyclerView.adapter = notProcessedAdapter notProcessedAdapter.setOnItemClickListener(object : OrderNotProcessedAdapter.OnItemClickListener { override fun onClicked(position: Int) { diff --git a/app/src/main/java/com/casic/app/smartwell/greendao/DaoMaster.java b/app/src/main/java/com/casic/app/smartwell/greendao/DaoMaster.java index fdcf3a7..1e52b74 100644 --- a/app/src/main/java/com/casic/app/smartwell/greendao/DaoMaster.java +++ b/app/src/main/java/com/casic/app/smartwell/greendao/DaoMaster.java @@ -13,25 +13,20 @@ // THIS CODE IS GENERATED BY greenDAO, DO NOT EDIT. - /** * Master of DAO (schema version 4): knows all DAOs. */ public class DaoMaster extends AbstractDaoMaster { public static final int SCHEMA_VERSION = 4; - /** - * Creates underlying database table using DAOs. - */ + /** Creates underlying database table using DAOs. */ public static void createAllTables(Database db, boolean ifNotExists) { MapWellLocalBeanDao.createTable(db, ifNotExists); NoticeLocaleBeanDao.createTable(db, ifNotExists); PipeLocalBeanDao.createTable(db, ifNotExists); } - /** - * Drops underlying database table using DAOs. - */ + /** Drops underlying database table using DAOs. */ public static void dropAllTables(Database db, boolean ifExists) { MapWellLocalBeanDao.dropTable(db, ifExists); NoticeLocaleBeanDao.dropTable(db, ifExists); @@ -86,9 +81,7 @@ } } - /** - * WARNING: Drops all table on Upgrade! Use only during development. - */ + /** WARNING: Drops all table on Upgrade! Use only during development. */ public static class DevOpenHelper extends OpenHelper { public DevOpenHelper(Context context, String name) { super(context, name); diff --git a/app/src/main/java/com/casic/app/smartwell/greendao/DaoSession.java b/app/src/main/java/com/casic/app/smartwell/greendao/DaoSession.java index 0b36d17..3e40e3b 100644 --- a/app/src/main/java/com/casic/app/smartwell/greendao/DaoSession.java +++ b/app/src/main/java/com/casic/app/smartwell/greendao/DaoSession.java @@ -16,7 +16,7 @@ /** * {@inheritDoc} - * + * * @see org.greenrobot.greendao.AbstractDaoSession */ public class DaoSession extends AbstractDaoSession { @@ -50,7 +50,7 @@ registerDao(NoticeLocaleBean.class, noticeLocaleBeanDao); registerDao(PipeLocalBean.class, pipeLocalBeanDao); } - + public void clear() { mapWellLocalBeanDaoConfig.clearIdentityScope(); noticeLocaleBeanDaoConfig.clearIdentityScope(); diff --git a/app/src/main/java/com/casic/app/smartwell/greendao/MapWellLocalBeanDao.java b/app/src/main/java/com/casic/app/smartwell/greendao/MapWellLocalBeanDao.java index 8908fda..407bc92 100644 --- a/app/src/main/java/com/casic/app/smartwell/greendao/MapWellLocalBeanDao.java +++ b/app/src/main/java/com/casic/app/smartwell/greendao/MapWellLocalBeanDao.java @@ -12,10 +12,9 @@ import org.greenrobot.greendao.internal.DaoConfig; // THIS CODE IS GENERATED BY greenDAO, DO NOT EDIT. - -/** +/** * DAO for table "MAP_WELL_LOCAL_BEAN". - */ +*/ public class MapWellLocalBeanDao extends AbstractDao { public static final String TABLENAME = "MAP_WELL_LOCAL_BEAN"; @@ -57,16 +56,14 @@ public MapWellLocalBeanDao(DaoConfig config) { super(config); } - + public MapWellLocalBeanDao(DaoConfig config, DaoSession daoSession) { super(config, daoSession); } - /** - * Creates the underlying database table. - */ + /** Creates the underlying database table. */ public static void createTable(Database db, boolean ifNotExists) { - String constraint = ifNotExists ? "IF NOT EXISTS " : ""; + String constraint = ifNotExists? "IF NOT EXISTS ": ""; db.execSQL("CREATE TABLE " + constraint + "\"MAP_WELL_LOCAL_BEAN\" (" + // "\"_id\" INTEGER PRIMARY KEY AUTOINCREMENT ," + // 0: kId "\"AREA\" TEXT," + // 1: area @@ -96,9 +93,7 @@ "\"WELL_TYPE_NAME\" TEXT);"); // 25: wellTypeName } - /** - * Drops the underlying database table. - */ + /** Drops the underlying database table. */ public static void dropTable(Database db, boolean ifExists) { String sql = "DROP TABLE " + (ifExists ? "IF EXISTS " : "") + "\"MAP_WELL_LOCAL_BEAN\""; db.execSQL(sql); @@ -107,132 +102,132 @@ @Override protected final void bindValues(DatabaseStatement stmt, MapWellLocalBean entity) { stmt.clearBindings(); - + Long kId = entity.getKId(); if (kId != null) { stmt.bindLong(1, kId); } - + String area = entity.getArea(); if (area != null) { stmt.bindString(2, area); } - + String bfzt = entity.getBfzt(); if (bfzt != null) { stmt.bindString(3, bfzt); } - + String bfztName = entity.getBfztName(); if (bfztName != null) { stmt.bindString(4, bfztName); } - + String coordinateX = entity.getCoordinateX(); if (coordinateX != null) { stmt.bindString(5, coordinateX); } - + String coordinateY = entity.getCoordinateY(); if (coordinateY != null) { stmt.bindString(6, coordinateY); } - + String deep = entity.getDeep(); if (deep != null) { stmt.bindString(7, deep); } - + String deptName = entity.getDeptName(); if (deptName != null) { stmt.bindString(8, deptName); } - + String deptid = entity.getDeptid(); if (deptid != null) { stmt.bindString(9, deptid); } - + String id = entity.getId(); if (id != null) { stmt.bindString(10, id); } - + String latBaidu = entity.getLatBaidu(); if (latBaidu != null) { stmt.bindString(11, latBaidu); } - + String latGaode = entity.getLatGaode(); if (latGaode != null) { stmt.bindString(12, latGaode); } - + String lngBaidu = entity.getLngBaidu(); if (lngBaidu != null) { stmt.bindString(13, lngBaidu); } - + String lngGaode = entity.getLngGaode(); if (lngGaode != null) { stmt.bindString(14, lngGaode); } - + String notes = entity.getNotes(); if (notes != null) { stmt.bindString(15, notes); } - + String photos = entity.getPhotos(); if (photos != null) { stmt.bindString(16, photos); } - + String position = entity.getPosition(); if (position != null) { stmt.bindString(17, position); } - + String staff = entity.getStaff(); if (staff != null) { stmt.bindString(18, staff); } - + String tel = entity.getTel(); if (tel != null) { stmt.bindString(19, tel); } - + String ts = entity.getTs(); if (ts != null) { stmt.bindString(20, ts); } - + String valid = entity.getValid(); if (valid != null) { stmt.bindString(21, valid); } - + String watchData = entity.getWatchData(); if (watchData != null) { stmt.bindString(22, watchData); } - + String wellCode = entity.getWellCode(); if (wellCode != null) { stmt.bindString(23, wellCode); } - + String wellName = entity.getWellName(); if (wellName != null) { stmt.bindString(24, wellName); } - + String wellType = entity.getWellType(); if (wellType != null) { stmt.bindString(25, wellType); } - + String wellTypeName = entity.getWellTypeName(); if (wellTypeName != null) { stmt.bindString(26, wellTypeName); @@ -242,132 +237,132 @@ @Override protected final void bindValues(SQLiteStatement stmt, MapWellLocalBean entity) { stmt.clearBindings(); - + Long kId = entity.getKId(); if (kId != null) { stmt.bindLong(1, kId); } - + String area = entity.getArea(); if (area != null) { stmt.bindString(2, area); } - + String bfzt = entity.getBfzt(); if (bfzt != null) { stmt.bindString(3, bfzt); } - + String bfztName = entity.getBfztName(); if (bfztName != null) { stmt.bindString(4, bfztName); } - + String coordinateX = entity.getCoordinateX(); if (coordinateX != null) { stmt.bindString(5, coordinateX); } - + String coordinateY = entity.getCoordinateY(); if (coordinateY != null) { stmt.bindString(6, coordinateY); } - + String deep = entity.getDeep(); if (deep != null) { stmt.bindString(7, deep); } - + String deptName = entity.getDeptName(); if (deptName != null) { stmt.bindString(8, deptName); } - + String deptid = entity.getDeptid(); if (deptid != null) { stmt.bindString(9, deptid); } - + String id = entity.getId(); if (id != null) { stmt.bindString(10, id); } - + String latBaidu = entity.getLatBaidu(); if (latBaidu != null) { stmt.bindString(11, latBaidu); } - + String latGaode = entity.getLatGaode(); if (latGaode != null) { stmt.bindString(12, latGaode); } - + String lngBaidu = entity.getLngBaidu(); if (lngBaidu != null) { stmt.bindString(13, lngBaidu); } - + String lngGaode = entity.getLngGaode(); if (lngGaode != null) { stmt.bindString(14, lngGaode); } - + String notes = entity.getNotes(); if (notes != null) { stmt.bindString(15, notes); } - + String photos = entity.getPhotos(); if (photos != null) { stmt.bindString(16, photos); } - + String position = entity.getPosition(); if (position != null) { stmt.bindString(17, position); } - + String staff = entity.getStaff(); if (staff != null) { stmt.bindString(18, staff); } - + String tel = entity.getTel(); if (tel != null) { stmt.bindString(19, tel); } - + String ts = entity.getTs(); if (ts != null) { stmt.bindString(20, ts); } - + String valid = entity.getValid(); if (valid != null) { stmt.bindString(21, valid); } - + String watchData = entity.getWatchData(); if (watchData != null) { stmt.bindString(22, watchData); } - + String wellCode = entity.getWellCode(); if (wellCode != null) { stmt.bindString(23, wellCode); } - + String wellName = entity.getWellName(); if (wellName != null) { stmt.bindString(24, wellName); } - + String wellType = entity.getWellType(); if (wellType != null) { stmt.bindString(25, wellType); } - + String wellTypeName = entity.getWellTypeName(); if (wellTypeName != null) { stmt.bindString(26, wellTypeName); @@ -377,41 +372,41 @@ @Override public Long readKey(Cursor cursor, int offset) { return cursor.isNull(offset + 0) ? null : cursor.getLong(offset + 0); - } + } @Override public MapWellLocalBean readEntity(Cursor cursor, int offset) { MapWellLocalBean entity = new MapWellLocalBean( // - cursor.isNull(offset + 0) ? null : cursor.getLong(offset + 0), // kId - cursor.isNull(offset + 1) ? null : cursor.getString(offset + 1), // area - cursor.isNull(offset + 2) ? null : cursor.getString(offset + 2), // bfzt - cursor.isNull(offset + 3) ? null : cursor.getString(offset + 3), // bfztName - cursor.isNull(offset + 4) ? null : cursor.getString(offset + 4), // coordinateX - cursor.isNull(offset + 5) ? null : cursor.getString(offset + 5), // coordinateY - cursor.isNull(offset + 6) ? null : cursor.getString(offset + 6), // deep - cursor.isNull(offset + 7) ? null : cursor.getString(offset + 7), // deptName - cursor.isNull(offset + 8) ? null : cursor.getString(offset + 8), // deptid - cursor.isNull(offset + 9) ? null : cursor.getString(offset + 9), // id - cursor.isNull(offset + 10) ? null : cursor.getString(offset + 10), // latBaidu - cursor.isNull(offset + 11) ? null : cursor.getString(offset + 11), // latGaode - cursor.isNull(offset + 12) ? null : cursor.getString(offset + 12), // lngBaidu - cursor.isNull(offset + 13) ? null : cursor.getString(offset + 13), // lngGaode - cursor.isNull(offset + 14) ? null : cursor.getString(offset + 14), // notes - cursor.isNull(offset + 15) ? null : cursor.getString(offset + 15), // photos - cursor.isNull(offset + 16) ? null : cursor.getString(offset + 16), // position - cursor.isNull(offset + 17) ? null : cursor.getString(offset + 17), // staff - cursor.isNull(offset + 18) ? null : cursor.getString(offset + 18), // tel - cursor.isNull(offset + 19) ? null : cursor.getString(offset + 19), // ts - cursor.isNull(offset + 20) ? null : cursor.getString(offset + 20), // valid - cursor.isNull(offset + 21) ? null : cursor.getString(offset + 21), // watchData - cursor.isNull(offset + 22) ? null : cursor.getString(offset + 22), // wellCode - cursor.isNull(offset + 23) ? null : cursor.getString(offset + 23), // wellName - cursor.isNull(offset + 24) ? null : cursor.getString(offset + 24), // wellType - cursor.isNull(offset + 25) ? null : cursor.getString(offset + 25) // wellTypeName + cursor.isNull(offset + 0) ? null : cursor.getLong(offset + 0), // kId + cursor.isNull(offset + 1) ? null : cursor.getString(offset + 1), // area + cursor.isNull(offset + 2) ? null : cursor.getString(offset + 2), // bfzt + cursor.isNull(offset + 3) ? null : cursor.getString(offset + 3), // bfztName + cursor.isNull(offset + 4) ? null : cursor.getString(offset + 4), // coordinateX + cursor.isNull(offset + 5) ? null : cursor.getString(offset + 5), // coordinateY + cursor.isNull(offset + 6) ? null : cursor.getString(offset + 6), // deep + cursor.isNull(offset + 7) ? null : cursor.getString(offset + 7), // deptName + cursor.isNull(offset + 8) ? null : cursor.getString(offset + 8), // deptid + cursor.isNull(offset + 9) ? null : cursor.getString(offset + 9), // id + cursor.isNull(offset + 10) ? null : cursor.getString(offset + 10), // latBaidu + cursor.isNull(offset + 11) ? null : cursor.getString(offset + 11), // latGaode + cursor.isNull(offset + 12) ? null : cursor.getString(offset + 12), // lngBaidu + cursor.isNull(offset + 13) ? null : cursor.getString(offset + 13), // lngGaode + cursor.isNull(offset + 14) ? null : cursor.getString(offset + 14), // notes + cursor.isNull(offset + 15) ? null : cursor.getString(offset + 15), // photos + cursor.isNull(offset + 16) ? null : cursor.getString(offset + 16), // position + cursor.isNull(offset + 17) ? null : cursor.getString(offset + 17), // staff + cursor.isNull(offset + 18) ? null : cursor.getString(offset + 18), // tel + cursor.isNull(offset + 19) ? null : cursor.getString(offset + 19), // ts + cursor.isNull(offset + 20) ? null : cursor.getString(offset + 20), // valid + cursor.isNull(offset + 21) ? null : cursor.getString(offset + 21), // watchData + cursor.isNull(offset + 22) ? null : cursor.getString(offset + 22), // wellCode + cursor.isNull(offset + 23) ? null : cursor.getString(offset + 23), // wellName + cursor.isNull(offset + 24) ? null : cursor.getString(offset + 24), // wellType + cursor.isNull(offset + 25) ? null : cursor.getString(offset + 25) // wellTypeName ); return entity; } - + @Override public void readEntity(Cursor cursor, MapWellLocalBean entity, int offset) { entity.setKId(cursor.isNull(offset + 0) ? null : cursor.getLong(offset + 0)); @@ -440,17 +435,17 @@ entity.setWellName(cursor.isNull(offset + 23) ? null : cursor.getString(offset + 23)); entity.setWellType(cursor.isNull(offset + 24) ? null : cursor.getString(offset + 24)); entity.setWellTypeName(cursor.isNull(offset + 25) ? null : cursor.getString(offset + 25)); - } - + } + @Override protected final Long updateKeyAfterInsert(MapWellLocalBean entity, long rowId) { entity.setKId(rowId); return rowId; } - + @Override public Long getKey(MapWellLocalBean entity) { - if (entity != null) { + if(entity != null) { return entity.getKId(); } else { return null; @@ -466,5 +461,5 @@ protected final boolean isEntityUpdateable() { return true; } - + } diff --git a/app/src/main/java/com/casic/app/smartwell/greendao/NoticeLocaleBeanDao.java b/app/src/main/java/com/casic/app/smartwell/greendao/NoticeLocaleBeanDao.java index 64312ed..deb2d49 100644 --- a/app/src/main/java/com/casic/app/smartwell/greendao/NoticeLocaleBeanDao.java +++ b/app/src/main/java/com/casic/app/smartwell/greendao/NoticeLocaleBeanDao.java @@ -12,10 +12,9 @@ import org.greenrobot.greendao.internal.DaoConfig; // THIS CODE IS GENERATED BY greenDAO, DO NOT EDIT. - -/** +/** * DAO for table "NOTICE_LOCALE_BEAN". - */ +*/ public class NoticeLocaleBeanDao extends AbstractDao { public static final String TABLENAME = "NOTICE_LOCALE_BEAN"; @@ -43,16 +42,14 @@ public NoticeLocaleBeanDao(DaoConfig config) { super(config); } - + public NoticeLocaleBeanDao(DaoConfig config, DaoSession daoSession) { super(config, daoSession); } - /** - * Creates the underlying database table. - */ + /** Creates the underlying database table. */ public static void createTable(Database db, boolean ifNotExists) { - String constraint = ifNotExists ? "IF NOT EXISTS " : ""; + String constraint = ifNotExists? "IF NOT EXISTS ": ""; db.execSQL("CREATE TABLE " + constraint + "\"NOTICE_LOCALE_BEAN\" (" + // "\"_id\" INTEGER PRIMARY KEY AUTOINCREMENT ," + // 0: id "\"MESSAGE_ID\" TEXT UNIQUE ," + // 1: messageId @@ -68,9 +65,7 @@ "\"NOTICE_TIME\" TEXT);"); // 11: noticeTime } - /** - * Drops the underlying database table. - */ + /** Drops the underlying database table. */ public static void dropTable(Database db, boolean ifExists) { String sql = "DROP TABLE " + (ifExists ? "IF EXISTS " : "") + "\"NOTICE_LOCALE_BEAN\""; db.execSQL(sql); @@ -79,62 +74,62 @@ @Override protected final void bindValues(DatabaseStatement stmt, NoticeLocaleBean entity) { stmt.clearBindings(); - + Long id = entity.getId(); if (id != null) { stmt.bindLong(1, id); } - + String messageId = entity.getMessageId(); if (messageId != null) { stmt.bindString(2, messageId); } - + String appid = entity.getAppid(); if (appid != null) { stmt.bindString(3, appid); } - + String clientId = entity.getClientId(); if (clientId != null) { stmt.bindString(4, clientId); } - + String taskId = entity.getTaskId(); if (taskId != null) { stmt.bindString(5, taskId); } - + String userId = entity.getUserId(); if (userId != null) { stmt.bindString(6, userId); } - + String title = entity.getTitle(); if (title != null) { stmt.bindString(7, title); } - + String content = entity.getContent(); if (content != null) { stmt.bindString(8, content); } - + String deviceCode = entity.getDeviceCode(); if (deviceCode != null) { stmt.bindString(9, deviceCode); } - + String jobId = entity.getJobId(); if (jobId != null) { stmt.bindString(10, jobId); } - + String isRead = entity.getIsRead(); if (isRead != null) { stmt.bindString(11, isRead); } - + String noticeTime = entity.getNoticeTime(); if (noticeTime != null) { stmt.bindString(12, noticeTime); @@ -144,62 +139,62 @@ @Override protected final void bindValues(SQLiteStatement stmt, NoticeLocaleBean entity) { stmt.clearBindings(); - + Long id = entity.getId(); if (id != null) { stmt.bindLong(1, id); } - + String messageId = entity.getMessageId(); if (messageId != null) { stmt.bindString(2, messageId); } - + String appid = entity.getAppid(); if (appid != null) { stmt.bindString(3, appid); } - + String clientId = entity.getClientId(); if (clientId != null) { stmt.bindString(4, clientId); } - + String taskId = entity.getTaskId(); if (taskId != null) { stmt.bindString(5, taskId); } - + String userId = entity.getUserId(); if (userId != null) { stmt.bindString(6, userId); } - + String title = entity.getTitle(); if (title != null) { stmt.bindString(7, title); } - + String content = entity.getContent(); if (content != null) { stmt.bindString(8, content); } - + String deviceCode = entity.getDeviceCode(); if (deviceCode != null) { stmt.bindString(9, deviceCode); } - + String jobId = entity.getJobId(); if (jobId != null) { stmt.bindString(10, jobId); } - + String isRead = entity.getIsRead(); if (isRead != null) { stmt.bindString(11, isRead); } - + String noticeTime = entity.getNoticeTime(); if (noticeTime != null) { stmt.bindString(12, noticeTime); @@ -209,27 +204,27 @@ @Override public Long readKey(Cursor cursor, int offset) { return cursor.isNull(offset + 0) ? null : cursor.getLong(offset + 0); - } + } @Override public NoticeLocaleBean readEntity(Cursor cursor, int offset) { NoticeLocaleBean entity = new NoticeLocaleBean( // - cursor.isNull(offset + 0) ? null : cursor.getLong(offset + 0), // id - cursor.isNull(offset + 1) ? null : cursor.getString(offset + 1), // messageId - cursor.isNull(offset + 2) ? null : cursor.getString(offset + 2), // appid - cursor.isNull(offset + 3) ? null : cursor.getString(offset + 3), // clientId - cursor.isNull(offset + 4) ? null : cursor.getString(offset + 4), // taskId - cursor.isNull(offset + 5) ? null : cursor.getString(offset + 5), // userId - cursor.isNull(offset + 6) ? null : cursor.getString(offset + 6), // title - cursor.isNull(offset + 7) ? null : cursor.getString(offset + 7), // content - cursor.isNull(offset + 8) ? null : cursor.getString(offset + 8), // deviceCode - cursor.isNull(offset + 9) ? null : cursor.getString(offset + 9), // jobId - cursor.isNull(offset + 10) ? null : cursor.getString(offset + 10), // isRead - cursor.isNull(offset + 11) ? null : cursor.getString(offset + 11) // noticeTime + cursor.isNull(offset + 0) ? null : cursor.getLong(offset + 0), // id + cursor.isNull(offset + 1) ? null : cursor.getString(offset + 1), // messageId + cursor.isNull(offset + 2) ? null : cursor.getString(offset + 2), // appid + cursor.isNull(offset + 3) ? null : cursor.getString(offset + 3), // clientId + cursor.isNull(offset + 4) ? null : cursor.getString(offset + 4), // taskId + cursor.isNull(offset + 5) ? null : cursor.getString(offset + 5), // userId + cursor.isNull(offset + 6) ? null : cursor.getString(offset + 6), // title + cursor.isNull(offset + 7) ? null : cursor.getString(offset + 7), // content + cursor.isNull(offset + 8) ? null : cursor.getString(offset + 8), // deviceCode + cursor.isNull(offset + 9) ? null : cursor.getString(offset + 9), // jobId + cursor.isNull(offset + 10) ? null : cursor.getString(offset + 10), // isRead + cursor.isNull(offset + 11) ? null : cursor.getString(offset + 11) // noticeTime ); return entity; } - + @Override public void readEntity(Cursor cursor, NoticeLocaleBean entity, int offset) { entity.setId(cursor.isNull(offset + 0) ? null : cursor.getLong(offset + 0)); @@ -244,17 +239,17 @@ entity.setJobId(cursor.isNull(offset + 9) ? null : cursor.getString(offset + 9)); entity.setIsRead(cursor.isNull(offset + 10) ? null : cursor.getString(offset + 10)); entity.setNoticeTime(cursor.isNull(offset + 11) ? null : cursor.getString(offset + 11)); - } - + } + @Override protected final Long updateKeyAfterInsert(NoticeLocaleBean entity, long rowId) { entity.setId(rowId); return rowId; } - + @Override public Long getKey(NoticeLocaleBean entity) { - if (entity != null) { + if(entity != null) { return entity.getId(); } else { return null; @@ -270,5 +265,5 @@ protected final boolean isEntityUpdateable() { return true; } - + } diff --git a/app/src/main/java/com/casic/app/smartwell/greendao/PipeLocalBeanDao.java b/app/src/main/java/com/casic/app/smartwell/greendao/PipeLocalBeanDao.java index aab4d3f..df5515a 100644 --- a/app/src/main/java/com/casic/app/smartwell/greendao/PipeLocalBeanDao.java +++ b/app/src/main/java/com/casic/app/smartwell/greendao/PipeLocalBeanDao.java @@ -12,10 +12,9 @@ import org.greenrobot.greendao.internal.DaoConfig; // THIS CODE IS GENERATED BY greenDAO, DO NOT EDIT. - -/** +/** * DAO for table "PIPE_LOCAL_BEAN". - */ +*/ public class PipeLocalBeanDao extends AbstractDao { public static final String TABLENAME = "PIPE_LOCAL_BEAN"; @@ -37,16 +36,14 @@ public PipeLocalBeanDao(DaoConfig config) { super(config); } - + public PipeLocalBeanDao(DaoConfig config, DaoSession daoSession) { super(config, daoSession); } - /** - * Creates the underlying database table. - */ + /** Creates the underlying database table. */ public static void createTable(Database db, boolean ifNotExists) { - String constraint = ifNotExists ? "IF NOT EXISTS " : ""; + String constraint = ifNotExists? "IF NOT EXISTS ": ""; db.execSQL("CREATE TABLE " + constraint + "\"PIPE_LOCAL_BEAN\" (" + // "\"_id\" INTEGER PRIMARY KEY AUTOINCREMENT ," + // 0: id "\"PIPE_CODE\" TEXT," + // 1: pipeCode @@ -56,9 +53,7 @@ "\"START_LONGITUDE_GD\" TEXT);"); // 5: startLongitudeGd } - /** - * Drops the underlying database table. - */ + /** Drops the underlying database table. */ public static void dropTable(Database db, boolean ifExists) { String sql = "DROP TABLE " + (ifExists ? "IF EXISTS " : "") + "\"PIPE_LOCAL_BEAN\""; db.execSQL(sql); @@ -67,32 +62,32 @@ @Override protected final void bindValues(DatabaseStatement stmt, PipeLocalBean entity) { stmt.clearBindings(); - + Long id = entity.getId(); if (id != null) { stmt.bindLong(1, id); } - + String pipeCode = entity.getPipeCode(); if (pipeCode != null) { stmt.bindString(2, pipeCode); } - + String endLatitudeGd = entity.getEndLatitudeGd(); if (endLatitudeGd != null) { stmt.bindString(3, endLatitudeGd); } - + String endLongitudeGd = entity.getEndLongitudeGd(); if (endLongitudeGd != null) { stmt.bindString(4, endLongitudeGd); } - + String startLatitudeGd = entity.getStartLatitudeGd(); if (startLatitudeGd != null) { stmt.bindString(5, startLatitudeGd); } - + String startLongitudeGd = entity.getStartLongitudeGd(); if (startLongitudeGd != null) { stmt.bindString(6, startLongitudeGd); @@ -102,32 +97,32 @@ @Override protected final void bindValues(SQLiteStatement stmt, PipeLocalBean entity) { stmt.clearBindings(); - + Long id = entity.getId(); if (id != null) { stmt.bindLong(1, id); } - + String pipeCode = entity.getPipeCode(); if (pipeCode != null) { stmt.bindString(2, pipeCode); } - + String endLatitudeGd = entity.getEndLatitudeGd(); if (endLatitudeGd != null) { stmt.bindString(3, endLatitudeGd); } - + String endLongitudeGd = entity.getEndLongitudeGd(); if (endLongitudeGd != null) { stmt.bindString(4, endLongitudeGd); } - + String startLatitudeGd = entity.getStartLatitudeGd(); if (startLatitudeGd != null) { stmt.bindString(5, startLatitudeGd); } - + String startLongitudeGd = entity.getStartLongitudeGd(); if (startLongitudeGd != null) { stmt.bindString(6, startLongitudeGd); @@ -137,21 +132,21 @@ @Override public Long readKey(Cursor cursor, int offset) { return cursor.isNull(offset + 0) ? null : cursor.getLong(offset + 0); - } + } @Override public PipeLocalBean readEntity(Cursor cursor, int offset) { PipeLocalBean entity = new PipeLocalBean( // - cursor.isNull(offset + 0) ? null : cursor.getLong(offset + 0), // id - cursor.isNull(offset + 1) ? null : cursor.getString(offset + 1), // pipeCode - cursor.isNull(offset + 2) ? null : cursor.getString(offset + 2), // endLatitudeGd - cursor.isNull(offset + 3) ? null : cursor.getString(offset + 3), // endLongitudeGd - cursor.isNull(offset + 4) ? null : cursor.getString(offset + 4), // startLatitudeGd - cursor.isNull(offset + 5) ? null : cursor.getString(offset + 5) // startLongitudeGd + cursor.isNull(offset + 0) ? null : cursor.getLong(offset + 0), // id + cursor.isNull(offset + 1) ? null : cursor.getString(offset + 1), // pipeCode + cursor.isNull(offset + 2) ? null : cursor.getString(offset + 2), // endLatitudeGd + cursor.isNull(offset + 3) ? null : cursor.getString(offset + 3), // endLongitudeGd + cursor.isNull(offset + 4) ? null : cursor.getString(offset + 4), // startLatitudeGd + cursor.isNull(offset + 5) ? null : cursor.getString(offset + 5) // startLongitudeGd ); return entity; } - + @Override public void readEntity(Cursor cursor, PipeLocalBean entity, int offset) { entity.setId(cursor.isNull(offset + 0) ? null : cursor.getLong(offset + 0)); @@ -160,17 +155,17 @@ entity.setEndLongitudeGd(cursor.isNull(offset + 3) ? null : cursor.getString(offset + 3)); entity.setStartLatitudeGd(cursor.isNull(offset + 4) ? null : cursor.getString(offset + 4)); entity.setStartLongitudeGd(cursor.isNull(offset + 5) ? null : cursor.getString(offset + 5)); - } - + } + @Override protected final Long updateKeyAfterInsert(PipeLocalBean entity, long rowId) { entity.setId(rowId); return rowId; } - + @Override public Long getKey(PipeLocalBean entity) { - if (entity != null) { + if(entity != null) { return entity.getId(); } else { return null; @@ -186,5 +181,5 @@ protected final boolean isEntityUpdateable() { return true; } - + } diff --git a/app/src/main/java/com/casic/app/smartwell/view/ChangePasswordActivity.kt b/app/src/main/java/com/casic/app/smartwell/view/ChangePasswordActivity.kt index 8e41039..9f1dd40 100644 --- a/app/src/main/java/com/casic/app/smartwell/view/ChangePasswordActivity.kt +++ b/app/src/main/java/com/casic/app/smartwell/view/ChangePasswordActivity.kt @@ -14,7 +14,7 @@ import com.pengxh.kt.lite.extensions.show import com.pengxh.kt.lite.utils.ActivityStackManager import com.pengxh.kt.lite.utils.LoadState -import com.pengxh.kt.lite.utils.LoadingDialogHub +import com.pengxh.kt.lite.utils.LoadingDialog import com.pengxh.kt.lite.widget.TitleBarView import java.nio.charset.StandardCharsets @@ -46,15 +46,15 @@ override fun observeRequestState() { userViewModel.loadState.observe(this) { when (it) { - is LoadState.Loading -> LoadingDialogHub.show(this, "修改中,请稍后") + is LoadState.Loading -> LoadingDialog.show(this, "修改中,请稍后") is LoadState.Success -> { - LoadingDialogHub.dismiss() + LoadingDialog.dismiss() AuthenticationHelper.removeToken() this.navigatePageTo() ActivityStackManager.finishAllActivity() } - else -> LoadingDialogHub.dismiss() + else -> LoadingDialog.dismiss() } } } diff --git a/app/src/main/java/com/casic/app/smartwell/view/DeployedWellActivity.kt b/app/src/main/java/com/casic/app/smartwell/view/DeployedWellActivity.kt index fb4339c..28a5078 100644 --- a/app/src/main/java/com/casic/app/smartwell/view/DeployedWellActivity.kt +++ b/app/src/main/java/com/casic/app/smartwell/view/DeployedWellActivity.kt @@ -83,8 +83,8 @@ } //添加分割线 - binding.deployedListView.addItemDecoration( - RecyclerViewItemOffsets(0, 5, 0, 5) + binding.recyclerView.addItemDecoration( + RecyclerViewItemOffsets(0, 7, 0, 7) ) } @@ -149,12 +149,11 @@ } else { item.deep.toString() + "m" } - viewHolder.setText(R.id.wellNameView, item.wellName) + viewHolder.setText(R.id.wellTypeView, item.wellTypeName) .setText(R.id.wellDepthView, "深:${deep}") .setText(R.id.wellCodeView, "点位编号:${item.wellCode}") - .setText(R.id.wellTypeView, "点位类型:${item.wellTypeName}") .setText(R.id.ownerShipView, "权属单位:${item.deptName}") - .setText(R.id.wellLocationView, "点位置:${item.position}") + .setText(R.id.wellLocationView, "点位位置:${item.position}") .setOnClickListener( R.id.operationButton, object : View.OnClickListener { override fun onClick(v: View?) { @@ -207,7 +206,7 @@ }) } } - binding.deployedListView.adapter = deployAdapter + binding.recyclerView.adapter = deployAdapter deployAdapter.setOnItemClickedListener(object : NormalRecyclerAdapter.OnItemClickedListener { override fun onItemClicked(position: Int, t: WellListModel.DataBean.RowsBean) { diff --git a/app/src/main/java/com/casic/app/smartwell/view/LoginActivity.kt b/app/src/main/java/com/casic/app/smartwell/view/LoginActivity.kt index e4bb0e3..834527b 100644 --- a/app/src/main/java/com/casic/app/smartwell/view/LoginActivity.kt +++ b/app/src/main/java/com/casic/app/smartwell/view/LoginActivity.kt @@ -21,7 +21,7 @@ import com.pengxh.kt.lite.extensions.navigatePageTo import com.pengxh.kt.lite.extensions.readAssetsFile import com.pengxh.kt.lite.extensions.show -import com.pengxh.kt.lite.utils.LoadingDialogHub +import com.pengxh.kt.lite.utils.LoadingDialog import com.pengxh.kt.lite.utils.SaveKeyValues import kotlinx.coroutines.Dispatchers import kotlinx.coroutines.launch @@ -106,11 +106,11 @@ override fun observeRequestState() { authenticateViewModel.loadState.observe(this) { - LoadingDialogHub.show(this, "登录中,请稍后") + LoadingDialog.show(this, "登录中,请稍后") } loginViewModel.loadState.observe(this) { - LoadingDialogHub.dismiss() + LoadingDialog.dismiss() } } diff --git a/app/src/main/java/com/casic/app/smartwell/view/OrderCompletedDetailActivity.kt b/app/src/main/java/com/casic/app/smartwell/view/OrderCompletedDetailActivity.kt index db8ad1f..75cd905 100644 --- a/app/src/main/java/com/casic/app/smartwell/view/OrderCompletedDetailActivity.kt +++ b/app/src/main/java/com/casic/app/smartwell/view/OrderCompletedDetailActivity.kt @@ -17,7 +17,7 @@ import com.pengxh.kt.lite.extensions.show import com.pengxh.kt.lite.utils.Constant import com.pengxh.kt.lite.utils.LoadState -import com.pengxh.kt.lite.utils.LoadingDialogHub +import com.pengxh.kt.lite.utils.LoadingDialog import com.pengxh.kt.lite.widget.TitleBarView import com.pengxh.kt.lite.widget.dialog.AlertMessageDialog @@ -44,7 +44,7 @@ } override fun initOnCreate(savedInstanceState: Bundle?) { - val jobId = intent.getStringExtra(Constant.INTENT_PARAM)!! + val jobId = intent.getStringExtra(Constant.INTENT_PARAM_KEY)!! orderViewModel = ViewModelProvider(this)[OrderViewModel::class.java] orderViewModel.getWorkOrderDetail(jobId) orderViewModel.detailModel.observe(this) { @@ -154,8 +154,8 @@ override fun observeRequestState() { orderViewModel.loadState.observe(this) { when (it) { - is LoadState.Loading -> LoadingDialogHub.show(this, "数据加载中,请稍后") - else -> LoadingDialogHub.dismiss() + is LoadState.Loading -> LoadingDialog.show(this, "数据加载中,请稍后") + else -> LoadingDialog.dismiss() } } } diff --git a/app/src/main/java/com/casic/app/smartwell/view/OrderInHandleDetailActivity.kt b/app/src/main/java/com/casic/app/smartwell/view/OrderInHandleDetailActivity.kt index d70a979..04a7d5d 100644 --- a/app/src/main/java/com/casic/app/smartwell/view/OrderInHandleDetailActivity.kt +++ b/app/src/main/java/com/casic/app/smartwell/view/OrderInHandleDetailActivity.kt @@ -38,7 +38,7 @@ import com.pengxh.kt.lite.extensions.show import com.pengxh.kt.lite.utils.Constant import com.pengxh.kt.lite.utils.LoadState -import com.pengxh.kt.lite.utils.LoadingDialogHub +import com.pengxh.kt.lite.utils.LoadingDialog import com.pengxh.kt.lite.widget.TitleBarView import com.pengxh.kt.lite.widget.dialog.AlertControlDialog import com.pengxh.kt.lite.widget.dialog.AlertMessageDialog @@ -93,7 +93,7 @@ ) binding.addImageRecyclerView.adapter = imageAdapter - val jobId = intent.getStringExtra(Constant.INTENT_PARAM)!!//初始化图片九宫格 + val jobId = intent.getStringExtra(Constant.INTENT_PARAM_KEY)!!//初始化图片九宫格 orderViewModel.getWorkOrderDetail(jobId) orderViewModel.detailModel.observe(this) { if (it.code == 200) { @@ -312,41 +312,41 @@ override fun observeRequestState() { orderViewModel.loadState.observe(this) { when (it) { - is LoadState.Loading -> LoadingDialogHub.show(this, "数据加载中,请稍后") - else -> LoadingDialogHub.dismiss() + is LoadState.Loading -> LoadingDialog.show(this, "数据加载中,请稍后") + else -> LoadingDialog.dismiss() } } uploadImageViewModel.loadState.observe(this) { when (it) { - LoadState.Loading -> LoadingDialogHub.show(this, "图片上传中,请稍后...") - else -> LoadingDialogHub.dismiss() + LoadState.Loading -> LoadingDialog.show(this, "图片上传中,请稍后...") + else -> LoadingDialog.dismiss() } } //转单状态处理 operationViewModel.loadState.observe(this) { when (it) { - is LoadState.Loading -> LoadingDialogHub.show(this, "转单中,请稍后") + is LoadState.Loading -> LoadingDialog.show(this, "转单中,请稍后") is LoadState.Success -> { - LoadingDialogHub.dismiss() + LoadingDialog.dismiss() this.finish() } - else -> LoadingDialogHub.dismiss() + else -> LoadingDialog.dismiss() } } //处理完成工单状态处理 operationViewModel.loadState.observe(this) { when (it) { - is LoadState.Loading -> LoadingDialogHub.show(this, "处理中,请稍后") + is LoadState.Loading -> LoadingDialog.show(this, "处理中,请稍后") is LoadState.Success -> { - LoadingDialogHub.dismiss() + LoadingDialog.dismiss() this.finish() } - else -> LoadingDialogHub.dismiss() + else -> LoadingDialog.dismiss() } } } diff --git a/app/src/main/java/com/casic/app/smartwell/view/OrderNotConfirmedDetailActivity.kt b/app/src/main/java/com/casic/app/smartwell/view/OrderNotConfirmedDetailActivity.kt index 8e036d2..687ec86 100644 --- a/app/src/main/java/com/casic/app/smartwell/view/OrderNotConfirmedDetailActivity.kt +++ b/app/src/main/java/com/casic/app/smartwell/view/OrderNotConfirmedDetailActivity.kt @@ -36,7 +36,7 @@ import com.pengxh.kt.lite.extensions.show import com.pengxh.kt.lite.utils.Constant import com.pengxh.kt.lite.utils.LoadState -import com.pengxh.kt.lite.utils.LoadingDialogHub +import com.pengxh.kt.lite.utils.LoadingDialog import com.pengxh.kt.lite.widget.TitleBarView import com.pengxh.kt.lite.widget.dialog.AlertControlDialog import com.pengxh.kt.lite.widget.dialog.AlertMessageDialog @@ -80,7 +80,7 @@ } override fun initOnCreate(savedInstanceState: Bundle?) { - val jobId = intent.getStringExtra(Constant.INTENT_PARAM)!! + val jobId = intent.getStringExtra(Constant.INTENT_PARAM_KEY)!! //初始化图片九宫格 //左外边距,左内边距,右内边距,右外边距 val viewWidth = getScreenWidth() - (10 + 10 + 10 + 10).dp2px(this) @@ -263,41 +263,41 @@ //数据加载状态处理 orderViewModel.loadState.observe(this) { when (it) { - is LoadState.Loading -> LoadingDialogHub.show(this, "数据加载中,请稍后") - else -> LoadingDialogHub.dismiss() + is LoadState.Loading -> LoadingDialog.show(this, "数据加载中,请稍后") + else -> LoadingDialog.dismiss() } } uploadImageViewModel.loadState.observe(this) { when (it) { - LoadState.Loading -> LoadingDialogHub.show(this, "图片上传中,请稍后") - else -> LoadingDialogHub.dismiss() + LoadState.Loading -> LoadingDialog.show(this, "图片上传中,请稍后") + else -> LoadingDialog.dismiss() } } //转单状态处理 operationViewModel.loadState.observe(this) { when (it) { - is LoadState.Loading -> LoadingDialogHub.show(this, "转单中,请稍后") + is LoadState.Loading -> LoadingDialog.show(this, "转单中,请稍后") is LoadState.Success -> { - LoadingDialogHub.dismiss() + LoadingDialog.dismiss() this.finish() } - else -> LoadingDialogHub.dismiss() + else -> LoadingDialog.dismiss() } } //确认工单状态处理 operationViewModel.loadState.observe(this) { when (it) { - is LoadState.Loading -> LoadingDialogHub.show(this, "处理中,请稍后") + is LoadState.Loading -> LoadingDialog.show(this, "处理中,请稍后") is LoadState.Success -> { - LoadingDialogHub.dismiss() + LoadingDialog.dismiss() this.finish() } - else -> LoadingDialogHub.dismiss() + else -> LoadingDialog.dismiss() } } } diff --git a/app/src/main/java/com/casic/app/smartwell/view/OrderNotProcessedDetailActivity.kt b/app/src/main/java/com/casic/app/smartwell/view/OrderNotProcessedDetailActivity.kt index d3f22dc..0c97a52 100644 --- a/app/src/main/java/com/casic/app/smartwell/view/OrderNotProcessedDetailActivity.kt +++ b/app/src/main/java/com/casic/app/smartwell/view/OrderNotProcessedDetailActivity.kt @@ -18,7 +18,7 @@ import com.pengxh.kt.lite.extensions.show import com.pengxh.kt.lite.utils.Constant import com.pengxh.kt.lite.utils.LoadState -import com.pengxh.kt.lite.utils.LoadingDialogHub +import com.pengxh.kt.lite.utils.LoadingDialog import com.pengxh.kt.lite.widget.TitleBarView import com.pengxh.kt.lite.widget.dialog.AlertControlDialog import com.pengxh.kt.lite.widget.dialog.AlertMessageDialog @@ -50,7 +50,7 @@ } override fun initOnCreate(savedInstanceState: Bundle?) { - this.jobId = intent.getStringExtra(Constant.INTENT_PARAM)!! + this.jobId = intent.getStringExtra(Constant.INTENT_PARAM_KEY)!! orderViewModel = ViewModelProvider(this)[OrderViewModel::class.java] operationViewModel = ViewModelProvider(this)[OperationViewModel::class.java] wellViewModel = ViewModelProvider(this)[WellViewModel::class.java] @@ -162,21 +162,21 @@ //数据加载状态处理 orderViewModel.loadState.observe(this) { when (it) { - is LoadState.Loading -> LoadingDialogHub.show(this, "数据加载中,请稍后") - else -> LoadingDialogHub.dismiss() + is LoadState.Loading -> LoadingDialog.show(this, "数据加载中,请稍后") + else -> LoadingDialog.dismiss() } } //接单状态处理 operationViewModel.loadState.observe(this) { when (it) { - is LoadState.Loading -> LoadingDialogHub.show(this, "接单中,请稍后") + is LoadState.Loading -> LoadingDialog.show(this, "接单中,请稍后") is LoadState.Success -> { - LoadingDialogHub.dismiss() + LoadingDialog.dismiss() this.finish() } - else -> LoadingDialogHub.dismiss() + else -> LoadingDialog.dismiss() } } } diff --git a/app/src/main/java/com/casic/app/smartwell/view/SearchResultActivity.kt b/app/src/main/java/com/casic/app/smartwell/view/SearchResultActivity.kt index 6a92917..4f3a674 100644 --- a/app/src/main/java/com/casic/app/smartwell/view/SearchResultActivity.kt +++ b/app/src/main/java/com/casic/app/smartwell/view/SearchResultActivity.kt @@ -19,7 +19,7 @@ import com.pengxh.kt.lite.extensions.show import com.pengxh.kt.lite.utils.Constant import com.pengxh.kt.lite.utils.LoadState -import com.pengxh.kt.lite.utils.LoadingDialogHub +import com.pengxh.kt.lite.utils.LoadingDialog import com.pengxh.kt.lite.utils.WeakReferenceHandler import com.pengxh.kt.lite.widget.TitleBarView import com.pengxh.kt.lite.widget.dialog.AlertControlDialog @@ -56,7 +56,7 @@ } override fun initOnCreate(savedInstanceState: Bundle?) { - args = intent.getStringArrayListExtra(Constant.INTENT_PARAM)!! + args = intent.getStringArrayListExtra(Constant.INTENT_PARAM_KEY)!! orderViewModel = ViewModelProvider(this)[OrderViewModel::class.java] operationViewModel = ViewModelProvider(this)[OperationViewModel::class.java] @@ -101,24 +101,24 @@ } } - binding.resultRecyclerView.addItemDecoration( - RecyclerViewItemOffsets(0, 5, 0, 5) + binding.recyclerView.addItemDecoration( + RecyclerViewItemOffsets(0, 7, 0, 7) ) } override fun observeRequestState() { orderViewModel.loadState.observe(this) { when (it) { - is LoadState.Loading -> LoadingDialogHub.show(this, "数据加载中,请稍后") - else -> LoadingDialogHub.dismiss() + is LoadState.Loading -> LoadingDialog.show(this, "数据加载中,请稍后") + else -> LoadingDialog.dismiss() } } //接单状态处理 operationViewModel.loadState.observe(this) { when (it) { - is LoadState.Loading -> LoadingDialogHub.show(this, "接单中,请稍后") + is LoadState.Loading -> LoadingDialog.show(this, "接单中,请稍后") is LoadState.Success -> { - LoadingDialogHub.dismiss() + LoadingDialog.dismiss() //接单成功之后刷新列表 dataBeans.removeAt(clickedPosition) searchResultAdapter.notifyItemRemoved(clickedPosition) @@ -127,7 +127,7 @@ ) } - else -> LoadingDialogHub.dismiss() + else -> LoadingDialog.dismiss() } } } @@ -162,7 +162,7 @@ } else { binding.emptyInclude.emptyView.hide() searchResultAdapter = SearchResultAdapter(this, dataBeans) - binding.resultRecyclerView.adapter = searchResultAdapter + binding.recyclerView.adapter = searchResultAdapter searchResultAdapter.setOnItemClickListener(object : SearchResultAdapter.OnItemClickListener { override fun onClicked(position: Int) { diff --git a/app/src/main/java/com/casic/app/smartwell/view/UnDeployWellActivity.kt b/app/src/main/java/com/casic/app/smartwell/view/UnDeployWellActivity.kt index 7f7cd3c..555c278 100644 --- a/app/src/main/java/com/casic/app/smartwell/view/UnDeployWellActivity.kt +++ b/app/src/main/java/com/casic/app/smartwell/view/UnDeployWellActivity.kt @@ -81,8 +81,8 @@ } } - binding.undeployListView.addItemDecoration( - RecyclerViewItemOffsets(0, 5, 0, 5) + binding.recyclerView.addItemDecoration( + RecyclerViewItemOffsets(0, 7, 0, 7) ) } @@ -147,12 +147,11 @@ } else { item.deep.toString() + "m" } - viewHolder.setText(R.id.wellNameView, item.wellName) + viewHolder.setText(R.id.wellTypeView, item.wellTypeName) .setText(R.id.wellDepthView, "深:${deep}") .setText(R.id.wellCodeView, "点位编号:${item.wellCode}") - .setText(R.id.wellTypeView, "点位类型:${item.wellTypeName}") .setText(R.id.ownerShipView, "权属单位:${item.deptName}") - .setText(R.id.wellLocationView, "点位置:${item.position}") + .setText(R.id.wellLocationView, "点位位置:${item.position}") .setOnClickListener( R.id.operationButton, object : View.OnClickListener { override fun onClick(v: View?) { @@ -185,7 +184,7 @@ ) } } - binding.undeployListView.adapter = unDeployAdapter + binding.recyclerView.adapter = unDeployAdapter unDeployAdapter.setOnItemClickedListener(object : NormalRecyclerAdapter.OnItemClickedListener { override fun onItemClicked(position: Int, t: WellListModel.DataBean.RowsBean) { diff --git a/app/src/main/java/com/casic/app/smartwell/view/WellDetailActivity.kt b/app/src/main/java/com/casic/app/smartwell/view/WellDetailActivity.kt index b50d067..eb8b468 100644 --- a/app/src/main/java/com/casic/app/smartwell/view/WellDetailActivity.kt +++ b/app/src/main/java/com/casic/app/smartwell/view/WellDetailActivity.kt @@ -16,7 +16,7 @@ import com.pengxh.kt.lite.extensions.show import com.pengxh.kt.lite.utils.Constant import com.pengxh.kt.lite.utils.LoadState -import com.pengxh.kt.lite.utils.LoadingDialogHub +import com.pengxh.kt.lite.utils.LoadingDialog import com.pengxh.kt.lite.widget.TitleBarView import com.pengxh.kt.lite.widget.dialog.AlertMessageDialog @@ -44,7 +44,7 @@ } override fun initOnCreate(savedInstanceState: Bundle?) { - val wellId = intent.getStringExtra(Constant.INTENT_PARAM)!! + val wellId = intent.getStringExtra(Constant.INTENT_PARAM_KEY)!! wellViewModel = ViewModelProvider(this)[WellViewModel::class.java] wellViewModel.getWellDetail(wellId) wellViewModel.wellDetailModel.observe(this) { @@ -132,8 +132,8 @@ override fun observeRequestState() { wellViewModel.loadState.observe(this) { when (it) { - is LoadState.Loading -> LoadingDialogHub.show(this, "数据加载中,请稍后") - else -> LoadingDialogHub.dismiss() + is LoadState.Loading -> LoadingDialog.show(this, "数据加载中,请稍后") + else -> LoadingDialog.dismiss() } } } diff --git a/app/src/main/java/com/casic/app/smartwell/view/WellManagementActivity.kt b/app/src/main/java/com/casic/app/smartwell/view/WellManagementActivity.kt index 084da95..457096b 100644 --- a/app/src/main/java/com/casic/app/smartwell/view/WellManagementActivity.kt +++ b/app/src/main/java/com/casic/app/smartwell/view/WellManagementActivity.kt @@ -94,8 +94,8 @@ } } - binding.wellListView.addItemDecoration( - RecyclerViewItemOffsets(0, 5, 0, 5) + binding.recyclerView.addItemDecoration( + RecyclerViewItemOffsets(0, 7, 0, 7) ) } @@ -175,13 +175,12 @@ } else { item.deep.toString() + "m" } - viewHolder.setText(R.id.wellNameView, item.wellName) + viewHolder.setText(R.id.wellTypeView, item.wellTypeName) .setText(R.id.wellStateView, "已${item.bfztName}") .setText(R.id.wellDepthView, "深:${deep}") .setText(R.id.wellCodeView, "点位编号:${item.wellCode}") - .setText(R.id.wellTypeView, "点位类型:${item.wellTypeName}") .setText(R.id.ownerShipView, "权属单位:${item.deptName}") - .setText(R.id.wellLocationView, "点位置:${item.position}") + .setText(R.id.wellLocationView, "点位位置:${item.position}") .setOnClickListener( R.id.navigationButton, object : View.OnClickListener { override fun onClick(v: View?) { @@ -200,7 +199,7 @@ ) } } - binding.wellListView.adapter = wellListAdapter + binding.recyclerView.adapter = wellListAdapter wellListAdapter.setOnItemClickedListener(object : NormalRecyclerAdapter.OnItemClickedListener { override fun onItemClicked(position: Int, t: WellListModel.DataBean.RowsBean) { diff --git a/app/src/main/java/com/casic/app/smartwell/view/WellMonitorActivity.kt b/app/src/main/java/com/casic/app/smartwell/view/WellMonitorActivity.kt index e3573eb..b87bdb7 100644 --- a/app/src/main/java/com/casic/app/smartwell/view/WellMonitorActivity.kt +++ b/app/src/main/java/com/casic/app/smartwell/view/WellMonitorActivity.kt @@ -11,7 +11,7 @@ import com.pengxh.kt.lite.base.KotlinBaseActivity import com.pengxh.kt.lite.utils.Constant import com.pengxh.kt.lite.utils.LoadState -import com.pengxh.kt.lite.utils.LoadingDialogHub +import com.pengxh.kt.lite.utils.LoadingDialog import com.pengxh.kt.lite.widget.TitleBarView class WellMonitorActivity : KotlinBaseActivity() { @@ -36,7 +36,7 @@ } override fun initOnCreate(savedInstanceState: Bundle?) { - val wellId = intent.getStringExtra(Constant.INTENT_PARAM)!! + val wellId = intent.getStringExtra(Constant.INTENT_PARAM_KEY)!! wellViewModel = ViewModelProvider(this)[WellViewModel::class.java] wellViewModel.getMonitorResult(wellId) wellViewModel.monitorModel.observe(this) { @@ -56,8 +56,8 @@ override fun observeRequestState() { wellViewModel.loadState.observe(this) { when (it) { - is LoadState.Loading -> LoadingDialogHub.show(this, "数据加载中,请稍后") - else -> LoadingDialogHub.dismiss() + is LoadState.Loading -> LoadingDialog.show(this, "数据加载中,请稍后") + else -> LoadingDialog.dismiss() } } } diff --git a/app/src/main/java/com/casic/app/smartwell/view/WellOperationActivity.kt b/app/src/main/java/com/casic/app/smartwell/view/WellOperationActivity.kt index 8d333bf..347ebb6 100644 --- a/app/src/main/java/com/casic/app/smartwell/view/WellOperationActivity.kt +++ b/app/src/main/java/com/casic/app/smartwell/view/WellOperationActivity.kt @@ -23,7 +23,7 @@ import com.pengxh.kt.lite.extensions.navigatePageTo import com.pengxh.kt.lite.extensions.show import com.pengxh.kt.lite.utils.LoadState -import com.pengxh.kt.lite.utils.LoadingDialogHub +import com.pengxh.kt.lite.utils.LoadingDialog import com.pengxh.kt.lite.utils.WeakReferenceHandler import com.pengxh.kt.lite.widget.dialog.AlertControlDialog @@ -109,8 +109,8 @@ } } - binding.operationListView.addItemDecoration( - RecyclerViewItemOffsets(0, 5, 0, 5) + binding.recyclerView.addItemDecoration( + RecyclerViewItemOffsets(0, 7, 0, 7) ) } @@ -123,13 +123,13 @@ override fun observeRequestState() { wellViewModel.loadState.observe(this) { when (it) { - is LoadState.Loading -> LoadingDialogHub.show(this, "处理中,请稍后") + is LoadState.Loading -> LoadingDialog.show(this, "处理中,请稍后") is LoadState.Success -> { - LoadingDialogHub.dismiss() + LoadingDialog.dismiss() wellOperationAdapter.notifyItemChanged(clickedPosition) } - else -> LoadingDialogHub.dismiss() + else -> LoadingDialog.dismiss() } } } @@ -203,24 +203,23 @@ if (item.bfztName == "布防") { viewHolder.setImageResource( R.id.wellStateView, R.drawable.bg_solid_text_green_radius_5 - ).setText(R.id.wellStateView, "撤防") + ).setText(R.id.operationButton, "撤防") } else { viewHolder.setImageResource( R.id.wellStateView, R.drawable.bg_solid_text_red_radius_5 - ).setText(R.id.wellStateView, "布防") + ).setText(R.id.operationButton, "布防") } val deep = if (item.deep.toString().isBlank()) { "未知" } else { item.deep.toString() + "m" } - viewHolder.setText(R.id.wellNameView, item.wellName) + viewHolder.setText(R.id.wellTypeView, item.wellTypeName) .setText(R.id.wellStateView, "已${item.bfztName}") .setText(R.id.wellDepthView, "深:${deep}") .setText(R.id.wellCodeView, "点位编号:${item.wellCode}") - .setText(R.id.wellTypeView, "点位类型:${item.wellTypeName}") .setText(R.id.ownerShipView, "权属单位:${item.deptName}") - .setText(R.id.wellLocationView, "点位置:${item.position}") + .setText(R.id.wellLocationView, "点位位置:${item.position}") .setOnClickListener( R.id.operationButton, object : View.OnClickListener { override fun onClick(v: View?) { @@ -280,7 +279,7 @@ ) } } - binding.operationListView.adapter = wellOperationAdapter + binding.recyclerView.adapter = wellOperationAdapter wellOperationAdapter.setOnItemClickedListener(object : NormalRecyclerAdapter.OnItemClickedListener { override fun onItemClicked(position: Int, t: WellListModel.DataBean.RowsBean) { diff --git a/app/src/main/res/drawable/ic_down.xml b/app/src/main/res/drawable/ic_down.xml index 20e6476..6987e6c 100644 --- a/app/src/main/res/drawable/ic_down.xml +++ b/app/src/main/res/drawable/ic_down.xml @@ -1,6 +1,6 @@ + + diff --git a/app/src/main/res/layout/activity_about_us.xml b/app/src/main/res/layout/activity_about_us.xml index 9091a00..d5fbd0d 100644 --- a/app/src/main/res/layout/activity_about_us.xml +++ b/app/src/main/res/layout/activity_about_us.xml @@ -12,13 +12,7 @@ android:layout_width="match_parent" android:layout_height="wrap_content" android:background="@color/mainThemeColor" - app:tbv_left_image="@drawable/ic_title_left" - app:tbv_only_show_title="false" - app:tbv_show_left_image="true" - app:tbv_show_right_image="false" - app:tbv_text="关于我们" - app:tbv_text_color="@color/white" - app:tbv_text_size="@dimen/sp_18" /> + app:tbv_text="关于我们" /> + app:tbv_text="修改密码" /> - + + android:value="ee96d8b5e12de3fbb29949efd57418a8" /> () @@ -150,7 +158,7 @@ val cameraPosition = CameraPosition(centerLatLng, 14f, 0f, 0f) val cameraUpdate = CameraUpdateFactory.newCameraPosition(cameraPosition) withContext(Dispatchers.Main) { - LoadingDialogHub.dismiss() + LoadingDialog.dismiss() aMap.animateCamera(cameraUpdate, 1500, null) } } @@ -239,11 +247,6 @@ } override fun initEvent() { - binding.rightOptionView.setOnClickListener { - val x = binding.rightOptionView.width - easyPopupWindow.width - easyPopupWindow.showAsDropDown(binding.rightOptionView, x, 0) - } - //撤防点位 binding.unDeployedLayout.setOnClickListener { requireContext().navigatePageTo() @@ -263,11 +266,11 @@ override fun observeRequestState() { wellViewModel.loadState.observe(this) { when (it) { - is LoadState.Loading -> LoadingDialogHub.show( + is LoadState.Loading -> LoadingDialog.show( requireActivity(), "数据加载中,请稍后..." ) - else -> LoadingDialogHub.dismiss() + else -> LoadingDialog.dismiss() } } } @@ -376,7 +379,7 @@ }).build().show() } }) - infoPopup.showAsDropDown(binding.rightOptionView) +// infoPopup.showAsDropDown(binding.rightOptionView) } override fun onCameraChange(p0: CameraPosition?) { diff --git a/app/src/main/java/com/casic/app/smartwell/fragment/HomePageNoClusterFragment.kt b/app/src/main/java/com/casic/app/smartwell/fragment/HomePageNoClusterFragment.kt index 802426a..b25f743 100644 --- a/app/src/main/java/com/casic/app/smartwell/fragment/HomePageNoClusterFragment.kt +++ b/app/src/main/java/com/casic/app/smartwell/fragment/HomePageNoClusterFragment.kt @@ -38,8 +38,9 @@ import com.pengxh.kt.lite.extensions.navigatePageTo import com.pengxh.kt.lite.extensions.show import com.pengxh.kt.lite.utils.LoadState -import com.pengxh.kt.lite.utils.LoadingDialogHub +import com.pengxh.kt.lite.utils.LoadingDialog import com.pengxh.kt.lite.widget.EasyPopupWindow +import com.pengxh.kt.lite.widget.TitleBarView import com.pengxh.kt.lite.widget.dialog.AlertControlDialog import kotlinx.coroutines.Dispatchers import kotlinx.coroutines.launch @@ -78,7 +79,15 @@ override fun setupTopBarLayout() { binding.rootView.initImmersionBar(this, false, R.color.mainThemeColor) - binding.titleView.text = "首页" + binding.titleView.setOnClickListener(object : TitleBarView.OnClickListener { + override fun onLeftClick() { + + } + + override fun onRightClick() { + easyPopupWindow.showAsDropDown(binding.titleView, binding.titleView.width, 0) + } + }) } override fun initOnCreate(savedInstanceState: Bundle?) { @@ -112,7 +121,7 @@ //渲染井位置 lifecycleScope.launch(Dispatchers.Main) { - LoadingDialogHub.show(requireActivity(), "数据加载中,请稍后") + LoadingDialog.show(requireActivity(), "数据加载中,请稍后") withContext(Dispatchers.IO) { //取Well缓存 val allMarkerOptions = ArrayList() @@ -144,7 +153,7 @@ val cameraPosition = CameraPosition(centerLatLng, 14f, 0f, 0f) val cameraUpdate = CameraUpdateFactory.newCameraPosition(cameraPosition) withContext(Dispatchers.Main) { - LoadingDialogHub.dismiss() + LoadingDialog.dismiss() aMap.animateCamera(cameraUpdate, 1500, null) } } @@ -238,11 +247,6 @@ } override fun initEvent() { - binding.rightOptionView.setOnClickListener { - val x = binding.rightOptionView.width - easyPopupWindow.width - easyPopupWindow.showAsDropDown(binding.rightOptionView, x, 0) - } - //撤防点位 binding.unDeployedLayout.setOnClickListener { requireContext().navigatePageTo() @@ -262,11 +266,11 @@ override fun observeRequestState() { wellViewModel.loadState.observe(this) { when (it) { - is LoadState.Loading -> LoadingDialogHub.show( + is LoadState.Loading -> LoadingDialog.show( requireActivity(), "数据加载中,请稍后..." ) - else -> LoadingDialogHub.dismiss() + else -> LoadingDialog.dismiss() } } } diff --git a/app/src/main/java/com/casic/app/smartwell/fragment/MinePageFragment.kt b/app/src/main/java/com/casic/app/smartwell/fragment/MinePageFragment.kt index 09a570c..dcb48f8 100644 --- a/app/src/main/java/com/casic/app/smartwell/fragment/MinePageFragment.kt +++ b/app/src/main/java/com/casic/app/smartwell/fragment/MinePageFragment.kt @@ -35,7 +35,7 @@ import com.pengxh.kt.lite.utils.ActivityStackManager import com.pengxh.kt.lite.utils.FileDownloadManager import com.pengxh.kt.lite.utils.LoadState -import com.pengxh.kt.lite.utils.LoadingDialogHub +import com.pengxh.kt.lite.utils.LoadingDialog import com.pengxh.kt.lite.widget.dialog.AlertControlDialog import com.pengxh.kt.lite.widget.dialog.BottomActionSheet import kotlinx.coroutines.Dispatchers @@ -60,7 +60,6 @@ override fun setupTopBarLayout() { binding.rootView.initImmersionBar(this, false, R.color.mainThemeColor) - binding.titleInclude.titleView.text = "我的" } override fun initOnCreate(savedInstanceState: Bundle?) { @@ -155,27 +154,27 @@ override fun observeRequestState() { userViewModel.loadState.observe(this) { when (it) { - is LoadState.Loading -> LoadingDialogHub.show( + is LoadState.Loading -> LoadingDialog.show( requireActivity(), "检查版本中,请稍后" ) - else -> LoadingDialogHub.dismiss() + else -> LoadingDialog.dismiss() } } wellViewModel.loadState.observe(this) { when (it) { - is LoadState.Loading -> LoadingDialogHub.show( + is LoadState.Loading -> LoadingDialog.show( requireActivity(), "数据更新中,请稍后" ) is LoadState.Fail -> { - LoadingDialogHub.dismiss() + LoadingDialog.dismiss() "数据更新超时".show(requireContext()) } else -> { - LoadingDialogHub.dismiss() + LoadingDialog.dismiss() AlertControlDialog.Builder().setContext(requireContext()).setTitle("温馨提示") .setMessage("数据更新成功,请重启应用").setNegativeButton("取消") .setPositiveButton("确定").setOnDialogButtonClickListener(object : @@ -197,17 +196,17 @@ lineViewModel.loadState.observe(this) { when (it) { - is LoadState.Loading -> LoadingDialogHub.show( + is LoadState.Loading -> LoadingDialog.show( requireActivity(), "数据更新中,请稍后" ) is LoadState.Fail -> { - LoadingDialogHub.dismiss() + LoadingDialog.dismiss() "数据更新超时".show(requireContext()) } else -> { - LoadingDialogHub.dismiss() + LoadingDialog.dismiss() AlertControlDialog.Builder().setContext(requireContext()).setTitle("温馨提示") .setMessage("数据更新成功,请重启应用").setNegativeButton("取消") .setPositiveButton("确定").setOnDialogButtonClickListener(object : diff --git a/app/src/main/java/com/casic/app/smartwell/fragment/NoticePageFragment.kt b/app/src/main/java/com/casic/app/smartwell/fragment/NoticePageFragment.kt index 171b555..3c93f54 100644 --- a/app/src/main/java/com/casic/app/smartwell/fragment/NoticePageFragment.kt +++ b/app/src/main/java/com/casic/app/smartwell/fragment/NoticePageFragment.kt @@ -48,7 +48,6 @@ override fun setupTopBarLayout() { binding.rootView.initImmersionBar(this, false, R.color.mainThemeColor) - binding.titleInclude.titleView.text = "消息" } override fun initOnCreate(savedInstanceState: Bundle?) { diff --git a/app/src/main/java/com/casic/app/smartwell/fragment/OrderListFragment.kt b/app/src/main/java/com/casic/app/smartwell/fragment/OrderListFragment.kt index 93ff35b..5e38acb 100644 --- a/app/src/main/java/com/casic/app/smartwell/fragment/OrderListFragment.kt +++ b/app/src/main/java/com/casic/app/smartwell/fragment/OrderListFragment.kt @@ -12,6 +12,7 @@ import com.casic.app.smartwell.view.SearchOrderActivity import com.pengxh.kt.lite.base.KotlinBaseFragment import com.pengxh.kt.lite.extensions.navigatePageTo +import com.pengxh.kt.lite.widget.TitleBarView class OrderListFragment : KotlinBaseFragment() { @@ -25,15 +26,22 @@ } override fun initViewBinding( - inflater: LayoutInflater, - container: ViewGroup? + inflater: LayoutInflater, container: ViewGroup? ): FragmentOrderBinding { return FragmentOrderBinding.inflate(inflater, container, false) } override fun setupTopBarLayout() { binding.rootView.initImmersionBar(this, false, R.color.mainThemeColor) - binding.titleView.text = "工单" + binding.titleView.setOnClickListener(object : TitleBarView.OnClickListener { + override fun onLeftClick() { + + } + + override fun onRightClick() { + requireContext().navigatePageTo() + } + }) } override fun initOnCreate(savedInstanceState: Bundle?) { @@ -51,8 +59,6 @@ } override fun initEvent() { - binding.rightOptionView.setOnClickListener { - requireContext().navigatePageTo() - } + } } \ No newline at end of file diff --git a/app/src/main/java/com/casic/app/smartwell/fragment/OrderNotProcessedFragment.kt b/app/src/main/java/com/casic/app/smartwell/fragment/OrderNotProcessedFragment.kt index 0b3d09d..2b6f21d 100644 --- a/app/src/main/java/com/casic/app/smartwell/fragment/OrderNotProcessedFragment.kt +++ b/app/src/main/java/com/casic/app/smartwell/fragment/OrderNotProcessedFragment.kt @@ -18,7 +18,7 @@ import com.pengxh.kt.lite.extensions.navigatePageTo import com.pengxh.kt.lite.extensions.show import com.pengxh.kt.lite.utils.LoadState -import com.pengxh.kt.lite.utils.LoadingDialogHub +import com.pengxh.kt.lite.utils.LoadingDialog import com.pengxh.kt.lite.utils.WeakReferenceHandler import com.pengxh.kt.lite.widget.dialog.AlertControlDialog @@ -78,8 +78,8 @@ operationViewModel = ViewModelProvider(this)[OperationViewModel::class.java] - binding.notProcessedView.addItemDecoration( - RecyclerViewItemOffsets(0, 5, 0, 5) + binding.recyclerView.addItemDecoration( + RecyclerViewItemOffsets(0, 7, 0, 7) ) } @@ -87,9 +87,9 @@ //接单状态处理 operationViewModel.loadState.observe(this) { when (it) { - is LoadState.Loading -> LoadingDialogHub.show(requireActivity(), "接单中,请稍后") + is LoadState.Loading -> LoadingDialog.show(requireActivity(), "接单中,请稍后") is LoadState.Success -> { - LoadingDialogHub.dismiss() + LoadingDialog.dismiss() //接单成功之后刷新列表 dataBeans.removeAt(clickedPosition) notProcessedAdapter.notifyItemRemoved(clickedPosition) @@ -98,7 +98,7 @@ ) } - else -> LoadingDialogHub.dismiss() + else -> LoadingDialog.dismiss() } } } @@ -131,7 +131,7 @@ } else { binding.emptyInclude.emptyView.hide() notProcessedAdapter = OrderNotProcessedAdapter(requireContext(), dataBeans) - binding.notProcessedView.adapter = notProcessedAdapter + binding.recyclerView.adapter = notProcessedAdapter notProcessedAdapter.setOnItemClickListener(object : OrderNotProcessedAdapter.OnItemClickListener { override fun onClicked(position: Int) { diff --git a/app/src/main/java/com/casic/app/smartwell/fragment/OvertimeNotAcceptFragment.kt b/app/src/main/java/com/casic/app/smartwell/fragment/OvertimeNotAcceptFragment.kt index a198545..9b318ca 100644 --- a/app/src/main/java/com/casic/app/smartwell/fragment/OvertimeNotAcceptFragment.kt +++ b/app/src/main/java/com/casic/app/smartwell/fragment/OvertimeNotAcceptFragment.kt @@ -18,7 +18,7 @@ import com.pengxh.kt.lite.extensions.navigatePageTo import com.pengxh.kt.lite.extensions.show import com.pengxh.kt.lite.utils.LoadState -import com.pengxh.kt.lite.utils.LoadingDialogHub +import com.pengxh.kt.lite.utils.LoadingDialog import com.pengxh.kt.lite.utils.WeakReferenceHandler import com.pengxh.kt.lite.widget.dialog.AlertControlDialog @@ -81,8 +81,8 @@ operationViewModel = ViewModelProvider(this)[OperationViewModel::class.java] - binding.notProcessedView.addItemDecoration( - RecyclerViewItemOffsets(0, 5, 0, 5) + binding.recyclerView.addItemDecoration( + RecyclerViewItemOffsets(0, 7, 0, 7) ) } @@ -90,9 +90,9 @@ //接单状态处理 operationViewModel.loadState.observe(this) { when (it) { - is LoadState.Loading -> LoadingDialogHub.show(requireActivity(), "接单中,请稍后") + is LoadState.Loading -> LoadingDialog.show(requireActivity(), "接单中,请稍后") is LoadState.Success -> { - LoadingDialogHub.dismiss() + LoadingDialog.dismiss() //接单成功之后刷新列表 dataBeans.removeAt(clickedPosition) notProcessedAdapter.notifyItemRemoved(clickedPosition) @@ -101,7 +101,7 @@ ) } - else -> LoadingDialogHub.dismiss() + else -> LoadingDialog.dismiss() } } } @@ -134,7 +134,7 @@ } else { binding.emptyInclude.emptyView.hide() notProcessedAdapter = OrderNotProcessedAdapter(requireContext(), dataBeans) - binding.notProcessedView.adapter = notProcessedAdapter + binding.recyclerView.adapter = notProcessedAdapter notProcessedAdapter.setOnItemClickListener(object : OrderNotProcessedAdapter.OnItemClickListener { override fun onClicked(position: Int) { diff --git a/app/src/main/java/com/casic/app/smartwell/greendao/DaoMaster.java b/app/src/main/java/com/casic/app/smartwell/greendao/DaoMaster.java index fdcf3a7..1e52b74 100644 --- a/app/src/main/java/com/casic/app/smartwell/greendao/DaoMaster.java +++ b/app/src/main/java/com/casic/app/smartwell/greendao/DaoMaster.java @@ -13,25 +13,20 @@ // THIS CODE IS GENERATED BY greenDAO, DO NOT EDIT. - /** * Master of DAO (schema version 4): knows all DAOs. */ public class DaoMaster extends AbstractDaoMaster { public static final int SCHEMA_VERSION = 4; - /** - * Creates underlying database table using DAOs. - */ + /** Creates underlying database table using DAOs. */ public static void createAllTables(Database db, boolean ifNotExists) { MapWellLocalBeanDao.createTable(db, ifNotExists); NoticeLocaleBeanDao.createTable(db, ifNotExists); PipeLocalBeanDao.createTable(db, ifNotExists); } - /** - * Drops underlying database table using DAOs. - */ + /** Drops underlying database table using DAOs. */ public static void dropAllTables(Database db, boolean ifExists) { MapWellLocalBeanDao.dropTable(db, ifExists); NoticeLocaleBeanDao.dropTable(db, ifExists); @@ -86,9 +81,7 @@ } } - /** - * WARNING: Drops all table on Upgrade! Use only during development. - */ + /** WARNING: Drops all table on Upgrade! Use only during development. */ public static class DevOpenHelper extends OpenHelper { public DevOpenHelper(Context context, String name) { super(context, name); diff --git a/app/src/main/java/com/casic/app/smartwell/greendao/DaoSession.java b/app/src/main/java/com/casic/app/smartwell/greendao/DaoSession.java index 0b36d17..3e40e3b 100644 --- a/app/src/main/java/com/casic/app/smartwell/greendao/DaoSession.java +++ b/app/src/main/java/com/casic/app/smartwell/greendao/DaoSession.java @@ -16,7 +16,7 @@ /** * {@inheritDoc} - * + * * @see org.greenrobot.greendao.AbstractDaoSession */ public class DaoSession extends AbstractDaoSession { @@ -50,7 +50,7 @@ registerDao(NoticeLocaleBean.class, noticeLocaleBeanDao); registerDao(PipeLocalBean.class, pipeLocalBeanDao); } - + public void clear() { mapWellLocalBeanDaoConfig.clearIdentityScope(); noticeLocaleBeanDaoConfig.clearIdentityScope(); diff --git a/app/src/main/java/com/casic/app/smartwell/greendao/MapWellLocalBeanDao.java b/app/src/main/java/com/casic/app/smartwell/greendao/MapWellLocalBeanDao.java index 8908fda..407bc92 100644 --- a/app/src/main/java/com/casic/app/smartwell/greendao/MapWellLocalBeanDao.java +++ b/app/src/main/java/com/casic/app/smartwell/greendao/MapWellLocalBeanDao.java @@ -12,10 +12,9 @@ import org.greenrobot.greendao.internal.DaoConfig; // THIS CODE IS GENERATED BY greenDAO, DO NOT EDIT. - -/** +/** * DAO for table "MAP_WELL_LOCAL_BEAN". - */ +*/ public class MapWellLocalBeanDao extends AbstractDao { public static final String TABLENAME = "MAP_WELL_LOCAL_BEAN"; @@ -57,16 +56,14 @@ public MapWellLocalBeanDao(DaoConfig config) { super(config); } - + public MapWellLocalBeanDao(DaoConfig config, DaoSession daoSession) { super(config, daoSession); } - /** - * Creates the underlying database table. - */ + /** Creates the underlying database table. */ public static void createTable(Database db, boolean ifNotExists) { - String constraint = ifNotExists ? "IF NOT EXISTS " : ""; + String constraint = ifNotExists? "IF NOT EXISTS ": ""; db.execSQL("CREATE TABLE " + constraint + "\"MAP_WELL_LOCAL_BEAN\" (" + // "\"_id\" INTEGER PRIMARY KEY AUTOINCREMENT ," + // 0: kId "\"AREA\" TEXT," + // 1: area @@ -96,9 +93,7 @@ "\"WELL_TYPE_NAME\" TEXT);"); // 25: wellTypeName } - /** - * Drops the underlying database table. - */ + /** Drops the underlying database table. */ public static void dropTable(Database db, boolean ifExists) { String sql = "DROP TABLE " + (ifExists ? "IF EXISTS " : "") + "\"MAP_WELL_LOCAL_BEAN\""; db.execSQL(sql); @@ -107,132 +102,132 @@ @Override protected final void bindValues(DatabaseStatement stmt, MapWellLocalBean entity) { stmt.clearBindings(); - + Long kId = entity.getKId(); if (kId != null) { stmt.bindLong(1, kId); } - + String area = entity.getArea(); if (area != null) { stmt.bindString(2, area); } - + String bfzt = entity.getBfzt(); if (bfzt != null) { stmt.bindString(3, bfzt); } - + String bfztName = entity.getBfztName(); if (bfztName != null) { stmt.bindString(4, bfztName); } - + String coordinateX = entity.getCoordinateX(); if (coordinateX != null) { stmt.bindString(5, coordinateX); } - + String coordinateY = entity.getCoordinateY(); if (coordinateY != null) { stmt.bindString(6, coordinateY); } - + String deep = entity.getDeep(); if (deep != null) { stmt.bindString(7, deep); } - + String deptName = entity.getDeptName(); if (deptName != null) { stmt.bindString(8, deptName); } - + String deptid = entity.getDeptid(); if (deptid != null) { stmt.bindString(9, deptid); } - + String id = entity.getId(); if (id != null) { stmt.bindString(10, id); } - + String latBaidu = entity.getLatBaidu(); if (latBaidu != null) { stmt.bindString(11, latBaidu); } - + String latGaode = entity.getLatGaode(); if (latGaode != null) { stmt.bindString(12, latGaode); } - + String lngBaidu = entity.getLngBaidu(); if (lngBaidu != null) { stmt.bindString(13, lngBaidu); } - + String lngGaode = entity.getLngGaode(); if (lngGaode != null) { stmt.bindString(14, lngGaode); } - + String notes = entity.getNotes(); if (notes != null) { stmt.bindString(15, notes); } - + String photos = entity.getPhotos(); if (photos != null) { stmt.bindString(16, photos); } - + String position = entity.getPosition(); if (position != null) { stmt.bindString(17, position); } - + String staff = entity.getStaff(); if (staff != null) { stmt.bindString(18, staff); } - + String tel = entity.getTel(); if (tel != null) { stmt.bindString(19, tel); } - + String ts = entity.getTs(); if (ts != null) { stmt.bindString(20, ts); } - + String valid = entity.getValid(); if (valid != null) { stmt.bindString(21, valid); } - + String watchData = entity.getWatchData(); if (watchData != null) { stmt.bindString(22, watchData); } - + String wellCode = entity.getWellCode(); if (wellCode != null) { stmt.bindString(23, wellCode); } - + String wellName = entity.getWellName(); if (wellName != null) { stmt.bindString(24, wellName); } - + String wellType = entity.getWellType(); if (wellType != null) { stmt.bindString(25, wellType); } - + String wellTypeName = entity.getWellTypeName(); if (wellTypeName != null) { stmt.bindString(26, wellTypeName); @@ -242,132 +237,132 @@ @Override protected final void bindValues(SQLiteStatement stmt, MapWellLocalBean entity) { stmt.clearBindings(); - + Long kId = entity.getKId(); if (kId != null) { stmt.bindLong(1, kId); } - + String area = entity.getArea(); if (area != null) { stmt.bindString(2, area); } - + String bfzt = entity.getBfzt(); if (bfzt != null) { stmt.bindString(3, bfzt); } - + String bfztName = entity.getBfztName(); if (bfztName != null) { stmt.bindString(4, bfztName); } - + String coordinateX = entity.getCoordinateX(); if (coordinateX != null) { stmt.bindString(5, coordinateX); } - + String coordinateY = entity.getCoordinateY(); if (coordinateY != null) { stmt.bindString(6, coordinateY); } - + String deep = entity.getDeep(); if (deep != null) { stmt.bindString(7, deep); } - + String deptName = entity.getDeptName(); if (deptName != null) { stmt.bindString(8, deptName); } - + String deptid = entity.getDeptid(); if (deptid != null) { stmt.bindString(9, deptid); } - + String id = entity.getId(); if (id != null) { stmt.bindString(10, id); } - + String latBaidu = entity.getLatBaidu(); if (latBaidu != null) { stmt.bindString(11, latBaidu); } - + String latGaode = entity.getLatGaode(); if (latGaode != null) { stmt.bindString(12, latGaode); } - + String lngBaidu = entity.getLngBaidu(); if (lngBaidu != null) { stmt.bindString(13, lngBaidu); } - + String lngGaode = entity.getLngGaode(); if (lngGaode != null) { stmt.bindString(14, lngGaode); } - + String notes = entity.getNotes(); if (notes != null) { stmt.bindString(15, notes); } - + String photos = entity.getPhotos(); if (photos != null) { stmt.bindString(16, photos); } - + String position = entity.getPosition(); if (position != null) { stmt.bindString(17, position); } - + String staff = entity.getStaff(); if (staff != null) { stmt.bindString(18, staff); } - + String tel = entity.getTel(); if (tel != null) { stmt.bindString(19, tel); } - + String ts = entity.getTs(); if (ts != null) { stmt.bindString(20, ts); } - + String valid = entity.getValid(); if (valid != null) { stmt.bindString(21, valid); } - + String watchData = entity.getWatchData(); if (watchData != null) { stmt.bindString(22, watchData); } - + String wellCode = entity.getWellCode(); if (wellCode != null) { stmt.bindString(23, wellCode); } - + String wellName = entity.getWellName(); if (wellName != null) { stmt.bindString(24, wellName); } - + String wellType = entity.getWellType(); if (wellType != null) { stmt.bindString(25, wellType); } - + String wellTypeName = entity.getWellTypeName(); if (wellTypeName != null) { stmt.bindString(26, wellTypeName); @@ -377,41 +372,41 @@ @Override public Long readKey(Cursor cursor, int offset) { return cursor.isNull(offset + 0) ? null : cursor.getLong(offset + 0); - } + } @Override public MapWellLocalBean readEntity(Cursor cursor, int offset) { MapWellLocalBean entity = new MapWellLocalBean( // - cursor.isNull(offset + 0) ? null : cursor.getLong(offset + 0), // kId - cursor.isNull(offset + 1) ? null : cursor.getString(offset + 1), // area - cursor.isNull(offset + 2) ? null : cursor.getString(offset + 2), // bfzt - cursor.isNull(offset + 3) ? null : cursor.getString(offset + 3), // bfztName - cursor.isNull(offset + 4) ? null : cursor.getString(offset + 4), // coordinateX - cursor.isNull(offset + 5) ? null : cursor.getString(offset + 5), // coordinateY - cursor.isNull(offset + 6) ? null : cursor.getString(offset + 6), // deep - cursor.isNull(offset + 7) ? null : cursor.getString(offset + 7), // deptName - cursor.isNull(offset + 8) ? null : cursor.getString(offset + 8), // deptid - cursor.isNull(offset + 9) ? null : cursor.getString(offset + 9), // id - cursor.isNull(offset + 10) ? null : cursor.getString(offset + 10), // latBaidu - cursor.isNull(offset + 11) ? null : cursor.getString(offset + 11), // latGaode - cursor.isNull(offset + 12) ? null : cursor.getString(offset + 12), // lngBaidu - cursor.isNull(offset + 13) ? null : cursor.getString(offset + 13), // lngGaode - cursor.isNull(offset + 14) ? null : cursor.getString(offset + 14), // notes - cursor.isNull(offset + 15) ? null : cursor.getString(offset + 15), // photos - cursor.isNull(offset + 16) ? null : cursor.getString(offset + 16), // position - cursor.isNull(offset + 17) ? null : cursor.getString(offset + 17), // staff - cursor.isNull(offset + 18) ? null : cursor.getString(offset + 18), // tel - cursor.isNull(offset + 19) ? null : cursor.getString(offset + 19), // ts - cursor.isNull(offset + 20) ? null : cursor.getString(offset + 20), // valid - cursor.isNull(offset + 21) ? null : cursor.getString(offset + 21), // watchData - cursor.isNull(offset + 22) ? null : cursor.getString(offset + 22), // wellCode - cursor.isNull(offset + 23) ? null : cursor.getString(offset + 23), // wellName - cursor.isNull(offset + 24) ? null : cursor.getString(offset + 24), // wellType - cursor.isNull(offset + 25) ? null : cursor.getString(offset + 25) // wellTypeName + cursor.isNull(offset + 0) ? null : cursor.getLong(offset + 0), // kId + cursor.isNull(offset + 1) ? null : cursor.getString(offset + 1), // area + cursor.isNull(offset + 2) ? null : cursor.getString(offset + 2), // bfzt + cursor.isNull(offset + 3) ? null : cursor.getString(offset + 3), // bfztName + cursor.isNull(offset + 4) ? null : cursor.getString(offset + 4), // coordinateX + cursor.isNull(offset + 5) ? null : cursor.getString(offset + 5), // coordinateY + cursor.isNull(offset + 6) ? null : cursor.getString(offset + 6), // deep + cursor.isNull(offset + 7) ? null : cursor.getString(offset + 7), // deptName + cursor.isNull(offset + 8) ? null : cursor.getString(offset + 8), // deptid + cursor.isNull(offset + 9) ? null : cursor.getString(offset + 9), // id + cursor.isNull(offset + 10) ? null : cursor.getString(offset + 10), // latBaidu + cursor.isNull(offset + 11) ? null : cursor.getString(offset + 11), // latGaode + cursor.isNull(offset + 12) ? null : cursor.getString(offset + 12), // lngBaidu + cursor.isNull(offset + 13) ? null : cursor.getString(offset + 13), // lngGaode + cursor.isNull(offset + 14) ? null : cursor.getString(offset + 14), // notes + cursor.isNull(offset + 15) ? null : cursor.getString(offset + 15), // photos + cursor.isNull(offset + 16) ? null : cursor.getString(offset + 16), // position + cursor.isNull(offset + 17) ? null : cursor.getString(offset + 17), // staff + cursor.isNull(offset + 18) ? null : cursor.getString(offset + 18), // tel + cursor.isNull(offset + 19) ? null : cursor.getString(offset + 19), // ts + cursor.isNull(offset + 20) ? null : cursor.getString(offset + 20), // valid + cursor.isNull(offset + 21) ? null : cursor.getString(offset + 21), // watchData + cursor.isNull(offset + 22) ? null : cursor.getString(offset + 22), // wellCode + cursor.isNull(offset + 23) ? null : cursor.getString(offset + 23), // wellName + cursor.isNull(offset + 24) ? null : cursor.getString(offset + 24), // wellType + cursor.isNull(offset + 25) ? null : cursor.getString(offset + 25) // wellTypeName ); return entity; } - + @Override public void readEntity(Cursor cursor, MapWellLocalBean entity, int offset) { entity.setKId(cursor.isNull(offset + 0) ? null : cursor.getLong(offset + 0)); @@ -440,17 +435,17 @@ entity.setWellName(cursor.isNull(offset + 23) ? null : cursor.getString(offset + 23)); entity.setWellType(cursor.isNull(offset + 24) ? null : cursor.getString(offset + 24)); entity.setWellTypeName(cursor.isNull(offset + 25) ? null : cursor.getString(offset + 25)); - } - + } + @Override protected final Long updateKeyAfterInsert(MapWellLocalBean entity, long rowId) { entity.setKId(rowId); return rowId; } - + @Override public Long getKey(MapWellLocalBean entity) { - if (entity != null) { + if(entity != null) { return entity.getKId(); } else { return null; @@ -466,5 +461,5 @@ protected final boolean isEntityUpdateable() { return true; } - + } diff --git a/app/src/main/java/com/casic/app/smartwell/greendao/NoticeLocaleBeanDao.java b/app/src/main/java/com/casic/app/smartwell/greendao/NoticeLocaleBeanDao.java index 64312ed..deb2d49 100644 --- a/app/src/main/java/com/casic/app/smartwell/greendao/NoticeLocaleBeanDao.java +++ b/app/src/main/java/com/casic/app/smartwell/greendao/NoticeLocaleBeanDao.java @@ -12,10 +12,9 @@ import org.greenrobot.greendao.internal.DaoConfig; // THIS CODE IS GENERATED BY greenDAO, DO NOT EDIT. - -/** +/** * DAO for table "NOTICE_LOCALE_BEAN". - */ +*/ public class NoticeLocaleBeanDao extends AbstractDao { public static final String TABLENAME = "NOTICE_LOCALE_BEAN"; @@ -43,16 +42,14 @@ public NoticeLocaleBeanDao(DaoConfig config) { super(config); } - + public NoticeLocaleBeanDao(DaoConfig config, DaoSession daoSession) { super(config, daoSession); } - /** - * Creates the underlying database table. - */ + /** Creates the underlying database table. */ public static void createTable(Database db, boolean ifNotExists) { - String constraint = ifNotExists ? "IF NOT EXISTS " : ""; + String constraint = ifNotExists? "IF NOT EXISTS ": ""; db.execSQL("CREATE TABLE " + constraint + "\"NOTICE_LOCALE_BEAN\" (" + // "\"_id\" INTEGER PRIMARY KEY AUTOINCREMENT ," + // 0: id "\"MESSAGE_ID\" TEXT UNIQUE ," + // 1: messageId @@ -68,9 +65,7 @@ "\"NOTICE_TIME\" TEXT);"); // 11: noticeTime } - /** - * Drops the underlying database table. - */ + /** Drops the underlying database table. */ public static void dropTable(Database db, boolean ifExists) { String sql = "DROP TABLE " + (ifExists ? "IF EXISTS " : "") + "\"NOTICE_LOCALE_BEAN\""; db.execSQL(sql); @@ -79,62 +74,62 @@ @Override protected final void bindValues(DatabaseStatement stmt, NoticeLocaleBean entity) { stmt.clearBindings(); - + Long id = entity.getId(); if (id != null) { stmt.bindLong(1, id); } - + String messageId = entity.getMessageId(); if (messageId != null) { stmt.bindString(2, messageId); } - + String appid = entity.getAppid(); if (appid != null) { stmt.bindString(3, appid); } - + String clientId = entity.getClientId(); if (clientId != null) { stmt.bindString(4, clientId); } - + String taskId = entity.getTaskId(); if (taskId != null) { stmt.bindString(5, taskId); } - + String userId = entity.getUserId(); if (userId != null) { stmt.bindString(6, userId); } - + String title = entity.getTitle(); if (title != null) { stmt.bindString(7, title); } - + String content = entity.getContent(); if (content != null) { stmt.bindString(8, content); } - + String deviceCode = entity.getDeviceCode(); if (deviceCode != null) { stmt.bindString(9, deviceCode); } - + String jobId = entity.getJobId(); if (jobId != null) { stmt.bindString(10, jobId); } - + String isRead = entity.getIsRead(); if (isRead != null) { stmt.bindString(11, isRead); } - + String noticeTime = entity.getNoticeTime(); if (noticeTime != null) { stmt.bindString(12, noticeTime); @@ -144,62 +139,62 @@ @Override protected final void bindValues(SQLiteStatement stmt, NoticeLocaleBean entity) { stmt.clearBindings(); - + Long id = entity.getId(); if (id != null) { stmt.bindLong(1, id); } - + String messageId = entity.getMessageId(); if (messageId != null) { stmt.bindString(2, messageId); } - + String appid = entity.getAppid(); if (appid != null) { stmt.bindString(3, appid); } - + String clientId = entity.getClientId(); if (clientId != null) { stmt.bindString(4, clientId); } - + String taskId = entity.getTaskId(); if (taskId != null) { stmt.bindString(5, taskId); } - + String userId = entity.getUserId(); if (userId != null) { stmt.bindString(6, userId); } - + String title = entity.getTitle(); if (title != null) { stmt.bindString(7, title); } - + String content = entity.getContent(); if (content != null) { stmt.bindString(8, content); } - + String deviceCode = entity.getDeviceCode(); if (deviceCode != null) { stmt.bindString(9, deviceCode); } - + String jobId = entity.getJobId(); if (jobId != null) { stmt.bindString(10, jobId); } - + String isRead = entity.getIsRead(); if (isRead != null) { stmt.bindString(11, isRead); } - + String noticeTime = entity.getNoticeTime(); if (noticeTime != null) { stmt.bindString(12, noticeTime); @@ -209,27 +204,27 @@ @Override public Long readKey(Cursor cursor, int offset) { return cursor.isNull(offset + 0) ? null : cursor.getLong(offset + 0); - } + } @Override public NoticeLocaleBean readEntity(Cursor cursor, int offset) { NoticeLocaleBean entity = new NoticeLocaleBean( // - cursor.isNull(offset + 0) ? null : cursor.getLong(offset + 0), // id - cursor.isNull(offset + 1) ? null : cursor.getString(offset + 1), // messageId - cursor.isNull(offset + 2) ? null : cursor.getString(offset + 2), // appid - cursor.isNull(offset + 3) ? null : cursor.getString(offset + 3), // clientId - cursor.isNull(offset + 4) ? null : cursor.getString(offset + 4), // taskId - cursor.isNull(offset + 5) ? null : cursor.getString(offset + 5), // userId - cursor.isNull(offset + 6) ? null : cursor.getString(offset + 6), // title - cursor.isNull(offset + 7) ? null : cursor.getString(offset + 7), // content - cursor.isNull(offset + 8) ? null : cursor.getString(offset + 8), // deviceCode - cursor.isNull(offset + 9) ? null : cursor.getString(offset + 9), // jobId - cursor.isNull(offset + 10) ? null : cursor.getString(offset + 10), // isRead - cursor.isNull(offset + 11) ? null : cursor.getString(offset + 11) // noticeTime + cursor.isNull(offset + 0) ? null : cursor.getLong(offset + 0), // id + cursor.isNull(offset + 1) ? null : cursor.getString(offset + 1), // messageId + cursor.isNull(offset + 2) ? null : cursor.getString(offset + 2), // appid + cursor.isNull(offset + 3) ? null : cursor.getString(offset + 3), // clientId + cursor.isNull(offset + 4) ? null : cursor.getString(offset + 4), // taskId + cursor.isNull(offset + 5) ? null : cursor.getString(offset + 5), // userId + cursor.isNull(offset + 6) ? null : cursor.getString(offset + 6), // title + cursor.isNull(offset + 7) ? null : cursor.getString(offset + 7), // content + cursor.isNull(offset + 8) ? null : cursor.getString(offset + 8), // deviceCode + cursor.isNull(offset + 9) ? null : cursor.getString(offset + 9), // jobId + cursor.isNull(offset + 10) ? null : cursor.getString(offset + 10), // isRead + cursor.isNull(offset + 11) ? null : cursor.getString(offset + 11) // noticeTime ); return entity; } - + @Override public void readEntity(Cursor cursor, NoticeLocaleBean entity, int offset) { entity.setId(cursor.isNull(offset + 0) ? null : cursor.getLong(offset + 0)); @@ -244,17 +239,17 @@ entity.setJobId(cursor.isNull(offset + 9) ? null : cursor.getString(offset + 9)); entity.setIsRead(cursor.isNull(offset + 10) ? null : cursor.getString(offset + 10)); entity.setNoticeTime(cursor.isNull(offset + 11) ? null : cursor.getString(offset + 11)); - } - + } + @Override protected final Long updateKeyAfterInsert(NoticeLocaleBean entity, long rowId) { entity.setId(rowId); return rowId; } - + @Override public Long getKey(NoticeLocaleBean entity) { - if (entity != null) { + if(entity != null) { return entity.getId(); } else { return null; @@ -270,5 +265,5 @@ protected final boolean isEntityUpdateable() { return true; } - + } diff --git a/app/src/main/java/com/casic/app/smartwell/greendao/PipeLocalBeanDao.java b/app/src/main/java/com/casic/app/smartwell/greendao/PipeLocalBeanDao.java index aab4d3f..df5515a 100644 --- a/app/src/main/java/com/casic/app/smartwell/greendao/PipeLocalBeanDao.java +++ b/app/src/main/java/com/casic/app/smartwell/greendao/PipeLocalBeanDao.java @@ -12,10 +12,9 @@ import org.greenrobot.greendao.internal.DaoConfig; // THIS CODE IS GENERATED BY greenDAO, DO NOT EDIT. - -/** +/** * DAO for table "PIPE_LOCAL_BEAN". - */ +*/ public class PipeLocalBeanDao extends AbstractDao { public static final String TABLENAME = "PIPE_LOCAL_BEAN"; @@ -37,16 +36,14 @@ public PipeLocalBeanDao(DaoConfig config) { super(config); } - + public PipeLocalBeanDao(DaoConfig config, DaoSession daoSession) { super(config, daoSession); } - /** - * Creates the underlying database table. - */ + /** Creates the underlying database table. */ public static void createTable(Database db, boolean ifNotExists) { - String constraint = ifNotExists ? "IF NOT EXISTS " : ""; + String constraint = ifNotExists? "IF NOT EXISTS ": ""; db.execSQL("CREATE TABLE " + constraint + "\"PIPE_LOCAL_BEAN\" (" + // "\"_id\" INTEGER PRIMARY KEY AUTOINCREMENT ," + // 0: id "\"PIPE_CODE\" TEXT," + // 1: pipeCode @@ -56,9 +53,7 @@ "\"START_LONGITUDE_GD\" TEXT);"); // 5: startLongitudeGd } - /** - * Drops the underlying database table. - */ + /** Drops the underlying database table. */ public static void dropTable(Database db, boolean ifExists) { String sql = "DROP TABLE " + (ifExists ? "IF EXISTS " : "") + "\"PIPE_LOCAL_BEAN\""; db.execSQL(sql); @@ -67,32 +62,32 @@ @Override protected final void bindValues(DatabaseStatement stmt, PipeLocalBean entity) { stmt.clearBindings(); - + Long id = entity.getId(); if (id != null) { stmt.bindLong(1, id); } - + String pipeCode = entity.getPipeCode(); if (pipeCode != null) { stmt.bindString(2, pipeCode); } - + String endLatitudeGd = entity.getEndLatitudeGd(); if (endLatitudeGd != null) { stmt.bindString(3, endLatitudeGd); } - + String endLongitudeGd = entity.getEndLongitudeGd(); if (endLongitudeGd != null) { stmt.bindString(4, endLongitudeGd); } - + String startLatitudeGd = entity.getStartLatitudeGd(); if (startLatitudeGd != null) { stmt.bindString(5, startLatitudeGd); } - + String startLongitudeGd = entity.getStartLongitudeGd(); if (startLongitudeGd != null) { stmt.bindString(6, startLongitudeGd); @@ -102,32 +97,32 @@ @Override protected final void bindValues(SQLiteStatement stmt, PipeLocalBean entity) { stmt.clearBindings(); - + Long id = entity.getId(); if (id != null) { stmt.bindLong(1, id); } - + String pipeCode = entity.getPipeCode(); if (pipeCode != null) { stmt.bindString(2, pipeCode); } - + String endLatitudeGd = entity.getEndLatitudeGd(); if (endLatitudeGd != null) { stmt.bindString(3, endLatitudeGd); } - + String endLongitudeGd = entity.getEndLongitudeGd(); if (endLongitudeGd != null) { stmt.bindString(4, endLongitudeGd); } - + String startLatitudeGd = entity.getStartLatitudeGd(); if (startLatitudeGd != null) { stmt.bindString(5, startLatitudeGd); } - + String startLongitudeGd = entity.getStartLongitudeGd(); if (startLongitudeGd != null) { stmt.bindString(6, startLongitudeGd); @@ -137,21 +132,21 @@ @Override public Long readKey(Cursor cursor, int offset) { return cursor.isNull(offset + 0) ? null : cursor.getLong(offset + 0); - } + } @Override public PipeLocalBean readEntity(Cursor cursor, int offset) { PipeLocalBean entity = new PipeLocalBean( // - cursor.isNull(offset + 0) ? null : cursor.getLong(offset + 0), // id - cursor.isNull(offset + 1) ? null : cursor.getString(offset + 1), // pipeCode - cursor.isNull(offset + 2) ? null : cursor.getString(offset + 2), // endLatitudeGd - cursor.isNull(offset + 3) ? null : cursor.getString(offset + 3), // endLongitudeGd - cursor.isNull(offset + 4) ? null : cursor.getString(offset + 4), // startLatitudeGd - cursor.isNull(offset + 5) ? null : cursor.getString(offset + 5) // startLongitudeGd + cursor.isNull(offset + 0) ? null : cursor.getLong(offset + 0), // id + cursor.isNull(offset + 1) ? null : cursor.getString(offset + 1), // pipeCode + cursor.isNull(offset + 2) ? null : cursor.getString(offset + 2), // endLatitudeGd + cursor.isNull(offset + 3) ? null : cursor.getString(offset + 3), // endLongitudeGd + cursor.isNull(offset + 4) ? null : cursor.getString(offset + 4), // startLatitudeGd + cursor.isNull(offset + 5) ? null : cursor.getString(offset + 5) // startLongitudeGd ); return entity; } - + @Override public void readEntity(Cursor cursor, PipeLocalBean entity, int offset) { entity.setId(cursor.isNull(offset + 0) ? null : cursor.getLong(offset + 0)); @@ -160,17 +155,17 @@ entity.setEndLongitudeGd(cursor.isNull(offset + 3) ? null : cursor.getString(offset + 3)); entity.setStartLatitudeGd(cursor.isNull(offset + 4) ? null : cursor.getString(offset + 4)); entity.setStartLongitudeGd(cursor.isNull(offset + 5) ? null : cursor.getString(offset + 5)); - } - + } + @Override protected final Long updateKeyAfterInsert(PipeLocalBean entity, long rowId) { entity.setId(rowId); return rowId; } - + @Override public Long getKey(PipeLocalBean entity) { - if (entity != null) { + if(entity != null) { return entity.getId(); } else { return null; @@ -186,5 +181,5 @@ protected final boolean isEntityUpdateable() { return true; } - + } diff --git a/app/src/main/java/com/casic/app/smartwell/view/ChangePasswordActivity.kt b/app/src/main/java/com/casic/app/smartwell/view/ChangePasswordActivity.kt index 8e41039..9f1dd40 100644 --- a/app/src/main/java/com/casic/app/smartwell/view/ChangePasswordActivity.kt +++ b/app/src/main/java/com/casic/app/smartwell/view/ChangePasswordActivity.kt @@ -14,7 +14,7 @@ import com.pengxh.kt.lite.extensions.show import com.pengxh.kt.lite.utils.ActivityStackManager import com.pengxh.kt.lite.utils.LoadState -import com.pengxh.kt.lite.utils.LoadingDialogHub +import com.pengxh.kt.lite.utils.LoadingDialog import com.pengxh.kt.lite.widget.TitleBarView import java.nio.charset.StandardCharsets @@ -46,15 +46,15 @@ override fun observeRequestState() { userViewModel.loadState.observe(this) { when (it) { - is LoadState.Loading -> LoadingDialogHub.show(this, "修改中,请稍后") + is LoadState.Loading -> LoadingDialog.show(this, "修改中,请稍后") is LoadState.Success -> { - LoadingDialogHub.dismiss() + LoadingDialog.dismiss() AuthenticationHelper.removeToken() this.navigatePageTo() ActivityStackManager.finishAllActivity() } - else -> LoadingDialogHub.dismiss() + else -> LoadingDialog.dismiss() } } } diff --git a/app/src/main/java/com/casic/app/smartwell/view/DeployedWellActivity.kt b/app/src/main/java/com/casic/app/smartwell/view/DeployedWellActivity.kt index fb4339c..28a5078 100644 --- a/app/src/main/java/com/casic/app/smartwell/view/DeployedWellActivity.kt +++ b/app/src/main/java/com/casic/app/smartwell/view/DeployedWellActivity.kt @@ -83,8 +83,8 @@ } //添加分割线 - binding.deployedListView.addItemDecoration( - RecyclerViewItemOffsets(0, 5, 0, 5) + binding.recyclerView.addItemDecoration( + RecyclerViewItemOffsets(0, 7, 0, 7) ) } @@ -149,12 +149,11 @@ } else { item.deep.toString() + "m" } - viewHolder.setText(R.id.wellNameView, item.wellName) + viewHolder.setText(R.id.wellTypeView, item.wellTypeName) .setText(R.id.wellDepthView, "深:${deep}") .setText(R.id.wellCodeView, "点位编号:${item.wellCode}") - .setText(R.id.wellTypeView, "点位类型:${item.wellTypeName}") .setText(R.id.ownerShipView, "权属单位:${item.deptName}") - .setText(R.id.wellLocationView, "点位置:${item.position}") + .setText(R.id.wellLocationView, "点位位置:${item.position}") .setOnClickListener( R.id.operationButton, object : View.OnClickListener { override fun onClick(v: View?) { @@ -207,7 +206,7 @@ }) } } - binding.deployedListView.adapter = deployAdapter + binding.recyclerView.adapter = deployAdapter deployAdapter.setOnItemClickedListener(object : NormalRecyclerAdapter.OnItemClickedListener { override fun onItemClicked(position: Int, t: WellListModel.DataBean.RowsBean) { diff --git a/app/src/main/java/com/casic/app/smartwell/view/LoginActivity.kt b/app/src/main/java/com/casic/app/smartwell/view/LoginActivity.kt index e4bb0e3..834527b 100644 --- a/app/src/main/java/com/casic/app/smartwell/view/LoginActivity.kt +++ b/app/src/main/java/com/casic/app/smartwell/view/LoginActivity.kt @@ -21,7 +21,7 @@ import com.pengxh.kt.lite.extensions.navigatePageTo import com.pengxh.kt.lite.extensions.readAssetsFile import com.pengxh.kt.lite.extensions.show -import com.pengxh.kt.lite.utils.LoadingDialogHub +import com.pengxh.kt.lite.utils.LoadingDialog import com.pengxh.kt.lite.utils.SaveKeyValues import kotlinx.coroutines.Dispatchers import kotlinx.coroutines.launch @@ -106,11 +106,11 @@ override fun observeRequestState() { authenticateViewModel.loadState.observe(this) { - LoadingDialogHub.show(this, "登录中,请稍后") + LoadingDialog.show(this, "登录中,请稍后") } loginViewModel.loadState.observe(this) { - LoadingDialogHub.dismiss() + LoadingDialog.dismiss() } } diff --git a/app/src/main/java/com/casic/app/smartwell/view/OrderCompletedDetailActivity.kt b/app/src/main/java/com/casic/app/smartwell/view/OrderCompletedDetailActivity.kt index db8ad1f..75cd905 100644 --- a/app/src/main/java/com/casic/app/smartwell/view/OrderCompletedDetailActivity.kt +++ b/app/src/main/java/com/casic/app/smartwell/view/OrderCompletedDetailActivity.kt @@ -17,7 +17,7 @@ import com.pengxh.kt.lite.extensions.show import com.pengxh.kt.lite.utils.Constant import com.pengxh.kt.lite.utils.LoadState -import com.pengxh.kt.lite.utils.LoadingDialogHub +import com.pengxh.kt.lite.utils.LoadingDialog import com.pengxh.kt.lite.widget.TitleBarView import com.pengxh.kt.lite.widget.dialog.AlertMessageDialog @@ -44,7 +44,7 @@ } override fun initOnCreate(savedInstanceState: Bundle?) { - val jobId = intent.getStringExtra(Constant.INTENT_PARAM)!! + val jobId = intent.getStringExtra(Constant.INTENT_PARAM_KEY)!! orderViewModel = ViewModelProvider(this)[OrderViewModel::class.java] orderViewModel.getWorkOrderDetail(jobId) orderViewModel.detailModel.observe(this) { @@ -154,8 +154,8 @@ override fun observeRequestState() { orderViewModel.loadState.observe(this) { when (it) { - is LoadState.Loading -> LoadingDialogHub.show(this, "数据加载中,请稍后") - else -> LoadingDialogHub.dismiss() + is LoadState.Loading -> LoadingDialog.show(this, "数据加载中,请稍后") + else -> LoadingDialog.dismiss() } } } diff --git a/app/src/main/java/com/casic/app/smartwell/view/OrderInHandleDetailActivity.kt b/app/src/main/java/com/casic/app/smartwell/view/OrderInHandleDetailActivity.kt index d70a979..04a7d5d 100644 --- a/app/src/main/java/com/casic/app/smartwell/view/OrderInHandleDetailActivity.kt +++ b/app/src/main/java/com/casic/app/smartwell/view/OrderInHandleDetailActivity.kt @@ -38,7 +38,7 @@ import com.pengxh.kt.lite.extensions.show import com.pengxh.kt.lite.utils.Constant import com.pengxh.kt.lite.utils.LoadState -import com.pengxh.kt.lite.utils.LoadingDialogHub +import com.pengxh.kt.lite.utils.LoadingDialog import com.pengxh.kt.lite.widget.TitleBarView import com.pengxh.kt.lite.widget.dialog.AlertControlDialog import com.pengxh.kt.lite.widget.dialog.AlertMessageDialog @@ -93,7 +93,7 @@ ) binding.addImageRecyclerView.adapter = imageAdapter - val jobId = intent.getStringExtra(Constant.INTENT_PARAM)!!//初始化图片九宫格 + val jobId = intent.getStringExtra(Constant.INTENT_PARAM_KEY)!!//初始化图片九宫格 orderViewModel.getWorkOrderDetail(jobId) orderViewModel.detailModel.observe(this) { if (it.code == 200) { @@ -312,41 +312,41 @@ override fun observeRequestState() { orderViewModel.loadState.observe(this) { when (it) { - is LoadState.Loading -> LoadingDialogHub.show(this, "数据加载中,请稍后") - else -> LoadingDialogHub.dismiss() + is LoadState.Loading -> LoadingDialog.show(this, "数据加载中,请稍后") + else -> LoadingDialog.dismiss() } } uploadImageViewModel.loadState.observe(this) { when (it) { - LoadState.Loading -> LoadingDialogHub.show(this, "图片上传中,请稍后...") - else -> LoadingDialogHub.dismiss() + LoadState.Loading -> LoadingDialog.show(this, "图片上传中,请稍后...") + else -> LoadingDialog.dismiss() } } //转单状态处理 operationViewModel.loadState.observe(this) { when (it) { - is LoadState.Loading -> LoadingDialogHub.show(this, "转单中,请稍后") + is LoadState.Loading -> LoadingDialog.show(this, "转单中,请稍后") is LoadState.Success -> { - LoadingDialogHub.dismiss() + LoadingDialog.dismiss() this.finish() } - else -> LoadingDialogHub.dismiss() + else -> LoadingDialog.dismiss() } } //处理完成工单状态处理 operationViewModel.loadState.observe(this) { when (it) { - is LoadState.Loading -> LoadingDialogHub.show(this, "处理中,请稍后") + is LoadState.Loading -> LoadingDialog.show(this, "处理中,请稍后") is LoadState.Success -> { - LoadingDialogHub.dismiss() + LoadingDialog.dismiss() this.finish() } - else -> LoadingDialogHub.dismiss() + else -> LoadingDialog.dismiss() } } } diff --git a/app/src/main/java/com/casic/app/smartwell/view/OrderNotConfirmedDetailActivity.kt b/app/src/main/java/com/casic/app/smartwell/view/OrderNotConfirmedDetailActivity.kt index 8e036d2..687ec86 100644 --- a/app/src/main/java/com/casic/app/smartwell/view/OrderNotConfirmedDetailActivity.kt +++ b/app/src/main/java/com/casic/app/smartwell/view/OrderNotConfirmedDetailActivity.kt @@ -36,7 +36,7 @@ import com.pengxh.kt.lite.extensions.show import com.pengxh.kt.lite.utils.Constant import com.pengxh.kt.lite.utils.LoadState -import com.pengxh.kt.lite.utils.LoadingDialogHub +import com.pengxh.kt.lite.utils.LoadingDialog import com.pengxh.kt.lite.widget.TitleBarView import com.pengxh.kt.lite.widget.dialog.AlertControlDialog import com.pengxh.kt.lite.widget.dialog.AlertMessageDialog @@ -80,7 +80,7 @@ } override fun initOnCreate(savedInstanceState: Bundle?) { - val jobId = intent.getStringExtra(Constant.INTENT_PARAM)!! + val jobId = intent.getStringExtra(Constant.INTENT_PARAM_KEY)!! //初始化图片九宫格 //左外边距,左内边距,右内边距,右外边距 val viewWidth = getScreenWidth() - (10 + 10 + 10 + 10).dp2px(this) @@ -263,41 +263,41 @@ //数据加载状态处理 orderViewModel.loadState.observe(this) { when (it) { - is LoadState.Loading -> LoadingDialogHub.show(this, "数据加载中,请稍后") - else -> LoadingDialogHub.dismiss() + is LoadState.Loading -> LoadingDialog.show(this, "数据加载中,请稍后") + else -> LoadingDialog.dismiss() } } uploadImageViewModel.loadState.observe(this) { when (it) { - LoadState.Loading -> LoadingDialogHub.show(this, "图片上传中,请稍后") - else -> LoadingDialogHub.dismiss() + LoadState.Loading -> LoadingDialog.show(this, "图片上传中,请稍后") + else -> LoadingDialog.dismiss() } } //转单状态处理 operationViewModel.loadState.observe(this) { when (it) { - is LoadState.Loading -> LoadingDialogHub.show(this, "转单中,请稍后") + is LoadState.Loading -> LoadingDialog.show(this, "转单中,请稍后") is LoadState.Success -> { - LoadingDialogHub.dismiss() + LoadingDialog.dismiss() this.finish() } - else -> LoadingDialogHub.dismiss() + else -> LoadingDialog.dismiss() } } //确认工单状态处理 operationViewModel.loadState.observe(this) { when (it) { - is LoadState.Loading -> LoadingDialogHub.show(this, "处理中,请稍后") + is LoadState.Loading -> LoadingDialog.show(this, "处理中,请稍后") is LoadState.Success -> { - LoadingDialogHub.dismiss() + LoadingDialog.dismiss() this.finish() } - else -> LoadingDialogHub.dismiss() + else -> LoadingDialog.dismiss() } } } diff --git a/app/src/main/java/com/casic/app/smartwell/view/OrderNotProcessedDetailActivity.kt b/app/src/main/java/com/casic/app/smartwell/view/OrderNotProcessedDetailActivity.kt index d3f22dc..0c97a52 100644 --- a/app/src/main/java/com/casic/app/smartwell/view/OrderNotProcessedDetailActivity.kt +++ b/app/src/main/java/com/casic/app/smartwell/view/OrderNotProcessedDetailActivity.kt @@ -18,7 +18,7 @@ import com.pengxh.kt.lite.extensions.show import com.pengxh.kt.lite.utils.Constant import com.pengxh.kt.lite.utils.LoadState -import com.pengxh.kt.lite.utils.LoadingDialogHub +import com.pengxh.kt.lite.utils.LoadingDialog import com.pengxh.kt.lite.widget.TitleBarView import com.pengxh.kt.lite.widget.dialog.AlertControlDialog import com.pengxh.kt.lite.widget.dialog.AlertMessageDialog @@ -50,7 +50,7 @@ } override fun initOnCreate(savedInstanceState: Bundle?) { - this.jobId = intent.getStringExtra(Constant.INTENT_PARAM)!! + this.jobId = intent.getStringExtra(Constant.INTENT_PARAM_KEY)!! orderViewModel = ViewModelProvider(this)[OrderViewModel::class.java] operationViewModel = ViewModelProvider(this)[OperationViewModel::class.java] wellViewModel = ViewModelProvider(this)[WellViewModel::class.java] @@ -162,21 +162,21 @@ //数据加载状态处理 orderViewModel.loadState.observe(this) { when (it) { - is LoadState.Loading -> LoadingDialogHub.show(this, "数据加载中,请稍后") - else -> LoadingDialogHub.dismiss() + is LoadState.Loading -> LoadingDialog.show(this, "数据加载中,请稍后") + else -> LoadingDialog.dismiss() } } //接单状态处理 operationViewModel.loadState.observe(this) { when (it) { - is LoadState.Loading -> LoadingDialogHub.show(this, "接单中,请稍后") + is LoadState.Loading -> LoadingDialog.show(this, "接单中,请稍后") is LoadState.Success -> { - LoadingDialogHub.dismiss() + LoadingDialog.dismiss() this.finish() } - else -> LoadingDialogHub.dismiss() + else -> LoadingDialog.dismiss() } } } diff --git a/app/src/main/java/com/casic/app/smartwell/view/SearchResultActivity.kt b/app/src/main/java/com/casic/app/smartwell/view/SearchResultActivity.kt index 6a92917..4f3a674 100644 --- a/app/src/main/java/com/casic/app/smartwell/view/SearchResultActivity.kt +++ b/app/src/main/java/com/casic/app/smartwell/view/SearchResultActivity.kt @@ -19,7 +19,7 @@ import com.pengxh.kt.lite.extensions.show import com.pengxh.kt.lite.utils.Constant import com.pengxh.kt.lite.utils.LoadState -import com.pengxh.kt.lite.utils.LoadingDialogHub +import com.pengxh.kt.lite.utils.LoadingDialog import com.pengxh.kt.lite.utils.WeakReferenceHandler import com.pengxh.kt.lite.widget.TitleBarView import com.pengxh.kt.lite.widget.dialog.AlertControlDialog @@ -56,7 +56,7 @@ } override fun initOnCreate(savedInstanceState: Bundle?) { - args = intent.getStringArrayListExtra(Constant.INTENT_PARAM)!! + args = intent.getStringArrayListExtra(Constant.INTENT_PARAM_KEY)!! orderViewModel = ViewModelProvider(this)[OrderViewModel::class.java] operationViewModel = ViewModelProvider(this)[OperationViewModel::class.java] @@ -101,24 +101,24 @@ } } - binding.resultRecyclerView.addItemDecoration( - RecyclerViewItemOffsets(0, 5, 0, 5) + binding.recyclerView.addItemDecoration( + RecyclerViewItemOffsets(0, 7, 0, 7) ) } override fun observeRequestState() { orderViewModel.loadState.observe(this) { when (it) { - is LoadState.Loading -> LoadingDialogHub.show(this, "数据加载中,请稍后") - else -> LoadingDialogHub.dismiss() + is LoadState.Loading -> LoadingDialog.show(this, "数据加载中,请稍后") + else -> LoadingDialog.dismiss() } } //接单状态处理 operationViewModel.loadState.observe(this) { when (it) { - is LoadState.Loading -> LoadingDialogHub.show(this, "接单中,请稍后") + is LoadState.Loading -> LoadingDialog.show(this, "接单中,请稍后") is LoadState.Success -> { - LoadingDialogHub.dismiss() + LoadingDialog.dismiss() //接单成功之后刷新列表 dataBeans.removeAt(clickedPosition) searchResultAdapter.notifyItemRemoved(clickedPosition) @@ -127,7 +127,7 @@ ) } - else -> LoadingDialogHub.dismiss() + else -> LoadingDialog.dismiss() } } } @@ -162,7 +162,7 @@ } else { binding.emptyInclude.emptyView.hide() searchResultAdapter = SearchResultAdapter(this, dataBeans) - binding.resultRecyclerView.adapter = searchResultAdapter + binding.recyclerView.adapter = searchResultAdapter searchResultAdapter.setOnItemClickListener(object : SearchResultAdapter.OnItemClickListener { override fun onClicked(position: Int) { diff --git a/app/src/main/java/com/casic/app/smartwell/view/UnDeployWellActivity.kt b/app/src/main/java/com/casic/app/smartwell/view/UnDeployWellActivity.kt index 7f7cd3c..555c278 100644 --- a/app/src/main/java/com/casic/app/smartwell/view/UnDeployWellActivity.kt +++ b/app/src/main/java/com/casic/app/smartwell/view/UnDeployWellActivity.kt @@ -81,8 +81,8 @@ } } - binding.undeployListView.addItemDecoration( - RecyclerViewItemOffsets(0, 5, 0, 5) + binding.recyclerView.addItemDecoration( + RecyclerViewItemOffsets(0, 7, 0, 7) ) } @@ -147,12 +147,11 @@ } else { item.deep.toString() + "m" } - viewHolder.setText(R.id.wellNameView, item.wellName) + viewHolder.setText(R.id.wellTypeView, item.wellTypeName) .setText(R.id.wellDepthView, "深:${deep}") .setText(R.id.wellCodeView, "点位编号:${item.wellCode}") - .setText(R.id.wellTypeView, "点位类型:${item.wellTypeName}") .setText(R.id.ownerShipView, "权属单位:${item.deptName}") - .setText(R.id.wellLocationView, "点位置:${item.position}") + .setText(R.id.wellLocationView, "点位位置:${item.position}") .setOnClickListener( R.id.operationButton, object : View.OnClickListener { override fun onClick(v: View?) { @@ -185,7 +184,7 @@ ) } } - binding.undeployListView.adapter = unDeployAdapter + binding.recyclerView.adapter = unDeployAdapter unDeployAdapter.setOnItemClickedListener(object : NormalRecyclerAdapter.OnItemClickedListener { override fun onItemClicked(position: Int, t: WellListModel.DataBean.RowsBean) { diff --git a/app/src/main/java/com/casic/app/smartwell/view/WellDetailActivity.kt b/app/src/main/java/com/casic/app/smartwell/view/WellDetailActivity.kt index b50d067..eb8b468 100644 --- a/app/src/main/java/com/casic/app/smartwell/view/WellDetailActivity.kt +++ b/app/src/main/java/com/casic/app/smartwell/view/WellDetailActivity.kt @@ -16,7 +16,7 @@ import com.pengxh.kt.lite.extensions.show import com.pengxh.kt.lite.utils.Constant import com.pengxh.kt.lite.utils.LoadState -import com.pengxh.kt.lite.utils.LoadingDialogHub +import com.pengxh.kt.lite.utils.LoadingDialog import com.pengxh.kt.lite.widget.TitleBarView import com.pengxh.kt.lite.widget.dialog.AlertMessageDialog @@ -44,7 +44,7 @@ } override fun initOnCreate(savedInstanceState: Bundle?) { - val wellId = intent.getStringExtra(Constant.INTENT_PARAM)!! + val wellId = intent.getStringExtra(Constant.INTENT_PARAM_KEY)!! wellViewModel = ViewModelProvider(this)[WellViewModel::class.java] wellViewModel.getWellDetail(wellId) wellViewModel.wellDetailModel.observe(this) { @@ -132,8 +132,8 @@ override fun observeRequestState() { wellViewModel.loadState.observe(this) { when (it) { - is LoadState.Loading -> LoadingDialogHub.show(this, "数据加载中,请稍后") - else -> LoadingDialogHub.dismiss() + is LoadState.Loading -> LoadingDialog.show(this, "数据加载中,请稍后") + else -> LoadingDialog.dismiss() } } } diff --git a/app/src/main/java/com/casic/app/smartwell/view/WellManagementActivity.kt b/app/src/main/java/com/casic/app/smartwell/view/WellManagementActivity.kt index 084da95..457096b 100644 --- a/app/src/main/java/com/casic/app/smartwell/view/WellManagementActivity.kt +++ b/app/src/main/java/com/casic/app/smartwell/view/WellManagementActivity.kt @@ -94,8 +94,8 @@ } } - binding.wellListView.addItemDecoration( - RecyclerViewItemOffsets(0, 5, 0, 5) + binding.recyclerView.addItemDecoration( + RecyclerViewItemOffsets(0, 7, 0, 7) ) } @@ -175,13 +175,12 @@ } else { item.deep.toString() + "m" } - viewHolder.setText(R.id.wellNameView, item.wellName) + viewHolder.setText(R.id.wellTypeView, item.wellTypeName) .setText(R.id.wellStateView, "已${item.bfztName}") .setText(R.id.wellDepthView, "深:${deep}") .setText(R.id.wellCodeView, "点位编号:${item.wellCode}") - .setText(R.id.wellTypeView, "点位类型:${item.wellTypeName}") .setText(R.id.ownerShipView, "权属单位:${item.deptName}") - .setText(R.id.wellLocationView, "点位置:${item.position}") + .setText(R.id.wellLocationView, "点位位置:${item.position}") .setOnClickListener( R.id.navigationButton, object : View.OnClickListener { override fun onClick(v: View?) { @@ -200,7 +199,7 @@ ) } } - binding.wellListView.adapter = wellListAdapter + binding.recyclerView.adapter = wellListAdapter wellListAdapter.setOnItemClickedListener(object : NormalRecyclerAdapter.OnItemClickedListener { override fun onItemClicked(position: Int, t: WellListModel.DataBean.RowsBean) { diff --git a/app/src/main/java/com/casic/app/smartwell/view/WellMonitorActivity.kt b/app/src/main/java/com/casic/app/smartwell/view/WellMonitorActivity.kt index e3573eb..b87bdb7 100644 --- a/app/src/main/java/com/casic/app/smartwell/view/WellMonitorActivity.kt +++ b/app/src/main/java/com/casic/app/smartwell/view/WellMonitorActivity.kt @@ -11,7 +11,7 @@ import com.pengxh.kt.lite.base.KotlinBaseActivity import com.pengxh.kt.lite.utils.Constant import com.pengxh.kt.lite.utils.LoadState -import com.pengxh.kt.lite.utils.LoadingDialogHub +import com.pengxh.kt.lite.utils.LoadingDialog import com.pengxh.kt.lite.widget.TitleBarView class WellMonitorActivity : KotlinBaseActivity() { @@ -36,7 +36,7 @@ } override fun initOnCreate(savedInstanceState: Bundle?) { - val wellId = intent.getStringExtra(Constant.INTENT_PARAM)!! + val wellId = intent.getStringExtra(Constant.INTENT_PARAM_KEY)!! wellViewModel = ViewModelProvider(this)[WellViewModel::class.java] wellViewModel.getMonitorResult(wellId) wellViewModel.monitorModel.observe(this) { @@ -56,8 +56,8 @@ override fun observeRequestState() { wellViewModel.loadState.observe(this) { when (it) { - is LoadState.Loading -> LoadingDialogHub.show(this, "数据加载中,请稍后") - else -> LoadingDialogHub.dismiss() + is LoadState.Loading -> LoadingDialog.show(this, "数据加载中,请稍后") + else -> LoadingDialog.dismiss() } } } diff --git a/app/src/main/java/com/casic/app/smartwell/view/WellOperationActivity.kt b/app/src/main/java/com/casic/app/smartwell/view/WellOperationActivity.kt index 8d333bf..347ebb6 100644 --- a/app/src/main/java/com/casic/app/smartwell/view/WellOperationActivity.kt +++ b/app/src/main/java/com/casic/app/smartwell/view/WellOperationActivity.kt @@ -23,7 +23,7 @@ import com.pengxh.kt.lite.extensions.navigatePageTo import com.pengxh.kt.lite.extensions.show import com.pengxh.kt.lite.utils.LoadState -import com.pengxh.kt.lite.utils.LoadingDialogHub +import com.pengxh.kt.lite.utils.LoadingDialog import com.pengxh.kt.lite.utils.WeakReferenceHandler import com.pengxh.kt.lite.widget.dialog.AlertControlDialog @@ -109,8 +109,8 @@ } } - binding.operationListView.addItemDecoration( - RecyclerViewItemOffsets(0, 5, 0, 5) + binding.recyclerView.addItemDecoration( + RecyclerViewItemOffsets(0, 7, 0, 7) ) } @@ -123,13 +123,13 @@ override fun observeRequestState() { wellViewModel.loadState.observe(this) { when (it) { - is LoadState.Loading -> LoadingDialogHub.show(this, "处理中,请稍后") + is LoadState.Loading -> LoadingDialog.show(this, "处理中,请稍后") is LoadState.Success -> { - LoadingDialogHub.dismiss() + LoadingDialog.dismiss() wellOperationAdapter.notifyItemChanged(clickedPosition) } - else -> LoadingDialogHub.dismiss() + else -> LoadingDialog.dismiss() } } } @@ -203,24 +203,23 @@ if (item.bfztName == "布防") { viewHolder.setImageResource( R.id.wellStateView, R.drawable.bg_solid_text_green_radius_5 - ).setText(R.id.wellStateView, "撤防") + ).setText(R.id.operationButton, "撤防") } else { viewHolder.setImageResource( R.id.wellStateView, R.drawable.bg_solid_text_red_radius_5 - ).setText(R.id.wellStateView, "布防") + ).setText(R.id.operationButton, "布防") } val deep = if (item.deep.toString().isBlank()) { "未知" } else { item.deep.toString() + "m" } - viewHolder.setText(R.id.wellNameView, item.wellName) + viewHolder.setText(R.id.wellTypeView, item.wellTypeName) .setText(R.id.wellStateView, "已${item.bfztName}") .setText(R.id.wellDepthView, "深:${deep}") .setText(R.id.wellCodeView, "点位编号:${item.wellCode}") - .setText(R.id.wellTypeView, "点位类型:${item.wellTypeName}") .setText(R.id.ownerShipView, "权属单位:${item.deptName}") - .setText(R.id.wellLocationView, "点位置:${item.position}") + .setText(R.id.wellLocationView, "点位位置:${item.position}") .setOnClickListener( R.id.operationButton, object : View.OnClickListener { override fun onClick(v: View?) { @@ -280,7 +279,7 @@ ) } } - binding.operationListView.adapter = wellOperationAdapter + binding.recyclerView.adapter = wellOperationAdapter wellOperationAdapter.setOnItemClickedListener(object : NormalRecyclerAdapter.OnItemClickedListener { override fun onItemClicked(position: Int, t: WellListModel.DataBean.RowsBean) { diff --git a/app/src/main/res/drawable/ic_down.xml b/app/src/main/res/drawable/ic_down.xml index 20e6476..6987e6c 100644 --- a/app/src/main/res/drawable/ic_down.xml +++ b/app/src/main/res/drawable/ic_down.xml @@ -1,6 +1,6 @@ + + diff --git a/app/src/main/res/layout/activity_about_us.xml b/app/src/main/res/layout/activity_about_us.xml index 9091a00..d5fbd0d 100644 --- a/app/src/main/res/layout/activity_about_us.xml +++ b/app/src/main/res/layout/activity_about_us.xml @@ -12,13 +12,7 @@ android:layout_width="match_parent" android:layout_height="wrap_content" android:background="@color/mainThemeColor" - app:tbv_left_image="@drawable/ic_title_left" - app:tbv_only_show_title="false" - app:tbv_show_left_image="true" - app:tbv_show_right_image="false" - app:tbv_text="关于我们" - app:tbv_text_color="@color/white" - app:tbv_text_size="@dimen/sp_18" /> + app:tbv_text="关于我们" /> + app:tbv_text="修改密码" /> + app:tbv_text="布防列表" /> - + + android:value="ee96d8b5e12de3fbb29949efd57418a8" /> () @@ -150,7 +158,7 @@ val cameraPosition = CameraPosition(centerLatLng, 14f, 0f, 0f) val cameraUpdate = CameraUpdateFactory.newCameraPosition(cameraPosition) withContext(Dispatchers.Main) { - LoadingDialogHub.dismiss() + LoadingDialog.dismiss() aMap.animateCamera(cameraUpdate, 1500, null) } } @@ -239,11 +247,6 @@ } override fun initEvent() { - binding.rightOptionView.setOnClickListener { - val x = binding.rightOptionView.width - easyPopupWindow.width - easyPopupWindow.showAsDropDown(binding.rightOptionView, x, 0) - } - //撤防点位 binding.unDeployedLayout.setOnClickListener { requireContext().navigatePageTo() @@ -263,11 +266,11 @@ override fun observeRequestState() { wellViewModel.loadState.observe(this) { when (it) { - is LoadState.Loading -> LoadingDialogHub.show( + is LoadState.Loading -> LoadingDialog.show( requireActivity(), "数据加载中,请稍后..." ) - else -> LoadingDialogHub.dismiss() + else -> LoadingDialog.dismiss() } } } @@ -376,7 +379,7 @@ }).build().show() } }) - infoPopup.showAsDropDown(binding.rightOptionView) +// infoPopup.showAsDropDown(binding.rightOptionView) } override fun onCameraChange(p0: CameraPosition?) { diff --git a/app/src/main/java/com/casic/app/smartwell/fragment/HomePageNoClusterFragment.kt b/app/src/main/java/com/casic/app/smartwell/fragment/HomePageNoClusterFragment.kt index 802426a..b25f743 100644 --- a/app/src/main/java/com/casic/app/smartwell/fragment/HomePageNoClusterFragment.kt +++ b/app/src/main/java/com/casic/app/smartwell/fragment/HomePageNoClusterFragment.kt @@ -38,8 +38,9 @@ import com.pengxh.kt.lite.extensions.navigatePageTo import com.pengxh.kt.lite.extensions.show import com.pengxh.kt.lite.utils.LoadState -import com.pengxh.kt.lite.utils.LoadingDialogHub +import com.pengxh.kt.lite.utils.LoadingDialog import com.pengxh.kt.lite.widget.EasyPopupWindow +import com.pengxh.kt.lite.widget.TitleBarView import com.pengxh.kt.lite.widget.dialog.AlertControlDialog import kotlinx.coroutines.Dispatchers import kotlinx.coroutines.launch @@ -78,7 +79,15 @@ override fun setupTopBarLayout() { binding.rootView.initImmersionBar(this, false, R.color.mainThemeColor) - binding.titleView.text = "首页" + binding.titleView.setOnClickListener(object : TitleBarView.OnClickListener { + override fun onLeftClick() { + + } + + override fun onRightClick() { + easyPopupWindow.showAsDropDown(binding.titleView, binding.titleView.width, 0) + } + }) } override fun initOnCreate(savedInstanceState: Bundle?) { @@ -112,7 +121,7 @@ //渲染井位置 lifecycleScope.launch(Dispatchers.Main) { - LoadingDialogHub.show(requireActivity(), "数据加载中,请稍后") + LoadingDialog.show(requireActivity(), "数据加载中,请稍后") withContext(Dispatchers.IO) { //取Well缓存 val allMarkerOptions = ArrayList() @@ -144,7 +153,7 @@ val cameraPosition = CameraPosition(centerLatLng, 14f, 0f, 0f) val cameraUpdate = CameraUpdateFactory.newCameraPosition(cameraPosition) withContext(Dispatchers.Main) { - LoadingDialogHub.dismiss() + LoadingDialog.dismiss() aMap.animateCamera(cameraUpdate, 1500, null) } } @@ -238,11 +247,6 @@ } override fun initEvent() { - binding.rightOptionView.setOnClickListener { - val x = binding.rightOptionView.width - easyPopupWindow.width - easyPopupWindow.showAsDropDown(binding.rightOptionView, x, 0) - } - //撤防点位 binding.unDeployedLayout.setOnClickListener { requireContext().navigatePageTo() @@ -262,11 +266,11 @@ override fun observeRequestState() { wellViewModel.loadState.observe(this) { when (it) { - is LoadState.Loading -> LoadingDialogHub.show( + is LoadState.Loading -> LoadingDialog.show( requireActivity(), "数据加载中,请稍后..." ) - else -> LoadingDialogHub.dismiss() + else -> LoadingDialog.dismiss() } } } diff --git a/app/src/main/java/com/casic/app/smartwell/fragment/MinePageFragment.kt b/app/src/main/java/com/casic/app/smartwell/fragment/MinePageFragment.kt index 09a570c..dcb48f8 100644 --- a/app/src/main/java/com/casic/app/smartwell/fragment/MinePageFragment.kt +++ b/app/src/main/java/com/casic/app/smartwell/fragment/MinePageFragment.kt @@ -35,7 +35,7 @@ import com.pengxh.kt.lite.utils.ActivityStackManager import com.pengxh.kt.lite.utils.FileDownloadManager import com.pengxh.kt.lite.utils.LoadState -import com.pengxh.kt.lite.utils.LoadingDialogHub +import com.pengxh.kt.lite.utils.LoadingDialog import com.pengxh.kt.lite.widget.dialog.AlertControlDialog import com.pengxh.kt.lite.widget.dialog.BottomActionSheet import kotlinx.coroutines.Dispatchers @@ -60,7 +60,6 @@ override fun setupTopBarLayout() { binding.rootView.initImmersionBar(this, false, R.color.mainThemeColor) - binding.titleInclude.titleView.text = "我的" } override fun initOnCreate(savedInstanceState: Bundle?) { @@ -155,27 +154,27 @@ override fun observeRequestState() { userViewModel.loadState.observe(this) { when (it) { - is LoadState.Loading -> LoadingDialogHub.show( + is LoadState.Loading -> LoadingDialog.show( requireActivity(), "检查版本中,请稍后" ) - else -> LoadingDialogHub.dismiss() + else -> LoadingDialog.dismiss() } } wellViewModel.loadState.observe(this) { when (it) { - is LoadState.Loading -> LoadingDialogHub.show( + is LoadState.Loading -> LoadingDialog.show( requireActivity(), "数据更新中,请稍后" ) is LoadState.Fail -> { - LoadingDialogHub.dismiss() + LoadingDialog.dismiss() "数据更新超时".show(requireContext()) } else -> { - LoadingDialogHub.dismiss() + LoadingDialog.dismiss() AlertControlDialog.Builder().setContext(requireContext()).setTitle("温馨提示") .setMessage("数据更新成功,请重启应用").setNegativeButton("取消") .setPositiveButton("确定").setOnDialogButtonClickListener(object : @@ -197,17 +196,17 @@ lineViewModel.loadState.observe(this) { when (it) { - is LoadState.Loading -> LoadingDialogHub.show( + is LoadState.Loading -> LoadingDialog.show( requireActivity(), "数据更新中,请稍后" ) is LoadState.Fail -> { - LoadingDialogHub.dismiss() + LoadingDialog.dismiss() "数据更新超时".show(requireContext()) } else -> { - LoadingDialogHub.dismiss() + LoadingDialog.dismiss() AlertControlDialog.Builder().setContext(requireContext()).setTitle("温馨提示") .setMessage("数据更新成功,请重启应用").setNegativeButton("取消") .setPositiveButton("确定").setOnDialogButtonClickListener(object : diff --git a/app/src/main/java/com/casic/app/smartwell/fragment/NoticePageFragment.kt b/app/src/main/java/com/casic/app/smartwell/fragment/NoticePageFragment.kt index 171b555..3c93f54 100644 --- a/app/src/main/java/com/casic/app/smartwell/fragment/NoticePageFragment.kt +++ b/app/src/main/java/com/casic/app/smartwell/fragment/NoticePageFragment.kt @@ -48,7 +48,6 @@ override fun setupTopBarLayout() { binding.rootView.initImmersionBar(this, false, R.color.mainThemeColor) - binding.titleInclude.titleView.text = "消息" } override fun initOnCreate(savedInstanceState: Bundle?) { diff --git a/app/src/main/java/com/casic/app/smartwell/fragment/OrderListFragment.kt b/app/src/main/java/com/casic/app/smartwell/fragment/OrderListFragment.kt index 93ff35b..5e38acb 100644 --- a/app/src/main/java/com/casic/app/smartwell/fragment/OrderListFragment.kt +++ b/app/src/main/java/com/casic/app/smartwell/fragment/OrderListFragment.kt @@ -12,6 +12,7 @@ import com.casic.app.smartwell.view.SearchOrderActivity import com.pengxh.kt.lite.base.KotlinBaseFragment import com.pengxh.kt.lite.extensions.navigatePageTo +import com.pengxh.kt.lite.widget.TitleBarView class OrderListFragment : KotlinBaseFragment() { @@ -25,15 +26,22 @@ } override fun initViewBinding( - inflater: LayoutInflater, - container: ViewGroup? + inflater: LayoutInflater, container: ViewGroup? ): FragmentOrderBinding { return FragmentOrderBinding.inflate(inflater, container, false) } override fun setupTopBarLayout() { binding.rootView.initImmersionBar(this, false, R.color.mainThemeColor) - binding.titleView.text = "工单" + binding.titleView.setOnClickListener(object : TitleBarView.OnClickListener { + override fun onLeftClick() { + + } + + override fun onRightClick() { + requireContext().navigatePageTo() + } + }) } override fun initOnCreate(savedInstanceState: Bundle?) { @@ -51,8 +59,6 @@ } override fun initEvent() { - binding.rightOptionView.setOnClickListener { - requireContext().navigatePageTo() - } + } } \ No newline at end of file diff --git a/app/src/main/java/com/casic/app/smartwell/fragment/OrderNotProcessedFragment.kt b/app/src/main/java/com/casic/app/smartwell/fragment/OrderNotProcessedFragment.kt index 0b3d09d..2b6f21d 100644 --- a/app/src/main/java/com/casic/app/smartwell/fragment/OrderNotProcessedFragment.kt +++ b/app/src/main/java/com/casic/app/smartwell/fragment/OrderNotProcessedFragment.kt @@ -18,7 +18,7 @@ import com.pengxh.kt.lite.extensions.navigatePageTo import com.pengxh.kt.lite.extensions.show import com.pengxh.kt.lite.utils.LoadState -import com.pengxh.kt.lite.utils.LoadingDialogHub +import com.pengxh.kt.lite.utils.LoadingDialog import com.pengxh.kt.lite.utils.WeakReferenceHandler import com.pengxh.kt.lite.widget.dialog.AlertControlDialog @@ -78,8 +78,8 @@ operationViewModel = ViewModelProvider(this)[OperationViewModel::class.java] - binding.notProcessedView.addItemDecoration( - RecyclerViewItemOffsets(0, 5, 0, 5) + binding.recyclerView.addItemDecoration( + RecyclerViewItemOffsets(0, 7, 0, 7) ) } @@ -87,9 +87,9 @@ //接单状态处理 operationViewModel.loadState.observe(this) { when (it) { - is LoadState.Loading -> LoadingDialogHub.show(requireActivity(), "接单中,请稍后") + is LoadState.Loading -> LoadingDialog.show(requireActivity(), "接单中,请稍后") is LoadState.Success -> { - LoadingDialogHub.dismiss() + LoadingDialog.dismiss() //接单成功之后刷新列表 dataBeans.removeAt(clickedPosition) notProcessedAdapter.notifyItemRemoved(clickedPosition) @@ -98,7 +98,7 @@ ) } - else -> LoadingDialogHub.dismiss() + else -> LoadingDialog.dismiss() } } } @@ -131,7 +131,7 @@ } else { binding.emptyInclude.emptyView.hide() notProcessedAdapter = OrderNotProcessedAdapter(requireContext(), dataBeans) - binding.notProcessedView.adapter = notProcessedAdapter + binding.recyclerView.adapter = notProcessedAdapter notProcessedAdapter.setOnItemClickListener(object : OrderNotProcessedAdapter.OnItemClickListener { override fun onClicked(position: Int) { diff --git a/app/src/main/java/com/casic/app/smartwell/fragment/OvertimeNotAcceptFragment.kt b/app/src/main/java/com/casic/app/smartwell/fragment/OvertimeNotAcceptFragment.kt index a198545..9b318ca 100644 --- a/app/src/main/java/com/casic/app/smartwell/fragment/OvertimeNotAcceptFragment.kt +++ b/app/src/main/java/com/casic/app/smartwell/fragment/OvertimeNotAcceptFragment.kt @@ -18,7 +18,7 @@ import com.pengxh.kt.lite.extensions.navigatePageTo import com.pengxh.kt.lite.extensions.show import com.pengxh.kt.lite.utils.LoadState -import com.pengxh.kt.lite.utils.LoadingDialogHub +import com.pengxh.kt.lite.utils.LoadingDialog import com.pengxh.kt.lite.utils.WeakReferenceHandler import com.pengxh.kt.lite.widget.dialog.AlertControlDialog @@ -81,8 +81,8 @@ operationViewModel = ViewModelProvider(this)[OperationViewModel::class.java] - binding.notProcessedView.addItemDecoration( - RecyclerViewItemOffsets(0, 5, 0, 5) + binding.recyclerView.addItemDecoration( + RecyclerViewItemOffsets(0, 7, 0, 7) ) } @@ -90,9 +90,9 @@ //接单状态处理 operationViewModel.loadState.observe(this) { when (it) { - is LoadState.Loading -> LoadingDialogHub.show(requireActivity(), "接单中,请稍后") + is LoadState.Loading -> LoadingDialog.show(requireActivity(), "接单中,请稍后") is LoadState.Success -> { - LoadingDialogHub.dismiss() + LoadingDialog.dismiss() //接单成功之后刷新列表 dataBeans.removeAt(clickedPosition) notProcessedAdapter.notifyItemRemoved(clickedPosition) @@ -101,7 +101,7 @@ ) } - else -> LoadingDialogHub.dismiss() + else -> LoadingDialog.dismiss() } } } @@ -134,7 +134,7 @@ } else { binding.emptyInclude.emptyView.hide() notProcessedAdapter = OrderNotProcessedAdapter(requireContext(), dataBeans) - binding.notProcessedView.adapter = notProcessedAdapter + binding.recyclerView.adapter = notProcessedAdapter notProcessedAdapter.setOnItemClickListener(object : OrderNotProcessedAdapter.OnItemClickListener { override fun onClicked(position: Int) { diff --git a/app/src/main/java/com/casic/app/smartwell/greendao/DaoMaster.java b/app/src/main/java/com/casic/app/smartwell/greendao/DaoMaster.java index fdcf3a7..1e52b74 100644 --- a/app/src/main/java/com/casic/app/smartwell/greendao/DaoMaster.java +++ b/app/src/main/java/com/casic/app/smartwell/greendao/DaoMaster.java @@ -13,25 +13,20 @@ // THIS CODE IS GENERATED BY greenDAO, DO NOT EDIT. - /** * Master of DAO (schema version 4): knows all DAOs. */ public class DaoMaster extends AbstractDaoMaster { public static final int SCHEMA_VERSION = 4; - /** - * Creates underlying database table using DAOs. - */ + /** Creates underlying database table using DAOs. */ public static void createAllTables(Database db, boolean ifNotExists) { MapWellLocalBeanDao.createTable(db, ifNotExists); NoticeLocaleBeanDao.createTable(db, ifNotExists); PipeLocalBeanDao.createTable(db, ifNotExists); } - /** - * Drops underlying database table using DAOs. - */ + /** Drops underlying database table using DAOs. */ public static void dropAllTables(Database db, boolean ifExists) { MapWellLocalBeanDao.dropTable(db, ifExists); NoticeLocaleBeanDao.dropTable(db, ifExists); @@ -86,9 +81,7 @@ } } - /** - * WARNING: Drops all table on Upgrade! Use only during development. - */ + /** WARNING: Drops all table on Upgrade! Use only during development. */ public static class DevOpenHelper extends OpenHelper { public DevOpenHelper(Context context, String name) { super(context, name); diff --git a/app/src/main/java/com/casic/app/smartwell/greendao/DaoSession.java b/app/src/main/java/com/casic/app/smartwell/greendao/DaoSession.java index 0b36d17..3e40e3b 100644 --- a/app/src/main/java/com/casic/app/smartwell/greendao/DaoSession.java +++ b/app/src/main/java/com/casic/app/smartwell/greendao/DaoSession.java @@ -16,7 +16,7 @@ /** * {@inheritDoc} - * + * * @see org.greenrobot.greendao.AbstractDaoSession */ public class DaoSession extends AbstractDaoSession { @@ -50,7 +50,7 @@ registerDao(NoticeLocaleBean.class, noticeLocaleBeanDao); registerDao(PipeLocalBean.class, pipeLocalBeanDao); } - + public void clear() { mapWellLocalBeanDaoConfig.clearIdentityScope(); noticeLocaleBeanDaoConfig.clearIdentityScope(); diff --git a/app/src/main/java/com/casic/app/smartwell/greendao/MapWellLocalBeanDao.java b/app/src/main/java/com/casic/app/smartwell/greendao/MapWellLocalBeanDao.java index 8908fda..407bc92 100644 --- a/app/src/main/java/com/casic/app/smartwell/greendao/MapWellLocalBeanDao.java +++ b/app/src/main/java/com/casic/app/smartwell/greendao/MapWellLocalBeanDao.java @@ -12,10 +12,9 @@ import org.greenrobot.greendao.internal.DaoConfig; // THIS CODE IS GENERATED BY greenDAO, DO NOT EDIT. - -/** +/** * DAO for table "MAP_WELL_LOCAL_BEAN". - */ +*/ public class MapWellLocalBeanDao extends AbstractDao { public static final String TABLENAME = "MAP_WELL_LOCAL_BEAN"; @@ -57,16 +56,14 @@ public MapWellLocalBeanDao(DaoConfig config) { super(config); } - + public MapWellLocalBeanDao(DaoConfig config, DaoSession daoSession) { super(config, daoSession); } - /** - * Creates the underlying database table. - */ + /** Creates the underlying database table. */ public static void createTable(Database db, boolean ifNotExists) { - String constraint = ifNotExists ? "IF NOT EXISTS " : ""; + String constraint = ifNotExists? "IF NOT EXISTS ": ""; db.execSQL("CREATE TABLE " + constraint + "\"MAP_WELL_LOCAL_BEAN\" (" + // "\"_id\" INTEGER PRIMARY KEY AUTOINCREMENT ," + // 0: kId "\"AREA\" TEXT," + // 1: area @@ -96,9 +93,7 @@ "\"WELL_TYPE_NAME\" TEXT);"); // 25: wellTypeName } - /** - * Drops the underlying database table. - */ + /** Drops the underlying database table. */ public static void dropTable(Database db, boolean ifExists) { String sql = "DROP TABLE " + (ifExists ? "IF EXISTS " : "") + "\"MAP_WELL_LOCAL_BEAN\""; db.execSQL(sql); @@ -107,132 +102,132 @@ @Override protected final void bindValues(DatabaseStatement stmt, MapWellLocalBean entity) { stmt.clearBindings(); - + Long kId = entity.getKId(); if (kId != null) { stmt.bindLong(1, kId); } - + String area = entity.getArea(); if (area != null) { stmt.bindString(2, area); } - + String bfzt = entity.getBfzt(); if (bfzt != null) { stmt.bindString(3, bfzt); } - + String bfztName = entity.getBfztName(); if (bfztName != null) { stmt.bindString(4, bfztName); } - + String coordinateX = entity.getCoordinateX(); if (coordinateX != null) { stmt.bindString(5, coordinateX); } - + String coordinateY = entity.getCoordinateY(); if (coordinateY != null) { stmt.bindString(6, coordinateY); } - + String deep = entity.getDeep(); if (deep != null) { stmt.bindString(7, deep); } - + String deptName = entity.getDeptName(); if (deptName != null) { stmt.bindString(8, deptName); } - + String deptid = entity.getDeptid(); if (deptid != null) { stmt.bindString(9, deptid); } - + String id = entity.getId(); if (id != null) { stmt.bindString(10, id); } - + String latBaidu = entity.getLatBaidu(); if (latBaidu != null) { stmt.bindString(11, latBaidu); } - + String latGaode = entity.getLatGaode(); if (latGaode != null) { stmt.bindString(12, latGaode); } - + String lngBaidu = entity.getLngBaidu(); if (lngBaidu != null) { stmt.bindString(13, lngBaidu); } - + String lngGaode = entity.getLngGaode(); if (lngGaode != null) { stmt.bindString(14, lngGaode); } - + String notes = entity.getNotes(); if (notes != null) { stmt.bindString(15, notes); } - + String photos = entity.getPhotos(); if (photos != null) { stmt.bindString(16, photos); } - + String position = entity.getPosition(); if (position != null) { stmt.bindString(17, position); } - + String staff = entity.getStaff(); if (staff != null) { stmt.bindString(18, staff); } - + String tel = entity.getTel(); if (tel != null) { stmt.bindString(19, tel); } - + String ts = entity.getTs(); if (ts != null) { stmt.bindString(20, ts); } - + String valid = entity.getValid(); if (valid != null) { stmt.bindString(21, valid); } - + String watchData = entity.getWatchData(); if (watchData != null) { stmt.bindString(22, watchData); } - + String wellCode = entity.getWellCode(); if (wellCode != null) { stmt.bindString(23, wellCode); } - + String wellName = entity.getWellName(); if (wellName != null) { stmt.bindString(24, wellName); } - + String wellType = entity.getWellType(); if (wellType != null) { stmt.bindString(25, wellType); } - + String wellTypeName = entity.getWellTypeName(); if (wellTypeName != null) { stmt.bindString(26, wellTypeName); @@ -242,132 +237,132 @@ @Override protected final void bindValues(SQLiteStatement stmt, MapWellLocalBean entity) { stmt.clearBindings(); - + Long kId = entity.getKId(); if (kId != null) { stmt.bindLong(1, kId); } - + String area = entity.getArea(); if (area != null) { stmt.bindString(2, area); } - + String bfzt = entity.getBfzt(); if (bfzt != null) { stmt.bindString(3, bfzt); } - + String bfztName = entity.getBfztName(); if (bfztName != null) { stmt.bindString(4, bfztName); } - + String coordinateX = entity.getCoordinateX(); if (coordinateX != null) { stmt.bindString(5, coordinateX); } - + String coordinateY = entity.getCoordinateY(); if (coordinateY != null) { stmt.bindString(6, coordinateY); } - + String deep = entity.getDeep(); if (deep != null) { stmt.bindString(7, deep); } - + String deptName = entity.getDeptName(); if (deptName != null) { stmt.bindString(8, deptName); } - + String deptid = entity.getDeptid(); if (deptid != null) { stmt.bindString(9, deptid); } - + String id = entity.getId(); if (id != null) { stmt.bindString(10, id); } - + String latBaidu = entity.getLatBaidu(); if (latBaidu != null) { stmt.bindString(11, latBaidu); } - + String latGaode = entity.getLatGaode(); if (latGaode != null) { stmt.bindString(12, latGaode); } - + String lngBaidu = entity.getLngBaidu(); if (lngBaidu != null) { stmt.bindString(13, lngBaidu); } - + String lngGaode = entity.getLngGaode(); if (lngGaode != null) { stmt.bindString(14, lngGaode); } - + String notes = entity.getNotes(); if (notes != null) { stmt.bindString(15, notes); } - + String photos = entity.getPhotos(); if (photos != null) { stmt.bindString(16, photos); } - + String position = entity.getPosition(); if (position != null) { stmt.bindString(17, position); } - + String staff = entity.getStaff(); if (staff != null) { stmt.bindString(18, staff); } - + String tel = entity.getTel(); if (tel != null) { stmt.bindString(19, tel); } - + String ts = entity.getTs(); if (ts != null) { stmt.bindString(20, ts); } - + String valid = entity.getValid(); if (valid != null) { stmt.bindString(21, valid); } - + String watchData = entity.getWatchData(); if (watchData != null) { stmt.bindString(22, watchData); } - + String wellCode = entity.getWellCode(); if (wellCode != null) { stmt.bindString(23, wellCode); } - + String wellName = entity.getWellName(); if (wellName != null) { stmt.bindString(24, wellName); } - + String wellType = entity.getWellType(); if (wellType != null) { stmt.bindString(25, wellType); } - + String wellTypeName = entity.getWellTypeName(); if (wellTypeName != null) { stmt.bindString(26, wellTypeName); @@ -377,41 +372,41 @@ @Override public Long readKey(Cursor cursor, int offset) { return cursor.isNull(offset + 0) ? null : cursor.getLong(offset + 0); - } + } @Override public MapWellLocalBean readEntity(Cursor cursor, int offset) { MapWellLocalBean entity = new MapWellLocalBean( // - cursor.isNull(offset + 0) ? null : cursor.getLong(offset + 0), // kId - cursor.isNull(offset + 1) ? null : cursor.getString(offset + 1), // area - cursor.isNull(offset + 2) ? null : cursor.getString(offset + 2), // bfzt - cursor.isNull(offset + 3) ? null : cursor.getString(offset + 3), // bfztName - cursor.isNull(offset + 4) ? null : cursor.getString(offset + 4), // coordinateX - cursor.isNull(offset + 5) ? null : cursor.getString(offset + 5), // coordinateY - cursor.isNull(offset + 6) ? null : cursor.getString(offset + 6), // deep - cursor.isNull(offset + 7) ? null : cursor.getString(offset + 7), // deptName - cursor.isNull(offset + 8) ? null : cursor.getString(offset + 8), // deptid - cursor.isNull(offset + 9) ? null : cursor.getString(offset + 9), // id - cursor.isNull(offset + 10) ? null : cursor.getString(offset + 10), // latBaidu - cursor.isNull(offset + 11) ? null : cursor.getString(offset + 11), // latGaode - cursor.isNull(offset + 12) ? null : cursor.getString(offset + 12), // lngBaidu - cursor.isNull(offset + 13) ? null : cursor.getString(offset + 13), // lngGaode - cursor.isNull(offset + 14) ? null : cursor.getString(offset + 14), // notes - cursor.isNull(offset + 15) ? null : cursor.getString(offset + 15), // photos - cursor.isNull(offset + 16) ? null : cursor.getString(offset + 16), // position - cursor.isNull(offset + 17) ? null : cursor.getString(offset + 17), // staff - cursor.isNull(offset + 18) ? null : cursor.getString(offset + 18), // tel - cursor.isNull(offset + 19) ? null : cursor.getString(offset + 19), // ts - cursor.isNull(offset + 20) ? null : cursor.getString(offset + 20), // valid - cursor.isNull(offset + 21) ? null : cursor.getString(offset + 21), // watchData - cursor.isNull(offset + 22) ? null : cursor.getString(offset + 22), // wellCode - cursor.isNull(offset + 23) ? null : cursor.getString(offset + 23), // wellName - cursor.isNull(offset + 24) ? null : cursor.getString(offset + 24), // wellType - cursor.isNull(offset + 25) ? null : cursor.getString(offset + 25) // wellTypeName + cursor.isNull(offset + 0) ? null : cursor.getLong(offset + 0), // kId + cursor.isNull(offset + 1) ? null : cursor.getString(offset + 1), // area + cursor.isNull(offset + 2) ? null : cursor.getString(offset + 2), // bfzt + cursor.isNull(offset + 3) ? null : cursor.getString(offset + 3), // bfztName + cursor.isNull(offset + 4) ? null : cursor.getString(offset + 4), // coordinateX + cursor.isNull(offset + 5) ? null : cursor.getString(offset + 5), // coordinateY + cursor.isNull(offset + 6) ? null : cursor.getString(offset + 6), // deep + cursor.isNull(offset + 7) ? null : cursor.getString(offset + 7), // deptName + cursor.isNull(offset + 8) ? null : cursor.getString(offset + 8), // deptid + cursor.isNull(offset + 9) ? null : cursor.getString(offset + 9), // id + cursor.isNull(offset + 10) ? null : cursor.getString(offset + 10), // latBaidu + cursor.isNull(offset + 11) ? null : cursor.getString(offset + 11), // latGaode + cursor.isNull(offset + 12) ? null : cursor.getString(offset + 12), // lngBaidu + cursor.isNull(offset + 13) ? null : cursor.getString(offset + 13), // lngGaode + cursor.isNull(offset + 14) ? null : cursor.getString(offset + 14), // notes + cursor.isNull(offset + 15) ? null : cursor.getString(offset + 15), // photos + cursor.isNull(offset + 16) ? null : cursor.getString(offset + 16), // position + cursor.isNull(offset + 17) ? null : cursor.getString(offset + 17), // staff + cursor.isNull(offset + 18) ? null : cursor.getString(offset + 18), // tel + cursor.isNull(offset + 19) ? null : cursor.getString(offset + 19), // ts + cursor.isNull(offset + 20) ? null : cursor.getString(offset + 20), // valid + cursor.isNull(offset + 21) ? null : cursor.getString(offset + 21), // watchData + cursor.isNull(offset + 22) ? null : cursor.getString(offset + 22), // wellCode + cursor.isNull(offset + 23) ? null : cursor.getString(offset + 23), // wellName + cursor.isNull(offset + 24) ? null : cursor.getString(offset + 24), // wellType + cursor.isNull(offset + 25) ? null : cursor.getString(offset + 25) // wellTypeName ); return entity; } - + @Override public void readEntity(Cursor cursor, MapWellLocalBean entity, int offset) { entity.setKId(cursor.isNull(offset + 0) ? null : cursor.getLong(offset + 0)); @@ -440,17 +435,17 @@ entity.setWellName(cursor.isNull(offset + 23) ? null : cursor.getString(offset + 23)); entity.setWellType(cursor.isNull(offset + 24) ? null : cursor.getString(offset + 24)); entity.setWellTypeName(cursor.isNull(offset + 25) ? null : cursor.getString(offset + 25)); - } - + } + @Override protected final Long updateKeyAfterInsert(MapWellLocalBean entity, long rowId) { entity.setKId(rowId); return rowId; } - + @Override public Long getKey(MapWellLocalBean entity) { - if (entity != null) { + if(entity != null) { return entity.getKId(); } else { return null; @@ -466,5 +461,5 @@ protected final boolean isEntityUpdateable() { return true; } - + } diff --git a/app/src/main/java/com/casic/app/smartwell/greendao/NoticeLocaleBeanDao.java b/app/src/main/java/com/casic/app/smartwell/greendao/NoticeLocaleBeanDao.java index 64312ed..deb2d49 100644 --- a/app/src/main/java/com/casic/app/smartwell/greendao/NoticeLocaleBeanDao.java +++ b/app/src/main/java/com/casic/app/smartwell/greendao/NoticeLocaleBeanDao.java @@ -12,10 +12,9 @@ import org.greenrobot.greendao.internal.DaoConfig; // THIS CODE IS GENERATED BY greenDAO, DO NOT EDIT. - -/** +/** * DAO for table "NOTICE_LOCALE_BEAN". - */ +*/ public class NoticeLocaleBeanDao extends AbstractDao { public static final String TABLENAME = "NOTICE_LOCALE_BEAN"; @@ -43,16 +42,14 @@ public NoticeLocaleBeanDao(DaoConfig config) { super(config); } - + public NoticeLocaleBeanDao(DaoConfig config, DaoSession daoSession) { super(config, daoSession); } - /** - * Creates the underlying database table. - */ + /** Creates the underlying database table. */ public static void createTable(Database db, boolean ifNotExists) { - String constraint = ifNotExists ? "IF NOT EXISTS " : ""; + String constraint = ifNotExists? "IF NOT EXISTS ": ""; db.execSQL("CREATE TABLE " + constraint + "\"NOTICE_LOCALE_BEAN\" (" + // "\"_id\" INTEGER PRIMARY KEY AUTOINCREMENT ," + // 0: id "\"MESSAGE_ID\" TEXT UNIQUE ," + // 1: messageId @@ -68,9 +65,7 @@ "\"NOTICE_TIME\" TEXT);"); // 11: noticeTime } - /** - * Drops the underlying database table. - */ + /** Drops the underlying database table. */ public static void dropTable(Database db, boolean ifExists) { String sql = "DROP TABLE " + (ifExists ? "IF EXISTS " : "") + "\"NOTICE_LOCALE_BEAN\""; db.execSQL(sql); @@ -79,62 +74,62 @@ @Override protected final void bindValues(DatabaseStatement stmt, NoticeLocaleBean entity) { stmt.clearBindings(); - + Long id = entity.getId(); if (id != null) { stmt.bindLong(1, id); } - + String messageId = entity.getMessageId(); if (messageId != null) { stmt.bindString(2, messageId); } - + String appid = entity.getAppid(); if (appid != null) { stmt.bindString(3, appid); } - + String clientId = entity.getClientId(); if (clientId != null) { stmt.bindString(4, clientId); } - + String taskId = entity.getTaskId(); if (taskId != null) { stmt.bindString(5, taskId); } - + String userId = entity.getUserId(); if (userId != null) { stmt.bindString(6, userId); } - + String title = entity.getTitle(); if (title != null) { stmt.bindString(7, title); } - + String content = entity.getContent(); if (content != null) { stmt.bindString(8, content); } - + String deviceCode = entity.getDeviceCode(); if (deviceCode != null) { stmt.bindString(9, deviceCode); } - + String jobId = entity.getJobId(); if (jobId != null) { stmt.bindString(10, jobId); } - + String isRead = entity.getIsRead(); if (isRead != null) { stmt.bindString(11, isRead); } - + String noticeTime = entity.getNoticeTime(); if (noticeTime != null) { stmt.bindString(12, noticeTime); @@ -144,62 +139,62 @@ @Override protected final void bindValues(SQLiteStatement stmt, NoticeLocaleBean entity) { stmt.clearBindings(); - + Long id = entity.getId(); if (id != null) { stmt.bindLong(1, id); } - + String messageId = entity.getMessageId(); if (messageId != null) { stmt.bindString(2, messageId); } - + String appid = entity.getAppid(); if (appid != null) { stmt.bindString(3, appid); } - + String clientId = entity.getClientId(); if (clientId != null) { stmt.bindString(4, clientId); } - + String taskId = entity.getTaskId(); if (taskId != null) { stmt.bindString(5, taskId); } - + String userId = entity.getUserId(); if (userId != null) { stmt.bindString(6, userId); } - + String title = entity.getTitle(); if (title != null) { stmt.bindString(7, title); } - + String content = entity.getContent(); if (content != null) { stmt.bindString(8, content); } - + String deviceCode = entity.getDeviceCode(); if (deviceCode != null) { stmt.bindString(9, deviceCode); } - + String jobId = entity.getJobId(); if (jobId != null) { stmt.bindString(10, jobId); } - + String isRead = entity.getIsRead(); if (isRead != null) { stmt.bindString(11, isRead); } - + String noticeTime = entity.getNoticeTime(); if (noticeTime != null) { stmt.bindString(12, noticeTime); @@ -209,27 +204,27 @@ @Override public Long readKey(Cursor cursor, int offset) { return cursor.isNull(offset + 0) ? null : cursor.getLong(offset + 0); - } + } @Override public NoticeLocaleBean readEntity(Cursor cursor, int offset) { NoticeLocaleBean entity = new NoticeLocaleBean( // - cursor.isNull(offset + 0) ? null : cursor.getLong(offset + 0), // id - cursor.isNull(offset + 1) ? null : cursor.getString(offset + 1), // messageId - cursor.isNull(offset + 2) ? null : cursor.getString(offset + 2), // appid - cursor.isNull(offset + 3) ? null : cursor.getString(offset + 3), // clientId - cursor.isNull(offset + 4) ? null : cursor.getString(offset + 4), // taskId - cursor.isNull(offset + 5) ? null : cursor.getString(offset + 5), // userId - cursor.isNull(offset + 6) ? null : cursor.getString(offset + 6), // title - cursor.isNull(offset + 7) ? null : cursor.getString(offset + 7), // content - cursor.isNull(offset + 8) ? null : cursor.getString(offset + 8), // deviceCode - cursor.isNull(offset + 9) ? null : cursor.getString(offset + 9), // jobId - cursor.isNull(offset + 10) ? null : cursor.getString(offset + 10), // isRead - cursor.isNull(offset + 11) ? null : cursor.getString(offset + 11) // noticeTime + cursor.isNull(offset + 0) ? null : cursor.getLong(offset + 0), // id + cursor.isNull(offset + 1) ? null : cursor.getString(offset + 1), // messageId + cursor.isNull(offset + 2) ? null : cursor.getString(offset + 2), // appid + cursor.isNull(offset + 3) ? null : cursor.getString(offset + 3), // clientId + cursor.isNull(offset + 4) ? null : cursor.getString(offset + 4), // taskId + cursor.isNull(offset + 5) ? null : cursor.getString(offset + 5), // userId + cursor.isNull(offset + 6) ? null : cursor.getString(offset + 6), // title + cursor.isNull(offset + 7) ? null : cursor.getString(offset + 7), // content + cursor.isNull(offset + 8) ? null : cursor.getString(offset + 8), // deviceCode + cursor.isNull(offset + 9) ? null : cursor.getString(offset + 9), // jobId + cursor.isNull(offset + 10) ? null : cursor.getString(offset + 10), // isRead + cursor.isNull(offset + 11) ? null : cursor.getString(offset + 11) // noticeTime ); return entity; } - + @Override public void readEntity(Cursor cursor, NoticeLocaleBean entity, int offset) { entity.setId(cursor.isNull(offset + 0) ? null : cursor.getLong(offset + 0)); @@ -244,17 +239,17 @@ entity.setJobId(cursor.isNull(offset + 9) ? null : cursor.getString(offset + 9)); entity.setIsRead(cursor.isNull(offset + 10) ? null : cursor.getString(offset + 10)); entity.setNoticeTime(cursor.isNull(offset + 11) ? null : cursor.getString(offset + 11)); - } - + } + @Override protected final Long updateKeyAfterInsert(NoticeLocaleBean entity, long rowId) { entity.setId(rowId); return rowId; } - + @Override public Long getKey(NoticeLocaleBean entity) { - if (entity != null) { + if(entity != null) { return entity.getId(); } else { return null; @@ -270,5 +265,5 @@ protected final boolean isEntityUpdateable() { return true; } - + } diff --git a/app/src/main/java/com/casic/app/smartwell/greendao/PipeLocalBeanDao.java b/app/src/main/java/com/casic/app/smartwell/greendao/PipeLocalBeanDao.java index aab4d3f..df5515a 100644 --- a/app/src/main/java/com/casic/app/smartwell/greendao/PipeLocalBeanDao.java +++ b/app/src/main/java/com/casic/app/smartwell/greendao/PipeLocalBeanDao.java @@ -12,10 +12,9 @@ import org.greenrobot.greendao.internal.DaoConfig; // THIS CODE IS GENERATED BY greenDAO, DO NOT EDIT. - -/** +/** * DAO for table "PIPE_LOCAL_BEAN". - */ +*/ public class PipeLocalBeanDao extends AbstractDao { public static final String TABLENAME = "PIPE_LOCAL_BEAN"; @@ -37,16 +36,14 @@ public PipeLocalBeanDao(DaoConfig config) { super(config); } - + public PipeLocalBeanDao(DaoConfig config, DaoSession daoSession) { super(config, daoSession); } - /** - * Creates the underlying database table. - */ + /** Creates the underlying database table. */ public static void createTable(Database db, boolean ifNotExists) { - String constraint = ifNotExists ? "IF NOT EXISTS " : ""; + String constraint = ifNotExists? "IF NOT EXISTS ": ""; db.execSQL("CREATE TABLE " + constraint + "\"PIPE_LOCAL_BEAN\" (" + // "\"_id\" INTEGER PRIMARY KEY AUTOINCREMENT ," + // 0: id "\"PIPE_CODE\" TEXT," + // 1: pipeCode @@ -56,9 +53,7 @@ "\"START_LONGITUDE_GD\" TEXT);"); // 5: startLongitudeGd } - /** - * Drops the underlying database table. - */ + /** Drops the underlying database table. */ public static void dropTable(Database db, boolean ifExists) { String sql = "DROP TABLE " + (ifExists ? "IF EXISTS " : "") + "\"PIPE_LOCAL_BEAN\""; db.execSQL(sql); @@ -67,32 +62,32 @@ @Override protected final void bindValues(DatabaseStatement stmt, PipeLocalBean entity) { stmt.clearBindings(); - + Long id = entity.getId(); if (id != null) { stmt.bindLong(1, id); } - + String pipeCode = entity.getPipeCode(); if (pipeCode != null) { stmt.bindString(2, pipeCode); } - + String endLatitudeGd = entity.getEndLatitudeGd(); if (endLatitudeGd != null) { stmt.bindString(3, endLatitudeGd); } - + String endLongitudeGd = entity.getEndLongitudeGd(); if (endLongitudeGd != null) { stmt.bindString(4, endLongitudeGd); } - + String startLatitudeGd = entity.getStartLatitudeGd(); if (startLatitudeGd != null) { stmt.bindString(5, startLatitudeGd); } - + String startLongitudeGd = entity.getStartLongitudeGd(); if (startLongitudeGd != null) { stmt.bindString(6, startLongitudeGd); @@ -102,32 +97,32 @@ @Override protected final void bindValues(SQLiteStatement stmt, PipeLocalBean entity) { stmt.clearBindings(); - + Long id = entity.getId(); if (id != null) { stmt.bindLong(1, id); } - + String pipeCode = entity.getPipeCode(); if (pipeCode != null) { stmt.bindString(2, pipeCode); } - + String endLatitudeGd = entity.getEndLatitudeGd(); if (endLatitudeGd != null) { stmt.bindString(3, endLatitudeGd); } - + String endLongitudeGd = entity.getEndLongitudeGd(); if (endLongitudeGd != null) { stmt.bindString(4, endLongitudeGd); } - + String startLatitudeGd = entity.getStartLatitudeGd(); if (startLatitudeGd != null) { stmt.bindString(5, startLatitudeGd); } - + String startLongitudeGd = entity.getStartLongitudeGd(); if (startLongitudeGd != null) { stmt.bindString(6, startLongitudeGd); @@ -137,21 +132,21 @@ @Override public Long readKey(Cursor cursor, int offset) { return cursor.isNull(offset + 0) ? null : cursor.getLong(offset + 0); - } + } @Override public PipeLocalBean readEntity(Cursor cursor, int offset) { PipeLocalBean entity = new PipeLocalBean( // - cursor.isNull(offset + 0) ? null : cursor.getLong(offset + 0), // id - cursor.isNull(offset + 1) ? null : cursor.getString(offset + 1), // pipeCode - cursor.isNull(offset + 2) ? null : cursor.getString(offset + 2), // endLatitudeGd - cursor.isNull(offset + 3) ? null : cursor.getString(offset + 3), // endLongitudeGd - cursor.isNull(offset + 4) ? null : cursor.getString(offset + 4), // startLatitudeGd - cursor.isNull(offset + 5) ? null : cursor.getString(offset + 5) // startLongitudeGd + cursor.isNull(offset + 0) ? null : cursor.getLong(offset + 0), // id + cursor.isNull(offset + 1) ? null : cursor.getString(offset + 1), // pipeCode + cursor.isNull(offset + 2) ? null : cursor.getString(offset + 2), // endLatitudeGd + cursor.isNull(offset + 3) ? null : cursor.getString(offset + 3), // endLongitudeGd + cursor.isNull(offset + 4) ? null : cursor.getString(offset + 4), // startLatitudeGd + cursor.isNull(offset + 5) ? null : cursor.getString(offset + 5) // startLongitudeGd ); return entity; } - + @Override public void readEntity(Cursor cursor, PipeLocalBean entity, int offset) { entity.setId(cursor.isNull(offset + 0) ? null : cursor.getLong(offset + 0)); @@ -160,17 +155,17 @@ entity.setEndLongitudeGd(cursor.isNull(offset + 3) ? null : cursor.getString(offset + 3)); entity.setStartLatitudeGd(cursor.isNull(offset + 4) ? null : cursor.getString(offset + 4)); entity.setStartLongitudeGd(cursor.isNull(offset + 5) ? null : cursor.getString(offset + 5)); - } - + } + @Override protected final Long updateKeyAfterInsert(PipeLocalBean entity, long rowId) { entity.setId(rowId); return rowId; } - + @Override public Long getKey(PipeLocalBean entity) { - if (entity != null) { + if(entity != null) { return entity.getId(); } else { return null; @@ -186,5 +181,5 @@ protected final boolean isEntityUpdateable() { return true; } - + } diff --git a/app/src/main/java/com/casic/app/smartwell/view/ChangePasswordActivity.kt b/app/src/main/java/com/casic/app/smartwell/view/ChangePasswordActivity.kt index 8e41039..9f1dd40 100644 --- a/app/src/main/java/com/casic/app/smartwell/view/ChangePasswordActivity.kt +++ b/app/src/main/java/com/casic/app/smartwell/view/ChangePasswordActivity.kt @@ -14,7 +14,7 @@ import com.pengxh.kt.lite.extensions.show import com.pengxh.kt.lite.utils.ActivityStackManager import com.pengxh.kt.lite.utils.LoadState -import com.pengxh.kt.lite.utils.LoadingDialogHub +import com.pengxh.kt.lite.utils.LoadingDialog import com.pengxh.kt.lite.widget.TitleBarView import java.nio.charset.StandardCharsets @@ -46,15 +46,15 @@ override fun observeRequestState() { userViewModel.loadState.observe(this) { when (it) { - is LoadState.Loading -> LoadingDialogHub.show(this, "修改中,请稍后") + is LoadState.Loading -> LoadingDialog.show(this, "修改中,请稍后") is LoadState.Success -> { - LoadingDialogHub.dismiss() + LoadingDialog.dismiss() AuthenticationHelper.removeToken() this.navigatePageTo() ActivityStackManager.finishAllActivity() } - else -> LoadingDialogHub.dismiss() + else -> LoadingDialog.dismiss() } } } diff --git a/app/src/main/java/com/casic/app/smartwell/view/DeployedWellActivity.kt b/app/src/main/java/com/casic/app/smartwell/view/DeployedWellActivity.kt index fb4339c..28a5078 100644 --- a/app/src/main/java/com/casic/app/smartwell/view/DeployedWellActivity.kt +++ b/app/src/main/java/com/casic/app/smartwell/view/DeployedWellActivity.kt @@ -83,8 +83,8 @@ } //添加分割线 - binding.deployedListView.addItemDecoration( - RecyclerViewItemOffsets(0, 5, 0, 5) + binding.recyclerView.addItemDecoration( + RecyclerViewItemOffsets(0, 7, 0, 7) ) } @@ -149,12 +149,11 @@ } else { item.deep.toString() + "m" } - viewHolder.setText(R.id.wellNameView, item.wellName) + viewHolder.setText(R.id.wellTypeView, item.wellTypeName) .setText(R.id.wellDepthView, "深:${deep}") .setText(R.id.wellCodeView, "点位编号:${item.wellCode}") - .setText(R.id.wellTypeView, "点位类型:${item.wellTypeName}") .setText(R.id.ownerShipView, "权属单位:${item.deptName}") - .setText(R.id.wellLocationView, "点位置:${item.position}") + .setText(R.id.wellLocationView, "点位位置:${item.position}") .setOnClickListener( R.id.operationButton, object : View.OnClickListener { override fun onClick(v: View?) { @@ -207,7 +206,7 @@ }) } } - binding.deployedListView.adapter = deployAdapter + binding.recyclerView.adapter = deployAdapter deployAdapter.setOnItemClickedListener(object : NormalRecyclerAdapter.OnItemClickedListener { override fun onItemClicked(position: Int, t: WellListModel.DataBean.RowsBean) { diff --git a/app/src/main/java/com/casic/app/smartwell/view/LoginActivity.kt b/app/src/main/java/com/casic/app/smartwell/view/LoginActivity.kt index e4bb0e3..834527b 100644 --- a/app/src/main/java/com/casic/app/smartwell/view/LoginActivity.kt +++ b/app/src/main/java/com/casic/app/smartwell/view/LoginActivity.kt @@ -21,7 +21,7 @@ import com.pengxh.kt.lite.extensions.navigatePageTo import com.pengxh.kt.lite.extensions.readAssetsFile import com.pengxh.kt.lite.extensions.show -import com.pengxh.kt.lite.utils.LoadingDialogHub +import com.pengxh.kt.lite.utils.LoadingDialog import com.pengxh.kt.lite.utils.SaveKeyValues import kotlinx.coroutines.Dispatchers import kotlinx.coroutines.launch @@ -106,11 +106,11 @@ override fun observeRequestState() { authenticateViewModel.loadState.observe(this) { - LoadingDialogHub.show(this, "登录中,请稍后") + LoadingDialog.show(this, "登录中,请稍后") } loginViewModel.loadState.observe(this) { - LoadingDialogHub.dismiss() + LoadingDialog.dismiss() } } diff --git a/app/src/main/java/com/casic/app/smartwell/view/OrderCompletedDetailActivity.kt b/app/src/main/java/com/casic/app/smartwell/view/OrderCompletedDetailActivity.kt index db8ad1f..75cd905 100644 --- a/app/src/main/java/com/casic/app/smartwell/view/OrderCompletedDetailActivity.kt +++ b/app/src/main/java/com/casic/app/smartwell/view/OrderCompletedDetailActivity.kt @@ -17,7 +17,7 @@ import com.pengxh.kt.lite.extensions.show import com.pengxh.kt.lite.utils.Constant import com.pengxh.kt.lite.utils.LoadState -import com.pengxh.kt.lite.utils.LoadingDialogHub +import com.pengxh.kt.lite.utils.LoadingDialog import com.pengxh.kt.lite.widget.TitleBarView import com.pengxh.kt.lite.widget.dialog.AlertMessageDialog @@ -44,7 +44,7 @@ } override fun initOnCreate(savedInstanceState: Bundle?) { - val jobId = intent.getStringExtra(Constant.INTENT_PARAM)!! + val jobId = intent.getStringExtra(Constant.INTENT_PARAM_KEY)!! orderViewModel = ViewModelProvider(this)[OrderViewModel::class.java] orderViewModel.getWorkOrderDetail(jobId) orderViewModel.detailModel.observe(this) { @@ -154,8 +154,8 @@ override fun observeRequestState() { orderViewModel.loadState.observe(this) { when (it) { - is LoadState.Loading -> LoadingDialogHub.show(this, "数据加载中,请稍后") - else -> LoadingDialogHub.dismiss() + is LoadState.Loading -> LoadingDialog.show(this, "数据加载中,请稍后") + else -> LoadingDialog.dismiss() } } } diff --git a/app/src/main/java/com/casic/app/smartwell/view/OrderInHandleDetailActivity.kt b/app/src/main/java/com/casic/app/smartwell/view/OrderInHandleDetailActivity.kt index d70a979..04a7d5d 100644 --- a/app/src/main/java/com/casic/app/smartwell/view/OrderInHandleDetailActivity.kt +++ b/app/src/main/java/com/casic/app/smartwell/view/OrderInHandleDetailActivity.kt @@ -38,7 +38,7 @@ import com.pengxh.kt.lite.extensions.show import com.pengxh.kt.lite.utils.Constant import com.pengxh.kt.lite.utils.LoadState -import com.pengxh.kt.lite.utils.LoadingDialogHub +import com.pengxh.kt.lite.utils.LoadingDialog import com.pengxh.kt.lite.widget.TitleBarView import com.pengxh.kt.lite.widget.dialog.AlertControlDialog import com.pengxh.kt.lite.widget.dialog.AlertMessageDialog @@ -93,7 +93,7 @@ ) binding.addImageRecyclerView.adapter = imageAdapter - val jobId = intent.getStringExtra(Constant.INTENT_PARAM)!!//初始化图片九宫格 + val jobId = intent.getStringExtra(Constant.INTENT_PARAM_KEY)!!//初始化图片九宫格 orderViewModel.getWorkOrderDetail(jobId) orderViewModel.detailModel.observe(this) { if (it.code == 200) { @@ -312,41 +312,41 @@ override fun observeRequestState() { orderViewModel.loadState.observe(this) { when (it) { - is LoadState.Loading -> LoadingDialogHub.show(this, "数据加载中,请稍后") - else -> LoadingDialogHub.dismiss() + is LoadState.Loading -> LoadingDialog.show(this, "数据加载中,请稍后") + else -> LoadingDialog.dismiss() } } uploadImageViewModel.loadState.observe(this) { when (it) { - LoadState.Loading -> LoadingDialogHub.show(this, "图片上传中,请稍后...") - else -> LoadingDialogHub.dismiss() + LoadState.Loading -> LoadingDialog.show(this, "图片上传中,请稍后...") + else -> LoadingDialog.dismiss() } } //转单状态处理 operationViewModel.loadState.observe(this) { when (it) { - is LoadState.Loading -> LoadingDialogHub.show(this, "转单中,请稍后") + is LoadState.Loading -> LoadingDialog.show(this, "转单中,请稍后") is LoadState.Success -> { - LoadingDialogHub.dismiss() + LoadingDialog.dismiss() this.finish() } - else -> LoadingDialogHub.dismiss() + else -> LoadingDialog.dismiss() } } //处理完成工单状态处理 operationViewModel.loadState.observe(this) { when (it) { - is LoadState.Loading -> LoadingDialogHub.show(this, "处理中,请稍后") + is LoadState.Loading -> LoadingDialog.show(this, "处理中,请稍后") is LoadState.Success -> { - LoadingDialogHub.dismiss() + LoadingDialog.dismiss() this.finish() } - else -> LoadingDialogHub.dismiss() + else -> LoadingDialog.dismiss() } } } diff --git a/app/src/main/java/com/casic/app/smartwell/view/OrderNotConfirmedDetailActivity.kt b/app/src/main/java/com/casic/app/smartwell/view/OrderNotConfirmedDetailActivity.kt index 8e036d2..687ec86 100644 --- a/app/src/main/java/com/casic/app/smartwell/view/OrderNotConfirmedDetailActivity.kt +++ b/app/src/main/java/com/casic/app/smartwell/view/OrderNotConfirmedDetailActivity.kt @@ -36,7 +36,7 @@ import com.pengxh.kt.lite.extensions.show import com.pengxh.kt.lite.utils.Constant import com.pengxh.kt.lite.utils.LoadState -import com.pengxh.kt.lite.utils.LoadingDialogHub +import com.pengxh.kt.lite.utils.LoadingDialog import com.pengxh.kt.lite.widget.TitleBarView import com.pengxh.kt.lite.widget.dialog.AlertControlDialog import com.pengxh.kt.lite.widget.dialog.AlertMessageDialog @@ -80,7 +80,7 @@ } override fun initOnCreate(savedInstanceState: Bundle?) { - val jobId = intent.getStringExtra(Constant.INTENT_PARAM)!! + val jobId = intent.getStringExtra(Constant.INTENT_PARAM_KEY)!! //初始化图片九宫格 //左外边距,左内边距,右内边距,右外边距 val viewWidth = getScreenWidth() - (10 + 10 + 10 + 10).dp2px(this) @@ -263,41 +263,41 @@ //数据加载状态处理 orderViewModel.loadState.observe(this) { when (it) { - is LoadState.Loading -> LoadingDialogHub.show(this, "数据加载中,请稍后") - else -> LoadingDialogHub.dismiss() + is LoadState.Loading -> LoadingDialog.show(this, "数据加载中,请稍后") + else -> LoadingDialog.dismiss() } } uploadImageViewModel.loadState.observe(this) { when (it) { - LoadState.Loading -> LoadingDialogHub.show(this, "图片上传中,请稍后") - else -> LoadingDialogHub.dismiss() + LoadState.Loading -> LoadingDialog.show(this, "图片上传中,请稍后") + else -> LoadingDialog.dismiss() } } //转单状态处理 operationViewModel.loadState.observe(this) { when (it) { - is LoadState.Loading -> LoadingDialogHub.show(this, "转单中,请稍后") + is LoadState.Loading -> LoadingDialog.show(this, "转单中,请稍后") is LoadState.Success -> { - LoadingDialogHub.dismiss() + LoadingDialog.dismiss() this.finish() } - else -> LoadingDialogHub.dismiss() + else -> LoadingDialog.dismiss() } } //确认工单状态处理 operationViewModel.loadState.observe(this) { when (it) { - is LoadState.Loading -> LoadingDialogHub.show(this, "处理中,请稍后") + is LoadState.Loading -> LoadingDialog.show(this, "处理中,请稍后") is LoadState.Success -> { - LoadingDialogHub.dismiss() + LoadingDialog.dismiss() this.finish() } - else -> LoadingDialogHub.dismiss() + else -> LoadingDialog.dismiss() } } } diff --git a/app/src/main/java/com/casic/app/smartwell/view/OrderNotProcessedDetailActivity.kt b/app/src/main/java/com/casic/app/smartwell/view/OrderNotProcessedDetailActivity.kt index d3f22dc..0c97a52 100644 --- a/app/src/main/java/com/casic/app/smartwell/view/OrderNotProcessedDetailActivity.kt +++ b/app/src/main/java/com/casic/app/smartwell/view/OrderNotProcessedDetailActivity.kt @@ -18,7 +18,7 @@ import com.pengxh.kt.lite.extensions.show import com.pengxh.kt.lite.utils.Constant import com.pengxh.kt.lite.utils.LoadState -import com.pengxh.kt.lite.utils.LoadingDialogHub +import com.pengxh.kt.lite.utils.LoadingDialog import com.pengxh.kt.lite.widget.TitleBarView import com.pengxh.kt.lite.widget.dialog.AlertControlDialog import com.pengxh.kt.lite.widget.dialog.AlertMessageDialog @@ -50,7 +50,7 @@ } override fun initOnCreate(savedInstanceState: Bundle?) { - this.jobId = intent.getStringExtra(Constant.INTENT_PARAM)!! + this.jobId = intent.getStringExtra(Constant.INTENT_PARAM_KEY)!! orderViewModel = ViewModelProvider(this)[OrderViewModel::class.java] operationViewModel = ViewModelProvider(this)[OperationViewModel::class.java] wellViewModel = ViewModelProvider(this)[WellViewModel::class.java] @@ -162,21 +162,21 @@ //数据加载状态处理 orderViewModel.loadState.observe(this) { when (it) { - is LoadState.Loading -> LoadingDialogHub.show(this, "数据加载中,请稍后") - else -> LoadingDialogHub.dismiss() + is LoadState.Loading -> LoadingDialog.show(this, "数据加载中,请稍后") + else -> LoadingDialog.dismiss() } } //接单状态处理 operationViewModel.loadState.observe(this) { when (it) { - is LoadState.Loading -> LoadingDialogHub.show(this, "接单中,请稍后") + is LoadState.Loading -> LoadingDialog.show(this, "接单中,请稍后") is LoadState.Success -> { - LoadingDialogHub.dismiss() + LoadingDialog.dismiss() this.finish() } - else -> LoadingDialogHub.dismiss() + else -> LoadingDialog.dismiss() } } } diff --git a/app/src/main/java/com/casic/app/smartwell/view/SearchResultActivity.kt b/app/src/main/java/com/casic/app/smartwell/view/SearchResultActivity.kt index 6a92917..4f3a674 100644 --- a/app/src/main/java/com/casic/app/smartwell/view/SearchResultActivity.kt +++ b/app/src/main/java/com/casic/app/smartwell/view/SearchResultActivity.kt @@ -19,7 +19,7 @@ import com.pengxh.kt.lite.extensions.show import com.pengxh.kt.lite.utils.Constant import com.pengxh.kt.lite.utils.LoadState -import com.pengxh.kt.lite.utils.LoadingDialogHub +import com.pengxh.kt.lite.utils.LoadingDialog import com.pengxh.kt.lite.utils.WeakReferenceHandler import com.pengxh.kt.lite.widget.TitleBarView import com.pengxh.kt.lite.widget.dialog.AlertControlDialog @@ -56,7 +56,7 @@ } override fun initOnCreate(savedInstanceState: Bundle?) { - args = intent.getStringArrayListExtra(Constant.INTENT_PARAM)!! + args = intent.getStringArrayListExtra(Constant.INTENT_PARAM_KEY)!! orderViewModel = ViewModelProvider(this)[OrderViewModel::class.java] operationViewModel = ViewModelProvider(this)[OperationViewModel::class.java] @@ -101,24 +101,24 @@ } } - binding.resultRecyclerView.addItemDecoration( - RecyclerViewItemOffsets(0, 5, 0, 5) + binding.recyclerView.addItemDecoration( + RecyclerViewItemOffsets(0, 7, 0, 7) ) } override fun observeRequestState() { orderViewModel.loadState.observe(this) { when (it) { - is LoadState.Loading -> LoadingDialogHub.show(this, "数据加载中,请稍后") - else -> LoadingDialogHub.dismiss() + is LoadState.Loading -> LoadingDialog.show(this, "数据加载中,请稍后") + else -> LoadingDialog.dismiss() } } //接单状态处理 operationViewModel.loadState.observe(this) { when (it) { - is LoadState.Loading -> LoadingDialogHub.show(this, "接单中,请稍后") + is LoadState.Loading -> LoadingDialog.show(this, "接单中,请稍后") is LoadState.Success -> { - LoadingDialogHub.dismiss() + LoadingDialog.dismiss() //接单成功之后刷新列表 dataBeans.removeAt(clickedPosition) searchResultAdapter.notifyItemRemoved(clickedPosition) @@ -127,7 +127,7 @@ ) } - else -> LoadingDialogHub.dismiss() + else -> LoadingDialog.dismiss() } } } @@ -162,7 +162,7 @@ } else { binding.emptyInclude.emptyView.hide() searchResultAdapter = SearchResultAdapter(this, dataBeans) - binding.resultRecyclerView.adapter = searchResultAdapter + binding.recyclerView.adapter = searchResultAdapter searchResultAdapter.setOnItemClickListener(object : SearchResultAdapter.OnItemClickListener { override fun onClicked(position: Int) { diff --git a/app/src/main/java/com/casic/app/smartwell/view/UnDeployWellActivity.kt b/app/src/main/java/com/casic/app/smartwell/view/UnDeployWellActivity.kt index 7f7cd3c..555c278 100644 --- a/app/src/main/java/com/casic/app/smartwell/view/UnDeployWellActivity.kt +++ b/app/src/main/java/com/casic/app/smartwell/view/UnDeployWellActivity.kt @@ -81,8 +81,8 @@ } } - binding.undeployListView.addItemDecoration( - RecyclerViewItemOffsets(0, 5, 0, 5) + binding.recyclerView.addItemDecoration( + RecyclerViewItemOffsets(0, 7, 0, 7) ) } @@ -147,12 +147,11 @@ } else { item.deep.toString() + "m" } - viewHolder.setText(R.id.wellNameView, item.wellName) + viewHolder.setText(R.id.wellTypeView, item.wellTypeName) .setText(R.id.wellDepthView, "深:${deep}") .setText(R.id.wellCodeView, "点位编号:${item.wellCode}") - .setText(R.id.wellTypeView, "点位类型:${item.wellTypeName}") .setText(R.id.ownerShipView, "权属单位:${item.deptName}") - .setText(R.id.wellLocationView, "点位置:${item.position}") + .setText(R.id.wellLocationView, "点位位置:${item.position}") .setOnClickListener( R.id.operationButton, object : View.OnClickListener { override fun onClick(v: View?) { @@ -185,7 +184,7 @@ ) } } - binding.undeployListView.adapter = unDeployAdapter + binding.recyclerView.adapter = unDeployAdapter unDeployAdapter.setOnItemClickedListener(object : NormalRecyclerAdapter.OnItemClickedListener { override fun onItemClicked(position: Int, t: WellListModel.DataBean.RowsBean) { diff --git a/app/src/main/java/com/casic/app/smartwell/view/WellDetailActivity.kt b/app/src/main/java/com/casic/app/smartwell/view/WellDetailActivity.kt index b50d067..eb8b468 100644 --- a/app/src/main/java/com/casic/app/smartwell/view/WellDetailActivity.kt +++ b/app/src/main/java/com/casic/app/smartwell/view/WellDetailActivity.kt @@ -16,7 +16,7 @@ import com.pengxh.kt.lite.extensions.show import com.pengxh.kt.lite.utils.Constant import com.pengxh.kt.lite.utils.LoadState -import com.pengxh.kt.lite.utils.LoadingDialogHub +import com.pengxh.kt.lite.utils.LoadingDialog import com.pengxh.kt.lite.widget.TitleBarView import com.pengxh.kt.lite.widget.dialog.AlertMessageDialog @@ -44,7 +44,7 @@ } override fun initOnCreate(savedInstanceState: Bundle?) { - val wellId = intent.getStringExtra(Constant.INTENT_PARAM)!! + val wellId = intent.getStringExtra(Constant.INTENT_PARAM_KEY)!! wellViewModel = ViewModelProvider(this)[WellViewModel::class.java] wellViewModel.getWellDetail(wellId) wellViewModel.wellDetailModel.observe(this) { @@ -132,8 +132,8 @@ override fun observeRequestState() { wellViewModel.loadState.observe(this) { when (it) { - is LoadState.Loading -> LoadingDialogHub.show(this, "数据加载中,请稍后") - else -> LoadingDialogHub.dismiss() + is LoadState.Loading -> LoadingDialog.show(this, "数据加载中,请稍后") + else -> LoadingDialog.dismiss() } } } diff --git a/app/src/main/java/com/casic/app/smartwell/view/WellManagementActivity.kt b/app/src/main/java/com/casic/app/smartwell/view/WellManagementActivity.kt index 084da95..457096b 100644 --- a/app/src/main/java/com/casic/app/smartwell/view/WellManagementActivity.kt +++ b/app/src/main/java/com/casic/app/smartwell/view/WellManagementActivity.kt @@ -94,8 +94,8 @@ } } - binding.wellListView.addItemDecoration( - RecyclerViewItemOffsets(0, 5, 0, 5) + binding.recyclerView.addItemDecoration( + RecyclerViewItemOffsets(0, 7, 0, 7) ) } @@ -175,13 +175,12 @@ } else { item.deep.toString() + "m" } - viewHolder.setText(R.id.wellNameView, item.wellName) + viewHolder.setText(R.id.wellTypeView, item.wellTypeName) .setText(R.id.wellStateView, "已${item.bfztName}") .setText(R.id.wellDepthView, "深:${deep}") .setText(R.id.wellCodeView, "点位编号:${item.wellCode}") - .setText(R.id.wellTypeView, "点位类型:${item.wellTypeName}") .setText(R.id.ownerShipView, "权属单位:${item.deptName}") - .setText(R.id.wellLocationView, "点位置:${item.position}") + .setText(R.id.wellLocationView, "点位位置:${item.position}") .setOnClickListener( R.id.navigationButton, object : View.OnClickListener { override fun onClick(v: View?) { @@ -200,7 +199,7 @@ ) } } - binding.wellListView.adapter = wellListAdapter + binding.recyclerView.adapter = wellListAdapter wellListAdapter.setOnItemClickedListener(object : NormalRecyclerAdapter.OnItemClickedListener { override fun onItemClicked(position: Int, t: WellListModel.DataBean.RowsBean) { diff --git a/app/src/main/java/com/casic/app/smartwell/view/WellMonitorActivity.kt b/app/src/main/java/com/casic/app/smartwell/view/WellMonitorActivity.kt index e3573eb..b87bdb7 100644 --- a/app/src/main/java/com/casic/app/smartwell/view/WellMonitorActivity.kt +++ b/app/src/main/java/com/casic/app/smartwell/view/WellMonitorActivity.kt @@ -11,7 +11,7 @@ import com.pengxh.kt.lite.base.KotlinBaseActivity import com.pengxh.kt.lite.utils.Constant import com.pengxh.kt.lite.utils.LoadState -import com.pengxh.kt.lite.utils.LoadingDialogHub +import com.pengxh.kt.lite.utils.LoadingDialog import com.pengxh.kt.lite.widget.TitleBarView class WellMonitorActivity : KotlinBaseActivity() { @@ -36,7 +36,7 @@ } override fun initOnCreate(savedInstanceState: Bundle?) { - val wellId = intent.getStringExtra(Constant.INTENT_PARAM)!! + val wellId = intent.getStringExtra(Constant.INTENT_PARAM_KEY)!! wellViewModel = ViewModelProvider(this)[WellViewModel::class.java] wellViewModel.getMonitorResult(wellId) wellViewModel.monitorModel.observe(this) { @@ -56,8 +56,8 @@ override fun observeRequestState() { wellViewModel.loadState.observe(this) { when (it) { - is LoadState.Loading -> LoadingDialogHub.show(this, "数据加载中,请稍后") - else -> LoadingDialogHub.dismiss() + is LoadState.Loading -> LoadingDialog.show(this, "数据加载中,请稍后") + else -> LoadingDialog.dismiss() } } } diff --git a/app/src/main/java/com/casic/app/smartwell/view/WellOperationActivity.kt b/app/src/main/java/com/casic/app/smartwell/view/WellOperationActivity.kt index 8d333bf..347ebb6 100644 --- a/app/src/main/java/com/casic/app/smartwell/view/WellOperationActivity.kt +++ b/app/src/main/java/com/casic/app/smartwell/view/WellOperationActivity.kt @@ -23,7 +23,7 @@ import com.pengxh.kt.lite.extensions.navigatePageTo import com.pengxh.kt.lite.extensions.show import com.pengxh.kt.lite.utils.LoadState -import com.pengxh.kt.lite.utils.LoadingDialogHub +import com.pengxh.kt.lite.utils.LoadingDialog import com.pengxh.kt.lite.utils.WeakReferenceHandler import com.pengxh.kt.lite.widget.dialog.AlertControlDialog @@ -109,8 +109,8 @@ } } - binding.operationListView.addItemDecoration( - RecyclerViewItemOffsets(0, 5, 0, 5) + binding.recyclerView.addItemDecoration( + RecyclerViewItemOffsets(0, 7, 0, 7) ) } @@ -123,13 +123,13 @@ override fun observeRequestState() { wellViewModel.loadState.observe(this) { when (it) { - is LoadState.Loading -> LoadingDialogHub.show(this, "处理中,请稍后") + is LoadState.Loading -> LoadingDialog.show(this, "处理中,请稍后") is LoadState.Success -> { - LoadingDialogHub.dismiss() + LoadingDialog.dismiss() wellOperationAdapter.notifyItemChanged(clickedPosition) } - else -> LoadingDialogHub.dismiss() + else -> LoadingDialog.dismiss() } } } @@ -203,24 +203,23 @@ if (item.bfztName == "布防") { viewHolder.setImageResource( R.id.wellStateView, R.drawable.bg_solid_text_green_radius_5 - ).setText(R.id.wellStateView, "撤防") + ).setText(R.id.operationButton, "撤防") } else { viewHolder.setImageResource( R.id.wellStateView, R.drawable.bg_solid_text_red_radius_5 - ).setText(R.id.wellStateView, "布防") + ).setText(R.id.operationButton, "布防") } val deep = if (item.deep.toString().isBlank()) { "未知" } else { item.deep.toString() + "m" } - viewHolder.setText(R.id.wellNameView, item.wellName) + viewHolder.setText(R.id.wellTypeView, item.wellTypeName) .setText(R.id.wellStateView, "已${item.bfztName}") .setText(R.id.wellDepthView, "深:${deep}") .setText(R.id.wellCodeView, "点位编号:${item.wellCode}") - .setText(R.id.wellTypeView, "点位类型:${item.wellTypeName}") .setText(R.id.ownerShipView, "权属单位:${item.deptName}") - .setText(R.id.wellLocationView, "点位置:${item.position}") + .setText(R.id.wellLocationView, "点位位置:${item.position}") .setOnClickListener( R.id.operationButton, object : View.OnClickListener { override fun onClick(v: View?) { @@ -280,7 +279,7 @@ ) } } - binding.operationListView.adapter = wellOperationAdapter + binding.recyclerView.adapter = wellOperationAdapter wellOperationAdapter.setOnItemClickedListener(object : NormalRecyclerAdapter.OnItemClickedListener { override fun onItemClicked(position: Int, t: WellListModel.DataBean.RowsBean) { diff --git a/app/src/main/res/drawable/ic_down.xml b/app/src/main/res/drawable/ic_down.xml index 20e6476..6987e6c 100644 --- a/app/src/main/res/drawable/ic_down.xml +++ b/app/src/main/res/drawable/ic_down.xml @@ -1,6 +1,6 @@ + + diff --git a/app/src/main/res/layout/activity_about_us.xml b/app/src/main/res/layout/activity_about_us.xml index 9091a00..d5fbd0d 100644 --- a/app/src/main/res/layout/activity_about_us.xml +++ b/app/src/main/res/layout/activity_about_us.xml @@ -12,13 +12,7 @@ android:layout_width="match_parent" android:layout_height="wrap_content" android:background="@color/mainThemeColor" - app:tbv_left_image="@drawable/ic_title_left" - app:tbv_only_show_title="false" - app:tbv_show_left_image="true" - app:tbv_show_right_image="false" - app:tbv_text="关于我们" - app:tbv_text_color="@color/white" - app:tbv_text_size="@dimen/sp_18" /> + app:tbv_text="关于我们" /> + app:tbv_text="修改密码" /> + app:tbv_text="布防列表" /> + app:tbv_text="帮助中心" /> - + + android:value="ee96d8b5e12de3fbb29949efd57418a8" /> () @@ -150,7 +158,7 @@ val cameraPosition = CameraPosition(centerLatLng, 14f, 0f, 0f) val cameraUpdate = CameraUpdateFactory.newCameraPosition(cameraPosition) withContext(Dispatchers.Main) { - LoadingDialogHub.dismiss() + LoadingDialog.dismiss() aMap.animateCamera(cameraUpdate, 1500, null) } } @@ -239,11 +247,6 @@ } override fun initEvent() { - binding.rightOptionView.setOnClickListener { - val x = binding.rightOptionView.width - easyPopupWindow.width - easyPopupWindow.showAsDropDown(binding.rightOptionView, x, 0) - } - //撤防点位 binding.unDeployedLayout.setOnClickListener { requireContext().navigatePageTo() @@ -263,11 +266,11 @@ override fun observeRequestState() { wellViewModel.loadState.observe(this) { when (it) { - is LoadState.Loading -> LoadingDialogHub.show( + is LoadState.Loading -> LoadingDialog.show( requireActivity(), "数据加载中,请稍后..." ) - else -> LoadingDialogHub.dismiss() + else -> LoadingDialog.dismiss() } } } @@ -376,7 +379,7 @@ }).build().show() } }) - infoPopup.showAsDropDown(binding.rightOptionView) +// infoPopup.showAsDropDown(binding.rightOptionView) } override fun onCameraChange(p0: CameraPosition?) { diff --git a/app/src/main/java/com/casic/app/smartwell/fragment/HomePageNoClusterFragment.kt b/app/src/main/java/com/casic/app/smartwell/fragment/HomePageNoClusterFragment.kt index 802426a..b25f743 100644 --- a/app/src/main/java/com/casic/app/smartwell/fragment/HomePageNoClusterFragment.kt +++ b/app/src/main/java/com/casic/app/smartwell/fragment/HomePageNoClusterFragment.kt @@ -38,8 +38,9 @@ import com.pengxh.kt.lite.extensions.navigatePageTo import com.pengxh.kt.lite.extensions.show import com.pengxh.kt.lite.utils.LoadState -import com.pengxh.kt.lite.utils.LoadingDialogHub +import com.pengxh.kt.lite.utils.LoadingDialog import com.pengxh.kt.lite.widget.EasyPopupWindow +import com.pengxh.kt.lite.widget.TitleBarView import com.pengxh.kt.lite.widget.dialog.AlertControlDialog import kotlinx.coroutines.Dispatchers import kotlinx.coroutines.launch @@ -78,7 +79,15 @@ override fun setupTopBarLayout() { binding.rootView.initImmersionBar(this, false, R.color.mainThemeColor) - binding.titleView.text = "首页" + binding.titleView.setOnClickListener(object : TitleBarView.OnClickListener { + override fun onLeftClick() { + + } + + override fun onRightClick() { + easyPopupWindow.showAsDropDown(binding.titleView, binding.titleView.width, 0) + } + }) } override fun initOnCreate(savedInstanceState: Bundle?) { @@ -112,7 +121,7 @@ //渲染井位置 lifecycleScope.launch(Dispatchers.Main) { - LoadingDialogHub.show(requireActivity(), "数据加载中,请稍后") + LoadingDialog.show(requireActivity(), "数据加载中,请稍后") withContext(Dispatchers.IO) { //取Well缓存 val allMarkerOptions = ArrayList() @@ -144,7 +153,7 @@ val cameraPosition = CameraPosition(centerLatLng, 14f, 0f, 0f) val cameraUpdate = CameraUpdateFactory.newCameraPosition(cameraPosition) withContext(Dispatchers.Main) { - LoadingDialogHub.dismiss() + LoadingDialog.dismiss() aMap.animateCamera(cameraUpdate, 1500, null) } } @@ -238,11 +247,6 @@ } override fun initEvent() { - binding.rightOptionView.setOnClickListener { - val x = binding.rightOptionView.width - easyPopupWindow.width - easyPopupWindow.showAsDropDown(binding.rightOptionView, x, 0) - } - //撤防点位 binding.unDeployedLayout.setOnClickListener { requireContext().navigatePageTo() @@ -262,11 +266,11 @@ override fun observeRequestState() { wellViewModel.loadState.observe(this) { when (it) { - is LoadState.Loading -> LoadingDialogHub.show( + is LoadState.Loading -> LoadingDialog.show( requireActivity(), "数据加载中,请稍后..." ) - else -> LoadingDialogHub.dismiss() + else -> LoadingDialog.dismiss() } } } diff --git a/app/src/main/java/com/casic/app/smartwell/fragment/MinePageFragment.kt b/app/src/main/java/com/casic/app/smartwell/fragment/MinePageFragment.kt index 09a570c..dcb48f8 100644 --- a/app/src/main/java/com/casic/app/smartwell/fragment/MinePageFragment.kt +++ b/app/src/main/java/com/casic/app/smartwell/fragment/MinePageFragment.kt @@ -35,7 +35,7 @@ import com.pengxh.kt.lite.utils.ActivityStackManager import com.pengxh.kt.lite.utils.FileDownloadManager import com.pengxh.kt.lite.utils.LoadState -import com.pengxh.kt.lite.utils.LoadingDialogHub +import com.pengxh.kt.lite.utils.LoadingDialog import com.pengxh.kt.lite.widget.dialog.AlertControlDialog import com.pengxh.kt.lite.widget.dialog.BottomActionSheet import kotlinx.coroutines.Dispatchers @@ -60,7 +60,6 @@ override fun setupTopBarLayout() { binding.rootView.initImmersionBar(this, false, R.color.mainThemeColor) - binding.titleInclude.titleView.text = "我的" } override fun initOnCreate(savedInstanceState: Bundle?) { @@ -155,27 +154,27 @@ override fun observeRequestState() { userViewModel.loadState.observe(this) { when (it) { - is LoadState.Loading -> LoadingDialogHub.show( + is LoadState.Loading -> LoadingDialog.show( requireActivity(), "检查版本中,请稍后" ) - else -> LoadingDialogHub.dismiss() + else -> LoadingDialog.dismiss() } } wellViewModel.loadState.observe(this) { when (it) { - is LoadState.Loading -> LoadingDialogHub.show( + is LoadState.Loading -> LoadingDialog.show( requireActivity(), "数据更新中,请稍后" ) is LoadState.Fail -> { - LoadingDialogHub.dismiss() + LoadingDialog.dismiss() "数据更新超时".show(requireContext()) } else -> { - LoadingDialogHub.dismiss() + LoadingDialog.dismiss() AlertControlDialog.Builder().setContext(requireContext()).setTitle("温馨提示") .setMessage("数据更新成功,请重启应用").setNegativeButton("取消") .setPositiveButton("确定").setOnDialogButtonClickListener(object : @@ -197,17 +196,17 @@ lineViewModel.loadState.observe(this) { when (it) { - is LoadState.Loading -> LoadingDialogHub.show( + is LoadState.Loading -> LoadingDialog.show( requireActivity(), "数据更新中,请稍后" ) is LoadState.Fail -> { - LoadingDialogHub.dismiss() + LoadingDialog.dismiss() "数据更新超时".show(requireContext()) } else -> { - LoadingDialogHub.dismiss() + LoadingDialog.dismiss() AlertControlDialog.Builder().setContext(requireContext()).setTitle("温馨提示") .setMessage("数据更新成功,请重启应用").setNegativeButton("取消") .setPositiveButton("确定").setOnDialogButtonClickListener(object : diff --git a/app/src/main/java/com/casic/app/smartwell/fragment/NoticePageFragment.kt b/app/src/main/java/com/casic/app/smartwell/fragment/NoticePageFragment.kt index 171b555..3c93f54 100644 --- a/app/src/main/java/com/casic/app/smartwell/fragment/NoticePageFragment.kt +++ b/app/src/main/java/com/casic/app/smartwell/fragment/NoticePageFragment.kt @@ -48,7 +48,6 @@ override fun setupTopBarLayout() { binding.rootView.initImmersionBar(this, false, R.color.mainThemeColor) - binding.titleInclude.titleView.text = "消息" } override fun initOnCreate(savedInstanceState: Bundle?) { diff --git a/app/src/main/java/com/casic/app/smartwell/fragment/OrderListFragment.kt b/app/src/main/java/com/casic/app/smartwell/fragment/OrderListFragment.kt index 93ff35b..5e38acb 100644 --- a/app/src/main/java/com/casic/app/smartwell/fragment/OrderListFragment.kt +++ b/app/src/main/java/com/casic/app/smartwell/fragment/OrderListFragment.kt @@ -12,6 +12,7 @@ import com.casic.app.smartwell.view.SearchOrderActivity import com.pengxh.kt.lite.base.KotlinBaseFragment import com.pengxh.kt.lite.extensions.navigatePageTo +import com.pengxh.kt.lite.widget.TitleBarView class OrderListFragment : KotlinBaseFragment() { @@ -25,15 +26,22 @@ } override fun initViewBinding( - inflater: LayoutInflater, - container: ViewGroup? + inflater: LayoutInflater, container: ViewGroup? ): FragmentOrderBinding { return FragmentOrderBinding.inflate(inflater, container, false) } override fun setupTopBarLayout() { binding.rootView.initImmersionBar(this, false, R.color.mainThemeColor) - binding.titleView.text = "工单" + binding.titleView.setOnClickListener(object : TitleBarView.OnClickListener { + override fun onLeftClick() { + + } + + override fun onRightClick() { + requireContext().navigatePageTo() + } + }) } override fun initOnCreate(savedInstanceState: Bundle?) { @@ -51,8 +59,6 @@ } override fun initEvent() { - binding.rightOptionView.setOnClickListener { - requireContext().navigatePageTo() - } + } } \ No newline at end of file diff --git a/app/src/main/java/com/casic/app/smartwell/fragment/OrderNotProcessedFragment.kt b/app/src/main/java/com/casic/app/smartwell/fragment/OrderNotProcessedFragment.kt index 0b3d09d..2b6f21d 100644 --- a/app/src/main/java/com/casic/app/smartwell/fragment/OrderNotProcessedFragment.kt +++ b/app/src/main/java/com/casic/app/smartwell/fragment/OrderNotProcessedFragment.kt @@ -18,7 +18,7 @@ import com.pengxh.kt.lite.extensions.navigatePageTo import com.pengxh.kt.lite.extensions.show import com.pengxh.kt.lite.utils.LoadState -import com.pengxh.kt.lite.utils.LoadingDialogHub +import com.pengxh.kt.lite.utils.LoadingDialog import com.pengxh.kt.lite.utils.WeakReferenceHandler import com.pengxh.kt.lite.widget.dialog.AlertControlDialog @@ -78,8 +78,8 @@ operationViewModel = ViewModelProvider(this)[OperationViewModel::class.java] - binding.notProcessedView.addItemDecoration( - RecyclerViewItemOffsets(0, 5, 0, 5) + binding.recyclerView.addItemDecoration( + RecyclerViewItemOffsets(0, 7, 0, 7) ) } @@ -87,9 +87,9 @@ //接单状态处理 operationViewModel.loadState.observe(this) { when (it) { - is LoadState.Loading -> LoadingDialogHub.show(requireActivity(), "接单中,请稍后") + is LoadState.Loading -> LoadingDialog.show(requireActivity(), "接单中,请稍后") is LoadState.Success -> { - LoadingDialogHub.dismiss() + LoadingDialog.dismiss() //接单成功之后刷新列表 dataBeans.removeAt(clickedPosition) notProcessedAdapter.notifyItemRemoved(clickedPosition) @@ -98,7 +98,7 @@ ) } - else -> LoadingDialogHub.dismiss() + else -> LoadingDialog.dismiss() } } } @@ -131,7 +131,7 @@ } else { binding.emptyInclude.emptyView.hide() notProcessedAdapter = OrderNotProcessedAdapter(requireContext(), dataBeans) - binding.notProcessedView.adapter = notProcessedAdapter + binding.recyclerView.adapter = notProcessedAdapter notProcessedAdapter.setOnItemClickListener(object : OrderNotProcessedAdapter.OnItemClickListener { override fun onClicked(position: Int) { diff --git a/app/src/main/java/com/casic/app/smartwell/fragment/OvertimeNotAcceptFragment.kt b/app/src/main/java/com/casic/app/smartwell/fragment/OvertimeNotAcceptFragment.kt index a198545..9b318ca 100644 --- a/app/src/main/java/com/casic/app/smartwell/fragment/OvertimeNotAcceptFragment.kt +++ b/app/src/main/java/com/casic/app/smartwell/fragment/OvertimeNotAcceptFragment.kt @@ -18,7 +18,7 @@ import com.pengxh.kt.lite.extensions.navigatePageTo import com.pengxh.kt.lite.extensions.show import com.pengxh.kt.lite.utils.LoadState -import com.pengxh.kt.lite.utils.LoadingDialogHub +import com.pengxh.kt.lite.utils.LoadingDialog import com.pengxh.kt.lite.utils.WeakReferenceHandler import com.pengxh.kt.lite.widget.dialog.AlertControlDialog @@ -81,8 +81,8 @@ operationViewModel = ViewModelProvider(this)[OperationViewModel::class.java] - binding.notProcessedView.addItemDecoration( - RecyclerViewItemOffsets(0, 5, 0, 5) + binding.recyclerView.addItemDecoration( + RecyclerViewItemOffsets(0, 7, 0, 7) ) } @@ -90,9 +90,9 @@ //接单状态处理 operationViewModel.loadState.observe(this) { when (it) { - is LoadState.Loading -> LoadingDialogHub.show(requireActivity(), "接单中,请稍后") + is LoadState.Loading -> LoadingDialog.show(requireActivity(), "接单中,请稍后") is LoadState.Success -> { - LoadingDialogHub.dismiss() + LoadingDialog.dismiss() //接单成功之后刷新列表 dataBeans.removeAt(clickedPosition) notProcessedAdapter.notifyItemRemoved(clickedPosition) @@ -101,7 +101,7 @@ ) } - else -> LoadingDialogHub.dismiss() + else -> LoadingDialog.dismiss() } } } @@ -134,7 +134,7 @@ } else { binding.emptyInclude.emptyView.hide() notProcessedAdapter = OrderNotProcessedAdapter(requireContext(), dataBeans) - binding.notProcessedView.adapter = notProcessedAdapter + binding.recyclerView.adapter = notProcessedAdapter notProcessedAdapter.setOnItemClickListener(object : OrderNotProcessedAdapter.OnItemClickListener { override fun onClicked(position: Int) { diff --git a/app/src/main/java/com/casic/app/smartwell/greendao/DaoMaster.java b/app/src/main/java/com/casic/app/smartwell/greendao/DaoMaster.java index fdcf3a7..1e52b74 100644 --- a/app/src/main/java/com/casic/app/smartwell/greendao/DaoMaster.java +++ b/app/src/main/java/com/casic/app/smartwell/greendao/DaoMaster.java @@ -13,25 +13,20 @@ // THIS CODE IS GENERATED BY greenDAO, DO NOT EDIT. - /** * Master of DAO (schema version 4): knows all DAOs. */ public class DaoMaster extends AbstractDaoMaster { public static final int SCHEMA_VERSION = 4; - /** - * Creates underlying database table using DAOs. - */ + /** Creates underlying database table using DAOs. */ public static void createAllTables(Database db, boolean ifNotExists) { MapWellLocalBeanDao.createTable(db, ifNotExists); NoticeLocaleBeanDao.createTable(db, ifNotExists); PipeLocalBeanDao.createTable(db, ifNotExists); } - /** - * Drops underlying database table using DAOs. - */ + /** Drops underlying database table using DAOs. */ public static void dropAllTables(Database db, boolean ifExists) { MapWellLocalBeanDao.dropTable(db, ifExists); NoticeLocaleBeanDao.dropTable(db, ifExists); @@ -86,9 +81,7 @@ } } - /** - * WARNING: Drops all table on Upgrade! Use only during development. - */ + /** WARNING: Drops all table on Upgrade! Use only during development. */ public static class DevOpenHelper extends OpenHelper { public DevOpenHelper(Context context, String name) { super(context, name); diff --git a/app/src/main/java/com/casic/app/smartwell/greendao/DaoSession.java b/app/src/main/java/com/casic/app/smartwell/greendao/DaoSession.java index 0b36d17..3e40e3b 100644 --- a/app/src/main/java/com/casic/app/smartwell/greendao/DaoSession.java +++ b/app/src/main/java/com/casic/app/smartwell/greendao/DaoSession.java @@ -16,7 +16,7 @@ /** * {@inheritDoc} - * + * * @see org.greenrobot.greendao.AbstractDaoSession */ public class DaoSession extends AbstractDaoSession { @@ -50,7 +50,7 @@ registerDao(NoticeLocaleBean.class, noticeLocaleBeanDao); registerDao(PipeLocalBean.class, pipeLocalBeanDao); } - + public void clear() { mapWellLocalBeanDaoConfig.clearIdentityScope(); noticeLocaleBeanDaoConfig.clearIdentityScope(); diff --git a/app/src/main/java/com/casic/app/smartwell/greendao/MapWellLocalBeanDao.java b/app/src/main/java/com/casic/app/smartwell/greendao/MapWellLocalBeanDao.java index 8908fda..407bc92 100644 --- a/app/src/main/java/com/casic/app/smartwell/greendao/MapWellLocalBeanDao.java +++ b/app/src/main/java/com/casic/app/smartwell/greendao/MapWellLocalBeanDao.java @@ -12,10 +12,9 @@ import org.greenrobot.greendao.internal.DaoConfig; // THIS CODE IS GENERATED BY greenDAO, DO NOT EDIT. - -/** +/** * DAO for table "MAP_WELL_LOCAL_BEAN". - */ +*/ public class MapWellLocalBeanDao extends AbstractDao { public static final String TABLENAME = "MAP_WELL_LOCAL_BEAN"; @@ -57,16 +56,14 @@ public MapWellLocalBeanDao(DaoConfig config) { super(config); } - + public MapWellLocalBeanDao(DaoConfig config, DaoSession daoSession) { super(config, daoSession); } - /** - * Creates the underlying database table. - */ + /** Creates the underlying database table. */ public static void createTable(Database db, boolean ifNotExists) { - String constraint = ifNotExists ? "IF NOT EXISTS " : ""; + String constraint = ifNotExists? "IF NOT EXISTS ": ""; db.execSQL("CREATE TABLE " + constraint + "\"MAP_WELL_LOCAL_BEAN\" (" + // "\"_id\" INTEGER PRIMARY KEY AUTOINCREMENT ," + // 0: kId "\"AREA\" TEXT," + // 1: area @@ -96,9 +93,7 @@ "\"WELL_TYPE_NAME\" TEXT);"); // 25: wellTypeName } - /** - * Drops the underlying database table. - */ + /** Drops the underlying database table. */ public static void dropTable(Database db, boolean ifExists) { String sql = "DROP TABLE " + (ifExists ? "IF EXISTS " : "") + "\"MAP_WELL_LOCAL_BEAN\""; db.execSQL(sql); @@ -107,132 +102,132 @@ @Override protected final void bindValues(DatabaseStatement stmt, MapWellLocalBean entity) { stmt.clearBindings(); - + Long kId = entity.getKId(); if (kId != null) { stmt.bindLong(1, kId); } - + String area = entity.getArea(); if (area != null) { stmt.bindString(2, area); } - + String bfzt = entity.getBfzt(); if (bfzt != null) { stmt.bindString(3, bfzt); } - + String bfztName = entity.getBfztName(); if (bfztName != null) { stmt.bindString(4, bfztName); } - + String coordinateX = entity.getCoordinateX(); if (coordinateX != null) { stmt.bindString(5, coordinateX); } - + String coordinateY = entity.getCoordinateY(); if (coordinateY != null) { stmt.bindString(6, coordinateY); } - + String deep = entity.getDeep(); if (deep != null) { stmt.bindString(7, deep); } - + String deptName = entity.getDeptName(); if (deptName != null) { stmt.bindString(8, deptName); } - + String deptid = entity.getDeptid(); if (deptid != null) { stmt.bindString(9, deptid); } - + String id = entity.getId(); if (id != null) { stmt.bindString(10, id); } - + String latBaidu = entity.getLatBaidu(); if (latBaidu != null) { stmt.bindString(11, latBaidu); } - + String latGaode = entity.getLatGaode(); if (latGaode != null) { stmt.bindString(12, latGaode); } - + String lngBaidu = entity.getLngBaidu(); if (lngBaidu != null) { stmt.bindString(13, lngBaidu); } - + String lngGaode = entity.getLngGaode(); if (lngGaode != null) { stmt.bindString(14, lngGaode); } - + String notes = entity.getNotes(); if (notes != null) { stmt.bindString(15, notes); } - + String photos = entity.getPhotos(); if (photos != null) { stmt.bindString(16, photos); } - + String position = entity.getPosition(); if (position != null) { stmt.bindString(17, position); } - + String staff = entity.getStaff(); if (staff != null) { stmt.bindString(18, staff); } - + String tel = entity.getTel(); if (tel != null) { stmt.bindString(19, tel); } - + String ts = entity.getTs(); if (ts != null) { stmt.bindString(20, ts); } - + String valid = entity.getValid(); if (valid != null) { stmt.bindString(21, valid); } - + String watchData = entity.getWatchData(); if (watchData != null) { stmt.bindString(22, watchData); } - + String wellCode = entity.getWellCode(); if (wellCode != null) { stmt.bindString(23, wellCode); } - + String wellName = entity.getWellName(); if (wellName != null) { stmt.bindString(24, wellName); } - + String wellType = entity.getWellType(); if (wellType != null) { stmt.bindString(25, wellType); } - + String wellTypeName = entity.getWellTypeName(); if (wellTypeName != null) { stmt.bindString(26, wellTypeName); @@ -242,132 +237,132 @@ @Override protected final void bindValues(SQLiteStatement stmt, MapWellLocalBean entity) { stmt.clearBindings(); - + Long kId = entity.getKId(); if (kId != null) { stmt.bindLong(1, kId); } - + String area = entity.getArea(); if (area != null) { stmt.bindString(2, area); } - + String bfzt = entity.getBfzt(); if (bfzt != null) { stmt.bindString(3, bfzt); } - + String bfztName = entity.getBfztName(); if (bfztName != null) { stmt.bindString(4, bfztName); } - + String coordinateX = entity.getCoordinateX(); if (coordinateX != null) { stmt.bindString(5, coordinateX); } - + String coordinateY = entity.getCoordinateY(); if (coordinateY != null) { stmt.bindString(6, coordinateY); } - + String deep = entity.getDeep(); if (deep != null) { stmt.bindString(7, deep); } - + String deptName = entity.getDeptName(); if (deptName != null) { stmt.bindString(8, deptName); } - + String deptid = entity.getDeptid(); if (deptid != null) { stmt.bindString(9, deptid); } - + String id = entity.getId(); if (id != null) { stmt.bindString(10, id); } - + String latBaidu = entity.getLatBaidu(); if (latBaidu != null) { stmt.bindString(11, latBaidu); } - + String latGaode = entity.getLatGaode(); if (latGaode != null) { stmt.bindString(12, latGaode); } - + String lngBaidu = entity.getLngBaidu(); if (lngBaidu != null) { stmt.bindString(13, lngBaidu); } - + String lngGaode = entity.getLngGaode(); if (lngGaode != null) { stmt.bindString(14, lngGaode); } - + String notes = entity.getNotes(); if (notes != null) { stmt.bindString(15, notes); } - + String photos = entity.getPhotos(); if (photos != null) { stmt.bindString(16, photos); } - + String position = entity.getPosition(); if (position != null) { stmt.bindString(17, position); } - + String staff = entity.getStaff(); if (staff != null) { stmt.bindString(18, staff); } - + String tel = entity.getTel(); if (tel != null) { stmt.bindString(19, tel); } - + String ts = entity.getTs(); if (ts != null) { stmt.bindString(20, ts); } - + String valid = entity.getValid(); if (valid != null) { stmt.bindString(21, valid); } - + String watchData = entity.getWatchData(); if (watchData != null) { stmt.bindString(22, watchData); } - + String wellCode = entity.getWellCode(); if (wellCode != null) { stmt.bindString(23, wellCode); } - + String wellName = entity.getWellName(); if (wellName != null) { stmt.bindString(24, wellName); } - + String wellType = entity.getWellType(); if (wellType != null) { stmt.bindString(25, wellType); } - + String wellTypeName = entity.getWellTypeName(); if (wellTypeName != null) { stmt.bindString(26, wellTypeName); @@ -377,41 +372,41 @@ @Override public Long readKey(Cursor cursor, int offset) { return cursor.isNull(offset + 0) ? null : cursor.getLong(offset + 0); - } + } @Override public MapWellLocalBean readEntity(Cursor cursor, int offset) { MapWellLocalBean entity = new MapWellLocalBean( // - cursor.isNull(offset + 0) ? null : cursor.getLong(offset + 0), // kId - cursor.isNull(offset + 1) ? null : cursor.getString(offset + 1), // area - cursor.isNull(offset + 2) ? null : cursor.getString(offset + 2), // bfzt - cursor.isNull(offset + 3) ? null : cursor.getString(offset + 3), // bfztName - cursor.isNull(offset + 4) ? null : cursor.getString(offset + 4), // coordinateX - cursor.isNull(offset + 5) ? null : cursor.getString(offset + 5), // coordinateY - cursor.isNull(offset + 6) ? null : cursor.getString(offset + 6), // deep - cursor.isNull(offset + 7) ? null : cursor.getString(offset + 7), // deptName - cursor.isNull(offset + 8) ? null : cursor.getString(offset + 8), // deptid - cursor.isNull(offset + 9) ? null : cursor.getString(offset + 9), // id - cursor.isNull(offset + 10) ? null : cursor.getString(offset + 10), // latBaidu - cursor.isNull(offset + 11) ? null : cursor.getString(offset + 11), // latGaode - cursor.isNull(offset + 12) ? null : cursor.getString(offset + 12), // lngBaidu - cursor.isNull(offset + 13) ? null : cursor.getString(offset + 13), // lngGaode - cursor.isNull(offset + 14) ? null : cursor.getString(offset + 14), // notes - cursor.isNull(offset + 15) ? null : cursor.getString(offset + 15), // photos - cursor.isNull(offset + 16) ? null : cursor.getString(offset + 16), // position - cursor.isNull(offset + 17) ? null : cursor.getString(offset + 17), // staff - cursor.isNull(offset + 18) ? null : cursor.getString(offset + 18), // tel - cursor.isNull(offset + 19) ? null : cursor.getString(offset + 19), // ts - cursor.isNull(offset + 20) ? null : cursor.getString(offset + 20), // valid - cursor.isNull(offset + 21) ? null : cursor.getString(offset + 21), // watchData - cursor.isNull(offset + 22) ? null : cursor.getString(offset + 22), // wellCode - cursor.isNull(offset + 23) ? null : cursor.getString(offset + 23), // wellName - cursor.isNull(offset + 24) ? null : cursor.getString(offset + 24), // wellType - cursor.isNull(offset + 25) ? null : cursor.getString(offset + 25) // wellTypeName + cursor.isNull(offset + 0) ? null : cursor.getLong(offset + 0), // kId + cursor.isNull(offset + 1) ? null : cursor.getString(offset + 1), // area + cursor.isNull(offset + 2) ? null : cursor.getString(offset + 2), // bfzt + cursor.isNull(offset + 3) ? null : cursor.getString(offset + 3), // bfztName + cursor.isNull(offset + 4) ? null : cursor.getString(offset + 4), // coordinateX + cursor.isNull(offset + 5) ? null : cursor.getString(offset + 5), // coordinateY + cursor.isNull(offset + 6) ? null : cursor.getString(offset + 6), // deep + cursor.isNull(offset + 7) ? null : cursor.getString(offset + 7), // deptName + cursor.isNull(offset + 8) ? null : cursor.getString(offset + 8), // deptid + cursor.isNull(offset + 9) ? null : cursor.getString(offset + 9), // id + cursor.isNull(offset + 10) ? null : cursor.getString(offset + 10), // latBaidu + cursor.isNull(offset + 11) ? null : cursor.getString(offset + 11), // latGaode + cursor.isNull(offset + 12) ? null : cursor.getString(offset + 12), // lngBaidu + cursor.isNull(offset + 13) ? null : cursor.getString(offset + 13), // lngGaode + cursor.isNull(offset + 14) ? null : cursor.getString(offset + 14), // notes + cursor.isNull(offset + 15) ? null : cursor.getString(offset + 15), // photos + cursor.isNull(offset + 16) ? null : cursor.getString(offset + 16), // position + cursor.isNull(offset + 17) ? null : cursor.getString(offset + 17), // staff + cursor.isNull(offset + 18) ? null : cursor.getString(offset + 18), // tel + cursor.isNull(offset + 19) ? null : cursor.getString(offset + 19), // ts + cursor.isNull(offset + 20) ? null : cursor.getString(offset + 20), // valid + cursor.isNull(offset + 21) ? null : cursor.getString(offset + 21), // watchData + cursor.isNull(offset + 22) ? null : cursor.getString(offset + 22), // wellCode + cursor.isNull(offset + 23) ? null : cursor.getString(offset + 23), // wellName + cursor.isNull(offset + 24) ? null : cursor.getString(offset + 24), // wellType + cursor.isNull(offset + 25) ? null : cursor.getString(offset + 25) // wellTypeName ); return entity; } - + @Override public void readEntity(Cursor cursor, MapWellLocalBean entity, int offset) { entity.setKId(cursor.isNull(offset + 0) ? null : cursor.getLong(offset + 0)); @@ -440,17 +435,17 @@ entity.setWellName(cursor.isNull(offset + 23) ? null : cursor.getString(offset + 23)); entity.setWellType(cursor.isNull(offset + 24) ? null : cursor.getString(offset + 24)); entity.setWellTypeName(cursor.isNull(offset + 25) ? null : cursor.getString(offset + 25)); - } - + } + @Override protected final Long updateKeyAfterInsert(MapWellLocalBean entity, long rowId) { entity.setKId(rowId); return rowId; } - + @Override public Long getKey(MapWellLocalBean entity) { - if (entity != null) { + if(entity != null) { return entity.getKId(); } else { return null; @@ -466,5 +461,5 @@ protected final boolean isEntityUpdateable() { return true; } - + } diff --git a/app/src/main/java/com/casic/app/smartwell/greendao/NoticeLocaleBeanDao.java b/app/src/main/java/com/casic/app/smartwell/greendao/NoticeLocaleBeanDao.java index 64312ed..deb2d49 100644 --- a/app/src/main/java/com/casic/app/smartwell/greendao/NoticeLocaleBeanDao.java +++ b/app/src/main/java/com/casic/app/smartwell/greendao/NoticeLocaleBeanDao.java @@ -12,10 +12,9 @@ import org.greenrobot.greendao.internal.DaoConfig; // THIS CODE IS GENERATED BY greenDAO, DO NOT EDIT. - -/** +/** * DAO for table "NOTICE_LOCALE_BEAN". - */ +*/ public class NoticeLocaleBeanDao extends AbstractDao { public static final String TABLENAME = "NOTICE_LOCALE_BEAN"; @@ -43,16 +42,14 @@ public NoticeLocaleBeanDao(DaoConfig config) { super(config); } - + public NoticeLocaleBeanDao(DaoConfig config, DaoSession daoSession) { super(config, daoSession); } - /** - * Creates the underlying database table. - */ + /** Creates the underlying database table. */ public static void createTable(Database db, boolean ifNotExists) { - String constraint = ifNotExists ? "IF NOT EXISTS " : ""; + String constraint = ifNotExists? "IF NOT EXISTS ": ""; db.execSQL("CREATE TABLE " + constraint + "\"NOTICE_LOCALE_BEAN\" (" + // "\"_id\" INTEGER PRIMARY KEY AUTOINCREMENT ," + // 0: id "\"MESSAGE_ID\" TEXT UNIQUE ," + // 1: messageId @@ -68,9 +65,7 @@ "\"NOTICE_TIME\" TEXT);"); // 11: noticeTime } - /** - * Drops the underlying database table. - */ + /** Drops the underlying database table. */ public static void dropTable(Database db, boolean ifExists) { String sql = "DROP TABLE " + (ifExists ? "IF EXISTS " : "") + "\"NOTICE_LOCALE_BEAN\""; db.execSQL(sql); @@ -79,62 +74,62 @@ @Override protected final void bindValues(DatabaseStatement stmt, NoticeLocaleBean entity) { stmt.clearBindings(); - + Long id = entity.getId(); if (id != null) { stmt.bindLong(1, id); } - + String messageId = entity.getMessageId(); if (messageId != null) { stmt.bindString(2, messageId); } - + String appid = entity.getAppid(); if (appid != null) { stmt.bindString(3, appid); } - + String clientId = entity.getClientId(); if (clientId != null) { stmt.bindString(4, clientId); } - + String taskId = entity.getTaskId(); if (taskId != null) { stmt.bindString(5, taskId); } - + String userId = entity.getUserId(); if (userId != null) { stmt.bindString(6, userId); } - + String title = entity.getTitle(); if (title != null) { stmt.bindString(7, title); } - + String content = entity.getContent(); if (content != null) { stmt.bindString(8, content); } - + String deviceCode = entity.getDeviceCode(); if (deviceCode != null) { stmt.bindString(9, deviceCode); } - + String jobId = entity.getJobId(); if (jobId != null) { stmt.bindString(10, jobId); } - + String isRead = entity.getIsRead(); if (isRead != null) { stmt.bindString(11, isRead); } - + String noticeTime = entity.getNoticeTime(); if (noticeTime != null) { stmt.bindString(12, noticeTime); @@ -144,62 +139,62 @@ @Override protected final void bindValues(SQLiteStatement stmt, NoticeLocaleBean entity) { stmt.clearBindings(); - + Long id = entity.getId(); if (id != null) { stmt.bindLong(1, id); } - + String messageId = entity.getMessageId(); if (messageId != null) { stmt.bindString(2, messageId); } - + String appid = entity.getAppid(); if (appid != null) { stmt.bindString(3, appid); } - + String clientId = entity.getClientId(); if (clientId != null) { stmt.bindString(4, clientId); } - + String taskId = entity.getTaskId(); if (taskId != null) { stmt.bindString(5, taskId); } - + String userId = entity.getUserId(); if (userId != null) { stmt.bindString(6, userId); } - + String title = entity.getTitle(); if (title != null) { stmt.bindString(7, title); } - + String content = entity.getContent(); if (content != null) { stmt.bindString(8, content); } - + String deviceCode = entity.getDeviceCode(); if (deviceCode != null) { stmt.bindString(9, deviceCode); } - + String jobId = entity.getJobId(); if (jobId != null) { stmt.bindString(10, jobId); } - + String isRead = entity.getIsRead(); if (isRead != null) { stmt.bindString(11, isRead); } - + String noticeTime = entity.getNoticeTime(); if (noticeTime != null) { stmt.bindString(12, noticeTime); @@ -209,27 +204,27 @@ @Override public Long readKey(Cursor cursor, int offset) { return cursor.isNull(offset + 0) ? null : cursor.getLong(offset + 0); - } + } @Override public NoticeLocaleBean readEntity(Cursor cursor, int offset) { NoticeLocaleBean entity = new NoticeLocaleBean( // - cursor.isNull(offset + 0) ? null : cursor.getLong(offset + 0), // id - cursor.isNull(offset + 1) ? null : cursor.getString(offset + 1), // messageId - cursor.isNull(offset + 2) ? null : cursor.getString(offset + 2), // appid - cursor.isNull(offset + 3) ? null : cursor.getString(offset + 3), // clientId - cursor.isNull(offset + 4) ? null : cursor.getString(offset + 4), // taskId - cursor.isNull(offset + 5) ? null : cursor.getString(offset + 5), // userId - cursor.isNull(offset + 6) ? null : cursor.getString(offset + 6), // title - cursor.isNull(offset + 7) ? null : cursor.getString(offset + 7), // content - cursor.isNull(offset + 8) ? null : cursor.getString(offset + 8), // deviceCode - cursor.isNull(offset + 9) ? null : cursor.getString(offset + 9), // jobId - cursor.isNull(offset + 10) ? null : cursor.getString(offset + 10), // isRead - cursor.isNull(offset + 11) ? null : cursor.getString(offset + 11) // noticeTime + cursor.isNull(offset + 0) ? null : cursor.getLong(offset + 0), // id + cursor.isNull(offset + 1) ? null : cursor.getString(offset + 1), // messageId + cursor.isNull(offset + 2) ? null : cursor.getString(offset + 2), // appid + cursor.isNull(offset + 3) ? null : cursor.getString(offset + 3), // clientId + cursor.isNull(offset + 4) ? null : cursor.getString(offset + 4), // taskId + cursor.isNull(offset + 5) ? null : cursor.getString(offset + 5), // userId + cursor.isNull(offset + 6) ? null : cursor.getString(offset + 6), // title + cursor.isNull(offset + 7) ? null : cursor.getString(offset + 7), // content + cursor.isNull(offset + 8) ? null : cursor.getString(offset + 8), // deviceCode + cursor.isNull(offset + 9) ? null : cursor.getString(offset + 9), // jobId + cursor.isNull(offset + 10) ? null : cursor.getString(offset + 10), // isRead + cursor.isNull(offset + 11) ? null : cursor.getString(offset + 11) // noticeTime ); return entity; } - + @Override public void readEntity(Cursor cursor, NoticeLocaleBean entity, int offset) { entity.setId(cursor.isNull(offset + 0) ? null : cursor.getLong(offset + 0)); @@ -244,17 +239,17 @@ entity.setJobId(cursor.isNull(offset + 9) ? null : cursor.getString(offset + 9)); entity.setIsRead(cursor.isNull(offset + 10) ? null : cursor.getString(offset + 10)); entity.setNoticeTime(cursor.isNull(offset + 11) ? null : cursor.getString(offset + 11)); - } - + } + @Override protected final Long updateKeyAfterInsert(NoticeLocaleBean entity, long rowId) { entity.setId(rowId); return rowId; } - + @Override public Long getKey(NoticeLocaleBean entity) { - if (entity != null) { + if(entity != null) { return entity.getId(); } else { return null; @@ -270,5 +265,5 @@ protected final boolean isEntityUpdateable() { return true; } - + } diff --git a/app/src/main/java/com/casic/app/smartwell/greendao/PipeLocalBeanDao.java b/app/src/main/java/com/casic/app/smartwell/greendao/PipeLocalBeanDao.java index aab4d3f..df5515a 100644 --- a/app/src/main/java/com/casic/app/smartwell/greendao/PipeLocalBeanDao.java +++ b/app/src/main/java/com/casic/app/smartwell/greendao/PipeLocalBeanDao.java @@ -12,10 +12,9 @@ import org.greenrobot.greendao.internal.DaoConfig; // THIS CODE IS GENERATED BY greenDAO, DO NOT EDIT. - -/** +/** * DAO for table "PIPE_LOCAL_BEAN". - */ +*/ public class PipeLocalBeanDao extends AbstractDao { public static final String TABLENAME = "PIPE_LOCAL_BEAN"; @@ -37,16 +36,14 @@ public PipeLocalBeanDao(DaoConfig config) { super(config); } - + public PipeLocalBeanDao(DaoConfig config, DaoSession daoSession) { super(config, daoSession); } - /** - * Creates the underlying database table. - */ + /** Creates the underlying database table. */ public static void createTable(Database db, boolean ifNotExists) { - String constraint = ifNotExists ? "IF NOT EXISTS " : ""; + String constraint = ifNotExists? "IF NOT EXISTS ": ""; db.execSQL("CREATE TABLE " + constraint + "\"PIPE_LOCAL_BEAN\" (" + // "\"_id\" INTEGER PRIMARY KEY AUTOINCREMENT ," + // 0: id "\"PIPE_CODE\" TEXT," + // 1: pipeCode @@ -56,9 +53,7 @@ "\"START_LONGITUDE_GD\" TEXT);"); // 5: startLongitudeGd } - /** - * Drops the underlying database table. - */ + /** Drops the underlying database table. */ public static void dropTable(Database db, boolean ifExists) { String sql = "DROP TABLE " + (ifExists ? "IF EXISTS " : "") + "\"PIPE_LOCAL_BEAN\""; db.execSQL(sql); @@ -67,32 +62,32 @@ @Override protected final void bindValues(DatabaseStatement stmt, PipeLocalBean entity) { stmt.clearBindings(); - + Long id = entity.getId(); if (id != null) { stmt.bindLong(1, id); } - + String pipeCode = entity.getPipeCode(); if (pipeCode != null) { stmt.bindString(2, pipeCode); } - + String endLatitudeGd = entity.getEndLatitudeGd(); if (endLatitudeGd != null) { stmt.bindString(3, endLatitudeGd); } - + String endLongitudeGd = entity.getEndLongitudeGd(); if (endLongitudeGd != null) { stmt.bindString(4, endLongitudeGd); } - + String startLatitudeGd = entity.getStartLatitudeGd(); if (startLatitudeGd != null) { stmt.bindString(5, startLatitudeGd); } - + String startLongitudeGd = entity.getStartLongitudeGd(); if (startLongitudeGd != null) { stmt.bindString(6, startLongitudeGd); @@ -102,32 +97,32 @@ @Override protected final void bindValues(SQLiteStatement stmt, PipeLocalBean entity) { stmt.clearBindings(); - + Long id = entity.getId(); if (id != null) { stmt.bindLong(1, id); } - + String pipeCode = entity.getPipeCode(); if (pipeCode != null) { stmt.bindString(2, pipeCode); } - + String endLatitudeGd = entity.getEndLatitudeGd(); if (endLatitudeGd != null) { stmt.bindString(3, endLatitudeGd); } - + String endLongitudeGd = entity.getEndLongitudeGd(); if (endLongitudeGd != null) { stmt.bindString(4, endLongitudeGd); } - + String startLatitudeGd = entity.getStartLatitudeGd(); if (startLatitudeGd != null) { stmt.bindString(5, startLatitudeGd); } - + String startLongitudeGd = entity.getStartLongitudeGd(); if (startLongitudeGd != null) { stmt.bindString(6, startLongitudeGd); @@ -137,21 +132,21 @@ @Override public Long readKey(Cursor cursor, int offset) { return cursor.isNull(offset + 0) ? null : cursor.getLong(offset + 0); - } + } @Override public PipeLocalBean readEntity(Cursor cursor, int offset) { PipeLocalBean entity = new PipeLocalBean( // - cursor.isNull(offset + 0) ? null : cursor.getLong(offset + 0), // id - cursor.isNull(offset + 1) ? null : cursor.getString(offset + 1), // pipeCode - cursor.isNull(offset + 2) ? null : cursor.getString(offset + 2), // endLatitudeGd - cursor.isNull(offset + 3) ? null : cursor.getString(offset + 3), // endLongitudeGd - cursor.isNull(offset + 4) ? null : cursor.getString(offset + 4), // startLatitudeGd - cursor.isNull(offset + 5) ? null : cursor.getString(offset + 5) // startLongitudeGd + cursor.isNull(offset + 0) ? null : cursor.getLong(offset + 0), // id + cursor.isNull(offset + 1) ? null : cursor.getString(offset + 1), // pipeCode + cursor.isNull(offset + 2) ? null : cursor.getString(offset + 2), // endLatitudeGd + cursor.isNull(offset + 3) ? null : cursor.getString(offset + 3), // endLongitudeGd + cursor.isNull(offset + 4) ? null : cursor.getString(offset + 4), // startLatitudeGd + cursor.isNull(offset + 5) ? null : cursor.getString(offset + 5) // startLongitudeGd ); return entity; } - + @Override public void readEntity(Cursor cursor, PipeLocalBean entity, int offset) { entity.setId(cursor.isNull(offset + 0) ? null : cursor.getLong(offset + 0)); @@ -160,17 +155,17 @@ entity.setEndLongitudeGd(cursor.isNull(offset + 3) ? null : cursor.getString(offset + 3)); entity.setStartLatitudeGd(cursor.isNull(offset + 4) ? null : cursor.getString(offset + 4)); entity.setStartLongitudeGd(cursor.isNull(offset + 5) ? null : cursor.getString(offset + 5)); - } - + } + @Override protected final Long updateKeyAfterInsert(PipeLocalBean entity, long rowId) { entity.setId(rowId); return rowId; } - + @Override public Long getKey(PipeLocalBean entity) { - if (entity != null) { + if(entity != null) { return entity.getId(); } else { return null; @@ -186,5 +181,5 @@ protected final boolean isEntityUpdateable() { return true; } - + } diff --git a/app/src/main/java/com/casic/app/smartwell/view/ChangePasswordActivity.kt b/app/src/main/java/com/casic/app/smartwell/view/ChangePasswordActivity.kt index 8e41039..9f1dd40 100644 --- a/app/src/main/java/com/casic/app/smartwell/view/ChangePasswordActivity.kt +++ b/app/src/main/java/com/casic/app/smartwell/view/ChangePasswordActivity.kt @@ -14,7 +14,7 @@ import com.pengxh.kt.lite.extensions.show import com.pengxh.kt.lite.utils.ActivityStackManager import com.pengxh.kt.lite.utils.LoadState -import com.pengxh.kt.lite.utils.LoadingDialogHub +import com.pengxh.kt.lite.utils.LoadingDialog import com.pengxh.kt.lite.widget.TitleBarView import java.nio.charset.StandardCharsets @@ -46,15 +46,15 @@ override fun observeRequestState() { userViewModel.loadState.observe(this) { when (it) { - is LoadState.Loading -> LoadingDialogHub.show(this, "修改中,请稍后") + is LoadState.Loading -> LoadingDialog.show(this, "修改中,请稍后") is LoadState.Success -> { - LoadingDialogHub.dismiss() + LoadingDialog.dismiss() AuthenticationHelper.removeToken() this.navigatePageTo() ActivityStackManager.finishAllActivity() } - else -> LoadingDialogHub.dismiss() + else -> LoadingDialog.dismiss() } } } diff --git a/app/src/main/java/com/casic/app/smartwell/view/DeployedWellActivity.kt b/app/src/main/java/com/casic/app/smartwell/view/DeployedWellActivity.kt index fb4339c..28a5078 100644 --- a/app/src/main/java/com/casic/app/smartwell/view/DeployedWellActivity.kt +++ b/app/src/main/java/com/casic/app/smartwell/view/DeployedWellActivity.kt @@ -83,8 +83,8 @@ } //添加分割线 - binding.deployedListView.addItemDecoration( - RecyclerViewItemOffsets(0, 5, 0, 5) + binding.recyclerView.addItemDecoration( + RecyclerViewItemOffsets(0, 7, 0, 7) ) } @@ -149,12 +149,11 @@ } else { item.deep.toString() + "m" } - viewHolder.setText(R.id.wellNameView, item.wellName) + viewHolder.setText(R.id.wellTypeView, item.wellTypeName) .setText(R.id.wellDepthView, "深:${deep}") .setText(R.id.wellCodeView, "点位编号:${item.wellCode}") - .setText(R.id.wellTypeView, "点位类型:${item.wellTypeName}") .setText(R.id.ownerShipView, "权属单位:${item.deptName}") - .setText(R.id.wellLocationView, "点位置:${item.position}") + .setText(R.id.wellLocationView, "点位位置:${item.position}") .setOnClickListener( R.id.operationButton, object : View.OnClickListener { override fun onClick(v: View?) { @@ -207,7 +206,7 @@ }) } } - binding.deployedListView.adapter = deployAdapter + binding.recyclerView.adapter = deployAdapter deployAdapter.setOnItemClickedListener(object : NormalRecyclerAdapter.OnItemClickedListener { override fun onItemClicked(position: Int, t: WellListModel.DataBean.RowsBean) { diff --git a/app/src/main/java/com/casic/app/smartwell/view/LoginActivity.kt b/app/src/main/java/com/casic/app/smartwell/view/LoginActivity.kt index e4bb0e3..834527b 100644 --- a/app/src/main/java/com/casic/app/smartwell/view/LoginActivity.kt +++ b/app/src/main/java/com/casic/app/smartwell/view/LoginActivity.kt @@ -21,7 +21,7 @@ import com.pengxh.kt.lite.extensions.navigatePageTo import com.pengxh.kt.lite.extensions.readAssetsFile import com.pengxh.kt.lite.extensions.show -import com.pengxh.kt.lite.utils.LoadingDialogHub +import com.pengxh.kt.lite.utils.LoadingDialog import com.pengxh.kt.lite.utils.SaveKeyValues import kotlinx.coroutines.Dispatchers import kotlinx.coroutines.launch @@ -106,11 +106,11 @@ override fun observeRequestState() { authenticateViewModel.loadState.observe(this) { - LoadingDialogHub.show(this, "登录中,请稍后") + LoadingDialog.show(this, "登录中,请稍后") } loginViewModel.loadState.observe(this) { - LoadingDialogHub.dismiss() + LoadingDialog.dismiss() } } diff --git a/app/src/main/java/com/casic/app/smartwell/view/OrderCompletedDetailActivity.kt b/app/src/main/java/com/casic/app/smartwell/view/OrderCompletedDetailActivity.kt index db8ad1f..75cd905 100644 --- a/app/src/main/java/com/casic/app/smartwell/view/OrderCompletedDetailActivity.kt +++ b/app/src/main/java/com/casic/app/smartwell/view/OrderCompletedDetailActivity.kt @@ -17,7 +17,7 @@ import com.pengxh.kt.lite.extensions.show import com.pengxh.kt.lite.utils.Constant import com.pengxh.kt.lite.utils.LoadState -import com.pengxh.kt.lite.utils.LoadingDialogHub +import com.pengxh.kt.lite.utils.LoadingDialog import com.pengxh.kt.lite.widget.TitleBarView import com.pengxh.kt.lite.widget.dialog.AlertMessageDialog @@ -44,7 +44,7 @@ } override fun initOnCreate(savedInstanceState: Bundle?) { - val jobId = intent.getStringExtra(Constant.INTENT_PARAM)!! + val jobId = intent.getStringExtra(Constant.INTENT_PARAM_KEY)!! orderViewModel = ViewModelProvider(this)[OrderViewModel::class.java] orderViewModel.getWorkOrderDetail(jobId) orderViewModel.detailModel.observe(this) { @@ -154,8 +154,8 @@ override fun observeRequestState() { orderViewModel.loadState.observe(this) { when (it) { - is LoadState.Loading -> LoadingDialogHub.show(this, "数据加载中,请稍后") - else -> LoadingDialogHub.dismiss() + is LoadState.Loading -> LoadingDialog.show(this, "数据加载中,请稍后") + else -> LoadingDialog.dismiss() } } } diff --git a/app/src/main/java/com/casic/app/smartwell/view/OrderInHandleDetailActivity.kt b/app/src/main/java/com/casic/app/smartwell/view/OrderInHandleDetailActivity.kt index d70a979..04a7d5d 100644 --- a/app/src/main/java/com/casic/app/smartwell/view/OrderInHandleDetailActivity.kt +++ b/app/src/main/java/com/casic/app/smartwell/view/OrderInHandleDetailActivity.kt @@ -38,7 +38,7 @@ import com.pengxh.kt.lite.extensions.show import com.pengxh.kt.lite.utils.Constant import com.pengxh.kt.lite.utils.LoadState -import com.pengxh.kt.lite.utils.LoadingDialogHub +import com.pengxh.kt.lite.utils.LoadingDialog import com.pengxh.kt.lite.widget.TitleBarView import com.pengxh.kt.lite.widget.dialog.AlertControlDialog import com.pengxh.kt.lite.widget.dialog.AlertMessageDialog @@ -93,7 +93,7 @@ ) binding.addImageRecyclerView.adapter = imageAdapter - val jobId = intent.getStringExtra(Constant.INTENT_PARAM)!!//初始化图片九宫格 + val jobId = intent.getStringExtra(Constant.INTENT_PARAM_KEY)!!//初始化图片九宫格 orderViewModel.getWorkOrderDetail(jobId) orderViewModel.detailModel.observe(this) { if (it.code == 200) { @@ -312,41 +312,41 @@ override fun observeRequestState() { orderViewModel.loadState.observe(this) { when (it) { - is LoadState.Loading -> LoadingDialogHub.show(this, "数据加载中,请稍后") - else -> LoadingDialogHub.dismiss() + is LoadState.Loading -> LoadingDialog.show(this, "数据加载中,请稍后") + else -> LoadingDialog.dismiss() } } uploadImageViewModel.loadState.observe(this) { when (it) { - LoadState.Loading -> LoadingDialogHub.show(this, "图片上传中,请稍后...") - else -> LoadingDialogHub.dismiss() + LoadState.Loading -> LoadingDialog.show(this, "图片上传中,请稍后...") + else -> LoadingDialog.dismiss() } } //转单状态处理 operationViewModel.loadState.observe(this) { when (it) { - is LoadState.Loading -> LoadingDialogHub.show(this, "转单中,请稍后") + is LoadState.Loading -> LoadingDialog.show(this, "转单中,请稍后") is LoadState.Success -> { - LoadingDialogHub.dismiss() + LoadingDialog.dismiss() this.finish() } - else -> LoadingDialogHub.dismiss() + else -> LoadingDialog.dismiss() } } //处理完成工单状态处理 operationViewModel.loadState.observe(this) { when (it) { - is LoadState.Loading -> LoadingDialogHub.show(this, "处理中,请稍后") + is LoadState.Loading -> LoadingDialog.show(this, "处理中,请稍后") is LoadState.Success -> { - LoadingDialogHub.dismiss() + LoadingDialog.dismiss() this.finish() } - else -> LoadingDialogHub.dismiss() + else -> LoadingDialog.dismiss() } } } diff --git a/app/src/main/java/com/casic/app/smartwell/view/OrderNotConfirmedDetailActivity.kt b/app/src/main/java/com/casic/app/smartwell/view/OrderNotConfirmedDetailActivity.kt index 8e036d2..687ec86 100644 --- a/app/src/main/java/com/casic/app/smartwell/view/OrderNotConfirmedDetailActivity.kt +++ b/app/src/main/java/com/casic/app/smartwell/view/OrderNotConfirmedDetailActivity.kt @@ -36,7 +36,7 @@ import com.pengxh.kt.lite.extensions.show import com.pengxh.kt.lite.utils.Constant import com.pengxh.kt.lite.utils.LoadState -import com.pengxh.kt.lite.utils.LoadingDialogHub +import com.pengxh.kt.lite.utils.LoadingDialog import com.pengxh.kt.lite.widget.TitleBarView import com.pengxh.kt.lite.widget.dialog.AlertControlDialog import com.pengxh.kt.lite.widget.dialog.AlertMessageDialog @@ -80,7 +80,7 @@ } override fun initOnCreate(savedInstanceState: Bundle?) { - val jobId = intent.getStringExtra(Constant.INTENT_PARAM)!! + val jobId = intent.getStringExtra(Constant.INTENT_PARAM_KEY)!! //初始化图片九宫格 //左外边距,左内边距,右内边距,右外边距 val viewWidth = getScreenWidth() - (10 + 10 + 10 + 10).dp2px(this) @@ -263,41 +263,41 @@ //数据加载状态处理 orderViewModel.loadState.observe(this) { when (it) { - is LoadState.Loading -> LoadingDialogHub.show(this, "数据加载中,请稍后") - else -> LoadingDialogHub.dismiss() + is LoadState.Loading -> LoadingDialog.show(this, "数据加载中,请稍后") + else -> LoadingDialog.dismiss() } } uploadImageViewModel.loadState.observe(this) { when (it) { - LoadState.Loading -> LoadingDialogHub.show(this, "图片上传中,请稍后") - else -> LoadingDialogHub.dismiss() + LoadState.Loading -> LoadingDialog.show(this, "图片上传中,请稍后") + else -> LoadingDialog.dismiss() } } //转单状态处理 operationViewModel.loadState.observe(this) { when (it) { - is LoadState.Loading -> LoadingDialogHub.show(this, "转单中,请稍后") + is LoadState.Loading -> LoadingDialog.show(this, "转单中,请稍后") is LoadState.Success -> { - LoadingDialogHub.dismiss() + LoadingDialog.dismiss() this.finish() } - else -> LoadingDialogHub.dismiss() + else -> LoadingDialog.dismiss() } } //确认工单状态处理 operationViewModel.loadState.observe(this) { when (it) { - is LoadState.Loading -> LoadingDialogHub.show(this, "处理中,请稍后") + is LoadState.Loading -> LoadingDialog.show(this, "处理中,请稍后") is LoadState.Success -> { - LoadingDialogHub.dismiss() + LoadingDialog.dismiss() this.finish() } - else -> LoadingDialogHub.dismiss() + else -> LoadingDialog.dismiss() } } } diff --git a/app/src/main/java/com/casic/app/smartwell/view/OrderNotProcessedDetailActivity.kt b/app/src/main/java/com/casic/app/smartwell/view/OrderNotProcessedDetailActivity.kt index d3f22dc..0c97a52 100644 --- a/app/src/main/java/com/casic/app/smartwell/view/OrderNotProcessedDetailActivity.kt +++ b/app/src/main/java/com/casic/app/smartwell/view/OrderNotProcessedDetailActivity.kt @@ -18,7 +18,7 @@ import com.pengxh.kt.lite.extensions.show import com.pengxh.kt.lite.utils.Constant import com.pengxh.kt.lite.utils.LoadState -import com.pengxh.kt.lite.utils.LoadingDialogHub +import com.pengxh.kt.lite.utils.LoadingDialog import com.pengxh.kt.lite.widget.TitleBarView import com.pengxh.kt.lite.widget.dialog.AlertControlDialog import com.pengxh.kt.lite.widget.dialog.AlertMessageDialog @@ -50,7 +50,7 @@ } override fun initOnCreate(savedInstanceState: Bundle?) { - this.jobId = intent.getStringExtra(Constant.INTENT_PARAM)!! + this.jobId = intent.getStringExtra(Constant.INTENT_PARAM_KEY)!! orderViewModel = ViewModelProvider(this)[OrderViewModel::class.java] operationViewModel = ViewModelProvider(this)[OperationViewModel::class.java] wellViewModel = ViewModelProvider(this)[WellViewModel::class.java] @@ -162,21 +162,21 @@ //数据加载状态处理 orderViewModel.loadState.observe(this) { when (it) { - is LoadState.Loading -> LoadingDialogHub.show(this, "数据加载中,请稍后") - else -> LoadingDialogHub.dismiss() + is LoadState.Loading -> LoadingDialog.show(this, "数据加载中,请稍后") + else -> LoadingDialog.dismiss() } } //接单状态处理 operationViewModel.loadState.observe(this) { when (it) { - is LoadState.Loading -> LoadingDialogHub.show(this, "接单中,请稍后") + is LoadState.Loading -> LoadingDialog.show(this, "接单中,请稍后") is LoadState.Success -> { - LoadingDialogHub.dismiss() + LoadingDialog.dismiss() this.finish() } - else -> LoadingDialogHub.dismiss() + else -> LoadingDialog.dismiss() } } } diff --git a/app/src/main/java/com/casic/app/smartwell/view/SearchResultActivity.kt b/app/src/main/java/com/casic/app/smartwell/view/SearchResultActivity.kt index 6a92917..4f3a674 100644 --- a/app/src/main/java/com/casic/app/smartwell/view/SearchResultActivity.kt +++ b/app/src/main/java/com/casic/app/smartwell/view/SearchResultActivity.kt @@ -19,7 +19,7 @@ import com.pengxh.kt.lite.extensions.show import com.pengxh.kt.lite.utils.Constant import com.pengxh.kt.lite.utils.LoadState -import com.pengxh.kt.lite.utils.LoadingDialogHub +import com.pengxh.kt.lite.utils.LoadingDialog import com.pengxh.kt.lite.utils.WeakReferenceHandler import com.pengxh.kt.lite.widget.TitleBarView import com.pengxh.kt.lite.widget.dialog.AlertControlDialog @@ -56,7 +56,7 @@ } override fun initOnCreate(savedInstanceState: Bundle?) { - args = intent.getStringArrayListExtra(Constant.INTENT_PARAM)!! + args = intent.getStringArrayListExtra(Constant.INTENT_PARAM_KEY)!! orderViewModel = ViewModelProvider(this)[OrderViewModel::class.java] operationViewModel = ViewModelProvider(this)[OperationViewModel::class.java] @@ -101,24 +101,24 @@ } } - binding.resultRecyclerView.addItemDecoration( - RecyclerViewItemOffsets(0, 5, 0, 5) + binding.recyclerView.addItemDecoration( + RecyclerViewItemOffsets(0, 7, 0, 7) ) } override fun observeRequestState() { orderViewModel.loadState.observe(this) { when (it) { - is LoadState.Loading -> LoadingDialogHub.show(this, "数据加载中,请稍后") - else -> LoadingDialogHub.dismiss() + is LoadState.Loading -> LoadingDialog.show(this, "数据加载中,请稍后") + else -> LoadingDialog.dismiss() } } //接单状态处理 operationViewModel.loadState.observe(this) { when (it) { - is LoadState.Loading -> LoadingDialogHub.show(this, "接单中,请稍后") + is LoadState.Loading -> LoadingDialog.show(this, "接单中,请稍后") is LoadState.Success -> { - LoadingDialogHub.dismiss() + LoadingDialog.dismiss() //接单成功之后刷新列表 dataBeans.removeAt(clickedPosition) searchResultAdapter.notifyItemRemoved(clickedPosition) @@ -127,7 +127,7 @@ ) } - else -> LoadingDialogHub.dismiss() + else -> LoadingDialog.dismiss() } } } @@ -162,7 +162,7 @@ } else { binding.emptyInclude.emptyView.hide() searchResultAdapter = SearchResultAdapter(this, dataBeans) - binding.resultRecyclerView.adapter = searchResultAdapter + binding.recyclerView.adapter = searchResultAdapter searchResultAdapter.setOnItemClickListener(object : SearchResultAdapter.OnItemClickListener { override fun onClicked(position: Int) { diff --git a/app/src/main/java/com/casic/app/smartwell/view/UnDeployWellActivity.kt b/app/src/main/java/com/casic/app/smartwell/view/UnDeployWellActivity.kt index 7f7cd3c..555c278 100644 --- a/app/src/main/java/com/casic/app/smartwell/view/UnDeployWellActivity.kt +++ b/app/src/main/java/com/casic/app/smartwell/view/UnDeployWellActivity.kt @@ -81,8 +81,8 @@ } } - binding.undeployListView.addItemDecoration( - RecyclerViewItemOffsets(0, 5, 0, 5) + binding.recyclerView.addItemDecoration( + RecyclerViewItemOffsets(0, 7, 0, 7) ) } @@ -147,12 +147,11 @@ } else { item.deep.toString() + "m" } - viewHolder.setText(R.id.wellNameView, item.wellName) + viewHolder.setText(R.id.wellTypeView, item.wellTypeName) .setText(R.id.wellDepthView, "深:${deep}") .setText(R.id.wellCodeView, "点位编号:${item.wellCode}") - .setText(R.id.wellTypeView, "点位类型:${item.wellTypeName}") .setText(R.id.ownerShipView, "权属单位:${item.deptName}") - .setText(R.id.wellLocationView, "点位置:${item.position}") + .setText(R.id.wellLocationView, "点位位置:${item.position}") .setOnClickListener( R.id.operationButton, object : View.OnClickListener { override fun onClick(v: View?) { @@ -185,7 +184,7 @@ ) } } - binding.undeployListView.adapter = unDeployAdapter + binding.recyclerView.adapter = unDeployAdapter unDeployAdapter.setOnItemClickedListener(object : NormalRecyclerAdapter.OnItemClickedListener { override fun onItemClicked(position: Int, t: WellListModel.DataBean.RowsBean) { diff --git a/app/src/main/java/com/casic/app/smartwell/view/WellDetailActivity.kt b/app/src/main/java/com/casic/app/smartwell/view/WellDetailActivity.kt index b50d067..eb8b468 100644 --- a/app/src/main/java/com/casic/app/smartwell/view/WellDetailActivity.kt +++ b/app/src/main/java/com/casic/app/smartwell/view/WellDetailActivity.kt @@ -16,7 +16,7 @@ import com.pengxh.kt.lite.extensions.show import com.pengxh.kt.lite.utils.Constant import com.pengxh.kt.lite.utils.LoadState -import com.pengxh.kt.lite.utils.LoadingDialogHub +import com.pengxh.kt.lite.utils.LoadingDialog import com.pengxh.kt.lite.widget.TitleBarView import com.pengxh.kt.lite.widget.dialog.AlertMessageDialog @@ -44,7 +44,7 @@ } override fun initOnCreate(savedInstanceState: Bundle?) { - val wellId = intent.getStringExtra(Constant.INTENT_PARAM)!! + val wellId = intent.getStringExtra(Constant.INTENT_PARAM_KEY)!! wellViewModel = ViewModelProvider(this)[WellViewModel::class.java] wellViewModel.getWellDetail(wellId) wellViewModel.wellDetailModel.observe(this) { @@ -132,8 +132,8 @@ override fun observeRequestState() { wellViewModel.loadState.observe(this) { when (it) { - is LoadState.Loading -> LoadingDialogHub.show(this, "数据加载中,请稍后") - else -> LoadingDialogHub.dismiss() + is LoadState.Loading -> LoadingDialog.show(this, "数据加载中,请稍后") + else -> LoadingDialog.dismiss() } } } diff --git a/app/src/main/java/com/casic/app/smartwell/view/WellManagementActivity.kt b/app/src/main/java/com/casic/app/smartwell/view/WellManagementActivity.kt index 084da95..457096b 100644 --- a/app/src/main/java/com/casic/app/smartwell/view/WellManagementActivity.kt +++ b/app/src/main/java/com/casic/app/smartwell/view/WellManagementActivity.kt @@ -94,8 +94,8 @@ } } - binding.wellListView.addItemDecoration( - RecyclerViewItemOffsets(0, 5, 0, 5) + binding.recyclerView.addItemDecoration( + RecyclerViewItemOffsets(0, 7, 0, 7) ) } @@ -175,13 +175,12 @@ } else { item.deep.toString() + "m" } - viewHolder.setText(R.id.wellNameView, item.wellName) + viewHolder.setText(R.id.wellTypeView, item.wellTypeName) .setText(R.id.wellStateView, "已${item.bfztName}") .setText(R.id.wellDepthView, "深:${deep}") .setText(R.id.wellCodeView, "点位编号:${item.wellCode}") - .setText(R.id.wellTypeView, "点位类型:${item.wellTypeName}") .setText(R.id.ownerShipView, "权属单位:${item.deptName}") - .setText(R.id.wellLocationView, "点位置:${item.position}") + .setText(R.id.wellLocationView, "点位位置:${item.position}") .setOnClickListener( R.id.navigationButton, object : View.OnClickListener { override fun onClick(v: View?) { @@ -200,7 +199,7 @@ ) } } - binding.wellListView.adapter = wellListAdapter + binding.recyclerView.adapter = wellListAdapter wellListAdapter.setOnItemClickedListener(object : NormalRecyclerAdapter.OnItemClickedListener { override fun onItemClicked(position: Int, t: WellListModel.DataBean.RowsBean) { diff --git a/app/src/main/java/com/casic/app/smartwell/view/WellMonitorActivity.kt b/app/src/main/java/com/casic/app/smartwell/view/WellMonitorActivity.kt index e3573eb..b87bdb7 100644 --- a/app/src/main/java/com/casic/app/smartwell/view/WellMonitorActivity.kt +++ b/app/src/main/java/com/casic/app/smartwell/view/WellMonitorActivity.kt @@ -11,7 +11,7 @@ import com.pengxh.kt.lite.base.KotlinBaseActivity import com.pengxh.kt.lite.utils.Constant import com.pengxh.kt.lite.utils.LoadState -import com.pengxh.kt.lite.utils.LoadingDialogHub +import com.pengxh.kt.lite.utils.LoadingDialog import com.pengxh.kt.lite.widget.TitleBarView class WellMonitorActivity : KotlinBaseActivity() { @@ -36,7 +36,7 @@ } override fun initOnCreate(savedInstanceState: Bundle?) { - val wellId = intent.getStringExtra(Constant.INTENT_PARAM)!! + val wellId = intent.getStringExtra(Constant.INTENT_PARAM_KEY)!! wellViewModel = ViewModelProvider(this)[WellViewModel::class.java] wellViewModel.getMonitorResult(wellId) wellViewModel.monitorModel.observe(this) { @@ -56,8 +56,8 @@ override fun observeRequestState() { wellViewModel.loadState.observe(this) { when (it) { - is LoadState.Loading -> LoadingDialogHub.show(this, "数据加载中,请稍后") - else -> LoadingDialogHub.dismiss() + is LoadState.Loading -> LoadingDialog.show(this, "数据加载中,请稍后") + else -> LoadingDialog.dismiss() } } } diff --git a/app/src/main/java/com/casic/app/smartwell/view/WellOperationActivity.kt b/app/src/main/java/com/casic/app/smartwell/view/WellOperationActivity.kt index 8d333bf..347ebb6 100644 --- a/app/src/main/java/com/casic/app/smartwell/view/WellOperationActivity.kt +++ b/app/src/main/java/com/casic/app/smartwell/view/WellOperationActivity.kt @@ -23,7 +23,7 @@ import com.pengxh.kt.lite.extensions.navigatePageTo import com.pengxh.kt.lite.extensions.show import com.pengxh.kt.lite.utils.LoadState -import com.pengxh.kt.lite.utils.LoadingDialogHub +import com.pengxh.kt.lite.utils.LoadingDialog import com.pengxh.kt.lite.utils.WeakReferenceHandler import com.pengxh.kt.lite.widget.dialog.AlertControlDialog @@ -109,8 +109,8 @@ } } - binding.operationListView.addItemDecoration( - RecyclerViewItemOffsets(0, 5, 0, 5) + binding.recyclerView.addItemDecoration( + RecyclerViewItemOffsets(0, 7, 0, 7) ) } @@ -123,13 +123,13 @@ override fun observeRequestState() { wellViewModel.loadState.observe(this) { when (it) { - is LoadState.Loading -> LoadingDialogHub.show(this, "处理中,请稍后") + is LoadState.Loading -> LoadingDialog.show(this, "处理中,请稍后") is LoadState.Success -> { - LoadingDialogHub.dismiss() + LoadingDialog.dismiss() wellOperationAdapter.notifyItemChanged(clickedPosition) } - else -> LoadingDialogHub.dismiss() + else -> LoadingDialog.dismiss() } } } @@ -203,24 +203,23 @@ if (item.bfztName == "布防") { viewHolder.setImageResource( R.id.wellStateView, R.drawable.bg_solid_text_green_radius_5 - ).setText(R.id.wellStateView, "撤防") + ).setText(R.id.operationButton, "撤防") } else { viewHolder.setImageResource( R.id.wellStateView, R.drawable.bg_solid_text_red_radius_5 - ).setText(R.id.wellStateView, "布防") + ).setText(R.id.operationButton, "布防") } val deep = if (item.deep.toString().isBlank()) { "未知" } else { item.deep.toString() + "m" } - viewHolder.setText(R.id.wellNameView, item.wellName) + viewHolder.setText(R.id.wellTypeView, item.wellTypeName) .setText(R.id.wellStateView, "已${item.bfztName}") .setText(R.id.wellDepthView, "深:${deep}") .setText(R.id.wellCodeView, "点位编号:${item.wellCode}") - .setText(R.id.wellTypeView, "点位类型:${item.wellTypeName}") .setText(R.id.ownerShipView, "权属单位:${item.deptName}") - .setText(R.id.wellLocationView, "点位置:${item.position}") + .setText(R.id.wellLocationView, "点位位置:${item.position}") .setOnClickListener( R.id.operationButton, object : View.OnClickListener { override fun onClick(v: View?) { @@ -280,7 +279,7 @@ ) } } - binding.operationListView.adapter = wellOperationAdapter + binding.recyclerView.adapter = wellOperationAdapter wellOperationAdapter.setOnItemClickedListener(object : NormalRecyclerAdapter.OnItemClickedListener { override fun onItemClicked(position: Int, t: WellListModel.DataBean.RowsBean) { diff --git a/app/src/main/res/drawable/ic_down.xml b/app/src/main/res/drawable/ic_down.xml index 20e6476..6987e6c 100644 --- a/app/src/main/res/drawable/ic_down.xml +++ b/app/src/main/res/drawable/ic_down.xml @@ -1,6 +1,6 @@ + + diff --git a/app/src/main/res/layout/activity_about_us.xml b/app/src/main/res/layout/activity_about_us.xml index 9091a00..d5fbd0d 100644 --- a/app/src/main/res/layout/activity_about_us.xml +++ b/app/src/main/res/layout/activity_about_us.xml @@ -12,13 +12,7 @@ android:layout_width="match_parent" android:layout_height="wrap_content" android:background="@color/mainThemeColor" - app:tbv_left_image="@drawable/ic_title_left" - app:tbv_only_show_title="false" - app:tbv_show_left_image="true" - app:tbv_show_right_image="false" - app:tbv_text="关于我们" - app:tbv_text_color="@color/white" - app:tbv_text_size="@dimen/sp_18" /> + app:tbv_text="关于我们" /> + app:tbv_text="修改密码" /> + app:tbv_text="布防列表" /> + app:tbv_text="帮助中心" /> + app:tbv_text="工单详情" /> - + + android:value="ee96d8b5e12de3fbb29949efd57418a8" /> () @@ -150,7 +158,7 @@ val cameraPosition = CameraPosition(centerLatLng, 14f, 0f, 0f) val cameraUpdate = CameraUpdateFactory.newCameraPosition(cameraPosition) withContext(Dispatchers.Main) { - LoadingDialogHub.dismiss() + LoadingDialog.dismiss() aMap.animateCamera(cameraUpdate, 1500, null) } } @@ -239,11 +247,6 @@ } override fun initEvent() { - binding.rightOptionView.setOnClickListener { - val x = binding.rightOptionView.width - easyPopupWindow.width - easyPopupWindow.showAsDropDown(binding.rightOptionView, x, 0) - } - //撤防点位 binding.unDeployedLayout.setOnClickListener { requireContext().navigatePageTo() @@ -263,11 +266,11 @@ override fun observeRequestState() { wellViewModel.loadState.observe(this) { when (it) { - is LoadState.Loading -> LoadingDialogHub.show( + is LoadState.Loading -> LoadingDialog.show( requireActivity(), "数据加载中,请稍后..." ) - else -> LoadingDialogHub.dismiss() + else -> LoadingDialog.dismiss() } } } @@ -376,7 +379,7 @@ }).build().show() } }) - infoPopup.showAsDropDown(binding.rightOptionView) +// infoPopup.showAsDropDown(binding.rightOptionView) } override fun onCameraChange(p0: CameraPosition?) { diff --git a/app/src/main/java/com/casic/app/smartwell/fragment/HomePageNoClusterFragment.kt b/app/src/main/java/com/casic/app/smartwell/fragment/HomePageNoClusterFragment.kt index 802426a..b25f743 100644 --- a/app/src/main/java/com/casic/app/smartwell/fragment/HomePageNoClusterFragment.kt +++ b/app/src/main/java/com/casic/app/smartwell/fragment/HomePageNoClusterFragment.kt @@ -38,8 +38,9 @@ import com.pengxh.kt.lite.extensions.navigatePageTo import com.pengxh.kt.lite.extensions.show import com.pengxh.kt.lite.utils.LoadState -import com.pengxh.kt.lite.utils.LoadingDialogHub +import com.pengxh.kt.lite.utils.LoadingDialog import com.pengxh.kt.lite.widget.EasyPopupWindow +import com.pengxh.kt.lite.widget.TitleBarView import com.pengxh.kt.lite.widget.dialog.AlertControlDialog import kotlinx.coroutines.Dispatchers import kotlinx.coroutines.launch @@ -78,7 +79,15 @@ override fun setupTopBarLayout() { binding.rootView.initImmersionBar(this, false, R.color.mainThemeColor) - binding.titleView.text = "首页" + binding.titleView.setOnClickListener(object : TitleBarView.OnClickListener { + override fun onLeftClick() { + + } + + override fun onRightClick() { + easyPopupWindow.showAsDropDown(binding.titleView, binding.titleView.width, 0) + } + }) } override fun initOnCreate(savedInstanceState: Bundle?) { @@ -112,7 +121,7 @@ //渲染井位置 lifecycleScope.launch(Dispatchers.Main) { - LoadingDialogHub.show(requireActivity(), "数据加载中,请稍后") + LoadingDialog.show(requireActivity(), "数据加载中,请稍后") withContext(Dispatchers.IO) { //取Well缓存 val allMarkerOptions = ArrayList() @@ -144,7 +153,7 @@ val cameraPosition = CameraPosition(centerLatLng, 14f, 0f, 0f) val cameraUpdate = CameraUpdateFactory.newCameraPosition(cameraPosition) withContext(Dispatchers.Main) { - LoadingDialogHub.dismiss() + LoadingDialog.dismiss() aMap.animateCamera(cameraUpdate, 1500, null) } } @@ -238,11 +247,6 @@ } override fun initEvent() { - binding.rightOptionView.setOnClickListener { - val x = binding.rightOptionView.width - easyPopupWindow.width - easyPopupWindow.showAsDropDown(binding.rightOptionView, x, 0) - } - //撤防点位 binding.unDeployedLayout.setOnClickListener { requireContext().navigatePageTo() @@ -262,11 +266,11 @@ override fun observeRequestState() { wellViewModel.loadState.observe(this) { when (it) { - is LoadState.Loading -> LoadingDialogHub.show( + is LoadState.Loading -> LoadingDialog.show( requireActivity(), "数据加载中,请稍后..." ) - else -> LoadingDialogHub.dismiss() + else -> LoadingDialog.dismiss() } } } diff --git a/app/src/main/java/com/casic/app/smartwell/fragment/MinePageFragment.kt b/app/src/main/java/com/casic/app/smartwell/fragment/MinePageFragment.kt index 09a570c..dcb48f8 100644 --- a/app/src/main/java/com/casic/app/smartwell/fragment/MinePageFragment.kt +++ b/app/src/main/java/com/casic/app/smartwell/fragment/MinePageFragment.kt @@ -35,7 +35,7 @@ import com.pengxh.kt.lite.utils.ActivityStackManager import com.pengxh.kt.lite.utils.FileDownloadManager import com.pengxh.kt.lite.utils.LoadState -import com.pengxh.kt.lite.utils.LoadingDialogHub +import com.pengxh.kt.lite.utils.LoadingDialog import com.pengxh.kt.lite.widget.dialog.AlertControlDialog import com.pengxh.kt.lite.widget.dialog.BottomActionSheet import kotlinx.coroutines.Dispatchers @@ -60,7 +60,6 @@ override fun setupTopBarLayout() { binding.rootView.initImmersionBar(this, false, R.color.mainThemeColor) - binding.titleInclude.titleView.text = "我的" } override fun initOnCreate(savedInstanceState: Bundle?) { @@ -155,27 +154,27 @@ override fun observeRequestState() { userViewModel.loadState.observe(this) { when (it) { - is LoadState.Loading -> LoadingDialogHub.show( + is LoadState.Loading -> LoadingDialog.show( requireActivity(), "检查版本中,请稍后" ) - else -> LoadingDialogHub.dismiss() + else -> LoadingDialog.dismiss() } } wellViewModel.loadState.observe(this) { when (it) { - is LoadState.Loading -> LoadingDialogHub.show( + is LoadState.Loading -> LoadingDialog.show( requireActivity(), "数据更新中,请稍后" ) is LoadState.Fail -> { - LoadingDialogHub.dismiss() + LoadingDialog.dismiss() "数据更新超时".show(requireContext()) } else -> { - LoadingDialogHub.dismiss() + LoadingDialog.dismiss() AlertControlDialog.Builder().setContext(requireContext()).setTitle("温馨提示") .setMessage("数据更新成功,请重启应用").setNegativeButton("取消") .setPositiveButton("确定").setOnDialogButtonClickListener(object : @@ -197,17 +196,17 @@ lineViewModel.loadState.observe(this) { when (it) { - is LoadState.Loading -> LoadingDialogHub.show( + is LoadState.Loading -> LoadingDialog.show( requireActivity(), "数据更新中,请稍后" ) is LoadState.Fail -> { - LoadingDialogHub.dismiss() + LoadingDialog.dismiss() "数据更新超时".show(requireContext()) } else -> { - LoadingDialogHub.dismiss() + LoadingDialog.dismiss() AlertControlDialog.Builder().setContext(requireContext()).setTitle("温馨提示") .setMessage("数据更新成功,请重启应用").setNegativeButton("取消") .setPositiveButton("确定").setOnDialogButtonClickListener(object : diff --git a/app/src/main/java/com/casic/app/smartwell/fragment/NoticePageFragment.kt b/app/src/main/java/com/casic/app/smartwell/fragment/NoticePageFragment.kt index 171b555..3c93f54 100644 --- a/app/src/main/java/com/casic/app/smartwell/fragment/NoticePageFragment.kt +++ b/app/src/main/java/com/casic/app/smartwell/fragment/NoticePageFragment.kt @@ -48,7 +48,6 @@ override fun setupTopBarLayout() { binding.rootView.initImmersionBar(this, false, R.color.mainThemeColor) - binding.titleInclude.titleView.text = "消息" } override fun initOnCreate(savedInstanceState: Bundle?) { diff --git a/app/src/main/java/com/casic/app/smartwell/fragment/OrderListFragment.kt b/app/src/main/java/com/casic/app/smartwell/fragment/OrderListFragment.kt index 93ff35b..5e38acb 100644 --- a/app/src/main/java/com/casic/app/smartwell/fragment/OrderListFragment.kt +++ b/app/src/main/java/com/casic/app/smartwell/fragment/OrderListFragment.kt @@ -12,6 +12,7 @@ import com.casic.app.smartwell.view.SearchOrderActivity import com.pengxh.kt.lite.base.KotlinBaseFragment import com.pengxh.kt.lite.extensions.navigatePageTo +import com.pengxh.kt.lite.widget.TitleBarView class OrderListFragment : KotlinBaseFragment() { @@ -25,15 +26,22 @@ } override fun initViewBinding( - inflater: LayoutInflater, - container: ViewGroup? + inflater: LayoutInflater, container: ViewGroup? ): FragmentOrderBinding { return FragmentOrderBinding.inflate(inflater, container, false) } override fun setupTopBarLayout() { binding.rootView.initImmersionBar(this, false, R.color.mainThemeColor) - binding.titleView.text = "工单" + binding.titleView.setOnClickListener(object : TitleBarView.OnClickListener { + override fun onLeftClick() { + + } + + override fun onRightClick() { + requireContext().navigatePageTo() + } + }) } override fun initOnCreate(savedInstanceState: Bundle?) { @@ -51,8 +59,6 @@ } override fun initEvent() { - binding.rightOptionView.setOnClickListener { - requireContext().navigatePageTo() - } + } } \ No newline at end of file diff --git a/app/src/main/java/com/casic/app/smartwell/fragment/OrderNotProcessedFragment.kt b/app/src/main/java/com/casic/app/smartwell/fragment/OrderNotProcessedFragment.kt index 0b3d09d..2b6f21d 100644 --- a/app/src/main/java/com/casic/app/smartwell/fragment/OrderNotProcessedFragment.kt +++ b/app/src/main/java/com/casic/app/smartwell/fragment/OrderNotProcessedFragment.kt @@ -18,7 +18,7 @@ import com.pengxh.kt.lite.extensions.navigatePageTo import com.pengxh.kt.lite.extensions.show import com.pengxh.kt.lite.utils.LoadState -import com.pengxh.kt.lite.utils.LoadingDialogHub +import com.pengxh.kt.lite.utils.LoadingDialog import com.pengxh.kt.lite.utils.WeakReferenceHandler import com.pengxh.kt.lite.widget.dialog.AlertControlDialog @@ -78,8 +78,8 @@ operationViewModel = ViewModelProvider(this)[OperationViewModel::class.java] - binding.notProcessedView.addItemDecoration( - RecyclerViewItemOffsets(0, 5, 0, 5) + binding.recyclerView.addItemDecoration( + RecyclerViewItemOffsets(0, 7, 0, 7) ) } @@ -87,9 +87,9 @@ //接单状态处理 operationViewModel.loadState.observe(this) { when (it) { - is LoadState.Loading -> LoadingDialogHub.show(requireActivity(), "接单中,请稍后") + is LoadState.Loading -> LoadingDialog.show(requireActivity(), "接单中,请稍后") is LoadState.Success -> { - LoadingDialogHub.dismiss() + LoadingDialog.dismiss() //接单成功之后刷新列表 dataBeans.removeAt(clickedPosition) notProcessedAdapter.notifyItemRemoved(clickedPosition) @@ -98,7 +98,7 @@ ) } - else -> LoadingDialogHub.dismiss() + else -> LoadingDialog.dismiss() } } } @@ -131,7 +131,7 @@ } else { binding.emptyInclude.emptyView.hide() notProcessedAdapter = OrderNotProcessedAdapter(requireContext(), dataBeans) - binding.notProcessedView.adapter = notProcessedAdapter + binding.recyclerView.adapter = notProcessedAdapter notProcessedAdapter.setOnItemClickListener(object : OrderNotProcessedAdapter.OnItemClickListener { override fun onClicked(position: Int) { diff --git a/app/src/main/java/com/casic/app/smartwell/fragment/OvertimeNotAcceptFragment.kt b/app/src/main/java/com/casic/app/smartwell/fragment/OvertimeNotAcceptFragment.kt index a198545..9b318ca 100644 --- a/app/src/main/java/com/casic/app/smartwell/fragment/OvertimeNotAcceptFragment.kt +++ b/app/src/main/java/com/casic/app/smartwell/fragment/OvertimeNotAcceptFragment.kt @@ -18,7 +18,7 @@ import com.pengxh.kt.lite.extensions.navigatePageTo import com.pengxh.kt.lite.extensions.show import com.pengxh.kt.lite.utils.LoadState -import com.pengxh.kt.lite.utils.LoadingDialogHub +import com.pengxh.kt.lite.utils.LoadingDialog import com.pengxh.kt.lite.utils.WeakReferenceHandler import com.pengxh.kt.lite.widget.dialog.AlertControlDialog @@ -81,8 +81,8 @@ operationViewModel = ViewModelProvider(this)[OperationViewModel::class.java] - binding.notProcessedView.addItemDecoration( - RecyclerViewItemOffsets(0, 5, 0, 5) + binding.recyclerView.addItemDecoration( + RecyclerViewItemOffsets(0, 7, 0, 7) ) } @@ -90,9 +90,9 @@ //接单状态处理 operationViewModel.loadState.observe(this) { when (it) { - is LoadState.Loading -> LoadingDialogHub.show(requireActivity(), "接单中,请稍后") + is LoadState.Loading -> LoadingDialog.show(requireActivity(), "接单中,请稍后") is LoadState.Success -> { - LoadingDialogHub.dismiss() + LoadingDialog.dismiss() //接单成功之后刷新列表 dataBeans.removeAt(clickedPosition) notProcessedAdapter.notifyItemRemoved(clickedPosition) @@ -101,7 +101,7 @@ ) } - else -> LoadingDialogHub.dismiss() + else -> LoadingDialog.dismiss() } } } @@ -134,7 +134,7 @@ } else { binding.emptyInclude.emptyView.hide() notProcessedAdapter = OrderNotProcessedAdapter(requireContext(), dataBeans) - binding.notProcessedView.adapter = notProcessedAdapter + binding.recyclerView.adapter = notProcessedAdapter notProcessedAdapter.setOnItemClickListener(object : OrderNotProcessedAdapter.OnItemClickListener { override fun onClicked(position: Int) { diff --git a/app/src/main/java/com/casic/app/smartwell/greendao/DaoMaster.java b/app/src/main/java/com/casic/app/smartwell/greendao/DaoMaster.java index fdcf3a7..1e52b74 100644 --- a/app/src/main/java/com/casic/app/smartwell/greendao/DaoMaster.java +++ b/app/src/main/java/com/casic/app/smartwell/greendao/DaoMaster.java @@ -13,25 +13,20 @@ // THIS CODE IS GENERATED BY greenDAO, DO NOT EDIT. - /** * Master of DAO (schema version 4): knows all DAOs. */ public class DaoMaster extends AbstractDaoMaster { public static final int SCHEMA_VERSION = 4; - /** - * Creates underlying database table using DAOs. - */ + /** Creates underlying database table using DAOs. */ public static void createAllTables(Database db, boolean ifNotExists) { MapWellLocalBeanDao.createTable(db, ifNotExists); NoticeLocaleBeanDao.createTable(db, ifNotExists); PipeLocalBeanDao.createTable(db, ifNotExists); } - /** - * Drops underlying database table using DAOs. - */ + /** Drops underlying database table using DAOs. */ public static void dropAllTables(Database db, boolean ifExists) { MapWellLocalBeanDao.dropTable(db, ifExists); NoticeLocaleBeanDao.dropTable(db, ifExists); @@ -86,9 +81,7 @@ } } - /** - * WARNING: Drops all table on Upgrade! Use only during development. - */ + /** WARNING: Drops all table on Upgrade! Use only during development. */ public static class DevOpenHelper extends OpenHelper { public DevOpenHelper(Context context, String name) { super(context, name); diff --git a/app/src/main/java/com/casic/app/smartwell/greendao/DaoSession.java b/app/src/main/java/com/casic/app/smartwell/greendao/DaoSession.java index 0b36d17..3e40e3b 100644 --- a/app/src/main/java/com/casic/app/smartwell/greendao/DaoSession.java +++ b/app/src/main/java/com/casic/app/smartwell/greendao/DaoSession.java @@ -16,7 +16,7 @@ /** * {@inheritDoc} - * + * * @see org.greenrobot.greendao.AbstractDaoSession */ public class DaoSession extends AbstractDaoSession { @@ -50,7 +50,7 @@ registerDao(NoticeLocaleBean.class, noticeLocaleBeanDao); registerDao(PipeLocalBean.class, pipeLocalBeanDao); } - + public void clear() { mapWellLocalBeanDaoConfig.clearIdentityScope(); noticeLocaleBeanDaoConfig.clearIdentityScope(); diff --git a/app/src/main/java/com/casic/app/smartwell/greendao/MapWellLocalBeanDao.java b/app/src/main/java/com/casic/app/smartwell/greendao/MapWellLocalBeanDao.java index 8908fda..407bc92 100644 --- a/app/src/main/java/com/casic/app/smartwell/greendao/MapWellLocalBeanDao.java +++ b/app/src/main/java/com/casic/app/smartwell/greendao/MapWellLocalBeanDao.java @@ -12,10 +12,9 @@ import org.greenrobot.greendao.internal.DaoConfig; // THIS CODE IS GENERATED BY greenDAO, DO NOT EDIT. - -/** +/** * DAO for table "MAP_WELL_LOCAL_BEAN". - */ +*/ public class MapWellLocalBeanDao extends AbstractDao { public static final String TABLENAME = "MAP_WELL_LOCAL_BEAN"; @@ -57,16 +56,14 @@ public MapWellLocalBeanDao(DaoConfig config) { super(config); } - + public MapWellLocalBeanDao(DaoConfig config, DaoSession daoSession) { super(config, daoSession); } - /** - * Creates the underlying database table. - */ + /** Creates the underlying database table. */ public static void createTable(Database db, boolean ifNotExists) { - String constraint = ifNotExists ? "IF NOT EXISTS " : ""; + String constraint = ifNotExists? "IF NOT EXISTS ": ""; db.execSQL("CREATE TABLE " + constraint + "\"MAP_WELL_LOCAL_BEAN\" (" + // "\"_id\" INTEGER PRIMARY KEY AUTOINCREMENT ," + // 0: kId "\"AREA\" TEXT," + // 1: area @@ -96,9 +93,7 @@ "\"WELL_TYPE_NAME\" TEXT);"); // 25: wellTypeName } - /** - * Drops the underlying database table. - */ + /** Drops the underlying database table. */ public static void dropTable(Database db, boolean ifExists) { String sql = "DROP TABLE " + (ifExists ? "IF EXISTS " : "") + "\"MAP_WELL_LOCAL_BEAN\""; db.execSQL(sql); @@ -107,132 +102,132 @@ @Override protected final void bindValues(DatabaseStatement stmt, MapWellLocalBean entity) { stmt.clearBindings(); - + Long kId = entity.getKId(); if (kId != null) { stmt.bindLong(1, kId); } - + String area = entity.getArea(); if (area != null) { stmt.bindString(2, area); } - + String bfzt = entity.getBfzt(); if (bfzt != null) { stmt.bindString(3, bfzt); } - + String bfztName = entity.getBfztName(); if (bfztName != null) { stmt.bindString(4, bfztName); } - + String coordinateX = entity.getCoordinateX(); if (coordinateX != null) { stmt.bindString(5, coordinateX); } - + String coordinateY = entity.getCoordinateY(); if (coordinateY != null) { stmt.bindString(6, coordinateY); } - + String deep = entity.getDeep(); if (deep != null) { stmt.bindString(7, deep); } - + String deptName = entity.getDeptName(); if (deptName != null) { stmt.bindString(8, deptName); } - + String deptid = entity.getDeptid(); if (deptid != null) { stmt.bindString(9, deptid); } - + String id = entity.getId(); if (id != null) { stmt.bindString(10, id); } - + String latBaidu = entity.getLatBaidu(); if (latBaidu != null) { stmt.bindString(11, latBaidu); } - + String latGaode = entity.getLatGaode(); if (latGaode != null) { stmt.bindString(12, latGaode); } - + String lngBaidu = entity.getLngBaidu(); if (lngBaidu != null) { stmt.bindString(13, lngBaidu); } - + String lngGaode = entity.getLngGaode(); if (lngGaode != null) { stmt.bindString(14, lngGaode); } - + String notes = entity.getNotes(); if (notes != null) { stmt.bindString(15, notes); } - + String photos = entity.getPhotos(); if (photos != null) { stmt.bindString(16, photos); } - + String position = entity.getPosition(); if (position != null) { stmt.bindString(17, position); } - + String staff = entity.getStaff(); if (staff != null) { stmt.bindString(18, staff); } - + String tel = entity.getTel(); if (tel != null) { stmt.bindString(19, tel); } - + String ts = entity.getTs(); if (ts != null) { stmt.bindString(20, ts); } - + String valid = entity.getValid(); if (valid != null) { stmt.bindString(21, valid); } - + String watchData = entity.getWatchData(); if (watchData != null) { stmt.bindString(22, watchData); } - + String wellCode = entity.getWellCode(); if (wellCode != null) { stmt.bindString(23, wellCode); } - + String wellName = entity.getWellName(); if (wellName != null) { stmt.bindString(24, wellName); } - + String wellType = entity.getWellType(); if (wellType != null) { stmt.bindString(25, wellType); } - + String wellTypeName = entity.getWellTypeName(); if (wellTypeName != null) { stmt.bindString(26, wellTypeName); @@ -242,132 +237,132 @@ @Override protected final void bindValues(SQLiteStatement stmt, MapWellLocalBean entity) { stmt.clearBindings(); - + Long kId = entity.getKId(); if (kId != null) { stmt.bindLong(1, kId); } - + String area = entity.getArea(); if (area != null) { stmt.bindString(2, area); } - + String bfzt = entity.getBfzt(); if (bfzt != null) { stmt.bindString(3, bfzt); } - + String bfztName = entity.getBfztName(); if (bfztName != null) { stmt.bindString(4, bfztName); } - + String coordinateX = entity.getCoordinateX(); if (coordinateX != null) { stmt.bindString(5, coordinateX); } - + String coordinateY = entity.getCoordinateY(); if (coordinateY != null) { stmt.bindString(6, coordinateY); } - + String deep = entity.getDeep(); if (deep != null) { stmt.bindString(7, deep); } - + String deptName = entity.getDeptName(); if (deptName != null) { stmt.bindString(8, deptName); } - + String deptid = entity.getDeptid(); if (deptid != null) { stmt.bindString(9, deptid); } - + String id = entity.getId(); if (id != null) { stmt.bindString(10, id); } - + String latBaidu = entity.getLatBaidu(); if (latBaidu != null) { stmt.bindString(11, latBaidu); } - + String latGaode = entity.getLatGaode(); if (latGaode != null) { stmt.bindString(12, latGaode); } - + String lngBaidu = entity.getLngBaidu(); if (lngBaidu != null) { stmt.bindString(13, lngBaidu); } - + String lngGaode = entity.getLngGaode(); if (lngGaode != null) { stmt.bindString(14, lngGaode); } - + String notes = entity.getNotes(); if (notes != null) { stmt.bindString(15, notes); } - + String photos = entity.getPhotos(); if (photos != null) { stmt.bindString(16, photos); } - + String position = entity.getPosition(); if (position != null) { stmt.bindString(17, position); } - + String staff = entity.getStaff(); if (staff != null) { stmt.bindString(18, staff); } - + String tel = entity.getTel(); if (tel != null) { stmt.bindString(19, tel); } - + String ts = entity.getTs(); if (ts != null) { stmt.bindString(20, ts); } - + String valid = entity.getValid(); if (valid != null) { stmt.bindString(21, valid); } - + String watchData = entity.getWatchData(); if (watchData != null) { stmt.bindString(22, watchData); } - + String wellCode = entity.getWellCode(); if (wellCode != null) { stmt.bindString(23, wellCode); } - + String wellName = entity.getWellName(); if (wellName != null) { stmt.bindString(24, wellName); } - + String wellType = entity.getWellType(); if (wellType != null) { stmt.bindString(25, wellType); } - + String wellTypeName = entity.getWellTypeName(); if (wellTypeName != null) { stmt.bindString(26, wellTypeName); @@ -377,41 +372,41 @@ @Override public Long readKey(Cursor cursor, int offset) { return cursor.isNull(offset + 0) ? null : cursor.getLong(offset + 0); - } + } @Override public MapWellLocalBean readEntity(Cursor cursor, int offset) { MapWellLocalBean entity = new MapWellLocalBean( // - cursor.isNull(offset + 0) ? null : cursor.getLong(offset + 0), // kId - cursor.isNull(offset + 1) ? null : cursor.getString(offset + 1), // area - cursor.isNull(offset + 2) ? null : cursor.getString(offset + 2), // bfzt - cursor.isNull(offset + 3) ? null : cursor.getString(offset + 3), // bfztName - cursor.isNull(offset + 4) ? null : cursor.getString(offset + 4), // coordinateX - cursor.isNull(offset + 5) ? null : cursor.getString(offset + 5), // coordinateY - cursor.isNull(offset + 6) ? null : cursor.getString(offset + 6), // deep - cursor.isNull(offset + 7) ? null : cursor.getString(offset + 7), // deptName - cursor.isNull(offset + 8) ? null : cursor.getString(offset + 8), // deptid - cursor.isNull(offset + 9) ? null : cursor.getString(offset + 9), // id - cursor.isNull(offset + 10) ? null : cursor.getString(offset + 10), // latBaidu - cursor.isNull(offset + 11) ? null : cursor.getString(offset + 11), // latGaode - cursor.isNull(offset + 12) ? null : cursor.getString(offset + 12), // lngBaidu - cursor.isNull(offset + 13) ? null : cursor.getString(offset + 13), // lngGaode - cursor.isNull(offset + 14) ? null : cursor.getString(offset + 14), // notes - cursor.isNull(offset + 15) ? null : cursor.getString(offset + 15), // photos - cursor.isNull(offset + 16) ? null : cursor.getString(offset + 16), // position - cursor.isNull(offset + 17) ? null : cursor.getString(offset + 17), // staff - cursor.isNull(offset + 18) ? null : cursor.getString(offset + 18), // tel - cursor.isNull(offset + 19) ? null : cursor.getString(offset + 19), // ts - cursor.isNull(offset + 20) ? null : cursor.getString(offset + 20), // valid - cursor.isNull(offset + 21) ? null : cursor.getString(offset + 21), // watchData - cursor.isNull(offset + 22) ? null : cursor.getString(offset + 22), // wellCode - cursor.isNull(offset + 23) ? null : cursor.getString(offset + 23), // wellName - cursor.isNull(offset + 24) ? null : cursor.getString(offset + 24), // wellType - cursor.isNull(offset + 25) ? null : cursor.getString(offset + 25) // wellTypeName + cursor.isNull(offset + 0) ? null : cursor.getLong(offset + 0), // kId + cursor.isNull(offset + 1) ? null : cursor.getString(offset + 1), // area + cursor.isNull(offset + 2) ? null : cursor.getString(offset + 2), // bfzt + cursor.isNull(offset + 3) ? null : cursor.getString(offset + 3), // bfztName + cursor.isNull(offset + 4) ? null : cursor.getString(offset + 4), // coordinateX + cursor.isNull(offset + 5) ? null : cursor.getString(offset + 5), // coordinateY + cursor.isNull(offset + 6) ? null : cursor.getString(offset + 6), // deep + cursor.isNull(offset + 7) ? null : cursor.getString(offset + 7), // deptName + cursor.isNull(offset + 8) ? null : cursor.getString(offset + 8), // deptid + cursor.isNull(offset + 9) ? null : cursor.getString(offset + 9), // id + cursor.isNull(offset + 10) ? null : cursor.getString(offset + 10), // latBaidu + cursor.isNull(offset + 11) ? null : cursor.getString(offset + 11), // latGaode + cursor.isNull(offset + 12) ? null : cursor.getString(offset + 12), // lngBaidu + cursor.isNull(offset + 13) ? null : cursor.getString(offset + 13), // lngGaode + cursor.isNull(offset + 14) ? null : cursor.getString(offset + 14), // notes + cursor.isNull(offset + 15) ? null : cursor.getString(offset + 15), // photos + cursor.isNull(offset + 16) ? null : cursor.getString(offset + 16), // position + cursor.isNull(offset + 17) ? null : cursor.getString(offset + 17), // staff + cursor.isNull(offset + 18) ? null : cursor.getString(offset + 18), // tel + cursor.isNull(offset + 19) ? null : cursor.getString(offset + 19), // ts + cursor.isNull(offset + 20) ? null : cursor.getString(offset + 20), // valid + cursor.isNull(offset + 21) ? null : cursor.getString(offset + 21), // watchData + cursor.isNull(offset + 22) ? null : cursor.getString(offset + 22), // wellCode + cursor.isNull(offset + 23) ? null : cursor.getString(offset + 23), // wellName + cursor.isNull(offset + 24) ? null : cursor.getString(offset + 24), // wellType + cursor.isNull(offset + 25) ? null : cursor.getString(offset + 25) // wellTypeName ); return entity; } - + @Override public void readEntity(Cursor cursor, MapWellLocalBean entity, int offset) { entity.setKId(cursor.isNull(offset + 0) ? null : cursor.getLong(offset + 0)); @@ -440,17 +435,17 @@ entity.setWellName(cursor.isNull(offset + 23) ? null : cursor.getString(offset + 23)); entity.setWellType(cursor.isNull(offset + 24) ? null : cursor.getString(offset + 24)); entity.setWellTypeName(cursor.isNull(offset + 25) ? null : cursor.getString(offset + 25)); - } - + } + @Override protected final Long updateKeyAfterInsert(MapWellLocalBean entity, long rowId) { entity.setKId(rowId); return rowId; } - + @Override public Long getKey(MapWellLocalBean entity) { - if (entity != null) { + if(entity != null) { return entity.getKId(); } else { return null; @@ -466,5 +461,5 @@ protected final boolean isEntityUpdateable() { return true; } - + } diff --git a/app/src/main/java/com/casic/app/smartwell/greendao/NoticeLocaleBeanDao.java b/app/src/main/java/com/casic/app/smartwell/greendao/NoticeLocaleBeanDao.java index 64312ed..deb2d49 100644 --- a/app/src/main/java/com/casic/app/smartwell/greendao/NoticeLocaleBeanDao.java +++ b/app/src/main/java/com/casic/app/smartwell/greendao/NoticeLocaleBeanDao.java @@ -12,10 +12,9 @@ import org.greenrobot.greendao.internal.DaoConfig; // THIS CODE IS GENERATED BY greenDAO, DO NOT EDIT. - -/** +/** * DAO for table "NOTICE_LOCALE_BEAN". - */ +*/ public class NoticeLocaleBeanDao extends AbstractDao { public static final String TABLENAME = "NOTICE_LOCALE_BEAN"; @@ -43,16 +42,14 @@ public NoticeLocaleBeanDao(DaoConfig config) { super(config); } - + public NoticeLocaleBeanDao(DaoConfig config, DaoSession daoSession) { super(config, daoSession); } - /** - * Creates the underlying database table. - */ + /** Creates the underlying database table. */ public static void createTable(Database db, boolean ifNotExists) { - String constraint = ifNotExists ? "IF NOT EXISTS " : ""; + String constraint = ifNotExists? "IF NOT EXISTS ": ""; db.execSQL("CREATE TABLE " + constraint + "\"NOTICE_LOCALE_BEAN\" (" + // "\"_id\" INTEGER PRIMARY KEY AUTOINCREMENT ," + // 0: id "\"MESSAGE_ID\" TEXT UNIQUE ," + // 1: messageId @@ -68,9 +65,7 @@ "\"NOTICE_TIME\" TEXT);"); // 11: noticeTime } - /** - * Drops the underlying database table. - */ + /** Drops the underlying database table. */ public static void dropTable(Database db, boolean ifExists) { String sql = "DROP TABLE " + (ifExists ? "IF EXISTS " : "") + "\"NOTICE_LOCALE_BEAN\""; db.execSQL(sql); @@ -79,62 +74,62 @@ @Override protected final void bindValues(DatabaseStatement stmt, NoticeLocaleBean entity) { stmt.clearBindings(); - + Long id = entity.getId(); if (id != null) { stmt.bindLong(1, id); } - + String messageId = entity.getMessageId(); if (messageId != null) { stmt.bindString(2, messageId); } - + String appid = entity.getAppid(); if (appid != null) { stmt.bindString(3, appid); } - + String clientId = entity.getClientId(); if (clientId != null) { stmt.bindString(4, clientId); } - + String taskId = entity.getTaskId(); if (taskId != null) { stmt.bindString(5, taskId); } - + String userId = entity.getUserId(); if (userId != null) { stmt.bindString(6, userId); } - + String title = entity.getTitle(); if (title != null) { stmt.bindString(7, title); } - + String content = entity.getContent(); if (content != null) { stmt.bindString(8, content); } - + String deviceCode = entity.getDeviceCode(); if (deviceCode != null) { stmt.bindString(9, deviceCode); } - + String jobId = entity.getJobId(); if (jobId != null) { stmt.bindString(10, jobId); } - + String isRead = entity.getIsRead(); if (isRead != null) { stmt.bindString(11, isRead); } - + String noticeTime = entity.getNoticeTime(); if (noticeTime != null) { stmt.bindString(12, noticeTime); @@ -144,62 +139,62 @@ @Override protected final void bindValues(SQLiteStatement stmt, NoticeLocaleBean entity) { stmt.clearBindings(); - + Long id = entity.getId(); if (id != null) { stmt.bindLong(1, id); } - + String messageId = entity.getMessageId(); if (messageId != null) { stmt.bindString(2, messageId); } - + String appid = entity.getAppid(); if (appid != null) { stmt.bindString(3, appid); } - + String clientId = entity.getClientId(); if (clientId != null) { stmt.bindString(4, clientId); } - + String taskId = entity.getTaskId(); if (taskId != null) { stmt.bindString(5, taskId); } - + String userId = entity.getUserId(); if (userId != null) { stmt.bindString(6, userId); } - + String title = entity.getTitle(); if (title != null) { stmt.bindString(7, title); } - + String content = entity.getContent(); if (content != null) { stmt.bindString(8, content); } - + String deviceCode = entity.getDeviceCode(); if (deviceCode != null) { stmt.bindString(9, deviceCode); } - + String jobId = entity.getJobId(); if (jobId != null) { stmt.bindString(10, jobId); } - + String isRead = entity.getIsRead(); if (isRead != null) { stmt.bindString(11, isRead); } - + String noticeTime = entity.getNoticeTime(); if (noticeTime != null) { stmt.bindString(12, noticeTime); @@ -209,27 +204,27 @@ @Override public Long readKey(Cursor cursor, int offset) { return cursor.isNull(offset + 0) ? null : cursor.getLong(offset + 0); - } + } @Override public NoticeLocaleBean readEntity(Cursor cursor, int offset) { NoticeLocaleBean entity = new NoticeLocaleBean( // - cursor.isNull(offset + 0) ? null : cursor.getLong(offset + 0), // id - cursor.isNull(offset + 1) ? null : cursor.getString(offset + 1), // messageId - cursor.isNull(offset + 2) ? null : cursor.getString(offset + 2), // appid - cursor.isNull(offset + 3) ? null : cursor.getString(offset + 3), // clientId - cursor.isNull(offset + 4) ? null : cursor.getString(offset + 4), // taskId - cursor.isNull(offset + 5) ? null : cursor.getString(offset + 5), // userId - cursor.isNull(offset + 6) ? null : cursor.getString(offset + 6), // title - cursor.isNull(offset + 7) ? null : cursor.getString(offset + 7), // content - cursor.isNull(offset + 8) ? null : cursor.getString(offset + 8), // deviceCode - cursor.isNull(offset + 9) ? null : cursor.getString(offset + 9), // jobId - cursor.isNull(offset + 10) ? null : cursor.getString(offset + 10), // isRead - cursor.isNull(offset + 11) ? null : cursor.getString(offset + 11) // noticeTime + cursor.isNull(offset + 0) ? null : cursor.getLong(offset + 0), // id + cursor.isNull(offset + 1) ? null : cursor.getString(offset + 1), // messageId + cursor.isNull(offset + 2) ? null : cursor.getString(offset + 2), // appid + cursor.isNull(offset + 3) ? null : cursor.getString(offset + 3), // clientId + cursor.isNull(offset + 4) ? null : cursor.getString(offset + 4), // taskId + cursor.isNull(offset + 5) ? null : cursor.getString(offset + 5), // userId + cursor.isNull(offset + 6) ? null : cursor.getString(offset + 6), // title + cursor.isNull(offset + 7) ? null : cursor.getString(offset + 7), // content + cursor.isNull(offset + 8) ? null : cursor.getString(offset + 8), // deviceCode + cursor.isNull(offset + 9) ? null : cursor.getString(offset + 9), // jobId + cursor.isNull(offset + 10) ? null : cursor.getString(offset + 10), // isRead + cursor.isNull(offset + 11) ? null : cursor.getString(offset + 11) // noticeTime ); return entity; } - + @Override public void readEntity(Cursor cursor, NoticeLocaleBean entity, int offset) { entity.setId(cursor.isNull(offset + 0) ? null : cursor.getLong(offset + 0)); @@ -244,17 +239,17 @@ entity.setJobId(cursor.isNull(offset + 9) ? null : cursor.getString(offset + 9)); entity.setIsRead(cursor.isNull(offset + 10) ? null : cursor.getString(offset + 10)); entity.setNoticeTime(cursor.isNull(offset + 11) ? null : cursor.getString(offset + 11)); - } - + } + @Override protected final Long updateKeyAfterInsert(NoticeLocaleBean entity, long rowId) { entity.setId(rowId); return rowId; } - + @Override public Long getKey(NoticeLocaleBean entity) { - if (entity != null) { + if(entity != null) { return entity.getId(); } else { return null; @@ -270,5 +265,5 @@ protected final boolean isEntityUpdateable() { return true; } - + } diff --git a/app/src/main/java/com/casic/app/smartwell/greendao/PipeLocalBeanDao.java b/app/src/main/java/com/casic/app/smartwell/greendao/PipeLocalBeanDao.java index aab4d3f..df5515a 100644 --- a/app/src/main/java/com/casic/app/smartwell/greendao/PipeLocalBeanDao.java +++ b/app/src/main/java/com/casic/app/smartwell/greendao/PipeLocalBeanDao.java @@ -12,10 +12,9 @@ import org.greenrobot.greendao.internal.DaoConfig; // THIS CODE IS GENERATED BY greenDAO, DO NOT EDIT. - -/** +/** * DAO for table "PIPE_LOCAL_BEAN". - */ +*/ public class PipeLocalBeanDao extends AbstractDao { public static final String TABLENAME = "PIPE_LOCAL_BEAN"; @@ -37,16 +36,14 @@ public PipeLocalBeanDao(DaoConfig config) { super(config); } - + public PipeLocalBeanDao(DaoConfig config, DaoSession daoSession) { super(config, daoSession); } - /** - * Creates the underlying database table. - */ + /** Creates the underlying database table. */ public static void createTable(Database db, boolean ifNotExists) { - String constraint = ifNotExists ? "IF NOT EXISTS " : ""; + String constraint = ifNotExists? "IF NOT EXISTS ": ""; db.execSQL("CREATE TABLE " + constraint + "\"PIPE_LOCAL_BEAN\" (" + // "\"_id\" INTEGER PRIMARY KEY AUTOINCREMENT ," + // 0: id "\"PIPE_CODE\" TEXT," + // 1: pipeCode @@ -56,9 +53,7 @@ "\"START_LONGITUDE_GD\" TEXT);"); // 5: startLongitudeGd } - /** - * Drops the underlying database table. - */ + /** Drops the underlying database table. */ public static void dropTable(Database db, boolean ifExists) { String sql = "DROP TABLE " + (ifExists ? "IF EXISTS " : "") + "\"PIPE_LOCAL_BEAN\""; db.execSQL(sql); @@ -67,32 +62,32 @@ @Override protected final void bindValues(DatabaseStatement stmt, PipeLocalBean entity) { stmt.clearBindings(); - + Long id = entity.getId(); if (id != null) { stmt.bindLong(1, id); } - + String pipeCode = entity.getPipeCode(); if (pipeCode != null) { stmt.bindString(2, pipeCode); } - + String endLatitudeGd = entity.getEndLatitudeGd(); if (endLatitudeGd != null) { stmt.bindString(3, endLatitudeGd); } - + String endLongitudeGd = entity.getEndLongitudeGd(); if (endLongitudeGd != null) { stmt.bindString(4, endLongitudeGd); } - + String startLatitudeGd = entity.getStartLatitudeGd(); if (startLatitudeGd != null) { stmt.bindString(5, startLatitudeGd); } - + String startLongitudeGd = entity.getStartLongitudeGd(); if (startLongitudeGd != null) { stmt.bindString(6, startLongitudeGd); @@ -102,32 +97,32 @@ @Override protected final void bindValues(SQLiteStatement stmt, PipeLocalBean entity) { stmt.clearBindings(); - + Long id = entity.getId(); if (id != null) { stmt.bindLong(1, id); } - + String pipeCode = entity.getPipeCode(); if (pipeCode != null) { stmt.bindString(2, pipeCode); } - + String endLatitudeGd = entity.getEndLatitudeGd(); if (endLatitudeGd != null) { stmt.bindString(3, endLatitudeGd); } - + String endLongitudeGd = entity.getEndLongitudeGd(); if (endLongitudeGd != null) { stmt.bindString(4, endLongitudeGd); } - + String startLatitudeGd = entity.getStartLatitudeGd(); if (startLatitudeGd != null) { stmt.bindString(5, startLatitudeGd); } - + String startLongitudeGd = entity.getStartLongitudeGd(); if (startLongitudeGd != null) { stmt.bindString(6, startLongitudeGd); @@ -137,21 +132,21 @@ @Override public Long readKey(Cursor cursor, int offset) { return cursor.isNull(offset + 0) ? null : cursor.getLong(offset + 0); - } + } @Override public PipeLocalBean readEntity(Cursor cursor, int offset) { PipeLocalBean entity = new PipeLocalBean( // - cursor.isNull(offset + 0) ? null : cursor.getLong(offset + 0), // id - cursor.isNull(offset + 1) ? null : cursor.getString(offset + 1), // pipeCode - cursor.isNull(offset + 2) ? null : cursor.getString(offset + 2), // endLatitudeGd - cursor.isNull(offset + 3) ? null : cursor.getString(offset + 3), // endLongitudeGd - cursor.isNull(offset + 4) ? null : cursor.getString(offset + 4), // startLatitudeGd - cursor.isNull(offset + 5) ? null : cursor.getString(offset + 5) // startLongitudeGd + cursor.isNull(offset + 0) ? null : cursor.getLong(offset + 0), // id + cursor.isNull(offset + 1) ? null : cursor.getString(offset + 1), // pipeCode + cursor.isNull(offset + 2) ? null : cursor.getString(offset + 2), // endLatitudeGd + cursor.isNull(offset + 3) ? null : cursor.getString(offset + 3), // endLongitudeGd + cursor.isNull(offset + 4) ? null : cursor.getString(offset + 4), // startLatitudeGd + cursor.isNull(offset + 5) ? null : cursor.getString(offset + 5) // startLongitudeGd ); return entity; } - + @Override public void readEntity(Cursor cursor, PipeLocalBean entity, int offset) { entity.setId(cursor.isNull(offset + 0) ? null : cursor.getLong(offset + 0)); @@ -160,17 +155,17 @@ entity.setEndLongitudeGd(cursor.isNull(offset + 3) ? null : cursor.getString(offset + 3)); entity.setStartLatitudeGd(cursor.isNull(offset + 4) ? null : cursor.getString(offset + 4)); entity.setStartLongitudeGd(cursor.isNull(offset + 5) ? null : cursor.getString(offset + 5)); - } - + } + @Override protected final Long updateKeyAfterInsert(PipeLocalBean entity, long rowId) { entity.setId(rowId); return rowId; } - + @Override public Long getKey(PipeLocalBean entity) { - if (entity != null) { + if(entity != null) { return entity.getId(); } else { return null; @@ -186,5 +181,5 @@ protected final boolean isEntityUpdateable() { return true; } - + } diff --git a/app/src/main/java/com/casic/app/smartwell/view/ChangePasswordActivity.kt b/app/src/main/java/com/casic/app/smartwell/view/ChangePasswordActivity.kt index 8e41039..9f1dd40 100644 --- a/app/src/main/java/com/casic/app/smartwell/view/ChangePasswordActivity.kt +++ b/app/src/main/java/com/casic/app/smartwell/view/ChangePasswordActivity.kt @@ -14,7 +14,7 @@ import com.pengxh.kt.lite.extensions.show import com.pengxh.kt.lite.utils.ActivityStackManager import com.pengxh.kt.lite.utils.LoadState -import com.pengxh.kt.lite.utils.LoadingDialogHub +import com.pengxh.kt.lite.utils.LoadingDialog import com.pengxh.kt.lite.widget.TitleBarView import java.nio.charset.StandardCharsets @@ -46,15 +46,15 @@ override fun observeRequestState() { userViewModel.loadState.observe(this) { when (it) { - is LoadState.Loading -> LoadingDialogHub.show(this, "修改中,请稍后") + is LoadState.Loading -> LoadingDialog.show(this, "修改中,请稍后") is LoadState.Success -> { - LoadingDialogHub.dismiss() + LoadingDialog.dismiss() AuthenticationHelper.removeToken() this.navigatePageTo() ActivityStackManager.finishAllActivity() } - else -> LoadingDialogHub.dismiss() + else -> LoadingDialog.dismiss() } } } diff --git a/app/src/main/java/com/casic/app/smartwell/view/DeployedWellActivity.kt b/app/src/main/java/com/casic/app/smartwell/view/DeployedWellActivity.kt index fb4339c..28a5078 100644 --- a/app/src/main/java/com/casic/app/smartwell/view/DeployedWellActivity.kt +++ b/app/src/main/java/com/casic/app/smartwell/view/DeployedWellActivity.kt @@ -83,8 +83,8 @@ } //添加分割线 - binding.deployedListView.addItemDecoration( - RecyclerViewItemOffsets(0, 5, 0, 5) + binding.recyclerView.addItemDecoration( + RecyclerViewItemOffsets(0, 7, 0, 7) ) } @@ -149,12 +149,11 @@ } else { item.deep.toString() + "m" } - viewHolder.setText(R.id.wellNameView, item.wellName) + viewHolder.setText(R.id.wellTypeView, item.wellTypeName) .setText(R.id.wellDepthView, "深:${deep}") .setText(R.id.wellCodeView, "点位编号:${item.wellCode}") - .setText(R.id.wellTypeView, "点位类型:${item.wellTypeName}") .setText(R.id.ownerShipView, "权属单位:${item.deptName}") - .setText(R.id.wellLocationView, "点位置:${item.position}") + .setText(R.id.wellLocationView, "点位位置:${item.position}") .setOnClickListener( R.id.operationButton, object : View.OnClickListener { override fun onClick(v: View?) { @@ -207,7 +206,7 @@ }) } } - binding.deployedListView.adapter = deployAdapter + binding.recyclerView.adapter = deployAdapter deployAdapter.setOnItemClickedListener(object : NormalRecyclerAdapter.OnItemClickedListener { override fun onItemClicked(position: Int, t: WellListModel.DataBean.RowsBean) { diff --git a/app/src/main/java/com/casic/app/smartwell/view/LoginActivity.kt b/app/src/main/java/com/casic/app/smartwell/view/LoginActivity.kt index e4bb0e3..834527b 100644 --- a/app/src/main/java/com/casic/app/smartwell/view/LoginActivity.kt +++ b/app/src/main/java/com/casic/app/smartwell/view/LoginActivity.kt @@ -21,7 +21,7 @@ import com.pengxh.kt.lite.extensions.navigatePageTo import com.pengxh.kt.lite.extensions.readAssetsFile import com.pengxh.kt.lite.extensions.show -import com.pengxh.kt.lite.utils.LoadingDialogHub +import com.pengxh.kt.lite.utils.LoadingDialog import com.pengxh.kt.lite.utils.SaveKeyValues import kotlinx.coroutines.Dispatchers import kotlinx.coroutines.launch @@ -106,11 +106,11 @@ override fun observeRequestState() { authenticateViewModel.loadState.observe(this) { - LoadingDialogHub.show(this, "登录中,请稍后") + LoadingDialog.show(this, "登录中,请稍后") } loginViewModel.loadState.observe(this) { - LoadingDialogHub.dismiss() + LoadingDialog.dismiss() } } diff --git a/app/src/main/java/com/casic/app/smartwell/view/OrderCompletedDetailActivity.kt b/app/src/main/java/com/casic/app/smartwell/view/OrderCompletedDetailActivity.kt index db8ad1f..75cd905 100644 --- a/app/src/main/java/com/casic/app/smartwell/view/OrderCompletedDetailActivity.kt +++ b/app/src/main/java/com/casic/app/smartwell/view/OrderCompletedDetailActivity.kt @@ -17,7 +17,7 @@ import com.pengxh.kt.lite.extensions.show import com.pengxh.kt.lite.utils.Constant import com.pengxh.kt.lite.utils.LoadState -import com.pengxh.kt.lite.utils.LoadingDialogHub +import com.pengxh.kt.lite.utils.LoadingDialog import com.pengxh.kt.lite.widget.TitleBarView import com.pengxh.kt.lite.widget.dialog.AlertMessageDialog @@ -44,7 +44,7 @@ } override fun initOnCreate(savedInstanceState: Bundle?) { - val jobId = intent.getStringExtra(Constant.INTENT_PARAM)!! + val jobId = intent.getStringExtra(Constant.INTENT_PARAM_KEY)!! orderViewModel = ViewModelProvider(this)[OrderViewModel::class.java] orderViewModel.getWorkOrderDetail(jobId) orderViewModel.detailModel.observe(this) { @@ -154,8 +154,8 @@ override fun observeRequestState() { orderViewModel.loadState.observe(this) { when (it) { - is LoadState.Loading -> LoadingDialogHub.show(this, "数据加载中,请稍后") - else -> LoadingDialogHub.dismiss() + is LoadState.Loading -> LoadingDialog.show(this, "数据加载中,请稍后") + else -> LoadingDialog.dismiss() } } } diff --git a/app/src/main/java/com/casic/app/smartwell/view/OrderInHandleDetailActivity.kt b/app/src/main/java/com/casic/app/smartwell/view/OrderInHandleDetailActivity.kt index d70a979..04a7d5d 100644 --- a/app/src/main/java/com/casic/app/smartwell/view/OrderInHandleDetailActivity.kt +++ b/app/src/main/java/com/casic/app/smartwell/view/OrderInHandleDetailActivity.kt @@ -38,7 +38,7 @@ import com.pengxh.kt.lite.extensions.show import com.pengxh.kt.lite.utils.Constant import com.pengxh.kt.lite.utils.LoadState -import com.pengxh.kt.lite.utils.LoadingDialogHub +import com.pengxh.kt.lite.utils.LoadingDialog import com.pengxh.kt.lite.widget.TitleBarView import com.pengxh.kt.lite.widget.dialog.AlertControlDialog import com.pengxh.kt.lite.widget.dialog.AlertMessageDialog @@ -93,7 +93,7 @@ ) binding.addImageRecyclerView.adapter = imageAdapter - val jobId = intent.getStringExtra(Constant.INTENT_PARAM)!!//初始化图片九宫格 + val jobId = intent.getStringExtra(Constant.INTENT_PARAM_KEY)!!//初始化图片九宫格 orderViewModel.getWorkOrderDetail(jobId) orderViewModel.detailModel.observe(this) { if (it.code == 200) { @@ -312,41 +312,41 @@ override fun observeRequestState() { orderViewModel.loadState.observe(this) { when (it) { - is LoadState.Loading -> LoadingDialogHub.show(this, "数据加载中,请稍后") - else -> LoadingDialogHub.dismiss() + is LoadState.Loading -> LoadingDialog.show(this, "数据加载中,请稍后") + else -> LoadingDialog.dismiss() } } uploadImageViewModel.loadState.observe(this) { when (it) { - LoadState.Loading -> LoadingDialogHub.show(this, "图片上传中,请稍后...") - else -> LoadingDialogHub.dismiss() + LoadState.Loading -> LoadingDialog.show(this, "图片上传中,请稍后...") + else -> LoadingDialog.dismiss() } } //转单状态处理 operationViewModel.loadState.observe(this) { when (it) { - is LoadState.Loading -> LoadingDialogHub.show(this, "转单中,请稍后") + is LoadState.Loading -> LoadingDialog.show(this, "转单中,请稍后") is LoadState.Success -> { - LoadingDialogHub.dismiss() + LoadingDialog.dismiss() this.finish() } - else -> LoadingDialogHub.dismiss() + else -> LoadingDialog.dismiss() } } //处理完成工单状态处理 operationViewModel.loadState.observe(this) { when (it) { - is LoadState.Loading -> LoadingDialogHub.show(this, "处理中,请稍后") + is LoadState.Loading -> LoadingDialog.show(this, "处理中,请稍后") is LoadState.Success -> { - LoadingDialogHub.dismiss() + LoadingDialog.dismiss() this.finish() } - else -> LoadingDialogHub.dismiss() + else -> LoadingDialog.dismiss() } } } diff --git a/app/src/main/java/com/casic/app/smartwell/view/OrderNotConfirmedDetailActivity.kt b/app/src/main/java/com/casic/app/smartwell/view/OrderNotConfirmedDetailActivity.kt index 8e036d2..687ec86 100644 --- a/app/src/main/java/com/casic/app/smartwell/view/OrderNotConfirmedDetailActivity.kt +++ b/app/src/main/java/com/casic/app/smartwell/view/OrderNotConfirmedDetailActivity.kt @@ -36,7 +36,7 @@ import com.pengxh.kt.lite.extensions.show import com.pengxh.kt.lite.utils.Constant import com.pengxh.kt.lite.utils.LoadState -import com.pengxh.kt.lite.utils.LoadingDialogHub +import com.pengxh.kt.lite.utils.LoadingDialog import com.pengxh.kt.lite.widget.TitleBarView import com.pengxh.kt.lite.widget.dialog.AlertControlDialog import com.pengxh.kt.lite.widget.dialog.AlertMessageDialog @@ -80,7 +80,7 @@ } override fun initOnCreate(savedInstanceState: Bundle?) { - val jobId = intent.getStringExtra(Constant.INTENT_PARAM)!! + val jobId = intent.getStringExtra(Constant.INTENT_PARAM_KEY)!! //初始化图片九宫格 //左外边距,左内边距,右内边距,右外边距 val viewWidth = getScreenWidth() - (10 + 10 + 10 + 10).dp2px(this) @@ -263,41 +263,41 @@ //数据加载状态处理 orderViewModel.loadState.observe(this) { when (it) { - is LoadState.Loading -> LoadingDialogHub.show(this, "数据加载中,请稍后") - else -> LoadingDialogHub.dismiss() + is LoadState.Loading -> LoadingDialog.show(this, "数据加载中,请稍后") + else -> LoadingDialog.dismiss() } } uploadImageViewModel.loadState.observe(this) { when (it) { - LoadState.Loading -> LoadingDialogHub.show(this, "图片上传中,请稍后") - else -> LoadingDialogHub.dismiss() + LoadState.Loading -> LoadingDialog.show(this, "图片上传中,请稍后") + else -> LoadingDialog.dismiss() } } //转单状态处理 operationViewModel.loadState.observe(this) { when (it) { - is LoadState.Loading -> LoadingDialogHub.show(this, "转单中,请稍后") + is LoadState.Loading -> LoadingDialog.show(this, "转单中,请稍后") is LoadState.Success -> { - LoadingDialogHub.dismiss() + LoadingDialog.dismiss() this.finish() } - else -> LoadingDialogHub.dismiss() + else -> LoadingDialog.dismiss() } } //确认工单状态处理 operationViewModel.loadState.observe(this) { when (it) { - is LoadState.Loading -> LoadingDialogHub.show(this, "处理中,请稍后") + is LoadState.Loading -> LoadingDialog.show(this, "处理中,请稍后") is LoadState.Success -> { - LoadingDialogHub.dismiss() + LoadingDialog.dismiss() this.finish() } - else -> LoadingDialogHub.dismiss() + else -> LoadingDialog.dismiss() } } } diff --git a/app/src/main/java/com/casic/app/smartwell/view/OrderNotProcessedDetailActivity.kt b/app/src/main/java/com/casic/app/smartwell/view/OrderNotProcessedDetailActivity.kt index d3f22dc..0c97a52 100644 --- a/app/src/main/java/com/casic/app/smartwell/view/OrderNotProcessedDetailActivity.kt +++ b/app/src/main/java/com/casic/app/smartwell/view/OrderNotProcessedDetailActivity.kt @@ -18,7 +18,7 @@ import com.pengxh.kt.lite.extensions.show import com.pengxh.kt.lite.utils.Constant import com.pengxh.kt.lite.utils.LoadState -import com.pengxh.kt.lite.utils.LoadingDialogHub +import com.pengxh.kt.lite.utils.LoadingDialog import com.pengxh.kt.lite.widget.TitleBarView import com.pengxh.kt.lite.widget.dialog.AlertControlDialog import com.pengxh.kt.lite.widget.dialog.AlertMessageDialog @@ -50,7 +50,7 @@ } override fun initOnCreate(savedInstanceState: Bundle?) { - this.jobId = intent.getStringExtra(Constant.INTENT_PARAM)!! + this.jobId = intent.getStringExtra(Constant.INTENT_PARAM_KEY)!! orderViewModel = ViewModelProvider(this)[OrderViewModel::class.java] operationViewModel = ViewModelProvider(this)[OperationViewModel::class.java] wellViewModel = ViewModelProvider(this)[WellViewModel::class.java] @@ -162,21 +162,21 @@ //数据加载状态处理 orderViewModel.loadState.observe(this) { when (it) { - is LoadState.Loading -> LoadingDialogHub.show(this, "数据加载中,请稍后") - else -> LoadingDialogHub.dismiss() + is LoadState.Loading -> LoadingDialog.show(this, "数据加载中,请稍后") + else -> LoadingDialog.dismiss() } } //接单状态处理 operationViewModel.loadState.observe(this) { when (it) { - is LoadState.Loading -> LoadingDialogHub.show(this, "接单中,请稍后") + is LoadState.Loading -> LoadingDialog.show(this, "接单中,请稍后") is LoadState.Success -> { - LoadingDialogHub.dismiss() + LoadingDialog.dismiss() this.finish() } - else -> LoadingDialogHub.dismiss() + else -> LoadingDialog.dismiss() } } } diff --git a/app/src/main/java/com/casic/app/smartwell/view/SearchResultActivity.kt b/app/src/main/java/com/casic/app/smartwell/view/SearchResultActivity.kt index 6a92917..4f3a674 100644 --- a/app/src/main/java/com/casic/app/smartwell/view/SearchResultActivity.kt +++ b/app/src/main/java/com/casic/app/smartwell/view/SearchResultActivity.kt @@ -19,7 +19,7 @@ import com.pengxh.kt.lite.extensions.show import com.pengxh.kt.lite.utils.Constant import com.pengxh.kt.lite.utils.LoadState -import com.pengxh.kt.lite.utils.LoadingDialogHub +import com.pengxh.kt.lite.utils.LoadingDialog import com.pengxh.kt.lite.utils.WeakReferenceHandler import com.pengxh.kt.lite.widget.TitleBarView import com.pengxh.kt.lite.widget.dialog.AlertControlDialog @@ -56,7 +56,7 @@ } override fun initOnCreate(savedInstanceState: Bundle?) { - args = intent.getStringArrayListExtra(Constant.INTENT_PARAM)!! + args = intent.getStringArrayListExtra(Constant.INTENT_PARAM_KEY)!! orderViewModel = ViewModelProvider(this)[OrderViewModel::class.java] operationViewModel = ViewModelProvider(this)[OperationViewModel::class.java] @@ -101,24 +101,24 @@ } } - binding.resultRecyclerView.addItemDecoration( - RecyclerViewItemOffsets(0, 5, 0, 5) + binding.recyclerView.addItemDecoration( + RecyclerViewItemOffsets(0, 7, 0, 7) ) } override fun observeRequestState() { orderViewModel.loadState.observe(this) { when (it) { - is LoadState.Loading -> LoadingDialogHub.show(this, "数据加载中,请稍后") - else -> LoadingDialogHub.dismiss() + is LoadState.Loading -> LoadingDialog.show(this, "数据加载中,请稍后") + else -> LoadingDialog.dismiss() } } //接单状态处理 operationViewModel.loadState.observe(this) { when (it) { - is LoadState.Loading -> LoadingDialogHub.show(this, "接单中,请稍后") + is LoadState.Loading -> LoadingDialog.show(this, "接单中,请稍后") is LoadState.Success -> { - LoadingDialogHub.dismiss() + LoadingDialog.dismiss() //接单成功之后刷新列表 dataBeans.removeAt(clickedPosition) searchResultAdapter.notifyItemRemoved(clickedPosition) @@ -127,7 +127,7 @@ ) } - else -> LoadingDialogHub.dismiss() + else -> LoadingDialog.dismiss() } } } @@ -162,7 +162,7 @@ } else { binding.emptyInclude.emptyView.hide() searchResultAdapter = SearchResultAdapter(this, dataBeans) - binding.resultRecyclerView.adapter = searchResultAdapter + binding.recyclerView.adapter = searchResultAdapter searchResultAdapter.setOnItemClickListener(object : SearchResultAdapter.OnItemClickListener { override fun onClicked(position: Int) { diff --git a/app/src/main/java/com/casic/app/smartwell/view/UnDeployWellActivity.kt b/app/src/main/java/com/casic/app/smartwell/view/UnDeployWellActivity.kt index 7f7cd3c..555c278 100644 --- a/app/src/main/java/com/casic/app/smartwell/view/UnDeployWellActivity.kt +++ b/app/src/main/java/com/casic/app/smartwell/view/UnDeployWellActivity.kt @@ -81,8 +81,8 @@ } } - binding.undeployListView.addItemDecoration( - RecyclerViewItemOffsets(0, 5, 0, 5) + binding.recyclerView.addItemDecoration( + RecyclerViewItemOffsets(0, 7, 0, 7) ) } @@ -147,12 +147,11 @@ } else { item.deep.toString() + "m" } - viewHolder.setText(R.id.wellNameView, item.wellName) + viewHolder.setText(R.id.wellTypeView, item.wellTypeName) .setText(R.id.wellDepthView, "深:${deep}") .setText(R.id.wellCodeView, "点位编号:${item.wellCode}") - .setText(R.id.wellTypeView, "点位类型:${item.wellTypeName}") .setText(R.id.ownerShipView, "权属单位:${item.deptName}") - .setText(R.id.wellLocationView, "点位置:${item.position}") + .setText(R.id.wellLocationView, "点位位置:${item.position}") .setOnClickListener( R.id.operationButton, object : View.OnClickListener { override fun onClick(v: View?) { @@ -185,7 +184,7 @@ ) } } - binding.undeployListView.adapter = unDeployAdapter + binding.recyclerView.adapter = unDeployAdapter unDeployAdapter.setOnItemClickedListener(object : NormalRecyclerAdapter.OnItemClickedListener { override fun onItemClicked(position: Int, t: WellListModel.DataBean.RowsBean) { diff --git a/app/src/main/java/com/casic/app/smartwell/view/WellDetailActivity.kt b/app/src/main/java/com/casic/app/smartwell/view/WellDetailActivity.kt index b50d067..eb8b468 100644 --- a/app/src/main/java/com/casic/app/smartwell/view/WellDetailActivity.kt +++ b/app/src/main/java/com/casic/app/smartwell/view/WellDetailActivity.kt @@ -16,7 +16,7 @@ import com.pengxh.kt.lite.extensions.show import com.pengxh.kt.lite.utils.Constant import com.pengxh.kt.lite.utils.LoadState -import com.pengxh.kt.lite.utils.LoadingDialogHub +import com.pengxh.kt.lite.utils.LoadingDialog import com.pengxh.kt.lite.widget.TitleBarView import com.pengxh.kt.lite.widget.dialog.AlertMessageDialog @@ -44,7 +44,7 @@ } override fun initOnCreate(savedInstanceState: Bundle?) { - val wellId = intent.getStringExtra(Constant.INTENT_PARAM)!! + val wellId = intent.getStringExtra(Constant.INTENT_PARAM_KEY)!! wellViewModel = ViewModelProvider(this)[WellViewModel::class.java] wellViewModel.getWellDetail(wellId) wellViewModel.wellDetailModel.observe(this) { @@ -132,8 +132,8 @@ override fun observeRequestState() { wellViewModel.loadState.observe(this) { when (it) { - is LoadState.Loading -> LoadingDialogHub.show(this, "数据加载中,请稍后") - else -> LoadingDialogHub.dismiss() + is LoadState.Loading -> LoadingDialog.show(this, "数据加载中,请稍后") + else -> LoadingDialog.dismiss() } } } diff --git a/app/src/main/java/com/casic/app/smartwell/view/WellManagementActivity.kt b/app/src/main/java/com/casic/app/smartwell/view/WellManagementActivity.kt index 084da95..457096b 100644 --- a/app/src/main/java/com/casic/app/smartwell/view/WellManagementActivity.kt +++ b/app/src/main/java/com/casic/app/smartwell/view/WellManagementActivity.kt @@ -94,8 +94,8 @@ } } - binding.wellListView.addItemDecoration( - RecyclerViewItemOffsets(0, 5, 0, 5) + binding.recyclerView.addItemDecoration( + RecyclerViewItemOffsets(0, 7, 0, 7) ) } @@ -175,13 +175,12 @@ } else { item.deep.toString() + "m" } - viewHolder.setText(R.id.wellNameView, item.wellName) + viewHolder.setText(R.id.wellTypeView, item.wellTypeName) .setText(R.id.wellStateView, "已${item.bfztName}") .setText(R.id.wellDepthView, "深:${deep}") .setText(R.id.wellCodeView, "点位编号:${item.wellCode}") - .setText(R.id.wellTypeView, "点位类型:${item.wellTypeName}") .setText(R.id.ownerShipView, "权属单位:${item.deptName}") - .setText(R.id.wellLocationView, "点位置:${item.position}") + .setText(R.id.wellLocationView, "点位位置:${item.position}") .setOnClickListener( R.id.navigationButton, object : View.OnClickListener { override fun onClick(v: View?) { @@ -200,7 +199,7 @@ ) } } - binding.wellListView.adapter = wellListAdapter + binding.recyclerView.adapter = wellListAdapter wellListAdapter.setOnItemClickedListener(object : NormalRecyclerAdapter.OnItemClickedListener { override fun onItemClicked(position: Int, t: WellListModel.DataBean.RowsBean) { diff --git a/app/src/main/java/com/casic/app/smartwell/view/WellMonitorActivity.kt b/app/src/main/java/com/casic/app/smartwell/view/WellMonitorActivity.kt index e3573eb..b87bdb7 100644 --- a/app/src/main/java/com/casic/app/smartwell/view/WellMonitorActivity.kt +++ b/app/src/main/java/com/casic/app/smartwell/view/WellMonitorActivity.kt @@ -11,7 +11,7 @@ import com.pengxh.kt.lite.base.KotlinBaseActivity import com.pengxh.kt.lite.utils.Constant import com.pengxh.kt.lite.utils.LoadState -import com.pengxh.kt.lite.utils.LoadingDialogHub +import com.pengxh.kt.lite.utils.LoadingDialog import com.pengxh.kt.lite.widget.TitleBarView class WellMonitorActivity : KotlinBaseActivity() { @@ -36,7 +36,7 @@ } override fun initOnCreate(savedInstanceState: Bundle?) { - val wellId = intent.getStringExtra(Constant.INTENT_PARAM)!! + val wellId = intent.getStringExtra(Constant.INTENT_PARAM_KEY)!! wellViewModel = ViewModelProvider(this)[WellViewModel::class.java] wellViewModel.getMonitorResult(wellId) wellViewModel.monitorModel.observe(this) { @@ -56,8 +56,8 @@ override fun observeRequestState() { wellViewModel.loadState.observe(this) { when (it) { - is LoadState.Loading -> LoadingDialogHub.show(this, "数据加载中,请稍后") - else -> LoadingDialogHub.dismiss() + is LoadState.Loading -> LoadingDialog.show(this, "数据加载中,请稍后") + else -> LoadingDialog.dismiss() } } } diff --git a/app/src/main/java/com/casic/app/smartwell/view/WellOperationActivity.kt b/app/src/main/java/com/casic/app/smartwell/view/WellOperationActivity.kt index 8d333bf..347ebb6 100644 --- a/app/src/main/java/com/casic/app/smartwell/view/WellOperationActivity.kt +++ b/app/src/main/java/com/casic/app/smartwell/view/WellOperationActivity.kt @@ -23,7 +23,7 @@ import com.pengxh.kt.lite.extensions.navigatePageTo import com.pengxh.kt.lite.extensions.show import com.pengxh.kt.lite.utils.LoadState -import com.pengxh.kt.lite.utils.LoadingDialogHub +import com.pengxh.kt.lite.utils.LoadingDialog import com.pengxh.kt.lite.utils.WeakReferenceHandler import com.pengxh.kt.lite.widget.dialog.AlertControlDialog @@ -109,8 +109,8 @@ } } - binding.operationListView.addItemDecoration( - RecyclerViewItemOffsets(0, 5, 0, 5) + binding.recyclerView.addItemDecoration( + RecyclerViewItemOffsets(0, 7, 0, 7) ) } @@ -123,13 +123,13 @@ override fun observeRequestState() { wellViewModel.loadState.observe(this) { when (it) { - is LoadState.Loading -> LoadingDialogHub.show(this, "处理中,请稍后") + is LoadState.Loading -> LoadingDialog.show(this, "处理中,请稍后") is LoadState.Success -> { - LoadingDialogHub.dismiss() + LoadingDialog.dismiss() wellOperationAdapter.notifyItemChanged(clickedPosition) } - else -> LoadingDialogHub.dismiss() + else -> LoadingDialog.dismiss() } } } @@ -203,24 +203,23 @@ if (item.bfztName == "布防") { viewHolder.setImageResource( R.id.wellStateView, R.drawable.bg_solid_text_green_radius_5 - ).setText(R.id.wellStateView, "撤防") + ).setText(R.id.operationButton, "撤防") } else { viewHolder.setImageResource( R.id.wellStateView, R.drawable.bg_solid_text_red_radius_5 - ).setText(R.id.wellStateView, "布防") + ).setText(R.id.operationButton, "布防") } val deep = if (item.deep.toString().isBlank()) { "未知" } else { item.deep.toString() + "m" } - viewHolder.setText(R.id.wellNameView, item.wellName) + viewHolder.setText(R.id.wellTypeView, item.wellTypeName) .setText(R.id.wellStateView, "已${item.bfztName}") .setText(R.id.wellDepthView, "深:${deep}") .setText(R.id.wellCodeView, "点位编号:${item.wellCode}") - .setText(R.id.wellTypeView, "点位类型:${item.wellTypeName}") .setText(R.id.ownerShipView, "权属单位:${item.deptName}") - .setText(R.id.wellLocationView, "点位置:${item.position}") + .setText(R.id.wellLocationView, "点位位置:${item.position}") .setOnClickListener( R.id.operationButton, object : View.OnClickListener { override fun onClick(v: View?) { @@ -280,7 +279,7 @@ ) } } - binding.operationListView.adapter = wellOperationAdapter + binding.recyclerView.adapter = wellOperationAdapter wellOperationAdapter.setOnItemClickedListener(object : NormalRecyclerAdapter.OnItemClickedListener { override fun onItemClicked(position: Int, t: WellListModel.DataBean.RowsBean) { diff --git a/app/src/main/res/drawable/ic_down.xml b/app/src/main/res/drawable/ic_down.xml index 20e6476..6987e6c 100644 --- a/app/src/main/res/drawable/ic_down.xml +++ b/app/src/main/res/drawable/ic_down.xml @@ -1,6 +1,6 @@ + + diff --git a/app/src/main/res/layout/activity_about_us.xml b/app/src/main/res/layout/activity_about_us.xml index 9091a00..d5fbd0d 100644 --- a/app/src/main/res/layout/activity_about_us.xml +++ b/app/src/main/res/layout/activity_about_us.xml @@ -12,13 +12,7 @@ android:layout_width="match_parent" android:layout_height="wrap_content" android:background="@color/mainThemeColor" - app:tbv_left_image="@drawable/ic_title_left" - app:tbv_only_show_title="false" - app:tbv_show_left_image="true" - app:tbv_show_right_image="false" - app:tbv_text="关于我们" - app:tbv_text_color="@color/white" - app:tbv_text_size="@dimen/sp_18" /> + app:tbv_text="关于我们" /> + app:tbv_text="修改密码" /> + app:tbv_text="布防列表" /> + app:tbv_text="帮助中心" /> + app:tbv_text="工单详情" /> + app:tbv_text="工单详情" /> - + + android:value="ee96d8b5e12de3fbb29949efd57418a8" /> () @@ -150,7 +158,7 @@ val cameraPosition = CameraPosition(centerLatLng, 14f, 0f, 0f) val cameraUpdate = CameraUpdateFactory.newCameraPosition(cameraPosition) withContext(Dispatchers.Main) { - LoadingDialogHub.dismiss() + LoadingDialog.dismiss() aMap.animateCamera(cameraUpdate, 1500, null) } } @@ -239,11 +247,6 @@ } override fun initEvent() { - binding.rightOptionView.setOnClickListener { - val x = binding.rightOptionView.width - easyPopupWindow.width - easyPopupWindow.showAsDropDown(binding.rightOptionView, x, 0) - } - //撤防点位 binding.unDeployedLayout.setOnClickListener { requireContext().navigatePageTo() @@ -263,11 +266,11 @@ override fun observeRequestState() { wellViewModel.loadState.observe(this) { when (it) { - is LoadState.Loading -> LoadingDialogHub.show( + is LoadState.Loading -> LoadingDialog.show( requireActivity(), "数据加载中,请稍后..." ) - else -> LoadingDialogHub.dismiss() + else -> LoadingDialog.dismiss() } } } @@ -376,7 +379,7 @@ }).build().show() } }) - infoPopup.showAsDropDown(binding.rightOptionView) +// infoPopup.showAsDropDown(binding.rightOptionView) } override fun onCameraChange(p0: CameraPosition?) { diff --git a/app/src/main/java/com/casic/app/smartwell/fragment/HomePageNoClusterFragment.kt b/app/src/main/java/com/casic/app/smartwell/fragment/HomePageNoClusterFragment.kt index 802426a..b25f743 100644 --- a/app/src/main/java/com/casic/app/smartwell/fragment/HomePageNoClusterFragment.kt +++ b/app/src/main/java/com/casic/app/smartwell/fragment/HomePageNoClusterFragment.kt @@ -38,8 +38,9 @@ import com.pengxh.kt.lite.extensions.navigatePageTo import com.pengxh.kt.lite.extensions.show import com.pengxh.kt.lite.utils.LoadState -import com.pengxh.kt.lite.utils.LoadingDialogHub +import com.pengxh.kt.lite.utils.LoadingDialog import com.pengxh.kt.lite.widget.EasyPopupWindow +import com.pengxh.kt.lite.widget.TitleBarView import com.pengxh.kt.lite.widget.dialog.AlertControlDialog import kotlinx.coroutines.Dispatchers import kotlinx.coroutines.launch @@ -78,7 +79,15 @@ override fun setupTopBarLayout() { binding.rootView.initImmersionBar(this, false, R.color.mainThemeColor) - binding.titleView.text = "首页" + binding.titleView.setOnClickListener(object : TitleBarView.OnClickListener { + override fun onLeftClick() { + + } + + override fun onRightClick() { + easyPopupWindow.showAsDropDown(binding.titleView, binding.titleView.width, 0) + } + }) } override fun initOnCreate(savedInstanceState: Bundle?) { @@ -112,7 +121,7 @@ //渲染井位置 lifecycleScope.launch(Dispatchers.Main) { - LoadingDialogHub.show(requireActivity(), "数据加载中,请稍后") + LoadingDialog.show(requireActivity(), "数据加载中,请稍后") withContext(Dispatchers.IO) { //取Well缓存 val allMarkerOptions = ArrayList() @@ -144,7 +153,7 @@ val cameraPosition = CameraPosition(centerLatLng, 14f, 0f, 0f) val cameraUpdate = CameraUpdateFactory.newCameraPosition(cameraPosition) withContext(Dispatchers.Main) { - LoadingDialogHub.dismiss() + LoadingDialog.dismiss() aMap.animateCamera(cameraUpdate, 1500, null) } } @@ -238,11 +247,6 @@ } override fun initEvent() { - binding.rightOptionView.setOnClickListener { - val x = binding.rightOptionView.width - easyPopupWindow.width - easyPopupWindow.showAsDropDown(binding.rightOptionView, x, 0) - } - //撤防点位 binding.unDeployedLayout.setOnClickListener { requireContext().navigatePageTo() @@ -262,11 +266,11 @@ override fun observeRequestState() { wellViewModel.loadState.observe(this) { when (it) { - is LoadState.Loading -> LoadingDialogHub.show( + is LoadState.Loading -> LoadingDialog.show( requireActivity(), "数据加载中,请稍后..." ) - else -> LoadingDialogHub.dismiss() + else -> LoadingDialog.dismiss() } } } diff --git a/app/src/main/java/com/casic/app/smartwell/fragment/MinePageFragment.kt b/app/src/main/java/com/casic/app/smartwell/fragment/MinePageFragment.kt index 09a570c..dcb48f8 100644 --- a/app/src/main/java/com/casic/app/smartwell/fragment/MinePageFragment.kt +++ b/app/src/main/java/com/casic/app/smartwell/fragment/MinePageFragment.kt @@ -35,7 +35,7 @@ import com.pengxh.kt.lite.utils.ActivityStackManager import com.pengxh.kt.lite.utils.FileDownloadManager import com.pengxh.kt.lite.utils.LoadState -import com.pengxh.kt.lite.utils.LoadingDialogHub +import com.pengxh.kt.lite.utils.LoadingDialog import com.pengxh.kt.lite.widget.dialog.AlertControlDialog import com.pengxh.kt.lite.widget.dialog.BottomActionSheet import kotlinx.coroutines.Dispatchers @@ -60,7 +60,6 @@ override fun setupTopBarLayout() { binding.rootView.initImmersionBar(this, false, R.color.mainThemeColor) - binding.titleInclude.titleView.text = "我的" } override fun initOnCreate(savedInstanceState: Bundle?) { @@ -155,27 +154,27 @@ override fun observeRequestState() { userViewModel.loadState.observe(this) { when (it) { - is LoadState.Loading -> LoadingDialogHub.show( + is LoadState.Loading -> LoadingDialog.show( requireActivity(), "检查版本中,请稍后" ) - else -> LoadingDialogHub.dismiss() + else -> LoadingDialog.dismiss() } } wellViewModel.loadState.observe(this) { when (it) { - is LoadState.Loading -> LoadingDialogHub.show( + is LoadState.Loading -> LoadingDialog.show( requireActivity(), "数据更新中,请稍后" ) is LoadState.Fail -> { - LoadingDialogHub.dismiss() + LoadingDialog.dismiss() "数据更新超时".show(requireContext()) } else -> { - LoadingDialogHub.dismiss() + LoadingDialog.dismiss() AlertControlDialog.Builder().setContext(requireContext()).setTitle("温馨提示") .setMessage("数据更新成功,请重启应用").setNegativeButton("取消") .setPositiveButton("确定").setOnDialogButtonClickListener(object : @@ -197,17 +196,17 @@ lineViewModel.loadState.observe(this) { when (it) { - is LoadState.Loading -> LoadingDialogHub.show( + is LoadState.Loading -> LoadingDialog.show( requireActivity(), "数据更新中,请稍后" ) is LoadState.Fail -> { - LoadingDialogHub.dismiss() + LoadingDialog.dismiss() "数据更新超时".show(requireContext()) } else -> { - LoadingDialogHub.dismiss() + LoadingDialog.dismiss() AlertControlDialog.Builder().setContext(requireContext()).setTitle("温馨提示") .setMessage("数据更新成功,请重启应用").setNegativeButton("取消") .setPositiveButton("确定").setOnDialogButtonClickListener(object : diff --git a/app/src/main/java/com/casic/app/smartwell/fragment/NoticePageFragment.kt b/app/src/main/java/com/casic/app/smartwell/fragment/NoticePageFragment.kt index 171b555..3c93f54 100644 --- a/app/src/main/java/com/casic/app/smartwell/fragment/NoticePageFragment.kt +++ b/app/src/main/java/com/casic/app/smartwell/fragment/NoticePageFragment.kt @@ -48,7 +48,6 @@ override fun setupTopBarLayout() { binding.rootView.initImmersionBar(this, false, R.color.mainThemeColor) - binding.titleInclude.titleView.text = "消息" } override fun initOnCreate(savedInstanceState: Bundle?) { diff --git a/app/src/main/java/com/casic/app/smartwell/fragment/OrderListFragment.kt b/app/src/main/java/com/casic/app/smartwell/fragment/OrderListFragment.kt index 93ff35b..5e38acb 100644 --- a/app/src/main/java/com/casic/app/smartwell/fragment/OrderListFragment.kt +++ b/app/src/main/java/com/casic/app/smartwell/fragment/OrderListFragment.kt @@ -12,6 +12,7 @@ import com.casic.app.smartwell.view.SearchOrderActivity import com.pengxh.kt.lite.base.KotlinBaseFragment import com.pengxh.kt.lite.extensions.navigatePageTo +import com.pengxh.kt.lite.widget.TitleBarView class OrderListFragment : KotlinBaseFragment() { @@ -25,15 +26,22 @@ } override fun initViewBinding( - inflater: LayoutInflater, - container: ViewGroup? + inflater: LayoutInflater, container: ViewGroup? ): FragmentOrderBinding { return FragmentOrderBinding.inflate(inflater, container, false) } override fun setupTopBarLayout() { binding.rootView.initImmersionBar(this, false, R.color.mainThemeColor) - binding.titleView.text = "工单" + binding.titleView.setOnClickListener(object : TitleBarView.OnClickListener { + override fun onLeftClick() { + + } + + override fun onRightClick() { + requireContext().navigatePageTo() + } + }) } override fun initOnCreate(savedInstanceState: Bundle?) { @@ -51,8 +59,6 @@ } override fun initEvent() { - binding.rightOptionView.setOnClickListener { - requireContext().navigatePageTo() - } + } } \ No newline at end of file diff --git a/app/src/main/java/com/casic/app/smartwell/fragment/OrderNotProcessedFragment.kt b/app/src/main/java/com/casic/app/smartwell/fragment/OrderNotProcessedFragment.kt index 0b3d09d..2b6f21d 100644 --- a/app/src/main/java/com/casic/app/smartwell/fragment/OrderNotProcessedFragment.kt +++ b/app/src/main/java/com/casic/app/smartwell/fragment/OrderNotProcessedFragment.kt @@ -18,7 +18,7 @@ import com.pengxh.kt.lite.extensions.navigatePageTo import com.pengxh.kt.lite.extensions.show import com.pengxh.kt.lite.utils.LoadState -import com.pengxh.kt.lite.utils.LoadingDialogHub +import com.pengxh.kt.lite.utils.LoadingDialog import com.pengxh.kt.lite.utils.WeakReferenceHandler import com.pengxh.kt.lite.widget.dialog.AlertControlDialog @@ -78,8 +78,8 @@ operationViewModel = ViewModelProvider(this)[OperationViewModel::class.java] - binding.notProcessedView.addItemDecoration( - RecyclerViewItemOffsets(0, 5, 0, 5) + binding.recyclerView.addItemDecoration( + RecyclerViewItemOffsets(0, 7, 0, 7) ) } @@ -87,9 +87,9 @@ //接单状态处理 operationViewModel.loadState.observe(this) { when (it) { - is LoadState.Loading -> LoadingDialogHub.show(requireActivity(), "接单中,请稍后") + is LoadState.Loading -> LoadingDialog.show(requireActivity(), "接单中,请稍后") is LoadState.Success -> { - LoadingDialogHub.dismiss() + LoadingDialog.dismiss() //接单成功之后刷新列表 dataBeans.removeAt(clickedPosition) notProcessedAdapter.notifyItemRemoved(clickedPosition) @@ -98,7 +98,7 @@ ) } - else -> LoadingDialogHub.dismiss() + else -> LoadingDialog.dismiss() } } } @@ -131,7 +131,7 @@ } else { binding.emptyInclude.emptyView.hide() notProcessedAdapter = OrderNotProcessedAdapter(requireContext(), dataBeans) - binding.notProcessedView.adapter = notProcessedAdapter + binding.recyclerView.adapter = notProcessedAdapter notProcessedAdapter.setOnItemClickListener(object : OrderNotProcessedAdapter.OnItemClickListener { override fun onClicked(position: Int) { diff --git a/app/src/main/java/com/casic/app/smartwell/fragment/OvertimeNotAcceptFragment.kt b/app/src/main/java/com/casic/app/smartwell/fragment/OvertimeNotAcceptFragment.kt index a198545..9b318ca 100644 --- a/app/src/main/java/com/casic/app/smartwell/fragment/OvertimeNotAcceptFragment.kt +++ b/app/src/main/java/com/casic/app/smartwell/fragment/OvertimeNotAcceptFragment.kt @@ -18,7 +18,7 @@ import com.pengxh.kt.lite.extensions.navigatePageTo import com.pengxh.kt.lite.extensions.show import com.pengxh.kt.lite.utils.LoadState -import com.pengxh.kt.lite.utils.LoadingDialogHub +import com.pengxh.kt.lite.utils.LoadingDialog import com.pengxh.kt.lite.utils.WeakReferenceHandler import com.pengxh.kt.lite.widget.dialog.AlertControlDialog @@ -81,8 +81,8 @@ operationViewModel = ViewModelProvider(this)[OperationViewModel::class.java] - binding.notProcessedView.addItemDecoration( - RecyclerViewItemOffsets(0, 5, 0, 5) + binding.recyclerView.addItemDecoration( + RecyclerViewItemOffsets(0, 7, 0, 7) ) } @@ -90,9 +90,9 @@ //接单状态处理 operationViewModel.loadState.observe(this) { when (it) { - is LoadState.Loading -> LoadingDialogHub.show(requireActivity(), "接单中,请稍后") + is LoadState.Loading -> LoadingDialog.show(requireActivity(), "接单中,请稍后") is LoadState.Success -> { - LoadingDialogHub.dismiss() + LoadingDialog.dismiss() //接单成功之后刷新列表 dataBeans.removeAt(clickedPosition) notProcessedAdapter.notifyItemRemoved(clickedPosition) @@ -101,7 +101,7 @@ ) } - else -> LoadingDialogHub.dismiss() + else -> LoadingDialog.dismiss() } } } @@ -134,7 +134,7 @@ } else { binding.emptyInclude.emptyView.hide() notProcessedAdapter = OrderNotProcessedAdapter(requireContext(), dataBeans) - binding.notProcessedView.adapter = notProcessedAdapter + binding.recyclerView.adapter = notProcessedAdapter notProcessedAdapter.setOnItemClickListener(object : OrderNotProcessedAdapter.OnItemClickListener { override fun onClicked(position: Int) { diff --git a/app/src/main/java/com/casic/app/smartwell/greendao/DaoMaster.java b/app/src/main/java/com/casic/app/smartwell/greendao/DaoMaster.java index fdcf3a7..1e52b74 100644 --- a/app/src/main/java/com/casic/app/smartwell/greendao/DaoMaster.java +++ b/app/src/main/java/com/casic/app/smartwell/greendao/DaoMaster.java @@ -13,25 +13,20 @@ // THIS CODE IS GENERATED BY greenDAO, DO NOT EDIT. - /** * Master of DAO (schema version 4): knows all DAOs. */ public class DaoMaster extends AbstractDaoMaster { public static final int SCHEMA_VERSION = 4; - /** - * Creates underlying database table using DAOs. - */ + /** Creates underlying database table using DAOs. */ public static void createAllTables(Database db, boolean ifNotExists) { MapWellLocalBeanDao.createTable(db, ifNotExists); NoticeLocaleBeanDao.createTable(db, ifNotExists); PipeLocalBeanDao.createTable(db, ifNotExists); } - /** - * Drops underlying database table using DAOs. - */ + /** Drops underlying database table using DAOs. */ public static void dropAllTables(Database db, boolean ifExists) { MapWellLocalBeanDao.dropTable(db, ifExists); NoticeLocaleBeanDao.dropTable(db, ifExists); @@ -86,9 +81,7 @@ } } - /** - * WARNING: Drops all table on Upgrade! Use only during development. - */ + /** WARNING: Drops all table on Upgrade! Use only during development. */ public static class DevOpenHelper extends OpenHelper { public DevOpenHelper(Context context, String name) { super(context, name); diff --git a/app/src/main/java/com/casic/app/smartwell/greendao/DaoSession.java b/app/src/main/java/com/casic/app/smartwell/greendao/DaoSession.java index 0b36d17..3e40e3b 100644 --- a/app/src/main/java/com/casic/app/smartwell/greendao/DaoSession.java +++ b/app/src/main/java/com/casic/app/smartwell/greendao/DaoSession.java @@ -16,7 +16,7 @@ /** * {@inheritDoc} - * + * * @see org.greenrobot.greendao.AbstractDaoSession */ public class DaoSession extends AbstractDaoSession { @@ -50,7 +50,7 @@ registerDao(NoticeLocaleBean.class, noticeLocaleBeanDao); registerDao(PipeLocalBean.class, pipeLocalBeanDao); } - + public void clear() { mapWellLocalBeanDaoConfig.clearIdentityScope(); noticeLocaleBeanDaoConfig.clearIdentityScope(); diff --git a/app/src/main/java/com/casic/app/smartwell/greendao/MapWellLocalBeanDao.java b/app/src/main/java/com/casic/app/smartwell/greendao/MapWellLocalBeanDao.java index 8908fda..407bc92 100644 --- a/app/src/main/java/com/casic/app/smartwell/greendao/MapWellLocalBeanDao.java +++ b/app/src/main/java/com/casic/app/smartwell/greendao/MapWellLocalBeanDao.java @@ -12,10 +12,9 @@ import org.greenrobot.greendao.internal.DaoConfig; // THIS CODE IS GENERATED BY greenDAO, DO NOT EDIT. - -/** +/** * DAO for table "MAP_WELL_LOCAL_BEAN". - */ +*/ public class MapWellLocalBeanDao extends AbstractDao { public static final String TABLENAME = "MAP_WELL_LOCAL_BEAN"; @@ -57,16 +56,14 @@ public MapWellLocalBeanDao(DaoConfig config) { super(config); } - + public MapWellLocalBeanDao(DaoConfig config, DaoSession daoSession) { super(config, daoSession); } - /** - * Creates the underlying database table. - */ + /** Creates the underlying database table. */ public static void createTable(Database db, boolean ifNotExists) { - String constraint = ifNotExists ? "IF NOT EXISTS " : ""; + String constraint = ifNotExists? "IF NOT EXISTS ": ""; db.execSQL("CREATE TABLE " + constraint + "\"MAP_WELL_LOCAL_BEAN\" (" + // "\"_id\" INTEGER PRIMARY KEY AUTOINCREMENT ," + // 0: kId "\"AREA\" TEXT," + // 1: area @@ -96,9 +93,7 @@ "\"WELL_TYPE_NAME\" TEXT);"); // 25: wellTypeName } - /** - * Drops the underlying database table. - */ + /** Drops the underlying database table. */ public static void dropTable(Database db, boolean ifExists) { String sql = "DROP TABLE " + (ifExists ? "IF EXISTS " : "") + "\"MAP_WELL_LOCAL_BEAN\""; db.execSQL(sql); @@ -107,132 +102,132 @@ @Override protected final void bindValues(DatabaseStatement stmt, MapWellLocalBean entity) { stmt.clearBindings(); - + Long kId = entity.getKId(); if (kId != null) { stmt.bindLong(1, kId); } - + String area = entity.getArea(); if (area != null) { stmt.bindString(2, area); } - + String bfzt = entity.getBfzt(); if (bfzt != null) { stmt.bindString(3, bfzt); } - + String bfztName = entity.getBfztName(); if (bfztName != null) { stmt.bindString(4, bfztName); } - + String coordinateX = entity.getCoordinateX(); if (coordinateX != null) { stmt.bindString(5, coordinateX); } - + String coordinateY = entity.getCoordinateY(); if (coordinateY != null) { stmt.bindString(6, coordinateY); } - + String deep = entity.getDeep(); if (deep != null) { stmt.bindString(7, deep); } - + String deptName = entity.getDeptName(); if (deptName != null) { stmt.bindString(8, deptName); } - + String deptid = entity.getDeptid(); if (deptid != null) { stmt.bindString(9, deptid); } - + String id = entity.getId(); if (id != null) { stmt.bindString(10, id); } - + String latBaidu = entity.getLatBaidu(); if (latBaidu != null) { stmt.bindString(11, latBaidu); } - + String latGaode = entity.getLatGaode(); if (latGaode != null) { stmt.bindString(12, latGaode); } - + String lngBaidu = entity.getLngBaidu(); if (lngBaidu != null) { stmt.bindString(13, lngBaidu); } - + String lngGaode = entity.getLngGaode(); if (lngGaode != null) { stmt.bindString(14, lngGaode); } - + String notes = entity.getNotes(); if (notes != null) { stmt.bindString(15, notes); } - + String photos = entity.getPhotos(); if (photos != null) { stmt.bindString(16, photos); } - + String position = entity.getPosition(); if (position != null) { stmt.bindString(17, position); } - + String staff = entity.getStaff(); if (staff != null) { stmt.bindString(18, staff); } - + String tel = entity.getTel(); if (tel != null) { stmt.bindString(19, tel); } - + String ts = entity.getTs(); if (ts != null) { stmt.bindString(20, ts); } - + String valid = entity.getValid(); if (valid != null) { stmt.bindString(21, valid); } - + String watchData = entity.getWatchData(); if (watchData != null) { stmt.bindString(22, watchData); } - + String wellCode = entity.getWellCode(); if (wellCode != null) { stmt.bindString(23, wellCode); } - + String wellName = entity.getWellName(); if (wellName != null) { stmt.bindString(24, wellName); } - + String wellType = entity.getWellType(); if (wellType != null) { stmt.bindString(25, wellType); } - + String wellTypeName = entity.getWellTypeName(); if (wellTypeName != null) { stmt.bindString(26, wellTypeName); @@ -242,132 +237,132 @@ @Override protected final void bindValues(SQLiteStatement stmt, MapWellLocalBean entity) { stmt.clearBindings(); - + Long kId = entity.getKId(); if (kId != null) { stmt.bindLong(1, kId); } - + String area = entity.getArea(); if (area != null) { stmt.bindString(2, area); } - + String bfzt = entity.getBfzt(); if (bfzt != null) { stmt.bindString(3, bfzt); } - + String bfztName = entity.getBfztName(); if (bfztName != null) { stmt.bindString(4, bfztName); } - + String coordinateX = entity.getCoordinateX(); if (coordinateX != null) { stmt.bindString(5, coordinateX); } - + String coordinateY = entity.getCoordinateY(); if (coordinateY != null) { stmt.bindString(6, coordinateY); } - + String deep = entity.getDeep(); if (deep != null) { stmt.bindString(7, deep); } - + String deptName = entity.getDeptName(); if (deptName != null) { stmt.bindString(8, deptName); } - + String deptid = entity.getDeptid(); if (deptid != null) { stmt.bindString(9, deptid); } - + String id = entity.getId(); if (id != null) { stmt.bindString(10, id); } - + String latBaidu = entity.getLatBaidu(); if (latBaidu != null) { stmt.bindString(11, latBaidu); } - + String latGaode = entity.getLatGaode(); if (latGaode != null) { stmt.bindString(12, latGaode); } - + String lngBaidu = entity.getLngBaidu(); if (lngBaidu != null) { stmt.bindString(13, lngBaidu); } - + String lngGaode = entity.getLngGaode(); if (lngGaode != null) { stmt.bindString(14, lngGaode); } - + String notes = entity.getNotes(); if (notes != null) { stmt.bindString(15, notes); } - + String photos = entity.getPhotos(); if (photos != null) { stmt.bindString(16, photos); } - + String position = entity.getPosition(); if (position != null) { stmt.bindString(17, position); } - + String staff = entity.getStaff(); if (staff != null) { stmt.bindString(18, staff); } - + String tel = entity.getTel(); if (tel != null) { stmt.bindString(19, tel); } - + String ts = entity.getTs(); if (ts != null) { stmt.bindString(20, ts); } - + String valid = entity.getValid(); if (valid != null) { stmt.bindString(21, valid); } - + String watchData = entity.getWatchData(); if (watchData != null) { stmt.bindString(22, watchData); } - + String wellCode = entity.getWellCode(); if (wellCode != null) { stmt.bindString(23, wellCode); } - + String wellName = entity.getWellName(); if (wellName != null) { stmt.bindString(24, wellName); } - + String wellType = entity.getWellType(); if (wellType != null) { stmt.bindString(25, wellType); } - + String wellTypeName = entity.getWellTypeName(); if (wellTypeName != null) { stmt.bindString(26, wellTypeName); @@ -377,41 +372,41 @@ @Override public Long readKey(Cursor cursor, int offset) { return cursor.isNull(offset + 0) ? null : cursor.getLong(offset + 0); - } + } @Override public MapWellLocalBean readEntity(Cursor cursor, int offset) { MapWellLocalBean entity = new MapWellLocalBean( // - cursor.isNull(offset + 0) ? null : cursor.getLong(offset + 0), // kId - cursor.isNull(offset + 1) ? null : cursor.getString(offset + 1), // area - cursor.isNull(offset + 2) ? null : cursor.getString(offset + 2), // bfzt - cursor.isNull(offset + 3) ? null : cursor.getString(offset + 3), // bfztName - cursor.isNull(offset + 4) ? null : cursor.getString(offset + 4), // coordinateX - cursor.isNull(offset + 5) ? null : cursor.getString(offset + 5), // coordinateY - cursor.isNull(offset + 6) ? null : cursor.getString(offset + 6), // deep - cursor.isNull(offset + 7) ? null : cursor.getString(offset + 7), // deptName - cursor.isNull(offset + 8) ? null : cursor.getString(offset + 8), // deptid - cursor.isNull(offset + 9) ? null : cursor.getString(offset + 9), // id - cursor.isNull(offset + 10) ? null : cursor.getString(offset + 10), // latBaidu - cursor.isNull(offset + 11) ? null : cursor.getString(offset + 11), // latGaode - cursor.isNull(offset + 12) ? null : cursor.getString(offset + 12), // lngBaidu - cursor.isNull(offset + 13) ? null : cursor.getString(offset + 13), // lngGaode - cursor.isNull(offset + 14) ? null : cursor.getString(offset + 14), // notes - cursor.isNull(offset + 15) ? null : cursor.getString(offset + 15), // photos - cursor.isNull(offset + 16) ? null : cursor.getString(offset + 16), // position - cursor.isNull(offset + 17) ? null : cursor.getString(offset + 17), // staff - cursor.isNull(offset + 18) ? null : cursor.getString(offset + 18), // tel - cursor.isNull(offset + 19) ? null : cursor.getString(offset + 19), // ts - cursor.isNull(offset + 20) ? null : cursor.getString(offset + 20), // valid - cursor.isNull(offset + 21) ? null : cursor.getString(offset + 21), // watchData - cursor.isNull(offset + 22) ? null : cursor.getString(offset + 22), // wellCode - cursor.isNull(offset + 23) ? null : cursor.getString(offset + 23), // wellName - cursor.isNull(offset + 24) ? null : cursor.getString(offset + 24), // wellType - cursor.isNull(offset + 25) ? null : cursor.getString(offset + 25) // wellTypeName + cursor.isNull(offset + 0) ? null : cursor.getLong(offset + 0), // kId + cursor.isNull(offset + 1) ? null : cursor.getString(offset + 1), // area + cursor.isNull(offset + 2) ? null : cursor.getString(offset + 2), // bfzt + cursor.isNull(offset + 3) ? null : cursor.getString(offset + 3), // bfztName + cursor.isNull(offset + 4) ? null : cursor.getString(offset + 4), // coordinateX + cursor.isNull(offset + 5) ? null : cursor.getString(offset + 5), // coordinateY + cursor.isNull(offset + 6) ? null : cursor.getString(offset + 6), // deep + cursor.isNull(offset + 7) ? null : cursor.getString(offset + 7), // deptName + cursor.isNull(offset + 8) ? null : cursor.getString(offset + 8), // deptid + cursor.isNull(offset + 9) ? null : cursor.getString(offset + 9), // id + cursor.isNull(offset + 10) ? null : cursor.getString(offset + 10), // latBaidu + cursor.isNull(offset + 11) ? null : cursor.getString(offset + 11), // latGaode + cursor.isNull(offset + 12) ? null : cursor.getString(offset + 12), // lngBaidu + cursor.isNull(offset + 13) ? null : cursor.getString(offset + 13), // lngGaode + cursor.isNull(offset + 14) ? null : cursor.getString(offset + 14), // notes + cursor.isNull(offset + 15) ? null : cursor.getString(offset + 15), // photos + cursor.isNull(offset + 16) ? null : cursor.getString(offset + 16), // position + cursor.isNull(offset + 17) ? null : cursor.getString(offset + 17), // staff + cursor.isNull(offset + 18) ? null : cursor.getString(offset + 18), // tel + cursor.isNull(offset + 19) ? null : cursor.getString(offset + 19), // ts + cursor.isNull(offset + 20) ? null : cursor.getString(offset + 20), // valid + cursor.isNull(offset + 21) ? null : cursor.getString(offset + 21), // watchData + cursor.isNull(offset + 22) ? null : cursor.getString(offset + 22), // wellCode + cursor.isNull(offset + 23) ? null : cursor.getString(offset + 23), // wellName + cursor.isNull(offset + 24) ? null : cursor.getString(offset + 24), // wellType + cursor.isNull(offset + 25) ? null : cursor.getString(offset + 25) // wellTypeName ); return entity; } - + @Override public void readEntity(Cursor cursor, MapWellLocalBean entity, int offset) { entity.setKId(cursor.isNull(offset + 0) ? null : cursor.getLong(offset + 0)); @@ -440,17 +435,17 @@ entity.setWellName(cursor.isNull(offset + 23) ? null : cursor.getString(offset + 23)); entity.setWellType(cursor.isNull(offset + 24) ? null : cursor.getString(offset + 24)); entity.setWellTypeName(cursor.isNull(offset + 25) ? null : cursor.getString(offset + 25)); - } - + } + @Override protected final Long updateKeyAfterInsert(MapWellLocalBean entity, long rowId) { entity.setKId(rowId); return rowId; } - + @Override public Long getKey(MapWellLocalBean entity) { - if (entity != null) { + if(entity != null) { return entity.getKId(); } else { return null; @@ -466,5 +461,5 @@ protected final boolean isEntityUpdateable() { return true; } - + } diff --git a/app/src/main/java/com/casic/app/smartwell/greendao/NoticeLocaleBeanDao.java b/app/src/main/java/com/casic/app/smartwell/greendao/NoticeLocaleBeanDao.java index 64312ed..deb2d49 100644 --- a/app/src/main/java/com/casic/app/smartwell/greendao/NoticeLocaleBeanDao.java +++ b/app/src/main/java/com/casic/app/smartwell/greendao/NoticeLocaleBeanDao.java @@ -12,10 +12,9 @@ import org.greenrobot.greendao.internal.DaoConfig; // THIS CODE IS GENERATED BY greenDAO, DO NOT EDIT. - -/** +/** * DAO for table "NOTICE_LOCALE_BEAN". - */ +*/ public class NoticeLocaleBeanDao extends AbstractDao { public static final String TABLENAME = "NOTICE_LOCALE_BEAN"; @@ -43,16 +42,14 @@ public NoticeLocaleBeanDao(DaoConfig config) { super(config); } - + public NoticeLocaleBeanDao(DaoConfig config, DaoSession daoSession) { super(config, daoSession); } - /** - * Creates the underlying database table. - */ + /** Creates the underlying database table. */ public static void createTable(Database db, boolean ifNotExists) { - String constraint = ifNotExists ? "IF NOT EXISTS " : ""; + String constraint = ifNotExists? "IF NOT EXISTS ": ""; db.execSQL("CREATE TABLE " + constraint + "\"NOTICE_LOCALE_BEAN\" (" + // "\"_id\" INTEGER PRIMARY KEY AUTOINCREMENT ," + // 0: id "\"MESSAGE_ID\" TEXT UNIQUE ," + // 1: messageId @@ -68,9 +65,7 @@ "\"NOTICE_TIME\" TEXT);"); // 11: noticeTime } - /** - * Drops the underlying database table. - */ + /** Drops the underlying database table. */ public static void dropTable(Database db, boolean ifExists) { String sql = "DROP TABLE " + (ifExists ? "IF EXISTS " : "") + "\"NOTICE_LOCALE_BEAN\""; db.execSQL(sql); @@ -79,62 +74,62 @@ @Override protected final void bindValues(DatabaseStatement stmt, NoticeLocaleBean entity) { stmt.clearBindings(); - + Long id = entity.getId(); if (id != null) { stmt.bindLong(1, id); } - + String messageId = entity.getMessageId(); if (messageId != null) { stmt.bindString(2, messageId); } - + String appid = entity.getAppid(); if (appid != null) { stmt.bindString(3, appid); } - + String clientId = entity.getClientId(); if (clientId != null) { stmt.bindString(4, clientId); } - + String taskId = entity.getTaskId(); if (taskId != null) { stmt.bindString(5, taskId); } - + String userId = entity.getUserId(); if (userId != null) { stmt.bindString(6, userId); } - + String title = entity.getTitle(); if (title != null) { stmt.bindString(7, title); } - + String content = entity.getContent(); if (content != null) { stmt.bindString(8, content); } - + String deviceCode = entity.getDeviceCode(); if (deviceCode != null) { stmt.bindString(9, deviceCode); } - + String jobId = entity.getJobId(); if (jobId != null) { stmt.bindString(10, jobId); } - + String isRead = entity.getIsRead(); if (isRead != null) { stmt.bindString(11, isRead); } - + String noticeTime = entity.getNoticeTime(); if (noticeTime != null) { stmt.bindString(12, noticeTime); @@ -144,62 +139,62 @@ @Override protected final void bindValues(SQLiteStatement stmt, NoticeLocaleBean entity) { stmt.clearBindings(); - + Long id = entity.getId(); if (id != null) { stmt.bindLong(1, id); } - + String messageId = entity.getMessageId(); if (messageId != null) { stmt.bindString(2, messageId); } - + String appid = entity.getAppid(); if (appid != null) { stmt.bindString(3, appid); } - + String clientId = entity.getClientId(); if (clientId != null) { stmt.bindString(4, clientId); } - + String taskId = entity.getTaskId(); if (taskId != null) { stmt.bindString(5, taskId); } - + String userId = entity.getUserId(); if (userId != null) { stmt.bindString(6, userId); } - + String title = entity.getTitle(); if (title != null) { stmt.bindString(7, title); } - + String content = entity.getContent(); if (content != null) { stmt.bindString(8, content); } - + String deviceCode = entity.getDeviceCode(); if (deviceCode != null) { stmt.bindString(9, deviceCode); } - + String jobId = entity.getJobId(); if (jobId != null) { stmt.bindString(10, jobId); } - + String isRead = entity.getIsRead(); if (isRead != null) { stmt.bindString(11, isRead); } - + String noticeTime = entity.getNoticeTime(); if (noticeTime != null) { stmt.bindString(12, noticeTime); @@ -209,27 +204,27 @@ @Override public Long readKey(Cursor cursor, int offset) { return cursor.isNull(offset + 0) ? null : cursor.getLong(offset + 0); - } + } @Override public NoticeLocaleBean readEntity(Cursor cursor, int offset) { NoticeLocaleBean entity = new NoticeLocaleBean( // - cursor.isNull(offset + 0) ? null : cursor.getLong(offset + 0), // id - cursor.isNull(offset + 1) ? null : cursor.getString(offset + 1), // messageId - cursor.isNull(offset + 2) ? null : cursor.getString(offset + 2), // appid - cursor.isNull(offset + 3) ? null : cursor.getString(offset + 3), // clientId - cursor.isNull(offset + 4) ? null : cursor.getString(offset + 4), // taskId - cursor.isNull(offset + 5) ? null : cursor.getString(offset + 5), // userId - cursor.isNull(offset + 6) ? null : cursor.getString(offset + 6), // title - cursor.isNull(offset + 7) ? null : cursor.getString(offset + 7), // content - cursor.isNull(offset + 8) ? null : cursor.getString(offset + 8), // deviceCode - cursor.isNull(offset + 9) ? null : cursor.getString(offset + 9), // jobId - cursor.isNull(offset + 10) ? null : cursor.getString(offset + 10), // isRead - cursor.isNull(offset + 11) ? null : cursor.getString(offset + 11) // noticeTime + cursor.isNull(offset + 0) ? null : cursor.getLong(offset + 0), // id + cursor.isNull(offset + 1) ? null : cursor.getString(offset + 1), // messageId + cursor.isNull(offset + 2) ? null : cursor.getString(offset + 2), // appid + cursor.isNull(offset + 3) ? null : cursor.getString(offset + 3), // clientId + cursor.isNull(offset + 4) ? null : cursor.getString(offset + 4), // taskId + cursor.isNull(offset + 5) ? null : cursor.getString(offset + 5), // userId + cursor.isNull(offset + 6) ? null : cursor.getString(offset + 6), // title + cursor.isNull(offset + 7) ? null : cursor.getString(offset + 7), // content + cursor.isNull(offset + 8) ? null : cursor.getString(offset + 8), // deviceCode + cursor.isNull(offset + 9) ? null : cursor.getString(offset + 9), // jobId + cursor.isNull(offset + 10) ? null : cursor.getString(offset + 10), // isRead + cursor.isNull(offset + 11) ? null : cursor.getString(offset + 11) // noticeTime ); return entity; } - + @Override public void readEntity(Cursor cursor, NoticeLocaleBean entity, int offset) { entity.setId(cursor.isNull(offset + 0) ? null : cursor.getLong(offset + 0)); @@ -244,17 +239,17 @@ entity.setJobId(cursor.isNull(offset + 9) ? null : cursor.getString(offset + 9)); entity.setIsRead(cursor.isNull(offset + 10) ? null : cursor.getString(offset + 10)); entity.setNoticeTime(cursor.isNull(offset + 11) ? null : cursor.getString(offset + 11)); - } - + } + @Override protected final Long updateKeyAfterInsert(NoticeLocaleBean entity, long rowId) { entity.setId(rowId); return rowId; } - + @Override public Long getKey(NoticeLocaleBean entity) { - if (entity != null) { + if(entity != null) { return entity.getId(); } else { return null; @@ -270,5 +265,5 @@ protected final boolean isEntityUpdateable() { return true; } - + } diff --git a/app/src/main/java/com/casic/app/smartwell/greendao/PipeLocalBeanDao.java b/app/src/main/java/com/casic/app/smartwell/greendao/PipeLocalBeanDao.java index aab4d3f..df5515a 100644 --- a/app/src/main/java/com/casic/app/smartwell/greendao/PipeLocalBeanDao.java +++ b/app/src/main/java/com/casic/app/smartwell/greendao/PipeLocalBeanDao.java @@ -12,10 +12,9 @@ import org.greenrobot.greendao.internal.DaoConfig; // THIS CODE IS GENERATED BY greenDAO, DO NOT EDIT. - -/** +/** * DAO for table "PIPE_LOCAL_BEAN". - */ +*/ public class PipeLocalBeanDao extends AbstractDao { public static final String TABLENAME = "PIPE_LOCAL_BEAN"; @@ -37,16 +36,14 @@ public PipeLocalBeanDao(DaoConfig config) { super(config); } - + public PipeLocalBeanDao(DaoConfig config, DaoSession daoSession) { super(config, daoSession); } - /** - * Creates the underlying database table. - */ + /** Creates the underlying database table. */ public static void createTable(Database db, boolean ifNotExists) { - String constraint = ifNotExists ? "IF NOT EXISTS " : ""; + String constraint = ifNotExists? "IF NOT EXISTS ": ""; db.execSQL("CREATE TABLE " + constraint + "\"PIPE_LOCAL_BEAN\" (" + // "\"_id\" INTEGER PRIMARY KEY AUTOINCREMENT ," + // 0: id "\"PIPE_CODE\" TEXT," + // 1: pipeCode @@ -56,9 +53,7 @@ "\"START_LONGITUDE_GD\" TEXT);"); // 5: startLongitudeGd } - /** - * Drops the underlying database table. - */ + /** Drops the underlying database table. */ public static void dropTable(Database db, boolean ifExists) { String sql = "DROP TABLE " + (ifExists ? "IF EXISTS " : "") + "\"PIPE_LOCAL_BEAN\""; db.execSQL(sql); @@ -67,32 +62,32 @@ @Override protected final void bindValues(DatabaseStatement stmt, PipeLocalBean entity) { stmt.clearBindings(); - + Long id = entity.getId(); if (id != null) { stmt.bindLong(1, id); } - + String pipeCode = entity.getPipeCode(); if (pipeCode != null) { stmt.bindString(2, pipeCode); } - + String endLatitudeGd = entity.getEndLatitudeGd(); if (endLatitudeGd != null) { stmt.bindString(3, endLatitudeGd); } - + String endLongitudeGd = entity.getEndLongitudeGd(); if (endLongitudeGd != null) { stmt.bindString(4, endLongitudeGd); } - + String startLatitudeGd = entity.getStartLatitudeGd(); if (startLatitudeGd != null) { stmt.bindString(5, startLatitudeGd); } - + String startLongitudeGd = entity.getStartLongitudeGd(); if (startLongitudeGd != null) { stmt.bindString(6, startLongitudeGd); @@ -102,32 +97,32 @@ @Override protected final void bindValues(SQLiteStatement stmt, PipeLocalBean entity) { stmt.clearBindings(); - + Long id = entity.getId(); if (id != null) { stmt.bindLong(1, id); } - + String pipeCode = entity.getPipeCode(); if (pipeCode != null) { stmt.bindString(2, pipeCode); } - + String endLatitudeGd = entity.getEndLatitudeGd(); if (endLatitudeGd != null) { stmt.bindString(3, endLatitudeGd); } - + String endLongitudeGd = entity.getEndLongitudeGd(); if (endLongitudeGd != null) { stmt.bindString(4, endLongitudeGd); } - + String startLatitudeGd = entity.getStartLatitudeGd(); if (startLatitudeGd != null) { stmt.bindString(5, startLatitudeGd); } - + String startLongitudeGd = entity.getStartLongitudeGd(); if (startLongitudeGd != null) { stmt.bindString(6, startLongitudeGd); @@ -137,21 +132,21 @@ @Override public Long readKey(Cursor cursor, int offset) { return cursor.isNull(offset + 0) ? null : cursor.getLong(offset + 0); - } + } @Override public PipeLocalBean readEntity(Cursor cursor, int offset) { PipeLocalBean entity = new PipeLocalBean( // - cursor.isNull(offset + 0) ? null : cursor.getLong(offset + 0), // id - cursor.isNull(offset + 1) ? null : cursor.getString(offset + 1), // pipeCode - cursor.isNull(offset + 2) ? null : cursor.getString(offset + 2), // endLatitudeGd - cursor.isNull(offset + 3) ? null : cursor.getString(offset + 3), // endLongitudeGd - cursor.isNull(offset + 4) ? null : cursor.getString(offset + 4), // startLatitudeGd - cursor.isNull(offset + 5) ? null : cursor.getString(offset + 5) // startLongitudeGd + cursor.isNull(offset + 0) ? null : cursor.getLong(offset + 0), // id + cursor.isNull(offset + 1) ? null : cursor.getString(offset + 1), // pipeCode + cursor.isNull(offset + 2) ? null : cursor.getString(offset + 2), // endLatitudeGd + cursor.isNull(offset + 3) ? null : cursor.getString(offset + 3), // endLongitudeGd + cursor.isNull(offset + 4) ? null : cursor.getString(offset + 4), // startLatitudeGd + cursor.isNull(offset + 5) ? null : cursor.getString(offset + 5) // startLongitudeGd ); return entity; } - + @Override public void readEntity(Cursor cursor, PipeLocalBean entity, int offset) { entity.setId(cursor.isNull(offset + 0) ? null : cursor.getLong(offset + 0)); @@ -160,17 +155,17 @@ entity.setEndLongitudeGd(cursor.isNull(offset + 3) ? null : cursor.getString(offset + 3)); entity.setStartLatitudeGd(cursor.isNull(offset + 4) ? null : cursor.getString(offset + 4)); entity.setStartLongitudeGd(cursor.isNull(offset + 5) ? null : cursor.getString(offset + 5)); - } - + } + @Override protected final Long updateKeyAfterInsert(PipeLocalBean entity, long rowId) { entity.setId(rowId); return rowId; } - + @Override public Long getKey(PipeLocalBean entity) { - if (entity != null) { + if(entity != null) { return entity.getId(); } else { return null; @@ -186,5 +181,5 @@ protected final boolean isEntityUpdateable() { return true; } - + } diff --git a/app/src/main/java/com/casic/app/smartwell/view/ChangePasswordActivity.kt b/app/src/main/java/com/casic/app/smartwell/view/ChangePasswordActivity.kt index 8e41039..9f1dd40 100644 --- a/app/src/main/java/com/casic/app/smartwell/view/ChangePasswordActivity.kt +++ b/app/src/main/java/com/casic/app/smartwell/view/ChangePasswordActivity.kt @@ -14,7 +14,7 @@ import com.pengxh.kt.lite.extensions.show import com.pengxh.kt.lite.utils.ActivityStackManager import com.pengxh.kt.lite.utils.LoadState -import com.pengxh.kt.lite.utils.LoadingDialogHub +import com.pengxh.kt.lite.utils.LoadingDialog import com.pengxh.kt.lite.widget.TitleBarView import java.nio.charset.StandardCharsets @@ -46,15 +46,15 @@ override fun observeRequestState() { userViewModel.loadState.observe(this) { when (it) { - is LoadState.Loading -> LoadingDialogHub.show(this, "修改中,请稍后") + is LoadState.Loading -> LoadingDialog.show(this, "修改中,请稍后") is LoadState.Success -> { - LoadingDialogHub.dismiss() + LoadingDialog.dismiss() AuthenticationHelper.removeToken() this.navigatePageTo() ActivityStackManager.finishAllActivity() } - else -> LoadingDialogHub.dismiss() + else -> LoadingDialog.dismiss() } } } diff --git a/app/src/main/java/com/casic/app/smartwell/view/DeployedWellActivity.kt b/app/src/main/java/com/casic/app/smartwell/view/DeployedWellActivity.kt index fb4339c..28a5078 100644 --- a/app/src/main/java/com/casic/app/smartwell/view/DeployedWellActivity.kt +++ b/app/src/main/java/com/casic/app/smartwell/view/DeployedWellActivity.kt @@ -83,8 +83,8 @@ } //添加分割线 - binding.deployedListView.addItemDecoration( - RecyclerViewItemOffsets(0, 5, 0, 5) + binding.recyclerView.addItemDecoration( + RecyclerViewItemOffsets(0, 7, 0, 7) ) } @@ -149,12 +149,11 @@ } else { item.deep.toString() + "m" } - viewHolder.setText(R.id.wellNameView, item.wellName) + viewHolder.setText(R.id.wellTypeView, item.wellTypeName) .setText(R.id.wellDepthView, "深:${deep}") .setText(R.id.wellCodeView, "点位编号:${item.wellCode}") - .setText(R.id.wellTypeView, "点位类型:${item.wellTypeName}") .setText(R.id.ownerShipView, "权属单位:${item.deptName}") - .setText(R.id.wellLocationView, "点位置:${item.position}") + .setText(R.id.wellLocationView, "点位位置:${item.position}") .setOnClickListener( R.id.operationButton, object : View.OnClickListener { override fun onClick(v: View?) { @@ -207,7 +206,7 @@ }) } } - binding.deployedListView.adapter = deployAdapter + binding.recyclerView.adapter = deployAdapter deployAdapter.setOnItemClickedListener(object : NormalRecyclerAdapter.OnItemClickedListener { override fun onItemClicked(position: Int, t: WellListModel.DataBean.RowsBean) { diff --git a/app/src/main/java/com/casic/app/smartwell/view/LoginActivity.kt b/app/src/main/java/com/casic/app/smartwell/view/LoginActivity.kt index e4bb0e3..834527b 100644 --- a/app/src/main/java/com/casic/app/smartwell/view/LoginActivity.kt +++ b/app/src/main/java/com/casic/app/smartwell/view/LoginActivity.kt @@ -21,7 +21,7 @@ import com.pengxh.kt.lite.extensions.navigatePageTo import com.pengxh.kt.lite.extensions.readAssetsFile import com.pengxh.kt.lite.extensions.show -import com.pengxh.kt.lite.utils.LoadingDialogHub +import com.pengxh.kt.lite.utils.LoadingDialog import com.pengxh.kt.lite.utils.SaveKeyValues import kotlinx.coroutines.Dispatchers import kotlinx.coroutines.launch @@ -106,11 +106,11 @@ override fun observeRequestState() { authenticateViewModel.loadState.observe(this) { - LoadingDialogHub.show(this, "登录中,请稍后") + LoadingDialog.show(this, "登录中,请稍后") } loginViewModel.loadState.observe(this) { - LoadingDialogHub.dismiss() + LoadingDialog.dismiss() } } diff --git a/app/src/main/java/com/casic/app/smartwell/view/OrderCompletedDetailActivity.kt b/app/src/main/java/com/casic/app/smartwell/view/OrderCompletedDetailActivity.kt index db8ad1f..75cd905 100644 --- a/app/src/main/java/com/casic/app/smartwell/view/OrderCompletedDetailActivity.kt +++ b/app/src/main/java/com/casic/app/smartwell/view/OrderCompletedDetailActivity.kt @@ -17,7 +17,7 @@ import com.pengxh.kt.lite.extensions.show import com.pengxh.kt.lite.utils.Constant import com.pengxh.kt.lite.utils.LoadState -import com.pengxh.kt.lite.utils.LoadingDialogHub +import com.pengxh.kt.lite.utils.LoadingDialog import com.pengxh.kt.lite.widget.TitleBarView import com.pengxh.kt.lite.widget.dialog.AlertMessageDialog @@ -44,7 +44,7 @@ } override fun initOnCreate(savedInstanceState: Bundle?) { - val jobId = intent.getStringExtra(Constant.INTENT_PARAM)!! + val jobId = intent.getStringExtra(Constant.INTENT_PARAM_KEY)!! orderViewModel = ViewModelProvider(this)[OrderViewModel::class.java] orderViewModel.getWorkOrderDetail(jobId) orderViewModel.detailModel.observe(this) { @@ -154,8 +154,8 @@ override fun observeRequestState() { orderViewModel.loadState.observe(this) { when (it) { - is LoadState.Loading -> LoadingDialogHub.show(this, "数据加载中,请稍后") - else -> LoadingDialogHub.dismiss() + is LoadState.Loading -> LoadingDialog.show(this, "数据加载中,请稍后") + else -> LoadingDialog.dismiss() } } } diff --git a/app/src/main/java/com/casic/app/smartwell/view/OrderInHandleDetailActivity.kt b/app/src/main/java/com/casic/app/smartwell/view/OrderInHandleDetailActivity.kt index d70a979..04a7d5d 100644 --- a/app/src/main/java/com/casic/app/smartwell/view/OrderInHandleDetailActivity.kt +++ b/app/src/main/java/com/casic/app/smartwell/view/OrderInHandleDetailActivity.kt @@ -38,7 +38,7 @@ import com.pengxh.kt.lite.extensions.show import com.pengxh.kt.lite.utils.Constant import com.pengxh.kt.lite.utils.LoadState -import com.pengxh.kt.lite.utils.LoadingDialogHub +import com.pengxh.kt.lite.utils.LoadingDialog import com.pengxh.kt.lite.widget.TitleBarView import com.pengxh.kt.lite.widget.dialog.AlertControlDialog import com.pengxh.kt.lite.widget.dialog.AlertMessageDialog @@ -93,7 +93,7 @@ ) binding.addImageRecyclerView.adapter = imageAdapter - val jobId = intent.getStringExtra(Constant.INTENT_PARAM)!!//初始化图片九宫格 + val jobId = intent.getStringExtra(Constant.INTENT_PARAM_KEY)!!//初始化图片九宫格 orderViewModel.getWorkOrderDetail(jobId) orderViewModel.detailModel.observe(this) { if (it.code == 200) { @@ -312,41 +312,41 @@ override fun observeRequestState() { orderViewModel.loadState.observe(this) { when (it) { - is LoadState.Loading -> LoadingDialogHub.show(this, "数据加载中,请稍后") - else -> LoadingDialogHub.dismiss() + is LoadState.Loading -> LoadingDialog.show(this, "数据加载中,请稍后") + else -> LoadingDialog.dismiss() } } uploadImageViewModel.loadState.observe(this) { when (it) { - LoadState.Loading -> LoadingDialogHub.show(this, "图片上传中,请稍后...") - else -> LoadingDialogHub.dismiss() + LoadState.Loading -> LoadingDialog.show(this, "图片上传中,请稍后...") + else -> LoadingDialog.dismiss() } } //转单状态处理 operationViewModel.loadState.observe(this) { when (it) { - is LoadState.Loading -> LoadingDialogHub.show(this, "转单中,请稍后") + is LoadState.Loading -> LoadingDialog.show(this, "转单中,请稍后") is LoadState.Success -> { - LoadingDialogHub.dismiss() + LoadingDialog.dismiss() this.finish() } - else -> LoadingDialogHub.dismiss() + else -> LoadingDialog.dismiss() } } //处理完成工单状态处理 operationViewModel.loadState.observe(this) { when (it) { - is LoadState.Loading -> LoadingDialogHub.show(this, "处理中,请稍后") + is LoadState.Loading -> LoadingDialog.show(this, "处理中,请稍后") is LoadState.Success -> { - LoadingDialogHub.dismiss() + LoadingDialog.dismiss() this.finish() } - else -> LoadingDialogHub.dismiss() + else -> LoadingDialog.dismiss() } } } diff --git a/app/src/main/java/com/casic/app/smartwell/view/OrderNotConfirmedDetailActivity.kt b/app/src/main/java/com/casic/app/smartwell/view/OrderNotConfirmedDetailActivity.kt index 8e036d2..687ec86 100644 --- a/app/src/main/java/com/casic/app/smartwell/view/OrderNotConfirmedDetailActivity.kt +++ b/app/src/main/java/com/casic/app/smartwell/view/OrderNotConfirmedDetailActivity.kt @@ -36,7 +36,7 @@ import com.pengxh.kt.lite.extensions.show import com.pengxh.kt.lite.utils.Constant import com.pengxh.kt.lite.utils.LoadState -import com.pengxh.kt.lite.utils.LoadingDialogHub +import com.pengxh.kt.lite.utils.LoadingDialog import com.pengxh.kt.lite.widget.TitleBarView import com.pengxh.kt.lite.widget.dialog.AlertControlDialog import com.pengxh.kt.lite.widget.dialog.AlertMessageDialog @@ -80,7 +80,7 @@ } override fun initOnCreate(savedInstanceState: Bundle?) { - val jobId = intent.getStringExtra(Constant.INTENT_PARAM)!! + val jobId = intent.getStringExtra(Constant.INTENT_PARAM_KEY)!! //初始化图片九宫格 //左外边距,左内边距,右内边距,右外边距 val viewWidth = getScreenWidth() - (10 + 10 + 10 + 10).dp2px(this) @@ -263,41 +263,41 @@ //数据加载状态处理 orderViewModel.loadState.observe(this) { when (it) { - is LoadState.Loading -> LoadingDialogHub.show(this, "数据加载中,请稍后") - else -> LoadingDialogHub.dismiss() + is LoadState.Loading -> LoadingDialog.show(this, "数据加载中,请稍后") + else -> LoadingDialog.dismiss() } } uploadImageViewModel.loadState.observe(this) { when (it) { - LoadState.Loading -> LoadingDialogHub.show(this, "图片上传中,请稍后") - else -> LoadingDialogHub.dismiss() + LoadState.Loading -> LoadingDialog.show(this, "图片上传中,请稍后") + else -> LoadingDialog.dismiss() } } //转单状态处理 operationViewModel.loadState.observe(this) { when (it) { - is LoadState.Loading -> LoadingDialogHub.show(this, "转单中,请稍后") + is LoadState.Loading -> LoadingDialog.show(this, "转单中,请稍后") is LoadState.Success -> { - LoadingDialogHub.dismiss() + LoadingDialog.dismiss() this.finish() } - else -> LoadingDialogHub.dismiss() + else -> LoadingDialog.dismiss() } } //确认工单状态处理 operationViewModel.loadState.observe(this) { when (it) { - is LoadState.Loading -> LoadingDialogHub.show(this, "处理中,请稍后") + is LoadState.Loading -> LoadingDialog.show(this, "处理中,请稍后") is LoadState.Success -> { - LoadingDialogHub.dismiss() + LoadingDialog.dismiss() this.finish() } - else -> LoadingDialogHub.dismiss() + else -> LoadingDialog.dismiss() } } } diff --git a/app/src/main/java/com/casic/app/smartwell/view/OrderNotProcessedDetailActivity.kt b/app/src/main/java/com/casic/app/smartwell/view/OrderNotProcessedDetailActivity.kt index d3f22dc..0c97a52 100644 --- a/app/src/main/java/com/casic/app/smartwell/view/OrderNotProcessedDetailActivity.kt +++ b/app/src/main/java/com/casic/app/smartwell/view/OrderNotProcessedDetailActivity.kt @@ -18,7 +18,7 @@ import com.pengxh.kt.lite.extensions.show import com.pengxh.kt.lite.utils.Constant import com.pengxh.kt.lite.utils.LoadState -import com.pengxh.kt.lite.utils.LoadingDialogHub +import com.pengxh.kt.lite.utils.LoadingDialog import com.pengxh.kt.lite.widget.TitleBarView import com.pengxh.kt.lite.widget.dialog.AlertControlDialog import com.pengxh.kt.lite.widget.dialog.AlertMessageDialog @@ -50,7 +50,7 @@ } override fun initOnCreate(savedInstanceState: Bundle?) { - this.jobId = intent.getStringExtra(Constant.INTENT_PARAM)!! + this.jobId = intent.getStringExtra(Constant.INTENT_PARAM_KEY)!! orderViewModel = ViewModelProvider(this)[OrderViewModel::class.java] operationViewModel = ViewModelProvider(this)[OperationViewModel::class.java] wellViewModel = ViewModelProvider(this)[WellViewModel::class.java] @@ -162,21 +162,21 @@ //数据加载状态处理 orderViewModel.loadState.observe(this) { when (it) { - is LoadState.Loading -> LoadingDialogHub.show(this, "数据加载中,请稍后") - else -> LoadingDialogHub.dismiss() + is LoadState.Loading -> LoadingDialog.show(this, "数据加载中,请稍后") + else -> LoadingDialog.dismiss() } } //接单状态处理 operationViewModel.loadState.observe(this) { when (it) { - is LoadState.Loading -> LoadingDialogHub.show(this, "接单中,请稍后") + is LoadState.Loading -> LoadingDialog.show(this, "接单中,请稍后") is LoadState.Success -> { - LoadingDialogHub.dismiss() + LoadingDialog.dismiss() this.finish() } - else -> LoadingDialogHub.dismiss() + else -> LoadingDialog.dismiss() } } } diff --git a/app/src/main/java/com/casic/app/smartwell/view/SearchResultActivity.kt b/app/src/main/java/com/casic/app/smartwell/view/SearchResultActivity.kt index 6a92917..4f3a674 100644 --- a/app/src/main/java/com/casic/app/smartwell/view/SearchResultActivity.kt +++ b/app/src/main/java/com/casic/app/smartwell/view/SearchResultActivity.kt @@ -19,7 +19,7 @@ import com.pengxh.kt.lite.extensions.show import com.pengxh.kt.lite.utils.Constant import com.pengxh.kt.lite.utils.LoadState -import com.pengxh.kt.lite.utils.LoadingDialogHub +import com.pengxh.kt.lite.utils.LoadingDialog import com.pengxh.kt.lite.utils.WeakReferenceHandler import com.pengxh.kt.lite.widget.TitleBarView import com.pengxh.kt.lite.widget.dialog.AlertControlDialog @@ -56,7 +56,7 @@ } override fun initOnCreate(savedInstanceState: Bundle?) { - args = intent.getStringArrayListExtra(Constant.INTENT_PARAM)!! + args = intent.getStringArrayListExtra(Constant.INTENT_PARAM_KEY)!! orderViewModel = ViewModelProvider(this)[OrderViewModel::class.java] operationViewModel = ViewModelProvider(this)[OperationViewModel::class.java] @@ -101,24 +101,24 @@ } } - binding.resultRecyclerView.addItemDecoration( - RecyclerViewItemOffsets(0, 5, 0, 5) + binding.recyclerView.addItemDecoration( + RecyclerViewItemOffsets(0, 7, 0, 7) ) } override fun observeRequestState() { orderViewModel.loadState.observe(this) { when (it) { - is LoadState.Loading -> LoadingDialogHub.show(this, "数据加载中,请稍后") - else -> LoadingDialogHub.dismiss() + is LoadState.Loading -> LoadingDialog.show(this, "数据加载中,请稍后") + else -> LoadingDialog.dismiss() } } //接单状态处理 operationViewModel.loadState.observe(this) { when (it) { - is LoadState.Loading -> LoadingDialogHub.show(this, "接单中,请稍后") + is LoadState.Loading -> LoadingDialog.show(this, "接单中,请稍后") is LoadState.Success -> { - LoadingDialogHub.dismiss() + LoadingDialog.dismiss() //接单成功之后刷新列表 dataBeans.removeAt(clickedPosition) searchResultAdapter.notifyItemRemoved(clickedPosition) @@ -127,7 +127,7 @@ ) } - else -> LoadingDialogHub.dismiss() + else -> LoadingDialog.dismiss() } } } @@ -162,7 +162,7 @@ } else { binding.emptyInclude.emptyView.hide() searchResultAdapter = SearchResultAdapter(this, dataBeans) - binding.resultRecyclerView.adapter = searchResultAdapter + binding.recyclerView.adapter = searchResultAdapter searchResultAdapter.setOnItemClickListener(object : SearchResultAdapter.OnItemClickListener { override fun onClicked(position: Int) { diff --git a/app/src/main/java/com/casic/app/smartwell/view/UnDeployWellActivity.kt b/app/src/main/java/com/casic/app/smartwell/view/UnDeployWellActivity.kt index 7f7cd3c..555c278 100644 --- a/app/src/main/java/com/casic/app/smartwell/view/UnDeployWellActivity.kt +++ b/app/src/main/java/com/casic/app/smartwell/view/UnDeployWellActivity.kt @@ -81,8 +81,8 @@ } } - binding.undeployListView.addItemDecoration( - RecyclerViewItemOffsets(0, 5, 0, 5) + binding.recyclerView.addItemDecoration( + RecyclerViewItemOffsets(0, 7, 0, 7) ) } @@ -147,12 +147,11 @@ } else { item.deep.toString() + "m" } - viewHolder.setText(R.id.wellNameView, item.wellName) + viewHolder.setText(R.id.wellTypeView, item.wellTypeName) .setText(R.id.wellDepthView, "深:${deep}") .setText(R.id.wellCodeView, "点位编号:${item.wellCode}") - .setText(R.id.wellTypeView, "点位类型:${item.wellTypeName}") .setText(R.id.ownerShipView, "权属单位:${item.deptName}") - .setText(R.id.wellLocationView, "点位置:${item.position}") + .setText(R.id.wellLocationView, "点位位置:${item.position}") .setOnClickListener( R.id.operationButton, object : View.OnClickListener { override fun onClick(v: View?) { @@ -185,7 +184,7 @@ ) } } - binding.undeployListView.adapter = unDeployAdapter + binding.recyclerView.adapter = unDeployAdapter unDeployAdapter.setOnItemClickedListener(object : NormalRecyclerAdapter.OnItemClickedListener { override fun onItemClicked(position: Int, t: WellListModel.DataBean.RowsBean) { diff --git a/app/src/main/java/com/casic/app/smartwell/view/WellDetailActivity.kt b/app/src/main/java/com/casic/app/smartwell/view/WellDetailActivity.kt index b50d067..eb8b468 100644 --- a/app/src/main/java/com/casic/app/smartwell/view/WellDetailActivity.kt +++ b/app/src/main/java/com/casic/app/smartwell/view/WellDetailActivity.kt @@ -16,7 +16,7 @@ import com.pengxh.kt.lite.extensions.show import com.pengxh.kt.lite.utils.Constant import com.pengxh.kt.lite.utils.LoadState -import com.pengxh.kt.lite.utils.LoadingDialogHub +import com.pengxh.kt.lite.utils.LoadingDialog import com.pengxh.kt.lite.widget.TitleBarView import com.pengxh.kt.lite.widget.dialog.AlertMessageDialog @@ -44,7 +44,7 @@ } override fun initOnCreate(savedInstanceState: Bundle?) { - val wellId = intent.getStringExtra(Constant.INTENT_PARAM)!! + val wellId = intent.getStringExtra(Constant.INTENT_PARAM_KEY)!! wellViewModel = ViewModelProvider(this)[WellViewModel::class.java] wellViewModel.getWellDetail(wellId) wellViewModel.wellDetailModel.observe(this) { @@ -132,8 +132,8 @@ override fun observeRequestState() { wellViewModel.loadState.observe(this) { when (it) { - is LoadState.Loading -> LoadingDialogHub.show(this, "数据加载中,请稍后") - else -> LoadingDialogHub.dismiss() + is LoadState.Loading -> LoadingDialog.show(this, "数据加载中,请稍后") + else -> LoadingDialog.dismiss() } } } diff --git a/app/src/main/java/com/casic/app/smartwell/view/WellManagementActivity.kt b/app/src/main/java/com/casic/app/smartwell/view/WellManagementActivity.kt index 084da95..457096b 100644 --- a/app/src/main/java/com/casic/app/smartwell/view/WellManagementActivity.kt +++ b/app/src/main/java/com/casic/app/smartwell/view/WellManagementActivity.kt @@ -94,8 +94,8 @@ } } - binding.wellListView.addItemDecoration( - RecyclerViewItemOffsets(0, 5, 0, 5) + binding.recyclerView.addItemDecoration( + RecyclerViewItemOffsets(0, 7, 0, 7) ) } @@ -175,13 +175,12 @@ } else { item.deep.toString() + "m" } - viewHolder.setText(R.id.wellNameView, item.wellName) + viewHolder.setText(R.id.wellTypeView, item.wellTypeName) .setText(R.id.wellStateView, "已${item.bfztName}") .setText(R.id.wellDepthView, "深:${deep}") .setText(R.id.wellCodeView, "点位编号:${item.wellCode}") - .setText(R.id.wellTypeView, "点位类型:${item.wellTypeName}") .setText(R.id.ownerShipView, "权属单位:${item.deptName}") - .setText(R.id.wellLocationView, "点位置:${item.position}") + .setText(R.id.wellLocationView, "点位位置:${item.position}") .setOnClickListener( R.id.navigationButton, object : View.OnClickListener { override fun onClick(v: View?) { @@ -200,7 +199,7 @@ ) } } - binding.wellListView.adapter = wellListAdapter + binding.recyclerView.adapter = wellListAdapter wellListAdapter.setOnItemClickedListener(object : NormalRecyclerAdapter.OnItemClickedListener { override fun onItemClicked(position: Int, t: WellListModel.DataBean.RowsBean) { diff --git a/app/src/main/java/com/casic/app/smartwell/view/WellMonitorActivity.kt b/app/src/main/java/com/casic/app/smartwell/view/WellMonitorActivity.kt index e3573eb..b87bdb7 100644 --- a/app/src/main/java/com/casic/app/smartwell/view/WellMonitorActivity.kt +++ b/app/src/main/java/com/casic/app/smartwell/view/WellMonitorActivity.kt @@ -11,7 +11,7 @@ import com.pengxh.kt.lite.base.KotlinBaseActivity import com.pengxh.kt.lite.utils.Constant import com.pengxh.kt.lite.utils.LoadState -import com.pengxh.kt.lite.utils.LoadingDialogHub +import com.pengxh.kt.lite.utils.LoadingDialog import com.pengxh.kt.lite.widget.TitleBarView class WellMonitorActivity : KotlinBaseActivity() { @@ -36,7 +36,7 @@ } override fun initOnCreate(savedInstanceState: Bundle?) { - val wellId = intent.getStringExtra(Constant.INTENT_PARAM)!! + val wellId = intent.getStringExtra(Constant.INTENT_PARAM_KEY)!! wellViewModel = ViewModelProvider(this)[WellViewModel::class.java] wellViewModel.getMonitorResult(wellId) wellViewModel.monitorModel.observe(this) { @@ -56,8 +56,8 @@ override fun observeRequestState() { wellViewModel.loadState.observe(this) { when (it) { - is LoadState.Loading -> LoadingDialogHub.show(this, "数据加载中,请稍后") - else -> LoadingDialogHub.dismiss() + is LoadState.Loading -> LoadingDialog.show(this, "数据加载中,请稍后") + else -> LoadingDialog.dismiss() } } } diff --git a/app/src/main/java/com/casic/app/smartwell/view/WellOperationActivity.kt b/app/src/main/java/com/casic/app/smartwell/view/WellOperationActivity.kt index 8d333bf..347ebb6 100644 --- a/app/src/main/java/com/casic/app/smartwell/view/WellOperationActivity.kt +++ b/app/src/main/java/com/casic/app/smartwell/view/WellOperationActivity.kt @@ -23,7 +23,7 @@ import com.pengxh.kt.lite.extensions.navigatePageTo import com.pengxh.kt.lite.extensions.show import com.pengxh.kt.lite.utils.LoadState -import com.pengxh.kt.lite.utils.LoadingDialogHub +import com.pengxh.kt.lite.utils.LoadingDialog import com.pengxh.kt.lite.utils.WeakReferenceHandler import com.pengxh.kt.lite.widget.dialog.AlertControlDialog @@ -109,8 +109,8 @@ } } - binding.operationListView.addItemDecoration( - RecyclerViewItemOffsets(0, 5, 0, 5) + binding.recyclerView.addItemDecoration( + RecyclerViewItemOffsets(0, 7, 0, 7) ) } @@ -123,13 +123,13 @@ override fun observeRequestState() { wellViewModel.loadState.observe(this) { when (it) { - is LoadState.Loading -> LoadingDialogHub.show(this, "处理中,请稍后") + is LoadState.Loading -> LoadingDialog.show(this, "处理中,请稍后") is LoadState.Success -> { - LoadingDialogHub.dismiss() + LoadingDialog.dismiss() wellOperationAdapter.notifyItemChanged(clickedPosition) } - else -> LoadingDialogHub.dismiss() + else -> LoadingDialog.dismiss() } } } @@ -203,24 +203,23 @@ if (item.bfztName == "布防") { viewHolder.setImageResource( R.id.wellStateView, R.drawable.bg_solid_text_green_radius_5 - ).setText(R.id.wellStateView, "撤防") + ).setText(R.id.operationButton, "撤防") } else { viewHolder.setImageResource( R.id.wellStateView, R.drawable.bg_solid_text_red_radius_5 - ).setText(R.id.wellStateView, "布防") + ).setText(R.id.operationButton, "布防") } val deep = if (item.deep.toString().isBlank()) { "未知" } else { item.deep.toString() + "m" } - viewHolder.setText(R.id.wellNameView, item.wellName) + viewHolder.setText(R.id.wellTypeView, item.wellTypeName) .setText(R.id.wellStateView, "已${item.bfztName}") .setText(R.id.wellDepthView, "深:${deep}") .setText(R.id.wellCodeView, "点位编号:${item.wellCode}") - .setText(R.id.wellTypeView, "点位类型:${item.wellTypeName}") .setText(R.id.ownerShipView, "权属单位:${item.deptName}") - .setText(R.id.wellLocationView, "点位置:${item.position}") + .setText(R.id.wellLocationView, "点位位置:${item.position}") .setOnClickListener( R.id.operationButton, object : View.OnClickListener { override fun onClick(v: View?) { @@ -280,7 +279,7 @@ ) } } - binding.operationListView.adapter = wellOperationAdapter + binding.recyclerView.adapter = wellOperationAdapter wellOperationAdapter.setOnItemClickedListener(object : NormalRecyclerAdapter.OnItemClickedListener { override fun onItemClicked(position: Int, t: WellListModel.DataBean.RowsBean) { diff --git a/app/src/main/res/drawable/ic_down.xml b/app/src/main/res/drawable/ic_down.xml index 20e6476..6987e6c 100644 --- a/app/src/main/res/drawable/ic_down.xml +++ b/app/src/main/res/drawable/ic_down.xml @@ -1,6 +1,6 @@ + + diff --git a/app/src/main/res/layout/activity_about_us.xml b/app/src/main/res/layout/activity_about_us.xml index 9091a00..d5fbd0d 100644 --- a/app/src/main/res/layout/activity_about_us.xml +++ b/app/src/main/res/layout/activity_about_us.xml @@ -12,13 +12,7 @@ android:layout_width="match_parent" android:layout_height="wrap_content" android:background="@color/mainThemeColor" - app:tbv_left_image="@drawable/ic_title_left" - app:tbv_only_show_title="false" - app:tbv_show_left_image="true" - app:tbv_show_right_image="false" - app:tbv_text="关于我们" - app:tbv_text_color="@color/white" - app:tbv_text_size="@dimen/sp_18" /> + app:tbv_text="关于我们" /> + app:tbv_text="修改密码" /> + app:tbv_text="布防列表" /> + app:tbv_text="帮助中心" /> + app:tbv_text="工单详情" /> + app:tbv_text="工单详情" /> + app:tbv_text="工单详情" /> - + + android:value="ee96d8b5e12de3fbb29949efd57418a8" /> () @@ -150,7 +158,7 @@ val cameraPosition = CameraPosition(centerLatLng, 14f, 0f, 0f) val cameraUpdate = CameraUpdateFactory.newCameraPosition(cameraPosition) withContext(Dispatchers.Main) { - LoadingDialogHub.dismiss() + LoadingDialog.dismiss() aMap.animateCamera(cameraUpdate, 1500, null) } } @@ -239,11 +247,6 @@ } override fun initEvent() { - binding.rightOptionView.setOnClickListener { - val x = binding.rightOptionView.width - easyPopupWindow.width - easyPopupWindow.showAsDropDown(binding.rightOptionView, x, 0) - } - //撤防点位 binding.unDeployedLayout.setOnClickListener { requireContext().navigatePageTo() @@ -263,11 +266,11 @@ override fun observeRequestState() { wellViewModel.loadState.observe(this) { when (it) { - is LoadState.Loading -> LoadingDialogHub.show( + is LoadState.Loading -> LoadingDialog.show( requireActivity(), "数据加载中,请稍后..." ) - else -> LoadingDialogHub.dismiss() + else -> LoadingDialog.dismiss() } } } @@ -376,7 +379,7 @@ }).build().show() } }) - infoPopup.showAsDropDown(binding.rightOptionView) +// infoPopup.showAsDropDown(binding.rightOptionView) } override fun onCameraChange(p0: CameraPosition?) { diff --git a/app/src/main/java/com/casic/app/smartwell/fragment/HomePageNoClusterFragment.kt b/app/src/main/java/com/casic/app/smartwell/fragment/HomePageNoClusterFragment.kt index 802426a..b25f743 100644 --- a/app/src/main/java/com/casic/app/smartwell/fragment/HomePageNoClusterFragment.kt +++ b/app/src/main/java/com/casic/app/smartwell/fragment/HomePageNoClusterFragment.kt @@ -38,8 +38,9 @@ import com.pengxh.kt.lite.extensions.navigatePageTo import com.pengxh.kt.lite.extensions.show import com.pengxh.kt.lite.utils.LoadState -import com.pengxh.kt.lite.utils.LoadingDialogHub +import com.pengxh.kt.lite.utils.LoadingDialog import com.pengxh.kt.lite.widget.EasyPopupWindow +import com.pengxh.kt.lite.widget.TitleBarView import com.pengxh.kt.lite.widget.dialog.AlertControlDialog import kotlinx.coroutines.Dispatchers import kotlinx.coroutines.launch @@ -78,7 +79,15 @@ override fun setupTopBarLayout() { binding.rootView.initImmersionBar(this, false, R.color.mainThemeColor) - binding.titleView.text = "首页" + binding.titleView.setOnClickListener(object : TitleBarView.OnClickListener { + override fun onLeftClick() { + + } + + override fun onRightClick() { + easyPopupWindow.showAsDropDown(binding.titleView, binding.titleView.width, 0) + } + }) } override fun initOnCreate(savedInstanceState: Bundle?) { @@ -112,7 +121,7 @@ //渲染井位置 lifecycleScope.launch(Dispatchers.Main) { - LoadingDialogHub.show(requireActivity(), "数据加载中,请稍后") + LoadingDialog.show(requireActivity(), "数据加载中,请稍后") withContext(Dispatchers.IO) { //取Well缓存 val allMarkerOptions = ArrayList() @@ -144,7 +153,7 @@ val cameraPosition = CameraPosition(centerLatLng, 14f, 0f, 0f) val cameraUpdate = CameraUpdateFactory.newCameraPosition(cameraPosition) withContext(Dispatchers.Main) { - LoadingDialogHub.dismiss() + LoadingDialog.dismiss() aMap.animateCamera(cameraUpdate, 1500, null) } } @@ -238,11 +247,6 @@ } override fun initEvent() { - binding.rightOptionView.setOnClickListener { - val x = binding.rightOptionView.width - easyPopupWindow.width - easyPopupWindow.showAsDropDown(binding.rightOptionView, x, 0) - } - //撤防点位 binding.unDeployedLayout.setOnClickListener { requireContext().navigatePageTo() @@ -262,11 +266,11 @@ override fun observeRequestState() { wellViewModel.loadState.observe(this) { when (it) { - is LoadState.Loading -> LoadingDialogHub.show( + is LoadState.Loading -> LoadingDialog.show( requireActivity(), "数据加载中,请稍后..." ) - else -> LoadingDialogHub.dismiss() + else -> LoadingDialog.dismiss() } } } diff --git a/app/src/main/java/com/casic/app/smartwell/fragment/MinePageFragment.kt b/app/src/main/java/com/casic/app/smartwell/fragment/MinePageFragment.kt index 09a570c..dcb48f8 100644 --- a/app/src/main/java/com/casic/app/smartwell/fragment/MinePageFragment.kt +++ b/app/src/main/java/com/casic/app/smartwell/fragment/MinePageFragment.kt @@ -35,7 +35,7 @@ import com.pengxh.kt.lite.utils.ActivityStackManager import com.pengxh.kt.lite.utils.FileDownloadManager import com.pengxh.kt.lite.utils.LoadState -import com.pengxh.kt.lite.utils.LoadingDialogHub +import com.pengxh.kt.lite.utils.LoadingDialog import com.pengxh.kt.lite.widget.dialog.AlertControlDialog import com.pengxh.kt.lite.widget.dialog.BottomActionSheet import kotlinx.coroutines.Dispatchers @@ -60,7 +60,6 @@ override fun setupTopBarLayout() { binding.rootView.initImmersionBar(this, false, R.color.mainThemeColor) - binding.titleInclude.titleView.text = "我的" } override fun initOnCreate(savedInstanceState: Bundle?) { @@ -155,27 +154,27 @@ override fun observeRequestState() { userViewModel.loadState.observe(this) { when (it) { - is LoadState.Loading -> LoadingDialogHub.show( + is LoadState.Loading -> LoadingDialog.show( requireActivity(), "检查版本中,请稍后" ) - else -> LoadingDialogHub.dismiss() + else -> LoadingDialog.dismiss() } } wellViewModel.loadState.observe(this) { when (it) { - is LoadState.Loading -> LoadingDialogHub.show( + is LoadState.Loading -> LoadingDialog.show( requireActivity(), "数据更新中,请稍后" ) is LoadState.Fail -> { - LoadingDialogHub.dismiss() + LoadingDialog.dismiss() "数据更新超时".show(requireContext()) } else -> { - LoadingDialogHub.dismiss() + LoadingDialog.dismiss() AlertControlDialog.Builder().setContext(requireContext()).setTitle("温馨提示") .setMessage("数据更新成功,请重启应用").setNegativeButton("取消") .setPositiveButton("确定").setOnDialogButtonClickListener(object : @@ -197,17 +196,17 @@ lineViewModel.loadState.observe(this) { when (it) { - is LoadState.Loading -> LoadingDialogHub.show( + is LoadState.Loading -> LoadingDialog.show( requireActivity(), "数据更新中,请稍后" ) is LoadState.Fail -> { - LoadingDialogHub.dismiss() + LoadingDialog.dismiss() "数据更新超时".show(requireContext()) } else -> { - LoadingDialogHub.dismiss() + LoadingDialog.dismiss() AlertControlDialog.Builder().setContext(requireContext()).setTitle("温馨提示") .setMessage("数据更新成功,请重启应用").setNegativeButton("取消") .setPositiveButton("确定").setOnDialogButtonClickListener(object : diff --git a/app/src/main/java/com/casic/app/smartwell/fragment/NoticePageFragment.kt b/app/src/main/java/com/casic/app/smartwell/fragment/NoticePageFragment.kt index 171b555..3c93f54 100644 --- a/app/src/main/java/com/casic/app/smartwell/fragment/NoticePageFragment.kt +++ b/app/src/main/java/com/casic/app/smartwell/fragment/NoticePageFragment.kt @@ -48,7 +48,6 @@ override fun setupTopBarLayout() { binding.rootView.initImmersionBar(this, false, R.color.mainThemeColor) - binding.titleInclude.titleView.text = "消息" } override fun initOnCreate(savedInstanceState: Bundle?) { diff --git a/app/src/main/java/com/casic/app/smartwell/fragment/OrderListFragment.kt b/app/src/main/java/com/casic/app/smartwell/fragment/OrderListFragment.kt index 93ff35b..5e38acb 100644 --- a/app/src/main/java/com/casic/app/smartwell/fragment/OrderListFragment.kt +++ b/app/src/main/java/com/casic/app/smartwell/fragment/OrderListFragment.kt @@ -12,6 +12,7 @@ import com.casic.app.smartwell.view.SearchOrderActivity import com.pengxh.kt.lite.base.KotlinBaseFragment import com.pengxh.kt.lite.extensions.navigatePageTo +import com.pengxh.kt.lite.widget.TitleBarView class OrderListFragment : KotlinBaseFragment() { @@ -25,15 +26,22 @@ } override fun initViewBinding( - inflater: LayoutInflater, - container: ViewGroup? + inflater: LayoutInflater, container: ViewGroup? ): FragmentOrderBinding { return FragmentOrderBinding.inflate(inflater, container, false) } override fun setupTopBarLayout() { binding.rootView.initImmersionBar(this, false, R.color.mainThemeColor) - binding.titleView.text = "工单" + binding.titleView.setOnClickListener(object : TitleBarView.OnClickListener { + override fun onLeftClick() { + + } + + override fun onRightClick() { + requireContext().navigatePageTo() + } + }) } override fun initOnCreate(savedInstanceState: Bundle?) { @@ -51,8 +59,6 @@ } override fun initEvent() { - binding.rightOptionView.setOnClickListener { - requireContext().navigatePageTo() - } + } } \ No newline at end of file diff --git a/app/src/main/java/com/casic/app/smartwell/fragment/OrderNotProcessedFragment.kt b/app/src/main/java/com/casic/app/smartwell/fragment/OrderNotProcessedFragment.kt index 0b3d09d..2b6f21d 100644 --- a/app/src/main/java/com/casic/app/smartwell/fragment/OrderNotProcessedFragment.kt +++ b/app/src/main/java/com/casic/app/smartwell/fragment/OrderNotProcessedFragment.kt @@ -18,7 +18,7 @@ import com.pengxh.kt.lite.extensions.navigatePageTo import com.pengxh.kt.lite.extensions.show import com.pengxh.kt.lite.utils.LoadState -import com.pengxh.kt.lite.utils.LoadingDialogHub +import com.pengxh.kt.lite.utils.LoadingDialog import com.pengxh.kt.lite.utils.WeakReferenceHandler import com.pengxh.kt.lite.widget.dialog.AlertControlDialog @@ -78,8 +78,8 @@ operationViewModel = ViewModelProvider(this)[OperationViewModel::class.java] - binding.notProcessedView.addItemDecoration( - RecyclerViewItemOffsets(0, 5, 0, 5) + binding.recyclerView.addItemDecoration( + RecyclerViewItemOffsets(0, 7, 0, 7) ) } @@ -87,9 +87,9 @@ //接单状态处理 operationViewModel.loadState.observe(this) { when (it) { - is LoadState.Loading -> LoadingDialogHub.show(requireActivity(), "接单中,请稍后") + is LoadState.Loading -> LoadingDialog.show(requireActivity(), "接单中,请稍后") is LoadState.Success -> { - LoadingDialogHub.dismiss() + LoadingDialog.dismiss() //接单成功之后刷新列表 dataBeans.removeAt(clickedPosition) notProcessedAdapter.notifyItemRemoved(clickedPosition) @@ -98,7 +98,7 @@ ) } - else -> LoadingDialogHub.dismiss() + else -> LoadingDialog.dismiss() } } } @@ -131,7 +131,7 @@ } else { binding.emptyInclude.emptyView.hide() notProcessedAdapter = OrderNotProcessedAdapter(requireContext(), dataBeans) - binding.notProcessedView.adapter = notProcessedAdapter + binding.recyclerView.adapter = notProcessedAdapter notProcessedAdapter.setOnItemClickListener(object : OrderNotProcessedAdapter.OnItemClickListener { override fun onClicked(position: Int) { diff --git a/app/src/main/java/com/casic/app/smartwell/fragment/OvertimeNotAcceptFragment.kt b/app/src/main/java/com/casic/app/smartwell/fragment/OvertimeNotAcceptFragment.kt index a198545..9b318ca 100644 --- a/app/src/main/java/com/casic/app/smartwell/fragment/OvertimeNotAcceptFragment.kt +++ b/app/src/main/java/com/casic/app/smartwell/fragment/OvertimeNotAcceptFragment.kt @@ -18,7 +18,7 @@ import com.pengxh.kt.lite.extensions.navigatePageTo import com.pengxh.kt.lite.extensions.show import com.pengxh.kt.lite.utils.LoadState -import com.pengxh.kt.lite.utils.LoadingDialogHub +import com.pengxh.kt.lite.utils.LoadingDialog import com.pengxh.kt.lite.utils.WeakReferenceHandler import com.pengxh.kt.lite.widget.dialog.AlertControlDialog @@ -81,8 +81,8 @@ operationViewModel = ViewModelProvider(this)[OperationViewModel::class.java] - binding.notProcessedView.addItemDecoration( - RecyclerViewItemOffsets(0, 5, 0, 5) + binding.recyclerView.addItemDecoration( + RecyclerViewItemOffsets(0, 7, 0, 7) ) } @@ -90,9 +90,9 @@ //接单状态处理 operationViewModel.loadState.observe(this) { when (it) { - is LoadState.Loading -> LoadingDialogHub.show(requireActivity(), "接单中,请稍后") + is LoadState.Loading -> LoadingDialog.show(requireActivity(), "接单中,请稍后") is LoadState.Success -> { - LoadingDialogHub.dismiss() + LoadingDialog.dismiss() //接单成功之后刷新列表 dataBeans.removeAt(clickedPosition) notProcessedAdapter.notifyItemRemoved(clickedPosition) @@ -101,7 +101,7 @@ ) } - else -> LoadingDialogHub.dismiss() + else -> LoadingDialog.dismiss() } } } @@ -134,7 +134,7 @@ } else { binding.emptyInclude.emptyView.hide() notProcessedAdapter = OrderNotProcessedAdapter(requireContext(), dataBeans) - binding.notProcessedView.adapter = notProcessedAdapter + binding.recyclerView.adapter = notProcessedAdapter notProcessedAdapter.setOnItemClickListener(object : OrderNotProcessedAdapter.OnItemClickListener { override fun onClicked(position: Int) { diff --git a/app/src/main/java/com/casic/app/smartwell/greendao/DaoMaster.java b/app/src/main/java/com/casic/app/smartwell/greendao/DaoMaster.java index fdcf3a7..1e52b74 100644 --- a/app/src/main/java/com/casic/app/smartwell/greendao/DaoMaster.java +++ b/app/src/main/java/com/casic/app/smartwell/greendao/DaoMaster.java @@ -13,25 +13,20 @@ // THIS CODE IS GENERATED BY greenDAO, DO NOT EDIT. - /** * Master of DAO (schema version 4): knows all DAOs. */ public class DaoMaster extends AbstractDaoMaster { public static final int SCHEMA_VERSION = 4; - /** - * Creates underlying database table using DAOs. - */ + /** Creates underlying database table using DAOs. */ public static void createAllTables(Database db, boolean ifNotExists) { MapWellLocalBeanDao.createTable(db, ifNotExists); NoticeLocaleBeanDao.createTable(db, ifNotExists); PipeLocalBeanDao.createTable(db, ifNotExists); } - /** - * Drops underlying database table using DAOs. - */ + /** Drops underlying database table using DAOs. */ public static void dropAllTables(Database db, boolean ifExists) { MapWellLocalBeanDao.dropTable(db, ifExists); NoticeLocaleBeanDao.dropTable(db, ifExists); @@ -86,9 +81,7 @@ } } - /** - * WARNING: Drops all table on Upgrade! Use only during development. - */ + /** WARNING: Drops all table on Upgrade! Use only during development. */ public static class DevOpenHelper extends OpenHelper { public DevOpenHelper(Context context, String name) { super(context, name); diff --git a/app/src/main/java/com/casic/app/smartwell/greendao/DaoSession.java b/app/src/main/java/com/casic/app/smartwell/greendao/DaoSession.java index 0b36d17..3e40e3b 100644 --- a/app/src/main/java/com/casic/app/smartwell/greendao/DaoSession.java +++ b/app/src/main/java/com/casic/app/smartwell/greendao/DaoSession.java @@ -16,7 +16,7 @@ /** * {@inheritDoc} - * + * * @see org.greenrobot.greendao.AbstractDaoSession */ public class DaoSession extends AbstractDaoSession { @@ -50,7 +50,7 @@ registerDao(NoticeLocaleBean.class, noticeLocaleBeanDao); registerDao(PipeLocalBean.class, pipeLocalBeanDao); } - + public void clear() { mapWellLocalBeanDaoConfig.clearIdentityScope(); noticeLocaleBeanDaoConfig.clearIdentityScope(); diff --git a/app/src/main/java/com/casic/app/smartwell/greendao/MapWellLocalBeanDao.java b/app/src/main/java/com/casic/app/smartwell/greendao/MapWellLocalBeanDao.java index 8908fda..407bc92 100644 --- a/app/src/main/java/com/casic/app/smartwell/greendao/MapWellLocalBeanDao.java +++ b/app/src/main/java/com/casic/app/smartwell/greendao/MapWellLocalBeanDao.java @@ -12,10 +12,9 @@ import org.greenrobot.greendao.internal.DaoConfig; // THIS CODE IS GENERATED BY greenDAO, DO NOT EDIT. - -/** +/** * DAO for table "MAP_WELL_LOCAL_BEAN". - */ +*/ public class MapWellLocalBeanDao extends AbstractDao { public static final String TABLENAME = "MAP_WELL_LOCAL_BEAN"; @@ -57,16 +56,14 @@ public MapWellLocalBeanDao(DaoConfig config) { super(config); } - + public MapWellLocalBeanDao(DaoConfig config, DaoSession daoSession) { super(config, daoSession); } - /** - * Creates the underlying database table. - */ + /** Creates the underlying database table. */ public static void createTable(Database db, boolean ifNotExists) { - String constraint = ifNotExists ? "IF NOT EXISTS " : ""; + String constraint = ifNotExists? "IF NOT EXISTS ": ""; db.execSQL("CREATE TABLE " + constraint + "\"MAP_WELL_LOCAL_BEAN\" (" + // "\"_id\" INTEGER PRIMARY KEY AUTOINCREMENT ," + // 0: kId "\"AREA\" TEXT," + // 1: area @@ -96,9 +93,7 @@ "\"WELL_TYPE_NAME\" TEXT);"); // 25: wellTypeName } - /** - * Drops the underlying database table. - */ + /** Drops the underlying database table. */ public static void dropTable(Database db, boolean ifExists) { String sql = "DROP TABLE " + (ifExists ? "IF EXISTS " : "") + "\"MAP_WELL_LOCAL_BEAN\""; db.execSQL(sql); @@ -107,132 +102,132 @@ @Override protected final void bindValues(DatabaseStatement stmt, MapWellLocalBean entity) { stmt.clearBindings(); - + Long kId = entity.getKId(); if (kId != null) { stmt.bindLong(1, kId); } - + String area = entity.getArea(); if (area != null) { stmt.bindString(2, area); } - + String bfzt = entity.getBfzt(); if (bfzt != null) { stmt.bindString(3, bfzt); } - + String bfztName = entity.getBfztName(); if (bfztName != null) { stmt.bindString(4, bfztName); } - + String coordinateX = entity.getCoordinateX(); if (coordinateX != null) { stmt.bindString(5, coordinateX); } - + String coordinateY = entity.getCoordinateY(); if (coordinateY != null) { stmt.bindString(6, coordinateY); } - + String deep = entity.getDeep(); if (deep != null) { stmt.bindString(7, deep); } - + String deptName = entity.getDeptName(); if (deptName != null) { stmt.bindString(8, deptName); } - + String deptid = entity.getDeptid(); if (deptid != null) { stmt.bindString(9, deptid); } - + String id = entity.getId(); if (id != null) { stmt.bindString(10, id); } - + String latBaidu = entity.getLatBaidu(); if (latBaidu != null) { stmt.bindString(11, latBaidu); } - + String latGaode = entity.getLatGaode(); if (latGaode != null) { stmt.bindString(12, latGaode); } - + String lngBaidu = entity.getLngBaidu(); if (lngBaidu != null) { stmt.bindString(13, lngBaidu); } - + String lngGaode = entity.getLngGaode(); if (lngGaode != null) { stmt.bindString(14, lngGaode); } - + String notes = entity.getNotes(); if (notes != null) { stmt.bindString(15, notes); } - + String photos = entity.getPhotos(); if (photos != null) { stmt.bindString(16, photos); } - + String position = entity.getPosition(); if (position != null) { stmt.bindString(17, position); } - + String staff = entity.getStaff(); if (staff != null) { stmt.bindString(18, staff); } - + String tel = entity.getTel(); if (tel != null) { stmt.bindString(19, tel); } - + String ts = entity.getTs(); if (ts != null) { stmt.bindString(20, ts); } - + String valid = entity.getValid(); if (valid != null) { stmt.bindString(21, valid); } - + String watchData = entity.getWatchData(); if (watchData != null) { stmt.bindString(22, watchData); } - + String wellCode = entity.getWellCode(); if (wellCode != null) { stmt.bindString(23, wellCode); } - + String wellName = entity.getWellName(); if (wellName != null) { stmt.bindString(24, wellName); } - + String wellType = entity.getWellType(); if (wellType != null) { stmt.bindString(25, wellType); } - + String wellTypeName = entity.getWellTypeName(); if (wellTypeName != null) { stmt.bindString(26, wellTypeName); @@ -242,132 +237,132 @@ @Override protected final void bindValues(SQLiteStatement stmt, MapWellLocalBean entity) { stmt.clearBindings(); - + Long kId = entity.getKId(); if (kId != null) { stmt.bindLong(1, kId); } - + String area = entity.getArea(); if (area != null) { stmt.bindString(2, area); } - + String bfzt = entity.getBfzt(); if (bfzt != null) { stmt.bindString(3, bfzt); } - + String bfztName = entity.getBfztName(); if (bfztName != null) { stmt.bindString(4, bfztName); } - + String coordinateX = entity.getCoordinateX(); if (coordinateX != null) { stmt.bindString(5, coordinateX); } - + String coordinateY = entity.getCoordinateY(); if (coordinateY != null) { stmt.bindString(6, coordinateY); } - + String deep = entity.getDeep(); if (deep != null) { stmt.bindString(7, deep); } - + String deptName = entity.getDeptName(); if (deptName != null) { stmt.bindString(8, deptName); } - + String deptid = entity.getDeptid(); if (deptid != null) { stmt.bindString(9, deptid); } - + String id = entity.getId(); if (id != null) { stmt.bindString(10, id); } - + String latBaidu = entity.getLatBaidu(); if (latBaidu != null) { stmt.bindString(11, latBaidu); } - + String latGaode = entity.getLatGaode(); if (latGaode != null) { stmt.bindString(12, latGaode); } - + String lngBaidu = entity.getLngBaidu(); if (lngBaidu != null) { stmt.bindString(13, lngBaidu); } - + String lngGaode = entity.getLngGaode(); if (lngGaode != null) { stmt.bindString(14, lngGaode); } - + String notes = entity.getNotes(); if (notes != null) { stmt.bindString(15, notes); } - + String photos = entity.getPhotos(); if (photos != null) { stmt.bindString(16, photos); } - + String position = entity.getPosition(); if (position != null) { stmt.bindString(17, position); } - + String staff = entity.getStaff(); if (staff != null) { stmt.bindString(18, staff); } - + String tel = entity.getTel(); if (tel != null) { stmt.bindString(19, tel); } - + String ts = entity.getTs(); if (ts != null) { stmt.bindString(20, ts); } - + String valid = entity.getValid(); if (valid != null) { stmt.bindString(21, valid); } - + String watchData = entity.getWatchData(); if (watchData != null) { stmt.bindString(22, watchData); } - + String wellCode = entity.getWellCode(); if (wellCode != null) { stmt.bindString(23, wellCode); } - + String wellName = entity.getWellName(); if (wellName != null) { stmt.bindString(24, wellName); } - + String wellType = entity.getWellType(); if (wellType != null) { stmt.bindString(25, wellType); } - + String wellTypeName = entity.getWellTypeName(); if (wellTypeName != null) { stmt.bindString(26, wellTypeName); @@ -377,41 +372,41 @@ @Override public Long readKey(Cursor cursor, int offset) { return cursor.isNull(offset + 0) ? null : cursor.getLong(offset + 0); - } + } @Override public MapWellLocalBean readEntity(Cursor cursor, int offset) { MapWellLocalBean entity = new MapWellLocalBean( // - cursor.isNull(offset + 0) ? null : cursor.getLong(offset + 0), // kId - cursor.isNull(offset + 1) ? null : cursor.getString(offset + 1), // area - cursor.isNull(offset + 2) ? null : cursor.getString(offset + 2), // bfzt - cursor.isNull(offset + 3) ? null : cursor.getString(offset + 3), // bfztName - cursor.isNull(offset + 4) ? null : cursor.getString(offset + 4), // coordinateX - cursor.isNull(offset + 5) ? null : cursor.getString(offset + 5), // coordinateY - cursor.isNull(offset + 6) ? null : cursor.getString(offset + 6), // deep - cursor.isNull(offset + 7) ? null : cursor.getString(offset + 7), // deptName - cursor.isNull(offset + 8) ? null : cursor.getString(offset + 8), // deptid - cursor.isNull(offset + 9) ? null : cursor.getString(offset + 9), // id - cursor.isNull(offset + 10) ? null : cursor.getString(offset + 10), // latBaidu - cursor.isNull(offset + 11) ? null : cursor.getString(offset + 11), // latGaode - cursor.isNull(offset + 12) ? null : cursor.getString(offset + 12), // lngBaidu - cursor.isNull(offset + 13) ? null : cursor.getString(offset + 13), // lngGaode - cursor.isNull(offset + 14) ? null : cursor.getString(offset + 14), // notes - cursor.isNull(offset + 15) ? null : cursor.getString(offset + 15), // photos - cursor.isNull(offset + 16) ? null : cursor.getString(offset + 16), // position - cursor.isNull(offset + 17) ? null : cursor.getString(offset + 17), // staff - cursor.isNull(offset + 18) ? null : cursor.getString(offset + 18), // tel - cursor.isNull(offset + 19) ? null : cursor.getString(offset + 19), // ts - cursor.isNull(offset + 20) ? null : cursor.getString(offset + 20), // valid - cursor.isNull(offset + 21) ? null : cursor.getString(offset + 21), // watchData - cursor.isNull(offset + 22) ? null : cursor.getString(offset + 22), // wellCode - cursor.isNull(offset + 23) ? null : cursor.getString(offset + 23), // wellName - cursor.isNull(offset + 24) ? null : cursor.getString(offset + 24), // wellType - cursor.isNull(offset + 25) ? null : cursor.getString(offset + 25) // wellTypeName + cursor.isNull(offset + 0) ? null : cursor.getLong(offset + 0), // kId + cursor.isNull(offset + 1) ? null : cursor.getString(offset + 1), // area + cursor.isNull(offset + 2) ? null : cursor.getString(offset + 2), // bfzt + cursor.isNull(offset + 3) ? null : cursor.getString(offset + 3), // bfztName + cursor.isNull(offset + 4) ? null : cursor.getString(offset + 4), // coordinateX + cursor.isNull(offset + 5) ? null : cursor.getString(offset + 5), // coordinateY + cursor.isNull(offset + 6) ? null : cursor.getString(offset + 6), // deep + cursor.isNull(offset + 7) ? null : cursor.getString(offset + 7), // deptName + cursor.isNull(offset + 8) ? null : cursor.getString(offset + 8), // deptid + cursor.isNull(offset + 9) ? null : cursor.getString(offset + 9), // id + cursor.isNull(offset + 10) ? null : cursor.getString(offset + 10), // latBaidu + cursor.isNull(offset + 11) ? null : cursor.getString(offset + 11), // latGaode + cursor.isNull(offset + 12) ? null : cursor.getString(offset + 12), // lngBaidu + cursor.isNull(offset + 13) ? null : cursor.getString(offset + 13), // lngGaode + cursor.isNull(offset + 14) ? null : cursor.getString(offset + 14), // notes + cursor.isNull(offset + 15) ? null : cursor.getString(offset + 15), // photos + cursor.isNull(offset + 16) ? null : cursor.getString(offset + 16), // position + cursor.isNull(offset + 17) ? null : cursor.getString(offset + 17), // staff + cursor.isNull(offset + 18) ? null : cursor.getString(offset + 18), // tel + cursor.isNull(offset + 19) ? null : cursor.getString(offset + 19), // ts + cursor.isNull(offset + 20) ? null : cursor.getString(offset + 20), // valid + cursor.isNull(offset + 21) ? null : cursor.getString(offset + 21), // watchData + cursor.isNull(offset + 22) ? null : cursor.getString(offset + 22), // wellCode + cursor.isNull(offset + 23) ? null : cursor.getString(offset + 23), // wellName + cursor.isNull(offset + 24) ? null : cursor.getString(offset + 24), // wellType + cursor.isNull(offset + 25) ? null : cursor.getString(offset + 25) // wellTypeName ); return entity; } - + @Override public void readEntity(Cursor cursor, MapWellLocalBean entity, int offset) { entity.setKId(cursor.isNull(offset + 0) ? null : cursor.getLong(offset + 0)); @@ -440,17 +435,17 @@ entity.setWellName(cursor.isNull(offset + 23) ? null : cursor.getString(offset + 23)); entity.setWellType(cursor.isNull(offset + 24) ? null : cursor.getString(offset + 24)); entity.setWellTypeName(cursor.isNull(offset + 25) ? null : cursor.getString(offset + 25)); - } - + } + @Override protected final Long updateKeyAfterInsert(MapWellLocalBean entity, long rowId) { entity.setKId(rowId); return rowId; } - + @Override public Long getKey(MapWellLocalBean entity) { - if (entity != null) { + if(entity != null) { return entity.getKId(); } else { return null; @@ -466,5 +461,5 @@ protected final boolean isEntityUpdateable() { return true; } - + } diff --git a/app/src/main/java/com/casic/app/smartwell/greendao/NoticeLocaleBeanDao.java b/app/src/main/java/com/casic/app/smartwell/greendao/NoticeLocaleBeanDao.java index 64312ed..deb2d49 100644 --- a/app/src/main/java/com/casic/app/smartwell/greendao/NoticeLocaleBeanDao.java +++ b/app/src/main/java/com/casic/app/smartwell/greendao/NoticeLocaleBeanDao.java @@ -12,10 +12,9 @@ import org.greenrobot.greendao.internal.DaoConfig; // THIS CODE IS GENERATED BY greenDAO, DO NOT EDIT. - -/** +/** * DAO for table "NOTICE_LOCALE_BEAN". - */ +*/ public class NoticeLocaleBeanDao extends AbstractDao { public static final String TABLENAME = "NOTICE_LOCALE_BEAN"; @@ -43,16 +42,14 @@ public NoticeLocaleBeanDao(DaoConfig config) { super(config); } - + public NoticeLocaleBeanDao(DaoConfig config, DaoSession daoSession) { super(config, daoSession); } - /** - * Creates the underlying database table. - */ + /** Creates the underlying database table. */ public static void createTable(Database db, boolean ifNotExists) { - String constraint = ifNotExists ? "IF NOT EXISTS " : ""; + String constraint = ifNotExists? "IF NOT EXISTS ": ""; db.execSQL("CREATE TABLE " + constraint + "\"NOTICE_LOCALE_BEAN\" (" + // "\"_id\" INTEGER PRIMARY KEY AUTOINCREMENT ," + // 0: id "\"MESSAGE_ID\" TEXT UNIQUE ," + // 1: messageId @@ -68,9 +65,7 @@ "\"NOTICE_TIME\" TEXT);"); // 11: noticeTime } - /** - * Drops the underlying database table. - */ + /** Drops the underlying database table. */ public static void dropTable(Database db, boolean ifExists) { String sql = "DROP TABLE " + (ifExists ? "IF EXISTS " : "") + "\"NOTICE_LOCALE_BEAN\""; db.execSQL(sql); @@ -79,62 +74,62 @@ @Override protected final void bindValues(DatabaseStatement stmt, NoticeLocaleBean entity) { stmt.clearBindings(); - + Long id = entity.getId(); if (id != null) { stmt.bindLong(1, id); } - + String messageId = entity.getMessageId(); if (messageId != null) { stmt.bindString(2, messageId); } - + String appid = entity.getAppid(); if (appid != null) { stmt.bindString(3, appid); } - + String clientId = entity.getClientId(); if (clientId != null) { stmt.bindString(4, clientId); } - + String taskId = entity.getTaskId(); if (taskId != null) { stmt.bindString(5, taskId); } - + String userId = entity.getUserId(); if (userId != null) { stmt.bindString(6, userId); } - + String title = entity.getTitle(); if (title != null) { stmt.bindString(7, title); } - + String content = entity.getContent(); if (content != null) { stmt.bindString(8, content); } - + String deviceCode = entity.getDeviceCode(); if (deviceCode != null) { stmt.bindString(9, deviceCode); } - + String jobId = entity.getJobId(); if (jobId != null) { stmt.bindString(10, jobId); } - + String isRead = entity.getIsRead(); if (isRead != null) { stmt.bindString(11, isRead); } - + String noticeTime = entity.getNoticeTime(); if (noticeTime != null) { stmt.bindString(12, noticeTime); @@ -144,62 +139,62 @@ @Override protected final void bindValues(SQLiteStatement stmt, NoticeLocaleBean entity) { stmt.clearBindings(); - + Long id = entity.getId(); if (id != null) { stmt.bindLong(1, id); } - + String messageId = entity.getMessageId(); if (messageId != null) { stmt.bindString(2, messageId); } - + String appid = entity.getAppid(); if (appid != null) { stmt.bindString(3, appid); } - + String clientId = entity.getClientId(); if (clientId != null) { stmt.bindString(4, clientId); } - + String taskId = entity.getTaskId(); if (taskId != null) { stmt.bindString(5, taskId); } - + String userId = entity.getUserId(); if (userId != null) { stmt.bindString(6, userId); } - + String title = entity.getTitle(); if (title != null) { stmt.bindString(7, title); } - + String content = entity.getContent(); if (content != null) { stmt.bindString(8, content); } - + String deviceCode = entity.getDeviceCode(); if (deviceCode != null) { stmt.bindString(9, deviceCode); } - + String jobId = entity.getJobId(); if (jobId != null) { stmt.bindString(10, jobId); } - + String isRead = entity.getIsRead(); if (isRead != null) { stmt.bindString(11, isRead); } - + String noticeTime = entity.getNoticeTime(); if (noticeTime != null) { stmt.bindString(12, noticeTime); @@ -209,27 +204,27 @@ @Override public Long readKey(Cursor cursor, int offset) { return cursor.isNull(offset + 0) ? null : cursor.getLong(offset + 0); - } + } @Override public NoticeLocaleBean readEntity(Cursor cursor, int offset) { NoticeLocaleBean entity = new NoticeLocaleBean( // - cursor.isNull(offset + 0) ? null : cursor.getLong(offset + 0), // id - cursor.isNull(offset + 1) ? null : cursor.getString(offset + 1), // messageId - cursor.isNull(offset + 2) ? null : cursor.getString(offset + 2), // appid - cursor.isNull(offset + 3) ? null : cursor.getString(offset + 3), // clientId - cursor.isNull(offset + 4) ? null : cursor.getString(offset + 4), // taskId - cursor.isNull(offset + 5) ? null : cursor.getString(offset + 5), // userId - cursor.isNull(offset + 6) ? null : cursor.getString(offset + 6), // title - cursor.isNull(offset + 7) ? null : cursor.getString(offset + 7), // content - cursor.isNull(offset + 8) ? null : cursor.getString(offset + 8), // deviceCode - cursor.isNull(offset + 9) ? null : cursor.getString(offset + 9), // jobId - cursor.isNull(offset + 10) ? null : cursor.getString(offset + 10), // isRead - cursor.isNull(offset + 11) ? null : cursor.getString(offset + 11) // noticeTime + cursor.isNull(offset + 0) ? null : cursor.getLong(offset + 0), // id + cursor.isNull(offset + 1) ? null : cursor.getString(offset + 1), // messageId + cursor.isNull(offset + 2) ? null : cursor.getString(offset + 2), // appid + cursor.isNull(offset + 3) ? null : cursor.getString(offset + 3), // clientId + cursor.isNull(offset + 4) ? null : cursor.getString(offset + 4), // taskId + cursor.isNull(offset + 5) ? null : cursor.getString(offset + 5), // userId + cursor.isNull(offset + 6) ? null : cursor.getString(offset + 6), // title + cursor.isNull(offset + 7) ? null : cursor.getString(offset + 7), // content + cursor.isNull(offset + 8) ? null : cursor.getString(offset + 8), // deviceCode + cursor.isNull(offset + 9) ? null : cursor.getString(offset + 9), // jobId + cursor.isNull(offset + 10) ? null : cursor.getString(offset + 10), // isRead + cursor.isNull(offset + 11) ? null : cursor.getString(offset + 11) // noticeTime ); return entity; } - + @Override public void readEntity(Cursor cursor, NoticeLocaleBean entity, int offset) { entity.setId(cursor.isNull(offset + 0) ? null : cursor.getLong(offset + 0)); @@ -244,17 +239,17 @@ entity.setJobId(cursor.isNull(offset + 9) ? null : cursor.getString(offset + 9)); entity.setIsRead(cursor.isNull(offset + 10) ? null : cursor.getString(offset + 10)); entity.setNoticeTime(cursor.isNull(offset + 11) ? null : cursor.getString(offset + 11)); - } - + } + @Override protected final Long updateKeyAfterInsert(NoticeLocaleBean entity, long rowId) { entity.setId(rowId); return rowId; } - + @Override public Long getKey(NoticeLocaleBean entity) { - if (entity != null) { + if(entity != null) { return entity.getId(); } else { return null; @@ -270,5 +265,5 @@ protected final boolean isEntityUpdateable() { return true; } - + } diff --git a/app/src/main/java/com/casic/app/smartwell/greendao/PipeLocalBeanDao.java b/app/src/main/java/com/casic/app/smartwell/greendao/PipeLocalBeanDao.java index aab4d3f..df5515a 100644 --- a/app/src/main/java/com/casic/app/smartwell/greendao/PipeLocalBeanDao.java +++ b/app/src/main/java/com/casic/app/smartwell/greendao/PipeLocalBeanDao.java @@ -12,10 +12,9 @@ import org.greenrobot.greendao.internal.DaoConfig; // THIS CODE IS GENERATED BY greenDAO, DO NOT EDIT. - -/** +/** * DAO for table "PIPE_LOCAL_BEAN". - */ +*/ public class PipeLocalBeanDao extends AbstractDao { public static final String TABLENAME = "PIPE_LOCAL_BEAN"; @@ -37,16 +36,14 @@ public PipeLocalBeanDao(DaoConfig config) { super(config); } - + public PipeLocalBeanDao(DaoConfig config, DaoSession daoSession) { super(config, daoSession); } - /** - * Creates the underlying database table. - */ + /** Creates the underlying database table. */ public static void createTable(Database db, boolean ifNotExists) { - String constraint = ifNotExists ? "IF NOT EXISTS " : ""; + String constraint = ifNotExists? "IF NOT EXISTS ": ""; db.execSQL("CREATE TABLE " + constraint + "\"PIPE_LOCAL_BEAN\" (" + // "\"_id\" INTEGER PRIMARY KEY AUTOINCREMENT ," + // 0: id "\"PIPE_CODE\" TEXT," + // 1: pipeCode @@ -56,9 +53,7 @@ "\"START_LONGITUDE_GD\" TEXT);"); // 5: startLongitudeGd } - /** - * Drops the underlying database table. - */ + /** Drops the underlying database table. */ public static void dropTable(Database db, boolean ifExists) { String sql = "DROP TABLE " + (ifExists ? "IF EXISTS " : "") + "\"PIPE_LOCAL_BEAN\""; db.execSQL(sql); @@ -67,32 +62,32 @@ @Override protected final void bindValues(DatabaseStatement stmt, PipeLocalBean entity) { stmt.clearBindings(); - + Long id = entity.getId(); if (id != null) { stmt.bindLong(1, id); } - + String pipeCode = entity.getPipeCode(); if (pipeCode != null) { stmt.bindString(2, pipeCode); } - + String endLatitudeGd = entity.getEndLatitudeGd(); if (endLatitudeGd != null) { stmt.bindString(3, endLatitudeGd); } - + String endLongitudeGd = entity.getEndLongitudeGd(); if (endLongitudeGd != null) { stmt.bindString(4, endLongitudeGd); } - + String startLatitudeGd = entity.getStartLatitudeGd(); if (startLatitudeGd != null) { stmt.bindString(5, startLatitudeGd); } - + String startLongitudeGd = entity.getStartLongitudeGd(); if (startLongitudeGd != null) { stmt.bindString(6, startLongitudeGd); @@ -102,32 +97,32 @@ @Override protected final void bindValues(SQLiteStatement stmt, PipeLocalBean entity) { stmt.clearBindings(); - + Long id = entity.getId(); if (id != null) { stmt.bindLong(1, id); } - + String pipeCode = entity.getPipeCode(); if (pipeCode != null) { stmt.bindString(2, pipeCode); } - + String endLatitudeGd = entity.getEndLatitudeGd(); if (endLatitudeGd != null) { stmt.bindString(3, endLatitudeGd); } - + String endLongitudeGd = entity.getEndLongitudeGd(); if (endLongitudeGd != null) { stmt.bindString(4, endLongitudeGd); } - + String startLatitudeGd = entity.getStartLatitudeGd(); if (startLatitudeGd != null) { stmt.bindString(5, startLatitudeGd); } - + String startLongitudeGd = entity.getStartLongitudeGd(); if (startLongitudeGd != null) { stmt.bindString(6, startLongitudeGd); @@ -137,21 +132,21 @@ @Override public Long readKey(Cursor cursor, int offset) { return cursor.isNull(offset + 0) ? null : cursor.getLong(offset + 0); - } + } @Override public PipeLocalBean readEntity(Cursor cursor, int offset) { PipeLocalBean entity = new PipeLocalBean( // - cursor.isNull(offset + 0) ? null : cursor.getLong(offset + 0), // id - cursor.isNull(offset + 1) ? null : cursor.getString(offset + 1), // pipeCode - cursor.isNull(offset + 2) ? null : cursor.getString(offset + 2), // endLatitudeGd - cursor.isNull(offset + 3) ? null : cursor.getString(offset + 3), // endLongitudeGd - cursor.isNull(offset + 4) ? null : cursor.getString(offset + 4), // startLatitudeGd - cursor.isNull(offset + 5) ? null : cursor.getString(offset + 5) // startLongitudeGd + cursor.isNull(offset + 0) ? null : cursor.getLong(offset + 0), // id + cursor.isNull(offset + 1) ? null : cursor.getString(offset + 1), // pipeCode + cursor.isNull(offset + 2) ? null : cursor.getString(offset + 2), // endLatitudeGd + cursor.isNull(offset + 3) ? null : cursor.getString(offset + 3), // endLongitudeGd + cursor.isNull(offset + 4) ? null : cursor.getString(offset + 4), // startLatitudeGd + cursor.isNull(offset + 5) ? null : cursor.getString(offset + 5) // startLongitudeGd ); return entity; } - + @Override public void readEntity(Cursor cursor, PipeLocalBean entity, int offset) { entity.setId(cursor.isNull(offset + 0) ? null : cursor.getLong(offset + 0)); @@ -160,17 +155,17 @@ entity.setEndLongitudeGd(cursor.isNull(offset + 3) ? null : cursor.getString(offset + 3)); entity.setStartLatitudeGd(cursor.isNull(offset + 4) ? null : cursor.getString(offset + 4)); entity.setStartLongitudeGd(cursor.isNull(offset + 5) ? null : cursor.getString(offset + 5)); - } - + } + @Override protected final Long updateKeyAfterInsert(PipeLocalBean entity, long rowId) { entity.setId(rowId); return rowId; } - + @Override public Long getKey(PipeLocalBean entity) { - if (entity != null) { + if(entity != null) { return entity.getId(); } else { return null; @@ -186,5 +181,5 @@ protected final boolean isEntityUpdateable() { return true; } - + } diff --git a/app/src/main/java/com/casic/app/smartwell/view/ChangePasswordActivity.kt b/app/src/main/java/com/casic/app/smartwell/view/ChangePasswordActivity.kt index 8e41039..9f1dd40 100644 --- a/app/src/main/java/com/casic/app/smartwell/view/ChangePasswordActivity.kt +++ b/app/src/main/java/com/casic/app/smartwell/view/ChangePasswordActivity.kt @@ -14,7 +14,7 @@ import com.pengxh.kt.lite.extensions.show import com.pengxh.kt.lite.utils.ActivityStackManager import com.pengxh.kt.lite.utils.LoadState -import com.pengxh.kt.lite.utils.LoadingDialogHub +import com.pengxh.kt.lite.utils.LoadingDialog import com.pengxh.kt.lite.widget.TitleBarView import java.nio.charset.StandardCharsets @@ -46,15 +46,15 @@ override fun observeRequestState() { userViewModel.loadState.observe(this) { when (it) { - is LoadState.Loading -> LoadingDialogHub.show(this, "修改中,请稍后") + is LoadState.Loading -> LoadingDialog.show(this, "修改中,请稍后") is LoadState.Success -> { - LoadingDialogHub.dismiss() + LoadingDialog.dismiss() AuthenticationHelper.removeToken() this.navigatePageTo() ActivityStackManager.finishAllActivity() } - else -> LoadingDialogHub.dismiss() + else -> LoadingDialog.dismiss() } } } diff --git a/app/src/main/java/com/casic/app/smartwell/view/DeployedWellActivity.kt b/app/src/main/java/com/casic/app/smartwell/view/DeployedWellActivity.kt index fb4339c..28a5078 100644 --- a/app/src/main/java/com/casic/app/smartwell/view/DeployedWellActivity.kt +++ b/app/src/main/java/com/casic/app/smartwell/view/DeployedWellActivity.kt @@ -83,8 +83,8 @@ } //添加分割线 - binding.deployedListView.addItemDecoration( - RecyclerViewItemOffsets(0, 5, 0, 5) + binding.recyclerView.addItemDecoration( + RecyclerViewItemOffsets(0, 7, 0, 7) ) } @@ -149,12 +149,11 @@ } else { item.deep.toString() + "m" } - viewHolder.setText(R.id.wellNameView, item.wellName) + viewHolder.setText(R.id.wellTypeView, item.wellTypeName) .setText(R.id.wellDepthView, "深:${deep}") .setText(R.id.wellCodeView, "点位编号:${item.wellCode}") - .setText(R.id.wellTypeView, "点位类型:${item.wellTypeName}") .setText(R.id.ownerShipView, "权属单位:${item.deptName}") - .setText(R.id.wellLocationView, "点位置:${item.position}") + .setText(R.id.wellLocationView, "点位位置:${item.position}") .setOnClickListener( R.id.operationButton, object : View.OnClickListener { override fun onClick(v: View?) { @@ -207,7 +206,7 @@ }) } } - binding.deployedListView.adapter = deployAdapter + binding.recyclerView.adapter = deployAdapter deployAdapter.setOnItemClickedListener(object : NormalRecyclerAdapter.OnItemClickedListener { override fun onItemClicked(position: Int, t: WellListModel.DataBean.RowsBean) { diff --git a/app/src/main/java/com/casic/app/smartwell/view/LoginActivity.kt b/app/src/main/java/com/casic/app/smartwell/view/LoginActivity.kt index e4bb0e3..834527b 100644 --- a/app/src/main/java/com/casic/app/smartwell/view/LoginActivity.kt +++ b/app/src/main/java/com/casic/app/smartwell/view/LoginActivity.kt @@ -21,7 +21,7 @@ import com.pengxh.kt.lite.extensions.navigatePageTo import com.pengxh.kt.lite.extensions.readAssetsFile import com.pengxh.kt.lite.extensions.show -import com.pengxh.kt.lite.utils.LoadingDialogHub +import com.pengxh.kt.lite.utils.LoadingDialog import com.pengxh.kt.lite.utils.SaveKeyValues import kotlinx.coroutines.Dispatchers import kotlinx.coroutines.launch @@ -106,11 +106,11 @@ override fun observeRequestState() { authenticateViewModel.loadState.observe(this) { - LoadingDialogHub.show(this, "登录中,请稍后") + LoadingDialog.show(this, "登录中,请稍后") } loginViewModel.loadState.observe(this) { - LoadingDialogHub.dismiss() + LoadingDialog.dismiss() } } diff --git a/app/src/main/java/com/casic/app/smartwell/view/OrderCompletedDetailActivity.kt b/app/src/main/java/com/casic/app/smartwell/view/OrderCompletedDetailActivity.kt index db8ad1f..75cd905 100644 --- a/app/src/main/java/com/casic/app/smartwell/view/OrderCompletedDetailActivity.kt +++ b/app/src/main/java/com/casic/app/smartwell/view/OrderCompletedDetailActivity.kt @@ -17,7 +17,7 @@ import com.pengxh.kt.lite.extensions.show import com.pengxh.kt.lite.utils.Constant import com.pengxh.kt.lite.utils.LoadState -import com.pengxh.kt.lite.utils.LoadingDialogHub +import com.pengxh.kt.lite.utils.LoadingDialog import com.pengxh.kt.lite.widget.TitleBarView import com.pengxh.kt.lite.widget.dialog.AlertMessageDialog @@ -44,7 +44,7 @@ } override fun initOnCreate(savedInstanceState: Bundle?) { - val jobId = intent.getStringExtra(Constant.INTENT_PARAM)!! + val jobId = intent.getStringExtra(Constant.INTENT_PARAM_KEY)!! orderViewModel = ViewModelProvider(this)[OrderViewModel::class.java] orderViewModel.getWorkOrderDetail(jobId) orderViewModel.detailModel.observe(this) { @@ -154,8 +154,8 @@ override fun observeRequestState() { orderViewModel.loadState.observe(this) { when (it) { - is LoadState.Loading -> LoadingDialogHub.show(this, "数据加载中,请稍后") - else -> LoadingDialogHub.dismiss() + is LoadState.Loading -> LoadingDialog.show(this, "数据加载中,请稍后") + else -> LoadingDialog.dismiss() } } } diff --git a/app/src/main/java/com/casic/app/smartwell/view/OrderInHandleDetailActivity.kt b/app/src/main/java/com/casic/app/smartwell/view/OrderInHandleDetailActivity.kt index d70a979..04a7d5d 100644 --- a/app/src/main/java/com/casic/app/smartwell/view/OrderInHandleDetailActivity.kt +++ b/app/src/main/java/com/casic/app/smartwell/view/OrderInHandleDetailActivity.kt @@ -38,7 +38,7 @@ import com.pengxh.kt.lite.extensions.show import com.pengxh.kt.lite.utils.Constant import com.pengxh.kt.lite.utils.LoadState -import com.pengxh.kt.lite.utils.LoadingDialogHub +import com.pengxh.kt.lite.utils.LoadingDialog import com.pengxh.kt.lite.widget.TitleBarView import com.pengxh.kt.lite.widget.dialog.AlertControlDialog import com.pengxh.kt.lite.widget.dialog.AlertMessageDialog @@ -93,7 +93,7 @@ ) binding.addImageRecyclerView.adapter = imageAdapter - val jobId = intent.getStringExtra(Constant.INTENT_PARAM)!!//初始化图片九宫格 + val jobId = intent.getStringExtra(Constant.INTENT_PARAM_KEY)!!//初始化图片九宫格 orderViewModel.getWorkOrderDetail(jobId) orderViewModel.detailModel.observe(this) { if (it.code == 200) { @@ -312,41 +312,41 @@ override fun observeRequestState() { orderViewModel.loadState.observe(this) { when (it) { - is LoadState.Loading -> LoadingDialogHub.show(this, "数据加载中,请稍后") - else -> LoadingDialogHub.dismiss() + is LoadState.Loading -> LoadingDialog.show(this, "数据加载中,请稍后") + else -> LoadingDialog.dismiss() } } uploadImageViewModel.loadState.observe(this) { when (it) { - LoadState.Loading -> LoadingDialogHub.show(this, "图片上传中,请稍后...") - else -> LoadingDialogHub.dismiss() + LoadState.Loading -> LoadingDialog.show(this, "图片上传中,请稍后...") + else -> LoadingDialog.dismiss() } } //转单状态处理 operationViewModel.loadState.observe(this) { when (it) { - is LoadState.Loading -> LoadingDialogHub.show(this, "转单中,请稍后") + is LoadState.Loading -> LoadingDialog.show(this, "转单中,请稍后") is LoadState.Success -> { - LoadingDialogHub.dismiss() + LoadingDialog.dismiss() this.finish() } - else -> LoadingDialogHub.dismiss() + else -> LoadingDialog.dismiss() } } //处理完成工单状态处理 operationViewModel.loadState.observe(this) { when (it) { - is LoadState.Loading -> LoadingDialogHub.show(this, "处理中,请稍后") + is LoadState.Loading -> LoadingDialog.show(this, "处理中,请稍后") is LoadState.Success -> { - LoadingDialogHub.dismiss() + LoadingDialog.dismiss() this.finish() } - else -> LoadingDialogHub.dismiss() + else -> LoadingDialog.dismiss() } } } diff --git a/app/src/main/java/com/casic/app/smartwell/view/OrderNotConfirmedDetailActivity.kt b/app/src/main/java/com/casic/app/smartwell/view/OrderNotConfirmedDetailActivity.kt index 8e036d2..687ec86 100644 --- a/app/src/main/java/com/casic/app/smartwell/view/OrderNotConfirmedDetailActivity.kt +++ b/app/src/main/java/com/casic/app/smartwell/view/OrderNotConfirmedDetailActivity.kt @@ -36,7 +36,7 @@ import com.pengxh.kt.lite.extensions.show import com.pengxh.kt.lite.utils.Constant import com.pengxh.kt.lite.utils.LoadState -import com.pengxh.kt.lite.utils.LoadingDialogHub +import com.pengxh.kt.lite.utils.LoadingDialog import com.pengxh.kt.lite.widget.TitleBarView import com.pengxh.kt.lite.widget.dialog.AlertControlDialog import com.pengxh.kt.lite.widget.dialog.AlertMessageDialog @@ -80,7 +80,7 @@ } override fun initOnCreate(savedInstanceState: Bundle?) { - val jobId = intent.getStringExtra(Constant.INTENT_PARAM)!! + val jobId = intent.getStringExtra(Constant.INTENT_PARAM_KEY)!! //初始化图片九宫格 //左外边距,左内边距,右内边距,右外边距 val viewWidth = getScreenWidth() - (10 + 10 + 10 + 10).dp2px(this) @@ -263,41 +263,41 @@ //数据加载状态处理 orderViewModel.loadState.observe(this) { when (it) { - is LoadState.Loading -> LoadingDialogHub.show(this, "数据加载中,请稍后") - else -> LoadingDialogHub.dismiss() + is LoadState.Loading -> LoadingDialog.show(this, "数据加载中,请稍后") + else -> LoadingDialog.dismiss() } } uploadImageViewModel.loadState.observe(this) { when (it) { - LoadState.Loading -> LoadingDialogHub.show(this, "图片上传中,请稍后") - else -> LoadingDialogHub.dismiss() + LoadState.Loading -> LoadingDialog.show(this, "图片上传中,请稍后") + else -> LoadingDialog.dismiss() } } //转单状态处理 operationViewModel.loadState.observe(this) { when (it) { - is LoadState.Loading -> LoadingDialogHub.show(this, "转单中,请稍后") + is LoadState.Loading -> LoadingDialog.show(this, "转单中,请稍后") is LoadState.Success -> { - LoadingDialogHub.dismiss() + LoadingDialog.dismiss() this.finish() } - else -> LoadingDialogHub.dismiss() + else -> LoadingDialog.dismiss() } } //确认工单状态处理 operationViewModel.loadState.observe(this) { when (it) { - is LoadState.Loading -> LoadingDialogHub.show(this, "处理中,请稍后") + is LoadState.Loading -> LoadingDialog.show(this, "处理中,请稍后") is LoadState.Success -> { - LoadingDialogHub.dismiss() + LoadingDialog.dismiss() this.finish() } - else -> LoadingDialogHub.dismiss() + else -> LoadingDialog.dismiss() } } } diff --git a/app/src/main/java/com/casic/app/smartwell/view/OrderNotProcessedDetailActivity.kt b/app/src/main/java/com/casic/app/smartwell/view/OrderNotProcessedDetailActivity.kt index d3f22dc..0c97a52 100644 --- a/app/src/main/java/com/casic/app/smartwell/view/OrderNotProcessedDetailActivity.kt +++ b/app/src/main/java/com/casic/app/smartwell/view/OrderNotProcessedDetailActivity.kt @@ -18,7 +18,7 @@ import com.pengxh.kt.lite.extensions.show import com.pengxh.kt.lite.utils.Constant import com.pengxh.kt.lite.utils.LoadState -import com.pengxh.kt.lite.utils.LoadingDialogHub +import com.pengxh.kt.lite.utils.LoadingDialog import com.pengxh.kt.lite.widget.TitleBarView import com.pengxh.kt.lite.widget.dialog.AlertControlDialog import com.pengxh.kt.lite.widget.dialog.AlertMessageDialog @@ -50,7 +50,7 @@ } override fun initOnCreate(savedInstanceState: Bundle?) { - this.jobId = intent.getStringExtra(Constant.INTENT_PARAM)!! + this.jobId = intent.getStringExtra(Constant.INTENT_PARAM_KEY)!! orderViewModel = ViewModelProvider(this)[OrderViewModel::class.java] operationViewModel = ViewModelProvider(this)[OperationViewModel::class.java] wellViewModel = ViewModelProvider(this)[WellViewModel::class.java] @@ -162,21 +162,21 @@ //数据加载状态处理 orderViewModel.loadState.observe(this) { when (it) { - is LoadState.Loading -> LoadingDialogHub.show(this, "数据加载中,请稍后") - else -> LoadingDialogHub.dismiss() + is LoadState.Loading -> LoadingDialog.show(this, "数据加载中,请稍后") + else -> LoadingDialog.dismiss() } } //接单状态处理 operationViewModel.loadState.observe(this) { when (it) { - is LoadState.Loading -> LoadingDialogHub.show(this, "接单中,请稍后") + is LoadState.Loading -> LoadingDialog.show(this, "接单中,请稍后") is LoadState.Success -> { - LoadingDialogHub.dismiss() + LoadingDialog.dismiss() this.finish() } - else -> LoadingDialogHub.dismiss() + else -> LoadingDialog.dismiss() } } } diff --git a/app/src/main/java/com/casic/app/smartwell/view/SearchResultActivity.kt b/app/src/main/java/com/casic/app/smartwell/view/SearchResultActivity.kt index 6a92917..4f3a674 100644 --- a/app/src/main/java/com/casic/app/smartwell/view/SearchResultActivity.kt +++ b/app/src/main/java/com/casic/app/smartwell/view/SearchResultActivity.kt @@ -19,7 +19,7 @@ import com.pengxh.kt.lite.extensions.show import com.pengxh.kt.lite.utils.Constant import com.pengxh.kt.lite.utils.LoadState -import com.pengxh.kt.lite.utils.LoadingDialogHub +import com.pengxh.kt.lite.utils.LoadingDialog import com.pengxh.kt.lite.utils.WeakReferenceHandler import com.pengxh.kt.lite.widget.TitleBarView import com.pengxh.kt.lite.widget.dialog.AlertControlDialog @@ -56,7 +56,7 @@ } override fun initOnCreate(savedInstanceState: Bundle?) { - args = intent.getStringArrayListExtra(Constant.INTENT_PARAM)!! + args = intent.getStringArrayListExtra(Constant.INTENT_PARAM_KEY)!! orderViewModel = ViewModelProvider(this)[OrderViewModel::class.java] operationViewModel = ViewModelProvider(this)[OperationViewModel::class.java] @@ -101,24 +101,24 @@ } } - binding.resultRecyclerView.addItemDecoration( - RecyclerViewItemOffsets(0, 5, 0, 5) + binding.recyclerView.addItemDecoration( + RecyclerViewItemOffsets(0, 7, 0, 7) ) } override fun observeRequestState() { orderViewModel.loadState.observe(this) { when (it) { - is LoadState.Loading -> LoadingDialogHub.show(this, "数据加载中,请稍后") - else -> LoadingDialogHub.dismiss() + is LoadState.Loading -> LoadingDialog.show(this, "数据加载中,请稍后") + else -> LoadingDialog.dismiss() } } //接单状态处理 operationViewModel.loadState.observe(this) { when (it) { - is LoadState.Loading -> LoadingDialogHub.show(this, "接单中,请稍后") + is LoadState.Loading -> LoadingDialog.show(this, "接单中,请稍后") is LoadState.Success -> { - LoadingDialogHub.dismiss() + LoadingDialog.dismiss() //接单成功之后刷新列表 dataBeans.removeAt(clickedPosition) searchResultAdapter.notifyItemRemoved(clickedPosition) @@ -127,7 +127,7 @@ ) } - else -> LoadingDialogHub.dismiss() + else -> LoadingDialog.dismiss() } } } @@ -162,7 +162,7 @@ } else { binding.emptyInclude.emptyView.hide() searchResultAdapter = SearchResultAdapter(this, dataBeans) - binding.resultRecyclerView.adapter = searchResultAdapter + binding.recyclerView.adapter = searchResultAdapter searchResultAdapter.setOnItemClickListener(object : SearchResultAdapter.OnItemClickListener { override fun onClicked(position: Int) { diff --git a/app/src/main/java/com/casic/app/smartwell/view/UnDeployWellActivity.kt b/app/src/main/java/com/casic/app/smartwell/view/UnDeployWellActivity.kt index 7f7cd3c..555c278 100644 --- a/app/src/main/java/com/casic/app/smartwell/view/UnDeployWellActivity.kt +++ b/app/src/main/java/com/casic/app/smartwell/view/UnDeployWellActivity.kt @@ -81,8 +81,8 @@ } } - binding.undeployListView.addItemDecoration( - RecyclerViewItemOffsets(0, 5, 0, 5) + binding.recyclerView.addItemDecoration( + RecyclerViewItemOffsets(0, 7, 0, 7) ) } @@ -147,12 +147,11 @@ } else { item.deep.toString() + "m" } - viewHolder.setText(R.id.wellNameView, item.wellName) + viewHolder.setText(R.id.wellTypeView, item.wellTypeName) .setText(R.id.wellDepthView, "深:${deep}") .setText(R.id.wellCodeView, "点位编号:${item.wellCode}") - .setText(R.id.wellTypeView, "点位类型:${item.wellTypeName}") .setText(R.id.ownerShipView, "权属单位:${item.deptName}") - .setText(R.id.wellLocationView, "点位置:${item.position}") + .setText(R.id.wellLocationView, "点位位置:${item.position}") .setOnClickListener( R.id.operationButton, object : View.OnClickListener { override fun onClick(v: View?) { @@ -185,7 +184,7 @@ ) } } - binding.undeployListView.adapter = unDeployAdapter + binding.recyclerView.adapter = unDeployAdapter unDeployAdapter.setOnItemClickedListener(object : NormalRecyclerAdapter.OnItemClickedListener { override fun onItemClicked(position: Int, t: WellListModel.DataBean.RowsBean) { diff --git a/app/src/main/java/com/casic/app/smartwell/view/WellDetailActivity.kt b/app/src/main/java/com/casic/app/smartwell/view/WellDetailActivity.kt index b50d067..eb8b468 100644 --- a/app/src/main/java/com/casic/app/smartwell/view/WellDetailActivity.kt +++ b/app/src/main/java/com/casic/app/smartwell/view/WellDetailActivity.kt @@ -16,7 +16,7 @@ import com.pengxh.kt.lite.extensions.show import com.pengxh.kt.lite.utils.Constant import com.pengxh.kt.lite.utils.LoadState -import com.pengxh.kt.lite.utils.LoadingDialogHub +import com.pengxh.kt.lite.utils.LoadingDialog import com.pengxh.kt.lite.widget.TitleBarView import com.pengxh.kt.lite.widget.dialog.AlertMessageDialog @@ -44,7 +44,7 @@ } override fun initOnCreate(savedInstanceState: Bundle?) { - val wellId = intent.getStringExtra(Constant.INTENT_PARAM)!! + val wellId = intent.getStringExtra(Constant.INTENT_PARAM_KEY)!! wellViewModel = ViewModelProvider(this)[WellViewModel::class.java] wellViewModel.getWellDetail(wellId) wellViewModel.wellDetailModel.observe(this) { @@ -132,8 +132,8 @@ override fun observeRequestState() { wellViewModel.loadState.observe(this) { when (it) { - is LoadState.Loading -> LoadingDialogHub.show(this, "数据加载中,请稍后") - else -> LoadingDialogHub.dismiss() + is LoadState.Loading -> LoadingDialog.show(this, "数据加载中,请稍后") + else -> LoadingDialog.dismiss() } } } diff --git a/app/src/main/java/com/casic/app/smartwell/view/WellManagementActivity.kt b/app/src/main/java/com/casic/app/smartwell/view/WellManagementActivity.kt index 084da95..457096b 100644 --- a/app/src/main/java/com/casic/app/smartwell/view/WellManagementActivity.kt +++ b/app/src/main/java/com/casic/app/smartwell/view/WellManagementActivity.kt @@ -94,8 +94,8 @@ } } - binding.wellListView.addItemDecoration( - RecyclerViewItemOffsets(0, 5, 0, 5) + binding.recyclerView.addItemDecoration( + RecyclerViewItemOffsets(0, 7, 0, 7) ) } @@ -175,13 +175,12 @@ } else { item.deep.toString() + "m" } - viewHolder.setText(R.id.wellNameView, item.wellName) + viewHolder.setText(R.id.wellTypeView, item.wellTypeName) .setText(R.id.wellStateView, "已${item.bfztName}") .setText(R.id.wellDepthView, "深:${deep}") .setText(R.id.wellCodeView, "点位编号:${item.wellCode}") - .setText(R.id.wellTypeView, "点位类型:${item.wellTypeName}") .setText(R.id.ownerShipView, "权属单位:${item.deptName}") - .setText(R.id.wellLocationView, "点位置:${item.position}") + .setText(R.id.wellLocationView, "点位位置:${item.position}") .setOnClickListener( R.id.navigationButton, object : View.OnClickListener { override fun onClick(v: View?) { @@ -200,7 +199,7 @@ ) } } - binding.wellListView.adapter = wellListAdapter + binding.recyclerView.adapter = wellListAdapter wellListAdapter.setOnItemClickedListener(object : NormalRecyclerAdapter.OnItemClickedListener { override fun onItemClicked(position: Int, t: WellListModel.DataBean.RowsBean) { diff --git a/app/src/main/java/com/casic/app/smartwell/view/WellMonitorActivity.kt b/app/src/main/java/com/casic/app/smartwell/view/WellMonitorActivity.kt index e3573eb..b87bdb7 100644 --- a/app/src/main/java/com/casic/app/smartwell/view/WellMonitorActivity.kt +++ b/app/src/main/java/com/casic/app/smartwell/view/WellMonitorActivity.kt @@ -11,7 +11,7 @@ import com.pengxh.kt.lite.base.KotlinBaseActivity import com.pengxh.kt.lite.utils.Constant import com.pengxh.kt.lite.utils.LoadState -import com.pengxh.kt.lite.utils.LoadingDialogHub +import com.pengxh.kt.lite.utils.LoadingDialog import com.pengxh.kt.lite.widget.TitleBarView class WellMonitorActivity : KotlinBaseActivity() { @@ -36,7 +36,7 @@ } override fun initOnCreate(savedInstanceState: Bundle?) { - val wellId = intent.getStringExtra(Constant.INTENT_PARAM)!! + val wellId = intent.getStringExtra(Constant.INTENT_PARAM_KEY)!! wellViewModel = ViewModelProvider(this)[WellViewModel::class.java] wellViewModel.getMonitorResult(wellId) wellViewModel.monitorModel.observe(this) { @@ -56,8 +56,8 @@ override fun observeRequestState() { wellViewModel.loadState.observe(this) { when (it) { - is LoadState.Loading -> LoadingDialogHub.show(this, "数据加载中,请稍后") - else -> LoadingDialogHub.dismiss() + is LoadState.Loading -> LoadingDialog.show(this, "数据加载中,请稍后") + else -> LoadingDialog.dismiss() } } } diff --git a/app/src/main/java/com/casic/app/smartwell/view/WellOperationActivity.kt b/app/src/main/java/com/casic/app/smartwell/view/WellOperationActivity.kt index 8d333bf..347ebb6 100644 --- a/app/src/main/java/com/casic/app/smartwell/view/WellOperationActivity.kt +++ b/app/src/main/java/com/casic/app/smartwell/view/WellOperationActivity.kt @@ -23,7 +23,7 @@ import com.pengxh.kt.lite.extensions.navigatePageTo import com.pengxh.kt.lite.extensions.show import com.pengxh.kt.lite.utils.LoadState -import com.pengxh.kt.lite.utils.LoadingDialogHub +import com.pengxh.kt.lite.utils.LoadingDialog import com.pengxh.kt.lite.utils.WeakReferenceHandler import com.pengxh.kt.lite.widget.dialog.AlertControlDialog @@ -109,8 +109,8 @@ } } - binding.operationListView.addItemDecoration( - RecyclerViewItemOffsets(0, 5, 0, 5) + binding.recyclerView.addItemDecoration( + RecyclerViewItemOffsets(0, 7, 0, 7) ) } @@ -123,13 +123,13 @@ override fun observeRequestState() { wellViewModel.loadState.observe(this) { when (it) { - is LoadState.Loading -> LoadingDialogHub.show(this, "处理中,请稍后") + is LoadState.Loading -> LoadingDialog.show(this, "处理中,请稍后") is LoadState.Success -> { - LoadingDialogHub.dismiss() + LoadingDialog.dismiss() wellOperationAdapter.notifyItemChanged(clickedPosition) } - else -> LoadingDialogHub.dismiss() + else -> LoadingDialog.dismiss() } } } @@ -203,24 +203,23 @@ if (item.bfztName == "布防") { viewHolder.setImageResource( R.id.wellStateView, R.drawable.bg_solid_text_green_radius_5 - ).setText(R.id.wellStateView, "撤防") + ).setText(R.id.operationButton, "撤防") } else { viewHolder.setImageResource( R.id.wellStateView, R.drawable.bg_solid_text_red_radius_5 - ).setText(R.id.wellStateView, "布防") + ).setText(R.id.operationButton, "布防") } val deep = if (item.deep.toString().isBlank()) { "未知" } else { item.deep.toString() + "m" } - viewHolder.setText(R.id.wellNameView, item.wellName) + viewHolder.setText(R.id.wellTypeView, item.wellTypeName) .setText(R.id.wellStateView, "已${item.bfztName}") .setText(R.id.wellDepthView, "深:${deep}") .setText(R.id.wellCodeView, "点位编号:${item.wellCode}") - .setText(R.id.wellTypeView, "点位类型:${item.wellTypeName}") .setText(R.id.ownerShipView, "权属单位:${item.deptName}") - .setText(R.id.wellLocationView, "点位置:${item.position}") + .setText(R.id.wellLocationView, "点位位置:${item.position}") .setOnClickListener( R.id.operationButton, object : View.OnClickListener { override fun onClick(v: View?) { @@ -280,7 +279,7 @@ ) } } - binding.operationListView.adapter = wellOperationAdapter + binding.recyclerView.adapter = wellOperationAdapter wellOperationAdapter.setOnItemClickedListener(object : NormalRecyclerAdapter.OnItemClickedListener { override fun onItemClicked(position: Int, t: WellListModel.DataBean.RowsBean) { diff --git a/app/src/main/res/drawable/ic_down.xml b/app/src/main/res/drawable/ic_down.xml index 20e6476..6987e6c 100644 --- a/app/src/main/res/drawable/ic_down.xml +++ b/app/src/main/res/drawable/ic_down.xml @@ -1,6 +1,6 @@ + + diff --git a/app/src/main/res/layout/activity_about_us.xml b/app/src/main/res/layout/activity_about_us.xml index 9091a00..d5fbd0d 100644 --- a/app/src/main/res/layout/activity_about_us.xml +++ b/app/src/main/res/layout/activity_about_us.xml @@ -12,13 +12,7 @@ android:layout_width="match_parent" android:layout_height="wrap_content" android:background="@color/mainThemeColor" - app:tbv_left_image="@drawable/ic_title_left" - app:tbv_only_show_title="false" - app:tbv_show_left_image="true" - app:tbv_show_right_image="false" - app:tbv_text="关于我们" - app:tbv_text_color="@color/white" - app:tbv_text_size="@dimen/sp_18" /> + app:tbv_text="关于我们" /> + app:tbv_text="修改密码" /> + app:tbv_text="布防列表" /> + app:tbv_text="帮助中心" /> + app:tbv_text="工单详情" /> + app:tbv_text="工单详情" /> + app:tbv_text="工单详情" /> + app:tbv_text="工单详情" /> - + + android:value="ee96d8b5e12de3fbb29949efd57418a8" /> () @@ -150,7 +158,7 @@ val cameraPosition = CameraPosition(centerLatLng, 14f, 0f, 0f) val cameraUpdate = CameraUpdateFactory.newCameraPosition(cameraPosition) withContext(Dispatchers.Main) { - LoadingDialogHub.dismiss() + LoadingDialog.dismiss() aMap.animateCamera(cameraUpdate, 1500, null) } } @@ -239,11 +247,6 @@ } override fun initEvent() { - binding.rightOptionView.setOnClickListener { - val x = binding.rightOptionView.width - easyPopupWindow.width - easyPopupWindow.showAsDropDown(binding.rightOptionView, x, 0) - } - //撤防点位 binding.unDeployedLayout.setOnClickListener { requireContext().navigatePageTo() @@ -263,11 +266,11 @@ override fun observeRequestState() { wellViewModel.loadState.observe(this) { when (it) { - is LoadState.Loading -> LoadingDialogHub.show( + is LoadState.Loading -> LoadingDialog.show( requireActivity(), "数据加载中,请稍后..." ) - else -> LoadingDialogHub.dismiss() + else -> LoadingDialog.dismiss() } } } @@ -376,7 +379,7 @@ }).build().show() } }) - infoPopup.showAsDropDown(binding.rightOptionView) +// infoPopup.showAsDropDown(binding.rightOptionView) } override fun onCameraChange(p0: CameraPosition?) { diff --git a/app/src/main/java/com/casic/app/smartwell/fragment/HomePageNoClusterFragment.kt b/app/src/main/java/com/casic/app/smartwell/fragment/HomePageNoClusterFragment.kt index 802426a..b25f743 100644 --- a/app/src/main/java/com/casic/app/smartwell/fragment/HomePageNoClusterFragment.kt +++ b/app/src/main/java/com/casic/app/smartwell/fragment/HomePageNoClusterFragment.kt @@ -38,8 +38,9 @@ import com.pengxh.kt.lite.extensions.navigatePageTo import com.pengxh.kt.lite.extensions.show import com.pengxh.kt.lite.utils.LoadState -import com.pengxh.kt.lite.utils.LoadingDialogHub +import com.pengxh.kt.lite.utils.LoadingDialog import com.pengxh.kt.lite.widget.EasyPopupWindow +import com.pengxh.kt.lite.widget.TitleBarView import com.pengxh.kt.lite.widget.dialog.AlertControlDialog import kotlinx.coroutines.Dispatchers import kotlinx.coroutines.launch @@ -78,7 +79,15 @@ override fun setupTopBarLayout() { binding.rootView.initImmersionBar(this, false, R.color.mainThemeColor) - binding.titleView.text = "首页" + binding.titleView.setOnClickListener(object : TitleBarView.OnClickListener { + override fun onLeftClick() { + + } + + override fun onRightClick() { + easyPopupWindow.showAsDropDown(binding.titleView, binding.titleView.width, 0) + } + }) } override fun initOnCreate(savedInstanceState: Bundle?) { @@ -112,7 +121,7 @@ //渲染井位置 lifecycleScope.launch(Dispatchers.Main) { - LoadingDialogHub.show(requireActivity(), "数据加载中,请稍后") + LoadingDialog.show(requireActivity(), "数据加载中,请稍后") withContext(Dispatchers.IO) { //取Well缓存 val allMarkerOptions = ArrayList() @@ -144,7 +153,7 @@ val cameraPosition = CameraPosition(centerLatLng, 14f, 0f, 0f) val cameraUpdate = CameraUpdateFactory.newCameraPosition(cameraPosition) withContext(Dispatchers.Main) { - LoadingDialogHub.dismiss() + LoadingDialog.dismiss() aMap.animateCamera(cameraUpdate, 1500, null) } } @@ -238,11 +247,6 @@ } override fun initEvent() { - binding.rightOptionView.setOnClickListener { - val x = binding.rightOptionView.width - easyPopupWindow.width - easyPopupWindow.showAsDropDown(binding.rightOptionView, x, 0) - } - //撤防点位 binding.unDeployedLayout.setOnClickListener { requireContext().navigatePageTo() @@ -262,11 +266,11 @@ override fun observeRequestState() { wellViewModel.loadState.observe(this) { when (it) { - is LoadState.Loading -> LoadingDialogHub.show( + is LoadState.Loading -> LoadingDialog.show( requireActivity(), "数据加载中,请稍后..." ) - else -> LoadingDialogHub.dismiss() + else -> LoadingDialog.dismiss() } } } diff --git a/app/src/main/java/com/casic/app/smartwell/fragment/MinePageFragment.kt b/app/src/main/java/com/casic/app/smartwell/fragment/MinePageFragment.kt index 09a570c..dcb48f8 100644 --- a/app/src/main/java/com/casic/app/smartwell/fragment/MinePageFragment.kt +++ b/app/src/main/java/com/casic/app/smartwell/fragment/MinePageFragment.kt @@ -35,7 +35,7 @@ import com.pengxh.kt.lite.utils.ActivityStackManager import com.pengxh.kt.lite.utils.FileDownloadManager import com.pengxh.kt.lite.utils.LoadState -import com.pengxh.kt.lite.utils.LoadingDialogHub +import com.pengxh.kt.lite.utils.LoadingDialog import com.pengxh.kt.lite.widget.dialog.AlertControlDialog import com.pengxh.kt.lite.widget.dialog.BottomActionSheet import kotlinx.coroutines.Dispatchers @@ -60,7 +60,6 @@ override fun setupTopBarLayout() { binding.rootView.initImmersionBar(this, false, R.color.mainThemeColor) - binding.titleInclude.titleView.text = "我的" } override fun initOnCreate(savedInstanceState: Bundle?) { @@ -155,27 +154,27 @@ override fun observeRequestState() { userViewModel.loadState.observe(this) { when (it) { - is LoadState.Loading -> LoadingDialogHub.show( + is LoadState.Loading -> LoadingDialog.show( requireActivity(), "检查版本中,请稍后" ) - else -> LoadingDialogHub.dismiss() + else -> LoadingDialog.dismiss() } } wellViewModel.loadState.observe(this) { when (it) { - is LoadState.Loading -> LoadingDialogHub.show( + is LoadState.Loading -> LoadingDialog.show( requireActivity(), "数据更新中,请稍后" ) is LoadState.Fail -> { - LoadingDialogHub.dismiss() + LoadingDialog.dismiss() "数据更新超时".show(requireContext()) } else -> { - LoadingDialogHub.dismiss() + LoadingDialog.dismiss() AlertControlDialog.Builder().setContext(requireContext()).setTitle("温馨提示") .setMessage("数据更新成功,请重启应用").setNegativeButton("取消") .setPositiveButton("确定").setOnDialogButtonClickListener(object : @@ -197,17 +196,17 @@ lineViewModel.loadState.observe(this) { when (it) { - is LoadState.Loading -> LoadingDialogHub.show( + is LoadState.Loading -> LoadingDialog.show( requireActivity(), "数据更新中,请稍后" ) is LoadState.Fail -> { - LoadingDialogHub.dismiss() + LoadingDialog.dismiss() "数据更新超时".show(requireContext()) } else -> { - LoadingDialogHub.dismiss() + LoadingDialog.dismiss() AlertControlDialog.Builder().setContext(requireContext()).setTitle("温馨提示") .setMessage("数据更新成功,请重启应用").setNegativeButton("取消") .setPositiveButton("确定").setOnDialogButtonClickListener(object : diff --git a/app/src/main/java/com/casic/app/smartwell/fragment/NoticePageFragment.kt b/app/src/main/java/com/casic/app/smartwell/fragment/NoticePageFragment.kt index 171b555..3c93f54 100644 --- a/app/src/main/java/com/casic/app/smartwell/fragment/NoticePageFragment.kt +++ b/app/src/main/java/com/casic/app/smartwell/fragment/NoticePageFragment.kt @@ -48,7 +48,6 @@ override fun setupTopBarLayout() { binding.rootView.initImmersionBar(this, false, R.color.mainThemeColor) - binding.titleInclude.titleView.text = "消息" } override fun initOnCreate(savedInstanceState: Bundle?) { diff --git a/app/src/main/java/com/casic/app/smartwell/fragment/OrderListFragment.kt b/app/src/main/java/com/casic/app/smartwell/fragment/OrderListFragment.kt index 93ff35b..5e38acb 100644 --- a/app/src/main/java/com/casic/app/smartwell/fragment/OrderListFragment.kt +++ b/app/src/main/java/com/casic/app/smartwell/fragment/OrderListFragment.kt @@ -12,6 +12,7 @@ import com.casic.app.smartwell.view.SearchOrderActivity import com.pengxh.kt.lite.base.KotlinBaseFragment import com.pengxh.kt.lite.extensions.navigatePageTo +import com.pengxh.kt.lite.widget.TitleBarView class OrderListFragment : KotlinBaseFragment() { @@ -25,15 +26,22 @@ } override fun initViewBinding( - inflater: LayoutInflater, - container: ViewGroup? + inflater: LayoutInflater, container: ViewGroup? ): FragmentOrderBinding { return FragmentOrderBinding.inflate(inflater, container, false) } override fun setupTopBarLayout() { binding.rootView.initImmersionBar(this, false, R.color.mainThemeColor) - binding.titleView.text = "工单" + binding.titleView.setOnClickListener(object : TitleBarView.OnClickListener { + override fun onLeftClick() { + + } + + override fun onRightClick() { + requireContext().navigatePageTo() + } + }) } override fun initOnCreate(savedInstanceState: Bundle?) { @@ -51,8 +59,6 @@ } override fun initEvent() { - binding.rightOptionView.setOnClickListener { - requireContext().navigatePageTo() - } + } } \ No newline at end of file diff --git a/app/src/main/java/com/casic/app/smartwell/fragment/OrderNotProcessedFragment.kt b/app/src/main/java/com/casic/app/smartwell/fragment/OrderNotProcessedFragment.kt index 0b3d09d..2b6f21d 100644 --- a/app/src/main/java/com/casic/app/smartwell/fragment/OrderNotProcessedFragment.kt +++ b/app/src/main/java/com/casic/app/smartwell/fragment/OrderNotProcessedFragment.kt @@ -18,7 +18,7 @@ import com.pengxh.kt.lite.extensions.navigatePageTo import com.pengxh.kt.lite.extensions.show import com.pengxh.kt.lite.utils.LoadState -import com.pengxh.kt.lite.utils.LoadingDialogHub +import com.pengxh.kt.lite.utils.LoadingDialog import com.pengxh.kt.lite.utils.WeakReferenceHandler import com.pengxh.kt.lite.widget.dialog.AlertControlDialog @@ -78,8 +78,8 @@ operationViewModel = ViewModelProvider(this)[OperationViewModel::class.java] - binding.notProcessedView.addItemDecoration( - RecyclerViewItemOffsets(0, 5, 0, 5) + binding.recyclerView.addItemDecoration( + RecyclerViewItemOffsets(0, 7, 0, 7) ) } @@ -87,9 +87,9 @@ //接单状态处理 operationViewModel.loadState.observe(this) { when (it) { - is LoadState.Loading -> LoadingDialogHub.show(requireActivity(), "接单中,请稍后") + is LoadState.Loading -> LoadingDialog.show(requireActivity(), "接单中,请稍后") is LoadState.Success -> { - LoadingDialogHub.dismiss() + LoadingDialog.dismiss() //接单成功之后刷新列表 dataBeans.removeAt(clickedPosition) notProcessedAdapter.notifyItemRemoved(clickedPosition) @@ -98,7 +98,7 @@ ) } - else -> LoadingDialogHub.dismiss() + else -> LoadingDialog.dismiss() } } } @@ -131,7 +131,7 @@ } else { binding.emptyInclude.emptyView.hide() notProcessedAdapter = OrderNotProcessedAdapter(requireContext(), dataBeans) - binding.notProcessedView.adapter = notProcessedAdapter + binding.recyclerView.adapter = notProcessedAdapter notProcessedAdapter.setOnItemClickListener(object : OrderNotProcessedAdapter.OnItemClickListener { override fun onClicked(position: Int) { diff --git a/app/src/main/java/com/casic/app/smartwell/fragment/OvertimeNotAcceptFragment.kt b/app/src/main/java/com/casic/app/smartwell/fragment/OvertimeNotAcceptFragment.kt index a198545..9b318ca 100644 --- a/app/src/main/java/com/casic/app/smartwell/fragment/OvertimeNotAcceptFragment.kt +++ b/app/src/main/java/com/casic/app/smartwell/fragment/OvertimeNotAcceptFragment.kt @@ -18,7 +18,7 @@ import com.pengxh.kt.lite.extensions.navigatePageTo import com.pengxh.kt.lite.extensions.show import com.pengxh.kt.lite.utils.LoadState -import com.pengxh.kt.lite.utils.LoadingDialogHub +import com.pengxh.kt.lite.utils.LoadingDialog import com.pengxh.kt.lite.utils.WeakReferenceHandler import com.pengxh.kt.lite.widget.dialog.AlertControlDialog @@ -81,8 +81,8 @@ operationViewModel = ViewModelProvider(this)[OperationViewModel::class.java] - binding.notProcessedView.addItemDecoration( - RecyclerViewItemOffsets(0, 5, 0, 5) + binding.recyclerView.addItemDecoration( + RecyclerViewItemOffsets(0, 7, 0, 7) ) } @@ -90,9 +90,9 @@ //接单状态处理 operationViewModel.loadState.observe(this) { when (it) { - is LoadState.Loading -> LoadingDialogHub.show(requireActivity(), "接单中,请稍后") + is LoadState.Loading -> LoadingDialog.show(requireActivity(), "接单中,请稍后") is LoadState.Success -> { - LoadingDialogHub.dismiss() + LoadingDialog.dismiss() //接单成功之后刷新列表 dataBeans.removeAt(clickedPosition) notProcessedAdapter.notifyItemRemoved(clickedPosition) @@ -101,7 +101,7 @@ ) } - else -> LoadingDialogHub.dismiss() + else -> LoadingDialog.dismiss() } } } @@ -134,7 +134,7 @@ } else { binding.emptyInclude.emptyView.hide() notProcessedAdapter = OrderNotProcessedAdapter(requireContext(), dataBeans) - binding.notProcessedView.adapter = notProcessedAdapter + binding.recyclerView.adapter = notProcessedAdapter notProcessedAdapter.setOnItemClickListener(object : OrderNotProcessedAdapter.OnItemClickListener { override fun onClicked(position: Int) { diff --git a/app/src/main/java/com/casic/app/smartwell/greendao/DaoMaster.java b/app/src/main/java/com/casic/app/smartwell/greendao/DaoMaster.java index fdcf3a7..1e52b74 100644 --- a/app/src/main/java/com/casic/app/smartwell/greendao/DaoMaster.java +++ b/app/src/main/java/com/casic/app/smartwell/greendao/DaoMaster.java @@ -13,25 +13,20 @@ // THIS CODE IS GENERATED BY greenDAO, DO NOT EDIT. - /** * Master of DAO (schema version 4): knows all DAOs. */ public class DaoMaster extends AbstractDaoMaster { public static final int SCHEMA_VERSION = 4; - /** - * Creates underlying database table using DAOs. - */ + /** Creates underlying database table using DAOs. */ public static void createAllTables(Database db, boolean ifNotExists) { MapWellLocalBeanDao.createTable(db, ifNotExists); NoticeLocaleBeanDao.createTable(db, ifNotExists); PipeLocalBeanDao.createTable(db, ifNotExists); } - /** - * Drops underlying database table using DAOs. - */ + /** Drops underlying database table using DAOs. */ public static void dropAllTables(Database db, boolean ifExists) { MapWellLocalBeanDao.dropTable(db, ifExists); NoticeLocaleBeanDao.dropTable(db, ifExists); @@ -86,9 +81,7 @@ } } - /** - * WARNING: Drops all table on Upgrade! Use only during development. - */ + /** WARNING: Drops all table on Upgrade! Use only during development. */ public static class DevOpenHelper extends OpenHelper { public DevOpenHelper(Context context, String name) { super(context, name); diff --git a/app/src/main/java/com/casic/app/smartwell/greendao/DaoSession.java b/app/src/main/java/com/casic/app/smartwell/greendao/DaoSession.java index 0b36d17..3e40e3b 100644 --- a/app/src/main/java/com/casic/app/smartwell/greendao/DaoSession.java +++ b/app/src/main/java/com/casic/app/smartwell/greendao/DaoSession.java @@ -16,7 +16,7 @@ /** * {@inheritDoc} - * + * * @see org.greenrobot.greendao.AbstractDaoSession */ public class DaoSession extends AbstractDaoSession { @@ -50,7 +50,7 @@ registerDao(NoticeLocaleBean.class, noticeLocaleBeanDao); registerDao(PipeLocalBean.class, pipeLocalBeanDao); } - + public void clear() { mapWellLocalBeanDaoConfig.clearIdentityScope(); noticeLocaleBeanDaoConfig.clearIdentityScope(); diff --git a/app/src/main/java/com/casic/app/smartwell/greendao/MapWellLocalBeanDao.java b/app/src/main/java/com/casic/app/smartwell/greendao/MapWellLocalBeanDao.java index 8908fda..407bc92 100644 --- a/app/src/main/java/com/casic/app/smartwell/greendao/MapWellLocalBeanDao.java +++ b/app/src/main/java/com/casic/app/smartwell/greendao/MapWellLocalBeanDao.java @@ -12,10 +12,9 @@ import org.greenrobot.greendao.internal.DaoConfig; // THIS CODE IS GENERATED BY greenDAO, DO NOT EDIT. - -/** +/** * DAO for table "MAP_WELL_LOCAL_BEAN". - */ +*/ public class MapWellLocalBeanDao extends AbstractDao { public static final String TABLENAME = "MAP_WELL_LOCAL_BEAN"; @@ -57,16 +56,14 @@ public MapWellLocalBeanDao(DaoConfig config) { super(config); } - + public MapWellLocalBeanDao(DaoConfig config, DaoSession daoSession) { super(config, daoSession); } - /** - * Creates the underlying database table. - */ + /** Creates the underlying database table. */ public static void createTable(Database db, boolean ifNotExists) { - String constraint = ifNotExists ? "IF NOT EXISTS " : ""; + String constraint = ifNotExists? "IF NOT EXISTS ": ""; db.execSQL("CREATE TABLE " + constraint + "\"MAP_WELL_LOCAL_BEAN\" (" + // "\"_id\" INTEGER PRIMARY KEY AUTOINCREMENT ," + // 0: kId "\"AREA\" TEXT," + // 1: area @@ -96,9 +93,7 @@ "\"WELL_TYPE_NAME\" TEXT);"); // 25: wellTypeName } - /** - * Drops the underlying database table. - */ + /** Drops the underlying database table. */ public static void dropTable(Database db, boolean ifExists) { String sql = "DROP TABLE " + (ifExists ? "IF EXISTS " : "") + "\"MAP_WELL_LOCAL_BEAN\""; db.execSQL(sql); @@ -107,132 +102,132 @@ @Override protected final void bindValues(DatabaseStatement stmt, MapWellLocalBean entity) { stmt.clearBindings(); - + Long kId = entity.getKId(); if (kId != null) { stmt.bindLong(1, kId); } - + String area = entity.getArea(); if (area != null) { stmt.bindString(2, area); } - + String bfzt = entity.getBfzt(); if (bfzt != null) { stmt.bindString(3, bfzt); } - + String bfztName = entity.getBfztName(); if (bfztName != null) { stmt.bindString(4, bfztName); } - + String coordinateX = entity.getCoordinateX(); if (coordinateX != null) { stmt.bindString(5, coordinateX); } - + String coordinateY = entity.getCoordinateY(); if (coordinateY != null) { stmt.bindString(6, coordinateY); } - + String deep = entity.getDeep(); if (deep != null) { stmt.bindString(7, deep); } - + String deptName = entity.getDeptName(); if (deptName != null) { stmt.bindString(8, deptName); } - + String deptid = entity.getDeptid(); if (deptid != null) { stmt.bindString(9, deptid); } - + String id = entity.getId(); if (id != null) { stmt.bindString(10, id); } - + String latBaidu = entity.getLatBaidu(); if (latBaidu != null) { stmt.bindString(11, latBaidu); } - + String latGaode = entity.getLatGaode(); if (latGaode != null) { stmt.bindString(12, latGaode); } - + String lngBaidu = entity.getLngBaidu(); if (lngBaidu != null) { stmt.bindString(13, lngBaidu); } - + String lngGaode = entity.getLngGaode(); if (lngGaode != null) { stmt.bindString(14, lngGaode); } - + String notes = entity.getNotes(); if (notes != null) { stmt.bindString(15, notes); } - + String photos = entity.getPhotos(); if (photos != null) { stmt.bindString(16, photos); } - + String position = entity.getPosition(); if (position != null) { stmt.bindString(17, position); } - + String staff = entity.getStaff(); if (staff != null) { stmt.bindString(18, staff); } - + String tel = entity.getTel(); if (tel != null) { stmt.bindString(19, tel); } - + String ts = entity.getTs(); if (ts != null) { stmt.bindString(20, ts); } - + String valid = entity.getValid(); if (valid != null) { stmt.bindString(21, valid); } - + String watchData = entity.getWatchData(); if (watchData != null) { stmt.bindString(22, watchData); } - + String wellCode = entity.getWellCode(); if (wellCode != null) { stmt.bindString(23, wellCode); } - + String wellName = entity.getWellName(); if (wellName != null) { stmt.bindString(24, wellName); } - + String wellType = entity.getWellType(); if (wellType != null) { stmt.bindString(25, wellType); } - + String wellTypeName = entity.getWellTypeName(); if (wellTypeName != null) { stmt.bindString(26, wellTypeName); @@ -242,132 +237,132 @@ @Override protected final void bindValues(SQLiteStatement stmt, MapWellLocalBean entity) { stmt.clearBindings(); - + Long kId = entity.getKId(); if (kId != null) { stmt.bindLong(1, kId); } - + String area = entity.getArea(); if (area != null) { stmt.bindString(2, area); } - + String bfzt = entity.getBfzt(); if (bfzt != null) { stmt.bindString(3, bfzt); } - + String bfztName = entity.getBfztName(); if (bfztName != null) { stmt.bindString(4, bfztName); } - + String coordinateX = entity.getCoordinateX(); if (coordinateX != null) { stmt.bindString(5, coordinateX); } - + String coordinateY = entity.getCoordinateY(); if (coordinateY != null) { stmt.bindString(6, coordinateY); } - + String deep = entity.getDeep(); if (deep != null) { stmt.bindString(7, deep); } - + String deptName = entity.getDeptName(); if (deptName != null) { stmt.bindString(8, deptName); } - + String deptid = entity.getDeptid(); if (deptid != null) { stmt.bindString(9, deptid); } - + String id = entity.getId(); if (id != null) { stmt.bindString(10, id); } - + String latBaidu = entity.getLatBaidu(); if (latBaidu != null) { stmt.bindString(11, latBaidu); } - + String latGaode = entity.getLatGaode(); if (latGaode != null) { stmt.bindString(12, latGaode); } - + String lngBaidu = entity.getLngBaidu(); if (lngBaidu != null) { stmt.bindString(13, lngBaidu); } - + String lngGaode = entity.getLngGaode(); if (lngGaode != null) { stmt.bindString(14, lngGaode); } - + String notes = entity.getNotes(); if (notes != null) { stmt.bindString(15, notes); } - + String photos = entity.getPhotos(); if (photos != null) { stmt.bindString(16, photos); } - + String position = entity.getPosition(); if (position != null) { stmt.bindString(17, position); } - + String staff = entity.getStaff(); if (staff != null) { stmt.bindString(18, staff); } - + String tel = entity.getTel(); if (tel != null) { stmt.bindString(19, tel); } - + String ts = entity.getTs(); if (ts != null) { stmt.bindString(20, ts); } - + String valid = entity.getValid(); if (valid != null) { stmt.bindString(21, valid); } - + String watchData = entity.getWatchData(); if (watchData != null) { stmt.bindString(22, watchData); } - + String wellCode = entity.getWellCode(); if (wellCode != null) { stmt.bindString(23, wellCode); } - + String wellName = entity.getWellName(); if (wellName != null) { stmt.bindString(24, wellName); } - + String wellType = entity.getWellType(); if (wellType != null) { stmt.bindString(25, wellType); } - + String wellTypeName = entity.getWellTypeName(); if (wellTypeName != null) { stmt.bindString(26, wellTypeName); @@ -377,41 +372,41 @@ @Override public Long readKey(Cursor cursor, int offset) { return cursor.isNull(offset + 0) ? null : cursor.getLong(offset + 0); - } + } @Override public MapWellLocalBean readEntity(Cursor cursor, int offset) { MapWellLocalBean entity = new MapWellLocalBean( // - cursor.isNull(offset + 0) ? null : cursor.getLong(offset + 0), // kId - cursor.isNull(offset + 1) ? null : cursor.getString(offset + 1), // area - cursor.isNull(offset + 2) ? null : cursor.getString(offset + 2), // bfzt - cursor.isNull(offset + 3) ? null : cursor.getString(offset + 3), // bfztName - cursor.isNull(offset + 4) ? null : cursor.getString(offset + 4), // coordinateX - cursor.isNull(offset + 5) ? null : cursor.getString(offset + 5), // coordinateY - cursor.isNull(offset + 6) ? null : cursor.getString(offset + 6), // deep - cursor.isNull(offset + 7) ? null : cursor.getString(offset + 7), // deptName - cursor.isNull(offset + 8) ? null : cursor.getString(offset + 8), // deptid - cursor.isNull(offset + 9) ? null : cursor.getString(offset + 9), // id - cursor.isNull(offset + 10) ? null : cursor.getString(offset + 10), // latBaidu - cursor.isNull(offset + 11) ? null : cursor.getString(offset + 11), // latGaode - cursor.isNull(offset + 12) ? null : cursor.getString(offset + 12), // lngBaidu - cursor.isNull(offset + 13) ? null : cursor.getString(offset + 13), // lngGaode - cursor.isNull(offset + 14) ? null : cursor.getString(offset + 14), // notes - cursor.isNull(offset + 15) ? null : cursor.getString(offset + 15), // photos - cursor.isNull(offset + 16) ? null : cursor.getString(offset + 16), // position - cursor.isNull(offset + 17) ? null : cursor.getString(offset + 17), // staff - cursor.isNull(offset + 18) ? null : cursor.getString(offset + 18), // tel - cursor.isNull(offset + 19) ? null : cursor.getString(offset + 19), // ts - cursor.isNull(offset + 20) ? null : cursor.getString(offset + 20), // valid - cursor.isNull(offset + 21) ? null : cursor.getString(offset + 21), // watchData - cursor.isNull(offset + 22) ? null : cursor.getString(offset + 22), // wellCode - cursor.isNull(offset + 23) ? null : cursor.getString(offset + 23), // wellName - cursor.isNull(offset + 24) ? null : cursor.getString(offset + 24), // wellType - cursor.isNull(offset + 25) ? null : cursor.getString(offset + 25) // wellTypeName + cursor.isNull(offset + 0) ? null : cursor.getLong(offset + 0), // kId + cursor.isNull(offset + 1) ? null : cursor.getString(offset + 1), // area + cursor.isNull(offset + 2) ? null : cursor.getString(offset + 2), // bfzt + cursor.isNull(offset + 3) ? null : cursor.getString(offset + 3), // bfztName + cursor.isNull(offset + 4) ? null : cursor.getString(offset + 4), // coordinateX + cursor.isNull(offset + 5) ? null : cursor.getString(offset + 5), // coordinateY + cursor.isNull(offset + 6) ? null : cursor.getString(offset + 6), // deep + cursor.isNull(offset + 7) ? null : cursor.getString(offset + 7), // deptName + cursor.isNull(offset + 8) ? null : cursor.getString(offset + 8), // deptid + cursor.isNull(offset + 9) ? null : cursor.getString(offset + 9), // id + cursor.isNull(offset + 10) ? null : cursor.getString(offset + 10), // latBaidu + cursor.isNull(offset + 11) ? null : cursor.getString(offset + 11), // latGaode + cursor.isNull(offset + 12) ? null : cursor.getString(offset + 12), // lngBaidu + cursor.isNull(offset + 13) ? null : cursor.getString(offset + 13), // lngGaode + cursor.isNull(offset + 14) ? null : cursor.getString(offset + 14), // notes + cursor.isNull(offset + 15) ? null : cursor.getString(offset + 15), // photos + cursor.isNull(offset + 16) ? null : cursor.getString(offset + 16), // position + cursor.isNull(offset + 17) ? null : cursor.getString(offset + 17), // staff + cursor.isNull(offset + 18) ? null : cursor.getString(offset + 18), // tel + cursor.isNull(offset + 19) ? null : cursor.getString(offset + 19), // ts + cursor.isNull(offset + 20) ? null : cursor.getString(offset + 20), // valid + cursor.isNull(offset + 21) ? null : cursor.getString(offset + 21), // watchData + cursor.isNull(offset + 22) ? null : cursor.getString(offset + 22), // wellCode + cursor.isNull(offset + 23) ? null : cursor.getString(offset + 23), // wellName + cursor.isNull(offset + 24) ? null : cursor.getString(offset + 24), // wellType + cursor.isNull(offset + 25) ? null : cursor.getString(offset + 25) // wellTypeName ); return entity; } - + @Override public void readEntity(Cursor cursor, MapWellLocalBean entity, int offset) { entity.setKId(cursor.isNull(offset + 0) ? null : cursor.getLong(offset + 0)); @@ -440,17 +435,17 @@ entity.setWellName(cursor.isNull(offset + 23) ? null : cursor.getString(offset + 23)); entity.setWellType(cursor.isNull(offset + 24) ? null : cursor.getString(offset + 24)); entity.setWellTypeName(cursor.isNull(offset + 25) ? null : cursor.getString(offset + 25)); - } - + } + @Override protected final Long updateKeyAfterInsert(MapWellLocalBean entity, long rowId) { entity.setKId(rowId); return rowId; } - + @Override public Long getKey(MapWellLocalBean entity) { - if (entity != null) { + if(entity != null) { return entity.getKId(); } else { return null; @@ -466,5 +461,5 @@ protected final boolean isEntityUpdateable() { return true; } - + } diff --git a/app/src/main/java/com/casic/app/smartwell/greendao/NoticeLocaleBeanDao.java b/app/src/main/java/com/casic/app/smartwell/greendao/NoticeLocaleBeanDao.java index 64312ed..deb2d49 100644 --- a/app/src/main/java/com/casic/app/smartwell/greendao/NoticeLocaleBeanDao.java +++ b/app/src/main/java/com/casic/app/smartwell/greendao/NoticeLocaleBeanDao.java @@ -12,10 +12,9 @@ import org.greenrobot.greendao.internal.DaoConfig; // THIS CODE IS GENERATED BY greenDAO, DO NOT EDIT. - -/** +/** * DAO for table "NOTICE_LOCALE_BEAN". - */ +*/ public class NoticeLocaleBeanDao extends AbstractDao { public static final String TABLENAME = "NOTICE_LOCALE_BEAN"; @@ -43,16 +42,14 @@ public NoticeLocaleBeanDao(DaoConfig config) { super(config); } - + public NoticeLocaleBeanDao(DaoConfig config, DaoSession daoSession) { super(config, daoSession); } - /** - * Creates the underlying database table. - */ + /** Creates the underlying database table. */ public static void createTable(Database db, boolean ifNotExists) { - String constraint = ifNotExists ? "IF NOT EXISTS " : ""; + String constraint = ifNotExists? "IF NOT EXISTS ": ""; db.execSQL("CREATE TABLE " + constraint + "\"NOTICE_LOCALE_BEAN\" (" + // "\"_id\" INTEGER PRIMARY KEY AUTOINCREMENT ," + // 0: id "\"MESSAGE_ID\" TEXT UNIQUE ," + // 1: messageId @@ -68,9 +65,7 @@ "\"NOTICE_TIME\" TEXT);"); // 11: noticeTime } - /** - * Drops the underlying database table. - */ + /** Drops the underlying database table. */ public static void dropTable(Database db, boolean ifExists) { String sql = "DROP TABLE " + (ifExists ? "IF EXISTS " : "") + "\"NOTICE_LOCALE_BEAN\""; db.execSQL(sql); @@ -79,62 +74,62 @@ @Override protected final void bindValues(DatabaseStatement stmt, NoticeLocaleBean entity) { stmt.clearBindings(); - + Long id = entity.getId(); if (id != null) { stmt.bindLong(1, id); } - + String messageId = entity.getMessageId(); if (messageId != null) { stmt.bindString(2, messageId); } - + String appid = entity.getAppid(); if (appid != null) { stmt.bindString(3, appid); } - + String clientId = entity.getClientId(); if (clientId != null) { stmt.bindString(4, clientId); } - + String taskId = entity.getTaskId(); if (taskId != null) { stmt.bindString(5, taskId); } - + String userId = entity.getUserId(); if (userId != null) { stmt.bindString(6, userId); } - + String title = entity.getTitle(); if (title != null) { stmt.bindString(7, title); } - + String content = entity.getContent(); if (content != null) { stmt.bindString(8, content); } - + String deviceCode = entity.getDeviceCode(); if (deviceCode != null) { stmt.bindString(9, deviceCode); } - + String jobId = entity.getJobId(); if (jobId != null) { stmt.bindString(10, jobId); } - + String isRead = entity.getIsRead(); if (isRead != null) { stmt.bindString(11, isRead); } - + String noticeTime = entity.getNoticeTime(); if (noticeTime != null) { stmt.bindString(12, noticeTime); @@ -144,62 +139,62 @@ @Override protected final void bindValues(SQLiteStatement stmt, NoticeLocaleBean entity) { stmt.clearBindings(); - + Long id = entity.getId(); if (id != null) { stmt.bindLong(1, id); } - + String messageId = entity.getMessageId(); if (messageId != null) { stmt.bindString(2, messageId); } - + String appid = entity.getAppid(); if (appid != null) { stmt.bindString(3, appid); } - + String clientId = entity.getClientId(); if (clientId != null) { stmt.bindString(4, clientId); } - + String taskId = entity.getTaskId(); if (taskId != null) { stmt.bindString(5, taskId); } - + String userId = entity.getUserId(); if (userId != null) { stmt.bindString(6, userId); } - + String title = entity.getTitle(); if (title != null) { stmt.bindString(7, title); } - + String content = entity.getContent(); if (content != null) { stmt.bindString(8, content); } - + String deviceCode = entity.getDeviceCode(); if (deviceCode != null) { stmt.bindString(9, deviceCode); } - + String jobId = entity.getJobId(); if (jobId != null) { stmt.bindString(10, jobId); } - + String isRead = entity.getIsRead(); if (isRead != null) { stmt.bindString(11, isRead); } - + String noticeTime = entity.getNoticeTime(); if (noticeTime != null) { stmt.bindString(12, noticeTime); @@ -209,27 +204,27 @@ @Override public Long readKey(Cursor cursor, int offset) { return cursor.isNull(offset + 0) ? null : cursor.getLong(offset + 0); - } + } @Override public NoticeLocaleBean readEntity(Cursor cursor, int offset) { NoticeLocaleBean entity = new NoticeLocaleBean( // - cursor.isNull(offset + 0) ? null : cursor.getLong(offset + 0), // id - cursor.isNull(offset + 1) ? null : cursor.getString(offset + 1), // messageId - cursor.isNull(offset + 2) ? null : cursor.getString(offset + 2), // appid - cursor.isNull(offset + 3) ? null : cursor.getString(offset + 3), // clientId - cursor.isNull(offset + 4) ? null : cursor.getString(offset + 4), // taskId - cursor.isNull(offset + 5) ? null : cursor.getString(offset + 5), // userId - cursor.isNull(offset + 6) ? null : cursor.getString(offset + 6), // title - cursor.isNull(offset + 7) ? null : cursor.getString(offset + 7), // content - cursor.isNull(offset + 8) ? null : cursor.getString(offset + 8), // deviceCode - cursor.isNull(offset + 9) ? null : cursor.getString(offset + 9), // jobId - cursor.isNull(offset + 10) ? null : cursor.getString(offset + 10), // isRead - cursor.isNull(offset + 11) ? null : cursor.getString(offset + 11) // noticeTime + cursor.isNull(offset + 0) ? null : cursor.getLong(offset + 0), // id + cursor.isNull(offset + 1) ? null : cursor.getString(offset + 1), // messageId + cursor.isNull(offset + 2) ? null : cursor.getString(offset + 2), // appid + cursor.isNull(offset + 3) ? null : cursor.getString(offset + 3), // clientId + cursor.isNull(offset + 4) ? null : cursor.getString(offset + 4), // taskId + cursor.isNull(offset + 5) ? null : cursor.getString(offset + 5), // userId + cursor.isNull(offset + 6) ? null : cursor.getString(offset + 6), // title + cursor.isNull(offset + 7) ? null : cursor.getString(offset + 7), // content + cursor.isNull(offset + 8) ? null : cursor.getString(offset + 8), // deviceCode + cursor.isNull(offset + 9) ? null : cursor.getString(offset + 9), // jobId + cursor.isNull(offset + 10) ? null : cursor.getString(offset + 10), // isRead + cursor.isNull(offset + 11) ? null : cursor.getString(offset + 11) // noticeTime ); return entity; } - + @Override public void readEntity(Cursor cursor, NoticeLocaleBean entity, int offset) { entity.setId(cursor.isNull(offset + 0) ? null : cursor.getLong(offset + 0)); @@ -244,17 +239,17 @@ entity.setJobId(cursor.isNull(offset + 9) ? null : cursor.getString(offset + 9)); entity.setIsRead(cursor.isNull(offset + 10) ? null : cursor.getString(offset + 10)); entity.setNoticeTime(cursor.isNull(offset + 11) ? null : cursor.getString(offset + 11)); - } - + } + @Override protected final Long updateKeyAfterInsert(NoticeLocaleBean entity, long rowId) { entity.setId(rowId); return rowId; } - + @Override public Long getKey(NoticeLocaleBean entity) { - if (entity != null) { + if(entity != null) { return entity.getId(); } else { return null; @@ -270,5 +265,5 @@ protected final boolean isEntityUpdateable() { return true; } - + } diff --git a/app/src/main/java/com/casic/app/smartwell/greendao/PipeLocalBeanDao.java b/app/src/main/java/com/casic/app/smartwell/greendao/PipeLocalBeanDao.java index aab4d3f..df5515a 100644 --- a/app/src/main/java/com/casic/app/smartwell/greendao/PipeLocalBeanDao.java +++ b/app/src/main/java/com/casic/app/smartwell/greendao/PipeLocalBeanDao.java @@ -12,10 +12,9 @@ import org.greenrobot.greendao.internal.DaoConfig; // THIS CODE IS GENERATED BY greenDAO, DO NOT EDIT. - -/** +/** * DAO for table "PIPE_LOCAL_BEAN". - */ +*/ public class PipeLocalBeanDao extends AbstractDao { public static final String TABLENAME = "PIPE_LOCAL_BEAN"; @@ -37,16 +36,14 @@ public PipeLocalBeanDao(DaoConfig config) { super(config); } - + public PipeLocalBeanDao(DaoConfig config, DaoSession daoSession) { super(config, daoSession); } - /** - * Creates the underlying database table. - */ + /** Creates the underlying database table. */ public static void createTable(Database db, boolean ifNotExists) { - String constraint = ifNotExists ? "IF NOT EXISTS " : ""; + String constraint = ifNotExists? "IF NOT EXISTS ": ""; db.execSQL("CREATE TABLE " + constraint + "\"PIPE_LOCAL_BEAN\" (" + // "\"_id\" INTEGER PRIMARY KEY AUTOINCREMENT ," + // 0: id "\"PIPE_CODE\" TEXT," + // 1: pipeCode @@ -56,9 +53,7 @@ "\"START_LONGITUDE_GD\" TEXT);"); // 5: startLongitudeGd } - /** - * Drops the underlying database table. - */ + /** Drops the underlying database table. */ public static void dropTable(Database db, boolean ifExists) { String sql = "DROP TABLE " + (ifExists ? "IF EXISTS " : "") + "\"PIPE_LOCAL_BEAN\""; db.execSQL(sql); @@ -67,32 +62,32 @@ @Override protected final void bindValues(DatabaseStatement stmt, PipeLocalBean entity) { stmt.clearBindings(); - + Long id = entity.getId(); if (id != null) { stmt.bindLong(1, id); } - + String pipeCode = entity.getPipeCode(); if (pipeCode != null) { stmt.bindString(2, pipeCode); } - + String endLatitudeGd = entity.getEndLatitudeGd(); if (endLatitudeGd != null) { stmt.bindString(3, endLatitudeGd); } - + String endLongitudeGd = entity.getEndLongitudeGd(); if (endLongitudeGd != null) { stmt.bindString(4, endLongitudeGd); } - + String startLatitudeGd = entity.getStartLatitudeGd(); if (startLatitudeGd != null) { stmt.bindString(5, startLatitudeGd); } - + String startLongitudeGd = entity.getStartLongitudeGd(); if (startLongitudeGd != null) { stmt.bindString(6, startLongitudeGd); @@ -102,32 +97,32 @@ @Override protected final void bindValues(SQLiteStatement stmt, PipeLocalBean entity) { stmt.clearBindings(); - + Long id = entity.getId(); if (id != null) { stmt.bindLong(1, id); } - + String pipeCode = entity.getPipeCode(); if (pipeCode != null) { stmt.bindString(2, pipeCode); } - + String endLatitudeGd = entity.getEndLatitudeGd(); if (endLatitudeGd != null) { stmt.bindString(3, endLatitudeGd); } - + String endLongitudeGd = entity.getEndLongitudeGd(); if (endLongitudeGd != null) { stmt.bindString(4, endLongitudeGd); } - + String startLatitudeGd = entity.getStartLatitudeGd(); if (startLatitudeGd != null) { stmt.bindString(5, startLatitudeGd); } - + String startLongitudeGd = entity.getStartLongitudeGd(); if (startLongitudeGd != null) { stmt.bindString(6, startLongitudeGd); @@ -137,21 +132,21 @@ @Override public Long readKey(Cursor cursor, int offset) { return cursor.isNull(offset + 0) ? null : cursor.getLong(offset + 0); - } + } @Override public PipeLocalBean readEntity(Cursor cursor, int offset) { PipeLocalBean entity = new PipeLocalBean( // - cursor.isNull(offset + 0) ? null : cursor.getLong(offset + 0), // id - cursor.isNull(offset + 1) ? null : cursor.getString(offset + 1), // pipeCode - cursor.isNull(offset + 2) ? null : cursor.getString(offset + 2), // endLatitudeGd - cursor.isNull(offset + 3) ? null : cursor.getString(offset + 3), // endLongitudeGd - cursor.isNull(offset + 4) ? null : cursor.getString(offset + 4), // startLatitudeGd - cursor.isNull(offset + 5) ? null : cursor.getString(offset + 5) // startLongitudeGd + cursor.isNull(offset + 0) ? null : cursor.getLong(offset + 0), // id + cursor.isNull(offset + 1) ? null : cursor.getString(offset + 1), // pipeCode + cursor.isNull(offset + 2) ? null : cursor.getString(offset + 2), // endLatitudeGd + cursor.isNull(offset + 3) ? null : cursor.getString(offset + 3), // endLongitudeGd + cursor.isNull(offset + 4) ? null : cursor.getString(offset + 4), // startLatitudeGd + cursor.isNull(offset + 5) ? null : cursor.getString(offset + 5) // startLongitudeGd ); return entity; } - + @Override public void readEntity(Cursor cursor, PipeLocalBean entity, int offset) { entity.setId(cursor.isNull(offset + 0) ? null : cursor.getLong(offset + 0)); @@ -160,17 +155,17 @@ entity.setEndLongitudeGd(cursor.isNull(offset + 3) ? null : cursor.getString(offset + 3)); entity.setStartLatitudeGd(cursor.isNull(offset + 4) ? null : cursor.getString(offset + 4)); entity.setStartLongitudeGd(cursor.isNull(offset + 5) ? null : cursor.getString(offset + 5)); - } - + } + @Override protected final Long updateKeyAfterInsert(PipeLocalBean entity, long rowId) { entity.setId(rowId); return rowId; } - + @Override public Long getKey(PipeLocalBean entity) { - if (entity != null) { + if(entity != null) { return entity.getId(); } else { return null; @@ -186,5 +181,5 @@ protected final boolean isEntityUpdateable() { return true; } - + } diff --git a/app/src/main/java/com/casic/app/smartwell/view/ChangePasswordActivity.kt b/app/src/main/java/com/casic/app/smartwell/view/ChangePasswordActivity.kt index 8e41039..9f1dd40 100644 --- a/app/src/main/java/com/casic/app/smartwell/view/ChangePasswordActivity.kt +++ b/app/src/main/java/com/casic/app/smartwell/view/ChangePasswordActivity.kt @@ -14,7 +14,7 @@ import com.pengxh.kt.lite.extensions.show import com.pengxh.kt.lite.utils.ActivityStackManager import com.pengxh.kt.lite.utils.LoadState -import com.pengxh.kt.lite.utils.LoadingDialogHub +import com.pengxh.kt.lite.utils.LoadingDialog import com.pengxh.kt.lite.widget.TitleBarView import java.nio.charset.StandardCharsets @@ -46,15 +46,15 @@ override fun observeRequestState() { userViewModel.loadState.observe(this) { when (it) { - is LoadState.Loading -> LoadingDialogHub.show(this, "修改中,请稍后") + is LoadState.Loading -> LoadingDialog.show(this, "修改中,请稍后") is LoadState.Success -> { - LoadingDialogHub.dismiss() + LoadingDialog.dismiss() AuthenticationHelper.removeToken() this.navigatePageTo() ActivityStackManager.finishAllActivity() } - else -> LoadingDialogHub.dismiss() + else -> LoadingDialog.dismiss() } } } diff --git a/app/src/main/java/com/casic/app/smartwell/view/DeployedWellActivity.kt b/app/src/main/java/com/casic/app/smartwell/view/DeployedWellActivity.kt index fb4339c..28a5078 100644 --- a/app/src/main/java/com/casic/app/smartwell/view/DeployedWellActivity.kt +++ b/app/src/main/java/com/casic/app/smartwell/view/DeployedWellActivity.kt @@ -83,8 +83,8 @@ } //添加分割线 - binding.deployedListView.addItemDecoration( - RecyclerViewItemOffsets(0, 5, 0, 5) + binding.recyclerView.addItemDecoration( + RecyclerViewItemOffsets(0, 7, 0, 7) ) } @@ -149,12 +149,11 @@ } else { item.deep.toString() + "m" } - viewHolder.setText(R.id.wellNameView, item.wellName) + viewHolder.setText(R.id.wellTypeView, item.wellTypeName) .setText(R.id.wellDepthView, "深:${deep}") .setText(R.id.wellCodeView, "点位编号:${item.wellCode}") - .setText(R.id.wellTypeView, "点位类型:${item.wellTypeName}") .setText(R.id.ownerShipView, "权属单位:${item.deptName}") - .setText(R.id.wellLocationView, "点位置:${item.position}") + .setText(R.id.wellLocationView, "点位位置:${item.position}") .setOnClickListener( R.id.operationButton, object : View.OnClickListener { override fun onClick(v: View?) { @@ -207,7 +206,7 @@ }) } } - binding.deployedListView.adapter = deployAdapter + binding.recyclerView.adapter = deployAdapter deployAdapter.setOnItemClickedListener(object : NormalRecyclerAdapter.OnItemClickedListener { override fun onItemClicked(position: Int, t: WellListModel.DataBean.RowsBean) { diff --git a/app/src/main/java/com/casic/app/smartwell/view/LoginActivity.kt b/app/src/main/java/com/casic/app/smartwell/view/LoginActivity.kt index e4bb0e3..834527b 100644 --- a/app/src/main/java/com/casic/app/smartwell/view/LoginActivity.kt +++ b/app/src/main/java/com/casic/app/smartwell/view/LoginActivity.kt @@ -21,7 +21,7 @@ import com.pengxh.kt.lite.extensions.navigatePageTo import com.pengxh.kt.lite.extensions.readAssetsFile import com.pengxh.kt.lite.extensions.show -import com.pengxh.kt.lite.utils.LoadingDialogHub +import com.pengxh.kt.lite.utils.LoadingDialog import com.pengxh.kt.lite.utils.SaveKeyValues import kotlinx.coroutines.Dispatchers import kotlinx.coroutines.launch @@ -106,11 +106,11 @@ override fun observeRequestState() { authenticateViewModel.loadState.observe(this) { - LoadingDialogHub.show(this, "登录中,请稍后") + LoadingDialog.show(this, "登录中,请稍后") } loginViewModel.loadState.observe(this) { - LoadingDialogHub.dismiss() + LoadingDialog.dismiss() } } diff --git a/app/src/main/java/com/casic/app/smartwell/view/OrderCompletedDetailActivity.kt b/app/src/main/java/com/casic/app/smartwell/view/OrderCompletedDetailActivity.kt index db8ad1f..75cd905 100644 --- a/app/src/main/java/com/casic/app/smartwell/view/OrderCompletedDetailActivity.kt +++ b/app/src/main/java/com/casic/app/smartwell/view/OrderCompletedDetailActivity.kt @@ -17,7 +17,7 @@ import com.pengxh.kt.lite.extensions.show import com.pengxh.kt.lite.utils.Constant import com.pengxh.kt.lite.utils.LoadState -import com.pengxh.kt.lite.utils.LoadingDialogHub +import com.pengxh.kt.lite.utils.LoadingDialog import com.pengxh.kt.lite.widget.TitleBarView import com.pengxh.kt.lite.widget.dialog.AlertMessageDialog @@ -44,7 +44,7 @@ } override fun initOnCreate(savedInstanceState: Bundle?) { - val jobId = intent.getStringExtra(Constant.INTENT_PARAM)!! + val jobId = intent.getStringExtra(Constant.INTENT_PARAM_KEY)!! orderViewModel = ViewModelProvider(this)[OrderViewModel::class.java] orderViewModel.getWorkOrderDetail(jobId) orderViewModel.detailModel.observe(this) { @@ -154,8 +154,8 @@ override fun observeRequestState() { orderViewModel.loadState.observe(this) { when (it) { - is LoadState.Loading -> LoadingDialogHub.show(this, "数据加载中,请稍后") - else -> LoadingDialogHub.dismiss() + is LoadState.Loading -> LoadingDialog.show(this, "数据加载中,请稍后") + else -> LoadingDialog.dismiss() } } } diff --git a/app/src/main/java/com/casic/app/smartwell/view/OrderInHandleDetailActivity.kt b/app/src/main/java/com/casic/app/smartwell/view/OrderInHandleDetailActivity.kt index d70a979..04a7d5d 100644 --- a/app/src/main/java/com/casic/app/smartwell/view/OrderInHandleDetailActivity.kt +++ b/app/src/main/java/com/casic/app/smartwell/view/OrderInHandleDetailActivity.kt @@ -38,7 +38,7 @@ import com.pengxh.kt.lite.extensions.show import com.pengxh.kt.lite.utils.Constant import com.pengxh.kt.lite.utils.LoadState -import com.pengxh.kt.lite.utils.LoadingDialogHub +import com.pengxh.kt.lite.utils.LoadingDialog import com.pengxh.kt.lite.widget.TitleBarView import com.pengxh.kt.lite.widget.dialog.AlertControlDialog import com.pengxh.kt.lite.widget.dialog.AlertMessageDialog @@ -93,7 +93,7 @@ ) binding.addImageRecyclerView.adapter = imageAdapter - val jobId = intent.getStringExtra(Constant.INTENT_PARAM)!!//初始化图片九宫格 + val jobId = intent.getStringExtra(Constant.INTENT_PARAM_KEY)!!//初始化图片九宫格 orderViewModel.getWorkOrderDetail(jobId) orderViewModel.detailModel.observe(this) { if (it.code == 200) { @@ -312,41 +312,41 @@ override fun observeRequestState() { orderViewModel.loadState.observe(this) { when (it) { - is LoadState.Loading -> LoadingDialogHub.show(this, "数据加载中,请稍后") - else -> LoadingDialogHub.dismiss() + is LoadState.Loading -> LoadingDialog.show(this, "数据加载中,请稍后") + else -> LoadingDialog.dismiss() } } uploadImageViewModel.loadState.observe(this) { when (it) { - LoadState.Loading -> LoadingDialogHub.show(this, "图片上传中,请稍后...") - else -> LoadingDialogHub.dismiss() + LoadState.Loading -> LoadingDialog.show(this, "图片上传中,请稍后...") + else -> LoadingDialog.dismiss() } } //转单状态处理 operationViewModel.loadState.observe(this) { when (it) { - is LoadState.Loading -> LoadingDialogHub.show(this, "转单中,请稍后") + is LoadState.Loading -> LoadingDialog.show(this, "转单中,请稍后") is LoadState.Success -> { - LoadingDialogHub.dismiss() + LoadingDialog.dismiss() this.finish() } - else -> LoadingDialogHub.dismiss() + else -> LoadingDialog.dismiss() } } //处理完成工单状态处理 operationViewModel.loadState.observe(this) { when (it) { - is LoadState.Loading -> LoadingDialogHub.show(this, "处理中,请稍后") + is LoadState.Loading -> LoadingDialog.show(this, "处理中,请稍后") is LoadState.Success -> { - LoadingDialogHub.dismiss() + LoadingDialog.dismiss() this.finish() } - else -> LoadingDialogHub.dismiss() + else -> LoadingDialog.dismiss() } } } diff --git a/app/src/main/java/com/casic/app/smartwell/view/OrderNotConfirmedDetailActivity.kt b/app/src/main/java/com/casic/app/smartwell/view/OrderNotConfirmedDetailActivity.kt index 8e036d2..687ec86 100644 --- a/app/src/main/java/com/casic/app/smartwell/view/OrderNotConfirmedDetailActivity.kt +++ b/app/src/main/java/com/casic/app/smartwell/view/OrderNotConfirmedDetailActivity.kt @@ -36,7 +36,7 @@ import com.pengxh.kt.lite.extensions.show import com.pengxh.kt.lite.utils.Constant import com.pengxh.kt.lite.utils.LoadState -import com.pengxh.kt.lite.utils.LoadingDialogHub +import com.pengxh.kt.lite.utils.LoadingDialog import com.pengxh.kt.lite.widget.TitleBarView import com.pengxh.kt.lite.widget.dialog.AlertControlDialog import com.pengxh.kt.lite.widget.dialog.AlertMessageDialog @@ -80,7 +80,7 @@ } override fun initOnCreate(savedInstanceState: Bundle?) { - val jobId = intent.getStringExtra(Constant.INTENT_PARAM)!! + val jobId = intent.getStringExtra(Constant.INTENT_PARAM_KEY)!! //初始化图片九宫格 //左外边距,左内边距,右内边距,右外边距 val viewWidth = getScreenWidth() - (10 + 10 + 10 + 10).dp2px(this) @@ -263,41 +263,41 @@ //数据加载状态处理 orderViewModel.loadState.observe(this) { when (it) { - is LoadState.Loading -> LoadingDialogHub.show(this, "数据加载中,请稍后") - else -> LoadingDialogHub.dismiss() + is LoadState.Loading -> LoadingDialog.show(this, "数据加载中,请稍后") + else -> LoadingDialog.dismiss() } } uploadImageViewModel.loadState.observe(this) { when (it) { - LoadState.Loading -> LoadingDialogHub.show(this, "图片上传中,请稍后") - else -> LoadingDialogHub.dismiss() + LoadState.Loading -> LoadingDialog.show(this, "图片上传中,请稍后") + else -> LoadingDialog.dismiss() } } //转单状态处理 operationViewModel.loadState.observe(this) { when (it) { - is LoadState.Loading -> LoadingDialogHub.show(this, "转单中,请稍后") + is LoadState.Loading -> LoadingDialog.show(this, "转单中,请稍后") is LoadState.Success -> { - LoadingDialogHub.dismiss() + LoadingDialog.dismiss() this.finish() } - else -> LoadingDialogHub.dismiss() + else -> LoadingDialog.dismiss() } } //确认工单状态处理 operationViewModel.loadState.observe(this) { when (it) { - is LoadState.Loading -> LoadingDialogHub.show(this, "处理中,请稍后") + is LoadState.Loading -> LoadingDialog.show(this, "处理中,请稍后") is LoadState.Success -> { - LoadingDialogHub.dismiss() + LoadingDialog.dismiss() this.finish() } - else -> LoadingDialogHub.dismiss() + else -> LoadingDialog.dismiss() } } } diff --git a/app/src/main/java/com/casic/app/smartwell/view/OrderNotProcessedDetailActivity.kt b/app/src/main/java/com/casic/app/smartwell/view/OrderNotProcessedDetailActivity.kt index d3f22dc..0c97a52 100644 --- a/app/src/main/java/com/casic/app/smartwell/view/OrderNotProcessedDetailActivity.kt +++ b/app/src/main/java/com/casic/app/smartwell/view/OrderNotProcessedDetailActivity.kt @@ -18,7 +18,7 @@ import com.pengxh.kt.lite.extensions.show import com.pengxh.kt.lite.utils.Constant import com.pengxh.kt.lite.utils.LoadState -import com.pengxh.kt.lite.utils.LoadingDialogHub +import com.pengxh.kt.lite.utils.LoadingDialog import com.pengxh.kt.lite.widget.TitleBarView import com.pengxh.kt.lite.widget.dialog.AlertControlDialog import com.pengxh.kt.lite.widget.dialog.AlertMessageDialog @@ -50,7 +50,7 @@ } override fun initOnCreate(savedInstanceState: Bundle?) { - this.jobId = intent.getStringExtra(Constant.INTENT_PARAM)!! + this.jobId = intent.getStringExtra(Constant.INTENT_PARAM_KEY)!! orderViewModel = ViewModelProvider(this)[OrderViewModel::class.java] operationViewModel = ViewModelProvider(this)[OperationViewModel::class.java] wellViewModel = ViewModelProvider(this)[WellViewModel::class.java] @@ -162,21 +162,21 @@ //数据加载状态处理 orderViewModel.loadState.observe(this) { when (it) { - is LoadState.Loading -> LoadingDialogHub.show(this, "数据加载中,请稍后") - else -> LoadingDialogHub.dismiss() + is LoadState.Loading -> LoadingDialog.show(this, "数据加载中,请稍后") + else -> LoadingDialog.dismiss() } } //接单状态处理 operationViewModel.loadState.observe(this) { when (it) { - is LoadState.Loading -> LoadingDialogHub.show(this, "接单中,请稍后") + is LoadState.Loading -> LoadingDialog.show(this, "接单中,请稍后") is LoadState.Success -> { - LoadingDialogHub.dismiss() + LoadingDialog.dismiss() this.finish() } - else -> LoadingDialogHub.dismiss() + else -> LoadingDialog.dismiss() } } } diff --git a/app/src/main/java/com/casic/app/smartwell/view/SearchResultActivity.kt b/app/src/main/java/com/casic/app/smartwell/view/SearchResultActivity.kt index 6a92917..4f3a674 100644 --- a/app/src/main/java/com/casic/app/smartwell/view/SearchResultActivity.kt +++ b/app/src/main/java/com/casic/app/smartwell/view/SearchResultActivity.kt @@ -19,7 +19,7 @@ import com.pengxh.kt.lite.extensions.show import com.pengxh.kt.lite.utils.Constant import com.pengxh.kt.lite.utils.LoadState -import com.pengxh.kt.lite.utils.LoadingDialogHub +import com.pengxh.kt.lite.utils.LoadingDialog import com.pengxh.kt.lite.utils.WeakReferenceHandler import com.pengxh.kt.lite.widget.TitleBarView import com.pengxh.kt.lite.widget.dialog.AlertControlDialog @@ -56,7 +56,7 @@ } override fun initOnCreate(savedInstanceState: Bundle?) { - args = intent.getStringArrayListExtra(Constant.INTENT_PARAM)!! + args = intent.getStringArrayListExtra(Constant.INTENT_PARAM_KEY)!! orderViewModel = ViewModelProvider(this)[OrderViewModel::class.java] operationViewModel = ViewModelProvider(this)[OperationViewModel::class.java] @@ -101,24 +101,24 @@ } } - binding.resultRecyclerView.addItemDecoration( - RecyclerViewItemOffsets(0, 5, 0, 5) + binding.recyclerView.addItemDecoration( + RecyclerViewItemOffsets(0, 7, 0, 7) ) } override fun observeRequestState() { orderViewModel.loadState.observe(this) { when (it) { - is LoadState.Loading -> LoadingDialogHub.show(this, "数据加载中,请稍后") - else -> LoadingDialogHub.dismiss() + is LoadState.Loading -> LoadingDialog.show(this, "数据加载中,请稍后") + else -> LoadingDialog.dismiss() } } //接单状态处理 operationViewModel.loadState.observe(this) { when (it) { - is LoadState.Loading -> LoadingDialogHub.show(this, "接单中,请稍后") + is LoadState.Loading -> LoadingDialog.show(this, "接单中,请稍后") is LoadState.Success -> { - LoadingDialogHub.dismiss() + LoadingDialog.dismiss() //接单成功之后刷新列表 dataBeans.removeAt(clickedPosition) searchResultAdapter.notifyItemRemoved(clickedPosition) @@ -127,7 +127,7 @@ ) } - else -> LoadingDialogHub.dismiss() + else -> LoadingDialog.dismiss() } } } @@ -162,7 +162,7 @@ } else { binding.emptyInclude.emptyView.hide() searchResultAdapter = SearchResultAdapter(this, dataBeans) - binding.resultRecyclerView.adapter = searchResultAdapter + binding.recyclerView.adapter = searchResultAdapter searchResultAdapter.setOnItemClickListener(object : SearchResultAdapter.OnItemClickListener { override fun onClicked(position: Int) { diff --git a/app/src/main/java/com/casic/app/smartwell/view/UnDeployWellActivity.kt b/app/src/main/java/com/casic/app/smartwell/view/UnDeployWellActivity.kt index 7f7cd3c..555c278 100644 --- a/app/src/main/java/com/casic/app/smartwell/view/UnDeployWellActivity.kt +++ b/app/src/main/java/com/casic/app/smartwell/view/UnDeployWellActivity.kt @@ -81,8 +81,8 @@ } } - binding.undeployListView.addItemDecoration( - RecyclerViewItemOffsets(0, 5, 0, 5) + binding.recyclerView.addItemDecoration( + RecyclerViewItemOffsets(0, 7, 0, 7) ) } @@ -147,12 +147,11 @@ } else { item.deep.toString() + "m" } - viewHolder.setText(R.id.wellNameView, item.wellName) + viewHolder.setText(R.id.wellTypeView, item.wellTypeName) .setText(R.id.wellDepthView, "深:${deep}") .setText(R.id.wellCodeView, "点位编号:${item.wellCode}") - .setText(R.id.wellTypeView, "点位类型:${item.wellTypeName}") .setText(R.id.ownerShipView, "权属单位:${item.deptName}") - .setText(R.id.wellLocationView, "点位置:${item.position}") + .setText(R.id.wellLocationView, "点位位置:${item.position}") .setOnClickListener( R.id.operationButton, object : View.OnClickListener { override fun onClick(v: View?) { @@ -185,7 +184,7 @@ ) } } - binding.undeployListView.adapter = unDeployAdapter + binding.recyclerView.adapter = unDeployAdapter unDeployAdapter.setOnItemClickedListener(object : NormalRecyclerAdapter.OnItemClickedListener { override fun onItemClicked(position: Int, t: WellListModel.DataBean.RowsBean) { diff --git a/app/src/main/java/com/casic/app/smartwell/view/WellDetailActivity.kt b/app/src/main/java/com/casic/app/smartwell/view/WellDetailActivity.kt index b50d067..eb8b468 100644 --- a/app/src/main/java/com/casic/app/smartwell/view/WellDetailActivity.kt +++ b/app/src/main/java/com/casic/app/smartwell/view/WellDetailActivity.kt @@ -16,7 +16,7 @@ import com.pengxh.kt.lite.extensions.show import com.pengxh.kt.lite.utils.Constant import com.pengxh.kt.lite.utils.LoadState -import com.pengxh.kt.lite.utils.LoadingDialogHub +import com.pengxh.kt.lite.utils.LoadingDialog import com.pengxh.kt.lite.widget.TitleBarView import com.pengxh.kt.lite.widget.dialog.AlertMessageDialog @@ -44,7 +44,7 @@ } override fun initOnCreate(savedInstanceState: Bundle?) { - val wellId = intent.getStringExtra(Constant.INTENT_PARAM)!! + val wellId = intent.getStringExtra(Constant.INTENT_PARAM_KEY)!! wellViewModel = ViewModelProvider(this)[WellViewModel::class.java] wellViewModel.getWellDetail(wellId) wellViewModel.wellDetailModel.observe(this) { @@ -132,8 +132,8 @@ override fun observeRequestState() { wellViewModel.loadState.observe(this) { when (it) { - is LoadState.Loading -> LoadingDialogHub.show(this, "数据加载中,请稍后") - else -> LoadingDialogHub.dismiss() + is LoadState.Loading -> LoadingDialog.show(this, "数据加载中,请稍后") + else -> LoadingDialog.dismiss() } } } diff --git a/app/src/main/java/com/casic/app/smartwell/view/WellManagementActivity.kt b/app/src/main/java/com/casic/app/smartwell/view/WellManagementActivity.kt index 084da95..457096b 100644 --- a/app/src/main/java/com/casic/app/smartwell/view/WellManagementActivity.kt +++ b/app/src/main/java/com/casic/app/smartwell/view/WellManagementActivity.kt @@ -94,8 +94,8 @@ } } - binding.wellListView.addItemDecoration( - RecyclerViewItemOffsets(0, 5, 0, 5) + binding.recyclerView.addItemDecoration( + RecyclerViewItemOffsets(0, 7, 0, 7) ) } @@ -175,13 +175,12 @@ } else { item.deep.toString() + "m" } - viewHolder.setText(R.id.wellNameView, item.wellName) + viewHolder.setText(R.id.wellTypeView, item.wellTypeName) .setText(R.id.wellStateView, "已${item.bfztName}") .setText(R.id.wellDepthView, "深:${deep}") .setText(R.id.wellCodeView, "点位编号:${item.wellCode}") - .setText(R.id.wellTypeView, "点位类型:${item.wellTypeName}") .setText(R.id.ownerShipView, "权属单位:${item.deptName}") - .setText(R.id.wellLocationView, "点位置:${item.position}") + .setText(R.id.wellLocationView, "点位位置:${item.position}") .setOnClickListener( R.id.navigationButton, object : View.OnClickListener { override fun onClick(v: View?) { @@ -200,7 +199,7 @@ ) } } - binding.wellListView.adapter = wellListAdapter + binding.recyclerView.adapter = wellListAdapter wellListAdapter.setOnItemClickedListener(object : NormalRecyclerAdapter.OnItemClickedListener { override fun onItemClicked(position: Int, t: WellListModel.DataBean.RowsBean) { diff --git a/app/src/main/java/com/casic/app/smartwell/view/WellMonitorActivity.kt b/app/src/main/java/com/casic/app/smartwell/view/WellMonitorActivity.kt index e3573eb..b87bdb7 100644 --- a/app/src/main/java/com/casic/app/smartwell/view/WellMonitorActivity.kt +++ b/app/src/main/java/com/casic/app/smartwell/view/WellMonitorActivity.kt @@ -11,7 +11,7 @@ import com.pengxh.kt.lite.base.KotlinBaseActivity import com.pengxh.kt.lite.utils.Constant import com.pengxh.kt.lite.utils.LoadState -import com.pengxh.kt.lite.utils.LoadingDialogHub +import com.pengxh.kt.lite.utils.LoadingDialog import com.pengxh.kt.lite.widget.TitleBarView class WellMonitorActivity : KotlinBaseActivity() { @@ -36,7 +36,7 @@ } override fun initOnCreate(savedInstanceState: Bundle?) { - val wellId = intent.getStringExtra(Constant.INTENT_PARAM)!! + val wellId = intent.getStringExtra(Constant.INTENT_PARAM_KEY)!! wellViewModel = ViewModelProvider(this)[WellViewModel::class.java] wellViewModel.getMonitorResult(wellId) wellViewModel.monitorModel.observe(this) { @@ -56,8 +56,8 @@ override fun observeRequestState() { wellViewModel.loadState.observe(this) { when (it) { - is LoadState.Loading -> LoadingDialogHub.show(this, "数据加载中,请稍后") - else -> LoadingDialogHub.dismiss() + is LoadState.Loading -> LoadingDialog.show(this, "数据加载中,请稍后") + else -> LoadingDialog.dismiss() } } } diff --git a/app/src/main/java/com/casic/app/smartwell/view/WellOperationActivity.kt b/app/src/main/java/com/casic/app/smartwell/view/WellOperationActivity.kt index 8d333bf..347ebb6 100644 --- a/app/src/main/java/com/casic/app/smartwell/view/WellOperationActivity.kt +++ b/app/src/main/java/com/casic/app/smartwell/view/WellOperationActivity.kt @@ -23,7 +23,7 @@ import com.pengxh.kt.lite.extensions.navigatePageTo import com.pengxh.kt.lite.extensions.show import com.pengxh.kt.lite.utils.LoadState -import com.pengxh.kt.lite.utils.LoadingDialogHub +import com.pengxh.kt.lite.utils.LoadingDialog import com.pengxh.kt.lite.utils.WeakReferenceHandler import com.pengxh.kt.lite.widget.dialog.AlertControlDialog @@ -109,8 +109,8 @@ } } - binding.operationListView.addItemDecoration( - RecyclerViewItemOffsets(0, 5, 0, 5) + binding.recyclerView.addItemDecoration( + RecyclerViewItemOffsets(0, 7, 0, 7) ) } @@ -123,13 +123,13 @@ override fun observeRequestState() { wellViewModel.loadState.observe(this) { when (it) { - is LoadState.Loading -> LoadingDialogHub.show(this, "处理中,请稍后") + is LoadState.Loading -> LoadingDialog.show(this, "处理中,请稍后") is LoadState.Success -> { - LoadingDialogHub.dismiss() + LoadingDialog.dismiss() wellOperationAdapter.notifyItemChanged(clickedPosition) } - else -> LoadingDialogHub.dismiss() + else -> LoadingDialog.dismiss() } } } @@ -203,24 +203,23 @@ if (item.bfztName == "布防") { viewHolder.setImageResource( R.id.wellStateView, R.drawable.bg_solid_text_green_radius_5 - ).setText(R.id.wellStateView, "撤防") + ).setText(R.id.operationButton, "撤防") } else { viewHolder.setImageResource( R.id.wellStateView, R.drawable.bg_solid_text_red_radius_5 - ).setText(R.id.wellStateView, "布防") + ).setText(R.id.operationButton, "布防") } val deep = if (item.deep.toString().isBlank()) { "未知" } else { item.deep.toString() + "m" } - viewHolder.setText(R.id.wellNameView, item.wellName) + viewHolder.setText(R.id.wellTypeView, item.wellTypeName) .setText(R.id.wellStateView, "已${item.bfztName}") .setText(R.id.wellDepthView, "深:${deep}") .setText(R.id.wellCodeView, "点位编号:${item.wellCode}") - .setText(R.id.wellTypeView, "点位类型:${item.wellTypeName}") .setText(R.id.ownerShipView, "权属单位:${item.deptName}") - .setText(R.id.wellLocationView, "点位置:${item.position}") + .setText(R.id.wellLocationView, "点位位置:${item.position}") .setOnClickListener( R.id.operationButton, object : View.OnClickListener { override fun onClick(v: View?) { @@ -280,7 +279,7 @@ ) } } - binding.operationListView.adapter = wellOperationAdapter + binding.recyclerView.adapter = wellOperationAdapter wellOperationAdapter.setOnItemClickedListener(object : NormalRecyclerAdapter.OnItemClickedListener { override fun onItemClicked(position: Int, t: WellListModel.DataBean.RowsBean) { diff --git a/app/src/main/res/drawable/ic_down.xml b/app/src/main/res/drawable/ic_down.xml index 20e6476..6987e6c 100644 --- a/app/src/main/res/drawable/ic_down.xml +++ b/app/src/main/res/drawable/ic_down.xml @@ -1,6 +1,6 @@ + + diff --git a/app/src/main/res/layout/activity_about_us.xml b/app/src/main/res/layout/activity_about_us.xml index 9091a00..d5fbd0d 100644 --- a/app/src/main/res/layout/activity_about_us.xml +++ b/app/src/main/res/layout/activity_about_us.xml @@ -12,13 +12,7 @@ android:layout_width="match_parent" android:layout_height="wrap_content" android:background="@color/mainThemeColor" - app:tbv_left_image="@drawable/ic_title_left" - app:tbv_only_show_title="false" - app:tbv_show_left_image="true" - app:tbv_show_right_image="false" - app:tbv_text="关于我们" - app:tbv_text_color="@color/white" - app:tbv_text_size="@dimen/sp_18" /> + app:tbv_text="关于我们" /> + app:tbv_text="修改密码" /> + app:tbv_text="布防列表" /> + app:tbv_text="帮助中心" /> + app:tbv_text="工单详情" /> + app:tbv_text="工单详情" /> + app:tbv_text="工单详情" /> + app:tbv_text="工单详情" /> + app:tbv_text="超时工单" /> - + + android:value="ee96d8b5e12de3fbb29949efd57418a8" /> () @@ -150,7 +158,7 @@ val cameraPosition = CameraPosition(centerLatLng, 14f, 0f, 0f) val cameraUpdate = CameraUpdateFactory.newCameraPosition(cameraPosition) withContext(Dispatchers.Main) { - LoadingDialogHub.dismiss() + LoadingDialog.dismiss() aMap.animateCamera(cameraUpdate, 1500, null) } } @@ -239,11 +247,6 @@ } override fun initEvent() { - binding.rightOptionView.setOnClickListener { - val x = binding.rightOptionView.width - easyPopupWindow.width - easyPopupWindow.showAsDropDown(binding.rightOptionView, x, 0) - } - //撤防点位 binding.unDeployedLayout.setOnClickListener { requireContext().navigatePageTo() @@ -263,11 +266,11 @@ override fun observeRequestState() { wellViewModel.loadState.observe(this) { when (it) { - is LoadState.Loading -> LoadingDialogHub.show( + is LoadState.Loading -> LoadingDialog.show( requireActivity(), "数据加载中,请稍后..." ) - else -> LoadingDialogHub.dismiss() + else -> LoadingDialog.dismiss() } } } @@ -376,7 +379,7 @@ }).build().show() } }) - infoPopup.showAsDropDown(binding.rightOptionView) +// infoPopup.showAsDropDown(binding.rightOptionView) } override fun onCameraChange(p0: CameraPosition?) { diff --git a/app/src/main/java/com/casic/app/smartwell/fragment/HomePageNoClusterFragment.kt b/app/src/main/java/com/casic/app/smartwell/fragment/HomePageNoClusterFragment.kt index 802426a..b25f743 100644 --- a/app/src/main/java/com/casic/app/smartwell/fragment/HomePageNoClusterFragment.kt +++ b/app/src/main/java/com/casic/app/smartwell/fragment/HomePageNoClusterFragment.kt @@ -38,8 +38,9 @@ import com.pengxh.kt.lite.extensions.navigatePageTo import com.pengxh.kt.lite.extensions.show import com.pengxh.kt.lite.utils.LoadState -import com.pengxh.kt.lite.utils.LoadingDialogHub +import com.pengxh.kt.lite.utils.LoadingDialog import com.pengxh.kt.lite.widget.EasyPopupWindow +import com.pengxh.kt.lite.widget.TitleBarView import com.pengxh.kt.lite.widget.dialog.AlertControlDialog import kotlinx.coroutines.Dispatchers import kotlinx.coroutines.launch @@ -78,7 +79,15 @@ override fun setupTopBarLayout() { binding.rootView.initImmersionBar(this, false, R.color.mainThemeColor) - binding.titleView.text = "首页" + binding.titleView.setOnClickListener(object : TitleBarView.OnClickListener { + override fun onLeftClick() { + + } + + override fun onRightClick() { + easyPopupWindow.showAsDropDown(binding.titleView, binding.titleView.width, 0) + } + }) } override fun initOnCreate(savedInstanceState: Bundle?) { @@ -112,7 +121,7 @@ //渲染井位置 lifecycleScope.launch(Dispatchers.Main) { - LoadingDialogHub.show(requireActivity(), "数据加载中,请稍后") + LoadingDialog.show(requireActivity(), "数据加载中,请稍后") withContext(Dispatchers.IO) { //取Well缓存 val allMarkerOptions = ArrayList() @@ -144,7 +153,7 @@ val cameraPosition = CameraPosition(centerLatLng, 14f, 0f, 0f) val cameraUpdate = CameraUpdateFactory.newCameraPosition(cameraPosition) withContext(Dispatchers.Main) { - LoadingDialogHub.dismiss() + LoadingDialog.dismiss() aMap.animateCamera(cameraUpdate, 1500, null) } } @@ -238,11 +247,6 @@ } override fun initEvent() { - binding.rightOptionView.setOnClickListener { - val x = binding.rightOptionView.width - easyPopupWindow.width - easyPopupWindow.showAsDropDown(binding.rightOptionView, x, 0) - } - //撤防点位 binding.unDeployedLayout.setOnClickListener { requireContext().navigatePageTo() @@ -262,11 +266,11 @@ override fun observeRequestState() { wellViewModel.loadState.observe(this) { when (it) { - is LoadState.Loading -> LoadingDialogHub.show( + is LoadState.Loading -> LoadingDialog.show( requireActivity(), "数据加载中,请稍后..." ) - else -> LoadingDialogHub.dismiss() + else -> LoadingDialog.dismiss() } } } diff --git a/app/src/main/java/com/casic/app/smartwell/fragment/MinePageFragment.kt b/app/src/main/java/com/casic/app/smartwell/fragment/MinePageFragment.kt index 09a570c..dcb48f8 100644 --- a/app/src/main/java/com/casic/app/smartwell/fragment/MinePageFragment.kt +++ b/app/src/main/java/com/casic/app/smartwell/fragment/MinePageFragment.kt @@ -35,7 +35,7 @@ import com.pengxh.kt.lite.utils.ActivityStackManager import com.pengxh.kt.lite.utils.FileDownloadManager import com.pengxh.kt.lite.utils.LoadState -import com.pengxh.kt.lite.utils.LoadingDialogHub +import com.pengxh.kt.lite.utils.LoadingDialog import com.pengxh.kt.lite.widget.dialog.AlertControlDialog import com.pengxh.kt.lite.widget.dialog.BottomActionSheet import kotlinx.coroutines.Dispatchers @@ -60,7 +60,6 @@ override fun setupTopBarLayout() { binding.rootView.initImmersionBar(this, false, R.color.mainThemeColor) - binding.titleInclude.titleView.text = "我的" } override fun initOnCreate(savedInstanceState: Bundle?) { @@ -155,27 +154,27 @@ override fun observeRequestState() { userViewModel.loadState.observe(this) { when (it) { - is LoadState.Loading -> LoadingDialogHub.show( + is LoadState.Loading -> LoadingDialog.show( requireActivity(), "检查版本中,请稍后" ) - else -> LoadingDialogHub.dismiss() + else -> LoadingDialog.dismiss() } } wellViewModel.loadState.observe(this) { when (it) { - is LoadState.Loading -> LoadingDialogHub.show( + is LoadState.Loading -> LoadingDialog.show( requireActivity(), "数据更新中,请稍后" ) is LoadState.Fail -> { - LoadingDialogHub.dismiss() + LoadingDialog.dismiss() "数据更新超时".show(requireContext()) } else -> { - LoadingDialogHub.dismiss() + LoadingDialog.dismiss() AlertControlDialog.Builder().setContext(requireContext()).setTitle("温馨提示") .setMessage("数据更新成功,请重启应用").setNegativeButton("取消") .setPositiveButton("确定").setOnDialogButtonClickListener(object : @@ -197,17 +196,17 @@ lineViewModel.loadState.observe(this) { when (it) { - is LoadState.Loading -> LoadingDialogHub.show( + is LoadState.Loading -> LoadingDialog.show( requireActivity(), "数据更新中,请稍后" ) is LoadState.Fail -> { - LoadingDialogHub.dismiss() + LoadingDialog.dismiss() "数据更新超时".show(requireContext()) } else -> { - LoadingDialogHub.dismiss() + LoadingDialog.dismiss() AlertControlDialog.Builder().setContext(requireContext()).setTitle("温馨提示") .setMessage("数据更新成功,请重启应用").setNegativeButton("取消") .setPositiveButton("确定").setOnDialogButtonClickListener(object : diff --git a/app/src/main/java/com/casic/app/smartwell/fragment/NoticePageFragment.kt b/app/src/main/java/com/casic/app/smartwell/fragment/NoticePageFragment.kt index 171b555..3c93f54 100644 --- a/app/src/main/java/com/casic/app/smartwell/fragment/NoticePageFragment.kt +++ b/app/src/main/java/com/casic/app/smartwell/fragment/NoticePageFragment.kt @@ -48,7 +48,6 @@ override fun setupTopBarLayout() { binding.rootView.initImmersionBar(this, false, R.color.mainThemeColor) - binding.titleInclude.titleView.text = "消息" } override fun initOnCreate(savedInstanceState: Bundle?) { diff --git a/app/src/main/java/com/casic/app/smartwell/fragment/OrderListFragment.kt b/app/src/main/java/com/casic/app/smartwell/fragment/OrderListFragment.kt index 93ff35b..5e38acb 100644 --- a/app/src/main/java/com/casic/app/smartwell/fragment/OrderListFragment.kt +++ b/app/src/main/java/com/casic/app/smartwell/fragment/OrderListFragment.kt @@ -12,6 +12,7 @@ import com.casic.app.smartwell.view.SearchOrderActivity import com.pengxh.kt.lite.base.KotlinBaseFragment import com.pengxh.kt.lite.extensions.navigatePageTo +import com.pengxh.kt.lite.widget.TitleBarView class OrderListFragment : KotlinBaseFragment() { @@ -25,15 +26,22 @@ } override fun initViewBinding( - inflater: LayoutInflater, - container: ViewGroup? + inflater: LayoutInflater, container: ViewGroup? ): FragmentOrderBinding { return FragmentOrderBinding.inflate(inflater, container, false) } override fun setupTopBarLayout() { binding.rootView.initImmersionBar(this, false, R.color.mainThemeColor) - binding.titleView.text = "工单" + binding.titleView.setOnClickListener(object : TitleBarView.OnClickListener { + override fun onLeftClick() { + + } + + override fun onRightClick() { + requireContext().navigatePageTo() + } + }) } override fun initOnCreate(savedInstanceState: Bundle?) { @@ -51,8 +59,6 @@ } override fun initEvent() { - binding.rightOptionView.setOnClickListener { - requireContext().navigatePageTo() - } + } } \ No newline at end of file diff --git a/app/src/main/java/com/casic/app/smartwell/fragment/OrderNotProcessedFragment.kt b/app/src/main/java/com/casic/app/smartwell/fragment/OrderNotProcessedFragment.kt index 0b3d09d..2b6f21d 100644 --- a/app/src/main/java/com/casic/app/smartwell/fragment/OrderNotProcessedFragment.kt +++ b/app/src/main/java/com/casic/app/smartwell/fragment/OrderNotProcessedFragment.kt @@ -18,7 +18,7 @@ import com.pengxh.kt.lite.extensions.navigatePageTo import com.pengxh.kt.lite.extensions.show import com.pengxh.kt.lite.utils.LoadState -import com.pengxh.kt.lite.utils.LoadingDialogHub +import com.pengxh.kt.lite.utils.LoadingDialog import com.pengxh.kt.lite.utils.WeakReferenceHandler import com.pengxh.kt.lite.widget.dialog.AlertControlDialog @@ -78,8 +78,8 @@ operationViewModel = ViewModelProvider(this)[OperationViewModel::class.java] - binding.notProcessedView.addItemDecoration( - RecyclerViewItemOffsets(0, 5, 0, 5) + binding.recyclerView.addItemDecoration( + RecyclerViewItemOffsets(0, 7, 0, 7) ) } @@ -87,9 +87,9 @@ //接单状态处理 operationViewModel.loadState.observe(this) { when (it) { - is LoadState.Loading -> LoadingDialogHub.show(requireActivity(), "接单中,请稍后") + is LoadState.Loading -> LoadingDialog.show(requireActivity(), "接单中,请稍后") is LoadState.Success -> { - LoadingDialogHub.dismiss() + LoadingDialog.dismiss() //接单成功之后刷新列表 dataBeans.removeAt(clickedPosition) notProcessedAdapter.notifyItemRemoved(clickedPosition) @@ -98,7 +98,7 @@ ) } - else -> LoadingDialogHub.dismiss() + else -> LoadingDialog.dismiss() } } } @@ -131,7 +131,7 @@ } else { binding.emptyInclude.emptyView.hide() notProcessedAdapter = OrderNotProcessedAdapter(requireContext(), dataBeans) - binding.notProcessedView.adapter = notProcessedAdapter + binding.recyclerView.adapter = notProcessedAdapter notProcessedAdapter.setOnItemClickListener(object : OrderNotProcessedAdapter.OnItemClickListener { override fun onClicked(position: Int) { diff --git a/app/src/main/java/com/casic/app/smartwell/fragment/OvertimeNotAcceptFragment.kt b/app/src/main/java/com/casic/app/smartwell/fragment/OvertimeNotAcceptFragment.kt index a198545..9b318ca 100644 --- a/app/src/main/java/com/casic/app/smartwell/fragment/OvertimeNotAcceptFragment.kt +++ b/app/src/main/java/com/casic/app/smartwell/fragment/OvertimeNotAcceptFragment.kt @@ -18,7 +18,7 @@ import com.pengxh.kt.lite.extensions.navigatePageTo import com.pengxh.kt.lite.extensions.show import com.pengxh.kt.lite.utils.LoadState -import com.pengxh.kt.lite.utils.LoadingDialogHub +import com.pengxh.kt.lite.utils.LoadingDialog import com.pengxh.kt.lite.utils.WeakReferenceHandler import com.pengxh.kt.lite.widget.dialog.AlertControlDialog @@ -81,8 +81,8 @@ operationViewModel = ViewModelProvider(this)[OperationViewModel::class.java] - binding.notProcessedView.addItemDecoration( - RecyclerViewItemOffsets(0, 5, 0, 5) + binding.recyclerView.addItemDecoration( + RecyclerViewItemOffsets(0, 7, 0, 7) ) } @@ -90,9 +90,9 @@ //接单状态处理 operationViewModel.loadState.observe(this) { when (it) { - is LoadState.Loading -> LoadingDialogHub.show(requireActivity(), "接单中,请稍后") + is LoadState.Loading -> LoadingDialog.show(requireActivity(), "接单中,请稍后") is LoadState.Success -> { - LoadingDialogHub.dismiss() + LoadingDialog.dismiss() //接单成功之后刷新列表 dataBeans.removeAt(clickedPosition) notProcessedAdapter.notifyItemRemoved(clickedPosition) @@ -101,7 +101,7 @@ ) } - else -> LoadingDialogHub.dismiss() + else -> LoadingDialog.dismiss() } } } @@ -134,7 +134,7 @@ } else { binding.emptyInclude.emptyView.hide() notProcessedAdapter = OrderNotProcessedAdapter(requireContext(), dataBeans) - binding.notProcessedView.adapter = notProcessedAdapter + binding.recyclerView.adapter = notProcessedAdapter notProcessedAdapter.setOnItemClickListener(object : OrderNotProcessedAdapter.OnItemClickListener { override fun onClicked(position: Int) { diff --git a/app/src/main/java/com/casic/app/smartwell/greendao/DaoMaster.java b/app/src/main/java/com/casic/app/smartwell/greendao/DaoMaster.java index fdcf3a7..1e52b74 100644 --- a/app/src/main/java/com/casic/app/smartwell/greendao/DaoMaster.java +++ b/app/src/main/java/com/casic/app/smartwell/greendao/DaoMaster.java @@ -13,25 +13,20 @@ // THIS CODE IS GENERATED BY greenDAO, DO NOT EDIT. - /** * Master of DAO (schema version 4): knows all DAOs. */ public class DaoMaster extends AbstractDaoMaster { public static final int SCHEMA_VERSION = 4; - /** - * Creates underlying database table using DAOs. - */ + /** Creates underlying database table using DAOs. */ public static void createAllTables(Database db, boolean ifNotExists) { MapWellLocalBeanDao.createTable(db, ifNotExists); NoticeLocaleBeanDao.createTable(db, ifNotExists); PipeLocalBeanDao.createTable(db, ifNotExists); } - /** - * Drops underlying database table using DAOs. - */ + /** Drops underlying database table using DAOs. */ public static void dropAllTables(Database db, boolean ifExists) { MapWellLocalBeanDao.dropTable(db, ifExists); NoticeLocaleBeanDao.dropTable(db, ifExists); @@ -86,9 +81,7 @@ } } - /** - * WARNING: Drops all table on Upgrade! Use only during development. - */ + /** WARNING: Drops all table on Upgrade! Use only during development. */ public static class DevOpenHelper extends OpenHelper { public DevOpenHelper(Context context, String name) { super(context, name); diff --git a/app/src/main/java/com/casic/app/smartwell/greendao/DaoSession.java b/app/src/main/java/com/casic/app/smartwell/greendao/DaoSession.java index 0b36d17..3e40e3b 100644 --- a/app/src/main/java/com/casic/app/smartwell/greendao/DaoSession.java +++ b/app/src/main/java/com/casic/app/smartwell/greendao/DaoSession.java @@ -16,7 +16,7 @@ /** * {@inheritDoc} - * + * * @see org.greenrobot.greendao.AbstractDaoSession */ public class DaoSession extends AbstractDaoSession { @@ -50,7 +50,7 @@ registerDao(NoticeLocaleBean.class, noticeLocaleBeanDao); registerDao(PipeLocalBean.class, pipeLocalBeanDao); } - + public void clear() { mapWellLocalBeanDaoConfig.clearIdentityScope(); noticeLocaleBeanDaoConfig.clearIdentityScope(); diff --git a/app/src/main/java/com/casic/app/smartwell/greendao/MapWellLocalBeanDao.java b/app/src/main/java/com/casic/app/smartwell/greendao/MapWellLocalBeanDao.java index 8908fda..407bc92 100644 --- a/app/src/main/java/com/casic/app/smartwell/greendao/MapWellLocalBeanDao.java +++ b/app/src/main/java/com/casic/app/smartwell/greendao/MapWellLocalBeanDao.java @@ -12,10 +12,9 @@ import org.greenrobot.greendao.internal.DaoConfig; // THIS CODE IS GENERATED BY greenDAO, DO NOT EDIT. - -/** +/** * DAO for table "MAP_WELL_LOCAL_BEAN". - */ +*/ public class MapWellLocalBeanDao extends AbstractDao { public static final String TABLENAME = "MAP_WELL_LOCAL_BEAN"; @@ -57,16 +56,14 @@ public MapWellLocalBeanDao(DaoConfig config) { super(config); } - + public MapWellLocalBeanDao(DaoConfig config, DaoSession daoSession) { super(config, daoSession); } - /** - * Creates the underlying database table. - */ + /** Creates the underlying database table. */ public static void createTable(Database db, boolean ifNotExists) { - String constraint = ifNotExists ? "IF NOT EXISTS " : ""; + String constraint = ifNotExists? "IF NOT EXISTS ": ""; db.execSQL("CREATE TABLE " + constraint + "\"MAP_WELL_LOCAL_BEAN\" (" + // "\"_id\" INTEGER PRIMARY KEY AUTOINCREMENT ," + // 0: kId "\"AREA\" TEXT," + // 1: area @@ -96,9 +93,7 @@ "\"WELL_TYPE_NAME\" TEXT);"); // 25: wellTypeName } - /** - * Drops the underlying database table. - */ + /** Drops the underlying database table. */ public static void dropTable(Database db, boolean ifExists) { String sql = "DROP TABLE " + (ifExists ? "IF EXISTS " : "") + "\"MAP_WELL_LOCAL_BEAN\""; db.execSQL(sql); @@ -107,132 +102,132 @@ @Override protected final void bindValues(DatabaseStatement stmt, MapWellLocalBean entity) { stmt.clearBindings(); - + Long kId = entity.getKId(); if (kId != null) { stmt.bindLong(1, kId); } - + String area = entity.getArea(); if (area != null) { stmt.bindString(2, area); } - + String bfzt = entity.getBfzt(); if (bfzt != null) { stmt.bindString(3, bfzt); } - + String bfztName = entity.getBfztName(); if (bfztName != null) { stmt.bindString(4, bfztName); } - + String coordinateX = entity.getCoordinateX(); if (coordinateX != null) { stmt.bindString(5, coordinateX); } - + String coordinateY = entity.getCoordinateY(); if (coordinateY != null) { stmt.bindString(6, coordinateY); } - + String deep = entity.getDeep(); if (deep != null) { stmt.bindString(7, deep); } - + String deptName = entity.getDeptName(); if (deptName != null) { stmt.bindString(8, deptName); } - + String deptid = entity.getDeptid(); if (deptid != null) { stmt.bindString(9, deptid); } - + String id = entity.getId(); if (id != null) { stmt.bindString(10, id); } - + String latBaidu = entity.getLatBaidu(); if (latBaidu != null) { stmt.bindString(11, latBaidu); } - + String latGaode = entity.getLatGaode(); if (latGaode != null) { stmt.bindString(12, latGaode); } - + String lngBaidu = entity.getLngBaidu(); if (lngBaidu != null) { stmt.bindString(13, lngBaidu); } - + String lngGaode = entity.getLngGaode(); if (lngGaode != null) { stmt.bindString(14, lngGaode); } - + String notes = entity.getNotes(); if (notes != null) { stmt.bindString(15, notes); } - + String photos = entity.getPhotos(); if (photos != null) { stmt.bindString(16, photos); } - + String position = entity.getPosition(); if (position != null) { stmt.bindString(17, position); } - + String staff = entity.getStaff(); if (staff != null) { stmt.bindString(18, staff); } - + String tel = entity.getTel(); if (tel != null) { stmt.bindString(19, tel); } - + String ts = entity.getTs(); if (ts != null) { stmt.bindString(20, ts); } - + String valid = entity.getValid(); if (valid != null) { stmt.bindString(21, valid); } - + String watchData = entity.getWatchData(); if (watchData != null) { stmt.bindString(22, watchData); } - + String wellCode = entity.getWellCode(); if (wellCode != null) { stmt.bindString(23, wellCode); } - + String wellName = entity.getWellName(); if (wellName != null) { stmt.bindString(24, wellName); } - + String wellType = entity.getWellType(); if (wellType != null) { stmt.bindString(25, wellType); } - + String wellTypeName = entity.getWellTypeName(); if (wellTypeName != null) { stmt.bindString(26, wellTypeName); @@ -242,132 +237,132 @@ @Override protected final void bindValues(SQLiteStatement stmt, MapWellLocalBean entity) { stmt.clearBindings(); - + Long kId = entity.getKId(); if (kId != null) { stmt.bindLong(1, kId); } - + String area = entity.getArea(); if (area != null) { stmt.bindString(2, area); } - + String bfzt = entity.getBfzt(); if (bfzt != null) { stmt.bindString(3, bfzt); } - + String bfztName = entity.getBfztName(); if (bfztName != null) { stmt.bindString(4, bfztName); } - + String coordinateX = entity.getCoordinateX(); if (coordinateX != null) { stmt.bindString(5, coordinateX); } - + String coordinateY = entity.getCoordinateY(); if (coordinateY != null) { stmt.bindString(6, coordinateY); } - + String deep = entity.getDeep(); if (deep != null) { stmt.bindString(7, deep); } - + String deptName = entity.getDeptName(); if (deptName != null) { stmt.bindString(8, deptName); } - + String deptid = entity.getDeptid(); if (deptid != null) { stmt.bindString(9, deptid); } - + String id = entity.getId(); if (id != null) { stmt.bindString(10, id); } - + String latBaidu = entity.getLatBaidu(); if (latBaidu != null) { stmt.bindString(11, latBaidu); } - + String latGaode = entity.getLatGaode(); if (latGaode != null) { stmt.bindString(12, latGaode); } - + String lngBaidu = entity.getLngBaidu(); if (lngBaidu != null) { stmt.bindString(13, lngBaidu); } - + String lngGaode = entity.getLngGaode(); if (lngGaode != null) { stmt.bindString(14, lngGaode); } - + String notes = entity.getNotes(); if (notes != null) { stmt.bindString(15, notes); } - + String photos = entity.getPhotos(); if (photos != null) { stmt.bindString(16, photos); } - + String position = entity.getPosition(); if (position != null) { stmt.bindString(17, position); } - + String staff = entity.getStaff(); if (staff != null) { stmt.bindString(18, staff); } - + String tel = entity.getTel(); if (tel != null) { stmt.bindString(19, tel); } - + String ts = entity.getTs(); if (ts != null) { stmt.bindString(20, ts); } - + String valid = entity.getValid(); if (valid != null) { stmt.bindString(21, valid); } - + String watchData = entity.getWatchData(); if (watchData != null) { stmt.bindString(22, watchData); } - + String wellCode = entity.getWellCode(); if (wellCode != null) { stmt.bindString(23, wellCode); } - + String wellName = entity.getWellName(); if (wellName != null) { stmt.bindString(24, wellName); } - + String wellType = entity.getWellType(); if (wellType != null) { stmt.bindString(25, wellType); } - + String wellTypeName = entity.getWellTypeName(); if (wellTypeName != null) { stmt.bindString(26, wellTypeName); @@ -377,41 +372,41 @@ @Override public Long readKey(Cursor cursor, int offset) { return cursor.isNull(offset + 0) ? null : cursor.getLong(offset + 0); - } + } @Override public MapWellLocalBean readEntity(Cursor cursor, int offset) { MapWellLocalBean entity = new MapWellLocalBean( // - cursor.isNull(offset + 0) ? null : cursor.getLong(offset + 0), // kId - cursor.isNull(offset + 1) ? null : cursor.getString(offset + 1), // area - cursor.isNull(offset + 2) ? null : cursor.getString(offset + 2), // bfzt - cursor.isNull(offset + 3) ? null : cursor.getString(offset + 3), // bfztName - cursor.isNull(offset + 4) ? null : cursor.getString(offset + 4), // coordinateX - cursor.isNull(offset + 5) ? null : cursor.getString(offset + 5), // coordinateY - cursor.isNull(offset + 6) ? null : cursor.getString(offset + 6), // deep - cursor.isNull(offset + 7) ? null : cursor.getString(offset + 7), // deptName - cursor.isNull(offset + 8) ? null : cursor.getString(offset + 8), // deptid - cursor.isNull(offset + 9) ? null : cursor.getString(offset + 9), // id - cursor.isNull(offset + 10) ? null : cursor.getString(offset + 10), // latBaidu - cursor.isNull(offset + 11) ? null : cursor.getString(offset + 11), // latGaode - cursor.isNull(offset + 12) ? null : cursor.getString(offset + 12), // lngBaidu - cursor.isNull(offset + 13) ? null : cursor.getString(offset + 13), // lngGaode - cursor.isNull(offset + 14) ? null : cursor.getString(offset + 14), // notes - cursor.isNull(offset + 15) ? null : cursor.getString(offset + 15), // photos - cursor.isNull(offset + 16) ? null : cursor.getString(offset + 16), // position - cursor.isNull(offset + 17) ? null : cursor.getString(offset + 17), // staff - cursor.isNull(offset + 18) ? null : cursor.getString(offset + 18), // tel - cursor.isNull(offset + 19) ? null : cursor.getString(offset + 19), // ts - cursor.isNull(offset + 20) ? null : cursor.getString(offset + 20), // valid - cursor.isNull(offset + 21) ? null : cursor.getString(offset + 21), // watchData - cursor.isNull(offset + 22) ? null : cursor.getString(offset + 22), // wellCode - cursor.isNull(offset + 23) ? null : cursor.getString(offset + 23), // wellName - cursor.isNull(offset + 24) ? null : cursor.getString(offset + 24), // wellType - cursor.isNull(offset + 25) ? null : cursor.getString(offset + 25) // wellTypeName + cursor.isNull(offset + 0) ? null : cursor.getLong(offset + 0), // kId + cursor.isNull(offset + 1) ? null : cursor.getString(offset + 1), // area + cursor.isNull(offset + 2) ? null : cursor.getString(offset + 2), // bfzt + cursor.isNull(offset + 3) ? null : cursor.getString(offset + 3), // bfztName + cursor.isNull(offset + 4) ? null : cursor.getString(offset + 4), // coordinateX + cursor.isNull(offset + 5) ? null : cursor.getString(offset + 5), // coordinateY + cursor.isNull(offset + 6) ? null : cursor.getString(offset + 6), // deep + cursor.isNull(offset + 7) ? null : cursor.getString(offset + 7), // deptName + cursor.isNull(offset + 8) ? null : cursor.getString(offset + 8), // deptid + cursor.isNull(offset + 9) ? null : cursor.getString(offset + 9), // id + cursor.isNull(offset + 10) ? null : cursor.getString(offset + 10), // latBaidu + cursor.isNull(offset + 11) ? null : cursor.getString(offset + 11), // latGaode + cursor.isNull(offset + 12) ? null : cursor.getString(offset + 12), // lngBaidu + cursor.isNull(offset + 13) ? null : cursor.getString(offset + 13), // lngGaode + cursor.isNull(offset + 14) ? null : cursor.getString(offset + 14), // notes + cursor.isNull(offset + 15) ? null : cursor.getString(offset + 15), // photos + cursor.isNull(offset + 16) ? null : cursor.getString(offset + 16), // position + cursor.isNull(offset + 17) ? null : cursor.getString(offset + 17), // staff + cursor.isNull(offset + 18) ? null : cursor.getString(offset + 18), // tel + cursor.isNull(offset + 19) ? null : cursor.getString(offset + 19), // ts + cursor.isNull(offset + 20) ? null : cursor.getString(offset + 20), // valid + cursor.isNull(offset + 21) ? null : cursor.getString(offset + 21), // watchData + cursor.isNull(offset + 22) ? null : cursor.getString(offset + 22), // wellCode + cursor.isNull(offset + 23) ? null : cursor.getString(offset + 23), // wellName + cursor.isNull(offset + 24) ? null : cursor.getString(offset + 24), // wellType + cursor.isNull(offset + 25) ? null : cursor.getString(offset + 25) // wellTypeName ); return entity; } - + @Override public void readEntity(Cursor cursor, MapWellLocalBean entity, int offset) { entity.setKId(cursor.isNull(offset + 0) ? null : cursor.getLong(offset + 0)); @@ -440,17 +435,17 @@ entity.setWellName(cursor.isNull(offset + 23) ? null : cursor.getString(offset + 23)); entity.setWellType(cursor.isNull(offset + 24) ? null : cursor.getString(offset + 24)); entity.setWellTypeName(cursor.isNull(offset + 25) ? null : cursor.getString(offset + 25)); - } - + } + @Override protected final Long updateKeyAfterInsert(MapWellLocalBean entity, long rowId) { entity.setKId(rowId); return rowId; } - + @Override public Long getKey(MapWellLocalBean entity) { - if (entity != null) { + if(entity != null) { return entity.getKId(); } else { return null; @@ -466,5 +461,5 @@ protected final boolean isEntityUpdateable() { return true; } - + } diff --git a/app/src/main/java/com/casic/app/smartwell/greendao/NoticeLocaleBeanDao.java b/app/src/main/java/com/casic/app/smartwell/greendao/NoticeLocaleBeanDao.java index 64312ed..deb2d49 100644 --- a/app/src/main/java/com/casic/app/smartwell/greendao/NoticeLocaleBeanDao.java +++ b/app/src/main/java/com/casic/app/smartwell/greendao/NoticeLocaleBeanDao.java @@ -12,10 +12,9 @@ import org.greenrobot.greendao.internal.DaoConfig; // THIS CODE IS GENERATED BY greenDAO, DO NOT EDIT. - -/** +/** * DAO for table "NOTICE_LOCALE_BEAN". - */ +*/ public class NoticeLocaleBeanDao extends AbstractDao { public static final String TABLENAME = "NOTICE_LOCALE_BEAN"; @@ -43,16 +42,14 @@ public NoticeLocaleBeanDao(DaoConfig config) { super(config); } - + public NoticeLocaleBeanDao(DaoConfig config, DaoSession daoSession) { super(config, daoSession); } - /** - * Creates the underlying database table. - */ + /** Creates the underlying database table. */ public static void createTable(Database db, boolean ifNotExists) { - String constraint = ifNotExists ? "IF NOT EXISTS " : ""; + String constraint = ifNotExists? "IF NOT EXISTS ": ""; db.execSQL("CREATE TABLE " + constraint + "\"NOTICE_LOCALE_BEAN\" (" + // "\"_id\" INTEGER PRIMARY KEY AUTOINCREMENT ," + // 0: id "\"MESSAGE_ID\" TEXT UNIQUE ," + // 1: messageId @@ -68,9 +65,7 @@ "\"NOTICE_TIME\" TEXT);"); // 11: noticeTime } - /** - * Drops the underlying database table. - */ + /** Drops the underlying database table. */ public static void dropTable(Database db, boolean ifExists) { String sql = "DROP TABLE " + (ifExists ? "IF EXISTS " : "") + "\"NOTICE_LOCALE_BEAN\""; db.execSQL(sql); @@ -79,62 +74,62 @@ @Override protected final void bindValues(DatabaseStatement stmt, NoticeLocaleBean entity) { stmt.clearBindings(); - + Long id = entity.getId(); if (id != null) { stmt.bindLong(1, id); } - + String messageId = entity.getMessageId(); if (messageId != null) { stmt.bindString(2, messageId); } - + String appid = entity.getAppid(); if (appid != null) { stmt.bindString(3, appid); } - + String clientId = entity.getClientId(); if (clientId != null) { stmt.bindString(4, clientId); } - + String taskId = entity.getTaskId(); if (taskId != null) { stmt.bindString(5, taskId); } - + String userId = entity.getUserId(); if (userId != null) { stmt.bindString(6, userId); } - + String title = entity.getTitle(); if (title != null) { stmt.bindString(7, title); } - + String content = entity.getContent(); if (content != null) { stmt.bindString(8, content); } - + String deviceCode = entity.getDeviceCode(); if (deviceCode != null) { stmt.bindString(9, deviceCode); } - + String jobId = entity.getJobId(); if (jobId != null) { stmt.bindString(10, jobId); } - + String isRead = entity.getIsRead(); if (isRead != null) { stmt.bindString(11, isRead); } - + String noticeTime = entity.getNoticeTime(); if (noticeTime != null) { stmt.bindString(12, noticeTime); @@ -144,62 +139,62 @@ @Override protected final void bindValues(SQLiteStatement stmt, NoticeLocaleBean entity) { stmt.clearBindings(); - + Long id = entity.getId(); if (id != null) { stmt.bindLong(1, id); } - + String messageId = entity.getMessageId(); if (messageId != null) { stmt.bindString(2, messageId); } - + String appid = entity.getAppid(); if (appid != null) { stmt.bindString(3, appid); } - + String clientId = entity.getClientId(); if (clientId != null) { stmt.bindString(4, clientId); } - + String taskId = entity.getTaskId(); if (taskId != null) { stmt.bindString(5, taskId); } - + String userId = entity.getUserId(); if (userId != null) { stmt.bindString(6, userId); } - + String title = entity.getTitle(); if (title != null) { stmt.bindString(7, title); } - + String content = entity.getContent(); if (content != null) { stmt.bindString(8, content); } - + String deviceCode = entity.getDeviceCode(); if (deviceCode != null) { stmt.bindString(9, deviceCode); } - + String jobId = entity.getJobId(); if (jobId != null) { stmt.bindString(10, jobId); } - + String isRead = entity.getIsRead(); if (isRead != null) { stmt.bindString(11, isRead); } - + String noticeTime = entity.getNoticeTime(); if (noticeTime != null) { stmt.bindString(12, noticeTime); @@ -209,27 +204,27 @@ @Override public Long readKey(Cursor cursor, int offset) { return cursor.isNull(offset + 0) ? null : cursor.getLong(offset + 0); - } + } @Override public NoticeLocaleBean readEntity(Cursor cursor, int offset) { NoticeLocaleBean entity = new NoticeLocaleBean( // - cursor.isNull(offset + 0) ? null : cursor.getLong(offset + 0), // id - cursor.isNull(offset + 1) ? null : cursor.getString(offset + 1), // messageId - cursor.isNull(offset + 2) ? null : cursor.getString(offset + 2), // appid - cursor.isNull(offset + 3) ? null : cursor.getString(offset + 3), // clientId - cursor.isNull(offset + 4) ? null : cursor.getString(offset + 4), // taskId - cursor.isNull(offset + 5) ? null : cursor.getString(offset + 5), // userId - cursor.isNull(offset + 6) ? null : cursor.getString(offset + 6), // title - cursor.isNull(offset + 7) ? null : cursor.getString(offset + 7), // content - cursor.isNull(offset + 8) ? null : cursor.getString(offset + 8), // deviceCode - cursor.isNull(offset + 9) ? null : cursor.getString(offset + 9), // jobId - cursor.isNull(offset + 10) ? null : cursor.getString(offset + 10), // isRead - cursor.isNull(offset + 11) ? null : cursor.getString(offset + 11) // noticeTime + cursor.isNull(offset + 0) ? null : cursor.getLong(offset + 0), // id + cursor.isNull(offset + 1) ? null : cursor.getString(offset + 1), // messageId + cursor.isNull(offset + 2) ? null : cursor.getString(offset + 2), // appid + cursor.isNull(offset + 3) ? null : cursor.getString(offset + 3), // clientId + cursor.isNull(offset + 4) ? null : cursor.getString(offset + 4), // taskId + cursor.isNull(offset + 5) ? null : cursor.getString(offset + 5), // userId + cursor.isNull(offset + 6) ? null : cursor.getString(offset + 6), // title + cursor.isNull(offset + 7) ? null : cursor.getString(offset + 7), // content + cursor.isNull(offset + 8) ? null : cursor.getString(offset + 8), // deviceCode + cursor.isNull(offset + 9) ? null : cursor.getString(offset + 9), // jobId + cursor.isNull(offset + 10) ? null : cursor.getString(offset + 10), // isRead + cursor.isNull(offset + 11) ? null : cursor.getString(offset + 11) // noticeTime ); return entity; } - + @Override public void readEntity(Cursor cursor, NoticeLocaleBean entity, int offset) { entity.setId(cursor.isNull(offset + 0) ? null : cursor.getLong(offset + 0)); @@ -244,17 +239,17 @@ entity.setJobId(cursor.isNull(offset + 9) ? null : cursor.getString(offset + 9)); entity.setIsRead(cursor.isNull(offset + 10) ? null : cursor.getString(offset + 10)); entity.setNoticeTime(cursor.isNull(offset + 11) ? null : cursor.getString(offset + 11)); - } - + } + @Override protected final Long updateKeyAfterInsert(NoticeLocaleBean entity, long rowId) { entity.setId(rowId); return rowId; } - + @Override public Long getKey(NoticeLocaleBean entity) { - if (entity != null) { + if(entity != null) { return entity.getId(); } else { return null; @@ -270,5 +265,5 @@ protected final boolean isEntityUpdateable() { return true; } - + } diff --git a/app/src/main/java/com/casic/app/smartwell/greendao/PipeLocalBeanDao.java b/app/src/main/java/com/casic/app/smartwell/greendao/PipeLocalBeanDao.java index aab4d3f..df5515a 100644 --- a/app/src/main/java/com/casic/app/smartwell/greendao/PipeLocalBeanDao.java +++ b/app/src/main/java/com/casic/app/smartwell/greendao/PipeLocalBeanDao.java @@ -12,10 +12,9 @@ import org.greenrobot.greendao.internal.DaoConfig; // THIS CODE IS GENERATED BY greenDAO, DO NOT EDIT. - -/** +/** * DAO for table "PIPE_LOCAL_BEAN". - */ +*/ public class PipeLocalBeanDao extends AbstractDao { public static final String TABLENAME = "PIPE_LOCAL_BEAN"; @@ -37,16 +36,14 @@ public PipeLocalBeanDao(DaoConfig config) { super(config); } - + public PipeLocalBeanDao(DaoConfig config, DaoSession daoSession) { super(config, daoSession); } - /** - * Creates the underlying database table. - */ + /** Creates the underlying database table. */ public static void createTable(Database db, boolean ifNotExists) { - String constraint = ifNotExists ? "IF NOT EXISTS " : ""; + String constraint = ifNotExists? "IF NOT EXISTS ": ""; db.execSQL("CREATE TABLE " + constraint + "\"PIPE_LOCAL_BEAN\" (" + // "\"_id\" INTEGER PRIMARY KEY AUTOINCREMENT ," + // 0: id "\"PIPE_CODE\" TEXT," + // 1: pipeCode @@ -56,9 +53,7 @@ "\"START_LONGITUDE_GD\" TEXT);"); // 5: startLongitudeGd } - /** - * Drops the underlying database table. - */ + /** Drops the underlying database table. */ public static void dropTable(Database db, boolean ifExists) { String sql = "DROP TABLE " + (ifExists ? "IF EXISTS " : "") + "\"PIPE_LOCAL_BEAN\""; db.execSQL(sql); @@ -67,32 +62,32 @@ @Override protected final void bindValues(DatabaseStatement stmt, PipeLocalBean entity) { stmt.clearBindings(); - + Long id = entity.getId(); if (id != null) { stmt.bindLong(1, id); } - + String pipeCode = entity.getPipeCode(); if (pipeCode != null) { stmt.bindString(2, pipeCode); } - + String endLatitudeGd = entity.getEndLatitudeGd(); if (endLatitudeGd != null) { stmt.bindString(3, endLatitudeGd); } - + String endLongitudeGd = entity.getEndLongitudeGd(); if (endLongitudeGd != null) { stmt.bindString(4, endLongitudeGd); } - + String startLatitudeGd = entity.getStartLatitudeGd(); if (startLatitudeGd != null) { stmt.bindString(5, startLatitudeGd); } - + String startLongitudeGd = entity.getStartLongitudeGd(); if (startLongitudeGd != null) { stmt.bindString(6, startLongitudeGd); @@ -102,32 +97,32 @@ @Override protected final void bindValues(SQLiteStatement stmt, PipeLocalBean entity) { stmt.clearBindings(); - + Long id = entity.getId(); if (id != null) { stmt.bindLong(1, id); } - + String pipeCode = entity.getPipeCode(); if (pipeCode != null) { stmt.bindString(2, pipeCode); } - + String endLatitudeGd = entity.getEndLatitudeGd(); if (endLatitudeGd != null) { stmt.bindString(3, endLatitudeGd); } - + String endLongitudeGd = entity.getEndLongitudeGd(); if (endLongitudeGd != null) { stmt.bindString(4, endLongitudeGd); } - + String startLatitudeGd = entity.getStartLatitudeGd(); if (startLatitudeGd != null) { stmt.bindString(5, startLatitudeGd); } - + String startLongitudeGd = entity.getStartLongitudeGd(); if (startLongitudeGd != null) { stmt.bindString(6, startLongitudeGd); @@ -137,21 +132,21 @@ @Override public Long readKey(Cursor cursor, int offset) { return cursor.isNull(offset + 0) ? null : cursor.getLong(offset + 0); - } + } @Override public PipeLocalBean readEntity(Cursor cursor, int offset) { PipeLocalBean entity = new PipeLocalBean( // - cursor.isNull(offset + 0) ? null : cursor.getLong(offset + 0), // id - cursor.isNull(offset + 1) ? null : cursor.getString(offset + 1), // pipeCode - cursor.isNull(offset + 2) ? null : cursor.getString(offset + 2), // endLatitudeGd - cursor.isNull(offset + 3) ? null : cursor.getString(offset + 3), // endLongitudeGd - cursor.isNull(offset + 4) ? null : cursor.getString(offset + 4), // startLatitudeGd - cursor.isNull(offset + 5) ? null : cursor.getString(offset + 5) // startLongitudeGd + cursor.isNull(offset + 0) ? null : cursor.getLong(offset + 0), // id + cursor.isNull(offset + 1) ? null : cursor.getString(offset + 1), // pipeCode + cursor.isNull(offset + 2) ? null : cursor.getString(offset + 2), // endLatitudeGd + cursor.isNull(offset + 3) ? null : cursor.getString(offset + 3), // endLongitudeGd + cursor.isNull(offset + 4) ? null : cursor.getString(offset + 4), // startLatitudeGd + cursor.isNull(offset + 5) ? null : cursor.getString(offset + 5) // startLongitudeGd ); return entity; } - + @Override public void readEntity(Cursor cursor, PipeLocalBean entity, int offset) { entity.setId(cursor.isNull(offset + 0) ? null : cursor.getLong(offset + 0)); @@ -160,17 +155,17 @@ entity.setEndLongitudeGd(cursor.isNull(offset + 3) ? null : cursor.getString(offset + 3)); entity.setStartLatitudeGd(cursor.isNull(offset + 4) ? null : cursor.getString(offset + 4)); entity.setStartLongitudeGd(cursor.isNull(offset + 5) ? null : cursor.getString(offset + 5)); - } - + } + @Override protected final Long updateKeyAfterInsert(PipeLocalBean entity, long rowId) { entity.setId(rowId); return rowId; } - + @Override public Long getKey(PipeLocalBean entity) { - if (entity != null) { + if(entity != null) { return entity.getId(); } else { return null; @@ -186,5 +181,5 @@ protected final boolean isEntityUpdateable() { return true; } - + } diff --git a/app/src/main/java/com/casic/app/smartwell/view/ChangePasswordActivity.kt b/app/src/main/java/com/casic/app/smartwell/view/ChangePasswordActivity.kt index 8e41039..9f1dd40 100644 --- a/app/src/main/java/com/casic/app/smartwell/view/ChangePasswordActivity.kt +++ b/app/src/main/java/com/casic/app/smartwell/view/ChangePasswordActivity.kt @@ -14,7 +14,7 @@ import com.pengxh.kt.lite.extensions.show import com.pengxh.kt.lite.utils.ActivityStackManager import com.pengxh.kt.lite.utils.LoadState -import com.pengxh.kt.lite.utils.LoadingDialogHub +import com.pengxh.kt.lite.utils.LoadingDialog import com.pengxh.kt.lite.widget.TitleBarView import java.nio.charset.StandardCharsets @@ -46,15 +46,15 @@ override fun observeRequestState() { userViewModel.loadState.observe(this) { when (it) { - is LoadState.Loading -> LoadingDialogHub.show(this, "修改中,请稍后") + is LoadState.Loading -> LoadingDialog.show(this, "修改中,请稍后") is LoadState.Success -> { - LoadingDialogHub.dismiss() + LoadingDialog.dismiss() AuthenticationHelper.removeToken() this.navigatePageTo() ActivityStackManager.finishAllActivity() } - else -> LoadingDialogHub.dismiss() + else -> LoadingDialog.dismiss() } } } diff --git a/app/src/main/java/com/casic/app/smartwell/view/DeployedWellActivity.kt b/app/src/main/java/com/casic/app/smartwell/view/DeployedWellActivity.kt index fb4339c..28a5078 100644 --- a/app/src/main/java/com/casic/app/smartwell/view/DeployedWellActivity.kt +++ b/app/src/main/java/com/casic/app/smartwell/view/DeployedWellActivity.kt @@ -83,8 +83,8 @@ } //添加分割线 - binding.deployedListView.addItemDecoration( - RecyclerViewItemOffsets(0, 5, 0, 5) + binding.recyclerView.addItemDecoration( + RecyclerViewItemOffsets(0, 7, 0, 7) ) } @@ -149,12 +149,11 @@ } else { item.deep.toString() + "m" } - viewHolder.setText(R.id.wellNameView, item.wellName) + viewHolder.setText(R.id.wellTypeView, item.wellTypeName) .setText(R.id.wellDepthView, "深:${deep}") .setText(R.id.wellCodeView, "点位编号:${item.wellCode}") - .setText(R.id.wellTypeView, "点位类型:${item.wellTypeName}") .setText(R.id.ownerShipView, "权属单位:${item.deptName}") - .setText(R.id.wellLocationView, "点位置:${item.position}") + .setText(R.id.wellLocationView, "点位位置:${item.position}") .setOnClickListener( R.id.operationButton, object : View.OnClickListener { override fun onClick(v: View?) { @@ -207,7 +206,7 @@ }) } } - binding.deployedListView.adapter = deployAdapter + binding.recyclerView.adapter = deployAdapter deployAdapter.setOnItemClickedListener(object : NormalRecyclerAdapter.OnItemClickedListener { override fun onItemClicked(position: Int, t: WellListModel.DataBean.RowsBean) { diff --git a/app/src/main/java/com/casic/app/smartwell/view/LoginActivity.kt b/app/src/main/java/com/casic/app/smartwell/view/LoginActivity.kt index e4bb0e3..834527b 100644 --- a/app/src/main/java/com/casic/app/smartwell/view/LoginActivity.kt +++ b/app/src/main/java/com/casic/app/smartwell/view/LoginActivity.kt @@ -21,7 +21,7 @@ import com.pengxh.kt.lite.extensions.navigatePageTo import com.pengxh.kt.lite.extensions.readAssetsFile import com.pengxh.kt.lite.extensions.show -import com.pengxh.kt.lite.utils.LoadingDialogHub +import com.pengxh.kt.lite.utils.LoadingDialog import com.pengxh.kt.lite.utils.SaveKeyValues import kotlinx.coroutines.Dispatchers import kotlinx.coroutines.launch @@ -106,11 +106,11 @@ override fun observeRequestState() { authenticateViewModel.loadState.observe(this) { - LoadingDialogHub.show(this, "登录中,请稍后") + LoadingDialog.show(this, "登录中,请稍后") } loginViewModel.loadState.observe(this) { - LoadingDialogHub.dismiss() + LoadingDialog.dismiss() } } diff --git a/app/src/main/java/com/casic/app/smartwell/view/OrderCompletedDetailActivity.kt b/app/src/main/java/com/casic/app/smartwell/view/OrderCompletedDetailActivity.kt index db8ad1f..75cd905 100644 --- a/app/src/main/java/com/casic/app/smartwell/view/OrderCompletedDetailActivity.kt +++ b/app/src/main/java/com/casic/app/smartwell/view/OrderCompletedDetailActivity.kt @@ -17,7 +17,7 @@ import com.pengxh.kt.lite.extensions.show import com.pengxh.kt.lite.utils.Constant import com.pengxh.kt.lite.utils.LoadState -import com.pengxh.kt.lite.utils.LoadingDialogHub +import com.pengxh.kt.lite.utils.LoadingDialog import com.pengxh.kt.lite.widget.TitleBarView import com.pengxh.kt.lite.widget.dialog.AlertMessageDialog @@ -44,7 +44,7 @@ } override fun initOnCreate(savedInstanceState: Bundle?) { - val jobId = intent.getStringExtra(Constant.INTENT_PARAM)!! + val jobId = intent.getStringExtra(Constant.INTENT_PARAM_KEY)!! orderViewModel = ViewModelProvider(this)[OrderViewModel::class.java] orderViewModel.getWorkOrderDetail(jobId) orderViewModel.detailModel.observe(this) { @@ -154,8 +154,8 @@ override fun observeRequestState() { orderViewModel.loadState.observe(this) { when (it) { - is LoadState.Loading -> LoadingDialogHub.show(this, "数据加载中,请稍后") - else -> LoadingDialogHub.dismiss() + is LoadState.Loading -> LoadingDialog.show(this, "数据加载中,请稍后") + else -> LoadingDialog.dismiss() } } } diff --git a/app/src/main/java/com/casic/app/smartwell/view/OrderInHandleDetailActivity.kt b/app/src/main/java/com/casic/app/smartwell/view/OrderInHandleDetailActivity.kt index d70a979..04a7d5d 100644 --- a/app/src/main/java/com/casic/app/smartwell/view/OrderInHandleDetailActivity.kt +++ b/app/src/main/java/com/casic/app/smartwell/view/OrderInHandleDetailActivity.kt @@ -38,7 +38,7 @@ import com.pengxh.kt.lite.extensions.show import com.pengxh.kt.lite.utils.Constant import com.pengxh.kt.lite.utils.LoadState -import com.pengxh.kt.lite.utils.LoadingDialogHub +import com.pengxh.kt.lite.utils.LoadingDialog import com.pengxh.kt.lite.widget.TitleBarView import com.pengxh.kt.lite.widget.dialog.AlertControlDialog import com.pengxh.kt.lite.widget.dialog.AlertMessageDialog @@ -93,7 +93,7 @@ ) binding.addImageRecyclerView.adapter = imageAdapter - val jobId = intent.getStringExtra(Constant.INTENT_PARAM)!!//初始化图片九宫格 + val jobId = intent.getStringExtra(Constant.INTENT_PARAM_KEY)!!//初始化图片九宫格 orderViewModel.getWorkOrderDetail(jobId) orderViewModel.detailModel.observe(this) { if (it.code == 200) { @@ -312,41 +312,41 @@ override fun observeRequestState() { orderViewModel.loadState.observe(this) { when (it) { - is LoadState.Loading -> LoadingDialogHub.show(this, "数据加载中,请稍后") - else -> LoadingDialogHub.dismiss() + is LoadState.Loading -> LoadingDialog.show(this, "数据加载中,请稍后") + else -> LoadingDialog.dismiss() } } uploadImageViewModel.loadState.observe(this) { when (it) { - LoadState.Loading -> LoadingDialogHub.show(this, "图片上传中,请稍后...") - else -> LoadingDialogHub.dismiss() + LoadState.Loading -> LoadingDialog.show(this, "图片上传中,请稍后...") + else -> LoadingDialog.dismiss() } } //转单状态处理 operationViewModel.loadState.observe(this) { when (it) { - is LoadState.Loading -> LoadingDialogHub.show(this, "转单中,请稍后") + is LoadState.Loading -> LoadingDialog.show(this, "转单中,请稍后") is LoadState.Success -> { - LoadingDialogHub.dismiss() + LoadingDialog.dismiss() this.finish() } - else -> LoadingDialogHub.dismiss() + else -> LoadingDialog.dismiss() } } //处理完成工单状态处理 operationViewModel.loadState.observe(this) { when (it) { - is LoadState.Loading -> LoadingDialogHub.show(this, "处理中,请稍后") + is LoadState.Loading -> LoadingDialog.show(this, "处理中,请稍后") is LoadState.Success -> { - LoadingDialogHub.dismiss() + LoadingDialog.dismiss() this.finish() } - else -> LoadingDialogHub.dismiss() + else -> LoadingDialog.dismiss() } } } diff --git a/app/src/main/java/com/casic/app/smartwell/view/OrderNotConfirmedDetailActivity.kt b/app/src/main/java/com/casic/app/smartwell/view/OrderNotConfirmedDetailActivity.kt index 8e036d2..687ec86 100644 --- a/app/src/main/java/com/casic/app/smartwell/view/OrderNotConfirmedDetailActivity.kt +++ b/app/src/main/java/com/casic/app/smartwell/view/OrderNotConfirmedDetailActivity.kt @@ -36,7 +36,7 @@ import com.pengxh.kt.lite.extensions.show import com.pengxh.kt.lite.utils.Constant import com.pengxh.kt.lite.utils.LoadState -import com.pengxh.kt.lite.utils.LoadingDialogHub +import com.pengxh.kt.lite.utils.LoadingDialog import com.pengxh.kt.lite.widget.TitleBarView import com.pengxh.kt.lite.widget.dialog.AlertControlDialog import com.pengxh.kt.lite.widget.dialog.AlertMessageDialog @@ -80,7 +80,7 @@ } override fun initOnCreate(savedInstanceState: Bundle?) { - val jobId = intent.getStringExtra(Constant.INTENT_PARAM)!! + val jobId = intent.getStringExtra(Constant.INTENT_PARAM_KEY)!! //初始化图片九宫格 //左外边距,左内边距,右内边距,右外边距 val viewWidth = getScreenWidth() - (10 + 10 + 10 + 10).dp2px(this) @@ -263,41 +263,41 @@ //数据加载状态处理 orderViewModel.loadState.observe(this) { when (it) { - is LoadState.Loading -> LoadingDialogHub.show(this, "数据加载中,请稍后") - else -> LoadingDialogHub.dismiss() + is LoadState.Loading -> LoadingDialog.show(this, "数据加载中,请稍后") + else -> LoadingDialog.dismiss() } } uploadImageViewModel.loadState.observe(this) { when (it) { - LoadState.Loading -> LoadingDialogHub.show(this, "图片上传中,请稍后") - else -> LoadingDialogHub.dismiss() + LoadState.Loading -> LoadingDialog.show(this, "图片上传中,请稍后") + else -> LoadingDialog.dismiss() } } //转单状态处理 operationViewModel.loadState.observe(this) { when (it) { - is LoadState.Loading -> LoadingDialogHub.show(this, "转单中,请稍后") + is LoadState.Loading -> LoadingDialog.show(this, "转单中,请稍后") is LoadState.Success -> { - LoadingDialogHub.dismiss() + LoadingDialog.dismiss() this.finish() } - else -> LoadingDialogHub.dismiss() + else -> LoadingDialog.dismiss() } } //确认工单状态处理 operationViewModel.loadState.observe(this) { when (it) { - is LoadState.Loading -> LoadingDialogHub.show(this, "处理中,请稍后") + is LoadState.Loading -> LoadingDialog.show(this, "处理中,请稍后") is LoadState.Success -> { - LoadingDialogHub.dismiss() + LoadingDialog.dismiss() this.finish() } - else -> LoadingDialogHub.dismiss() + else -> LoadingDialog.dismiss() } } } diff --git a/app/src/main/java/com/casic/app/smartwell/view/OrderNotProcessedDetailActivity.kt b/app/src/main/java/com/casic/app/smartwell/view/OrderNotProcessedDetailActivity.kt index d3f22dc..0c97a52 100644 --- a/app/src/main/java/com/casic/app/smartwell/view/OrderNotProcessedDetailActivity.kt +++ b/app/src/main/java/com/casic/app/smartwell/view/OrderNotProcessedDetailActivity.kt @@ -18,7 +18,7 @@ import com.pengxh.kt.lite.extensions.show import com.pengxh.kt.lite.utils.Constant import com.pengxh.kt.lite.utils.LoadState -import com.pengxh.kt.lite.utils.LoadingDialogHub +import com.pengxh.kt.lite.utils.LoadingDialog import com.pengxh.kt.lite.widget.TitleBarView import com.pengxh.kt.lite.widget.dialog.AlertControlDialog import com.pengxh.kt.lite.widget.dialog.AlertMessageDialog @@ -50,7 +50,7 @@ } override fun initOnCreate(savedInstanceState: Bundle?) { - this.jobId = intent.getStringExtra(Constant.INTENT_PARAM)!! + this.jobId = intent.getStringExtra(Constant.INTENT_PARAM_KEY)!! orderViewModel = ViewModelProvider(this)[OrderViewModel::class.java] operationViewModel = ViewModelProvider(this)[OperationViewModel::class.java] wellViewModel = ViewModelProvider(this)[WellViewModel::class.java] @@ -162,21 +162,21 @@ //数据加载状态处理 orderViewModel.loadState.observe(this) { when (it) { - is LoadState.Loading -> LoadingDialogHub.show(this, "数据加载中,请稍后") - else -> LoadingDialogHub.dismiss() + is LoadState.Loading -> LoadingDialog.show(this, "数据加载中,请稍后") + else -> LoadingDialog.dismiss() } } //接单状态处理 operationViewModel.loadState.observe(this) { when (it) { - is LoadState.Loading -> LoadingDialogHub.show(this, "接单中,请稍后") + is LoadState.Loading -> LoadingDialog.show(this, "接单中,请稍后") is LoadState.Success -> { - LoadingDialogHub.dismiss() + LoadingDialog.dismiss() this.finish() } - else -> LoadingDialogHub.dismiss() + else -> LoadingDialog.dismiss() } } } diff --git a/app/src/main/java/com/casic/app/smartwell/view/SearchResultActivity.kt b/app/src/main/java/com/casic/app/smartwell/view/SearchResultActivity.kt index 6a92917..4f3a674 100644 --- a/app/src/main/java/com/casic/app/smartwell/view/SearchResultActivity.kt +++ b/app/src/main/java/com/casic/app/smartwell/view/SearchResultActivity.kt @@ -19,7 +19,7 @@ import com.pengxh.kt.lite.extensions.show import com.pengxh.kt.lite.utils.Constant import com.pengxh.kt.lite.utils.LoadState -import com.pengxh.kt.lite.utils.LoadingDialogHub +import com.pengxh.kt.lite.utils.LoadingDialog import com.pengxh.kt.lite.utils.WeakReferenceHandler import com.pengxh.kt.lite.widget.TitleBarView import com.pengxh.kt.lite.widget.dialog.AlertControlDialog @@ -56,7 +56,7 @@ } override fun initOnCreate(savedInstanceState: Bundle?) { - args = intent.getStringArrayListExtra(Constant.INTENT_PARAM)!! + args = intent.getStringArrayListExtra(Constant.INTENT_PARAM_KEY)!! orderViewModel = ViewModelProvider(this)[OrderViewModel::class.java] operationViewModel = ViewModelProvider(this)[OperationViewModel::class.java] @@ -101,24 +101,24 @@ } } - binding.resultRecyclerView.addItemDecoration( - RecyclerViewItemOffsets(0, 5, 0, 5) + binding.recyclerView.addItemDecoration( + RecyclerViewItemOffsets(0, 7, 0, 7) ) } override fun observeRequestState() { orderViewModel.loadState.observe(this) { when (it) { - is LoadState.Loading -> LoadingDialogHub.show(this, "数据加载中,请稍后") - else -> LoadingDialogHub.dismiss() + is LoadState.Loading -> LoadingDialog.show(this, "数据加载中,请稍后") + else -> LoadingDialog.dismiss() } } //接单状态处理 operationViewModel.loadState.observe(this) { when (it) { - is LoadState.Loading -> LoadingDialogHub.show(this, "接单中,请稍后") + is LoadState.Loading -> LoadingDialog.show(this, "接单中,请稍后") is LoadState.Success -> { - LoadingDialogHub.dismiss() + LoadingDialog.dismiss() //接单成功之后刷新列表 dataBeans.removeAt(clickedPosition) searchResultAdapter.notifyItemRemoved(clickedPosition) @@ -127,7 +127,7 @@ ) } - else -> LoadingDialogHub.dismiss() + else -> LoadingDialog.dismiss() } } } @@ -162,7 +162,7 @@ } else { binding.emptyInclude.emptyView.hide() searchResultAdapter = SearchResultAdapter(this, dataBeans) - binding.resultRecyclerView.adapter = searchResultAdapter + binding.recyclerView.adapter = searchResultAdapter searchResultAdapter.setOnItemClickListener(object : SearchResultAdapter.OnItemClickListener { override fun onClicked(position: Int) { diff --git a/app/src/main/java/com/casic/app/smartwell/view/UnDeployWellActivity.kt b/app/src/main/java/com/casic/app/smartwell/view/UnDeployWellActivity.kt index 7f7cd3c..555c278 100644 --- a/app/src/main/java/com/casic/app/smartwell/view/UnDeployWellActivity.kt +++ b/app/src/main/java/com/casic/app/smartwell/view/UnDeployWellActivity.kt @@ -81,8 +81,8 @@ } } - binding.undeployListView.addItemDecoration( - RecyclerViewItemOffsets(0, 5, 0, 5) + binding.recyclerView.addItemDecoration( + RecyclerViewItemOffsets(0, 7, 0, 7) ) } @@ -147,12 +147,11 @@ } else { item.deep.toString() + "m" } - viewHolder.setText(R.id.wellNameView, item.wellName) + viewHolder.setText(R.id.wellTypeView, item.wellTypeName) .setText(R.id.wellDepthView, "深:${deep}") .setText(R.id.wellCodeView, "点位编号:${item.wellCode}") - .setText(R.id.wellTypeView, "点位类型:${item.wellTypeName}") .setText(R.id.ownerShipView, "权属单位:${item.deptName}") - .setText(R.id.wellLocationView, "点位置:${item.position}") + .setText(R.id.wellLocationView, "点位位置:${item.position}") .setOnClickListener( R.id.operationButton, object : View.OnClickListener { override fun onClick(v: View?) { @@ -185,7 +184,7 @@ ) } } - binding.undeployListView.adapter = unDeployAdapter + binding.recyclerView.adapter = unDeployAdapter unDeployAdapter.setOnItemClickedListener(object : NormalRecyclerAdapter.OnItemClickedListener { override fun onItemClicked(position: Int, t: WellListModel.DataBean.RowsBean) { diff --git a/app/src/main/java/com/casic/app/smartwell/view/WellDetailActivity.kt b/app/src/main/java/com/casic/app/smartwell/view/WellDetailActivity.kt index b50d067..eb8b468 100644 --- a/app/src/main/java/com/casic/app/smartwell/view/WellDetailActivity.kt +++ b/app/src/main/java/com/casic/app/smartwell/view/WellDetailActivity.kt @@ -16,7 +16,7 @@ import com.pengxh.kt.lite.extensions.show import com.pengxh.kt.lite.utils.Constant import com.pengxh.kt.lite.utils.LoadState -import com.pengxh.kt.lite.utils.LoadingDialogHub +import com.pengxh.kt.lite.utils.LoadingDialog import com.pengxh.kt.lite.widget.TitleBarView import com.pengxh.kt.lite.widget.dialog.AlertMessageDialog @@ -44,7 +44,7 @@ } override fun initOnCreate(savedInstanceState: Bundle?) { - val wellId = intent.getStringExtra(Constant.INTENT_PARAM)!! + val wellId = intent.getStringExtra(Constant.INTENT_PARAM_KEY)!! wellViewModel = ViewModelProvider(this)[WellViewModel::class.java] wellViewModel.getWellDetail(wellId) wellViewModel.wellDetailModel.observe(this) { @@ -132,8 +132,8 @@ override fun observeRequestState() { wellViewModel.loadState.observe(this) { when (it) { - is LoadState.Loading -> LoadingDialogHub.show(this, "数据加载中,请稍后") - else -> LoadingDialogHub.dismiss() + is LoadState.Loading -> LoadingDialog.show(this, "数据加载中,请稍后") + else -> LoadingDialog.dismiss() } } } diff --git a/app/src/main/java/com/casic/app/smartwell/view/WellManagementActivity.kt b/app/src/main/java/com/casic/app/smartwell/view/WellManagementActivity.kt index 084da95..457096b 100644 --- a/app/src/main/java/com/casic/app/smartwell/view/WellManagementActivity.kt +++ b/app/src/main/java/com/casic/app/smartwell/view/WellManagementActivity.kt @@ -94,8 +94,8 @@ } } - binding.wellListView.addItemDecoration( - RecyclerViewItemOffsets(0, 5, 0, 5) + binding.recyclerView.addItemDecoration( + RecyclerViewItemOffsets(0, 7, 0, 7) ) } @@ -175,13 +175,12 @@ } else { item.deep.toString() + "m" } - viewHolder.setText(R.id.wellNameView, item.wellName) + viewHolder.setText(R.id.wellTypeView, item.wellTypeName) .setText(R.id.wellStateView, "已${item.bfztName}") .setText(R.id.wellDepthView, "深:${deep}") .setText(R.id.wellCodeView, "点位编号:${item.wellCode}") - .setText(R.id.wellTypeView, "点位类型:${item.wellTypeName}") .setText(R.id.ownerShipView, "权属单位:${item.deptName}") - .setText(R.id.wellLocationView, "点位置:${item.position}") + .setText(R.id.wellLocationView, "点位位置:${item.position}") .setOnClickListener( R.id.navigationButton, object : View.OnClickListener { override fun onClick(v: View?) { @@ -200,7 +199,7 @@ ) } } - binding.wellListView.adapter = wellListAdapter + binding.recyclerView.adapter = wellListAdapter wellListAdapter.setOnItemClickedListener(object : NormalRecyclerAdapter.OnItemClickedListener { override fun onItemClicked(position: Int, t: WellListModel.DataBean.RowsBean) { diff --git a/app/src/main/java/com/casic/app/smartwell/view/WellMonitorActivity.kt b/app/src/main/java/com/casic/app/smartwell/view/WellMonitorActivity.kt index e3573eb..b87bdb7 100644 --- a/app/src/main/java/com/casic/app/smartwell/view/WellMonitorActivity.kt +++ b/app/src/main/java/com/casic/app/smartwell/view/WellMonitorActivity.kt @@ -11,7 +11,7 @@ import com.pengxh.kt.lite.base.KotlinBaseActivity import com.pengxh.kt.lite.utils.Constant import com.pengxh.kt.lite.utils.LoadState -import com.pengxh.kt.lite.utils.LoadingDialogHub +import com.pengxh.kt.lite.utils.LoadingDialog import com.pengxh.kt.lite.widget.TitleBarView class WellMonitorActivity : KotlinBaseActivity() { @@ -36,7 +36,7 @@ } override fun initOnCreate(savedInstanceState: Bundle?) { - val wellId = intent.getStringExtra(Constant.INTENT_PARAM)!! + val wellId = intent.getStringExtra(Constant.INTENT_PARAM_KEY)!! wellViewModel = ViewModelProvider(this)[WellViewModel::class.java] wellViewModel.getMonitorResult(wellId) wellViewModel.monitorModel.observe(this) { @@ -56,8 +56,8 @@ override fun observeRequestState() { wellViewModel.loadState.observe(this) { when (it) { - is LoadState.Loading -> LoadingDialogHub.show(this, "数据加载中,请稍后") - else -> LoadingDialogHub.dismiss() + is LoadState.Loading -> LoadingDialog.show(this, "数据加载中,请稍后") + else -> LoadingDialog.dismiss() } } } diff --git a/app/src/main/java/com/casic/app/smartwell/view/WellOperationActivity.kt b/app/src/main/java/com/casic/app/smartwell/view/WellOperationActivity.kt index 8d333bf..347ebb6 100644 --- a/app/src/main/java/com/casic/app/smartwell/view/WellOperationActivity.kt +++ b/app/src/main/java/com/casic/app/smartwell/view/WellOperationActivity.kt @@ -23,7 +23,7 @@ import com.pengxh.kt.lite.extensions.navigatePageTo import com.pengxh.kt.lite.extensions.show import com.pengxh.kt.lite.utils.LoadState -import com.pengxh.kt.lite.utils.LoadingDialogHub +import com.pengxh.kt.lite.utils.LoadingDialog import com.pengxh.kt.lite.utils.WeakReferenceHandler import com.pengxh.kt.lite.widget.dialog.AlertControlDialog @@ -109,8 +109,8 @@ } } - binding.operationListView.addItemDecoration( - RecyclerViewItemOffsets(0, 5, 0, 5) + binding.recyclerView.addItemDecoration( + RecyclerViewItemOffsets(0, 7, 0, 7) ) } @@ -123,13 +123,13 @@ override fun observeRequestState() { wellViewModel.loadState.observe(this) { when (it) { - is LoadState.Loading -> LoadingDialogHub.show(this, "处理中,请稍后") + is LoadState.Loading -> LoadingDialog.show(this, "处理中,请稍后") is LoadState.Success -> { - LoadingDialogHub.dismiss() + LoadingDialog.dismiss() wellOperationAdapter.notifyItemChanged(clickedPosition) } - else -> LoadingDialogHub.dismiss() + else -> LoadingDialog.dismiss() } } } @@ -203,24 +203,23 @@ if (item.bfztName == "布防") { viewHolder.setImageResource( R.id.wellStateView, R.drawable.bg_solid_text_green_radius_5 - ).setText(R.id.wellStateView, "撤防") + ).setText(R.id.operationButton, "撤防") } else { viewHolder.setImageResource( R.id.wellStateView, R.drawable.bg_solid_text_red_radius_5 - ).setText(R.id.wellStateView, "布防") + ).setText(R.id.operationButton, "布防") } val deep = if (item.deep.toString().isBlank()) { "未知" } else { item.deep.toString() + "m" } - viewHolder.setText(R.id.wellNameView, item.wellName) + viewHolder.setText(R.id.wellTypeView, item.wellTypeName) .setText(R.id.wellStateView, "已${item.bfztName}") .setText(R.id.wellDepthView, "深:${deep}") .setText(R.id.wellCodeView, "点位编号:${item.wellCode}") - .setText(R.id.wellTypeView, "点位类型:${item.wellTypeName}") .setText(R.id.ownerShipView, "权属单位:${item.deptName}") - .setText(R.id.wellLocationView, "点位置:${item.position}") + .setText(R.id.wellLocationView, "点位位置:${item.position}") .setOnClickListener( R.id.operationButton, object : View.OnClickListener { override fun onClick(v: View?) { @@ -280,7 +279,7 @@ ) } } - binding.operationListView.adapter = wellOperationAdapter + binding.recyclerView.adapter = wellOperationAdapter wellOperationAdapter.setOnItemClickedListener(object : NormalRecyclerAdapter.OnItemClickedListener { override fun onItemClicked(position: Int, t: WellListModel.DataBean.RowsBean) { diff --git a/app/src/main/res/drawable/ic_down.xml b/app/src/main/res/drawable/ic_down.xml index 20e6476..6987e6c 100644 --- a/app/src/main/res/drawable/ic_down.xml +++ b/app/src/main/res/drawable/ic_down.xml @@ -1,6 +1,6 @@ + + diff --git a/app/src/main/res/layout/activity_about_us.xml b/app/src/main/res/layout/activity_about_us.xml index 9091a00..d5fbd0d 100644 --- a/app/src/main/res/layout/activity_about_us.xml +++ b/app/src/main/res/layout/activity_about_us.xml @@ -12,13 +12,7 @@ android:layout_width="match_parent" android:layout_height="wrap_content" android:background="@color/mainThemeColor" - app:tbv_left_image="@drawable/ic_title_left" - app:tbv_only_show_title="false" - app:tbv_show_left_image="true" - app:tbv_show_right_image="false" - app:tbv_text="关于我们" - app:tbv_text_color="@color/white" - app:tbv_text_size="@dimen/sp_18" /> + app:tbv_text="关于我们" /> + app:tbv_text="修改密码" /> + app:tbv_text="布防列表" /> + app:tbv_text="帮助中心" /> + app:tbv_text="工单详情" /> + app:tbv_text="工单详情" /> + app:tbv_text="工单详情" /> + app:tbv_text="工单详情" /> + app:tbv_text="超时工单" /> + app:tbv_text="工单查询" /> - + + android:value="ee96d8b5e12de3fbb29949efd57418a8" /> () @@ -150,7 +158,7 @@ val cameraPosition = CameraPosition(centerLatLng, 14f, 0f, 0f) val cameraUpdate = CameraUpdateFactory.newCameraPosition(cameraPosition) withContext(Dispatchers.Main) { - LoadingDialogHub.dismiss() + LoadingDialog.dismiss() aMap.animateCamera(cameraUpdate, 1500, null) } } @@ -239,11 +247,6 @@ } override fun initEvent() { - binding.rightOptionView.setOnClickListener { - val x = binding.rightOptionView.width - easyPopupWindow.width - easyPopupWindow.showAsDropDown(binding.rightOptionView, x, 0) - } - //撤防点位 binding.unDeployedLayout.setOnClickListener { requireContext().navigatePageTo() @@ -263,11 +266,11 @@ override fun observeRequestState() { wellViewModel.loadState.observe(this) { when (it) { - is LoadState.Loading -> LoadingDialogHub.show( + is LoadState.Loading -> LoadingDialog.show( requireActivity(), "数据加载中,请稍后..." ) - else -> LoadingDialogHub.dismiss() + else -> LoadingDialog.dismiss() } } } @@ -376,7 +379,7 @@ }).build().show() } }) - infoPopup.showAsDropDown(binding.rightOptionView) +// infoPopup.showAsDropDown(binding.rightOptionView) } override fun onCameraChange(p0: CameraPosition?) { diff --git a/app/src/main/java/com/casic/app/smartwell/fragment/HomePageNoClusterFragment.kt b/app/src/main/java/com/casic/app/smartwell/fragment/HomePageNoClusterFragment.kt index 802426a..b25f743 100644 --- a/app/src/main/java/com/casic/app/smartwell/fragment/HomePageNoClusterFragment.kt +++ b/app/src/main/java/com/casic/app/smartwell/fragment/HomePageNoClusterFragment.kt @@ -38,8 +38,9 @@ import com.pengxh.kt.lite.extensions.navigatePageTo import com.pengxh.kt.lite.extensions.show import com.pengxh.kt.lite.utils.LoadState -import com.pengxh.kt.lite.utils.LoadingDialogHub +import com.pengxh.kt.lite.utils.LoadingDialog import com.pengxh.kt.lite.widget.EasyPopupWindow +import com.pengxh.kt.lite.widget.TitleBarView import com.pengxh.kt.lite.widget.dialog.AlertControlDialog import kotlinx.coroutines.Dispatchers import kotlinx.coroutines.launch @@ -78,7 +79,15 @@ override fun setupTopBarLayout() { binding.rootView.initImmersionBar(this, false, R.color.mainThemeColor) - binding.titleView.text = "首页" + binding.titleView.setOnClickListener(object : TitleBarView.OnClickListener { + override fun onLeftClick() { + + } + + override fun onRightClick() { + easyPopupWindow.showAsDropDown(binding.titleView, binding.titleView.width, 0) + } + }) } override fun initOnCreate(savedInstanceState: Bundle?) { @@ -112,7 +121,7 @@ //渲染井位置 lifecycleScope.launch(Dispatchers.Main) { - LoadingDialogHub.show(requireActivity(), "数据加载中,请稍后") + LoadingDialog.show(requireActivity(), "数据加载中,请稍后") withContext(Dispatchers.IO) { //取Well缓存 val allMarkerOptions = ArrayList() @@ -144,7 +153,7 @@ val cameraPosition = CameraPosition(centerLatLng, 14f, 0f, 0f) val cameraUpdate = CameraUpdateFactory.newCameraPosition(cameraPosition) withContext(Dispatchers.Main) { - LoadingDialogHub.dismiss() + LoadingDialog.dismiss() aMap.animateCamera(cameraUpdate, 1500, null) } } @@ -238,11 +247,6 @@ } override fun initEvent() { - binding.rightOptionView.setOnClickListener { - val x = binding.rightOptionView.width - easyPopupWindow.width - easyPopupWindow.showAsDropDown(binding.rightOptionView, x, 0) - } - //撤防点位 binding.unDeployedLayout.setOnClickListener { requireContext().navigatePageTo() @@ -262,11 +266,11 @@ override fun observeRequestState() { wellViewModel.loadState.observe(this) { when (it) { - is LoadState.Loading -> LoadingDialogHub.show( + is LoadState.Loading -> LoadingDialog.show( requireActivity(), "数据加载中,请稍后..." ) - else -> LoadingDialogHub.dismiss() + else -> LoadingDialog.dismiss() } } } diff --git a/app/src/main/java/com/casic/app/smartwell/fragment/MinePageFragment.kt b/app/src/main/java/com/casic/app/smartwell/fragment/MinePageFragment.kt index 09a570c..dcb48f8 100644 --- a/app/src/main/java/com/casic/app/smartwell/fragment/MinePageFragment.kt +++ b/app/src/main/java/com/casic/app/smartwell/fragment/MinePageFragment.kt @@ -35,7 +35,7 @@ import com.pengxh.kt.lite.utils.ActivityStackManager import com.pengxh.kt.lite.utils.FileDownloadManager import com.pengxh.kt.lite.utils.LoadState -import com.pengxh.kt.lite.utils.LoadingDialogHub +import com.pengxh.kt.lite.utils.LoadingDialog import com.pengxh.kt.lite.widget.dialog.AlertControlDialog import com.pengxh.kt.lite.widget.dialog.BottomActionSheet import kotlinx.coroutines.Dispatchers @@ -60,7 +60,6 @@ override fun setupTopBarLayout() { binding.rootView.initImmersionBar(this, false, R.color.mainThemeColor) - binding.titleInclude.titleView.text = "我的" } override fun initOnCreate(savedInstanceState: Bundle?) { @@ -155,27 +154,27 @@ override fun observeRequestState() { userViewModel.loadState.observe(this) { when (it) { - is LoadState.Loading -> LoadingDialogHub.show( + is LoadState.Loading -> LoadingDialog.show( requireActivity(), "检查版本中,请稍后" ) - else -> LoadingDialogHub.dismiss() + else -> LoadingDialog.dismiss() } } wellViewModel.loadState.observe(this) { when (it) { - is LoadState.Loading -> LoadingDialogHub.show( + is LoadState.Loading -> LoadingDialog.show( requireActivity(), "数据更新中,请稍后" ) is LoadState.Fail -> { - LoadingDialogHub.dismiss() + LoadingDialog.dismiss() "数据更新超时".show(requireContext()) } else -> { - LoadingDialogHub.dismiss() + LoadingDialog.dismiss() AlertControlDialog.Builder().setContext(requireContext()).setTitle("温馨提示") .setMessage("数据更新成功,请重启应用").setNegativeButton("取消") .setPositiveButton("确定").setOnDialogButtonClickListener(object : @@ -197,17 +196,17 @@ lineViewModel.loadState.observe(this) { when (it) { - is LoadState.Loading -> LoadingDialogHub.show( + is LoadState.Loading -> LoadingDialog.show( requireActivity(), "数据更新中,请稍后" ) is LoadState.Fail -> { - LoadingDialogHub.dismiss() + LoadingDialog.dismiss() "数据更新超时".show(requireContext()) } else -> { - LoadingDialogHub.dismiss() + LoadingDialog.dismiss() AlertControlDialog.Builder().setContext(requireContext()).setTitle("温馨提示") .setMessage("数据更新成功,请重启应用").setNegativeButton("取消") .setPositiveButton("确定").setOnDialogButtonClickListener(object : diff --git a/app/src/main/java/com/casic/app/smartwell/fragment/NoticePageFragment.kt b/app/src/main/java/com/casic/app/smartwell/fragment/NoticePageFragment.kt index 171b555..3c93f54 100644 --- a/app/src/main/java/com/casic/app/smartwell/fragment/NoticePageFragment.kt +++ b/app/src/main/java/com/casic/app/smartwell/fragment/NoticePageFragment.kt @@ -48,7 +48,6 @@ override fun setupTopBarLayout() { binding.rootView.initImmersionBar(this, false, R.color.mainThemeColor) - binding.titleInclude.titleView.text = "消息" } override fun initOnCreate(savedInstanceState: Bundle?) { diff --git a/app/src/main/java/com/casic/app/smartwell/fragment/OrderListFragment.kt b/app/src/main/java/com/casic/app/smartwell/fragment/OrderListFragment.kt index 93ff35b..5e38acb 100644 --- a/app/src/main/java/com/casic/app/smartwell/fragment/OrderListFragment.kt +++ b/app/src/main/java/com/casic/app/smartwell/fragment/OrderListFragment.kt @@ -12,6 +12,7 @@ import com.casic.app.smartwell.view.SearchOrderActivity import com.pengxh.kt.lite.base.KotlinBaseFragment import com.pengxh.kt.lite.extensions.navigatePageTo +import com.pengxh.kt.lite.widget.TitleBarView class OrderListFragment : KotlinBaseFragment() { @@ -25,15 +26,22 @@ } override fun initViewBinding( - inflater: LayoutInflater, - container: ViewGroup? + inflater: LayoutInflater, container: ViewGroup? ): FragmentOrderBinding { return FragmentOrderBinding.inflate(inflater, container, false) } override fun setupTopBarLayout() { binding.rootView.initImmersionBar(this, false, R.color.mainThemeColor) - binding.titleView.text = "工单" + binding.titleView.setOnClickListener(object : TitleBarView.OnClickListener { + override fun onLeftClick() { + + } + + override fun onRightClick() { + requireContext().navigatePageTo() + } + }) } override fun initOnCreate(savedInstanceState: Bundle?) { @@ -51,8 +59,6 @@ } override fun initEvent() { - binding.rightOptionView.setOnClickListener { - requireContext().navigatePageTo() - } + } } \ No newline at end of file diff --git a/app/src/main/java/com/casic/app/smartwell/fragment/OrderNotProcessedFragment.kt b/app/src/main/java/com/casic/app/smartwell/fragment/OrderNotProcessedFragment.kt index 0b3d09d..2b6f21d 100644 --- a/app/src/main/java/com/casic/app/smartwell/fragment/OrderNotProcessedFragment.kt +++ b/app/src/main/java/com/casic/app/smartwell/fragment/OrderNotProcessedFragment.kt @@ -18,7 +18,7 @@ import com.pengxh.kt.lite.extensions.navigatePageTo import com.pengxh.kt.lite.extensions.show import com.pengxh.kt.lite.utils.LoadState -import com.pengxh.kt.lite.utils.LoadingDialogHub +import com.pengxh.kt.lite.utils.LoadingDialog import com.pengxh.kt.lite.utils.WeakReferenceHandler import com.pengxh.kt.lite.widget.dialog.AlertControlDialog @@ -78,8 +78,8 @@ operationViewModel = ViewModelProvider(this)[OperationViewModel::class.java] - binding.notProcessedView.addItemDecoration( - RecyclerViewItemOffsets(0, 5, 0, 5) + binding.recyclerView.addItemDecoration( + RecyclerViewItemOffsets(0, 7, 0, 7) ) } @@ -87,9 +87,9 @@ //接单状态处理 operationViewModel.loadState.observe(this) { when (it) { - is LoadState.Loading -> LoadingDialogHub.show(requireActivity(), "接单中,请稍后") + is LoadState.Loading -> LoadingDialog.show(requireActivity(), "接单中,请稍后") is LoadState.Success -> { - LoadingDialogHub.dismiss() + LoadingDialog.dismiss() //接单成功之后刷新列表 dataBeans.removeAt(clickedPosition) notProcessedAdapter.notifyItemRemoved(clickedPosition) @@ -98,7 +98,7 @@ ) } - else -> LoadingDialogHub.dismiss() + else -> LoadingDialog.dismiss() } } } @@ -131,7 +131,7 @@ } else { binding.emptyInclude.emptyView.hide() notProcessedAdapter = OrderNotProcessedAdapter(requireContext(), dataBeans) - binding.notProcessedView.adapter = notProcessedAdapter + binding.recyclerView.adapter = notProcessedAdapter notProcessedAdapter.setOnItemClickListener(object : OrderNotProcessedAdapter.OnItemClickListener { override fun onClicked(position: Int) { diff --git a/app/src/main/java/com/casic/app/smartwell/fragment/OvertimeNotAcceptFragment.kt b/app/src/main/java/com/casic/app/smartwell/fragment/OvertimeNotAcceptFragment.kt index a198545..9b318ca 100644 --- a/app/src/main/java/com/casic/app/smartwell/fragment/OvertimeNotAcceptFragment.kt +++ b/app/src/main/java/com/casic/app/smartwell/fragment/OvertimeNotAcceptFragment.kt @@ -18,7 +18,7 @@ import com.pengxh.kt.lite.extensions.navigatePageTo import com.pengxh.kt.lite.extensions.show import com.pengxh.kt.lite.utils.LoadState -import com.pengxh.kt.lite.utils.LoadingDialogHub +import com.pengxh.kt.lite.utils.LoadingDialog import com.pengxh.kt.lite.utils.WeakReferenceHandler import com.pengxh.kt.lite.widget.dialog.AlertControlDialog @@ -81,8 +81,8 @@ operationViewModel = ViewModelProvider(this)[OperationViewModel::class.java] - binding.notProcessedView.addItemDecoration( - RecyclerViewItemOffsets(0, 5, 0, 5) + binding.recyclerView.addItemDecoration( + RecyclerViewItemOffsets(0, 7, 0, 7) ) } @@ -90,9 +90,9 @@ //接单状态处理 operationViewModel.loadState.observe(this) { when (it) { - is LoadState.Loading -> LoadingDialogHub.show(requireActivity(), "接单中,请稍后") + is LoadState.Loading -> LoadingDialog.show(requireActivity(), "接单中,请稍后") is LoadState.Success -> { - LoadingDialogHub.dismiss() + LoadingDialog.dismiss() //接单成功之后刷新列表 dataBeans.removeAt(clickedPosition) notProcessedAdapter.notifyItemRemoved(clickedPosition) @@ -101,7 +101,7 @@ ) } - else -> LoadingDialogHub.dismiss() + else -> LoadingDialog.dismiss() } } } @@ -134,7 +134,7 @@ } else { binding.emptyInclude.emptyView.hide() notProcessedAdapter = OrderNotProcessedAdapter(requireContext(), dataBeans) - binding.notProcessedView.adapter = notProcessedAdapter + binding.recyclerView.adapter = notProcessedAdapter notProcessedAdapter.setOnItemClickListener(object : OrderNotProcessedAdapter.OnItemClickListener { override fun onClicked(position: Int) { diff --git a/app/src/main/java/com/casic/app/smartwell/greendao/DaoMaster.java b/app/src/main/java/com/casic/app/smartwell/greendao/DaoMaster.java index fdcf3a7..1e52b74 100644 --- a/app/src/main/java/com/casic/app/smartwell/greendao/DaoMaster.java +++ b/app/src/main/java/com/casic/app/smartwell/greendao/DaoMaster.java @@ -13,25 +13,20 @@ // THIS CODE IS GENERATED BY greenDAO, DO NOT EDIT. - /** * Master of DAO (schema version 4): knows all DAOs. */ public class DaoMaster extends AbstractDaoMaster { public static final int SCHEMA_VERSION = 4; - /** - * Creates underlying database table using DAOs. - */ + /** Creates underlying database table using DAOs. */ public static void createAllTables(Database db, boolean ifNotExists) { MapWellLocalBeanDao.createTable(db, ifNotExists); NoticeLocaleBeanDao.createTable(db, ifNotExists); PipeLocalBeanDao.createTable(db, ifNotExists); } - /** - * Drops underlying database table using DAOs. - */ + /** Drops underlying database table using DAOs. */ public static void dropAllTables(Database db, boolean ifExists) { MapWellLocalBeanDao.dropTable(db, ifExists); NoticeLocaleBeanDao.dropTable(db, ifExists); @@ -86,9 +81,7 @@ } } - /** - * WARNING: Drops all table on Upgrade! Use only during development. - */ + /** WARNING: Drops all table on Upgrade! Use only during development. */ public static class DevOpenHelper extends OpenHelper { public DevOpenHelper(Context context, String name) { super(context, name); diff --git a/app/src/main/java/com/casic/app/smartwell/greendao/DaoSession.java b/app/src/main/java/com/casic/app/smartwell/greendao/DaoSession.java index 0b36d17..3e40e3b 100644 --- a/app/src/main/java/com/casic/app/smartwell/greendao/DaoSession.java +++ b/app/src/main/java/com/casic/app/smartwell/greendao/DaoSession.java @@ -16,7 +16,7 @@ /** * {@inheritDoc} - * + * * @see org.greenrobot.greendao.AbstractDaoSession */ public class DaoSession extends AbstractDaoSession { @@ -50,7 +50,7 @@ registerDao(NoticeLocaleBean.class, noticeLocaleBeanDao); registerDao(PipeLocalBean.class, pipeLocalBeanDao); } - + public void clear() { mapWellLocalBeanDaoConfig.clearIdentityScope(); noticeLocaleBeanDaoConfig.clearIdentityScope(); diff --git a/app/src/main/java/com/casic/app/smartwell/greendao/MapWellLocalBeanDao.java b/app/src/main/java/com/casic/app/smartwell/greendao/MapWellLocalBeanDao.java index 8908fda..407bc92 100644 --- a/app/src/main/java/com/casic/app/smartwell/greendao/MapWellLocalBeanDao.java +++ b/app/src/main/java/com/casic/app/smartwell/greendao/MapWellLocalBeanDao.java @@ -12,10 +12,9 @@ import org.greenrobot.greendao.internal.DaoConfig; // THIS CODE IS GENERATED BY greenDAO, DO NOT EDIT. - -/** +/** * DAO for table "MAP_WELL_LOCAL_BEAN". - */ +*/ public class MapWellLocalBeanDao extends AbstractDao { public static final String TABLENAME = "MAP_WELL_LOCAL_BEAN"; @@ -57,16 +56,14 @@ public MapWellLocalBeanDao(DaoConfig config) { super(config); } - + public MapWellLocalBeanDao(DaoConfig config, DaoSession daoSession) { super(config, daoSession); } - /** - * Creates the underlying database table. - */ + /** Creates the underlying database table. */ public static void createTable(Database db, boolean ifNotExists) { - String constraint = ifNotExists ? "IF NOT EXISTS " : ""; + String constraint = ifNotExists? "IF NOT EXISTS ": ""; db.execSQL("CREATE TABLE " + constraint + "\"MAP_WELL_LOCAL_BEAN\" (" + // "\"_id\" INTEGER PRIMARY KEY AUTOINCREMENT ," + // 0: kId "\"AREA\" TEXT," + // 1: area @@ -96,9 +93,7 @@ "\"WELL_TYPE_NAME\" TEXT);"); // 25: wellTypeName } - /** - * Drops the underlying database table. - */ + /** Drops the underlying database table. */ public static void dropTable(Database db, boolean ifExists) { String sql = "DROP TABLE " + (ifExists ? "IF EXISTS " : "") + "\"MAP_WELL_LOCAL_BEAN\""; db.execSQL(sql); @@ -107,132 +102,132 @@ @Override protected final void bindValues(DatabaseStatement stmt, MapWellLocalBean entity) { stmt.clearBindings(); - + Long kId = entity.getKId(); if (kId != null) { stmt.bindLong(1, kId); } - + String area = entity.getArea(); if (area != null) { stmt.bindString(2, area); } - + String bfzt = entity.getBfzt(); if (bfzt != null) { stmt.bindString(3, bfzt); } - + String bfztName = entity.getBfztName(); if (bfztName != null) { stmt.bindString(4, bfztName); } - + String coordinateX = entity.getCoordinateX(); if (coordinateX != null) { stmt.bindString(5, coordinateX); } - + String coordinateY = entity.getCoordinateY(); if (coordinateY != null) { stmt.bindString(6, coordinateY); } - + String deep = entity.getDeep(); if (deep != null) { stmt.bindString(7, deep); } - + String deptName = entity.getDeptName(); if (deptName != null) { stmt.bindString(8, deptName); } - + String deptid = entity.getDeptid(); if (deptid != null) { stmt.bindString(9, deptid); } - + String id = entity.getId(); if (id != null) { stmt.bindString(10, id); } - + String latBaidu = entity.getLatBaidu(); if (latBaidu != null) { stmt.bindString(11, latBaidu); } - + String latGaode = entity.getLatGaode(); if (latGaode != null) { stmt.bindString(12, latGaode); } - + String lngBaidu = entity.getLngBaidu(); if (lngBaidu != null) { stmt.bindString(13, lngBaidu); } - + String lngGaode = entity.getLngGaode(); if (lngGaode != null) { stmt.bindString(14, lngGaode); } - + String notes = entity.getNotes(); if (notes != null) { stmt.bindString(15, notes); } - + String photos = entity.getPhotos(); if (photos != null) { stmt.bindString(16, photos); } - + String position = entity.getPosition(); if (position != null) { stmt.bindString(17, position); } - + String staff = entity.getStaff(); if (staff != null) { stmt.bindString(18, staff); } - + String tel = entity.getTel(); if (tel != null) { stmt.bindString(19, tel); } - + String ts = entity.getTs(); if (ts != null) { stmt.bindString(20, ts); } - + String valid = entity.getValid(); if (valid != null) { stmt.bindString(21, valid); } - + String watchData = entity.getWatchData(); if (watchData != null) { stmt.bindString(22, watchData); } - + String wellCode = entity.getWellCode(); if (wellCode != null) { stmt.bindString(23, wellCode); } - + String wellName = entity.getWellName(); if (wellName != null) { stmt.bindString(24, wellName); } - + String wellType = entity.getWellType(); if (wellType != null) { stmt.bindString(25, wellType); } - + String wellTypeName = entity.getWellTypeName(); if (wellTypeName != null) { stmt.bindString(26, wellTypeName); @@ -242,132 +237,132 @@ @Override protected final void bindValues(SQLiteStatement stmt, MapWellLocalBean entity) { stmt.clearBindings(); - + Long kId = entity.getKId(); if (kId != null) { stmt.bindLong(1, kId); } - + String area = entity.getArea(); if (area != null) { stmt.bindString(2, area); } - + String bfzt = entity.getBfzt(); if (bfzt != null) { stmt.bindString(3, bfzt); } - + String bfztName = entity.getBfztName(); if (bfztName != null) { stmt.bindString(4, bfztName); } - + String coordinateX = entity.getCoordinateX(); if (coordinateX != null) { stmt.bindString(5, coordinateX); } - + String coordinateY = entity.getCoordinateY(); if (coordinateY != null) { stmt.bindString(6, coordinateY); } - + String deep = entity.getDeep(); if (deep != null) { stmt.bindString(7, deep); } - + String deptName = entity.getDeptName(); if (deptName != null) { stmt.bindString(8, deptName); } - + String deptid = entity.getDeptid(); if (deptid != null) { stmt.bindString(9, deptid); } - + String id = entity.getId(); if (id != null) { stmt.bindString(10, id); } - + String latBaidu = entity.getLatBaidu(); if (latBaidu != null) { stmt.bindString(11, latBaidu); } - + String latGaode = entity.getLatGaode(); if (latGaode != null) { stmt.bindString(12, latGaode); } - + String lngBaidu = entity.getLngBaidu(); if (lngBaidu != null) { stmt.bindString(13, lngBaidu); } - + String lngGaode = entity.getLngGaode(); if (lngGaode != null) { stmt.bindString(14, lngGaode); } - + String notes = entity.getNotes(); if (notes != null) { stmt.bindString(15, notes); } - + String photos = entity.getPhotos(); if (photos != null) { stmt.bindString(16, photos); } - + String position = entity.getPosition(); if (position != null) { stmt.bindString(17, position); } - + String staff = entity.getStaff(); if (staff != null) { stmt.bindString(18, staff); } - + String tel = entity.getTel(); if (tel != null) { stmt.bindString(19, tel); } - + String ts = entity.getTs(); if (ts != null) { stmt.bindString(20, ts); } - + String valid = entity.getValid(); if (valid != null) { stmt.bindString(21, valid); } - + String watchData = entity.getWatchData(); if (watchData != null) { stmt.bindString(22, watchData); } - + String wellCode = entity.getWellCode(); if (wellCode != null) { stmt.bindString(23, wellCode); } - + String wellName = entity.getWellName(); if (wellName != null) { stmt.bindString(24, wellName); } - + String wellType = entity.getWellType(); if (wellType != null) { stmt.bindString(25, wellType); } - + String wellTypeName = entity.getWellTypeName(); if (wellTypeName != null) { stmt.bindString(26, wellTypeName); @@ -377,41 +372,41 @@ @Override public Long readKey(Cursor cursor, int offset) { return cursor.isNull(offset + 0) ? null : cursor.getLong(offset + 0); - } + } @Override public MapWellLocalBean readEntity(Cursor cursor, int offset) { MapWellLocalBean entity = new MapWellLocalBean( // - cursor.isNull(offset + 0) ? null : cursor.getLong(offset + 0), // kId - cursor.isNull(offset + 1) ? null : cursor.getString(offset + 1), // area - cursor.isNull(offset + 2) ? null : cursor.getString(offset + 2), // bfzt - cursor.isNull(offset + 3) ? null : cursor.getString(offset + 3), // bfztName - cursor.isNull(offset + 4) ? null : cursor.getString(offset + 4), // coordinateX - cursor.isNull(offset + 5) ? null : cursor.getString(offset + 5), // coordinateY - cursor.isNull(offset + 6) ? null : cursor.getString(offset + 6), // deep - cursor.isNull(offset + 7) ? null : cursor.getString(offset + 7), // deptName - cursor.isNull(offset + 8) ? null : cursor.getString(offset + 8), // deptid - cursor.isNull(offset + 9) ? null : cursor.getString(offset + 9), // id - cursor.isNull(offset + 10) ? null : cursor.getString(offset + 10), // latBaidu - cursor.isNull(offset + 11) ? null : cursor.getString(offset + 11), // latGaode - cursor.isNull(offset + 12) ? null : cursor.getString(offset + 12), // lngBaidu - cursor.isNull(offset + 13) ? null : cursor.getString(offset + 13), // lngGaode - cursor.isNull(offset + 14) ? null : cursor.getString(offset + 14), // notes - cursor.isNull(offset + 15) ? null : cursor.getString(offset + 15), // photos - cursor.isNull(offset + 16) ? null : cursor.getString(offset + 16), // position - cursor.isNull(offset + 17) ? null : cursor.getString(offset + 17), // staff - cursor.isNull(offset + 18) ? null : cursor.getString(offset + 18), // tel - cursor.isNull(offset + 19) ? null : cursor.getString(offset + 19), // ts - cursor.isNull(offset + 20) ? null : cursor.getString(offset + 20), // valid - cursor.isNull(offset + 21) ? null : cursor.getString(offset + 21), // watchData - cursor.isNull(offset + 22) ? null : cursor.getString(offset + 22), // wellCode - cursor.isNull(offset + 23) ? null : cursor.getString(offset + 23), // wellName - cursor.isNull(offset + 24) ? null : cursor.getString(offset + 24), // wellType - cursor.isNull(offset + 25) ? null : cursor.getString(offset + 25) // wellTypeName + cursor.isNull(offset + 0) ? null : cursor.getLong(offset + 0), // kId + cursor.isNull(offset + 1) ? null : cursor.getString(offset + 1), // area + cursor.isNull(offset + 2) ? null : cursor.getString(offset + 2), // bfzt + cursor.isNull(offset + 3) ? null : cursor.getString(offset + 3), // bfztName + cursor.isNull(offset + 4) ? null : cursor.getString(offset + 4), // coordinateX + cursor.isNull(offset + 5) ? null : cursor.getString(offset + 5), // coordinateY + cursor.isNull(offset + 6) ? null : cursor.getString(offset + 6), // deep + cursor.isNull(offset + 7) ? null : cursor.getString(offset + 7), // deptName + cursor.isNull(offset + 8) ? null : cursor.getString(offset + 8), // deptid + cursor.isNull(offset + 9) ? null : cursor.getString(offset + 9), // id + cursor.isNull(offset + 10) ? null : cursor.getString(offset + 10), // latBaidu + cursor.isNull(offset + 11) ? null : cursor.getString(offset + 11), // latGaode + cursor.isNull(offset + 12) ? null : cursor.getString(offset + 12), // lngBaidu + cursor.isNull(offset + 13) ? null : cursor.getString(offset + 13), // lngGaode + cursor.isNull(offset + 14) ? null : cursor.getString(offset + 14), // notes + cursor.isNull(offset + 15) ? null : cursor.getString(offset + 15), // photos + cursor.isNull(offset + 16) ? null : cursor.getString(offset + 16), // position + cursor.isNull(offset + 17) ? null : cursor.getString(offset + 17), // staff + cursor.isNull(offset + 18) ? null : cursor.getString(offset + 18), // tel + cursor.isNull(offset + 19) ? null : cursor.getString(offset + 19), // ts + cursor.isNull(offset + 20) ? null : cursor.getString(offset + 20), // valid + cursor.isNull(offset + 21) ? null : cursor.getString(offset + 21), // watchData + cursor.isNull(offset + 22) ? null : cursor.getString(offset + 22), // wellCode + cursor.isNull(offset + 23) ? null : cursor.getString(offset + 23), // wellName + cursor.isNull(offset + 24) ? null : cursor.getString(offset + 24), // wellType + cursor.isNull(offset + 25) ? null : cursor.getString(offset + 25) // wellTypeName ); return entity; } - + @Override public void readEntity(Cursor cursor, MapWellLocalBean entity, int offset) { entity.setKId(cursor.isNull(offset + 0) ? null : cursor.getLong(offset + 0)); @@ -440,17 +435,17 @@ entity.setWellName(cursor.isNull(offset + 23) ? null : cursor.getString(offset + 23)); entity.setWellType(cursor.isNull(offset + 24) ? null : cursor.getString(offset + 24)); entity.setWellTypeName(cursor.isNull(offset + 25) ? null : cursor.getString(offset + 25)); - } - + } + @Override protected final Long updateKeyAfterInsert(MapWellLocalBean entity, long rowId) { entity.setKId(rowId); return rowId; } - + @Override public Long getKey(MapWellLocalBean entity) { - if (entity != null) { + if(entity != null) { return entity.getKId(); } else { return null; @@ -466,5 +461,5 @@ protected final boolean isEntityUpdateable() { return true; } - + } diff --git a/app/src/main/java/com/casic/app/smartwell/greendao/NoticeLocaleBeanDao.java b/app/src/main/java/com/casic/app/smartwell/greendao/NoticeLocaleBeanDao.java index 64312ed..deb2d49 100644 --- a/app/src/main/java/com/casic/app/smartwell/greendao/NoticeLocaleBeanDao.java +++ b/app/src/main/java/com/casic/app/smartwell/greendao/NoticeLocaleBeanDao.java @@ -12,10 +12,9 @@ import org.greenrobot.greendao.internal.DaoConfig; // THIS CODE IS GENERATED BY greenDAO, DO NOT EDIT. - -/** +/** * DAO for table "NOTICE_LOCALE_BEAN". - */ +*/ public class NoticeLocaleBeanDao extends AbstractDao { public static final String TABLENAME = "NOTICE_LOCALE_BEAN"; @@ -43,16 +42,14 @@ public NoticeLocaleBeanDao(DaoConfig config) { super(config); } - + public NoticeLocaleBeanDao(DaoConfig config, DaoSession daoSession) { super(config, daoSession); } - /** - * Creates the underlying database table. - */ + /** Creates the underlying database table. */ public static void createTable(Database db, boolean ifNotExists) { - String constraint = ifNotExists ? "IF NOT EXISTS " : ""; + String constraint = ifNotExists? "IF NOT EXISTS ": ""; db.execSQL("CREATE TABLE " + constraint + "\"NOTICE_LOCALE_BEAN\" (" + // "\"_id\" INTEGER PRIMARY KEY AUTOINCREMENT ," + // 0: id "\"MESSAGE_ID\" TEXT UNIQUE ," + // 1: messageId @@ -68,9 +65,7 @@ "\"NOTICE_TIME\" TEXT);"); // 11: noticeTime } - /** - * Drops the underlying database table. - */ + /** Drops the underlying database table. */ public static void dropTable(Database db, boolean ifExists) { String sql = "DROP TABLE " + (ifExists ? "IF EXISTS " : "") + "\"NOTICE_LOCALE_BEAN\""; db.execSQL(sql); @@ -79,62 +74,62 @@ @Override protected final void bindValues(DatabaseStatement stmt, NoticeLocaleBean entity) { stmt.clearBindings(); - + Long id = entity.getId(); if (id != null) { stmt.bindLong(1, id); } - + String messageId = entity.getMessageId(); if (messageId != null) { stmt.bindString(2, messageId); } - + String appid = entity.getAppid(); if (appid != null) { stmt.bindString(3, appid); } - + String clientId = entity.getClientId(); if (clientId != null) { stmt.bindString(4, clientId); } - + String taskId = entity.getTaskId(); if (taskId != null) { stmt.bindString(5, taskId); } - + String userId = entity.getUserId(); if (userId != null) { stmt.bindString(6, userId); } - + String title = entity.getTitle(); if (title != null) { stmt.bindString(7, title); } - + String content = entity.getContent(); if (content != null) { stmt.bindString(8, content); } - + String deviceCode = entity.getDeviceCode(); if (deviceCode != null) { stmt.bindString(9, deviceCode); } - + String jobId = entity.getJobId(); if (jobId != null) { stmt.bindString(10, jobId); } - + String isRead = entity.getIsRead(); if (isRead != null) { stmt.bindString(11, isRead); } - + String noticeTime = entity.getNoticeTime(); if (noticeTime != null) { stmt.bindString(12, noticeTime); @@ -144,62 +139,62 @@ @Override protected final void bindValues(SQLiteStatement stmt, NoticeLocaleBean entity) { stmt.clearBindings(); - + Long id = entity.getId(); if (id != null) { stmt.bindLong(1, id); } - + String messageId = entity.getMessageId(); if (messageId != null) { stmt.bindString(2, messageId); } - + String appid = entity.getAppid(); if (appid != null) { stmt.bindString(3, appid); } - + String clientId = entity.getClientId(); if (clientId != null) { stmt.bindString(4, clientId); } - + String taskId = entity.getTaskId(); if (taskId != null) { stmt.bindString(5, taskId); } - + String userId = entity.getUserId(); if (userId != null) { stmt.bindString(6, userId); } - + String title = entity.getTitle(); if (title != null) { stmt.bindString(7, title); } - + String content = entity.getContent(); if (content != null) { stmt.bindString(8, content); } - + String deviceCode = entity.getDeviceCode(); if (deviceCode != null) { stmt.bindString(9, deviceCode); } - + String jobId = entity.getJobId(); if (jobId != null) { stmt.bindString(10, jobId); } - + String isRead = entity.getIsRead(); if (isRead != null) { stmt.bindString(11, isRead); } - + String noticeTime = entity.getNoticeTime(); if (noticeTime != null) { stmt.bindString(12, noticeTime); @@ -209,27 +204,27 @@ @Override public Long readKey(Cursor cursor, int offset) { return cursor.isNull(offset + 0) ? null : cursor.getLong(offset + 0); - } + } @Override public NoticeLocaleBean readEntity(Cursor cursor, int offset) { NoticeLocaleBean entity = new NoticeLocaleBean( // - cursor.isNull(offset + 0) ? null : cursor.getLong(offset + 0), // id - cursor.isNull(offset + 1) ? null : cursor.getString(offset + 1), // messageId - cursor.isNull(offset + 2) ? null : cursor.getString(offset + 2), // appid - cursor.isNull(offset + 3) ? null : cursor.getString(offset + 3), // clientId - cursor.isNull(offset + 4) ? null : cursor.getString(offset + 4), // taskId - cursor.isNull(offset + 5) ? null : cursor.getString(offset + 5), // userId - cursor.isNull(offset + 6) ? null : cursor.getString(offset + 6), // title - cursor.isNull(offset + 7) ? null : cursor.getString(offset + 7), // content - cursor.isNull(offset + 8) ? null : cursor.getString(offset + 8), // deviceCode - cursor.isNull(offset + 9) ? null : cursor.getString(offset + 9), // jobId - cursor.isNull(offset + 10) ? null : cursor.getString(offset + 10), // isRead - cursor.isNull(offset + 11) ? null : cursor.getString(offset + 11) // noticeTime + cursor.isNull(offset + 0) ? null : cursor.getLong(offset + 0), // id + cursor.isNull(offset + 1) ? null : cursor.getString(offset + 1), // messageId + cursor.isNull(offset + 2) ? null : cursor.getString(offset + 2), // appid + cursor.isNull(offset + 3) ? null : cursor.getString(offset + 3), // clientId + cursor.isNull(offset + 4) ? null : cursor.getString(offset + 4), // taskId + cursor.isNull(offset + 5) ? null : cursor.getString(offset + 5), // userId + cursor.isNull(offset + 6) ? null : cursor.getString(offset + 6), // title + cursor.isNull(offset + 7) ? null : cursor.getString(offset + 7), // content + cursor.isNull(offset + 8) ? null : cursor.getString(offset + 8), // deviceCode + cursor.isNull(offset + 9) ? null : cursor.getString(offset + 9), // jobId + cursor.isNull(offset + 10) ? null : cursor.getString(offset + 10), // isRead + cursor.isNull(offset + 11) ? null : cursor.getString(offset + 11) // noticeTime ); return entity; } - + @Override public void readEntity(Cursor cursor, NoticeLocaleBean entity, int offset) { entity.setId(cursor.isNull(offset + 0) ? null : cursor.getLong(offset + 0)); @@ -244,17 +239,17 @@ entity.setJobId(cursor.isNull(offset + 9) ? null : cursor.getString(offset + 9)); entity.setIsRead(cursor.isNull(offset + 10) ? null : cursor.getString(offset + 10)); entity.setNoticeTime(cursor.isNull(offset + 11) ? null : cursor.getString(offset + 11)); - } - + } + @Override protected final Long updateKeyAfterInsert(NoticeLocaleBean entity, long rowId) { entity.setId(rowId); return rowId; } - + @Override public Long getKey(NoticeLocaleBean entity) { - if (entity != null) { + if(entity != null) { return entity.getId(); } else { return null; @@ -270,5 +265,5 @@ protected final boolean isEntityUpdateable() { return true; } - + } diff --git a/app/src/main/java/com/casic/app/smartwell/greendao/PipeLocalBeanDao.java b/app/src/main/java/com/casic/app/smartwell/greendao/PipeLocalBeanDao.java index aab4d3f..df5515a 100644 --- a/app/src/main/java/com/casic/app/smartwell/greendao/PipeLocalBeanDao.java +++ b/app/src/main/java/com/casic/app/smartwell/greendao/PipeLocalBeanDao.java @@ -12,10 +12,9 @@ import org.greenrobot.greendao.internal.DaoConfig; // THIS CODE IS GENERATED BY greenDAO, DO NOT EDIT. - -/** +/** * DAO for table "PIPE_LOCAL_BEAN". - */ +*/ public class PipeLocalBeanDao extends AbstractDao { public static final String TABLENAME = "PIPE_LOCAL_BEAN"; @@ -37,16 +36,14 @@ public PipeLocalBeanDao(DaoConfig config) { super(config); } - + public PipeLocalBeanDao(DaoConfig config, DaoSession daoSession) { super(config, daoSession); } - /** - * Creates the underlying database table. - */ + /** Creates the underlying database table. */ public static void createTable(Database db, boolean ifNotExists) { - String constraint = ifNotExists ? "IF NOT EXISTS " : ""; + String constraint = ifNotExists? "IF NOT EXISTS ": ""; db.execSQL("CREATE TABLE " + constraint + "\"PIPE_LOCAL_BEAN\" (" + // "\"_id\" INTEGER PRIMARY KEY AUTOINCREMENT ," + // 0: id "\"PIPE_CODE\" TEXT," + // 1: pipeCode @@ -56,9 +53,7 @@ "\"START_LONGITUDE_GD\" TEXT);"); // 5: startLongitudeGd } - /** - * Drops the underlying database table. - */ + /** Drops the underlying database table. */ public static void dropTable(Database db, boolean ifExists) { String sql = "DROP TABLE " + (ifExists ? "IF EXISTS " : "") + "\"PIPE_LOCAL_BEAN\""; db.execSQL(sql); @@ -67,32 +62,32 @@ @Override protected final void bindValues(DatabaseStatement stmt, PipeLocalBean entity) { stmt.clearBindings(); - + Long id = entity.getId(); if (id != null) { stmt.bindLong(1, id); } - + String pipeCode = entity.getPipeCode(); if (pipeCode != null) { stmt.bindString(2, pipeCode); } - + String endLatitudeGd = entity.getEndLatitudeGd(); if (endLatitudeGd != null) { stmt.bindString(3, endLatitudeGd); } - + String endLongitudeGd = entity.getEndLongitudeGd(); if (endLongitudeGd != null) { stmt.bindString(4, endLongitudeGd); } - + String startLatitudeGd = entity.getStartLatitudeGd(); if (startLatitudeGd != null) { stmt.bindString(5, startLatitudeGd); } - + String startLongitudeGd = entity.getStartLongitudeGd(); if (startLongitudeGd != null) { stmt.bindString(6, startLongitudeGd); @@ -102,32 +97,32 @@ @Override protected final void bindValues(SQLiteStatement stmt, PipeLocalBean entity) { stmt.clearBindings(); - + Long id = entity.getId(); if (id != null) { stmt.bindLong(1, id); } - + String pipeCode = entity.getPipeCode(); if (pipeCode != null) { stmt.bindString(2, pipeCode); } - + String endLatitudeGd = entity.getEndLatitudeGd(); if (endLatitudeGd != null) { stmt.bindString(3, endLatitudeGd); } - + String endLongitudeGd = entity.getEndLongitudeGd(); if (endLongitudeGd != null) { stmt.bindString(4, endLongitudeGd); } - + String startLatitudeGd = entity.getStartLatitudeGd(); if (startLatitudeGd != null) { stmt.bindString(5, startLatitudeGd); } - + String startLongitudeGd = entity.getStartLongitudeGd(); if (startLongitudeGd != null) { stmt.bindString(6, startLongitudeGd); @@ -137,21 +132,21 @@ @Override public Long readKey(Cursor cursor, int offset) { return cursor.isNull(offset + 0) ? null : cursor.getLong(offset + 0); - } + } @Override public PipeLocalBean readEntity(Cursor cursor, int offset) { PipeLocalBean entity = new PipeLocalBean( // - cursor.isNull(offset + 0) ? null : cursor.getLong(offset + 0), // id - cursor.isNull(offset + 1) ? null : cursor.getString(offset + 1), // pipeCode - cursor.isNull(offset + 2) ? null : cursor.getString(offset + 2), // endLatitudeGd - cursor.isNull(offset + 3) ? null : cursor.getString(offset + 3), // endLongitudeGd - cursor.isNull(offset + 4) ? null : cursor.getString(offset + 4), // startLatitudeGd - cursor.isNull(offset + 5) ? null : cursor.getString(offset + 5) // startLongitudeGd + cursor.isNull(offset + 0) ? null : cursor.getLong(offset + 0), // id + cursor.isNull(offset + 1) ? null : cursor.getString(offset + 1), // pipeCode + cursor.isNull(offset + 2) ? null : cursor.getString(offset + 2), // endLatitudeGd + cursor.isNull(offset + 3) ? null : cursor.getString(offset + 3), // endLongitudeGd + cursor.isNull(offset + 4) ? null : cursor.getString(offset + 4), // startLatitudeGd + cursor.isNull(offset + 5) ? null : cursor.getString(offset + 5) // startLongitudeGd ); return entity; } - + @Override public void readEntity(Cursor cursor, PipeLocalBean entity, int offset) { entity.setId(cursor.isNull(offset + 0) ? null : cursor.getLong(offset + 0)); @@ -160,17 +155,17 @@ entity.setEndLongitudeGd(cursor.isNull(offset + 3) ? null : cursor.getString(offset + 3)); entity.setStartLatitudeGd(cursor.isNull(offset + 4) ? null : cursor.getString(offset + 4)); entity.setStartLongitudeGd(cursor.isNull(offset + 5) ? null : cursor.getString(offset + 5)); - } - + } + @Override protected final Long updateKeyAfterInsert(PipeLocalBean entity, long rowId) { entity.setId(rowId); return rowId; } - + @Override public Long getKey(PipeLocalBean entity) { - if (entity != null) { + if(entity != null) { return entity.getId(); } else { return null; @@ -186,5 +181,5 @@ protected final boolean isEntityUpdateable() { return true; } - + } diff --git a/app/src/main/java/com/casic/app/smartwell/view/ChangePasswordActivity.kt b/app/src/main/java/com/casic/app/smartwell/view/ChangePasswordActivity.kt index 8e41039..9f1dd40 100644 --- a/app/src/main/java/com/casic/app/smartwell/view/ChangePasswordActivity.kt +++ b/app/src/main/java/com/casic/app/smartwell/view/ChangePasswordActivity.kt @@ -14,7 +14,7 @@ import com.pengxh.kt.lite.extensions.show import com.pengxh.kt.lite.utils.ActivityStackManager import com.pengxh.kt.lite.utils.LoadState -import com.pengxh.kt.lite.utils.LoadingDialogHub +import com.pengxh.kt.lite.utils.LoadingDialog import com.pengxh.kt.lite.widget.TitleBarView import java.nio.charset.StandardCharsets @@ -46,15 +46,15 @@ override fun observeRequestState() { userViewModel.loadState.observe(this) { when (it) { - is LoadState.Loading -> LoadingDialogHub.show(this, "修改中,请稍后") + is LoadState.Loading -> LoadingDialog.show(this, "修改中,请稍后") is LoadState.Success -> { - LoadingDialogHub.dismiss() + LoadingDialog.dismiss() AuthenticationHelper.removeToken() this.navigatePageTo() ActivityStackManager.finishAllActivity() } - else -> LoadingDialogHub.dismiss() + else -> LoadingDialog.dismiss() } } } diff --git a/app/src/main/java/com/casic/app/smartwell/view/DeployedWellActivity.kt b/app/src/main/java/com/casic/app/smartwell/view/DeployedWellActivity.kt index fb4339c..28a5078 100644 --- a/app/src/main/java/com/casic/app/smartwell/view/DeployedWellActivity.kt +++ b/app/src/main/java/com/casic/app/smartwell/view/DeployedWellActivity.kt @@ -83,8 +83,8 @@ } //添加分割线 - binding.deployedListView.addItemDecoration( - RecyclerViewItemOffsets(0, 5, 0, 5) + binding.recyclerView.addItemDecoration( + RecyclerViewItemOffsets(0, 7, 0, 7) ) } @@ -149,12 +149,11 @@ } else { item.deep.toString() + "m" } - viewHolder.setText(R.id.wellNameView, item.wellName) + viewHolder.setText(R.id.wellTypeView, item.wellTypeName) .setText(R.id.wellDepthView, "深:${deep}") .setText(R.id.wellCodeView, "点位编号:${item.wellCode}") - .setText(R.id.wellTypeView, "点位类型:${item.wellTypeName}") .setText(R.id.ownerShipView, "权属单位:${item.deptName}") - .setText(R.id.wellLocationView, "点位置:${item.position}") + .setText(R.id.wellLocationView, "点位位置:${item.position}") .setOnClickListener( R.id.operationButton, object : View.OnClickListener { override fun onClick(v: View?) { @@ -207,7 +206,7 @@ }) } } - binding.deployedListView.adapter = deployAdapter + binding.recyclerView.adapter = deployAdapter deployAdapter.setOnItemClickedListener(object : NormalRecyclerAdapter.OnItemClickedListener { override fun onItemClicked(position: Int, t: WellListModel.DataBean.RowsBean) { diff --git a/app/src/main/java/com/casic/app/smartwell/view/LoginActivity.kt b/app/src/main/java/com/casic/app/smartwell/view/LoginActivity.kt index e4bb0e3..834527b 100644 --- a/app/src/main/java/com/casic/app/smartwell/view/LoginActivity.kt +++ b/app/src/main/java/com/casic/app/smartwell/view/LoginActivity.kt @@ -21,7 +21,7 @@ import com.pengxh.kt.lite.extensions.navigatePageTo import com.pengxh.kt.lite.extensions.readAssetsFile import com.pengxh.kt.lite.extensions.show -import com.pengxh.kt.lite.utils.LoadingDialogHub +import com.pengxh.kt.lite.utils.LoadingDialog import com.pengxh.kt.lite.utils.SaveKeyValues import kotlinx.coroutines.Dispatchers import kotlinx.coroutines.launch @@ -106,11 +106,11 @@ override fun observeRequestState() { authenticateViewModel.loadState.observe(this) { - LoadingDialogHub.show(this, "登录中,请稍后") + LoadingDialog.show(this, "登录中,请稍后") } loginViewModel.loadState.observe(this) { - LoadingDialogHub.dismiss() + LoadingDialog.dismiss() } } diff --git a/app/src/main/java/com/casic/app/smartwell/view/OrderCompletedDetailActivity.kt b/app/src/main/java/com/casic/app/smartwell/view/OrderCompletedDetailActivity.kt index db8ad1f..75cd905 100644 --- a/app/src/main/java/com/casic/app/smartwell/view/OrderCompletedDetailActivity.kt +++ b/app/src/main/java/com/casic/app/smartwell/view/OrderCompletedDetailActivity.kt @@ -17,7 +17,7 @@ import com.pengxh.kt.lite.extensions.show import com.pengxh.kt.lite.utils.Constant import com.pengxh.kt.lite.utils.LoadState -import com.pengxh.kt.lite.utils.LoadingDialogHub +import com.pengxh.kt.lite.utils.LoadingDialog import com.pengxh.kt.lite.widget.TitleBarView import com.pengxh.kt.lite.widget.dialog.AlertMessageDialog @@ -44,7 +44,7 @@ } override fun initOnCreate(savedInstanceState: Bundle?) { - val jobId = intent.getStringExtra(Constant.INTENT_PARAM)!! + val jobId = intent.getStringExtra(Constant.INTENT_PARAM_KEY)!! orderViewModel = ViewModelProvider(this)[OrderViewModel::class.java] orderViewModel.getWorkOrderDetail(jobId) orderViewModel.detailModel.observe(this) { @@ -154,8 +154,8 @@ override fun observeRequestState() { orderViewModel.loadState.observe(this) { when (it) { - is LoadState.Loading -> LoadingDialogHub.show(this, "数据加载中,请稍后") - else -> LoadingDialogHub.dismiss() + is LoadState.Loading -> LoadingDialog.show(this, "数据加载中,请稍后") + else -> LoadingDialog.dismiss() } } } diff --git a/app/src/main/java/com/casic/app/smartwell/view/OrderInHandleDetailActivity.kt b/app/src/main/java/com/casic/app/smartwell/view/OrderInHandleDetailActivity.kt index d70a979..04a7d5d 100644 --- a/app/src/main/java/com/casic/app/smartwell/view/OrderInHandleDetailActivity.kt +++ b/app/src/main/java/com/casic/app/smartwell/view/OrderInHandleDetailActivity.kt @@ -38,7 +38,7 @@ import com.pengxh.kt.lite.extensions.show import com.pengxh.kt.lite.utils.Constant import com.pengxh.kt.lite.utils.LoadState -import com.pengxh.kt.lite.utils.LoadingDialogHub +import com.pengxh.kt.lite.utils.LoadingDialog import com.pengxh.kt.lite.widget.TitleBarView import com.pengxh.kt.lite.widget.dialog.AlertControlDialog import com.pengxh.kt.lite.widget.dialog.AlertMessageDialog @@ -93,7 +93,7 @@ ) binding.addImageRecyclerView.adapter = imageAdapter - val jobId = intent.getStringExtra(Constant.INTENT_PARAM)!!//初始化图片九宫格 + val jobId = intent.getStringExtra(Constant.INTENT_PARAM_KEY)!!//初始化图片九宫格 orderViewModel.getWorkOrderDetail(jobId) orderViewModel.detailModel.observe(this) { if (it.code == 200) { @@ -312,41 +312,41 @@ override fun observeRequestState() { orderViewModel.loadState.observe(this) { when (it) { - is LoadState.Loading -> LoadingDialogHub.show(this, "数据加载中,请稍后") - else -> LoadingDialogHub.dismiss() + is LoadState.Loading -> LoadingDialog.show(this, "数据加载中,请稍后") + else -> LoadingDialog.dismiss() } } uploadImageViewModel.loadState.observe(this) { when (it) { - LoadState.Loading -> LoadingDialogHub.show(this, "图片上传中,请稍后...") - else -> LoadingDialogHub.dismiss() + LoadState.Loading -> LoadingDialog.show(this, "图片上传中,请稍后...") + else -> LoadingDialog.dismiss() } } //转单状态处理 operationViewModel.loadState.observe(this) { when (it) { - is LoadState.Loading -> LoadingDialogHub.show(this, "转单中,请稍后") + is LoadState.Loading -> LoadingDialog.show(this, "转单中,请稍后") is LoadState.Success -> { - LoadingDialogHub.dismiss() + LoadingDialog.dismiss() this.finish() } - else -> LoadingDialogHub.dismiss() + else -> LoadingDialog.dismiss() } } //处理完成工单状态处理 operationViewModel.loadState.observe(this) { when (it) { - is LoadState.Loading -> LoadingDialogHub.show(this, "处理中,请稍后") + is LoadState.Loading -> LoadingDialog.show(this, "处理中,请稍后") is LoadState.Success -> { - LoadingDialogHub.dismiss() + LoadingDialog.dismiss() this.finish() } - else -> LoadingDialogHub.dismiss() + else -> LoadingDialog.dismiss() } } } diff --git a/app/src/main/java/com/casic/app/smartwell/view/OrderNotConfirmedDetailActivity.kt b/app/src/main/java/com/casic/app/smartwell/view/OrderNotConfirmedDetailActivity.kt index 8e036d2..687ec86 100644 --- a/app/src/main/java/com/casic/app/smartwell/view/OrderNotConfirmedDetailActivity.kt +++ b/app/src/main/java/com/casic/app/smartwell/view/OrderNotConfirmedDetailActivity.kt @@ -36,7 +36,7 @@ import com.pengxh.kt.lite.extensions.show import com.pengxh.kt.lite.utils.Constant import com.pengxh.kt.lite.utils.LoadState -import com.pengxh.kt.lite.utils.LoadingDialogHub +import com.pengxh.kt.lite.utils.LoadingDialog import com.pengxh.kt.lite.widget.TitleBarView import com.pengxh.kt.lite.widget.dialog.AlertControlDialog import com.pengxh.kt.lite.widget.dialog.AlertMessageDialog @@ -80,7 +80,7 @@ } override fun initOnCreate(savedInstanceState: Bundle?) { - val jobId = intent.getStringExtra(Constant.INTENT_PARAM)!! + val jobId = intent.getStringExtra(Constant.INTENT_PARAM_KEY)!! //初始化图片九宫格 //左外边距,左内边距,右内边距,右外边距 val viewWidth = getScreenWidth() - (10 + 10 + 10 + 10).dp2px(this) @@ -263,41 +263,41 @@ //数据加载状态处理 orderViewModel.loadState.observe(this) { when (it) { - is LoadState.Loading -> LoadingDialogHub.show(this, "数据加载中,请稍后") - else -> LoadingDialogHub.dismiss() + is LoadState.Loading -> LoadingDialog.show(this, "数据加载中,请稍后") + else -> LoadingDialog.dismiss() } } uploadImageViewModel.loadState.observe(this) { when (it) { - LoadState.Loading -> LoadingDialogHub.show(this, "图片上传中,请稍后") - else -> LoadingDialogHub.dismiss() + LoadState.Loading -> LoadingDialog.show(this, "图片上传中,请稍后") + else -> LoadingDialog.dismiss() } } //转单状态处理 operationViewModel.loadState.observe(this) { when (it) { - is LoadState.Loading -> LoadingDialogHub.show(this, "转单中,请稍后") + is LoadState.Loading -> LoadingDialog.show(this, "转单中,请稍后") is LoadState.Success -> { - LoadingDialogHub.dismiss() + LoadingDialog.dismiss() this.finish() } - else -> LoadingDialogHub.dismiss() + else -> LoadingDialog.dismiss() } } //确认工单状态处理 operationViewModel.loadState.observe(this) { when (it) { - is LoadState.Loading -> LoadingDialogHub.show(this, "处理中,请稍后") + is LoadState.Loading -> LoadingDialog.show(this, "处理中,请稍后") is LoadState.Success -> { - LoadingDialogHub.dismiss() + LoadingDialog.dismiss() this.finish() } - else -> LoadingDialogHub.dismiss() + else -> LoadingDialog.dismiss() } } } diff --git a/app/src/main/java/com/casic/app/smartwell/view/OrderNotProcessedDetailActivity.kt b/app/src/main/java/com/casic/app/smartwell/view/OrderNotProcessedDetailActivity.kt index d3f22dc..0c97a52 100644 --- a/app/src/main/java/com/casic/app/smartwell/view/OrderNotProcessedDetailActivity.kt +++ b/app/src/main/java/com/casic/app/smartwell/view/OrderNotProcessedDetailActivity.kt @@ -18,7 +18,7 @@ import com.pengxh.kt.lite.extensions.show import com.pengxh.kt.lite.utils.Constant import com.pengxh.kt.lite.utils.LoadState -import com.pengxh.kt.lite.utils.LoadingDialogHub +import com.pengxh.kt.lite.utils.LoadingDialog import com.pengxh.kt.lite.widget.TitleBarView import com.pengxh.kt.lite.widget.dialog.AlertControlDialog import com.pengxh.kt.lite.widget.dialog.AlertMessageDialog @@ -50,7 +50,7 @@ } override fun initOnCreate(savedInstanceState: Bundle?) { - this.jobId = intent.getStringExtra(Constant.INTENT_PARAM)!! + this.jobId = intent.getStringExtra(Constant.INTENT_PARAM_KEY)!! orderViewModel = ViewModelProvider(this)[OrderViewModel::class.java] operationViewModel = ViewModelProvider(this)[OperationViewModel::class.java] wellViewModel = ViewModelProvider(this)[WellViewModel::class.java] @@ -162,21 +162,21 @@ //数据加载状态处理 orderViewModel.loadState.observe(this) { when (it) { - is LoadState.Loading -> LoadingDialogHub.show(this, "数据加载中,请稍后") - else -> LoadingDialogHub.dismiss() + is LoadState.Loading -> LoadingDialog.show(this, "数据加载中,请稍后") + else -> LoadingDialog.dismiss() } } //接单状态处理 operationViewModel.loadState.observe(this) { when (it) { - is LoadState.Loading -> LoadingDialogHub.show(this, "接单中,请稍后") + is LoadState.Loading -> LoadingDialog.show(this, "接单中,请稍后") is LoadState.Success -> { - LoadingDialogHub.dismiss() + LoadingDialog.dismiss() this.finish() } - else -> LoadingDialogHub.dismiss() + else -> LoadingDialog.dismiss() } } } diff --git a/app/src/main/java/com/casic/app/smartwell/view/SearchResultActivity.kt b/app/src/main/java/com/casic/app/smartwell/view/SearchResultActivity.kt index 6a92917..4f3a674 100644 --- a/app/src/main/java/com/casic/app/smartwell/view/SearchResultActivity.kt +++ b/app/src/main/java/com/casic/app/smartwell/view/SearchResultActivity.kt @@ -19,7 +19,7 @@ import com.pengxh.kt.lite.extensions.show import com.pengxh.kt.lite.utils.Constant import com.pengxh.kt.lite.utils.LoadState -import com.pengxh.kt.lite.utils.LoadingDialogHub +import com.pengxh.kt.lite.utils.LoadingDialog import com.pengxh.kt.lite.utils.WeakReferenceHandler import com.pengxh.kt.lite.widget.TitleBarView import com.pengxh.kt.lite.widget.dialog.AlertControlDialog @@ -56,7 +56,7 @@ } override fun initOnCreate(savedInstanceState: Bundle?) { - args = intent.getStringArrayListExtra(Constant.INTENT_PARAM)!! + args = intent.getStringArrayListExtra(Constant.INTENT_PARAM_KEY)!! orderViewModel = ViewModelProvider(this)[OrderViewModel::class.java] operationViewModel = ViewModelProvider(this)[OperationViewModel::class.java] @@ -101,24 +101,24 @@ } } - binding.resultRecyclerView.addItemDecoration( - RecyclerViewItemOffsets(0, 5, 0, 5) + binding.recyclerView.addItemDecoration( + RecyclerViewItemOffsets(0, 7, 0, 7) ) } override fun observeRequestState() { orderViewModel.loadState.observe(this) { when (it) { - is LoadState.Loading -> LoadingDialogHub.show(this, "数据加载中,请稍后") - else -> LoadingDialogHub.dismiss() + is LoadState.Loading -> LoadingDialog.show(this, "数据加载中,请稍后") + else -> LoadingDialog.dismiss() } } //接单状态处理 operationViewModel.loadState.observe(this) { when (it) { - is LoadState.Loading -> LoadingDialogHub.show(this, "接单中,请稍后") + is LoadState.Loading -> LoadingDialog.show(this, "接单中,请稍后") is LoadState.Success -> { - LoadingDialogHub.dismiss() + LoadingDialog.dismiss() //接单成功之后刷新列表 dataBeans.removeAt(clickedPosition) searchResultAdapter.notifyItemRemoved(clickedPosition) @@ -127,7 +127,7 @@ ) } - else -> LoadingDialogHub.dismiss() + else -> LoadingDialog.dismiss() } } } @@ -162,7 +162,7 @@ } else { binding.emptyInclude.emptyView.hide() searchResultAdapter = SearchResultAdapter(this, dataBeans) - binding.resultRecyclerView.adapter = searchResultAdapter + binding.recyclerView.adapter = searchResultAdapter searchResultAdapter.setOnItemClickListener(object : SearchResultAdapter.OnItemClickListener { override fun onClicked(position: Int) { diff --git a/app/src/main/java/com/casic/app/smartwell/view/UnDeployWellActivity.kt b/app/src/main/java/com/casic/app/smartwell/view/UnDeployWellActivity.kt index 7f7cd3c..555c278 100644 --- a/app/src/main/java/com/casic/app/smartwell/view/UnDeployWellActivity.kt +++ b/app/src/main/java/com/casic/app/smartwell/view/UnDeployWellActivity.kt @@ -81,8 +81,8 @@ } } - binding.undeployListView.addItemDecoration( - RecyclerViewItemOffsets(0, 5, 0, 5) + binding.recyclerView.addItemDecoration( + RecyclerViewItemOffsets(0, 7, 0, 7) ) } @@ -147,12 +147,11 @@ } else { item.deep.toString() + "m" } - viewHolder.setText(R.id.wellNameView, item.wellName) + viewHolder.setText(R.id.wellTypeView, item.wellTypeName) .setText(R.id.wellDepthView, "深:${deep}") .setText(R.id.wellCodeView, "点位编号:${item.wellCode}") - .setText(R.id.wellTypeView, "点位类型:${item.wellTypeName}") .setText(R.id.ownerShipView, "权属单位:${item.deptName}") - .setText(R.id.wellLocationView, "点位置:${item.position}") + .setText(R.id.wellLocationView, "点位位置:${item.position}") .setOnClickListener( R.id.operationButton, object : View.OnClickListener { override fun onClick(v: View?) { @@ -185,7 +184,7 @@ ) } } - binding.undeployListView.adapter = unDeployAdapter + binding.recyclerView.adapter = unDeployAdapter unDeployAdapter.setOnItemClickedListener(object : NormalRecyclerAdapter.OnItemClickedListener { override fun onItemClicked(position: Int, t: WellListModel.DataBean.RowsBean) { diff --git a/app/src/main/java/com/casic/app/smartwell/view/WellDetailActivity.kt b/app/src/main/java/com/casic/app/smartwell/view/WellDetailActivity.kt index b50d067..eb8b468 100644 --- a/app/src/main/java/com/casic/app/smartwell/view/WellDetailActivity.kt +++ b/app/src/main/java/com/casic/app/smartwell/view/WellDetailActivity.kt @@ -16,7 +16,7 @@ import com.pengxh.kt.lite.extensions.show import com.pengxh.kt.lite.utils.Constant import com.pengxh.kt.lite.utils.LoadState -import com.pengxh.kt.lite.utils.LoadingDialogHub +import com.pengxh.kt.lite.utils.LoadingDialog import com.pengxh.kt.lite.widget.TitleBarView import com.pengxh.kt.lite.widget.dialog.AlertMessageDialog @@ -44,7 +44,7 @@ } override fun initOnCreate(savedInstanceState: Bundle?) { - val wellId = intent.getStringExtra(Constant.INTENT_PARAM)!! + val wellId = intent.getStringExtra(Constant.INTENT_PARAM_KEY)!! wellViewModel = ViewModelProvider(this)[WellViewModel::class.java] wellViewModel.getWellDetail(wellId) wellViewModel.wellDetailModel.observe(this) { @@ -132,8 +132,8 @@ override fun observeRequestState() { wellViewModel.loadState.observe(this) { when (it) { - is LoadState.Loading -> LoadingDialogHub.show(this, "数据加载中,请稍后") - else -> LoadingDialogHub.dismiss() + is LoadState.Loading -> LoadingDialog.show(this, "数据加载中,请稍后") + else -> LoadingDialog.dismiss() } } } diff --git a/app/src/main/java/com/casic/app/smartwell/view/WellManagementActivity.kt b/app/src/main/java/com/casic/app/smartwell/view/WellManagementActivity.kt index 084da95..457096b 100644 --- a/app/src/main/java/com/casic/app/smartwell/view/WellManagementActivity.kt +++ b/app/src/main/java/com/casic/app/smartwell/view/WellManagementActivity.kt @@ -94,8 +94,8 @@ } } - binding.wellListView.addItemDecoration( - RecyclerViewItemOffsets(0, 5, 0, 5) + binding.recyclerView.addItemDecoration( + RecyclerViewItemOffsets(0, 7, 0, 7) ) } @@ -175,13 +175,12 @@ } else { item.deep.toString() + "m" } - viewHolder.setText(R.id.wellNameView, item.wellName) + viewHolder.setText(R.id.wellTypeView, item.wellTypeName) .setText(R.id.wellStateView, "已${item.bfztName}") .setText(R.id.wellDepthView, "深:${deep}") .setText(R.id.wellCodeView, "点位编号:${item.wellCode}") - .setText(R.id.wellTypeView, "点位类型:${item.wellTypeName}") .setText(R.id.ownerShipView, "权属单位:${item.deptName}") - .setText(R.id.wellLocationView, "点位置:${item.position}") + .setText(R.id.wellLocationView, "点位位置:${item.position}") .setOnClickListener( R.id.navigationButton, object : View.OnClickListener { override fun onClick(v: View?) { @@ -200,7 +199,7 @@ ) } } - binding.wellListView.adapter = wellListAdapter + binding.recyclerView.adapter = wellListAdapter wellListAdapter.setOnItemClickedListener(object : NormalRecyclerAdapter.OnItemClickedListener { override fun onItemClicked(position: Int, t: WellListModel.DataBean.RowsBean) { diff --git a/app/src/main/java/com/casic/app/smartwell/view/WellMonitorActivity.kt b/app/src/main/java/com/casic/app/smartwell/view/WellMonitorActivity.kt index e3573eb..b87bdb7 100644 --- a/app/src/main/java/com/casic/app/smartwell/view/WellMonitorActivity.kt +++ b/app/src/main/java/com/casic/app/smartwell/view/WellMonitorActivity.kt @@ -11,7 +11,7 @@ import com.pengxh.kt.lite.base.KotlinBaseActivity import com.pengxh.kt.lite.utils.Constant import com.pengxh.kt.lite.utils.LoadState -import com.pengxh.kt.lite.utils.LoadingDialogHub +import com.pengxh.kt.lite.utils.LoadingDialog import com.pengxh.kt.lite.widget.TitleBarView class WellMonitorActivity : KotlinBaseActivity() { @@ -36,7 +36,7 @@ } override fun initOnCreate(savedInstanceState: Bundle?) { - val wellId = intent.getStringExtra(Constant.INTENT_PARAM)!! + val wellId = intent.getStringExtra(Constant.INTENT_PARAM_KEY)!! wellViewModel = ViewModelProvider(this)[WellViewModel::class.java] wellViewModel.getMonitorResult(wellId) wellViewModel.monitorModel.observe(this) { @@ -56,8 +56,8 @@ override fun observeRequestState() { wellViewModel.loadState.observe(this) { when (it) { - is LoadState.Loading -> LoadingDialogHub.show(this, "数据加载中,请稍后") - else -> LoadingDialogHub.dismiss() + is LoadState.Loading -> LoadingDialog.show(this, "数据加载中,请稍后") + else -> LoadingDialog.dismiss() } } } diff --git a/app/src/main/java/com/casic/app/smartwell/view/WellOperationActivity.kt b/app/src/main/java/com/casic/app/smartwell/view/WellOperationActivity.kt index 8d333bf..347ebb6 100644 --- a/app/src/main/java/com/casic/app/smartwell/view/WellOperationActivity.kt +++ b/app/src/main/java/com/casic/app/smartwell/view/WellOperationActivity.kt @@ -23,7 +23,7 @@ import com.pengxh.kt.lite.extensions.navigatePageTo import com.pengxh.kt.lite.extensions.show import com.pengxh.kt.lite.utils.LoadState -import com.pengxh.kt.lite.utils.LoadingDialogHub +import com.pengxh.kt.lite.utils.LoadingDialog import com.pengxh.kt.lite.utils.WeakReferenceHandler import com.pengxh.kt.lite.widget.dialog.AlertControlDialog @@ -109,8 +109,8 @@ } } - binding.operationListView.addItemDecoration( - RecyclerViewItemOffsets(0, 5, 0, 5) + binding.recyclerView.addItemDecoration( + RecyclerViewItemOffsets(0, 7, 0, 7) ) } @@ -123,13 +123,13 @@ override fun observeRequestState() { wellViewModel.loadState.observe(this) { when (it) { - is LoadState.Loading -> LoadingDialogHub.show(this, "处理中,请稍后") + is LoadState.Loading -> LoadingDialog.show(this, "处理中,请稍后") is LoadState.Success -> { - LoadingDialogHub.dismiss() + LoadingDialog.dismiss() wellOperationAdapter.notifyItemChanged(clickedPosition) } - else -> LoadingDialogHub.dismiss() + else -> LoadingDialog.dismiss() } } } @@ -203,24 +203,23 @@ if (item.bfztName == "布防") { viewHolder.setImageResource( R.id.wellStateView, R.drawable.bg_solid_text_green_radius_5 - ).setText(R.id.wellStateView, "撤防") + ).setText(R.id.operationButton, "撤防") } else { viewHolder.setImageResource( R.id.wellStateView, R.drawable.bg_solid_text_red_radius_5 - ).setText(R.id.wellStateView, "布防") + ).setText(R.id.operationButton, "布防") } val deep = if (item.deep.toString().isBlank()) { "未知" } else { item.deep.toString() + "m" } - viewHolder.setText(R.id.wellNameView, item.wellName) + viewHolder.setText(R.id.wellTypeView, item.wellTypeName) .setText(R.id.wellStateView, "已${item.bfztName}") .setText(R.id.wellDepthView, "深:${deep}") .setText(R.id.wellCodeView, "点位编号:${item.wellCode}") - .setText(R.id.wellTypeView, "点位类型:${item.wellTypeName}") .setText(R.id.ownerShipView, "权属单位:${item.deptName}") - .setText(R.id.wellLocationView, "点位置:${item.position}") + .setText(R.id.wellLocationView, "点位位置:${item.position}") .setOnClickListener( R.id.operationButton, object : View.OnClickListener { override fun onClick(v: View?) { @@ -280,7 +279,7 @@ ) } } - binding.operationListView.adapter = wellOperationAdapter + binding.recyclerView.adapter = wellOperationAdapter wellOperationAdapter.setOnItemClickedListener(object : NormalRecyclerAdapter.OnItemClickedListener { override fun onItemClicked(position: Int, t: WellListModel.DataBean.RowsBean) { diff --git a/app/src/main/res/drawable/ic_down.xml b/app/src/main/res/drawable/ic_down.xml index 20e6476..6987e6c 100644 --- a/app/src/main/res/drawable/ic_down.xml +++ b/app/src/main/res/drawable/ic_down.xml @@ -1,6 +1,6 @@ + + diff --git a/app/src/main/res/layout/activity_about_us.xml b/app/src/main/res/layout/activity_about_us.xml index 9091a00..d5fbd0d 100644 --- a/app/src/main/res/layout/activity_about_us.xml +++ b/app/src/main/res/layout/activity_about_us.xml @@ -12,13 +12,7 @@ android:layout_width="match_parent" android:layout_height="wrap_content" android:background="@color/mainThemeColor" - app:tbv_left_image="@drawable/ic_title_left" - app:tbv_only_show_title="false" - app:tbv_show_left_image="true" - app:tbv_show_right_image="false" - app:tbv_text="关于我们" - app:tbv_text_color="@color/white" - app:tbv_text_size="@dimen/sp_18" /> + app:tbv_text="关于我们" /> + app:tbv_text="修改密码" /> + app:tbv_text="布防列表" /> + app:tbv_text="帮助中心" /> + app:tbv_text="工单详情" /> + app:tbv_text="工单详情" /> + app:tbv_text="工单详情" /> + app:tbv_text="工单详情" /> + app:tbv_text="超时工单" /> + app:tbv_text="工单查询" /> + app:tbv_text="查询结果" /> - + + android:value="ee96d8b5e12de3fbb29949efd57418a8" /> () @@ -150,7 +158,7 @@ val cameraPosition = CameraPosition(centerLatLng, 14f, 0f, 0f) val cameraUpdate = CameraUpdateFactory.newCameraPosition(cameraPosition) withContext(Dispatchers.Main) { - LoadingDialogHub.dismiss() + LoadingDialog.dismiss() aMap.animateCamera(cameraUpdate, 1500, null) } } @@ -239,11 +247,6 @@ } override fun initEvent() { - binding.rightOptionView.setOnClickListener { - val x = binding.rightOptionView.width - easyPopupWindow.width - easyPopupWindow.showAsDropDown(binding.rightOptionView, x, 0) - } - //撤防点位 binding.unDeployedLayout.setOnClickListener { requireContext().navigatePageTo() @@ -263,11 +266,11 @@ override fun observeRequestState() { wellViewModel.loadState.observe(this) { when (it) { - is LoadState.Loading -> LoadingDialogHub.show( + is LoadState.Loading -> LoadingDialog.show( requireActivity(), "数据加载中,请稍后..." ) - else -> LoadingDialogHub.dismiss() + else -> LoadingDialog.dismiss() } } } @@ -376,7 +379,7 @@ }).build().show() } }) - infoPopup.showAsDropDown(binding.rightOptionView) +// infoPopup.showAsDropDown(binding.rightOptionView) } override fun onCameraChange(p0: CameraPosition?) { diff --git a/app/src/main/java/com/casic/app/smartwell/fragment/HomePageNoClusterFragment.kt b/app/src/main/java/com/casic/app/smartwell/fragment/HomePageNoClusterFragment.kt index 802426a..b25f743 100644 --- a/app/src/main/java/com/casic/app/smartwell/fragment/HomePageNoClusterFragment.kt +++ b/app/src/main/java/com/casic/app/smartwell/fragment/HomePageNoClusterFragment.kt @@ -38,8 +38,9 @@ import com.pengxh.kt.lite.extensions.navigatePageTo import com.pengxh.kt.lite.extensions.show import com.pengxh.kt.lite.utils.LoadState -import com.pengxh.kt.lite.utils.LoadingDialogHub +import com.pengxh.kt.lite.utils.LoadingDialog import com.pengxh.kt.lite.widget.EasyPopupWindow +import com.pengxh.kt.lite.widget.TitleBarView import com.pengxh.kt.lite.widget.dialog.AlertControlDialog import kotlinx.coroutines.Dispatchers import kotlinx.coroutines.launch @@ -78,7 +79,15 @@ override fun setupTopBarLayout() { binding.rootView.initImmersionBar(this, false, R.color.mainThemeColor) - binding.titleView.text = "首页" + binding.titleView.setOnClickListener(object : TitleBarView.OnClickListener { + override fun onLeftClick() { + + } + + override fun onRightClick() { + easyPopupWindow.showAsDropDown(binding.titleView, binding.titleView.width, 0) + } + }) } override fun initOnCreate(savedInstanceState: Bundle?) { @@ -112,7 +121,7 @@ //渲染井位置 lifecycleScope.launch(Dispatchers.Main) { - LoadingDialogHub.show(requireActivity(), "数据加载中,请稍后") + LoadingDialog.show(requireActivity(), "数据加载中,请稍后") withContext(Dispatchers.IO) { //取Well缓存 val allMarkerOptions = ArrayList() @@ -144,7 +153,7 @@ val cameraPosition = CameraPosition(centerLatLng, 14f, 0f, 0f) val cameraUpdate = CameraUpdateFactory.newCameraPosition(cameraPosition) withContext(Dispatchers.Main) { - LoadingDialogHub.dismiss() + LoadingDialog.dismiss() aMap.animateCamera(cameraUpdate, 1500, null) } } @@ -238,11 +247,6 @@ } override fun initEvent() { - binding.rightOptionView.setOnClickListener { - val x = binding.rightOptionView.width - easyPopupWindow.width - easyPopupWindow.showAsDropDown(binding.rightOptionView, x, 0) - } - //撤防点位 binding.unDeployedLayout.setOnClickListener { requireContext().navigatePageTo() @@ -262,11 +266,11 @@ override fun observeRequestState() { wellViewModel.loadState.observe(this) { when (it) { - is LoadState.Loading -> LoadingDialogHub.show( + is LoadState.Loading -> LoadingDialog.show( requireActivity(), "数据加载中,请稍后..." ) - else -> LoadingDialogHub.dismiss() + else -> LoadingDialog.dismiss() } } } diff --git a/app/src/main/java/com/casic/app/smartwell/fragment/MinePageFragment.kt b/app/src/main/java/com/casic/app/smartwell/fragment/MinePageFragment.kt index 09a570c..dcb48f8 100644 --- a/app/src/main/java/com/casic/app/smartwell/fragment/MinePageFragment.kt +++ b/app/src/main/java/com/casic/app/smartwell/fragment/MinePageFragment.kt @@ -35,7 +35,7 @@ import com.pengxh.kt.lite.utils.ActivityStackManager import com.pengxh.kt.lite.utils.FileDownloadManager import com.pengxh.kt.lite.utils.LoadState -import com.pengxh.kt.lite.utils.LoadingDialogHub +import com.pengxh.kt.lite.utils.LoadingDialog import com.pengxh.kt.lite.widget.dialog.AlertControlDialog import com.pengxh.kt.lite.widget.dialog.BottomActionSheet import kotlinx.coroutines.Dispatchers @@ -60,7 +60,6 @@ override fun setupTopBarLayout() { binding.rootView.initImmersionBar(this, false, R.color.mainThemeColor) - binding.titleInclude.titleView.text = "我的" } override fun initOnCreate(savedInstanceState: Bundle?) { @@ -155,27 +154,27 @@ override fun observeRequestState() { userViewModel.loadState.observe(this) { when (it) { - is LoadState.Loading -> LoadingDialogHub.show( + is LoadState.Loading -> LoadingDialog.show( requireActivity(), "检查版本中,请稍后" ) - else -> LoadingDialogHub.dismiss() + else -> LoadingDialog.dismiss() } } wellViewModel.loadState.observe(this) { when (it) { - is LoadState.Loading -> LoadingDialogHub.show( + is LoadState.Loading -> LoadingDialog.show( requireActivity(), "数据更新中,请稍后" ) is LoadState.Fail -> { - LoadingDialogHub.dismiss() + LoadingDialog.dismiss() "数据更新超时".show(requireContext()) } else -> { - LoadingDialogHub.dismiss() + LoadingDialog.dismiss() AlertControlDialog.Builder().setContext(requireContext()).setTitle("温馨提示") .setMessage("数据更新成功,请重启应用").setNegativeButton("取消") .setPositiveButton("确定").setOnDialogButtonClickListener(object : @@ -197,17 +196,17 @@ lineViewModel.loadState.observe(this) { when (it) { - is LoadState.Loading -> LoadingDialogHub.show( + is LoadState.Loading -> LoadingDialog.show( requireActivity(), "数据更新中,请稍后" ) is LoadState.Fail -> { - LoadingDialogHub.dismiss() + LoadingDialog.dismiss() "数据更新超时".show(requireContext()) } else -> { - LoadingDialogHub.dismiss() + LoadingDialog.dismiss() AlertControlDialog.Builder().setContext(requireContext()).setTitle("温馨提示") .setMessage("数据更新成功,请重启应用").setNegativeButton("取消") .setPositiveButton("确定").setOnDialogButtonClickListener(object : diff --git a/app/src/main/java/com/casic/app/smartwell/fragment/NoticePageFragment.kt b/app/src/main/java/com/casic/app/smartwell/fragment/NoticePageFragment.kt index 171b555..3c93f54 100644 --- a/app/src/main/java/com/casic/app/smartwell/fragment/NoticePageFragment.kt +++ b/app/src/main/java/com/casic/app/smartwell/fragment/NoticePageFragment.kt @@ -48,7 +48,6 @@ override fun setupTopBarLayout() { binding.rootView.initImmersionBar(this, false, R.color.mainThemeColor) - binding.titleInclude.titleView.text = "消息" } override fun initOnCreate(savedInstanceState: Bundle?) { diff --git a/app/src/main/java/com/casic/app/smartwell/fragment/OrderListFragment.kt b/app/src/main/java/com/casic/app/smartwell/fragment/OrderListFragment.kt index 93ff35b..5e38acb 100644 --- a/app/src/main/java/com/casic/app/smartwell/fragment/OrderListFragment.kt +++ b/app/src/main/java/com/casic/app/smartwell/fragment/OrderListFragment.kt @@ -12,6 +12,7 @@ import com.casic.app.smartwell.view.SearchOrderActivity import com.pengxh.kt.lite.base.KotlinBaseFragment import com.pengxh.kt.lite.extensions.navigatePageTo +import com.pengxh.kt.lite.widget.TitleBarView class OrderListFragment : KotlinBaseFragment() { @@ -25,15 +26,22 @@ } override fun initViewBinding( - inflater: LayoutInflater, - container: ViewGroup? + inflater: LayoutInflater, container: ViewGroup? ): FragmentOrderBinding { return FragmentOrderBinding.inflate(inflater, container, false) } override fun setupTopBarLayout() { binding.rootView.initImmersionBar(this, false, R.color.mainThemeColor) - binding.titleView.text = "工单" + binding.titleView.setOnClickListener(object : TitleBarView.OnClickListener { + override fun onLeftClick() { + + } + + override fun onRightClick() { + requireContext().navigatePageTo() + } + }) } override fun initOnCreate(savedInstanceState: Bundle?) { @@ -51,8 +59,6 @@ } override fun initEvent() { - binding.rightOptionView.setOnClickListener { - requireContext().navigatePageTo() - } + } } \ No newline at end of file diff --git a/app/src/main/java/com/casic/app/smartwell/fragment/OrderNotProcessedFragment.kt b/app/src/main/java/com/casic/app/smartwell/fragment/OrderNotProcessedFragment.kt index 0b3d09d..2b6f21d 100644 --- a/app/src/main/java/com/casic/app/smartwell/fragment/OrderNotProcessedFragment.kt +++ b/app/src/main/java/com/casic/app/smartwell/fragment/OrderNotProcessedFragment.kt @@ -18,7 +18,7 @@ import com.pengxh.kt.lite.extensions.navigatePageTo import com.pengxh.kt.lite.extensions.show import com.pengxh.kt.lite.utils.LoadState -import com.pengxh.kt.lite.utils.LoadingDialogHub +import com.pengxh.kt.lite.utils.LoadingDialog import com.pengxh.kt.lite.utils.WeakReferenceHandler import com.pengxh.kt.lite.widget.dialog.AlertControlDialog @@ -78,8 +78,8 @@ operationViewModel = ViewModelProvider(this)[OperationViewModel::class.java] - binding.notProcessedView.addItemDecoration( - RecyclerViewItemOffsets(0, 5, 0, 5) + binding.recyclerView.addItemDecoration( + RecyclerViewItemOffsets(0, 7, 0, 7) ) } @@ -87,9 +87,9 @@ //接单状态处理 operationViewModel.loadState.observe(this) { when (it) { - is LoadState.Loading -> LoadingDialogHub.show(requireActivity(), "接单中,请稍后") + is LoadState.Loading -> LoadingDialog.show(requireActivity(), "接单中,请稍后") is LoadState.Success -> { - LoadingDialogHub.dismiss() + LoadingDialog.dismiss() //接单成功之后刷新列表 dataBeans.removeAt(clickedPosition) notProcessedAdapter.notifyItemRemoved(clickedPosition) @@ -98,7 +98,7 @@ ) } - else -> LoadingDialogHub.dismiss() + else -> LoadingDialog.dismiss() } } } @@ -131,7 +131,7 @@ } else { binding.emptyInclude.emptyView.hide() notProcessedAdapter = OrderNotProcessedAdapter(requireContext(), dataBeans) - binding.notProcessedView.adapter = notProcessedAdapter + binding.recyclerView.adapter = notProcessedAdapter notProcessedAdapter.setOnItemClickListener(object : OrderNotProcessedAdapter.OnItemClickListener { override fun onClicked(position: Int) { diff --git a/app/src/main/java/com/casic/app/smartwell/fragment/OvertimeNotAcceptFragment.kt b/app/src/main/java/com/casic/app/smartwell/fragment/OvertimeNotAcceptFragment.kt index a198545..9b318ca 100644 --- a/app/src/main/java/com/casic/app/smartwell/fragment/OvertimeNotAcceptFragment.kt +++ b/app/src/main/java/com/casic/app/smartwell/fragment/OvertimeNotAcceptFragment.kt @@ -18,7 +18,7 @@ import com.pengxh.kt.lite.extensions.navigatePageTo import com.pengxh.kt.lite.extensions.show import com.pengxh.kt.lite.utils.LoadState -import com.pengxh.kt.lite.utils.LoadingDialogHub +import com.pengxh.kt.lite.utils.LoadingDialog import com.pengxh.kt.lite.utils.WeakReferenceHandler import com.pengxh.kt.lite.widget.dialog.AlertControlDialog @@ -81,8 +81,8 @@ operationViewModel = ViewModelProvider(this)[OperationViewModel::class.java] - binding.notProcessedView.addItemDecoration( - RecyclerViewItemOffsets(0, 5, 0, 5) + binding.recyclerView.addItemDecoration( + RecyclerViewItemOffsets(0, 7, 0, 7) ) } @@ -90,9 +90,9 @@ //接单状态处理 operationViewModel.loadState.observe(this) { when (it) { - is LoadState.Loading -> LoadingDialogHub.show(requireActivity(), "接单中,请稍后") + is LoadState.Loading -> LoadingDialog.show(requireActivity(), "接单中,请稍后") is LoadState.Success -> { - LoadingDialogHub.dismiss() + LoadingDialog.dismiss() //接单成功之后刷新列表 dataBeans.removeAt(clickedPosition) notProcessedAdapter.notifyItemRemoved(clickedPosition) @@ -101,7 +101,7 @@ ) } - else -> LoadingDialogHub.dismiss() + else -> LoadingDialog.dismiss() } } } @@ -134,7 +134,7 @@ } else { binding.emptyInclude.emptyView.hide() notProcessedAdapter = OrderNotProcessedAdapter(requireContext(), dataBeans) - binding.notProcessedView.adapter = notProcessedAdapter + binding.recyclerView.adapter = notProcessedAdapter notProcessedAdapter.setOnItemClickListener(object : OrderNotProcessedAdapter.OnItemClickListener { override fun onClicked(position: Int) { diff --git a/app/src/main/java/com/casic/app/smartwell/greendao/DaoMaster.java b/app/src/main/java/com/casic/app/smartwell/greendao/DaoMaster.java index fdcf3a7..1e52b74 100644 --- a/app/src/main/java/com/casic/app/smartwell/greendao/DaoMaster.java +++ b/app/src/main/java/com/casic/app/smartwell/greendao/DaoMaster.java @@ -13,25 +13,20 @@ // THIS CODE IS GENERATED BY greenDAO, DO NOT EDIT. - /** * Master of DAO (schema version 4): knows all DAOs. */ public class DaoMaster extends AbstractDaoMaster { public static final int SCHEMA_VERSION = 4; - /** - * Creates underlying database table using DAOs. - */ + /** Creates underlying database table using DAOs. */ public static void createAllTables(Database db, boolean ifNotExists) { MapWellLocalBeanDao.createTable(db, ifNotExists); NoticeLocaleBeanDao.createTable(db, ifNotExists); PipeLocalBeanDao.createTable(db, ifNotExists); } - /** - * Drops underlying database table using DAOs. - */ + /** Drops underlying database table using DAOs. */ public static void dropAllTables(Database db, boolean ifExists) { MapWellLocalBeanDao.dropTable(db, ifExists); NoticeLocaleBeanDao.dropTable(db, ifExists); @@ -86,9 +81,7 @@ } } - /** - * WARNING: Drops all table on Upgrade! Use only during development. - */ + /** WARNING: Drops all table on Upgrade! Use only during development. */ public static class DevOpenHelper extends OpenHelper { public DevOpenHelper(Context context, String name) { super(context, name); diff --git a/app/src/main/java/com/casic/app/smartwell/greendao/DaoSession.java b/app/src/main/java/com/casic/app/smartwell/greendao/DaoSession.java index 0b36d17..3e40e3b 100644 --- a/app/src/main/java/com/casic/app/smartwell/greendao/DaoSession.java +++ b/app/src/main/java/com/casic/app/smartwell/greendao/DaoSession.java @@ -16,7 +16,7 @@ /** * {@inheritDoc} - * + * * @see org.greenrobot.greendao.AbstractDaoSession */ public class DaoSession extends AbstractDaoSession { @@ -50,7 +50,7 @@ registerDao(NoticeLocaleBean.class, noticeLocaleBeanDao); registerDao(PipeLocalBean.class, pipeLocalBeanDao); } - + public void clear() { mapWellLocalBeanDaoConfig.clearIdentityScope(); noticeLocaleBeanDaoConfig.clearIdentityScope(); diff --git a/app/src/main/java/com/casic/app/smartwell/greendao/MapWellLocalBeanDao.java b/app/src/main/java/com/casic/app/smartwell/greendao/MapWellLocalBeanDao.java index 8908fda..407bc92 100644 --- a/app/src/main/java/com/casic/app/smartwell/greendao/MapWellLocalBeanDao.java +++ b/app/src/main/java/com/casic/app/smartwell/greendao/MapWellLocalBeanDao.java @@ -12,10 +12,9 @@ import org.greenrobot.greendao.internal.DaoConfig; // THIS CODE IS GENERATED BY greenDAO, DO NOT EDIT. - -/** +/** * DAO for table "MAP_WELL_LOCAL_BEAN". - */ +*/ public class MapWellLocalBeanDao extends AbstractDao { public static final String TABLENAME = "MAP_WELL_LOCAL_BEAN"; @@ -57,16 +56,14 @@ public MapWellLocalBeanDao(DaoConfig config) { super(config); } - + public MapWellLocalBeanDao(DaoConfig config, DaoSession daoSession) { super(config, daoSession); } - /** - * Creates the underlying database table. - */ + /** Creates the underlying database table. */ public static void createTable(Database db, boolean ifNotExists) { - String constraint = ifNotExists ? "IF NOT EXISTS " : ""; + String constraint = ifNotExists? "IF NOT EXISTS ": ""; db.execSQL("CREATE TABLE " + constraint + "\"MAP_WELL_LOCAL_BEAN\" (" + // "\"_id\" INTEGER PRIMARY KEY AUTOINCREMENT ," + // 0: kId "\"AREA\" TEXT," + // 1: area @@ -96,9 +93,7 @@ "\"WELL_TYPE_NAME\" TEXT);"); // 25: wellTypeName } - /** - * Drops the underlying database table. - */ + /** Drops the underlying database table. */ public static void dropTable(Database db, boolean ifExists) { String sql = "DROP TABLE " + (ifExists ? "IF EXISTS " : "") + "\"MAP_WELL_LOCAL_BEAN\""; db.execSQL(sql); @@ -107,132 +102,132 @@ @Override protected final void bindValues(DatabaseStatement stmt, MapWellLocalBean entity) { stmt.clearBindings(); - + Long kId = entity.getKId(); if (kId != null) { stmt.bindLong(1, kId); } - + String area = entity.getArea(); if (area != null) { stmt.bindString(2, area); } - + String bfzt = entity.getBfzt(); if (bfzt != null) { stmt.bindString(3, bfzt); } - + String bfztName = entity.getBfztName(); if (bfztName != null) { stmt.bindString(4, bfztName); } - + String coordinateX = entity.getCoordinateX(); if (coordinateX != null) { stmt.bindString(5, coordinateX); } - + String coordinateY = entity.getCoordinateY(); if (coordinateY != null) { stmt.bindString(6, coordinateY); } - + String deep = entity.getDeep(); if (deep != null) { stmt.bindString(7, deep); } - + String deptName = entity.getDeptName(); if (deptName != null) { stmt.bindString(8, deptName); } - + String deptid = entity.getDeptid(); if (deptid != null) { stmt.bindString(9, deptid); } - + String id = entity.getId(); if (id != null) { stmt.bindString(10, id); } - + String latBaidu = entity.getLatBaidu(); if (latBaidu != null) { stmt.bindString(11, latBaidu); } - + String latGaode = entity.getLatGaode(); if (latGaode != null) { stmt.bindString(12, latGaode); } - + String lngBaidu = entity.getLngBaidu(); if (lngBaidu != null) { stmt.bindString(13, lngBaidu); } - + String lngGaode = entity.getLngGaode(); if (lngGaode != null) { stmt.bindString(14, lngGaode); } - + String notes = entity.getNotes(); if (notes != null) { stmt.bindString(15, notes); } - + String photos = entity.getPhotos(); if (photos != null) { stmt.bindString(16, photos); } - + String position = entity.getPosition(); if (position != null) { stmt.bindString(17, position); } - + String staff = entity.getStaff(); if (staff != null) { stmt.bindString(18, staff); } - + String tel = entity.getTel(); if (tel != null) { stmt.bindString(19, tel); } - + String ts = entity.getTs(); if (ts != null) { stmt.bindString(20, ts); } - + String valid = entity.getValid(); if (valid != null) { stmt.bindString(21, valid); } - + String watchData = entity.getWatchData(); if (watchData != null) { stmt.bindString(22, watchData); } - + String wellCode = entity.getWellCode(); if (wellCode != null) { stmt.bindString(23, wellCode); } - + String wellName = entity.getWellName(); if (wellName != null) { stmt.bindString(24, wellName); } - + String wellType = entity.getWellType(); if (wellType != null) { stmt.bindString(25, wellType); } - + String wellTypeName = entity.getWellTypeName(); if (wellTypeName != null) { stmt.bindString(26, wellTypeName); @@ -242,132 +237,132 @@ @Override protected final void bindValues(SQLiteStatement stmt, MapWellLocalBean entity) { stmt.clearBindings(); - + Long kId = entity.getKId(); if (kId != null) { stmt.bindLong(1, kId); } - + String area = entity.getArea(); if (area != null) { stmt.bindString(2, area); } - + String bfzt = entity.getBfzt(); if (bfzt != null) { stmt.bindString(3, bfzt); } - + String bfztName = entity.getBfztName(); if (bfztName != null) { stmt.bindString(4, bfztName); } - + String coordinateX = entity.getCoordinateX(); if (coordinateX != null) { stmt.bindString(5, coordinateX); } - + String coordinateY = entity.getCoordinateY(); if (coordinateY != null) { stmt.bindString(6, coordinateY); } - + String deep = entity.getDeep(); if (deep != null) { stmt.bindString(7, deep); } - + String deptName = entity.getDeptName(); if (deptName != null) { stmt.bindString(8, deptName); } - + String deptid = entity.getDeptid(); if (deptid != null) { stmt.bindString(9, deptid); } - + String id = entity.getId(); if (id != null) { stmt.bindString(10, id); } - + String latBaidu = entity.getLatBaidu(); if (latBaidu != null) { stmt.bindString(11, latBaidu); } - + String latGaode = entity.getLatGaode(); if (latGaode != null) { stmt.bindString(12, latGaode); } - + String lngBaidu = entity.getLngBaidu(); if (lngBaidu != null) { stmt.bindString(13, lngBaidu); } - + String lngGaode = entity.getLngGaode(); if (lngGaode != null) { stmt.bindString(14, lngGaode); } - + String notes = entity.getNotes(); if (notes != null) { stmt.bindString(15, notes); } - + String photos = entity.getPhotos(); if (photos != null) { stmt.bindString(16, photos); } - + String position = entity.getPosition(); if (position != null) { stmt.bindString(17, position); } - + String staff = entity.getStaff(); if (staff != null) { stmt.bindString(18, staff); } - + String tel = entity.getTel(); if (tel != null) { stmt.bindString(19, tel); } - + String ts = entity.getTs(); if (ts != null) { stmt.bindString(20, ts); } - + String valid = entity.getValid(); if (valid != null) { stmt.bindString(21, valid); } - + String watchData = entity.getWatchData(); if (watchData != null) { stmt.bindString(22, watchData); } - + String wellCode = entity.getWellCode(); if (wellCode != null) { stmt.bindString(23, wellCode); } - + String wellName = entity.getWellName(); if (wellName != null) { stmt.bindString(24, wellName); } - + String wellType = entity.getWellType(); if (wellType != null) { stmt.bindString(25, wellType); } - + String wellTypeName = entity.getWellTypeName(); if (wellTypeName != null) { stmt.bindString(26, wellTypeName); @@ -377,41 +372,41 @@ @Override public Long readKey(Cursor cursor, int offset) { return cursor.isNull(offset + 0) ? null : cursor.getLong(offset + 0); - } + } @Override public MapWellLocalBean readEntity(Cursor cursor, int offset) { MapWellLocalBean entity = new MapWellLocalBean( // - cursor.isNull(offset + 0) ? null : cursor.getLong(offset + 0), // kId - cursor.isNull(offset + 1) ? null : cursor.getString(offset + 1), // area - cursor.isNull(offset + 2) ? null : cursor.getString(offset + 2), // bfzt - cursor.isNull(offset + 3) ? null : cursor.getString(offset + 3), // bfztName - cursor.isNull(offset + 4) ? null : cursor.getString(offset + 4), // coordinateX - cursor.isNull(offset + 5) ? null : cursor.getString(offset + 5), // coordinateY - cursor.isNull(offset + 6) ? null : cursor.getString(offset + 6), // deep - cursor.isNull(offset + 7) ? null : cursor.getString(offset + 7), // deptName - cursor.isNull(offset + 8) ? null : cursor.getString(offset + 8), // deptid - cursor.isNull(offset + 9) ? null : cursor.getString(offset + 9), // id - cursor.isNull(offset + 10) ? null : cursor.getString(offset + 10), // latBaidu - cursor.isNull(offset + 11) ? null : cursor.getString(offset + 11), // latGaode - cursor.isNull(offset + 12) ? null : cursor.getString(offset + 12), // lngBaidu - cursor.isNull(offset + 13) ? null : cursor.getString(offset + 13), // lngGaode - cursor.isNull(offset + 14) ? null : cursor.getString(offset + 14), // notes - cursor.isNull(offset + 15) ? null : cursor.getString(offset + 15), // photos - cursor.isNull(offset + 16) ? null : cursor.getString(offset + 16), // position - cursor.isNull(offset + 17) ? null : cursor.getString(offset + 17), // staff - cursor.isNull(offset + 18) ? null : cursor.getString(offset + 18), // tel - cursor.isNull(offset + 19) ? null : cursor.getString(offset + 19), // ts - cursor.isNull(offset + 20) ? null : cursor.getString(offset + 20), // valid - cursor.isNull(offset + 21) ? null : cursor.getString(offset + 21), // watchData - cursor.isNull(offset + 22) ? null : cursor.getString(offset + 22), // wellCode - cursor.isNull(offset + 23) ? null : cursor.getString(offset + 23), // wellName - cursor.isNull(offset + 24) ? null : cursor.getString(offset + 24), // wellType - cursor.isNull(offset + 25) ? null : cursor.getString(offset + 25) // wellTypeName + cursor.isNull(offset + 0) ? null : cursor.getLong(offset + 0), // kId + cursor.isNull(offset + 1) ? null : cursor.getString(offset + 1), // area + cursor.isNull(offset + 2) ? null : cursor.getString(offset + 2), // bfzt + cursor.isNull(offset + 3) ? null : cursor.getString(offset + 3), // bfztName + cursor.isNull(offset + 4) ? null : cursor.getString(offset + 4), // coordinateX + cursor.isNull(offset + 5) ? null : cursor.getString(offset + 5), // coordinateY + cursor.isNull(offset + 6) ? null : cursor.getString(offset + 6), // deep + cursor.isNull(offset + 7) ? null : cursor.getString(offset + 7), // deptName + cursor.isNull(offset + 8) ? null : cursor.getString(offset + 8), // deptid + cursor.isNull(offset + 9) ? null : cursor.getString(offset + 9), // id + cursor.isNull(offset + 10) ? null : cursor.getString(offset + 10), // latBaidu + cursor.isNull(offset + 11) ? null : cursor.getString(offset + 11), // latGaode + cursor.isNull(offset + 12) ? null : cursor.getString(offset + 12), // lngBaidu + cursor.isNull(offset + 13) ? null : cursor.getString(offset + 13), // lngGaode + cursor.isNull(offset + 14) ? null : cursor.getString(offset + 14), // notes + cursor.isNull(offset + 15) ? null : cursor.getString(offset + 15), // photos + cursor.isNull(offset + 16) ? null : cursor.getString(offset + 16), // position + cursor.isNull(offset + 17) ? null : cursor.getString(offset + 17), // staff + cursor.isNull(offset + 18) ? null : cursor.getString(offset + 18), // tel + cursor.isNull(offset + 19) ? null : cursor.getString(offset + 19), // ts + cursor.isNull(offset + 20) ? null : cursor.getString(offset + 20), // valid + cursor.isNull(offset + 21) ? null : cursor.getString(offset + 21), // watchData + cursor.isNull(offset + 22) ? null : cursor.getString(offset + 22), // wellCode + cursor.isNull(offset + 23) ? null : cursor.getString(offset + 23), // wellName + cursor.isNull(offset + 24) ? null : cursor.getString(offset + 24), // wellType + cursor.isNull(offset + 25) ? null : cursor.getString(offset + 25) // wellTypeName ); return entity; } - + @Override public void readEntity(Cursor cursor, MapWellLocalBean entity, int offset) { entity.setKId(cursor.isNull(offset + 0) ? null : cursor.getLong(offset + 0)); @@ -440,17 +435,17 @@ entity.setWellName(cursor.isNull(offset + 23) ? null : cursor.getString(offset + 23)); entity.setWellType(cursor.isNull(offset + 24) ? null : cursor.getString(offset + 24)); entity.setWellTypeName(cursor.isNull(offset + 25) ? null : cursor.getString(offset + 25)); - } - + } + @Override protected final Long updateKeyAfterInsert(MapWellLocalBean entity, long rowId) { entity.setKId(rowId); return rowId; } - + @Override public Long getKey(MapWellLocalBean entity) { - if (entity != null) { + if(entity != null) { return entity.getKId(); } else { return null; @@ -466,5 +461,5 @@ protected final boolean isEntityUpdateable() { return true; } - + } diff --git a/app/src/main/java/com/casic/app/smartwell/greendao/NoticeLocaleBeanDao.java b/app/src/main/java/com/casic/app/smartwell/greendao/NoticeLocaleBeanDao.java index 64312ed..deb2d49 100644 --- a/app/src/main/java/com/casic/app/smartwell/greendao/NoticeLocaleBeanDao.java +++ b/app/src/main/java/com/casic/app/smartwell/greendao/NoticeLocaleBeanDao.java @@ -12,10 +12,9 @@ import org.greenrobot.greendao.internal.DaoConfig; // THIS CODE IS GENERATED BY greenDAO, DO NOT EDIT. - -/** +/** * DAO for table "NOTICE_LOCALE_BEAN". - */ +*/ public class NoticeLocaleBeanDao extends AbstractDao { public static final String TABLENAME = "NOTICE_LOCALE_BEAN"; @@ -43,16 +42,14 @@ public NoticeLocaleBeanDao(DaoConfig config) { super(config); } - + public NoticeLocaleBeanDao(DaoConfig config, DaoSession daoSession) { super(config, daoSession); } - /** - * Creates the underlying database table. - */ + /** Creates the underlying database table. */ public static void createTable(Database db, boolean ifNotExists) { - String constraint = ifNotExists ? "IF NOT EXISTS " : ""; + String constraint = ifNotExists? "IF NOT EXISTS ": ""; db.execSQL("CREATE TABLE " + constraint + "\"NOTICE_LOCALE_BEAN\" (" + // "\"_id\" INTEGER PRIMARY KEY AUTOINCREMENT ," + // 0: id "\"MESSAGE_ID\" TEXT UNIQUE ," + // 1: messageId @@ -68,9 +65,7 @@ "\"NOTICE_TIME\" TEXT);"); // 11: noticeTime } - /** - * Drops the underlying database table. - */ + /** Drops the underlying database table. */ public static void dropTable(Database db, boolean ifExists) { String sql = "DROP TABLE " + (ifExists ? "IF EXISTS " : "") + "\"NOTICE_LOCALE_BEAN\""; db.execSQL(sql); @@ -79,62 +74,62 @@ @Override protected final void bindValues(DatabaseStatement stmt, NoticeLocaleBean entity) { stmt.clearBindings(); - + Long id = entity.getId(); if (id != null) { stmt.bindLong(1, id); } - + String messageId = entity.getMessageId(); if (messageId != null) { stmt.bindString(2, messageId); } - + String appid = entity.getAppid(); if (appid != null) { stmt.bindString(3, appid); } - + String clientId = entity.getClientId(); if (clientId != null) { stmt.bindString(4, clientId); } - + String taskId = entity.getTaskId(); if (taskId != null) { stmt.bindString(5, taskId); } - + String userId = entity.getUserId(); if (userId != null) { stmt.bindString(6, userId); } - + String title = entity.getTitle(); if (title != null) { stmt.bindString(7, title); } - + String content = entity.getContent(); if (content != null) { stmt.bindString(8, content); } - + String deviceCode = entity.getDeviceCode(); if (deviceCode != null) { stmt.bindString(9, deviceCode); } - + String jobId = entity.getJobId(); if (jobId != null) { stmt.bindString(10, jobId); } - + String isRead = entity.getIsRead(); if (isRead != null) { stmt.bindString(11, isRead); } - + String noticeTime = entity.getNoticeTime(); if (noticeTime != null) { stmt.bindString(12, noticeTime); @@ -144,62 +139,62 @@ @Override protected final void bindValues(SQLiteStatement stmt, NoticeLocaleBean entity) { stmt.clearBindings(); - + Long id = entity.getId(); if (id != null) { stmt.bindLong(1, id); } - + String messageId = entity.getMessageId(); if (messageId != null) { stmt.bindString(2, messageId); } - + String appid = entity.getAppid(); if (appid != null) { stmt.bindString(3, appid); } - + String clientId = entity.getClientId(); if (clientId != null) { stmt.bindString(4, clientId); } - + String taskId = entity.getTaskId(); if (taskId != null) { stmt.bindString(5, taskId); } - + String userId = entity.getUserId(); if (userId != null) { stmt.bindString(6, userId); } - + String title = entity.getTitle(); if (title != null) { stmt.bindString(7, title); } - + String content = entity.getContent(); if (content != null) { stmt.bindString(8, content); } - + String deviceCode = entity.getDeviceCode(); if (deviceCode != null) { stmt.bindString(9, deviceCode); } - + String jobId = entity.getJobId(); if (jobId != null) { stmt.bindString(10, jobId); } - + String isRead = entity.getIsRead(); if (isRead != null) { stmt.bindString(11, isRead); } - + String noticeTime = entity.getNoticeTime(); if (noticeTime != null) { stmt.bindString(12, noticeTime); @@ -209,27 +204,27 @@ @Override public Long readKey(Cursor cursor, int offset) { return cursor.isNull(offset + 0) ? null : cursor.getLong(offset + 0); - } + } @Override public NoticeLocaleBean readEntity(Cursor cursor, int offset) { NoticeLocaleBean entity = new NoticeLocaleBean( // - cursor.isNull(offset + 0) ? null : cursor.getLong(offset + 0), // id - cursor.isNull(offset + 1) ? null : cursor.getString(offset + 1), // messageId - cursor.isNull(offset + 2) ? null : cursor.getString(offset + 2), // appid - cursor.isNull(offset + 3) ? null : cursor.getString(offset + 3), // clientId - cursor.isNull(offset + 4) ? null : cursor.getString(offset + 4), // taskId - cursor.isNull(offset + 5) ? null : cursor.getString(offset + 5), // userId - cursor.isNull(offset + 6) ? null : cursor.getString(offset + 6), // title - cursor.isNull(offset + 7) ? null : cursor.getString(offset + 7), // content - cursor.isNull(offset + 8) ? null : cursor.getString(offset + 8), // deviceCode - cursor.isNull(offset + 9) ? null : cursor.getString(offset + 9), // jobId - cursor.isNull(offset + 10) ? null : cursor.getString(offset + 10), // isRead - cursor.isNull(offset + 11) ? null : cursor.getString(offset + 11) // noticeTime + cursor.isNull(offset + 0) ? null : cursor.getLong(offset + 0), // id + cursor.isNull(offset + 1) ? null : cursor.getString(offset + 1), // messageId + cursor.isNull(offset + 2) ? null : cursor.getString(offset + 2), // appid + cursor.isNull(offset + 3) ? null : cursor.getString(offset + 3), // clientId + cursor.isNull(offset + 4) ? null : cursor.getString(offset + 4), // taskId + cursor.isNull(offset + 5) ? null : cursor.getString(offset + 5), // userId + cursor.isNull(offset + 6) ? null : cursor.getString(offset + 6), // title + cursor.isNull(offset + 7) ? null : cursor.getString(offset + 7), // content + cursor.isNull(offset + 8) ? null : cursor.getString(offset + 8), // deviceCode + cursor.isNull(offset + 9) ? null : cursor.getString(offset + 9), // jobId + cursor.isNull(offset + 10) ? null : cursor.getString(offset + 10), // isRead + cursor.isNull(offset + 11) ? null : cursor.getString(offset + 11) // noticeTime ); return entity; } - + @Override public void readEntity(Cursor cursor, NoticeLocaleBean entity, int offset) { entity.setId(cursor.isNull(offset + 0) ? null : cursor.getLong(offset + 0)); @@ -244,17 +239,17 @@ entity.setJobId(cursor.isNull(offset + 9) ? null : cursor.getString(offset + 9)); entity.setIsRead(cursor.isNull(offset + 10) ? null : cursor.getString(offset + 10)); entity.setNoticeTime(cursor.isNull(offset + 11) ? null : cursor.getString(offset + 11)); - } - + } + @Override protected final Long updateKeyAfterInsert(NoticeLocaleBean entity, long rowId) { entity.setId(rowId); return rowId; } - + @Override public Long getKey(NoticeLocaleBean entity) { - if (entity != null) { + if(entity != null) { return entity.getId(); } else { return null; @@ -270,5 +265,5 @@ protected final boolean isEntityUpdateable() { return true; } - + } diff --git a/app/src/main/java/com/casic/app/smartwell/greendao/PipeLocalBeanDao.java b/app/src/main/java/com/casic/app/smartwell/greendao/PipeLocalBeanDao.java index aab4d3f..df5515a 100644 --- a/app/src/main/java/com/casic/app/smartwell/greendao/PipeLocalBeanDao.java +++ b/app/src/main/java/com/casic/app/smartwell/greendao/PipeLocalBeanDao.java @@ -12,10 +12,9 @@ import org.greenrobot.greendao.internal.DaoConfig; // THIS CODE IS GENERATED BY greenDAO, DO NOT EDIT. - -/** +/** * DAO for table "PIPE_LOCAL_BEAN". - */ +*/ public class PipeLocalBeanDao extends AbstractDao { public static final String TABLENAME = "PIPE_LOCAL_BEAN"; @@ -37,16 +36,14 @@ public PipeLocalBeanDao(DaoConfig config) { super(config); } - + public PipeLocalBeanDao(DaoConfig config, DaoSession daoSession) { super(config, daoSession); } - /** - * Creates the underlying database table. - */ + /** Creates the underlying database table. */ public static void createTable(Database db, boolean ifNotExists) { - String constraint = ifNotExists ? "IF NOT EXISTS " : ""; + String constraint = ifNotExists? "IF NOT EXISTS ": ""; db.execSQL("CREATE TABLE " + constraint + "\"PIPE_LOCAL_BEAN\" (" + // "\"_id\" INTEGER PRIMARY KEY AUTOINCREMENT ," + // 0: id "\"PIPE_CODE\" TEXT," + // 1: pipeCode @@ -56,9 +53,7 @@ "\"START_LONGITUDE_GD\" TEXT);"); // 5: startLongitudeGd } - /** - * Drops the underlying database table. - */ + /** Drops the underlying database table. */ public static void dropTable(Database db, boolean ifExists) { String sql = "DROP TABLE " + (ifExists ? "IF EXISTS " : "") + "\"PIPE_LOCAL_BEAN\""; db.execSQL(sql); @@ -67,32 +62,32 @@ @Override protected final void bindValues(DatabaseStatement stmt, PipeLocalBean entity) { stmt.clearBindings(); - + Long id = entity.getId(); if (id != null) { stmt.bindLong(1, id); } - + String pipeCode = entity.getPipeCode(); if (pipeCode != null) { stmt.bindString(2, pipeCode); } - + String endLatitudeGd = entity.getEndLatitudeGd(); if (endLatitudeGd != null) { stmt.bindString(3, endLatitudeGd); } - + String endLongitudeGd = entity.getEndLongitudeGd(); if (endLongitudeGd != null) { stmt.bindString(4, endLongitudeGd); } - + String startLatitudeGd = entity.getStartLatitudeGd(); if (startLatitudeGd != null) { stmt.bindString(5, startLatitudeGd); } - + String startLongitudeGd = entity.getStartLongitudeGd(); if (startLongitudeGd != null) { stmt.bindString(6, startLongitudeGd); @@ -102,32 +97,32 @@ @Override protected final void bindValues(SQLiteStatement stmt, PipeLocalBean entity) { stmt.clearBindings(); - + Long id = entity.getId(); if (id != null) { stmt.bindLong(1, id); } - + String pipeCode = entity.getPipeCode(); if (pipeCode != null) { stmt.bindString(2, pipeCode); } - + String endLatitudeGd = entity.getEndLatitudeGd(); if (endLatitudeGd != null) { stmt.bindString(3, endLatitudeGd); } - + String endLongitudeGd = entity.getEndLongitudeGd(); if (endLongitudeGd != null) { stmt.bindString(4, endLongitudeGd); } - + String startLatitudeGd = entity.getStartLatitudeGd(); if (startLatitudeGd != null) { stmt.bindString(5, startLatitudeGd); } - + String startLongitudeGd = entity.getStartLongitudeGd(); if (startLongitudeGd != null) { stmt.bindString(6, startLongitudeGd); @@ -137,21 +132,21 @@ @Override public Long readKey(Cursor cursor, int offset) { return cursor.isNull(offset + 0) ? null : cursor.getLong(offset + 0); - } + } @Override public PipeLocalBean readEntity(Cursor cursor, int offset) { PipeLocalBean entity = new PipeLocalBean( // - cursor.isNull(offset + 0) ? null : cursor.getLong(offset + 0), // id - cursor.isNull(offset + 1) ? null : cursor.getString(offset + 1), // pipeCode - cursor.isNull(offset + 2) ? null : cursor.getString(offset + 2), // endLatitudeGd - cursor.isNull(offset + 3) ? null : cursor.getString(offset + 3), // endLongitudeGd - cursor.isNull(offset + 4) ? null : cursor.getString(offset + 4), // startLatitudeGd - cursor.isNull(offset + 5) ? null : cursor.getString(offset + 5) // startLongitudeGd + cursor.isNull(offset + 0) ? null : cursor.getLong(offset + 0), // id + cursor.isNull(offset + 1) ? null : cursor.getString(offset + 1), // pipeCode + cursor.isNull(offset + 2) ? null : cursor.getString(offset + 2), // endLatitudeGd + cursor.isNull(offset + 3) ? null : cursor.getString(offset + 3), // endLongitudeGd + cursor.isNull(offset + 4) ? null : cursor.getString(offset + 4), // startLatitudeGd + cursor.isNull(offset + 5) ? null : cursor.getString(offset + 5) // startLongitudeGd ); return entity; } - + @Override public void readEntity(Cursor cursor, PipeLocalBean entity, int offset) { entity.setId(cursor.isNull(offset + 0) ? null : cursor.getLong(offset + 0)); @@ -160,17 +155,17 @@ entity.setEndLongitudeGd(cursor.isNull(offset + 3) ? null : cursor.getString(offset + 3)); entity.setStartLatitudeGd(cursor.isNull(offset + 4) ? null : cursor.getString(offset + 4)); entity.setStartLongitudeGd(cursor.isNull(offset + 5) ? null : cursor.getString(offset + 5)); - } - + } + @Override protected final Long updateKeyAfterInsert(PipeLocalBean entity, long rowId) { entity.setId(rowId); return rowId; } - + @Override public Long getKey(PipeLocalBean entity) { - if (entity != null) { + if(entity != null) { return entity.getId(); } else { return null; @@ -186,5 +181,5 @@ protected final boolean isEntityUpdateable() { return true; } - + } diff --git a/app/src/main/java/com/casic/app/smartwell/view/ChangePasswordActivity.kt b/app/src/main/java/com/casic/app/smartwell/view/ChangePasswordActivity.kt index 8e41039..9f1dd40 100644 --- a/app/src/main/java/com/casic/app/smartwell/view/ChangePasswordActivity.kt +++ b/app/src/main/java/com/casic/app/smartwell/view/ChangePasswordActivity.kt @@ -14,7 +14,7 @@ import com.pengxh.kt.lite.extensions.show import com.pengxh.kt.lite.utils.ActivityStackManager import com.pengxh.kt.lite.utils.LoadState -import com.pengxh.kt.lite.utils.LoadingDialogHub +import com.pengxh.kt.lite.utils.LoadingDialog import com.pengxh.kt.lite.widget.TitleBarView import java.nio.charset.StandardCharsets @@ -46,15 +46,15 @@ override fun observeRequestState() { userViewModel.loadState.observe(this) { when (it) { - is LoadState.Loading -> LoadingDialogHub.show(this, "修改中,请稍后") + is LoadState.Loading -> LoadingDialog.show(this, "修改中,请稍后") is LoadState.Success -> { - LoadingDialogHub.dismiss() + LoadingDialog.dismiss() AuthenticationHelper.removeToken() this.navigatePageTo() ActivityStackManager.finishAllActivity() } - else -> LoadingDialogHub.dismiss() + else -> LoadingDialog.dismiss() } } } diff --git a/app/src/main/java/com/casic/app/smartwell/view/DeployedWellActivity.kt b/app/src/main/java/com/casic/app/smartwell/view/DeployedWellActivity.kt index fb4339c..28a5078 100644 --- a/app/src/main/java/com/casic/app/smartwell/view/DeployedWellActivity.kt +++ b/app/src/main/java/com/casic/app/smartwell/view/DeployedWellActivity.kt @@ -83,8 +83,8 @@ } //添加分割线 - binding.deployedListView.addItemDecoration( - RecyclerViewItemOffsets(0, 5, 0, 5) + binding.recyclerView.addItemDecoration( + RecyclerViewItemOffsets(0, 7, 0, 7) ) } @@ -149,12 +149,11 @@ } else { item.deep.toString() + "m" } - viewHolder.setText(R.id.wellNameView, item.wellName) + viewHolder.setText(R.id.wellTypeView, item.wellTypeName) .setText(R.id.wellDepthView, "深:${deep}") .setText(R.id.wellCodeView, "点位编号:${item.wellCode}") - .setText(R.id.wellTypeView, "点位类型:${item.wellTypeName}") .setText(R.id.ownerShipView, "权属单位:${item.deptName}") - .setText(R.id.wellLocationView, "点位置:${item.position}") + .setText(R.id.wellLocationView, "点位位置:${item.position}") .setOnClickListener( R.id.operationButton, object : View.OnClickListener { override fun onClick(v: View?) { @@ -207,7 +206,7 @@ }) } } - binding.deployedListView.adapter = deployAdapter + binding.recyclerView.adapter = deployAdapter deployAdapter.setOnItemClickedListener(object : NormalRecyclerAdapter.OnItemClickedListener { override fun onItemClicked(position: Int, t: WellListModel.DataBean.RowsBean) { diff --git a/app/src/main/java/com/casic/app/smartwell/view/LoginActivity.kt b/app/src/main/java/com/casic/app/smartwell/view/LoginActivity.kt index e4bb0e3..834527b 100644 --- a/app/src/main/java/com/casic/app/smartwell/view/LoginActivity.kt +++ b/app/src/main/java/com/casic/app/smartwell/view/LoginActivity.kt @@ -21,7 +21,7 @@ import com.pengxh.kt.lite.extensions.navigatePageTo import com.pengxh.kt.lite.extensions.readAssetsFile import com.pengxh.kt.lite.extensions.show -import com.pengxh.kt.lite.utils.LoadingDialogHub +import com.pengxh.kt.lite.utils.LoadingDialog import com.pengxh.kt.lite.utils.SaveKeyValues import kotlinx.coroutines.Dispatchers import kotlinx.coroutines.launch @@ -106,11 +106,11 @@ override fun observeRequestState() { authenticateViewModel.loadState.observe(this) { - LoadingDialogHub.show(this, "登录中,请稍后") + LoadingDialog.show(this, "登录中,请稍后") } loginViewModel.loadState.observe(this) { - LoadingDialogHub.dismiss() + LoadingDialog.dismiss() } } diff --git a/app/src/main/java/com/casic/app/smartwell/view/OrderCompletedDetailActivity.kt b/app/src/main/java/com/casic/app/smartwell/view/OrderCompletedDetailActivity.kt index db8ad1f..75cd905 100644 --- a/app/src/main/java/com/casic/app/smartwell/view/OrderCompletedDetailActivity.kt +++ b/app/src/main/java/com/casic/app/smartwell/view/OrderCompletedDetailActivity.kt @@ -17,7 +17,7 @@ import com.pengxh.kt.lite.extensions.show import com.pengxh.kt.lite.utils.Constant import com.pengxh.kt.lite.utils.LoadState -import com.pengxh.kt.lite.utils.LoadingDialogHub +import com.pengxh.kt.lite.utils.LoadingDialog import com.pengxh.kt.lite.widget.TitleBarView import com.pengxh.kt.lite.widget.dialog.AlertMessageDialog @@ -44,7 +44,7 @@ } override fun initOnCreate(savedInstanceState: Bundle?) { - val jobId = intent.getStringExtra(Constant.INTENT_PARAM)!! + val jobId = intent.getStringExtra(Constant.INTENT_PARAM_KEY)!! orderViewModel = ViewModelProvider(this)[OrderViewModel::class.java] orderViewModel.getWorkOrderDetail(jobId) orderViewModel.detailModel.observe(this) { @@ -154,8 +154,8 @@ override fun observeRequestState() { orderViewModel.loadState.observe(this) { when (it) { - is LoadState.Loading -> LoadingDialogHub.show(this, "数据加载中,请稍后") - else -> LoadingDialogHub.dismiss() + is LoadState.Loading -> LoadingDialog.show(this, "数据加载中,请稍后") + else -> LoadingDialog.dismiss() } } } diff --git a/app/src/main/java/com/casic/app/smartwell/view/OrderInHandleDetailActivity.kt b/app/src/main/java/com/casic/app/smartwell/view/OrderInHandleDetailActivity.kt index d70a979..04a7d5d 100644 --- a/app/src/main/java/com/casic/app/smartwell/view/OrderInHandleDetailActivity.kt +++ b/app/src/main/java/com/casic/app/smartwell/view/OrderInHandleDetailActivity.kt @@ -38,7 +38,7 @@ import com.pengxh.kt.lite.extensions.show import com.pengxh.kt.lite.utils.Constant import com.pengxh.kt.lite.utils.LoadState -import com.pengxh.kt.lite.utils.LoadingDialogHub +import com.pengxh.kt.lite.utils.LoadingDialog import com.pengxh.kt.lite.widget.TitleBarView import com.pengxh.kt.lite.widget.dialog.AlertControlDialog import com.pengxh.kt.lite.widget.dialog.AlertMessageDialog @@ -93,7 +93,7 @@ ) binding.addImageRecyclerView.adapter = imageAdapter - val jobId = intent.getStringExtra(Constant.INTENT_PARAM)!!//初始化图片九宫格 + val jobId = intent.getStringExtra(Constant.INTENT_PARAM_KEY)!!//初始化图片九宫格 orderViewModel.getWorkOrderDetail(jobId) orderViewModel.detailModel.observe(this) { if (it.code == 200) { @@ -312,41 +312,41 @@ override fun observeRequestState() { orderViewModel.loadState.observe(this) { when (it) { - is LoadState.Loading -> LoadingDialogHub.show(this, "数据加载中,请稍后") - else -> LoadingDialogHub.dismiss() + is LoadState.Loading -> LoadingDialog.show(this, "数据加载中,请稍后") + else -> LoadingDialog.dismiss() } } uploadImageViewModel.loadState.observe(this) { when (it) { - LoadState.Loading -> LoadingDialogHub.show(this, "图片上传中,请稍后...") - else -> LoadingDialogHub.dismiss() + LoadState.Loading -> LoadingDialog.show(this, "图片上传中,请稍后...") + else -> LoadingDialog.dismiss() } } //转单状态处理 operationViewModel.loadState.observe(this) { when (it) { - is LoadState.Loading -> LoadingDialogHub.show(this, "转单中,请稍后") + is LoadState.Loading -> LoadingDialog.show(this, "转单中,请稍后") is LoadState.Success -> { - LoadingDialogHub.dismiss() + LoadingDialog.dismiss() this.finish() } - else -> LoadingDialogHub.dismiss() + else -> LoadingDialog.dismiss() } } //处理完成工单状态处理 operationViewModel.loadState.observe(this) { when (it) { - is LoadState.Loading -> LoadingDialogHub.show(this, "处理中,请稍后") + is LoadState.Loading -> LoadingDialog.show(this, "处理中,请稍后") is LoadState.Success -> { - LoadingDialogHub.dismiss() + LoadingDialog.dismiss() this.finish() } - else -> LoadingDialogHub.dismiss() + else -> LoadingDialog.dismiss() } } } diff --git a/app/src/main/java/com/casic/app/smartwell/view/OrderNotConfirmedDetailActivity.kt b/app/src/main/java/com/casic/app/smartwell/view/OrderNotConfirmedDetailActivity.kt index 8e036d2..687ec86 100644 --- a/app/src/main/java/com/casic/app/smartwell/view/OrderNotConfirmedDetailActivity.kt +++ b/app/src/main/java/com/casic/app/smartwell/view/OrderNotConfirmedDetailActivity.kt @@ -36,7 +36,7 @@ import com.pengxh.kt.lite.extensions.show import com.pengxh.kt.lite.utils.Constant import com.pengxh.kt.lite.utils.LoadState -import com.pengxh.kt.lite.utils.LoadingDialogHub +import com.pengxh.kt.lite.utils.LoadingDialog import com.pengxh.kt.lite.widget.TitleBarView import com.pengxh.kt.lite.widget.dialog.AlertControlDialog import com.pengxh.kt.lite.widget.dialog.AlertMessageDialog @@ -80,7 +80,7 @@ } override fun initOnCreate(savedInstanceState: Bundle?) { - val jobId = intent.getStringExtra(Constant.INTENT_PARAM)!! + val jobId = intent.getStringExtra(Constant.INTENT_PARAM_KEY)!! //初始化图片九宫格 //左外边距,左内边距,右内边距,右外边距 val viewWidth = getScreenWidth() - (10 + 10 + 10 + 10).dp2px(this) @@ -263,41 +263,41 @@ //数据加载状态处理 orderViewModel.loadState.observe(this) { when (it) { - is LoadState.Loading -> LoadingDialogHub.show(this, "数据加载中,请稍后") - else -> LoadingDialogHub.dismiss() + is LoadState.Loading -> LoadingDialog.show(this, "数据加载中,请稍后") + else -> LoadingDialog.dismiss() } } uploadImageViewModel.loadState.observe(this) { when (it) { - LoadState.Loading -> LoadingDialogHub.show(this, "图片上传中,请稍后") - else -> LoadingDialogHub.dismiss() + LoadState.Loading -> LoadingDialog.show(this, "图片上传中,请稍后") + else -> LoadingDialog.dismiss() } } //转单状态处理 operationViewModel.loadState.observe(this) { when (it) { - is LoadState.Loading -> LoadingDialogHub.show(this, "转单中,请稍后") + is LoadState.Loading -> LoadingDialog.show(this, "转单中,请稍后") is LoadState.Success -> { - LoadingDialogHub.dismiss() + LoadingDialog.dismiss() this.finish() } - else -> LoadingDialogHub.dismiss() + else -> LoadingDialog.dismiss() } } //确认工单状态处理 operationViewModel.loadState.observe(this) { when (it) { - is LoadState.Loading -> LoadingDialogHub.show(this, "处理中,请稍后") + is LoadState.Loading -> LoadingDialog.show(this, "处理中,请稍后") is LoadState.Success -> { - LoadingDialogHub.dismiss() + LoadingDialog.dismiss() this.finish() } - else -> LoadingDialogHub.dismiss() + else -> LoadingDialog.dismiss() } } } diff --git a/app/src/main/java/com/casic/app/smartwell/view/OrderNotProcessedDetailActivity.kt b/app/src/main/java/com/casic/app/smartwell/view/OrderNotProcessedDetailActivity.kt index d3f22dc..0c97a52 100644 --- a/app/src/main/java/com/casic/app/smartwell/view/OrderNotProcessedDetailActivity.kt +++ b/app/src/main/java/com/casic/app/smartwell/view/OrderNotProcessedDetailActivity.kt @@ -18,7 +18,7 @@ import com.pengxh.kt.lite.extensions.show import com.pengxh.kt.lite.utils.Constant import com.pengxh.kt.lite.utils.LoadState -import com.pengxh.kt.lite.utils.LoadingDialogHub +import com.pengxh.kt.lite.utils.LoadingDialog import com.pengxh.kt.lite.widget.TitleBarView import com.pengxh.kt.lite.widget.dialog.AlertControlDialog import com.pengxh.kt.lite.widget.dialog.AlertMessageDialog @@ -50,7 +50,7 @@ } override fun initOnCreate(savedInstanceState: Bundle?) { - this.jobId = intent.getStringExtra(Constant.INTENT_PARAM)!! + this.jobId = intent.getStringExtra(Constant.INTENT_PARAM_KEY)!! orderViewModel = ViewModelProvider(this)[OrderViewModel::class.java] operationViewModel = ViewModelProvider(this)[OperationViewModel::class.java] wellViewModel = ViewModelProvider(this)[WellViewModel::class.java] @@ -162,21 +162,21 @@ //数据加载状态处理 orderViewModel.loadState.observe(this) { when (it) { - is LoadState.Loading -> LoadingDialogHub.show(this, "数据加载中,请稍后") - else -> LoadingDialogHub.dismiss() + is LoadState.Loading -> LoadingDialog.show(this, "数据加载中,请稍后") + else -> LoadingDialog.dismiss() } } //接单状态处理 operationViewModel.loadState.observe(this) { when (it) { - is LoadState.Loading -> LoadingDialogHub.show(this, "接单中,请稍后") + is LoadState.Loading -> LoadingDialog.show(this, "接单中,请稍后") is LoadState.Success -> { - LoadingDialogHub.dismiss() + LoadingDialog.dismiss() this.finish() } - else -> LoadingDialogHub.dismiss() + else -> LoadingDialog.dismiss() } } } diff --git a/app/src/main/java/com/casic/app/smartwell/view/SearchResultActivity.kt b/app/src/main/java/com/casic/app/smartwell/view/SearchResultActivity.kt index 6a92917..4f3a674 100644 --- a/app/src/main/java/com/casic/app/smartwell/view/SearchResultActivity.kt +++ b/app/src/main/java/com/casic/app/smartwell/view/SearchResultActivity.kt @@ -19,7 +19,7 @@ import com.pengxh.kt.lite.extensions.show import com.pengxh.kt.lite.utils.Constant import com.pengxh.kt.lite.utils.LoadState -import com.pengxh.kt.lite.utils.LoadingDialogHub +import com.pengxh.kt.lite.utils.LoadingDialog import com.pengxh.kt.lite.utils.WeakReferenceHandler import com.pengxh.kt.lite.widget.TitleBarView import com.pengxh.kt.lite.widget.dialog.AlertControlDialog @@ -56,7 +56,7 @@ } override fun initOnCreate(savedInstanceState: Bundle?) { - args = intent.getStringArrayListExtra(Constant.INTENT_PARAM)!! + args = intent.getStringArrayListExtra(Constant.INTENT_PARAM_KEY)!! orderViewModel = ViewModelProvider(this)[OrderViewModel::class.java] operationViewModel = ViewModelProvider(this)[OperationViewModel::class.java] @@ -101,24 +101,24 @@ } } - binding.resultRecyclerView.addItemDecoration( - RecyclerViewItemOffsets(0, 5, 0, 5) + binding.recyclerView.addItemDecoration( + RecyclerViewItemOffsets(0, 7, 0, 7) ) } override fun observeRequestState() { orderViewModel.loadState.observe(this) { when (it) { - is LoadState.Loading -> LoadingDialogHub.show(this, "数据加载中,请稍后") - else -> LoadingDialogHub.dismiss() + is LoadState.Loading -> LoadingDialog.show(this, "数据加载中,请稍后") + else -> LoadingDialog.dismiss() } } //接单状态处理 operationViewModel.loadState.observe(this) { when (it) { - is LoadState.Loading -> LoadingDialogHub.show(this, "接单中,请稍后") + is LoadState.Loading -> LoadingDialog.show(this, "接单中,请稍后") is LoadState.Success -> { - LoadingDialogHub.dismiss() + LoadingDialog.dismiss() //接单成功之后刷新列表 dataBeans.removeAt(clickedPosition) searchResultAdapter.notifyItemRemoved(clickedPosition) @@ -127,7 +127,7 @@ ) } - else -> LoadingDialogHub.dismiss() + else -> LoadingDialog.dismiss() } } } @@ -162,7 +162,7 @@ } else { binding.emptyInclude.emptyView.hide() searchResultAdapter = SearchResultAdapter(this, dataBeans) - binding.resultRecyclerView.adapter = searchResultAdapter + binding.recyclerView.adapter = searchResultAdapter searchResultAdapter.setOnItemClickListener(object : SearchResultAdapter.OnItemClickListener { override fun onClicked(position: Int) { diff --git a/app/src/main/java/com/casic/app/smartwell/view/UnDeployWellActivity.kt b/app/src/main/java/com/casic/app/smartwell/view/UnDeployWellActivity.kt index 7f7cd3c..555c278 100644 --- a/app/src/main/java/com/casic/app/smartwell/view/UnDeployWellActivity.kt +++ b/app/src/main/java/com/casic/app/smartwell/view/UnDeployWellActivity.kt @@ -81,8 +81,8 @@ } } - binding.undeployListView.addItemDecoration( - RecyclerViewItemOffsets(0, 5, 0, 5) + binding.recyclerView.addItemDecoration( + RecyclerViewItemOffsets(0, 7, 0, 7) ) } @@ -147,12 +147,11 @@ } else { item.deep.toString() + "m" } - viewHolder.setText(R.id.wellNameView, item.wellName) + viewHolder.setText(R.id.wellTypeView, item.wellTypeName) .setText(R.id.wellDepthView, "深:${deep}") .setText(R.id.wellCodeView, "点位编号:${item.wellCode}") - .setText(R.id.wellTypeView, "点位类型:${item.wellTypeName}") .setText(R.id.ownerShipView, "权属单位:${item.deptName}") - .setText(R.id.wellLocationView, "点位置:${item.position}") + .setText(R.id.wellLocationView, "点位位置:${item.position}") .setOnClickListener( R.id.operationButton, object : View.OnClickListener { override fun onClick(v: View?) { @@ -185,7 +184,7 @@ ) } } - binding.undeployListView.adapter = unDeployAdapter + binding.recyclerView.adapter = unDeployAdapter unDeployAdapter.setOnItemClickedListener(object : NormalRecyclerAdapter.OnItemClickedListener { override fun onItemClicked(position: Int, t: WellListModel.DataBean.RowsBean) { diff --git a/app/src/main/java/com/casic/app/smartwell/view/WellDetailActivity.kt b/app/src/main/java/com/casic/app/smartwell/view/WellDetailActivity.kt index b50d067..eb8b468 100644 --- a/app/src/main/java/com/casic/app/smartwell/view/WellDetailActivity.kt +++ b/app/src/main/java/com/casic/app/smartwell/view/WellDetailActivity.kt @@ -16,7 +16,7 @@ import com.pengxh.kt.lite.extensions.show import com.pengxh.kt.lite.utils.Constant import com.pengxh.kt.lite.utils.LoadState -import com.pengxh.kt.lite.utils.LoadingDialogHub +import com.pengxh.kt.lite.utils.LoadingDialog import com.pengxh.kt.lite.widget.TitleBarView import com.pengxh.kt.lite.widget.dialog.AlertMessageDialog @@ -44,7 +44,7 @@ } override fun initOnCreate(savedInstanceState: Bundle?) { - val wellId = intent.getStringExtra(Constant.INTENT_PARAM)!! + val wellId = intent.getStringExtra(Constant.INTENT_PARAM_KEY)!! wellViewModel = ViewModelProvider(this)[WellViewModel::class.java] wellViewModel.getWellDetail(wellId) wellViewModel.wellDetailModel.observe(this) { @@ -132,8 +132,8 @@ override fun observeRequestState() { wellViewModel.loadState.observe(this) { when (it) { - is LoadState.Loading -> LoadingDialogHub.show(this, "数据加载中,请稍后") - else -> LoadingDialogHub.dismiss() + is LoadState.Loading -> LoadingDialog.show(this, "数据加载中,请稍后") + else -> LoadingDialog.dismiss() } } } diff --git a/app/src/main/java/com/casic/app/smartwell/view/WellManagementActivity.kt b/app/src/main/java/com/casic/app/smartwell/view/WellManagementActivity.kt index 084da95..457096b 100644 --- a/app/src/main/java/com/casic/app/smartwell/view/WellManagementActivity.kt +++ b/app/src/main/java/com/casic/app/smartwell/view/WellManagementActivity.kt @@ -94,8 +94,8 @@ } } - binding.wellListView.addItemDecoration( - RecyclerViewItemOffsets(0, 5, 0, 5) + binding.recyclerView.addItemDecoration( + RecyclerViewItemOffsets(0, 7, 0, 7) ) } @@ -175,13 +175,12 @@ } else { item.deep.toString() + "m" } - viewHolder.setText(R.id.wellNameView, item.wellName) + viewHolder.setText(R.id.wellTypeView, item.wellTypeName) .setText(R.id.wellStateView, "已${item.bfztName}") .setText(R.id.wellDepthView, "深:${deep}") .setText(R.id.wellCodeView, "点位编号:${item.wellCode}") - .setText(R.id.wellTypeView, "点位类型:${item.wellTypeName}") .setText(R.id.ownerShipView, "权属单位:${item.deptName}") - .setText(R.id.wellLocationView, "点位置:${item.position}") + .setText(R.id.wellLocationView, "点位位置:${item.position}") .setOnClickListener( R.id.navigationButton, object : View.OnClickListener { override fun onClick(v: View?) { @@ -200,7 +199,7 @@ ) } } - binding.wellListView.adapter = wellListAdapter + binding.recyclerView.adapter = wellListAdapter wellListAdapter.setOnItemClickedListener(object : NormalRecyclerAdapter.OnItemClickedListener { override fun onItemClicked(position: Int, t: WellListModel.DataBean.RowsBean) { diff --git a/app/src/main/java/com/casic/app/smartwell/view/WellMonitorActivity.kt b/app/src/main/java/com/casic/app/smartwell/view/WellMonitorActivity.kt index e3573eb..b87bdb7 100644 --- a/app/src/main/java/com/casic/app/smartwell/view/WellMonitorActivity.kt +++ b/app/src/main/java/com/casic/app/smartwell/view/WellMonitorActivity.kt @@ -11,7 +11,7 @@ import com.pengxh.kt.lite.base.KotlinBaseActivity import com.pengxh.kt.lite.utils.Constant import com.pengxh.kt.lite.utils.LoadState -import com.pengxh.kt.lite.utils.LoadingDialogHub +import com.pengxh.kt.lite.utils.LoadingDialog import com.pengxh.kt.lite.widget.TitleBarView class WellMonitorActivity : KotlinBaseActivity() { @@ -36,7 +36,7 @@ } override fun initOnCreate(savedInstanceState: Bundle?) { - val wellId = intent.getStringExtra(Constant.INTENT_PARAM)!! + val wellId = intent.getStringExtra(Constant.INTENT_PARAM_KEY)!! wellViewModel = ViewModelProvider(this)[WellViewModel::class.java] wellViewModel.getMonitorResult(wellId) wellViewModel.monitorModel.observe(this) { @@ -56,8 +56,8 @@ override fun observeRequestState() { wellViewModel.loadState.observe(this) { when (it) { - is LoadState.Loading -> LoadingDialogHub.show(this, "数据加载中,请稍后") - else -> LoadingDialogHub.dismiss() + is LoadState.Loading -> LoadingDialog.show(this, "数据加载中,请稍后") + else -> LoadingDialog.dismiss() } } } diff --git a/app/src/main/java/com/casic/app/smartwell/view/WellOperationActivity.kt b/app/src/main/java/com/casic/app/smartwell/view/WellOperationActivity.kt index 8d333bf..347ebb6 100644 --- a/app/src/main/java/com/casic/app/smartwell/view/WellOperationActivity.kt +++ b/app/src/main/java/com/casic/app/smartwell/view/WellOperationActivity.kt @@ -23,7 +23,7 @@ import com.pengxh.kt.lite.extensions.navigatePageTo import com.pengxh.kt.lite.extensions.show import com.pengxh.kt.lite.utils.LoadState -import com.pengxh.kt.lite.utils.LoadingDialogHub +import com.pengxh.kt.lite.utils.LoadingDialog import com.pengxh.kt.lite.utils.WeakReferenceHandler import com.pengxh.kt.lite.widget.dialog.AlertControlDialog @@ -109,8 +109,8 @@ } } - binding.operationListView.addItemDecoration( - RecyclerViewItemOffsets(0, 5, 0, 5) + binding.recyclerView.addItemDecoration( + RecyclerViewItemOffsets(0, 7, 0, 7) ) } @@ -123,13 +123,13 @@ override fun observeRequestState() { wellViewModel.loadState.observe(this) { when (it) { - is LoadState.Loading -> LoadingDialogHub.show(this, "处理中,请稍后") + is LoadState.Loading -> LoadingDialog.show(this, "处理中,请稍后") is LoadState.Success -> { - LoadingDialogHub.dismiss() + LoadingDialog.dismiss() wellOperationAdapter.notifyItemChanged(clickedPosition) } - else -> LoadingDialogHub.dismiss() + else -> LoadingDialog.dismiss() } } } @@ -203,24 +203,23 @@ if (item.bfztName == "布防") { viewHolder.setImageResource( R.id.wellStateView, R.drawable.bg_solid_text_green_radius_5 - ).setText(R.id.wellStateView, "撤防") + ).setText(R.id.operationButton, "撤防") } else { viewHolder.setImageResource( R.id.wellStateView, R.drawable.bg_solid_text_red_radius_5 - ).setText(R.id.wellStateView, "布防") + ).setText(R.id.operationButton, "布防") } val deep = if (item.deep.toString().isBlank()) { "未知" } else { item.deep.toString() + "m" } - viewHolder.setText(R.id.wellNameView, item.wellName) + viewHolder.setText(R.id.wellTypeView, item.wellTypeName) .setText(R.id.wellStateView, "已${item.bfztName}") .setText(R.id.wellDepthView, "深:${deep}") .setText(R.id.wellCodeView, "点位编号:${item.wellCode}") - .setText(R.id.wellTypeView, "点位类型:${item.wellTypeName}") .setText(R.id.ownerShipView, "权属单位:${item.deptName}") - .setText(R.id.wellLocationView, "点位置:${item.position}") + .setText(R.id.wellLocationView, "点位位置:${item.position}") .setOnClickListener( R.id.operationButton, object : View.OnClickListener { override fun onClick(v: View?) { @@ -280,7 +279,7 @@ ) } } - binding.operationListView.adapter = wellOperationAdapter + binding.recyclerView.adapter = wellOperationAdapter wellOperationAdapter.setOnItemClickedListener(object : NormalRecyclerAdapter.OnItemClickedListener { override fun onItemClicked(position: Int, t: WellListModel.DataBean.RowsBean) { diff --git a/app/src/main/res/drawable/ic_down.xml b/app/src/main/res/drawable/ic_down.xml index 20e6476..6987e6c 100644 --- a/app/src/main/res/drawable/ic_down.xml +++ b/app/src/main/res/drawable/ic_down.xml @@ -1,6 +1,6 @@ + + diff --git a/app/src/main/res/layout/activity_about_us.xml b/app/src/main/res/layout/activity_about_us.xml index 9091a00..d5fbd0d 100644 --- a/app/src/main/res/layout/activity_about_us.xml +++ b/app/src/main/res/layout/activity_about_us.xml @@ -12,13 +12,7 @@ android:layout_width="match_parent" android:layout_height="wrap_content" android:background="@color/mainThemeColor" - app:tbv_left_image="@drawable/ic_title_left" - app:tbv_only_show_title="false" - app:tbv_show_left_image="true" - app:tbv_show_right_image="false" - app:tbv_text="关于我们" - app:tbv_text_color="@color/white" - app:tbv_text_size="@dimen/sp_18" /> + app:tbv_text="关于我们" /> + app:tbv_text="修改密码" /> + app:tbv_text="布防列表" /> + app:tbv_text="帮助中心" /> + app:tbv_text="工单详情" /> + app:tbv_text="工单详情" /> + app:tbv_text="工单详情" /> + app:tbv_text="工单详情" /> + app:tbv_text="超时工单" /> + app:tbv_text="工单查询" /> + app:tbv_text="查询结果" /> + app:tbv_text="撤防列表" /> - + + android:value="ee96d8b5e12de3fbb29949efd57418a8" /> () @@ -150,7 +158,7 @@ val cameraPosition = CameraPosition(centerLatLng, 14f, 0f, 0f) val cameraUpdate = CameraUpdateFactory.newCameraPosition(cameraPosition) withContext(Dispatchers.Main) { - LoadingDialogHub.dismiss() + LoadingDialog.dismiss() aMap.animateCamera(cameraUpdate, 1500, null) } } @@ -239,11 +247,6 @@ } override fun initEvent() { - binding.rightOptionView.setOnClickListener { - val x = binding.rightOptionView.width - easyPopupWindow.width - easyPopupWindow.showAsDropDown(binding.rightOptionView, x, 0) - } - //撤防点位 binding.unDeployedLayout.setOnClickListener { requireContext().navigatePageTo() @@ -263,11 +266,11 @@ override fun observeRequestState() { wellViewModel.loadState.observe(this) { when (it) { - is LoadState.Loading -> LoadingDialogHub.show( + is LoadState.Loading -> LoadingDialog.show( requireActivity(), "数据加载中,请稍后..." ) - else -> LoadingDialogHub.dismiss() + else -> LoadingDialog.dismiss() } } } @@ -376,7 +379,7 @@ }).build().show() } }) - infoPopup.showAsDropDown(binding.rightOptionView) +// infoPopup.showAsDropDown(binding.rightOptionView) } override fun onCameraChange(p0: CameraPosition?) { diff --git a/app/src/main/java/com/casic/app/smartwell/fragment/HomePageNoClusterFragment.kt b/app/src/main/java/com/casic/app/smartwell/fragment/HomePageNoClusterFragment.kt index 802426a..b25f743 100644 --- a/app/src/main/java/com/casic/app/smartwell/fragment/HomePageNoClusterFragment.kt +++ b/app/src/main/java/com/casic/app/smartwell/fragment/HomePageNoClusterFragment.kt @@ -38,8 +38,9 @@ import com.pengxh.kt.lite.extensions.navigatePageTo import com.pengxh.kt.lite.extensions.show import com.pengxh.kt.lite.utils.LoadState -import com.pengxh.kt.lite.utils.LoadingDialogHub +import com.pengxh.kt.lite.utils.LoadingDialog import com.pengxh.kt.lite.widget.EasyPopupWindow +import com.pengxh.kt.lite.widget.TitleBarView import com.pengxh.kt.lite.widget.dialog.AlertControlDialog import kotlinx.coroutines.Dispatchers import kotlinx.coroutines.launch @@ -78,7 +79,15 @@ override fun setupTopBarLayout() { binding.rootView.initImmersionBar(this, false, R.color.mainThemeColor) - binding.titleView.text = "首页" + binding.titleView.setOnClickListener(object : TitleBarView.OnClickListener { + override fun onLeftClick() { + + } + + override fun onRightClick() { + easyPopupWindow.showAsDropDown(binding.titleView, binding.titleView.width, 0) + } + }) } override fun initOnCreate(savedInstanceState: Bundle?) { @@ -112,7 +121,7 @@ //渲染井位置 lifecycleScope.launch(Dispatchers.Main) { - LoadingDialogHub.show(requireActivity(), "数据加载中,请稍后") + LoadingDialog.show(requireActivity(), "数据加载中,请稍后") withContext(Dispatchers.IO) { //取Well缓存 val allMarkerOptions = ArrayList() @@ -144,7 +153,7 @@ val cameraPosition = CameraPosition(centerLatLng, 14f, 0f, 0f) val cameraUpdate = CameraUpdateFactory.newCameraPosition(cameraPosition) withContext(Dispatchers.Main) { - LoadingDialogHub.dismiss() + LoadingDialog.dismiss() aMap.animateCamera(cameraUpdate, 1500, null) } } @@ -238,11 +247,6 @@ } override fun initEvent() { - binding.rightOptionView.setOnClickListener { - val x = binding.rightOptionView.width - easyPopupWindow.width - easyPopupWindow.showAsDropDown(binding.rightOptionView, x, 0) - } - //撤防点位 binding.unDeployedLayout.setOnClickListener { requireContext().navigatePageTo() @@ -262,11 +266,11 @@ override fun observeRequestState() { wellViewModel.loadState.observe(this) { when (it) { - is LoadState.Loading -> LoadingDialogHub.show( + is LoadState.Loading -> LoadingDialog.show( requireActivity(), "数据加载中,请稍后..." ) - else -> LoadingDialogHub.dismiss() + else -> LoadingDialog.dismiss() } } } diff --git a/app/src/main/java/com/casic/app/smartwell/fragment/MinePageFragment.kt b/app/src/main/java/com/casic/app/smartwell/fragment/MinePageFragment.kt index 09a570c..dcb48f8 100644 --- a/app/src/main/java/com/casic/app/smartwell/fragment/MinePageFragment.kt +++ b/app/src/main/java/com/casic/app/smartwell/fragment/MinePageFragment.kt @@ -35,7 +35,7 @@ import com.pengxh.kt.lite.utils.ActivityStackManager import com.pengxh.kt.lite.utils.FileDownloadManager import com.pengxh.kt.lite.utils.LoadState -import com.pengxh.kt.lite.utils.LoadingDialogHub +import com.pengxh.kt.lite.utils.LoadingDialog import com.pengxh.kt.lite.widget.dialog.AlertControlDialog import com.pengxh.kt.lite.widget.dialog.BottomActionSheet import kotlinx.coroutines.Dispatchers @@ -60,7 +60,6 @@ override fun setupTopBarLayout() { binding.rootView.initImmersionBar(this, false, R.color.mainThemeColor) - binding.titleInclude.titleView.text = "我的" } override fun initOnCreate(savedInstanceState: Bundle?) { @@ -155,27 +154,27 @@ override fun observeRequestState() { userViewModel.loadState.observe(this) { when (it) { - is LoadState.Loading -> LoadingDialogHub.show( + is LoadState.Loading -> LoadingDialog.show( requireActivity(), "检查版本中,请稍后" ) - else -> LoadingDialogHub.dismiss() + else -> LoadingDialog.dismiss() } } wellViewModel.loadState.observe(this) { when (it) { - is LoadState.Loading -> LoadingDialogHub.show( + is LoadState.Loading -> LoadingDialog.show( requireActivity(), "数据更新中,请稍后" ) is LoadState.Fail -> { - LoadingDialogHub.dismiss() + LoadingDialog.dismiss() "数据更新超时".show(requireContext()) } else -> { - LoadingDialogHub.dismiss() + LoadingDialog.dismiss() AlertControlDialog.Builder().setContext(requireContext()).setTitle("温馨提示") .setMessage("数据更新成功,请重启应用").setNegativeButton("取消") .setPositiveButton("确定").setOnDialogButtonClickListener(object : @@ -197,17 +196,17 @@ lineViewModel.loadState.observe(this) { when (it) { - is LoadState.Loading -> LoadingDialogHub.show( + is LoadState.Loading -> LoadingDialog.show( requireActivity(), "数据更新中,请稍后" ) is LoadState.Fail -> { - LoadingDialogHub.dismiss() + LoadingDialog.dismiss() "数据更新超时".show(requireContext()) } else -> { - LoadingDialogHub.dismiss() + LoadingDialog.dismiss() AlertControlDialog.Builder().setContext(requireContext()).setTitle("温馨提示") .setMessage("数据更新成功,请重启应用").setNegativeButton("取消") .setPositiveButton("确定").setOnDialogButtonClickListener(object : diff --git a/app/src/main/java/com/casic/app/smartwell/fragment/NoticePageFragment.kt b/app/src/main/java/com/casic/app/smartwell/fragment/NoticePageFragment.kt index 171b555..3c93f54 100644 --- a/app/src/main/java/com/casic/app/smartwell/fragment/NoticePageFragment.kt +++ b/app/src/main/java/com/casic/app/smartwell/fragment/NoticePageFragment.kt @@ -48,7 +48,6 @@ override fun setupTopBarLayout() { binding.rootView.initImmersionBar(this, false, R.color.mainThemeColor) - binding.titleInclude.titleView.text = "消息" } override fun initOnCreate(savedInstanceState: Bundle?) { diff --git a/app/src/main/java/com/casic/app/smartwell/fragment/OrderListFragment.kt b/app/src/main/java/com/casic/app/smartwell/fragment/OrderListFragment.kt index 93ff35b..5e38acb 100644 --- a/app/src/main/java/com/casic/app/smartwell/fragment/OrderListFragment.kt +++ b/app/src/main/java/com/casic/app/smartwell/fragment/OrderListFragment.kt @@ -12,6 +12,7 @@ import com.casic.app.smartwell.view.SearchOrderActivity import com.pengxh.kt.lite.base.KotlinBaseFragment import com.pengxh.kt.lite.extensions.navigatePageTo +import com.pengxh.kt.lite.widget.TitleBarView class OrderListFragment : KotlinBaseFragment() { @@ -25,15 +26,22 @@ } override fun initViewBinding( - inflater: LayoutInflater, - container: ViewGroup? + inflater: LayoutInflater, container: ViewGroup? ): FragmentOrderBinding { return FragmentOrderBinding.inflate(inflater, container, false) } override fun setupTopBarLayout() { binding.rootView.initImmersionBar(this, false, R.color.mainThemeColor) - binding.titleView.text = "工单" + binding.titleView.setOnClickListener(object : TitleBarView.OnClickListener { + override fun onLeftClick() { + + } + + override fun onRightClick() { + requireContext().navigatePageTo() + } + }) } override fun initOnCreate(savedInstanceState: Bundle?) { @@ -51,8 +59,6 @@ } override fun initEvent() { - binding.rightOptionView.setOnClickListener { - requireContext().navigatePageTo() - } + } } \ No newline at end of file diff --git a/app/src/main/java/com/casic/app/smartwell/fragment/OrderNotProcessedFragment.kt b/app/src/main/java/com/casic/app/smartwell/fragment/OrderNotProcessedFragment.kt index 0b3d09d..2b6f21d 100644 --- a/app/src/main/java/com/casic/app/smartwell/fragment/OrderNotProcessedFragment.kt +++ b/app/src/main/java/com/casic/app/smartwell/fragment/OrderNotProcessedFragment.kt @@ -18,7 +18,7 @@ import com.pengxh.kt.lite.extensions.navigatePageTo import com.pengxh.kt.lite.extensions.show import com.pengxh.kt.lite.utils.LoadState -import com.pengxh.kt.lite.utils.LoadingDialogHub +import com.pengxh.kt.lite.utils.LoadingDialog import com.pengxh.kt.lite.utils.WeakReferenceHandler import com.pengxh.kt.lite.widget.dialog.AlertControlDialog @@ -78,8 +78,8 @@ operationViewModel = ViewModelProvider(this)[OperationViewModel::class.java] - binding.notProcessedView.addItemDecoration( - RecyclerViewItemOffsets(0, 5, 0, 5) + binding.recyclerView.addItemDecoration( + RecyclerViewItemOffsets(0, 7, 0, 7) ) } @@ -87,9 +87,9 @@ //接单状态处理 operationViewModel.loadState.observe(this) { when (it) { - is LoadState.Loading -> LoadingDialogHub.show(requireActivity(), "接单中,请稍后") + is LoadState.Loading -> LoadingDialog.show(requireActivity(), "接单中,请稍后") is LoadState.Success -> { - LoadingDialogHub.dismiss() + LoadingDialog.dismiss() //接单成功之后刷新列表 dataBeans.removeAt(clickedPosition) notProcessedAdapter.notifyItemRemoved(clickedPosition) @@ -98,7 +98,7 @@ ) } - else -> LoadingDialogHub.dismiss() + else -> LoadingDialog.dismiss() } } } @@ -131,7 +131,7 @@ } else { binding.emptyInclude.emptyView.hide() notProcessedAdapter = OrderNotProcessedAdapter(requireContext(), dataBeans) - binding.notProcessedView.adapter = notProcessedAdapter + binding.recyclerView.adapter = notProcessedAdapter notProcessedAdapter.setOnItemClickListener(object : OrderNotProcessedAdapter.OnItemClickListener { override fun onClicked(position: Int) { diff --git a/app/src/main/java/com/casic/app/smartwell/fragment/OvertimeNotAcceptFragment.kt b/app/src/main/java/com/casic/app/smartwell/fragment/OvertimeNotAcceptFragment.kt index a198545..9b318ca 100644 --- a/app/src/main/java/com/casic/app/smartwell/fragment/OvertimeNotAcceptFragment.kt +++ b/app/src/main/java/com/casic/app/smartwell/fragment/OvertimeNotAcceptFragment.kt @@ -18,7 +18,7 @@ import com.pengxh.kt.lite.extensions.navigatePageTo import com.pengxh.kt.lite.extensions.show import com.pengxh.kt.lite.utils.LoadState -import com.pengxh.kt.lite.utils.LoadingDialogHub +import com.pengxh.kt.lite.utils.LoadingDialog import com.pengxh.kt.lite.utils.WeakReferenceHandler import com.pengxh.kt.lite.widget.dialog.AlertControlDialog @@ -81,8 +81,8 @@ operationViewModel = ViewModelProvider(this)[OperationViewModel::class.java] - binding.notProcessedView.addItemDecoration( - RecyclerViewItemOffsets(0, 5, 0, 5) + binding.recyclerView.addItemDecoration( + RecyclerViewItemOffsets(0, 7, 0, 7) ) } @@ -90,9 +90,9 @@ //接单状态处理 operationViewModel.loadState.observe(this) { when (it) { - is LoadState.Loading -> LoadingDialogHub.show(requireActivity(), "接单中,请稍后") + is LoadState.Loading -> LoadingDialog.show(requireActivity(), "接单中,请稍后") is LoadState.Success -> { - LoadingDialogHub.dismiss() + LoadingDialog.dismiss() //接单成功之后刷新列表 dataBeans.removeAt(clickedPosition) notProcessedAdapter.notifyItemRemoved(clickedPosition) @@ -101,7 +101,7 @@ ) } - else -> LoadingDialogHub.dismiss() + else -> LoadingDialog.dismiss() } } } @@ -134,7 +134,7 @@ } else { binding.emptyInclude.emptyView.hide() notProcessedAdapter = OrderNotProcessedAdapter(requireContext(), dataBeans) - binding.notProcessedView.adapter = notProcessedAdapter + binding.recyclerView.adapter = notProcessedAdapter notProcessedAdapter.setOnItemClickListener(object : OrderNotProcessedAdapter.OnItemClickListener { override fun onClicked(position: Int) { diff --git a/app/src/main/java/com/casic/app/smartwell/greendao/DaoMaster.java b/app/src/main/java/com/casic/app/smartwell/greendao/DaoMaster.java index fdcf3a7..1e52b74 100644 --- a/app/src/main/java/com/casic/app/smartwell/greendao/DaoMaster.java +++ b/app/src/main/java/com/casic/app/smartwell/greendao/DaoMaster.java @@ -13,25 +13,20 @@ // THIS CODE IS GENERATED BY greenDAO, DO NOT EDIT. - /** * Master of DAO (schema version 4): knows all DAOs. */ public class DaoMaster extends AbstractDaoMaster { public static final int SCHEMA_VERSION = 4; - /** - * Creates underlying database table using DAOs. - */ + /** Creates underlying database table using DAOs. */ public static void createAllTables(Database db, boolean ifNotExists) { MapWellLocalBeanDao.createTable(db, ifNotExists); NoticeLocaleBeanDao.createTable(db, ifNotExists); PipeLocalBeanDao.createTable(db, ifNotExists); } - /** - * Drops underlying database table using DAOs. - */ + /** Drops underlying database table using DAOs. */ public static void dropAllTables(Database db, boolean ifExists) { MapWellLocalBeanDao.dropTable(db, ifExists); NoticeLocaleBeanDao.dropTable(db, ifExists); @@ -86,9 +81,7 @@ } } - /** - * WARNING: Drops all table on Upgrade! Use only during development. - */ + /** WARNING: Drops all table on Upgrade! Use only during development. */ public static class DevOpenHelper extends OpenHelper { public DevOpenHelper(Context context, String name) { super(context, name); diff --git a/app/src/main/java/com/casic/app/smartwell/greendao/DaoSession.java b/app/src/main/java/com/casic/app/smartwell/greendao/DaoSession.java index 0b36d17..3e40e3b 100644 --- a/app/src/main/java/com/casic/app/smartwell/greendao/DaoSession.java +++ b/app/src/main/java/com/casic/app/smartwell/greendao/DaoSession.java @@ -16,7 +16,7 @@ /** * {@inheritDoc} - * + * * @see org.greenrobot.greendao.AbstractDaoSession */ public class DaoSession extends AbstractDaoSession { @@ -50,7 +50,7 @@ registerDao(NoticeLocaleBean.class, noticeLocaleBeanDao); registerDao(PipeLocalBean.class, pipeLocalBeanDao); } - + public void clear() { mapWellLocalBeanDaoConfig.clearIdentityScope(); noticeLocaleBeanDaoConfig.clearIdentityScope(); diff --git a/app/src/main/java/com/casic/app/smartwell/greendao/MapWellLocalBeanDao.java b/app/src/main/java/com/casic/app/smartwell/greendao/MapWellLocalBeanDao.java index 8908fda..407bc92 100644 --- a/app/src/main/java/com/casic/app/smartwell/greendao/MapWellLocalBeanDao.java +++ b/app/src/main/java/com/casic/app/smartwell/greendao/MapWellLocalBeanDao.java @@ -12,10 +12,9 @@ import org.greenrobot.greendao.internal.DaoConfig; // THIS CODE IS GENERATED BY greenDAO, DO NOT EDIT. - -/** +/** * DAO for table "MAP_WELL_LOCAL_BEAN". - */ +*/ public class MapWellLocalBeanDao extends AbstractDao { public static final String TABLENAME = "MAP_WELL_LOCAL_BEAN"; @@ -57,16 +56,14 @@ public MapWellLocalBeanDao(DaoConfig config) { super(config); } - + public MapWellLocalBeanDao(DaoConfig config, DaoSession daoSession) { super(config, daoSession); } - /** - * Creates the underlying database table. - */ + /** Creates the underlying database table. */ public static void createTable(Database db, boolean ifNotExists) { - String constraint = ifNotExists ? "IF NOT EXISTS " : ""; + String constraint = ifNotExists? "IF NOT EXISTS ": ""; db.execSQL("CREATE TABLE " + constraint + "\"MAP_WELL_LOCAL_BEAN\" (" + // "\"_id\" INTEGER PRIMARY KEY AUTOINCREMENT ," + // 0: kId "\"AREA\" TEXT," + // 1: area @@ -96,9 +93,7 @@ "\"WELL_TYPE_NAME\" TEXT);"); // 25: wellTypeName } - /** - * Drops the underlying database table. - */ + /** Drops the underlying database table. */ public static void dropTable(Database db, boolean ifExists) { String sql = "DROP TABLE " + (ifExists ? "IF EXISTS " : "") + "\"MAP_WELL_LOCAL_BEAN\""; db.execSQL(sql); @@ -107,132 +102,132 @@ @Override protected final void bindValues(DatabaseStatement stmt, MapWellLocalBean entity) { stmt.clearBindings(); - + Long kId = entity.getKId(); if (kId != null) { stmt.bindLong(1, kId); } - + String area = entity.getArea(); if (area != null) { stmt.bindString(2, area); } - + String bfzt = entity.getBfzt(); if (bfzt != null) { stmt.bindString(3, bfzt); } - + String bfztName = entity.getBfztName(); if (bfztName != null) { stmt.bindString(4, bfztName); } - + String coordinateX = entity.getCoordinateX(); if (coordinateX != null) { stmt.bindString(5, coordinateX); } - + String coordinateY = entity.getCoordinateY(); if (coordinateY != null) { stmt.bindString(6, coordinateY); } - + String deep = entity.getDeep(); if (deep != null) { stmt.bindString(7, deep); } - + String deptName = entity.getDeptName(); if (deptName != null) { stmt.bindString(8, deptName); } - + String deptid = entity.getDeptid(); if (deptid != null) { stmt.bindString(9, deptid); } - + String id = entity.getId(); if (id != null) { stmt.bindString(10, id); } - + String latBaidu = entity.getLatBaidu(); if (latBaidu != null) { stmt.bindString(11, latBaidu); } - + String latGaode = entity.getLatGaode(); if (latGaode != null) { stmt.bindString(12, latGaode); } - + String lngBaidu = entity.getLngBaidu(); if (lngBaidu != null) { stmt.bindString(13, lngBaidu); } - + String lngGaode = entity.getLngGaode(); if (lngGaode != null) { stmt.bindString(14, lngGaode); } - + String notes = entity.getNotes(); if (notes != null) { stmt.bindString(15, notes); } - + String photos = entity.getPhotos(); if (photos != null) { stmt.bindString(16, photos); } - + String position = entity.getPosition(); if (position != null) { stmt.bindString(17, position); } - + String staff = entity.getStaff(); if (staff != null) { stmt.bindString(18, staff); } - + String tel = entity.getTel(); if (tel != null) { stmt.bindString(19, tel); } - + String ts = entity.getTs(); if (ts != null) { stmt.bindString(20, ts); } - + String valid = entity.getValid(); if (valid != null) { stmt.bindString(21, valid); } - + String watchData = entity.getWatchData(); if (watchData != null) { stmt.bindString(22, watchData); } - + String wellCode = entity.getWellCode(); if (wellCode != null) { stmt.bindString(23, wellCode); } - + String wellName = entity.getWellName(); if (wellName != null) { stmt.bindString(24, wellName); } - + String wellType = entity.getWellType(); if (wellType != null) { stmt.bindString(25, wellType); } - + String wellTypeName = entity.getWellTypeName(); if (wellTypeName != null) { stmt.bindString(26, wellTypeName); @@ -242,132 +237,132 @@ @Override protected final void bindValues(SQLiteStatement stmt, MapWellLocalBean entity) { stmt.clearBindings(); - + Long kId = entity.getKId(); if (kId != null) { stmt.bindLong(1, kId); } - + String area = entity.getArea(); if (area != null) { stmt.bindString(2, area); } - + String bfzt = entity.getBfzt(); if (bfzt != null) { stmt.bindString(3, bfzt); } - + String bfztName = entity.getBfztName(); if (bfztName != null) { stmt.bindString(4, bfztName); } - + String coordinateX = entity.getCoordinateX(); if (coordinateX != null) { stmt.bindString(5, coordinateX); } - + String coordinateY = entity.getCoordinateY(); if (coordinateY != null) { stmt.bindString(6, coordinateY); } - + String deep = entity.getDeep(); if (deep != null) { stmt.bindString(7, deep); } - + String deptName = entity.getDeptName(); if (deptName != null) { stmt.bindString(8, deptName); } - + String deptid = entity.getDeptid(); if (deptid != null) { stmt.bindString(9, deptid); } - + String id = entity.getId(); if (id != null) { stmt.bindString(10, id); } - + String latBaidu = entity.getLatBaidu(); if (latBaidu != null) { stmt.bindString(11, latBaidu); } - + String latGaode = entity.getLatGaode(); if (latGaode != null) { stmt.bindString(12, latGaode); } - + String lngBaidu = entity.getLngBaidu(); if (lngBaidu != null) { stmt.bindString(13, lngBaidu); } - + String lngGaode = entity.getLngGaode(); if (lngGaode != null) { stmt.bindString(14, lngGaode); } - + String notes = entity.getNotes(); if (notes != null) { stmt.bindString(15, notes); } - + String photos = entity.getPhotos(); if (photos != null) { stmt.bindString(16, photos); } - + String position = entity.getPosition(); if (position != null) { stmt.bindString(17, position); } - + String staff = entity.getStaff(); if (staff != null) { stmt.bindString(18, staff); } - + String tel = entity.getTel(); if (tel != null) { stmt.bindString(19, tel); } - + String ts = entity.getTs(); if (ts != null) { stmt.bindString(20, ts); } - + String valid = entity.getValid(); if (valid != null) { stmt.bindString(21, valid); } - + String watchData = entity.getWatchData(); if (watchData != null) { stmt.bindString(22, watchData); } - + String wellCode = entity.getWellCode(); if (wellCode != null) { stmt.bindString(23, wellCode); } - + String wellName = entity.getWellName(); if (wellName != null) { stmt.bindString(24, wellName); } - + String wellType = entity.getWellType(); if (wellType != null) { stmt.bindString(25, wellType); } - + String wellTypeName = entity.getWellTypeName(); if (wellTypeName != null) { stmt.bindString(26, wellTypeName); @@ -377,41 +372,41 @@ @Override public Long readKey(Cursor cursor, int offset) { return cursor.isNull(offset + 0) ? null : cursor.getLong(offset + 0); - } + } @Override public MapWellLocalBean readEntity(Cursor cursor, int offset) { MapWellLocalBean entity = new MapWellLocalBean( // - cursor.isNull(offset + 0) ? null : cursor.getLong(offset + 0), // kId - cursor.isNull(offset + 1) ? null : cursor.getString(offset + 1), // area - cursor.isNull(offset + 2) ? null : cursor.getString(offset + 2), // bfzt - cursor.isNull(offset + 3) ? null : cursor.getString(offset + 3), // bfztName - cursor.isNull(offset + 4) ? null : cursor.getString(offset + 4), // coordinateX - cursor.isNull(offset + 5) ? null : cursor.getString(offset + 5), // coordinateY - cursor.isNull(offset + 6) ? null : cursor.getString(offset + 6), // deep - cursor.isNull(offset + 7) ? null : cursor.getString(offset + 7), // deptName - cursor.isNull(offset + 8) ? null : cursor.getString(offset + 8), // deptid - cursor.isNull(offset + 9) ? null : cursor.getString(offset + 9), // id - cursor.isNull(offset + 10) ? null : cursor.getString(offset + 10), // latBaidu - cursor.isNull(offset + 11) ? null : cursor.getString(offset + 11), // latGaode - cursor.isNull(offset + 12) ? null : cursor.getString(offset + 12), // lngBaidu - cursor.isNull(offset + 13) ? null : cursor.getString(offset + 13), // lngGaode - cursor.isNull(offset + 14) ? null : cursor.getString(offset + 14), // notes - cursor.isNull(offset + 15) ? null : cursor.getString(offset + 15), // photos - cursor.isNull(offset + 16) ? null : cursor.getString(offset + 16), // position - cursor.isNull(offset + 17) ? null : cursor.getString(offset + 17), // staff - cursor.isNull(offset + 18) ? null : cursor.getString(offset + 18), // tel - cursor.isNull(offset + 19) ? null : cursor.getString(offset + 19), // ts - cursor.isNull(offset + 20) ? null : cursor.getString(offset + 20), // valid - cursor.isNull(offset + 21) ? null : cursor.getString(offset + 21), // watchData - cursor.isNull(offset + 22) ? null : cursor.getString(offset + 22), // wellCode - cursor.isNull(offset + 23) ? null : cursor.getString(offset + 23), // wellName - cursor.isNull(offset + 24) ? null : cursor.getString(offset + 24), // wellType - cursor.isNull(offset + 25) ? null : cursor.getString(offset + 25) // wellTypeName + cursor.isNull(offset + 0) ? null : cursor.getLong(offset + 0), // kId + cursor.isNull(offset + 1) ? null : cursor.getString(offset + 1), // area + cursor.isNull(offset + 2) ? null : cursor.getString(offset + 2), // bfzt + cursor.isNull(offset + 3) ? null : cursor.getString(offset + 3), // bfztName + cursor.isNull(offset + 4) ? null : cursor.getString(offset + 4), // coordinateX + cursor.isNull(offset + 5) ? null : cursor.getString(offset + 5), // coordinateY + cursor.isNull(offset + 6) ? null : cursor.getString(offset + 6), // deep + cursor.isNull(offset + 7) ? null : cursor.getString(offset + 7), // deptName + cursor.isNull(offset + 8) ? null : cursor.getString(offset + 8), // deptid + cursor.isNull(offset + 9) ? null : cursor.getString(offset + 9), // id + cursor.isNull(offset + 10) ? null : cursor.getString(offset + 10), // latBaidu + cursor.isNull(offset + 11) ? null : cursor.getString(offset + 11), // latGaode + cursor.isNull(offset + 12) ? null : cursor.getString(offset + 12), // lngBaidu + cursor.isNull(offset + 13) ? null : cursor.getString(offset + 13), // lngGaode + cursor.isNull(offset + 14) ? null : cursor.getString(offset + 14), // notes + cursor.isNull(offset + 15) ? null : cursor.getString(offset + 15), // photos + cursor.isNull(offset + 16) ? null : cursor.getString(offset + 16), // position + cursor.isNull(offset + 17) ? null : cursor.getString(offset + 17), // staff + cursor.isNull(offset + 18) ? null : cursor.getString(offset + 18), // tel + cursor.isNull(offset + 19) ? null : cursor.getString(offset + 19), // ts + cursor.isNull(offset + 20) ? null : cursor.getString(offset + 20), // valid + cursor.isNull(offset + 21) ? null : cursor.getString(offset + 21), // watchData + cursor.isNull(offset + 22) ? null : cursor.getString(offset + 22), // wellCode + cursor.isNull(offset + 23) ? null : cursor.getString(offset + 23), // wellName + cursor.isNull(offset + 24) ? null : cursor.getString(offset + 24), // wellType + cursor.isNull(offset + 25) ? null : cursor.getString(offset + 25) // wellTypeName ); return entity; } - + @Override public void readEntity(Cursor cursor, MapWellLocalBean entity, int offset) { entity.setKId(cursor.isNull(offset + 0) ? null : cursor.getLong(offset + 0)); @@ -440,17 +435,17 @@ entity.setWellName(cursor.isNull(offset + 23) ? null : cursor.getString(offset + 23)); entity.setWellType(cursor.isNull(offset + 24) ? null : cursor.getString(offset + 24)); entity.setWellTypeName(cursor.isNull(offset + 25) ? null : cursor.getString(offset + 25)); - } - + } + @Override protected final Long updateKeyAfterInsert(MapWellLocalBean entity, long rowId) { entity.setKId(rowId); return rowId; } - + @Override public Long getKey(MapWellLocalBean entity) { - if (entity != null) { + if(entity != null) { return entity.getKId(); } else { return null; @@ -466,5 +461,5 @@ protected final boolean isEntityUpdateable() { return true; } - + } diff --git a/app/src/main/java/com/casic/app/smartwell/greendao/NoticeLocaleBeanDao.java b/app/src/main/java/com/casic/app/smartwell/greendao/NoticeLocaleBeanDao.java index 64312ed..deb2d49 100644 --- a/app/src/main/java/com/casic/app/smartwell/greendao/NoticeLocaleBeanDao.java +++ b/app/src/main/java/com/casic/app/smartwell/greendao/NoticeLocaleBeanDao.java @@ -12,10 +12,9 @@ import org.greenrobot.greendao.internal.DaoConfig; // THIS CODE IS GENERATED BY greenDAO, DO NOT EDIT. - -/** +/** * DAO for table "NOTICE_LOCALE_BEAN". - */ +*/ public class NoticeLocaleBeanDao extends AbstractDao { public static final String TABLENAME = "NOTICE_LOCALE_BEAN"; @@ -43,16 +42,14 @@ public NoticeLocaleBeanDao(DaoConfig config) { super(config); } - + public NoticeLocaleBeanDao(DaoConfig config, DaoSession daoSession) { super(config, daoSession); } - /** - * Creates the underlying database table. - */ + /** Creates the underlying database table. */ public static void createTable(Database db, boolean ifNotExists) { - String constraint = ifNotExists ? "IF NOT EXISTS " : ""; + String constraint = ifNotExists? "IF NOT EXISTS ": ""; db.execSQL("CREATE TABLE " + constraint + "\"NOTICE_LOCALE_BEAN\" (" + // "\"_id\" INTEGER PRIMARY KEY AUTOINCREMENT ," + // 0: id "\"MESSAGE_ID\" TEXT UNIQUE ," + // 1: messageId @@ -68,9 +65,7 @@ "\"NOTICE_TIME\" TEXT);"); // 11: noticeTime } - /** - * Drops the underlying database table. - */ + /** Drops the underlying database table. */ public static void dropTable(Database db, boolean ifExists) { String sql = "DROP TABLE " + (ifExists ? "IF EXISTS " : "") + "\"NOTICE_LOCALE_BEAN\""; db.execSQL(sql); @@ -79,62 +74,62 @@ @Override protected final void bindValues(DatabaseStatement stmt, NoticeLocaleBean entity) { stmt.clearBindings(); - + Long id = entity.getId(); if (id != null) { stmt.bindLong(1, id); } - + String messageId = entity.getMessageId(); if (messageId != null) { stmt.bindString(2, messageId); } - + String appid = entity.getAppid(); if (appid != null) { stmt.bindString(3, appid); } - + String clientId = entity.getClientId(); if (clientId != null) { stmt.bindString(4, clientId); } - + String taskId = entity.getTaskId(); if (taskId != null) { stmt.bindString(5, taskId); } - + String userId = entity.getUserId(); if (userId != null) { stmt.bindString(6, userId); } - + String title = entity.getTitle(); if (title != null) { stmt.bindString(7, title); } - + String content = entity.getContent(); if (content != null) { stmt.bindString(8, content); } - + String deviceCode = entity.getDeviceCode(); if (deviceCode != null) { stmt.bindString(9, deviceCode); } - + String jobId = entity.getJobId(); if (jobId != null) { stmt.bindString(10, jobId); } - + String isRead = entity.getIsRead(); if (isRead != null) { stmt.bindString(11, isRead); } - + String noticeTime = entity.getNoticeTime(); if (noticeTime != null) { stmt.bindString(12, noticeTime); @@ -144,62 +139,62 @@ @Override protected final void bindValues(SQLiteStatement stmt, NoticeLocaleBean entity) { stmt.clearBindings(); - + Long id = entity.getId(); if (id != null) { stmt.bindLong(1, id); } - + String messageId = entity.getMessageId(); if (messageId != null) { stmt.bindString(2, messageId); } - + String appid = entity.getAppid(); if (appid != null) { stmt.bindString(3, appid); } - + String clientId = entity.getClientId(); if (clientId != null) { stmt.bindString(4, clientId); } - + String taskId = entity.getTaskId(); if (taskId != null) { stmt.bindString(5, taskId); } - + String userId = entity.getUserId(); if (userId != null) { stmt.bindString(6, userId); } - + String title = entity.getTitle(); if (title != null) { stmt.bindString(7, title); } - + String content = entity.getContent(); if (content != null) { stmt.bindString(8, content); } - + String deviceCode = entity.getDeviceCode(); if (deviceCode != null) { stmt.bindString(9, deviceCode); } - + String jobId = entity.getJobId(); if (jobId != null) { stmt.bindString(10, jobId); } - + String isRead = entity.getIsRead(); if (isRead != null) { stmt.bindString(11, isRead); } - + String noticeTime = entity.getNoticeTime(); if (noticeTime != null) { stmt.bindString(12, noticeTime); @@ -209,27 +204,27 @@ @Override public Long readKey(Cursor cursor, int offset) { return cursor.isNull(offset + 0) ? null : cursor.getLong(offset + 0); - } + } @Override public NoticeLocaleBean readEntity(Cursor cursor, int offset) { NoticeLocaleBean entity = new NoticeLocaleBean( // - cursor.isNull(offset + 0) ? null : cursor.getLong(offset + 0), // id - cursor.isNull(offset + 1) ? null : cursor.getString(offset + 1), // messageId - cursor.isNull(offset + 2) ? null : cursor.getString(offset + 2), // appid - cursor.isNull(offset + 3) ? null : cursor.getString(offset + 3), // clientId - cursor.isNull(offset + 4) ? null : cursor.getString(offset + 4), // taskId - cursor.isNull(offset + 5) ? null : cursor.getString(offset + 5), // userId - cursor.isNull(offset + 6) ? null : cursor.getString(offset + 6), // title - cursor.isNull(offset + 7) ? null : cursor.getString(offset + 7), // content - cursor.isNull(offset + 8) ? null : cursor.getString(offset + 8), // deviceCode - cursor.isNull(offset + 9) ? null : cursor.getString(offset + 9), // jobId - cursor.isNull(offset + 10) ? null : cursor.getString(offset + 10), // isRead - cursor.isNull(offset + 11) ? null : cursor.getString(offset + 11) // noticeTime + cursor.isNull(offset + 0) ? null : cursor.getLong(offset + 0), // id + cursor.isNull(offset + 1) ? null : cursor.getString(offset + 1), // messageId + cursor.isNull(offset + 2) ? null : cursor.getString(offset + 2), // appid + cursor.isNull(offset + 3) ? null : cursor.getString(offset + 3), // clientId + cursor.isNull(offset + 4) ? null : cursor.getString(offset + 4), // taskId + cursor.isNull(offset + 5) ? null : cursor.getString(offset + 5), // userId + cursor.isNull(offset + 6) ? null : cursor.getString(offset + 6), // title + cursor.isNull(offset + 7) ? null : cursor.getString(offset + 7), // content + cursor.isNull(offset + 8) ? null : cursor.getString(offset + 8), // deviceCode + cursor.isNull(offset + 9) ? null : cursor.getString(offset + 9), // jobId + cursor.isNull(offset + 10) ? null : cursor.getString(offset + 10), // isRead + cursor.isNull(offset + 11) ? null : cursor.getString(offset + 11) // noticeTime ); return entity; } - + @Override public void readEntity(Cursor cursor, NoticeLocaleBean entity, int offset) { entity.setId(cursor.isNull(offset + 0) ? null : cursor.getLong(offset + 0)); @@ -244,17 +239,17 @@ entity.setJobId(cursor.isNull(offset + 9) ? null : cursor.getString(offset + 9)); entity.setIsRead(cursor.isNull(offset + 10) ? null : cursor.getString(offset + 10)); entity.setNoticeTime(cursor.isNull(offset + 11) ? null : cursor.getString(offset + 11)); - } - + } + @Override protected final Long updateKeyAfterInsert(NoticeLocaleBean entity, long rowId) { entity.setId(rowId); return rowId; } - + @Override public Long getKey(NoticeLocaleBean entity) { - if (entity != null) { + if(entity != null) { return entity.getId(); } else { return null; @@ -270,5 +265,5 @@ protected final boolean isEntityUpdateable() { return true; } - + } diff --git a/app/src/main/java/com/casic/app/smartwell/greendao/PipeLocalBeanDao.java b/app/src/main/java/com/casic/app/smartwell/greendao/PipeLocalBeanDao.java index aab4d3f..df5515a 100644 --- a/app/src/main/java/com/casic/app/smartwell/greendao/PipeLocalBeanDao.java +++ b/app/src/main/java/com/casic/app/smartwell/greendao/PipeLocalBeanDao.java @@ -12,10 +12,9 @@ import org.greenrobot.greendao.internal.DaoConfig; // THIS CODE IS GENERATED BY greenDAO, DO NOT EDIT. - -/** +/** * DAO for table "PIPE_LOCAL_BEAN". - */ +*/ public class PipeLocalBeanDao extends AbstractDao { public static final String TABLENAME = "PIPE_LOCAL_BEAN"; @@ -37,16 +36,14 @@ public PipeLocalBeanDao(DaoConfig config) { super(config); } - + public PipeLocalBeanDao(DaoConfig config, DaoSession daoSession) { super(config, daoSession); } - /** - * Creates the underlying database table. - */ + /** Creates the underlying database table. */ public static void createTable(Database db, boolean ifNotExists) { - String constraint = ifNotExists ? "IF NOT EXISTS " : ""; + String constraint = ifNotExists? "IF NOT EXISTS ": ""; db.execSQL("CREATE TABLE " + constraint + "\"PIPE_LOCAL_BEAN\" (" + // "\"_id\" INTEGER PRIMARY KEY AUTOINCREMENT ," + // 0: id "\"PIPE_CODE\" TEXT," + // 1: pipeCode @@ -56,9 +53,7 @@ "\"START_LONGITUDE_GD\" TEXT);"); // 5: startLongitudeGd } - /** - * Drops the underlying database table. - */ + /** Drops the underlying database table. */ public static void dropTable(Database db, boolean ifExists) { String sql = "DROP TABLE " + (ifExists ? "IF EXISTS " : "") + "\"PIPE_LOCAL_BEAN\""; db.execSQL(sql); @@ -67,32 +62,32 @@ @Override protected final void bindValues(DatabaseStatement stmt, PipeLocalBean entity) { stmt.clearBindings(); - + Long id = entity.getId(); if (id != null) { stmt.bindLong(1, id); } - + String pipeCode = entity.getPipeCode(); if (pipeCode != null) { stmt.bindString(2, pipeCode); } - + String endLatitudeGd = entity.getEndLatitudeGd(); if (endLatitudeGd != null) { stmt.bindString(3, endLatitudeGd); } - + String endLongitudeGd = entity.getEndLongitudeGd(); if (endLongitudeGd != null) { stmt.bindString(4, endLongitudeGd); } - + String startLatitudeGd = entity.getStartLatitudeGd(); if (startLatitudeGd != null) { stmt.bindString(5, startLatitudeGd); } - + String startLongitudeGd = entity.getStartLongitudeGd(); if (startLongitudeGd != null) { stmt.bindString(6, startLongitudeGd); @@ -102,32 +97,32 @@ @Override protected final void bindValues(SQLiteStatement stmt, PipeLocalBean entity) { stmt.clearBindings(); - + Long id = entity.getId(); if (id != null) { stmt.bindLong(1, id); } - + String pipeCode = entity.getPipeCode(); if (pipeCode != null) { stmt.bindString(2, pipeCode); } - + String endLatitudeGd = entity.getEndLatitudeGd(); if (endLatitudeGd != null) { stmt.bindString(3, endLatitudeGd); } - + String endLongitudeGd = entity.getEndLongitudeGd(); if (endLongitudeGd != null) { stmt.bindString(4, endLongitudeGd); } - + String startLatitudeGd = entity.getStartLatitudeGd(); if (startLatitudeGd != null) { stmt.bindString(5, startLatitudeGd); } - + String startLongitudeGd = entity.getStartLongitudeGd(); if (startLongitudeGd != null) { stmt.bindString(6, startLongitudeGd); @@ -137,21 +132,21 @@ @Override public Long readKey(Cursor cursor, int offset) { return cursor.isNull(offset + 0) ? null : cursor.getLong(offset + 0); - } + } @Override public PipeLocalBean readEntity(Cursor cursor, int offset) { PipeLocalBean entity = new PipeLocalBean( // - cursor.isNull(offset + 0) ? null : cursor.getLong(offset + 0), // id - cursor.isNull(offset + 1) ? null : cursor.getString(offset + 1), // pipeCode - cursor.isNull(offset + 2) ? null : cursor.getString(offset + 2), // endLatitudeGd - cursor.isNull(offset + 3) ? null : cursor.getString(offset + 3), // endLongitudeGd - cursor.isNull(offset + 4) ? null : cursor.getString(offset + 4), // startLatitudeGd - cursor.isNull(offset + 5) ? null : cursor.getString(offset + 5) // startLongitudeGd + cursor.isNull(offset + 0) ? null : cursor.getLong(offset + 0), // id + cursor.isNull(offset + 1) ? null : cursor.getString(offset + 1), // pipeCode + cursor.isNull(offset + 2) ? null : cursor.getString(offset + 2), // endLatitudeGd + cursor.isNull(offset + 3) ? null : cursor.getString(offset + 3), // endLongitudeGd + cursor.isNull(offset + 4) ? null : cursor.getString(offset + 4), // startLatitudeGd + cursor.isNull(offset + 5) ? null : cursor.getString(offset + 5) // startLongitudeGd ); return entity; } - + @Override public void readEntity(Cursor cursor, PipeLocalBean entity, int offset) { entity.setId(cursor.isNull(offset + 0) ? null : cursor.getLong(offset + 0)); @@ -160,17 +155,17 @@ entity.setEndLongitudeGd(cursor.isNull(offset + 3) ? null : cursor.getString(offset + 3)); entity.setStartLatitudeGd(cursor.isNull(offset + 4) ? null : cursor.getString(offset + 4)); entity.setStartLongitudeGd(cursor.isNull(offset + 5) ? null : cursor.getString(offset + 5)); - } - + } + @Override protected final Long updateKeyAfterInsert(PipeLocalBean entity, long rowId) { entity.setId(rowId); return rowId; } - + @Override public Long getKey(PipeLocalBean entity) { - if (entity != null) { + if(entity != null) { return entity.getId(); } else { return null; @@ -186,5 +181,5 @@ protected final boolean isEntityUpdateable() { return true; } - + } diff --git a/app/src/main/java/com/casic/app/smartwell/view/ChangePasswordActivity.kt b/app/src/main/java/com/casic/app/smartwell/view/ChangePasswordActivity.kt index 8e41039..9f1dd40 100644 --- a/app/src/main/java/com/casic/app/smartwell/view/ChangePasswordActivity.kt +++ b/app/src/main/java/com/casic/app/smartwell/view/ChangePasswordActivity.kt @@ -14,7 +14,7 @@ import com.pengxh.kt.lite.extensions.show import com.pengxh.kt.lite.utils.ActivityStackManager import com.pengxh.kt.lite.utils.LoadState -import com.pengxh.kt.lite.utils.LoadingDialogHub +import com.pengxh.kt.lite.utils.LoadingDialog import com.pengxh.kt.lite.widget.TitleBarView import java.nio.charset.StandardCharsets @@ -46,15 +46,15 @@ override fun observeRequestState() { userViewModel.loadState.observe(this) { when (it) { - is LoadState.Loading -> LoadingDialogHub.show(this, "修改中,请稍后") + is LoadState.Loading -> LoadingDialog.show(this, "修改中,请稍后") is LoadState.Success -> { - LoadingDialogHub.dismiss() + LoadingDialog.dismiss() AuthenticationHelper.removeToken() this.navigatePageTo() ActivityStackManager.finishAllActivity() } - else -> LoadingDialogHub.dismiss() + else -> LoadingDialog.dismiss() } } } diff --git a/app/src/main/java/com/casic/app/smartwell/view/DeployedWellActivity.kt b/app/src/main/java/com/casic/app/smartwell/view/DeployedWellActivity.kt index fb4339c..28a5078 100644 --- a/app/src/main/java/com/casic/app/smartwell/view/DeployedWellActivity.kt +++ b/app/src/main/java/com/casic/app/smartwell/view/DeployedWellActivity.kt @@ -83,8 +83,8 @@ } //添加分割线 - binding.deployedListView.addItemDecoration( - RecyclerViewItemOffsets(0, 5, 0, 5) + binding.recyclerView.addItemDecoration( + RecyclerViewItemOffsets(0, 7, 0, 7) ) } @@ -149,12 +149,11 @@ } else { item.deep.toString() + "m" } - viewHolder.setText(R.id.wellNameView, item.wellName) + viewHolder.setText(R.id.wellTypeView, item.wellTypeName) .setText(R.id.wellDepthView, "深:${deep}") .setText(R.id.wellCodeView, "点位编号:${item.wellCode}") - .setText(R.id.wellTypeView, "点位类型:${item.wellTypeName}") .setText(R.id.ownerShipView, "权属单位:${item.deptName}") - .setText(R.id.wellLocationView, "点位置:${item.position}") + .setText(R.id.wellLocationView, "点位位置:${item.position}") .setOnClickListener( R.id.operationButton, object : View.OnClickListener { override fun onClick(v: View?) { @@ -207,7 +206,7 @@ }) } } - binding.deployedListView.adapter = deployAdapter + binding.recyclerView.adapter = deployAdapter deployAdapter.setOnItemClickedListener(object : NormalRecyclerAdapter.OnItemClickedListener { override fun onItemClicked(position: Int, t: WellListModel.DataBean.RowsBean) { diff --git a/app/src/main/java/com/casic/app/smartwell/view/LoginActivity.kt b/app/src/main/java/com/casic/app/smartwell/view/LoginActivity.kt index e4bb0e3..834527b 100644 --- a/app/src/main/java/com/casic/app/smartwell/view/LoginActivity.kt +++ b/app/src/main/java/com/casic/app/smartwell/view/LoginActivity.kt @@ -21,7 +21,7 @@ import com.pengxh.kt.lite.extensions.navigatePageTo import com.pengxh.kt.lite.extensions.readAssetsFile import com.pengxh.kt.lite.extensions.show -import com.pengxh.kt.lite.utils.LoadingDialogHub +import com.pengxh.kt.lite.utils.LoadingDialog import com.pengxh.kt.lite.utils.SaveKeyValues import kotlinx.coroutines.Dispatchers import kotlinx.coroutines.launch @@ -106,11 +106,11 @@ override fun observeRequestState() { authenticateViewModel.loadState.observe(this) { - LoadingDialogHub.show(this, "登录中,请稍后") + LoadingDialog.show(this, "登录中,请稍后") } loginViewModel.loadState.observe(this) { - LoadingDialogHub.dismiss() + LoadingDialog.dismiss() } } diff --git a/app/src/main/java/com/casic/app/smartwell/view/OrderCompletedDetailActivity.kt b/app/src/main/java/com/casic/app/smartwell/view/OrderCompletedDetailActivity.kt index db8ad1f..75cd905 100644 --- a/app/src/main/java/com/casic/app/smartwell/view/OrderCompletedDetailActivity.kt +++ b/app/src/main/java/com/casic/app/smartwell/view/OrderCompletedDetailActivity.kt @@ -17,7 +17,7 @@ import com.pengxh.kt.lite.extensions.show import com.pengxh.kt.lite.utils.Constant import com.pengxh.kt.lite.utils.LoadState -import com.pengxh.kt.lite.utils.LoadingDialogHub +import com.pengxh.kt.lite.utils.LoadingDialog import com.pengxh.kt.lite.widget.TitleBarView import com.pengxh.kt.lite.widget.dialog.AlertMessageDialog @@ -44,7 +44,7 @@ } override fun initOnCreate(savedInstanceState: Bundle?) { - val jobId = intent.getStringExtra(Constant.INTENT_PARAM)!! + val jobId = intent.getStringExtra(Constant.INTENT_PARAM_KEY)!! orderViewModel = ViewModelProvider(this)[OrderViewModel::class.java] orderViewModel.getWorkOrderDetail(jobId) orderViewModel.detailModel.observe(this) { @@ -154,8 +154,8 @@ override fun observeRequestState() { orderViewModel.loadState.observe(this) { when (it) { - is LoadState.Loading -> LoadingDialogHub.show(this, "数据加载中,请稍后") - else -> LoadingDialogHub.dismiss() + is LoadState.Loading -> LoadingDialog.show(this, "数据加载中,请稍后") + else -> LoadingDialog.dismiss() } } } diff --git a/app/src/main/java/com/casic/app/smartwell/view/OrderInHandleDetailActivity.kt b/app/src/main/java/com/casic/app/smartwell/view/OrderInHandleDetailActivity.kt index d70a979..04a7d5d 100644 --- a/app/src/main/java/com/casic/app/smartwell/view/OrderInHandleDetailActivity.kt +++ b/app/src/main/java/com/casic/app/smartwell/view/OrderInHandleDetailActivity.kt @@ -38,7 +38,7 @@ import com.pengxh.kt.lite.extensions.show import com.pengxh.kt.lite.utils.Constant import com.pengxh.kt.lite.utils.LoadState -import com.pengxh.kt.lite.utils.LoadingDialogHub +import com.pengxh.kt.lite.utils.LoadingDialog import com.pengxh.kt.lite.widget.TitleBarView import com.pengxh.kt.lite.widget.dialog.AlertControlDialog import com.pengxh.kt.lite.widget.dialog.AlertMessageDialog @@ -93,7 +93,7 @@ ) binding.addImageRecyclerView.adapter = imageAdapter - val jobId = intent.getStringExtra(Constant.INTENT_PARAM)!!//初始化图片九宫格 + val jobId = intent.getStringExtra(Constant.INTENT_PARAM_KEY)!!//初始化图片九宫格 orderViewModel.getWorkOrderDetail(jobId) orderViewModel.detailModel.observe(this) { if (it.code == 200) { @@ -312,41 +312,41 @@ override fun observeRequestState() { orderViewModel.loadState.observe(this) { when (it) { - is LoadState.Loading -> LoadingDialogHub.show(this, "数据加载中,请稍后") - else -> LoadingDialogHub.dismiss() + is LoadState.Loading -> LoadingDialog.show(this, "数据加载中,请稍后") + else -> LoadingDialog.dismiss() } } uploadImageViewModel.loadState.observe(this) { when (it) { - LoadState.Loading -> LoadingDialogHub.show(this, "图片上传中,请稍后...") - else -> LoadingDialogHub.dismiss() + LoadState.Loading -> LoadingDialog.show(this, "图片上传中,请稍后...") + else -> LoadingDialog.dismiss() } } //转单状态处理 operationViewModel.loadState.observe(this) { when (it) { - is LoadState.Loading -> LoadingDialogHub.show(this, "转单中,请稍后") + is LoadState.Loading -> LoadingDialog.show(this, "转单中,请稍后") is LoadState.Success -> { - LoadingDialogHub.dismiss() + LoadingDialog.dismiss() this.finish() } - else -> LoadingDialogHub.dismiss() + else -> LoadingDialog.dismiss() } } //处理完成工单状态处理 operationViewModel.loadState.observe(this) { when (it) { - is LoadState.Loading -> LoadingDialogHub.show(this, "处理中,请稍后") + is LoadState.Loading -> LoadingDialog.show(this, "处理中,请稍后") is LoadState.Success -> { - LoadingDialogHub.dismiss() + LoadingDialog.dismiss() this.finish() } - else -> LoadingDialogHub.dismiss() + else -> LoadingDialog.dismiss() } } } diff --git a/app/src/main/java/com/casic/app/smartwell/view/OrderNotConfirmedDetailActivity.kt b/app/src/main/java/com/casic/app/smartwell/view/OrderNotConfirmedDetailActivity.kt index 8e036d2..687ec86 100644 --- a/app/src/main/java/com/casic/app/smartwell/view/OrderNotConfirmedDetailActivity.kt +++ b/app/src/main/java/com/casic/app/smartwell/view/OrderNotConfirmedDetailActivity.kt @@ -36,7 +36,7 @@ import com.pengxh.kt.lite.extensions.show import com.pengxh.kt.lite.utils.Constant import com.pengxh.kt.lite.utils.LoadState -import com.pengxh.kt.lite.utils.LoadingDialogHub +import com.pengxh.kt.lite.utils.LoadingDialog import com.pengxh.kt.lite.widget.TitleBarView import com.pengxh.kt.lite.widget.dialog.AlertControlDialog import com.pengxh.kt.lite.widget.dialog.AlertMessageDialog @@ -80,7 +80,7 @@ } override fun initOnCreate(savedInstanceState: Bundle?) { - val jobId = intent.getStringExtra(Constant.INTENT_PARAM)!! + val jobId = intent.getStringExtra(Constant.INTENT_PARAM_KEY)!! //初始化图片九宫格 //左外边距,左内边距,右内边距,右外边距 val viewWidth = getScreenWidth() - (10 + 10 + 10 + 10).dp2px(this) @@ -263,41 +263,41 @@ //数据加载状态处理 orderViewModel.loadState.observe(this) { when (it) { - is LoadState.Loading -> LoadingDialogHub.show(this, "数据加载中,请稍后") - else -> LoadingDialogHub.dismiss() + is LoadState.Loading -> LoadingDialog.show(this, "数据加载中,请稍后") + else -> LoadingDialog.dismiss() } } uploadImageViewModel.loadState.observe(this) { when (it) { - LoadState.Loading -> LoadingDialogHub.show(this, "图片上传中,请稍后") - else -> LoadingDialogHub.dismiss() + LoadState.Loading -> LoadingDialog.show(this, "图片上传中,请稍后") + else -> LoadingDialog.dismiss() } } //转单状态处理 operationViewModel.loadState.observe(this) { when (it) { - is LoadState.Loading -> LoadingDialogHub.show(this, "转单中,请稍后") + is LoadState.Loading -> LoadingDialog.show(this, "转单中,请稍后") is LoadState.Success -> { - LoadingDialogHub.dismiss() + LoadingDialog.dismiss() this.finish() } - else -> LoadingDialogHub.dismiss() + else -> LoadingDialog.dismiss() } } //确认工单状态处理 operationViewModel.loadState.observe(this) { when (it) { - is LoadState.Loading -> LoadingDialogHub.show(this, "处理中,请稍后") + is LoadState.Loading -> LoadingDialog.show(this, "处理中,请稍后") is LoadState.Success -> { - LoadingDialogHub.dismiss() + LoadingDialog.dismiss() this.finish() } - else -> LoadingDialogHub.dismiss() + else -> LoadingDialog.dismiss() } } } diff --git a/app/src/main/java/com/casic/app/smartwell/view/OrderNotProcessedDetailActivity.kt b/app/src/main/java/com/casic/app/smartwell/view/OrderNotProcessedDetailActivity.kt index d3f22dc..0c97a52 100644 --- a/app/src/main/java/com/casic/app/smartwell/view/OrderNotProcessedDetailActivity.kt +++ b/app/src/main/java/com/casic/app/smartwell/view/OrderNotProcessedDetailActivity.kt @@ -18,7 +18,7 @@ import com.pengxh.kt.lite.extensions.show import com.pengxh.kt.lite.utils.Constant import com.pengxh.kt.lite.utils.LoadState -import com.pengxh.kt.lite.utils.LoadingDialogHub +import com.pengxh.kt.lite.utils.LoadingDialog import com.pengxh.kt.lite.widget.TitleBarView import com.pengxh.kt.lite.widget.dialog.AlertControlDialog import com.pengxh.kt.lite.widget.dialog.AlertMessageDialog @@ -50,7 +50,7 @@ } override fun initOnCreate(savedInstanceState: Bundle?) { - this.jobId = intent.getStringExtra(Constant.INTENT_PARAM)!! + this.jobId = intent.getStringExtra(Constant.INTENT_PARAM_KEY)!! orderViewModel = ViewModelProvider(this)[OrderViewModel::class.java] operationViewModel = ViewModelProvider(this)[OperationViewModel::class.java] wellViewModel = ViewModelProvider(this)[WellViewModel::class.java] @@ -162,21 +162,21 @@ //数据加载状态处理 orderViewModel.loadState.observe(this) { when (it) { - is LoadState.Loading -> LoadingDialogHub.show(this, "数据加载中,请稍后") - else -> LoadingDialogHub.dismiss() + is LoadState.Loading -> LoadingDialog.show(this, "数据加载中,请稍后") + else -> LoadingDialog.dismiss() } } //接单状态处理 operationViewModel.loadState.observe(this) { when (it) { - is LoadState.Loading -> LoadingDialogHub.show(this, "接单中,请稍后") + is LoadState.Loading -> LoadingDialog.show(this, "接单中,请稍后") is LoadState.Success -> { - LoadingDialogHub.dismiss() + LoadingDialog.dismiss() this.finish() } - else -> LoadingDialogHub.dismiss() + else -> LoadingDialog.dismiss() } } } diff --git a/app/src/main/java/com/casic/app/smartwell/view/SearchResultActivity.kt b/app/src/main/java/com/casic/app/smartwell/view/SearchResultActivity.kt index 6a92917..4f3a674 100644 --- a/app/src/main/java/com/casic/app/smartwell/view/SearchResultActivity.kt +++ b/app/src/main/java/com/casic/app/smartwell/view/SearchResultActivity.kt @@ -19,7 +19,7 @@ import com.pengxh.kt.lite.extensions.show import com.pengxh.kt.lite.utils.Constant import com.pengxh.kt.lite.utils.LoadState -import com.pengxh.kt.lite.utils.LoadingDialogHub +import com.pengxh.kt.lite.utils.LoadingDialog import com.pengxh.kt.lite.utils.WeakReferenceHandler import com.pengxh.kt.lite.widget.TitleBarView import com.pengxh.kt.lite.widget.dialog.AlertControlDialog @@ -56,7 +56,7 @@ } override fun initOnCreate(savedInstanceState: Bundle?) { - args = intent.getStringArrayListExtra(Constant.INTENT_PARAM)!! + args = intent.getStringArrayListExtra(Constant.INTENT_PARAM_KEY)!! orderViewModel = ViewModelProvider(this)[OrderViewModel::class.java] operationViewModel = ViewModelProvider(this)[OperationViewModel::class.java] @@ -101,24 +101,24 @@ } } - binding.resultRecyclerView.addItemDecoration( - RecyclerViewItemOffsets(0, 5, 0, 5) + binding.recyclerView.addItemDecoration( + RecyclerViewItemOffsets(0, 7, 0, 7) ) } override fun observeRequestState() { orderViewModel.loadState.observe(this) { when (it) { - is LoadState.Loading -> LoadingDialogHub.show(this, "数据加载中,请稍后") - else -> LoadingDialogHub.dismiss() + is LoadState.Loading -> LoadingDialog.show(this, "数据加载中,请稍后") + else -> LoadingDialog.dismiss() } } //接单状态处理 operationViewModel.loadState.observe(this) { when (it) { - is LoadState.Loading -> LoadingDialogHub.show(this, "接单中,请稍后") + is LoadState.Loading -> LoadingDialog.show(this, "接单中,请稍后") is LoadState.Success -> { - LoadingDialogHub.dismiss() + LoadingDialog.dismiss() //接单成功之后刷新列表 dataBeans.removeAt(clickedPosition) searchResultAdapter.notifyItemRemoved(clickedPosition) @@ -127,7 +127,7 @@ ) } - else -> LoadingDialogHub.dismiss() + else -> LoadingDialog.dismiss() } } } @@ -162,7 +162,7 @@ } else { binding.emptyInclude.emptyView.hide() searchResultAdapter = SearchResultAdapter(this, dataBeans) - binding.resultRecyclerView.adapter = searchResultAdapter + binding.recyclerView.adapter = searchResultAdapter searchResultAdapter.setOnItemClickListener(object : SearchResultAdapter.OnItemClickListener { override fun onClicked(position: Int) { diff --git a/app/src/main/java/com/casic/app/smartwell/view/UnDeployWellActivity.kt b/app/src/main/java/com/casic/app/smartwell/view/UnDeployWellActivity.kt index 7f7cd3c..555c278 100644 --- a/app/src/main/java/com/casic/app/smartwell/view/UnDeployWellActivity.kt +++ b/app/src/main/java/com/casic/app/smartwell/view/UnDeployWellActivity.kt @@ -81,8 +81,8 @@ } } - binding.undeployListView.addItemDecoration( - RecyclerViewItemOffsets(0, 5, 0, 5) + binding.recyclerView.addItemDecoration( + RecyclerViewItemOffsets(0, 7, 0, 7) ) } @@ -147,12 +147,11 @@ } else { item.deep.toString() + "m" } - viewHolder.setText(R.id.wellNameView, item.wellName) + viewHolder.setText(R.id.wellTypeView, item.wellTypeName) .setText(R.id.wellDepthView, "深:${deep}") .setText(R.id.wellCodeView, "点位编号:${item.wellCode}") - .setText(R.id.wellTypeView, "点位类型:${item.wellTypeName}") .setText(R.id.ownerShipView, "权属单位:${item.deptName}") - .setText(R.id.wellLocationView, "点位置:${item.position}") + .setText(R.id.wellLocationView, "点位位置:${item.position}") .setOnClickListener( R.id.operationButton, object : View.OnClickListener { override fun onClick(v: View?) { @@ -185,7 +184,7 @@ ) } } - binding.undeployListView.adapter = unDeployAdapter + binding.recyclerView.adapter = unDeployAdapter unDeployAdapter.setOnItemClickedListener(object : NormalRecyclerAdapter.OnItemClickedListener { override fun onItemClicked(position: Int, t: WellListModel.DataBean.RowsBean) { diff --git a/app/src/main/java/com/casic/app/smartwell/view/WellDetailActivity.kt b/app/src/main/java/com/casic/app/smartwell/view/WellDetailActivity.kt index b50d067..eb8b468 100644 --- a/app/src/main/java/com/casic/app/smartwell/view/WellDetailActivity.kt +++ b/app/src/main/java/com/casic/app/smartwell/view/WellDetailActivity.kt @@ -16,7 +16,7 @@ import com.pengxh.kt.lite.extensions.show import com.pengxh.kt.lite.utils.Constant import com.pengxh.kt.lite.utils.LoadState -import com.pengxh.kt.lite.utils.LoadingDialogHub +import com.pengxh.kt.lite.utils.LoadingDialog import com.pengxh.kt.lite.widget.TitleBarView import com.pengxh.kt.lite.widget.dialog.AlertMessageDialog @@ -44,7 +44,7 @@ } override fun initOnCreate(savedInstanceState: Bundle?) { - val wellId = intent.getStringExtra(Constant.INTENT_PARAM)!! + val wellId = intent.getStringExtra(Constant.INTENT_PARAM_KEY)!! wellViewModel = ViewModelProvider(this)[WellViewModel::class.java] wellViewModel.getWellDetail(wellId) wellViewModel.wellDetailModel.observe(this) { @@ -132,8 +132,8 @@ override fun observeRequestState() { wellViewModel.loadState.observe(this) { when (it) { - is LoadState.Loading -> LoadingDialogHub.show(this, "数据加载中,请稍后") - else -> LoadingDialogHub.dismiss() + is LoadState.Loading -> LoadingDialog.show(this, "数据加载中,请稍后") + else -> LoadingDialog.dismiss() } } } diff --git a/app/src/main/java/com/casic/app/smartwell/view/WellManagementActivity.kt b/app/src/main/java/com/casic/app/smartwell/view/WellManagementActivity.kt index 084da95..457096b 100644 --- a/app/src/main/java/com/casic/app/smartwell/view/WellManagementActivity.kt +++ b/app/src/main/java/com/casic/app/smartwell/view/WellManagementActivity.kt @@ -94,8 +94,8 @@ } } - binding.wellListView.addItemDecoration( - RecyclerViewItemOffsets(0, 5, 0, 5) + binding.recyclerView.addItemDecoration( + RecyclerViewItemOffsets(0, 7, 0, 7) ) } @@ -175,13 +175,12 @@ } else { item.deep.toString() + "m" } - viewHolder.setText(R.id.wellNameView, item.wellName) + viewHolder.setText(R.id.wellTypeView, item.wellTypeName) .setText(R.id.wellStateView, "已${item.bfztName}") .setText(R.id.wellDepthView, "深:${deep}") .setText(R.id.wellCodeView, "点位编号:${item.wellCode}") - .setText(R.id.wellTypeView, "点位类型:${item.wellTypeName}") .setText(R.id.ownerShipView, "权属单位:${item.deptName}") - .setText(R.id.wellLocationView, "点位置:${item.position}") + .setText(R.id.wellLocationView, "点位位置:${item.position}") .setOnClickListener( R.id.navigationButton, object : View.OnClickListener { override fun onClick(v: View?) { @@ -200,7 +199,7 @@ ) } } - binding.wellListView.adapter = wellListAdapter + binding.recyclerView.adapter = wellListAdapter wellListAdapter.setOnItemClickedListener(object : NormalRecyclerAdapter.OnItemClickedListener { override fun onItemClicked(position: Int, t: WellListModel.DataBean.RowsBean) { diff --git a/app/src/main/java/com/casic/app/smartwell/view/WellMonitorActivity.kt b/app/src/main/java/com/casic/app/smartwell/view/WellMonitorActivity.kt index e3573eb..b87bdb7 100644 --- a/app/src/main/java/com/casic/app/smartwell/view/WellMonitorActivity.kt +++ b/app/src/main/java/com/casic/app/smartwell/view/WellMonitorActivity.kt @@ -11,7 +11,7 @@ import com.pengxh.kt.lite.base.KotlinBaseActivity import com.pengxh.kt.lite.utils.Constant import com.pengxh.kt.lite.utils.LoadState -import com.pengxh.kt.lite.utils.LoadingDialogHub +import com.pengxh.kt.lite.utils.LoadingDialog import com.pengxh.kt.lite.widget.TitleBarView class WellMonitorActivity : KotlinBaseActivity() { @@ -36,7 +36,7 @@ } override fun initOnCreate(savedInstanceState: Bundle?) { - val wellId = intent.getStringExtra(Constant.INTENT_PARAM)!! + val wellId = intent.getStringExtra(Constant.INTENT_PARAM_KEY)!! wellViewModel = ViewModelProvider(this)[WellViewModel::class.java] wellViewModel.getMonitorResult(wellId) wellViewModel.monitorModel.observe(this) { @@ -56,8 +56,8 @@ override fun observeRequestState() { wellViewModel.loadState.observe(this) { when (it) { - is LoadState.Loading -> LoadingDialogHub.show(this, "数据加载中,请稍后") - else -> LoadingDialogHub.dismiss() + is LoadState.Loading -> LoadingDialog.show(this, "数据加载中,请稍后") + else -> LoadingDialog.dismiss() } } } diff --git a/app/src/main/java/com/casic/app/smartwell/view/WellOperationActivity.kt b/app/src/main/java/com/casic/app/smartwell/view/WellOperationActivity.kt index 8d333bf..347ebb6 100644 --- a/app/src/main/java/com/casic/app/smartwell/view/WellOperationActivity.kt +++ b/app/src/main/java/com/casic/app/smartwell/view/WellOperationActivity.kt @@ -23,7 +23,7 @@ import com.pengxh.kt.lite.extensions.navigatePageTo import com.pengxh.kt.lite.extensions.show import com.pengxh.kt.lite.utils.LoadState -import com.pengxh.kt.lite.utils.LoadingDialogHub +import com.pengxh.kt.lite.utils.LoadingDialog import com.pengxh.kt.lite.utils.WeakReferenceHandler import com.pengxh.kt.lite.widget.dialog.AlertControlDialog @@ -109,8 +109,8 @@ } } - binding.operationListView.addItemDecoration( - RecyclerViewItemOffsets(0, 5, 0, 5) + binding.recyclerView.addItemDecoration( + RecyclerViewItemOffsets(0, 7, 0, 7) ) } @@ -123,13 +123,13 @@ override fun observeRequestState() { wellViewModel.loadState.observe(this) { when (it) { - is LoadState.Loading -> LoadingDialogHub.show(this, "处理中,请稍后") + is LoadState.Loading -> LoadingDialog.show(this, "处理中,请稍后") is LoadState.Success -> { - LoadingDialogHub.dismiss() + LoadingDialog.dismiss() wellOperationAdapter.notifyItemChanged(clickedPosition) } - else -> LoadingDialogHub.dismiss() + else -> LoadingDialog.dismiss() } } } @@ -203,24 +203,23 @@ if (item.bfztName == "布防") { viewHolder.setImageResource( R.id.wellStateView, R.drawable.bg_solid_text_green_radius_5 - ).setText(R.id.wellStateView, "撤防") + ).setText(R.id.operationButton, "撤防") } else { viewHolder.setImageResource( R.id.wellStateView, R.drawable.bg_solid_text_red_radius_5 - ).setText(R.id.wellStateView, "布防") + ).setText(R.id.operationButton, "布防") } val deep = if (item.deep.toString().isBlank()) { "未知" } else { item.deep.toString() + "m" } - viewHolder.setText(R.id.wellNameView, item.wellName) + viewHolder.setText(R.id.wellTypeView, item.wellTypeName) .setText(R.id.wellStateView, "已${item.bfztName}") .setText(R.id.wellDepthView, "深:${deep}") .setText(R.id.wellCodeView, "点位编号:${item.wellCode}") - .setText(R.id.wellTypeView, "点位类型:${item.wellTypeName}") .setText(R.id.ownerShipView, "权属单位:${item.deptName}") - .setText(R.id.wellLocationView, "点位置:${item.position}") + .setText(R.id.wellLocationView, "点位位置:${item.position}") .setOnClickListener( R.id.operationButton, object : View.OnClickListener { override fun onClick(v: View?) { @@ -280,7 +279,7 @@ ) } } - binding.operationListView.adapter = wellOperationAdapter + binding.recyclerView.adapter = wellOperationAdapter wellOperationAdapter.setOnItemClickedListener(object : NormalRecyclerAdapter.OnItemClickedListener { override fun onItemClicked(position: Int, t: WellListModel.DataBean.RowsBean) { diff --git a/app/src/main/res/drawable/ic_down.xml b/app/src/main/res/drawable/ic_down.xml index 20e6476..6987e6c 100644 --- a/app/src/main/res/drawable/ic_down.xml +++ b/app/src/main/res/drawable/ic_down.xml @@ -1,6 +1,6 @@ + + diff --git a/app/src/main/res/layout/activity_about_us.xml b/app/src/main/res/layout/activity_about_us.xml index 9091a00..d5fbd0d 100644 --- a/app/src/main/res/layout/activity_about_us.xml +++ b/app/src/main/res/layout/activity_about_us.xml @@ -12,13 +12,7 @@ android:layout_width="match_parent" android:layout_height="wrap_content" android:background="@color/mainThemeColor" - app:tbv_left_image="@drawable/ic_title_left" - app:tbv_only_show_title="false" - app:tbv_show_left_image="true" - app:tbv_show_right_image="false" - app:tbv_text="关于我们" - app:tbv_text_color="@color/white" - app:tbv_text_size="@dimen/sp_18" /> + app:tbv_text="关于我们" /> + app:tbv_text="修改密码" /> + app:tbv_text="布防列表" /> + app:tbv_text="帮助中心" /> + app:tbv_text="工单详情" /> + app:tbv_text="工单详情" /> + app:tbv_text="工单详情" /> + app:tbv_text="工单详情" /> + app:tbv_text="超时工单" /> + app:tbv_text="工单查询" /> + app:tbv_text="查询结果" /> + app:tbv_text="撤防列表" /> + app:tbv_text="个人资料" /> - + + android:value="ee96d8b5e12de3fbb29949efd57418a8" /> () @@ -150,7 +158,7 @@ val cameraPosition = CameraPosition(centerLatLng, 14f, 0f, 0f) val cameraUpdate = CameraUpdateFactory.newCameraPosition(cameraPosition) withContext(Dispatchers.Main) { - LoadingDialogHub.dismiss() + LoadingDialog.dismiss() aMap.animateCamera(cameraUpdate, 1500, null) } } @@ -239,11 +247,6 @@ } override fun initEvent() { - binding.rightOptionView.setOnClickListener { - val x = binding.rightOptionView.width - easyPopupWindow.width - easyPopupWindow.showAsDropDown(binding.rightOptionView, x, 0) - } - //撤防点位 binding.unDeployedLayout.setOnClickListener { requireContext().navigatePageTo() @@ -263,11 +266,11 @@ override fun observeRequestState() { wellViewModel.loadState.observe(this) { when (it) { - is LoadState.Loading -> LoadingDialogHub.show( + is LoadState.Loading -> LoadingDialog.show( requireActivity(), "数据加载中,请稍后..." ) - else -> LoadingDialogHub.dismiss() + else -> LoadingDialog.dismiss() } } } @@ -376,7 +379,7 @@ }).build().show() } }) - infoPopup.showAsDropDown(binding.rightOptionView) +// infoPopup.showAsDropDown(binding.rightOptionView) } override fun onCameraChange(p0: CameraPosition?) { diff --git a/app/src/main/java/com/casic/app/smartwell/fragment/HomePageNoClusterFragment.kt b/app/src/main/java/com/casic/app/smartwell/fragment/HomePageNoClusterFragment.kt index 802426a..b25f743 100644 --- a/app/src/main/java/com/casic/app/smartwell/fragment/HomePageNoClusterFragment.kt +++ b/app/src/main/java/com/casic/app/smartwell/fragment/HomePageNoClusterFragment.kt @@ -38,8 +38,9 @@ import com.pengxh.kt.lite.extensions.navigatePageTo import com.pengxh.kt.lite.extensions.show import com.pengxh.kt.lite.utils.LoadState -import com.pengxh.kt.lite.utils.LoadingDialogHub +import com.pengxh.kt.lite.utils.LoadingDialog import com.pengxh.kt.lite.widget.EasyPopupWindow +import com.pengxh.kt.lite.widget.TitleBarView import com.pengxh.kt.lite.widget.dialog.AlertControlDialog import kotlinx.coroutines.Dispatchers import kotlinx.coroutines.launch @@ -78,7 +79,15 @@ override fun setupTopBarLayout() { binding.rootView.initImmersionBar(this, false, R.color.mainThemeColor) - binding.titleView.text = "首页" + binding.titleView.setOnClickListener(object : TitleBarView.OnClickListener { + override fun onLeftClick() { + + } + + override fun onRightClick() { + easyPopupWindow.showAsDropDown(binding.titleView, binding.titleView.width, 0) + } + }) } override fun initOnCreate(savedInstanceState: Bundle?) { @@ -112,7 +121,7 @@ //渲染井位置 lifecycleScope.launch(Dispatchers.Main) { - LoadingDialogHub.show(requireActivity(), "数据加载中,请稍后") + LoadingDialog.show(requireActivity(), "数据加载中,请稍后") withContext(Dispatchers.IO) { //取Well缓存 val allMarkerOptions = ArrayList() @@ -144,7 +153,7 @@ val cameraPosition = CameraPosition(centerLatLng, 14f, 0f, 0f) val cameraUpdate = CameraUpdateFactory.newCameraPosition(cameraPosition) withContext(Dispatchers.Main) { - LoadingDialogHub.dismiss() + LoadingDialog.dismiss() aMap.animateCamera(cameraUpdate, 1500, null) } } @@ -238,11 +247,6 @@ } override fun initEvent() { - binding.rightOptionView.setOnClickListener { - val x = binding.rightOptionView.width - easyPopupWindow.width - easyPopupWindow.showAsDropDown(binding.rightOptionView, x, 0) - } - //撤防点位 binding.unDeployedLayout.setOnClickListener { requireContext().navigatePageTo() @@ -262,11 +266,11 @@ override fun observeRequestState() { wellViewModel.loadState.observe(this) { when (it) { - is LoadState.Loading -> LoadingDialogHub.show( + is LoadState.Loading -> LoadingDialog.show( requireActivity(), "数据加载中,请稍后..." ) - else -> LoadingDialogHub.dismiss() + else -> LoadingDialog.dismiss() } } } diff --git a/app/src/main/java/com/casic/app/smartwell/fragment/MinePageFragment.kt b/app/src/main/java/com/casic/app/smartwell/fragment/MinePageFragment.kt index 09a570c..dcb48f8 100644 --- a/app/src/main/java/com/casic/app/smartwell/fragment/MinePageFragment.kt +++ b/app/src/main/java/com/casic/app/smartwell/fragment/MinePageFragment.kt @@ -35,7 +35,7 @@ import com.pengxh.kt.lite.utils.ActivityStackManager import com.pengxh.kt.lite.utils.FileDownloadManager import com.pengxh.kt.lite.utils.LoadState -import com.pengxh.kt.lite.utils.LoadingDialogHub +import com.pengxh.kt.lite.utils.LoadingDialog import com.pengxh.kt.lite.widget.dialog.AlertControlDialog import com.pengxh.kt.lite.widget.dialog.BottomActionSheet import kotlinx.coroutines.Dispatchers @@ -60,7 +60,6 @@ override fun setupTopBarLayout() { binding.rootView.initImmersionBar(this, false, R.color.mainThemeColor) - binding.titleInclude.titleView.text = "我的" } override fun initOnCreate(savedInstanceState: Bundle?) { @@ -155,27 +154,27 @@ override fun observeRequestState() { userViewModel.loadState.observe(this) { when (it) { - is LoadState.Loading -> LoadingDialogHub.show( + is LoadState.Loading -> LoadingDialog.show( requireActivity(), "检查版本中,请稍后" ) - else -> LoadingDialogHub.dismiss() + else -> LoadingDialog.dismiss() } } wellViewModel.loadState.observe(this) { when (it) { - is LoadState.Loading -> LoadingDialogHub.show( + is LoadState.Loading -> LoadingDialog.show( requireActivity(), "数据更新中,请稍后" ) is LoadState.Fail -> { - LoadingDialogHub.dismiss() + LoadingDialog.dismiss() "数据更新超时".show(requireContext()) } else -> { - LoadingDialogHub.dismiss() + LoadingDialog.dismiss() AlertControlDialog.Builder().setContext(requireContext()).setTitle("温馨提示") .setMessage("数据更新成功,请重启应用").setNegativeButton("取消") .setPositiveButton("确定").setOnDialogButtonClickListener(object : @@ -197,17 +196,17 @@ lineViewModel.loadState.observe(this) { when (it) { - is LoadState.Loading -> LoadingDialogHub.show( + is LoadState.Loading -> LoadingDialog.show( requireActivity(), "数据更新中,请稍后" ) is LoadState.Fail -> { - LoadingDialogHub.dismiss() + LoadingDialog.dismiss() "数据更新超时".show(requireContext()) } else -> { - LoadingDialogHub.dismiss() + LoadingDialog.dismiss() AlertControlDialog.Builder().setContext(requireContext()).setTitle("温馨提示") .setMessage("数据更新成功,请重启应用").setNegativeButton("取消") .setPositiveButton("确定").setOnDialogButtonClickListener(object : diff --git a/app/src/main/java/com/casic/app/smartwell/fragment/NoticePageFragment.kt b/app/src/main/java/com/casic/app/smartwell/fragment/NoticePageFragment.kt index 171b555..3c93f54 100644 --- a/app/src/main/java/com/casic/app/smartwell/fragment/NoticePageFragment.kt +++ b/app/src/main/java/com/casic/app/smartwell/fragment/NoticePageFragment.kt @@ -48,7 +48,6 @@ override fun setupTopBarLayout() { binding.rootView.initImmersionBar(this, false, R.color.mainThemeColor) - binding.titleInclude.titleView.text = "消息" } override fun initOnCreate(savedInstanceState: Bundle?) { diff --git a/app/src/main/java/com/casic/app/smartwell/fragment/OrderListFragment.kt b/app/src/main/java/com/casic/app/smartwell/fragment/OrderListFragment.kt index 93ff35b..5e38acb 100644 --- a/app/src/main/java/com/casic/app/smartwell/fragment/OrderListFragment.kt +++ b/app/src/main/java/com/casic/app/smartwell/fragment/OrderListFragment.kt @@ -12,6 +12,7 @@ import com.casic.app.smartwell.view.SearchOrderActivity import com.pengxh.kt.lite.base.KotlinBaseFragment import com.pengxh.kt.lite.extensions.navigatePageTo +import com.pengxh.kt.lite.widget.TitleBarView class OrderListFragment : KotlinBaseFragment() { @@ -25,15 +26,22 @@ } override fun initViewBinding( - inflater: LayoutInflater, - container: ViewGroup? + inflater: LayoutInflater, container: ViewGroup? ): FragmentOrderBinding { return FragmentOrderBinding.inflate(inflater, container, false) } override fun setupTopBarLayout() { binding.rootView.initImmersionBar(this, false, R.color.mainThemeColor) - binding.titleView.text = "工单" + binding.titleView.setOnClickListener(object : TitleBarView.OnClickListener { + override fun onLeftClick() { + + } + + override fun onRightClick() { + requireContext().navigatePageTo() + } + }) } override fun initOnCreate(savedInstanceState: Bundle?) { @@ -51,8 +59,6 @@ } override fun initEvent() { - binding.rightOptionView.setOnClickListener { - requireContext().navigatePageTo() - } + } } \ No newline at end of file diff --git a/app/src/main/java/com/casic/app/smartwell/fragment/OrderNotProcessedFragment.kt b/app/src/main/java/com/casic/app/smartwell/fragment/OrderNotProcessedFragment.kt index 0b3d09d..2b6f21d 100644 --- a/app/src/main/java/com/casic/app/smartwell/fragment/OrderNotProcessedFragment.kt +++ b/app/src/main/java/com/casic/app/smartwell/fragment/OrderNotProcessedFragment.kt @@ -18,7 +18,7 @@ import com.pengxh.kt.lite.extensions.navigatePageTo import com.pengxh.kt.lite.extensions.show import com.pengxh.kt.lite.utils.LoadState -import com.pengxh.kt.lite.utils.LoadingDialogHub +import com.pengxh.kt.lite.utils.LoadingDialog import com.pengxh.kt.lite.utils.WeakReferenceHandler import com.pengxh.kt.lite.widget.dialog.AlertControlDialog @@ -78,8 +78,8 @@ operationViewModel = ViewModelProvider(this)[OperationViewModel::class.java] - binding.notProcessedView.addItemDecoration( - RecyclerViewItemOffsets(0, 5, 0, 5) + binding.recyclerView.addItemDecoration( + RecyclerViewItemOffsets(0, 7, 0, 7) ) } @@ -87,9 +87,9 @@ //接单状态处理 operationViewModel.loadState.observe(this) { when (it) { - is LoadState.Loading -> LoadingDialogHub.show(requireActivity(), "接单中,请稍后") + is LoadState.Loading -> LoadingDialog.show(requireActivity(), "接单中,请稍后") is LoadState.Success -> { - LoadingDialogHub.dismiss() + LoadingDialog.dismiss() //接单成功之后刷新列表 dataBeans.removeAt(clickedPosition) notProcessedAdapter.notifyItemRemoved(clickedPosition) @@ -98,7 +98,7 @@ ) } - else -> LoadingDialogHub.dismiss() + else -> LoadingDialog.dismiss() } } } @@ -131,7 +131,7 @@ } else { binding.emptyInclude.emptyView.hide() notProcessedAdapter = OrderNotProcessedAdapter(requireContext(), dataBeans) - binding.notProcessedView.adapter = notProcessedAdapter + binding.recyclerView.adapter = notProcessedAdapter notProcessedAdapter.setOnItemClickListener(object : OrderNotProcessedAdapter.OnItemClickListener { override fun onClicked(position: Int) { diff --git a/app/src/main/java/com/casic/app/smartwell/fragment/OvertimeNotAcceptFragment.kt b/app/src/main/java/com/casic/app/smartwell/fragment/OvertimeNotAcceptFragment.kt index a198545..9b318ca 100644 --- a/app/src/main/java/com/casic/app/smartwell/fragment/OvertimeNotAcceptFragment.kt +++ b/app/src/main/java/com/casic/app/smartwell/fragment/OvertimeNotAcceptFragment.kt @@ -18,7 +18,7 @@ import com.pengxh.kt.lite.extensions.navigatePageTo import com.pengxh.kt.lite.extensions.show import com.pengxh.kt.lite.utils.LoadState -import com.pengxh.kt.lite.utils.LoadingDialogHub +import com.pengxh.kt.lite.utils.LoadingDialog import com.pengxh.kt.lite.utils.WeakReferenceHandler import com.pengxh.kt.lite.widget.dialog.AlertControlDialog @@ -81,8 +81,8 @@ operationViewModel = ViewModelProvider(this)[OperationViewModel::class.java] - binding.notProcessedView.addItemDecoration( - RecyclerViewItemOffsets(0, 5, 0, 5) + binding.recyclerView.addItemDecoration( + RecyclerViewItemOffsets(0, 7, 0, 7) ) } @@ -90,9 +90,9 @@ //接单状态处理 operationViewModel.loadState.observe(this) { when (it) { - is LoadState.Loading -> LoadingDialogHub.show(requireActivity(), "接单中,请稍后") + is LoadState.Loading -> LoadingDialog.show(requireActivity(), "接单中,请稍后") is LoadState.Success -> { - LoadingDialogHub.dismiss() + LoadingDialog.dismiss() //接单成功之后刷新列表 dataBeans.removeAt(clickedPosition) notProcessedAdapter.notifyItemRemoved(clickedPosition) @@ -101,7 +101,7 @@ ) } - else -> LoadingDialogHub.dismiss() + else -> LoadingDialog.dismiss() } } } @@ -134,7 +134,7 @@ } else { binding.emptyInclude.emptyView.hide() notProcessedAdapter = OrderNotProcessedAdapter(requireContext(), dataBeans) - binding.notProcessedView.adapter = notProcessedAdapter + binding.recyclerView.adapter = notProcessedAdapter notProcessedAdapter.setOnItemClickListener(object : OrderNotProcessedAdapter.OnItemClickListener { override fun onClicked(position: Int) { diff --git a/app/src/main/java/com/casic/app/smartwell/greendao/DaoMaster.java b/app/src/main/java/com/casic/app/smartwell/greendao/DaoMaster.java index fdcf3a7..1e52b74 100644 --- a/app/src/main/java/com/casic/app/smartwell/greendao/DaoMaster.java +++ b/app/src/main/java/com/casic/app/smartwell/greendao/DaoMaster.java @@ -13,25 +13,20 @@ // THIS CODE IS GENERATED BY greenDAO, DO NOT EDIT. - /** * Master of DAO (schema version 4): knows all DAOs. */ public class DaoMaster extends AbstractDaoMaster { public static final int SCHEMA_VERSION = 4; - /** - * Creates underlying database table using DAOs. - */ + /** Creates underlying database table using DAOs. */ public static void createAllTables(Database db, boolean ifNotExists) { MapWellLocalBeanDao.createTable(db, ifNotExists); NoticeLocaleBeanDao.createTable(db, ifNotExists); PipeLocalBeanDao.createTable(db, ifNotExists); } - /** - * Drops underlying database table using DAOs. - */ + /** Drops underlying database table using DAOs. */ public static void dropAllTables(Database db, boolean ifExists) { MapWellLocalBeanDao.dropTable(db, ifExists); NoticeLocaleBeanDao.dropTable(db, ifExists); @@ -86,9 +81,7 @@ } } - /** - * WARNING: Drops all table on Upgrade! Use only during development. - */ + /** WARNING: Drops all table on Upgrade! Use only during development. */ public static class DevOpenHelper extends OpenHelper { public DevOpenHelper(Context context, String name) { super(context, name); diff --git a/app/src/main/java/com/casic/app/smartwell/greendao/DaoSession.java b/app/src/main/java/com/casic/app/smartwell/greendao/DaoSession.java index 0b36d17..3e40e3b 100644 --- a/app/src/main/java/com/casic/app/smartwell/greendao/DaoSession.java +++ b/app/src/main/java/com/casic/app/smartwell/greendao/DaoSession.java @@ -16,7 +16,7 @@ /** * {@inheritDoc} - * + * * @see org.greenrobot.greendao.AbstractDaoSession */ public class DaoSession extends AbstractDaoSession { @@ -50,7 +50,7 @@ registerDao(NoticeLocaleBean.class, noticeLocaleBeanDao); registerDao(PipeLocalBean.class, pipeLocalBeanDao); } - + public void clear() { mapWellLocalBeanDaoConfig.clearIdentityScope(); noticeLocaleBeanDaoConfig.clearIdentityScope(); diff --git a/app/src/main/java/com/casic/app/smartwell/greendao/MapWellLocalBeanDao.java b/app/src/main/java/com/casic/app/smartwell/greendao/MapWellLocalBeanDao.java index 8908fda..407bc92 100644 --- a/app/src/main/java/com/casic/app/smartwell/greendao/MapWellLocalBeanDao.java +++ b/app/src/main/java/com/casic/app/smartwell/greendao/MapWellLocalBeanDao.java @@ -12,10 +12,9 @@ import org.greenrobot.greendao.internal.DaoConfig; // THIS CODE IS GENERATED BY greenDAO, DO NOT EDIT. - -/** +/** * DAO for table "MAP_WELL_LOCAL_BEAN". - */ +*/ public class MapWellLocalBeanDao extends AbstractDao { public static final String TABLENAME = "MAP_WELL_LOCAL_BEAN"; @@ -57,16 +56,14 @@ public MapWellLocalBeanDao(DaoConfig config) { super(config); } - + public MapWellLocalBeanDao(DaoConfig config, DaoSession daoSession) { super(config, daoSession); } - /** - * Creates the underlying database table. - */ + /** Creates the underlying database table. */ public static void createTable(Database db, boolean ifNotExists) { - String constraint = ifNotExists ? "IF NOT EXISTS " : ""; + String constraint = ifNotExists? "IF NOT EXISTS ": ""; db.execSQL("CREATE TABLE " + constraint + "\"MAP_WELL_LOCAL_BEAN\" (" + // "\"_id\" INTEGER PRIMARY KEY AUTOINCREMENT ," + // 0: kId "\"AREA\" TEXT," + // 1: area @@ -96,9 +93,7 @@ "\"WELL_TYPE_NAME\" TEXT);"); // 25: wellTypeName } - /** - * Drops the underlying database table. - */ + /** Drops the underlying database table. */ public static void dropTable(Database db, boolean ifExists) { String sql = "DROP TABLE " + (ifExists ? "IF EXISTS " : "") + "\"MAP_WELL_LOCAL_BEAN\""; db.execSQL(sql); @@ -107,132 +102,132 @@ @Override protected final void bindValues(DatabaseStatement stmt, MapWellLocalBean entity) { stmt.clearBindings(); - + Long kId = entity.getKId(); if (kId != null) { stmt.bindLong(1, kId); } - + String area = entity.getArea(); if (area != null) { stmt.bindString(2, area); } - + String bfzt = entity.getBfzt(); if (bfzt != null) { stmt.bindString(3, bfzt); } - + String bfztName = entity.getBfztName(); if (bfztName != null) { stmt.bindString(4, bfztName); } - + String coordinateX = entity.getCoordinateX(); if (coordinateX != null) { stmt.bindString(5, coordinateX); } - + String coordinateY = entity.getCoordinateY(); if (coordinateY != null) { stmt.bindString(6, coordinateY); } - + String deep = entity.getDeep(); if (deep != null) { stmt.bindString(7, deep); } - + String deptName = entity.getDeptName(); if (deptName != null) { stmt.bindString(8, deptName); } - + String deptid = entity.getDeptid(); if (deptid != null) { stmt.bindString(9, deptid); } - + String id = entity.getId(); if (id != null) { stmt.bindString(10, id); } - + String latBaidu = entity.getLatBaidu(); if (latBaidu != null) { stmt.bindString(11, latBaidu); } - + String latGaode = entity.getLatGaode(); if (latGaode != null) { stmt.bindString(12, latGaode); } - + String lngBaidu = entity.getLngBaidu(); if (lngBaidu != null) { stmt.bindString(13, lngBaidu); } - + String lngGaode = entity.getLngGaode(); if (lngGaode != null) { stmt.bindString(14, lngGaode); } - + String notes = entity.getNotes(); if (notes != null) { stmt.bindString(15, notes); } - + String photos = entity.getPhotos(); if (photos != null) { stmt.bindString(16, photos); } - + String position = entity.getPosition(); if (position != null) { stmt.bindString(17, position); } - + String staff = entity.getStaff(); if (staff != null) { stmt.bindString(18, staff); } - + String tel = entity.getTel(); if (tel != null) { stmt.bindString(19, tel); } - + String ts = entity.getTs(); if (ts != null) { stmt.bindString(20, ts); } - + String valid = entity.getValid(); if (valid != null) { stmt.bindString(21, valid); } - + String watchData = entity.getWatchData(); if (watchData != null) { stmt.bindString(22, watchData); } - + String wellCode = entity.getWellCode(); if (wellCode != null) { stmt.bindString(23, wellCode); } - + String wellName = entity.getWellName(); if (wellName != null) { stmt.bindString(24, wellName); } - + String wellType = entity.getWellType(); if (wellType != null) { stmt.bindString(25, wellType); } - + String wellTypeName = entity.getWellTypeName(); if (wellTypeName != null) { stmt.bindString(26, wellTypeName); @@ -242,132 +237,132 @@ @Override protected final void bindValues(SQLiteStatement stmt, MapWellLocalBean entity) { stmt.clearBindings(); - + Long kId = entity.getKId(); if (kId != null) { stmt.bindLong(1, kId); } - + String area = entity.getArea(); if (area != null) { stmt.bindString(2, area); } - + String bfzt = entity.getBfzt(); if (bfzt != null) { stmt.bindString(3, bfzt); } - + String bfztName = entity.getBfztName(); if (bfztName != null) { stmt.bindString(4, bfztName); } - + String coordinateX = entity.getCoordinateX(); if (coordinateX != null) { stmt.bindString(5, coordinateX); } - + String coordinateY = entity.getCoordinateY(); if (coordinateY != null) { stmt.bindString(6, coordinateY); } - + String deep = entity.getDeep(); if (deep != null) { stmt.bindString(7, deep); } - + String deptName = entity.getDeptName(); if (deptName != null) { stmt.bindString(8, deptName); } - + String deptid = entity.getDeptid(); if (deptid != null) { stmt.bindString(9, deptid); } - + String id = entity.getId(); if (id != null) { stmt.bindString(10, id); } - + String latBaidu = entity.getLatBaidu(); if (latBaidu != null) { stmt.bindString(11, latBaidu); } - + String latGaode = entity.getLatGaode(); if (latGaode != null) { stmt.bindString(12, latGaode); } - + String lngBaidu = entity.getLngBaidu(); if (lngBaidu != null) { stmt.bindString(13, lngBaidu); } - + String lngGaode = entity.getLngGaode(); if (lngGaode != null) { stmt.bindString(14, lngGaode); } - + String notes = entity.getNotes(); if (notes != null) { stmt.bindString(15, notes); } - + String photos = entity.getPhotos(); if (photos != null) { stmt.bindString(16, photos); } - + String position = entity.getPosition(); if (position != null) { stmt.bindString(17, position); } - + String staff = entity.getStaff(); if (staff != null) { stmt.bindString(18, staff); } - + String tel = entity.getTel(); if (tel != null) { stmt.bindString(19, tel); } - + String ts = entity.getTs(); if (ts != null) { stmt.bindString(20, ts); } - + String valid = entity.getValid(); if (valid != null) { stmt.bindString(21, valid); } - + String watchData = entity.getWatchData(); if (watchData != null) { stmt.bindString(22, watchData); } - + String wellCode = entity.getWellCode(); if (wellCode != null) { stmt.bindString(23, wellCode); } - + String wellName = entity.getWellName(); if (wellName != null) { stmt.bindString(24, wellName); } - + String wellType = entity.getWellType(); if (wellType != null) { stmt.bindString(25, wellType); } - + String wellTypeName = entity.getWellTypeName(); if (wellTypeName != null) { stmt.bindString(26, wellTypeName); @@ -377,41 +372,41 @@ @Override public Long readKey(Cursor cursor, int offset) { return cursor.isNull(offset + 0) ? null : cursor.getLong(offset + 0); - } + } @Override public MapWellLocalBean readEntity(Cursor cursor, int offset) { MapWellLocalBean entity = new MapWellLocalBean( // - cursor.isNull(offset + 0) ? null : cursor.getLong(offset + 0), // kId - cursor.isNull(offset + 1) ? null : cursor.getString(offset + 1), // area - cursor.isNull(offset + 2) ? null : cursor.getString(offset + 2), // bfzt - cursor.isNull(offset + 3) ? null : cursor.getString(offset + 3), // bfztName - cursor.isNull(offset + 4) ? null : cursor.getString(offset + 4), // coordinateX - cursor.isNull(offset + 5) ? null : cursor.getString(offset + 5), // coordinateY - cursor.isNull(offset + 6) ? null : cursor.getString(offset + 6), // deep - cursor.isNull(offset + 7) ? null : cursor.getString(offset + 7), // deptName - cursor.isNull(offset + 8) ? null : cursor.getString(offset + 8), // deptid - cursor.isNull(offset + 9) ? null : cursor.getString(offset + 9), // id - cursor.isNull(offset + 10) ? null : cursor.getString(offset + 10), // latBaidu - cursor.isNull(offset + 11) ? null : cursor.getString(offset + 11), // latGaode - cursor.isNull(offset + 12) ? null : cursor.getString(offset + 12), // lngBaidu - cursor.isNull(offset + 13) ? null : cursor.getString(offset + 13), // lngGaode - cursor.isNull(offset + 14) ? null : cursor.getString(offset + 14), // notes - cursor.isNull(offset + 15) ? null : cursor.getString(offset + 15), // photos - cursor.isNull(offset + 16) ? null : cursor.getString(offset + 16), // position - cursor.isNull(offset + 17) ? null : cursor.getString(offset + 17), // staff - cursor.isNull(offset + 18) ? null : cursor.getString(offset + 18), // tel - cursor.isNull(offset + 19) ? null : cursor.getString(offset + 19), // ts - cursor.isNull(offset + 20) ? null : cursor.getString(offset + 20), // valid - cursor.isNull(offset + 21) ? null : cursor.getString(offset + 21), // watchData - cursor.isNull(offset + 22) ? null : cursor.getString(offset + 22), // wellCode - cursor.isNull(offset + 23) ? null : cursor.getString(offset + 23), // wellName - cursor.isNull(offset + 24) ? null : cursor.getString(offset + 24), // wellType - cursor.isNull(offset + 25) ? null : cursor.getString(offset + 25) // wellTypeName + cursor.isNull(offset + 0) ? null : cursor.getLong(offset + 0), // kId + cursor.isNull(offset + 1) ? null : cursor.getString(offset + 1), // area + cursor.isNull(offset + 2) ? null : cursor.getString(offset + 2), // bfzt + cursor.isNull(offset + 3) ? null : cursor.getString(offset + 3), // bfztName + cursor.isNull(offset + 4) ? null : cursor.getString(offset + 4), // coordinateX + cursor.isNull(offset + 5) ? null : cursor.getString(offset + 5), // coordinateY + cursor.isNull(offset + 6) ? null : cursor.getString(offset + 6), // deep + cursor.isNull(offset + 7) ? null : cursor.getString(offset + 7), // deptName + cursor.isNull(offset + 8) ? null : cursor.getString(offset + 8), // deptid + cursor.isNull(offset + 9) ? null : cursor.getString(offset + 9), // id + cursor.isNull(offset + 10) ? null : cursor.getString(offset + 10), // latBaidu + cursor.isNull(offset + 11) ? null : cursor.getString(offset + 11), // latGaode + cursor.isNull(offset + 12) ? null : cursor.getString(offset + 12), // lngBaidu + cursor.isNull(offset + 13) ? null : cursor.getString(offset + 13), // lngGaode + cursor.isNull(offset + 14) ? null : cursor.getString(offset + 14), // notes + cursor.isNull(offset + 15) ? null : cursor.getString(offset + 15), // photos + cursor.isNull(offset + 16) ? null : cursor.getString(offset + 16), // position + cursor.isNull(offset + 17) ? null : cursor.getString(offset + 17), // staff + cursor.isNull(offset + 18) ? null : cursor.getString(offset + 18), // tel + cursor.isNull(offset + 19) ? null : cursor.getString(offset + 19), // ts + cursor.isNull(offset + 20) ? null : cursor.getString(offset + 20), // valid + cursor.isNull(offset + 21) ? null : cursor.getString(offset + 21), // watchData + cursor.isNull(offset + 22) ? null : cursor.getString(offset + 22), // wellCode + cursor.isNull(offset + 23) ? null : cursor.getString(offset + 23), // wellName + cursor.isNull(offset + 24) ? null : cursor.getString(offset + 24), // wellType + cursor.isNull(offset + 25) ? null : cursor.getString(offset + 25) // wellTypeName ); return entity; } - + @Override public void readEntity(Cursor cursor, MapWellLocalBean entity, int offset) { entity.setKId(cursor.isNull(offset + 0) ? null : cursor.getLong(offset + 0)); @@ -440,17 +435,17 @@ entity.setWellName(cursor.isNull(offset + 23) ? null : cursor.getString(offset + 23)); entity.setWellType(cursor.isNull(offset + 24) ? null : cursor.getString(offset + 24)); entity.setWellTypeName(cursor.isNull(offset + 25) ? null : cursor.getString(offset + 25)); - } - + } + @Override protected final Long updateKeyAfterInsert(MapWellLocalBean entity, long rowId) { entity.setKId(rowId); return rowId; } - + @Override public Long getKey(MapWellLocalBean entity) { - if (entity != null) { + if(entity != null) { return entity.getKId(); } else { return null; @@ -466,5 +461,5 @@ protected final boolean isEntityUpdateable() { return true; } - + } diff --git a/app/src/main/java/com/casic/app/smartwell/greendao/NoticeLocaleBeanDao.java b/app/src/main/java/com/casic/app/smartwell/greendao/NoticeLocaleBeanDao.java index 64312ed..deb2d49 100644 --- a/app/src/main/java/com/casic/app/smartwell/greendao/NoticeLocaleBeanDao.java +++ b/app/src/main/java/com/casic/app/smartwell/greendao/NoticeLocaleBeanDao.java @@ -12,10 +12,9 @@ import org.greenrobot.greendao.internal.DaoConfig; // THIS CODE IS GENERATED BY greenDAO, DO NOT EDIT. - -/** +/** * DAO for table "NOTICE_LOCALE_BEAN". - */ +*/ public class NoticeLocaleBeanDao extends AbstractDao { public static final String TABLENAME = "NOTICE_LOCALE_BEAN"; @@ -43,16 +42,14 @@ public NoticeLocaleBeanDao(DaoConfig config) { super(config); } - + public NoticeLocaleBeanDao(DaoConfig config, DaoSession daoSession) { super(config, daoSession); } - /** - * Creates the underlying database table. - */ + /** Creates the underlying database table. */ public static void createTable(Database db, boolean ifNotExists) { - String constraint = ifNotExists ? "IF NOT EXISTS " : ""; + String constraint = ifNotExists? "IF NOT EXISTS ": ""; db.execSQL("CREATE TABLE " + constraint + "\"NOTICE_LOCALE_BEAN\" (" + // "\"_id\" INTEGER PRIMARY KEY AUTOINCREMENT ," + // 0: id "\"MESSAGE_ID\" TEXT UNIQUE ," + // 1: messageId @@ -68,9 +65,7 @@ "\"NOTICE_TIME\" TEXT);"); // 11: noticeTime } - /** - * Drops the underlying database table. - */ + /** Drops the underlying database table. */ public static void dropTable(Database db, boolean ifExists) { String sql = "DROP TABLE " + (ifExists ? "IF EXISTS " : "") + "\"NOTICE_LOCALE_BEAN\""; db.execSQL(sql); @@ -79,62 +74,62 @@ @Override protected final void bindValues(DatabaseStatement stmt, NoticeLocaleBean entity) { stmt.clearBindings(); - + Long id = entity.getId(); if (id != null) { stmt.bindLong(1, id); } - + String messageId = entity.getMessageId(); if (messageId != null) { stmt.bindString(2, messageId); } - + String appid = entity.getAppid(); if (appid != null) { stmt.bindString(3, appid); } - + String clientId = entity.getClientId(); if (clientId != null) { stmt.bindString(4, clientId); } - + String taskId = entity.getTaskId(); if (taskId != null) { stmt.bindString(5, taskId); } - + String userId = entity.getUserId(); if (userId != null) { stmt.bindString(6, userId); } - + String title = entity.getTitle(); if (title != null) { stmt.bindString(7, title); } - + String content = entity.getContent(); if (content != null) { stmt.bindString(8, content); } - + String deviceCode = entity.getDeviceCode(); if (deviceCode != null) { stmt.bindString(9, deviceCode); } - + String jobId = entity.getJobId(); if (jobId != null) { stmt.bindString(10, jobId); } - + String isRead = entity.getIsRead(); if (isRead != null) { stmt.bindString(11, isRead); } - + String noticeTime = entity.getNoticeTime(); if (noticeTime != null) { stmt.bindString(12, noticeTime); @@ -144,62 +139,62 @@ @Override protected final void bindValues(SQLiteStatement stmt, NoticeLocaleBean entity) { stmt.clearBindings(); - + Long id = entity.getId(); if (id != null) { stmt.bindLong(1, id); } - + String messageId = entity.getMessageId(); if (messageId != null) { stmt.bindString(2, messageId); } - + String appid = entity.getAppid(); if (appid != null) { stmt.bindString(3, appid); } - + String clientId = entity.getClientId(); if (clientId != null) { stmt.bindString(4, clientId); } - + String taskId = entity.getTaskId(); if (taskId != null) { stmt.bindString(5, taskId); } - + String userId = entity.getUserId(); if (userId != null) { stmt.bindString(6, userId); } - + String title = entity.getTitle(); if (title != null) { stmt.bindString(7, title); } - + String content = entity.getContent(); if (content != null) { stmt.bindString(8, content); } - + String deviceCode = entity.getDeviceCode(); if (deviceCode != null) { stmt.bindString(9, deviceCode); } - + String jobId = entity.getJobId(); if (jobId != null) { stmt.bindString(10, jobId); } - + String isRead = entity.getIsRead(); if (isRead != null) { stmt.bindString(11, isRead); } - + String noticeTime = entity.getNoticeTime(); if (noticeTime != null) { stmt.bindString(12, noticeTime); @@ -209,27 +204,27 @@ @Override public Long readKey(Cursor cursor, int offset) { return cursor.isNull(offset + 0) ? null : cursor.getLong(offset + 0); - } + } @Override public NoticeLocaleBean readEntity(Cursor cursor, int offset) { NoticeLocaleBean entity = new NoticeLocaleBean( // - cursor.isNull(offset + 0) ? null : cursor.getLong(offset + 0), // id - cursor.isNull(offset + 1) ? null : cursor.getString(offset + 1), // messageId - cursor.isNull(offset + 2) ? null : cursor.getString(offset + 2), // appid - cursor.isNull(offset + 3) ? null : cursor.getString(offset + 3), // clientId - cursor.isNull(offset + 4) ? null : cursor.getString(offset + 4), // taskId - cursor.isNull(offset + 5) ? null : cursor.getString(offset + 5), // userId - cursor.isNull(offset + 6) ? null : cursor.getString(offset + 6), // title - cursor.isNull(offset + 7) ? null : cursor.getString(offset + 7), // content - cursor.isNull(offset + 8) ? null : cursor.getString(offset + 8), // deviceCode - cursor.isNull(offset + 9) ? null : cursor.getString(offset + 9), // jobId - cursor.isNull(offset + 10) ? null : cursor.getString(offset + 10), // isRead - cursor.isNull(offset + 11) ? null : cursor.getString(offset + 11) // noticeTime + cursor.isNull(offset + 0) ? null : cursor.getLong(offset + 0), // id + cursor.isNull(offset + 1) ? null : cursor.getString(offset + 1), // messageId + cursor.isNull(offset + 2) ? null : cursor.getString(offset + 2), // appid + cursor.isNull(offset + 3) ? null : cursor.getString(offset + 3), // clientId + cursor.isNull(offset + 4) ? null : cursor.getString(offset + 4), // taskId + cursor.isNull(offset + 5) ? null : cursor.getString(offset + 5), // userId + cursor.isNull(offset + 6) ? null : cursor.getString(offset + 6), // title + cursor.isNull(offset + 7) ? null : cursor.getString(offset + 7), // content + cursor.isNull(offset + 8) ? null : cursor.getString(offset + 8), // deviceCode + cursor.isNull(offset + 9) ? null : cursor.getString(offset + 9), // jobId + cursor.isNull(offset + 10) ? null : cursor.getString(offset + 10), // isRead + cursor.isNull(offset + 11) ? null : cursor.getString(offset + 11) // noticeTime ); return entity; } - + @Override public void readEntity(Cursor cursor, NoticeLocaleBean entity, int offset) { entity.setId(cursor.isNull(offset + 0) ? null : cursor.getLong(offset + 0)); @@ -244,17 +239,17 @@ entity.setJobId(cursor.isNull(offset + 9) ? null : cursor.getString(offset + 9)); entity.setIsRead(cursor.isNull(offset + 10) ? null : cursor.getString(offset + 10)); entity.setNoticeTime(cursor.isNull(offset + 11) ? null : cursor.getString(offset + 11)); - } - + } + @Override protected final Long updateKeyAfterInsert(NoticeLocaleBean entity, long rowId) { entity.setId(rowId); return rowId; } - + @Override public Long getKey(NoticeLocaleBean entity) { - if (entity != null) { + if(entity != null) { return entity.getId(); } else { return null; @@ -270,5 +265,5 @@ protected final boolean isEntityUpdateable() { return true; } - + } diff --git a/app/src/main/java/com/casic/app/smartwell/greendao/PipeLocalBeanDao.java b/app/src/main/java/com/casic/app/smartwell/greendao/PipeLocalBeanDao.java index aab4d3f..df5515a 100644 --- a/app/src/main/java/com/casic/app/smartwell/greendao/PipeLocalBeanDao.java +++ b/app/src/main/java/com/casic/app/smartwell/greendao/PipeLocalBeanDao.java @@ -12,10 +12,9 @@ import org.greenrobot.greendao.internal.DaoConfig; // THIS CODE IS GENERATED BY greenDAO, DO NOT EDIT. - -/** +/** * DAO for table "PIPE_LOCAL_BEAN". - */ +*/ public class PipeLocalBeanDao extends AbstractDao { public static final String TABLENAME = "PIPE_LOCAL_BEAN"; @@ -37,16 +36,14 @@ public PipeLocalBeanDao(DaoConfig config) { super(config); } - + public PipeLocalBeanDao(DaoConfig config, DaoSession daoSession) { super(config, daoSession); } - /** - * Creates the underlying database table. - */ + /** Creates the underlying database table. */ public static void createTable(Database db, boolean ifNotExists) { - String constraint = ifNotExists ? "IF NOT EXISTS " : ""; + String constraint = ifNotExists? "IF NOT EXISTS ": ""; db.execSQL("CREATE TABLE " + constraint + "\"PIPE_LOCAL_BEAN\" (" + // "\"_id\" INTEGER PRIMARY KEY AUTOINCREMENT ," + // 0: id "\"PIPE_CODE\" TEXT," + // 1: pipeCode @@ -56,9 +53,7 @@ "\"START_LONGITUDE_GD\" TEXT);"); // 5: startLongitudeGd } - /** - * Drops the underlying database table. - */ + /** Drops the underlying database table. */ public static void dropTable(Database db, boolean ifExists) { String sql = "DROP TABLE " + (ifExists ? "IF EXISTS " : "") + "\"PIPE_LOCAL_BEAN\""; db.execSQL(sql); @@ -67,32 +62,32 @@ @Override protected final void bindValues(DatabaseStatement stmt, PipeLocalBean entity) { stmt.clearBindings(); - + Long id = entity.getId(); if (id != null) { stmt.bindLong(1, id); } - + String pipeCode = entity.getPipeCode(); if (pipeCode != null) { stmt.bindString(2, pipeCode); } - + String endLatitudeGd = entity.getEndLatitudeGd(); if (endLatitudeGd != null) { stmt.bindString(3, endLatitudeGd); } - + String endLongitudeGd = entity.getEndLongitudeGd(); if (endLongitudeGd != null) { stmt.bindString(4, endLongitudeGd); } - + String startLatitudeGd = entity.getStartLatitudeGd(); if (startLatitudeGd != null) { stmt.bindString(5, startLatitudeGd); } - + String startLongitudeGd = entity.getStartLongitudeGd(); if (startLongitudeGd != null) { stmt.bindString(6, startLongitudeGd); @@ -102,32 +97,32 @@ @Override protected final void bindValues(SQLiteStatement stmt, PipeLocalBean entity) { stmt.clearBindings(); - + Long id = entity.getId(); if (id != null) { stmt.bindLong(1, id); } - + String pipeCode = entity.getPipeCode(); if (pipeCode != null) { stmt.bindString(2, pipeCode); } - + String endLatitudeGd = entity.getEndLatitudeGd(); if (endLatitudeGd != null) { stmt.bindString(3, endLatitudeGd); } - + String endLongitudeGd = entity.getEndLongitudeGd(); if (endLongitudeGd != null) { stmt.bindString(4, endLongitudeGd); } - + String startLatitudeGd = entity.getStartLatitudeGd(); if (startLatitudeGd != null) { stmt.bindString(5, startLatitudeGd); } - + String startLongitudeGd = entity.getStartLongitudeGd(); if (startLongitudeGd != null) { stmt.bindString(6, startLongitudeGd); @@ -137,21 +132,21 @@ @Override public Long readKey(Cursor cursor, int offset) { return cursor.isNull(offset + 0) ? null : cursor.getLong(offset + 0); - } + } @Override public PipeLocalBean readEntity(Cursor cursor, int offset) { PipeLocalBean entity = new PipeLocalBean( // - cursor.isNull(offset + 0) ? null : cursor.getLong(offset + 0), // id - cursor.isNull(offset + 1) ? null : cursor.getString(offset + 1), // pipeCode - cursor.isNull(offset + 2) ? null : cursor.getString(offset + 2), // endLatitudeGd - cursor.isNull(offset + 3) ? null : cursor.getString(offset + 3), // endLongitudeGd - cursor.isNull(offset + 4) ? null : cursor.getString(offset + 4), // startLatitudeGd - cursor.isNull(offset + 5) ? null : cursor.getString(offset + 5) // startLongitudeGd + cursor.isNull(offset + 0) ? null : cursor.getLong(offset + 0), // id + cursor.isNull(offset + 1) ? null : cursor.getString(offset + 1), // pipeCode + cursor.isNull(offset + 2) ? null : cursor.getString(offset + 2), // endLatitudeGd + cursor.isNull(offset + 3) ? null : cursor.getString(offset + 3), // endLongitudeGd + cursor.isNull(offset + 4) ? null : cursor.getString(offset + 4), // startLatitudeGd + cursor.isNull(offset + 5) ? null : cursor.getString(offset + 5) // startLongitudeGd ); return entity; } - + @Override public void readEntity(Cursor cursor, PipeLocalBean entity, int offset) { entity.setId(cursor.isNull(offset + 0) ? null : cursor.getLong(offset + 0)); @@ -160,17 +155,17 @@ entity.setEndLongitudeGd(cursor.isNull(offset + 3) ? null : cursor.getString(offset + 3)); entity.setStartLatitudeGd(cursor.isNull(offset + 4) ? null : cursor.getString(offset + 4)); entity.setStartLongitudeGd(cursor.isNull(offset + 5) ? null : cursor.getString(offset + 5)); - } - + } + @Override protected final Long updateKeyAfterInsert(PipeLocalBean entity, long rowId) { entity.setId(rowId); return rowId; } - + @Override public Long getKey(PipeLocalBean entity) { - if (entity != null) { + if(entity != null) { return entity.getId(); } else { return null; @@ -186,5 +181,5 @@ protected final boolean isEntityUpdateable() { return true; } - + } diff --git a/app/src/main/java/com/casic/app/smartwell/view/ChangePasswordActivity.kt b/app/src/main/java/com/casic/app/smartwell/view/ChangePasswordActivity.kt index 8e41039..9f1dd40 100644 --- a/app/src/main/java/com/casic/app/smartwell/view/ChangePasswordActivity.kt +++ b/app/src/main/java/com/casic/app/smartwell/view/ChangePasswordActivity.kt @@ -14,7 +14,7 @@ import com.pengxh.kt.lite.extensions.show import com.pengxh.kt.lite.utils.ActivityStackManager import com.pengxh.kt.lite.utils.LoadState -import com.pengxh.kt.lite.utils.LoadingDialogHub +import com.pengxh.kt.lite.utils.LoadingDialog import com.pengxh.kt.lite.widget.TitleBarView import java.nio.charset.StandardCharsets @@ -46,15 +46,15 @@ override fun observeRequestState() { userViewModel.loadState.observe(this) { when (it) { - is LoadState.Loading -> LoadingDialogHub.show(this, "修改中,请稍后") + is LoadState.Loading -> LoadingDialog.show(this, "修改中,请稍后") is LoadState.Success -> { - LoadingDialogHub.dismiss() + LoadingDialog.dismiss() AuthenticationHelper.removeToken() this.navigatePageTo() ActivityStackManager.finishAllActivity() } - else -> LoadingDialogHub.dismiss() + else -> LoadingDialog.dismiss() } } } diff --git a/app/src/main/java/com/casic/app/smartwell/view/DeployedWellActivity.kt b/app/src/main/java/com/casic/app/smartwell/view/DeployedWellActivity.kt index fb4339c..28a5078 100644 --- a/app/src/main/java/com/casic/app/smartwell/view/DeployedWellActivity.kt +++ b/app/src/main/java/com/casic/app/smartwell/view/DeployedWellActivity.kt @@ -83,8 +83,8 @@ } //添加分割线 - binding.deployedListView.addItemDecoration( - RecyclerViewItemOffsets(0, 5, 0, 5) + binding.recyclerView.addItemDecoration( + RecyclerViewItemOffsets(0, 7, 0, 7) ) } @@ -149,12 +149,11 @@ } else { item.deep.toString() + "m" } - viewHolder.setText(R.id.wellNameView, item.wellName) + viewHolder.setText(R.id.wellTypeView, item.wellTypeName) .setText(R.id.wellDepthView, "深:${deep}") .setText(R.id.wellCodeView, "点位编号:${item.wellCode}") - .setText(R.id.wellTypeView, "点位类型:${item.wellTypeName}") .setText(R.id.ownerShipView, "权属单位:${item.deptName}") - .setText(R.id.wellLocationView, "点位置:${item.position}") + .setText(R.id.wellLocationView, "点位位置:${item.position}") .setOnClickListener( R.id.operationButton, object : View.OnClickListener { override fun onClick(v: View?) { @@ -207,7 +206,7 @@ }) } } - binding.deployedListView.adapter = deployAdapter + binding.recyclerView.adapter = deployAdapter deployAdapter.setOnItemClickedListener(object : NormalRecyclerAdapter.OnItemClickedListener { override fun onItemClicked(position: Int, t: WellListModel.DataBean.RowsBean) { diff --git a/app/src/main/java/com/casic/app/smartwell/view/LoginActivity.kt b/app/src/main/java/com/casic/app/smartwell/view/LoginActivity.kt index e4bb0e3..834527b 100644 --- a/app/src/main/java/com/casic/app/smartwell/view/LoginActivity.kt +++ b/app/src/main/java/com/casic/app/smartwell/view/LoginActivity.kt @@ -21,7 +21,7 @@ import com.pengxh.kt.lite.extensions.navigatePageTo import com.pengxh.kt.lite.extensions.readAssetsFile import com.pengxh.kt.lite.extensions.show -import com.pengxh.kt.lite.utils.LoadingDialogHub +import com.pengxh.kt.lite.utils.LoadingDialog import com.pengxh.kt.lite.utils.SaveKeyValues import kotlinx.coroutines.Dispatchers import kotlinx.coroutines.launch @@ -106,11 +106,11 @@ override fun observeRequestState() { authenticateViewModel.loadState.observe(this) { - LoadingDialogHub.show(this, "登录中,请稍后") + LoadingDialog.show(this, "登录中,请稍后") } loginViewModel.loadState.observe(this) { - LoadingDialogHub.dismiss() + LoadingDialog.dismiss() } } diff --git a/app/src/main/java/com/casic/app/smartwell/view/OrderCompletedDetailActivity.kt b/app/src/main/java/com/casic/app/smartwell/view/OrderCompletedDetailActivity.kt index db8ad1f..75cd905 100644 --- a/app/src/main/java/com/casic/app/smartwell/view/OrderCompletedDetailActivity.kt +++ b/app/src/main/java/com/casic/app/smartwell/view/OrderCompletedDetailActivity.kt @@ -17,7 +17,7 @@ import com.pengxh.kt.lite.extensions.show import com.pengxh.kt.lite.utils.Constant import com.pengxh.kt.lite.utils.LoadState -import com.pengxh.kt.lite.utils.LoadingDialogHub +import com.pengxh.kt.lite.utils.LoadingDialog import com.pengxh.kt.lite.widget.TitleBarView import com.pengxh.kt.lite.widget.dialog.AlertMessageDialog @@ -44,7 +44,7 @@ } override fun initOnCreate(savedInstanceState: Bundle?) { - val jobId = intent.getStringExtra(Constant.INTENT_PARAM)!! + val jobId = intent.getStringExtra(Constant.INTENT_PARAM_KEY)!! orderViewModel = ViewModelProvider(this)[OrderViewModel::class.java] orderViewModel.getWorkOrderDetail(jobId) orderViewModel.detailModel.observe(this) { @@ -154,8 +154,8 @@ override fun observeRequestState() { orderViewModel.loadState.observe(this) { when (it) { - is LoadState.Loading -> LoadingDialogHub.show(this, "数据加载中,请稍后") - else -> LoadingDialogHub.dismiss() + is LoadState.Loading -> LoadingDialog.show(this, "数据加载中,请稍后") + else -> LoadingDialog.dismiss() } } } diff --git a/app/src/main/java/com/casic/app/smartwell/view/OrderInHandleDetailActivity.kt b/app/src/main/java/com/casic/app/smartwell/view/OrderInHandleDetailActivity.kt index d70a979..04a7d5d 100644 --- a/app/src/main/java/com/casic/app/smartwell/view/OrderInHandleDetailActivity.kt +++ b/app/src/main/java/com/casic/app/smartwell/view/OrderInHandleDetailActivity.kt @@ -38,7 +38,7 @@ import com.pengxh.kt.lite.extensions.show import com.pengxh.kt.lite.utils.Constant import com.pengxh.kt.lite.utils.LoadState -import com.pengxh.kt.lite.utils.LoadingDialogHub +import com.pengxh.kt.lite.utils.LoadingDialog import com.pengxh.kt.lite.widget.TitleBarView import com.pengxh.kt.lite.widget.dialog.AlertControlDialog import com.pengxh.kt.lite.widget.dialog.AlertMessageDialog @@ -93,7 +93,7 @@ ) binding.addImageRecyclerView.adapter = imageAdapter - val jobId = intent.getStringExtra(Constant.INTENT_PARAM)!!//初始化图片九宫格 + val jobId = intent.getStringExtra(Constant.INTENT_PARAM_KEY)!!//初始化图片九宫格 orderViewModel.getWorkOrderDetail(jobId) orderViewModel.detailModel.observe(this) { if (it.code == 200) { @@ -312,41 +312,41 @@ override fun observeRequestState() { orderViewModel.loadState.observe(this) { when (it) { - is LoadState.Loading -> LoadingDialogHub.show(this, "数据加载中,请稍后") - else -> LoadingDialogHub.dismiss() + is LoadState.Loading -> LoadingDialog.show(this, "数据加载中,请稍后") + else -> LoadingDialog.dismiss() } } uploadImageViewModel.loadState.observe(this) { when (it) { - LoadState.Loading -> LoadingDialogHub.show(this, "图片上传中,请稍后...") - else -> LoadingDialogHub.dismiss() + LoadState.Loading -> LoadingDialog.show(this, "图片上传中,请稍后...") + else -> LoadingDialog.dismiss() } } //转单状态处理 operationViewModel.loadState.observe(this) { when (it) { - is LoadState.Loading -> LoadingDialogHub.show(this, "转单中,请稍后") + is LoadState.Loading -> LoadingDialog.show(this, "转单中,请稍后") is LoadState.Success -> { - LoadingDialogHub.dismiss() + LoadingDialog.dismiss() this.finish() } - else -> LoadingDialogHub.dismiss() + else -> LoadingDialog.dismiss() } } //处理完成工单状态处理 operationViewModel.loadState.observe(this) { when (it) { - is LoadState.Loading -> LoadingDialogHub.show(this, "处理中,请稍后") + is LoadState.Loading -> LoadingDialog.show(this, "处理中,请稍后") is LoadState.Success -> { - LoadingDialogHub.dismiss() + LoadingDialog.dismiss() this.finish() } - else -> LoadingDialogHub.dismiss() + else -> LoadingDialog.dismiss() } } } diff --git a/app/src/main/java/com/casic/app/smartwell/view/OrderNotConfirmedDetailActivity.kt b/app/src/main/java/com/casic/app/smartwell/view/OrderNotConfirmedDetailActivity.kt index 8e036d2..687ec86 100644 --- a/app/src/main/java/com/casic/app/smartwell/view/OrderNotConfirmedDetailActivity.kt +++ b/app/src/main/java/com/casic/app/smartwell/view/OrderNotConfirmedDetailActivity.kt @@ -36,7 +36,7 @@ import com.pengxh.kt.lite.extensions.show import com.pengxh.kt.lite.utils.Constant import com.pengxh.kt.lite.utils.LoadState -import com.pengxh.kt.lite.utils.LoadingDialogHub +import com.pengxh.kt.lite.utils.LoadingDialog import com.pengxh.kt.lite.widget.TitleBarView import com.pengxh.kt.lite.widget.dialog.AlertControlDialog import com.pengxh.kt.lite.widget.dialog.AlertMessageDialog @@ -80,7 +80,7 @@ } override fun initOnCreate(savedInstanceState: Bundle?) { - val jobId = intent.getStringExtra(Constant.INTENT_PARAM)!! + val jobId = intent.getStringExtra(Constant.INTENT_PARAM_KEY)!! //初始化图片九宫格 //左外边距,左内边距,右内边距,右外边距 val viewWidth = getScreenWidth() - (10 + 10 + 10 + 10).dp2px(this) @@ -263,41 +263,41 @@ //数据加载状态处理 orderViewModel.loadState.observe(this) { when (it) { - is LoadState.Loading -> LoadingDialogHub.show(this, "数据加载中,请稍后") - else -> LoadingDialogHub.dismiss() + is LoadState.Loading -> LoadingDialog.show(this, "数据加载中,请稍后") + else -> LoadingDialog.dismiss() } } uploadImageViewModel.loadState.observe(this) { when (it) { - LoadState.Loading -> LoadingDialogHub.show(this, "图片上传中,请稍后") - else -> LoadingDialogHub.dismiss() + LoadState.Loading -> LoadingDialog.show(this, "图片上传中,请稍后") + else -> LoadingDialog.dismiss() } } //转单状态处理 operationViewModel.loadState.observe(this) { when (it) { - is LoadState.Loading -> LoadingDialogHub.show(this, "转单中,请稍后") + is LoadState.Loading -> LoadingDialog.show(this, "转单中,请稍后") is LoadState.Success -> { - LoadingDialogHub.dismiss() + LoadingDialog.dismiss() this.finish() } - else -> LoadingDialogHub.dismiss() + else -> LoadingDialog.dismiss() } } //确认工单状态处理 operationViewModel.loadState.observe(this) { when (it) { - is LoadState.Loading -> LoadingDialogHub.show(this, "处理中,请稍后") + is LoadState.Loading -> LoadingDialog.show(this, "处理中,请稍后") is LoadState.Success -> { - LoadingDialogHub.dismiss() + LoadingDialog.dismiss() this.finish() } - else -> LoadingDialogHub.dismiss() + else -> LoadingDialog.dismiss() } } } diff --git a/app/src/main/java/com/casic/app/smartwell/view/OrderNotProcessedDetailActivity.kt b/app/src/main/java/com/casic/app/smartwell/view/OrderNotProcessedDetailActivity.kt index d3f22dc..0c97a52 100644 --- a/app/src/main/java/com/casic/app/smartwell/view/OrderNotProcessedDetailActivity.kt +++ b/app/src/main/java/com/casic/app/smartwell/view/OrderNotProcessedDetailActivity.kt @@ -18,7 +18,7 @@ import com.pengxh.kt.lite.extensions.show import com.pengxh.kt.lite.utils.Constant import com.pengxh.kt.lite.utils.LoadState -import com.pengxh.kt.lite.utils.LoadingDialogHub +import com.pengxh.kt.lite.utils.LoadingDialog import com.pengxh.kt.lite.widget.TitleBarView import com.pengxh.kt.lite.widget.dialog.AlertControlDialog import com.pengxh.kt.lite.widget.dialog.AlertMessageDialog @@ -50,7 +50,7 @@ } override fun initOnCreate(savedInstanceState: Bundle?) { - this.jobId = intent.getStringExtra(Constant.INTENT_PARAM)!! + this.jobId = intent.getStringExtra(Constant.INTENT_PARAM_KEY)!! orderViewModel = ViewModelProvider(this)[OrderViewModel::class.java] operationViewModel = ViewModelProvider(this)[OperationViewModel::class.java] wellViewModel = ViewModelProvider(this)[WellViewModel::class.java] @@ -162,21 +162,21 @@ //数据加载状态处理 orderViewModel.loadState.observe(this) { when (it) { - is LoadState.Loading -> LoadingDialogHub.show(this, "数据加载中,请稍后") - else -> LoadingDialogHub.dismiss() + is LoadState.Loading -> LoadingDialog.show(this, "数据加载中,请稍后") + else -> LoadingDialog.dismiss() } } //接单状态处理 operationViewModel.loadState.observe(this) { when (it) { - is LoadState.Loading -> LoadingDialogHub.show(this, "接单中,请稍后") + is LoadState.Loading -> LoadingDialog.show(this, "接单中,请稍后") is LoadState.Success -> { - LoadingDialogHub.dismiss() + LoadingDialog.dismiss() this.finish() } - else -> LoadingDialogHub.dismiss() + else -> LoadingDialog.dismiss() } } } diff --git a/app/src/main/java/com/casic/app/smartwell/view/SearchResultActivity.kt b/app/src/main/java/com/casic/app/smartwell/view/SearchResultActivity.kt index 6a92917..4f3a674 100644 --- a/app/src/main/java/com/casic/app/smartwell/view/SearchResultActivity.kt +++ b/app/src/main/java/com/casic/app/smartwell/view/SearchResultActivity.kt @@ -19,7 +19,7 @@ import com.pengxh.kt.lite.extensions.show import com.pengxh.kt.lite.utils.Constant import com.pengxh.kt.lite.utils.LoadState -import com.pengxh.kt.lite.utils.LoadingDialogHub +import com.pengxh.kt.lite.utils.LoadingDialog import com.pengxh.kt.lite.utils.WeakReferenceHandler import com.pengxh.kt.lite.widget.TitleBarView import com.pengxh.kt.lite.widget.dialog.AlertControlDialog @@ -56,7 +56,7 @@ } override fun initOnCreate(savedInstanceState: Bundle?) { - args = intent.getStringArrayListExtra(Constant.INTENT_PARAM)!! + args = intent.getStringArrayListExtra(Constant.INTENT_PARAM_KEY)!! orderViewModel = ViewModelProvider(this)[OrderViewModel::class.java] operationViewModel = ViewModelProvider(this)[OperationViewModel::class.java] @@ -101,24 +101,24 @@ } } - binding.resultRecyclerView.addItemDecoration( - RecyclerViewItemOffsets(0, 5, 0, 5) + binding.recyclerView.addItemDecoration( + RecyclerViewItemOffsets(0, 7, 0, 7) ) } override fun observeRequestState() { orderViewModel.loadState.observe(this) { when (it) { - is LoadState.Loading -> LoadingDialogHub.show(this, "数据加载中,请稍后") - else -> LoadingDialogHub.dismiss() + is LoadState.Loading -> LoadingDialog.show(this, "数据加载中,请稍后") + else -> LoadingDialog.dismiss() } } //接单状态处理 operationViewModel.loadState.observe(this) { when (it) { - is LoadState.Loading -> LoadingDialogHub.show(this, "接单中,请稍后") + is LoadState.Loading -> LoadingDialog.show(this, "接单中,请稍后") is LoadState.Success -> { - LoadingDialogHub.dismiss() + LoadingDialog.dismiss() //接单成功之后刷新列表 dataBeans.removeAt(clickedPosition) searchResultAdapter.notifyItemRemoved(clickedPosition) @@ -127,7 +127,7 @@ ) } - else -> LoadingDialogHub.dismiss() + else -> LoadingDialog.dismiss() } } } @@ -162,7 +162,7 @@ } else { binding.emptyInclude.emptyView.hide() searchResultAdapter = SearchResultAdapter(this, dataBeans) - binding.resultRecyclerView.adapter = searchResultAdapter + binding.recyclerView.adapter = searchResultAdapter searchResultAdapter.setOnItemClickListener(object : SearchResultAdapter.OnItemClickListener { override fun onClicked(position: Int) { diff --git a/app/src/main/java/com/casic/app/smartwell/view/UnDeployWellActivity.kt b/app/src/main/java/com/casic/app/smartwell/view/UnDeployWellActivity.kt index 7f7cd3c..555c278 100644 --- a/app/src/main/java/com/casic/app/smartwell/view/UnDeployWellActivity.kt +++ b/app/src/main/java/com/casic/app/smartwell/view/UnDeployWellActivity.kt @@ -81,8 +81,8 @@ } } - binding.undeployListView.addItemDecoration( - RecyclerViewItemOffsets(0, 5, 0, 5) + binding.recyclerView.addItemDecoration( + RecyclerViewItemOffsets(0, 7, 0, 7) ) } @@ -147,12 +147,11 @@ } else { item.deep.toString() + "m" } - viewHolder.setText(R.id.wellNameView, item.wellName) + viewHolder.setText(R.id.wellTypeView, item.wellTypeName) .setText(R.id.wellDepthView, "深:${deep}") .setText(R.id.wellCodeView, "点位编号:${item.wellCode}") - .setText(R.id.wellTypeView, "点位类型:${item.wellTypeName}") .setText(R.id.ownerShipView, "权属单位:${item.deptName}") - .setText(R.id.wellLocationView, "点位置:${item.position}") + .setText(R.id.wellLocationView, "点位位置:${item.position}") .setOnClickListener( R.id.operationButton, object : View.OnClickListener { override fun onClick(v: View?) { @@ -185,7 +184,7 @@ ) } } - binding.undeployListView.adapter = unDeployAdapter + binding.recyclerView.adapter = unDeployAdapter unDeployAdapter.setOnItemClickedListener(object : NormalRecyclerAdapter.OnItemClickedListener { override fun onItemClicked(position: Int, t: WellListModel.DataBean.RowsBean) { diff --git a/app/src/main/java/com/casic/app/smartwell/view/WellDetailActivity.kt b/app/src/main/java/com/casic/app/smartwell/view/WellDetailActivity.kt index b50d067..eb8b468 100644 --- a/app/src/main/java/com/casic/app/smartwell/view/WellDetailActivity.kt +++ b/app/src/main/java/com/casic/app/smartwell/view/WellDetailActivity.kt @@ -16,7 +16,7 @@ import com.pengxh.kt.lite.extensions.show import com.pengxh.kt.lite.utils.Constant import com.pengxh.kt.lite.utils.LoadState -import com.pengxh.kt.lite.utils.LoadingDialogHub +import com.pengxh.kt.lite.utils.LoadingDialog import com.pengxh.kt.lite.widget.TitleBarView import com.pengxh.kt.lite.widget.dialog.AlertMessageDialog @@ -44,7 +44,7 @@ } override fun initOnCreate(savedInstanceState: Bundle?) { - val wellId = intent.getStringExtra(Constant.INTENT_PARAM)!! + val wellId = intent.getStringExtra(Constant.INTENT_PARAM_KEY)!! wellViewModel = ViewModelProvider(this)[WellViewModel::class.java] wellViewModel.getWellDetail(wellId) wellViewModel.wellDetailModel.observe(this) { @@ -132,8 +132,8 @@ override fun observeRequestState() { wellViewModel.loadState.observe(this) { when (it) { - is LoadState.Loading -> LoadingDialogHub.show(this, "数据加载中,请稍后") - else -> LoadingDialogHub.dismiss() + is LoadState.Loading -> LoadingDialog.show(this, "数据加载中,请稍后") + else -> LoadingDialog.dismiss() } } } diff --git a/app/src/main/java/com/casic/app/smartwell/view/WellManagementActivity.kt b/app/src/main/java/com/casic/app/smartwell/view/WellManagementActivity.kt index 084da95..457096b 100644 --- a/app/src/main/java/com/casic/app/smartwell/view/WellManagementActivity.kt +++ b/app/src/main/java/com/casic/app/smartwell/view/WellManagementActivity.kt @@ -94,8 +94,8 @@ } } - binding.wellListView.addItemDecoration( - RecyclerViewItemOffsets(0, 5, 0, 5) + binding.recyclerView.addItemDecoration( + RecyclerViewItemOffsets(0, 7, 0, 7) ) } @@ -175,13 +175,12 @@ } else { item.deep.toString() + "m" } - viewHolder.setText(R.id.wellNameView, item.wellName) + viewHolder.setText(R.id.wellTypeView, item.wellTypeName) .setText(R.id.wellStateView, "已${item.bfztName}") .setText(R.id.wellDepthView, "深:${deep}") .setText(R.id.wellCodeView, "点位编号:${item.wellCode}") - .setText(R.id.wellTypeView, "点位类型:${item.wellTypeName}") .setText(R.id.ownerShipView, "权属单位:${item.deptName}") - .setText(R.id.wellLocationView, "点位置:${item.position}") + .setText(R.id.wellLocationView, "点位位置:${item.position}") .setOnClickListener( R.id.navigationButton, object : View.OnClickListener { override fun onClick(v: View?) { @@ -200,7 +199,7 @@ ) } } - binding.wellListView.adapter = wellListAdapter + binding.recyclerView.adapter = wellListAdapter wellListAdapter.setOnItemClickedListener(object : NormalRecyclerAdapter.OnItemClickedListener { override fun onItemClicked(position: Int, t: WellListModel.DataBean.RowsBean) { diff --git a/app/src/main/java/com/casic/app/smartwell/view/WellMonitorActivity.kt b/app/src/main/java/com/casic/app/smartwell/view/WellMonitorActivity.kt index e3573eb..b87bdb7 100644 --- a/app/src/main/java/com/casic/app/smartwell/view/WellMonitorActivity.kt +++ b/app/src/main/java/com/casic/app/smartwell/view/WellMonitorActivity.kt @@ -11,7 +11,7 @@ import com.pengxh.kt.lite.base.KotlinBaseActivity import com.pengxh.kt.lite.utils.Constant import com.pengxh.kt.lite.utils.LoadState -import com.pengxh.kt.lite.utils.LoadingDialogHub +import com.pengxh.kt.lite.utils.LoadingDialog import com.pengxh.kt.lite.widget.TitleBarView class WellMonitorActivity : KotlinBaseActivity() { @@ -36,7 +36,7 @@ } override fun initOnCreate(savedInstanceState: Bundle?) { - val wellId = intent.getStringExtra(Constant.INTENT_PARAM)!! + val wellId = intent.getStringExtra(Constant.INTENT_PARAM_KEY)!! wellViewModel = ViewModelProvider(this)[WellViewModel::class.java] wellViewModel.getMonitorResult(wellId) wellViewModel.monitorModel.observe(this) { @@ -56,8 +56,8 @@ override fun observeRequestState() { wellViewModel.loadState.observe(this) { when (it) { - is LoadState.Loading -> LoadingDialogHub.show(this, "数据加载中,请稍后") - else -> LoadingDialogHub.dismiss() + is LoadState.Loading -> LoadingDialog.show(this, "数据加载中,请稍后") + else -> LoadingDialog.dismiss() } } } diff --git a/app/src/main/java/com/casic/app/smartwell/view/WellOperationActivity.kt b/app/src/main/java/com/casic/app/smartwell/view/WellOperationActivity.kt index 8d333bf..347ebb6 100644 --- a/app/src/main/java/com/casic/app/smartwell/view/WellOperationActivity.kt +++ b/app/src/main/java/com/casic/app/smartwell/view/WellOperationActivity.kt @@ -23,7 +23,7 @@ import com.pengxh.kt.lite.extensions.navigatePageTo import com.pengxh.kt.lite.extensions.show import com.pengxh.kt.lite.utils.LoadState -import com.pengxh.kt.lite.utils.LoadingDialogHub +import com.pengxh.kt.lite.utils.LoadingDialog import com.pengxh.kt.lite.utils.WeakReferenceHandler import com.pengxh.kt.lite.widget.dialog.AlertControlDialog @@ -109,8 +109,8 @@ } } - binding.operationListView.addItemDecoration( - RecyclerViewItemOffsets(0, 5, 0, 5) + binding.recyclerView.addItemDecoration( + RecyclerViewItemOffsets(0, 7, 0, 7) ) } @@ -123,13 +123,13 @@ override fun observeRequestState() { wellViewModel.loadState.observe(this) { when (it) { - is LoadState.Loading -> LoadingDialogHub.show(this, "处理中,请稍后") + is LoadState.Loading -> LoadingDialog.show(this, "处理中,请稍后") is LoadState.Success -> { - LoadingDialogHub.dismiss() + LoadingDialog.dismiss() wellOperationAdapter.notifyItemChanged(clickedPosition) } - else -> LoadingDialogHub.dismiss() + else -> LoadingDialog.dismiss() } } } @@ -203,24 +203,23 @@ if (item.bfztName == "布防") { viewHolder.setImageResource( R.id.wellStateView, R.drawable.bg_solid_text_green_radius_5 - ).setText(R.id.wellStateView, "撤防") + ).setText(R.id.operationButton, "撤防") } else { viewHolder.setImageResource( R.id.wellStateView, R.drawable.bg_solid_text_red_radius_5 - ).setText(R.id.wellStateView, "布防") + ).setText(R.id.operationButton, "布防") } val deep = if (item.deep.toString().isBlank()) { "未知" } else { item.deep.toString() + "m" } - viewHolder.setText(R.id.wellNameView, item.wellName) + viewHolder.setText(R.id.wellTypeView, item.wellTypeName) .setText(R.id.wellStateView, "已${item.bfztName}") .setText(R.id.wellDepthView, "深:${deep}") .setText(R.id.wellCodeView, "点位编号:${item.wellCode}") - .setText(R.id.wellTypeView, "点位类型:${item.wellTypeName}") .setText(R.id.ownerShipView, "权属单位:${item.deptName}") - .setText(R.id.wellLocationView, "点位置:${item.position}") + .setText(R.id.wellLocationView, "点位位置:${item.position}") .setOnClickListener( R.id.operationButton, object : View.OnClickListener { override fun onClick(v: View?) { @@ -280,7 +279,7 @@ ) } } - binding.operationListView.adapter = wellOperationAdapter + binding.recyclerView.adapter = wellOperationAdapter wellOperationAdapter.setOnItemClickedListener(object : NormalRecyclerAdapter.OnItemClickedListener { override fun onItemClicked(position: Int, t: WellListModel.DataBean.RowsBean) { diff --git a/app/src/main/res/drawable/ic_down.xml b/app/src/main/res/drawable/ic_down.xml index 20e6476..6987e6c 100644 --- a/app/src/main/res/drawable/ic_down.xml +++ b/app/src/main/res/drawable/ic_down.xml @@ -1,6 +1,6 @@ + + diff --git a/app/src/main/res/layout/activity_about_us.xml b/app/src/main/res/layout/activity_about_us.xml index 9091a00..d5fbd0d 100644 --- a/app/src/main/res/layout/activity_about_us.xml +++ b/app/src/main/res/layout/activity_about_us.xml @@ -12,13 +12,7 @@ android:layout_width="match_parent" android:layout_height="wrap_content" android:background="@color/mainThemeColor" - app:tbv_left_image="@drawable/ic_title_left" - app:tbv_only_show_title="false" - app:tbv_show_left_image="true" - app:tbv_show_right_image="false" - app:tbv_text="关于我们" - app:tbv_text_color="@color/white" - app:tbv_text_size="@dimen/sp_18" /> + app:tbv_text="关于我们" /> + app:tbv_text="修改密码" /> + app:tbv_text="布防列表" /> + app:tbv_text="帮助中心" /> + app:tbv_text="工单详情" /> + app:tbv_text="工单详情" /> + app:tbv_text="工单详情" /> + app:tbv_text="工单详情" /> + app:tbv_text="超时工单" /> + app:tbv_text="工单查询" /> + app:tbv_text="查询结果" /> + app:tbv_text="撤防列表" /> + app:tbv_text="个人资料" /> + app:tbv_text="点位详情" /> - + + android:value="ee96d8b5e12de3fbb29949efd57418a8" /> () @@ -150,7 +158,7 @@ val cameraPosition = CameraPosition(centerLatLng, 14f, 0f, 0f) val cameraUpdate = CameraUpdateFactory.newCameraPosition(cameraPosition) withContext(Dispatchers.Main) { - LoadingDialogHub.dismiss() + LoadingDialog.dismiss() aMap.animateCamera(cameraUpdate, 1500, null) } } @@ -239,11 +247,6 @@ } override fun initEvent() { - binding.rightOptionView.setOnClickListener { - val x = binding.rightOptionView.width - easyPopupWindow.width - easyPopupWindow.showAsDropDown(binding.rightOptionView, x, 0) - } - //撤防点位 binding.unDeployedLayout.setOnClickListener { requireContext().navigatePageTo() @@ -263,11 +266,11 @@ override fun observeRequestState() { wellViewModel.loadState.observe(this) { when (it) { - is LoadState.Loading -> LoadingDialogHub.show( + is LoadState.Loading -> LoadingDialog.show( requireActivity(), "数据加载中,请稍后..." ) - else -> LoadingDialogHub.dismiss() + else -> LoadingDialog.dismiss() } } } @@ -376,7 +379,7 @@ }).build().show() } }) - infoPopup.showAsDropDown(binding.rightOptionView) +// infoPopup.showAsDropDown(binding.rightOptionView) } override fun onCameraChange(p0: CameraPosition?) { diff --git a/app/src/main/java/com/casic/app/smartwell/fragment/HomePageNoClusterFragment.kt b/app/src/main/java/com/casic/app/smartwell/fragment/HomePageNoClusterFragment.kt index 802426a..b25f743 100644 --- a/app/src/main/java/com/casic/app/smartwell/fragment/HomePageNoClusterFragment.kt +++ b/app/src/main/java/com/casic/app/smartwell/fragment/HomePageNoClusterFragment.kt @@ -38,8 +38,9 @@ import com.pengxh.kt.lite.extensions.navigatePageTo import com.pengxh.kt.lite.extensions.show import com.pengxh.kt.lite.utils.LoadState -import com.pengxh.kt.lite.utils.LoadingDialogHub +import com.pengxh.kt.lite.utils.LoadingDialog import com.pengxh.kt.lite.widget.EasyPopupWindow +import com.pengxh.kt.lite.widget.TitleBarView import com.pengxh.kt.lite.widget.dialog.AlertControlDialog import kotlinx.coroutines.Dispatchers import kotlinx.coroutines.launch @@ -78,7 +79,15 @@ override fun setupTopBarLayout() { binding.rootView.initImmersionBar(this, false, R.color.mainThemeColor) - binding.titleView.text = "首页" + binding.titleView.setOnClickListener(object : TitleBarView.OnClickListener { + override fun onLeftClick() { + + } + + override fun onRightClick() { + easyPopupWindow.showAsDropDown(binding.titleView, binding.titleView.width, 0) + } + }) } override fun initOnCreate(savedInstanceState: Bundle?) { @@ -112,7 +121,7 @@ //渲染井位置 lifecycleScope.launch(Dispatchers.Main) { - LoadingDialogHub.show(requireActivity(), "数据加载中,请稍后") + LoadingDialog.show(requireActivity(), "数据加载中,请稍后") withContext(Dispatchers.IO) { //取Well缓存 val allMarkerOptions = ArrayList() @@ -144,7 +153,7 @@ val cameraPosition = CameraPosition(centerLatLng, 14f, 0f, 0f) val cameraUpdate = CameraUpdateFactory.newCameraPosition(cameraPosition) withContext(Dispatchers.Main) { - LoadingDialogHub.dismiss() + LoadingDialog.dismiss() aMap.animateCamera(cameraUpdate, 1500, null) } } @@ -238,11 +247,6 @@ } override fun initEvent() { - binding.rightOptionView.setOnClickListener { - val x = binding.rightOptionView.width - easyPopupWindow.width - easyPopupWindow.showAsDropDown(binding.rightOptionView, x, 0) - } - //撤防点位 binding.unDeployedLayout.setOnClickListener { requireContext().navigatePageTo() @@ -262,11 +266,11 @@ override fun observeRequestState() { wellViewModel.loadState.observe(this) { when (it) { - is LoadState.Loading -> LoadingDialogHub.show( + is LoadState.Loading -> LoadingDialog.show( requireActivity(), "数据加载中,请稍后..." ) - else -> LoadingDialogHub.dismiss() + else -> LoadingDialog.dismiss() } } } diff --git a/app/src/main/java/com/casic/app/smartwell/fragment/MinePageFragment.kt b/app/src/main/java/com/casic/app/smartwell/fragment/MinePageFragment.kt index 09a570c..dcb48f8 100644 --- a/app/src/main/java/com/casic/app/smartwell/fragment/MinePageFragment.kt +++ b/app/src/main/java/com/casic/app/smartwell/fragment/MinePageFragment.kt @@ -35,7 +35,7 @@ import com.pengxh.kt.lite.utils.ActivityStackManager import com.pengxh.kt.lite.utils.FileDownloadManager import com.pengxh.kt.lite.utils.LoadState -import com.pengxh.kt.lite.utils.LoadingDialogHub +import com.pengxh.kt.lite.utils.LoadingDialog import com.pengxh.kt.lite.widget.dialog.AlertControlDialog import com.pengxh.kt.lite.widget.dialog.BottomActionSheet import kotlinx.coroutines.Dispatchers @@ -60,7 +60,6 @@ override fun setupTopBarLayout() { binding.rootView.initImmersionBar(this, false, R.color.mainThemeColor) - binding.titleInclude.titleView.text = "我的" } override fun initOnCreate(savedInstanceState: Bundle?) { @@ -155,27 +154,27 @@ override fun observeRequestState() { userViewModel.loadState.observe(this) { when (it) { - is LoadState.Loading -> LoadingDialogHub.show( + is LoadState.Loading -> LoadingDialog.show( requireActivity(), "检查版本中,请稍后" ) - else -> LoadingDialogHub.dismiss() + else -> LoadingDialog.dismiss() } } wellViewModel.loadState.observe(this) { when (it) { - is LoadState.Loading -> LoadingDialogHub.show( + is LoadState.Loading -> LoadingDialog.show( requireActivity(), "数据更新中,请稍后" ) is LoadState.Fail -> { - LoadingDialogHub.dismiss() + LoadingDialog.dismiss() "数据更新超时".show(requireContext()) } else -> { - LoadingDialogHub.dismiss() + LoadingDialog.dismiss() AlertControlDialog.Builder().setContext(requireContext()).setTitle("温馨提示") .setMessage("数据更新成功,请重启应用").setNegativeButton("取消") .setPositiveButton("确定").setOnDialogButtonClickListener(object : @@ -197,17 +196,17 @@ lineViewModel.loadState.observe(this) { when (it) { - is LoadState.Loading -> LoadingDialogHub.show( + is LoadState.Loading -> LoadingDialog.show( requireActivity(), "数据更新中,请稍后" ) is LoadState.Fail -> { - LoadingDialogHub.dismiss() + LoadingDialog.dismiss() "数据更新超时".show(requireContext()) } else -> { - LoadingDialogHub.dismiss() + LoadingDialog.dismiss() AlertControlDialog.Builder().setContext(requireContext()).setTitle("温馨提示") .setMessage("数据更新成功,请重启应用").setNegativeButton("取消") .setPositiveButton("确定").setOnDialogButtonClickListener(object : diff --git a/app/src/main/java/com/casic/app/smartwell/fragment/NoticePageFragment.kt b/app/src/main/java/com/casic/app/smartwell/fragment/NoticePageFragment.kt index 171b555..3c93f54 100644 --- a/app/src/main/java/com/casic/app/smartwell/fragment/NoticePageFragment.kt +++ b/app/src/main/java/com/casic/app/smartwell/fragment/NoticePageFragment.kt @@ -48,7 +48,6 @@ override fun setupTopBarLayout() { binding.rootView.initImmersionBar(this, false, R.color.mainThemeColor) - binding.titleInclude.titleView.text = "消息" } override fun initOnCreate(savedInstanceState: Bundle?) { diff --git a/app/src/main/java/com/casic/app/smartwell/fragment/OrderListFragment.kt b/app/src/main/java/com/casic/app/smartwell/fragment/OrderListFragment.kt index 93ff35b..5e38acb 100644 --- a/app/src/main/java/com/casic/app/smartwell/fragment/OrderListFragment.kt +++ b/app/src/main/java/com/casic/app/smartwell/fragment/OrderListFragment.kt @@ -12,6 +12,7 @@ import com.casic.app.smartwell.view.SearchOrderActivity import com.pengxh.kt.lite.base.KotlinBaseFragment import com.pengxh.kt.lite.extensions.navigatePageTo +import com.pengxh.kt.lite.widget.TitleBarView class OrderListFragment : KotlinBaseFragment() { @@ -25,15 +26,22 @@ } override fun initViewBinding( - inflater: LayoutInflater, - container: ViewGroup? + inflater: LayoutInflater, container: ViewGroup? ): FragmentOrderBinding { return FragmentOrderBinding.inflate(inflater, container, false) } override fun setupTopBarLayout() { binding.rootView.initImmersionBar(this, false, R.color.mainThemeColor) - binding.titleView.text = "工单" + binding.titleView.setOnClickListener(object : TitleBarView.OnClickListener { + override fun onLeftClick() { + + } + + override fun onRightClick() { + requireContext().navigatePageTo() + } + }) } override fun initOnCreate(savedInstanceState: Bundle?) { @@ -51,8 +59,6 @@ } override fun initEvent() { - binding.rightOptionView.setOnClickListener { - requireContext().navigatePageTo() - } + } } \ No newline at end of file diff --git a/app/src/main/java/com/casic/app/smartwell/fragment/OrderNotProcessedFragment.kt b/app/src/main/java/com/casic/app/smartwell/fragment/OrderNotProcessedFragment.kt index 0b3d09d..2b6f21d 100644 --- a/app/src/main/java/com/casic/app/smartwell/fragment/OrderNotProcessedFragment.kt +++ b/app/src/main/java/com/casic/app/smartwell/fragment/OrderNotProcessedFragment.kt @@ -18,7 +18,7 @@ import com.pengxh.kt.lite.extensions.navigatePageTo import com.pengxh.kt.lite.extensions.show import com.pengxh.kt.lite.utils.LoadState -import com.pengxh.kt.lite.utils.LoadingDialogHub +import com.pengxh.kt.lite.utils.LoadingDialog import com.pengxh.kt.lite.utils.WeakReferenceHandler import com.pengxh.kt.lite.widget.dialog.AlertControlDialog @@ -78,8 +78,8 @@ operationViewModel = ViewModelProvider(this)[OperationViewModel::class.java] - binding.notProcessedView.addItemDecoration( - RecyclerViewItemOffsets(0, 5, 0, 5) + binding.recyclerView.addItemDecoration( + RecyclerViewItemOffsets(0, 7, 0, 7) ) } @@ -87,9 +87,9 @@ //接单状态处理 operationViewModel.loadState.observe(this) { when (it) { - is LoadState.Loading -> LoadingDialogHub.show(requireActivity(), "接单中,请稍后") + is LoadState.Loading -> LoadingDialog.show(requireActivity(), "接单中,请稍后") is LoadState.Success -> { - LoadingDialogHub.dismiss() + LoadingDialog.dismiss() //接单成功之后刷新列表 dataBeans.removeAt(clickedPosition) notProcessedAdapter.notifyItemRemoved(clickedPosition) @@ -98,7 +98,7 @@ ) } - else -> LoadingDialogHub.dismiss() + else -> LoadingDialog.dismiss() } } } @@ -131,7 +131,7 @@ } else { binding.emptyInclude.emptyView.hide() notProcessedAdapter = OrderNotProcessedAdapter(requireContext(), dataBeans) - binding.notProcessedView.adapter = notProcessedAdapter + binding.recyclerView.adapter = notProcessedAdapter notProcessedAdapter.setOnItemClickListener(object : OrderNotProcessedAdapter.OnItemClickListener { override fun onClicked(position: Int) { diff --git a/app/src/main/java/com/casic/app/smartwell/fragment/OvertimeNotAcceptFragment.kt b/app/src/main/java/com/casic/app/smartwell/fragment/OvertimeNotAcceptFragment.kt index a198545..9b318ca 100644 --- a/app/src/main/java/com/casic/app/smartwell/fragment/OvertimeNotAcceptFragment.kt +++ b/app/src/main/java/com/casic/app/smartwell/fragment/OvertimeNotAcceptFragment.kt @@ -18,7 +18,7 @@ import com.pengxh.kt.lite.extensions.navigatePageTo import com.pengxh.kt.lite.extensions.show import com.pengxh.kt.lite.utils.LoadState -import com.pengxh.kt.lite.utils.LoadingDialogHub +import com.pengxh.kt.lite.utils.LoadingDialog import com.pengxh.kt.lite.utils.WeakReferenceHandler import com.pengxh.kt.lite.widget.dialog.AlertControlDialog @@ -81,8 +81,8 @@ operationViewModel = ViewModelProvider(this)[OperationViewModel::class.java] - binding.notProcessedView.addItemDecoration( - RecyclerViewItemOffsets(0, 5, 0, 5) + binding.recyclerView.addItemDecoration( + RecyclerViewItemOffsets(0, 7, 0, 7) ) } @@ -90,9 +90,9 @@ //接单状态处理 operationViewModel.loadState.observe(this) { when (it) { - is LoadState.Loading -> LoadingDialogHub.show(requireActivity(), "接单中,请稍后") + is LoadState.Loading -> LoadingDialog.show(requireActivity(), "接单中,请稍后") is LoadState.Success -> { - LoadingDialogHub.dismiss() + LoadingDialog.dismiss() //接单成功之后刷新列表 dataBeans.removeAt(clickedPosition) notProcessedAdapter.notifyItemRemoved(clickedPosition) @@ -101,7 +101,7 @@ ) } - else -> LoadingDialogHub.dismiss() + else -> LoadingDialog.dismiss() } } } @@ -134,7 +134,7 @@ } else { binding.emptyInclude.emptyView.hide() notProcessedAdapter = OrderNotProcessedAdapter(requireContext(), dataBeans) - binding.notProcessedView.adapter = notProcessedAdapter + binding.recyclerView.adapter = notProcessedAdapter notProcessedAdapter.setOnItemClickListener(object : OrderNotProcessedAdapter.OnItemClickListener { override fun onClicked(position: Int) { diff --git a/app/src/main/java/com/casic/app/smartwell/greendao/DaoMaster.java b/app/src/main/java/com/casic/app/smartwell/greendao/DaoMaster.java index fdcf3a7..1e52b74 100644 --- a/app/src/main/java/com/casic/app/smartwell/greendao/DaoMaster.java +++ b/app/src/main/java/com/casic/app/smartwell/greendao/DaoMaster.java @@ -13,25 +13,20 @@ // THIS CODE IS GENERATED BY greenDAO, DO NOT EDIT. - /** * Master of DAO (schema version 4): knows all DAOs. */ public class DaoMaster extends AbstractDaoMaster { public static final int SCHEMA_VERSION = 4; - /** - * Creates underlying database table using DAOs. - */ + /** Creates underlying database table using DAOs. */ public static void createAllTables(Database db, boolean ifNotExists) { MapWellLocalBeanDao.createTable(db, ifNotExists); NoticeLocaleBeanDao.createTable(db, ifNotExists); PipeLocalBeanDao.createTable(db, ifNotExists); } - /** - * Drops underlying database table using DAOs. - */ + /** Drops underlying database table using DAOs. */ public static void dropAllTables(Database db, boolean ifExists) { MapWellLocalBeanDao.dropTable(db, ifExists); NoticeLocaleBeanDao.dropTable(db, ifExists); @@ -86,9 +81,7 @@ } } - /** - * WARNING: Drops all table on Upgrade! Use only during development. - */ + /** WARNING: Drops all table on Upgrade! Use only during development. */ public static class DevOpenHelper extends OpenHelper { public DevOpenHelper(Context context, String name) { super(context, name); diff --git a/app/src/main/java/com/casic/app/smartwell/greendao/DaoSession.java b/app/src/main/java/com/casic/app/smartwell/greendao/DaoSession.java index 0b36d17..3e40e3b 100644 --- a/app/src/main/java/com/casic/app/smartwell/greendao/DaoSession.java +++ b/app/src/main/java/com/casic/app/smartwell/greendao/DaoSession.java @@ -16,7 +16,7 @@ /** * {@inheritDoc} - * + * * @see org.greenrobot.greendao.AbstractDaoSession */ public class DaoSession extends AbstractDaoSession { @@ -50,7 +50,7 @@ registerDao(NoticeLocaleBean.class, noticeLocaleBeanDao); registerDao(PipeLocalBean.class, pipeLocalBeanDao); } - + public void clear() { mapWellLocalBeanDaoConfig.clearIdentityScope(); noticeLocaleBeanDaoConfig.clearIdentityScope(); diff --git a/app/src/main/java/com/casic/app/smartwell/greendao/MapWellLocalBeanDao.java b/app/src/main/java/com/casic/app/smartwell/greendao/MapWellLocalBeanDao.java index 8908fda..407bc92 100644 --- a/app/src/main/java/com/casic/app/smartwell/greendao/MapWellLocalBeanDao.java +++ b/app/src/main/java/com/casic/app/smartwell/greendao/MapWellLocalBeanDao.java @@ -12,10 +12,9 @@ import org.greenrobot.greendao.internal.DaoConfig; // THIS CODE IS GENERATED BY greenDAO, DO NOT EDIT. - -/** +/** * DAO for table "MAP_WELL_LOCAL_BEAN". - */ +*/ public class MapWellLocalBeanDao extends AbstractDao { public static final String TABLENAME = "MAP_WELL_LOCAL_BEAN"; @@ -57,16 +56,14 @@ public MapWellLocalBeanDao(DaoConfig config) { super(config); } - + public MapWellLocalBeanDao(DaoConfig config, DaoSession daoSession) { super(config, daoSession); } - /** - * Creates the underlying database table. - */ + /** Creates the underlying database table. */ public static void createTable(Database db, boolean ifNotExists) { - String constraint = ifNotExists ? "IF NOT EXISTS " : ""; + String constraint = ifNotExists? "IF NOT EXISTS ": ""; db.execSQL("CREATE TABLE " + constraint + "\"MAP_WELL_LOCAL_BEAN\" (" + // "\"_id\" INTEGER PRIMARY KEY AUTOINCREMENT ," + // 0: kId "\"AREA\" TEXT," + // 1: area @@ -96,9 +93,7 @@ "\"WELL_TYPE_NAME\" TEXT);"); // 25: wellTypeName } - /** - * Drops the underlying database table. - */ + /** Drops the underlying database table. */ public static void dropTable(Database db, boolean ifExists) { String sql = "DROP TABLE " + (ifExists ? "IF EXISTS " : "") + "\"MAP_WELL_LOCAL_BEAN\""; db.execSQL(sql); @@ -107,132 +102,132 @@ @Override protected final void bindValues(DatabaseStatement stmt, MapWellLocalBean entity) { stmt.clearBindings(); - + Long kId = entity.getKId(); if (kId != null) { stmt.bindLong(1, kId); } - + String area = entity.getArea(); if (area != null) { stmt.bindString(2, area); } - + String bfzt = entity.getBfzt(); if (bfzt != null) { stmt.bindString(3, bfzt); } - + String bfztName = entity.getBfztName(); if (bfztName != null) { stmt.bindString(4, bfztName); } - + String coordinateX = entity.getCoordinateX(); if (coordinateX != null) { stmt.bindString(5, coordinateX); } - + String coordinateY = entity.getCoordinateY(); if (coordinateY != null) { stmt.bindString(6, coordinateY); } - + String deep = entity.getDeep(); if (deep != null) { stmt.bindString(7, deep); } - + String deptName = entity.getDeptName(); if (deptName != null) { stmt.bindString(8, deptName); } - + String deptid = entity.getDeptid(); if (deptid != null) { stmt.bindString(9, deptid); } - + String id = entity.getId(); if (id != null) { stmt.bindString(10, id); } - + String latBaidu = entity.getLatBaidu(); if (latBaidu != null) { stmt.bindString(11, latBaidu); } - + String latGaode = entity.getLatGaode(); if (latGaode != null) { stmt.bindString(12, latGaode); } - + String lngBaidu = entity.getLngBaidu(); if (lngBaidu != null) { stmt.bindString(13, lngBaidu); } - + String lngGaode = entity.getLngGaode(); if (lngGaode != null) { stmt.bindString(14, lngGaode); } - + String notes = entity.getNotes(); if (notes != null) { stmt.bindString(15, notes); } - + String photos = entity.getPhotos(); if (photos != null) { stmt.bindString(16, photos); } - + String position = entity.getPosition(); if (position != null) { stmt.bindString(17, position); } - + String staff = entity.getStaff(); if (staff != null) { stmt.bindString(18, staff); } - + String tel = entity.getTel(); if (tel != null) { stmt.bindString(19, tel); } - + String ts = entity.getTs(); if (ts != null) { stmt.bindString(20, ts); } - + String valid = entity.getValid(); if (valid != null) { stmt.bindString(21, valid); } - + String watchData = entity.getWatchData(); if (watchData != null) { stmt.bindString(22, watchData); } - + String wellCode = entity.getWellCode(); if (wellCode != null) { stmt.bindString(23, wellCode); } - + String wellName = entity.getWellName(); if (wellName != null) { stmt.bindString(24, wellName); } - + String wellType = entity.getWellType(); if (wellType != null) { stmt.bindString(25, wellType); } - + String wellTypeName = entity.getWellTypeName(); if (wellTypeName != null) { stmt.bindString(26, wellTypeName); @@ -242,132 +237,132 @@ @Override protected final void bindValues(SQLiteStatement stmt, MapWellLocalBean entity) { stmt.clearBindings(); - + Long kId = entity.getKId(); if (kId != null) { stmt.bindLong(1, kId); } - + String area = entity.getArea(); if (area != null) { stmt.bindString(2, area); } - + String bfzt = entity.getBfzt(); if (bfzt != null) { stmt.bindString(3, bfzt); } - + String bfztName = entity.getBfztName(); if (bfztName != null) { stmt.bindString(4, bfztName); } - + String coordinateX = entity.getCoordinateX(); if (coordinateX != null) { stmt.bindString(5, coordinateX); } - + String coordinateY = entity.getCoordinateY(); if (coordinateY != null) { stmt.bindString(6, coordinateY); } - + String deep = entity.getDeep(); if (deep != null) { stmt.bindString(7, deep); } - + String deptName = entity.getDeptName(); if (deptName != null) { stmt.bindString(8, deptName); } - + String deptid = entity.getDeptid(); if (deptid != null) { stmt.bindString(9, deptid); } - + String id = entity.getId(); if (id != null) { stmt.bindString(10, id); } - + String latBaidu = entity.getLatBaidu(); if (latBaidu != null) { stmt.bindString(11, latBaidu); } - + String latGaode = entity.getLatGaode(); if (latGaode != null) { stmt.bindString(12, latGaode); } - + String lngBaidu = entity.getLngBaidu(); if (lngBaidu != null) { stmt.bindString(13, lngBaidu); } - + String lngGaode = entity.getLngGaode(); if (lngGaode != null) { stmt.bindString(14, lngGaode); } - + String notes = entity.getNotes(); if (notes != null) { stmt.bindString(15, notes); } - + String photos = entity.getPhotos(); if (photos != null) { stmt.bindString(16, photos); } - + String position = entity.getPosition(); if (position != null) { stmt.bindString(17, position); } - + String staff = entity.getStaff(); if (staff != null) { stmt.bindString(18, staff); } - + String tel = entity.getTel(); if (tel != null) { stmt.bindString(19, tel); } - + String ts = entity.getTs(); if (ts != null) { stmt.bindString(20, ts); } - + String valid = entity.getValid(); if (valid != null) { stmt.bindString(21, valid); } - + String watchData = entity.getWatchData(); if (watchData != null) { stmt.bindString(22, watchData); } - + String wellCode = entity.getWellCode(); if (wellCode != null) { stmt.bindString(23, wellCode); } - + String wellName = entity.getWellName(); if (wellName != null) { stmt.bindString(24, wellName); } - + String wellType = entity.getWellType(); if (wellType != null) { stmt.bindString(25, wellType); } - + String wellTypeName = entity.getWellTypeName(); if (wellTypeName != null) { stmt.bindString(26, wellTypeName); @@ -377,41 +372,41 @@ @Override public Long readKey(Cursor cursor, int offset) { return cursor.isNull(offset + 0) ? null : cursor.getLong(offset + 0); - } + } @Override public MapWellLocalBean readEntity(Cursor cursor, int offset) { MapWellLocalBean entity = new MapWellLocalBean( // - cursor.isNull(offset + 0) ? null : cursor.getLong(offset + 0), // kId - cursor.isNull(offset + 1) ? null : cursor.getString(offset + 1), // area - cursor.isNull(offset + 2) ? null : cursor.getString(offset + 2), // bfzt - cursor.isNull(offset + 3) ? null : cursor.getString(offset + 3), // bfztName - cursor.isNull(offset + 4) ? null : cursor.getString(offset + 4), // coordinateX - cursor.isNull(offset + 5) ? null : cursor.getString(offset + 5), // coordinateY - cursor.isNull(offset + 6) ? null : cursor.getString(offset + 6), // deep - cursor.isNull(offset + 7) ? null : cursor.getString(offset + 7), // deptName - cursor.isNull(offset + 8) ? null : cursor.getString(offset + 8), // deptid - cursor.isNull(offset + 9) ? null : cursor.getString(offset + 9), // id - cursor.isNull(offset + 10) ? null : cursor.getString(offset + 10), // latBaidu - cursor.isNull(offset + 11) ? null : cursor.getString(offset + 11), // latGaode - cursor.isNull(offset + 12) ? null : cursor.getString(offset + 12), // lngBaidu - cursor.isNull(offset + 13) ? null : cursor.getString(offset + 13), // lngGaode - cursor.isNull(offset + 14) ? null : cursor.getString(offset + 14), // notes - cursor.isNull(offset + 15) ? null : cursor.getString(offset + 15), // photos - cursor.isNull(offset + 16) ? null : cursor.getString(offset + 16), // position - cursor.isNull(offset + 17) ? null : cursor.getString(offset + 17), // staff - cursor.isNull(offset + 18) ? null : cursor.getString(offset + 18), // tel - cursor.isNull(offset + 19) ? null : cursor.getString(offset + 19), // ts - cursor.isNull(offset + 20) ? null : cursor.getString(offset + 20), // valid - cursor.isNull(offset + 21) ? null : cursor.getString(offset + 21), // watchData - cursor.isNull(offset + 22) ? null : cursor.getString(offset + 22), // wellCode - cursor.isNull(offset + 23) ? null : cursor.getString(offset + 23), // wellName - cursor.isNull(offset + 24) ? null : cursor.getString(offset + 24), // wellType - cursor.isNull(offset + 25) ? null : cursor.getString(offset + 25) // wellTypeName + cursor.isNull(offset + 0) ? null : cursor.getLong(offset + 0), // kId + cursor.isNull(offset + 1) ? null : cursor.getString(offset + 1), // area + cursor.isNull(offset + 2) ? null : cursor.getString(offset + 2), // bfzt + cursor.isNull(offset + 3) ? null : cursor.getString(offset + 3), // bfztName + cursor.isNull(offset + 4) ? null : cursor.getString(offset + 4), // coordinateX + cursor.isNull(offset + 5) ? null : cursor.getString(offset + 5), // coordinateY + cursor.isNull(offset + 6) ? null : cursor.getString(offset + 6), // deep + cursor.isNull(offset + 7) ? null : cursor.getString(offset + 7), // deptName + cursor.isNull(offset + 8) ? null : cursor.getString(offset + 8), // deptid + cursor.isNull(offset + 9) ? null : cursor.getString(offset + 9), // id + cursor.isNull(offset + 10) ? null : cursor.getString(offset + 10), // latBaidu + cursor.isNull(offset + 11) ? null : cursor.getString(offset + 11), // latGaode + cursor.isNull(offset + 12) ? null : cursor.getString(offset + 12), // lngBaidu + cursor.isNull(offset + 13) ? null : cursor.getString(offset + 13), // lngGaode + cursor.isNull(offset + 14) ? null : cursor.getString(offset + 14), // notes + cursor.isNull(offset + 15) ? null : cursor.getString(offset + 15), // photos + cursor.isNull(offset + 16) ? null : cursor.getString(offset + 16), // position + cursor.isNull(offset + 17) ? null : cursor.getString(offset + 17), // staff + cursor.isNull(offset + 18) ? null : cursor.getString(offset + 18), // tel + cursor.isNull(offset + 19) ? null : cursor.getString(offset + 19), // ts + cursor.isNull(offset + 20) ? null : cursor.getString(offset + 20), // valid + cursor.isNull(offset + 21) ? null : cursor.getString(offset + 21), // watchData + cursor.isNull(offset + 22) ? null : cursor.getString(offset + 22), // wellCode + cursor.isNull(offset + 23) ? null : cursor.getString(offset + 23), // wellName + cursor.isNull(offset + 24) ? null : cursor.getString(offset + 24), // wellType + cursor.isNull(offset + 25) ? null : cursor.getString(offset + 25) // wellTypeName ); return entity; } - + @Override public void readEntity(Cursor cursor, MapWellLocalBean entity, int offset) { entity.setKId(cursor.isNull(offset + 0) ? null : cursor.getLong(offset + 0)); @@ -440,17 +435,17 @@ entity.setWellName(cursor.isNull(offset + 23) ? null : cursor.getString(offset + 23)); entity.setWellType(cursor.isNull(offset + 24) ? null : cursor.getString(offset + 24)); entity.setWellTypeName(cursor.isNull(offset + 25) ? null : cursor.getString(offset + 25)); - } - + } + @Override protected final Long updateKeyAfterInsert(MapWellLocalBean entity, long rowId) { entity.setKId(rowId); return rowId; } - + @Override public Long getKey(MapWellLocalBean entity) { - if (entity != null) { + if(entity != null) { return entity.getKId(); } else { return null; @@ -466,5 +461,5 @@ protected final boolean isEntityUpdateable() { return true; } - + } diff --git a/app/src/main/java/com/casic/app/smartwell/greendao/NoticeLocaleBeanDao.java b/app/src/main/java/com/casic/app/smartwell/greendao/NoticeLocaleBeanDao.java index 64312ed..deb2d49 100644 --- a/app/src/main/java/com/casic/app/smartwell/greendao/NoticeLocaleBeanDao.java +++ b/app/src/main/java/com/casic/app/smartwell/greendao/NoticeLocaleBeanDao.java @@ -12,10 +12,9 @@ import org.greenrobot.greendao.internal.DaoConfig; // THIS CODE IS GENERATED BY greenDAO, DO NOT EDIT. - -/** +/** * DAO for table "NOTICE_LOCALE_BEAN". - */ +*/ public class NoticeLocaleBeanDao extends AbstractDao { public static final String TABLENAME = "NOTICE_LOCALE_BEAN"; @@ -43,16 +42,14 @@ public NoticeLocaleBeanDao(DaoConfig config) { super(config); } - + public NoticeLocaleBeanDao(DaoConfig config, DaoSession daoSession) { super(config, daoSession); } - /** - * Creates the underlying database table. - */ + /** Creates the underlying database table. */ public static void createTable(Database db, boolean ifNotExists) { - String constraint = ifNotExists ? "IF NOT EXISTS " : ""; + String constraint = ifNotExists? "IF NOT EXISTS ": ""; db.execSQL("CREATE TABLE " + constraint + "\"NOTICE_LOCALE_BEAN\" (" + // "\"_id\" INTEGER PRIMARY KEY AUTOINCREMENT ," + // 0: id "\"MESSAGE_ID\" TEXT UNIQUE ," + // 1: messageId @@ -68,9 +65,7 @@ "\"NOTICE_TIME\" TEXT);"); // 11: noticeTime } - /** - * Drops the underlying database table. - */ + /** Drops the underlying database table. */ public static void dropTable(Database db, boolean ifExists) { String sql = "DROP TABLE " + (ifExists ? "IF EXISTS " : "") + "\"NOTICE_LOCALE_BEAN\""; db.execSQL(sql); @@ -79,62 +74,62 @@ @Override protected final void bindValues(DatabaseStatement stmt, NoticeLocaleBean entity) { stmt.clearBindings(); - + Long id = entity.getId(); if (id != null) { stmt.bindLong(1, id); } - + String messageId = entity.getMessageId(); if (messageId != null) { stmt.bindString(2, messageId); } - + String appid = entity.getAppid(); if (appid != null) { stmt.bindString(3, appid); } - + String clientId = entity.getClientId(); if (clientId != null) { stmt.bindString(4, clientId); } - + String taskId = entity.getTaskId(); if (taskId != null) { stmt.bindString(5, taskId); } - + String userId = entity.getUserId(); if (userId != null) { stmt.bindString(6, userId); } - + String title = entity.getTitle(); if (title != null) { stmt.bindString(7, title); } - + String content = entity.getContent(); if (content != null) { stmt.bindString(8, content); } - + String deviceCode = entity.getDeviceCode(); if (deviceCode != null) { stmt.bindString(9, deviceCode); } - + String jobId = entity.getJobId(); if (jobId != null) { stmt.bindString(10, jobId); } - + String isRead = entity.getIsRead(); if (isRead != null) { stmt.bindString(11, isRead); } - + String noticeTime = entity.getNoticeTime(); if (noticeTime != null) { stmt.bindString(12, noticeTime); @@ -144,62 +139,62 @@ @Override protected final void bindValues(SQLiteStatement stmt, NoticeLocaleBean entity) { stmt.clearBindings(); - + Long id = entity.getId(); if (id != null) { stmt.bindLong(1, id); } - + String messageId = entity.getMessageId(); if (messageId != null) { stmt.bindString(2, messageId); } - + String appid = entity.getAppid(); if (appid != null) { stmt.bindString(3, appid); } - + String clientId = entity.getClientId(); if (clientId != null) { stmt.bindString(4, clientId); } - + String taskId = entity.getTaskId(); if (taskId != null) { stmt.bindString(5, taskId); } - + String userId = entity.getUserId(); if (userId != null) { stmt.bindString(6, userId); } - + String title = entity.getTitle(); if (title != null) { stmt.bindString(7, title); } - + String content = entity.getContent(); if (content != null) { stmt.bindString(8, content); } - + String deviceCode = entity.getDeviceCode(); if (deviceCode != null) { stmt.bindString(9, deviceCode); } - + String jobId = entity.getJobId(); if (jobId != null) { stmt.bindString(10, jobId); } - + String isRead = entity.getIsRead(); if (isRead != null) { stmt.bindString(11, isRead); } - + String noticeTime = entity.getNoticeTime(); if (noticeTime != null) { stmt.bindString(12, noticeTime); @@ -209,27 +204,27 @@ @Override public Long readKey(Cursor cursor, int offset) { return cursor.isNull(offset + 0) ? null : cursor.getLong(offset + 0); - } + } @Override public NoticeLocaleBean readEntity(Cursor cursor, int offset) { NoticeLocaleBean entity = new NoticeLocaleBean( // - cursor.isNull(offset + 0) ? null : cursor.getLong(offset + 0), // id - cursor.isNull(offset + 1) ? null : cursor.getString(offset + 1), // messageId - cursor.isNull(offset + 2) ? null : cursor.getString(offset + 2), // appid - cursor.isNull(offset + 3) ? null : cursor.getString(offset + 3), // clientId - cursor.isNull(offset + 4) ? null : cursor.getString(offset + 4), // taskId - cursor.isNull(offset + 5) ? null : cursor.getString(offset + 5), // userId - cursor.isNull(offset + 6) ? null : cursor.getString(offset + 6), // title - cursor.isNull(offset + 7) ? null : cursor.getString(offset + 7), // content - cursor.isNull(offset + 8) ? null : cursor.getString(offset + 8), // deviceCode - cursor.isNull(offset + 9) ? null : cursor.getString(offset + 9), // jobId - cursor.isNull(offset + 10) ? null : cursor.getString(offset + 10), // isRead - cursor.isNull(offset + 11) ? null : cursor.getString(offset + 11) // noticeTime + cursor.isNull(offset + 0) ? null : cursor.getLong(offset + 0), // id + cursor.isNull(offset + 1) ? null : cursor.getString(offset + 1), // messageId + cursor.isNull(offset + 2) ? null : cursor.getString(offset + 2), // appid + cursor.isNull(offset + 3) ? null : cursor.getString(offset + 3), // clientId + cursor.isNull(offset + 4) ? null : cursor.getString(offset + 4), // taskId + cursor.isNull(offset + 5) ? null : cursor.getString(offset + 5), // userId + cursor.isNull(offset + 6) ? null : cursor.getString(offset + 6), // title + cursor.isNull(offset + 7) ? null : cursor.getString(offset + 7), // content + cursor.isNull(offset + 8) ? null : cursor.getString(offset + 8), // deviceCode + cursor.isNull(offset + 9) ? null : cursor.getString(offset + 9), // jobId + cursor.isNull(offset + 10) ? null : cursor.getString(offset + 10), // isRead + cursor.isNull(offset + 11) ? null : cursor.getString(offset + 11) // noticeTime ); return entity; } - + @Override public void readEntity(Cursor cursor, NoticeLocaleBean entity, int offset) { entity.setId(cursor.isNull(offset + 0) ? null : cursor.getLong(offset + 0)); @@ -244,17 +239,17 @@ entity.setJobId(cursor.isNull(offset + 9) ? null : cursor.getString(offset + 9)); entity.setIsRead(cursor.isNull(offset + 10) ? null : cursor.getString(offset + 10)); entity.setNoticeTime(cursor.isNull(offset + 11) ? null : cursor.getString(offset + 11)); - } - + } + @Override protected final Long updateKeyAfterInsert(NoticeLocaleBean entity, long rowId) { entity.setId(rowId); return rowId; } - + @Override public Long getKey(NoticeLocaleBean entity) { - if (entity != null) { + if(entity != null) { return entity.getId(); } else { return null; @@ -270,5 +265,5 @@ protected final boolean isEntityUpdateable() { return true; } - + } diff --git a/app/src/main/java/com/casic/app/smartwell/greendao/PipeLocalBeanDao.java b/app/src/main/java/com/casic/app/smartwell/greendao/PipeLocalBeanDao.java index aab4d3f..df5515a 100644 --- a/app/src/main/java/com/casic/app/smartwell/greendao/PipeLocalBeanDao.java +++ b/app/src/main/java/com/casic/app/smartwell/greendao/PipeLocalBeanDao.java @@ -12,10 +12,9 @@ import org.greenrobot.greendao.internal.DaoConfig; // THIS CODE IS GENERATED BY greenDAO, DO NOT EDIT. - -/** +/** * DAO for table "PIPE_LOCAL_BEAN". - */ +*/ public class PipeLocalBeanDao extends AbstractDao { public static final String TABLENAME = "PIPE_LOCAL_BEAN"; @@ -37,16 +36,14 @@ public PipeLocalBeanDao(DaoConfig config) { super(config); } - + public PipeLocalBeanDao(DaoConfig config, DaoSession daoSession) { super(config, daoSession); } - /** - * Creates the underlying database table. - */ + /** Creates the underlying database table. */ public static void createTable(Database db, boolean ifNotExists) { - String constraint = ifNotExists ? "IF NOT EXISTS " : ""; + String constraint = ifNotExists? "IF NOT EXISTS ": ""; db.execSQL("CREATE TABLE " + constraint + "\"PIPE_LOCAL_BEAN\" (" + // "\"_id\" INTEGER PRIMARY KEY AUTOINCREMENT ," + // 0: id "\"PIPE_CODE\" TEXT," + // 1: pipeCode @@ -56,9 +53,7 @@ "\"START_LONGITUDE_GD\" TEXT);"); // 5: startLongitudeGd } - /** - * Drops the underlying database table. - */ + /** Drops the underlying database table. */ public static void dropTable(Database db, boolean ifExists) { String sql = "DROP TABLE " + (ifExists ? "IF EXISTS " : "") + "\"PIPE_LOCAL_BEAN\""; db.execSQL(sql); @@ -67,32 +62,32 @@ @Override protected final void bindValues(DatabaseStatement stmt, PipeLocalBean entity) { stmt.clearBindings(); - + Long id = entity.getId(); if (id != null) { stmt.bindLong(1, id); } - + String pipeCode = entity.getPipeCode(); if (pipeCode != null) { stmt.bindString(2, pipeCode); } - + String endLatitudeGd = entity.getEndLatitudeGd(); if (endLatitudeGd != null) { stmt.bindString(3, endLatitudeGd); } - + String endLongitudeGd = entity.getEndLongitudeGd(); if (endLongitudeGd != null) { stmt.bindString(4, endLongitudeGd); } - + String startLatitudeGd = entity.getStartLatitudeGd(); if (startLatitudeGd != null) { stmt.bindString(5, startLatitudeGd); } - + String startLongitudeGd = entity.getStartLongitudeGd(); if (startLongitudeGd != null) { stmt.bindString(6, startLongitudeGd); @@ -102,32 +97,32 @@ @Override protected final void bindValues(SQLiteStatement stmt, PipeLocalBean entity) { stmt.clearBindings(); - + Long id = entity.getId(); if (id != null) { stmt.bindLong(1, id); } - + String pipeCode = entity.getPipeCode(); if (pipeCode != null) { stmt.bindString(2, pipeCode); } - + String endLatitudeGd = entity.getEndLatitudeGd(); if (endLatitudeGd != null) { stmt.bindString(3, endLatitudeGd); } - + String endLongitudeGd = entity.getEndLongitudeGd(); if (endLongitudeGd != null) { stmt.bindString(4, endLongitudeGd); } - + String startLatitudeGd = entity.getStartLatitudeGd(); if (startLatitudeGd != null) { stmt.bindString(5, startLatitudeGd); } - + String startLongitudeGd = entity.getStartLongitudeGd(); if (startLongitudeGd != null) { stmt.bindString(6, startLongitudeGd); @@ -137,21 +132,21 @@ @Override public Long readKey(Cursor cursor, int offset) { return cursor.isNull(offset + 0) ? null : cursor.getLong(offset + 0); - } + } @Override public PipeLocalBean readEntity(Cursor cursor, int offset) { PipeLocalBean entity = new PipeLocalBean( // - cursor.isNull(offset + 0) ? null : cursor.getLong(offset + 0), // id - cursor.isNull(offset + 1) ? null : cursor.getString(offset + 1), // pipeCode - cursor.isNull(offset + 2) ? null : cursor.getString(offset + 2), // endLatitudeGd - cursor.isNull(offset + 3) ? null : cursor.getString(offset + 3), // endLongitudeGd - cursor.isNull(offset + 4) ? null : cursor.getString(offset + 4), // startLatitudeGd - cursor.isNull(offset + 5) ? null : cursor.getString(offset + 5) // startLongitudeGd + cursor.isNull(offset + 0) ? null : cursor.getLong(offset + 0), // id + cursor.isNull(offset + 1) ? null : cursor.getString(offset + 1), // pipeCode + cursor.isNull(offset + 2) ? null : cursor.getString(offset + 2), // endLatitudeGd + cursor.isNull(offset + 3) ? null : cursor.getString(offset + 3), // endLongitudeGd + cursor.isNull(offset + 4) ? null : cursor.getString(offset + 4), // startLatitudeGd + cursor.isNull(offset + 5) ? null : cursor.getString(offset + 5) // startLongitudeGd ); return entity; } - + @Override public void readEntity(Cursor cursor, PipeLocalBean entity, int offset) { entity.setId(cursor.isNull(offset + 0) ? null : cursor.getLong(offset + 0)); @@ -160,17 +155,17 @@ entity.setEndLongitudeGd(cursor.isNull(offset + 3) ? null : cursor.getString(offset + 3)); entity.setStartLatitudeGd(cursor.isNull(offset + 4) ? null : cursor.getString(offset + 4)); entity.setStartLongitudeGd(cursor.isNull(offset + 5) ? null : cursor.getString(offset + 5)); - } - + } + @Override protected final Long updateKeyAfterInsert(PipeLocalBean entity, long rowId) { entity.setId(rowId); return rowId; } - + @Override public Long getKey(PipeLocalBean entity) { - if (entity != null) { + if(entity != null) { return entity.getId(); } else { return null; @@ -186,5 +181,5 @@ protected final boolean isEntityUpdateable() { return true; } - + } diff --git a/app/src/main/java/com/casic/app/smartwell/view/ChangePasswordActivity.kt b/app/src/main/java/com/casic/app/smartwell/view/ChangePasswordActivity.kt index 8e41039..9f1dd40 100644 --- a/app/src/main/java/com/casic/app/smartwell/view/ChangePasswordActivity.kt +++ b/app/src/main/java/com/casic/app/smartwell/view/ChangePasswordActivity.kt @@ -14,7 +14,7 @@ import com.pengxh.kt.lite.extensions.show import com.pengxh.kt.lite.utils.ActivityStackManager import com.pengxh.kt.lite.utils.LoadState -import com.pengxh.kt.lite.utils.LoadingDialogHub +import com.pengxh.kt.lite.utils.LoadingDialog import com.pengxh.kt.lite.widget.TitleBarView import java.nio.charset.StandardCharsets @@ -46,15 +46,15 @@ override fun observeRequestState() { userViewModel.loadState.observe(this) { when (it) { - is LoadState.Loading -> LoadingDialogHub.show(this, "修改中,请稍后") + is LoadState.Loading -> LoadingDialog.show(this, "修改中,请稍后") is LoadState.Success -> { - LoadingDialogHub.dismiss() + LoadingDialog.dismiss() AuthenticationHelper.removeToken() this.navigatePageTo() ActivityStackManager.finishAllActivity() } - else -> LoadingDialogHub.dismiss() + else -> LoadingDialog.dismiss() } } } diff --git a/app/src/main/java/com/casic/app/smartwell/view/DeployedWellActivity.kt b/app/src/main/java/com/casic/app/smartwell/view/DeployedWellActivity.kt index fb4339c..28a5078 100644 --- a/app/src/main/java/com/casic/app/smartwell/view/DeployedWellActivity.kt +++ b/app/src/main/java/com/casic/app/smartwell/view/DeployedWellActivity.kt @@ -83,8 +83,8 @@ } //添加分割线 - binding.deployedListView.addItemDecoration( - RecyclerViewItemOffsets(0, 5, 0, 5) + binding.recyclerView.addItemDecoration( + RecyclerViewItemOffsets(0, 7, 0, 7) ) } @@ -149,12 +149,11 @@ } else { item.deep.toString() + "m" } - viewHolder.setText(R.id.wellNameView, item.wellName) + viewHolder.setText(R.id.wellTypeView, item.wellTypeName) .setText(R.id.wellDepthView, "深:${deep}") .setText(R.id.wellCodeView, "点位编号:${item.wellCode}") - .setText(R.id.wellTypeView, "点位类型:${item.wellTypeName}") .setText(R.id.ownerShipView, "权属单位:${item.deptName}") - .setText(R.id.wellLocationView, "点位置:${item.position}") + .setText(R.id.wellLocationView, "点位位置:${item.position}") .setOnClickListener( R.id.operationButton, object : View.OnClickListener { override fun onClick(v: View?) { @@ -207,7 +206,7 @@ }) } } - binding.deployedListView.adapter = deployAdapter + binding.recyclerView.adapter = deployAdapter deployAdapter.setOnItemClickedListener(object : NormalRecyclerAdapter.OnItemClickedListener { override fun onItemClicked(position: Int, t: WellListModel.DataBean.RowsBean) { diff --git a/app/src/main/java/com/casic/app/smartwell/view/LoginActivity.kt b/app/src/main/java/com/casic/app/smartwell/view/LoginActivity.kt index e4bb0e3..834527b 100644 --- a/app/src/main/java/com/casic/app/smartwell/view/LoginActivity.kt +++ b/app/src/main/java/com/casic/app/smartwell/view/LoginActivity.kt @@ -21,7 +21,7 @@ import com.pengxh.kt.lite.extensions.navigatePageTo import com.pengxh.kt.lite.extensions.readAssetsFile import com.pengxh.kt.lite.extensions.show -import com.pengxh.kt.lite.utils.LoadingDialogHub +import com.pengxh.kt.lite.utils.LoadingDialog import com.pengxh.kt.lite.utils.SaveKeyValues import kotlinx.coroutines.Dispatchers import kotlinx.coroutines.launch @@ -106,11 +106,11 @@ override fun observeRequestState() { authenticateViewModel.loadState.observe(this) { - LoadingDialogHub.show(this, "登录中,请稍后") + LoadingDialog.show(this, "登录中,请稍后") } loginViewModel.loadState.observe(this) { - LoadingDialogHub.dismiss() + LoadingDialog.dismiss() } } diff --git a/app/src/main/java/com/casic/app/smartwell/view/OrderCompletedDetailActivity.kt b/app/src/main/java/com/casic/app/smartwell/view/OrderCompletedDetailActivity.kt index db8ad1f..75cd905 100644 --- a/app/src/main/java/com/casic/app/smartwell/view/OrderCompletedDetailActivity.kt +++ b/app/src/main/java/com/casic/app/smartwell/view/OrderCompletedDetailActivity.kt @@ -17,7 +17,7 @@ import com.pengxh.kt.lite.extensions.show import com.pengxh.kt.lite.utils.Constant import com.pengxh.kt.lite.utils.LoadState -import com.pengxh.kt.lite.utils.LoadingDialogHub +import com.pengxh.kt.lite.utils.LoadingDialog import com.pengxh.kt.lite.widget.TitleBarView import com.pengxh.kt.lite.widget.dialog.AlertMessageDialog @@ -44,7 +44,7 @@ } override fun initOnCreate(savedInstanceState: Bundle?) { - val jobId = intent.getStringExtra(Constant.INTENT_PARAM)!! + val jobId = intent.getStringExtra(Constant.INTENT_PARAM_KEY)!! orderViewModel = ViewModelProvider(this)[OrderViewModel::class.java] orderViewModel.getWorkOrderDetail(jobId) orderViewModel.detailModel.observe(this) { @@ -154,8 +154,8 @@ override fun observeRequestState() { orderViewModel.loadState.observe(this) { when (it) { - is LoadState.Loading -> LoadingDialogHub.show(this, "数据加载中,请稍后") - else -> LoadingDialogHub.dismiss() + is LoadState.Loading -> LoadingDialog.show(this, "数据加载中,请稍后") + else -> LoadingDialog.dismiss() } } } diff --git a/app/src/main/java/com/casic/app/smartwell/view/OrderInHandleDetailActivity.kt b/app/src/main/java/com/casic/app/smartwell/view/OrderInHandleDetailActivity.kt index d70a979..04a7d5d 100644 --- a/app/src/main/java/com/casic/app/smartwell/view/OrderInHandleDetailActivity.kt +++ b/app/src/main/java/com/casic/app/smartwell/view/OrderInHandleDetailActivity.kt @@ -38,7 +38,7 @@ import com.pengxh.kt.lite.extensions.show import com.pengxh.kt.lite.utils.Constant import com.pengxh.kt.lite.utils.LoadState -import com.pengxh.kt.lite.utils.LoadingDialogHub +import com.pengxh.kt.lite.utils.LoadingDialog import com.pengxh.kt.lite.widget.TitleBarView import com.pengxh.kt.lite.widget.dialog.AlertControlDialog import com.pengxh.kt.lite.widget.dialog.AlertMessageDialog @@ -93,7 +93,7 @@ ) binding.addImageRecyclerView.adapter = imageAdapter - val jobId = intent.getStringExtra(Constant.INTENT_PARAM)!!//初始化图片九宫格 + val jobId = intent.getStringExtra(Constant.INTENT_PARAM_KEY)!!//初始化图片九宫格 orderViewModel.getWorkOrderDetail(jobId) orderViewModel.detailModel.observe(this) { if (it.code == 200) { @@ -312,41 +312,41 @@ override fun observeRequestState() { orderViewModel.loadState.observe(this) { when (it) { - is LoadState.Loading -> LoadingDialogHub.show(this, "数据加载中,请稍后") - else -> LoadingDialogHub.dismiss() + is LoadState.Loading -> LoadingDialog.show(this, "数据加载中,请稍后") + else -> LoadingDialog.dismiss() } } uploadImageViewModel.loadState.observe(this) { when (it) { - LoadState.Loading -> LoadingDialogHub.show(this, "图片上传中,请稍后...") - else -> LoadingDialogHub.dismiss() + LoadState.Loading -> LoadingDialog.show(this, "图片上传中,请稍后...") + else -> LoadingDialog.dismiss() } } //转单状态处理 operationViewModel.loadState.observe(this) { when (it) { - is LoadState.Loading -> LoadingDialogHub.show(this, "转单中,请稍后") + is LoadState.Loading -> LoadingDialog.show(this, "转单中,请稍后") is LoadState.Success -> { - LoadingDialogHub.dismiss() + LoadingDialog.dismiss() this.finish() } - else -> LoadingDialogHub.dismiss() + else -> LoadingDialog.dismiss() } } //处理完成工单状态处理 operationViewModel.loadState.observe(this) { when (it) { - is LoadState.Loading -> LoadingDialogHub.show(this, "处理中,请稍后") + is LoadState.Loading -> LoadingDialog.show(this, "处理中,请稍后") is LoadState.Success -> { - LoadingDialogHub.dismiss() + LoadingDialog.dismiss() this.finish() } - else -> LoadingDialogHub.dismiss() + else -> LoadingDialog.dismiss() } } } diff --git a/app/src/main/java/com/casic/app/smartwell/view/OrderNotConfirmedDetailActivity.kt b/app/src/main/java/com/casic/app/smartwell/view/OrderNotConfirmedDetailActivity.kt index 8e036d2..687ec86 100644 --- a/app/src/main/java/com/casic/app/smartwell/view/OrderNotConfirmedDetailActivity.kt +++ b/app/src/main/java/com/casic/app/smartwell/view/OrderNotConfirmedDetailActivity.kt @@ -36,7 +36,7 @@ import com.pengxh.kt.lite.extensions.show import com.pengxh.kt.lite.utils.Constant import com.pengxh.kt.lite.utils.LoadState -import com.pengxh.kt.lite.utils.LoadingDialogHub +import com.pengxh.kt.lite.utils.LoadingDialog import com.pengxh.kt.lite.widget.TitleBarView import com.pengxh.kt.lite.widget.dialog.AlertControlDialog import com.pengxh.kt.lite.widget.dialog.AlertMessageDialog @@ -80,7 +80,7 @@ } override fun initOnCreate(savedInstanceState: Bundle?) { - val jobId = intent.getStringExtra(Constant.INTENT_PARAM)!! + val jobId = intent.getStringExtra(Constant.INTENT_PARAM_KEY)!! //初始化图片九宫格 //左外边距,左内边距,右内边距,右外边距 val viewWidth = getScreenWidth() - (10 + 10 + 10 + 10).dp2px(this) @@ -263,41 +263,41 @@ //数据加载状态处理 orderViewModel.loadState.observe(this) { when (it) { - is LoadState.Loading -> LoadingDialogHub.show(this, "数据加载中,请稍后") - else -> LoadingDialogHub.dismiss() + is LoadState.Loading -> LoadingDialog.show(this, "数据加载中,请稍后") + else -> LoadingDialog.dismiss() } } uploadImageViewModel.loadState.observe(this) { when (it) { - LoadState.Loading -> LoadingDialogHub.show(this, "图片上传中,请稍后") - else -> LoadingDialogHub.dismiss() + LoadState.Loading -> LoadingDialog.show(this, "图片上传中,请稍后") + else -> LoadingDialog.dismiss() } } //转单状态处理 operationViewModel.loadState.observe(this) { when (it) { - is LoadState.Loading -> LoadingDialogHub.show(this, "转单中,请稍后") + is LoadState.Loading -> LoadingDialog.show(this, "转单中,请稍后") is LoadState.Success -> { - LoadingDialogHub.dismiss() + LoadingDialog.dismiss() this.finish() } - else -> LoadingDialogHub.dismiss() + else -> LoadingDialog.dismiss() } } //确认工单状态处理 operationViewModel.loadState.observe(this) { when (it) { - is LoadState.Loading -> LoadingDialogHub.show(this, "处理中,请稍后") + is LoadState.Loading -> LoadingDialog.show(this, "处理中,请稍后") is LoadState.Success -> { - LoadingDialogHub.dismiss() + LoadingDialog.dismiss() this.finish() } - else -> LoadingDialogHub.dismiss() + else -> LoadingDialog.dismiss() } } } diff --git a/app/src/main/java/com/casic/app/smartwell/view/OrderNotProcessedDetailActivity.kt b/app/src/main/java/com/casic/app/smartwell/view/OrderNotProcessedDetailActivity.kt index d3f22dc..0c97a52 100644 --- a/app/src/main/java/com/casic/app/smartwell/view/OrderNotProcessedDetailActivity.kt +++ b/app/src/main/java/com/casic/app/smartwell/view/OrderNotProcessedDetailActivity.kt @@ -18,7 +18,7 @@ import com.pengxh.kt.lite.extensions.show import com.pengxh.kt.lite.utils.Constant import com.pengxh.kt.lite.utils.LoadState -import com.pengxh.kt.lite.utils.LoadingDialogHub +import com.pengxh.kt.lite.utils.LoadingDialog import com.pengxh.kt.lite.widget.TitleBarView import com.pengxh.kt.lite.widget.dialog.AlertControlDialog import com.pengxh.kt.lite.widget.dialog.AlertMessageDialog @@ -50,7 +50,7 @@ } override fun initOnCreate(savedInstanceState: Bundle?) { - this.jobId = intent.getStringExtra(Constant.INTENT_PARAM)!! + this.jobId = intent.getStringExtra(Constant.INTENT_PARAM_KEY)!! orderViewModel = ViewModelProvider(this)[OrderViewModel::class.java] operationViewModel = ViewModelProvider(this)[OperationViewModel::class.java] wellViewModel = ViewModelProvider(this)[WellViewModel::class.java] @@ -162,21 +162,21 @@ //数据加载状态处理 orderViewModel.loadState.observe(this) { when (it) { - is LoadState.Loading -> LoadingDialogHub.show(this, "数据加载中,请稍后") - else -> LoadingDialogHub.dismiss() + is LoadState.Loading -> LoadingDialog.show(this, "数据加载中,请稍后") + else -> LoadingDialog.dismiss() } } //接单状态处理 operationViewModel.loadState.observe(this) { when (it) { - is LoadState.Loading -> LoadingDialogHub.show(this, "接单中,请稍后") + is LoadState.Loading -> LoadingDialog.show(this, "接单中,请稍后") is LoadState.Success -> { - LoadingDialogHub.dismiss() + LoadingDialog.dismiss() this.finish() } - else -> LoadingDialogHub.dismiss() + else -> LoadingDialog.dismiss() } } } diff --git a/app/src/main/java/com/casic/app/smartwell/view/SearchResultActivity.kt b/app/src/main/java/com/casic/app/smartwell/view/SearchResultActivity.kt index 6a92917..4f3a674 100644 --- a/app/src/main/java/com/casic/app/smartwell/view/SearchResultActivity.kt +++ b/app/src/main/java/com/casic/app/smartwell/view/SearchResultActivity.kt @@ -19,7 +19,7 @@ import com.pengxh.kt.lite.extensions.show import com.pengxh.kt.lite.utils.Constant import com.pengxh.kt.lite.utils.LoadState -import com.pengxh.kt.lite.utils.LoadingDialogHub +import com.pengxh.kt.lite.utils.LoadingDialog import com.pengxh.kt.lite.utils.WeakReferenceHandler import com.pengxh.kt.lite.widget.TitleBarView import com.pengxh.kt.lite.widget.dialog.AlertControlDialog @@ -56,7 +56,7 @@ } override fun initOnCreate(savedInstanceState: Bundle?) { - args = intent.getStringArrayListExtra(Constant.INTENT_PARAM)!! + args = intent.getStringArrayListExtra(Constant.INTENT_PARAM_KEY)!! orderViewModel = ViewModelProvider(this)[OrderViewModel::class.java] operationViewModel = ViewModelProvider(this)[OperationViewModel::class.java] @@ -101,24 +101,24 @@ } } - binding.resultRecyclerView.addItemDecoration( - RecyclerViewItemOffsets(0, 5, 0, 5) + binding.recyclerView.addItemDecoration( + RecyclerViewItemOffsets(0, 7, 0, 7) ) } override fun observeRequestState() { orderViewModel.loadState.observe(this) { when (it) { - is LoadState.Loading -> LoadingDialogHub.show(this, "数据加载中,请稍后") - else -> LoadingDialogHub.dismiss() + is LoadState.Loading -> LoadingDialog.show(this, "数据加载中,请稍后") + else -> LoadingDialog.dismiss() } } //接单状态处理 operationViewModel.loadState.observe(this) { when (it) { - is LoadState.Loading -> LoadingDialogHub.show(this, "接单中,请稍后") + is LoadState.Loading -> LoadingDialog.show(this, "接单中,请稍后") is LoadState.Success -> { - LoadingDialogHub.dismiss() + LoadingDialog.dismiss() //接单成功之后刷新列表 dataBeans.removeAt(clickedPosition) searchResultAdapter.notifyItemRemoved(clickedPosition) @@ -127,7 +127,7 @@ ) } - else -> LoadingDialogHub.dismiss() + else -> LoadingDialog.dismiss() } } } @@ -162,7 +162,7 @@ } else { binding.emptyInclude.emptyView.hide() searchResultAdapter = SearchResultAdapter(this, dataBeans) - binding.resultRecyclerView.adapter = searchResultAdapter + binding.recyclerView.adapter = searchResultAdapter searchResultAdapter.setOnItemClickListener(object : SearchResultAdapter.OnItemClickListener { override fun onClicked(position: Int) { diff --git a/app/src/main/java/com/casic/app/smartwell/view/UnDeployWellActivity.kt b/app/src/main/java/com/casic/app/smartwell/view/UnDeployWellActivity.kt index 7f7cd3c..555c278 100644 --- a/app/src/main/java/com/casic/app/smartwell/view/UnDeployWellActivity.kt +++ b/app/src/main/java/com/casic/app/smartwell/view/UnDeployWellActivity.kt @@ -81,8 +81,8 @@ } } - binding.undeployListView.addItemDecoration( - RecyclerViewItemOffsets(0, 5, 0, 5) + binding.recyclerView.addItemDecoration( + RecyclerViewItemOffsets(0, 7, 0, 7) ) } @@ -147,12 +147,11 @@ } else { item.deep.toString() + "m" } - viewHolder.setText(R.id.wellNameView, item.wellName) + viewHolder.setText(R.id.wellTypeView, item.wellTypeName) .setText(R.id.wellDepthView, "深:${deep}") .setText(R.id.wellCodeView, "点位编号:${item.wellCode}") - .setText(R.id.wellTypeView, "点位类型:${item.wellTypeName}") .setText(R.id.ownerShipView, "权属单位:${item.deptName}") - .setText(R.id.wellLocationView, "点位置:${item.position}") + .setText(R.id.wellLocationView, "点位位置:${item.position}") .setOnClickListener( R.id.operationButton, object : View.OnClickListener { override fun onClick(v: View?) { @@ -185,7 +184,7 @@ ) } } - binding.undeployListView.adapter = unDeployAdapter + binding.recyclerView.adapter = unDeployAdapter unDeployAdapter.setOnItemClickedListener(object : NormalRecyclerAdapter.OnItemClickedListener { override fun onItemClicked(position: Int, t: WellListModel.DataBean.RowsBean) { diff --git a/app/src/main/java/com/casic/app/smartwell/view/WellDetailActivity.kt b/app/src/main/java/com/casic/app/smartwell/view/WellDetailActivity.kt index b50d067..eb8b468 100644 --- a/app/src/main/java/com/casic/app/smartwell/view/WellDetailActivity.kt +++ b/app/src/main/java/com/casic/app/smartwell/view/WellDetailActivity.kt @@ -16,7 +16,7 @@ import com.pengxh.kt.lite.extensions.show import com.pengxh.kt.lite.utils.Constant import com.pengxh.kt.lite.utils.LoadState -import com.pengxh.kt.lite.utils.LoadingDialogHub +import com.pengxh.kt.lite.utils.LoadingDialog import com.pengxh.kt.lite.widget.TitleBarView import com.pengxh.kt.lite.widget.dialog.AlertMessageDialog @@ -44,7 +44,7 @@ } override fun initOnCreate(savedInstanceState: Bundle?) { - val wellId = intent.getStringExtra(Constant.INTENT_PARAM)!! + val wellId = intent.getStringExtra(Constant.INTENT_PARAM_KEY)!! wellViewModel = ViewModelProvider(this)[WellViewModel::class.java] wellViewModel.getWellDetail(wellId) wellViewModel.wellDetailModel.observe(this) { @@ -132,8 +132,8 @@ override fun observeRequestState() { wellViewModel.loadState.observe(this) { when (it) { - is LoadState.Loading -> LoadingDialogHub.show(this, "数据加载中,请稍后") - else -> LoadingDialogHub.dismiss() + is LoadState.Loading -> LoadingDialog.show(this, "数据加载中,请稍后") + else -> LoadingDialog.dismiss() } } } diff --git a/app/src/main/java/com/casic/app/smartwell/view/WellManagementActivity.kt b/app/src/main/java/com/casic/app/smartwell/view/WellManagementActivity.kt index 084da95..457096b 100644 --- a/app/src/main/java/com/casic/app/smartwell/view/WellManagementActivity.kt +++ b/app/src/main/java/com/casic/app/smartwell/view/WellManagementActivity.kt @@ -94,8 +94,8 @@ } } - binding.wellListView.addItemDecoration( - RecyclerViewItemOffsets(0, 5, 0, 5) + binding.recyclerView.addItemDecoration( + RecyclerViewItemOffsets(0, 7, 0, 7) ) } @@ -175,13 +175,12 @@ } else { item.deep.toString() + "m" } - viewHolder.setText(R.id.wellNameView, item.wellName) + viewHolder.setText(R.id.wellTypeView, item.wellTypeName) .setText(R.id.wellStateView, "已${item.bfztName}") .setText(R.id.wellDepthView, "深:${deep}") .setText(R.id.wellCodeView, "点位编号:${item.wellCode}") - .setText(R.id.wellTypeView, "点位类型:${item.wellTypeName}") .setText(R.id.ownerShipView, "权属单位:${item.deptName}") - .setText(R.id.wellLocationView, "点位置:${item.position}") + .setText(R.id.wellLocationView, "点位位置:${item.position}") .setOnClickListener( R.id.navigationButton, object : View.OnClickListener { override fun onClick(v: View?) { @@ -200,7 +199,7 @@ ) } } - binding.wellListView.adapter = wellListAdapter + binding.recyclerView.adapter = wellListAdapter wellListAdapter.setOnItemClickedListener(object : NormalRecyclerAdapter.OnItemClickedListener { override fun onItemClicked(position: Int, t: WellListModel.DataBean.RowsBean) { diff --git a/app/src/main/java/com/casic/app/smartwell/view/WellMonitorActivity.kt b/app/src/main/java/com/casic/app/smartwell/view/WellMonitorActivity.kt index e3573eb..b87bdb7 100644 --- a/app/src/main/java/com/casic/app/smartwell/view/WellMonitorActivity.kt +++ b/app/src/main/java/com/casic/app/smartwell/view/WellMonitorActivity.kt @@ -11,7 +11,7 @@ import com.pengxh.kt.lite.base.KotlinBaseActivity import com.pengxh.kt.lite.utils.Constant import com.pengxh.kt.lite.utils.LoadState -import com.pengxh.kt.lite.utils.LoadingDialogHub +import com.pengxh.kt.lite.utils.LoadingDialog import com.pengxh.kt.lite.widget.TitleBarView class WellMonitorActivity : KotlinBaseActivity() { @@ -36,7 +36,7 @@ } override fun initOnCreate(savedInstanceState: Bundle?) { - val wellId = intent.getStringExtra(Constant.INTENT_PARAM)!! + val wellId = intent.getStringExtra(Constant.INTENT_PARAM_KEY)!! wellViewModel = ViewModelProvider(this)[WellViewModel::class.java] wellViewModel.getMonitorResult(wellId) wellViewModel.monitorModel.observe(this) { @@ -56,8 +56,8 @@ override fun observeRequestState() { wellViewModel.loadState.observe(this) { when (it) { - is LoadState.Loading -> LoadingDialogHub.show(this, "数据加载中,请稍后") - else -> LoadingDialogHub.dismiss() + is LoadState.Loading -> LoadingDialog.show(this, "数据加载中,请稍后") + else -> LoadingDialog.dismiss() } } } diff --git a/app/src/main/java/com/casic/app/smartwell/view/WellOperationActivity.kt b/app/src/main/java/com/casic/app/smartwell/view/WellOperationActivity.kt index 8d333bf..347ebb6 100644 --- a/app/src/main/java/com/casic/app/smartwell/view/WellOperationActivity.kt +++ b/app/src/main/java/com/casic/app/smartwell/view/WellOperationActivity.kt @@ -23,7 +23,7 @@ import com.pengxh.kt.lite.extensions.navigatePageTo import com.pengxh.kt.lite.extensions.show import com.pengxh.kt.lite.utils.LoadState -import com.pengxh.kt.lite.utils.LoadingDialogHub +import com.pengxh.kt.lite.utils.LoadingDialog import com.pengxh.kt.lite.utils.WeakReferenceHandler import com.pengxh.kt.lite.widget.dialog.AlertControlDialog @@ -109,8 +109,8 @@ } } - binding.operationListView.addItemDecoration( - RecyclerViewItemOffsets(0, 5, 0, 5) + binding.recyclerView.addItemDecoration( + RecyclerViewItemOffsets(0, 7, 0, 7) ) } @@ -123,13 +123,13 @@ override fun observeRequestState() { wellViewModel.loadState.observe(this) { when (it) { - is LoadState.Loading -> LoadingDialogHub.show(this, "处理中,请稍后") + is LoadState.Loading -> LoadingDialog.show(this, "处理中,请稍后") is LoadState.Success -> { - LoadingDialogHub.dismiss() + LoadingDialog.dismiss() wellOperationAdapter.notifyItemChanged(clickedPosition) } - else -> LoadingDialogHub.dismiss() + else -> LoadingDialog.dismiss() } } } @@ -203,24 +203,23 @@ if (item.bfztName == "布防") { viewHolder.setImageResource( R.id.wellStateView, R.drawable.bg_solid_text_green_radius_5 - ).setText(R.id.wellStateView, "撤防") + ).setText(R.id.operationButton, "撤防") } else { viewHolder.setImageResource( R.id.wellStateView, R.drawable.bg_solid_text_red_radius_5 - ).setText(R.id.wellStateView, "布防") + ).setText(R.id.operationButton, "布防") } val deep = if (item.deep.toString().isBlank()) { "未知" } else { item.deep.toString() + "m" } - viewHolder.setText(R.id.wellNameView, item.wellName) + viewHolder.setText(R.id.wellTypeView, item.wellTypeName) .setText(R.id.wellStateView, "已${item.bfztName}") .setText(R.id.wellDepthView, "深:${deep}") .setText(R.id.wellCodeView, "点位编号:${item.wellCode}") - .setText(R.id.wellTypeView, "点位类型:${item.wellTypeName}") .setText(R.id.ownerShipView, "权属单位:${item.deptName}") - .setText(R.id.wellLocationView, "点位置:${item.position}") + .setText(R.id.wellLocationView, "点位位置:${item.position}") .setOnClickListener( R.id.operationButton, object : View.OnClickListener { override fun onClick(v: View?) { @@ -280,7 +279,7 @@ ) } } - binding.operationListView.adapter = wellOperationAdapter + binding.recyclerView.adapter = wellOperationAdapter wellOperationAdapter.setOnItemClickedListener(object : NormalRecyclerAdapter.OnItemClickedListener { override fun onItemClicked(position: Int, t: WellListModel.DataBean.RowsBean) { diff --git a/app/src/main/res/drawable/ic_down.xml b/app/src/main/res/drawable/ic_down.xml index 20e6476..6987e6c 100644 --- a/app/src/main/res/drawable/ic_down.xml +++ b/app/src/main/res/drawable/ic_down.xml @@ -1,6 +1,6 @@ + + diff --git a/app/src/main/res/layout/activity_about_us.xml b/app/src/main/res/layout/activity_about_us.xml index 9091a00..d5fbd0d 100644 --- a/app/src/main/res/layout/activity_about_us.xml +++ b/app/src/main/res/layout/activity_about_us.xml @@ -12,13 +12,7 @@ android:layout_width="match_parent" android:layout_height="wrap_content" android:background="@color/mainThemeColor" - app:tbv_left_image="@drawable/ic_title_left" - app:tbv_only_show_title="false" - app:tbv_show_left_image="true" - app:tbv_show_right_image="false" - app:tbv_text="关于我们" - app:tbv_text_color="@color/white" - app:tbv_text_size="@dimen/sp_18" /> + app:tbv_text="关于我们" /> + app:tbv_text="修改密码" /> + app:tbv_text="布防列表" /> + app:tbv_text="帮助中心" /> + app:tbv_text="工单详情" /> + app:tbv_text="工单详情" /> + app:tbv_text="工单详情" /> + app:tbv_text="工单详情" /> + app:tbv_text="超时工单" /> + app:tbv_text="工单查询" /> + app:tbv_text="查询结果" /> + app:tbv_text="撤防列表" /> + app:tbv_text="个人资料" /> + app:tbv_text="点位详情" /> - + + android:value="ee96d8b5e12de3fbb29949efd57418a8" /> () @@ -150,7 +158,7 @@ val cameraPosition = CameraPosition(centerLatLng, 14f, 0f, 0f) val cameraUpdate = CameraUpdateFactory.newCameraPosition(cameraPosition) withContext(Dispatchers.Main) { - LoadingDialogHub.dismiss() + LoadingDialog.dismiss() aMap.animateCamera(cameraUpdate, 1500, null) } } @@ -239,11 +247,6 @@ } override fun initEvent() { - binding.rightOptionView.setOnClickListener { - val x = binding.rightOptionView.width - easyPopupWindow.width - easyPopupWindow.showAsDropDown(binding.rightOptionView, x, 0) - } - //撤防点位 binding.unDeployedLayout.setOnClickListener { requireContext().navigatePageTo() @@ -263,11 +266,11 @@ override fun observeRequestState() { wellViewModel.loadState.observe(this) { when (it) { - is LoadState.Loading -> LoadingDialogHub.show( + is LoadState.Loading -> LoadingDialog.show( requireActivity(), "数据加载中,请稍后..." ) - else -> LoadingDialogHub.dismiss() + else -> LoadingDialog.dismiss() } } } @@ -376,7 +379,7 @@ }).build().show() } }) - infoPopup.showAsDropDown(binding.rightOptionView) +// infoPopup.showAsDropDown(binding.rightOptionView) } override fun onCameraChange(p0: CameraPosition?) { diff --git a/app/src/main/java/com/casic/app/smartwell/fragment/HomePageNoClusterFragment.kt b/app/src/main/java/com/casic/app/smartwell/fragment/HomePageNoClusterFragment.kt index 802426a..b25f743 100644 --- a/app/src/main/java/com/casic/app/smartwell/fragment/HomePageNoClusterFragment.kt +++ b/app/src/main/java/com/casic/app/smartwell/fragment/HomePageNoClusterFragment.kt @@ -38,8 +38,9 @@ import com.pengxh.kt.lite.extensions.navigatePageTo import com.pengxh.kt.lite.extensions.show import com.pengxh.kt.lite.utils.LoadState -import com.pengxh.kt.lite.utils.LoadingDialogHub +import com.pengxh.kt.lite.utils.LoadingDialog import com.pengxh.kt.lite.widget.EasyPopupWindow +import com.pengxh.kt.lite.widget.TitleBarView import com.pengxh.kt.lite.widget.dialog.AlertControlDialog import kotlinx.coroutines.Dispatchers import kotlinx.coroutines.launch @@ -78,7 +79,15 @@ override fun setupTopBarLayout() { binding.rootView.initImmersionBar(this, false, R.color.mainThemeColor) - binding.titleView.text = "首页" + binding.titleView.setOnClickListener(object : TitleBarView.OnClickListener { + override fun onLeftClick() { + + } + + override fun onRightClick() { + easyPopupWindow.showAsDropDown(binding.titleView, binding.titleView.width, 0) + } + }) } override fun initOnCreate(savedInstanceState: Bundle?) { @@ -112,7 +121,7 @@ //渲染井位置 lifecycleScope.launch(Dispatchers.Main) { - LoadingDialogHub.show(requireActivity(), "数据加载中,请稍后") + LoadingDialog.show(requireActivity(), "数据加载中,请稍后") withContext(Dispatchers.IO) { //取Well缓存 val allMarkerOptions = ArrayList() @@ -144,7 +153,7 @@ val cameraPosition = CameraPosition(centerLatLng, 14f, 0f, 0f) val cameraUpdate = CameraUpdateFactory.newCameraPosition(cameraPosition) withContext(Dispatchers.Main) { - LoadingDialogHub.dismiss() + LoadingDialog.dismiss() aMap.animateCamera(cameraUpdate, 1500, null) } } @@ -238,11 +247,6 @@ } override fun initEvent() { - binding.rightOptionView.setOnClickListener { - val x = binding.rightOptionView.width - easyPopupWindow.width - easyPopupWindow.showAsDropDown(binding.rightOptionView, x, 0) - } - //撤防点位 binding.unDeployedLayout.setOnClickListener { requireContext().navigatePageTo() @@ -262,11 +266,11 @@ override fun observeRequestState() { wellViewModel.loadState.observe(this) { when (it) { - is LoadState.Loading -> LoadingDialogHub.show( + is LoadState.Loading -> LoadingDialog.show( requireActivity(), "数据加载中,请稍后..." ) - else -> LoadingDialogHub.dismiss() + else -> LoadingDialog.dismiss() } } } diff --git a/app/src/main/java/com/casic/app/smartwell/fragment/MinePageFragment.kt b/app/src/main/java/com/casic/app/smartwell/fragment/MinePageFragment.kt index 09a570c..dcb48f8 100644 --- a/app/src/main/java/com/casic/app/smartwell/fragment/MinePageFragment.kt +++ b/app/src/main/java/com/casic/app/smartwell/fragment/MinePageFragment.kt @@ -35,7 +35,7 @@ import com.pengxh.kt.lite.utils.ActivityStackManager import com.pengxh.kt.lite.utils.FileDownloadManager import com.pengxh.kt.lite.utils.LoadState -import com.pengxh.kt.lite.utils.LoadingDialogHub +import com.pengxh.kt.lite.utils.LoadingDialog import com.pengxh.kt.lite.widget.dialog.AlertControlDialog import com.pengxh.kt.lite.widget.dialog.BottomActionSheet import kotlinx.coroutines.Dispatchers @@ -60,7 +60,6 @@ override fun setupTopBarLayout() { binding.rootView.initImmersionBar(this, false, R.color.mainThemeColor) - binding.titleInclude.titleView.text = "我的" } override fun initOnCreate(savedInstanceState: Bundle?) { @@ -155,27 +154,27 @@ override fun observeRequestState() { userViewModel.loadState.observe(this) { when (it) { - is LoadState.Loading -> LoadingDialogHub.show( + is LoadState.Loading -> LoadingDialog.show( requireActivity(), "检查版本中,请稍后" ) - else -> LoadingDialogHub.dismiss() + else -> LoadingDialog.dismiss() } } wellViewModel.loadState.observe(this) { when (it) { - is LoadState.Loading -> LoadingDialogHub.show( + is LoadState.Loading -> LoadingDialog.show( requireActivity(), "数据更新中,请稍后" ) is LoadState.Fail -> { - LoadingDialogHub.dismiss() + LoadingDialog.dismiss() "数据更新超时".show(requireContext()) } else -> { - LoadingDialogHub.dismiss() + LoadingDialog.dismiss() AlertControlDialog.Builder().setContext(requireContext()).setTitle("温馨提示") .setMessage("数据更新成功,请重启应用").setNegativeButton("取消") .setPositiveButton("确定").setOnDialogButtonClickListener(object : @@ -197,17 +196,17 @@ lineViewModel.loadState.observe(this) { when (it) { - is LoadState.Loading -> LoadingDialogHub.show( + is LoadState.Loading -> LoadingDialog.show( requireActivity(), "数据更新中,请稍后" ) is LoadState.Fail -> { - LoadingDialogHub.dismiss() + LoadingDialog.dismiss() "数据更新超时".show(requireContext()) } else -> { - LoadingDialogHub.dismiss() + LoadingDialog.dismiss() AlertControlDialog.Builder().setContext(requireContext()).setTitle("温馨提示") .setMessage("数据更新成功,请重启应用").setNegativeButton("取消") .setPositiveButton("确定").setOnDialogButtonClickListener(object : diff --git a/app/src/main/java/com/casic/app/smartwell/fragment/NoticePageFragment.kt b/app/src/main/java/com/casic/app/smartwell/fragment/NoticePageFragment.kt index 171b555..3c93f54 100644 --- a/app/src/main/java/com/casic/app/smartwell/fragment/NoticePageFragment.kt +++ b/app/src/main/java/com/casic/app/smartwell/fragment/NoticePageFragment.kt @@ -48,7 +48,6 @@ override fun setupTopBarLayout() { binding.rootView.initImmersionBar(this, false, R.color.mainThemeColor) - binding.titleInclude.titleView.text = "消息" } override fun initOnCreate(savedInstanceState: Bundle?) { diff --git a/app/src/main/java/com/casic/app/smartwell/fragment/OrderListFragment.kt b/app/src/main/java/com/casic/app/smartwell/fragment/OrderListFragment.kt index 93ff35b..5e38acb 100644 --- a/app/src/main/java/com/casic/app/smartwell/fragment/OrderListFragment.kt +++ b/app/src/main/java/com/casic/app/smartwell/fragment/OrderListFragment.kt @@ -12,6 +12,7 @@ import com.casic.app.smartwell.view.SearchOrderActivity import com.pengxh.kt.lite.base.KotlinBaseFragment import com.pengxh.kt.lite.extensions.navigatePageTo +import com.pengxh.kt.lite.widget.TitleBarView class OrderListFragment : KotlinBaseFragment() { @@ -25,15 +26,22 @@ } override fun initViewBinding( - inflater: LayoutInflater, - container: ViewGroup? + inflater: LayoutInflater, container: ViewGroup? ): FragmentOrderBinding { return FragmentOrderBinding.inflate(inflater, container, false) } override fun setupTopBarLayout() { binding.rootView.initImmersionBar(this, false, R.color.mainThemeColor) - binding.titleView.text = "工单" + binding.titleView.setOnClickListener(object : TitleBarView.OnClickListener { + override fun onLeftClick() { + + } + + override fun onRightClick() { + requireContext().navigatePageTo() + } + }) } override fun initOnCreate(savedInstanceState: Bundle?) { @@ -51,8 +59,6 @@ } override fun initEvent() { - binding.rightOptionView.setOnClickListener { - requireContext().navigatePageTo() - } + } } \ No newline at end of file diff --git a/app/src/main/java/com/casic/app/smartwell/fragment/OrderNotProcessedFragment.kt b/app/src/main/java/com/casic/app/smartwell/fragment/OrderNotProcessedFragment.kt index 0b3d09d..2b6f21d 100644 --- a/app/src/main/java/com/casic/app/smartwell/fragment/OrderNotProcessedFragment.kt +++ b/app/src/main/java/com/casic/app/smartwell/fragment/OrderNotProcessedFragment.kt @@ -18,7 +18,7 @@ import com.pengxh.kt.lite.extensions.navigatePageTo import com.pengxh.kt.lite.extensions.show import com.pengxh.kt.lite.utils.LoadState -import com.pengxh.kt.lite.utils.LoadingDialogHub +import com.pengxh.kt.lite.utils.LoadingDialog import com.pengxh.kt.lite.utils.WeakReferenceHandler import com.pengxh.kt.lite.widget.dialog.AlertControlDialog @@ -78,8 +78,8 @@ operationViewModel = ViewModelProvider(this)[OperationViewModel::class.java] - binding.notProcessedView.addItemDecoration( - RecyclerViewItemOffsets(0, 5, 0, 5) + binding.recyclerView.addItemDecoration( + RecyclerViewItemOffsets(0, 7, 0, 7) ) } @@ -87,9 +87,9 @@ //接单状态处理 operationViewModel.loadState.observe(this) { when (it) { - is LoadState.Loading -> LoadingDialogHub.show(requireActivity(), "接单中,请稍后") + is LoadState.Loading -> LoadingDialog.show(requireActivity(), "接单中,请稍后") is LoadState.Success -> { - LoadingDialogHub.dismiss() + LoadingDialog.dismiss() //接单成功之后刷新列表 dataBeans.removeAt(clickedPosition) notProcessedAdapter.notifyItemRemoved(clickedPosition) @@ -98,7 +98,7 @@ ) } - else -> LoadingDialogHub.dismiss() + else -> LoadingDialog.dismiss() } } } @@ -131,7 +131,7 @@ } else { binding.emptyInclude.emptyView.hide() notProcessedAdapter = OrderNotProcessedAdapter(requireContext(), dataBeans) - binding.notProcessedView.adapter = notProcessedAdapter + binding.recyclerView.adapter = notProcessedAdapter notProcessedAdapter.setOnItemClickListener(object : OrderNotProcessedAdapter.OnItemClickListener { override fun onClicked(position: Int) { diff --git a/app/src/main/java/com/casic/app/smartwell/fragment/OvertimeNotAcceptFragment.kt b/app/src/main/java/com/casic/app/smartwell/fragment/OvertimeNotAcceptFragment.kt index a198545..9b318ca 100644 --- a/app/src/main/java/com/casic/app/smartwell/fragment/OvertimeNotAcceptFragment.kt +++ b/app/src/main/java/com/casic/app/smartwell/fragment/OvertimeNotAcceptFragment.kt @@ -18,7 +18,7 @@ import com.pengxh.kt.lite.extensions.navigatePageTo import com.pengxh.kt.lite.extensions.show import com.pengxh.kt.lite.utils.LoadState -import com.pengxh.kt.lite.utils.LoadingDialogHub +import com.pengxh.kt.lite.utils.LoadingDialog import com.pengxh.kt.lite.utils.WeakReferenceHandler import com.pengxh.kt.lite.widget.dialog.AlertControlDialog @@ -81,8 +81,8 @@ operationViewModel = ViewModelProvider(this)[OperationViewModel::class.java] - binding.notProcessedView.addItemDecoration( - RecyclerViewItemOffsets(0, 5, 0, 5) + binding.recyclerView.addItemDecoration( + RecyclerViewItemOffsets(0, 7, 0, 7) ) } @@ -90,9 +90,9 @@ //接单状态处理 operationViewModel.loadState.observe(this) { when (it) { - is LoadState.Loading -> LoadingDialogHub.show(requireActivity(), "接单中,请稍后") + is LoadState.Loading -> LoadingDialog.show(requireActivity(), "接单中,请稍后") is LoadState.Success -> { - LoadingDialogHub.dismiss() + LoadingDialog.dismiss() //接单成功之后刷新列表 dataBeans.removeAt(clickedPosition) notProcessedAdapter.notifyItemRemoved(clickedPosition) @@ -101,7 +101,7 @@ ) } - else -> LoadingDialogHub.dismiss() + else -> LoadingDialog.dismiss() } } } @@ -134,7 +134,7 @@ } else { binding.emptyInclude.emptyView.hide() notProcessedAdapter = OrderNotProcessedAdapter(requireContext(), dataBeans) - binding.notProcessedView.adapter = notProcessedAdapter + binding.recyclerView.adapter = notProcessedAdapter notProcessedAdapter.setOnItemClickListener(object : OrderNotProcessedAdapter.OnItemClickListener { override fun onClicked(position: Int) { diff --git a/app/src/main/java/com/casic/app/smartwell/greendao/DaoMaster.java b/app/src/main/java/com/casic/app/smartwell/greendao/DaoMaster.java index fdcf3a7..1e52b74 100644 --- a/app/src/main/java/com/casic/app/smartwell/greendao/DaoMaster.java +++ b/app/src/main/java/com/casic/app/smartwell/greendao/DaoMaster.java @@ -13,25 +13,20 @@ // THIS CODE IS GENERATED BY greenDAO, DO NOT EDIT. - /** * Master of DAO (schema version 4): knows all DAOs. */ public class DaoMaster extends AbstractDaoMaster { public static final int SCHEMA_VERSION = 4; - /** - * Creates underlying database table using DAOs. - */ + /** Creates underlying database table using DAOs. */ public static void createAllTables(Database db, boolean ifNotExists) { MapWellLocalBeanDao.createTable(db, ifNotExists); NoticeLocaleBeanDao.createTable(db, ifNotExists); PipeLocalBeanDao.createTable(db, ifNotExists); } - /** - * Drops underlying database table using DAOs. - */ + /** Drops underlying database table using DAOs. */ public static void dropAllTables(Database db, boolean ifExists) { MapWellLocalBeanDao.dropTable(db, ifExists); NoticeLocaleBeanDao.dropTable(db, ifExists); @@ -86,9 +81,7 @@ } } - /** - * WARNING: Drops all table on Upgrade! Use only during development. - */ + /** WARNING: Drops all table on Upgrade! Use only during development. */ public static class DevOpenHelper extends OpenHelper { public DevOpenHelper(Context context, String name) { super(context, name); diff --git a/app/src/main/java/com/casic/app/smartwell/greendao/DaoSession.java b/app/src/main/java/com/casic/app/smartwell/greendao/DaoSession.java index 0b36d17..3e40e3b 100644 --- a/app/src/main/java/com/casic/app/smartwell/greendao/DaoSession.java +++ b/app/src/main/java/com/casic/app/smartwell/greendao/DaoSession.java @@ -16,7 +16,7 @@ /** * {@inheritDoc} - * + * * @see org.greenrobot.greendao.AbstractDaoSession */ public class DaoSession extends AbstractDaoSession { @@ -50,7 +50,7 @@ registerDao(NoticeLocaleBean.class, noticeLocaleBeanDao); registerDao(PipeLocalBean.class, pipeLocalBeanDao); } - + public void clear() { mapWellLocalBeanDaoConfig.clearIdentityScope(); noticeLocaleBeanDaoConfig.clearIdentityScope(); diff --git a/app/src/main/java/com/casic/app/smartwell/greendao/MapWellLocalBeanDao.java b/app/src/main/java/com/casic/app/smartwell/greendao/MapWellLocalBeanDao.java index 8908fda..407bc92 100644 --- a/app/src/main/java/com/casic/app/smartwell/greendao/MapWellLocalBeanDao.java +++ b/app/src/main/java/com/casic/app/smartwell/greendao/MapWellLocalBeanDao.java @@ -12,10 +12,9 @@ import org.greenrobot.greendao.internal.DaoConfig; // THIS CODE IS GENERATED BY greenDAO, DO NOT EDIT. - -/** +/** * DAO for table "MAP_WELL_LOCAL_BEAN". - */ +*/ public class MapWellLocalBeanDao extends AbstractDao { public static final String TABLENAME = "MAP_WELL_LOCAL_BEAN"; @@ -57,16 +56,14 @@ public MapWellLocalBeanDao(DaoConfig config) { super(config); } - + public MapWellLocalBeanDao(DaoConfig config, DaoSession daoSession) { super(config, daoSession); } - /** - * Creates the underlying database table. - */ + /** Creates the underlying database table. */ public static void createTable(Database db, boolean ifNotExists) { - String constraint = ifNotExists ? "IF NOT EXISTS " : ""; + String constraint = ifNotExists? "IF NOT EXISTS ": ""; db.execSQL("CREATE TABLE " + constraint + "\"MAP_WELL_LOCAL_BEAN\" (" + // "\"_id\" INTEGER PRIMARY KEY AUTOINCREMENT ," + // 0: kId "\"AREA\" TEXT," + // 1: area @@ -96,9 +93,7 @@ "\"WELL_TYPE_NAME\" TEXT);"); // 25: wellTypeName } - /** - * Drops the underlying database table. - */ + /** Drops the underlying database table. */ public static void dropTable(Database db, boolean ifExists) { String sql = "DROP TABLE " + (ifExists ? "IF EXISTS " : "") + "\"MAP_WELL_LOCAL_BEAN\""; db.execSQL(sql); @@ -107,132 +102,132 @@ @Override protected final void bindValues(DatabaseStatement stmt, MapWellLocalBean entity) { stmt.clearBindings(); - + Long kId = entity.getKId(); if (kId != null) { stmt.bindLong(1, kId); } - + String area = entity.getArea(); if (area != null) { stmt.bindString(2, area); } - + String bfzt = entity.getBfzt(); if (bfzt != null) { stmt.bindString(3, bfzt); } - + String bfztName = entity.getBfztName(); if (bfztName != null) { stmt.bindString(4, bfztName); } - + String coordinateX = entity.getCoordinateX(); if (coordinateX != null) { stmt.bindString(5, coordinateX); } - + String coordinateY = entity.getCoordinateY(); if (coordinateY != null) { stmt.bindString(6, coordinateY); } - + String deep = entity.getDeep(); if (deep != null) { stmt.bindString(7, deep); } - + String deptName = entity.getDeptName(); if (deptName != null) { stmt.bindString(8, deptName); } - + String deptid = entity.getDeptid(); if (deptid != null) { stmt.bindString(9, deptid); } - + String id = entity.getId(); if (id != null) { stmt.bindString(10, id); } - + String latBaidu = entity.getLatBaidu(); if (latBaidu != null) { stmt.bindString(11, latBaidu); } - + String latGaode = entity.getLatGaode(); if (latGaode != null) { stmt.bindString(12, latGaode); } - + String lngBaidu = entity.getLngBaidu(); if (lngBaidu != null) { stmt.bindString(13, lngBaidu); } - + String lngGaode = entity.getLngGaode(); if (lngGaode != null) { stmt.bindString(14, lngGaode); } - + String notes = entity.getNotes(); if (notes != null) { stmt.bindString(15, notes); } - + String photos = entity.getPhotos(); if (photos != null) { stmt.bindString(16, photos); } - + String position = entity.getPosition(); if (position != null) { stmt.bindString(17, position); } - + String staff = entity.getStaff(); if (staff != null) { stmt.bindString(18, staff); } - + String tel = entity.getTel(); if (tel != null) { stmt.bindString(19, tel); } - + String ts = entity.getTs(); if (ts != null) { stmt.bindString(20, ts); } - + String valid = entity.getValid(); if (valid != null) { stmt.bindString(21, valid); } - + String watchData = entity.getWatchData(); if (watchData != null) { stmt.bindString(22, watchData); } - + String wellCode = entity.getWellCode(); if (wellCode != null) { stmt.bindString(23, wellCode); } - + String wellName = entity.getWellName(); if (wellName != null) { stmt.bindString(24, wellName); } - + String wellType = entity.getWellType(); if (wellType != null) { stmt.bindString(25, wellType); } - + String wellTypeName = entity.getWellTypeName(); if (wellTypeName != null) { stmt.bindString(26, wellTypeName); @@ -242,132 +237,132 @@ @Override protected final void bindValues(SQLiteStatement stmt, MapWellLocalBean entity) { stmt.clearBindings(); - + Long kId = entity.getKId(); if (kId != null) { stmt.bindLong(1, kId); } - + String area = entity.getArea(); if (area != null) { stmt.bindString(2, area); } - + String bfzt = entity.getBfzt(); if (bfzt != null) { stmt.bindString(3, bfzt); } - + String bfztName = entity.getBfztName(); if (bfztName != null) { stmt.bindString(4, bfztName); } - + String coordinateX = entity.getCoordinateX(); if (coordinateX != null) { stmt.bindString(5, coordinateX); } - + String coordinateY = entity.getCoordinateY(); if (coordinateY != null) { stmt.bindString(6, coordinateY); } - + String deep = entity.getDeep(); if (deep != null) { stmt.bindString(7, deep); } - + String deptName = entity.getDeptName(); if (deptName != null) { stmt.bindString(8, deptName); } - + String deptid = entity.getDeptid(); if (deptid != null) { stmt.bindString(9, deptid); } - + String id = entity.getId(); if (id != null) { stmt.bindString(10, id); } - + String latBaidu = entity.getLatBaidu(); if (latBaidu != null) { stmt.bindString(11, latBaidu); } - + String latGaode = entity.getLatGaode(); if (latGaode != null) { stmt.bindString(12, latGaode); } - + String lngBaidu = entity.getLngBaidu(); if (lngBaidu != null) { stmt.bindString(13, lngBaidu); } - + String lngGaode = entity.getLngGaode(); if (lngGaode != null) { stmt.bindString(14, lngGaode); } - + String notes = entity.getNotes(); if (notes != null) { stmt.bindString(15, notes); } - + String photos = entity.getPhotos(); if (photos != null) { stmt.bindString(16, photos); } - + String position = entity.getPosition(); if (position != null) { stmt.bindString(17, position); } - + String staff = entity.getStaff(); if (staff != null) { stmt.bindString(18, staff); } - + String tel = entity.getTel(); if (tel != null) { stmt.bindString(19, tel); } - + String ts = entity.getTs(); if (ts != null) { stmt.bindString(20, ts); } - + String valid = entity.getValid(); if (valid != null) { stmt.bindString(21, valid); } - + String watchData = entity.getWatchData(); if (watchData != null) { stmt.bindString(22, watchData); } - + String wellCode = entity.getWellCode(); if (wellCode != null) { stmt.bindString(23, wellCode); } - + String wellName = entity.getWellName(); if (wellName != null) { stmt.bindString(24, wellName); } - + String wellType = entity.getWellType(); if (wellType != null) { stmt.bindString(25, wellType); } - + String wellTypeName = entity.getWellTypeName(); if (wellTypeName != null) { stmt.bindString(26, wellTypeName); @@ -377,41 +372,41 @@ @Override public Long readKey(Cursor cursor, int offset) { return cursor.isNull(offset + 0) ? null : cursor.getLong(offset + 0); - } + } @Override public MapWellLocalBean readEntity(Cursor cursor, int offset) { MapWellLocalBean entity = new MapWellLocalBean( // - cursor.isNull(offset + 0) ? null : cursor.getLong(offset + 0), // kId - cursor.isNull(offset + 1) ? null : cursor.getString(offset + 1), // area - cursor.isNull(offset + 2) ? null : cursor.getString(offset + 2), // bfzt - cursor.isNull(offset + 3) ? null : cursor.getString(offset + 3), // bfztName - cursor.isNull(offset + 4) ? null : cursor.getString(offset + 4), // coordinateX - cursor.isNull(offset + 5) ? null : cursor.getString(offset + 5), // coordinateY - cursor.isNull(offset + 6) ? null : cursor.getString(offset + 6), // deep - cursor.isNull(offset + 7) ? null : cursor.getString(offset + 7), // deptName - cursor.isNull(offset + 8) ? null : cursor.getString(offset + 8), // deptid - cursor.isNull(offset + 9) ? null : cursor.getString(offset + 9), // id - cursor.isNull(offset + 10) ? null : cursor.getString(offset + 10), // latBaidu - cursor.isNull(offset + 11) ? null : cursor.getString(offset + 11), // latGaode - cursor.isNull(offset + 12) ? null : cursor.getString(offset + 12), // lngBaidu - cursor.isNull(offset + 13) ? null : cursor.getString(offset + 13), // lngGaode - cursor.isNull(offset + 14) ? null : cursor.getString(offset + 14), // notes - cursor.isNull(offset + 15) ? null : cursor.getString(offset + 15), // photos - cursor.isNull(offset + 16) ? null : cursor.getString(offset + 16), // position - cursor.isNull(offset + 17) ? null : cursor.getString(offset + 17), // staff - cursor.isNull(offset + 18) ? null : cursor.getString(offset + 18), // tel - cursor.isNull(offset + 19) ? null : cursor.getString(offset + 19), // ts - cursor.isNull(offset + 20) ? null : cursor.getString(offset + 20), // valid - cursor.isNull(offset + 21) ? null : cursor.getString(offset + 21), // watchData - cursor.isNull(offset + 22) ? null : cursor.getString(offset + 22), // wellCode - cursor.isNull(offset + 23) ? null : cursor.getString(offset + 23), // wellName - cursor.isNull(offset + 24) ? null : cursor.getString(offset + 24), // wellType - cursor.isNull(offset + 25) ? null : cursor.getString(offset + 25) // wellTypeName + cursor.isNull(offset + 0) ? null : cursor.getLong(offset + 0), // kId + cursor.isNull(offset + 1) ? null : cursor.getString(offset + 1), // area + cursor.isNull(offset + 2) ? null : cursor.getString(offset + 2), // bfzt + cursor.isNull(offset + 3) ? null : cursor.getString(offset + 3), // bfztName + cursor.isNull(offset + 4) ? null : cursor.getString(offset + 4), // coordinateX + cursor.isNull(offset + 5) ? null : cursor.getString(offset + 5), // coordinateY + cursor.isNull(offset + 6) ? null : cursor.getString(offset + 6), // deep + cursor.isNull(offset + 7) ? null : cursor.getString(offset + 7), // deptName + cursor.isNull(offset + 8) ? null : cursor.getString(offset + 8), // deptid + cursor.isNull(offset + 9) ? null : cursor.getString(offset + 9), // id + cursor.isNull(offset + 10) ? null : cursor.getString(offset + 10), // latBaidu + cursor.isNull(offset + 11) ? null : cursor.getString(offset + 11), // latGaode + cursor.isNull(offset + 12) ? null : cursor.getString(offset + 12), // lngBaidu + cursor.isNull(offset + 13) ? null : cursor.getString(offset + 13), // lngGaode + cursor.isNull(offset + 14) ? null : cursor.getString(offset + 14), // notes + cursor.isNull(offset + 15) ? null : cursor.getString(offset + 15), // photos + cursor.isNull(offset + 16) ? null : cursor.getString(offset + 16), // position + cursor.isNull(offset + 17) ? null : cursor.getString(offset + 17), // staff + cursor.isNull(offset + 18) ? null : cursor.getString(offset + 18), // tel + cursor.isNull(offset + 19) ? null : cursor.getString(offset + 19), // ts + cursor.isNull(offset + 20) ? null : cursor.getString(offset + 20), // valid + cursor.isNull(offset + 21) ? null : cursor.getString(offset + 21), // watchData + cursor.isNull(offset + 22) ? null : cursor.getString(offset + 22), // wellCode + cursor.isNull(offset + 23) ? null : cursor.getString(offset + 23), // wellName + cursor.isNull(offset + 24) ? null : cursor.getString(offset + 24), // wellType + cursor.isNull(offset + 25) ? null : cursor.getString(offset + 25) // wellTypeName ); return entity; } - + @Override public void readEntity(Cursor cursor, MapWellLocalBean entity, int offset) { entity.setKId(cursor.isNull(offset + 0) ? null : cursor.getLong(offset + 0)); @@ -440,17 +435,17 @@ entity.setWellName(cursor.isNull(offset + 23) ? null : cursor.getString(offset + 23)); entity.setWellType(cursor.isNull(offset + 24) ? null : cursor.getString(offset + 24)); entity.setWellTypeName(cursor.isNull(offset + 25) ? null : cursor.getString(offset + 25)); - } - + } + @Override protected final Long updateKeyAfterInsert(MapWellLocalBean entity, long rowId) { entity.setKId(rowId); return rowId; } - + @Override public Long getKey(MapWellLocalBean entity) { - if (entity != null) { + if(entity != null) { return entity.getKId(); } else { return null; @@ -466,5 +461,5 @@ protected final boolean isEntityUpdateable() { return true; } - + } diff --git a/app/src/main/java/com/casic/app/smartwell/greendao/NoticeLocaleBeanDao.java b/app/src/main/java/com/casic/app/smartwell/greendao/NoticeLocaleBeanDao.java index 64312ed..deb2d49 100644 --- a/app/src/main/java/com/casic/app/smartwell/greendao/NoticeLocaleBeanDao.java +++ b/app/src/main/java/com/casic/app/smartwell/greendao/NoticeLocaleBeanDao.java @@ -12,10 +12,9 @@ import org.greenrobot.greendao.internal.DaoConfig; // THIS CODE IS GENERATED BY greenDAO, DO NOT EDIT. - -/** +/** * DAO for table "NOTICE_LOCALE_BEAN". - */ +*/ public class NoticeLocaleBeanDao extends AbstractDao { public static final String TABLENAME = "NOTICE_LOCALE_BEAN"; @@ -43,16 +42,14 @@ public NoticeLocaleBeanDao(DaoConfig config) { super(config); } - + public NoticeLocaleBeanDao(DaoConfig config, DaoSession daoSession) { super(config, daoSession); } - /** - * Creates the underlying database table. - */ + /** Creates the underlying database table. */ public static void createTable(Database db, boolean ifNotExists) { - String constraint = ifNotExists ? "IF NOT EXISTS " : ""; + String constraint = ifNotExists? "IF NOT EXISTS ": ""; db.execSQL("CREATE TABLE " + constraint + "\"NOTICE_LOCALE_BEAN\" (" + // "\"_id\" INTEGER PRIMARY KEY AUTOINCREMENT ," + // 0: id "\"MESSAGE_ID\" TEXT UNIQUE ," + // 1: messageId @@ -68,9 +65,7 @@ "\"NOTICE_TIME\" TEXT);"); // 11: noticeTime } - /** - * Drops the underlying database table. - */ + /** Drops the underlying database table. */ public static void dropTable(Database db, boolean ifExists) { String sql = "DROP TABLE " + (ifExists ? "IF EXISTS " : "") + "\"NOTICE_LOCALE_BEAN\""; db.execSQL(sql); @@ -79,62 +74,62 @@ @Override protected final void bindValues(DatabaseStatement stmt, NoticeLocaleBean entity) { stmt.clearBindings(); - + Long id = entity.getId(); if (id != null) { stmt.bindLong(1, id); } - + String messageId = entity.getMessageId(); if (messageId != null) { stmt.bindString(2, messageId); } - + String appid = entity.getAppid(); if (appid != null) { stmt.bindString(3, appid); } - + String clientId = entity.getClientId(); if (clientId != null) { stmt.bindString(4, clientId); } - + String taskId = entity.getTaskId(); if (taskId != null) { stmt.bindString(5, taskId); } - + String userId = entity.getUserId(); if (userId != null) { stmt.bindString(6, userId); } - + String title = entity.getTitle(); if (title != null) { stmt.bindString(7, title); } - + String content = entity.getContent(); if (content != null) { stmt.bindString(8, content); } - + String deviceCode = entity.getDeviceCode(); if (deviceCode != null) { stmt.bindString(9, deviceCode); } - + String jobId = entity.getJobId(); if (jobId != null) { stmt.bindString(10, jobId); } - + String isRead = entity.getIsRead(); if (isRead != null) { stmt.bindString(11, isRead); } - + String noticeTime = entity.getNoticeTime(); if (noticeTime != null) { stmt.bindString(12, noticeTime); @@ -144,62 +139,62 @@ @Override protected final void bindValues(SQLiteStatement stmt, NoticeLocaleBean entity) { stmt.clearBindings(); - + Long id = entity.getId(); if (id != null) { stmt.bindLong(1, id); } - + String messageId = entity.getMessageId(); if (messageId != null) { stmt.bindString(2, messageId); } - + String appid = entity.getAppid(); if (appid != null) { stmt.bindString(3, appid); } - + String clientId = entity.getClientId(); if (clientId != null) { stmt.bindString(4, clientId); } - + String taskId = entity.getTaskId(); if (taskId != null) { stmt.bindString(5, taskId); } - + String userId = entity.getUserId(); if (userId != null) { stmt.bindString(6, userId); } - + String title = entity.getTitle(); if (title != null) { stmt.bindString(7, title); } - + String content = entity.getContent(); if (content != null) { stmt.bindString(8, content); } - + String deviceCode = entity.getDeviceCode(); if (deviceCode != null) { stmt.bindString(9, deviceCode); } - + String jobId = entity.getJobId(); if (jobId != null) { stmt.bindString(10, jobId); } - + String isRead = entity.getIsRead(); if (isRead != null) { stmt.bindString(11, isRead); } - + String noticeTime = entity.getNoticeTime(); if (noticeTime != null) { stmt.bindString(12, noticeTime); @@ -209,27 +204,27 @@ @Override public Long readKey(Cursor cursor, int offset) { return cursor.isNull(offset + 0) ? null : cursor.getLong(offset + 0); - } + } @Override public NoticeLocaleBean readEntity(Cursor cursor, int offset) { NoticeLocaleBean entity = new NoticeLocaleBean( // - cursor.isNull(offset + 0) ? null : cursor.getLong(offset + 0), // id - cursor.isNull(offset + 1) ? null : cursor.getString(offset + 1), // messageId - cursor.isNull(offset + 2) ? null : cursor.getString(offset + 2), // appid - cursor.isNull(offset + 3) ? null : cursor.getString(offset + 3), // clientId - cursor.isNull(offset + 4) ? null : cursor.getString(offset + 4), // taskId - cursor.isNull(offset + 5) ? null : cursor.getString(offset + 5), // userId - cursor.isNull(offset + 6) ? null : cursor.getString(offset + 6), // title - cursor.isNull(offset + 7) ? null : cursor.getString(offset + 7), // content - cursor.isNull(offset + 8) ? null : cursor.getString(offset + 8), // deviceCode - cursor.isNull(offset + 9) ? null : cursor.getString(offset + 9), // jobId - cursor.isNull(offset + 10) ? null : cursor.getString(offset + 10), // isRead - cursor.isNull(offset + 11) ? null : cursor.getString(offset + 11) // noticeTime + cursor.isNull(offset + 0) ? null : cursor.getLong(offset + 0), // id + cursor.isNull(offset + 1) ? null : cursor.getString(offset + 1), // messageId + cursor.isNull(offset + 2) ? null : cursor.getString(offset + 2), // appid + cursor.isNull(offset + 3) ? null : cursor.getString(offset + 3), // clientId + cursor.isNull(offset + 4) ? null : cursor.getString(offset + 4), // taskId + cursor.isNull(offset + 5) ? null : cursor.getString(offset + 5), // userId + cursor.isNull(offset + 6) ? null : cursor.getString(offset + 6), // title + cursor.isNull(offset + 7) ? null : cursor.getString(offset + 7), // content + cursor.isNull(offset + 8) ? null : cursor.getString(offset + 8), // deviceCode + cursor.isNull(offset + 9) ? null : cursor.getString(offset + 9), // jobId + cursor.isNull(offset + 10) ? null : cursor.getString(offset + 10), // isRead + cursor.isNull(offset + 11) ? null : cursor.getString(offset + 11) // noticeTime ); return entity; } - + @Override public void readEntity(Cursor cursor, NoticeLocaleBean entity, int offset) { entity.setId(cursor.isNull(offset + 0) ? null : cursor.getLong(offset + 0)); @@ -244,17 +239,17 @@ entity.setJobId(cursor.isNull(offset + 9) ? null : cursor.getString(offset + 9)); entity.setIsRead(cursor.isNull(offset + 10) ? null : cursor.getString(offset + 10)); entity.setNoticeTime(cursor.isNull(offset + 11) ? null : cursor.getString(offset + 11)); - } - + } + @Override protected final Long updateKeyAfterInsert(NoticeLocaleBean entity, long rowId) { entity.setId(rowId); return rowId; } - + @Override public Long getKey(NoticeLocaleBean entity) { - if (entity != null) { + if(entity != null) { return entity.getId(); } else { return null; @@ -270,5 +265,5 @@ protected final boolean isEntityUpdateable() { return true; } - + } diff --git a/app/src/main/java/com/casic/app/smartwell/greendao/PipeLocalBeanDao.java b/app/src/main/java/com/casic/app/smartwell/greendao/PipeLocalBeanDao.java index aab4d3f..df5515a 100644 --- a/app/src/main/java/com/casic/app/smartwell/greendao/PipeLocalBeanDao.java +++ b/app/src/main/java/com/casic/app/smartwell/greendao/PipeLocalBeanDao.java @@ -12,10 +12,9 @@ import org.greenrobot.greendao.internal.DaoConfig; // THIS CODE IS GENERATED BY greenDAO, DO NOT EDIT. - -/** +/** * DAO for table "PIPE_LOCAL_BEAN". - */ +*/ public class PipeLocalBeanDao extends AbstractDao { public static final String TABLENAME = "PIPE_LOCAL_BEAN"; @@ -37,16 +36,14 @@ public PipeLocalBeanDao(DaoConfig config) { super(config); } - + public PipeLocalBeanDao(DaoConfig config, DaoSession daoSession) { super(config, daoSession); } - /** - * Creates the underlying database table. - */ + /** Creates the underlying database table. */ public static void createTable(Database db, boolean ifNotExists) { - String constraint = ifNotExists ? "IF NOT EXISTS " : ""; + String constraint = ifNotExists? "IF NOT EXISTS ": ""; db.execSQL("CREATE TABLE " + constraint + "\"PIPE_LOCAL_BEAN\" (" + // "\"_id\" INTEGER PRIMARY KEY AUTOINCREMENT ," + // 0: id "\"PIPE_CODE\" TEXT," + // 1: pipeCode @@ -56,9 +53,7 @@ "\"START_LONGITUDE_GD\" TEXT);"); // 5: startLongitudeGd } - /** - * Drops the underlying database table. - */ + /** Drops the underlying database table. */ public static void dropTable(Database db, boolean ifExists) { String sql = "DROP TABLE " + (ifExists ? "IF EXISTS " : "") + "\"PIPE_LOCAL_BEAN\""; db.execSQL(sql); @@ -67,32 +62,32 @@ @Override protected final void bindValues(DatabaseStatement stmt, PipeLocalBean entity) { stmt.clearBindings(); - + Long id = entity.getId(); if (id != null) { stmt.bindLong(1, id); } - + String pipeCode = entity.getPipeCode(); if (pipeCode != null) { stmt.bindString(2, pipeCode); } - + String endLatitudeGd = entity.getEndLatitudeGd(); if (endLatitudeGd != null) { stmt.bindString(3, endLatitudeGd); } - + String endLongitudeGd = entity.getEndLongitudeGd(); if (endLongitudeGd != null) { stmt.bindString(4, endLongitudeGd); } - + String startLatitudeGd = entity.getStartLatitudeGd(); if (startLatitudeGd != null) { stmt.bindString(5, startLatitudeGd); } - + String startLongitudeGd = entity.getStartLongitudeGd(); if (startLongitudeGd != null) { stmt.bindString(6, startLongitudeGd); @@ -102,32 +97,32 @@ @Override protected final void bindValues(SQLiteStatement stmt, PipeLocalBean entity) { stmt.clearBindings(); - + Long id = entity.getId(); if (id != null) { stmt.bindLong(1, id); } - + String pipeCode = entity.getPipeCode(); if (pipeCode != null) { stmt.bindString(2, pipeCode); } - + String endLatitudeGd = entity.getEndLatitudeGd(); if (endLatitudeGd != null) { stmt.bindString(3, endLatitudeGd); } - + String endLongitudeGd = entity.getEndLongitudeGd(); if (endLongitudeGd != null) { stmt.bindString(4, endLongitudeGd); } - + String startLatitudeGd = entity.getStartLatitudeGd(); if (startLatitudeGd != null) { stmt.bindString(5, startLatitudeGd); } - + String startLongitudeGd = entity.getStartLongitudeGd(); if (startLongitudeGd != null) { stmt.bindString(6, startLongitudeGd); @@ -137,21 +132,21 @@ @Override public Long readKey(Cursor cursor, int offset) { return cursor.isNull(offset + 0) ? null : cursor.getLong(offset + 0); - } + } @Override public PipeLocalBean readEntity(Cursor cursor, int offset) { PipeLocalBean entity = new PipeLocalBean( // - cursor.isNull(offset + 0) ? null : cursor.getLong(offset + 0), // id - cursor.isNull(offset + 1) ? null : cursor.getString(offset + 1), // pipeCode - cursor.isNull(offset + 2) ? null : cursor.getString(offset + 2), // endLatitudeGd - cursor.isNull(offset + 3) ? null : cursor.getString(offset + 3), // endLongitudeGd - cursor.isNull(offset + 4) ? null : cursor.getString(offset + 4), // startLatitudeGd - cursor.isNull(offset + 5) ? null : cursor.getString(offset + 5) // startLongitudeGd + cursor.isNull(offset + 0) ? null : cursor.getLong(offset + 0), // id + cursor.isNull(offset + 1) ? null : cursor.getString(offset + 1), // pipeCode + cursor.isNull(offset + 2) ? null : cursor.getString(offset + 2), // endLatitudeGd + cursor.isNull(offset + 3) ? null : cursor.getString(offset + 3), // endLongitudeGd + cursor.isNull(offset + 4) ? null : cursor.getString(offset + 4), // startLatitudeGd + cursor.isNull(offset + 5) ? null : cursor.getString(offset + 5) // startLongitudeGd ); return entity; } - + @Override public void readEntity(Cursor cursor, PipeLocalBean entity, int offset) { entity.setId(cursor.isNull(offset + 0) ? null : cursor.getLong(offset + 0)); @@ -160,17 +155,17 @@ entity.setEndLongitudeGd(cursor.isNull(offset + 3) ? null : cursor.getString(offset + 3)); entity.setStartLatitudeGd(cursor.isNull(offset + 4) ? null : cursor.getString(offset + 4)); entity.setStartLongitudeGd(cursor.isNull(offset + 5) ? null : cursor.getString(offset + 5)); - } - + } + @Override protected final Long updateKeyAfterInsert(PipeLocalBean entity, long rowId) { entity.setId(rowId); return rowId; } - + @Override public Long getKey(PipeLocalBean entity) { - if (entity != null) { + if(entity != null) { return entity.getId(); } else { return null; @@ -186,5 +181,5 @@ protected final boolean isEntityUpdateable() { return true; } - + } diff --git a/app/src/main/java/com/casic/app/smartwell/view/ChangePasswordActivity.kt b/app/src/main/java/com/casic/app/smartwell/view/ChangePasswordActivity.kt index 8e41039..9f1dd40 100644 --- a/app/src/main/java/com/casic/app/smartwell/view/ChangePasswordActivity.kt +++ b/app/src/main/java/com/casic/app/smartwell/view/ChangePasswordActivity.kt @@ -14,7 +14,7 @@ import com.pengxh.kt.lite.extensions.show import com.pengxh.kt.lite.utils.ActivityStackManager import com.pengxh.kt.lite.utils.LoadState -import com.pengxh.kt.lite.utils.LoadingDialogHub +import com.pengxh.kt.lite.utils.LoadingDialog import com.pengxh.kt.lite.widget.TitleBarView import java.nio.charset.StandardCharsets @@ -46,15 +46,15 @@ override fun observeRequestState() { userViewModel.loadState.observe(this) { when (it) { - is LoadState.Loading -> LoadingDialogHub.show(this, "修改中,请稍后") + is LoadState.Loading -> LoadingDialog.show(this, "修改中,请稍后") is LoadState.Success -> { - LoadingDialogHub.dismiss() + LoadingDialog.dismiss() AuthenticationHelper.removeToken() this.navigatePageTo() ActivityStackManager.finishAllActivity() } - else -> LoadingDialogHub.dismiss() + else -> LoadingDialog.dismiss() } } } diff --git a/app/src/main/java/com/casic/app/smartwell/view/DeployedWellActivity.kt b/app/src/main/java/com/casic/app/smartwell/view/DeployedWellActivity.kt index fb4339c..28a5078 100644 --- a/app/src/main/java/com/casic/app/smartwell/view/DeployedWellActivity.kt +++ b/app/src/main/java/com/casic/app/smartwell/view/DeployedWellActivity.kt @@ -83,8 +83,8 @@ } //添加分割线 - binding.deployedListView.addItemDecoration( - RecyclerViewItemOffsets(0, 5, 0, 5) + binding.recyclerView.addItemDecoration( + RecyclerViewItemOffsets(0, 7, 0, 7) ) } @@ -149,12 +149,11 @@ } else { item.deep.toString() + "m" } - viewHolder.setText(R.id.wellNameView, item.wellName) + viewHolder.setText(R.id.wellTypeView, item.wellTypeName) .setText(R.id.wellDepthView, "深:${deep}") .setText(R.id.wellCodeView, "点位编号:${item.wellCode}") - .setText(R.id.wellTypeView, "点位类型:${item.wellTypeName}") .setText(R.id.ownerShipView, "权属单位:${item.deptName}") - .setText(R.id.wellLocationView, "点位置:${item.position}") + .setText(R.id.wellLocationView, "点位位置:${item.position}") .setOnClickListener( R.id.operationButton, object : View.OnClickListener { override fun onClick(v: View?) { @@ -207,7 +206,7 @@ }) } } - binding.deployedListView.adapter = deployAdapter + binding.recyclerView.adapter = deployAdapter deployAdapter.setOnItemClickedListener(object : NormalRecyclerAdapter.OnItemClickedListener { override fun onItemClicked(position: Int, t: WellListModel.DataBean.RowsBean) { diff --git a/app/src/main/java/com/casic/app/smartwell/view/LoginActivity.kt b/app/src/main/java/com/casic/app/smartwell/view/LoginActivity.kt index e4bb0e3..834527b 100644 --- a/app/src/main/java/com/casic/app/smartwell/view/LoginActivity.kt +++ b/app/src/main/java/com/casic/app/smartwell/view/LoginActivity.kt @@ -21,7 +21,7 @@ import com.pengxh.kt.lite.extensions.navigatePageTo import com.pengxh.kt.lite.extensions.readAssetsFile import com.pengxh.kt.lite.extensions.show -import com.pengxh.kt.lite.utils.LoadingDialogHub +import com.pengxh.kt.lite.utils.LoadingDialog import com.pengxh.kt.lite.utils.SaveKeyValues import kotlinx.coroutines.Dispatchers import kotlinx.coroutines.launch @@ -106,11 +106,11 @@ override fun observeRequestState() { authenticateViewModel.loadState.observe(this) { - LoadingDialogHub.show(this, "登录中,请稍后") + LoadingDialog.show(this, "登录中,请稍后") } loginViewModel.loadState.observe(this) { - LoadingDialogHub.dismiss() + LoadingDialog.dismiss() } } diff --git a/app/src/main/java/com/casic/app/smartwell/view/OrderCompletedDetailActivity.kt b/app/src/main/java/com/casic/app/smartwell/view/OrderCompletedDetailActivity.kt index db8ad1f..75cd905 100644 --- a/app/src/main/java/com/casic/app/smartwell/view/OrderCompletedDetailActivity.kt +++ b/app/src/main/java/com/casic/app/smartwell/view/OrderCompletedDetailActivity.kt @@ -17,7 +17,7 @@ import com.pengxh.kt.lite.extensions.show import com.pengxh.kt.lite.utils.Constant import com.pengxh.kt.lite.utils.LoadState -import com.pengxh.kt.lite.utils.LoadingDialogHub +import com.pengxh.kt.lite.utils.LoadingDialog import com.pengxh.kt.lite.widget.TitleBarView import com.pengxh.kt.lite.widget.dialog.AlertMessageDialog @@ -44,7 +44,7 @@ } override fun initOnCreate(savedInstanceState: Bundle?) { - val jobId = intent.getStringExtra(Constant.INTENT_PARAM)!! + val jobId = intent.getStringExtra(Constant.INTENT_PARAM_KEY)!! orderViewModel = ViewModelProvider(this)[OrderViewModel::class.java] orderViewModel.getWorkOrderDetail(jobId) orderViewModel.detailModel.observe(this) { @@ -154,8 +154,8 @@ override fun observeRequestState() { orderViewModel.loadState.observe(this) { when (it) { - is LoadState.Loading -> LoadingDialogHub.show(this, "数据加载中,请稍后") - else -> LoadingDialogHub.dismiss() + is LoadState.Loading -> LoadingDialog.show(this, "数据加载中,请稍后") + else -> LoadingDialog.dismiss() } } } diff --git a/app/src/main/java/com/casic/app/smartwell/view/OrderInHandleDetailActivity.kt b/app/src/main/java/com/casic/app/smartwell/view/OrderInHandleDetailActivity.kt index d70a979..04a7d5d 100644 --- a/app/src/main/java/com/casic/app/smartwell/view/OrderInHandleDetailActivity.kt +++ b/app/src/main/java/com/casic/app/smartwell/view/OrderInHandleDetailActivity.kt @@ -38,7 +38,7 @@ import com.pengxh.kt.lite.extensions.show import com.pengxh.kt.lite.utils.Constant import com.pengxh.kt.lite.utils.LoadState -import com.pengxh.kt.lite.utils.LoadingDialogHub +import com.pengxh.kt.lite.utils.LoadingDialog import com.pengxh.kt.lite.widget.TitleBarView import com.pengxh.kt.lite.widget.dialog.AlertControlDialog import com.pengxh.kt.lite.widget.dialog.AlertMessageDialog @@ -93,7 +93,7 @@ ) binding.addImageRecyclerView.adapter = imageAdapter - val jobId = intent.getStringExtra(Constant.INTENT_PARAM)!!//初始化图片九宫格 + val jobId = intent.getStringExtra(Constant.INTENT_PARAM_KEY)!!//初始化图片九宫格 orderViewModel.getWorkOrderDetail(jobId) orderViewModel.detailModel.observe(this) { if (it.code == 200) { @@ -312,41 +312,41 @@ override fun observeRequestState() { orderViewModel.loadState.observe(this) { when (it) { - is LoadState.Loading -> LoadingDialogHub.show(this, "数据加载中,请稍后") - else -> LoadingDialogHub.dismiss() + is LoadState.Loading -> LoadingDialog.show(this, "数据加载中,请稍后") + else -> LoadingDialog.dismiss() } } uploadImageViewModel.loadState.observe(this) { when (it) { - LoadState.Loading -> LoadingDialogHub.show(this, "图片上传中,请稍后...") - else -> LoadingDialogHub.dismiss() + LoadState.Loading -> LoadingDialog.show(this, "图片上传中,请稍后...") + else -> LoadingDialog.dismiss() } } //转单状态处理 operationViewModel.loadState.observe(this) { when (it) { - is LoadState.Loading -> LoadingDialogHub.show(this, "转单中,请稍后") + is LoadState.Loading -> LoadingDialog.show(this, "转单中,请稍后") is LoadState.Success -> { - LoadingDialogHub.dismiss() + LoadingDialog.dismiss() this.finish() } - else -> LoadingDialogHub.dismiss() + else -> LoadingDialog.dismiss() } } //处理完成工单状态处理 operationViewModel.loadState.observe(this) { when (it) { - is LoadState.Loading -> LoadingDialogHub.show(this, "处理中,请稍后") + is LoadState.Loading -> LoadingDialog.show(this, "处理中,请稍后") is LoadState.Success -> { - LoadingDialogHub.dismiss() + LoadingDialog.dismiss() this.finish() } - else -> LoadingDialogHub.dismiss() + else -> LoadingDialog.dismiss() } } } diff --git a/app/src/main/java/com/casic/app/smartwell/view/OrderNotConfirmedDetailActivity.kt b/app/src/main/java/com/casic/app/smartwell/view/OrderNotConfirmedDetailActivity.kt index 8e036d2..687ec86 100644 --- a/app/src/main/java/com/casic/app/smartwell/view/OrderNotConfirmedDetailActivity.kt +++ b/app/src/main/java/com/casic/app/smartwell/view/OrderNotConfirmedDetailActivity.kt @@ -36,7 +36,7 @@ import com.pengxh.kt.lite.extensions.show import com.pengxh.kt.lite.utils.Constant import com.pengxh.kt.lite.utils.LoadState -import com.pengxh.kt.lite.utils.LoadingDialogHub +import com.pengxh.kt.lite.utils.LoadingDialog import com.pengxh.kt.lite.widget.TitleBarView import com.pengxh.kt.lite.widget.dialog.AlertControlDialog import com.pengxh.kt.lite.widget.dialog.AlertMessageDialog @@ -80,7 +80,7 @@ } override fun initOnCreate(savedInstanceState: Bundle?) { - val jobId = intent.getStringExtra(Constant.INTENT_PARAM)!! + val jobId = intent.getStringExtra(Constant.INTENT_PARAM_KEY)!! //初始化图片九宫格 //左外边距,左内边距,右内边距,右外边距 val viewWidth = getScreenWidth() - (10 + 10 + 10 + 10).dp2px(this) @@ -263,41 +263,41 @@ //数据加载状态处理 orderViewModel.loadState.observe(this) { when (it) { - is LoadState.Loading -> LoadingDialogHub.show(this, "数据加载中,请稍后") - else -> LoadingDialogHub.dismiss() + is LoadState.Loading -> LoadingDialog.show(this, "数据加载中,请稍后") + else -> LoadingDialog.dismiss() } } uploadImageViewModel.loadState.observe(this) { when (it) { - LoadState.Loading -> LoadingDialogHub.show(this, "图片上传中,请稍后") - else -> LoadingDialogHub.dismiss() + LoadState.Loading -> LoadingDialog.show(this, "图片上传中,请稍后") + else -> LoadingDialog.dismiss() } } //转单状态处理 operationViewModel.loadState.observe(this) { when (it) { - is LoadState.Loading -> LoadingDialogHub.show(this, "转单中,请稍后") + is LoadState.Loading -> LoadingDialog.show(this, "转单中,请稍后") is LoadState.Success -> { - LoadingDialogHub.dismiss() + LoadingDialog.dismiss() this.finish() } - else -> LoadingDialogHub.dismiss() + else -> LoadingDialog.dismiss() } } //确认工单状态处理 operationViewModel.loadState.observe(this) { when (it) { - is LoadState.Loading -> LoadingDialogHub.show(this, "处理中,请稍后") + is LoadState.Loading -> LoadingDialog.show(this, "处理中,请稍后") is LoadState.Success -> { - LoadingDialogHub.dismiss() + LoadingDialog.dismiss() this.finish() } - else -> LoadingDialogHub.dismiss() + else -> LoadingDialog.dismiss() } } } diff --git a/app/src/main/java/com/casic/app/smartwell/view/OrderNotProcessedDetailActivity.kt b/app/src/main/java/com/casic/app/smartwell/view/OrderNotProcessedDetailActivity.kt index d3f22dc..0c97a52 100644 --- a/app/src/main/java/com/casic/app/smartwell/view/OrderNotProcessedDetailActivity.kt +++ b/app/src/main/java/com/casic/app/smartwell/view/OrderNotProcessedDetailActivity.kt @@ -18,7 +18,7 @@ import com.pengxh.kt.lite.extensions.show import com.pengxh.kt.lite.utils.Constant import com.pengxh.kt.lite.utils.LoadState -import com.pengxh.kt.lite.utils.LoadingDialogHub +import com.pengxh.kt.lite.utils.LoadingDialog import com.pengxh.kt.lite.widget.TitleBarView import com.pengxh.kt.lite.widget.dialog.AlertControlDialog import com.pengxh.kt.lite.widget.dialog.AlertMessageDialog @@ -50,7 +50,7 @@ } override fun initOnCreate(savedInstanceState: Bundle?) { - this.jobId = intent.getStringExtra(Constant.INTENT_PARAM)!! + this.jobId = intent.getStringExtra(Constant.INTENT_PARAM_KEY)!! orderViewModel = ViewModelProvider(this)[OrderViewModel::class.java] operationViewModel = ViewModelProvider(this)[OperationViewModel::class.java] wellViewModel = ViewModelProvider(this)[WellViewModel::class.java] @@ -162,21 +162,21 @@ //数据加载状态处理 orderViewModel.loadState.observe(this) { when (it) { - is LoadState.Loading -> LoadingDialogHub.show(this, "数据加载中,请稍后") - else -> LoadingDialogHub.dismiss() + is LoadState.Loading -> LoadingDialog.show(this, "数据加载中,请稍后") + else -> LoadingDialog.dismiss() } } //接单状态处理 operationViewModel.loadState.observe(this) { when (it) { - is LoadState.Loading -> LoadingDialogHub.show(this, "接单中,请稍后") + is LoadState.Loading -> LoadingDialog.show(this, "接单中,请稍后") is LoadState.Success -> { - LoadingDialogHub.dismiss() + LoadingDialog.dismiss() this.finish() } - else -> LoadingDialogHub.dismiss() + else -> LoadingDialog.dismiss() } } } diff --git a/app/src/main/java/com/casic/app/smartwell/view/SearchResultActivity.kt b/app/src/main/java/com/casic/app/smartwell/view/SearchResultActivity.kt index 6a92917..4f3a674 100644 --- a/app/src/main/java/com/casic/app/smartwell/view/SearchResultActivity.kt +++ b/app/src/main/java/com/casic/app/smartwell/view/SearchResultActivity.kt @@ -19,7 +19,7 @@ import com.pengxh.kt.lite.extensions.show import com.pengxh.kt.lite.utils.Constant import com.pengxh.kt.lite.utils.LoadState -import com.pengxh.kt.lite.utils.LoadingDialogHub +import com.pengxh.kt.lite.utils.LoadingDialog import com.pengxh.kt.lite.utils.WeakReferenceHandler import com.pengxh.kt.lite.widget.TitleBarView import com.pengxh.kt.lite.widget.dialog.AlertControlDialog @@ -56,7 +56,7 @@ } override fun initOnCreate(savedInstanceState: Bundle?) { - args = intent.getStringArrayListExtra(Constant.INTENT_PARAM)!! + args = intent.getStringArrayListExtra(Constant.INTENT_PARAM_KEY)!! orderViewModel = ViewModelProvider(this)[OrderViewModel::class.java] operationViewModel = ViewModelProvider(this)[OperationViewModel::class.java] @@ -101,24 +101,24 @@ } } - binding.resultRecyclerView.addItemDecoration( - RecyclerViewItemOffsets(0, 5, 0, 5) + binding.recyclerView.addItemDecoration( + RecyclerViewItemOffsets(0, 7, 0, 7) ) } override fun observeRequestState() { orderViewModel.loadState.observe(this) { when (it) { - is LoadState.Loading -> LoadingDialogHub.show(this, "数据加载中,请稍后") - else -> LoadingDialogHub.dismiss() + is LoadState.Loading -> LoadingDialog.show(this, "数据加载中,请稍后") + else -> LoadingDialog.dismiss() } } //接单状态处理 operationViewModel.loadState.observe(this) { when (it) { - is LoadState.Loading -> LoadingDialogHub.show(this, "接单中,请稍后") + is LoadState.Loading -> LoadingDialog.show(this, "接单中,请稍后") is LoadState.Success -> { - LoadingDialogHub.dismiss() + LoadingDialog.dismiss() //接单成功之后刷新列表 dataBeans.removeAt(clickedPosition) searchResultAdapter.notifyItemRemoved(clickedPosition) @@ -127,7 +127,7 @@ ) } - else -> LoadingDialogHub.dismiss() + else -> LoadingDialog.dismiss() } } } @@ -162,7 +162,7 @@ } else { binding.emptyInclude.emptyView.hide() searchResultAdapter = SearchResultAdapter(this, dataBeans) - binding.resultRecyclerView.adapter = searchResultAdapter + binding.recyclerView.adapter = searchResultAdapter searchResultAdapter.setOnItemClickListener(object : SearchResultAdapter.OnItemClickListener { override fun onClicked(position: Int) { diff --git a/app/src/main/java/com/casic/app/smartwell/view/UnDeployWellActivity.kt b/app/src/main/java/com/casic/app/smartwell/view/UnDeployWellActivity.kt index 7f7cd3c..555c278 100644 --- a/app/src/main/java/com/casic/app/smartwell/view/UnDeployWellActivity.kt +++ b/app/src/main/java/com/casic/app/smartwell/view/UnDeployWellActivity.kt @@ -81,8 +81,8 @@ } } - binding.undeployListView.addItemDecoration( - RecyclerViewItemOffsets(0, 5, 0, 5) + binding.recyclerView.addItemDecoration( + RecyclerViewItemOffsets(0, 7, 0, 7) ) } @@ -147,12 +147,11 @@ } else { item.deep.toString() + "m" } - viewHolder.setText(R.id.wellNameView, item.wellName) + viewHolder.setText(R.id.wellTypeView, item.wellTypeName) .setText(R.id.wellDepthView, "深:${deep}") .setText(R.id.wellCodeView, "点位编号:${item.wellCode}") - .setText(R.id.wellTypeView, "点位类型:${item.wellTypeName}") .setText(R.id.ownerShipView, "权属单位:${item.deptName}") - .setText(R.id.wellLocationView, "点位置:${item.position}") + .setText(R.id.wellLocationView, "点位位置:${item.position}") .setOnClickListener( R.id.operationButton, object : View.OnClickListener { override fun onClick(v: View?) { @@ -185,7 +184,7 @@ ) } } - binding.undeployListView.adapter = unDeployAdapter + binding.recyclerView.adapter = unDeployAdapter unDeployAdapter.setOnItemClickedListener(object : NormalRecyclerAdapter.OnItemClickedListener { override fun onItemClicked(position: Int, t: WellListModel.DataBean.RowsBean) { diff --git a/app/src/main/java/com/casic/app/smartwell/view/WellDetailActivity.kt b/app/src/main/java/com/casic/app/smartwell/view/WellDetailActivity.kt index b50d067..eb8b468 100644 --- a/app/src/main/java/com/casic/app/smartwell/view/WellDetailActivity.kt +++ b/app/src/main/java/com/casic/app/smartwell/view/WellDetailActivity.kt @@ -16,7 +16,7 @@ import com.pengxh.kt.lite.extensions.show import com.pengxh.kt.lite.utils.Constant import com.pengxh.kt.lite.utils.LoadState -import com.pengxh.kt.lite.utils.LoadingDialogHub +import com.pengxh.kt.lite.utils.LoadingDialog import com.pengxh.kt.lite.widget.TitleBarView import com.pengxh.kt.lite.widget.dialog.AlertMessageDialog @@ -44,7 +44,7 @@ } override fun initOnCreate(savedInstanceState: Bundle?) { - val wellId = intent.getStringExtra(Constant.INTENT_PARAM)!! + val wellId = intent.getStringExtra(Constant.INTENT_PARAM_KEY)!! wellViewModel = ViewModelProvider(this)[WellViewModel::class.java] wellViewModel.getWellDetail(wellId) wellViewModel.wellDetailModel.observe(this) { @@ -132,8 +132,8 @@ override fun observeRequestState() { wellViewModel.loadState.observe(this) { when (it) { - is LoadState.Loading -> LoadingDialogHub.show(this, "数据加载中,请稍后") - else -> LoadingDialogHub.dismiss() + is LoadState.Loading -> LoadingDialog.show(this, "数据加载中,请稍后") + else -> LoadingDialog.dismiss() } } } diff --git a/app/src/main/java/com/casic/app/smartwell/view/WellManagementActivity.kt b/app/src/main/java/com/casic/app/smartwell/view/WellManagementActivity.kt index 084da95..457096b 100644 --- a/app/src/main/java/com/casic/app/smartwell/view/WellManagementActivity.kt +++ b/app/src/main/java/com/casic/app/smartwell/view/WellManagementActivity.kt @@ -94,8 +94,8 @@ } } - binding.wellListView.addItemDecoration( - RecyclerViewItemOffsets(0, 5, 0, 5) + binding.recyclerView.addItemDecoration( + RecyclerViewItemOffsets(0, 7, 0, 7) ) } @@ -175,13 +175,12 @@ } else { item.deep.toString() + "m" } - viewHolder.setText(R.id.wellNameView, item.wellName) + viewHolder.setText(R.id.wellTypeView, item.wellTypeName) .setText(R.id.wellStateView, "已${item.bfztName}") .setText(R.id.wellDepthView, "深:${deep}") .setText(R.id.wellCodeView, "点位编号:${item.wellCode}") - .setText(R.id.wellTypeView, "点位类型:${item.wellTypeName}") .setText(R.id.ownerShipView, "权属单位:${item.deptName}") - .setText(R.id.wellLocationView, "点位置:${item.position}") + .setText(R.id.wellLocationView, "点位位置:${item.position}") .setOnClickListener( R.id.navigationButton, object : View.OnClickListener { override fun onClick(v: View?) { @@ -200,7 +199,7 @@ ) } } - binding.wellListView.adapter = wellListAdapter + binding.recyclerView.adapter = wellListAdapter wellListAdapter.setOnItemClickedListener(object : NormalRecyclerAdapter.OnItemClickedListener { override fun onItemClicked(position: Int, t: WellListModel.DataBean.RowsBean) { diff --git a/app/src/main/java/com/casic/app/smartwell/view/WellMonitorActivity.kt b/app/src/main/java/com/casic/app/smartwell/view/WellMonitorActivity.kt index e3573eb..b87bdb7 100644 --- a/app/src/main/java/com/casic/app/smartwell/view/WellMonitorActivity.kt +++ b/app/src/main/java/com/casic/app/smartwell/view/WellMonitorActivity.kt @@ -11,7 +11,7 @@ import com.pengxh.kt.lite.base.KotlinBaseActivity import com.pengxh.kt.lite.utils.Constant import com.pengxh.kt.lite.utils.LoadState -import com.pengxh.kt.lite.utils.LoadingDialogHub +import com.pengxh.kt.lite.utils.LoadingDialog import com.pengxh.kt.lite.widget.TitleBarView class WellMonitorActivity : KotlinBaseActivity() { @@ -36,7 +36,7 @@ } override fun initOnCreate(savedInstanceState: Bundle?) { - val wellId = intent.getStringExtra(Constant.INTENT_PARAM)!! + val wellId = intent.getStringExtra(Constant.INTENT_PARAM_KEY)!! wellViewModel = ViewModelProvider(this)[WellViewModel::class.java] wellViewModel.getMonitorResult(wellId) wellViewModel.monitorModel.observe(this) { @@ -56,8 +56,8 @@ override fun observeRequestState() { wellViewModel.loadState.observe(this) { when (it) { - is LoadState.Loading -> LoadingDialogHub.show(this, "数据加载中,请稍后") - else -> LoadingDialogHub.dismiss() + is LoadState.Loading -> LoadingDialog.show(this, "数据加载中,请稍后") + else -> LoadingDialog.dismiss() } } } diff --git a/app/src/main/java/com/casic/app/smartwell/view/WellOperationActivity.kt b/app/src/main/java/com/casic/app/smartwell/view/WellOperationActivity.kt index 8d333bf..347ebb6 100644 --- a/app/src/main/java/com/casic/app/smartwell/view/WellOperationActivity.kt +++ b/app/src/main/java/com/casic/app/smartwell/view/WellOperationActivity.kt @@ -23,7 +23,7 @@ import com.pengxh.kt.lite.extensions.navigatePageTo import com.pengxh.kt.lite.extensions.show import com.pengxh.kt.lite.utils.LoadState -import com.pengxh.kt.lite.utils.LoadingDialogHub +import com.pengxh.kt.lite.utils.LoadingDialog import com.pengxh.kt.lite.utils.WeakReferenceHandler import com.pengxh.kt.lite.widget.dialog.AlertControlDialog @@ -109,8 +109,8 @@ } } - binding.operationListView.addItemDecoration( - RecyclerViewItemOffsets(0, 5, 0, 5) + binding.recyclerView.addItemDecoration( + RecyclerViewItemOffsets(0, 7, 0, 7) ) } @@ -123,13 +123,13 @@ override fun observeRequestState() { wellViewModel.loadState.observe(this) { when (it) { - is LoadState.Loading -> LoadingDialogHub.show(this, "处理中,请稍后") + is LoadState.Loading -> LoadingDialog.show(this, "处理中,请稍后") is LoadState.Success -> { - LoadingDialogHub.dismiss() + LoadingDialog.dismiss() wellOperationAdapter.notifyItemChanged(clickedPosition) } - else -> LoadingDialogHub.dismiss() + else -> LoadingDialog.dismiss() } } } @@ -203,24 +203,23 @@ if (item.bfztName == "布防") { viewHolder.setImageResource( R.id.wellStateView, R.drawable.bg_solid_text_green_radius_5 - ).setText(R.id.wellStateView, "撤防") + ).setText(R.id.operationButton, "撤防") } else { viewHolder.setImageResource( R.id.wellStateView, R.drawable.bg_solid_text_red_radius_5 - ).setText(R.id.wellStateView, "布防") + ).setText(R.id.operationButton, "布防") } val deep = if (item.deep.toString().isBlank()) { "未知" } else { item.deep.toString() + "m" } - viewHolder.setText(R.id.wellNameView, item.wellName) + viewHolder.setText(R.id.wellTypeView, item.wellTypeName) .setText(R.id.wellStateView, "已${item.bfztName}") .setText(R.id.wellDepthView, "深:${deep}") .setText(R.id.wellCodeView, "点位编号:${item.wellCode}") - .setText(R.id.wellTypeView, "点位类型:${item.wellTypeName}") .setText(R.id.ownerShipView, "权属单位:${item.deptName}") - .setText(R.id.wellLocationView, "点位置:${item.position}") + .setText(R.id.wellLocationView, "点位位置:${item.position}") .setOnClickListener( R.id.operationButton, object : View.OnClickListener { override fun onClick(v: View?) { @@ -280,7 +279,7 @@ ) } } - binding.operationListView.adapter = wellOperationAdapter + binding.recyclerView.adapter = wellOperationAdapter wellOperationAdapter.setOnItemClickedListener(object : NormalRecyclerAdapter.OnItemClickedListener { override fun onItemClicked(position: Int, t: WellListModel.DataBean.RowsBean) { diff --git a/app/src/main/res/drawable/ic_down.xml b/app/src/main/res/drawable/ic_down.xml index 20e6476..6987e6c 100644 --- a/app/src/main/res/drawable/ic_down.xml +++ b/app/src/main/res/drawable/ic_down.xml @@ -1,6 +1,6 @@ + + diff --git a/app/src/main/res/layout/activity_about_us.xml b/app/src/main/res/layout/activity_about_us.xml index 9091a00..d5fbd0d 100644 --- a/app/src/main/res/layout/activity_about_us.xml +++ b/app/src/main/res/layout/activity_about_us.xml @@ -12,13 +12,7 @@ android:layout_width="match_parent" android:layout_height="wrap_content" android:background="@color/mainThemeColor" - app:tbv_left_image="@drawable/ic_title_left" - app:tbv_only_show_title="false" - app:tbv_show_left_image="true" - app:tbv_show_right_image="false" - app:tbv_text="关于我们" - app:tbv_text_color="@color/white" - app:tbv_text_size="@dimen/sp_18" /> + app:tbv_text="关于我们" /> + app:tbv_text="修改密码" /> + app:tbv_text="布防列表" /> + app:tbv_text="帮助中心" /> + app:tbv_text="工单详情" /> + app:tbv_text="工单详情" /> + app:tbv_text="工单详情" /> + app:tbv_text="工单详情" /> + app:tbv_text="超时工单" /> + app:tbv_text="工单查询" /> + app:tbv_text="查询结果" /> + app:tbv_text="撤防列表" /> + app:tbv_text="个人资料" /> + app:tbv_text="点位详情" /> + app:tbv_text="监控内容" /> - + + android:value="ee96d8b5e12de3fbb29949efd57418a8" /> () @@ -150,7 +158,7 @@ val cameraPosition = CameraPosition(centerLatLng, 14f, 0f, 0f) val cameraUpdate = CameraUpdateFactory.newCameraPosition(cameraPosition) withContext(Dispatchers.Main) { - LoadingDialogHub.dismiss() + LoadingDialog.dismiss() aMap.animateCamera(cameraUpdate, 1500, null) } } @@ -239,11 +247,6 @@ } override fun initEvent() { - binding.rightOptionView.setOnClickListener { - val x = binding.rightOptionView.width - easyPopupWindow.width - easyPopupWindow.showAsDropDown(binding.rightOptionView, x, 0) - } - //撤防点位 binding.unDeployedLayout.setOnClickListener { requireContext().navigatePageTo() @@ -263,11 +266,11 @@ override fun observeRequestState() { wellViewModel.loadState.observe(this) { when (it) { - is LoadState.Loading -> LoadingDialogHub.show( + is LoadState.Loading -> LoadingDialog.show( requireActivity(), "数据加载中,请稍后..." ) - else -> LoadingDialogHub.dismiss() + else -> LoadingDialog.dismiss() } } } @@ -376,7 +379,7 @@ }).build().show() } }) - infoPopup.showAsDropDown(binding.rightOptionView) +// infoPopup.showAsDropDown(binding.rightOptionView) } override fun onCameraChange(p0: CameraPosition?) { diff --git a/app/src/main/java/com/casic/app/smartwell/fragment/HomePageNoClusterFragment.kt b/app/src/main/java/com/casic/app/smartwell/fragment/HomePageNoClusterFragment.kt index 802426a..b25f743 100644 --- a/app/src/main/java/com/casic/app/smartwell/fragment/HomePageNoClusterFragment.kt +++ b/app/src/main/java/com/casic/app/smartwell/fragment/HomePageNoClusterFragment.kt @@ -38,8 +38,9 @@ import com.pengxh.kt.lite.extensions.navigatePageTo import com.pengxh.kt.lite.extensions.show import com.pengxh.kt.lite.utils.LoadState -import com.pengxh.kt.lite.utils.LoadingDialogHub +import com.pengxh.kt.lite.utils.LoadingDialog import com.pengxh.kt.lite.widget.EasyPopupWindow +import com.pengxh.kt.lite.widget.TitleBarView import com.pengxh.kt.lite.widget.dialog.AlertControlDialog import kotlinx.coroutines.Dispatchers import kotlinx.coroutines.launch @@ -78,7 +79,15 @@ override fun setupTopBarLayout() { binding.rootView.initImmersionBar(this, false, R.color.mainThemeColor) - binding.titleView.text = "首页" + binding.titleView.setOnClickListener(object : TitleBarView.OnClickListener { + override fun onLeftClick() { + + } + + override fun onRightClick() { + easyPopupWindow.showAsDropDown(binding.titleView, binding.titleView.width, 0) + } + }) } override fun initOnCreate(savedInstanceState: Bundle?) { @@ -112,7 +121,7 @@ //渲染井位置 lifecycleScope.launch(Dispatchers.Main) { - LoadingDialogHub.show(requireActivity(), "数据加载中,请稍后") + LoadingDialog.show(requireActivity(), "数据加载中,请稍后") withContext(Dispatchers.IO) { //取Well缓存 val allMarkerOptions = ArrayList() @@ -144,7 +153,7 @@ val cameraPosition = CameraPosition(centerLatLng, 14f, 0f, 0f) val cameraUpdate = CameraUpdateFactory.newCameraPosition(cameraPosition) withContext(Dispatchers.Main) { - LoadingDialogHub.dismiss() + LoadingDialog.dismiss() aMap.animateCamera(cameraUpdate, 1500, null) } } @@ -238,11 +247,6 @@ } override fun initEvent() { - binding.rightOptionView.setOnClickListener { - val x = binding.rightOptionView.width - easyPopupWindow.width - easyPopupWindow.showAsDropDown(binding.rightOptionView, x, 0) - } - //撤防点位 binding.unDeployedLayout.setOnClickListener { requireContext().navigatePageTo() @@ -262,11 +266,11 @@ override fun observeRequestState() { wellViewModel.loadState.observe(this) { when (it) { - is LoadState.Loading -> LoadingDialogHub.show( + is LoadState.Loading -> LoadingDialog.show( requireActivity(), "数据加载中,请稍后..." ) - else -> LoadingDialogHub.dismiss() + else -> LoadingDialog.dismiss() } } } diff --git a/app/src/main/java/com/casic/app/smartwell/fragment/MinePageFragment.kt b/app/src/main/java/com/casic/app/smartwell/fragment/MinePageFragment.kt index 09a570c..dcb48f8 100644 --- a/app/src/main/java/com/casic/app/smartwell/fragment/MinePageFragment.kt +++ b/app/src/main/java/com/casic/app/smartwell/fragment/MinePageFragment.kt @@ -35,7 +35,7 @@ import com.pengxh.kt.lite.utils.ActivityStackManager import com.pengxh.kt.lite.utils.FileDownloadManager import com.pengxh.kt.lite.utils.LoadState -import com.pengxh.kt.lite.utils.LoadingDialogHub +import com.pengxh.kt.lite.utils.LoadingDialog import com.pengxh.kt.lite.widget.dialog.AlertControlDialog import com.pengxh.kt.lite.widget.dialog.BottomActionSheet import kotlinx.coroutines.Dispatchers @@ -60,7 +60,6 @@ override fun setupTopBarLayout() { binding.rootView.initImmersionBar(this, false, R.color.mainThemeColor) - binding.titleInclude.titleView.text = "我的" } override fun initOnCreate(savedInstanceState: Bundle?) { @@ -155,27 +154,27 @@ override fun observeRequestState() { userViewModel.loadState.observe(this) { when (it) { - is LoadState.Loading -> LoadingDialogHub.show( + is LoadState.Loading -> LoadingDialog.show( requireActivity(), "检查版本中,请稍后" ) - else -> LoadingDialogHub.dismiss() + else -> LoadingDialog.dismiss() } } wellViewModel.loadState.observe(this) { when (it) { - is LoadState.Loading -> LoadingDialogHub.show( + is LoadState.Loading -> LoadingDialog.show( requireActivity(), "数据更新中,请稍后" ) is LoadState.Fail -> { - LoadingDialogHub.dismiss() + LoadingDialog.dismiss() "数据更新超时".show(requireContext()) } else -> { - LoadingDialogHub.dismiss() + LoadingDialog.dismiss() AlertControlDialog.Builder().setContext(requireContext()).setTitle("温馨提示") .setMessage("数据更新成功,请重启应用").setNegativeButton("取消") .setPositiveButton("确定").setOnDialogButtonClickListener(object : @@ -197,17 +196,17 @@ lineViewModel.loadState.observe(this) { when (it) { - is LoadState.Loading -> LoadingDialogHub.show( + is LoadState.Loading -> LoadingDialog.show( requireActivity(), "数据更新中,请稍后" ) is LoadState.Fail -> { - LoadingDialogHub.dismiss() + LoadingDialog.dismiss() "数据更新超时".show(requireContext()) } else -> { - LoadingDialogHub.dismiss() + LoadingDialog.dismiss() AlertControlDialog.Builder().setContext(requireContext()).setTitle("温馨提示") .setMessage("数据更新成功,请重启应用").setNegativeButton("取消") .setPositiveButton("确定").setOnDialogButtonClickListener(object : diff --git a/app/src/main/java/com/casic/app/smartwell/fragment/NoticePageFragment.kt b/app/src/main/java/com/casic/app/smartwell/fragment/NoticePageFragment.kt index 171b555..3c93f54 100644 --- a/app/src/main/java/com/casic/app/smartwell/fragment/NoticePageFragment.kt +++ b/app/src/main/java/com/casic/app/smartwell/fragment/NoticePageFragment.kt @@ -48,7 +48,6 @@ override fun setupTopBarLayout() { binding.rootView.initImmersionBar(this, false, R.color.mainThemeColor) - binding.titleInclude.titleView.text = "消息" } override fun initOnCreate(savedInstanceState: Bundle?) { diff --git a/app/src/main/java/com/casic/app/smartwell/fragment/OrderListFragment.kt b/app/src/main/java/com/casic/app/smartwell/fragment/OrderListFragment.kt index 93ff35b..5e38acb 100644 --- a/app/src/main/java/com/casic/app/smartwell/fragment/OrderListFragment.kt +++ b/app/src/main/java/com/casic/app/smartwell/fragment/OrderListFragment.kt @@ -12,6 +12,7 @@ import com.casic.app.smartwell.view.SearchOrderActivity import com.pengxh.kt.lite.base.KotlinBaseFragment import com.pengxh.kt.lite.extensions.navigatePageTo +import com.pengxh.kt.lite.widget.TitleBarView class OrderListFragment : KotlinBaseFragment() { @@ -25,15 +26,22 @@ } override fun initViewBinding( - inflater: LayoutInflater, - container: ViewGroup? + inflater: LayoutInflater, container: ViewGroup? ): FragmentOrderBinding { return FragmentOrderBinding.inflate(inflater, container, false) } override fun setupTopBarLayout() { binding.rootView.initImmersionBar(this, false, R.color.mainThemeColor) - binding.titleView.text = "工单" + binding.titleView.setOnClickListener(object : TitleBarView.OnClickListener { + override fun onLeftClick() { + + } + + override fun onRightClick() { + requireContext().navigatePageTo() + } + }) } override fun initOnCreate(savedInstanceState: Bundle?) { @@ -51,8 +59,6 @@ } override fun initEvent() { - binding.rightOptionView.setOnClickListener { - requireContext().navigatePageTo() - } + } } \ No newline at end of file diff --git a/app/src/main/java/com/casic/app/smartwell/fragment/OrderNotProcessedFragment.kt b/app/src/main/java/com/casic/app/smartwell/fragment/OrderNotProcessedFragment.kt index 0b3d09d..2b6f21d 100644 --- a/app/src/main/java/com/casic/app/smartwell/fragment/OrderNotProcessedFragment.kt +++ b/app/src/main/java/com/casic/app/smartwell/fragment/OrderNotProcessedFragment.kt @@ -18,7 +18,7 @@ import com.pengxh.kt.lite.extensions.navigatePageTo import com.pengxh.kt.lite.extensions.show import com.pengxh.kt.lite.utils.LoadState -import com.pengxh.kt.lite.utils.LoadingDialogHub +import com.pengxh.kt.lite.utils.LoadingDialog import com.pengxh.kt.lite.utils.WeakReferenceHandler import com.pengxh.kt.lite.widget.dialog.AlertControlDialog @@ -78,8 +78,8 @@ operationViewModel = ViewModelProvider(this)[OperationViewModel::class.java] - binding.notProcessedView.addItemDecoration( - RecyclerViewItemOffsets(0, 5, 0, 5) + binding.recyclerView.addItemDecoration( + RecyclerViewItemOffsets(0, 7, 0, 7) ) } @@ -87,9 +87,9 @@ //接单状态处理 operationViewModel.loadState.observe(this) { when (it) { - is LoadState.Loading -> LoadingDialogHub.show(requireActivity(), "接单中,请稍后") + is LoadState.Loading -> LoadingDialog.show(requireActivity(), "接单中,请稍后") is LoadState.Success -> { - LoadingDialogHub.dismiss() + LoadingDialog.dismiss() //接单成功之后刷新列表 dataBeans.removeAt(clickedPosition) notProcessedAdapter.notifyItemRemoved(clickedPosition) @@ -98,7 +98,7 @@ ) } - else -> LoadingDialogHub.dismiss() + else -> LoadingDialog.dismiss() } } } @@ -131,7 +131,7 @@ } else { binding.emptyInclude.emptyView.hide() notProcessedAdapter = OrderNotProcessedAdapter(requireContext(), dataBeans) - binding.notProcessedView.adapter = notProcessedAdapter + binding.recyclerView.adapter = notProcessedAdapter notProcessedAdapter.setOnItemClickListener(object : OrderNotProcessedAdapter.OnItemClickListener { override fun onClicked(position: Int) { diff --git a/app/src/main/java/com/casic/app/smartwell/fragment/OvertimeNotAcceptFragment.kt b/app/src/main/java/com/casic/app/smartwell/fragment/OvertimeNotAcceptFragment.kt index a198545..9b318ca 100644 --- a/app/src/main/java/com/casic/app/smartwell/fragment/OvertimeNotAcceptFragment.kt +++ b/app/src/main/java/com/casic/app/smartwell/fragment/OvertimeNotAcceptFragment.kt @@ -18,7 +18,7 @@ import com.pengxh.kt.lite.extensions.navigatePageTo import com.pengxh.kt.lite.extensions.show import com.pengxh.kt.lite.utils.LoadState -import com.pengxh.kt.lite.utils.LoadingDialogHub +import com.pengxh.kt.lite.utils.LoadingDialog import com.pengxh.kt.lite.utils.WeakReferenceHandler import com.pengxh.kt.lite.widget.dialog.AlertControlDialog @@ -81,8 +81,8 @@ operationViewModel = ViewModelProvider(this)[OperationViewModel::class.java] - binding.notProcessedView.addItemDecoration( - RecyclerViewItemOffsets(0, 5, 0, 5) + binding.recyclerView.addItemDecoration( + RecyclerViewItemOffsets(0, 7, 0, 7) ) } @@ -90,9 +90,9 @@ //接单状态处理 operationViewModel.loadState.observe(this) { when (it) { - is LoadState.Loading -> LoadingDialogHub.show(requireActivity(), "接单中,请稍后") + is LoadState.Loading -> LoadingDialog.show(requireActivity(), "接单中,请稍后") is LoadState.Success -> { - LoadingDialogHub.dismiss() + LoadingDialog.dismiss() //接单成功之后刷新列表 dataBeans.removeAt(clickedPosition) notProcessedAdapter.notifyItemRemoved(clickedPosition) @@ -101,7 +101,7 @@ ) } - else -> LoadingDialogHub.dismiss() + else -> LoadingDialog.dismiss() } } } @@ -134,7 +134,7 @@ } else { binding.emptyInclude.emptyView.hide() notProcessedAdapter = OrderNotProcessedAdapter(requireContext(), dataBeans) - binding.notProcessedView.adapter = notProcessedAdapter + binding.recyclerView.adapter = notProcessedAdapter notProcessedAdapter.setOnItemClickListener(object : OrderNotProcessedAdapter.OnItemClickListener { override fun onClicked(position: Int) { diff --git a/app/src/main/java/com/casic/app/smartwell/greendao/DaoMaster.java b/app/src/main/java/com/casic/app/smartwell/greendao/DaoMaster.java index fdcf3a7..1e52b74 100644 --- a/app/src/main/java/com/casic/app/smartwell/greendao/DaoMaster.java +++ b/app/src/main/java/com/casic/app/smartwell/greendao/DaoMaster.java @@ -13,25 +13,20 @@ // THIS CODE IS GENERATED BY greenDAO, DO NOT EDIT. - /** * Master of DAO (schema version 4): knows all DAOs. */ public class DaoMaster extends AbstractDaoMaster { public static final int SCHEMA_VERSION = 4; - /** - * Creates underlying database table using DAOs. - */ + /** Creates underlying database table using DAOs. */ public static void createAllTables(Database db, boolean ifNotExists) { MapWellLocalBeanDao.createTable(db, ifNotExists); NoticeLocaleBeanDao.createTable(db, ifNotExists); PipeLocalBeanDao.createTable(db, ifNotExists); } - /** - * Drops underlying database table using DAOs. - */ + /** Drops underlying database table using DAOs. */ public static void dropAllTables(Database db, boolean ifExists) { MapWellLocalBeanDao.dropTable(db, ifExists); NoticeLocaleBeanDao.dropTable(db, ifExists); @@ -86,9 +81,7 @@ } } - /** - * WARNING: Drops all table on Upgrade! Use only during development. - */ + /** WARNING: Drops all table on Upgrade! Use only during development. */ public static class DevOpenHelper extends OpenHelper { public DevOpenHelper(Context context, String name) { super(context, name); diff --git a/app/src/main/java/com/casic/app/smartwell/greendao/DaoSession.java b/app/src/main/java/com/casic/app/smartwell/greendao/DaoSession.java index 0b36d17..3e40e3b 100644 --- a/app/src/main/java/com/casic/app/smartwell/greendao/DaoSession.java +++ b/app/src/main/java/com/casic/app/smartwell/greendao/DaoSession.java @@ -16,7 +16,7 @@ /** * {@inheritDoc} - * + * * @see org.greenrobot.greendao.AbstractDaoSession */ public class DaoSession extends AbstractDaoSession { @@ -50,7 +50,7 @@ registerDao(NoticeLocaleBean.class, noticeLocaleBeanDao); registerDao(PipeLocalBean.class, pipeLocalBeanDao); } - + public void clear() { mapWellLocalBeanDaoConfig.clearIdentityScope(); noticeLocaleBeanDaoConfig.clearIdentityScope(); diff --git a/app/src/main/java/com/casic/app/smartwell/greendao/MapWellLocalBeanDao.java b/app/src/main/java/com/casic/app/smartwell/greendao/MapWellLocalBeanDao.java index 8908fda..407bc92 100644 --- a/app/src/main/java/com/casic/app/smartwell/greendao/MapWellLocalBeanDao.java +++ b/app/src/main/java/com/casic/app/smartwell/greendao/MapWellLocalBeanDao.java @@ -12,10 +12,9 @@ import org.greenrobot.greendao.internal.DaoConfig; // THIS CODE IS GENERATED BY greenDAO, DO NOT EDIT. - -/** +/** * DAO for table "MAP_WELL_LOCAL_BEAN". - */ +*/ public class MapWellLocalBeanDao extends AbstractDao { public static final String TABLENAME = "MAP_WELL_LOCAL_BEAN"; @@ -57,16 +56,14 @@ public MapWellLocalBeanDao(DaoConfig config) { super(config); } - + public MapWellLocalBeanDao(DaoConfig config, DaoSession daoSession) { super(config, daoSession); } - /** - * Creates the underlying database table. - */ + /** Creates the underlying database table. */ public static void createTable(Database db, boolean ifNotExists) { - String constraint = ifNotExists ? "IF NOT EXISTS " : ""; + String constraint = ifNotExists? "IF NOT EXISTS ": ""; db.execSQL("CREATE TABLE " + constraint + "\"MAP_WELL_LOCAL_BEAN\" (" + // "\"_id\" INTEGER PRIMARY KEY AUTOINCREMENT ," + // 0: kId "\"AREA\" TEXT," + // 1: area @@ -96,9 +93,7 @@ "\"WELL_TYPE_NAME\" TEXT);"); // 25: wellTypeName } - /** - * Drops the underlying database table. - */ + /** Drops the underlying database table. */ public static void dropTable(Database db, boolean ifExists) { String sql = "DROP TABLE " + (ifExists ? "IF EXISTS " : "") + "\"MAP_WELL_LOCAL_BEAN\""; db.execSQL(sql); @@ -107,132 +102,132 @@ @Override protected final void bindValues(DatabaseStatement stmt, MapWellLocalBean entity) { stmt.clearBindings(); - + Long kId = entity.getKId(); if (kId != null) { stmt.bindLong(1, kId); } - + String area = entity.getArea(); if (area != null) { stmt.bindString(2, area); } - + String bfzt = entity.getBfzt(); if (bfzt != null) { stmt.bindString(3, bfzt); } - + String bfztName = entity.getBfztName(); if (bfztName != null) { stmt.bindString(4, bfztName); } - + String coordinateX = entity.getCoordinateX(); if (coordinateX != null) { stmt.bindString(5, coordinateX); } - + String coordinateY = entity.getCoordinateY(); if (coordinateY != null) { stmt.bindString(6, coordinateY); } - + String deep = entity.getDeep(); if (deep != null) { stmt.bindString(7, deep); } - + String deptName = entity.getDeptName(); if (deptName != null) { stmt.bindString(8, deptName); } - + String deptid = entity.getDeptid(); if (deptid != null) { stmt.bindString(9, deptid); } - + String id = entity.getId(); if (id != null) { stmt.bindString(10, id); } - + String latBaidu = entity.getLatBaidu(); if (latBaidu != null) { stmt.bindString(11, latBaidu); } - + String latGaode = entity.getLatGaode(); if (latGaode != null) { stmt.bindString(12, latGaode); } - + String lngBaidu = entity.getLngBaidu(); if (lngBaidu != null) { stmt.bindString(13, lngBaidu); } - + String lngGaode = entity.getLngGaode(); if (lngGaode != null) { stmt.bindString(14, lngGaode); } - + String notes = entity.getNotes(); if (notes != null) { stmt.bindString(15, notes); } - + String photos = entity.getPhotos(); if (photos != null) { stmt.bindString(16, photos); } - + String position = entity.getPosition(); if (position != null) { stmt.bindString(17, position); } - + String staff = entity.getStaff(); if (staff != null) { stmt.bindString(18, staff); } - + String tel = entity.getTel(); if (tel != null) { stmt.bindString(19, tel); } - + String ts = entity.getTs(); if (ts != null) { stmt.bindString(20, ts); } - + String valid = entity.getValid(); if (valid != null) { stmt.bindString(21, valid); } - + String watchData = entity.getWatchData(); if (watchData != null) { stmt.bindString(22, watchData); } - + String wellCode = entity.getWellCode(); if (wellCode != null) { stmt.bindString(23, wellCode); } - + String wellName = entity.getWellName(); if (wellName != null) { stmt.bindString(24, wellName); } - + String wellType = entity.getWellType(); if (wellType != null) { stmt.bindString(25, wellType); } - + String wellTypeName = entity.getWellTypeName(); if (wellTypeName != null) { stmt.bindString(26, wellTypeName); @@ -242,132 +237,132 @@ @Override protected final void bindValues(SQLiteStatement stmt, MapWellLocalBean entity) { stmt.clearBindings(); - + Long kId = entity.getKId(); if (kId != null) { stmt.bindLong(1, kId); } - + String area = entity.getArea(); if (area != null) { stmt.bindString(2, area); } - + String bfzt = entity.getBfzt(); if (bfzt != null) { stmt.bindString(3, bfzt); } - + String bfztName = entity.getBfztName(); if (bfztName != null) { stmt.bindString(4, bfztName); } - + String coordinateX = entity.getCoordinateX(); if (coordinateX != null) { stmt.bindString(5, coordinateX); } - + String coordinateY = entity.getCoordinateY(); if (coordinateY != null) { stmt.bindString(6, coordinateY); } - + String deep = entity.getDeep(); if (deep != null) { stmt.bindString(7, deep); } - + String deptName = entity.getDeptName(); if (deptName != null) { stmt.bindString(8, deptName); } - + String deptid = entity.getDeptid(); if (deptid != null) { stmt.bindString(9, deptid); } - + String id = entity.getId(); if (id != null) { stmt.bindString(10, id); } - + String latBaidu = entity.getLatBaidu(); if (latBaidu != null) { stmt.bindString(11, latBaidu); } - + String latGaode = entity.getLatGaode(); if (latGaode != null) { stmt.bindString(12, latGaode); } - + String lngBaidu = entity.getLngBaidu(); if (lngBaidu != null) { stmt.bindString(13, lngBaidu); } - + String lngGaode = entity.getLngGaode(); if (lngGaode != null) { stmt.bindString(14, lngGaode); } - + String notes = entity.getNotes(); if (notes != null) { stmt.bindString(15, notes); } - + String photos = entity.getPhotos(); if (photos != null) { stmt.bindString(16, photos); } - + String position = entity.getPosition(); if (position != null) { stmt.bindString(17, position); } - + String staff = entity.getStaff(); if (staff != null) { stmt.bindString(18, staff); } - + String tel = entity.getTel(); if (tel != null) { stmt.bindString(19, tel); } - + String ts = entity.getTs(); if (ts != null) { stmt.bindString(20, ts); } - + String valid = entity.getValid(); if (valid != null) { stmt.bindString(21, valid); } - + String watchData = entity.getWatchData(); if (watchData != null) { stmt.bindString(22, watchData); } - + String wellCode = entity.getWellCode(); if (wellCode != null) { stmt.bindString(23, wellCode); } - + String wellName = entity.getWellName(); if (wellName != null) { stmt.bindString(24, wellName); } - + String wellType = entity.getWellType(); if (wellType != null) { stmt.bindString(25, wellType); } - + String wellTypeName = entity.getWellTypeName(); if (wellTypeName != null) { stmt.bindString(26, wellTypeName); @@ -377,41 +372,41 @@ @Override public Long readKey(Cursor cursor, int offset) { return cursor.isNull(offset + 0) ? null : cursor.getLong(offset + 0); - } + } @Override public MapWellLocalBean readEntity(Cursor cursor, int offset) { MapWellLocalBean entity = new MapWellLocalBean( // - cursor.isNull(offset + 0) ? null : cursor.getLong(offset + 0), // kId - cursor.isNull(offset + 1) ? null : cursor.getString(offset + 1), // area - cursor.isNull(offset + 2) ? null : cursor.getString(offset + 2), // bfzt - cursor.isNull(offset + 3) ? null : cursor.getString(offset + 3), // bfztName - cursor.isNull(offset + 4) ? null : cursor.getString(offset + 4), // coordinateX - cursor.isNull(offset + 5) ? null : cursor.getString(offset + 5), // coordinateY - cursor.isNull(offset + 6) ? null : cursor.getString(offset + 6), // deep - cursor.isNull(offset + 7) ? null : cursor.getString(offset + 7), // deptName - cursor.isNull(offset + 8) ? null : cursor.getString(offset + 8), // deptid - cursor.isNull(offset + 9) ? null : cursor.getString(offset + 9), // id - cursor.isNull(offset + 10) ? null : cursor.getString(offset + 10), // latBaidu - cursor.isNull(offset + 11) ? null : cursor.getString(offset + 11), // latGaode - cursor.isNull(offset + 12) ? null : cursor.getString(offset + 12), // lngBaidu - cursor.isNull(offset + 13) ? null : cursor.getString(offset + 13), // lngGaode - cursor.isNull(offset + 14) ? null : cursor.getString(offset + 14), // notes - cursor.isNull(offset + 15) ? null : cursor.getString(offset + 15), // photos - cursor.isNull(offset + 16) ? null : cursor.getString(offset + 16), // position - cursor.isNull(offset + 17) ? null : cursor.getString(offset + 17), // staff - cursor.isNull(offset + 18) ? null : cursor.getString(offset + 18), // tel - cursor.isNull(offset + 19) ? null : cursor.getString(offset + 19), // ts - cursor.isNull(offset + 20) ? null : cursor.getString(offset + 20), // valid - cursor.isNull(offset + 21) ? null : cursor.getString(offset + 21), // watchData - cursor.isNull(offset + 22) ? null : cursor.getString(offset + 22), // wellCode - cursor.isNull(offset + 23) ? null : cursor.getString(offset + 23), // wellName - cursor.isNull(offset + 24) ? null : cursor.getString(offset + 24), // wellType - cursor.isNull(offset + 25) ? null : cursor.getString(offset + 25) // wellTypeName + cursor.isNull(offset + 0) ? null : cursor.getLong(offset + 0), // kId + cursor.isNull(offset + 1) ? null : cursor.getString(offset + 1), // area + cursor.isNull(offset + 2) ? null : cursor.getString(offset + 2), // bfzt + cursor.isNull(offset + 3) ? null : cursor.getString(offset + 3), // bfztName + cursor.isNull(offset + 4) ? null : cursor.getString(offset + 4), // coordinateX + cursor.isNull(offset + 5) ? null : cursor.getString(offset + 5), // coordinateY + cursor.isNull(offset + 6) ? null : cursor.getString(offset + 6), // deep + cursor.isNull(offset + 7) ? null : cursor.getString(offset + 7), // deptName + cursor.isNull(offset + 8) ? null : cursor.getString(offset + 8), // deptid + cursor.isNull(offset + 9) ? null : cursor.getString(offset + 9), // id + cursor.isNull(offset + 10) ? null : cursor.getString(offset + 10), // latBaidu + cursor.isNull(offset + 11) ? null : cursor.getString(offset + 11), // latGaode + cursor.isNull(offset + 12) ? null : cursor.getString(offset + 12), // lngBaidu + cursor.isNull(offset + 13) ? null : cursor.getString(offset + 13), // lngGaode + cursor.isNull(offset + 14) ? null : cursor.getString(offset + 14), // notes + cursor.isNull(offset + 15) ? null : cursor.getString(offset + 15), // photos + cursor.isNull(offset + 16) ? null : cursor.getString(offset + 16), // position + cursor.isNull(offset + 17) ? null : cursor.getString(offset + 17), // staff + cursor.isNull(offset + 18) ? null : cursor.getString(offset + 18), // tel + cursor.isNull(offset + 19) ? null : cursor.getString(offset + 19), // ts + cursor.isNull(offset + 20) ? null : cursor.getString(offset + 20), // valid + cursor.isNull(offset + 21) ? null : cursor.getString(offset + 21), // watchData + cursor.isNull(offset + 22) ? null : cursor.getString(offset + 22), // wellCode + cursor.isNull(offset + 23) ? null : cursor.getString(offset + 23), // wellName + cursor.isNull(offset + 24) ? null : cursor.getString(offset + 24), // wellType + cursor.isNull(offset + 25) ? null : cursor.getString(offset + 25) // wellTypeName ); return entity; } - + @Override public void readEntity(Cursor cursor, MapWellLocalBean entity, int offset) { entity.setKId(cursor.isNull(offset + 0) ? null : cursor.getLong(offset + 0)); @@ -440,17 +435,17 @@ entity.setWellName(cursor.isNull(offset + 23) ? null : cursor.getString(offset + 23)); entity.setWellType(cursor.isNull(offset + 24) ? null : cursor.getString(offset + 24)); entity.setWellTypeName(cursor.isNull(offset + 25) ? null : cursor.getString(offset + 25)); - } - + } + @Override protected final Long updateKeyAfterInsert(MapWellLocalBean entity, long rowId) { entity.setKId(rowId); return rowId; } - + @Override public Long getKey(MapWellLocalBean entity) { - if (entity != null) { + if(entity != null) { return entity.getKId(); } else { return null; @@ -466,5 +461,5 @@ protected final boolean isEntityUpdateable() { return true; } - + } diff --git a/app/src/main/java/com/casic/app/smartwell/greendao/NoticeLocaleBeanDao.java b/app/src/main/java/com/casic/app/smartwell/greendao/NoticeLocaleBeanDao.java index 64312ed..deb2d49 100644 --- a/app/src/main/java/com/casic/app/smartwell/greendao/NoticeLocaleBeanDao.java +++ b/app/src/main/java/com/casic/app/smartwell/greendao/NoticeLocaleBeanDao.java @@ -12,10 +12,9 @@ import org.greenrobot.greendao.internal.DaoConfig; // THIS CODE IS GENERATED BY greenDAO, DO NOT EDIT. - -/** +/** * DAO for table "NOTICE_LOCALE_BEAN". - */ +*/ public class NoticeLocaleBeanDao extends AbstractDao { public static final String TABLENAME = "NOTICE_LOCALE_BEAN"; @@ -43,16 +42,14 @@ public NoticeLocaleBeanDao(DaoConfig config) { super(config); } - + public NoticeLocaleBeanDao(DaoConfig config, DaoSession daoSession) { super(config, daoSession); } - /** - * Creates the underlying database table. - */ + /** Creates the underlying database table. */ public static void createTable(Database db, boolean ifNotExists) { - String constraint = ifNotExists ? "IF NOT EXISTS " : ""; + String constraint = ifNotExists? "IF NOT EXISTS ": ""; db.execSQL("CREATE TABLE " + constraint + "\"NOTICE_LOCALE_BEAN\" (" + // "\"_id\" INTEGER PRIMARY KEY AUTOINCREMENT ," + // 0: id "\"MESSAGE_ID\" TEXT UNIQUE ," + // 1: messageId @@ -68,9 +65,7 @@ "\"NOTICE_TIME\" TEXT);"); // 11: noticeTime } - /** - * Drops the underlying database table. - */ + /** Drops the underlying database table. */ public static void dropTable(Database db, boolean ifExists) { String sql = "DROP TABLE " + (ifExists ? "IF EXISTS " : "") + "\"NOTICE_LOCALE_BEAN\""; db.execSQL(sql); @@ -79,62 +74,62 @@ @Override protected final void bindValues(DatabaseStatement stmt, NoticeLocaleBean entity) { stmt.clearBindings(); - + Long id = entity.getId(); if (id != null) { stmt.bindLong(1, id); } - + String messageId = entity.getMessageId(); if (messageId != null) { stmt.bindString(2, messageId); } - + String appid = entity.getAppid(); if (appid != null) { stmt.bindString(3, appid); } - + String clientId = entity.getClientId(); if (clientId != null) { stmt.bindString(4, clientId); } - + String taskId = entity.getTaskId(); if (taskId != null) { stmt.bindString(5, taskId); } - + String userId = entity.getUserId(); if (userId != null) { stmt.bindString(6, userId); } - + String title = entity.getTitle(); if (title != null) { stmt.bindString(7, title); } - + String content = entity.getContent(); if (content != null) { stmt.bindString(8, content); } - + String deviceCode = entity.getDeviceCode(); if (deviceCode != null) { stmt.bindString(9, deviceCode); } - + String jobId = entity.getJobId(); if (jobId != null) { stmt.bindString(10, jobId); } - + String isRead = entity.getIsRead(); if (isRead != null) { stmt.bindString(11, isRead); } - + String noticeTime = entity.getNoticeTime(); if (noticeTime != null) { stmt.bindString(12, noticeTime); @@ -144,62 +139,62 @@ @Override protected final void bindValues(SQLiteStatement stmt, NoticeLocaleBean entity) { stmt.clearBindings(); - + Long id = entity.getId(); if (id != null) { stmt.bindLong(1, id); } - + String messageId = entity.getMessageId(); if (messageId != null) { stmt.bindString(2, messageId); } - + String appid = entity.getAppid(); if (appid != null) { stmt.bindString(3, appid); } - + String clientId = entity.getClientId(); if (clientId != null) { stmt.bindString(4, clientId); } - + String taskId = entity.getTaskId(); if (taskId != null) { stmt.bindString(5, taskId); } - + String userId = entity.getUserId(); if (userId != null) { stmt.bindString(6, userId); } - + String title = entity.getTitle(); if (title != null) { stmt.bindString(7, title); } - + String content = entity.getContent(); if (content != null) { stmt.bindString(8, content); } - + String deviceCode = entity.getDeviceCode(); if (deviceCode != null) { stmt.bindString(9, deviceCode); } - + String jobId = entity.getJobId(); if (jobId != null) { stmt.bindString(10, jobId); } - + String isRead = entity.getIsRead(); if (isRead != null) { stmt.bindString(11, isRead); } - + String noticeTime = entity.getNoticeTime(); if (noticeTime != null) { stmt.bindString(12, noticeTime); @@ -209,27 +204,27 @@ @Override public Long readKey(Cursor cursor, int offset) { return cursor.isNull(offset + 0) ? null : cursor.getLong(offset + 0); - } + } @Override public NoticeLocaleBean readEntity(Cursor cursor, int offset) { NoticeLocaleBean entity = new NoticeLocaleBean( // - cursor.isNull(offset + 0) ? null : cursor.getLong(offset + 0), // id - cursor.isNull(offset + 1) ? null : cursor.getString(offset + 1), // messageId - cursor.isNull(offset + 2) ? null : cursor.getString(offset + 2), // appid - cursor.isNull(offset + 3) ? null : cursor.getString(offset + 3), // clientId - cursor.isNull(offset + 4) ? null : cursor.getString(offset + 4), // taskId - cursor.isNull(offset + 5) ? null : cursor.getString(offset + 5), // userId - cursor.isNull(offset + 6) ? null : cursor.getString(offset + 6), // title - cursor.isNull(offset + 7) ? null : cursor.getString(offset + 7), // content - cursor.isNull(offset + 8) ? null : cursor.getString(offset + 8), // deviceCode - cursor.isNull(offset + 9) ? null : cursor.getString(offset + 9), // jobId - cursor.isNull(offset + 10) ? null : cursor.getString(offset + 10), // isRead - cursor.isNull(offset + 11) ? null : cursor.getString(offset + 11) // noticeTime + cursor.isNull(offset + 0) ? null : cursor.getLong(offset + 0), // id + cursor.isNull(offset + 1) ? null : cursor.getString(offset + 1), // messageId + cursor.isNull(offset + 2) ? null : cursor.getString(offset + 2), // appid + cursor.isNull(offset + 3) ? null : cursor.getString(offset + 3), // clientId + cursor.isNull(offset + 4) ? null : cursor.getString(offset + 4), // taskId + cursor.isNull(offset + 5) ? null : cursor.getString(offset + 5), // userId + cursor.isNull(offset + 6) ? null : cursor.getString(offset + 6), // title + cursor.isNull(offset + 7) ? null : cursor.getString(offset + 7), // content + cursor.isNull(offset + 8) ? null : cursor.getString(offset + 8), // deviceCode + cursor.isNull(offset + 9) ? null : cursor.getString(offset + 9), // jobId + cursor.isNull(offset + 10) ? null : cursor.getString(offset + 10), // isRead + cursor.isNull(offset + 11) ? null : cursor.getString(offset + 11) // noticeTime ); return entity; } - + @Override public void readEntity(Cursor cursor, NoticeLocaleBean entity, int offset) { entity.setId(cursor.isNull(offset + 0) ? null : cursor.getLong(offset + 0)); @@ -244,17 +239,17 @@ entity.setJobId(cursor.isNull(offset + 9) ? null : cursor.getString(offset + 9)); entity.setIsRead(cursor.isNull(offset + 10) ? null : cursor.getString(offset + 10)); entity.setNoticeTime(cursor.isNull(offset + 11) ? null : cursor.getString(offset + 11)); - } - + } + @Override protected final Long updateKeyAfterInsert(NoticeLocaleBean entity, long rowId) { entity.setId(rowId); return rowId; } - + @Override public Long getKey(NoticeLocaleBean entity) { - if (entity != null) { + if(entity != null) { return entity.getId(); } else { return null; @@ -270,5 +265,5 @@ protected final boolean isEntityUpdateable() { return true; } - + } diff --git a/app/src/main/java/com/casic/app/smartwell/greendao/PipeLocalBeanDao.java b/app/src/main/java/com/casic/app/smartwell/greendao/PipeLocalBeanDao.java index aab4d3f..df5515a 100644 --- a/app/src/main/java/com/casic/app/smartwell/greendao/PipeLocalBeanDao.java +++ b/app/src/main/java/com/casic/app/smartwell/greendao/PipeLocalBeanDao.java @@ -12,10 +12,9 @@ import org.greenrobot.greendao.internal.DaoConfig; // THIS CODE IS GENERATED BY greenDAO, DO NOT EDIT. - -/** +/** * DAO for table "PIPE_LOCAL_BEAN". - */ +*/ public class PipeLocalBeanDao extends AbstractDao { public static final String TABLENAME = "PIPE_LOCAL_BEAN"; @@ -37,16 +36,14 @@ public PipeLocalBeanDao(DaoConfig config) { super(config); } - + public PipeLocalBeanDao(DaoConfig config, DaoSession daoSession) { super(config, daoSession); } - /** - * Creates the underlying database table. - */ + /** Creates the underlying database table. */ public static void createTable(Database db, boolean ifNotExists) { - String constraint = ifNotExists ? "IF NOT EXISTS " : ""; + String constraint = ifNotExists? "IF NOT EXISTS ": ""; db.execSQL("CREATE TABLE " + constraint + "\"PIPE_LOCAL_BEAN\" (" + // "\"_id\" INTEGER PRIMARY KEY AUTOINCREMENT ," + // 0: id "\"PIPE_CODE\" TEXT," + // 1: pipeCode @@ -56,9 +53,7 @@ "\"START_LONGITUDE_GD\" TEXT);"); // 5: startLongitudeGd } - /** - * Drops the underlying database table. - */ + /** Drops the underlying database table. */ public static void dropTable(Database db, boolean ifExists) { String sql = "DROP TABLE " + (ifExists ? "IF EXISTS " : "") + "\"PIPE_LOCAL_BEAN\""; db.execSQL(sql); @@ -67,32 +62,32 @@ @Override protected final void bindValues(DatabaseStatement stmt, PipeLocalBean entity) { stmt.clearBindings(); - + Long id = entity.getId(); if (id != null) { stmt.bindLong(1, id); } - + String pipeCode = entity.getPipeCode(); if (pipeCode != null) { stmt.bindString(2, pipeCode); } - + String endLatitudeGd = entity.getEndLatitudeGd(); if (endLatitudeGd != null) { stmt.bindString(3, endLatitudeGd); } - + String endLongitudeGd = entity.getEndLongitudeGd(); if (endLongitudeGd != null) { stmt.bindString(4, endLongitudeGd); } - + String startLatitudeGd = entity.getStartLatitudeGd(); if (startLatitudeGd != null) { stmt.bindString(5, startLatitudeGd); } - + String startLongitudeGd = entity.getStartLongitudeGd(); if (startLongitudeGd != null) { stmt.bindString(6, startLongitudeGd); @@ -102,32 +97,32 @@ @Override protected final void bindValues(SQLiteStatement stmt, PipeLocalBean entity) { stmt.clearBindings(); - + Long id = entity.getId(); if (id != null) { stmt.bindLong(1, id); } - + String pipeCode = entity.getPipeCode(); if (pipeCode != null) { stmt.bindString(2, pipeCode); } - + String endLatitudeGd = entity.getEndLatitudeGd(); if (endLatitudeGd != null) { stmt.bindString(3, endLatitudeGd); } - + String endLongitudeGd = entity.getEndLongitudeGd(); if (endLongitudeGd != null) { stmt.bindString(4, endLongitudeGd); } - + String startLatitudeGd = entity.getStartLatitudeGd(); if (startLatitudeGd != null) { stmt.bindString(5, startLatitudeGd); } - + String startLongitudeGd = entity.getStartLongitudeGd(); if (startLongitudeGd != null) { stmt.bindString(6, startLongitudeGd); @@ -137,21 +132,21 @@ @Override public Long readKey(Cursor cursor, int offset) { return cursor.isNull(offset + 0) ? null : cursor.getLong(offset + 0); - } + } @Override public PipeLocalBean readEntity(Cursor cursor, int offset) { PipeLocalBean entity = new PipeLocalBean( // - cursor.isNull(offset + 0) ? null : cursor.getLong(offset + 0), // id - cursor.isNull(offset + 1) ? null : cursor.getString(offset + 1), // pipeCode - cursor.isNull(offset + 2) ? null : cursor.getString(offset + 2), // endLatitudeGd - cursor.isNull(offset + 3) ? null : cursor.getString(offset + 3), // endLongitudeGd - cursor.isNull(offset + 4) ? null : cursor.getString(offset + 4), // startLatitudeGd - cursor.isNull(offset + 5) ? null : cursor.getString(offset + 5) // startLongitudeGd + cursor.isNull(offset + 0) ? null : cursor.getLong(offset + 0), // id + cursor.isNull(offset + 1) ? null : cursor.getString(offset + 1), // pipeCode + cursor.isNull(offset + 2) ? null : cursor.getString(offset + 2), // endLatitudeGd + cursor.isNull(offset + 3) ? null : cursor.getString(offset + 3), // endLongitudeGd + cursor.isNull(offset + 4) ? null : cursor.getString(offset + 4), // startLatitudeGd + cursor.isNull(offset + 5) ? null : cursor.getString(offset + 5) // startLongitudeGd ); return entity; } - + @Override public void readEntity(Cursor cursor, PipeLocalBean entity, int offset) { entity.setId(cursor.isNull(offset + 0) ? null : cursor.getLong(offset + 0)); @@ -160,17 +155,17 @@ entity.setEndLongitudeGd(cursor.isNull(offset + 3) ? null : cursor.getString(offset + 3)); entity.setStartLatitudeGd(cursor.isNull(offset + 4) ? null : cursor.getString(offset + 4)); entity.setStartLongitudeGd(cursor.isNull(offset + 5) ? null : cursor.getString(offset + 5)); - } - + } + @Override protected final Long updateKeyAfterInsert(PipeLocalBean entity, long rowId) { entity.setId(rowId); return rowId; } - + @Override public Long getKey(PipeLocalBean entity) { - if (entity != null) { + if(entity != null) { return entity.getId(); } else { return null; @@ -186,5 +181,5 @@ protected final boolean isEntityUpdateable() { return true; } - + } diff --git a/app/src/main/java/com/casic/app/smartwell/view/ChangePasswordActivity.kt b/app/src/main/java/com/casic/app/smartwell/view/ChangePasswordActivity.kt index 8e41039..9f1dd40 100644 --- a/app/src/main/java/com/casic/app/smartwell/view/ChangePasswordActivity.kt +++ b/app/src/main/java/com/casic/app/smartwell/view/ChangePasswordActivity.kt @@ -14,7 +14,7 @@ import com.pengxh.kt.lite.extensions.show import com.pengxh.kt.lite.utils.ActivityStackManager import com.pengxh.kt.lite.utils.LoadState -import com.pengxh.kt.lite.utils.LoadingDialogHub +import com.pengxh.kt.lite.utils.LoadingDialog import com.pengxh.kt.lite.widget.TitleBarView import java.nio.charset.StandardCharsets @@ -46,15 +46,15 @@ override fun observeRequestState() { userViewModel.loadState.observe(this) { when (it) { - is LoadState.Loading -> LoadingDialogHub.show(this, "修改中,请稍后") + is LoadState.Loading -> LoadingDialog.show(this, "修改中,请稍后") is LoadState.Success -> { - LoadingDialogHub.dismiss() + LoadingDialog.dismiss() AuthenticationHelper.removeToken() this.navigatePageTo() ActivityStackManager.finishAllActivity() } - else -> LoadingDialogHub.dismiss() + else -> LoadingDialog.dismiss() } } } diff --git a/app/src/main/java/com/casic/app/smartwell/view/DeployedWellActivity.kt b/app/src/main/java/com/casic/app/smartwell/view/DeployedWellActivity.kt index fb4339c..28a5078 100644 --- a/app/src/main/java/com/casic/app/smartwell/view/DeployedWellActivity.kt +++ b/app/src/main/java/com/casic/app/smartwell/view/DeployedWellActivity.kt @@ -83,8 +83,8 @@ } //添加分割线 - binding.deployedListView.addItemDecoration( - RecyclerViewItemOffsets(0, 5, 0, 5) + binding.recyclerView.addItemDecoration( + RecyclerViewItemOffsets(0, 7, 0, 7) ) } @@ -149,12 +149,11 @@ } else { item.deep.toString() + "m" } - viewHolder.setText(R.id.wellNameView, item.wellName) + viewHolder.setText(R.id.wellTypeView, item.wellTypeName) .setText(R.id.wellDepthView, "深:${deep}") .setText(R.id.wellCodeView, "点位编号:${item.wellCode}") - .setText(R.id.wellTypeView, "点位类型:${item.wellTypeName}") .setText(R.id.ownerShipView, "权属单位:${item.deptName}") - .setText(R.id.wellLocationView, "点位置:${item.position}") + .setText(R.id.wellLocationView, "点位位置:${item.position}") .setOnClickListener( R.id.operationButton, object : View.OnClickListener { override fun onClick(v: View?) { @@ -207,7 +206,7 @@ }) } } - binding.deployedListView.adapter = deployAdapter + binding.recyclerView.adapter = deployAdapter deployAdapter.setOnItemClickedListener(object : NormalRecyclerAdapter.OnItemClickedListener { override fun onItemClicked(position: Int, t: WellListModel.DataBean.RowsBean) { diff --git a/app/src/main/java/com/casic/app/smartwell/view/LoginActivity.kt b/app/src/main/java/com/casic/app/smartwell/view/LoginActivity.kt index e4bb0e3..834527b 100644 --- a/app/src/main/java/com/casic/app/smartwell/view/LoginActivity.kt +++ b/app/src/main/java/com/casic/app/smartwell/view/LoginActivity.kt @@ -21,7 +21,7 @@ import com.pengxh.kt.lite.extensions.navigatePageTo import com.pengxh.kt.lite.extensions.readAssetsFile import com.pengxh.kt.lite.extensions.show -import com.pengxh.kt.lite.utils.LoadingDialogHub +import com.pengxh.kt.lite.utils.LoadingDialog import com.pengxh.kt.lite.utils.SaveKeyValues import kotlinx.coroutines.Dispatchers import kotlinx.coroutines.launch @@ -106,11 +106,11 @@ override fun observeRequestState() { authenticateViewModel.loadState.observe(this) { - LoadingDialogHub.show(this, "登录中,请稍后") + LoadingDialog.show(this, "登录中,请稍后") } loginViewModel.loadState.observe(this) { - LoadingDialogHub.dismiss() + LoadingDialog.dismiss() } } diff --git a/app/src/main/java/com/casic/app/smartwell/view/OrderCompletedDetailActivity.kt b/app/src/main/java/com/casic/app/smartwell/view/OrderCompletedDetailActivity.kt index db8ad1f..75cd905 100644 --- a/app/src/main/java/com/casic/app/smartwell/view/OrderCompletedDetailActivity.kt +++ b/app/src/main/java/com/casic/app/smartwell/view/OrderCompletedDetailActivity.kt @@ -17,7 +17,7 @@ import com.pengxh.kt.lite.extensions.show import com.pengxh.kt.lite.utils.Constant import com.pengxh.kt.lite.utils.LoadState -import com.pengxh.kt.lite.utils.LoadingDialogHub +import com.pengxh.kt.lite.utils.LoadingDialog import com.pengxh.kt.lite.widget.TitleBarView import com.pengxh.kt.lite.widget.dialog.AlertMessageDialog @@ -44,7 +44,7 @@ } override fun initOnCreate(savedInstanceState: Bundle?) { - val jobId = intent.getStringExtra(Constant.INTENT_PARAM)!! + val jobId = intent.getStringExtra(Constant.INTENT_PARAM_KEY)!! orderViewModel = ViewModelProvider(this)[OrderViewModel::class.java] orderViewModel.getWorkOrderDetail(jobId) orderViewModel.detailModel.observe(this) { @@ -154,8 +154,8 @@ override fun observeRequestState() { orderViewModel.loadState.observe(this) { when (it) { - is LoadState.Loading -> LoadingDialogHub.show(this, "数据加载中,请稍后") - else -> LoadingDialogHub.dismiss() + is LoadState.Loading -> LoadingDialog.show(this, "数据加载中,请稍后") + else -> LoadingDialog.dismiss() } } } diff --git a/app/src/main/java/com/casic/app/smartwell/view/OrderInHandleDetailActivity.kt b/app/src/main/java/com/casic/app/smartwell/view/OrderInHandleDetailActivity.kt index d70a979..04a7d5d 100644 --- a/app/src/main/java/com/casic/app/smartwell/view/OrderInHandleDetailActivity.kt +++ b/app/src/main/java/com/casic/app/smartwell/view/OrderInHandleDetailActivity.kt @@ -38,7 +38,7 @@ import com.pengxh.kt.lite.extensions.show import com.pengxh.kt.lite.utils.Constant import com.pengxh.kt.lite.utils.LoadState -import com.pengxh.kt.lite.utils.LoadingDialogHub +import com.pengxh.kt.lite.utils.LoadingDialog import com.pengxh.kt.lite.widget.TitleBarView import com.pengxh.kt.lite.widget.dialog.AlertControlDialog import com.pengxh.kt.lite.widget.dialog.AlertMessageDialog @@ -93,7 +93,7 @@ ) binding.addImageRecyclerView.adapter = imageAdapter - val jobId = intent.getStringExtra(Constant.INTENT_PARAM)!!//初始化图片九宫格 + val jobId = intent.getStringExtra(Constant.INTENT_PARAM_KEY)!!//初始化图片九宫格 orderViewModel.getWorkOrderDetail(jobId) orderViewModel.detailModel.observe(this) { if (it.code == 200) { @@ -312,41 +312,41 @@ override fun observeRequestState() { orderViewModel.loadState.observe(this) { when (it) { - is LoadState.Loading -> LoadingDialogHub.show(this, "数据加载中,请稍后") - else -> LoadingDialogHub.dismiss() + is LoadState.Loading -> LoadingDialog.show(this, "数据加载中,请稍后") + else -> LoadingDialog.dismiss() } } uploadImageViewModel.loadState.observe(this) { when (it) { - LoadState.Loading -> LoadingDialogHub.show(this, "图片上传中,请稍后...") - else -> LoadingDialogHub.dismiss() + LoadState.Loading -> LoadingDialog.show(this, "图片上传中,请稍后...") + else -> LoadingDialog.dismiss() } } //转单状态处理 operationViewModel.loadState.observe(this) { when (it) { - is LoadState.Loading -> LoadingDialogHub.show(this, "转单中,请稍后") + is LoadState.Loading -> LoadingDialog.show(this, "转单中,请稍后") is LoadState.Success -> { - LoadingDialogHub.dismiss() + LoadingDialog.dismiss() this.finish() } - else -> LoadingDialogHub.dismiss() + else -> LoadingDialog.dismiss() } } //处理完成工单状态处理 operationViewModel.loadState.observe(this) { when (it) { - is LoadState.Loading -> LoadingDialogHub.show(this, "处理中,请稍后") + is LoadState.Loading -> LoadingDialog.show(this, "处理中,请稍后") is LoadState.Success -> { - LoadingDialogHub.dismiss() + LoadingDialog.dismiss() this.finish() } - else -> LoadingDialogHub.dismiss() + else -> LoadingDialog.dismiss() } } } diff --git a/app/src/main/java/com/casic/app/smartwell/view/OrderNotConfirmedDetailActivity.kt b/app/src/main/java/com/casic/app/smartwell/view/OrderNotConfirmedDetailActivity.kt index 8e036d2..687ec86 100644 --- a/app/src/main/java/com/casic/app/smartwell/view/OrderNotConfirmedDetailActivity.kt +++ b/app/src/main/java/com/casic/app/smartwell/view/OrderNotConfirmedDetailActivity.kt @@ -36,7 +36,7 @@ import com.pengxh.kt.lite.extensions.show import com.pengxh.kt.lite.utils.Constant import com.pengxh.kt.lite.utils.LoadState -import com.pengxh.kt.lite.utils.LoadingDialogHub +import com.pengxh.kt.lite.utils.LoadingDialog import com.pengxh.kt.lite.widget.TitleBarView import com.pengxh.kt.lite.widget.dialog.AlertControlDialog import com.pengxh.kt.lite.widget.dialog.AlertMessageDialog @@ -80,7 +80,7 @@ } override fun initOnCreate(savedInstanceState: Bundle?) { - val jobId = intent.getStringExtra(Constant.INTENT_PARAM)!! + val jobId = intent.getStringExtra(Constant.INTENT_PARAM_KEY)!! //初始化图片九宫格 //左外边距,左内边距,右内边距,右外边距 val viewWidth = getScreenWidth() - (10 + 10 + 10 + 10).dp2px(this) @@ -263,41 +263,41 @@ //数据加载状态处理 orderViewModel.loadState.observe(this) { when (it) { - is LoadState.Loading -> LoadingDialogHub.show(this, "数据加载中,请稍后") - else -> LoadingDialogHub.dismiss() + is LoadState.Loading -> LoadingDialog.show(this, "数据加载中,请稍后") + else -> LoadingDialog.dismiss() } } uploadImageViewModel.loadState.observe(this) { when (it) { - LoadState.Loading -> LoadingDialogHub.show(this, "图片上传中,请稍后") - else -> LoadingDialogHub.dismiss() + LoadState.Loading -> LoadingDialog.show(this, "图片上传中,请稍后") + else -> LoadingDialog.dismiss() } } //转单状态处理 operationViewModel.loadState.observe(this) { when (it) { - is LoadState.Loading -> LoadingDialogHub.show(this, "转单中,请稍后") + is LoadState.Loading -> LoadingDialog.show(this, "转单中,请稍后") is LoadState.Success -> { - LoadingDialogHub.dismiss() + LoadingDialog.dismiss() this.finish() } - else -> LoadingDialogHub.dismiss() + else -> LoadingDialog.dismiss() } } //确认工单状态处理 operationViewModel.loadState.observe(this) { when (it) { - is LoadState.Loading -> LoadingDialogHub.show(this, "处理中,请稍后") + is LoadState.Loading -> LoadingDialog.show(this, "处理中,请稍后") is LoadState.Success -> { - LoadingDialogHub.dismiss() + LoadingDialog.dismiss() this.finish() } - else -> LoadingDialogHub.dismiss() + else -> LoadingDialog.dismiss() } } } diff --git a/app/src/main/java/com/casic/app/smartwell/view/OrderNotProcessedDetailActivity.kt b/app/src/main/java/com/casic/app/smartwell/view/OrderNotProcessedDetailActivity.kt index d3f22dc..0c97a52 100644 --- a/app/src/main/java/com/casic/app/smartwell/view/OrderNotProcessedDetailActivity.kt +++ b/app/src/main/java/com/casic/app/smartwell/view/OrderNotProcessedDetailActivity.kt @@ -18,7 +18,7 @@ import com.pengxh.kt.lite.extensions.show import com.pengxh.kt.lite.utils.Constant import com.pengxh.kt.lite.utils.LoadState -import com.pengxh.kt.lite.utils.LoadingDialogHub +import com.pengxh.kt.lite.utils.LoadingDialog import com.pengxh.kt.lite.widget.TitleBarView import com.pengxh.kt.lite.widget.dialog.AlertControlDialog import com.pengxh.kt.lite.widget.dialog.AlertMessageDialog @@ -50,7 +50,7 @@ } override fun initOnCreate(savedInstanceState: Bundle?) { - this.jobId = intent.getStringExtra(Constant.INTENT_PARAM)!! + this.jobId = intent.getStringExtra(Constant.INTENT_PARAM_KEY)!! orderViewModel = ViewModelProvider(this)[OrderViewModel::class.java] operationViewModel = ViewModelProvider(this)[OperationViewModel::class.java] wellViewModel = ViewModelProvider(this)[WellViewModel::class.java] @@ -162,21 +162,21 @@ //数据加载状态处理 orderViewModel.loadState.observe(this) { when (it) { - is LoadState.Loading -> LoadingDialogHub.show(this, "数据加载中,请稍后") - else -> LoadingDialogHub.dismiss() + is LoadState.Loading -> LoadingDialog.show(this, "数据加载中,请稍后") + else -> LoadingDialog.dismiss() } } //接单状态处理 operationViewModel.loadState.observe(this) { when (it) { - is LoadState.Loading -> LoadingDialogHub.show(this, "接单中,请稍后") + is LoadState.Loading -> LoadingDialog.show(this, "接单中,请稍后") is LoadState.Success -> { - LoadingDialogHub.dismiss() + LoadingDialog.dismiss() this.finish() } - else -> LoadingDialogHub.dismiss() + else -> LoadingDialog.dismiss() } } } diff --git a/app/src/main/java/com/casic/app/smartwell/view/SearchResultActivity.kt b/app/src/main/java/com/casic/app/smartwell/view/SearchResultActivity.kt index 6a92917..4f3a674 100644 --- a/app/src/main/java/com/casic/app/smartwell/view/SearchResultActivity.kt +++ b/app/src/main/java/com/casic/app/smartwell/view/SearchResultActivity.kt @@ -19,7 +19,7 @@ import com.pengxh.kt.lite.extensions.show import com.pengxh.kt.lite.utils.Constant import com.pengxh.kt.lite.utils.LoadState -import com.pengxh.kt.lite.utils.LoadingDialogHub +import com.pengxh.kt.lite.utils.LoadingDialog import com.pengxh.kt.lite.utils.WeakReferenceHandler import com.pengxh.kt.lite.widget.TitleBarView import com.pengxh.kt.lite.widget.dialog.AlertControlDialog @@ -56,7 +56,7 @@ } override fun initOnCreate(savedInstanceState: Bundle?) { - args = intent.getStringArrayListExtra(Constant.INTENT_PARAM)!! + args = intent.getStringArrayListExtra(Constant.INTENT_PARAM_KEY)!! orderViewModel = ViewModelProvider(this)[OrderViewModel::class.java] operationViewModel = ViewModelProvider(this)[OperationViewModel::class.java] @@ -101,24 +101,24 @@ } } - binding.resultRecyclerView.addItemDecoration( - RecyclerViewItemOffsets(0, 5, 0, 5) + binding.recyclerView.addItemDecoration( + RecyclerViewItemOffsets(0, 7, 0, 7) ) } override fun observeRequestState() { orderViewModel.loadState.observe(this) { when (it) { - is LoadState.Loading -> LoadingDialogHub.show(this, "数据加载中,请稍后") - else -> LoadingDialogHub.dismiss() + is LoadState.Loading -> LoadingDialog.show(this, "数据加载中,请稍后") + else -> LoadingDialog.dismiss() } } //接单状态处理 operationViewModel.loadState.observe(this) { when (it) { - is LoadState.Loading -> LoadingDialogHub.show(this, "接单中,请稍后") + is LoadState.Loading -> LoadingDialog.show(this, "接单中,请稍后") is LoadState.Success -> { - LoadingDialogHub.dismiss() + LoadingDialog.dismiss() //接单成功之后刷新列表 dataBeans.removeAt(clickedPosition) searchResultAdapter.notifyItemRemoved(clickedPosition) @@ -127,7 +127,7 @@ ) } - else -> LoadingDialogHub.dismiss() + else -> LoadingDialog.dismiss() } } } @@ -162,7 +162,7 @@ } else { binding.emptyInclude.emptyView.hide() searchResultAdapter = SearchResultAdapter(this, dataBeans) - binding.resultRecyclerView.adapter = searchResultAdapter + binding.recyclerView.adapter = searchResultAdapter searchResultAdapter.setOnItemClickListener(object : SearchResultAdapter.OnItemClickListener { override fun onClicked(position: Int) { diff --git a/app/src/main/java/com/casic/app/smartwell/view/UnDeployWellActivity.kt b/app/src/main/java/com/casic/app/smartwell/view/UnDeployWellActivity.kt index 7f7cd3c..555c278 100644 --- a/app/src/main/java/com/casic/app/smartwell/view/UnDeployWellActivity.kt +++ b/app/src/main/java/com/casic/app/smartwell/view/UnDeployWellActivity.kt @@ -81,8 +81,8 @@ } } - binding.undeployListView.addItemDecoration( - RecyclerViewItemOffsets(0, 5, 0, 5) + binding.recyclerView.addItemDecoration( + RecyclerViewItemOffsets(0, 7, 0, 7) ) } @@ -147,12 +147,11 @@ } else { item.deep.toString() + "m" } - viewHolder.setText(R.id.wellNameView, item.wellName) + viewHolder.setText(R.id.wellTypeView, item.wellTypeName) .setText(R.id.wellDepthView, "深:${deep}") .setText(R.id.wellCodeView, "点位编号:${item.wellCode}") - .setText(R.id.wellTypeView, "点位类型:${item.wellTypeName}") .setText(R.id.ownerShipView, "权属单位:${item.deptName}") - .setText(R.id.wellLocationView, "点位置:${item.position}") + .setText(R.id.wellLocationView, "点位位置:${item.position}") .setOnClickListener( R.id.operationButton, object : View.OnClickListener { override fun onClick(v: View?) { @@ -185,7 +184,7 @@ ) } } - binding.undeployListView.adapter = unDeployAdapter + binding.recyclerView.adapter = unDeployAdapter unDeployAdapter.setOnItemClickedListener(object : NormalRecyclerAdapter.OnItemClickedListener { override fun onItemClicked(position: Int, t: WellListModel.DataBean.RowsBean) { diff --git a/app/src/main/java/com/casic/app/smartwell/view/WellDetailActivity.kt b/app/src/main/java/com/casic/app/smartwell/view/WellDetailActivity.kt index b50d067..eb8b468 100644 --- a/app/src/main/java/com/casic/app/smartwell/view/WellDetailActivity.kt +++ b/app/src/main/java/com/casic/app/smartwell/view/WellDetailActivity.kt @@ -16,7 +16,7 @@ import com.pengxh.kt.lite.extensions.show import com.pengxh.kt.lite.utils.Constant import com.pengxh.kt.lite.utils.LoadState -import com.pengxh.kt.lite.utils.LoadingDialogHub +import com.pengxh.kt.lite.utils.LoadingDialog import com.pengxh.kt.lite.widget.TitleBarView import com.pengxh.kt.lite.widget.dialog.AlertMessageDialog @@ -44,7 +44,7 @@ } override fun initOnCreate(savedInstanceState: Bundle?) { - val wellId = intent.getStringExtra(Constant.INTENT_PARAM)!! + val wellId = intent.getStringExtra(Constant.INTENT_PARAM_KEY)!! wellViewModel = ViewModelProvider(this)[WellViewModel::class.java] wellViewModel.getWellDetail(wellId) wellViewModel.wellDetailModel.observe(this) { @@ -132,8 +132,8 @@ override fun observeRequestState() { wellViewModel.loadState.observe(this) { when (it) { - is LoadState.Loading -> LoadingDialogHub.show(this, "数据加载中,请稍后") - else -> LoadingDialogHub.dismiss() + is LoadState.Loading -> LoadingDialog.show(this, "数据加载中,请稍后") + else -> LoadingDialog.dismiss() } } } diff --git a/app/src/main/java/com/casic/app/smartwell/view/WellManagementActivity.kt b/app/src/main/java/com/casic/app/smartwell/view/WellManagementActivity.kt index 084da95..457096b 100644 --- a/app/src/main/java/com/casic/app/smartwell/view/WellManagementActivity.kt +++ b/app/src/main/java/com/casic/app/smartwell/view/WellManagementActivity.kt @@ -94,8 +94,8 @@ } } - binding.wellListView.addItemDecoration( - RecyclerViewItemOffsets(0, 5, 0, 5) + binding.recyclerView.addItemDecoration( + RecyclerViewItemOffsets(0, 7, 0, 7) ) } @@ -175,13 +175,12 @@ } else { item.deep.toString() + "m" } - viewHolder.setText(R.id.wellNameView, item.wellName) + viewHolder.setText(R.id.wellTypeView, item.wellTypeName) .setText(R.id.wellStateView, "已${item.bfztName}") .setText(R.id.wellDepthView, "深:${deep}") .setText(R.id.wellCodeView, "点位编号:${item.wellCode}") - .setText(R.id.wellTypeView, "点位类型:${item.wellTypeName}") .setText(R.id.ownerShipView, "权属单位:${item.deptName}") - .setText(R.id.wellLocationView, "点位置:${item.position}") + .setText(R.id.wellLocationView, "点位位置:${item.position}") .setOnClickListener( R.id.navigationButton, object : View.OnClickListener { override fun onClick(v: View?) { @@ -200,7 +199,7 @@ ) } } - binding.wellListView.adapter = wellListAdapter + binding.recyclerView.adapter = wellListAdapter wellListAdapter.setOnItemClickedListener(object : NormalRecyclerAdapter.OnItemClickedListener { override fun onItemClicked(position: Int, t: WellListModel.DataBean.RowsBean) { diff --git a/app/src/main/java/com/casic/app/smartwell/view/WellMonitorActivity.kt b/app/src/main/java/com/casic/app/smartwell/view/WellMonitorActivity.kt index e3573eb..b87bdb7 100644 --- a/app/src/main/java/com/casic/app/smartwell/view/WellMonitorActivity.kt +++ b/app/src/main/java/com/casic/app/smartwell/view/WellMonitorActivity.kt @@ -11,7 +11,7 @@ import com.pengxh.kt.lite.base.KotlinBaseActivity import com.pengxh.kt.lite.utils.Constant import com.pengxh.kt.lite.utils.LoadState -import com.pengxh.kt.lite.utils.LoadingDialogHub +import com.pengxh.kt.lite.utils.LoadingDialog import com.pengxh.kt.lite.widget.TitleBarView class WellMonitorActivity : KotlinBaseActivity() { @@ -36,7 +36,7 @@ } override fun initOnCreate(savedInstanceState: Bundle?) { - val wellId = intent.getStringExtra(Constant.INTENT_PARAM)!! + val wellId = intent.getStringExtra(Constant.INTENT_PARAM_KEY)!! wellViewModel = ViewModelProvider(this)[WellViewModel::class.java] wellViewModel.getMonitorResult(wellId) wellViewModel.monitorModel.observe(this) { @@ -56,8 +56,8 @@ override fun observeRequestState() { wellViewModel.loadState.observe(this) { when (it) { - is LoadState.Loading -> LoadingDialogHub.show(this, "数据加载中,请稍后") - else -> LoadingDialogHub.dismiss() + is LoadState.Loading -> LoadingDialog.show(this, "数据加载中,请稍后") + else -> LoadingDialog.dismiss() } } } diff --git a/app/src/main/java/com/casic/app/smartwell/view/WellOperationActivity.kt b/app/src/main/java/com/casic/app/smartwell/view/WellOperationActivity.kt index 8d333bf..347ebb6 100644 --- a/app/src/main/java/com/casic/app/smartwell/view/WellOperationActivity.kt +++ b/app/src/main/java/com/casic/app/smartwell/view/WellOperationActivity.kt @@ -23,7 +23,7 @@ import com.pengxh.kt.lite.extensions.navigatePageTo import com.pengxh.kt.lite.extensions.show import com.pengxh.kt.lite.utils.LoadState -import com.pengxh.kt.lite.utils.LoadingDialogHub +import com.pengxh.kt.lite.utils.LoadingDialog import com.pengxh.kt.lite.utils.WeakReferenceHandler import com.pengxh.kt.lite.widget.dialog.AlertControlDialog @@ -109,8 +109,8 @@ } } - binding.operationListView.addItemDecoration( - RecyclerViewItemOffsets(0, 5, 0, 5) + binding.recyclerView.addItemDecoration( + RecyclerViewItemOffsets(0, 7, 0, 7) ) } @@ -123,13 +123,13 @@ override fun observeRequestState() { wellViewModel.loadState.observe(this) { when (it) { - is LoadState.Loading -> LoadingDialogHub.show(this, "处理中,请稍后") + is LoadState.Loading -> LoadingDialog.show(this, "处理中,请稍后") is LoadState.Success -> { - LoadingDialogHub.dismiss() + LoadingDialog.dismiss() wellOperationAdapter.notifyItemChanged(clickedPosition) } - else -> LoadingDialogHub.dismiss() + else -> LoadingDialog.dismiss() } } } @@ -203,24 +203,23 @@ if (item.bfztName == "布防") { viewHolder.setImageResource( R.id.wellStateView, R.drawable.bg_solid_text_green_radius_5 - ).setText(R.id.wellStateView, "撤防") + ).setText(R.id.operationButton, "撤防") } else { viewHolder.setImageResource( R.id.wellStateView, R.drawable.bg_solid_text_red_radius_5 - ).setText(R.id.wellStateView, "布防") + ).setText(R.id.operationButton, "布防") } val deep = if (item.deep.toString().isBlank()) { "未知" } else { item.deep.toString() + "m" } - viewHolder.setText(R.id.wellNameView, item.wellName) + viewHolder.setText(R.id.wellTypeView, item.wellTypeName) .setText(R.id.wellStateView, "已${item.bfztName}") .setText(R.id.wellDepthView, "深:${deep}") .setText(R.id.wellCodeView, "点位编号:${item.wellCode}") - .setText(R.id.wellTypeView, "点位类型:${item.wellTypeName}") .setText(R.id.ownerShipView, "权属单位:${item.deptName}") - .setText(R.id.wellLocationView, "点位置:${item.position}") + .setText(R.id.wellLocationView, "点位位置:${item.position}") .setOnClickListener( R.id.operationButton, object : View.OnClickListener { override fun onClick(v: View?) { @@ -280,7 +279,7 @@ ) } } - binding.operationListView.adapter = wellOperationAdapter + binding.recyclerView.adapter = wellOperationAdapter wellOperationAdapter.setOnItemClickedListener(object : NormalRecyclerAdapter.OnItemClickedListener { override fun onItemClicked(position: Int, t: WellListModel.DataBean.RowsBean) { diff --git a/app/src/main/res/drawable/ic_down.xml b/app/src/main/res/drawable/ic_down.xml index 20e6476..6987e6c 100644 --- a/app/src/main/res/drawable/ic_down.xml +++ b/app/src/main/res/drawable/ic_down.xml @@ -1,6 +1,6 @@ + + diff --git a/app/src/main/res/layout/activity_about_us.xml b/app/src/main/res/layout/activity_about_us.xml index 9091a00..d5fbd0d 100644 --- a/app/src/main/res/layout/activity_about_us.xml +++ b/app/src/main/res/layout/activity_about_us.xml @@ -12,13 +12,7 @@ android:layout_width="match_parent" android:layout_height="wrap_content" android:background="@color/mainThemeColor" - app:tbv_left_image="@drawable/ic_title_left" - app:tbv_only_show_title="false" - app:tbv_show_left_image="true" - app:tbv_show_right_image="false" - app:tbv_text="关于我们" - app:tbv_text_color="@color/white" - app:tbv_text_size="@dimen/sp_18" /> + app:tbv_text="关于我们" /> + app:tbv_text="修改密码" /> + app:tbv_text="布防列表" /> + app:tbv_text="帮助中心" /> + app:tbv_text="工单详情" /> + app:tbv_text="工单详情" /> + app:tbv_text="工单详情" /> + app:tbv_text="工单详情" /> + app:tbv_text="超时工单" /> + app:tbv_text="工单查询" /> + app:tbv_text="查询结果" /> + app:tbv_text="撤防列表" /> + app:tbv_text="个人资料" /> + app:tbv_text="点位详情" /> + app:tbv_text="监控内容" /> - + + android:value="ee96d8b5e12de3fbb29949efd57418a8" /> () @@ -150,7 +158,7 @@ val cameraPosition = CameraPosition(centerLatLng, 14f, 0f, 0f) val cameraUpdate = CameraUpdateFactory.newCameraPosition(cameraPosition) withContext(Dispatchers.Main) { - LoadingDialogHub.dismiss() + LoadingDialog.dismiss() aMap.animateCamera(cameraUpdate, 1500, null) } } @@ -239,11 +247,6 @@ } override fun initEvent() { - binding.rightOptionView.setOnClickListener { - val x = binding.rightOptionView.width - easyPopupWindow.width - easyPopupWindow.showAsDropDown(binding.rightOptionView, x, 0) - } - //撤防点位 binding.unDeployedLayout.setOnClickListener { requireContext().navigatePageTo() @@ -263,11 +266,11 @@ override fun observeRequestState() { wellViewModel.loadState.observe(this) { when (it) { - is LoadState.Loading -> LoadingDialogHub.show( + is LoadState.Loading -> LoadingDialog.show( requireActivity(), "数据加载中,请稍后..." ) - else -> LoadingDialogHub.dismiss() + else -> LoadingDialog.dismiss() } } } @@ -376,7 +379,7 @@ }).build().show() } }) - infoPopup.showAsDropDown(binding.rightOptionView) +// infoPopup.showAsDropDown(binding.rightOptionView) } override fun onCameraChange(p0: CameraPosition?) { diff --git a/app/src/main/java/com/casic/app/smartwell/fragment/HomePageNoClusterFragment.kt b/app/src/main/java/com/casic/app/smartwell/fragment/HomePageNoClusterFragment.kt index 802426a..b25f743 100644 --- a/app/src/main/java/com/casic/app/smartwell/fragment/HomePageNoClusterFragment.kt +++ b/app/src/main/java/com/casic/app/smartwell/fragment/HomePageNoClusterFragment.kt @@ -38,8 +38,9 @@ import com.pengxh.kt.lite.extensions.navigatePageTo import com.pengxh.kt.lite.extensions.show import com.pengxh.kt.lite.utils.LoadState -import com.pengxh.kt.lite.utils.LoadingDialogHub +import com.pengxh.kt.lite.utils.LoadingDialog import com.pengxh.kt.lite.widget.EasyPopupWindow +import com.pengxh.kt.lite.widget.TitleBarView import com.pengxh.kt.lite.widget.dialog.AlertControlDialog import kotlinx.coroutines.Dispatchers import kotlinx.coroutines.launch @@ -78,7 +79,15 @@ override fun setupTopBarLayout() { binding.rootView.initImmersionBar(this, false, R.color.mainThemeColor) - binding.titleView.text = "首页" + binding.titleView.setOnClickListener(object : TitleBarView.OnClickListener { + override fun onLeftClick() { + + } + + override fun onRightClick() { + easyPopupWindow.showAsDropDown(binding.titleView, binding.titleView.width, 0) + } + }) } override fun initOnCreate(savedInstanceState: Bundle?) { @@ -112,7 +121,7 @@ //渲染井位置 lifecycleScope.launch(Dispatchers.Main) { - LoadingDialogHub.show(requireActivity(), "数据加载中,请稍后") + LoadingDialog.show(requireActivity(), "数据加载中,请稍后") withContext(Dispatchers.IO) { //取Well缓存 val allMarkerOptions = ArrayList() @@ -144,7 +153,7 @@ val cameraPosition = CameraPosition(centerLatLng, 14f, 0f, 0f) val cameraUpdate = CameraUpdateFactory.newCameraPosition(cameraPosition) withContext(Dispatchers.Main) { - LoadingDialogHub.dismiss() + LoadingDialog.dismiss() aMap.animateCamera(cameraUpdate, 1500, null) } } @@ -238,11 +247,6 @@ } override fun initEvent() { - binding.rightOptionView.setOnClickListener { - val x = binding.rightOptionView.width - easyPopupWindow.width - easyPopupWindow.showAsDropDown(binding.rightOptionView, x, 0) - } - //撤防点位 binding.unDeployedLayout.setOnClickListener { requireContext().navigatePageTo() @@ -262,11 +266,11 @@ override fun observeRequestState() { wellViewModel.loadState.observe(this) { when (it) { - is LoadState.Loading -> LoadingDialogHub.show( + is LoadState.Loading -> LoadingDialog.show( requireActivity(), "数据加载中,请稍后..." ) - else -> LoadingDialogHub.dismiss() + else -> LoadingDialog.dismiss() } } } diff --git a/app/src/main/java/com/casic/app/smartwell/fragment/MinePageFragment.kt b/app/src/main/java/com/casic/app/smartwell/fragment/MinePageFragment.kt index 09a570c..dcb48f8 100644 --- a/app/src/main/java/com/casic/app/smartwell/fragment/MinePageFragment.kt +++ b/app/src/main/java/com/casic/app/smartwell/fragment/MinePageFragment.kt @@ -35,7 +35,7 @@ import com.pengxh.kt.lite.utils.ActivityStackManager import com.pengxh.kt.lite.utils.FileDownloadManager import com.pengxh.kt.lite.utils.LoadState -import com.pengxh.kt.lite.utils.LoadingDialogHub +import com.pengxh.kt.lite.utils.LoadingDialog import com.pengxh.kt.lite.widget.dialog.AlertControlDialog import com.pengxh.kt.lite.widget.dialog.BottomActionSheet import kotlinx.coroutines.Dispatchers @@ -60,7 +60,6 @@ override fun setupTopBarLayout() { binding.rootView.initImmersionBar(this, false, R.color.mainThemeColor) - binding.titleInclude.titleView.text = "我的" } override fun initOnCreate(savedInstanceState: Bundle?) { @@ -155,27 +154,27 @@ override fun observeRequestState() { userViewModel.loadState.observe(this) { when (it) { - is LoadState.Loading -> LoadingDialogHub.show( + is LoadState.Loading -> LoadingDialog.show( requireActivity(), "检查版本中,请稍后" ) - else -> LoadingDialogHub.dismiss() + else -> LoadingDialog.dismiss() } } wellViewModel.loadState.observe(this) { when (it) { - is LoadState.Loading -> LoadingDialogHub.show( + is LoadState.Loading -> LoadingDialog.show( requireActivity(), "数据更新中,请稍后" ) is LoadState.Fail -> { - LoadingDialogHub.dismiss() + LoadingDialog.dismiss() "数据更新超时".show(requireContext()) } else -> { - LoadingDialogHub.dismiss() + LoadingDialog.dismiss() AlertControlDialog.Builder().setContext(requireContext()).setTitle("温馨提示") .setMessage("数据更新成功,请重启应用").setNegativeButton("取消") .setPositiveButton("确定").setOnDialogButtonClickListener(object : @@ -197,17 +196,17 @@ lineViewModel.loadState.observe(this) { when (it) { - is LoadState.Loading -> LoadingDialogHub.show( + is LoadState.Loading -> LoadingDialog.show( requireActivity(), "数据更新中,请稍后" ) is LoadState.Fail -> { - LoadingDialogHub.dismiss() + LoadingDialog.dismiss() "数据更新超时".show(requireContext()) } else -> { - LoadingDialogHub.dismiss() + LoadingDialog.dismiss() AlertControlDialog.Builder().setContext(requireContext()).setTitle("温馨提示") .setMessage("数据更新成功,请重启应用").setNegativeButton("取消") .setPositiveButton("确定").setOnDialogButtonClickListener(object : diff --git a/app/src/main/java/com/casic/app/smartwell/fragment/NoticePageFragment.kt b/app/src/main/java/com/casic/app/smartwell/fragment/NoticePageFragment.kt index 171b555..3c93f54 100644 --- a/app/src/main/java/com/casic/app/smartwell/fragment/NoticePageFragment.kt +++ b/app/src/main/java/com/casic/app/smartwell/fragment/NoticePageFragment.kt @@ -48,7 +48,6 @@ override fun setupTopBarLayout() { binding.rootView.initImmersionBar(this, false, R.color.mainThemeColor) - binding.titleInclude.titleView.text = "消息" } override fun initOnCreate(savedInstanceState: Bundle?) { diff --git a/app/src/main/java/com/casic/app/smartwell/fragment/OrderListFragment.kt b/app/src/main/java/com/casic/app/smartwell/fragment/OrderListFragment.kt index 93ff35b..5e38acb 100644 --- a/app/src/main/java/com/casic/app/smartwell/fragment/OrderListFragment.kt +++ b/app/src/main/java/com/casic/app/smartwell/fragment/OrderListFragment.kt @@ -12,6 +12,7 @@ import com.casic.app.smartwell.view.SearchOrderActivity import com.pengxh.kt.lite.base.KotlinBaseFragment import com.pengxh.kt.lite.extensions.navigatePageTo +import com.pengxh.kt.lite.widget.TitleBarView class OrderListFragment : KotlinBaseFragment() { @@ -25,15 +26,22 @@ } override fun initViewBinding( - inflater: LayoutInflater, - container: ViewGroup? + inflater: LayoutInflater, container: ViewGroup? ): FragmentOrderBinding { return FragmentOrderBinding.inflate(inflater, container, false) } override fun setupTopBarLayout() { binding.rootView.initImmersionBar(this, false, R.color.mainThemeColor) - binding.titleView.text = "工单" + binding.titleView.setOnClickListener(object : TitleBarView.OnClickListener { + override fun onLeftClick() { + + } + + override fun onRightClick() { + requireContext().navigatePageTo() + } + }) } override fun initOnCreate(savedInstanceState: Bundle?) { @@ -51,8 +59,6 @@ } override fun initEvent() { - binding.rightOptionView.setOnClickListener { - requireContext().navigatePageTo() - } + } } \ No newline at end of file diff --git a/app/src/main/java/com/casic/app/smartwell/fragment/OrderNotProcessedFragment.kt b/app/src/main/java/com/casic/app/smartwell/fragment/OrderNotProcessedFragment.kt index 0b3d09d..2b6f21d 100644 --- a/app/src/main/java/com/casic/app/smartwell/fragment/OrderNotProcessedFragment.kt +++ b/app/src/main/java/com/casic/app/smartwell/fragment/OrderNotProcessedFragment.kt @@ -18,7 +18,7 @@ import com.pengxh.kt.lite.extensions.navigatePageTo import com.pengxh.kt.lite.extensions.show import com.pengxh.kt.lite.utils.LoadState -import com.pengxh.kt.lite.utils.LoadingDialogHub +import com.pengxh.kt.lite.utils.LoadingDialog import com.pengxh.kt.lite.utils.WeakReferenceHandler import com.pengxh.kt.lite.widget.dialog.AlertControlDialog @@ -78,8 +78,8 @@ operationViewModel = ViewModelProvider(this)[OperationViewModel::class.java] - binding.notProcessedView.addItemDecoration( - RecyclerViewItemOffsets(0, 5, 0, 5) + binding.recyclerView.addItemDecoration( + RecyclerViewItemOffsets(0, 7, 0, 7) ) } @@ -87,9 +87,9 @@ //接单状态处理 operationViewModel.loadState.observe(this) { when (it) { - is LoadState.Loading -> LoadingDialogHub.show(requireActivity(), "接单中,请稍后") + is LoadState.Loading -> LoadingDialog.show(requireActivity(), "接单中,请稍后") is LoadState.Success -> { - LoadingDialogHub.dismiss() + LoadingDialog.dismiss() //接单成功之后刷新列表 dataBeans.removeAt(clickedPosition) notProcessedAdapter.notifyItemRemoved(clickedPosition) @@ -98,7 +98,7 @@ ) } - else -> LoadingDialogHub.dismiss() + else -> LoadingDialog.dismiss() } } } @@ -131,7 +131,7 @@ } else { binding.emptyInclude.emptyView.hide() notProcessedAdapter = OrderNotProcessedAdapter(requireContext(), dataBeans) - binding.notProcessedView.adapter = notProcessedAdapter + binding.recyclerView.adapter = notProcessedAdapter notProcessedAdapter.setOnItemClickListener(object : OrderNotProcessedAdapter.OnItemClickListener { override fun onClicked(position: Int) { diff --git a/app/src/main/java/com/casic/app/smartwell/fragment/OvertimeNotAcceptFragment.kt b/app/src/main/java/com/casic/app/smartwell/fragment/OvertimeNotAcceptFragment.kt index a198545..9b318ca 100644 --- a/app/src/main/java/com/casic/app/smartwell/fragment/OvertimeNotAcceptFragment.kt +++ b/app/src/main/java/com/casic/app/smartwell/fragment/OvertimeNotAcceptFragment.kt @@ -18,7 +18,7 @@ import com.pengxh.kt.lite.extensions.navigatePageTo import com.pengxh.kt.lite.extensions.show import com.pengxh.kt.lite.utils.LoadState -import com.pengxh.kt.lite.utils.LoadingDialogHub +import com.pengxh.kt.lite.utils.LoadingDialog import com.pengxh.kt.lite.utils.WeakReferenceHandler import com.pengxh.kt.lite.widget.dialog.AlertControlDialog @@ -81,8 +81,8 @@ operationViewModel = ViewModelProvider(this)[OperationViewModel::class.java] - binding.notProcessedView.addItemDecoration( - RecyclerViewItemOffsets(0, 5, 0, 5) + binding.recyclerView.addItemDecoration( + RecyclerViewItemOffsets(0, 7, 0, 7) ) } @@ -90,9 +90,9 @@ //接单状态处理 operationViewModel.loadState.observe(this) { when (it) { - is LoadState.Loading -> LoadingDialogHub.show(requireActivity(), "接单中,请稍后") + is LoadState.Loading -> LoadingDialog.show(requireActivity(), "接单中,请稍后") is LoadState.Success -> { - LoadingDialogHub.dismiss() + LoadingDialog.dismiss() //接单成功之后刷新列表 dataBeans.removeAt(clickedPosition) notProcessedAdapter.notifyItemRemoved(clickedPosition) @@ -101,7 +101,7 @@ ) } - else -> LoadingDialogHub.dismiss() + else -> LoadingDialog.dismiss() } } } @@ -134,7 +134,7 @@ } else { binding.emptyInclude.emptyView.hide() notProcessedAdapter = OrderNotProcessedAdapter(requireContext(), dataBeans) - binding.notProcessedView.adapter = notProcessedAdapter + binding.recyclerView.adapter = notProcessedAdapter notProcessedAdapter.setOnItemClickListener(object : OrderNotProcessedAdapter.OnItemClickListener { override fun onClicked(position: Int) { diff --git a/app/src/main/java/com/casic/app/smartwell/greendao/DaoMaster.java b/app/src/main/java/com/casic/app/smartwell/greendao/DaoMaster.java index fdcf3a7..1e52b74 100644 --- a/app/src/main/java/com/casic/app/smartwell/greendao/DaoMaster.java +++ b/app/src/main/java/com/casic/app/smartwell/greendao/DaoMaster.java @@ -13,25 +13,20 @@ // THIS CODE IS GENERATED BY greenDAO, DO NOT EDIT. - /** * Master of DAO (schema version 4): knows all DAOs. */ public class DaoMaster extends AbstractDaoMaster { public static final int SCHEMA_VERSION = 4; - /** - * Creates underlying database table using DAOs. - */ + /** Creates underlying database table using DAOs. */ public static void createAllTables(Database db, boolean ifNotExists) { MapWellLocalBeanDao.createTable(db, ifNotExists); NoticeLocaleBeanDao.createTable(db, ifNotExists); PipeLocalBeanDao.createTable(db, ifNotExists); } - /** - * Drops underlying database table using DAOs. - */ + /** Drops underlying database table using DAOs. */ public static void dropAllTables(Database db, boolean ifExists) { MapWellLocalBeanDao.dropTable(db, ifExists); NoticeLocaleBeanDao.dropTable(db, ifExists); @@ -86,9 +81,7 @@ } } - /** - * WARNING: Drops all table on Upgrade! Use only during development. - */ + /** WARNING: Drops all table on Upgrade! Use only during development. */ public static class DevOpenHelper extends OpenHelper { public DevOpenHelper(Context context, String name) { super(context, name); diff --git a/app/src/main/java/com/casic/app/smartwell/greendao/DaoSession.java b/app/src/main/java/com/casic/app/smartwell/greendao/DaoSession.java index 0b36d17..3e40e3b 100644 --- a/app/src/main/java/com/casic/app/smartwell/greendao/DaoSession.java +++ b/app/src/main/java/com/casic/app/smartwell/greendao/DaoSession.java @@ -16,7 +16,7 @@ /** * {@inheritDoc} - * + * * @see org.greenrobot.greendao.AbstractDaoSession */ public class DaoSession extends AbstractDaoSession { @@ -50,7 +50,7 @@ registerDao(NoticeLocaleBean.class, noticeLocaleBeanDao); registerDao(PipeLocalBean.class, pipeLocalBeanDao); } - + public void clear() { mapWellLocalBeanDaoConfig.clearIdentityScope(); noticeLocaleBeanDaoConfig.clearIdentityScope(); diff --git a/app/src/main/java/com/casic/app/smartwell/greendao/MapWellLocalBeanDao.java b/app/src/main/java/com/casic/app/smartwell/greendao/MapWellLocalBeanDao.java index 8908fda..407bc92 100644 --- a/app/src/main/java/com/casic/app/smartwell/greendao/MapWellLocalBeanDao.java +++ b/app/src/main/java/com/casic/app/smartwell/greendao/MapWellLocalBeanDao.java @@ -12,10 +12,9 @@ import org.greenrobot.greendao.internal.DaoConfig; // THIS CODE IS GENERATED BY greenDAO, DO NOT EDIT. - -/** +/** * DAO for table "MAP_WELL_LOCAL_BEAN". - */ +*/ public class MapWellLocalBeanDao extends AbstractDao { public static final String TABLENAME = "MAP_WELL_LOCAL_BEAN"; @@ -57,16 +56,14 @@ public MapWellLocalBeanDao(DaoConfig config) { super(config); } - + public MapWellLocalBeanDao(DaoConfig config, DaoSession daoSession) { super(config, daoSession); } - /** - * Creates the underlying database table. - */ + /** Creates the underlying database table. */ public static void createTable(Database db, boolean ifNotExists) { - String constraint = ifNotExists ? "IF NOT EXISTS " : ""; + String constraint = ifNotExists? "IF NOT EXISTS ": ""; db.execSQL("CREATE TABLE " + constraint + "\"MAP_WELL_LOCAL_BEAN\" (" + // "\"_id\" INTEGER PRIMARY KEY AUTOINCREMENT ," + // 0: kId "\"AREA\" TEXT," + // 1: area @@ -96,9 +93,7 @@ "\"WELL_TYPE_NAME\" TEXT);"); // 25: wellTypeName } - /** - * Drops the underlying database table. - */ + /** Drops the underlying database table. */ public static void dropTable(Database db, boolean ifExists) { String sql = "DROP TABLE " + (ifExists ? "IF EXISTS " : "") + "\"MAP_WELL_LOCAL_BEAN\""; db.execSQL(sql); @@ -107,132 +102,132 @@ @Override protected final void bindValues(DatabaseStatement stmt, MapWellLocalBean entity) { stmt.clearBindings(); - + Long kId = entity.getKId(); if (kId != null) { stmt.bindLong(1, kId); } - + String area = entity.getArea(); if (area != null) { stmt.bindString(2, area); } - + String bfzt = entity.getBfzt(); if (bfzt != null) { stmt.bindString(3, bfzt); } - + String bfztName = entity.getBfztName(); if (bfztName != null) { stmt.bindString(4, bfztName); } - + String coordinateX = entity.getCoordinateX(); if (coordinateX != null) { stmt.bindString(5, coordinateX); } - + String coordinateY = entity.getCoordinateY(); if (coordinateY != null) { stmt.bindString(6, coordinateY); } - + String deep = entity.getDeep(); if (deep != null) { stmt.bindString(7, deep); } - + String deptName = entity.getDeptName(); if (deptName != null) { stmt.bindString(8, deptName); } - + String deptid = entity.getDeptid(); if (deptid != null) { stmt.bindString(9, deptid); } - + String id = entity.getId(); if (id != null) { stmt.bindString(10, id); } - + String latBaidu = entity.getLatBaidu(); if (latBaidu != null) { stmt.bindString(11, latBaidu); } - + String latGaode = entity.getLatGaode(); if (latGaode != null) { stmt.bindString(12, latGaode); } - + String lngBaidu = entity.getLngBaidu(); if (lngBaidu != null) { stmt.bindString(13, lngBaidu); } - + String lngGaode = entity.getLngGaode(); if (lngGaode != null) { stmt.bindString(14, lngGaode); } - + String notes = entity.getNotes(); if (notes != null) { stmt.bindString(15, notes); } - + String photos = entity.getPhotos(); if (photos != null) { stmt.bindString(16, photos); } - + String position = entity.getPosition(); if (position != null) { stmt.bindString(17, position); } - + String staff = entity.getStaff(); if (staff != null) { stmt.bindString(18, staff); } - + String tel = entity.getTel(); if (tel != null) { stmt.bindString(19, tel); } - + String ts = entity.getTs(); if (ts != null) { stmt.bindString(20, ts); } - + String valid = entity.getValid(); if (valid != null) { stmt.bindString(21, valid); } - + String watchData = entity.getWatchData(); if (watchData != null) { stmt.bindString(22, watchData); } - + String wellCode = entity.getWellCode(); if (wellCode != null) { stmt.bindString(23, wellCode); } - + String wellName = entity.getWellName(); if (wellName != null) { stmt.bindString(24, wellName); } - + String wellType = entity.getWellType(); if (wellType != null) { stmt.bindString(25, wellType); } - + String wellTypeName = entity.getWellTypeName(); if (wellTypeName != null) { stmt.bindString(26, wellTypeName); @@ -242,132 +237,132 @@ @Override protected final void bindValues(SQLiteStatement stmt, MapWellLocalBean entity) { stmt.clearBindings(); - + Long kId = entity.getKId(); if (kId != null) { stmt.bindLong(1, kId); } - + String area = entity.getArea(); if (area != null) { stmt.bindString(2, area); } - + String bfzt = entity.getBfzt(); if (bfzt != null) { stmt.bindString(3, bfzt); } - + String bfztName = entity.getBfztName(); if (bfztName != null) { stmt.bindString(4, bfztName); } - + String coordinateX = entity.getCoordinateX(); if (coordinateX != null) { stmt.bindString(5, coordinateX); } - + String coordinateY = entity.getCoordinateY(); if (coordinateY != null) { stmt.bindString(6, coordinateY); } - + String deep = entity.getDeep(); if (deep != null) { stmt.bindString(7, deep); } - + String deptName = entity.getDeptName(); if (deptName != null) { stmt.bindString(8, deptName); } - + String deptid = entity.getDeptid(); if (deptid != null) { stmt.bindString(9, deptid); } - + String id = entity.getId(); if (id != null) { stmt.bindString(10, id); } - + String latBaidu = entity.getLatBaidu(); if (latBaidu != null) { stmt.bindString(11, latBaidu); } - + String latGaode = entity.getLatGaode(); if (latGaode != null) { stmt.bindString(12, latGaode); } - + String lngBaidu = entity.getLngBaidu(); if (lngBaidu != null) { stmt.bindString(13, lngBaidu); } - + String lngGaode = entity.getLngGaode(); if (lngGaode != null) { stmt.bindString(14, lngGaode); } - + String notes = entity.getNotes(); if (notes != null) { stmt.bindString(15, notes); } - + String photos = entity.getPhotos(); if (photos != null) { stmt.bindString(16, photos); } - + String position = entity.getPosition(); if (position != null) { stmt.bindString(17, position); } - + String staff = entity.getStaff(); if (staff != null) { stmt.bindString(18, staff); } - + String tel = entity.getTel(); if (tel != null) { stmt.bindString(19, tel); } - + String ts = entity.getTs(); if (ts != null) { stmt.bindString(20, ts); } - + String valid = entity.getValid(); if (valid != null) { stmt.bindString(21, valid); } - + String watchData = entity.getWatchData(); if (watchData != null) { stmt.bindString(22, watchData); } - + String wellCode = entity.getWellCode(); if (wellCode != null) { stmt.bindString(23, wellCode); } - + String wellName = entity.getWellName(); if (wellName != null) { stmt.bindString(24, wellName); } - + String wellType = entity.getWellType(); if (wellType != null) { stmt.bindString(25, wellType); } - + String wellTypeName = entity.getWellTypeName(); if (wellTypeName != null) { stmt.bindString(26, wellTypeName); @@ -377,41 +372,41 @@ @Override public Long readKey(Cursor cursor, int offset) { return cursor.isNull(offset + 0) ? null : cursor.getLong(offset + 0); - } + } @Override public MapWellLocalBean readEntity(Cursor cursor, int offset) { MapWellLocalBean entity = new MapWellLocalBean( // - cursor.isNull(offset + 0) ? null : cursor.getLong(offset + 0), // kId - cursor.isNull(offset + 1) ? null : cursor.getString(offset + 1), // area - cursor.isNull(offset + 2) ? null : cursor.getString(offset + 2), // bfzt - cursor.isNull(offset + 3) ? null : cursor.getString(offset + 3), // bfztName - cursor.isNull(offset + 4) ? null : cursor.getString(offset + 4), // coordinateX - cursor.isNull(offset + 5) ? null : cursor.getString(offset + 5), // coordinateY - cursor.isNull(offset + 6) ? null : cursor.getString(offset + 6), // deep - cursor.isNull(offset + 7) ? null : cursor.getString(offset + 7), // deptName - cursor.isNull(offset + 8) ? null : cursor.getString(offset + 8), // deptid - cursor.isNull(offset + 9) ? null : cursor.getString(offset + 9), // id - cursor.isNull(offset + 10) ? null : cursor.getString(offset + 10), // latBaidu - cursor.isNull(offset + 11) ? null : cursor.getString(offset + 11), // latGaode - cursor.isNull(offset + 12) ? null : cursor.getString(offset + 12), // lngBaidu - cursor.isNull(offset + 13) ? null : cursor.getString(offset + 13), // lngGaode - cursor.isNull(offset + 14) ? null : cursor.getString(offset + 14), // notes - cursor.isNull(offset + 15) ? null : cursor.getString(offset + 15), // photos - cursor.isNull(offset + 16) ? null : cursor.getString(offset + 16), // position - cursor.isNull(offset + 17) ? null : cursor.getString(offset + 17), // staff - cursor.isNull(offset + 18) ? null : cursor.getString(offset + 18), // tel - cursor.isNull(offset + 19) ? null : cursor.getString(offset + 19), // ts - cursor.isNull(offset + 20) ? null : cursor.getString(offset + 20), // valid - cursor.isNull(offset + 21) ? null : cursor.getString(offset + 21), // watchData - cursor.isNull(offset + 22) ? null : cursor.getString(offset + 22), // wellCode - cursor.isNull(offset + 23) ? null : cursor.getString(offset + 23), // wellName - cursor.isNull(offset + 24) ? null : cursor.getString(offset + 24), // wellType - cursor.isNull(offset + 25) ? null : cursor.getString(offset + 25) // wellTypeName + cursor.isNull(offset + 0) ? null : cursor.getLong(offset + 0), // kId + cursor.isNull(offset + 1) ? null : cursor.getString(offset + 1), // area + cursor.isNull(offset + 2) ? null : cursor.getString(offset + 2), // bfzt + cursor.isNull(offset + 3) ? null : cursor.getString(offset + 3), // bfztName + cursor.isNull(offset + 4) ? null : cursor.getString(offset + 4), // coordinateX + cursor.isNull(offset + 5) ? null : cursor.getString(offset + 5), // coordinateY + cursor.isNull(offset + 6) ? null : cursor.getString(offset + 6), // deep + cursor.isNull(offset + 7) ? null : cursor.getString(offset + 7), // deptName + cursor.isNull(offset + 8) ? null : cursor.getString(offset + 8), // deptid + cursor.isNull(offset + 9) ? null : cursor.getString(offset + 9), // id + cursor.isNull(offset + 10) ? null : cursor.getString(offset + 10), // latBaidu + cursor.isNull(offset + 11) ? null : cursor.getString(offset + 11), // latGaode + cursor.isNull(offset + 12) ? null : cursor.getString(offset + 12), // lngBaidu + cursor.isNull(offset + 13) ? null : cursor.getString(offset + 13), // lngGaode + cursor.isNull(offset + 14) ? null : cursor.getString(offset + 14), // notes + cursor.isNull(offset + 15) ? null : cursor.getString(offset + 15), // photos + cursor.isNull(offset + 16) ? null : cursor.getString(offset + 16), // position + cursor.isNull(offset + 17) ? null : cursor.getString(offset + 17), // staff + cursor.isNull(offset + 18) ? null : cursor.getString(offset + 18), // tel + cursor.isNull(offset + 19) ? null : cursor.getString(offset + 19), // ts + cursor.isNull(offset + 20) ? null : cursor.getString(offset + 20), // valid + cursor.isNull(offset + 21) ? null : cursor.getString(offset + 21), // watchData + cursor.isNull(offset + 22) ? null : cursor.getString(offset + 22), // wellCode + cursor.isNull(offset + 23) ? null : cursor.getString(offset + 23), // wellName + cursor.isNull(offset + 24) ? null : cursor.getString(offset + 24), // wellType + cursor.isNull(offset + 25) ? null : cursor.getString(offset + 25) // wellTypeName ); return entity; } - + @Override public void readEntity(Cursor cursor, MapWellLocalBean entity, int offset) { entity.setKId(cursor.isNull(offset + 0) ? null : cursor.getLong(offset + 0)); @@ -440,17 +435,17 @@ entity.setWellName(cursor.isNull(offset + 23) ? null : cursor.getString(offset + 23)); entity.setWellType(cursor.isNull(offset + 24) ? null : cursor.getString(offset + 24)); entity.setWellTypeName(cursor.isNull(offset + 25) ? null : cursor.getString(offset + 25)); - } - + } + @Override protected final Long updateKeyAfterInsert(MapWellLocalBean entity, long rowId) { entity.setKId(rowId); return rowId; } - + @Override public Long getKey(MapWellLocalBean entity) { - if (entity != null) { + if(entity != null) { return entity.getKId(); } else { return null; @@ -466,5 +461,5 @@ protected final boolean isEntityUpdateable() { return true; } - + } diff --git a/app/src/main/java/com/casic/app/smartwell/greendao/NoticeLocaleBeanDao.java b/app/src/main/java/com/casic/app/smartwell/greendao/NoticeLocaleBeanDao.java index 64312ed..deb2d49 100644 --- a/app/src/main/java/com/casic/app/smartwell/greendao/NoticeLocaleBeanDao.java +++ b/app/src/main/java/com/casic/app/smartwell/greendao/NoticeLocaleBeanDao.java @@ -12,10 +12,9 @@ import org.greenrobot.greendao.internal.DaoConfig; // THIS CODE IS GENERATED BY greenDAO, DO NOT EDIT. - -/** +/** * DAO for table "NOTICE_LOCALE_BEAN". - */ +*/ public class NoticeLocaleBeanDao extends AbstractDao { public static final String TABLENAME = "NOTICE_LOCALE_BEAN"; @@ -43,16 +42,14 @@ public NoticeLocaleBeanDao(DaoConfig config) { super(config); } - + public NoticeLocaleBeanDao(DaoConfig config, DaoSession daoSession) { super(config, daoSession); } - /** - * Creates the underlying database table. - */ + /** Creates the underlying database table. */ public static void createTable(Database db, boolean ifNotExists) { - String constraint = ifNotExists ? "IF NOT EXISTS " : ""; + String constraint = ifNotExists? "IF NOT EXISTS ": ""; db.execSQL("CREATE TABLE " + constraint + "\"NOTICE_LOCALE_BEAN\" (" + // "\"_id\" INTEGER PRIMARY KEY AUTOINCREMENT ," + // 0: id "\"MESSAGE_ID\" TEXT UNIQUE ," + // 1: messageId @@ -68,9 +65,7 @@ "\"NOTICE_TIME\" TEXT);"); // 11: noticeTime } - /** - * Drops the underlying database table. - */ + /** Drops the underlying database table. */ public static void dropTable(Database db, boolean ifExists) { String sql = "DROP TABLE " + (ifExists ? "IF EXISTS " : "") + "\"NOTICE_LOCALE_BEAN\""; db.execSQL(sql); @@ -79,62 +74,62 @@ @Override protected final void bindValues(DatabaseStatement stmt, NoticeLocaleBean entity) { stmt.clearBindings(); - + Long id = entity.getId(); if (id != null) { stmt.bindLong(1, id); } - + String messageId = entity.getMessageId(); if (messageId != null) { stmt.bindString(2, messageId); } - + String appid = entity.getAppid(); if (appid != null) { stmt.bindString(3, appid); } - + String clientId = entity.getClientId(); if (clientId != null) { stmt.bindString(4, clientId); } - + String taskId = entity.getTaskId(); if (taskId != null) { stmt.bindString(5, taskId); } - + String userId = entity.getUserId(); if (userId != null) { stmt.bindString(6, userId); } - + String title = entity.getTitle(); if (title != null) { stmt.bindString(7, title); } - + String content = entity.getContent(); if (content != null) { stmt.bindString(8, content); } - + String deviceCode = entity.getDeviceCode(); if (deviceCode != null) { stmt.bindString(9, deviceCode); } - + String jobId = entity.getJobId(); if (jobId != null) { stmt.bindString(10, jobId); } - + String isRead = entity.getIsRead(); if (isRead != null) { stmt.bindString(11, isRead); } - + String noticeTime = entity.getNoticeTime(); if (noticeTime != null) { stmt.bindString(12, noticeTime); @@ -144,62 +139,62 @@ @Override protected final void bindValues(SQLiteStatement stmt, NoticeLocaleBean entity) { stmt.clearBindings(); - + Long id = entity.getId(); if (id != null) { stmt.bindLong(1, id); } - + String messageId = entity.getMessageId(); if (messageId != null) { stmt.bindString(2, messageId); } - + String appid = entity.getAppid(); if (appid != null) { stmt.bindString(3, appid); } - + String clientId = entity.getClientId(); if (clientId != null) { stmt.bindString(4, clientId); } - + String taskId = entity.getTaskId(); if (taskId != null) { stmt.bindString(5, taskId); } - + String userId = entity.getUserId(); if (userId != null) { stmt.bindString(6, userId); } - + String title = entity.getTitle(); if (title != null) { stmt.bindString(7, title); } - + String content = entity.getContent(); if (content != null) { stmt.bindString(8, content); } - + String deviceCode = entity.getDeviceCode(); if (deviceCode != null) { stmt.bindString(9, deviceCode); } - + String jobId = entity.getJobId(); if (jobId != null) { stmt.bindString(10, jobId); } - + String isRead = entity.getIsRead(); if (isRead != null) { stmt.bindString(11, isRead); } - + String noticeTime = entity.getNoticeTime(); if (noticeTime != null) { stmt.bindString(12, noticeTime); @@ -209,27 +204,27 @@ @Override public Long readKey(Cursor cursor, int offset) { return cursor.isNull(offset + 0) ? null : cursor.getLong(offset + 0); - } + } @Override public NoticeLocaleBean readEntity(Cursor cursor, int offset) { NoticeLocaleBean entity = new NoticeLocaleBean( // - cursor.isNull(offset + 0) ? null : cursor.getLong(offset + 0), // id - cursor.isNull(offset + 1) ? null : cursor.getString(offset + 1), // messageId - cursor.isNull(offset + 2) ? null : cursor.getString(offset + 2), // appid - cursor.isNull(offset + 3) ? null : cursor.getString(offset + 3), // clientId - cursor.isNull(offset + 4) ? null : cursor.getString(offset + 4), // taskId - cursor.isNull(offset + 5) ? null : cursor.getString(offset + 5), // userId - cursor.isNull(offset + 6) ? null : cursor.getString(offset + 6), // title - cursor.isNull(offset + 7) ? null : cursor.getString(offset + 7), // content - cursor.isNull(offset + 8) ? null : cursor.getString(offset + 8), // deviceCode - cursor.isNull(offset + 9) ? null : cursor.getString(offset + 9), // jobId - cursor.isNull(offset + 10) ? null : cursor.getString(offset + 10), // isRead - cursor.isNull(offset + 11) ? null : cursor.getString(offset + 11) // noticeTime + cursor.isNull(offset + 0) ? null : cursor.getLong(offset + 0), // id + cursor.isNull(offset + 1) ? null : cursor.getString(offset + 1), // messageId + cursor.isNull(offset + 2) ? null : cursor.getString(offset + 2), // appid + cursor.isNull(offset + 3) ? null : cursor.getString(offset + 3), // clientId + cursor.isNull(offset + 4) ? null : cursor.getString(offset + 4), // taskId + cursor.isNull(offset + 5) ? null : cursor.getString(offset + 5), // userId + cursor.isNull(offset + 6) ? null : cursor.getString(offset + 6), // title + cursor.isNull(offset + 7) ? null : cursor.getString(offset + 7), // content + cursor.isNull(offset + 8) ? null : cursor.getString(offset + 8), // deviceCode + cursor.isNull(offset + 9) ? null : cursor.getString(offset + 9), // jobId + cursor.isNull(offset + 10) ? null : cursor.getString(offset + 10), // isRead + cursor.isNull(offset + 11) ? null : cursor.getString(offset + 11) // noticeTime ); return entity; } - + @Override public void readEntity(Cursor cursor, NoticeLocaleBean entity, int offset) { entity.setId(cursor.isNull(offset + 0) ? null : cursor.getLong(offset + 0)); @@ -244,17 +239,17 @@ entity.setJobId(cursor.isNull(offset + 9) ? null : cursor.getString(offset + 9)); entity.setIsRead(cursor.isNull(offset + 10) ? null : cursor.getString(offset + 10)); entity.setNoticeTime(cursor.isNull(offset + 11) ? null : cursor.getString(offset + 11)); - } - + } + @Override protected final Long updateKeyAfterInsert(NoticeLocaleBean entity, long rowId) { entity.setId(rowId); return rowId; } - + @Override public Long getKey(NoticeLocaleBean entity) { - if (entity != null) { + if(entity != null) { return entity.getId(); } else { return null; @@ -270,5 +265,5 @@ protected final boolean isEntityUpdateable() { return true; } - + } diff --git a/app/src/main/java/com/casic/app/smartwell/greendao/PipeLocalBeanDao.java b/app/src/main/java/com/casic/app/smartwell/greendao/PipeLocalBeanDao.java index aab4d3f..df5515a 100644 --- a/app/src/main/java/com/casic/app/smartwell/greendao/PipeLocalBeanDao.java +++ b/app/src/main/java/com/casic/app/smartwell/greendao/PipeLocalBeanDao.java @@ -12,10 +12,9 @@ import org.greenrobot.greendao.internal.DaoConfig; // THIS CODE IS GENERATED BY greenDAO, DO NOT EDIT. - -/** +/** * DAO for table "PIPE_LOCAL_BEAN". - */ +*/ public class PipeLocalBeanDao extends AbstractDao { public static final String TABLENAME = "PIPE_LOCAL_BEAN"; @@ -37,16 +36,14 @@ public PipeLocalBeanDao(DaoConfig config) { super(config); } - + public PipeLocalBeanDao(DaoConfig config, DaoSession daoSession) { super(config, daoSession); } - /** - * Creates the underlying database table. - */ + /** Creates the underlying database table. */ public static void createTable(Database db, boolean ifNotExists) { - String constraint = ifNotExists ? "IF NOT EXISTS " : ""; + String constraint = ifNotExists? "IF NOT EXISTS ": ""; db.execSQL("CREATE TABLE " + constraint + "\"PIPE_LOCAL_BEAN\" (" + // "\"_id\" INTEGER PRIMARY KEY AUTOINCREMENT ," + // 0: id "\"PIPE_CODE\" TEXT," + // 1: pipeCode @@ -56,9 +53,7 @@ "\"START_LONGITUDE_GD\" TEXT);"); // 5: startLongitudeGd } - /** - * Drops the underlying database table. - */ + /** Drops the underlying database table. */ public static void dropTable(Database db, boolean ifExists) { String sql = "DROP TABLE " + (ifExists ? "IF EXISTS " : "") + "\"PIPE_LOCAL_BEAN\""; db.execSQL(sql); @@ -67,32 +62,32 @@ @Override protected final void bindValues(DatabaseStatement stmt, PipeLocalBean entity) { stmt.clearBindings(); - + Long id = entity.getId(); if (id != null) { stmt.bindLong(1, id); } - + String pipeCode = entity.getPipeCode(); if (pipeCode != null) { stmt.bindString(2, pipeCode); } - + String endLatitudeGd = entity.getEndLatitudeGd(); if (endLatitudeGd != null) { stmt.bindString(3, endLatitudeGd); } - + String endLongitudeGd = entity.getEndLongitudeGd(); if (endLongitudeGd != null) { stmt.bindString(4, endLongitudeGd); } - + String startLatitudeGd = entity.getStartLatitudeGd(); if (startLatitudeGd != null) { stmt.bindString(5, startLatitudeGd); } - + String startLongitudeGd = entity.getStartLongitudeGd(); if (startLongitudeGd != null) { stmt.bindString(6, startLongitudeGd); @@ -102,32 +97,32 @@ @Override protected final void bindValues(SQLiteStatement stmt, PipeLocalBean entity) { stmt.clearBindings(); - + Long id = entity.getId(); if (id != null) { stmt.bindLong(1, id); } - + String pipeCode = entity.getPipeCode(); if (pipeCode != null) { stmt.bindString(2, pipeCode); } - + String endLatitudeGd = entity.getEndLatitudeGd(); if (endLatitudeGd != null) { stmt.bindString(3, endLatitudeGd); } - + String endLongitudeGd = entity.getEndLongitudeGd(); if (endLongitudeGd != null) { stmt.bindString(4, endLongitudeGd); } - + String startLatitudeGd = entity.getStartLatitudeGd(); if (startLatitudeGd != null) { stmt.bindString(5, startLatitudeGd); } - + String startLongitudeGd = entity.getStartLongitudeGd(); if (startLongitudeGd != null) { stmt.bindString(6, startLongitudeGd); @@ -137,21 +132,21 @@ @Override public Long readKey(Cursor cursor, int offset) { return cursor.isNull(offset + 0) ? null : cursor.getLong(offset + 0); - } + } @Override public PipeLocalBean readEntity(Cursor cursor, int offset) { PipeLocalBean entity = new PipeLocalBean( // - cursor.isNull(offset + 0) ? null : cursor.getLong(offset + 0), // id - cursor.isNull(offset + 1) ? null : cursor.getString(offset + 1), // pipeCode - cursor.isNull(offset + 2) ? null : cursor.getString(offset + 2), // endLatitudeGd - cursor.isNull(offset + 3) ? null : cursor.getString(offset + 3), // endLongitudeGd - cursor.isNull(offset + 4) ? null : cursor.getString(offset + 4), // startLatitudeGd - cursor.isNull(offset + 5) ? null : cursor.getString(offset + 5) // startLongitudeGd + cursor.isNull(offset + 0) ? null : cursor.getLong(offset + 0), // id + cursor.isNull(offset + 1) ? null : cursor.getString(offset + 1), // pipeCode + cursor.isNull(offset + 2) ? null : cursor.getString(offset + 2), // endLatitudeGd + cursor.isNull(offset + 3) ? null : cursor.getString(offset + 3), // endLongitudeGd + cursor.isNull(offset + 4) ? null : cursor.getString(offset + 4), // startLatitudeGd + cursor.isNull(offset + 5) ? null : cursor.getString(offset + 5) // startLongitudeGd ); return entity; } - + @Override public void readEntity(Cursor cursor, PipeLocalBean entity, int offset) { entity.setId(cursor.isNull(offset + 0) ? null : cursor.getLong(offset + 0)); @@ -160,17 +155,17 @@ entity.setEndLongitudeGd(cursor.isNull(offset + 3) ? null : cursor.getString(offset + 3)); entity.setStartLatitudeGd(cursor.isNull(offset + 4) ? null : cursor.getString(offset + 4)); entity.setStartLongitudeGd(cursor.isNull(offset + 5) ? null : cursor.getString(offset + 5)); - } - + } + @Override protected final Long updateKeyAfterInsert(PipeLocalBean entity, long rowId) { entity.setId(rowId); return rowId; } - + @Override public Long getKey(PipeLocalBean entity) { - if (entity != null) { + if(entity != null) { return entity.getId(); } else { return null; @@ -186,5 +181,5 @@ protected final boolean isEntityUpdateable() { return true; } - + } diff --git a/app/src/main/java/com/casic/app/smartwell/view/ChangePasswordActivity.kt b/app/src/main/java/com/casic/app/smartwell/view/ChangePasswordActivity.kt index 8e41039..9f1dd40 100644 --- a/app/src/main/java/com/casic/app/smartwell/view/ChangePasswordActivity.kt +++ b/app/src/main/java/com/casic/app/smartwell/view/ChangePasswordActivity.kt @@ -14,7 +14,7 @@ import com.pengxh.kt.lite.extensions.show import com.pengxh.kt.lite.utils.ActivityStackManager import com.pengxh.kt.lite.utils.LoadState -import com.pengxh.kt.lite.utils.LoadingDialogHub +import com.pengxh.kt.lite.utils.LoadingDialog import com.pengxh.kt.lite.widget.TitleBarView import java.nio.charset.StandardCharsets @@ -46,15 +46,15 @@ override fun observeRequestState() { userViewModel.loadState.observe(this) { when (it) { - is LoadState.Loading -> LoadingDialogHub.show(this, "修改中,请稍后") + is LoadState.Loading -> LoadingDialog.show(this, "修改中,请稍后") is LoadState.Success -> { - LoadingDialogHub.dismiss() + LoadingDialog.dismiss() AuthenticationHelper.removeToken() this.navigatePageTo() ActivityStackManager.finishAllActivity() } - else -> LoadingDialogHub.dismiss() + else -> LoadingDialog.dismiss() } } } diff --git a/app/src/main/java/com/casic/app/smartwell/view/DeployedWellActivity.kt b/app/src/main/java/com/casic/app/smartwell/view/DeployedWellActivity.kt index fb4339c..28a5078 100644 --- a/app/src/main/java/com/casic/app/smartwell/view/DeployedWellActivity.kt +++ b/app/src/main/java/com/casic/app/smartwell/view/DeployedWellActivity.kt @@ -83,8 +83,8 @@ } //添加分割线 - binding.deployedListView.addItemDecoration( - RecyclerViewItemOffsets(0, 5, 0, 5) + binding.recyclerView.addItemDecoration( + RecyclerViewItemOffsets(0, 7, 0, 7) ) } @@ -149,12 +149,11 @@ } else { item.deep.toString() + "m" } - viewHolder.setText(R.id.wellNameView, item.wellName) + viewHolder.setText(R.id.wellTypeView, item.wellTypeName) .setText(R.id.wellDepthView, "深:${deep}") .setText(R.id.wellCodeView, "点位编号:${item.wellCode}") - .setText(R.id.wellTypeView, "点位类型:${item.wellTypeName}") .setText(R.id.ownerShipView, "权属单位:${item.deptName}") - .setText(R.id.wellLocationView, "点位置:${item.position}") + .setText(R.id.wellLocationView, "点位位置:${item.position}") .setOnClickListener( R.id.operationButton, object : View.OnClickListener { override fun onClick(v: View?) { @@ -207,7 +206,7 @@ }) } } - binding.deployedListView.adapter = deployAdapter + binding.recyclerView.adapter = deployAdapter deployAdapter.setOnItemClickedListener(object : NormalRecyclerAdapter.OnItemClickedListener { override fun onItemClicked(position: Int, t: WellListModel.DataBean.RowsBean) { diff --git a/app/src/main/java/com/casic/app/smartwell/view/LoginActivity.kt b/app/src/main/java/com/casic/app/smartwell/view/LoginActivity.kt index e4bb0e3..834527b 100644 --- a/app/src/main/java/com/casic/app/smartwell/view/LoginActivity.kt +++ b/app/src/main/java/com/casic/app/smartwell/view/LoginActivity.kt @@ -21,7 +21,7 @@ import com.pengxh.kt.lite.extensions.navigatePageTo import com.pengxh.kt.lite.extensions.readAssetsFile import com.pengxh.kt.lite.extensions.show -import com.pengxh.kt.lite.utils.LoadingDialogHub +import com.pengxh.kt.lite.utils.LoadingDialog import com.pengxh.kt.lite.utils.SaveKeyValues import kotlinx.coroutines.Dispatchers import kotlinx.coroutines.launch @@ -106,11 +106,11 @@ override fun observeRequestState() { authenticateViewModel.loadState.observe(this) { - LoadingDialogHub.show(this, "登录中,请稍后") + LoadingDialog.show(this, "登录中,请稍后") } loginViewModel.loadState.observe(this) { - LoadingDialogHub.dismiss() + LoadingDialog.dismiss() } } diff --git a/app/src/main/java/com/casic/app/smartwell/view/OrderCompletedDetailActivity.kt b/app/src/main/java/com/casic/app/smartwell/view/OrderCompletedDetailActivity.kt index db8ad1f..75cd905 100644 --- a/app/src/main/java/com/casic/app/smartwell/view/OrderCompletedDetailActivity.kt +++ b/app/src/main/java/com/casic/app/smartwell/view/OrderCompletedDetailActivity.kt @@ -17,7 +17,7 @@ import com.pengxh.kt.lite.extensions.show import com.pengxh.kt.lite.utils.Constant import com.pengxh.kt.lite.utils.LoadState -import com.pengxh.kt.lite.utils.LoadingDialogHub +import com.pengxh.kt.lite.utils.LoadingDialog import com.pengxh.kt.lite.widget.TitleBarView import com.pengxh.kt.lite.widget.dialog.AlertMessageDialog @@ -44,7 +44,7 @@ } override fun initOnCreate(savedInstanceState: Bundle?) { - val jobId = intent.getStringExtra(Constant.INTENT_PARAM)!! + val jobId = intent.getStringExtra(Constant.INTENT_PARAM_KEY)!! orderViewModel = ViewModelProvider(this)[OrderViewModel::class.java] orderViewModel.getWorkOrderDetail(jobId) orderViewModel.detailModel.observe(this) { @@ -154,8 +154,8 @@ override fun observeRequestState() { orderViewModel.loadState.observe(this) { when (it) { - is LoadState.Loading -> LoadingDialogHub.show(this, "数据加载中,请稍后") - else -> LoadingDialogHub.dismiss() + is LoadState.Loading -> LoadingDialog.show(this, "数据加载中,请稍后") + else -> LoadingDialog.dismiss() } } } diff --git a/app/src/main/java/com/casic/app/smartwell/view/OrderInHandleDetailActivity.kt b/app/src/main/java/com/casic/app/smartwell/view/OrderInHandleDetailActivity.kt index d70a979..04a7d5d 100644 --- a/app/src/main/java/com/casic/app/smartwell/view/OrderInHandleDetailActivity.kt +++ b/app/src/main/java/com/casic/app/smartwell/view/OrderInHandleDetailActivity.kt @@ -38,7 +38,7 @@ import com.pengxh.kt.lite.extensions.show import com.pengxh.kt.lite.utils.Constant import com.pengxh.kt.lite.utils.LoadState -import com.pengxh.kt.lite.utils.LoadingDialogHub +import com.pengxh.kt.lite.utils.LoadingDialog import com.pengxh.kt.lite.widget.TitleBarView import com.pengxh.kt.lite.widget.dialog.AlertControlDialog import com.pengxh.kt.lite.widget.dialog.AlertMessageDialog @@ -93,7 +93,7 @@ ) binding.addImageRecyclerView.adapter = imageAdapter - val jobId = intent.getStringExtra(Constant.INTENT_PARAM)!!//初始化图片九宫格 + val jobId = intent.getStringExtra(Constant.INTENT_PARAM_KEY)!!//初始化图片九宫格 orderViewModel.getWorkOrderDetail(jobId) orderViewModel.detailModel.observe(this) { if (it.code == 200) { @@ -312,41 +312,41 @@ override fun observeRequestState() { orderViewModel.loadState.observe(this) { when (it) { - is LoadState.Loading -> LoadingDialogHub.show(this, "数据加载中,请稍后") - else -> LoadingDialogHub.dismiss() + is LoadState.Loading -> LoadingDialog.show(this, "数据加载中,请稍后") + else -> LoadingDialog.dismiss() } } uploadImageViewModel.loadState.observe(this) { when (it) { - LoadState.Loading -> LoadingDialogHub.show(this, "图片上传中,请稍后...") - else -> LoadingDialogHub.dismiss() + LoadState.Loading -> LoadingDialog.show(this, "图片上传中,请稍后...") + else -> LoadingDialog.dismiss() } } //转单状态处理 operationViewModel.loadState.observe(this) { when (it) { - is LoadState.Loading -> LoadingDialogHub.show(this, "转单中,请稍后") + is LoadState.Loading -> LoadingDialog.show(this, "转单中,请稍后") is LoadState.Success -> { - LoadingDialogHub.dismiss() + LoadingDialog.dismiss() this.finish() } - else -> LoadingDialogHub.dismiss() + else -> LoadingDialog.dismiss() } } //处理完成工单状态处理 operationViewModel.loadState.observe(this) { when (it) { - is LoadState.Loading -> LoadingDialogHub.show(this, "处理中,请稍后") + is LoadState.Loading -> LoadingDialog.show(this, "处理中,请稍后") is LoadState.Success -> { - LoadingDialogHub.dismiss() + LoadingDialog.dismiss() this.finish() } - else -> LoadingDialogHub.dismiss() + else -> LoadingDialog.dismiss() } } } diff --git a/app/src/main/java/com/casic/app/smartwell/view/OrderNotConfirmedDetailActivity.kt b/app/src/main/java/com/casic/app/smartwell/view/OrderNotConfirmedDetailActivity.kt index 8e036d2..687ec86 100644 --- a/app/src/main/java/com/casic/app/smartwell/view/OrderNotConfirmedDetailActivity.kt +++ b/app/src/main/java/com/casic/app/smartwell/view/OrderNotConfirmedDetailActivity.kt @@ -36,7 +36,7 @@ import com.pengxh.kt.lite.extensions.show import com.pengxh.kt.lite.utils.Constant import com.pengxh.kt.lite.utils.LoadState -import com.pengxh.kt.lite.utils.LoadingDialogHub +import com.pengxh.kt.lite.utils.LoadingDialog import com.pengxh.kt.lite.widget.TitleBarView import com.pengxh.kt.lite.widget.dialog.AlertControlDialog import com.pengxh.kt.lite.widget.dialog.AlertMessageDialog @@ -80,7 +80,7 @@ } override fun initOnCreate(savedInstanceState: Bundle?) { - val jobId = intent.getStringExtra(Constant.INTENT_PARAM)!! + val jobId = intent.getStringExtra(Constant.INTENT_PARAM_KEY)!! //初始化图片九宫格 //左外边距,左内边距,右内边距,右外边距 val viewWidth = getScreenWidth() - (10 + 10 + 10 + 10).dp2px(this) @@ -263,41 +263,41 @@ //数据加载状态处理 orderViewModel.loadState.observe(this) { when (it) { - is LoadState.Loading -> LoadingDialogHub.show(this, "数据加载中,请稍后") - else -> LoadingDialogHub.dismiss() + is LoadState.Loading -> LoadingDialog.show(this, "数据加载中,请稍后") + else -> LoadingDialog.dismiss() } } uploadImageViewModel.loadState.observe(this) { when (it) { - LoadState.Loading -> LoadingDialogHub.show(this, "图片上传中,请稍后") - else -> LoadingDialogHub.dismiss() + LoadState.Loading -> LoadingDialog.show(this, "图片上传中,请稍后") + else -> LoadingDialog.dismiss() } } //转单状态处理 operationViewModel.loadState.observe(this) { when (it) { - is LoadState.Loading -> LoadingDialogHub.show(this, "转单中,请稍后") + is LoadState.Loading -> LoadingDialog.show(this, "转单中,请稍后") is LoadState.Success -> { - LoadingDialogHub.dismiss() + LoadingDialog.dismiss() this.finish() } - else -> LoadingDialogHub.dismiss() + else -> LoadingDialog.dismiss() } } //确认工单状态处理 operationViewModel.loadState.observe(this) { when (it) { - is LoadState.Loading -> LoadingDialogHub.show(this, "处理中,请稍后") + is LoadState.Loading -> LoadingDialog.show(this, "处理中,请稍后") is LoadState.Success -> { - LoadingDialogHub.dismiss() + LoadingDialog.dismiss() this.finish() } - else -> LoadingDialogHub.dismiss() + else -> LoadingDialog.dismiss() } } } diff --git a/app/src/main/java/com/casic/app/smartwell/view/OrderNotProcessedDetailActivity.kt b/app/src/main/java/com/casic/app/smartwell/view/OrderNotProcessedDetailActivity.kt index d3f22dc..0c97a52 100644 --- a/app/src/main/java/com/casic/app/smartwell/view/OrderNotProcessedDetailActivity.kt +++ b/app/src/main/java/com/casic/app/smartwell/view/OrderNotProcessedDetailActivity.kt @@ -18,7 +18,7 @@ import com.pengxh.kt.lite.extensions.show import com.pengxh.kt.lite.utils.Constant import com.pengxh.kt.lite.utils.LoadState -import com.pengxh.kt.lite.utils.LoadingDialogHub +import com.pengxh.kt.lite.utils.LoadingDialog import com.pengxh.kt.lite.widget.TitleBarView import com.pengxh.kt.lite.widget.dialog.AlertControlDialog import com.pengxh.kt.lite.widget.dialog.AlertMessageDialog @@ -50,7 +50,7 @@ } override fun initOnCreate(savedInstanceState: Bundle?) { - this.jobId = intent.getStringExtra(Constant.INTENT_PARAM)!! + this.jobId = intent.getStringExtra(Constant.INTENT_PARAM_KEY)!! orderViewModel = ViewModelProvider(this)[OrderViewModel::class.java] operationViewModel = ViewModelProvider(this)[OperationViewModel::class.java] wellViewModel = ViewModelProvider(this)[WellViewModel::class.java] @@ -162,21 +162,21 @@ //数据加载状态处理 orderViewModel.loadState.observe(this) { when (it) { - is LoadState.Loading -> LoadingDialogHub.show(this, "数据加载中,请稍后") - else -> LoadingDialogHub.dismiss() + is LoadState.Loading -> LoadingDialog.show(this, "数据加载中,请稍后") + else -> LoadingDialog.dismiss() } } //接单状态处理 operationViewModel.loadState.observe(this) { when (it) { - is LoadState.Loading -> LoadingDialogHub.show(this, "接单中,请稍后") + is LoadState.Loading -> LoadingDialog.show(this, "接单中,请稍后") is LoadState.Success -> { - LoadingDialogHub.dismiss() + LoadingDialog.dismiss() this.finish() } - else -> LoadingDialogHub.dismiss() + else -> LoadingDialog.dismiss() } } } diff --git a/app/src/main/java/com/casic/app/smartwell/view/SearchResultActivity.kt b/app/src/main/java/com/casic/app/smartwell/view/SearchResultActivity.kt index 6a92917..4f3a674 100644 --- a/app/src/main/java/com/casic/app/smartwell/view/SearchResultActivity.kt +++ b/app/src/main/java/com/casic/app/smartwell/view/SearchResultActivity.kt @@ -19,7 +19,7 @@ import com.pengxh.kt.lite.extensions.show import com.pengxh.kt.lite.utils.Constant import com.pengxh.kt.lite.utils.LoadState -import com.pengxh.kt.lite.utils.LoadingDialogHub +import com.pengxh.kt.lite.utils.LoadingDialog import com.pengxh.kt.lite.utils.WeakReferenceHandler import com.pengxh.kt.lite.widget.TitleBarView import com.pengxh.kt.lite.widget.dialog.AlertControlDialog @@ -56,7 +56,7 @@ } override fun initOnCreate(savedInstanceState: Bundle?) { - args = intent.getStringArrayListExtra(Constant.INTENT_PARAM)!! + args = intent.getStringArrayListExtra(Constant.INTENT_PARAM_KEY)!! orderViewModel = ViewModelProvider(this)[OrderViewModel::class.java] operationViewModel = ViewModelProvider(this)[OperationViewModel::class.java] @@ -101,24 +101,24 @@ } } - binding.resultRecyclerView.addItemDecoration( - RecyclerViewItemOffsets(0, 5, 0, 5) + binding.recyclerView.addItemDecoration( + RecyclerViewItemOffsets(0, 7, 0, 7) ) } override fun observeRequestState() { orderViewModel.loadState.observe(this) { when (it) { - is LoadState.Loading -> LoadingDialogHub.show(this, "数据加载中,请稍后") - else -> LoadingDialogHub.dismiss() + is LoadState.Loading -> LoadingDialog.show(this, "数据加载中,请稍后") + else -> LoadingDialog.dismiss() } } //接单状态处理 operationViewModel.loadState.observe(this) { when (it) { - is LoadState.Loading -> LoadingDialogHub.show(this, "接单中,请稍后") + is LoadState.Loading -> LoadingDialog.show(this, "接单中,请稍后") is LoadState.Success -> { - LoadingDialogHub.dismiss() + LoadingDialog.dismiss() //接单成功之后刷新列表 dataBeans.removeAt(clickedPosition) searchResultAdapter.notifyItemRemoved(clickedPosition) @@ -127,7 +127,7 @@ ) } - else -> LoadingDialogHub.dismiss() + else -> LoadingDialog.dismiss() } } } @@ -162,7 +162,7 @@ } else { binding.emptyInclude.emptyView.hide() searchResultAdapter = SearchResultAdapter(this, dataBeans) - binding.resultRecyclerView.adapter = searchResultAdapter + binding.recyclerView.adapter = searchResultAdapter searchResultAdapter.setOnItemClickListener(object : SearchResultAdapter.OnItemClickListener { override fun onClicked(position: Int) { diff --git a/app/src/main/java/com/casic/app/smartwell/view/UnDeployWellActivity.kt b/app/src/main/java/com/casic/app/smartwell/view/UnDeployWellActivity.kt index 7f7cd3c..555c278 100644 --- a/app/src/main/java/com/casic/app/smartwell/view/UnDeployWellActivity.kt +++ b/app/src/main/java/com/casic/app/smartwell/view/UnDeployWellActivity.kt @@ -81,8 +81,8 @@ } } - binding.undeployListView.addItemDecoration( - RecyclerViewItemOffsets(0, 5, 0, 5) + binding.recyclerView.addItemDecoration( + RecyclerViewItemOffsets(0, 7, 0, 7) ) } @@ -147,12 +147,11 @@ } else { item.deep.toString() + "m" } - viewHolder.setText(R.id.wellNameView, item.wellName) + viewHolder.setText(R.id.wellTypeView, item.wellTypeName) .setText(R.id.wellDepthView, "深:${deep}") .setText(R.id.wellCodeView, "点位编号:${item.wellCode}") - .setText(R.id.wellTypeView, "点位类型:${item.wellTypeName}") .setText(R.id.ownerShipView, "权属单位:${item.deptName}") - .setText(R.id.wellLocationView, "点位置:${item.position}") + .setText(R.id.wellLocationView, "点位位置:${item.position}") .setOnClickListener( R.id.operationButton, object : View.OnClickListener { override fun onClick(v: View?) { @@ -185,7 +184,7 @@ ) } } - binding.undeployListView.adapter = unDeployAdapter + binding.recyclerView.adapter = unDeployAdapter unDeployAdapter.setOnItemClickedListener(object : NormalRecyclerAdapter.OnItemClickedListener { override fun onItemClicked(position: Int, t: WellListModel.DataBean.RowsBean) { diff --git a/app/src/main/java/com/casic/app/smartwell/view/WellDetailActivity.kt b/app/src/main/java/com/casic/app/smartwell/view/WellDetailActivity.kt index b50d067..eb8b468 100644 --- a/app/src/main/java/com/casic/app/smartwell/view/WellDetailActivity.kt +++ b/app/src/main/java/com/casic/app/smartwell/view/WellDetailActivity.kt @@ -16,7 +16,7 @@ import com.pengxh.kt.lite.extensions.show import com.pengxh.kt.lite.utils.Constant import com.pengxh.kt.lite.utils.LoadState -import com.pengxh.kt.lite.utils.LoadingDialogHub +import com.pengxh.kt.lite.utils.LoadingDialog import com.pengxh.kt.lite.widget.TitleBarView import com.pengxh.kt.lite.widget.dialog.AlertMessageDialog @@ -44,7 +44,7 @@ } override fun initOnCreate(savedInstanceState: Bundle?) { - val wellId = intent.getStringExtra(Constant.INTENT_PARAM)!! + val wellId = intent.getStringExtra(Constant.INTENT_PARAM_KEY)!! wellViewModel = ViewModelProvider(this)[WellViewModel::class.java] wellViewModel.getWellDetail(wellId) wellViewModel.wellDetailModel.observe(this) { @@ -132,8 +132,8 @@ override fun observeRequestState() { wellViewModel.loadState.observe(this) { when (it) { - is LoadState.Loading -> LoadingDialogHub.show(this, "数据加载中,请稍后") - else -> LoadingDialogHub.dismiss() + is LoadState.Loading -> LoadingDialog.show(this, "数据加载中,请稍后") + else -> LoadingDialog.dismiss() } } } diff --git a/app/src/main/java/com/casic/app/smartwell/view/WellManagementActivity.kt b/app/src/main/java/com/casic/app/smartwell/view/WellManagementActivity.kt index 084da95..457096b 100644 --- a/app/src/main/java/com/casic/app/smartwell/view/WellManagementActivity.kt +++ b/app/src/main/java/com/casic/app/smartwell/view/WellManagementActivity.kt @@ -94,8 +94,8 @@ } } - binding.wellListView.addItemDecoration( - RecyclerViewItemOffsets(0, 5, 0, 5) + binding.recyclerView.addItemDecoration( + RecyclerViewItemOffsets(0, 7, 0, 7) ) } @@ -175,13 +175,12 @@ } else { item.deep.toString() + "m" } - viewHolder.setText(R.id.wellNameView, item.wellName) + viewHolder.setText(R.id.wellTypeView, item.wellTypeName) .setText(R.id.wellStateView, "已${item.bfztName}") .setText(R.id.wellDepthView, "深:${deep}") .setText(R.id.wellCodeView, "点位编号:${item.wellCode}") - .setText(R.id.wellTypeView, "点位类型:${item.wellTypeName}") .setText(R.id.ownerShipView, "权属单位:${item.deptName}") - .setText(R.id.wellLocationView, "点位置:${item.position}") + .setText(R.id.wellLocationView, "点位位置:${item.position}") .setOnClickListener( R.id.navigationButton, object : View.OnClickListener { override fun onClick(v: View?) { @@ -200,7 +199,7 @@ ) } } - binding.wellListView.adapter = wellListAdapter + binding.recyclerView.adapter = wellListAdapter wellListAdapter.setOnItemClickedListener(object : NormalRecyclerAdapter.OnItemClickedListener { override fun onItemClicked(position: Int, t: WellListModel.DataBean.RowsBean) { diff --git a/app/src/main/java/com/casic/app/smartwell/view/WellMonitorActivity.kt b/app/src/main/java/com/casic/app/smartwell/view/WellMonitorActivity.kt index e3573eb..b87bdb7 100644 --- a/app/src/main/java/com/casic/app/smartwell/view/WellMonitorActivity.kt +++ b/app/src/main/java/com/casic/app/smartwell/view/WellMonitorActivity.kt @@ -11,7 +11,7 @@ import com.pengxh.kt.lite.base.KotlinBaseActivity import com.pengxh.kt.lite.utils.Constant import com.pengxh.kt.lite.utils.LoadState -import com.pengxh.kt.lite.utils.LoadingDialogHub +import com.pengxh.kt.lite.utils.LoadingDialog import com.pengxh.kt.lite.widget.TitleBarView class WellMonitorActivity : KotlinBaseActivity() { @@ -36,7 +36,7 @@ } override fun initOnCreate(savedInstanceState: Bundle?) { - val wellId = intent.getStringExtra(Constant.INTENT_PARAM)!! + val wellId = intent.getStringExtra(Constant.INTENT_PARAM_KEY)!! wellViewModel = ViewModelProvider(this)[WellViewModel::class.java] wellViewModel.getMonitorResult(wellId) wellViewModel.monitorModel.observe(this) { @@ -56,8 +56,8 @@ override fun observeRequestState() { wellViewModel.loadState.observe(this) { when (it) { - is LoadState.Loading -> LoadingDialogHub.show(this, "数据加载中,请稍后") - else -> LoadingDialogHub.dismiss() + is LoadState.Loading -> LoadingDialog.show(this, "数据加载中,请稍后") + else -> LoadingDialog.dismiss() } } } diff --git a/app/src/main/java/com/casic/app/smartwell/view/WellOperationActivity.kt b/app/src/main/java/com/casic/app/smartwell/view/WellOperationActivity.kt index 8d333bf..347ebb6 100644 --- a/app/src/main/java/com/casic/app/smartwell/view/WellOperationActivity.kt +++ b/app/src/main/java/com/casic/app/smartwell/view/WellOperationActivity.kt @@ -23,7 +23,7 @@ import com.pengxh.kt.lite.extensions.navigatePageTo import com.pengxh.kt.lite.extensions.show import com.pengxh.kt.lite.utils.LoadState -import com.pengxh.kt.lite.utils.LoadingDialogHub +import com.pengxh.kt.lite.utils.LoadingDialog import com.pengxh.kt.lite.utils.WeakReferenceHandler import com.pengxh.kt.lite.widget.dialog.AlertControlDialog @@ -109,8 +109,8 @@ } } - binding.operationListView.addItemDecoration( - RecyclerViewItemOffsets(0, 5, 0, 5) + binding.recyclerView.addItemDecoration( + RecyclerViewItemOffsets(0, 7, 0, 7) ) } @@ -123,13 +123,13 @@ override fun observeRequestState() { wellViewModel.loadState.observe(this) { when (it) { - is LoadState.Loading -> LoadingDialogHub.show(this, "处理中,请稍后") + is LoadState.Loading -> LoadingDialog.show(this, "处理中,请稍后") is LoadState.Success -> { - LoadingDialogHub.dismiss() + LoadingDialog.dismiss() wellOperationAdapter.notifyItemChanged(clickedPosition) } - else -> LoadingDialogHub.dismiss() + else -> LoadingDialog.dismiss() } } } @@ -203,24 +203,23 @@ if (item.bfztName == "布防") { viewHolder.setImageResource( R.id.wellStateView, R.drawable.bg_solid_text_green_radius_5 - ).setText(R.id.wellStateView, "撤防") + ).setText(R.id.operationButton, "撤防") } else { viewHolder.setImageResource( R.id.wellStateView, R.drawable.bg_solid_text_red_radius_5 - ).setText(R.id.wellStateView, "布防") + ).setText(R.id.operationButton, "布防") } val deep = if (item.deep.toString().isBlank()) { "未知" } else { item.deep.toString() + "m" } - viewHolder.setText(R.id.wellNameView, item.wellName) + viewHolder.setText(R.id.wellTypeView, item.wellTypeName) .setText(R.id.wellStateView, "已${item.bfztName}") .setText(R.id.wellDepthView, "深:${deep}") .setText(R.id.wellCodeView, "点位编号:${item.wellCode}") - .setText(R.id.wellTypeView, "点位类型:${item.wellTypeName}") .setText(R.id.ownerShipView, "权属单位:${item.deptName}") - .setText(R.id.wellLocationView, "点位置:${item.position}") + .setText(R.id.wellLocationView, "点位位置:${item.position}") .setOnClickListener( R.id.operationButton, object : View.OnClickListener { override fun onClick(v: View?) { @@ -280,7 +279,7 @@ ) } } - binding.operationListView.adapter = wellOperationAdapter + binding.recyclerView.adapter = wellOperationAdapter wellOperationAdapter.setOnItemClickedListener(object : NormalRecyclerAdapter.OnItemClickedListener { override fun onItemClicked(position: Int, t: WellListModel.DataBean.RowsBean) { diff --git a/app/src/main/res/drawable/ic_down.xml b/app/src/main/res/drawable/ic_down.xml index 20e6476..6987e6c 100644 --- a/app/src/main/res/drawable/ic_down.xml +++ b/app/src/main/res/drawable/ic_down.xml @@ -1,6 +1,6 @@ + + diff --git a/app/src/main/res/layout/activity_about_us.xml b/app/src/main/res/layout/activity_about_us.xml index 9091a00..d5fbd0d 100644 --- a/app/src/main/res/layout/activity_about_us.xml +++ b/app/src/main/res/layout/activity_about_us.xml @@ -12,13 +12,7 @@ android:layout_width="match_parent" android:layout_height="wrap_content" android:background="@color/mainThemeColor" - app:tbv_left_image="@drawable/ic_title_left" - app:tbv_only_show_title="false" - app:tbv_show_left_image="true" - app:tbv_show_right_image="false" - app:tbv_text="关于我们" - app:tbv_text_color="@color/white" - app:tbv_text_size="@dimen/sp_18" /> + app:tbv_text="关于我们" /> + app:tbv_text="修改密码" /> + app:tbv_text="布防列表" /> + app:tbv_text="帮助中心" /> + app:tbv_text="工单详情" /> + app:tbv_text="工单详情" /> + app:tbv_text="工单详情" /> + app:tbv_text="工单详情" /> + app:tbv_text="超时工单" /> + app:tbv_text="工单查询" /> + app:tbv_text="查询结果" /> + app:tbv_text="撤防列表" /> + app:tbv_text="个人资料" /> + app:tbv_text="点位详情" /> + app:tbv_text="监控内容" /> - - - - - - + android:layout_height="wrap_content" + android:background="@color/mainThemeColor" + app:tbv_show_left_image="false" + app:tbv_show_right_image="true" + app:tbv_text="首页" /> - + + android:value="ee96d8b5e12de3fbb29949efd57418a8" /> () @@ -150,7 +158,7 @@ val cameraPosition = CameraPosition(centerLatLng, 14f, 0f, 0f) val cameraUpdate = CameraUpdateFactory.newCameraPosition(cameraPosition) withContext(Dispatchers.Main) { - LoadingDialogHub.dismiss() + LoadingDialog.dismiss() aMap.animateCamera(cameraUpdate, 1500, null) } } @@ -239,11 +247,6 @@ } override fun initEvent() { - binding.rightOptionView.setOnClickListener { - val x = binding.rightOptionView.width - easyPopupWindow.width - easyPopupWindow.showAsDropDown(binding.rightOptionView, x, 0) - } - //撤防点位 binding.unDeployedLayout.setOnClickListener { requireContext().navigatePageTo() @@ -263,11 +266,11 @@ override fun observeRequestState() { wellViewModel.loadState.observe(this) { when (it) { - is LoadState.Loading -> LoadingDialogHub.show( + is LoadState.Loading -> LoadingDialog.show( requireActivity(), "数据加载中,请稍后..." ) - else -> LoadingDialogHub.dismiss() + else -> LoadingDialog.dismiss() } } } @@ -376,7 +379,7 @@ }).build().show() } }) - infoPopup.showAsDropDown(binding.rightOptionView) +// infoPopup.showAsDropDown(binding.rightOptionView) } override fun onCameraChange(p0: CameraPosition?) { diff --git a/app/src/main/java/com/casic/app/smartwell/fragment/HomePageNoClusterFragment.kt b/app/src/main/java/com/casic/app/smartwell/fragment/HomePageNoClusterFragment.kt index 802426a..b25f743 100644 --- a/app/src/main/java/com/casic/app/smartwell/fragment/HomePageNoClusterFragment.kt +++ b/app/src/main/java/com/casic/app/smartwell/fragment/HomePageNoClusterFragment.kt @@ -38,8 +38,9 @@ import com.pengxh.kt.lite.extensions.navigatePageTo import com.pengxh.kt.lite.extensions.show import com.pengxh.kt.lite.utils.LoadState -import com.pengxh.kt.lite.utils.LoadingDialogHub +import com.pengxh.kt.lite.utils.LoadingDialog import com.pengxh.kt.lite.widget.EasyPopupWindow +import com.pengxh.kt.lite.widget.TitleBarView import com.pengxh.kt.lite.widget.dialog.AlertControlDialog import kotlinx.coroutines.Dispatchers import kotlinx.coroutines.launch @@ -78,7 +79,15 @@ override fun setupTopBarLayout() { binding.rootView.initImmersionBar(this, false, R.color.mainThemeColor) - binding.titleView.text = "首页" + binding.titleView.setOnClickListener(object : TitleBarView.OnClickListener { + override fun onLeftClick() { + + } + + override fun onRightClick() { + easyPopupWindow.showAsDropDown(binding.titleView, binding.titleView.width, 0) + } + }) } override fun initOnCreate(savedInstanceState: Bundle?) { @@ -112,7 +121,7 @@ //渲染井位置 lifecycleScope.launch(Dispatchers.Main) { - LoadingDialogHub.show(requireActivity(), "数据加载中,请稍后") + LoadingDialog.show(requireActivity(), "数据加载中,请稍后") withContext(Dispatchers.IO) { //取Well缓存 val allMarkerOptions = ArrayList() @@ -144,7 +153,7 @@ val cameraPosition = CameraPosition(centerLatLng, 14f, 0f, 0f) val cameraUpdate = CameraUpdateFactory.newCameraPosition(cameraPosition) withContext(Dispatchers.Main) { - LoadingDialogHub.dismiss() + LoadingDialog.dismiss() aMap.animateCamera(cameraUpdate, 1500, null) } } @@ -238,11 +247,6 @@ } override fun initEvent() { - binding.rightOptionView.setOnClickListener { - val x = binding.rightOptionView.width - easyPopupWindow.width - easyPopupWindow.showAsDropDown(binding.rightOptionView, x, 0) - } - //撤防点位 binding.unDeployedLayout.setOnClickListener { requireContext().navigatePageTo() @@ -262,11 +266,11 @@ override fun observeRequestState() { wellViewModel.loadState.observe(this) { when (it) { - is LoadState.Loading -> LoadingDialogHub.show( + is LoadState.Loading -> LoadingDialog.show( requireActivity(), "数据加载中,请稍后..." ) - else -> LoadingDialogHub.dismiss() + else -> LoadingDialog.dismiss() } } } diff --git a/app/src/main/java/com/casic/app/smartwell/fragment/MinePageFragment.kt b/app/src/main/java/com/casic/app/smartwell/fragment/MinePageFragment.kt index 09a570c..dcb48f8 100644 --- a/app/src/main/java/com/casic/app/smartwell/fragment/MinePageFragment.kt +++ b/app/src/main/java/com/casic/app/smartwell/fragment/MinePageFragment.kt @@ -35,7 +35,7 @@ import com.pengxh.kt.lite.utils.ActivityStackManager import com.pengxh.kt.lite.utils.FileDownloadManager import com.pengxh.kt.lite.utils.LoadState -import com.pengxh.kt.lite.utils.LoadingDialogHub +import com.pengxh.kt.lite.utils.LoadingDialog import com.pengxh.kt.lite.widget.dialog.AlertControlDialog import com.pengxh.kt.lite.widget.dialog.BottomActionSheet import kotlinx.coroutines.Dispatchers @@ -60,7 +60,6 @@ override fun setupTopBarLayout() { binding.rootView.initImmersionBar(this, false, R.color.mainThemeColor) - binding.titleInclude.titleView.text = "我的" } override fun initOnCreate(savedInstanceState: Bundle?) { @@ -155,27 +154,27 @@ override fun observeRequestState() { userViewModel.loadState.observe(this) { when (it) { - is LoadState.Loading -> LoadingDialogHub.show( + is LoadState.Loading -> LoadingDialog.show( requireActivity(), "检查版本中,请稍后" ) - else -> LoadingDialogHub.dismiss() + else -> LoadingDialog.dismiss() } } wellViewModel.loadState.observe(this) { when (it) { - is LoadState.Loading -> LoadingDialogHub.show( + is LoadState.Loading -> LoadingDialog.show( requireActivity(), "数据更新中,请稍后" ) is LoadState.Fail -> { - LoadingDialogHub.dismiss() + LoadingDialog.dismiss() "数据更新超时".show(requireContext()) } else -> { - LoadingDialogHub.dismiss() + LoadingDialog.dismiss() AlertControlDialog.Builder().setContext(requireContext()).setTitle("温馨提示") .setMessage("数据更新成功,请重启应用").setNegativeButton("取消") .setPositiveButton("确定").setOnDialogButtonClickListener(object : @@ -197,17 +196,17 @@ lineViewModel.loadState.observe(this) { when (it) { - is LoadState.Loading -> LoadingDialogHub.show( + is LoadState.Loading -> LoadingDialog.show( requireActivity(), "数据更新中,请稍后" ) is LoadState.Fail -> { - LoadingDialogHub.dismiss() + LoadingDialog.dismiss() "数据更新超时".show(requireContext()) } else -> { - LoadingDialogHub.dismiss() + LoadingDialog.dismiss() AlertControlDialog.Builder().setContext(requireContext()).setTitle("温馨提示") .setMessage("数据更新成功,请重启应用").setNegativeButton("取消") .setPositiveButton("确定").setOnDialogButtonClickListener(object : diff --git a/app/src/main/java/com/casic/app/smartwell/fragment/NoticePageFragment.kt b/app/src/main/java/com/casic/app/smartwell/fragment/NoticePageFragment.kt index 171b555..3c93f54 100644 --- a/app/src/main/java/com/casic/app/smartwell/fragment/NoticePageFragment.kt +++ b/app/src/main/java/com/casic/app/smartwell/fragment/NoticePageFragment.kt @@ -48,7 +48,6 @@ override fun setupTopBarLayout() { binding.rootView.initImmersionBar(this, false, R.color.mainThemeColor) - binding.titleInclude.titleView.text = "消息" } override fun initOnCreate(savedInstanceState: Bundle?) { diff --git a/app/src/main/java/com/casic/app/smartwell/fragment/OrderListFragment.kt b/app/src/main/java/com/casic/app/smartwell/fragment/OrderListFragment.kt index 93ff35b..5e38acb 100644 --- a/app/src/main/java/com/casic/app/smartwell/fragment/OrderListFragment.kt +++ b/app/src/main/java/com/casic/app/smartwell/fragment/OrderListFragment.kt @@ -12,6 +12,7 @@ import com.casic.app.smartwell.view.SearchOrderActivity import com.pengxh.kt.lite.base.KotlinBaseFragment import com.pengxh.kt.lite.extensions.navigatePageTo +import com.pengxh.kt.lite.widget.TitleBarView class OrderListFragment : KotlinBaseFragment() { @@ -25,15 +26,22 @@ } override fun initViewBinding( - inflater: LayoutInflater, - container: ViewGroup? + inflater: LayoutInflater, container: ViewGroup? ): FragmentOrderBinding { return FragmentOrderBinding.inflate(inflater, container, false) } override fun setupTopBarLayout() { binding.rootView.initImmersionBar(this, false, R.color.mainThemeColor) - binding.titleView.text = "工单" + binding.titleView.setOnClickListener(object : TitleBarView.OnClickListener { + override fun onLeftClick() { + + } + + override fun onRightClick() { + requireContext().navigatePageTo() + } + }) } override fun initOnCreate(savedInstanceState: Bundle?) { @@ -51,8 +59,6 @@ } override fun initEvent() { - binding.rightOptionView.setOnClickListener { - requireContext().navigatePageTo() - } + } } \ No newline at end of file diff --git a/app/src/main/java/com/casic/app/smartwell/fragment/OrderNotProcessedFragment.kt b/app/src/main/java/com/casic/app/smartwell/fragment/OrderNotProcessedFragment.kt index 0b3d09d..2b6f21d 100644 --- a/app/src/main/java/com/casic/app/smartwell/fragment/OrderNotProcessedFragment.kt +++ b/app/src/main/java/com/casic/app/smartwell/fragment/OrderNotProcessedFragment.kt @@ -18,7 +18,7 @@ import com.pengxh.kt.lite.extensions.navigatePageTo import com.pengxh.kt.lite.extensions.show import com.pengxh.kt.lite.utils.LoadState -import com.pengxh.kt.lite.utils.LoadingDialogHub +import com.pengxh.kt.lite.utils.LoadingDialog import com.pengxh.kt.lite.utils.WeakReferenceHandler import com.pengxh.kt.lite.widget.dialog.AlertControlDialog @@ -78,8 +78,8 @@ operationViewModel = ViewModelProvider(this)[OperationViewModel::class.java] - binding.notProcessedView.addItemDecoration( - RecyclerViewItemOffsets(0, 5, 0, 5) + binding.recyclerView.addItemDecoration( + RecyclerViewItemOffsets(0, 7, 0, 7) ) } @@ -87,9 +87,9 @@ //接单状态处理 operationViewModel.loadState.observe(this) { when (it) { - is LoadState.Loading -> LoadingDialogHub.show(requireActivity(), "接单中,请稍后") + is LoadState.Loading -> LoadingDialog.show(requireActivity(), "接单中,请稍后") is LoadState.Success -> { - LoadingDialogHub.dismiss() + LoadingDialog.dismiss() //接单成功之后刷新列表 dataBeans.removeAt(clickedPosition) notProcessedAdapter.notifyItemRemoved(clickedPosition) @@ -98,7 +98,7 @@ ) } - else -> LoadingDialogHub.dismiss() + else -> LoadingDialog.dismiss() } } } @@ -131,7 +131,7 @@ } else { binding.emptyInclude.emptyView.hide() notProcessedAdapter = OrderNotProcessedAdapter(requireContext(), dataBeans) - binding.notProcessedView.adapter = notProcessedAdapter + binding.recyclerView.adapter = notProcessedAdapter notProcessedAdapter.setOnItemClickListener(object : OrderNotProcessedAdapter.OnItemClickListener { override fun onClicked(position: Int) { diff --git a/app/src/main/java/com/casic/app/smartwell/fragment/OvertimeNotAcceptFragment.kt b/app/src/main/java/com/casic/app/smartwell/fragment/OvertimeNotAcceptFragment.kt index a198545..9b318ca 100644 --- a/app/src/main/java/com/casic/app/smartwell/fragment/OvertimeNotAcceptFragment.kt +++ b/app/src/main/java/com/casic/app/smartwell/fragment/OvertimeNotAcceptFragment.kt @@ -18,7 +18,7 @@ import com.pengxh.kt.lite.extensions.navigatePageTo import com.pengxh.kt.lite.extensions.show import com.pengxh.kt.lite.utils.LoadState -import com.pengxh.kt.lite.utils.LoadingDialogHub +import com.pengxh.kt.lite.utils.LoadingDialog import com.pengxh.kt.lite.utils.WeakReferenceHandler import com.pengxh.kt.lite.widget.dialog.AlertControlDialog @@ -81,8 +81,8 @@ operationViewModel = ViewModelProvider(this)[OperationViewModel::class.java] - binding.notProcessedView.addItemDecoration( - RecyclerViewItemOffsets(0, 5, 0, 5) + binding.recyclerView.addItemDecoration( + RecyclerViewItemOffsets(0, 7, 0, 7) ) } @@ -90,9 +90,9 @@ //接单状态处理 operationViewModel.loadState.observe(this) { when (it) { - is LoadState.Loading -> LoadingDialogHub.show(requireActivity(), "接单中,请稍后") + is LoadState.Loading -> LoadingDialog.show(requireActivity(), "接单中,请稍后") is LoadState.Success -> { - LoadingDialogHub.dismiss() + LoadingDialog.dismiss() //接单成功之后刷新列表 dataBeans.removeAt(clickedPosition) notProcessedAdapter.notifyItemRemoved(clickedPosition) @@ -101,7 +101,7 @@ ) } - else -> LoadingDialogHub.dismiss() + else -> LoadingDialog.dismiss() } } } @@ -134,7 +134,7 @@ } else { binding.emptyInclude.emptyView.hide() notProcessedAdapter = OrderNotProcessedAdapter(requireContext(), dataBeans) - binding.notProcessedView.adapter = notProcessedAdapter + binding.recyclerView.adapter = notProcessedAdapter notProcessedAdapter.setOnItemClickListener(object : OrderNotProcessedAdapter.OnItemClickListener { override fun onClicked(position: Int) { diff --git a/app/src/main/java/com/casic/app/smartwell/greendao/DaoMaster.java b/app/src/main/java/com/casic/app/smartwell/greendao/DaoMaster.java index fdcf3a7..1e52b74 100644 --- a/app/src/main/java/com/casic/app/smartwell/greendao/DaoMaster.java +++ b/app/src/main/java/com/casic/app/smartwell/greendao/DaoMaster.java @@ -13,25 +13,20 @@ // THIS CODE IS GENERATED BY greenDAO, DO NOT EDIT. - /** * Master of DAO (schema version 4): knows all DAOs. */ public class DaoMaster extends AbstractDaoMaster { public static final int SCHEMA_VERSION = 4; - /** - * Creates underlying database table using DAOs. - */ + /** Creates underlying database table using DAOs. */ public static void createAllTables(Database db, boolean ifNotExists) { MapWellLocalBeanDao.createTable(db, ifNotExists); NoticeLocaleBeanDao.createTable(db, ifNotExists); PipeLocalBeanDao.createTable(db, ifNotExists); } - /** - * Drops underlying database table using DAOs. - */ + /** Drops underlying database table using DAOs. */ public static void dropAllTables(Database db, boolean ifExists) { MapWellLocalBeanDao.dropTable(db, ifExists); NoticeLocaleBeanDao.dropTable(db, ifExists); @@ -86,9 +81,7 @@ } } - /** - * WARNING: Drops all table on Upgrade! Use only during development. - */ + /** WARNING: Drops all table on Upgrade! Use only during development. */ public static class DevOpenHelper extends OpenHelper { public DevOpenHelper(Context context, String name) { super(context, name); diff --git a/app/src/main/java/com/casic/app/smartwell/greendao/DaoSession.java b/app/src/main/java/com/casic/app/smartwell/greendao/DaoSession.java index 0b36d17..3e40e3b 100644 --- a/app/src/main/java/com/casic/app/smartwell/greendao/DaoSession.java +++ b/app/src/main/java/com/casic/app/smartwell/greendao/DaoSession.java @@ -16,7 +16,7 @@ /** * {@inheritDoc} - * + * * @see org.greenrobot.greendao.AbstractDaoSession */ public class DaoSession extends AbstractDaoSession { @@ -50,7 +50,7 @@ registerDao(NoticeLocaleBean.class, noticeLocaleBeanDao); registerDao(PipeLocalBean.class, pipeLocalBeanDao); } - + public void clear() { mapWellLocalBeanDaoConfig.clearIdentityScope(); noticeLocaleBeanDaoConfig.clearIdentityScope(); diff --git a/app/src/main/java/com/casic/app/smartwell/greendao/MapWellLocalBeanDao.java b/app/src/main/java/com/casic/app/smartwell/greendao/MapWellLocalBeanDao.java index 8908fda..407bc92 100644 --- a/app/src/main/java/com/casic/app/smartwell/greendao/MapWellLocalBeanDao.java +++ b/app/src/main/java/com/casic/app/smartwell/greendao/MapWellLocalBeanDao.java @@ -12,10 +12,9 @@ import org.greenrobot.greendao.internal.DaoConfig; // THIS CODE IS GENERATED BY greenDAO, DO NOT EDIT. - -/** +/** * DAO for table "MAP_WELL_LOCAL_BEAN". - */ +*/ public class MapWellLocalBeanDao extends AbstractDao { public static final String TABLENAME = "MAP_WELL_LOCAL_BEAN"; @@ -57,16 +56,14 @@ public MapWellLocalBeanDao(DaoConfig config) { super(config); } - + public MapWellLocalBeanDao(DaoConfig config, DaoSession daoSession) { super(config, daoSession); } - /** - * Creates the underlying database table. - */ + /** Creates the underlying database table. */ public static void createTable(Database db, boolean ifNotExists) { - String constraint = ifNotExists ? "IF NOT EXISTS " : ""; + String constraint = ifNotExists? "IF NOT EXISTS ": ""; db.execSQL("CREATE TABLE " + constraint + "\"MAP_WELL_LOCAL_BEAN\" (" + // "\"_id\" INTEGER PRIMARY KEY AUTOINCREMENT ," + // 0: kId "\"AREA\" TEXT," + // 1: area @@ -96,9 +93,7 @@ "\"WELL_TYPE_NAME\" TEXT);"); // 25: wellTypeName } - /** - * Drops the underlying database table. - */ + /** Drops the underlying database table. */ public static void dropTable(Database db, boolean ifExists) { String sql = "DROP TABLE " + (ifExists ? "IF EXISTS " : "") + "\"MAP_WELL_LOCAL_BEAN\""; db.execSQL(sql); @@ -107,132 +102,132 @@ @Override protected final void bindValues(DatabaseStatement stmt, MapWellLocalBean entity) { stmt.clearBindings(); - + Long kId = entity.getKId(); if (kId != null) { stmt.bindLong(1, kId); } - + String area = entity.getArea(); if (area != null) { stmt.bindString(2, area); } - + String bfzt = entity.getBfzt(); if (bfzt != null) { stmt.bindString(3, bfzt); } - + String bfztName = entity.getBfztName(); if (bfztName != null) { stmt.bindString(4, bfztName); } - + String coordinateX = entity.getCoordinateX(); if (coordinateX != null) { stmt.bindString(5, coordinateX); } - + String coordinateY = entity.getCoordinateY(); if (coordinateY != null) { stmt.bindString(6, coordinateY); } - + String deep = entity.getDeep(); if (deep != null) { stmt.bindString(7, deep); } - + String deptName = entity.getDeptName(); if (deptName != null) { stmt.bindString(8, deptName); } - + String deptid = entity.getDeptid(); if (deptid != null) { stmt.bindString(9, deptid); } - + String id = entity.getId(); if (id != null) { stmt.bindString(10, id); } - + String latBaidu = entity.getLatBaidu(); if (latBaidu != null) { stmt.bindString(11, latBaidu); } - + String latGaode = entity.getLatGaode(); if (latGaode != null) { stmt.bindString(12, latGaode); } - + String lngBaidu = entity.getLngBaidu(); if (lngBaidu != null) { stmt.bindString(13, lngBaidu); } - + String lngGaode = entity.getLngGaode(); if (lngGaode != null) { stmt.bindString(14, lngGaode); } - + String notes = entity.getNotes(); if (notes != null) { stmt.bindString(15, notes); } - + String photos = entity.getPhotos(); if (photos != null) { stmt.bindString(16, photos); } - + String position = entity.getPosition(); if (position != null) { stmt.bindString(17, position); } - + String staff = entity.getStaff(); if (staff != null) { stmt.bindString(18, staff); } - + String tel = entity.getTel(); if (tel != null) { stmt.bindString(19, tel); } - + String ts = entity.getTs(); if (ts != null) { stmt.bindString(20, ts); } - + String valid = entity.getValid(); if (valid != null) { stmt.bindString(21, valid); } - + String watchData = entity.getWatchData(); if (watchData != null) { stmt.bindString(22, watchData); } - + String wellCode = entity.getWellCode(); if (wellCode != null) { stmt.bindString(23, wellCode); } - + String wellName = entity.getWellName(); if (wellName != null) { stmt.bindString(24, wellName); } - + String wellType = entity.getWellType(); if (wellType != null) { stmt.bindString(25, wellType); } - + String wellTypeName = entity.getWellTypeName(); if (wellTypeName != null) { stmt.bindString(26, wellTypeName); @@ -242,132 +237,132 @@ @Override protected final void bindValues(SQLiteStatement stmt, MapWellLocalBean entity) { stmt.clearBindings(); - + Long kId = entity.getKId(); if (kId != null) { stmt.bindLong(1, kId); } - + String area = entity.getArea(); if (area != null) { stmt.bindString(2, area); } - + String bfzt = entity.getBfzt(); if (bfzt != null) { stmt.bindString(3, bfzt); } - + String bfztName = entity.getBfztName(); if (bfztName != null) { stmt.bindString(4, bfztName); } - + String coordinateX = entity.getCoordinateX(); if (coordinateX != null) { stmt.bindString(5, coordinateX); } - + String coordinateY = entity.getCoordinateY(); if (coordinateY != null) { stmt.bindString(6, coordinateY); } - + String deep = entity.getDeep(); if (deep != null) { stmt.bindString(7, deep); } - + String deptName = entity.getDeptName(); if (deptName != null) { stmt.bindString(8, deptName); } - + String deptid = entity.getDeptid(); if (deptid != null) { stmt.bindString(9, deptid); } - + String id = entity.getId(); if (id != null) { stmt.bindString(10, id); } - + String latBaidu = entity.getLatBaidu(); if (latBaidu != null) { stmt.bindString(11, latBaidu); } - + String latGaode = entity.getLatGaode(); if (latGaode != null) { stmt.bindString(12, latGaode); } - + String lngBaidu = entity.getLngBaidu(); if (lngBaidu != null) { stmt.bindString(13, lngBaidu); } - + String lngGaode = entity.getLngGaode(); if (lngGaode != null) { stmt.bindString(14, lngGaode); } - + String notes = entity.getNotes(); if (notes != null) { stmt.bindString(15, notes); } - + String photos = entity.getPhotos(); if (photos != null) { stmt.bindString(16, photos); } - + String position = entity.getPosition(); if (position != null) { stmt.bindString(17, position); } - + String staff = entity.getStaff(); if (staff != null) { stmt.bindString(18, staff); } - + String tel = entity.getTel(); if (tel != null) { stmt.bindString(19, tel); } - + String ts = entity.getTs(); if (ts != null) { stmt.bindString(20, ts); } - + String valid = entity.getValid(); if (valid != null) { stmt.bindString(21, valid); } - + String watchData = entity.getWatchData(); if (watchData != null) { stmt.bindString(22, watchData); } - + String wellCode = entity.getWellCode(); if (wellCode != null) { stmt.bindString(23, wellCode); } - + String wellName = entity.getWellName(); if (wellName != null) { stmt.bindString(24, wellName); } - + String wellType = entity.getWellType(); if (wellType != null) { stmt.bindString(25, wellType); } - + String wellTypeName = entity.getWellTypeName(); if (wellTypeName != null) { stmt.bindString(26, wellTypeName); @@ -377,41 +372,41 @@ @Override public Long readKey(Cursor cursor, int offset) { return cursor.isNull(offset + 0) ? null : cursor.getLong(offset + 0); - } + } @Override public MapWellLocalBean readEntity(Cursor cursor, int offset) { MapWellLocalBean entity = new MapWellLocalBean( // - cursor.isNull(offset + 0) ? null : cursor.getLong(offset + 0), // kId - cursor.isNull(offset + 1) ? null : cursor.getString(offset + 1), // area - cursor.isNull(offset + 2) ? null : cursor.getString(offset + 2), // bfzt - cursor.isNull(offset + 3) ? null : cursor.getString(offset + 3), // bfztName - cursor.isNull(offset + 4) ? null : cursor.getString(offset + 4), // coordinateX - cursor.isNull(offset + 5) ? null : cursor.getString(offset + 5), // coordinateY - cursor.isNull(offset + 6) ? null : cursor.getString(offset + 6), // deep - cursor.isNull(offset + 7) ? null : cursor.getString(offset + 7), // deptName - cursor.isNull(offset + 8) ? null : cursor.getString(offset + 8), // deptid - cursor.isNull(offset + 9) ? null : cursor.getString(offset + 9), // id - cursor.isNull(offset + 10) ? null : cursor.getString(offset + 10), // latBaidu - cursor.isNull(offset + 11) ? null : cursor.getString(offset + 11), // latGaode - cursor.isNull(offset + 12) ? null : cursor.getString(offset + 12), // lngBaidu - cursor.isNull(offset + 13) ? null : cursor.getString(offset + 13), // lngGaode - cursor.isNull(offset + 14) ? null : cursor.getString(offset + 14), // notes - cursor.isNull(offset + 15) ? null : cursor.getString(offset + 15), // photos - cursor.isNull(offset + 16) ? null : cursor.getString(offset + 16), // position - cursor.isNull(offset + 17) ? null : cursor.getString(offset + 17), // staff - cursor.isNull(offset + 18) ? null : cursor.getString(offset + 18), // tel - cursor.isNull(offset + 19) ? null : cursor.getString(offset + 19), // ts - cursor.isNull(offset + 20) ? null : cursor.getString(offset + 20), // valid - cursor.isNull(offset + 21) ? null : cursor.getString(offset + 21), // watchData - cursor.isNull(offset + 22) ? null : cursor.getString(offset + 22), // wellCode - cursor.isNull(offset + 23) ? null : cursor.getString(offset + 23), // wellName - cursor.isNull(offset + 24) ? null : cursor.getString(offset + 24), // wellType - cursor.isNull(offset + 25) ? null : cursor.getString(offset + 25) // wellTypeName + cursor.isNull(offset + 0) ? null : cursor.getLong(offset + 0), // kId + cursor.isNull(offset + 1) ? null : cursor.getString(offset + 1), // area + cursor.isNull(offset + 2) ? null : cursor.getString(offset + 2), // bfzt + cursor.isNull(offset + 3) ? null : cursor.getString(offset + 3), // bfztName + cursor.isNull(offset + 4) ? null : cursor.getString(offset + 4), // coordinateX + cursor.isNull(offset + 5) ? null : cursor.getString(offset + 5), // coordinateY + cursor.isNull(offset + 6) ? null : cursor.getString(offset + 6), // deep + cursor.isNull(offset + 7) ? null : cursor.getString(offset + 7), // deptName + cursor.isNull(offset + 8) ? null : cursor.getString(offset + 8), // deptid + cursor.isNull(offset + 9) ? null : cursor.getString(offset + 9), // id + cursor.isNull(offset + 10) ? null : cursor.getString(offset + 10), // latBaidu + cursor.isNull(offset + 11) ? null : cursor.getString(offset + 11), // latGaode + cursor.isNull(offset + 12) ? null : cursor.getString(offset + 12), // lngBaidu + cursor.isNull(offset + 13) ? null : cursor.getString(offset + 13), // lngGaode + cursor.isNull(offset + 14) ? null : cursor.getString(offset + 14), // notes + cursor.isNull(offset + 15) ? null : cursor.getString(offset + 15), // photos + cursor.isNull(offset + 16) ? null : cursor.getString(offset + 16), // position + cursor.isNull(offset + 17) ? null : cursor.getString(offset + 17), // staff + cursor.isNull(offset + 18) ? null : cursor.getString(offset + 18), // tel + cursor.isNull(offset + 19) ? null : cursor.getString(offset + 19), // ts + cursor.isNull(offset + 20) ? null : cursor.getString(offset + 20), // valid + cursor.isNull(offset + 21) ? null : cursor.getString(offset + 21), // watchData + cursor.isNull(offset + 22) ? null : cursor.getString(offset + 22), // wellCode + cursor.isNull(offset + 23) ? null : cursor.getString(offset + 23), // wellName + cursor.isNull(offset + 24) ? null : cursor.getString(offset + 24), // wellType + cursor.isNull(offset + 25) ? null : cursor.getString(offset + 25) // wellTypeName ); return entity; } - + @Override public void readEntity(Cursor cursor, MapWellLocalBean entity, int offset) { entity.setKId(cursor.isNull(offset + 0) ? null : cursor.getLong(offset + 0)); @@ -440,17 +435,17 @@ entity.setWellName(cursor.isNull(offset + 23) ? null : cursor.getString(offset + 23)); entity.setWellType(cursor.isNull(offset + 24) ? null : cursor.getString(offset + 24)); entity.setWellTypeName(cursor.isNull(offset + 25) ? null : cursor.getString(offset + 25)); - } - + } + @Override protected final Long updateKeyAfterInsert(MapWellLocalBean entity, long rowId) { entity.setKId(rowId); return rowId; } - + @Override public Long getKey(MapWellLocalBean entity) { - if (entity != null) { + if(entity != null) { return entity.getKId(); } else { return null; @@ -466,5 +461,5 @@ protected final boolean isEntityUpdateable() { return true; } - + } diff --git a/app/src/main/java/com/casic/app/smartwell/greendao/NoticeLocaleBeanDao.java b/app/src/main/java/com/casic/app/smartwell/greendao/NoticeLocaleBeanDao.java index 64312ed..deb2d49 100644 --- a/app/src/main/java/com/casic/app/smartwell/greendao/NoticeLocaleBeanDao.java +++ b/app/src/main/java/com/casic/app/smartwell/greendao/NoticeLocaleBeanDao.java @@ -12,10 +12,9 @@ import org.greenrobot.greendao.internal.DaoConfig; // THIS CODE IS GENERATED BY greenDAO, DO NOT EDIT. - -/** +/** * DAO for table "NOTICE_LOCALE_BEAN". - */ +*/ public class NoticeLocaleBeanDao extends AbstractDao { public static final String TABLENAME = "NOTICE_LOCALE_BEAN"; @@ -43,16 +42,14 @@ public NoticeLocaleBeanDao(DaoConfig config) { super(config); } - + public NoticeLocaleBeanDao(DaoConfig config, DaoSession daoSession) { super(config, daoSession); } - /** - * Creates the underlying database table. - */ + /** Creates the underlying database table. */ public static void createTable(Database db, boolean ifNotExists) { - String constraint = ifNotExists ? "IF NOT EXISTS " : ""; + String constraint = ifNotExists? "IF NOT EXISTS ": ""; db.execSQL("CREATE TABLE " + constraint + "\"NOTICE_LOCALE_BEAN\" (" + // "\"_id\" INTEGER PRIMARY KEY AUTOINCREMENT ," + // 0: id "\"MESSAGE_ID\" TEXT UNIQUE ," + // 1: messageId @@ -68,9 +65,7 @@ "\"NOTICE_TIME\" TEXT);"); // 11: noticeTime } - /** - * Drops the underlying database table. - */ + /** Drops the underlying database table. */ public static void dropTable(Database db, boolean ifExists) { String sql = "DROP TABLE " + (ifExists ? "IF EXISTS " : "") + "\"NOTICE_LOCALE_BEAN\""; db.execSQL(sql); @@ -79,62 +74,62 @@ @Override protected final void bindValues(DatabaseStatement stmt, NoticeLocaleBean entity) { stmt.clearBindings(); - + Long id = entity.getId(); if (id != null) { stmt.bindLong(1, id); } - + String messageId = entity.getMessageId(); if (messageId != null) { stmt.bindString(2, messageId); } - + String appid = entity.getAppid(); if (appid != null) { stmt.bindString(3, appid); } - + String clientId = entity.getClientId(); if (clientId != null) { stmt.bindString(4, clientId); } - + String taskId = entity.getTaskId(); if (taskId != null) { stmt.bindString(5, taskId); } - + String userId = entity.getUserId(); if (userId != null) { stmt.bindString(6, userId); } - + String title = entity.getTitle(); if (title != null) { stmt.bindString(7, title); } - + String content = entity.getContent(); if (content != null) { stmt.bindString(8, content); } - + String deviceCode = entity.getDeviceCode(); if (deviceCode != null) { stmt.bindString(9, deviceCode); } - + String jobId = entity.getJobId(); if (jobId != null) { stmt.bindString(10, jobId); } - + String isRead = entity.getIsRead(); if (isRead != null) { stmt.bindString(11, isRead); } - + String noticeTime = entity.getNoticeTime(); if (noticeTime != null) { stmt.bindString(12, noticeTime); @@ -144,62 +139,62 @@ @Override protected final void bindValues(SQLiteStatement stmt, NoticeLocaleBean entity) { stmt.clearBindings(); - + Long id = entity.getId(); if (id != null) { stmt.bindLong(1, id); } - + String messageId = entity.getMessageId(); if (messageId != null) { stmt.bindString(2, messageId); } - + String appid = entity.getAppid(); if (appid != null) { stmt.bindString(3, appid); } - + String clientId = entity.getClientId(); if (clientId != null) { stmt.bindString(4, clientId); } - + String taskId = entity.getTaskId(); if (taskId != null) { stmt.bindString(5, taskId); } - + String userId = entity.getUserId(); if (userId != null) { stmt.bindString(6, userId); } - + String title = entity.getTitle(); if (title != null) { stmt.bindString(7, title); } - + String content = entity.getContent(); if (content != null) { stmt.bindString(8, content); } - + String deviceCode = entity.getDeviceCode(); if (deviceCode != null) { stmt.bindString(9, deviceCode); } - + String jobId = entity.getJobId(); if (jobId != null) { stmt.bindString(10, jobId); } - + String isRead = entity.getIsRead(); if (isRead != null) { stmt.bindString(11, isRead); } - + String noticeTime = entity.getNoticeTime(); if (noticeTime != null) { stmt.bindString(12, noticeTime); @@ -209,27 +204,27 @@ @Override public Long readKey(Cursor cursor, int offset) { return cursor.isNull(offset + 0) ? null : cursor.getLong(offset + 0); - } + } @Override public NoticeLocaleBean readEntity(Cursor cursor, int offset) { NoticeLocaleBean entity = new NoticeLocaleBean( // - cursor.isNull(offset + 0) ? null : cursor.getLong(offset + 0), // id - cursor.isNull(offset + 1) ? null : cursor.getString(offset + 1), // messageId - cursor.isNull(offset + 2) ? null : cursor.getString(offset + 2), // appid - cursor.isNull(offset + 3) ? null : cursor.getString(offset + 3), // clientId - cursor.isNull(offset + 4) ? null : cursor.getString(offset + 4), // taskId - cursor.isNull(offset + 5) ? null : cursor.getString(offset + 5), // userId - cursor.isNull(offset + 6) ? null : cursor.getString(offset + 6), // title - cursor.isNull(offset + 7) ? null : cursor.getString(offset + 7), // content - cursor.isNull(offset + 8) ? null : cursor.getString(offset + 8), // deviceCode - cursor.isNull(offset + 9) ? null : cursor.getString(offset + 9), // jobId - cursor.isNull(offset + 10) ? null : cursor.getString(offset + 10), // isRead - cursor.isNull(offset + 11) ? null : cursor.getString(offset + 11) // noticeTime + cursor.isNull(offset + 0) ? null : cursor.getLong(offset + 0), // id + cursor.isNull(offset + 1) ? null : cursor.getString(offset + 1), // messageId + cursor.isNull(offset + 2) ? null : cursor.getString(offset + 2), // appid + cursor.isNull(offset + 3) ? null : cursor.getString(offset + 3), // clientId + cursor.isNull(offset + 4) ? null : cursor.getString(offset + 4), // taskId + cursor.isNull(offset + 5) ? null : cursor.getString(offset + 5), // userId + cursor.isNull(offset + 6) ? null : cursor.getString(offset + 6), // title + cursor.isNull(offset + 7) ? null : cursor.getString(offset + 7), // content + cursor.isNull(offset + 8) ? null : cursor.getString(offset + 8), // deviceCode + cursor.isNull(offset + 9) ? null : cursor.getString(offset + 9), // jobId + cursor.isNull(offset + 10) ? null : cursor.getString(offset + 10), // isRead + cursor.isNull(offset + 11) ? null : cursor.getString(offset + 11) // noticeTime ); return entity; } - + @Override public void readEntity(Cursor cursor, NoticeLocaleBean entity, int offset) { entity.setId(cursor.isNull(offset + 0) ? null : cursor.getLong(offset + 0)); @@ -244,17 +239,17 @@ entity.setJobId(cursor.isNull(offset + 9) ? null : cursor.getString(offset + 9)); entity.setIsRead(cursor.isNull(offset + 10) ? null : cursor.getString(offset + 10)); entity.setNoticeTime(cursor.isNull(offset + 11) ? null : cursor.getString(offset + 11)); - } - + } + @Override protected final Long updateKeyAfterInsert(NoticeLocaleBean entity, long rowId) { entity.setId(rowId); return rowId; } - + @Override public Long getKey(NoticeLocaleBean entity) { - if (entity != null) { + if(entity != null) { return entity.getId(); } else { return null; @@ -270,5 +265,5 @@ protected final boolean isEntityUpdateable() { return true; } - + } diff --git a/app/src/main/java/com/casic/app/smartwell/greendao/PipeLocalBeanDao.java b/app/src/main/java/com/casic/app/smartwell/greendao/PipeLocalBeanDao.java index aab4d3f..df5515a 100644 --- a/app/src/main/java/com/casic/app/smartwell/greendao/PipeLocalBeanDao.java +++ b/app/src/main/java/com/casic/app/smartwell/greendao/PipeLocalBeanDao.java @@ -12,10 +12,9 @@ import org.greenrobot.greendao.internal.DaoConfig; // THIS CODE IS GENERATED BY greenDAO, DO NOT EDIT. - -/** +/** * DAO for table "PIPE_LOCAL_BEAN". - */ +*/ public class PipeLocalBeanDao extends AbstractDao { public static final String TABLENAME = "PIPE_LOCAL_BEAN"; @@ -37,16 +36,14 @@ public PipeLocalBeanDao(DaoConfig config) { super(config); } - + public PipeLocalBeanDao(DaoConfig config, DaoSession daoSession) { super(config, daoSession); } - /** - * Creates the underlying database table. - */ + /** Creates the underlying database table. */ public static void createTable(Database db, boolean ifNotExists) { - String constraint = ifNotExists ? "IF NOT EXISTS " : ""; + String constraint = ifNotExists? "IF NOT EXISTS ": ""; db.execSQL("CREATE TABLE " + constraint + "\"PIPE_LOCAL_BEAN\" (" + // "\"_id\" INTEGER PRIMARY KEY AUTOINCREMENT ," + // 0: id "\"PIPE_CODE\" TEXT," + // 1: pipeCode @@ -56,9 +53,7 @@ "\"START_LONGITUDE_GD\" TEXT);"); // 5: startLongitudeGd } - /** - * Drops the underlying database table. - */ + /** Drops the underlying database table. */ public static void dropTable(Database db, boolean ifExists) { String sql = "DROP TABLE " + (ifExists ? "IF EXISTS " : "") + "\"PIPE_LOCAL_BEAN\""; db.execSQL(sql); @@ -67,32 +62,32 @@ @Override protected final void bindValues(DatabaseStatement stmt, PipeLocalBean entity) { stmt.clearBindings(); - + Long id = entity.getId(); if (id != null) { stmt.bindLong(1, id); } - + String pipeCode = entity.getPipeCode(); if (pipeCode != null) { stmt.bindString(2, pipeCode); } - + String endLatitudeGd = entity.getEndLatitudeGd(); if (endLatitudeGd != null) { stmt.bindString(3, endLatitudeGd); } - + String endLongitudeGd = entity.getEndLongitudeGd(); if (endLongitudeGd != null) { stmt.bindString(4, endLongitudeGd); } - + String startLatitudeGd = entity.getStartLatitudeGd(); if (startLatitudeGd != null) { stmt.bindString(5, startLatitudeGd); } - + String startLongitudeGd = entity.getStartLongitudeGd(); if (startLongitudeGd != null) { stmt.bindString(6, startLongitudeGd); @@ -102,32 +97,32 @@ @Override protected final void bindValues(SQLiteStatement stmt, PipeLocalBean entity) { stmt.clearBindings(); - + Long id = entity.getId(); if (id != null) { stmt.bindLong(1, id); } - + String pipeCode = entity.getPipeCode(); if (pipeCode != null) { stmt.bindString(2, pipeCode); } - + String endLatitudeGd = entity.getEndLatitudeGd(); if (endLatitudeGd != null) { stmt.bindString(3, endLatitudeGd); } - + String endLongitudeGd = entity.getEndLongitudeGd(); if (endLongitudeGd != null) { stmt.bindString(4, endLongitudeGd); } - + String startLatitudeGd = entity.getStartLatitudeGd(); if (startLatitudeGd != null) { stmt.bindString(5, startLatitudeGd); } - + String startLongitudeGd = entity.getStartLongitudeGd(); if (startLongitudeGd != null) { stmt.bindString(6, startLongitudeGd); @@ -137,21 +132,21 @@ @Override public Long readKey(Cursor cursor, int offset) { return cursor.isNull(offset + 0) ? null : cursor.getLong(offset + 0); - } + } @Override public PipeLocalBean readEntity(Cursor cursor, int offset) { PipeLocalBean entity = new PipeLocalBean( // - cursor.isNull(offset + 0) ? null : cursor.getLong(offset + 0), // id - cursor.isNull(offset + 1) ? null : cursor.getString(offset + 1), // pipeCode - cursor.isNull(offset + 2) ? null : cursor.getString(offset + 2), // endLatitudeGd - cursor.isNull(offset + 3) ? null : cursor.getString(offset + 3), // endLongitudeGd - cursor.isNull(offset + 4) ? null : cursor.getString(offset + 4), // startLatitudeGd - cursor.isNull(offset + 5) ? null : cursor.getString(offset + 5) // startLongitudeGd + cursor.isNull(offset + 0) ? null : cursor.getLong(offset + 0), // id + cursor.isNull(offset + 1) ? null : cursor.getString(offset + 1), // pipeCode + cursor.isNull(offset + 2) ? null : cursor.getString(offset + 2), // endLatitudeGd + cursor.isNull(offset + 3) ? null : cursor.getString(offset + 3), // endLongitudeGd + cursor.isNull(offset + 4) ? null : cursor.getString(offset + 4), // startLatitudeGd + cursor.isNull(offset + 5) ? null : cursor.getString(offset + 5) // startLongitudeGd ); return entity; } - + @Override public void readEntity(Cursor cursor, PipeLocalBean entity, int offset) { entity.setId(cursor.isNull(offset + 0) ? null : cursor.getLong(offset + 0)); @@ -160,17 +155,17 @@ entity.setEndLongitudeGd(cursor.isNull(offset + 3) ? null : cursor.getString(offset + 3)); entity.setStartLatitudeGd(cursor.isNull(offset + 4) ? null : cursor.getString(offset + 4)); entity.setStartLongitudeGd(cursor.isNull(offset + 5) ? null : cursor.getString(offset + 5)); - } - + } + @Override protected final Long updateKeyAfterInsert(PipeLocalBean entity, long rowId) { entity.setId(rowId); return rowId; } - + @Override public Long getKey(PipeLocalBean entity) { - if (entity != null) { + if(entity != null) { return entity.getId(); } else { return null; @@ -186,5 +181,5 @@ protected final boolean isEntityUpdateable() { return true; } - + } diff --git a/app/src/main/java/com/casic/app/smartwell/view/ChangePasswordActivity.kt b/app/src/main/java/com/casic/app/smartwell/view/ChangePasswordActivity.kt index 8e41039..9f1dd40 100644 --- a/app/src/main/java/com/casic/app/smartwell/view/ChangePasswordActivity.kt +++ b/app/src/main/java/com/casic/app/smartwell/view/ChangePasswordActivity.kt @@ -14,7 +14,7 @@ import com.pengxh.kt.lite.extensions.show import com.pengxh.kt.lite.utils.ActivityStackManager import com.pengxh.kt.lite.utils.LoadState -import com.pengxh.kt.lite.utils.LoadingDialogHub +import com.pengxh.kt.lite.utils.LoadingDialog import com.pengxh.kt.lite.widget.TitleBarView import java.nio.charset.StandardCharsets @@ -46,15 +46,15 @@ override fun observeRequestState() { userViewModel.loadState.observe(this) { when (it) { - is LoadState.Loading -> LoadingDialogHub.show(this, "修改中,请稍后") + is LoadState.Loading -> LoadingDialog.show(this, "修改中,请稍后") is LoadState.Success -> { - LoadingDialogHub.dismiss() + LoadingDialog.dismiss() AuthenticationHelper.removeToken() this.navigatePageTo() ActivityStackManager.finishAllActivity() } - else -> LoadingDialogHub.dismiss() + else -> LoadingDialog.dismiss() } } } diff --git a/app/src/main/java/com/casic/app/smartwell/view/DeployedWellActivity.kt b/app/src/main/java/com/casic/app/smartwell/view/DeployedWellActivity.kt index fb4339c..28a5078 100644 --- a/app/src/main/java/com/casic/app/smartwell/view/DeployedWellActivity.kt +++ b/app/src/main/java/com/casic/app/smartwell/view/DeployedWellActivity.kt @@ -83,8 +83,8 @@ } //添加分割线 - binding.deployedListView.addItemDecoration( - RecyclerViewItemOffsets(0, 5, 0, 5) + binding.recyclerView.addItemDecoration( + RecyclerViewItemOffsets(0, 7, 0, 7) ) } @@ -149,12 +149,11 @@ } else { item.deep.toString() + "m" } - viewHolder.setText(R.id.wellNameView, item.wellName) + viewHolder.setText(R.id.wellTypeView, item.wellTypeName) .setText(R.id.wellDepthView, "深:${deep}") .setText(R.id.wellCodeView, "点位编号:${item.wellCode}") - .setText(R.id.wellTypeView, "点位类型:${item.wellTypeName}") .setText(R.id.ownerShipView, "权属单位:${item.deptName}") - .setText(R.id.wellLocationView, "点位置:${item.position}") + .setText(R.id.wellLocationView, "点位位置:${item.position}") .setOnClickListener( R.id.operationButton, object : View.OnClickListener { override fun onClick(v: View?) { @@ -207,7 +206,7 @@ }) } } - binding.deployedListView.adapter = deployAdapter + binding.recyclerView.adapter = deployAdapter deployAdapter.setOnItemClickedListener(object : NormalRecyclerAdapter.OnItemClickedListener { override fun onItemClicked(position: Int, t: WellListModel.DataBean.RowsBean) { diff --git a/app/src/main/java/com/casic/app/smartwell/view/LoginActivity.kt b/app/src/main/java/com/casic/app/smartwell/view/LoginActivity.kt index e4bb0e3..834527b 100644 --- a/app/src/main/java/com/casic/app/smartwell/view/LoginActivity.kt +++ b/app/src/main/java/com/casic/app/smartwell/view/LoginActivity.kt @@ -21,7 +21,7 @@ import com.pengxh.kt.lite.extensions.navigatePageTo import com.pengxh.kt.lite.extensions.readAssetsFile import com.pengxh.kt.lite.extensions.show -import com.pengxh.kt.lite.utils.LoadingDialogHub +import com.pengxh.kt.lite.utils.LoadingDialog import com.pengxh.kt.lite.utils.SaveKeyValues import kotlinx.coroutines.Dispatchers import kotlinx.coroutines.launch @@ -106,11 +106,11 @@ override fun observeRequestState() { authenticateViewModel.loadState.observe(this) { - LoadingDialogHub.show(this, "登录中,请稍后") + LoadingDialog.show(this, "登录中,请稍后") } loginViewModel.loadState.observe(this) { - LoadingDialogHub.dismiss() + LoadingDialog.dismiss() } } diff --git a/app/src/main/java/com/casic/app/smartwell/view/OrderCompletedDetailActivity.kt b/app/src/main/java/com/casic/app/smartwell/view/OrderCompletedDetailActivity.kt index db8ad1f..75cd905 100644 --- a/app/src/main/java/com/casic/app/smartwell/view/OrderCompletedDetailActivity.kt +++ b/app/src/main/java/com/casic/app/smartwell/view/OrderCompletedDetailActivity.kt @@ -17,7 +17,7 @@ import com.pengxh.kt.lite.extensions.show import com.pengxh.kt.lite.utils.Constant import com.pengxh.kt.lite.utils.LoadState -import com.pengxh.kt.lite.utils.LoadingDialogHub +import com.pengxh.kt.lite.utils.LoadingDialog import com.pengxh.kt.lite.widget.TitleBarView import com.pengxh.kt.lite.widget.dialog.AlertMessageDialog @@ -44,7 +44,7 @@ } override fun initOnCreate(savedInstanceState: Bundle?) { - val jobId = intent.getStringExtra(Constant.INTENT_PARAM)!! + val jobId = intent.getStringExtra(Constant.INTENT_PARAM_KEY)!! orderViewModel = ViewModelProvider(this)[OrderViewModel::class.java] orderViewModel.getWorkOrderDetail(jobId) orderViewModel.detailModel.observe(this) { @@ -154,8 +154,8 @@ override fun observeRequestState() { orderViewModel.loadState.observe(this) { when (it) { - is LoadState.Loading -> LoadingDialogHub.show(this, "数据加载中,请稍后") - else -> LoadingDialogHub.dismiss() + is LoadState.Loading -> LoadingDialog.show(this, "数据加载中,请稍后") + else -> LoadingDialog.dismiss() } } } diff --git a/app/src/main/java/com/casic/app/smartwell/view/OrderInHandleDetailActivity.kt b/app/src/main/java/com/casic/app/smartwell/view/OrderInHandleDetailActivity.kt index d70a979..04a7d5d 100644 --- a/app/src/main/java/com/casic/app/smartwell/view/OrderInHandleDetailActivity.kt +++ b/app/src/main/java/com/casic/app/smartwell/view/OrderInHandleDetailActivity.kt @@ -38,7 +38,7 @@ import com.pengxh.kt.lite.extensions.show import com.pengxh.kt.lite.utils.Constant import com.pengxh.kt.lite.utils.LoadState -import com.pengxh.kt.lite.utils.LoadingDialogHub +import com.pengxh.kt.lite.utils.LoadingDialog import com.pengxh.kt.lite.widget.TitleBarView import com.pengxh.kt.lite.widget.dialog.AlertControlDialog import com.pengxh.kt.lite.widget.dialog.AlertMessageDialog @@ -93,7 +93,7 @@ ) binding.addImageRecyclerView.adapter = imageAdapter - val jobId = intent.getStringExtra(Constant.INTENT_PARAM)!!//初始化图片九宫格 + val jobId = intent.getStringExtra(Constant.INTENT_PARAM_KEY)!!//初始化图片九宫格 orderViewModel.getWorkOrderDetail(jobId) orderViewModel.detailModel.observe(this) { if (it.code == 200) { @@ -312,41 +312,41 @@ override fun observeRequestState() { orderViewModel.loadState.observe(this) { when (it) { - is LoadState.Loading -> LoadingDialogHub.show(this, "数据加载中,请稍后") - else -> LoadingDialogHub.dismiss() + is LoadState.Loading -> LoadingDialog.show(this, "数据加载中,请稍后") + else -> LoadingDialog.dismiss() } } uploadImageViewModel.loadState.observe(this) { when (it) { - LoadState.Loading -> LoadingDialogHub.show(this, "图片上传中,请稍后...") - else -> LoadingDialogHub.dismiss() + LoadState.Loading -> LoadingDialog.show(this, "图片上传中,请稍后...") + else -> LoadingDialog.dismiss() } } //转单状态处理 operationViewModel.loadState.observe(this) { when (it) { - is LoadState.Loading -> LoadingDialogHub.show(this, "转单中,请稍后") + is LoadState.Loading -> LoadingDialog.show(this, "转单中,请稍后") is LoadState.Success -> { - LoadingDialogHub.dismiss() + LoadingDialog.dismiss() this.finish() } - else -> LoadingDialogHub.dismiss() + else -> LoadingDialog.dismiss() } } //处理完成工单状态处理 operationViewModel.loadState.observe(this) { when (it) { - is LoadState.Loading -> LoadingDialogHub.show(this, "处理中,请稍后") + is LoadState.Loading -> LoadingDialog.show(this, "处理中,请稍后") is LoadState.Success -> { - LoadingDialogHub.dismiss() + LoadingDialog.dismiss() this.finish() } - else -> LoadingDialogHub.dismiss() + else -> LoadingDialog.dismiss() } } } diff --git a/app/src/main/java/com/casic/app/smartwell/view/OrderNotConfirmedDetailActivity.kt b/app/src/main/java/com/casic/app/smartwell/view/OrderNotConfirmedDetailActivity.kt index 8e036d2..687ec86 100644 --- a/app/src/main/java/com/casic/app/smartwell/view/OrderNotConfirmedDetailActivity.kt +++ b/app/src/main/java/com/casic/app/smartwell/view/OrderNotConfirmedDetailActivity.kt @@ -36,7 +36,7 @@ import com.pengxh.kt.lite.extensions.show import com.pengxh.kt.lite.utils.Constant import com.pengxh.kt.lite.utils.LoadState -import com.pengxh.kt.lite.utils.LoadingDialogHub +import com.pengxh.kt.lite.utils.LoadingDialog import com.pengxh.kt.lite.widget.TitleBarView import com.pengxh.kt.lite.widget.dialog.AlertControlDialog import com.pengxh.kt.lite.widget.dialog.AlertMessageDialog @@ -80,7 +80,7 @@ } override fun initOnCreate(savedInstanceState: Bundle?) { - val jobId = intent.getStringExtra(Constant.INTENT_PARAM)!! + val jobId = intent.getStringExtra(Constant.INTENT_PARAM_KEY)!! //初始化图片九宫格 //左外边距,左内边距,右内边距,右外边距 val viewWidth = getScreenWidth() - (10 + 10 + 10 + 10).dp2px(this) @@ -263,41 +263,41 @@ //数据加载状态处理 orderViewModel.loadState.observe(this) { when (it) { - is LoadState.Loading -> LoadingDialogHub.show(this, "数据加载中,请稍后") - else -> LoadingDialogHub.dismiss() + is LoadState.Loading -> LoadingDialog.show(this, "数据加载中,请稍后") + else -> LoadingDialog.dismiss() } } uploadImageViewModel.loadState.observe(this) { when (it) { - LoadState.Loading -> LoadingDialogHub.show(this, "图片上传中,请稍后") - else -> LoadingDialogHub.dismiss() + LoadState.Loading -> LoadingDialog.show(this, "图片上传中,请稍后") + else -> LoadingDialog.dismiss() } } //转单状态处理 operationViewModel.loadState.observe(this) { when (it) { - is LoadState.Loading -> LoadingDialogHub.show(this, "转单中,请稍后") + is LoadState.Loading -> LoadingDialog.show(this, "转单中,请稍后") is LoadState.Success -> { - LoadingDialogHub.dismiss() + LoadingDialog.dismiss() this.finish() } - else -> LoadingDialogHub.dismiss() + else -> LoadingDialog.dismiss() } } //确认工单状态处理 operationViewModel.loadState.observe(this) { when (it) { - is LoadState.Loading -> LoadingDialogHub.show(this, "处理中,请稍后") + is LoadState.Loading -> LoadingDialog.show(this, "处理中,请稍后") is LoadState.Success -> { - LoadingDialogHub.dismiss() + LoadingDialog.dismiss() this.finish() } - else -> LoadingDialogHub.dismiss() + else -> LoadingDialog.dismiss() } } } diff --git a/app/src/main/java/com/casic/app/smartwell/view/OrderNotProcessedDetailActivity.kt b/app/src/main/java/com/casic/app/smartwell/view/OrderNotProcessedDetailActivity.kt index d3f22dc..0c97a52 100644 --- a/app/src/main/java/com/casic/app/smartwell/view/OrderNotProcessedDetailActivity.kt +++ b/app/src/main/java/com/casic/app/smartwell/view/OrderNotProcessedDetailActivity.kt @@ -18,7 +18,7 @@ import com.pengxh.kt.lite.extensions.show import com.pengxh.kt.lite.utils.Constant import com.pengxh.kt.lite.utils.LoadState -import com.pengxh.kt.lite.utils.LoadingDialogHub +import com.pengxh.kt.lite.utils.LoadingDialog import com.pengxh.kt.lite.widget.TitleBarView import com.pengxh.kt.lite.widget.dialog.AlertControlDialog import com.pengxh.kt.lite.widget.dialog.AlertMessageDialog @@ -50,7 +50,7 @@ } override fun initOnCreate(savedInstanceState: Bundle?) { - this.jobId = intent.getStringExtra(Constant.INTENT_PARAM)!! + this.jobId = intent.getStringExtra(Constant.INTENT_PARAM_KEY)!! orderViewModel = ViewModelProvider(this)[OrderViewModel::class.java] operationViewModel = ViewModelProvider(this)[OperationViewModel::class.java] wellViewModel = ViewModelProvider(this)[WellViewModel::class.java] @@ -162,21 +162,21 @@ //数据加载状态处理 orderViewModel.loadState.observe(this) { when (it) { - is LoadState.Loading -> LoadingDialogHub.show(this, "数据加载中,请稍后") - else -> LoadingDialogHub.dismiss() + is LoadState.Loading -> LoadingDialog.show(this, "数据加载中,请稍后") + else -> LoadingDialog.dismiss() } } //接单状态处理 operationViewModel.loadState.observe(this) { when (it) { - is LoadState.Loading -> LoadingDialogHub.show(this, "接单中,请稍后") + is LoadState.Loading -> LoadingDialog.show(this, "接单中,请稍后") is LoadState.Success -> { - LoadingDialogHub.dismiss() + LoadingDialog.dismiss() this.finish() } - else -> LoadingDialogHub.dismiss() + else -> LoadingDialog.dismiss() } } } diff --git a/app/src/main/java/com/casic/app/smartwell/view/SearchResultActivity.kt b/app/src/main/java/com/casic/app/smartwell/view/SearchResultActivity.kt index 6a92917..4f3a674 100644 --- a/app/src/main/java/com/casic/app/smartwell/view/SearchResultActivity.kt +++ b/app/src/main/java/com/casic/app/smartwell/view/SearchResultActivity.kt @@ -19,7 +19,7 @@ import com.pengxh.kt.lite.extensions.show import com.pengxh.kt.lite.utils.Constant import com.pengxh.kt.lite.utils.LoadState -import com.pengxh.kt.lite.utils.LoadingDialogHub +import com.pengxh.kt.lite.utils.LoadingDialog import com.pengxh.kt.lite.utils.WeakReferenceHandler import com.pengxh.kt.lite.widget.TitleBarView import com.pengxh.kt.lite.widget.dialog.AlertControlDialog @@ -56,7 +56,7 @@ } override fun initOnCreate(savedInstanceState: Bundle?) { - args = intent.getStringArrayListExtra(Constant.INTENT_PARAM)!! + args = intent.getStringArrayListExtra(Constant.INTENT_PARAM_KEY)!! orderViewModel = ViewModelProvider(this)[OrderViewModel::class.java] operationViewModel = ViewModelProvider(this)[OperationViewModel::class.java] @@ -101,24 +101,24 @@ } } - binding.resultRecyclerView.addItemDecoration( - RecyclerViewItemOffsets(0, 5, 0, 5) + binding.recyclerView.addItemDecoration( + RecyclerViewItemOffsets(0, 7, 0, 7) ) } override fun observeRequestState() { orderViewModel.loadState.observe(this) { when (it) { - is LoadState.Loading -> LoadingDialogHub.show(this, "数据加载中,请稍后") - else -> LoadingDialogHub.dismiss() + is LoadState.Loading -> LoadingDialog.show(this, "数据加载中,请稍后") + else -> LoadingDialog.dismiss() } } //接单状态处理 operationViewModel.loadState.observe(this) { when (it) { - is LoadState.Loading -> LoadingDialogHub.show(this, "接单中,请稍后") + is LoadState.Loading -> LoadingDialog.show(this, "接单中,请稍后") is LoadState.Success -> { - LoadingDialogHub.dismiss() + LoadingDialog.dismiss() //接单成功之后刷新列表 dataBeans.removeAt(clickedPosition) searchResultAdapter.notifyItemRemoved(clickedPosition) @@ -127,7 +127,7 @@ ) } - else -> LoadingDialogHub.dismiss() + else -> LoadingDialog.dismiss() } } } @@ -162,7 +162,7 @@ } else { binding.emptyInclude.emptyView.hide() searchResultAdapter = SearchResultAdapter(this, dataBeans) - binding.resultRecyclerView.adapter = searchResultAdapter + binding.recyclerView.adapter = searchResultAdapter searchResultAdapter.setOnItemClickListener(object : SearchResultAdapter.OnItemClickListener { override fun onClicked(position: Int) { diff --git a/app/src/main/java/com/casic/app/smartwell/view/UnDeployWellActivity.kt b/app/src/main/java/com/casic/app/smartwell/view/UnDeployWellActivity.kt index 7f7cd3c..555c278 100644 --- a/app/src/main/java/com/casic/app/smartwell/view/UnDeployWellActivity.kt +++ b/app/src/main/java/com/casic/app/smartwell/view/UnDeployWellActivity.kt @@ -81,8 +81,8 @@ } } - binding.undeployListView.addItemDecoration( - RecyclerViewItemOffsets(0, 5, 0, 5) + binding.recyclerView.addItemDecoration( + RecyclerViewItemOffsets(0, 7, 0, 7) ) } @@ -147,12 +147,11 @@ } else { item.deep.toString() + "m" } - viewHolder.setText(R.id.wellNameView, item.wellName) + viewHolder.setText(R.id.wellTypeView, item.wellTypeName) .setText(R.id.wellDepthView, "深:${deep}") .setText(R.id.wellCodeView, "点位编号:${item.wellCode}") - .setText(R.id.wellTypeView, "点位类型:${item.wellTypeName}") .setText(R.id.ownerShipView, "权属单位:${item.deptName}") - .setText(R.id.wellLocationView, "点位置:${item.position}") + .setText(R.id.wellLocationView, "点位位置:${item.position}") .setOnClickListener( R.id.operationButton, object : View.OnClickListener { override fun onClick(v: View?) { @@ -185,7 +184,7 @@ ) } } - binding.undeployListView.adapter = unDeployAdapter + binding.recyclerView.adapter = unDeployAdapter unDeployAdapter.setOnItemClickedListener(object : NormalRecyclerAdapter.OnItemClickedListener { override fun onItemClicked(position: Int, t: WellListModel.DataBean.RowsBean) { diff --git a/app/src/main/java/com/casic/app/smartwell/view/WellDetailActivity.kt b/app/src/main/java/com/casic/app/smartwell/view/WellDetailActivity.kt index b50d067..eb8b468 100644 --- a/app/src/main/java/com/casic/app/smartwell/view/WellDetailActivity.kt +++ b/app/src/main/java/com/casic/app/smartwell/view/WellDetailActivity.kt @@ -16,7 +16,7 @@ import com.pengxh.kt.lite.extensions.show import com.pengxh.kt.lite.utils.Constant import com.pengxh.kt.lite.utils.LoadState -import com.pengxh.kt.lite.utils.LoadingDialogHub +import com.pengxh.kt.lite.utils.LoadingDialog import com.pengxh.kt.lite.widget.TitleBarView import com.pengxh.kt.lite.widget.dialog.AlertMessageDialog @@ -44,7 +44,7 @@ } override fun initOnCreate(savedInstanceState: Bundle?) { - val wellId = intent.getStringExtra(Constant.INTENT_PARAM)!! + val wellId = intent.getStringExtra(Constant.INTENT_PARAM_KEY)!! wellViewModel = ViewModelProvider(this)[WellViewModel::class.java] wellViewModel.getWellDetail(wellId) wellViewModel.wellDetailModel.observe(this) { @@ -132,8 +132,8 @@ override fun observeRequestState() { wellViewModel.loadState.observe(this) { when (it) { - is LoadState.Loading -> LoadingDialogHub.show(this, "数据加载中,请稍后") - else -> LoadingDialogHub.dismiss() + is LoadState.Loading -> LoadingDialog.show(this, "数据加载中,请稍后") + else -> LoadingDialog.dismiss() } } } diff --git a/app/src/main/java/com/casic/app/smartwell/view/WellManagementActivity.kt b/app/src/main/java/com/casic/app/smartwell/view/WellManagementActivity.kt index 084da95..457096b 100644 --- a/app/src/main/java/com/casic/app/smartwell/view/WellManagementActivity.kt +++ b/app/src/main/java/com/casic/app/smartwell/view/WellManagementActivity.kt @@ -94,8 +94,8 @@ } } - binding.wellListView.addItemDecoration( - RecyclerViewItemOffsets(0, 5, 0, 5) + binding.recyclerView.addItemDecoration( + RecyclerViewItemOffsets(0, 7, 0, 7) ) } @@ -175,13 +175,12 @@ } else { item.deep.toString() + "m" } - viewHolder.setText(R.id.wellNameView, item.wellName) + viewHolder.setText(R.id.wellTypeView, item.wellTypeName) .setText(R.id.wellStateView, "已${item.bfztName}") .setText(R.id.wellDepthView, "深:${deep}") .setText(R.id.wellCodeView, "点位编号:${item.wellCode}") - .setText(R.id.wellTypeView, "点位类型:${item.wellTypeName}") .setText(R.id.ownerShipView, "权属单位:${item.deptName}") - .setText(R.id.wellLocationView, "点位置:${item.position}") + .setText(R.id.wellLocationView, "点位位置:${item.position}") .setOnClickListener( R.id.navigationButton, object : View.OnClickListener { override fun onClick(v: View?) { @@ -200,7 +199,7 @@ ) } } - binding.wellListView.adapter = wellListAdapter + binding.recyclerView.adapter = wellListAdapter wellListAdapter.setOnItemClickedListener(object : NormalRecyclerAdapter.OnItemClickedListener { override fun onItemClicked(position: Int, t: WellListModel.DataBean.RowsBean) { diff --git a/app/src/main/java/com/casic/app/smartwell/view/WellMonitorActivity.kt b/app/src/main/java/com/casic/app/smartwell/view/WellMonitorActivity.kt index e3573eb..b87bdb7 100644 --- a/app/src/main/java/com/casic/app/smartwell/view/WellMonitorActivity.kt +++ b/app/src/main/java/com/casic/app/smartwell/view/WellMonitorActivity.kt @@ -11,7 +11,7 @@ import com.pengxh.kt.lite.base.KotlinBaseActivity import com.pengxh.kt.lite.utils.Constant import com.pengxh.kt.lite.utils.LoadState -import com.pengxh.kt.lite.utils.LoadingDialogHub +import com.pengxh.kt.lite.utils.LoadingDialog import com.pengxh.kt.lite.widget.TitleBarView class WellMonitorActivity : KotlinBaseActivity() { @@ -36,7 +36,7 @@ } override fun initOnCreate(savedInstanceState: Bundle?) { - val wellId = intent.getStringExtra(Constant.INTENT_PARAM)!! + val wellId = intent.getStringExtra(Constant.INTENT_PARAM_KEY)!! wellViewModel = ViewModelProvider(this)[WellViewModel::class.java] wellViewModel.getMonitorResult(wellId) wellViewModel.monitorModel.observe(this) { @@ -56,8 +56,8 @@ override fun observeRequestState() { wellViewModel.loadState.observe(this) { when (it) { - is LoadState.Loading -> LoadingDialogHub.show(this, "数据加载中,请稍后") - else -> LoadingDialogHub.dismiss() + is LoadState.Loading -> LoadingDialog.show(this, "数据加载中,请稍后") + else -> LoadingDialog.dismiss() } } } diff --git a/app/src/main/java/com/casic/app/smartwell/view/WellOperationActivity.kt b/app/src/main/java/com/casic/app/smartwell/view/WellOperationActivity.kt index 8d333bf..347ebb6 100644 --- a/app/src/main/java/com/casic/app/smartwell/view/WellOperationActivity.kt +++ b/app/src/main/java/com/casic/app/smartwell/view/WellOperationActivity.kt @@ -23,7 +23,7 @@ import com.pengxh.kt.lite.extensions.navigatePageTo import com.pengxh.kt.lite.extensions.show import com.pengxh.kt.lite.utils.LoadState -import com.pengxh.kt.lite.utils.LoadingDialogHub +import com.pengxh.kt.lite.utils.LoadingDialog import com.pengxh.kt.lite.utils.WeakReferenceHandler import com.pengxh.kt.lite.widget.dialog.AlertControlDialog @@ -109,8 +109,8 @@ } } - binding.operationListView.addItemDecoration( - RecyclerViewItemOffsets(0, 5, 0, 5) + binding.recyclerView.addItemDecoration( + RecyclerViewItemOffsets(0, 7, 0, 7) ) } @@ -123,13 +123,13 @@ override fun observeRequestState() { wellViewModel.loadState.observe(this) { when (it) { - is LoadState.Loading -> LoadingDialogHub.show(this, "处理中,请稍后") + is LoadState.Loading -> LoadingDialog.show(this, "处理中,请稍后") is LoadState.Success -> { - LoadingDialogHub.dismiss() + LoadingDialog.dismiss() wellOperationAdapter.notifyItemChanged(clickedPosition) } - else -> LoadingDialogHub.dismiss() + else -> LoadingDialog.dismiss() } } } @@ -203,24 +203,23 @@ if (item.bfztName == "布防") { viewHolder.setImageResource( R.id.wellStateView, R.drawable.bg_solid_text_green_radius_5 - ).setText(R.id.wellStateView, "撤防") + ).setText(R.id.operationButton, "撤防") } else { viewHolder.setImageResource( R.id.wellStateView, R.drawable.bg_solid_text_red_radius_5 - ).setText(R.id.wellStateView, "布防") + ).setText(R.id.operationButton, "布防") } val deep = if (item.deep.toString().isBlank()) { "未知" } else { item.deep.toString() + "m" } - viewHolder.setText(R.id.wellNameView, item.wellName) + viewHolder.setText(R.id.wellTypeView, item.wellTypeName) .setText(R.id.wellStateView, "已${item.bfztName}") .setText(R.id.wellDepthView, "深:${deep}") .setText(R.id.wellCodeView, "点位编号:${item.wellCode}") - .setText(R.id.wellTypeView, "点位类型:${item.wellTypeName}") .setText(R.id.ownerShipView, "权属单位:${item.deptName}") - .setText(R.id.wellLocationView, "点位置:${item.position}") + .setText(R.id.wellLocationView, "点位位置:${item.position}") .setOnClickListener( R.id.operationButton, object : View.OnClickListener { override fun onClick(v: View?) { @@ -280,7 +279,7 @@ ) } } - binding.operationListView.adapter = wellOperationAdapter + binding.recyclerView.adapter = wellOperationAdapter wellOperationAdapter.setOnItemClickedListener(object : NormalRecyclerAdapter.OnItemClickedListener { override fun onItemClicked(position: Int, t: WellListModel.DataBean.RowsBean) { diff --git a/app/src/main/res/drawable/ic_down.xml b/app/src/main/res/drawable/ic_down.xml index 20e6476..6987e6c 100644 --- a/app/src/main/res/drawable/ic_down.xml +++ b/app/src/main/res/drawable/ic_down.xml @@ -1,6 +1,6 @@ + + diff --git a/app/src/main/res/layout/activity_about_us.xml b/app/src/main/res/layout/activity_about_us.xml index 9091a00..d5fbd0d 100644 --- a/app/src/main/res/layout/activity_about_us.xml +++ b/app/src/main/res/layout/activity_about_us.xml @@ -12,13 +12,7 @@ android:layout_width="match_parent" android:layout_height="wrap_content" android:background="@color/mainThemeColor" - app:tbv_left_image="@drawable/ic_title_left" - app:tbv_only_show_title="false" - app:tbv_show_left_image="true" - app:tbv_show_right_image="false" - app:tbv_text="关于我们" - app:tbv_text_color="@color/white" - app:tbv_text_size="@dimen/sp_18" /> + app:tbv_text="关于我们" /> + app:tbv_text="修改密码" /> + app:tbv_text="布防列表" /> + app:tbv_text="帮助中心" /> + app:tbv_text="工单详情" /> + app:tbv_text="工单详情" /> + app:tbv_text="工单详情" /> + app:tbv_text="工单详情" /> + app:tbv_text="超时工单" /> + app:tbv_text="工单查询" /> + app:tbv_text="查询结果" /> + app:tbv_text="撤防列表" /> + app:tbv_text="个人资料" /> + app:tbv_text="点位详情" /> + app:tbv_text="监控内容" /> - - - - - - + android:layout_height="wrap_content" + android:background="@color/mainThemeColor" + app:tbv_show_left_image="false" + app:tbv_show_right_image="true" + app:tbv_text="首页" /> - + - + + android:value="ee96d8b5e12de3fbb29949efd57418a8" /> () @@ -150,7 +158,7 @@ val cameraPosition = CameraPosition(centerLatLng, 14f, 0f, 0f) val cameraUpdate = CameraUpdateFactory.newCameraPosition(cameraPosition) withContext(Dispatchers.Main) { - LoadingDialogHub.dismiss() + LoadingDialog.dismiss() aMap.animateCamera(cameraUpdate, 1500, null) } } @@ -239,11 +247,6 @@ } override fun initEvent() { - binding.rightOptionView.setOnClickListener { - val x = binding.rightOptionView.width - easyPopupWindow.width - easyPopupWindow.showAsDropDown(binding.rightOptionView, x, 0) - } - //撤防点位 binding.unDeployedLayout.setOnClickListener { requireContext().navigatePageTo() @@ -263,11 +266,11 @@ override fun observeRequestState() { wellViewModel.loadState.observe(this) { when (it) { - is LoadState.Loading -> LoadingDialogHub.show( + is LoadState.Loading -> LoadingDialog.show( requireActivity(), "数据加载中,请稍后..." ) - else -> LoadingDialogHub.dismiss() + else -> LoadingDialog.dismiss() } } } @@ -376,7 +379,7 @@ }).build().show() } }) - infoPopup.showAsDropDown(binding.rightOptionView) +// infoPopup.showAsDropDown(binding.rightOptionView) } override fun onCameraChange(p0: CameraPosition?) { diff --git a/app/src/main/java/com/casic/app/smartwell/fragment/HomePageNoClusterFragment.kt b/app/src/main/java/com/casic/app/smartwell/fragment/HomePageNoClusterFragment.kt index 802426a..b25f743 100644 --- a/app/src/main/java/com/casic/app/smartwell/fragment/HomePageNoClusterFragment.kt +++ b/app/src/main/java/com/casic/app/smartwell/fragment/HomePageNoClusterFragment.kt @@ -38,8 +38,9 @@ import com.pengxh.kt.lite.extensions.navigatePageTo import com.pengxh.kt.lite.extensions.show import com.pengxh.kt.lite.utils.LoadState -import com.pengxh.kt.lite.utils.LoadingDialogHub +import com.pengxh.kt.lite.utils.LoadingDialog import com.pengxh.kt.lite.widget.EasyPopupWindow +import com.pengxh.kt.lite.widget.TitleBarView import com.pengxh.kt.lite.widget.dialog.AlertControlDialog import kotlinx.coroutines.Dispatchers import kotlinx.coroutines.launch @@ -78,7 +79,15 @@ override fun setupTopBarLayout() { binding.rootView.initImmersionBar(this, false, R.color.mainThemeColor) - binding.titleView.text = "首页" + binding.titleView.setOnClickListener(object : TitleBarView.OnClickListener { + override fun onLeftClick() { + + } + + override fun onRightClick() { + easyPopupWindow.showAsDropDown(binding.titleView, binding.titleView.width, 0) + } + }) } override fun initOnCreate(savedInstanceState: Bundle?) { @@ -112,7 +121,7 @@ //渲染井位置 lifecycleScope.launch(Dispatchers.Main) { - LoadingDialogHub.show(requireActivity(), "数据加载中,请稍后") + LoadingDialog.show(requireActivity(), "数据加载中,请稍后") withContext(Dispatchers.IO) { //取Well缓存 val allMarkerOptions = ArrayList() @@ -144,7 +153,7 @@ val cameraPosition = CameraPosition(centerLatLng, 14f, 0f, 0f) val cameraUpdate = CameraUpdateFactory.newCameraPosition(cameraPosition) withContext(Dispatchers.Main) { - LoadingDialogHub.dismiss() + LoadingDialog.dismiss() aMap.animateCamera(cameraUpdate, 1500, null) } } @@ -238,11 +247,6 @@ } override fun initEvent() { - binding.rightOptionView.setOnClickListener { - val x = binding.rightOptionView.width - easyPopupWindow.width - easyPopupWindow.showAsDropDown(binding.rightOptionView, x, 0) - } - //撤防点位 binding.unDeployedLayout.setOnClickListener { requireContext().navigatePageTo() @@ -262,11 +266,11 @@ override fun observeRequestState() { wellViewModel.loadState.observe(this) { when (it) { - is LoadState.Loading -> LoadingDialogHub.show( + is LoadState.Loading -> LoadingDialog.show( requireActivity(), "数据加载中,请稍后..." ) - else -> LoadingDialogHub.dismiss() + else -> LoadingDialog.dismiss() } } } diff --git a/app/src/main/java/com/casic/app/smartwell/fragment/MinePageFragment.kt b/app/src/main/java/com/casic/app/smartwell/fragment/MinePageFragment.kt index 09a570c..dcb48f8 100644 --- a/app/src/main/java/com/casic/app/smartwell/fragment/MinePageFragment.kt +++ b/app/src/main/java/com/casic/app/smartwell/fragment/MinePageFragment.kt @@ -35,7 +35,7 @@ import com.pengxh.kt.lite.utils.ActivityStackManager import com.pengxh.kt.lite.utils.FileDownloadManager import com.pengxh.kt.lite.utils.LoadState -import com.pengxh.kt.lite.utils.LoadingDialogHub +import com.pengxh.kt.lite.utils.LoadingDialog import com.pengxh.kt.lite.widget.dialog.AlertControlDialog import com.pengxh.kt.lite.widget.dialog.BottomActionSheet import kotlinx.coroutines.Dispatchers @@ -60,7 +60,6 @@ override fun setupTopBarLayout() { binding.rootView.initImmersionBar(this, false, R.color.mainThemeColor) - binding.titleInclude.titleView.text = "我的" } override fun initOnCreate(savedInstanceState: Bundle?) { @@ -155,27 +154,27 @@ override fun observeRequestState() { userViewModel.loadState.observe(this) { when (it) { - is LoadState.Loading -> LoadingDialogHub.show( + is LoadState.Loading -> LoadingDialog.show( requireActivity(), "检查版本中,请稍后" ) - else -> LoadingDialogHub.dismiss() + else -> LoadingDialog.dismiss() } } wellViewModel.loadState.observe(this) { when (it) { - is LoadState.Loading -> LoadingDialogHub.show( + is LoadState.Loading -> LoadingDialog.show( requireActivity(), "数据更新中,请稍后" ) is LoadState.Fail -> { - LoadingDialogHub.dismiss() + LoadingDialog.dismiss() "数据更新超时".show(requireContext()) } else -> { - LoadingDialogHub.dismiss() + LoadingDialog.dismiss() AlertControlDialog.Builder().setContext(requireContext()).setTitle("温馨提示") .setMessage("数据更新成功,请重启应用").setNegativeButton("取消") .setPositiveButton("确定").setOnDialogButtonClickListener(object : @@ -197,17 +196,17 @@ lineViewModel.loadState.observe(this) { when (it) { - is LoadState.Loading -> LoadingDialogHub.show( + is LoadState.Loading -> LoadingDialog.show( requireActivity(), "数据更新中,请稍后" ) is LoadState.Fail -> { - LoadingDialogHub.dismiss() + LoadingDialog.dismiss() "数据更新超时".show(requireContext()) } else -> { - LoadingDialogHub.dismiss() + LoadingDialog.dismiss() AlertControlDialog.Builder().setContext(requireContext()).setTitle("温馨提示") .setMessage("数据更新成功,请重启应用").setNegativeButton("取消") .setPositiveButton("确定").setOnDialogButtonClickListener(object : diff --git a/app/src/main/java/com/casic/app/smartwell/fragment/NoticePageFragment.kt b/app/src/main/java/com/casic/app/smartwell/fragment/NoticePageFragment.kt index 171b555..3c93f54 100644 --- a/app/src/main/java/com/casic/app/smartwell/fragment/NoticePageFragment.kt +++ b/app/src/main/java/com/casic/app/smartwell/fragment/NoticePageFragment.kt @@ -48,7 +48,6 @@ override fun setupTopBarLayout() { binding.rootView.initImmersionBar(this, false, R.color.mainThemeColor) - binding.titleInclude.titleView.text = "消息" } override fun initOnCreate(savedInstanceState: Bundle?) { diff --git a/app/src/main/java/com/casic/app/smartwell/fragment/OrderListFragment.kt b/app/src/main/java/com/casic/app/smartwell/fragment/OrderListFragment.kt index 93ff35b..5e38acb 100644 --- a/app/src/main/java/com/casic/app/smartwell/fragment/OrderListFragment.kt +++ b/app/src/main/java/com/casic/app/smartwell/fragment/OrderListFragment.kt @@ -12,6 +12,7 @@ import com.casic.app.smartwell.view.SearchOrderActivity import com.pengxh.kt.lite.base.KotlinBaseFragment import com.pengxh.kt.lite.extensions.navigatePageTo +import com.pengxh.kt.lite.widget.TitleBarView class OrderListFragment : KotlinBaseFragment() { @@ -25,15 +26,22 @@ } override fun initViewBinding( - inflater: LayoutInflater, - container: ViewGroup? + inflater: LayoutInflater, container: ViewGroup? ): FragmentOrderBinding { return FragmentOrderBinding.inflate(inflater, container, false) } override fun setupTopBarLayout() { binding.rootView.initImmersionBar(this, false, R.color.mainThemeColor) - binding.titleView.text = "工单" + binding.titleView.setOnClickListener(object : TitleBarView.OnClickListener { + override fun onLeftClick() { + + } + + override fun onRightClick() { + requireContext().navigatePageTo() + } + }) } override fun initOnCreate(savedInstanceState: Bundle?) { @@ -51,8 +59,6 @@ } override fun initEvent() { - binding.rightOptionView.setOnClickListener { - requireContext().navigatePageTo() - } + } } \ No newline at end of file diff --git a/app/src/main/java/com/casic/app/smartwell/fragment/OrderNotProcessedFragment.kt b/app/src/main/java/com/casic/app/smartwell/fragment/OrderNotProcessedFragment.kt index 0b3d09d..2b6f21d 100644 --- a/app/src/main/java/com/casic/app/smartwell/fragment/OrderNotProcessedFragment.kt +++ b/app/src/main/java/com/casic/app/smartwell/fragment/OrderNotProcessedFragment.kt @@ -18,7 +18,7 @@ import com.pengxh.kt.lite.extensions.navigatePageTo import com.pengxh.kt.lite.extensions.show import com.pengxh.kt.lite.utils.LoadState -import com.pengxh.kt.lite.utils.LoadingDialogHub +import com.pengxh.kt.lite.utils.LoadingDialog import com.pengxh.kt.lite.utils.WeakReferenceHandler import com.pengxh.kt.lite.widget.dialog.AlertControlDialog @@ -78,8 +78,8 @@ operationViewModel = ViewModelProvider(this)[OperationViewModel::class.java] - binding.notProcessedView.addItemDecoration( - RecyclerViewItemOffsets(0, 5, 0, 5) + binding.recyclerView.addItemDecoration( + RecyclerViewItemOffsets(0, 7, 0, 7) ) } @@ -87,9 +87,9 @@ //接单状态处理 operationViewModel.loadState.observe(this) { when (it) { - is LoadState.Loading -> LoadingDialogHub.show(requireActivity(), "接单中,请稍后") + is LoadState.Loading -> LoadingDialog.show(requireActivity(), "接单中,请稍后") is LoadState.Success -> { - LoadingDialogHub.dismiss() + LoadingDialog.dismiss() //接单成功之后刷新列表 dataBeans.removeAt(clickedPosition) notProcessedAdapter.notifyItemRemoved(clickedPosition) @@ -98,7 +98,7 @@ ) } - else -> LoadingDialogHub.dismiss() + else -> LoadingDialog.dismiss() } } } @@ -131,7 +131,7 @@ } else { binding.emptyInclude.emptyView.hide() notProcessedAdapter = OrderNotProcessedAdapter(requireContext(), dataBeans) - binding.notProcessedView.adapter = notProcessedAdapter + binding.recyclerView.adapter = notProcessedAdapter notProcessedAdapter.setOnItemClickListener(object : OrderNotProcessedAdapter.OnItemClickListener { override fun onClicked(position: Int) { diff --git a/app/src/main/java/com/casic/app/smartwell/fragment/OvertimeNotAcceptFragment.kt b/app/src/main/java/com/casic/app/smartwell/fragment/OvertimeNotAcceptFragment.kt index a198545..9b318ca 100644 --- a/app/src/main/java/com/casic/app/smartwell/fragment/OvertimeNotAcceptFragment.kt +++ b/app/src/main/java/com/casic/app/smartwell/fragment/OvertimeNotAcceptFragment.kt @@ -18,7 +18,7 @@ import com.pengxh.kt.lite.extensions.navigatePageTo import com.pengxh.kt.lite.extensions.show import com.pengxh.kt.lite.utils.LoadState -import com.pengxh.kt.lite.utils.LoadingDialogHub +import com.pengxh.kt.lite.utils.LoadingDialog import com.pengxh.kt.lite.utils.WeakReferenceHandler import com.pengxh.kt.lite.widget.dialog.AlertControlDialog @@ -81,8 +81,8 @@ operationViewModel = ViewModelProvider(this)[OperationViewModel::class.java] - binding.notProcessedView.addItemDecoration( - RecyclerViewItemOffsets(0, 5, 0, 5) + binding.recyclerView.addItemDecoration( + RecyclerViewItemOffsets(0, 7, 0, 7) ) } @@ -90,9 +90,9 @@ //接单状态处理 operationViewModel.loadState.observe(this) { when (it) { - is LoadState.Loading -> LoadingDialogHub.show(requireActivity(), "接单中,请稍后") + is LoadState.Loading -> LoadingDialog.show(requireActivity(), "接单中,请稍后") is LoadState.Success -> { - LoadingDialogHub.dismiss() + LoadingDialog.dismiss() //接单成功之后刷新列表 dataBeans.removeAt(clickedPosition) notProcessedAdapter.notifyItemRemoved(clickedPosition) @@ -101,7 +101,7 @@ ) } - else -> LoadingDialogHub.dismiss() + else -> LoadingDialog.dismiss() } } } @@ -134,7 +134,7 @@ } else { binding.emptyInclude.emptyView.hide() notProcessedAdapter = OrderNotProcessedAdapter(requireContext(), dataBeans) - binding.notProcessedView.adapter = notProcessedAdapter + binding.recyclerView.adapter = notProcessedAdapter notProcessedAdapter.setOnItemClickListener(object : OrderNotProcessedAdapter.OnItemClickListener { override fun onClicked(position: Int) { diff --git a/app/src/main/java/com/casic/app/smartwell/greendao/DaoMaster.java b/app/src/main/java/com/casic/app/smartwell/greendao/DaoMaster.java index fdcf3a7..1e52b74 100644 --- a/app/src/main/java/com/casic/app/smartwell/greendao/DaoMaster.java +++ b/app/src/main/java/com/casic/app/smartwell/greendao/DaoMaster.java @@ -13,25 +13,20 @@ // THIS CODE IS GENERATED BY greenDAO, DO NOT EDIT. - /** * Master of DAO (schema version 4): knows all DAOs. */ public class DaoMaster extends AbstractDaoMaster { public static final int SCHEMA_VERSION = 4; - /** - * Creates underlying database table using DAOs. - */ + /** Creates underlying database table using DAOs. */ public static void createAllTables(Database db, boolean ifNotExists) { MapWellLocalBeanDao.createTable(db, ifNotExists); NoticeLocaleBeanDao.createTable(db, ifNotExists); PipeLocalBeanDao.createTable(db, ifNotExists); } - /** - * Drops underlying database table using DAOs. - */ + /** Drops underlying database table using DAOs. */ public static void dropAllTables(Database db, boolean ifExists) { MapWellLocalBeanDao.dropTable(db, ifExists); NoticeLocaleBeanDao.dropTable(db, ifExists); @@ -86,9 +81,7 @@ } } - /** - * WARNING: Drops all table on Upgrade! Use only during development. - */ + /** WARNING: Drops all table on Upgrade! Use only during development. */ public static class DevOpenHelper extends OpenHelper { public DevOpenHelper(Context context, String name) { super(context, name); diff --git a/app/src/main/java/com/casic/app/smartwell/greendao/DaoSession.java b/app/src/main/java/com/casic/app/smartwell/greendao/DaoSession.java index 0b36d17..3e40e3b 100644 --- a/app/src/main/java/com/casic/app/smartwell/greendao/DaoSession.java +++ b/app/src/main/java/com/casic/app/smartwell/greendao/DaoSession.java @@ -16,7 +16,7 @@ /** * {@inheritDoc} - * + * * @see org.greenrobot.greendao.AbstractDaoSession */ public class DaoSession extends AbstractDaoSession { @@ -50,7 +50,7 @@ registerDao(NoticeLocaleBean.class, noticeLocaleBeanDao); registerDao(PipeLocalBean.class, pipeLocalBeanDao); } - + public void clear() { mapWellLocalBeanDaoConfig.clearIdentityScope(); noticeLocaleBeanDaoConfig.clearIdentityScope(); diff --git a/app/src/main/java/com/casic/app/smartwell/greendao/MapWellLocalBeanDao.java b/app/src/main/java/com/casic/app/smartwell/greendao/MapWellLocalBeanDao.java index 8908fda..407bc92 100644 --- a/app/src/main/java/com/casic/app/smartwell/greendao/MapWellLocalBeanDao.java +++ b/app/src/main/java/com/casic/app/smartwell/greendao/MapWellLocalBeanDao.java @@ -12,10 +12,9 @@ import org.greenrobot.greendao.internal.DaoConfig; // THIS CODE IS GENERATED BY greenDAO, DO NOT EDIT. - -/** +/** * DAO for table "MAP_WELL_LOCAL_BEAN". - */ +*/ public class MapWellLocalBeanDao extends AbstractDao { public static final String TABLENAME = "MAP_WELL_LOCAL_BEAN"; @@ -57,16 +56,14 @@ public MapWellLocalBeanDao(DaoConfig config) { super(config); } - + public MapWellLocalBeanDao(DaoConfig config, DaoSession daoSession) { super(config, daoSession); } - /** - * Creates the underlying database table. - */ + /** Creates the underlying database table. */ public static void createTable(Database db, boolean ifNotExists) { - String constraint = ifNotExists ? "IF NOT EXISTS " : ""; + String constraint = ifNotExists? "IF NOT EXISTS ": ""; db.execSQL("CREATE TABLE " + constraint + "\"MAP_WELL_LOCAL_BEAN\" (" + // "\"_id\" INTEGER PRIMARY KEY AUTOINCREMENT ," + // 0: kId "\"AREA\" TEXT," + // 1: area @@ -96,9 +93,7 @@ "\"WELL_TYPE_NAME\" TEXT);"); // 25: wellTypeName } - /** - * Drops the underlying database table. - */ + /** Drops the underlying database table. */ public static void dropTable(Database db, boolean ifExists) { String sql = "DROP TABLE " + (ifExists ? "IF EXISTS " : "") + "\"MAP_WELL_LOCAL_BEAN\""; db.execSQL(sql); @@ -107,132 +102,132 @@ @Override protected final void bindValues(DatabaseStatement stmt, MapWellLocalBean entity) { stmt.clearBindings(); - + Long kId = entity.getKId(); if (kId != null) { stmt.bindLong(1, kId); } - + String area = entity.getArea(); if (area != null) { stmt.bindString(2, area); } - + String bfzt = entity.getBfzt(); if (bfzt != null) { stmt.bindString(3, bfzt); } - + String bfztName = entity.getBfztName(); if (bfztName != null) { stmt.bindString(4, bfztName); } - + String coordinateX = entity.getCoordinateX(); if (coordinateX != null) { stmt.bindString(5, coordinateX); } - + String coordinateY = entity.getCoordinateY(); if (coordinateY != null) { stmt.bindString(6, coordinateY); } - + String deep = entity.getDeep(); if (deep != null) { stmt.bindString(7, deep); } - + String deptName = entity.getDeptName(); if (deptName != null) { stmt.bindString(8, deptName); } - + String deptid = entity.getDeptid(); if (deptid != null) { stmt.bindString(9, deptid); } - + String id = entity.getId(); if (id != null) { stmt.bindString(10, id); } - + String latBaidu = entity.getLatBaidu(); if (latBaidu != null) { stmt.bindString(11, latBaidu); } - + String latGaode = entity.getLatGaode(); if (latGaode != null) { stmt.bindString(12, latGaode); } - + String lngBaidu = entity.getLngBaidu(); if (lngBaidu != null) { stmt.bindString(13, lngBaidu); } - + String lngGaode = entity.getLngGaode(); if (lngGaode != null) { stmt.bindString(14, lngGaode); } - + String notes = entity.getNotes(); if (notes != null) { stmt.bindString(15, notes); } - + String photos = entity.getPhotos(); if (photos != null) { stmt.bindString(16, photos); } - + String position = entity.getPosition(); if (position != null) { stmt.bindString(17, position); } - + String staff = entity.getStaff(); if (staff != null) { stmt.bindString(18, staff); } - + String tel = entity.getTel(); if (tel != null) { stmt.bindString(19, tel); } - + String ts = entity.getTs(); if (ts != null) { stmt.bindString(20, ts); } - + String valid = entity.getValid(); if (valid != null) { stmt.bindString(21, valid); } - + String watchData = entity.getWatchData(); if (watchData != null) { stmt.bindString(22, watchData); } - + String wellCode = entity.getWellCode(); if (wellCode != null) { stmt.bindString(23, wellCode); } - + String wellName = entity.getWellName(); if (wellName != null) { stmt.bindString(24, wellName); } - + String wellType = entity.getWellType(); if (wellType != null) { stmt.bindString(25, wellType); } - + String wellTypeName = entity.getWellTypeName(); if (wellTypeName != null) { stmt.bindString(26, wellTypeName); @@ -242,132 +237,132 @@ @Override protected final void bindValues(SQLiteStatement stmt, MapWellLocalBean entity) { stmt.clearBindings(); - + Long kId = entity.getKId(); if (kId != null) { stmt.bindLong(1, kId); } - + String area = entity.getArea(); if (area != null) { stmt.bindString(2, area); } - + String bfzt = entity.getBfzt(); if (bfzt != null) { stmt.bindString(3, bfzt); } - + String bfztName = entity.getBfztName(); if (bfztName != null) { stmt.bindString(4, bfztName); } - + String coordinateX = entity.getCoordinateX(); if (coordinateX != null) { stmt.bindString(5, coordinateX); } - + String coordinateY = entity.getCoordinateY(); if (coordinateY != null) { stmt.bindString(6, coordinateY); } - + String deep = entity.getDeep(); if (deep != null) { stmt.bindString(7, deep); } - + String deptName = entity.getDeptName(); if (deptName != null) { stmt.bindString(8, deptName); } - + String deptid = entity.getDeptid(); if (deptid != null) { stmt.bindString(9, deptid); } - + String id = entity.getId(); if (id != null) { stmt.bindString(10, id); } - + String latBaidu = entity.getLatBaidu(); if (latBaidu != null) { stmt.bindString(11, latBaidu); } - + String latGaode = entity.getLatGaode(); if (latGaode != null) { stmt.bindString(12, latGaode); } - + String lngBaidu = entity.getLngBaidu(); if (lngBaidu != null) { stmt.bindString(13, lngBaidu); } - + String lngGaode = entity.getLngGaode(); if (lngGaode != null) { stmt.bindString(14, lngGaode); } - + String notes = entity.getNotes(); if (notes != null) { stmt.bindString(15, notes); } - + String photos = entity.getPhotos(); if (photos != null) { stmt.bindString(16, photos); } - + String position = entity.getPosition(); if (position != null) { stmt.bindString(17, position); } - + String staff = entity.getStaff(); if (staff != null) { stmt.bindString(18, staff); } - + String tel = entity.getTel(); if (tel != null) { stmt.bindString(19, tel); } - + String ts = entity.getTs(); if (ts != null) { stmt.bindString(20, ts); } - + String valid = entity.getValid(); if (valid != null) { stmt.bindString(21, valid); } - + String watchData = entity.getWatchData(); if (watchData != null) { stmt.bindString(22, watchData); } - + String wellCode = entity.getWellCode(); if (wellCode != null) { stmt.bindString(23, wellCode); } - + String wellName = entity.getWellName(); if (wellName != null) { stmt.bindString(24, wellName); } - + String wellType = entity.getWellType(); if (wellType != null) { stmt.bindString(25, wellType); } - + String wellTypeName = entity.getWellTypeName(); if (wellTypeName != null) { stmt.bindString(26, wellTypeName); @@ -377,41 +372,41 @@ @Override public Long readKey(Cursor cursor, int offset) { return cursor.isNull(offset + 0) ? null : cursor.getLong(offset + 0); - } + } @Override public MapWellLocalBean readEntity(Cursor cursor, int offset) { MapWellLocalBean entity = new MapWellLocalBean( // - cursor.isNull(offset + 0) ? null : cursor.getLong(offset + 0), // kId - cursor.isNull(offset + 1) ? null : cursor.getString(offset + 1), // area - cursor.isNull(offset + 2) ? null : cursor.getString(offset + 2), // bfzt - cursor.isNull(offset + 3) ? null : cursor.getString(offset + 3), // bfztName - cursor.isNull(offset + 4) ? null : cursor.getString(offset + 4), // coordinateX - cursor.isNull(offset + 5) ? null : cursor.getString(offset + 5), // coordinateY - cursor.isNull(offset + 6) ? null : cursor.getString(offset + 6), // deep - cursor.isNull(offset + 7) ? null : cursor.getString(offset + 7), // deptName - cursor.isNull(offset + 8) ? null : cursor.getString(offset + 8), // deptid - cursor.isNull(offset + 9) ? null : cursor.getString(offset + 9), // id - cursor.isNull(offset + 10) ? null : cursor.getString(offset + 10), // latBaidu - cursor.isNull(offset + 11) ? null : cursor.getString(offset + 11), // latGaode - cursor.isNull(offset + 12) ? null : cursor.getString(offset + 12), // lngBaidu - cursor.isNull(offset + 13) ? null : cursor.getString(offset + 13), // lngGaode - cursor.isNull(offset + 14) ? null : cursor.getString(offset + 14), // notes - cursor.isNull(offset + 15) ? null : cursor.getString(offset + 15), // photos - cursor.isNull(offset + 16) ? null : cursor.getString(offset + 16), // position - cursor.isNull(offset + 17) ? null : cursor.getString(offset + 17), // staff - cursor.isNull(offset + 18) ? null : cursor.getString(offset + 18), // tel - cursor.isNull(offset + 19) ? null : cursor.getString(offset + 19), // ts - cursor.isNull(offset + 20) ? null : cursor.getString(offset + 20), // valid - cursor.isNull(offset + 21) ? null : cursor.getString(offset + 21), // watchData - cursor.isNull(offset + 22) ? null : cursor.getString(offset + 22), // wellCode - cursor.isNull(offset + 23) ? null : cursor.getString(offset + 23), // wellName - cursor.isNull(offset + 24) ? null : cursor.getString(offset + 24), // wellType - cursor.isNull(offset + 25) ? null : cursor.getString(offset + 25) // wellTypeName + cursor.isNull(offset + 0) ? null : cursor.getLong(offset + 0), // kId + cursor.isNull(offset + 1) ? null : cursor.getString(offset + 1), // area + cursor.isNull(offset + 2) ? null : cursor.getString(offset + 2), // bfzt + cursor.isNull(offset + 3) ? null : cursor.getString(offset + 3), // bfztName + cursor.isNull(offset + 4) ? null : cursor.getString(offset + 4), // coordinateX + cursor.isNull(offset + 5) ? null : cursor.getString(offset + 5), // coordinateY + cursor.isNull(offset + 6) ? null : cursor.getString(offset + 6), // deep + cursor.isNull(offset + 7) ? null : cursor.getString(offset + 7), // deptName + cursor.isNull(offset + 8) ? null : cursor.getString(offset + 8), // deptid + cursor.isNull(offset + 9) ? null : cursor.getString(offset + 9), // id + cursor.isNull(offset + 10) ? null : cursor.getString(offset + 10), // latBaidu + cursor.isNull(offset + 11) ? null : cursor.getString(offset + 11), // latGaode + cursor.isNull(offset + 12) ? null : cursor.getString(offset + 12), // lngBaidu + cursor.isNull(offset + 13) ? null : cursor.getString(offset + 13), // lngGaode + cursor.isNull(offset + 14) ? null : cursor.getString(offset + 14), // notes + cursor.isNull(offset + 15) ? null : cursor.getString(offset + 15), // photos + cursor.isNull(offset + 16) ? null : cursor.getString(offset + 16), // position + cursor.isNull(offset + 17) ? null : cursor.getString(offset + 17), // staff + cursor.isNull(offset + 18) ? null : cursor.getString(offset + 18), // tel + cursor.isNull(offset + 19) ? null : cursor.getString(offset + 19), // ts + cursor.isNull(offset + 20) ? null : cursor.getString(offset + 20), // valid + cursor.isNull(offset + 21) ? null : cursor.getString(offset + 21), // watchData + cursor.isNull(offset + 22) ? null : cursor.getString(offset + 22), // wellCode + cursor.isNull(offset + 23) ? null : cursor.getString(offset + 23), // wellName + cursor.isNull(offset + 24) ? null : cursor.getString(offset + 24), // wellType + cursor.isNull(offset + 25) ? null : cursor.getString(offset + 25) // wellTypeName ); return entity; } - + @Override public void readEntity(Cursor cursor, MapWellLocalBean entity, int offset) { entity.setKId(cursor.isNull(offset + 0) ? null : cursor.getLong(offset + 0)); @@ -440,17 +435,17 @@ entity.setWellName(cursor.isNull(offset + 23) ? null : cursor.getString(offset + 23)); entity.setWellType(cursor.isNull(offset + 24) ? null : cursor.getString(offset + 24)); entity.setWellTypeName(cursor.isNull(offset + 25) ? null : cursor.getString(offset + 25)); - } - + } + @Override protected final Long updateKeyAfterInsert(MapWellLocalBean entity, long rowId) { entity.setKId(rowId); return rowId; } - + @Override public Long getKey(MapWellLocalBean entity) { - if (entity != null) { + if(entity != null) { return entity.getKId(); } else { return null; @@ -466,5 +461,5 @@ protected final boolean isEntityUpdateable() { return true; } - + } diff --git a/app/src/main/java/com/casic/app/smartwell/greendao/NoticeLocaleBeanDao.java b/app/src/main/java/com/casic/app/smartwell/greendao/NoticeLocaleBeanDao.java index 64312ed..deb2d49 100644 --- a/app/src/main/java/com/casic/app/smartwell/greendao/NoticeLocaleBeanDao.java +++ b/app/src/main/java/com/casic/app/smartwell/greendao/NoticeLocaleBeanDao.java @@ -12,10 +12,9 @@ import org.greenrobot.greendao.internal.DaoConfig; // THIS CODE IS GENERATED BY greenDAO, DO NOT EDIT. - -/** +/** * DAO for table "NOTICE_LOCALE_BEAN". - */ +*/ public class NoticeLocaleBeanDao extends AbstractDao { public static final String TABLENAME = "NOTICE_LOCALE_BEAN"; @@ -43,16 +42,14 @@ public NoticeLocaleBeanDao(DaoConfig config) { super(config); } - + public NoticeLocaleBeanDao(DaoConfig config, DaoSession daoSession) { super(config, daoSession); } - /** - * Creates the underlying database table. - */ + /** Creates the underlying database table. */ public static void createTable(Database db, boolean ifNotExists) { - String constraint = ifNotExists ? "IF NOT EXISTS " : ""; + String constraint = ifNotExists? "IF NOT EXISTS ": ""; db.execSQL("CREATE TABLE " + constraint + "\"NOTICE_LOCALE_BEAN\" (" + // "\"_id\" INTEGER PRIMARY KEY AUTOINCREMENT ," + // 0: id "\"MESSAGE_ID\" TEXT UNIQUE ," + // 1: messageId @@ -68,9 +65,7 @@ "\"NOTICE_TIME\" TEXT);"); // 11: noticeTime } - /** - * Drops the underlying database table. - */ + /** Drops the underlying database table. */ public static void dropTable(Database db, boolean ifExists) { String sql = "DROP TABLE " + (ifExists ? "IF EXISTS " : "") + "\"NOTICE_LOCALE_BEAN\""; db.execSQL(sql); @@ -79,62 +74,62 @@ @Override protected final void bindValues(DatabaseStatement stmt, NoticeLocaleBean entity) { stmt.clearBindings(); - + Long id = entity.getId(); if (id != null) { stmt.bindLong(1, id); } - + String messageId = entity.getMessageId(); if (messageId != null) { stmt.bindString(2, messageId); } - + String appid = entity.getAppid(); if (appid != null) { stmt.bindString(3, appid); } - + String clientId = entity.getClientId(); if (clientId != null) { stmt.bindString(4, clientId); } - + String taskId = entity.getTaskId(); if (taskId != null) { stmt.bindString(5, taskId); } - + String userId = entity.getUserId(); if (userId != null) { stmt.bindString(6, userId); } - + String title = entity.getTitle(); if (title != null) { stmt.bindString(7, title); } - + String content = entity.getContent(); if (content != null) { stmt.bindString(8, content); } - + String deviceCode = entity.getDeviceCode(); if (deviceCode != null) { stmt.bindString(9, deviceCode); } - + String jobId = entity.getJobId(); if (jobId != null) { stmt.bindString(10, jobId); } - + String isRead = entity.getIsRead(); if (isRead != null) { stmt.bindString(11, isRead); } - + String noticeTime = entity.getNoticeTime(); if (noticeTime != null) { stmt.bindString(12, noticeTime); @@ -144,62 +139,62 @@ @Override protected final void bindValues(SQLiteStatement stmt, NoticeLocaleBean entity) { stmt.clearBindings(); - + Long id = entity.getId(); if (id != null) { stmt.bindLong(1, id); } - + String messageId = entity.getMessageId(); if (messageId != null) { stmt.bindString(2, messageId); } - + String appid = entity.getAppid(); if (appid != null) { stmt.bindString(3, appid); } - + String clientId = entity.getClientId(); if (clientId != null) { stmt.bindString(4, clientId); } - + String taskId = entity.getTaskId(); if (taskId != null) { stmt.bindString(5, taskId); } - + String userId = entity.getUserId(); if (userId != null) { stmt.bindString(6, userId); } - + String title = entity.getTitle(); if (title != null) { stmt.bindString(7, title); } - + String content = entity.getContent(); if (content != null) { stmt.bindString(8, content); } - + String deviceCode = entity.getDeviceCode(); if (deviceCode != null) { stmt.bindString(9, deviceCode); } - + String jobId = entity.getJobId(); if (jobId != null) { stmt.bindString(10, jobId); } - + String isRead = entity.getIsRead(); if (isRead != null) { stmt.bindString(11, isRead); } - + String noticeTime = entity.getNoticeTime(); if (noticeTime != null) { stmt.bindString(12, noticeTime); @@ -209,27 +204,27 @@ @Override public Long readKey(Cursor cursor, int offset) { return cursor.isNull(offset + 0) ? null : cursor.getLong(offset + 0); - } + } @Override public NoticeLocaleBean readEntity(Cursor cursor, int offset) { NoticeLocaleBean entity = new NoticeLocaleBean( // - cursor.isNull(offset + 0) ? null : cursor.getLong(offset + 0), // id - cursor.isNull(offset + 1) ? null : cursor.getString(offset + 1), // messageId - cursor.isNull(offset + 2) ? null : cursor.getString(offset + 2), // appid - cursor.isNull(offset + 3) ? null : cursor.getString(offset + 3), // clientId - cursor.isNull(offset + 4) ? null : cursor.getString(offset + 4), // taskId - cursor.isNull(offset + 5) ? null : cursor.getString(offset + 5), // userId - cursor.isNull(offset + 6) ? null : cursor.getString(offset + 6), // title - cursor.isNull(offset + 7) ? null : cursor.getString(offset + 7), // content - cursor.isNull(offset + 8) ? null : cursor.getString(offset + 8), // deviceCode - cursor.isNull(offset + 9) ? null : cursor.getString(offset + 9), // jobId - cursor.isNull(offset + 10) ? null : cursor.getString(offset + 10), // isRead - cursor.isNull(offset + 11) ? null : cursor.getString(offset + 11) // noticeTime + cursor.isNull(offset + 0) ? null : cursor.getLong(offset + 0), // id + cursor.isNull(offset + 1) ? null : cursor.getString(offset + 1), // messageId + cursor.isNull(offset + 2) ? null : cursor.getString(offset + 2), // appid + cursor.isNull(offset + 3) ? null : cursor.getString(offset + 3), // clientId + cursor.isNull(offset + 4) ? null : cursor.getString(offset + 4), // taskId + cursor.isNull(offset + 5) ? null : cursor.getString(offset + 5), // userId + cursor.isNull(offset + 6) ? null : cursor.getString(offset + 6), // title + cursor.isNull(offset + 7) ? null : cursor.getString(offset + 7), // content + cursor.isNull(offset + 8) ? null : cursor.getString(offset + 8), // deviceCode + cursor.isNull(offset + 9) ? null : cursor.getString(offset + 9), // jobId + cursor.isNull(offset + 10) ? null : cursor.getString(offset + 10), // isRead + cursor.isNull(offset + 11) ? null : cursor.getString(offset + 11) // noticeTime ); return entity; } - + @Override public void readEntity(Cursor cursor, NoticeLocaleBean entity, int offset) { entity.setId(cursor.isNull(offset + 0) ? null : cursor.getLong(offset + 0)); @@ -244,17 +239,17 @@ entity.setJobId(cursor.isNull(offset + 9) ? null : cursor.getString(offset + 9)); entity.setIsRead(cursor.isNull(offset + 10) ? null : cursor.getString(offset + 10)); entity.setNoticeTime(cursor.isNull(offset + 11) ? null : cursor.getString(offset + 11)); - } - + } + @Override protected final Long updateKeyAfterInsert(NoticeLocaleBean entity, long rowId) { entity.setId(rowId); return rowId; } - + @Override public Long getKey(NoticeLocaleBean entity) { - if (entity != null) { + if(entity != null) { return entity.getId(); } else { return null; @@ -270,5 +265,5 @@ protected final boolean isEntityUpdateable() { return true; } - + } diff --git a/app/src/main/java/com/casic/app/smartwell/greendao/PipeLocalBeanDao.java b/app/src/main/java/com/casic/app/smartwell/greendao/PipeLocalBeanDao.java index aab4d3f..df5515a 100644 --- a/app/src/main/java/com/casic/app/smartwell/greendao/PipeLocalBeanDao.java +++ b/app/src/main/java/com/casic/app/smartwell/greendao/PipeLocalBeanDao.java @@ -12,10 +12,9 @@ import org.greenrobot.greendao.internal.DaoConfig; // THIS CODE IS GENERATED BY greenDAO, DO NOT EDIT. - -/** +/** * DAO for table "PIPE_LOCAL_BEAN". - */ +*/ public class PipeLocalBeanDao extends AbstractDao { public static final String TABLENAME = "PIPE_LOCAL_BEAN"; @@ -37,16 +36,14 @@ public PipeLocalBeanDao(DaoConfig config) { super(config); } - + public PipeLocalBeanDao(DaoConfig config, DaoSession daoSession) { super(config, daoSession); } - /** - * Creates the underlying database table. - */ + /** Creates the underlying database table. */ public static void createTable(Database db, boolean ifNotExists) { - String constraint = ifNotExists ? "IF NOT EXISTS " : ""; + String constraint = ifNotExists? "IF NOT EXISTS ": ""; db.execSQL("CREATE TABLE " + constraint + "\"PIPE_LOCAL_BEAN\" (" + // "\"_id\" INTEGER PRIMARY KEY AUTOINCREMENT ," + // 0: id "\"PIPE_CODE\" TEXT," + // 1: pipeCode @@ -56,9 +53,7 @@ "\"START_LONGITUDE_GD\" TEXT);"); // 5: startLongitudeGd } - /** - * Drops the underlying database table. - */ + /** Drops the underlying database table. */ public static void dropTable(Database db, boolean ifExists) { String sql = "DROP TABLE " + (ifExists ? "IF EXISTS " : "") + "\"PIPE_LOCAL_BEAN\""; db.execSQL(sql); @@ -67,32 +62,32 @@ @Override protected final void bindValues(DatabaseStatement stmt, PipeLocalBean entity) { stmt.clearBindings(); - + Long id = entity.getId(); if (id != null) { stmt.bindLong(1, id); } - + String pipeCode = entity.getPipeCode(); if (pipeCode != null) { stmt.bindString(2, pipeCode); } - + String endLatitudeGd = entity.getEndLatitudeGd(); if (endLatitudeGd != null) { stmt.bindString(3, endLatitudeGd); } - + String endLongitudeGd = entity.getEndLongitudeGd(); if (endLongitudeGd != null) { stmt.bindString(4, endLongitudeGd); } - + String startLatitudeGd = entity.getStartLatitudeGd(); if (startLatitudeGd != null) { stmt.bindString(5, startLatitudeGd); } - + String startLongitudeGd = entity.getStartLongitudeGd(); if (startLongitudeGd != null) { stmt.bindString(6, startLongitudeGd); @@ -102,32 +97,32 @@ @Override protected final void bindValues(SQLiteStatement stmt, PipeLocalBean entity) { stmt.clearBindings(); - + Long id = entity.getId(); if (id != null) { stmt.bindLong(1, id); } - + String pipeCode = entity.getPipeCode(); if (pipeCode != null) { stmt.bindString(2, pipeCode); } - + String endLatitudeGd = entity.getEndLatitudeGd(); if (endLatitudeGd != null) { stmt.bindString(3, endLatitudeGd); } - + String endLongitudeGd = entity.getEndLongitudeGd(); if (endLongitudeGd != null) { stmt.bindString(4, endLongitudeGd); } - + String startLatitudeGd = entity.getStartLatitudeGd(); if (startLatitudeGd != null) { stmt.bindString(5, startLatitudeGd); } - + String startLongitudeGd = entity.getStartLongitudeGd(); if (startLongitudeGd != null) { stmt.bindString(6, startLongitudeGd); @@ -137,21 +132,21 @@ @Override public Long readKey(Cursor cursor, int offset) { return cursor.isNull(offset + 0) ? null : cursor.getLong(offset + 0); - } + } @Override public PipeLocalBean readEntity(Cursor cursor, int offset) { PipeLocalBean entity = new PipeLocalBean( // - cursor.isNull(offset + 0) ? null : cursor.getLong(offset + 0), // id - cursor.isNull(offset + 1) ? null : cursor.getString(offset + 1), // pipeCode - cursor.isNull(offset + 2) ? null : cursor.getString(offset + 2), // endLatitudeGd - cursor.isNull(offset + 3) ? null : cursor.getString(offset + 3), // endLongitudeGd - cursor.isNull(offset + 4) ? null : cursor.getString(offset + 4), // startLatitudeGd - cursor.isNull(offset + 5) ? null : cursor.getString(offset + 5) // startLongitudeGd + cursor.isNull(offset + 0) ? null : cursor.getLong(offset + 0), // id + cursor.isNull(offset + 1) ? null : cursor.getString(offset + 1), // pipeCode + cursor.isNull(offset + 2) ? null : cursor.getString(offset + 2), // endLatitudeGd + cursor.isNull(offset + 3) ? null : cursor.getString(offset + 3), // endLongitudeGd + cursor.isNull(offset + 4) ? null : cursor.getString(offset + 4), // startLatitudeGd + cursor.isNull(offset + 5) ? null : cursor.getString(offset + 5) // startLongitudeGd ); return entity; } - + @Override public void readEntity(Cursor cursor, PipeLocalBean entity, int offset) { entity.setId(cursor.isNull(offset + 0) ? null : cursor.getLong(offset + 0)); @@ -160,17 +155,17 @@ entity.setEndLongitudeGd(cursor.isNull(offset + 3) ? null : cursor.getString(offset + 3)); entity.setStartLatitudeGd(cursor.isNull(offset + 4) ? null : cursor.getString(offset + 4)); entity.setStartLongitudeGd(cursor.isNull(offset + 5) ? null : cursor.getString(offset + 5)); - } - + } + @Override protected final Long updateKeyAfterInsert(PipeLocalBean entity, long rowId) { entity.setId(rowId); return rowId; } - + @Override public Long getKey(PipeLocalBean entity) { - if (entity != null) { + if(entity != null) { return entity.getId(); } else { return null; @@ -186,5 +181,5 @@ protected final boolean isEntityUpdateable() { return true; } - + } diff --git a/app/src/main/java/com/casic/app/smartwell/view/ChangePasswordActivity.kt b/app/src/main/java/com/casic/app/smartwell/view/ChangePasswordActivity.kt index 8e41039..9f1dd40 100644 --- a/app/src/main/java/com/casic/app/smartwell/view/ChangePasswordActivity.kt +++ b/app/src/main/java/com/casic/app/smartwell/view/ChangePasswordActivity.kt @@ -14,7 +14,7 @@ import com.pengxh.kt.lite.extensions.show import com.pengxh.kt.lite.utils.ActivityStackManager import com.pengxh.kt.lite.utils.LoadState -import com.pengxh.kt.lite.utils.LoadingDialogHub +import com.pengxh.kt.lite.utils.LoadingDialog import com.pengxh.kt.lite.widget.TitleBarView import java.nio.charset.StandardCharsets @@ -46,15 +46,15 @@ override fun observeRequestState() { userViewModel.loadState.observe(this) { when (it) { - is LoadState.Loading -> LoadingDialogHub.show(this, "修改中,请稍后") + is LoadState.Loading -> LoadingDialog.show(this, "修改中,请稍后") is LoadState.Success -> { - LoadingDialogHub.dismiss() + LoadingDialog.dismiss() AuthenticationHelper.removeToken() this.navigatePageTo() ActivityStackManager.finishAllActivity() } - else -> LoadingDialogHub.dismiss() + else -> LoadingDialog.dismiss() } } } diff --git a/app/src/main/java/com/casic/app/smartwell/view/DeployedWellActivity.kt b/app/src/main/java/com/casic/app/smartwell/view/DeployedWellActivity.kt index fb4339c..28a5078 100644 --- a/app/src/main/java/com/casic/app/smartwell/view/DeployedWellActivity.kt +++ b/app/src/main/java/com/casic/app/smartwell/view/DeployedWellActivity.kt @@ -83,8 +83,8 @@ } //添加分割线 - binding.deployedListView.addItemDecoration( - RecyclerViewItemOffsets(0, 5, 0, 5) + binding.recyclerView.addItemDecoration( + RecyclerViewItemOffsets(0, 7, 0, 7) ) } @@ -149,12 +149,11 @@ } else { item.deep.toString() + "m" } - viewHolder.setText(R.id.wellNameView, item.wellName) + viewHolder.setText(R.id.wellTypeView, item.wellTypeName) .setText(R.id.wellDepthView, "深:${deep}") .setText(R.id.wellCodeView, "点位编号:${item.wellCode}") - .setText(R.id.wellTypeView, "点位类型:${item.wellTypeName}") .setText(R.id.ownerShipView, "权属单位:${item.deptName}") - .setText(R.id.wellLocationView, "点位置:${item.position}") + .setText(R.id.wellLocationView, "点位位置:${item.position}") .setOnClickListener( R.id.operationButton, object : View.OnClickListener { override fun onClick(v: View?) { @@ -207,7 +206,7 @@ }) } } - binding.deployedListView.adapter = deployAdapter + binding.recyclerView.adapter = deployAdapter deployAdapter.setOnItemClickedListener(object : NormalRecyclerAdapter.OnItemClickedListener { override fun onItemClicked(position: Int, t: WellListModel.DataBean.RowsBean) { diff --git a/app/src/main/java/com/casic/app/smartwell/view/LoginActivity.kt b/app/src/main/java/com/casic/app/smartwell/view/LoginActivity.kt index e4bb0e3..834527b 100644 --- a/app/src/main/java/com/casic/app/smartwell/view/LoginActivity.kt +++ b/app/src/main/java/com/casic/app/smartwell/view/LoginActivity.kt @@ -21,7 +21,7 @@ import com.pengxh.kt.lite.extensions.navigatePageTo import com.pengxh.kt.lite.extensions.readAssetsFile import com.pengxh.kt.lite.extensions.show -import com.pengxh.kt.lite.utils.LoadingDialogHub +import com.pengxh.kt.lite.utils.LoadingDialog import com.pengxh.kt.lite.utils.SaveKeyValues import kotlinx.coroutines.Dispatchers import kotlinx.coroutines.launch @@ -106,11 +106,11 @@ override fun observeRequestState() { authenticateViewModel.loadState.observe(this) { - LoadingDialogHub.show(this, "登录中,请稍后") + LoadingDialog.show(this, "登录中,请稍后") } loginViewModel.loadState.observe(this) { - LoadingDialogHub.dismiss() + LoadingDialog.dismiss() } } diff --git a/app/src/main/java/com/casic/app/smartwell/view/OrderCompletedDetailActivity.kt b/app/src/main/java/com/casic/app/smartwell/view/OrderCompletedDetailActivity.kt index db8ad1f..75cd905 100644 --- a/app/src/main/java/com/casic/app/smartwell/view/OrderCompletedDetailActivity.kt +++ b/app/src/main/java/com/casic/app/smartwell/view/OrderCompletedDetailActivity.kt @@ -17,7 +17,7 @@ import com.pengxh.kt.lite.extensions.show import com.pengxh.kt.lite.utils.Constant import com.pengxh.kt.lite.utils.LoadState -import com.pengxh.kt.lite.utils.LoadingDialogHub +import com.pengxh.kt.lite.utils.LoadingDialog import com.pengxh.kt.lite.widget.TitleBarView import com.pengxh.kt.lite.widget.dialog.AlertMessageDialog @@ -44,7 +44,7 @@ } override fun initOnCreate(savedInstanceState: Bundle?) { - val jobId = intent.getStringExtra(Constant.INTENT_PARAM)!! + val jobId = intent.getStringExtra(Constant.INTENT_PARAM_KEY)!! orderViewModel = ViewModelProvider(this)[OrderViewModel::class.java] orderViewModel.getWorkOrderDetail(jobId) orderViewModel.detailModel.observe(this) { @@ -154,8 +154,8 @@ override fun observeRequestState() { orderViewModel.loadState.observe(this) { when (it) { - is LoadState.Loading -> LoadingDialogHub.show(this, "数据加载中,请稍后") - else -> LoadingDialogHub.dismiss() + is LoadState.Loading -> LoadingDialog.show(this, "数据加载中,请稍后") + else -> LoadingDialog.dismiss() } } } diff --git a/app/src/main/java/com/casic/app/smartwell/view/OrderInHandleDetailActivity.kt b/app/src/main/java/com/casic/app/smartwell/view/OrderInHandleDetailActivity.kt index d70a979..04a7d5d 100644 --- a/app/src/main/java/com/casic/app/smartwell/view/OrderInHandleDetailActivity.kt +++ b/app/src/main/java/com/casic/app/smartwell/view/OrderInHandleDetailActivity.kt @@ -38,7 +38,7 @@ import com.pengxh.kt.lite.extensions.show import com.pengxh.kt.lite.utils.Constant import com.pengxh.kt.lite.utils.LoadState -import com.pengxh.kt.lite.utils.LoadingDialogHub +import com.pengxh.kt.lite.utils.LoadingDialog import com.pengxh.kt.lite.widget.TitleBarView import com.pengxh.kt.lite.widget.dialog.AlertControlDialog import com.pengxh.kt.lite.widget.dialog.AlertMessageDialog @@ -93,7 +93,7 @@ ) binding.addImageRecyclerView.adapter = imageAdapter - val jobId = intent.getStringExtra(Constant.INTENT_PARAM)!!//初始化图片九宫格 + val jobId = intent.getStringExtra(Constant.INTENT_PARAM_KEY)!!//初始化图片九宫格 orderViewModel.getWorkOrderDetail(jobId) orderViewModel.detailModel.observe(this) { if (it.code == 200) { @@ -312,41 +312,41 @@ override fun observeRequestState() { orderViewModel.loadState.observe(this) { when (it) { - is LoadState.Loading -> LoadingDialogHub.show(this, "数据加载中,请稍后") - else -> LoadingDialogHub.dismiss() + is LoadState.Loading -> LoadingDialog.show(this, "数据加载中,请稍后") + else -> LoadingDialog.dismiss() } } uploadImageViewModel.loadState.observe(this) { when (it) { - LoadState.Loading -> LoadingDialogHub.show(this, "图片上传中,请稍后...") - else -> LoadingDialogHub.dismiss() + LoadState.Loading -> LoadingDialog.show(this, "图片上传中,请稍后...") + else -> LoadingDialog.dismiss() } } //转单状态处理 operationViewModel.loadState.observe(this) { when (it) { - is LoadState.Loading -> LoadingDialogHub.show(this, "转单中,请稍后") + is LoadState.Loading -> LoadingDialog.show(this, "转单中,请稍后") is LoadState.Success -> { - LoadingDialogHub.dismiss() + LoadingDialog.dismiss() this.finish() } - else -> LoadingDialogHub.dismiss() + else -> LoadingDialog.dismiss() } } //处理完成工单状态处理 operationViewModel.loadState.observe(this) { when (it) { - is LoadState.Loading -> LoadingDialogHub.show(this, "处理中,请稍后") + is LoadState.Loading -> LoadingDialog.show(this, "处理中,请稍后") is LoadState.Success -> { - LoadingDialogHub.dismiss() + LoadingDialog.dismiss() this.finish() } - else -> LoadingDialogHub.dismiss() + else -> LoadingDialog.dismiss() } } } diff --git a/app/src/main/java/com/casic/app/smartwell/view/OrderNotConfirmedDetailActivity.kt b/app/src/main/java/com/casic/app/smartwell/view/OrderNotConfirmedDetailActivity.kt index 8e036d2..687ec86 100644 --- a/app/src/main/java/com/casic/app/smartwell/view/OrderNotConfirmedDetailActivity.kt +++ b/app/src/main/java/com/casic/app/smartwell/view/OrderNotConfirmedDetailActivity.kt @@ -36,7 +36,7 @@ import com.pengxh.kt.lite.extensions.show import com.pengxh.kt.lite.utils.Constant import com.pengxh.kt.lite.utils.LoadState -import com.pengxh.kt.lite.utils.LoadingDialogHub +import com.pengxh.kt.lite.utils.LoadingDialog import com.pengxh.kt.lite.widget.TitleBarView import com.pengxh.kt.lite.widget.dialog.AlertControlDialog import com.pengxh.kt.lite.widget.dialog.AlertMessageDialog @@ -80,7 +80,7 @@ } override fun initOnCreate(savedInstanceState: Bundle?) { - val jobId = intent.getStringExtra(Constant.INTENT_PARAM)!! + val jobId = intent.getStringExtra(Constant.INTENT_PARAM_KEY)!! //初始化图片九宫格 //左外边距,左内边距,右内边距,右外边距 val viewWidth = getScreenWidth() - (10 + 10 + 10 + 10).dp2px(this) @@ -263,41 +263,41 @@ //数据加载状态处理 orderViewModel.loadState.observe(this) { when (it) { - is LoadState.Loading -> LoadingDialogHub.show(this, "数据加载中,请稍后") - else -> LoadingDialogHub.dismiss() + is LoadState.Loading -> LoadingDialog.show(this, "数据加载中,请稍后") + else -> LoadingDialog.dismiss() } } uploadImageViewModel.loadState.observe(this) { when (it) { - LoadState.Loading -> LoadingDialogHub.show(this, "图片上传中,请稍后") - else -> LoadingDialogHub.dismiss() + LoadState.Loading -> LoadingDialog.show(this, "图片上传中,请稍后") + else -> LoadingDialog.dismiss() } } //转单状态处理 operationViewModel.loadState.observe(this) { when (it) { - is LoadState.Loading -> LoadingDialogHub.show(this, "转单中,请稍后") + is LoadState.Loading -> LoadingDialog.show(this, "转单中,请稍后") is LoadState.Success -> { - LoadingDialogHub.dismiss() + LoadingDialog.dismiss() this.finish() } - else -> LoadingDialogHub.dismiss() + else -> LoadingDialog.dismiss() } } //确认工单状态处理 operationViewModel.loadState.observe(this) { when (it) { - is LoadState.Loading -> LoadingDialogHub.show(this, "处理中,请稍后") + is LoadState.Loading -> LoadingDialog.show(this, "处理中,请稍后") is LoadState.Success -> { - LoadingDialogHub.dismiss() + LoadingDialog.dismiss() this.finish() } - else -> LoadingDialogHub.dismiss() + else -> LoadingDialog.dismiss() } } } diff --git a/app/src/main/java/com/casic/app/smartwell/view/OrderNotProcessedDetailActivity.kt b/app/src/main/java/com/casic/app/smartwell/view/OrderNotProcessedDetailActivity.kt index d3f22dc..0c97a52 100644 --- a/app/src/main/java/com/casic/app/smartwell/view/OrderNotProcessedDetailActivity.kt +++ b/app/src/main/java/com/casic/app/smartwell/view/OrderNotProcessedDetailActivity.kt @@ -18,7 +18,7 @@ import com.pengxh.kt.lite.extensions.show import com.pengxh.kt.lite.utils.Constant import com.pengxh.kt.lite.utils.LoadState -import com.pengxh.kt.lite.utils.LoadingDialogHub +import com.pengxh.kt.lite.utils.LoadingDialog import com.pengxh.kt.lite.widget.TitleBarView import com.pengxh.kt.lite.widget.dialog.AlertControlDialog import com.pengxh.kt.lite.widget.dialog.AlertMessageDialog @@ -50,7 +50,7 @@ } override fun initOnCreate(savedInstanceState: Bundle?) { - this.jobId = intent.getStringExtra(Constant.INTENT_PARAM)!! + this.jobId = intent.getStringExtra(Constant.INTENT_PARAM_KEY)!! orderViewModel = ViewModelProvider(this)[OrderViewModel::class.java] operationViewModel = ViewModelProvider(this)[OperationViewModel::class.java] wellViewModel = ViewModelProvider(this)[WellViewModel::class.java] @@ -162,21 +162,21 @@ //数据加载状态处理 orderViewModel.loadState.observe(this) { when (it) { - is LoadState.Loading -> LoadingDialogHub.show(this, "数据加载中,请稍后") - else -> LoadingDialogHub.dismiss() + is LoadState.Loading -> LoadingDialog.show(this, "数据加载中,请稍后") + else -> LoadingDialog.dismiss() } } //接单状态处理 operationViewModel.loadState.observe(this) { when (it) { - is LoadState.Loading -> LoadingDialogHub.show(this, "接单中,请稍后") + is LoadState.Loading -> LoadingDialog.show(this, "接单中,请稍后") is LoadState.Success -> { - LoadingDialogHub.dismiss() + LoadingDialog.dismiss() this.finish() } - else -> LoadingDialogHub.dismiss() + else -> LoadingDialog.dismiss() } } } diff --git a/app/src/main/java/com/casic/app/smartwell/view/SearchResultActivity.kt b/app/src/main/java/com/casic/app/smartwell/view/SearchResultActivity.kt index 6a92917..4f3a674 100644 --- a/app/src/main/java/com/casic/app/smartwell/view/SearchResultActivity.kt +++ b/app/src/main/java/com/casic/app/smartwell/view/SearchResultActivity.kt @@ -19,7 +19,7 @@ import com.pengxh.kt.lite.extensions.show import com.pengxh.kt.lite.utils.Constant import com.pengxh.kt.lite.utils.LoadState -import com.pengxh.kt.lite.utils.LoadingDialogHub +import com.pengxh.kt.lite.utils.LoadingDialog import com.pengxh.kt.lite.utils.WeakReferenceHandler import com.pengxh.kt.lite.widget.TitleBarView import com.pengxh.kt.lite.widget.dialog.AlertControlDialog @@ -56,7 +56,7 @@ } override fun initOnCreate(savedInstanceState: Bundle?) { - args = intent.getStringArrayListExtra(Constant.INTENT_PARAM)!! + args = intent.getStringArrayListExtra(Constant.INTENT_PARAM_KEY)!! orderViewModel = ViewModelProvider(this)[OrderViewModel::class.java] operationViewModel = ViewModelProvider(this)[OperationViewModel::class.java] @@ -101,24 +101,24 @@ } } - binding.resultRecyclerView.addItemDecoration( - RecyclerViewItemOffsets(0, 5, 0, 5) + binding.recyclerView.addItemDecoration( + RecyclerViewItemOffsets(0, 7, 0, 7) ) } override fun observeRequestState() { orderViewModel.loadState.observe(this) { when (it) { - is LoadState.Loading -> LoadingDialogHub.show(this, "数据加载中,请稍后") - else -> LoadingDialogHub.dismiss() + is LoadState.Loading -> LoadingDialog.show(this, "数据加载中,请稍后") + else -> LoadingDialog.dismiss() } } //接单状态处理 operationViewModel.loadState.observe(this) { when (it) { - is LoadState.Loading -> LoadingDialogHub.show(this, "接单中,请稍后") + is LoadState.Loading -> LoadingDialog.show(this, "接单中,请稍后") is LoadState.Success -> { - LoadingDialogHub.dismiss() + LoadingDialog.dismiss() //接单成功之后刷新列表 dataBeans.removeAt(clickedPosition) searchResultAdapter.notifyItemRemoved(clickedPosition) @@ -127,7 +127,7 @@ ) } - else -> LoadingDialogHub.dismiss() + else -> LoadingDialog.dismiss() } } } @@ -162,7 +162,7 @@ } else { binding.emptyInclude.emptyView.hide() searchResultAdapter = SearchResultAdapter(this, dataBeans) - binding.resultRecyclerView.adapter = searchResultAdapter + binding.recyclerView.adapter = searchResultAdapter searchResultAdapter.setOnItemClickListener(object : SearchResultAdapter.OnItemClickListener { override fun onClicked(position: Int) { diff --git a/app/src/main/java/com/casic/app/smartwell/view/UnDeployWellActivity.kt b/app/src/main/java/com/casic/app/smartwell/view/UnDeployWellActivity.kt index 7f7cd3c..555c278 100644 --- a/app/src/main/java/com/casic/app/smartwell/view/UnDeployWellActivity.kt +++ b/app/src/main/java/com/casic/app/smartwell/view/UnDeployWellActivity.kt @@ -81,8 +81,8 @@ } } - binding.undeployListView.addItemDecoration( - RecyclerViewItemOffsets(0, 5, 0, 5) + binding.recyclerView.addItemDecoration( + RecyclerViewItemOffsets(0, 7, 0, 7) ) } @@ -147,12 +147,11 @@ } else { item.deep.toString() + "m" } - viewHolder.setText(R.id.wellNameView, item.wellName) + viewHolder.setText(R.id.wellTypeView, item.wellTypeName) .setText(R.id.wellDepthView, "深:${deep}") .setText(R.id.wellCodeView, "点位编号:${item.wellCode}") - .setText(R.id.wellTypeView, "点位类型:${item.wellTypeName}") .setText(R.id.ownerShipView, "权属单位:${item.deptName}") - .setText(R.id.wellLocationView, "点位置:${item.position}") + .setText(R.id.wellLocationView, "点位位置:${item.position}") .setOnClickListener( R.id.operationButton, object : View.OnClickListener { override fun onClick(v: View?) { @@ -185,7 +184,7 @@ ) } } - binding.undeployListView.adapter = unDeployAdapter + binding.recyclerView.adapter = unDeployAdapter unDeployAdapter.setOnItemClickedListener(object : NormalRecyclerAdapter.OnItemClickedListener { override fun onItemClicked(position: Int, t: WellListModel.DataBean.RowsBean) { diff --git a/app/src/main/java/com/casic/app/smartwell/view/WellDetailActivity.kt b/app/src/main/java/com/casic/app/smartwell/view/WellDetailActivity.kt index b50d067..eb8b468 100644 --- a/app/src/main/java/com/casic/app/smartwell/view/WellDetailActivity.kt +++ b/app/src/main/java/com/casic/app/smartwell/view/WellDetailActivity.kt @@ -16,7 +16,7 @@ import com.pengxh.kt.lite.extensions.show import com.pengxh.kt.lite.utils.Constant import com.pengxh.kt.lite.utils.LoadState -import com.pengxh.kt.lite.utils.LoadingDialogHub +import com.pengxh.kt.lite.utils.LoadingDialog import com.pengxh.kt.lite.widget.TitleBarView import com.pengxh.kt.lite.widget.dialog.AlertMessageDialog @@ -44,7 +44,7 @@ } override fun initOnCreate(savedInstanceState: Bundle?) { - val wellId = intent.getStringExtra(Constant.INTENT_PARAM)!! + val wellId = intent.getStringExtra(Constant.INTENT_PARAM_KEY)!! wellViewModel = ViewModelProvider(this)[WellViewModel::class.java] wellViewModel.getWellDetail(wellId) wellViewModel.wellDetailModel.observe(this) { @@ -132,8 +132,8 @@ override fun observeRequestState() { wellViewModel.loadState.observe(this) { when (it) { - is LoadState.Loading -> LoadingDialogHub.show(this, "数据加载中,请稍后") - else -> LoadingDialogHub.dismiss() + is LoadState.Loading -> LoadingDialog.show(this, "数据加载中,请稍后") + else -> LoadingDialog.dismiss() } } } diff --git a/app/src/main/java/com/casic/app/smartwell/view/WellManagementActivity.kt b/app/src/main/java/com/casic/app/smartwell/view/WellManagementActivity.kt index 084da95..457096b 100644 --- a/app/src/main/java/com/casic/app/smartwell/view/WellManagementActivity.kt +++ b/app/src/main/java/com/casic/app/smartwell/view/WellManagementActivity.kt @@ -94,8 +94,8 @@ } } - binding.wellListView.addItemDecoration( - RecyclerViewItemOffsets(0, 5, 0, 5) + binding.recyclerView.addItemDecoration( + RecyclerViewItemOffsets(0, 7, 0, 7) ) } @@ -175,13 +175,12 @@ } else { item.deep.toString() + "m" } - viewHolder.setText(R.id.wellNameView, item.wellName) + viewHolder.setText(R.id.wellTypeView, item.wellTypeName) .setText(R.id.wellStateView, "已${item.bfztName}") .setText(R.id.wellDepthView, "深:${deep}") .setText(R.id.wellCodeView, "点位编号:${item.wellCode}") - .setText(R.id.wellTypeView, "点位类型:${item.wellTypeName}") .setText(R.id.ownerShipView, "权属单位:${item.deptName}") - .setText(R.id.wellLocationView, "点位置:${item.position}") + .setText(R.id.wellLocationView, "点位位置:${item.position}") .setOnClickListener( R.id.navigationButton, object : View.OnClickListener { override fun onClick(v: View?) { @@ -200,7 +199,7 @@ ) } } - binding.wellListView.adapter = wellListAdapter + binding.recyclerView.adapter = wellListAdapter wellListAdapter.setOnItemClickedListener(object : NormalRecyclerAdapter.OnItemClickedListener { override fun onItemClicked(position: Int, t: WellListModel.DataBean.RowsBean) { diff --git a/app/src/main/java/com/casic/app/smartwell/view/WellMonitorActivity.kt b/app/src/main/java/com/casic/app/smartwell/view/WellMonitorActivity.kt index e3573eb..b87bdb7 100644 --- a/app/src/main/java/com/casic/app/smartwell/view/WellMonitorActivity.kt +++ b/app/src/main/java/com/casic/app/smartwell/view/WellMonitorActivity.kt @@ -11,7 +11,7 @@ import com.pengxh.kt.lite.base.KotlinBaseActivity import com.pengxh.kt.lite.utils.Constant import com.pengxh.kt.lite.utils.LoadState -import com.pengxh.kt.lite.utils.LoadingDialogHub +import com.pengxh.kt.lite.utils.LoadingDialog import com.pengxh.kt.lite.widget.TitleBarView class WellMonitorActivity : KotlinBaseActivity() { @@ -36,7 +36,7 @@ } override fun initOnCreate(savedInstanceState: Bundle?) { - val wellId = intent.getStringExtra(Constant.INTENT_PARAM)!! + val wellId = intent.getStringExtra(Constant.INTENT_PARAM_KEY)!! wellViewModel = ViewModelProvider(this)[WellViewModel::class.java] wellViewModel.getMonitorResult(wellId) wellViewModel.monitorModel.observe(this) { @@ -56,8 +56,8 @@ override fun observeRequestState() { wellViewModel.loadState.observe(this) { when (it) { - is LoadState.Loading -> LoadingDialogHub.show(this, "数据加载中,请稍后") - else -> LoadingDialogHub.dismiss() + is LoadState.Loading -> LoadingDialog.show(this, "数据加载中,请稍后") + else -> LoadingDialog.dismiss() } } } diff --git a/app/src/main/java/com/casic/app/smartwell/view/WellOperationActivity.kt b/app/src/main/java/com/casic/app/smartwell/view/WellOperationActivity.kt index 8d333bf..347ebb6 100644 --- a/app/src/main/java/com/casic/app/smartwell/view/WellOperationActivity.kt +++ b/app/src/main/java/com/casic/app/smartwell/view/WellOperationActivity.kt @@ -23,7 +23,7 @@ import com.pengxh.kt.lite.extensions.navigatePageTo import com.pengxh.kt.lite.extensions.show import com.pengxh.kt.lite.utils.LoadState -import com.pengxh.kt.lite.utils.LoadingDialogHub +import com.pengxh.kt.lite.utils.LoadingDialog import com.pengxh.kt.lite.utils.WeakReferenceHandler import com.pengxh.kt.lite.widget.dialog.AlertControlDialog @@ -109,8 +109,8 @@ } } - binding.operationListView.addItemDecoration( - RecyclerViewItemOffsets(0, 5, 0, 5) + binding.recyclerView.addItemDecoration( + RecyclerViewItemOffsets(0, 7, 0, 7) ) } @@ -123,13 +123,13 @@ override fun observeRequestState() { wellViewModel.loadState.observe(this) { when (it) { - is LoadState.Loading -> LoadingDialogHub.show(this, "处理中,请稍后") + is LoadState.Loading -> LoadingDialog.show(this, "处理中,请稍后") is LoadState.Success -> { - LoadingDialogHub.dismiss() + LoadingDialog.dismiss() wellOperationAdapter.notifyItemChanged(clickedPosition) } - else -> LoadingDialogHub.dismiss() + else -> LoadingDialog.dismiss() } } } @@ -203,24 +203,23 @@ if (item.bfztName == "布防") { viewHolder.setImageResource( R.id.wellStateView, R.drawable.bg_solid_text_green_radius_5 - ).setText(R.id.wellStateView, "撤防") + ).setText(R.id.operationButton, "撤防") } else { viewHolder.setImageResource( R.id.wellStateView, R.drawable.bg_solid_text_red_radius_5 - ).setText(R.id.wellStateView, "布防") + ).setText(R.id.operationButton, "布防") } val deep = if (item.deep.toString().isBlank()) { "未知" } else { item.deep.toString() + "m" } - viewHolder.setText(R.id.wellNameView, item.wellName) + viewHolder.setText(R.id.wellTypeView, item.wellTypeName) .setText(R.id.wellStateView, "已${item.bfztName}") .setText(R.id.wellDepthView, "深:${deep}") .setText(R.id.wellCodeView, "点位编号:${item.wellCode}") - .setText(R.id.wellTypeView, "点位类型:${item.wellTypeName}") .setText(R.id.ownerShipView, "权属单位:${item.deptName}") - .setText(R.id.wellLocationView, "点位置:${item.position}") + .setText(R.id.wellLocationView, "点位位置:${item.position}") .setOnClickListener( R.id.operationButton, object : View.OnClickListener { override fun onClick(v: View?) { @@ -280,7 +279,7 @@ ) } } - binding.operationListView.adapter = wellOperationAdapter + binding.recyclerView.adapter = wellOperationAdapter wellOperationAdapter.setOnItemClickedListener(object : NormalRecyclerAdapter.OnItemClickedListener { override fun onItemClicked(position: Int, t: WellListModel.DataBean.RowsBean) { diff --git a/app/src/main/res/drawable/ic_down.xml b/app/src/main/res/drawable/ic_down.xml index 20e6476..6987e6c 100644 --- a/app/src/main/res/drawable/ic_down.xml +++ b/app/src/main/res/drawable/ic_down.xml @@ -1,6 +1,6 @@ + + diff --git a/app/src/main/res/layout/activity_about_us.xml b/app/src/main/res/layout/activity_about_us.xml index 9091a00..d5fbd0d 100644 --- a/app/src/main/res/layout/activity_about_us.xml +++ b/app/src/main/res/layout/activity_about_us.xml @@ -12,13 +12,7 @@ android:layout_width="match_parent" android:layout_height="wrap_content" android:background="@color/mainThemeColor" - app:tbv_left_image="@drawable/ic_title_left" - app:tbv_only_show_title="false" - app:tbv_show_left_image="true" - app:tbv_show_right_image="false" - app:tbv_text="关于我们" - app:tbv_text_color="@color/white" - app:tbv_text_size="@dimen/sp_18" /> + app:tbv_text="关于我们" /> + app:tbv_text="修改密码" /> + app:tbv_text="布防列表" /> + app:tbv_text="帮助中心" /> + app:tbv_text="工单详情" /> + app:tbv_text="工单详情" /> + app:tbv_text="工单详情" /> + app:tbv_text="工单详情" /> + app:tbv_text="超时工单" /> + app:tbv_text="工单查询" /> + app:tbv_text="查询结果" /> + app:tbv_text="撤防列表" /> + app:tbv_text="个人资料" /> + app:tbv_text="点位详情" /> + app:tbv_text="监控内容" /> - - - - - - + android:layout_height="wrap_content" + android:background="@color/mainThemeColor" + app:tbv_show_left_image="false" + app:tbv_show_right_image="true" + app:tbv_text="首页" /> - + - + - + + android:value="ee96d8b5e12de3fbb29949efd57418a8" /> () @@ -150,7 +158,7 @@ val cameraPosition = CameraPosition(centerLatLng, 14f, 0f, 0f) val cameraUpdate = CameraUpdateFactory.newCameraPosition(cameraPosition) withContext(Dispatchers.Main) { - LoadingDialogHub.dismiss() + LoadingDialog.dismiss() aMap.animateCamera(cameraUpdate, 1500, null) } } @@ -239,11 +247,6 @@ } override fun initEvent() { - binding.rightOptionView.setOnClickListener { - val x = binding.rightOptionView.width - easyPopupWindow.width - easyPopupWindow.showAsDropDown(binding.rightOptionView, x, 0) - } - //撤防点位 binding.unDeployedLayout.setOnClickListener { requireContext().navigatePageTo() @@ -263,11 +266,11 @@ override fun observeRequestState() { wellViewModel.loadState.observe(this) { when (it) { - is LoadState.Loading -> LoadingDialogHub.show( + is LoadState.Loading -> LoadingDialog.show( requireActivity(), "数据加载中,请稍后..." ) - else -> LoadingDialogHub.dismiss() + else -> LoadingDialog.dismiss() } } } @@ -376,7 +379,7 @@ }).build().show() } }) - infoPopup.showAsDropDown(binding.rightOptionView) +// infoPopup.showAsDropDown(binding.rightOptionView) } override fun onCameraChange(p0: CameraPosition?) { diff --git a/app/src/main/java/com/casic/app/smartwell/fragment/HomePageNoClusterFragment.kt b/app/src/main/java/com/casic/app/smartwell/fragment/HomePageNoClusterFragment.kt index 802426a..b25f743 100644 --- a/app/src/main/java/com/casic/app/smartwell/fragment/HomePageNoClusterFragment.kt +++ b/app/src/main/java/com/casic/app/smartwell/fragment/HomePageNoClusterFragment.kt @@ -38,8 +38,9 @@ import com.pengxh.kt.lite.extensions.navigatePageTo import com.pengxh.kt.lite.extensions.show import com.pengxh.kt.lite.utils.LoadState -import com.pengxh.kt.lite.utils.LoadingDialogHub +import com.pengxh.kt.lite.utils.LoadingDialog import com.pengxh.kt.lite.widget.EasyPopupWindow +import com.pengxh.kt.lite.widget.TitleBarView import com.pengxh.kt.lite.widget.dialog.AlertControlDialog import kotlinx.coroutines.Dispatchers import kotlinx.coroutines.launch @@ -78,7 +79,15 @@ override fun setupTopBarLayout() { binding.rootView.initImmersionBar(this, false, R.color.mainThemeColor) - binding.titleView.text = "首页" + binding.titleView.setOnClickListener(object : TitleBarView.OnClickListener { + override fun onLeftClick() { + + } + + override fun onRightClick() { + easyPopupWindow.showAsDropDown(binding.titleView, binding.titleView.width, 0) + } + }) } override fun initOnCreate(savedInstanceState: Bundle?) { @@ -112,7 +121,7 @@ //渲染井位置 lifecycleScope.launch(Dispatchers.Main) { - LoadingDialogHub.show(requireActivity(), "数据加载中,请稍后") + LoadingDialog.show(requireActivity(), "数据加载中,请稍后") withContext(Dispatchers.IO) { //取Well缓存 val allMarkerOptions = ArrayList() @@ -144,7 +153,7 @@ val cameraPosition = CameraPosition(centerLatLng, 14f, 0f, 0f) val cameraUpdate = CameraUpdateFactory.newCameraPosition(cameraPosition) withContext(Dispatchers.Main) { - LoadingDialogHub.dismiss() + LoadingDialog.dismiss() aMap.animateCamera(cameraUpdate, 1500, null) } } @@ -238,11 +247,6 @@ } override fun initEvent() { - binding.rightOptionView.setOnClickListener { - val x = binding.rightOptionView.width - easyPopupWindow.width - easyPopupWindow.showAsDropDown(binding.rightOptionView, x, 0) - } - //撤防点位 binding.unDeployedLayout.setOnClickListener { requireContext().navigatePageTo() @@ -262,11 +266,11 @@ override fun observeRequestState() { wellViewModel.loadState.observe(this) { when (it) { - is LoadState.Loading -> LoadingDialogHub.show( + is LoadState.Loading -> LoadingDialog.show( requireActivity(), "数据加载中,请稍后..." ) - else -> LoadingDialogHub.dismiss() + else -> LoadingDialog.dismiss() } } } diff --git a/app/src/main/java/com/casic/app/smartwell/fragment/MinePageFragment.kt b/app/src/main/java/com/casic/app/smartwell/fragment/MinePageFragment.kt index 09a570c..dcb48f8 100644 --- a/app/src/main/java/com/casic/app/smartwell/fragment/MinePageFragment.kt +++ b/app/src/main/java/com/casic/app/smartwell/fragment/MinePageFragment.kt @@ -35,7 +35,7 @@ import com.pengxh.kt.lite.utils.ActivityStackManager import com.pengxh.kt.lite.utils.FileDownloadManager import com.pengxh.kt.lite.utils.LoadState -import com.pengxh.kt.lite.utils.LoadingDialogHub +import com.pengxh.kt.lite.utils.LoadingDialog import com.pengxh.kt.lite.widget.dialog.AlertControlDialog import com.pengxh.kt.lite.widget.dialog.BottomActionSheet import kotlinx.coroutines.Dispatchers @@ -60,7 +60,6 @@ override fun setupTopBarLayout() { binding.rootView.initImmersionBar(this, false, R.color.mainThemeColor) - binding.titleInclude.titleView.text = "我的" } override fun initOnCreate(savedInstanceState: Bundle?) { @@ -155,27 +154,27 @@ override fun observeRequestState() { userViewModel.loadState.observe(this) { when (it) { - is LoadState.Loading -> LoadingDialogHub.show( + is LoadState.Loading -> LoadingDialog.show( requireActivity(), "检查版本中,请稍后" ) - else -> LoadingDialogHub.dismiss() + else -> LoadingDialog.dismiss() } } wellViewModel.loadState.observe(this) { when (it) { - is LoadState.Loading -> LoadingDialogHub.show( + is LoadState.Loading -> LoadingDialog.show( requireActivity(), "数据更新中,请稍后" ) is LoadState.Fail -> { - LoadingDialogHub.dismiss() + LoadingDialog.dismiss() "数据更新超时".show(requireContext()) } else -> { - LoadingDialogHub.dismiss() + LoadingDialog.dismiss() AlertControlDialog.Builder().setContext(requireContext()).setTitle("温馨提示") .setMessage("数据更新成功,请重启应用").setNegativeButton("取消") .setPositiveButton("确定").setOnDialogButtonClickListener(object : @@ -197,17 +196,17 @@ lineViewModel.loadState.observe(this) { when (it) { - is LoadState.Loading -> LoadingDialogHub.show( + is LoadState.Loading -> LoadingDialog.show( requireActivity(), "数据更新中,请稍后" ) is LoadState.Fail -> { - LoadingDialogHub.dismiss() + LoadingDialog.dismiss() "数据更新超时".show(requireContext()) } else -> { - LoadingDialogHub.dismiss() + LoadingDialog.dismiss() AlertControlDialog.Builder().setContext(requireContext()).setTitle("温馨提示") .setMessage("数据更新成功,请重启应用").setNegativeButton("取消") .setPositiveButton("确定").setOnDialogButtonClickListener(object : diff --git a/app/src/main/java/com/casic/app/smartwell/fragment/NoticePageFragment.kt b/app/src/main/java/com/casic/app/smartwell/fragment/NoticePageFragment.kt index 171b555..3c93f54 100644 --- a/app/src/main/java/com/casic/app/smartwell/fragment/NoticePageFragment.kt +++ b/app/src/main/java/com/casic/app/smartwell/fragment/NoticePageFragment.kt @@ -48,7 +48,6 @@ override fun setupTopBarLayout() { binding.rootView.initImmersionBar(this, false, R.color.mainThemeColor) - binding.titleInclude.titleView.text = "消息" } override fun initOnCreate(savedInstanceState: Bundle?) { diff --git a/app/src/main/java/com/casic/app/smartwell/fragment/OrderListFragment.kt b/app/src/main/java/com/casic/app/smartwell/fragment/OrderListFragment.kt index 93ff35b..5e38acb 100644 --- a/app/src/main/java/com/casic/app/smartwell/fragment/OrderListFragment.kt +++ b/app/src/main/java/com/casic/app/smartwell/fragment/OrderListFragment.kt @@ -12,6 +12,7 @@ import com.casic.app.smartwell.view.SearchOrderActivity import com.pengxh.kt.lite.base.KotlinBaseFragment import com.pengxh.kt.lite.extensions.navigatePageTo +import com.pengxh.kt.lite.widget.TitleBarView class OrderListFragment : KotlinBaseFragment() { @@ -25,15 +26,22 @@ } override fun initViewBinding( - inflater: LayoutInflater, - container: ViewGroup? + inflater: LayoutInflater, container: ViewGroup? ): FragmentOrderBinding { return FragmentOrderBinding.inflate(inflater, container, false) } override fun setupTopBarLayout() { binding.rootView.initImmersionBar(this, false, R.color.mainThemeColor) - binding.titleView.text = "工单" + binding.titleView.setOnClickListener(object : TitleBarView.OnClickListener { + override fun onLeftClick() { + + } + + override fun onRightClick() { + requireContext().navigatePageTo() + } + }) } override fun initOnCreate(savedInstanceState: Bundle?) { @@ -51,8 +59,6 @@ } override fun initEvent() { - binding.rightOptionView.setOnClickListener { - requireContext().navigatePageTo() - } + } } \ No newline at end of file diff --git a/app/src/main/java/com/casic/app/smartwell/fragment/OrderNotProcessedFragment.kt b/app/src/main/java/com/casic/app/smartwell/fragment/OrderNotProcessedFragment.kt index 0b3d09d..2b6f21d 100644 --- a/app/src/main/java/com/casic/app/smartwell/fragment/OrderNotProcessedFragment.kt +++ b/app/src/main/java/com/casic/app/smartwell/fragment/OrderNotProcessedFragment.kt @@ -18,7 +18,7 @@ import com.pengxh.kt.lite.extensions.navigatePageTo import com.pengxh.kt.lite.extensions.show import com.pengxh.kt.lite.utils.LoadState -import com.pengxh.kt.lite.utils.LoadingDialogHub +import com.pengxh.kt.lite.utils.LoadingDialog import com.pengxh.kt.lite.utils.WeakReferenceHandler import com.pengxh.kt.lite.widget.dialog.AlertControlDialog @@ -78,8 +78,8 @@ operationViewModel = ViewModelProvider(this)[OperationViewModel::class.java] - binding.notProcessedView.addItemDecoration( - RecyclerViewItemOffsets(0, 5, 0, 5) + binding.recyclerView.addItemDecoration( + RecyclerViewItemOffsets(0, 7, 0, 7) ) } @@ -87,9 +87,9 @@ //接单状态处理 operationViewModel.loadState.observe(this) { when (it) { - is LoadState.Loading -> LoadingDialogHub.show(requireActivity(), "接单中,请稍后") + is LoadState.Loading -> LoadingDialog.show(requireActivity(), "接单中,请稍后") is LoadState.Success -> { - LoadingDialogHub.dismiss() + LoadingDialog.dismiss() //接单成功之后刷新列表 dataBeans.removeAt(clickedPosition) notProcessedAdapter.notifyItemRemoved(clickedPosition) @@ -98,7 +98,7 @@ ) } - else -> LoadingDialogHub.dismiss() + else -> LoadingDialog.dismiss() } } } @@ -131,7 +131,7 @@ } else { binding.emptyInclude.emptyView.hide() notProcessedAdapter = OrderNotProcessedAdapter(requireContext(), dataBeans) - binding.notProcessedView.adapter = notProcessedAdapter + binding.recyclerView.adapter = notProcessedAdapter notProcessedAdapter.setOnItemClickListener(object : OrderNotProcessedAdapter.OnItemClickListener { override fun onClicked(position: Int) { diff --git a/app/src/main/java/com/casic/app/smartwell/fragment/OvertimeNotAcceptFragment.kt b/app/src/main/java/com/casic/app/smartwell/fragment/OvertimeNotAcceptFragment.kt index a198545..9b318ca 100644 --- a/app/src/main/java/com/casic/app/smartwell/fragment/OvertimeNotAcceptFragment.kt +++ b/app/src/main/java/com/casic/app/smartwell/fragment/OvertimeNotAcceptFragment.kt @@ -18,7 +18,7 @@ import com.pengxh.kt.lite.extensions.navigatePageTo import com.pengxh.kt.lite.extensions.show import com.pengxh.kt.lite.utils.LoadState -import com.pengxh.kt.lite.utils.LoadingDialogHub +import com.pengxh.kt.lite.utils.LoadingDialog import com.pengxh.kt.lite.utils.WeakReferenceHandler import com.pengxh.kt.lite.widget.dialog.AlertControlDialog @@ -81,8 +81,8 @@ operationViewModel = ViewModelProvider(this)[OperationViewModel::class.java] - binding.notProcessedView.addItemDecoration( - RecyclerViewItemOffsets(0, 5, 0, 5) + binding.recyclerView.addItemDecoration( + RecyclerViewItemOffsets(0, 7, 0, 7) ) } @@ -90,9 +90,9 @@ //接单状态处理 operationViewModel.loadState.observe(this) { when (it) { - is LoadState.Loading -> LoadingDialogHub.show(requireActivity(), "接单中,请稍后") + is LoadState.Loading -> LoadingDialog.show(requireActivity(), "接单中,请稍后") is LoadState.Success -> { - LoadingDialogHub.dismiss() + LoadingDialog.dismiss() //接单成功之后刷新列表 dataBeans.removeAt(clickedPosition) notProcessedAdapter.notifyItemRemoved(clickedPosition) @@ -101,7 +101,7 @@ ) } - else -> LoadingDialogHub.dismiss() + else -> LoadingDialog.dismiss() } } } @@ -134,7 +134,7 @@ } else { binding.emptyInclude.emptyView.hide() notProcessedAdapter = OrderNotProcessedAdapter(requireContext(), dataBeans) - binding.notProcessedView.adapter = notProcessedAdapter + binding.recyclerView.adapter = notProcessedAdapter notProcessedAdapter.setOnItemClickListener(object : OrderNotProcessedAdapter.OnItemClickListener { override fun onClicked(position: Int) { diff --git a/app/src/main/java/com/casic/app/smartwell/greendao/DaoMaster.java b/app/src/main/java/com/casic/app/smartwell/greendao/DaoMaster.java index fdcf3a7..1e52b74 100644 --- a/app/src/main/java/com/casic/app/smartwell/greendao/DaoMaster.java +++ b/app/src/main/java/com/casic/app/smartwell/greendao/DaoMaster.java @@ -13,25 +13,20 @@ // THIS CODE IS GENERATED BY greenDAO, DO NOT EDIT. - /** * Master of DAO (schema version 4): knows all DAOs. */ public class DaoMaster extends AbstractDaoMaster { public static final int SCHEMA_VERSION = 4; - /** - * Creates underlying database table using DAOs. - */ + /** Creates underlying database table using DAOs. */ public static void createAllTables(Database db, boolean ifNotExists) { MapWellLocalBeanDao.createTable(db, ifNotExists); NoticeLocaleBeanDao.createTable(db, ifNotExists); PipeLocalBeanDao.createTable(db, ifNotExists); } - /** - * Drops underlying database table using DAOs. - */ + /** Drops underlying database table using DAOs. */ public static void dropAllTables(Database db, boolean ifExists) { MapWellLocalBeanDao.dropTable(db, ifExists); NoticeLocaleBeanDao.dropTable(db, ifExists); @@ -86,9 +81,7 @@ } } - /** - * WARNING: Drops all table on Upgrade! Use only during development. - */ + /** WARNING: Drops all table on Upgrade! Use only during development. */ public static class DevOpenHelper extends OpenHelper { public DevOpenHelper(Context context, String name) { super(context, name); diff --git a/app/src/main/java/com/casic/app/smartwell/greendao/DaoSession.java b/app/src/main/java/com/casic/app/smartwell/greendao/DaoSession.java index 0b36d17..3e40e3b 100644 --- a/app/src/main/java/com/casic/app/smartwell/greendao/DaoSession.java +++ b/app/src/main/java/com/casic/app/smartwell/greendao/DaoSession.java @@ -16,7 +16,7 @@ /** * {@inheritDoc} - * + * * @see org.greenrobot.greendao.AbstractDaoSession */ public class DaoSession extends AbstractDaoSession { @@ -50,7 +50,7 @@ registerDao(NoticeLocaleBean.class, noticeLocaleBeanDao); registerDao(PipeLocalBean.class, pipeLocalBeanDao); } - + public void clear() { mapWellLocalBeanDaoConfig.clearIdentityScope(); noticeLocaleBeanDaoConfig.clearIdentityScope(); diff --git a/app/src/main/java/com/casic/app/smartwell/greendao/MapWellLocalBeanDao.java b/app/src/main/java/com/casic/app/smartwell/greendao/MapWellLocalBeanDao.java index 8908fda..407bc92 100644 --- a/app/src/main/java/com/casic/app/smartwell/greendao/MapWellLocalBeanDao.java +++ b/app/src/main/java/com/casic/app/smartwell/greendao/MapWellLocalBeanDao.java @@ -12,10 +12,9 @@ import org.greenrobot.greendao.internal.DaoConfig; // THIS CODE IS GENERATED BY greenDAO, DO NOT EDIT. - -/** +/** * DAO for table "MAP_WELL_LOCAL_BEAN". - */ +*/ public class MapWellLocalBeanDao extends AbstractDao { public static final String TABLENAME = "MAP_WELL_LOCAL_BEAN"; @@ -57,16 +56,14 @@ public MapWellLocalBeanDao(DaoConfig config) { super(config); } - + public MapWellLocalBeanDao(DaoConfig config, DaoSession daoSession) { super(config, daoSession); } - /** - * Creates the underlying database table. - */ + /** Creates the underlying database table. */ public static void createTable(Database db, boolean ifNotExists) { - String constraint = ifNotExists ? "IF NOT EXISTS " : ""; + String constraint = ifNotExists? "IF NOT EXISTS ": ""; db.execSQL("CREATE TABLE " + constraint + "\"MAP_WELL_LOCAL_BEAN\" (" + // "\"_id\" INTEGER PRIMARY KEY AUTOINCREMENT ," + // 0: kId "\"AREA\" TEXT," + // 1: area @@ -96,9 +93,7 @@ "\"WELL_TYPE_NAME\" TEXT);"); // 25: wellTypeName } - /** - * Drops the underlying database table. - */ + /** Drops the underlying database table. */ public static void dropTable(Database db, boolean ifExists) { String sql = "DROP TABLE " + (ifExists ? "IF EXISTS " : "") + "\"MAP_WELL_LOCAL_BEAN\""; db.execSQL(sql); @@ -107,132 +102,132 @@ @Override protected final void bindValues(DatabaseStatement stmt, MapWellLocalBean entity) { stmt.clearBindings(); - + Long kId = entity.getKId(); if (kId != null) { stmt.bindLong(1, kId); } - + String area = entity.getArea(); if (area != null) { stmt.bindString(2, area); } - + String bfzt = entity.getBfzt(); if (bfzt != null) { stmt.bindString(3, bfzt); } - + String bfztName = entity.getBfztName(); if (bfztName != null) { stmt.bindString(4, bfztName); } - + String coordinateX = entity.getCoordinateX(); if (coordinateX != null) { stmt.bindString(5, coordinateX); } - + String coordinateY = entity.getCoordinateY(); if (coordinateY != null) { stmt.bindString(6, coordinateY); } - + String deep = entity.getDeep(); if (deep != null) { stmt.bindString(7, deep); } - + String deptName = entity.getDeptName(); if (deptName != null) { stmt.bindString(8, deptName); } - + String deptid = entity.getDeptid(); if (deptid != null) { stmt.bindString(9, deptid); } - + String id = entity.getId(); if (id != null) { stmt.bindString(10, id); } - + String latBaidu = entity.getLatBaidu(); if (latBaidu != null) { stmt.bindString(11, latBaidu); } - + String latGaode = entity.getLatGaode(); if (latGaode != null) { stmt.bindString(12, latGaode); } - + String lngBaidu = entity.getLngBaidu(); if (lngBaidu != null) { stmt.bindString(13, lngBaidu); } - + String lngGaode = entity.getLngGaode(); if (lngGaode != null) { stmt.bindString(14, lngGaode); } - + String notes = entity.getNotes(); if (notes != null) { stmt.bindString(15, notes); } - + String photos = entity.getPhotos(); if (photos != null) { stmt.bindString(16, photos); } - + String position = entity.getPosition(); if (position != null) { stmt.bindString(17, position); } - + String staff = entity.getStaff(); if (staff != null) { stmt.bindString(18, staff); } - + String tel = entity.getTel(); if (tel != null) { stmt.bindString(19, tel); } - + String ts = entity.getTs(); if (ts != null) { stmt.bindString(20, ts); } - + String valid = entity.getValid(); if (valid != null) { stmt.bindString(21, valid); } - + String watchData = entity.getWatchData(); if (watchData != null) { stmt.bindString(22, watchData); } - + String wellCode = entity.getWellCode(); if (wellCode != null) { stmt.bindString(23, wellCode); } - + String wellName = entity.getWellName(); if (wellName != null) { stmt.bindString(24, wellName); } - + String wellType = entity.getWellType(); if (wellType != null) { stmt.bindString(25, wellType); } - + String wellTypeName = entity.getWellTypeName(); if (wellTypeName != null) { stmt.bindString(26, wellTypeName); @@ -242,132 +237,132 @@ @Override protected final void bindValues(SQLiteStatement stmt, MapWellLocalBean entity) { stmt.clearBindings(); - + Long kId = entity.getKId(); if (kId != null) { stmt.bindLong(1, kId); } - + String area = entity.getArea(); if (area != null) { stmt.bindString(2, area); } - + String bfzt = entity.getBfzt(); if (bfzt != null) { stmt.bindString(3, bfzt); } - + String bfztName = entity.getBfztName(); if (bfztName != null) { stmt.bindString(4, bfztName); } - + String coordinateX = entity.getCoordinateX(); if (coordinateX != null) { stmt.bindString(5, coordinateX); } - + String coordinateY = entity.getCoordinateY(); if (coordinateY != null) { stmt.bindString(6, coordinateY); } - + String deep = entity.getDeep(); if (deep != null) { stmt.bindString(7, deep); } - + String deptName = entity.getDeptName(); if (deptName != null) { stmt.bindString(8, deptName); } - + String deptid = entity.getDeptid(); if (deptid != null) { stmt.bindString(9, deptid); } - + String id = entity.getId(); if (id != null) { stmt.bindString(10, id); } - + String latBaidu = entity.getLatBaidu(); if (latBaidu != null) { stmt.bindString(11, latBaidu); } - + String latGaode = entity.getLatGaode(); if (latGaode != null) { stmt.bindString(12, latGaode); } - + String lngBaidu = entity.getLngBaidu(); if (lngBaidu != null) { stmt.bindString(13, lngBaidu); } - + String lngGaode = entity.getLngGaode(); if (lngGaode != null) { stmt.bindString(14, lngGaode); } - + String notes = entity.getNotes(); if (notes != null) { stmt.bindString(15, notes); } - + String photos = entity.getPhotos(); if (photos != null) { stmt.bindString(16, photos); } - + String position = entity.getPosition(); if (position != null) { stmt.bindString(17, position); } - + String staff = entity.getStaff(); if (staff != null) { stmt.bindString(18, staff); } - + String tel = entity.getTel(); if (tel != null) { stmt.bindString(19, tel); } - + String ts = entity.getTs(); if (ts != null) { stmt.bindString(20, ts); } - + String valid = entity.getValid(); if (valid != null) { stmt.bindString(21, valid); } - + String watchData = entity.getWatchData(); if (watchData != null) { stmt.bindString(22, watchData); } - + String wellCode = entity.getWellCode(); if (wellCode != null) { stmt.bindString(23, wellCode); } - + String wellName = entity.getWellName(); if (wellName != null) { stmt.bindString(24, wellName); } - + String wellType = entity.getWellType(); if (wellType != null) { stmt.bindString(25, wellType); } - + String wellTypeName = entity.getWellTypeName(); if (wellTypeName != null) { stmt.bindString(26, wellTypeName); @@ -377,41 +372,41 @@ @Override public Long readKey(Cursor cursor, int offset) { return cursor.isNull(offset + 0) ? null : cursor.getLong(offset + 0); - } + } @Override public MapWellLocalBean readEntity(Cursor cursor, int offset) { MapWellLocalBean entity = new MapWellLocalBean( // - cursor.isNull(offset + 0) ? null : cursor.getLong(offset + 0), // kId - cursor.isNull(offset + 1) ? null : cursor.getString(offset + 1), // area - cursor.isNull(offset + 2) ? null : cursor.getString(offset + 2), // bfzt - cursor.isNull(offset + 3) ? null : cursor.getString(offset + 3), // bfztName - cursor.isNull(offset + 4) ? null : cursor.getString(offset + 4), // coordinateX - cursor.isNull(offset + 5) ? null : cursor.getString(offset + 5), // coordinateY - cursor.isNull(offset + 6) ? null : cursor.getString(offset + 6), // deep - cursor.isNull(offset + 7) ? null : cursor.getString(offset + 7), // deptName - cursor.isNull(offset + 8) ? null : cursor.getString(offset + 8), // deptid - cursor.isNull(offset + 9) ? null : cursor.getString(offset + 9), // id - cursor.isNull(offset + 10) ? null : cursor.getString(offset + 10), // latBaidu - cursor.isNull(offset + 11) ? null : cursor.getString(offset + 11), // latGaode - cursor.isNull(offset + 12) ? null : cursor.getString(offset + 12), // lngBaidu - cursor.isNull(offset + 13) ? null : cursor.getString(offset + 13), // lngGaode - cursor.isNull(offset + 14) ? null : cursor.getString(offset + 14), // notes - cursor.isNull(offset + 15) ? null : cursor.getString(offset + 15), // photos - cursor.isNull(offset + 16) ? null : cursor.getString(offset + 16), // position - cursor.isNull(offset + 17) ? null : cursor.getString(offset + 17), // staff - cursor.isNull(offset + 18) ? null : cursor.getString(offset + 18), // tel - cursor.isNull(offset + 19) ? null : cursor.getString(offset + 19), // ts - cursor.isNull(offset + 20) ? null : cursor.getString(offset + 20), // valid - cursor.isNull(offset + 21) ? null : cursor.getString(offset + 21), // watchData - cursor.isNull(offset + 22) ? null : cursor.getString(offset + 22), // wellCode - cursor.isNull(offset + 23) ? null : cursor.getString(offset + 23), // wellName - cursor.isNull(offset + 24) ? null : cursor.getString(offset + 24), // wellType - cursor.isNull(offset + 25) ? null : cursor.getString(offset + 25) // wellTypeName + cursor.isNull(offset + 0) ? null : cursor.getLong(offset + 0), // kId + cursor.isNull(offset + 1) ? null : cursor.getString(offset + 1), // area + cursor.isNull(offset + 2) ? null : cursor.getString(offset + 2), // bfzt + cursor.isNull(offset + 3) ? null : cursor.getString(offset + 3), // bfztName + cursor.isNull(offset + 4) ? null : cursor.getString(offset + 4), // coordinateX + cursor.isNull(offset + 5) ? null : cursor.getString(offset + 5), // coordinateY + cursor.isNull(offset + 6) ? null : cursor.getString(offset + 6), // deep + cursor.isNull(offset + 7) ? null : cursor.getString(offset + 7), // deptName + cursor.isNull(offset + 8) ? null : cursor.getString(offset + 8), // deptid + cursor.isNull(offset + 9) ? null : cursor.getString(offset + 9), // id + cursor.isNull(offset + 10) ? null : cursor.getString(offset + 10), // latBaidu + cursor.isNull(offset + 11) ? null : cursor.getString(offset + 11), // latGaode + cursor.isNull(offset + 12) ? null : cursor.getString(offset + 12), // lngBaidu + cursor.isNull(offset + 13) ? null : cursor.getString(offset + 13), // lngGaode + cursor.isNull(offset + 14) ? null : cursor.getString(offset + 14), // notes + cursor.isNull(offset + 15) ? null : cursor.getString(offset + 15), // photos + cursor.isNull(offset + 16) ? null : cursor.getString(offset + 16), // position + cursor.isNull(offset + 17) ? null : cursor.getString(offset + 17), // staff + cursor.isNull(offset + 18) ? null : cursor.getString(offset + 18), // tel + cursor.isNull(offset + 19) ? null : cursor.getString(offset + 19), // ts + cursor.isNull(offset + 20) ? null : cursor.getString(offset + 20), // valid + cursor.isNull(offset + 21) ? null : cursor.getString(offset + 21), // watchData + cursor.isNull(offset + 22) ? null : cursor.getString(offset + 22), // wellCode + cursor.isNull(offset + 23) ? null : cursor.getString(offset + 23), // wellName + cursor.isNull(offset + 24) ? null : cursor.getString(offset + 24), // wellType + cursor.isNull(offset + 25) ? null : cursor.getString(offset + 25) // wellTypeName ); return entity; } - + @Override public void readEntity(Cursor cursor, MapWellLocalBean entity, int offset) { entity.setKId(cursor.isNull(offset + 0) ? null : cursor.getLong(offset + 0)); @@ -440,17 +435,17 @@ entity.setWellName(cursor.isNull(offset + 23) ? null : cursor.getString(offset + 23)); entity.setWellType(cursor.isNull(offset + 24) ? null : cursor.getString(offset + 24)); entity.setWellTypeName(cursor.isNull(offset + 25) ? null : cursor.getString(offset + 25)); - } - + } + @Override protected final Long updateKeyAfterInsert(MapWellLocalBean entity, long rowId) { entity.setKId(rowId); return rowId; } - + @Override public Long getKey(MapWellLocalBean entity) { - if (entity != null) { + if(entity != null) { return entity.getKId(); } else { return null; @@ -466,5 +461,5 @@ protected final boolean isEntityUpdateable() { return true; } - + } diff --git a/app/src/main/java/com/casic/app/smartwell/greendao/NoticeLocaleBeanDao.java b/app/src/main/java/com/casic/app/smartwell/greendao/NoticeLocaleBeanDao.java index 64312ed..deb2d49 100644 --- a/app/src/main/java/com/casic/app/smartwell/greendao/NoticeLocaleBeanDao.java +++ b/app/src/main/java/com/casic/app/smartwell/greendao/NoticeLocaleBeanDao.java @@ -12,10 +12,9 @@ import org.greenrobot.greendao.internal.DaoConfig; // THIS CODE IS GENERATED BY greenDAO, DO NOT EDIT. - -/** +/** * DAO for table "NOTICE_LOCALE_BEAN". - */ +*/ public class NoticeLocaleBeanDao extends AbstractDao { public static final String TABLENAME = "NOTICE_LOCALE_BEAN"; @@ -43,16 +42,14 @@ public NoticeLocaleBeanDao(DaoConfig config) { super(config); } - + public NoticeLocaleBeanDao(DaoConfig config, DaoSession daoSession) { super(config, daoSession); } - /** - * Creates the underlying database table. - */ + /** Creates the underlying database table. */ public static void createTable(Database db, boolean ifNotExists) { - String constraint = ifNotExists ? "IF NOT EXISTS " : ""; + String constraint = ifNotExists? "IF NOT EXISTS ": ""; db.execSQL("CREATE TABLE " + constraint + "\"NOTICE_LOCALE_BEAN\" (" + // "\"_id\" INTEGER PRIMARY KEY AUTOINCREMENT ," + // 0: id "\"MESSAGE_ID\" TEXT UNIQUE ," + // 1: messageId @@ -68,9 +65,7 @@ "\"NOTICE_TIME\" TEXT);"); // 11: noticeTime } - /** - * Drops the underlying database table. - */ + /** Drops the underlying database table. */ public static void dropTable(Database db, boolean ifExists) { String sql = "DROP TABLE " + (ifExists ? "IF EXISTS " : "") + "\"NOTICE_LOCALE_BEAN\""; db.execSQL(sql); @@ -79,62 +74,62 @@ @Override protected final void bindValues(DatabaseStatement stmt, NoticeLocaleBean entity) { stmt.clearBindings(); - + Long id = entity.getId(); if (id != null) { stmt.bindLong(1, id); } - + String messageId = entity.getMessageId(); if (messageId != null) { stmt.bindString(2, messageId); } - + String appid = entity.getAppid(); if (appid != null) { stmt.bindString(3, appid); } - + String clientId = entity.getClientId(); if (clientId != null) { stmt.bindString(4, clientId); } - + String taskId = entity.getTaskId(); if (taskId != null) { stmt.bindString(5, taskId); } - + String userId = entity.getUserId(); if (userId != null) { stmt.bindString(6, userId); } - + String title = entity.getTitle(); if (title != null) { stmt.bindString(7, title); } - + String content = entity.getContent(); if (content != null) { stmt.bindString(8, content); } - + String deviceCode = entity.getDeviceCode(); if (deviceCode != null) { stmt.bindString(9, deviceCode); } - + String jobId = entity.getJobId(); if (jobId != null) { stmt.bindString(10, jobId); } - + String isRead = entity.getIsRead(); if (isRead != null) { stmt.bindString(11, isRead); } - + String noticeTime = entity.getNoticeTime(); if (noticeTime != null) { stmt.bindString(12, noticeTime); @@ -144,62 +139,62 @@ @Override protected final void bindValues(SQLiteStatement stmt, NoticeLocaleBean entity) { stmt.clearBindings(); - + Long id = entity.getId(); if (id != null) { stmt.bindLong(1, id); } - + String messageId = entity.getMessageId(); if (messageId != null) { stmt.bindString(2, messageId); } - + String appid = entity.getAppid(); if (appid != null) { stmt.bindString(3, appid); } - + String clientId = entity.getClientId(); if (clientId != null) { stmt.bindString(4, clientId); } - + String taskId = entity.getTaskId(); if (taskId != null) { stmt.bindString(5, taskId); } - + String userId = entity.getUserId(); if (userId != null) { stmt.bindString(6, userId); } - + String title = entity.getTitle(); if (title != null) { stmt.bindString(7, title); } - + String content = entity.getContent(); if (content != null) { stmt.bindString(8, content); } - + String deviceCode = entity.getDeviceCode(); if (deviceCode != null) { stmt.bindString(9, deviceCode); } - + String jobId = entity.getJobId(); if (jobId != null) { stmt.bindString(10, jobId); } - + String isRead = entity.getIsRead(); if (isRead != null) { stmt.bindString(11, isRead); } - + String noticeTime = entity.getNoticeTime(); if (noticeTime != null) { stmt.bindString(12, noticeTime); @@ -209,27 +204,27 @@ @Override public Long readKey(Cursor cursor, int offset) { return cursor.isNull(offset + 0) ? null : cursor.getLong(offset + 0); - } + } @Override public NoticeLocaleBean readEntity(Cursor cursor, int offset) { NoticeLocaleBean entity = new NoticeLocaleBean( // - cursor.isNull(offset + 0) ? null : cursor.getLong(offset + 0), // id - cursor.isNull(offset + 1) ? null : cursor.getString(offset + 1), // messageId - cursor.isNull(offset + 2) ? null : cursor.getString(offset + 2), // appid - cursor.isNull(offset + 3) ? null : cursor.getString(offset + 3), // clientId - cursor.isNull(offset + 4) ? null : cursor.getString(offset + 4), // taskId - cursor.isNull(offset + 5) ? null : cursor.getString(offset + 5), // userId - cursor.isNull(offset + 6) ? null : cursor.getString(offset + 6), // title - cursor.isNull(offset + 7) ? null : cursor.getString(offset + 7), // content - cursor.isNull(offset + 8) ? null : cursor.getString(offset + 8), // deviceCode - cursor.isNull(offset + 9) ? null : cursor.getString(offset + 9), // jobId - cursor.isNull(offset + 10) ? null : cursor.getString(offset + 10), // isRead - cursor.isNull(offset + 11) ? null : cursor.getString(offset + 11) // noticeTime + cursor.isNull(offset + 0) ? null : cursor.getLong(offset + 0), // id + cursor.isNull(offset + 1) ? null : cursor.getString(offset + 1), // messageId + cursor.isNull(offset + 2) ? null : cursor.getString(offset + 2), // appid + cursor.isNull(offset + 3) ? null : cursor.getString(offset + 3), // clientId + cursor.isNull(offset + 4) ? null : cursor.getString(offset + 4), // taskId + cursor.isNull(offset + 5) ? null : cursor.getString(offset + 5), // userId + cursor.isNull(offset + 6) ? null : cursor.getString(offset + 6), // title + cursor.isNull(offset + 7) ? null : cursor.getString(offset + 7), // content + cursor.isNull(offset + 8) ? null : cursor.getString(offset + 8), // deviceCode + cursor.isNull(offset + 9) ? null : cursor.getString(offset + 9), // jobId + cursor.isNull(offset + 10) ? null : cursor.getString(offset + 10), // isRead + cursor.isNull(offset + 11) ? null : cursor.getString(offset + 11) // noticeTime ); return entity; } - + @Override public void readEntity(Cursor cursor, NoticeLocaleBean entity, int offset) { entity.setId(cursor.isNull(offset + 0) ? null : cursor.getLong(offset + 0)); @@ -244,17 +239,17 @@ entity.setJobId(cursor.isNull(offset + 9) ? null : cursor.getString(offset + 9)); entity.setIsRead(cursor.isNull(offset + 10) ? null : cursor.getString(offset + 10)); entity.setNoticeTime(cursor.isNull(offset + 11) ? null : cursor.getString(offset + 11)); - } - + } + @Override protected final Long updateKeyAfterInsert(NoticeLocaleBean entity, long rowId) { entity.setId(rowId); return rowId; } - + @Override public Long getKey(NoticeLocaleBean entity) { - if (entity != null) { + if(entity != null) { return entity.getId(); } else { return null; @@ -270,5 +265,5 @@ protected final boolean isEntityUpdateable() { return true; } - + } diff --git a/app/src/main/java/com/casic/app/smartwell/greendao/PipeLocalBeanDao.java b/app/src/main/java/com/casic/app/smartwell/greendao/PipeLocalBeanDao.java index aab4d3f..df5515a 100644 --- a/app/src/main/java/com/casic/app/smartwell/greendao/PipeLocalBeanDao.java +++ b/app/src/main/java/com/casic/app/smartwell/greendao/PipeLocalBeanDao.java @@ -12,10 +12,9 @@ import org.greenrobot.greendao.internal.DaoConfig; // THIS CODE IS GENERATED BY greenDAO, DO NOT EDIT. - -/** +/** * DAO for table "PIPE_LOCAL_BEAN". - */ +*/ public class PipeLocalBeanDao extends AbstractDao { public static final String TABLENAME = "PIPE_LOCAL_BEAN"; @@ -37,16 +36,14 @@ public PipeLocalBeanDao(DaoConfig config) { super(config); } - + public PipeLocalBeanDao(DaoConfig config, DaoSession daoSession) { super(config, daoSession); } - /** - * Creates the underlying database table. - */ + /** Creates the underlying database table. */ public static void createTable(Database db, boolean ifNotExists) { - String constraint = ifNotExists ? "IF NOT EXISTS " : ""; + String constraint = ifNotExists? "IF NOT EXISTS ": ""; db.execSQL("CREATE TABLE " + constraint + "\"PIPE_LOCAL_BEAN\" (" + // "\"_id\" INTEGER PRIMARY KEY AUTOINCREMENT ," + // 0: id "\"PIPE_CODE\" TEXT," + // 1: pipeCode @@ -56,9 +53,7 @@ "\"START_LONGITUDE_GD\" TEXT);"); // 5: startLongitudeGd } - /** - * Drops the underlying database table. - */ + /** Drops the underlying database table. */ public static void dropTable(Database db, boolean ifExists) { String sql = "DROP TABLE " + (ifExists ? "IF EXISTS " : "") + "\"PIPE_LOCAL_BEAN\""; db.execSQL(sql); @@ -67,32 +62,32 @@ @Override protected final void bindValues(DatabaseStatement stmt, PipeLocalBean entity) { stmt.clearBindings(); - + Long id = entity.getId(); if (id != null) { stmt.bindLong(1, id); } - + String pipeCode = entity.getPipeCode(); if (pipeCode != null) { stmt.bindString(2, pipeCode); } - + String endLatitudeGd = entity.getEndLatitudeGd(); if (endLatitudeGd != null) { stmt.bindString(3, endLatitudeGd); } - + String endLongitudeGd = entity.getEndLongitudeGd(); if (endLongitudeGd != null) { stmt.bindString(4, endLongitudeGd); } - + String startLatitudeGd = entity.getStartLatitudeGd(); if (startLatitudeGd != null) { stmt.bindString(5, startLatitudeGd); } - + String startLongitudeGd = entity.getStartLongitudeGd(); if (startLongitudeGd != null) { stmt.bindString(6, startLongitudeGd); @@ -102,32 +97,32 @@ @Override protected final void bindValues(SQLiteStatement stmt, PipeLocalBean entity) { stmt.clearBindings(); - + Long id = entity.getId(); if (id != null) { stmt.bindLong(1, id); } - + String pipeCode = entity.getPipeCode(); if (pipeCode != null) { stmt.bindString(2, pipeCode); } - + String endLatitudeGd = entity.getEndLatitudeGd(); if (endLatitudeGd != null) { stmt.bindString(3, endLatitudeGd); } - + String endLongitudeGd = entity.getEndLongitudeGd(); if (endLongitudeGd != null) { stmt.bindString(4, endLongitudeGd); } - + String startLatitudeGd = entity.getStartLatitudeGd(); if (startLatitudeGd != null) { stmt.bindString(5, startLatitudeGd); } - + String startLongitudeGd = entity.getStartLongitudeGd(); if (startLongitudeGd != null) { stmt.bindString(6, startLongitudeGd); @@ -137,21 +132,21 @@ @Override public Long readKey(Cursor cursor, int offset) { return cursor.isNull(offset + 0) ? null : cursor.getLong(offset + 0); - } + } @Override public PipeLocalBean readEntity(Cursor cursor, int offset) { PipeLocalBean entity = new PipeLocalBean( // - cursor.isNull(offset + 0) ? null : cursor.getLong(offset + 0), // id - cursor.isNull(offset + 1) ? null : cursor.getString(offset + 1), // pipeCode - cursor.isNull(offset + 2) ? null : cursor.getString(offset + 2), // endLatitudeGd - cursor.isNull(offset + 3) ? null : cursor.getString(offset + 3), // endLongitudeGd - cursor.isNull(offset + 4) ? null : cursor.getString(offset + 4), // startLatitudeGd - cursor.isNull(offset + 5) ? null : cursor.getString(offset + 5) // startLongitudeGd + cursor.isNull(offset + 0) ? null : cursor.getLong(offset + 0), // id + cursor.isNull(offset + 1) ? null : cursor.getString(offset + 1), // pipeCode + cursor.isNull(offset + 2) ? null : cursor.getString(offset + 2), // endLatitudeGd + cursor.isNull(offset + 3) ? null : cursor.getString(offset + 3), // endLongitudeGd + cursor.isNull(offset + 4) ? null : cursor.getString(offset + 4), // startLatitudeGd + cursor.isNull(offset + 5) ? null : cursor.getString(offset + 5) // startLongitudeGd ); return entity; } - + @Override public void readEntity(Cursor cursor, PipeLocalBean entity, int offset) { entity.setId(cursor.isNull(offset + 0) ? null : cursor.getLong(offset + 0)); @@ -160,17 +155,17 @@ entity.setEndLongitudeGd(cursor.isNull(offset + 3) ? null : cursor.getString(offset + 3)); entity.setStartLatitudeGd(cursor.isNull(offset + 4) ? null : cursor.getString(offset + 4)); entity.setStartLongitudeGd(cursor.isNull(offset + 5) ? null : cursor.getString(offset + 5)); - } - + } + @Override protected final Long updateKeyAfterInsert(PipeLocalBean entity, long rowId) { entity.setId(rowId); return rowId; } - + @Override public Long getKey(PipeLocalBean entity) { - if (entity != null) { + if(entity != null) { return entity.getId(); } else { return null; @@ -186,5 +181,5 @@ protected final boolean isEntityUpdateable() { return true; } - + } diff --git a/app/src/main/java/com/casic/app/smartwell/view/ChangePasswordActivity.kt b/app/src/main/java/com/casic/app/smartwell/view/ChangePasswordActivity.kt index 8e41039..9f1dd40 100644 --- a/app/src/main/java/com/casic/app/smartwell/view/ChangePasswordActivity.kt +++ b/app/src/main/java/com/casic/app/smartwell/view/ChangePasswordActivity.kt @@ -14,7 +14,7 @@ import com.pengxh.kt.lite.extensions.show import com.pengxh.kt.lite.utils.ActivityStackManager import com.pengxh.kt.lite.utils.LoadState -import com.pengxh.kt.lite.utils.LoadingDialogHub +import com.pengxh.kt.lite.utils.LoadingDialog import com.pengxh.kt.lite.widget.TitleBarView import java.nio.charset.StandardCharsets @@ -46,15 +46,15 @@ override fun observeRequestState() { userViewModel.loadState.observe(this) { when (it) { - is LoadState.Loading -> LoadingDialogHub.show(this, "修改中,请稍后") + is LoadState.Loading -> LoadingDialog.show(this, "修改中,请稍后") is LoadState.Success -> { - LoadingDialogHub.dismiss() + LoadingDialog.dismiss() AuthenticationHelper.removeToken() this.navigatePageTo() ActivityStackManager.finishAllActivity() } - else -> LoadingDialogHub.dismiss() + else -> LoadingDialog.dismiss() } } } diff --git a/app/src/main/java/com/casic/app/smartwell/view/DeployedWellActivity.kt b/app/src/main/java/com/casic/app/smartwell/view/DeployedWellActivity.kt index fb4339c..28a5078 100644 --- a/app/src/main/java/com/casic/app/smartwell/view/DeployedWellActivity.kt +++ b/app/src/main/java/com/casic/app/smartwell/view/DeployedWellActivity.kt @@ -83,8 +83,8 @@ } //添加分割线 - binding.deployedListView.addItemDecoration( - RecyclerViewItemOffsets(0, 5, 0, 5) + binding.recyclerView.addItemDecoration( + RecyclerViewItemOffsets(0, 7, 0, 7) ) } @@ -149,12 +149,11 @@ } else { item.deep.toString() + "m" } - viewHolder.setText(R.id.wellNameView, item.wellName) + viewHolder.setText(R.id.wellTypeView, item.wellTypeName) .setText(R.id.wellDepthView, "深:${deep}") .setText(R.id.wellCodeView, "点位编号:${item.wellCode}") - .setText(R.id.wellTypeView, "点位类型:${item.wellTypeName}") .setText(R.id.ownerShipView, "权属单位:${item.deptName}") - .setText(R.id.wellLocationView, "点位置:${item.position}") + .setText(R.id.wellLocationView, "点位位置:${item.position}") .setOnClickListener( R.id.operationButton, object : View.OnClickListener { override fun onClick(v: View?) { @@ -207,7 +206,7 @@ }) } } - binding.deployedListView.adapter = deployAdapter + binding.recyclerView.adapter = deployAdapter deployAdapter.setOnItemClickedListener(object : NormalRecyclerAdapter.OnItemClickedListener { override fun onItemClicked(position: Int, t: WellListModel.DataBean.RowsBean) { diff --git a/app/src/main/java/com/casic/app/smartwell/view/LoginActivity.kt b/app/src/main/java/com/casic/app/smartwell/view/LoginActivity.kt index e4bb0e3..834527b 100644 --- a/app/src/main/java/com/casic/app/smartwell/view/LoginActivity.kt +++ b/app/src/main/java/com/casic/app/smartwell/view/LoginActivity.kt @@ -21,7 +21,7 @@ import com.pengxh.kt.lite.extensions.navigatePageTo import com.pengxh.kt.lite.extensions.readAssetsFile import com.pengxh.kt.lite.extensions.show -import com.pengxh.kt.lite.utils.LoadingDialogHub +import com.pengxh.kt.lite.utils.LoadingDialog import com.pengxh.kt.lite.utils.SaveKeyValues import kotlinx.coroutines.Dispatchers import kotlinx.coroutines.launch @@ -106,11 +106,11 @@ override fun observeRequestState() { authenticateViewModel.loadState.observe(this) { - LoadingDialogHub.show(this, "登录中,请稍后") + LoadingDialog.show(this, "登录中,请稍后") } loginViewModel.loadState.observe(this) { - LoadingDialogHub.dismiss() + LoadingDialog.dismiss() } } diff --git a/app/src/main/java/com/casic/app/smartwell/view/OrderCompletedDetailActivity.kt b/app/src/main/java/com/casic/app/smartwell/view/OrderCompletedDetailActivity.kt index db8ad1f..75cd905 100644 --- a/app/src/main/java/com/casic/app/smartwell/view/OrderCompletedDetailActivity.kt +++ b/app/src/main/java/com/casic/app/smartwell/view/OrderCompletedDetailActivity.kt @@ -17,7 +17,7 @@ import com.pengxh.kt.lite.extensions.show import com.pengxh.kt.lite.utils.Constant import com.pengxh.kt.lite.utils.LoadState -import com.pengxh.kt.lite.utils.LoadingDialogHub +import com.pengxh.kt.lite.utils.LoadingDialog import com.pengxh.kt.lite.widget.TitleBarView import com.pengxh.kt.lite.widget.dialog.AlertMessageDialog @@ -44,7 +44,7 @@ } override fun initOnCreate(savedInstanceState: Bundle?) { - val jobId = intent.getStringExtra(Constant.INTENT_PARAM)!! + val jobId = intent.getStringExtra(Constant.INTENT_PARAM_KEY)!! orderViewModel = ViewModelProvider(this)[OrderViewModel::class.java] orderViewModel.getWorkOrderDetail(jobId) orderViewModel.detailModel.observe(this) { @@ -154,8 +154,8 @@ override fun observeRequestState() { orderViewModel.loadState.observe(this) { when (it) { - is LoadState.Loading -> LoadingDialogHub.show(this, "数据加载中,请稍后") - else -> LoadingDialogHub.dismiss() + is LoadState.Loading -> LoadingDialog.show(this, "数据加载中,请稍后") + else -> LoadingDialog.dismiss() } } } diff --git a/app/src/main/java/com/casic/app/smartwell/view/OrderInHandleDetailActivity.kt b/app/src/main/java/com/casic/app/smartwell/view/OrderInHandleDetailActivity.kt index d70a979..04a7d5d 100644 --- a/app/src/main/java/com/casic/app/smartwell/view/OrderInHandleDetailActivity.kt +++ b/app/src/main/java/com/casic/app/smartwell/view/OrderInHandleDetailActivity.kt @@ -38,7 +38,7 @@ import com.pengxh.kt.lite.extensions.show import com.pengxh.kt.lite.utils.Constant import com.pengxh.kt.lite.utils.LoadState -import com.pengxh.kt.lite.utils.LoadingDialogHub +import com.pengxh.kt.lite.utils.LoadingDialog import com.pengxh.kt.lite.widget.TitleBarView import com.pengxh.kt.lite.widget.dialog.AlertControlDialog import com.pengxh.kt.lite.widget.dialog.AlertMessageDialog @@ -93,7 +93,7 @@ ) binding.addImageRecyclerView.adapter = imageAdapter - val jobId = intent.getStringExtra(Constant.INTENT_PARAM)!!//初始化图片九宫格 + val jobId = intent.getStringExtra(Constant.INTENT_PARAM_KEY)!!//初始化图片九宫格 orderViewModel.getWorkOrderDetail(jobId) orderViewModel.detailModel.observe(this) { if (it.code == 200) { @@ -312,41 +312,41 @@ override fun observeRequestState() { orderViewModel.loadState.observe(this) { when (it) { - is LoadState.Loading -> LoadingDialogHub.show(this, "数据加载中,请稍后") - else -> LoadingDialogHub.dismiss() + is LoadState.Loading -> LoadingDialog.show(this, "数据加载中,请稍后") + else -> LoadingDialog.dismiss() } } uploadImageViewModel.loadState.observe(this) { when (it) { - LoadState.Loading -> LoadingDialogHub.show(this, "图片上传中,请稍后...") - else -> LoadingDialogHub.dismiss() + LoadState.Loading -> LoadingDialog.show(this, "图片上传中,请稍后...") + else -> LoadingDialog.dismiss() } } //转单状态处理 operationViewModel.loadState.observe(this) { when (it) { - is LoadState.Loading -> LoadingDialogHub.show(this, "转单中,请稍后") + is LoadState.Loading -> LoadingDialog.show(this, "转单中,请稍后") is LoadState.Success -> { - LoadingDialogHub.dismiss() + LoadingDialog.dismiss() this.finish() } - else -> LoadingDialogHub.dismiss() + else -> LoadingDialog.dismiss() } } //处理完成工单状态处理 operationViewModel.loadState.observe(this) { when (it) { - is LoadState.Loading -> LoadingDialogHub.show(this, "处理中,请稍后") + is LoadState.Loading -> LoadingDialog.show(this, "处理中,请稍后") is LoadState.Success -> { - LoadingDialogHub.dismiss() + LoadingDialog.dismiss() this.finish() } - else -> LoadingDialogHub.dismiss() + else -> LoadingDialog.dismiss() } } } diff --git a/app/src/main/java/com/casic/app/smartwell/view/OrderNotConfirmedDetailActivity.kt b/app/src/main/java/com/casic/app/smartwell/view/OrderNotConfirmedDetailActivity.kt index 8e036d2..687ec86 100644 --- a/app/src/main/java/com/casic/app/smartwell/view/OrderNotConfirmedDetailActivity.kt +++ b/app/src/main/java/com/casic/app/smartwell/view/OrderNotConfirmedDetailActivity.kt @@ -36,7 +36,7 @@ import com.pengxh.kt.lite.extensions.show import com.pengxh.kt.lite.utils.Constant import com.pengxh.kt.lite.utils.LoadState -import com.pengxh.kt.lite.utils.LoadingDialogHub +import com.pengxh.kt.lite.utils.LoadingDialog import com.pengxh.kt.lite.widget.TitleBarView import com.pengxh.kt.lite.widget.dialog.AlertControlDialog import com.pengxh.kt.lite.widget.dialog.AlertMessageDialog @@ -80,7 +80,7 @@ } override fun initOnCreate(savedInstanceState: Bundle?) { - val jobId = intent.getStringExtra(Constant.INTENT_PARAM)!! + val jobId = intent.getStringExtra(Constant.INTENT_PARAM_KEY)!! //初始化图片九宫格 //左外边距,左内边距,右内边距,右外边距 val viewWidth = getScreenWidth() - (10 + 10 + 10 + 10).dp2px(this) @@ -263,41 +263,41 @@ //数据加载状态处理 orderViewModel.loadState.observe(this) { when (it) { - is LoadState.Loading -> LoadingDialogHub.show(this, "数据加载中,请稍后") - else -> LoadingDialogHub.dismiss() + is LoadState.Loading -> LoadingDialog.show(this, "数据加载中,请稍后") + else -> LoadingDialog.dismiss() } } uploadImageViewModel.loadState.observe(this) { when (it) { - LoadState.Loading -> LoadingDialogHub.show(this, "图片上传中,请稍后") - else -> LoadingDialogHub.dismiss() + LoadState.Loading -> LoadingDialog.show(this, "图片上传中,请稍后") + else -> LoadingDialog.dismiss() } } //转单状态处理 operationViewModel.loadState.observe(this) { when (it) { - is LoadState.Loading -> LoadingDialogHub.show(this, "转单中,请稍后") + is LoadState.Loading -> LoadingDialog.show(this, "转单中,请稍后") is LoadState.Success -> { - LoadingDialogHub.dismiss() + LoadingDialog.dismiss() this.finish() } - else -> LoadingDialogHub.dismiss() + else -> LoadingDialog.dismiss() } } //确认工单状态处理 operationViewModel.loadState.observe(this) { when (it) { - is LoadState.Loading -> LoadingDialogHub.show(this, "处理中,请稍后") + is LoadState.Loading -> LoadingDialog.show(this, "处理中,请稍后") is LoadState.Success -> { - LoadingDialogHub.dismiss() + LoadingDialog.dismiss() this.finish() } - else -> LoadingDialogHub.dismiss() + else -> LoadingDialog.dismiss() } } } diff --git a/app/src/main/java/com/casic/app/smartwell/view/OrderNotProcessedDetailActivity.kt b/app/src/main/java/com/casic/app/smartwell/view/OrderNotProcessedDetailActivity.kt index d3f22dc..0c97a52 100644 --- a/app/src/main/java/com/casic/app/smartwell/view/OrderNotProcessedDetailActivity.kt +++ b/app/src/main/java/com/casic/app/smartwell/view/OrderNotProcessedDetailActivity.kt @@ -18,7 +18,7 @@ import com.pengxh.kt.lite.extensions.show import com.pengxh.kt.lite.utils.Constant import com.pengxh.kt.lite.utils.LoadState -import com.pengxh.kt.lite.utils.LoadingDialogHub +import com.pengxh.kt.lite.utils.LoadingDialog import com.pengxh.kt.lite.widget.TitleBarView import com.pengxh.kt.lite.widget.dialog.AlertControlDialog import com.pengxh.kt.lite.widget.dialog.AlertMessageDialog @@ -50,7 +50,7 @@ } override fun initOnCreate(savedInstanceState: Bundle?) { - this.jobId = intent.getStringExtra(Constant.INTENT_PARAM)!! + this.jobId = intent.getStringExtra(Constant.INTENT_PARAM_KEY)!! orderViewModel = ViewModelProvider(this)[OrderViewModel::class.java] operationViewModel = ViewModelProvider(this)[OperationViewModel::class.java] wellViewModel = ViewModelProvider(this)[WellViewModel::class.java] @@ -162,21 +162,21 @@ //数据加载状态处理 orderViewModel.loadState.observe(this) { when (it) { - is LoadState.Loading -> LoadingDialogHub.show(this, "数据加载中,请稍后") - else -> LoadingDialogHub.dismiss() + is LoadState.Loading -> LoadingDialog.show(this, "数据加载中,请稍后") + else -> LoadingDialog.dismiss() } } //接单状态处理 operationViewModel.loadState.observe(this) { when (it) { - is LoadState.Loading -> LoadingDialogHub.show(this, "接单中,请稍后") + is LoadState.Loading -> LoadingDialog.show(this, "接单中,请稍后") is LoadState.Success -> { - LoadingDialogHub.dismiss() + LoadingDialog.dismiss() this.finish() } - else -> LoadingDialogHub.dismiss() + else -> LoadingDialog.dismiss() } } } diff --git a/app/src/main/java/com/casic/app/smartwell/view/SearchResultActivity.kt b/app/src/main/java/com/casic/app/smartwell/view/SearchResultActivity.kt index 6a92917..4f3a674 100644 --- a/app/src/main/java/com/casic/app/smartwell/view/SearchResultActivity.kt +++ b/app/src/main/java/com/casic/app/smartwell/view/SearchResultActivity.kt @@ -19,7 +19,7 @@ import com.pengxh.kt.lite.extensions.show import com.pengxh.kt.lite.utils.Constant import com.pengxh.kt.lite.utils.LoadState -import com.pengxh.kt.lite.utils.LoadingDialogHub +import com.pengxh.kt.lite.utils.LoadingDialog import com.pengxh.kt.lite.utils.WeakReferenceHandler import com.pengxh.kt.lite.widget.TitleBarView import com.pengxh.kt.lite.widget.dialog.AlertControlDialog @@ -56,7 +56,7 @@ } override fun initOnCreate(savedInstanceState: Bundle?) { - args = intent.getStringArrayListExtra(Constant.INTENT_PARAM)!! + args = intent.getStringArrayListExtra(Constant.INTENT_PARAM_KEY)!! orderViewModel = ViewModelProvider(this)[OrderViewModel::class.java] operationViewModel = ViewModelProvider(this)[OperationViewModel::class.java] @@ -101,24 +101,24 @@ } } - binding.resultRecyclerView.addItemDecoration( - RecyclerViewItemOffsets(0, 5, 0, 5) + binding.recyclerView.addItemDecoration( + RecyclerViewItemOffsets(0, 7, 0, 7) ) } override fun observeRequestState() { orderViewModel.loadState.observe(this) { when (it) { - is LoadState.Loading -> LoadingDialogHub.show(this, "数据加载中,请稍后") - else -> LoadingDialogHub.dismiss() + is LoadState.Loading -> LoadingDialog.show(this, "数据加载中,请稍后") + else -> LoadingDialog.dismiss() } } //接单状态处理 operationViewModel.loadState.observe(this) { when (it) { - is LoadState.Loading -> LoadingDialogHub.show(this, "接单中,请稍后") + is LoadState.Loading -> LoadingDialog.show(this, "接单中,请稍后") is LoadState.Success -> { - LoadingDialogHub.dismiss() + LoadingDialog.dismiss() //接单成功之后刷新列表 dataBeans.removeAt(clickedPosition) searchResultAdapter.notifyItemRemoved(clickedPosition) @@ -127,7 +127,7 @@ ) } - else -> LoadingDialogHub.dismiss() + else -> LoadingDialog.dismiss() } } } @@ -162,7 +162,7 @@ } else { binding.emptyInclude.emptyView.hide() searchResultAdapter = SearchResultAdapter(this, dataBeans) - binding.resultRecyclerView.adapter = searchResultAdapter + binding.recyclerView.adapter = searchResultAdapter searchResultAdapter.setOnItemClickListener(object : SearchResultAdapter.OnItemClickListener { override fun onClicked(position: Int) { diff --git a/app/src/main/java/com/casic/app/smartwell/view/UnDeployWellActivity.kt b/app/src/main/java/com/casic/app/smartwell/view/UnDeployWellActivity.kt index 7f7cd3c..555c278 100644 --- a/app/src/main/java/com/casic/app/smartwell/view/UnDeployWellActivity.kt +++ b/app/src/main/java/com/casic/app/smartwell/view/UnDeployWellActivity.kt @@ -81,8 +81,8 @@ } } - binding.undeployListView.addItemDecoration( - RecyclerViewItemOffsets(0, 5, 0, 5) + binding.recyclerView.addItemDecoration( + RecyclerViewItemOffsets(0, 7, 0, 7) ) } @@ -147,12 +147,11 @@ } else { item.deep.toString() + "m" } - viewHolder.setText(R.id.wellNameView, item.wellName) + viewHolder.setText(R.id.wellTypeView, item.wellTypeName) .setText(R.id.wellDepthView, "深:${deep}") .setText(R.id.wellCodeView, "点位编号:${item.wellCode}") - .setText(R.id.wellTypeView, "点位类型:${item.wellTypeName}") .setText(R.id.ownerShipView, "权属单位:${item.deptName}") - .setText(R.id.wellLocationView, "点位置:${item.position}") + .setText(R.id.wellLocationView, "点位位置:${item.position}") .setOnClickListener( R.id.operationButton, object : View.OnClickListener { override fun onClick(v: View?) { @@ -185,7 +184,7 @@ ) } } - binding.undeployListView.adapter = unDeployAdapter + binding.recyclerView.adapter = unDeployAdapter unDeployAdapter.setOnItemClickedListener(object : NormalRecyclerAdapter.OnItemClickedListener { override fun onItemClicked(position: Int, t: WellListModel.DataBean.RowsBean) { diff --git a/app/src/main/java/com/casic/app/smartwell/view/WellDetailActivity.kt b/app/src/main/java/com/casic/app/smartwell/view/WellDetailActivity.kt index b50d067..eb8b468 100644 --- a/app/src/main/java/com/casic/app/smartwell/view/WellDetailActivity.kt +++ b/app/src/main/java/com/casic/app/smartwell/view/WellDetailActivity.kt @@ -16,7 +16,7 @@ import com.pengxh.kt.lite.extensions.show import com.pengxh.kt.lite.utils.Constant import com.pengxh.kt.lite.utils.LoadState -import com.pengxh.kt.lite.utils.LoadingDialogHub +import com.pengxh.kt.lite.utils.LoadingDialog import com.pengxh.kt.lite.widget.TitleBarView import com.pengxh.kt.lite.widget.dialog.AlertMessageDialog @@ -44,7 +44,7 @@ } override fun initOnCreate(savedInstanceState: Bundle?) { - val wellId = intent.getStringExtra(Constant.INTENT_PARAM)!! + val wellId = intent.getStringExtra(Constant.INTENT_PARAM_KEY)!! wellViewModel = ViewModelProvider(this)[WellViewModel::class.java] wellViewModel.getWellDetail(wellId) wellViewModel.wellDetailModel.observe(this) { @@ -132,8 +132,8 @@ override fun observeRequestState() { wellViewModel.loadState.observe(this) { when (it) { - is LoadState.Loading -> LoadingDialogHub.show(this, "数据加载中,请稍后") - else -> LoadingDialogHub.dismiss() + is LoadState.Loading -> LoadingDialog.show(this, "数据加载中,请稍后") + else -> LoadingDialog.dismiss() } } } diff --git a/app/src/main/java/com/casic/app/smartwell/view/WellManagementActivity.kt b/app/src/main/java/com/casic/app/smartwell/view/WellManagementActivity.kt index 084da95..457096b 100644 --- a/app/src/main/java/com/casic/app/smartwell/view/WellManagementActivity.kt +++ b/app/src/main/java/com/casic/app/smartwell/view/WellManagementActivity.kt @@ -94,8 +94,8 @@ } } - binding.wellListView.addItemDecoration( - RecyclerViewItemOffsets(0, 5, 0, 5) + binding.recyclerView.addItemDecoration( + RecyclerViewItemOffsets(0, 7, 0, 7) ) } @@ -175,13 +175,12 @@ } else { item.deep.toString() + "m" } - viewHolder.setText(R.id.wellNameView, item.wellName) + viewHolder.setText(R.id.wellTypeView, item.wellTypeName) .setText(R.id.wellStateView, "已${item.bfztName}") .setText(R.id.wellDepthView, "深:${deep}") .setText(R.id.wellCodeView, "点位编号:${item.wellCode}") - .setText(R.id.wellTypeView, "点位类型:${item.wellTypeName}") .setText(R.id.ownerShipView, "权属单位:${item.deptName}") - .setText(R.id.wellLocationView, "点位置:${item.position}") + .setText(R.id.wellLocationView, "点位位置:${item.position}") .setOnClickListener( R.id.navigationButton, object : View.OnClickListener { override fun onClick(v: View?) { @@ -200,7 +199,7 @@ ) } } - binding.wellListView.adapter = wellListAdapter + binding.recyclerView.adapter = wellListAdapter wellListAdapter.setOnItemClickedListener(object : NormalRecyclerAdapter.OnItemClickedListener { override fun onItemClicked(position: Int, t: WellListModel.DataBean.RowsBean) { diff --git a/app/src/main/java/com/casic/app/smartwell/view/WellMonitorActivity.kt b/app/src/main/java/com/casic/app/smartwell/view/WellMonitorActivity.kt index e3573eb..b87bdb7 100644 --- a/app/src/main/java/com/casic/app/smartwell/view/WellMonitorActivity.kt +++ b/app/src/main/java/com/casic/app/smartwell/view/WellMonitorActivity.kt @@ -11,7 +11,7 @@ import com.pengxh.kt.lite.base.KotlinBaseActivity import com.pengxh.kt.lite.utils.Constant import com.pengxh.kt.lite.utils.LoadState -import com.pengxh.kt.lite.utils.LoadingDialogHub +import com.pengxh.kt.lite.utils.LoadingDialog import com.pengxh.kt.lite.widget.TitleBarView class WellMonitorActivity : KotlinBaseActivity() { @@ -36,7 +36,7 @@ } override fun initOnCreate(savedInstanceState: Bundle?) { - val wellId = intent.getStringExtra(Constant.INTENT_PARAM)!! + val wellId = intent.getStringExtra(Constant.INTENT_PARAM_KEY)!! wellViewModel = ViewModelProvider(this)[WellViewModel::class.java] wellViewModel.getMonitorResult(wellId) wellViewModel.monitorModel.observe(this) { @@ -56,8 +56,8 @@ override fun observeRequestState() { wellViewModel.loadState.observe(this) { when (it) { - is LoadState.Loading -> LoadingDialogHub.show(this, "数据加载中,请稍后") - else -> LoadingDialogHub.dismiss() + is LoadState.Loading -> LoadingDialog.show(this, "数据加载中,请稍后") + else -> LoadingDialog.dismiss() } } } diff --git a/app/src/main/java/com/casic/app/smartwell/view/WellOperationActivity.kt b/app/src/main/java/com/casic/app/smartwell/view/WellOperationActivity.kt index 8d333bf..347ebb6 100644 --- a/app/src/main/java/com/casic/app/smartwell/view/WellOperationActivity.kt +++ b/app/src/main/java/com/casic/app/smartwell/view/WellOperationActivity.kt @@ -23,7 +23,7 @@ import com.pengxh.kt.lite.extensions.navigatePageTo import com.pengxh.kt.lite.extensions.show import com.pengxh.kt.lite.utils.LoadState -import com.pengxh.kt.lite.utils.LoadingDialogHub +import com.pengxh.kt.lite.utils.LoadingDialog import com.pengxh.kt.lite.utils.WeakReferenceHandler import com.pengxh.kt.lite.widget.dialog.AlertControlDialog @@ -109,8 +109,8 @@ } } - binding.operationListView.addItemDecoration( - RecyclerViewItemOffsets(0, 5, 0, 5) + binding.recyclerView.addItemDecoration( + RecyclerViewItemOffsets(0, 7, 0, 7) ) } @@ -123,13 +123,13 @@ override fun observeRequestState() { wellViewModel.loadState.observe(this) { when (it) { - is LoadState.Loading -> LoadingDialogHub.show(this, "处理中,请稍后") + is LoadState.Loading -> LoadingDialog.show(this, "处理中,请稍后") is LoadState.Success -> { - LoadingDialogHub.dismiss() + LoadingDialog.dismiss() wellOperationAdapter.notifyItemChanged(clickedPosition) } - else -> LoadingDialogHub.dismiss() + else -> LoadingDialog.dismiss() } } } @@ -203,24 +203,23 @@ if (item.bfztName == "布防") { viewHolder.setImageResource( R.id.wellStateView, R.drawable.bg_solid_text_green_radius_5 - ).setText(R.id.wellStateView, "撤防") + ).setText(R.id.operationButton, "撤防") } else { viewHolder.setImageResource( R.id.wellStateView, R.drawable.bg_solid_text_red_radius_5 - ).setText(R.id.wellStateView, "布防") + ).setText(R.id.operationButton, "布防") } val deep = if (item.deep.toString().isBlank()) { "未知" } else { item.deep.toString() + "m" } - viewHolder.setText(R.id.wellNameView, item.wellName) + viewHolder.setText(R.id.wellTypeView, item.wellTypeName) .setText(R.id.wellStateView, "已${item.bfztName}") .setText(R.id.wellDepthView, "深:${deep}") .setText(R.id.wellCodeView, "点位编号:${item.wellCode}") - .setText(R.id.wellTypeView, "点位类型:${item.wellTypeName}") .setText(R.id.ownerShipView, "权属单位:${item.deptName}") - .setText(R.id.wellLocationView, "点位置:${item.position}") + .setText(R.id.wellLocationView, "点位位置:${item.position}") .setOnClickListener( R.id.operationButton, object : View.OnClickListener { override fun onClick(v: View?) { @@ -280,7 +279,7 @@ ) } } - binding.operationListView.adapter = wellOperationAdapter + binding.recyclerView.adapter = wellOperationAdapter wellOperationAdapter.setOnItemClickedListener(object : NormalRecyclerAdapter.OnItemClickedListener { override fun onItemClicked(position: Int, t: WellListModel.DataBean.RowsBean) { diff --git a/app/src/main/res/drawable/ic_down.xml b/app/src/main/res/drawable/ic_down.xml index 20e6476..6987e6c 100644 --- a/app/src/main/res/drawable/ic_down.xml +++ b/app/src/main/res/drawable/ic_down.xml @@ -1,6 +1,6 @@ + + diff --git a/app/src/main/res/layout/activity_about_us.xml b/app/src/main/res/layout/activity_about_us.xml index 9091a00..d5fbd0d 100644 --- a/app/src/main/res/layout/activity_about_us.xml +++ b/app/src/main/res/layout/activity_about_us.xml @@ -12,13 +12,7 @@ android:layout_width="match_parent" android:layout_height="wrap_content" android:background="@color/mainThemeColor" - app:tbv_left_image="@drawable/ic_title_left" - app:tbv_only_show_title="false" - app:tbv_show_left_image="true" - app:tbv_show_right_image="false" - app:tbv_text="关于我们" - app:tbv_text_color="@color/white" - app:tbv_text_size="@dimen/sp_18" /> + app:tbv_text="关于我们" /> + app:tbv_text="修改密码" /> + app:tbv_text="布防列表" /> + app:tbv_text="帮助中心" /> + app:tbv_text="工单详情" /> + app:tbv_text="工单详情" /> + app:tbv_text="工单详情" /> + app:tbv_text="工单详情" /> + app:tbv_text="超时工单" /> + app:tbv_text="工单查询" /> + app:tbv_text="查询结果" /> + app:tbv_text="撤防列表" /> + app:tbv_text="个人资料" /> + app:tbv_text="点位详情" /> + app:tbv_text="监控内容" /> - - - - - - + android:layout_height="wrap_content" + android:background="@color/mainThemeColor" + app:tbv_show_left_image="false" + app:tbv_show_right_image="true" + app:tbv_text="首页" /> - + - + - - - - - - + android:layout_height="wrap_content" + android:background="@color/mainThemeColor" + app:tbv_right_image="@drawable/ic_search_white" + app:tbv_show_left_image="false" + app:tbv_show_right_image="true" + app:tbv_text="工单" /> - + + android:value="ee96d8b5e12de3fbb29949efd57418a8" /> () @@ -150,7 +158,7 @@ val cameraPosition = CameraPosition(centerLatLng, 14f, 0f, 0f) val cameraUpdate = CameraUpdateFactory.newCameraPosition(cameraPosition) withContext(Dispatchers.Main) { - LoadingDialogHub.dismiss() + LoadingDialog.dismiss() aMap.animateCamera(cameraUpdate, 1500, null) } } @@ -239,11 +247,6 @@ } override fun initEvent() { - binding.rightOptionView.setOnClickListener { - val x = binding.rightOptionView.width - easyPopupWindow.width - easyPopupWindow.showAsDropDown(binding.rightOptionView, x, 0) - } - //撤防点位 binding.unDeployedLayout.setOnClickListener { requireContext().navigatePageTo() @@ -263,11 +266,11 @@ override fun observeRequestState() { wellViewModel.loadState.observe(this) { when (it) { - is LoadState.Loading -> LoadingDialogHub.show( + is LoadState.Loading -> LoadingDialog.show( requireActivity(), "数据加载中,请稍后..." ) - else -> LoadingDialogHub.dismiss() + else -> LoadingDialog.dismiss() } } } @@ -376,7 +379,7 @@ }).build().show() } }) - infoPopup.showAsDropDown(binding.rightOptionView) +// infoPopup.showAsDropDown(binding.rightOptionView) } override fun onCameraChange(p0: CameraPosition?) { diff --git a/app/src/main/java/com/casic/app/smartwell/fragment/HomePageNoClusterFragment.kt b/app/src/main/java/com/casic/app/smartwell/fragment/HomePageNoClusterFragment.kt index 802426a..b25f743 100644 --- a/app/src/main/java/com/casic/app/smartwell/fragment/HomePageNoClusterFragment.kt +++ b/app/src/main/java/com/casic/app/smartwell/fragment/HomePageNoClusterFragment.kt @@ -38,8 +38,9 @@ import com.pengxh.kt.lite.extensions.navigatePageTo import com.pengxh.kt.lite.extensions.show import com.pengxh.kt.lite.utils.LoadState -import com.pengxh.kt.lite.utils.LoadingDialogHub +import com.pengxh.kt.lite.utils.LoadingDialog import com.pengxh.kt.lite.widget.EasyPopupWindow +import com.pengxh.kt.lite.widget.TitleBarView import com.pengxh.kt.lite.widget.dialog.AlertControlDialog import kotlinx.coroutines.Dispatchers import kotlinx.coroutines.launch @@ -78,7 +79,15 @@ override fun setupTopBarLayout() { binding.rootView.initImmersionBar(this, false, R.color.mainThemeColor) - binding.titleView.text = "首页" + binding.titleView.setOnClickListener(object : TitleBarView.OnClickListener { + override fun onLeftClick() { + + } + + override fun onRightClick() { + easyPopupWindow.showAsDropDown(binding.titleView, binding.titleView.width, 0) + } + }) } override fun initOnCreate(savedInstanceState: Bundle?) { @@ -112,7 +121,7 @@ //渲染井位置 lifecycleScope.launch(Dispatchers.Main) { - LoadingDialogHub.show(requireActivity(), "数据加载中,请稍后") + LoadingDialog.show(requireActivity(), "数据加载中,请稍后") withContext(Dispatchers.IO) { //取Well缓存 val allMarkerOptions = ArrayList() @@ -144,7 +153,7 @@ val cameraPosition = CameraPosition(centerLatLng, 14f, 0f, 0f) val cameraUpdate = CameraUpdateFactory.newCameraPosition(cameraPosition) withContext(Dispatchers.Main) { - LoadingDialogHub.dismiss() + LoadingDialog.dismiss() aMap.animateCamera(cameraUpdate, 1500, null) } } @@ -238,11 +247,6 @@ } override fun initEvent() { - binding.rightOptionView.setOnClickListener { - val x = binding.rightOptionView.width - easyPopupWindow.width - easyPopupWindow.showAsDropDown(binding.rightOptionView, x, 0) - } - //撤防点位 binding.unDeployedLayout.setOnClickListener { requireContext().navigatePageTo() @@ -262,11 +266,11 @@ override fun observeRequestState() { wellViewModel.loadState.observe(this) { when (it) { - is LoadState.Loading -> LoadingDialogHub.show( + is LoadState.Loading -> LoadingDialog.show( requireActivity(), "数据加载中,请稍后..." ) - else -> LoadingDialogHub.dismiss() + else -> LoadingDialog.dismiss() } } } diff --git a/app/src/main/java/com/casic/app/smartwell/fragment/MinePageFragment.kt b/app/src/main/java/com/casic/app/smartwell/fragment/MinePageFragment.kt index 09a570c..dcb48f8 100644 --- a/app/src/main/java/com/casic/app/smartwell/fragment/MinePageFragment.kt +++ b/app/src/main/java/com/casic/app/smartwell/fragment/MinePageFragment.kt @@ -35,7 +35,7 @@ import com.pengxh.kt.lite.utils.ActivityStackManager import com.pengxh.kt.lite.utils.FileDownloadManager import com.pengxh.kt.lite.utils.LoadState -import com.pengxh.kt.lite.utils.LoadingDialogHub +import com.pengxh.kt.lite.utils.LoadingDialog import com.pengxh.kt.lite.widget.dialog.AlertControlDialog import com.pengxh.kt.lite.widget.dialog.BottomActionSheet import kotlinx.coroutines.Dispatchers @@ -60,7 +60,6 @@ override fun setupTopBarLayout() { binding.rootView.initImmersionBar(this, false, R.color.mainThemeColor) - binding.titleInclude.titleView.text = "我的" } override fun initOnCreate(savedInstanceState: Bundle?) { @@ -155,27 +154,27 @@ override fun observeRequestState() { userViewModel.loadState.observe(this) { when (it) { - is LoadState.Loading -> LoadingDialogHub.show( + is LoadState.Loading -> LoadingDialog.show( requireActivity(), "检查版本中,请稍后" ) - else -> LoadingDialogHub.dismiss() + else -> LoadingDialog.dismiss() } } wellViewModel.loadState.observe(this) { when (it) { - is LoadState.Loading -> LoadingDialogHub.show( + is LoadState.Loading -> LoadingDialog.show( requireActivity(), "数据更新中,请稍后" ) is LoadState.Fail -> { - LoadingDialogHub.dismiss() + LoadingDialog.dismiss() "数据更新超时".show(requireContext()) } else -> { - LoadingDialogHub.dismiss() + LoadingDialog.dismiss() AlertControlDialog.Builder().setContext(requireContext()).setTitle("温馨提示") .setMessage("数据更新成功,请重启应用").setNegativeButton("取消") .setPositiveButton("确定").setOnDialogButtonClickListener(object : @@ -197,17 +196,17 @@ lineViewModel.loadState.observe(this) { when (it) { - is LoadState.Loading -> LoadingDialogHub.show( + is LoadState.Loading -> LoadingDialog.show( requireActivity(), "数据更新中,请稍后" ) is LoadState.Fail -> { - LoadingDialogHub.dismiss() + LoadingDialog.dismiss() "数据更新超时".show(requireContext()) } else -> { - LoadingDialogHub.dismiss() + LoadingDialog.dismiss() AlertControlDialog.Builder().setContext(requireContext()).setTitle("温馨提示") .setMessage("数据更新成功,请重启应用").setNegativeButton("取消") .setPositiveButton("确定").setOnDialogButtonClickListener(object : diff --git a/app/src/main/java/com/casic/app/smartwell/fragment/NoticePageFragment.kt b/app/src/main/java/com/casic/app/smartwell/fragment/NoticePageFragment.kt index 171b555..3c93f54 100644 --- a/app/src/main/java/com/casic/app/smartwell/fragment/NoticePageFragment.kt +++ b/app/src/main/java/com/casic/app/smartwell/fragment/NoticePageFragment.kt @@ -48,7 +48,6 @@ override fun setupTopBarLayout() { binding.rootView.initImmersionBar(this, false, R.color.mainThemeColor) - binding.titleInclude.titleView.text = "消息" } override fun initOnCreate(savedInstanceState: Bundle?) { diff --git a/app/src/main/java/com/casic/app/smartwell/fragment/OrderListFragment.kt b/app/src/main/java/com/casic/app/smartwell/fragment/OrderListFragment.kt index 93ff35b..5e38acb 100644 --- a/app/src/main/java/com/casic/app/smartwell/fragment/OrderListFragment.kt +++ b/app/src/main/java/com/casic/app/smartwell/fragment/OrderListFragment.kt @@ -12,6 +12,7 @@ import com.casic.app.smartwell.view.SearchOrderActivity import com.pengxh.kt.lite.base.KotlinBaseFragment import com.pengxh.kt.lite.extensions.navigatePageTo +import com.pengxh.kt.lite.widget.TitleBarView class OrderListFragment : KotlinBaseFragment() { @@ -25,15 +26,22 @@ } override fun initViewBinding( - inflater: LayoutInflater, - container: ViewGroup? + inflater: LayoutInflater, container: ViewGroup? ): FragmentOrderBinding { return FragmentOrderBinding.inflate(inflater, container, false) } override fun setupTopBarLayout() { binding.rootView.initImmersionBar(this, false, R.color.mainThemeColor) - binding.titleView.text = "工单" + binding.titleView.setOnClickListener(object : TitleBarView.OnClickListener { + override fun onLeftClick() { + + } + + override fun onRightClick() { + requireContext().navigatePageTo() + } + }) } override fun initOnCreate(savedInstanceState: Bundle?) { @@ -51,8 +59,6 @@ } override fun initEvent() { - binding.rightOptionView.setOnClickListener { - requireContext().navigatePageTo() - } + } } \ No newline at end of file diff --git a/app/src/main/java/com/casic/app/smartwell/fragment/OrderNotProcessedFragment.kt b/app/src/main/java/com/casic/app/smartwell/fragment/OrderNotProcessedFragment.kt index 0b3d09d..2b6f21d 100644 --- a/app/src/main/java/com/casic/app/smartwell/fragment/OrderNotProcessedFragment.kt +++ b/app/src/main/java/com/casic/app/smartwell/fragment/OrderNotProcessedFragment.kt @@ -18,7 +18,7 @@ import com.pengxh.kt.lite.extensions.navigatePageTo import com.pengxh.kt.lite.extensions.show import com.pengxh.kt.lite.utils.LoadState -import com.pengxh.kt.lite.utils.LoadingDialogHub +import com.pengxh.kt.lite.utils.LoadingDialog import com.pengxh.kt.lite.utils.WeakReferenceHandler import com.pengxh.kt.lite.widget.dialog.AlertControlDialog @@ -78,8 +78,8 @@ operationViewModel = ViewModelProvider(this)[OperationViewModel::class.java] - binding.notProcessedView.addItemDecoration( - RecyclerViewItemOffsets(0, 5, 0, 5) + binding.recyclerView.addItemDecoration( + RecyclerViewItemOffsets(0, 7, 0, 7) ) } @@ -87,9 +87,9 @@ //接单状态处理 operationViewModel.loadState.observe(this) { when (it) { - is LoadState.Loading -> LoadingDialogHub.show(requireActivity(), "接单中,请稍后") + is LoadState.Loading -> LoadingDialog.show(requireActivity(), "接单中,请稍后") is LoadState.Success -> { - LoadingDialogHub.dismiss() + LoadingDialog.dismiss() //接单成功之后刷新列表 dataBeans.removeAt(clickedPosition) notProcessedAdapter.notifyItemRemoved(clickedPosition) @@ -98,7 +98,7 @@ ) } - else -> LoadingDialogHub.dismiss() + else -> LoadingDialog.dismiss() } } } @@ -131,7 +131,7 @@ } else { binding.emptyInclude.emptyView.hide() notProcessedAdapter = OrderNotProcessedAdapter(requireContext(), dataBeans) - binding.notProcessedView.adapter = notProcessedAdapter + binding.recyclerView.adapter = notProcessedAdapter notProcessedAdapter.setOnItemClickListener(object : OrderNotProcessedAdapter.OnItemClickListener { override fun onClicked(position: Int) { diff --git a/app/src/main/java/com/casic/app/smartwell/fragment/OvertimeNotAcceptFragment.kt b/app/src/main/java/com/casic/app/smartwell/fragment/OvertimeNotAcceptFragment.kt index a198545..9b318ca 100644 --- a/app/src/main/java/com/casic/app/smartwell/fragment/OvertimeNotAcceptFragment.kt +++ b/app/src/main/java/com/casic/app/smartwell/fragment/OvertimeNotAcceptFragment.kt @@ -18,7 +18,7 @@ import com.pengxh.kt.lite.extensions.navigatePageTo import com.pengxh.kt.lite.extensions.show import com.pengxh.kt.lite.utils.LoadState -import com.pengxh.kt.lite.utils.LoadingDialogHub +import com.pengxh.kt.lite.utils.LoadingDialog import com.pengxh.kt.lite.utils.WeakReferenceHandler import com.pengxh.kt.lite.widget.dialog.AlertControlDialog @@ -81,8 +81,8 @@ operationViewModel = ViewModelProvider(this)[OperationViewModel::class.java] - binding.notProcessedView.addItemDecoration( - RecyclerViewItemOffsets(0, 5, 0, 5) + binding.recyclerView.addItemDecoration( + RecyclerViewItemOffsets(0, 7, 0, 7) ) } @@ -90,9 +90,9 @@ //接单状态处理 operationViewModel.loadState.observe(this) { when (it) { - is LoadState.Loading -> LoadingDialogHub.show(requireActivity(), "接单中,请稍后") + is LoadState.Loading -> LoadingDialog.show(requireActivity(), "接单中,请稍后") is LoadState.Success -> { - LoadingDialogHub.dismiss() + LoadingDialog.dismiss() //接单成功之后刷新列表 dataBeans.removeAt(clickedPosition) notProcessedAdapter.notifyItemRemoved(clickedPosition) @@ -101,7 +101,7 @@ ) } - else -> LoadingDialogHub.dismiss() + else -> LoadingDialog.dismiss() } } } @@ -134,7 +134,7 @@ } else { binding.emptyInclude.emptyView.hide() notProcessedAdapter = OrderNotProcessedAdapter(requireContext(), dataBeans) - binding.notProcessedView.adapter = notProcessedAdapter + binding.recyclerView.adapter = notProcessedAdapter notProcessedAdapter.setOnItemClickListener(object : OrderNotProcessedAdapter.OnItemClickListener { override fun onClicked(position: Int) { diff --git a/app/src/main/java/com/casic/app/smartwell/greendao/DaoMaster.java b/app/src/main/java/com/casic/app/smartwell/greendao/DaoMaster.java index fdcf3a7..1e52b74 100644 --- a/app/src/main/java/com/casic/app/smartwell/greendao/DaoMaster.java +++ b/app/src/main/java/com/casic/app/smartwell/greendao/DaoMaster.java @@ -13,25 +13,20 @@ // THIS CODE IS GENERATED BY greenDAO, DO NOT EDIT. - /** * Master of DAO (schema version 4): knows all DAOs. */ public class DaoMaster extends AbstractDaoMaster { public static final int SCHEMA_VERSION = 4; - /** - * Creates underlying database table using DAOs. - */ + /** Creates underlying database table using DAOs. */ public static void createAllTables(Database db, boolean ifNotExists) { MapWellLocalBeanDao.createTable(db, ifNotExists); NoticeLocaleBeanDao.createTable(db, ifNotExists); PipeLocalBeanDao.createTable(db, ifNotExists); } - /** - * Drops underlying database table using DAOs. - */ + /** Drops underlying database table using DAOs. */ public static void dropAllTables(Database db, boolean ifExists) { MapWellLocalBeanDao.dropTable(db, ifExists); NoticeLocaleBeanDao.dropTable(db, ifExists); @@ -86,9 +81,7 @@ } } - /** - * WARNING: Drops all table on Upgrade! Use only during development. - */ + /** WARNING: Drops all table on Upgrade! Use only during development. */ public static class DevOpenHelper extends OpenHelper { public DevOpenHelper(Context context, String name) { super(context, name); diff --git a/app/src/main/java/com/casic/app/smartwell/greendao/DaoSession.java b/app/src/main/java/com/casic/app/smartwell/greendao/DaoSession.java index 0b36d17..3e40e3b 100644 --- a/app/src/main/java/com/casic/app/smartwell/greendao/DaoSession.java +++ b/app/src/main/java/com/casic/app/smartwell/greendao/DaoSession.java @@ -16,7 +16,7 @@ /** * {@inheritDoc} - * + * * @see org.greenrobot.greendao.AbstractDaoSession */ public class DaoSession extends AbstractDaoSession { @@ -50,7 +50,7 @@ registerDao(NoticeLocaleBean.class, noticeLocaleBeanDao); registerDao(PipeLocalBean.class, pipeLocalBeanDao); } - + public void clear() { mapWellLocalBeanDaoConfig.clearIdentityScope(); noticeLocaleBeanDaoConfig.clearIdentityScope(); diff --git a/app/src/main/java/com/casic/app/smartwell/greendao/MapWellLocalBeanDao.java b/app/src/main/java/com/casic/app/smartwell/greendao/MapWellLocalBeanDao.java index 8908fda..407bc92 100644 --- a/app/src/main/java/com/casic/app/smartwell/greendao/MapWellLocalBeanDao.java +++ b/app/src/main/java/com/casic/app/smartwell/greendao/MapWellLocalBeanDao.java @@ -12,10 +12,9 @@ import org.greenrobot.greendao.internal.DaoConfig; // THIS CODE IS GENERATED BY greenDAO, DO NOT EDIT. - -/** +/** * DAO for table "MAP_WELL_LOCAL_BEAN". - */ +*/ public class MapWellLocalBeanDao extends AbstractDao { public static final String TABLENAME = "MAP_WELL_LOCAL_BEAN"; @@ -57,16 +56,14 @@ public MapWellLocalBeanDao(DaoConfig config) { super(config); } - + public MapWellLocalBeanDao(DaoConfig config, DaoSession daoSession) { super(config, daoSession); } - /** - * Creates the underlying database table. - */ + /** Creates the underlying database table. */ public static void createTable(Database db, boolean ifNotExists) { - String constraint = ifNotExists ? "IF NOT EXISTS " : ""; + String constraint = ifNotExists? "IF NOT EXISTS ": ""; db.execSQL("CREATE TABLE " + constraint + "\"MAP_WELL_LOCAL_BEAN\" (" + // "\"_id\" INTEGER PRIMARY KEY AUTOINCREMENT ," + // 0: kId "\"AREA\" TEXT," + // 1: area @@ -96,9 +93,7 @@ "\"WELL_TYPE_NAME\" TEXT);"); // 25: wellTypeName } - /** - * Drops the underlying database table. - */ + /** Drops the underlying database table. */ public static void dropTable(Database db, boolean ifExists) { String sql = "DROP TABLE " + (ifExists ? "IF EXISTS " : "") + "\"MAP_WELL_LOCAL_BEAN\""; db.execSQL(sql); @@ -107,132 +102,132 @@ @Override protected final void bindValues(DatabaseStatement stmt, MapWellLocalBean entity) { stmt.clearBindings(); - + Long kId = entity.getKId(); if (kId != null) { stmt.bindLong(1, kId); } - + String area = entity.getArea(); if (area != null) { stmt.bindString(2, area); } - + String bfzt = entity.getBfzt(); if (bfzt != null) { stmt.bindString(3, bfzt); } - + String bfztName = entity.getBfztName(); if (bfztName != null) { stmt.bindString(4, bfztName); } - + String coordinateX = entity.getCoordinateX(); if (coordinateX != null) { stmt.bindString(5, coordinateX); } - + String coordinateY = entity.getCoordinateY(); if (coordinateY != null) { stmt.bindString(6, coordinateY); } - + String deep = entity.getDeep(); if (deep != null) { stmt.bindString(7, deep); } - + String deptName = entity.getDeptName(); if (deptName != null) { stmt.bindString(8, deptName); } - + String deptid = entity.getDeptid(); if (deptid != null) { stmt.bindString(9, deptid); } - + String id = entity.getId(); if (id != null) { stmt.bindString(10, id); } - + String latBaidu = entity.getLatBaidu(); if (latBaidu != null) { stmt.bindString(11, latBaidu); } - + String latGaode = entity.getLatGaode(); if (latGaode != null) { stmt.bindString(12, latGaode); } - + String lngBaidu = entity.getLngBaidu(); if (lngBaidu != null) { stmt.bindString(13, lngBaidu); } - + String lngGaode = entity.getLngGaode(); if (lngGaode != null) { stmt.bindString(14, lngGaode); } - + String notes = entity.getNotes(); if (notes != null) { stmt.bindString(15, notes); } - + String photos = entity.getPhotos(); if (photos != null) { stmt.bindString(16, photos); } - + String position = entity.getPosition(); if (position != null) { stmt.bindString(17, position); } - + String staff = entity.getStaff(); if (staff != null) { stmt.bindString(18, staff); } - + String tel = entity.getTel(); if (tel != null) { stmt.bindString(19, tel); } - + String ts = entity.getTs(); if (ts != null) { stmt.bindString(20, ts); } - + String valid = entity.getValid(); if (valid != null) { stmt.bindString(21, valid); } - + String watchData = entity.getWatchData(); if (watchData != null) { stmt.bindString(22, watchData); } - + String wellCode = entity.getWellCode(); if (wellCode != null) { stmt.bindString(23, wellCode); } - + String wellName = entity.getWellName(); if (wellName != null) { stmt.bindString(24, wellName); } - + String wellType = entity.getWellType(); if (wellType != null) { stmt.bindString(25, wellType); } - + String wellTypeName = entity.getWellTypeName(); if (wellTypeName != null) { stmt.bindString(26, wellTypeName); @@ -242,132 +237,132 @@ @Override protected final void bindValues(SQLiteStatement stmt, MapWellLocalBean entity) { stmt.clearBindings(); - + Long kId = entity.getKId(); if (kId != null) { stmt.bindLong(1, kId); } - + String area = entity.getArea(); if (area != null) { stmt.bindString(2, area); } - + String bfzt = entity.getBfzt(); if (bfzt != null) { stmt.bindString(3, bfzt); } - + String bfztName = entity.getBfztName(); if (bfztName != null) { stmt.bindString(4, bfztName); } - + String coordinateX = entity.getCoordinateX(); if (coordinateX != null) { stmt.bindString(5, coordinateX); } - + String coordinateY = entity.getCoordinateY(); if (coordinateY != null) { stmt.bindString(6, coordinateY); } - + String deep = entity.getDeep(); if (deep != null) { stmt.bindString(7, deep); } - + String deptName = entity.getDeptName(); if (deptName != null) { stmt.bindString(8, deptName); } - + String deptid = entity.getDeptid(); if (deptid != null) { stmt.bindString(9, deptid); } - + String id = entity.getId(); if (id != null) { stmt.bindString(10, id); } - + String latBaidu = entity.getLatBaidu(); if (latBaidu != null) { stmt.bindString(11, latBaidu); } - + String latGaode = entity.getLatGaode(); if (latGaode != null) { stmt.bindString(12, latGaode); } - + String lngBaidu = entity.getLngBaidu(); if (lngBaidu != null) { stmt.bindString(13, lngBaidu); } - + String lngGaode = entity.getLngGaode(); if (lngGaode != null) { stmt.bindString(14, lngGaode); } - + String notes = entity.getNotes(); if (notes != null) { stmt.bindString(15, notes); } - + String photos = entity.getPhotos(); if (photos != null) { stmt.bindString(16, photos); } - + String position = entity.getPosition(); if (position != null) { stmt.bindString(17, position); } - + String staff = entity.getStaff(); if (staff != null) { stmt.bindString(18, staff); } - + String tel = entity.getTel(); if (tel != null) { stmt.bindString(19, tel); } - + String ts = entity.getTs(); if (ts != null) { stmt.bindString(20, ts); } - + String valid = entity.getValid(); if (valid != null) { stmt.bindString(21, valid); } - + String watchData = entity.getWatchData(); if (watchData != null) { stmt.bindString(22, watchData); } - + String wellCode = entity.getWellCode(); if (wellCode != null) { stmt.bindString(23, wellCode); } - + String wellName = entity.getWellName(); if (wellName != null) { stmt.bindString(24, wellName); } - + String wellType = entity.getWellType(); if (wellType != null) { stmt.bindString(25, wellType); } - + String wellTypeName = entity.getWellTypeName(); if (wellTypeName != null) { stmt.bindString(26, wellTypeName); @@ -377,41 +372,41 @@ @Override public Long readKey(Cursor cursor, int offset) { return cursor.isNull(offset + 0) ? null : cursor.getLong(offset + 0); - } + } @Override public MapWellLocalBean readEntity(Cursor cursor, int offset) { MapWellLocalBean entity = new MapWellLocalBean( // - cursor.isNull(offset + 0) ? null : cursor.getLong(offset + 0), // kId - cursor.isNull(offset + 1) ? null : cursor.getString(offset + 1), // area - cursor.isNull(offset + 2) ? null : cursor.getString(offset + 2), // bfzt - cursor.isNull(offset + 3) ? null : cursor.getString(offset + 3), // bfztName - cursor.isNull(offset + 4) ? null : cursor.getString(offset + 4), // coordinateX - cursor.isNull(offset + 5) ? null : cursor.getString(offset + 5), // coordinateY - cursor.isNull(offset + 6) ? null : cursor.getString(offset + 6), // deep - cursor.isNull(offset + 7) ? null : cursor.getString(offset + 7), // deptName - cursor.isNull(offset + 8) ? null : cursor.getString(offset + 8), // deptid - cursor.isNull(offset + 9) ? null : cursor.getString(offset + 9), // id - cursor.isNull(offset + 10) ? null : cursor.getString(offset + 10), // latBaidu - cursor.isNull(offset + 11) ? null : cursor.getString(offset + 11), // latGaode - cursor.isNull(offset + 12) ? null : cursor.getString(offset + 12), // lngBaidu - cursor.isNull(offset + 13) ? null : cursor.getString(offset + 13), // lngGaode - cursor.isNull(offset + 14) ? null : cursor.getString(offset + 14), // notes - cursor.isNull(offset + 15) ? null : cursor.getString(offset + 15), // photos - cursor.isNull(offset + 16) ? null : cursor.getString(offset + 16), // position - cursor.isNull(offset + 17) ? null : cursor.getString(offset + 17), // staff - cursor.isNull(offset + 18) ? null : cursor.getString(offset + 18), // tel - cursor.isNull(offset + 19) ? null : cursor.getString(offset + 19), // ts - cursor.isNull(offset + 20) ? null : cursor.getString(offset + 20), // valid - cursor.isNull(offset + 21) ? null : cursor.getString(offset + 21), // watchData - cursor.isNull(offset + 22) ? null : cursor.getString(offset + 22), // wellCode - cursor.isNull(offset + 23) ? null : cursor.getString(offset + 23), // wellName - cursor.isNull(offset + 24) ? null : cursor.getString(offset + 24), // wellType - cursor.isNull(offset + 25) ? null : cursor.getString(offset + 25) // wellTypeName + cursor.isNull(offset + 0) ? null : cursor.getLong(offset + 0), // kId + cursor.isNull(offset + 1) ? null : cursor.getString(offset + 1), // area + cursor.isNull(offset + 2) ? null : cursor.getString(offset + 2), // bfzt + cursor.isNull(offset + 3) ? null : cursor.getString(offset + 3), // bfztName + cursor.isNull(offset + 4) ? null : cursor.getString(offset + 4), // coordinateX + cursor.isNull(offset + 5) ? null : cursor.getString(offset + 5), // coordinateY + cursor.isNull(offset + 6) ? null : cursor.getString(offset + 6), // deep + cursor.isNull(offset + 7) ? null : cursor.getString(offset + 7), // deptName + cursor.isNull(offset + 8) ? null : cursor.getString(offset + 8), // deptid + cursor.isNull(offset + 9) ? null : cursor.getString(offset + 9), // id + cursor.isNull(offset + 10) ? null : cursor.getString(offset + 10), // latBaidu + cursor.isNull(offset + 11) ? null : cursor.getString(offset + 11), // latGaode + cursor.isNull(offset + 12) ? null : cursor.getString(offset + 12), // lngBaidu + cursor.isNull(offset + 13) ? null : cursor.getString(offset + 13), // lngGaode + cursor.isNull(offset + 14) ? null : cursor.getString(offset + 14), // notes + cursor.isNull(offset + 15) ? null : cursor.getString(offset + 15), // photos + cursor.isNull(offset + 16) ? null : cursor.getString(offset + 16), // position + cursor.isNull(offset + 17) ? null : cursor.getString(offset + 17), // staff + cursor.isNull(offset + 18) ? null : cursor.getString(offset + 18), // tel + cursor.isNull(offset + 19) ? null : cursor.getString(offset + 19), // ts + cursor.isNull(offset + 20) ? null : cursor.getString(offset + 20), // valid + cursor.isNull(offset + 21) ? null : cursor.getString(offset + 21), // watchData + cursor.isNull(offset + 22) ? null : cursor.getString(offset + 22), // wellCode + cursor.isNull(offset + 23) ? null : cursor.getString(offset + 23), // wellName + cursor.isNull(offset + 24) ? null : cursor.getString(offset + 24), // wellType + cursor.isNull(offset + 25) ? null : cursor.getString(offset + 25) // wellTypeName ); return entity; } - + @Override public void readEntity(Cursor cursor, MapWellLocalBean entity, int offset) { entity.setKId(cursor.isNull(offset + 0) ? null : cursor.getLong(offset + 0)); @@ -440,17 +435,17 @@ entity.setWellName(cursor.isNull(offset + 23) ? null : cursor.getString(offset + 23)); entity.setWellType(cursor.isNull(offset + 24) ? null : cursor.getString(offset + 24)); entity.setWellTypeName(cursor.isNull(offset + 25) ? null : cursor.getString(offset + 25)); - } - + } + @Override protected final Long updateKeyAfterInsert(MapWellLocalBean entity, long rowId) { entity.setKId(rowId); return rowId; } - + @Override public Long getKey(MapWellLocalBean entity) { - if (entity != null) { + if(entity != null) { return entity.getKId(); } else { return null; @@ -466,5 +461,5 @@ protected final boolean isEntityUpdateable() { return true; } - + } diff --git a/app/src/main/java/com/casic/app/smartwell/greendao/NoticeLocaleBeanDao.java b/app/src/main/java/com/casic/app/smartwell/greendao/NoticeLocaleBeanDao.java index 64312ed..deb2d49 100644 --- a/app/src/main/java/com/casic/app/smartwell/greendao/NoticeLocaleBeanDao.java +++ b/app/src/main/java/com/casic/app/smartwell/greendao/NoticeLocaleBeanDao.java @@ -12,10 +12,9 @@ import org.greenrobot.greendao.internal.DaoConfig; // THIS CODE IS GENERATED BY greenDAO, DO NOT EDIT. - -/** +/** * DAO for table "NOTICE_LOCALE_BEAN". - */ +*/ public class NoticeLocaleBeanDao extends AbstractDao { public static final String TABLENAME = "NOTICE_LOCALE_BEAN"; @@ -43,16 +42,14 @@ public NoticeLocaleBeanDao(DaoConfig config) { super(config); } - + public NoticeLocaleBeanDao(DaoConfig config, DaoSession daoSession) { super(config, daoSession); } - /** - * Creates the underlying database table. - */ + /** Creates the underlying database table. */ public static void createTable(Database db, boolean ifNotExists) { - String constraint = ifNotExists ? "IF NOT EXISTS " : ""; + String constraint = ifNotExists? "IF NOT EXISTS ": ""; db.execSQL("CREATE TABLE " + constraint + "\"NOTICE_LOCALE_BEAN\" (" + // "\"_id\" INTEGER PRIMARY KEY AUTOINCREMENT ," + // 0: id "\"MESSAGE_ID\" TEXT UNIQUE ," + // 1: messageId @@ -68,9 +65,7 @@ "\"NOTICE_TIME\" TEXT);"); // 11: noticeTime } - /** - * Drops the underlying database table. - */ + /** Drops the underlying database table. */ public static void dropTable(Database db, boolean ifExists) { String sql = "DROP TABLE " + (ifExists ? "IF EXISTS " : "") + "\"NOTICE_LOCALE_BEAN\""; db.execSQL(sql); @@ -79,62 +74,62 @@ @Override protected final void bindValues(DatabaseStatement stmt, NoticeLocaleBean entity) { stmt.clearBindings(); - + Long id = entity.getId(); if (id != null) { stmt.bindLong(1, id); } - + String messageId = entity.getMessageId(); if (messageId != null) { stmt.bindString(2, messageId); } - + String appid = entity.getAppid(); if (appid != null) { stmt.bindString(3, appid); } - + String clientId = entity.getClientId(); if (clientId != null) { stmt.bindString(4, clientId); } - + String taskId = entity.getTaskId(); if (taskId != null) { stmt.bindString(5, taskId); } - + String userId = entity.getUserId(); if (userId != null) { stmt.bindString(6, userId); } - + String title = entity.getTitle(); if (title != null) { stmt.bindString(7, title); } - + String content = entity.getContent(); if (content != null) { stmt.bindString(8, content); } - + String deviceCode = entity.getDeviceCode(); if (deviceCode != null) { stmt.bindString(9, deviceCode); } - + String jobId = entity.getJobId(); if (jobId != null) { stmt.bindString(10, jobId); } - + String isRead = entity.getIsRead(); if (isRead != null) { stmt.bindString(11, isRead); } - + String noticeTime = entity.getNoticeTime(); if (noticeTime != null) { stmt.bindString(12, noticeTime); @@ -144,62 +139,62 @@ @Override protected final void bindValues(SQLiteStatement stmt, NoticeLocaleBean entity) { stmt.clearBindings(); - + Long id = entity.getId(); if (id != null) { stmt.bindLong(1, id); } - + String messageId = entity.getMessageId(); if (messageId != null) { stmt.bindString(2, messageId); } - + String appid = entity.getAppid(); if (appid != null) { stmt.bindString(3, appid); } - + String clientId = entity.getClientId(); if (clientId != null) { stmt.bindString(4, clientId); } - + String taskId = entity.getTaskId(); if (taskId != null) { stmt.bindString(5, taskId); } - + String userId = entity.getUserId(); if (userId != null) { stmt.bindString(6, userId); } - + String title = entity.getTitle(); if (title != null) { stmt.bindString(7, title); } - + String content = entity.getContent(); if (content != null) { stmt.bindString(8, content); } - + String deviceCode = entity.getDeviceCode(); if (deviceCode != null) { stmt.bindString(9, deviceCode); } - + String jobId = entity.getJobId(); if (jobId != null) { stmt.bindString(10, jobId); } - + String isRead = entity.getIsRead(); if (isRead != null) { stmt.bindString(11, isRead); } - + String noticeTime = entity.getNoticeTime(); if (noticeTime != null) { stmt.bindString(12, noticeTime); @@ -209,27 +204,27 @@ @Override public Long readKey(Cursor cursor, int offset) { return cursor.isNull(offset + 0) ? null : cursor.getLong(offset + 0); - } + } @Override public NoticeLocaleBean readEntity(Cursor cursor, int offset) { NoticeLocaleBean entity = new NoticeLocaleBean( // - cursor.isNull(offset + 0) ? null : cursor.getLong(offset + 0), // id - cursor.isNull(offset + 1) ? null : cursor.getString(offset + 1), // messageId - cursor.isNull(offset + 2) ? null : cursor.getString(offset + 2), // appid - cursor.isNull(offset + 3) ? null : cursor.getString(offset + 3), // clientId - cursor.isNull(offset + 4) ? null : cursor.getString(offset + 4), // taskId - cursor.isNull(offset + 5) ? null : cursor.getString(offset + 5), // userId - cursor.isNull(offset + 6) ? null : cursor.getString(offset + 6), // title - cursor.isNull(offset + 7) ? null : cursor.getString(offset + 7), // content - cursor.isNull(offset + 8) ? null : cursor.getString(offset + 8), // deviceCode - cursor.isNull(offset + 9) ? null : cursor.getString(offset + 9), // jobId - cursor.isNull(offset + 10) ? null : cursor.getString(offset + 10), // isRead - cursor.isNull(offset + 11) ? null : cursor.getString(offset + 11) // noticeTime + cursor.isNull(offset + 0) ? null : cursor.getLong(offset + 0), // id + cursor.isNull(offset + 1) ? null : cursor.getString(offset + 1), // messageId + cursor.isNull(offset + 2) ? null : cursor.getString(offset + 2), // appid + cursor.isNull(offset + 3) ? null : cursor.getString(offset + 3), // clientId + cursor.isNull(offset + 4) ? null : cursor.getString(offset + 4), // taskId + cursor.isNull(offset + 5) ? null : cursor.getString(offset + 5), // userId + cursor.isNull(offset + 6) ? null : cursor.getString(offset + 6), // title + cursor.isNull(offset + 7) ? null : cursor.getString(offset + 7), // content + cursor.isNull(offset + 8) ? null : cursor.getString(offset + 8), // deviceCode + cursor.isNull(offset + 9) ? null : cursor.getString(offset + 9), // jobId + cursor.isNull(offset + 10) ? null : cursor.getString(offset + 10), // isRead + cursor.isNull(offset + 11) ? null : cursor.getString(offset + 11) // noticeTime ); return entity; } - + @Override public void readEntity(Cursor cursor, NoticeLocaleBean entity, int offset) { entity.setId(cursor.isNull(offset + 0) ? null : cursor.getLong(offset + 0)); @@ -244,17 +239,17 @@ entity.setJobId(cursor.isNull(offset + 9) ? null : cursor.getString(offset + 9)); entity.setIsRead(cursor.isNull(offset + 10) ? null : cursor.getString(offset + 10)); entity.setNoticeTime(cursor.isNull(offset + 11) ? null : cursor.getString(offset + 11)); - } - + } + @Override protected final Long updateKeyAfterInsert(NoticeLocaleBean entity, long rowId) { entity.setId(rowId); return rowId; } - + @Override public Long getKey(NoticeLocaleBean entity) { - if (entity != null) { + if(entity != null) { return entity.getId(); } else { return null; @@ -270,5 +265,5 @@ protected final boolean isEntityUpdateable() { return true; } - + } diff --git a/app/src/main/java/com/casic/app/smartwell/greendao/PipeLocalBeanDao.java b/app/src/main/java/com/casic/app/smartwell/greendao/PipeLocalBeanDao.java index aab4d3f..df5515a 100644 --- a/app/src/main/java/com/casic/app/smartwell/greendao/PipeLocalBeanDao.java +++ b/app/src/main/java/com/casic/app/smartwell/greendao/PipeLocalBeanDao.java @@ -12,10 +12,9 @@ import org.greenrobot.greendao.internal.DaoConfig; // THIS CODE IS GENERATED BY greenDAO, DO NOT EDIT. - -/** +/** * DAO for table "PIPE_LOCAL_BEAN". - */ +*/ public class PipeLocalBeanDao extends AbstractDao { public static final String TABLENAME = "PIPE_LOCAL_BEAN"; @@ -37,16 +36,14 @@ public PipeLocalBeanDao(DaoConfig config) { super(config); } - + public PipeLocalBeanDao(DaoConfig config, DaoSession daoSession) { super(config, daoSession); } - /** - * Creates the underlying database table. - */ + /** Creates the underlying database table. */ public static void createTable(Database db, boolean ifNotExists) { - String constraint = ifNotExists ? "IF NOT EXISTS " : ""; + String constraint = ifNotExists? "IF NOT EXISTS ": ""; db.execSQL("CREATE TABLE " + constraint + "\"PIPE_LOCAL_BEAN\" (" + // "\"_id\" INTEGER PRIMARY KEY AUTOINCREMENT ," + // 0: id "\"PIPE_CODE\" TEXT," + // 1: pipeCode @@ -56,9 +53,7 @@ "\"START_LONGITUDE_GD\" TEXT);"); // 5: startLongitudeGd } - /** - * Drops the underlying database table. - */ + /** Drops the underlying database table. */ public static void dropTable(Database db, boolean ifExists) { String sql = "DROP TABLE " + (ifExists ? "IF EXISTS " : "") + "\"PIPE_LOCAL_BEAN\""; db.execSQL(sql); @@ -67,32 +62,32 @@ @Override protected final void bindValues(DatabaseStatement stmt, PipeLocalBean entity) { stmt.clearBindings(); - + Long id = entity.getId(); if (id != null) { stmt.bindLong(1, id); } - + String pipeCode = entity.getPipeCode(); if (pipeCode != null) { stmt.bindString(2, pipeCode); } - + String endLatitudeGd = entity.getEndLatitudeGd(); if (endLatitudeGd != null) { stmt.bindString(3, endLatitudeGd); } - + String endLongitudeGd = entity.getEndLongitudeGd(); if (endLongitudeGd != null) { stmt.bindString(4, endLongitudeGd); } - + String startLatitudeGd = entity.getStartLatitudeGd(); if (startLatitudeGd != null) { stmt.bindString(5, startLatitudeGd); } - + String startLongitudeGd = entity.getStartLongitudeGd(); if (startLongitudeGd != null) { stmt.bindString(6, startLongitudeGd); @@ -102,32 +97,32 @@ @Override protected final void bindValues(SQLiteStatement stmt, PipeLocalBean entity) { stmt.clearBindings(); - + Long id = entity.getId(); if (id != null) { stmt.bindLong(1, id); } - + String pipeCode = entity.getPipeCode(); if (pipeCode != null) { stmt.bindString(2, pipeCode); } - + String endLatitudeGd = entity.getEndLatitudeGd(); if (endLatitudeGd != null) { stmt.bindString(3, endLatitudeGd); } - + String endLongitudeGd = entity.getEndLongitudeGd(); if (endLongitudeGd != null) { stmt.bindString(4, endLongitudeGd); } - + String startLatitudeGd = entity.getStartLatitudeGd(); if (startLatitudeGd != null) { stmt.bindString(5, startLatitudeGd); } - + String startLongitudeGd = entity.getStartLongitudeGd(); if (startLongitudeGd != null) { stmt.bindString(6, startLongitudeGd); @@ -137,21 +132,21 @@ @Override public Long readKey(Cursor cursor, int offset) { return cursor.isNull(offset + 0) ? null : cursor.getLong(offset + 0); - } + } @Override public PipeLocalBean readEntity(Cursor cursor, int offset) { PipeLocalBean entity = new PipeLocalBean( // - cursor.isNull(offset + 0) ? null : cursor.getLong(offset + 0), // id - cursor.isNull(offset + 1) ? null : cursor.getString(offset + 1), // pipeCode - cursor.isNull(offset + 2) ? null : cursor.getString(offset + 2), // endLatitudeGd - cursor.isNull(offset + 3) ? null : cursor.getString(offset + 3), // endLongitudeGd - cursor.isNull(offset + 4) ? null : cursor.getString(offset + 4), // startLatitudeGd - cursor.isNull(offset + 5) ? null : cursor.getString(offset + 5) // startLongitudeGd + cursor.isNull(offset + 0) ? null : cursor.getLong(offset + 0), // id + cursor.isNull(offset + 1) ? null : cursor.getString(offset + 1), // pipeCode + cursor.isNull(offset + 2) ? null : cursor.getString(offset + 2), // endLatitudeGd + cursor.isNull(offset + 3) ? null : cursor.getString(offset + 3), // endLongitudeGd + cursor.isNull(offset + 4) ? null : cursor.getString(offset + 4), // startLatitudeGd + cursor.isNull(offset + 5) ? null : cursor.getString(offset + 5) // startLongitudeGd ); return entity; } - + @Override public void readEntity(Cursor cursor, PipeLocalBean entity, int offset) { entity.setId(cursor.isNull(offset + 0) ? null : cursor.getLong(offset + 0)); @@ -160,17 +155,17 @@ entity.setEndLongitudeGd(cursor.isNull(offset + 3) ? null : cursor.getString(offset + 3)); entity.setStartLatitudeGd(cursor.isNull(offset + 4) ? null : cursor.getString(offset + 4)); entity.setStartLongitudeGd(cursor.isNull(offset + 5) ? null : cursor.getString(offset + 5)); - } - + } + @Override protected final Long updateKeyAfterInsert(PipeLocalBean entity, long rowId) { entity.setId(rowId); return rowId; } - + @Override public Long getKey(PipeLocalBean entity) { - if (entity != null) { + if(entity != null) { return entity.getId(); } else { return null; @@ -186,5 +181,5 @@ protected final boolean isEntityUpdateable() { return true; } - + } diff --git a/app/src/main/java/com/casic/app/smartwell/view/ChangePasswordActivity.kt b/app/src/main/java/com/casic/app/smartwell/view/ChangePasswordActivity.kt index 8e41039..9f1dd40 100644 --- a/app/src/main/java/com/casic/app/smartwell/view/ChangePasswordActivity.kt +++ b/app/src/main/java/com/casic/app/smartwell/view/ChangePasswordActivity.kt @@ -14,7 +14,7 @@ import com.pengxh.kt.lite.extensions.show import com.pengxh.kt.lite.utils.ActivityStackManager import com.pengxh.kt.lite.utils.LoadState -import com.pengxh.kt.lite.utils.LoadingDialogHub +import com.pengxh.kt.lite.utils.LoadingDialog import com.pengxh.kt.lite.widget.TitleBarView import java.nio.charset.StandardCharsets @@ -46,15 +46,15 @@ override fun observeRequestState() { userViewModel.loadState.observe(this) { when (it) { - is LoadState.Loading -> LoadingDialogHub.show(this, "修改中,请稍后") + is LoadState.Loading -> LoadingDialog.show(this, "修改中,请稍后") is LoadState.Success -> { - LoadingDialogHub.dismiss() + LoadingDialog.dismiss() AuthenticationHelper.removeToken() this.navigatePageTo() ActivityStackManager.finishAllActivity() } - else -> LoadingDialogHub.dismiss() + else -> LoadingDialog.dismiss() } } } diff --git a/app/src/main/java/com/casic/app/smartwell/view/DeployedWellActivity.kt b/app/src/main/java/com/casic/app/smartwell/view/DeployedWellActivity.kt index fb4339c..28a5078 100644 --- a/app/src/main/java/com/casic/app/smartwell/view/DeployedWellActivity.kt +++ b/app/src/main/java/com/casic/app/smartwell/view/DeployedWellActivity.kt @@ -83,8 +83,8 @@ } //添加分割线 - binding.deployedListView.addItemDecoration( - RecyclerViewItemOffsets(0, 5, 0, 5) + binding.recyclerView.addItemDecoration( + RecyclerViewItemOffsets(0, 7, 0, 7) ) } @@ -149,12 +149,11 @@ } else { item.deep.toString() + "m" } - viewHolder.setText(R.id.wellNameView, item.wellName) + viewHolder.setText(R.id.wellTypeView, item.wellTypeName) .setText(R.id.wellDepthView, "深:${deep}") .setText(R.id.wellCodeView, "点位编号:${item.wellCode}") - .setText(R.id.wellTypeView, "点位类型:${item.wellTypeName}") .setText(R.id.ownerShipView, "权属单位:${item.deptName}") - .setText(R.id.wellLocationView, "点位置:${item.position}") + .setText(R.id.wellLocationView, "点位位置:${item.position}") .setOnClickListener( R.id.operationButton, object : View.OnClickListener { override fun onClick(v: View?) { @@ -207,7 +206,7 @@ }) } } - binding.deployedListView.adapter = deployAdapter + binding.recyclerView.adapter = deployAdapter deployAdapter.setOnItemClickedListener(object : NormalRecyclerAdapter.OnItemClickedListener { override fun onItemClicked(position: Int, t: WellListModel.DataBean.RowsBean) { diff --git a/app/src/main/java/com/casic/app/smartwell/view/LoginActivity.kt b/app/src/main/java/com/casic/app/smartwell/view/LoginActivity.kt index e4bb0e3..834527b 100644 --- a/app/src/main/java/com/casic/app/smartwell/view/LoginActivity.kt +++ b/app/src/main/java/com/casic/app/smartwell/view/LoginActivity.kt @@ -21,7 +21,7 @@ import com.pengxh.kt.lite.extensions.navigatePageTo import com.pengxh.kt.lite.extensions.readAssetsFile import com.pengxh.kt.lite.extensions.show -import com.pengxh.kt.lite.utils.LoadingDialogHub +import com.pengxh.kt.lite.utils.LoadingDialog import com.pengxh.kt.lite.utils.SaveKeyValues import kotlinx.coroutines.Dispatchers import kotlinx.coroutines.launch @@ -106,11 +106,11 @@ override fun observeRequestState() { authenticateViewModel.loadState.observe(this) { - LoadingDialogHub.show(this, "登录中,请稍后") + LoadingDialog.show(this, "登录中,请稍后") } loginViewModel.loadState.observe(this) { - LoadingDialogHub.dismiss() + LoadingDialog.dismiss() } } diff --git a/app/src/main/java/com/casic/app/smartwell/view/OrderCompletedDetailActivity.kt b/app/src/main/java/com/casic/app/smartwell/view/OrderCompletedDetailActivity.kt index db8ad1f..75cd905 100644 --- a/app/src/main/java/com/casic/app/smartwell/view/OrderCompletedDetailActivity.kt +++ b/app/src/main/java/com/casic/app/smartwell/view/OrderCompletedDetailActivity.kt @@ -17,7 +17,7 @@ import com.pengxh.kt.lite.extensions.show import com.pengxh.kt.lite.utils.Constant import com.pengxh.kt.lite.utils.LoadState -import com.pengxh.kt.lite.utils.LoadingDialogHub +import com.pengxh.kt.lite.utils.LoadingDialog import com.pengxh.kt.lite.widget.TitleBarView import com.pengxh.kt.lite.widget.dialog.AlertMessageDialog @@ -44,7 +44,7 @@ } override fun initOnCreate(savedInstanceState: Bundle?) { - val jobId = intent.getStringExtra(Constant.INTENT_PARAM)!! + val jobId = intent.getStringExtra(Constant.INTENT_PARAM_KEY)!! orderViewModel = ViewModelProvider(this)[OrderViewModel::class.java] orderViewModel.getWorkOrderDetail(jobId) orderViewModel.detailModel.observe(this) { @@ -154,8 +154,8 @@ override fun observeRequestState() { orderViewModel.loadState.observe(this) { when (it) { - is LoadState.Loading -> LoadingDialogHub.show(this, "数据加载中,请稍后") - else -> LoadingDialogHub.dismiss() + is LoadState.Loading -> LoadingDialog.show(this, "数据加载中,请稍后") + else -> LoadingDialog.dismiss() } } } diff --git a/app/src/main/java/com/casic/app/smartwell/view/OrderInHandleDetailActivity.kt b/app/src/main/java/com/casic/app/smartwell/view/OrderInHandleDetailActivity.kt index d70a979..04a7d5d 100644 --- a/app/src/main/java/com/casic/app/smartwell/view/OrderInHandleDetailActivity.kt +++ b/app/src/main/java/com/casic/app/smartwell/view/OrderInHandleDetailActivity.kt @@ -38,7 +38,7 @@ import com.pengxh.kt.lite.extensions.show import com.pengxh.kt.lite.utils.Constant import com.pengxh.kt.lite.utils.LoadState -import com.pengxh.kt.lite.utils.LoadingDialogHub +import com.pengxh.kt.lite.utils.LoadingDialog import com.pengxh.kt.lite.widget.TitleBarView import com.pengxh.kt.lite.widget.dialog.AlertControlDialog import com.pengxh.kt.lite.widget.dialog.AlertMessageDialog @@ -93,7 +93,7 @@ ) binding.addImageRecyclerView.adapter = imageAdapter - val jobId = intent.getStringExtra(Constant.INTENT_PARAM)!!//初始化图片九宫格 + val jobId = intent.getStringExtra(Constant.INTENT_PARAM_KEY)!!//初始化图片九宫格 orderViewModel.getWorkOrderDetail(jobId) orderViewModel.detailModel.observe(this) { if (it.code == 200) { @@ -312,41 +312,41 @@ override fun observeRequestState() { orderViewModel.loadState.observe(this) { when (it) { - is LoadState.Loading -> LoadingDialogHub.show(this, "数据加载中,请稍后") - else -> LoadingDialogHub.dismiss() + is LoadState.Loading -> LoadingDialog.show(this, "数据加载中,请稍后") + else -> LoadingDialog.dismiss() } } uploadImageViewModel.loadState.observe(this) { when (it) { - LoadState.Loading -> LoadingDialogHub.show(this, "图片上传中,请稍后...") - else -> LoadingDialogHub.dismiss() + LoadState.Loading -> LoadingDialog.show(this, "图片上传中,请稍后...") + else -> LoadingDialog.dismiss() } } //转单状态处理 operationViewModel.loadState.observe(this) { when (it) { - is LoadState.Loading -> LoadingDialogHub.show(this, "转单中,请稍后") + is LoadState.Loading -> LoadingDialog.show(this, "转单中,请稍后") is LoadState.Success -> { - LoadingDialogHub.dismiss() + LoadingDialog.dismiss() this.finish() } - else -> LoadingDialogHub.dismiss() + else -> LoadingDialog.dismiss() } } //处理完成工单状态处理 operationViewModel.loadState.observe(this) { when (it) { - is LoadState.Loading -> LoadingDialogHub.show(this, "处理中,请稍后") + is LoadState.Loading -> LoadingDialog.show(this, "处理中,请稍后") is LoadState.Success -> { - LoadingDialogHub.dismiss() + LoadingDialog.dismiss() this.finish() } - else -> LoadingDialogHub.dismiss() + else -> LoadingDialog.dismiss() } } } diff --git a/app/src/main/java/com/casic/app/smartwell/view/OrderNotConfirmedDetailActivity.kt b/app/src/main/java/com/casic/app/smartwell/view/OrderNotConfirmedDetailActivity.kt index 8e036d2..687ec86 100644 --- a/app/src/main/java/com/casic/app/smartwell/view/OrderNotConfirmedDetailActivity.kt +++ b/app/src/main/java/com/casic/app/smartwell/view/OrderNotConfirmedDetailActivity.kt @@ -36,7 +36,7 @@ import com.pengxh.kt.lite.extensions.show import com.pengxh.kt.lite.utils.Constant import com.pengxh.kt.lite.utils.LoadState -import com.pengxh.kt.lite.utils.LoadingDialogHub +import com.pengxh.kt.lite.utils.LoadingDialog import com.pengxh.kt.lite.widget.TitleBarView import com.pengxh.kt.lite.widget.dialog.AlertControlDialog import com.pengxh.kt.lite.widget.dialog.AlertMessageDialog @@ -80,7 +80,7 @@ } override fun initOnCreate(savedInstanceState: Bundle?) { - val jobId = intent.getStringExtra(Constant.INTENT_PARAM)!! + val jobId = intent.getStringExtra(Constant.INTENT_PARAM_KEY)!! //初始化图片九宫格 //左外边距,左内边距,右内边距,右外边距 val viewWidth = getScreenWidth() - (10 + 10 + 10 + 10).dp2px(this) @@ -263,41 +263,41 @@ //数据加载状态处理 orderViewModel.loadState.observe(this) { when (it) { - is LoadState.Loading -> LoadingDialogHub.show(this, "数据加载中,请稍后") - else -> LoadingDialogHub.dismiss() + is LoadState.Loading -> LoadingDialog.show(this, "数据加载中,请稍后") + else -> LoadingDialog.dismiss() } } uploadImageViewModel.loadState.observe(this) { when (it) { - LoadState.Loading -> LoadingDialogHub.show(this, "图片上传中,请稍后") - else -> LoadingDialogHub.dismiss() + LoadState.Loading -> LoadingDialog.show(this, "图片上传中,请稍后") + else -> LoadingDialog.dismiss() } } //转单状态处理 operationViewModel.loadState.observe(this) { when (it) { - is LoadState.Loading -> LoadingDialogHub.show(this, "转单中,请稍后") + is LoadState.Loading -> LoadingDialog.show(this, "转单中,请稍后") is LoadState.Success -> { - LoadingDialogHub.dismiss() + LoadingDialog.dismiss() this.finish() } - else -> LoadingDialogHub.dismiss() + else -> LoadingDialog.dismiss() } } //确认工单状态处理 operationViewModel.loadState.observe(this) { when (it) { - is LoadState.Loading -> LoadingDialogHub.show(this, "处理中,请稍后") + is LoadState.Loading -> LoadingDialog.show(this, "处理中,请稍后") is LoadState.Success -> { - LoadingDialogHub.dismiss() + LoadingDialog.dismiss() this.finish() } - else -> LoadingDialogHub.dismiss() + else -> LoadingDialog.dismiss() } } } diff --git a/app/src/main/java/com/casic/app/smartwell/view/OrderNotProcessedDetailActivity.kt b/app/src/main/java/com/casic/app/smartwell/view/OrderNotProcessedDetailActivity.kt index d3f22dc..0c97a52 100644 --- a/app/src/main/java/com/casic/app/smartwell/view/OrderNotProcessedDetailActivity.kt +++ b/app/src/main/java/com/casic/app/smartwell/view/OrderNotProcessedDetailActivity.kt @@ -18,7 +18,7 @@ import com.pengxh.kt.lite.extensions.show import com.pengxh.kt.lite.utils.Constant import com.pengxh.kt.lite.utils.LoadState -import com.pengxh.kt.lite.utils.LoadingDialogHub +import com.pengxh.kt.lite.utils.LoadingDialog import com.pengxh.kt.lite.widget.TitleBarView import com.pengxh.kt.lite.widget.dialog.AlertControlDialog import com.pengxh.kt.lite.widget.dialog.AlertMessageDialog @@ -50,7 +50,7 @@ } override fun initOnCreate(savedInstanceState: Bundle?) { - this.jobId = intent.getStringExtra(Constant.INTENT_PARAM)!! + this.jobId = intent.getStringExtra(Constant.INTENT_PARAM_KEY)!! orderViewModel = ViewModelProvider(this)[OrderViewModel::class.java] operationViewModel = ViewModelProvider(this)[OperationViewModel::class.java] wellViewModel = ViewModelProvider(this)[WellViewModel::class.java] @@ -162,21 +162,21 @@ //数据加载状态处理 orderViewModel.loadState.observe(this) { when (it) { - is LoadState.Loading -> LoadingDialogHub.show(this, "数据加载中,请稍后") - else -> LoadingDialogHub.dismiss() + is LoadState.Loading -> LoadingDialog.show(this, "数据加载中,请稍后") + else -> LoadingDialog.dismiss() } } //接单状态处理 operationViewModel.loadState.observe(this) { when (it) { - is LoadState.Loading -> LoadingDialogHub.show(this, "接单中,请稍后") + is LoadState.Loading -> LoadingDialog.show(this, "接单中,请稍后") is LoadState.Success -> { - LoadingDialogHub.dismiss() + LoadingDialog.dismiss() this.finish() } - else -> LoadingDialogHub.dismiss() + else -> LoadingDialog.dismiss() } } } diff --git a/app/src/main/java/com/casic/app/smartwell/view/SearchResultActivity.kt b/app/src/main/java/com/casic/app/smartwell/view/SearchResultActivity.kt index 6a92917..4f3a674 100644 --- a/app/src/main/java/com/casic/app/smartwell/view/SearchResultActivity.kt +++ b/app/src/main/java/com/casic/app/smartwell/view/SearchResultActivity.kt @@ -19,7 +19,7 @@ import com.pengxh.kt.lite.extensions.show import com.pengxh.kt.lite.utils.Constant import com.pengxh.kt.lite.utils.LoadState -import com.pengxh.kt.lite.utils.LoadingDialogHub +import com.pengxh.kt.lite.utils.LoadingDialog import com.pengxh.kt.lite.utils.WeakReferenceHandler import com.pengxh.kt.lite.widget.TitleBarView import com.pengxh.kt.lite.widget.dialog.AlertControlDialog @@ -56,7 +56,7 @@ } override fun initOnCreate(savedInstanceState: Bundle?) { - args = intent.getStringArrayListExtra(Constant.INTENT_PARAM)!! + args = intent.getStringArrayListExtra(Constant.INTENT_PARAM_KEY)!! orderViewModel = ViewModelProvider(this)[OrderViewModel::class.java] operationViewModel = ViewModelProvider(this)[OperationViewModel::class.java] @@ -101,24 +101,24 @@ } } - binding.resultRecyclerView.addItemDecoration( - RecyclerViewItemOffsets(0, 5, 0, 5) + binding.recyclerView.addItemDecoration( + RecyclerViewItemOffsets(0, 7, 0, 7) ) } override fun observeRequestState() { orderViewModel.loadState.observe(this) { when (it) { - is LoadState.Loading -> LoadingDialogHub.show(this, "数据加载中,请稍后") - else -> LoadingDialogHub.dismiss() + is LoadState.Loading -> LoadingDialog.show(this, "数据加载中,请稍后") + else -> LoadingDialog.dismiss() } } //接单状态处理 operationViewModel.loadState.observe(this) { when (it) { - is LoadState.Loading -> LoadingDialogHub.show(this, "接单中,请稍后") + is LoadState.Loading -> LoadingDialog.show(this, "接单中,请稍后") is LoadState.Success -> { - LoadingDialogHub.dismiss() + LoadingDialog.dismiss() //接单成功之后刷新列表 dataBeans.removeAt(clickedPosition) searchResultAdapter.notifyItemRemoved(clickedPosition) @@ -127,7 +127,7 @@ ) } - else -> LoadingDialogHub.dismiss() + else -> LoadingDialog.dismiss() } } } @@ -162,7 +162,7 @@ } else { binding.emptyInclude.emptyView.hide() searchResultAdapter = SearchResultAdapter(this, dataBeans) - binding.resultRecyclerView.adapter = searchResultAdapter + binding.recyclerView.adapter = searchResultAdapter searchResultAdapter.setOnItemClickListener(object : SearchResultAdapter.OnItemClickListener { override fun onClicked(position: Int) { diff --git a/app/src/main/java/com/casic/app/smartwell/view/UnDeployWellActivity.kt b/app/src/main/java/com/casic/app/smartwell/view/UnDeployWellActivity.kt index 7f7cd3c..555c278 100644 --- a/app/src/main/java/com/casic/app/smartwell/view/UnDeployWellActivity.kt +++ b/app/src/main/java/com/casic/app/smartwell/view/UnDeployWellActivity.kt @@ -81,8 +81,8 @@ } } - binding.undeployListView.addItemDecoration( - RecyclerViewItemOffsets(0, 5, 0, 5) + binding.recyclerView.addItemDecoration( + RecyclerViewItemOffsets(0, 7, 0, 7) ) } @@ -147,12 +147,11 @@ } else { item.deep.toString() + "m" } - viewHolder.setText(R.id.wellNameView, item.wellName) + viewHolder.setText(R.id.wellTypeView, item.wellTypeName) .setText(R.id.wellDepthView, "深:${deep}") .setText(R.id.wellCodeView, "点位编号:${item.wellCode}") - .setText(R.id.wellTypeView, "点位类型:${item.wellTypeName}") .setText(R.id.ownerShipView, "权属单位:${item.deptName}") - .setText(R.id.wellLocationView, "点位置:${item.position}") + .setText(R.id.wellLocationView, "点位位置:${item.position}") .setOnClickListener( R.id.operationButton, object : View.OnClickListener { override fun onClick(v: View?) { @@ -185,7 +184,7 @@ ) } } - binding.undeployListView.adapter = unDeployAdapter + binding.recyclerView.adapter = unDeployAdapter unDeployAdapter.setOnItemClickedListener(object : NormalRecyclerAdapter.OnItemClickedListener { override fun onItemClicked(position: Int, t: WellListModel.DataBean.RowsBean) { diff --git a/app/src/main/java/com/casic/app/smartwell/view/WellDetailActivity.kt b/app/src/main/java/com/casic/app/smartwell/view/WellDetailActivity.kt index b50d067..eb8b468 100644 --- a/app/src/main/java/com/casic/app/smartwell/view/WellDetailActivity.kt +++ b/app/src/main/java/com/casic/app/smartwell/view/WellDetailActivity.kt @@ -16,7 +16,7 @@ import com.pengxh.kt.lite.extensions.show import com.pengxh.kt.lite.utils.Constant import com.pengxh.kt.lite.utils.LoadState -import com.pengxh.kt.lite.utils.LoadingDialogHub +import com.pengxh.kt.lite.utils.LoadingDialog import com.pengxh.kt.lite.widget.TitleBarView import com.pengxh.kt.lite.widget.dialog.AlertMessageDialog @@ -44,7 +44,7 @@ } override fun initOnCreate(savedInstanceState: Bundle?) { - val wellId = intent.getStringExtra(Constant.INTENT_PARAM)!! + val wellId = intent.getStringExtra(Constant.INTENT_PARAM_KEY)!! wellViewModel = ViewModelProvider(this)[WellViewModel::class.java] wellViewModel.getWellDetail(wellId) wellViewModel.wellDetailModel.observe(this) { @@ -132,8 +132,8 @@ override fun observeRequestState() { wellViewModel.loadState.observe(this) { when (it) { - is LoadState.Loading -> LoadingDialogHub.show(this, "数据加载中,请稍后") - else -> LoadingDialogHub.dismiss() + is LoadState.Loading -> LoadingDialog.show(this, "数据加载中,请稍后") + else -> LoadingDialog.dismiss() } } } diff --git a/app/src/main/java/com/casic/app/smartwell/view/WellManagementActivity.kt b/app/src/main/java/com/casic/app/smartwell/view/WellManagementActivity.kt index 084da95..457096b 100644 --- a/app/src/main/java/com/casic/app/smartwell/view/WellManagementActivity.kt +++ b/app/src/main/java/com/casic/app/smartwell/view/WellManagementActivity.kt @@ -94,8 +94,8 @@ } } - binding.wellListView.addItemDecoration( - RecyclerViewItemOffsets(0, 5, 0, 5) + binding.recyclerView.addItemDecoration( + RecyclerViewItemOffsets(0, 7, 0, 7) ) } @@ -175,13 +175,12 @@ } else { item.deep.toString() + "m" } - viewHolder.setText(R.id.wellNameView, item.wellName) + viewHolder.setText(R.id.wellTypeView, item.wellTypeName) .setText(R.id.wellStateView, "已${item.bfztName}") .setText(R.id.wellDepthView, "深:${deep}") .setText(R.id.wellCodeView, "点位编号:${item.wellCode}") - .setText(R.id.wellTypeView, "点位类型:${item.wellTypeName}") .setText(R.id.ownerShipView, "权属单位:${item.deptName}") - .setText(R.id.wellLocationView, "点位置:${item.position}") + .setText(R.id.wellLocationView, "点位位置:${item.position}") .setOnClickListener( R.id.navigationButton, object : View.OnClickListener { override fun onClick(v: View?) { @@ -200,7 +199,7 @@ ) } } - binding.wellListView.adapter = wellListAdapter + binding.recyclerView.adapter = wellListAdapter wellListAdapter.setOnItemClickedListener(object : NormalRecyclerAdapter.OnItemClickedListener { override fun onItemClicked(position: Int, t: WellListModel.DataBean.RowsBean) { diff --git a/app/src/main/java/com/casic/app/smartwell/view/WellMonitorActivity.kt b/app/src/main/java/com/casic/app/smartwell/view/WellMonitorActivity.kt index e3573eb..b87bdb7 100644 --- a/app/src/main/java/com/casic/app/smartwell/view/WellMonitorActivity.kt +++ b/app/src/main/java/com/casic/app/smartwell/view/WellMonitorActivity.kt @@ -11,7 +11,7 @@ import com.pengxh.kt.lite.base.KotlinBaseActivity import com.pengxh.kt.lite.utils.Constant import com.pengxh.kt.lite.utils.LoadState -import com.pengxh.kt.lite.utils.LoadingDialogHub +import com.pengxh.kt.lite.utils.LoadingDialog import com.pengxh.kt.lite.widget.TitleBarView class WellMonitorActivity : KotlinBaseActivity() { @@ -36,7 +36,7 @@ } override fun initOnCreate(savedInstanceState: Bundle?) { - val wellId = intent.getStringExtra(Constant.INTENT_PARAM)!! + val wellId = intent.getStringExtra(Constant.INTENT_PARAM_KEY)!! wellViewModel = ViewModelProvider(this)[WellViewModel::class.java] wellViewModel.getMonitorResult(wellId) wellViewModel.monitorModel.observe(this) { @@ -56,8 +56,8 @@ override fun observeRequestState() { wellViewModel.loadState.observe(this) { when (it) { - is LoadState.Loading -> LoadingDialogHub.show(this, "数据加载中,请稍后") - else -> LoadingDialogHub.dismiss() + is LoadState.Loading -> LoadingDialog.show(this, "数据加载中,请稍后") + else -> LoadingDialog.dismiss() } } } diff --git a/app/src/main/java/com/casic/app/smartwell/view/WellOperationActivity.kt b/app/src/main/java/com/casic/app/smartwell/view/WellOperationActivity.kt index 8d333bf..347ebb6 100644 --- a/app/src/main/java/com/casic/app/smartwell/view/WellOperationActivity.kt +++ b/app/src/main/java/com/casic/app/smartwell/view/WellOperationActivity.kt @@ -23,7 +23,7 @@ import com.pengxh.kt.lite.extensions.navigatePageTo import com.pengxh.kt.lite.extensions.show import com.pengxh.kt.lite.utils.LoadState -import com.pengxh.kt.lite.utils.LoadingDialogHub +import com.pengxh.kt.lite.utils.LoadingDialog import com.pengxh.kt.lite.utils.WeakReferenceHandler import com.pengxh.kt.lite.widget.dialog.AlertControlDialog @@ -109,8 +109,8 @@ } } - binding.operationListView.addItemDecoration( - RecyclerViewItemOffsets(0, 5, 0, 5) + binding.recyclerView.addItemDecoration( + RecyclerViewItemOffsets(0, 7, 0, 7) ) } @@ -123,13 +123,13 @@ override fun observeRequestState() { wellViewModel.loadState.observe(this) { when (it) { - is LoadState.Loading -> LoadingDialogHub.show(this, "处理中,请稍后") + is LoadState.Loading -> LoadingDialog.show(this, "处理中,请稍后") is LoadState.Success -> { - LoadingDialogHub.dismiss() + LoadingDialog.dismiss() wellOperationAdapter.notifyItemChanged(clickedPosition) } - else -> LoadingDialogHub.dismiss() + else -> LoadingDialog.dismiss() } } } @@ -203,24 +203,23 @@ if (item.bfztName == "布防") { viewHolder.setImageResource( R.id.wellStateView, R.drawable.bg_solid_text_green_radius_5 - ).setText(R.id.wellStateView, "撤防") + ).setText(R.id.operationButton, "撤防") } else { viewHolder.setImageResource( R.id.wellStateView, R.drawable.bg_solid_text_red_radius_5 - ).setText(R.id.wellStateView, "布防") + ).setText(R.id.operationButton, "布防") } val deep = if (item.deep.toString().isBlank()) { "未知" } else { item.deep.toString() + "m" } - viewHolder.setText(R.id.wellNameView, item.wellName) + viewHolder.setText(R.id.wellTypeView, item.wellTypeName) .setText(R.id.wellStateView, "已${item.bfztName}") .setText(R.id.wellDepthView, "深:${deep}") .setText(R.id.wellCodeView, "点位编号:${item.wellCode}") - .setText(R.id.wellTypeView, "点位类型:${item.wellTypeName}") .setText(R.id.ownerShipView, "权属单位:${item.deptName}") - .setText(R.id.wellLocationView, "点位置:${item.position}") + .setText(R.id.wellLocationView, "点位位置:${item.position}") .setOnClickListener( R.id.operationButton, object : View.OnClickListener { override fun onClick(v: View?) { @@ -280,7 +279,7 @@ ) } } - binding.operationListView.adapter = wellOperationAdapter + binding.recyclerView.adapter = wellOperationAdapter wellOperationAdapter.setOnItemClickedListener(object : NormalRecyclerAdapter.OnItemClickedListener { override fun onItemClicked(position: Int, t: WellListModel.DataBean.RowsBean) { diff --git a/app/src/main/res/drawable/ic_down.xml b/app/src/main/res/drawable/ic_down.xml index 20e6476..6987e6c 100644 --- a/app/src/main/res/drawable/ic_down.xml +++ b/app/src/main/res/drawable/ic_down.xml @@ -1,6 +1,6 @@ + + diff --git a/app/src/main/res/layout/activity_about_us.xml b/app/src/main/res/layout/activity_about_us.xml index 9091a00..d5fbd0d 100644 --- a/app/src/main/res/layout/activity_about_us.xml +++ b/app/src/main/res/layout/activity_about_us.xml @@ -12,13 +12,7 @@ android:layout_width="match_parent" android:layout_height="wrap_content" android:background="@color/mainThemeColor" - app:tbv_left_image="@drawable/ic_title_left" - app:tbv_only_show_title="false" - app:tbv_show_left_image="true" - app:tbv_show_right_image="false" - app:tbv_text="关于我们" - app:tbv_text_color="@color/white" - app:tbv_text_size="@dimen/sp_18" /> + app:tbv_text="关于我们" /> + app:tbv_text="修改密码" /> + app:tbv_text="布防列表" /> + app:tbv_text="帮助中心" /> + app:tbv_text="工单详情" /> + app:tbv_text="工单详情" /> + app:tbv_text="工单详情" /> + app:tbv_text="工单详情" /> + app:tbv_text="超时工单" /> + app:tbv_text="工单查询" /> + app:tbv_text="查询结果" /> + app:tbv_text="撤防列表" /> + app:tbv_text="个人资料" /> + app:tbv_text="点位详情" /> + app:tbv_text="监控内容" /> - - - - - - + android:layout_height="wrap_content" + android:background="@color/mainThemeColor" + app:tbv_show_left_image="false" + app:tbv_show_right_image="true" + app:tbv_text="首页" /> - + - + - - - - - - + android:layout_height="wrap_content" + android:background="@color/mainThemeColor" + app:tbv_right_image="@drawable/ic_search_white" + app:tbv_show_left_image="false" + app:tbv_show_right_image="true" + app:tbv_text="工单" /> - + + android:value="ee96d8b5e12de3fbb29949efd57418a8" /> () @@ -150,7 +158,7 @@ val cameraPosition = CameraPosition(centerLatLng, 14f, 0f, 0f) val cameraUpdate = CameraUpdateFactory.newCameraPosition(cameraPosition) withContext(Dispatchers.Main) { - LoadingDialogHub.dismiss() + LoadingDialog.dismiss() aMap.animateCamera(cameraUpdate, 1500, null) } } @@ -239,11 +247,6 @@ } override fun initEvent() { - binding.rightOptionView.setOnClickListener { - val x = binding.rightOptionView.width - easyPopupWindow.width - easyPopupWindow.showAsDropDown(binding.rightOptionView, x, 0) - } - //撤防点位 binding.unDeployedLayout.setOnClickListener { requireContext().navigatePageTo() @@ -263,11 +266,11 @@ override fun observeRequestState() { wellViewModel.loadState.observe(this) { when (it) { - is LoadState.Loading -> LoadingDialogHub.show( + is LoadState.Loading -> LoadingDialog.show( requireActivity(), "数据加载中,请稍后..." ) - else -> LoadingDialogHub.dismiss() + else -> LoadingDialog.dismiss() } } } @@ -376,7 +379,7 @@ }).build().show() } }) - infoPopup.showAsDropDown(binding.rightOptionView) +// infoPopup.showAsDropDown(binding.rightOptionView) } override fun onCameraChange(p0: CameraPosition?) { diff --git a/app/src/main/java/com/casic/app/smartwell/fragment/HomePageNoClusterFragment.kt b/app/src/main/java/com/casic/app/smartwell/fragment/HomePageNoClusterFragment.kt index 802426a..b25f743 100644 --- a/app/src/main/java/com/casic/app/smartwell/fragment/HomePageNoClusterFragment.kt +++ b/app/src/main/java/com/casic/app/smartwell/fragment/HomePageNoClusterFragment.kt @@ -38,8 +38,9 @@ import com.pengxh.kt.lite.extensions.navigatePageTo import com.pengxh.kt.lite.extensions.show import com.pengxh.kt.lite.utils.LoadState -import com.pengxh.kt.lite.utils.LoadingDialogHub +import com.pengxh.kt.lite.utils.LoadingDialog import com.pengxh.kt.lite.widget.EasyPopupWindow +import com.pengxh.kt.lite.widget.TitleBarView import com.pengxh.kt.lite.widget.dialog.AlertControlDialog import kotlinx.coroutines.Dispatchers import kotlinx.coroutines.launch @@ -78,7 +79,15 @@ override fun setupTopBarLayout() { binding.rootView.initImmersionBar(this, false, R.color.mainThemeColor) - binding.titleView.text = "首页" + binding.titleView.setOnClickListener(object : TitleBarView.OnClickListener { + override fun onLeftClick() { + + } + + override fun onRightClick() { + easyPopupWindow.showAsDropDown(binding.titleView, binding.titleView.width, 0) + } + }) } override fun initOnCreate(savedInstanceState: Bundle?) { @@ -112,7 +121,7 @@ //渲染井位置 lifecycleScope.launch(Dispatchers.Main) { - LoadingDialogHub.show(requireActivity(), "数据加载中,请稍后") + LoadingDialog.show(requireActivity(), "数据加载中,请稍后") withContext(Dispatchers.IO) { //取Well缓存 val allMarkerOptions = ArrayList() @@ -144,7 +153,7 @@ val cameraPosition = CameraPosition(centerLatLng, 14f, 0f, 0f) val cameraUpdate = CameraUpdateFactory.newCameraPosition(cameraPosition) withContext(Dispatchers.Main) { - LoadingDialogHub.dismiss() + LoadingDialog.dismiss() aMap.animateCamera(cameraUpdate, 1500, null) } } @@ -238,11 +247,6 @@ } override fun initEvent() { - binding.rightOptionView.setOnClickListener { - val x = binding.rightOptionView.width - easyPopupWindow.width - easyPopupWindow.showAsDropDown(binding.rightOptionView, x, 0) - } - //撤防点位 binding.unDeployedLayout.setOnClickListener { requireContext().navigatePageTo() @@ -262,11 +266,11 @@ override fun observeRequestState() { wellViewModel.loadState.observe(this) { when (it) { - is LoadState.Loading -> LoadingDialogHub.show( + is LoadState.Loading -> LoadingDialog.show( requireActivity(), "数据加载中,请稍后..." ) - else -> LoadingDialogHub.dismiss() + else -> LoadingDialog.dismiss() } } } diff --git a/app/src/main/java/com/casic/app/smartwell/fragment/MinePageFragment.kt b/app/src/main/java/com/casic/app/smartwell/fragment/MinePageFragment.kt index 09a570c..dcb48f8 100644 --- a/app/src/main/java/com/casic/app/smartwell/fragment/MinePageFragment.kt +++ b/app/src/main/java/com/casic/app/smartwell/fragment/MinePageFragment.kt @@ -35,7 +35,7 @@ import com.pengxh.kt.lite.utils.ActivityStackManager import com.pengxh.kt.lite.utils.FileDownloadManager import com.pengxh.kt.lite.utils.LoadState -import com.pengxh.kt.lite.utils.LoadingDialogHub +import com.pengxh.kt.lite.utils.LoadingDialog import com.pengxh.kt.lite.widget.dialog.AlertControlDialog import com.pengxh.kt.lite.widget.dialog.BottomActionSheet import kotlinx.coroutines.Dispatchers @@ -60,7 +60,6 @@ override fun setupTopBarLayout() { binding.rootView.initImmersionBar(this, false, R.color.mainThemeColor) - binding.titleInclude.titleView.text = "我的" } override fun initOnCreate(savedInstanceState: Bundle?) { @@ -155,27 +154,27 @@ override fun observeRequestState() { userViewModel.loadState.observe(this) { when (it) { - is LoadState.Loading -> LoadingDialogHub.show( + is LoadState.Loading -> LoadingDialog.show( requireActivity(), "检查版本中,请稍后" ) - else -> LoadingDialogHub.dismiss() + else -> LoadingDialog.dismiss() } } wellViewModel.loadState.observe(this) { when (it) { - is LoadState.Loading -> LoadingDialogHub.show( + is LoadState.Loading -> LoadingDialog.show( requireActivity(), "数据更新中,请稍后" ) is LoadState.Fail -> { - LoadingDialogHub.dismiss() + LoadingDialog.dismiss() "数据更新超时".show(requireContext()) } else -> { - LoadingDialogHub.dismiss() + LoadingDialog.dismiss() AlertControlDialog.Builder().setContext(requireContext()).setTitle("温馨提示") .setMessage("数据更新成功,请重启应用").setNegativeButton("取消") .setPositiveButton("确定").setOnDialogButtonClickListener(object : @@ -197,17 +196,17 @@ lineViewModel.loadState.observe(this) { when (it) { - is LoadState.Loading -> LoadingDialogHub.show( + is LoadState.Loading -> LoadingDialog.show( requireActivity(), "数据更新中,请稍后" ) is LoadState.Fail -> { - LoadingDialogHub.dismiss() + LoadingDialog.dismiss() "数据更新超时".show(requireContext()) } else -> { - LoadingDialogHub.dismiss() + LoadingDialog.dismiss() AlertControlDialog.Builder().setContext(requireContext()).setTitle("温馨提示") .setMessage("数据更新成功,请重启应用").setNegativeButton("取消") .setPositiveButton("确定").setOnDialogButtonClickListener(object : diff --git a/app/src/main/java/com/casic/app/smartwell/fragment/NoticePageFragment.kt b/app/src/main/java/com/casic/app/smartwell/fragment/NoticePageFragment.kt index 171b555..3c93f54 100644 --- a/app/src/main/java/com/casic/app/smartwell/fragment/NoticePageFragment.kt +++ b/app/src/main/java/com/casic/app/smartwell/fragment/NoticePageFragment.kt @@ -48,7 +48,6 @@ override fun setupTopBarLayout() { binding.rootView.initImmersionBar(this, false, R.color.mainThemeColor) - binding.titleInclude.titleView.text = "消息" } override fun initOnCreate(savedInstanceState: Bundle?) { diff --git a/app/src/main/java/com/casic/app/smartwell/fragment/OrderListFragment.kt b/app/src/main/java/com/casic/app/smartwell/fragment/OrderListFragment.kt index 93ff35b..5e38acb 100644 --- a/app/src/main/java/com/casic/app/smartwell/fragment/OrderListFragment.kt +++ b/app/src/main/java/com/casic/app/smartwell/fragment/OrderListFragment.kt @@ -12,6 +12,7 @@ import com.casic.app.smartwell.view.SearchOrderActivity import com.pengxh.kt.lite.base.KotlinBaseFragment import com.pengxh.kt.lite.extensions.navigatePageTo +import com.pengxh.kt.lite.widget.TitleBarView class OrderListFragment : KotlinBaseFragment() { @@ -25,15 +26,22 @@ } override fun initViewBinding( - inflater: LayoutInflater, - container: ViewGroup? + inflater: LayoutInflater, container: ViewGroup? ): FragmentOrderBinding { return FragmentOrderBinding.inflate(inflater, container, false) } override fun setupTopBarLayout() { binding.rootView.initImmersionBar(this, false, R.color.mainThemeColor) - binding.titleView.text = "工单" + binding.titleView.setOnClickListener(object : TitleBarView.OnClickListener { + override fun onLeftClick() { + + } + + override fun onRightClick() { + requireContext().navigatePageTo() + } + }) } override fun initOnCreate(savedInstanceState: Bundle?) { @@ -51,8 +59,6 @@ } override fun initEvent() { - binding.rightOptionView.setOnClickListener { - requireContext().navigatePageTo() - } + } } \ No newline at end of file diff --git a/app/src/main/java/com/casic/app/smartwell/fragment/OrderNotProcessedFragment.kt b/app/src/main/java/com/casic/app/smartwell/fragment/OrderNotProcessedFragment.kt index 0b3d09d..2b6f21d 100644 --- a/app/src/main/java/com/casic/app/smartwell/fragment/OrderNotProcessedFragment.kt +++ b/app/src/main/java/com/casic/app/smartwell/fragment/OrderNotProcessedFragment.kt @@ -18,7 +18,7 @@ import com.pengxh.kt.lite.extensions.navigatePageTo import com.pengxh.kt.lite.extensions.show import com.pengxh.kt.lite.utils.LoadState -import com.pengxh.kt.lite.utils.LoadingDialogHub +import com.pengxh.kt.lite.utils.LoadingDialog import com.pengxh.kt.lite.utils.WeakReferenceHandler import com.pengxh.kt.lite.widget.dialog.AlertControlDialog @@ -78,8 +78,8 @@ operationViewModel = ViewModelProvider(this)[OperationViewModel::class.java] - binding.notProcessedView.addItemDecoration( - RecyclerViewItemOffsets(0, 5, 0, 5) + binding.recyclerView.addItemDecoration( + RecyclerViewItemOffsets(0, 7, 0, 7) ) } @@ -87,9 +87,9 @@ //接单状态处理 operationViewModel.loadState.observe(this) { when (it) { - is LoadState.Loading -> LoadingDialogHub.show(requireActivity(), "接单中,请稍后") + is LoadState.Loading -> LoadingDialog.show(requireActivity(), "接单中,请稍后") is LoadState.Success -> { - LoadingDialogHub.dismiss() + LoadingDialog.dismiss() //接单成功之后刷新列表 dataBeans.removeAt(clickedPosition) notProcessedAdapter.notifyItemRemoved(clickedPosition) @@ -98,7 +98,7 @@ ) } - else -> LoadingDialogHub.dismiss() + else -> LoadingDialog.dismiss() } } } @@ -131,7 +131,7 @@ } else { binding.emptyInclude.emptyView.hide() notProcessedAdapter = OrderNotProcessedAdapter(requireContext(), dataBeans) - binding.notProcessedView.adapter = notProcessedAdapter + binding.recyclerView.adapter = notProcessedAdapter notProcessedAdapter.setOnItemClickListener(object : OrderNotProcessedAdapter.OnItemClickListener { override fun onClicked(position: Int) { diff --git a/app/src/main/java/com/casic/app/smartwell/fragment/OvertimeNotAcceptFragment.kt b/app/src/main/java/com/casic/app/smartwell/fragment/OvertimeNotAcceptFragment.kt index a198545..9b318ca 100644 --- a/app/src/main/java/com/casic/app/smartwell/fragment/OvertimeNotAcceptFragment.kt +++ b/app/src/main/java/com/casic/app/smartwell/fragment/OvertimeNotAcceptFragment.kt @@ -18,7 +18,7 @@ import com.pengxh.kt.lite.extensions.navigatePageTo import com.pengxh.kt.lite.extensions.show import com.pengxh.kt.lite.utils.LoadState -import com.pengxh.kt.lite.utils.LoadingDialogHub +import com.pengxh.kt.lite.utils.LoadingDialog import com.pengxh.kt.lite.utils.WeakReferenceHandler import com.pengxh.kt.lite.widget.dialog.AlertControlDialog @@ -81,8 +81,8 @@ operationViewModel = ViewModelProvider(this)[OperationViewModel::class.java] - binding.notProcessedView.addItemDecoration( - RecyclerViewItemOffsets(0, 5, 0, 5) + binding.recyclerView.addItemDecoration( + RecyclerViewItemOffsets(0, 7, 0, 7) ) } @@ -90,9 +90,9 @@ //接单状态处理 operationViewModel.loadState.observe(this) { when (it) { - is LoadState.Loading -> LoadingDialogHub.show(requireActivity(), "接单中,请稍后") + is LoadState.Loading -> LoadingDialog.show(requireActivity(), "接单中,请稍后") is LoadState.Success -> { - LoadingDialogHub.dismiss() + LoadingDialog.dismiss() //接单成功之后刷新列表 dataBeans.removeAt(clickedPosition) notProcessedAdapter.notifyItemRemoved(clickedPosition) @@ -101,7 +101,7 @@ ) } - else -> LoadingDialogHub.dismiss() + else -> LoadingDialog.dismiss() } } } @@ -134,7 +134,7 @@ } else { binding.emptyInclude.emptyView.hide() notProcessedAdapter = OrderNotProcessedAdapter(requireContext(), dataBeans) - binding.notProcessedView.adapter = notProcessedAdapter + binding.recyclerView.adapter = notProcessedAdapter notProcessedAdapter.setOnItemClickListener(object : OrderNotProcessedAdapter.OnItemClickListener { override fun onClicked(position: Int) { diff --git a/app/src/main/java/com/casic/app/smartwell/greendao/DaoMaster.java b/app/src/main/java/com/casic/app/smartwell/greendao/DaoMaster.java index fdcf3a7..1e52b74 100644 --- a/app/src/main/java/com/casic/app/smartwell/greendao/DaoMaster.java +++ b/app/src/main/java/com/casic/app/smartwell/greendao/DaoMaster.java @@ -13,25 +13,20 @@ // THIS CODE IS GENERATED BY greenDAO, DO NOT EDIT. - /** * Master of DAO (schema version 4): knows all DAOs. */ public class DaoMaster extends AbstractDaoMaster { public static final int SCHEMA_VERSION = 4; - /** - * Creates underlying database table using DAOs. - */ + /** Creates underlying database table using DAOs. */ public static void createAllTables(Database db, boolean ifNotExists) { MapWellLocalBeanDao.createTable(db, ifNotExists); NoticeLocaleBeanDao.createTable(db, ifNotExists); PipeLocalBeanDao.createTable(db, ifNotExists); } - /** - * Drops underlying database table using DAOs. - */ + /** Drops underlying database table using DAOs. */ public static void dropAllTables(Database db, boolean ifExists) { MapWellLocalBeanDao.dropTable(db, ifExists); NoticeLocaleBeanDao.dropTable(db, ifExists); @@ -86,9 +81,7 @@ } } - /** - * WARNING: Drops all table on Upgrade! Use only during development. - */ + /** WARNING: Drops all table on Upgrade! Use only during development. */ public static class DevOpenHelper extends OpenHelper { public DevOpenHelper(Context context, String name) { super(context, name); diff --git a/app/src/main/java/com/casic/app/smartwell/greendao/DaoSession.java b/app/src/main/java/com/casic/app/smartwell/greendao/DaoSession.java index 0b36d17..3e40e3b 100644 --- a/app/src/main/java/com/casic/app/smartwell/greendao/DaoSession.java +++ b/app/src/main/java/com/casic/app/smartwell/greendao/DaoSession.java @@ -16,7 +16,7 @@ /** * {@inheritDoc} - * + * * @see org.greenrobot.greendao.AbstractDaoSession */ public class DaoSession extends AbstractDaoSession { @@ -50,7 +50,7 @@ registerDao(NoticeLocaleBean.class, noticeLocaleBeanDao); registerDao(PipeLocalBean.class, pipeLocalBeanDao); } - + public void clear() { mapWellLocalBeanDaoConfig.clearIdentityScope(); noticeLocaleBeanDaoConfig.clearIdentityScope(); diff --git a/app/src/main/java/com/casic/app/smartwell/greendao/MapWellLocalBeanDao.java b/app/src/main/java/com/casic/app/smartwell/greendao/MapWellLocalBeanDao.java index 8908fda..407bc92 100644 --- a/app/src/main/java/com/casic/app/smartwell/greendao/MapWellLocalBeanDao.java +++ b/app/src/main/java/com/casic/app/smartwell/greendao/MapWellLocalBeanDao.java @@ -12,10 +12,9 @@ import org.greenrobot.greendao.internal.DaoConfig; // THIS CODE IS GENERATED BY greenDAO, DO NOT EDIT. - -/** +/** * DAO for table "MAP_WELL_LOCAL_BEAN". - */ +*/ public class MapWellLocalBeanDao extends AbstractDao { public static final String TABLENAME = "MAP_WELL_LOCAL_BEAN"; @@ -57,16 +56,14 @@ public MapWellLocalBeanDao(DaoConfig config) { super(config); } - + public MapWellLocalBeanDao(DaoConfig config, DaoSession daoSession) { super(config, daoSession); } - /** - * Creates the underlying database table. - */ + /** Creates the underlying database table. */ public static void createTable(Database db, boolean ifNotExists) { - String constraint = ifNotExists ? "IF NOT EXISTS " : ""; + String constraint = ifNotExists? "IF NOT EXISTS ": ""; db.execSQL("CREATE TABLE " + constraint + "\"MAP_WELL_LOCAL_BEAN\" (" + // "\"_id\" INTEGER PRIMARY KEY AUTOINCREMENT ," + // 0: kId "\"AREA\" TEXT," + // 1: area @@ -96,9 +93,7 @@ "\"WELL_TYPE_NAME\" TEXT);"); // 25: wellTypeName } - /** - * Drops the underlying database table. - */ + /** Drops the underlying database table. */ public static void dropTable(Database db, boolean ifExists) { String sql = "DROP TABLE " + (ifExists ? "IF EXISTS " : "") + "\"MAP_WELL_LOCAL_BEAN\""; db.execSQL(sql); @@ -107,132 +102,132 @@ @Override protected final void bindValues(DatabaseStatement stmt, MapWellLocalBean entity) { stmt.clearBindings(); - + Long kId = entity.getKId(); if (kId != null) { stmt.bindLong(1, kId); } - + String area = entity.getArea(); if (area != null) { stmt.bindString(2, area); } - + String bfzt = entity.getBfzt(); if (bfzt != null) { stmt.bindString(3, bfzt); } - + String bfztName = entity.getBfztName(); if (bfztName != null) { stmt.bindString(4, bfztName); } - + String coordinateX = entity.getCoordinateX(); if (coordinateX != null) { stmt.bindString(5, coordinateX); } - + String coordinateY = entity.getCoordinateY(); if (coordinateY != null) { stmt.bindString(6, coordinateY); } - + String deep = entity.getDeep(); if (deep != null) { stmt.bindString(7, deep); } - + String deptName = entity.getDeptName(); if (deptName != null) { stmt.bindString(8, deptName); } - + String deptid = entity.getDeptid(); if (deptid != null) { stmt.bindString(9, deptid); } - + String id = entity.getId(); if (id != null) { stmt.bindString(10, id); } - + String latBaidu = entity.getLatBaidu(); if (latBaidu != null) { stmt.bindString(11, latBaidu); } - + String latGaode = entity.getLatGaode(); if (latGaode != null) { stmt.bindString(12, latGaode); } - + String lngBaidu = entity.getLngBaidu(); if (lngBaidu != null) { stmt.bindString(13, lngBaidu); } - + String lngGaode = entity.getLngGaode(); if (lngGaode != null) { stmt.bindString(14, lngGaode); } - + String notes = entity.getNotes(); if (notes != null) { stmt.bindString(15, notes); } - + String photos = entity.getPhotos(); if (photos != null) { stmt.bindString(16, photos); } - + String position = entity.getPosition(); if (position != null) { stmt.bindString(17, position); } - + String staff = entity.getStaff(); if (staff != null) { stmt.bindString(18, staff); } - + String tel = entity.getTel(); if (tel != null) { stmt.bindString(19, tel); } - + String ts = entity.getTs(); if (ts != null) { stmt.bindString(20, ts); } - + String valid = entity.getValid(); if (valid != null) { stmt.bindString(21, valid); } - + String watchData = entity.getWatchData(); if (watchData != null) { stmt.bindString(22, watchData); } - + String wellCode = entity.getWellCode(); if (wellCode != null) { stmt.bindString(23, wellCode); } - + String wellName = entity.getWellName(); if (wellName != null) { stmt.bindString(24, wellName); } - + String wellType = entity.getWellType(); if (wellType != null) { stmt.bindString(25, wellType); } - + String wellTypeName = entity.getWellTypeName(); if (wellTypeName != null) { stmt.bindString(26, wellTypeName); @@ -242,132 +237,132 @@ @Override protected final void bindValues(SQLiteStatement stmt, MapWellLocalBean entity) { stmt.clearBindings(); - + Long kId = entity.getKId(); if (kId != null) { stmt.bindLong(1, kId); } - + String area = entity.getArea(); if (area != null) { stmt.bindString(2, area); } - + String bfzt = entity.getBfzt(); if (bfzt != null) { stmt.bindString(3, bfzt); } - + String bfztName = entity.getBfztName(); if (bfztName != null) { stmt.bindString(4, bfztName); } - + String coordinateX = entity.getCoordinateX(); if (coordinateX != null) { stmt.bindString(5, coordinateX); } - + String coordinateY = entity.getCoordinateY(); if (coordinateY != null) { stmt.bindString(6, coordinateY); } - + String deep = entity.getDeep(); if (deep != null) { stmt.bindString(7, deep); } - + String deptName = entity.getDeptName(); if (deptName != null) { stmt.bindString(8, deptName); } - + String deptid = entity.getDeptid(); if (deptid != null) { stmt.bindString(9, deptid); } - + String id = entity.getId(); if (id != null) { stmt.bindString(10, id); } - + String latBaidu = entity.getLatBaidu(); if (latBaidu != null) { stmt.bindString(11, latBaidu); } - + String latGaode = entity.getLatGaode(); if (latGaode != null) { stmt.bindString(12, latGaode); } - + String lngBaidu = entity.getLngBaidu(); if (lngBaidu != null) { stmt.bindString(13, lngBaidu); } - + String lngGaode = entity.getLngGaode(); if (lngGaode != null) { stmt.bindString(14, lngGaode); } - + String notes = entity.getNotes(); if (notes != null) { stmt.bindString(15, notes); } - + String photos = entity.getPhotos(); if (photos != null) { stmt.bindString(16, photos); } - + String position = entity.getPosition(); if (position != null) { stmt.bindString(17, position); } - + String staff = entity.getStaff(); if (staff != null) { stmt.bindString(18, staff); } - + String tel = entity.getTel(); if (tel != null) { stmt.bindString(19, tel); } - + String ts = entity.getTs(); if (ts != null) { stmt.bindString(20, ts); } - + String valid = entity.getValid(); if (valid != null) { stmt.bindString(21, valid); } - + String watchData = entity.getWatchData(); if (watchData != null) { stmt.bindString(22, watchData); } - + String wellCode = entity.getWellCode(); if (wellCode != null) { stmt.bindString(23, wellCode); } - + String wellName = entity.getWellName(); if (wellName != null) { stmt.bindString(24, wellName); } - + String wellType = entity.getWellType(); if (wellType != null) { stmt.bindString(25, wellType); } - + String wellTypeName = entity.getWellTypeName(); if (wellTypeName != null) { stmt.bindString(26, wellTypeName); @@ -377,41 +372,41 @@ @Override public Long readKey(Cursor cursor, int offset) { return cursor.isNull(offset + 0) ? null : cursor.getLong(offset + 0); - } + } @Override public MapWellLocalBean readEntity(Cursor cursor, int offset) { MapWellLocalBean entity = new MapWellLocalBean( // - cursor.isNull(offset + 0) ? null : cursor.getLong(offset + 0), // kId - cursor.isNull(offset + 1) ? null : cursor.getString(offset + 1), // area - cursor.isNull(offset + 2) ? null : cursor.getString(offset + 2), // bfzt - cursor.isNull(offset + 3) ? null : cursor.getString(offset + 3), // bfztName - cursor.isNull(offset + 4) ? null : cursor.getString(offset + 4), // coordinateX - cursor.isNull(offset + 5) ? null : cursor.getString(offset + 5), // coordinateY - cursor.isNull(offset + 6) ? null : cursor.getString(offset + 6), // deep - cursor.isNull(offset + 7) ? null : cursor.getString(offset + 7), // deptName - cursor.isNull(offset + 8) ? null : cursor.getString(offset + 8), // deptid - cursor.isNull(offset + 9) ? null : cursor.getString(offset + 9), // id - cursor.isNull(offset + 10) ? null : cursor.getString(offset + 10), // latBaidu - cursor.isNull(offset + 11) ? null : cursor.getString(offset + 11), // latGaode - cursor.isNull(offset + 12) ? null : cursor.getString(offset + 12), // lngBaidu - cursor.isNull(offset + 13) ? null : cursor.getString(offset + 13), // lngGaode - cursor.isNull(offset + 14) ? null : cursor.getString(offset + 14), // notes - cursor.isNull(offset + 15) ? null : cursor.getString(offset + 15), // photos - cursor.isNull(offset + 16) ? null : cursor.getString(offset + 16), // position - cursor.isNull(offset + 17) ? null : cursor.getString(offset + 17), // staff - cursor.isNull(offset + 18) ? null : cursor.getString(offset + 18), // tel - cursor.isNull(offset + 19) ? null : cursor.getString(offset + 19), // ts - cursor.isNull(offset + 20) ? null : cursor.getString(offset + 20), // valid - cursor.isNull(offset + 21) ? null : cursor.getString(offset + 21), // watchData - cursor.isNull(offset + 22) ? null : cursor.getString(offset + 22), // wellCode - cursor.isNull(offset + 23) ? null : cursor.getString(offset + 23), // wellName - cursor.isNull(offset + 24) ? null : cursor.getString(offset + 24), // wellType - cursor.isNull(offset + 25) ? null : cursor.getString(offset + 25) // wellTypeName + cursor.isNull(offset + 0) ? null : cursor.getLong(offset + 0), // kId + cursor.isNull(offset + 1) ? null : cursor.getString(offset + 1), // area + cursor.isNull(offset + 2) ? null : cursor.getString(offset + 2), // bfzt + cursor.isNull(offset + 3) ? null : cursor.getString(offset + 3), // bfztName + cursor.isNull(offset + 4) ? null : cursor.getString(offset + 4), // coordinateX + cursor.isNull(offset + 5) ? null : cursor.getString(offset + 5), // coordinateY + cursor.isNull(offset + 6) ? null : cursor.getString(offset + 6), // deep + cursor.isNull(offset + 7) ? null : cursor.getString(offset + 7), // deptName + cursor.isNull(offset + 8) ? null : cursor.getString(offset + 8), // deptid + cursor.isNull(offset + 9) ? null : cursor.getString(offset + 9), // id + cursor.isNull(offset + 10) ? null : cursor.getString(offset + 10), // latBaidu + cursor.isNull(offset + 11) ? null : cursor.getString(offset + 11), // latGaode + cursor.isNull(offset + 12) ? null : cursor.getString(offset + 12), // lngBaidu + cursor.isNull(offset + 13) ? null : cursor.getString(offset + 13), // lngGaode + cursor.isNull(offset + 14) ? null : cursor.getString(offset + 14), // notes + cursor.isNull(offset + 15) ? null : cursor.getString(offset + 15), // photos + cursor.isNull(offset + 16) ? null : cursor.getString(offset + 16), // position + cursor.isNull(offset + 17) ? null : cursor.getString(offset + 17), // staff + cursor.isNull(offset + 18) ? null : cursor.getString(offset + 18), // tel + cursor.isNull(offset + 19) ? null : cursor.getString(offset + 19), // ts + cursor.isNull(offset + 20) ? null : cursor.getString(offset + 20), // valid + cursor.isNull(offset + 21) ? null : cursor.getString(offset + 21), // watchData + cursor.isNull(offset + 22) ? null : cursor.getString(offset + 22), // wellCode + cursor.isNull(offset + 23) ? null : cursor.getString(offset + 23), // wellName + cursor.isNull(offset + 24) ? null : cursor.getString(offset + 24), // wellType + cursor.isNull(offset + 25) ? null : cursor.getString(offset + 25) // wellTypeName ); return entity; } - + @Override public void readEntity(Cursor cursor, MapWellLocalBean entity, int offset) { entity.setKId(cursor.isNull(offset + 0) ? null : cursor.getLong(offset + 0)); @@ -440,17 +435,17 @@ entity.setWellName(cursor.isNull(offset + 23) ? null : cursor.getString(offset + 23)); entity.setWellType(cursor.isNull(offset + 24) ? null : cursor.getString(offset + 24)); entity.setWellTypeName(cursor.isNull(offset + 25) ? null : cursor.getString(offset + 25)); - } - + } + @Override protected final Long updateKeyAfterInsert(MapWellLocalBean entity, long rowId) { entity.setKId(rowId); return rowId; } - + @Override public Long getKey(MapWellLocalBean entity) { - if (entity != null) { + if(entity != null) { return entity.getKId(); } else { return null; @@ -466,5 +461,5 @@ protected final boolean isEntityUpdateable() { return true; } - + } diff --git a/app/src/main/java/com/casic/app/smartwell/greendao/NoticeLocaleBeanDao.java b/app/src/main/java/com/casic/app/smartwell/greendao/NoticeLocaleBeanDao.java index 64312ed..deb2d49 100644 --- a/app/src/main/java/com/casic/app/smartwell/greendao/NoticeLocaleBeanDao.java +++ b/app/src/main/java/com/casic/app/smartwell/greendao/NoticeLocaleBeanDao.java @@ -12,10 +12,9 @@ import org.greenrobot.greendao.internal.DaoConfig; // THIS CODE IS GENERATED BY greenDAO, DO NOT EDIT. - -/** +/** * DAO for table "NOTICE_LOCALE_BEAN". - */ +*/ public class NoticeLocaleBeanDao extends AbstractDao { public static final String TABLENAME = "NOTICE_LOCALE_BEAN"; @@ -43,16 +42,14 @@ public NoticeLocaleBeanDao(DaoConfig config) { super(config); } - + public NoticeLocaleBeanDao(DaoConfig config, DaoSession daoSession) { super(config, daoSession); } - /** - * Creates the underlying database table. - */ + /** Creates the underlying database table. */ public static void createTable(Database db, boolean ifNotExists) { - String constraint = ifNotExists ? "IF NOT EXISTS " : ""; + String constraint = ifNotExists? "IF NOT EXISTS ": ""; db.execSQL("CREATE TABLE " + constraint + "\"NOTICE_LOCALE_BEAN\" (" + // "\"_id\" INTEGER PRIMARY KEY AUTOINCREMENT ," + // 0: id "\"MESSAGE_ID\" TEXT UNIQUE ," + // 1: messageId @@ -68,9 +65,7 @@ "\"NOTICE_TIME\" TEXT);"); // 11: noticeTime } - /** - * Drops the underlying database table. - */ + /** Drops the underlying database table. */ public static void dropTable(Database db, boolean ifExists) { String sql = "DROP TABLE " + (ifExists ? "IF EXISTS " : "") + "\"NOTICE_LOCALE_BEAN\""; db.execSQL(sql); @@ -79,62 +74,62 @@ @Override protected final void bindValues(DatabaseStatement stmt, NoticeLocaleBean entity) { stmt.clearBindings(); - + Long id = entity.getId(); if (id != null) { stmt.bindLong(1, id); } - + String messageId = entity.getMessageId(); if (messageId != null) { stmt.bindString(2, messageId); } - + String appid = entity.getAppid(); if (appid != null) { stmt.bindString(3, appid); } - + String clientId = entity.getClientId(); if (clientId != null) { stmt.bindString(4, clientId); } - + String taskId = entity.getTaskId(); if (taskId != null) { stmt.bindString(5, taskId); } - + String userId = entity.getUserId(); if (userId != null) { stmt.bindString(6, userId); } - + String title = entity.getTitle(); if (title != null) { stmt.bindString(7, title); } - + String content = entity.getContent(); if (content != null) { stmt.bindString(8, content); } - + String deviceCode = entity.getDeviceCode(); if (deviceCode != null) { stmt.bindString(9, deviceCode); } - + String jobId = entity.getJobId(); if (jobId != null) { stmt.bindString(10, jobId); } - + String isRead = entity.getIsRead(); if (isRead != null) { stmt.bindString(11, isRead); } - + String noticeTime = entity.getNoticeTime(); if (noticeTime != null) { stmt.bindString(12, noticeTime); @@ -144,62 +139,62 @@ @Override protected final void bindValues(SQLiteStatement stmt, NoticeLocaleBean entity) { stmt.clearBindings(); - + Long id = entity.getId(); if (id != null) { stmt.bindLong(1, id); } - + String messageId = entity.getMessageId(); if (messageId != null) { stmt.bindString(2, messageId); } - + String appid = entity.getAppid(); if (appid != null) { stmt.bindString(3, appid); } - + String clientId = entity.getClientId(); if (clientId != null) { stmt.bindString(4, clientId); } - + String taskId = entity.getTaskId(); if (taskId != null) { stmt.bindString(5, taskId); } - + String userId = entity.getUserId(); if (userId != null) { stmt.bindString(6, userId); } - + String title = entity.getTitle(); if (title != null) { stmt.bindString(7, title); } - + String content = entity.getContent(); if (content != null) { stmt.bindString(8, content); } - + String deviceCode = entity.getDeviceCode(); if (deviceCode != null) { stmt.bindString(9, deviceCode); } - + String jobId = entity.getJobId(); if (jobId != null) { stmt.bindString(10, jobId); } - + String isRead = entity.getIsRead(); if (isRead != null) { stmt.bindString(11, isRead); } - + String noticeTime = entity.getNoticeTime(); if (noticeTime != null) { stmt.bindString(12, noticeTime); @@ -209,27 +204,27 @@ @Override public Long readKey(Cursor cursor, int offset) { return cursor.isNull(offset + 0) ? null : cursor.getLong(offset + 0); - } + } @Override public NoticeLocaleBean readEntity(Cursor cursor, int offset) { NoticeLocaleBean entity = new NoticeLocaleBean( // - cursor.isNull(offset + 0) ? null : cursor.getLong(offset + 0), // id - cursor.isNull(offset + 1) ? null : cursor.getString(offset + 1), // messageId - cursor.isNull(offset + 2) ? null : cursor.getString(offset + 2), // appid - cursor.isNull(offset + 3) ? null : cursor.getString(offset + 3), // clientId - cursor.isNull(offset + 4) ? null : cursor.getString(offset + 4), // taskId - cursor.isNull(offset + 5) ? null : cursor.getString(offset + 5), // userId - cursor.isNull(offset + 6) ? null : cursor.getString(offset + 6), // title - cursor.isNull(offset + 7) ? null : cursor.getString(offset + 7), // content - cursor.isNull(offset + 8) ? null : cursor.getString(offset + 8), // deviceCode - cursor.isNull(offset + 9) ? null : cursor.getString(offset + 9), // jobId - cursor.isNull(offset + 10) ? null : cursor.getString(offset + 10), // isRead - cursor.isNull(offset + 11) ? null : cursor.getString(offset + 11) // noticeTime + cursor.isNull(offset + 0) ? null : cursor.getLong(offset + 0), // id + cursor.isNull(offset + 1) ? null : cursor.getString(offset + 1), // messageId + cursor.isNull(offset + 2) ? null : cursor.getString(offset + 2), // appid + cursor.isNull(offset + 3) ? null : cursor.getString(offset + 3), // clientId + cursor.isNull(offset + 4) ? null : cursor.getString(offset + 4), // taskId + cursor.isNull(offset + 5) ? null : cursor.getString(offset + 5), // userId + cursor.isNull(offset + 6) ? null : cursor.getString(offset + 6), // title + cursor.isNull(offset + 7) ? null : cursor.getString(offset + 7), // content + cursor.isNull(offset + 8) ? null : cursor.getString(offset + 8), // deviceCode + cursor.isNull(offset + 9) ? null : cursor.getString(offset + 9), // jobId + cursor.isNull(offset + 10) ? null : cursor.getString(offset + 10), // isRead + cursor.isNull(offset + 11) ? null : cursor.getString(offset + 11) // noticeTime ); return entity; } - + @Override public void readEntity(Cursor cursor, NoticeLocaleBean entity, int offset) { entity.setId(cursor.isNull(offset + 0) ? null : cursor.getLong(offset + 0)); @@ -244,17 +239,17 @@ entity.setJobId(cursor.isNull(offset + 9) ? null : cursor.getString(offset + 9)); entity.setIsRead(cursor.isNull(offset + 10) ? null : cursor.getString(offset + 10)); entity.setNoticeTime(cursor.isNull(offset + 11) ? null : cursor.getString(offset + 11)); - } - + } + @Override protected final Long updateKeyAfterInsert(NoticeLocaleBean entity, long rowId) { entity.setId(rowId); return rowId; } - + @Override public Long getKey(NoticeLocaleBean entity) { - if (entity != null) { + if(entity != null) { return entity.getId(); } else { return null; @@ -270,5 +265,5 @@ protected final boolean isEntityUpdateable() { return true; } - + } diff --git a/app/src/main/java/com/casic/app/smartwell/greendao/PipeLocalBeanDao.java b/app/src/main/java/com/casic/app/smartwell/greendao/PipeLocalBeanDao.java index aab4d3f..df5515a 100644 --- a/app/src/main/java/com/casic/app/smartwell/greendao/PipeLocalBeanDao.java +++ b/app/src/main/java/com/casic/app/smartwell/greendao/PipeLocalBeanDao.java @@ -12,10 +12,9 @@ import org.greenrobot.greendao.internal.DaoConfig; // THIS CODE IS GENERATED BY greenDAO, DO NOT EDIT. - -/** +/** * DAO for table "PIPE_LOCAL_BEAN". - */ +*/ public class PipeLocalBeanDao extends AbstractDao { public static final String TABLENAME = "PIPE_LOCAL_BEAN"; @@ -37,16 +36,14 @@ public PipeLocalBeanDao(DaoConfig config) { super(config); } - + public PipeLocalBeanDao(DaoConfig config, DaoSession daoSession) { super(config, daoSession); } - /** - * Creates the underlying database table. - */ + /** Creates the underlying database table. */ public static void createTable(Database db, boolean ifNotExists) { - String constraint = ifNotExists ? "IF NOT EXISTS " : ""; + String constraint = ifNotExists? "IF NOT EXISTS ": ""; db.execSQL("CREATE TABLE " + constraint + "\"PIPE_LOCAL_BEAN\" (" + // "\"_id\" INTEGER PRIMARY KEY AUTOINCREMENT ," + // 0: id "\"PIPE_CODE\" TEXT," + // 1: pipeCode @@ -56,9 +53,7 @@ "\"START_LONGITUDE_GD\" TEXT);"); // 5: startLongitudeGd } - /** - * Drops the underlying database table. - */ + /** Drops the underlying database table. */ public static void dropTable(Database db, boolean ifExists) { String sql = "DROP TABLE " + (ifExists ? "IF EXISTS " : "") + "\"PIPE_LOCAL_BEAN\""; db.execSQL(sql); @@ -67,32 +62,32 @@ @Override protected final void bindValues(DatabaseStatement stmt, PipeLocalBean entity) { stmt.clearBindings(); - + Long id = entity.getId(); if (id != null) { stmt.bindLong(1, id); } - + String pipeCode = entity.getPipeCode(); if (pipeCode != null) { stmt.bindString(2, pipeCode); } - + String endLatitudeGd = entity.getEndLatitudeGd(); if (endLatitudeGd != null) { stmt.bindString(3, endLatitudeGd); } - + String endLongitudeGd = entity.getEndLongitudeGd(); if (endLongitudeGd != null) { stmt.bindString(4, endLongitudeGd); } - + String startLatitudeGd = entity.getStartLatitudeGd(); if (startLatitudeGd != null) { stmt.bindString(5, startLatitudeGd); } - + String startLongitudeGd = entity.getStartLongitudeGd(); if (startLongitudeGd != null) { stmt.bindString(6, startLongitudeGd); @@ -102,32 +97,32 @@ @Override protected final void bindValues(SQLiteStatement stmt, PipeLocalBean entity) { stmt.clearBindings(); - + Long id = entity.getId(); if (id != null) { stmt.bindLong(1, id); } - + String pipeCode = entity.getPipeCode(); if (pipeCode != null) { stmt.bindString(2, pipeCode); } - + String endLatitudeGd = entity.getEndLatitudeGd(); if (endLatitudeGd != null) { stmt.bindString(3, endLatitudeGd); } - + String endLongitudeGd = entity.getEndLongitudeGd(); if (endLongitudeGd != null) { stmt.bindString(4, endLongitudeGd); } - + String startLatitudeGd = entity.getStartLatitudeGd(); if (startLatitudeGd != null) { stmt.bindString(5, startLatitudeGd); } - + String startLongitudeGd = entity.getStartLongitudeGd(); if (startLongitudeGd != null) { stmt.bindString(6, startLongitudeGd); @@ -137,21 +132,21 @@ @Override public Long readKey(Cursor cursor, int offset) { return cursor.isNull(offset + 0) ? null : cursor.getLong(offset + 0); - } + } @Override public PipeLocalBean readEntity(Cursor cursor, int offset) { PipeLocalBean entity = new PipeLocalBean( // - cursor.isNull(offset + 0) ? null : cursor.getLong(offset + 0), // id - cursor.isNull(offset + 1) ? null : cursor.getString(offset + 1), // pipeCode - cursor.isNull(offset + 2) ? null : cursor.getString(offset + 2), // endLatitudeGd - cursor.isNull(offset + 3) ? null : cursor.getString(offset + 3), // endLongitudeGd - cursor.isNull(offset + 4) ? null : cursor.getString(offset + 4), // startLatitudeGd - cursor.isNull(offset + 5) ? null : cursor.getString(offset + 5) // startLongitudeGd + cursor.isNull(offset + 0) ? null : cursor.getLong(offset + 0), // id + cursor.isNull(offset + 1) ? null : cursor.getString(offset + 1), // pipeCode + cursor.isNull(offset + 2) ? null : cursor.getString(offset + 2), // endLatitudeGd + cursor.isNull(offset + 3) ? null : cursor.getString(offset + 3), // endLongitudeGd + cursor.isNull(offset + 4) ? null : cursor.getString(offset + 4), // startLatitudeGd + cursor.isNull(offset + 5) ? null : cursor.getString(offset + 5) // startLongitudeGd ); return entity; } - + @Override public void readEntity(Cursor cursor, PipeLocalBean entity, int offset) { entity.setId(cursor.isNull(offset + 0) ? null : cursor.getLong(offset + 0)); @@ -160,17 +155,17 @@ entity.setEndLongitudeGd(cursor.isNull(offset + 3) ? null : cursor.getString(offset + 3)); entity.setStartLatitudeGd(cursor.isNull(offset + 4) ? null : cursor.getString(offset + 4)); entity.setStartLongitudeGd(cursor.isNull(offset + 5) ? null : cursor.getString(offset + 5)); - } - + } + @Override protected final Long updateKeyAfterInsert(PipeLocalBean entity, long rowId) { entity.setId(rowId); return rowId; } - + @Override public Long getKey(PipeLocalBean entity) { - if (entity != null) { + if(entity != null) { return entity.getId(); } else { return null; @@ -186,5 +181,5 @@ protected final boolean isEntityUpdateable() { return true; } - + } diff --git a/app/src/main/java/com/casic/app/smartwell/view/ChangePasswordActivity.kt b/app/src/main/java/com/casic/app/smartwell/view/ChangePasswordActivity.kt index 8e41039..9f1dd40 100644 --- a/app/src/main/java/com/casic/app/smartwell/view/ChangePasswordActivity.kt +++ b/app/src/main/java/com/casic/app/smartwell/view/ChangePasswordActivity.kt @@ -14,7 +14,7 @@ import com.pengxh.kt.lite.extensions.show import com.pengxh.kt.lite.utils.ActivityStackManager import com.pengxh.kt.lite.utils.LoadState -import com.pengxh.kt.lite.utils.LoadingDialogHub +import com.pengxh.kt.lite.utils.LoadingDialog import com.pengxh.kt.lite.widget.TitleBarView import java.nio.charset.StandardCharsets @@ -46,15 +46,15 @@ override fun observeRequestState() { userViewModel.loadState.observe(this) { when (it) { - is LoadState.Loading -> LoadingDialogHub.show(this, "修改中,请稍后") + is LoadState.Loading -> LoadingDialog.show(this, "修改中,请稍后") is LoadState.Success -> { - LoadingDialogHub.dismiss() + LoadingDialog.dismiss() AuthenticationHelper.removeToken() this.navigatePageTo() ActivityStackManager.finishAllActivity() } - else -> LoadingDialogHub.dismiss() + else -> LoadingDialog.dismiss() } } } diff --git a/app/src/main/java/com/casic/app/smartwell/view/DeployedWellActivity.kt b/app/src/main/java/com/casic/app/smartwell/view/DeployedWellActivity.kt index fb4339c..28a5078 100644 --- a/app/src/main/java/com/casic/app/smartwell/view/DeployedWellActivity.kt +++ b/app/src/main/java/com/casic/app/smartwell/view/DeployedWellActivity.kt @@ -83,8 +83,8 @@ } //添加分割线 - binding.deployedListView.addItemDecoration( - RecyclerViewItemOffsets(0, 5, 0, 5) + binding.recyclerView.addItemDecoration( + RecyclerViewItemOffsets(0, 7, 0, 7) ) } @@ -149,12 +149,11 @@ } else { item.deep.toString() + "m" } - viewHolder.setText(R.id.wellNameView, item.wellName) + viewHolder.setText(R.id.wellTypeView, item.wellTypeName) .setText(R.id.wellDepthView, "深:${deep}") .setText(R.id.wellCodeView, "点位编号:${item.wellCode}") - .setText(R.id.wellTypeView, "点位类型:${item.wellTypeName}") .setText(R.id.ownerShipView, "权属单位:${item.deptName}") - .setText(R.id.wellLocationView, "点位置:${item.position}") + .setText(R.id.wellLocationView, "点位位置:${item.position}") .setOnClickListener( R.id.operationButton, object : View.OnClickListener { override fun onClick(v: View?) { @@ -207,7 +206,7 @@ }) } } - binding.deployedListView.adapter = deployAdapter + binding.recyclerView.adapter = deployAdapter deployAdapter.setOnItemClickedListener(object : NormalRecyclerAdapter.OnItemClickedListener { override fun onItemClicked(position: Int, t: WellListModel.DataBean.RowsBean) { diff --git a/app/src/main/java/com/casic/app/smartwell/view/LoginActivity.kt b/app/src/main/java/com/casic/app/smartwell/view/LoginActivity.kt index e4bb0e3..834527b 100644 --- a/app/src/main/java/com/casic/app/smartwell/view/LoginActivity.kt +++ b/app/src/main/java/com/casic/app/smartwell/view/LoginActivity.kt @@ -21,7 +21,7 @@ import com.pengxh.kt.lite.extensions.navigatePageTo import com.pengxh.kt.lite.extensions.readAssetsFile import com.pengxh.kt.lite.extensions.show -import com.pengxh.kt.lite.utils.LoadingDialogHub +import com.pengxh.kt.lite.utils.LoadingDialog import com.pengxh.kt.lite.utils.SaveKeyValues import kotlinx.coroutines.Dispatchers import kotlinx.coroutines.launch @@ -106,11 +106,11 @@ override fun observeRequestState() { authenticateViewModel.loadState.observe(this) { - LoadingDialogHub.show(this, "登录中,请稍后") + LoadingDialog.show(this, "登录中,请稍后") } loginViewModel.loadState.observe(this) { - LoadingDialogHub.dismiss() + LoadingDialog.dismiss() } } diff --git a/app/src/main/java/com/casic/app/smartwell/view/OrderCompletedDetailActivity.kt b/app/src/main/java/com/casic/app/smartwell/view/OrderCompletedDetailActivity.kt index db8ad1f..75cd905 100644 --- a/app/src/main/java/com/casic/app/smartwell/view/OrderCompletedDetailActivity.kt +++ b/app/src/main/java/com/casic/app/smartwell/view/OrderCompletedDetailActivity.kt @@ -17,7 +17,7 @@ import com.pengxh.kt.lite.extensions.show import com.pengxh.kt.lite.utils.Constant import com.pengxh.kt.lite.utils.LoadState -import com.pengxh.kt.lite.utils.LoadingDialogHub +import com.pengxh.kt.lite.utils.LoadingDialog import com.pengxh.kt.lite.widget.TitleBarView import com.pengxh.kt.lite.widget.dialog.AlertMessageDialog @@ -44,7 +44,7 @@ } override fun initOnCreate(savedInstanceState: Bundle?) { - val jobId = intent.getStringExtra(Constant.INTENT_PARAM)!! + val jobId = intent.getStringExtra(Constant.INTENT_PARAM_KEY)!! orderViewModel = ViewModelProvider(this)[OrderViewModel::class.java] orderViewModel.getWorkOrderDetail(jobId) orderViewModel.detailModel.observe(this) { @@ -154,8 +154,8 @@ override fun observeRequestState() { orderViewModel.loadState.observe(this) { when (it) { - is LoadState.Loading -> LoadingDialogHub.show(this, "数据加载中,请稍后") - else -> LoadingDialogHub.dismiss() + is LoadState.Loading -> LoadingDialog.show(this, "数据加载中,请稍后") + else -> LoadingDialog.dismiss() } } } diff --git a/app/src/main/java/com/casic/app/smartwell/view/OrderInHandleDetailActivity.kt b/app/src/main/java/com/casic/app/smartwell/view/OrderInHandleDetailActivity.kt index d70a979..04a7d5d 100644 --- a/app/src/main/java/com/casic/app/smartwell/view/OrderInHandleDetailActivity.kt +++ b/app/src/main/java/com/casic/app/smartwell/view/OrderInHandleDetailActivity.kt @@ -38,7 +38,7 @@ import com.pengxh.kt.lite.extensions.show import com.pengxh.kt.lite.utils.Constant import com.pengxh.kt.lite.utils.LoadState -import com.pengxh.kt.lite.utils.LoadingDialogHub +import com.pengxh.kt.lite.utils.LoadingDialog import com.pengxh.kt.lite.widget.TitleBarView import com.pengxh.kt.lite.widget.dialog.AlertControlDialog import com.pengxh.kt.lite.widget.dialog.AlertMessageDialog @@ -93,7 +93,7 @@ ) binding.addImageRecyclerView.adapter = imageAdapter - val jobId = intent.getStringExtra(Constant.INTENT_PARAM)!!//初始化图片九宫格 + val jobId = intent.getStringExtra(Constant.INTENT_PARAM_KEY)!!//初始化图片九宫格 orderViewModel.getWorkOrderDetail(jobId) orderViewModel.detailModel.observe(this) { if (it.code == 200) { @@ -312,41 +312,41 @@ override fun observeRequestState() { orderViewModel.loadState.observe(this) { when (it) { - is LoadState.Loading -> LoadingDialogHub.show(this, "数据加载中,请稍后") - else -> LoadingDialogHub.dismiss() + is LoadState.Loading -> LoadingDialog.show(this, "数据加载中,请稍后") + else -> LoadingDialog.dismiss() } } uploadImageViewModel.loadState.observe(this) { when (it) { - LoadState.Loading -> LoadingDialogHub.show(this, "图片上传中,请稍后...") - else -> LoadingDialogHub.dismiss() + LoadState.Loading -> LoadingDialog.show(this, "图片上传中,请稍后...") + else -> LoadingDialog.dismiss() } } //转单状态处理 operationViewModel.loadState.observe(this) { when (it) { - is LoadState.Loading -> LoadingDialogHub.show(this, "转单中,请稍后") + is LoadState.Loading -> LoadingDialog.show(this, "转单中,请稍后") is LoadState.Success -> { - LoadingDialogHub.dismiss() + LoadingDialog.dismiss() this.finish() } - else -> LoadingDialogHub.dismiss() + else -> LoadingDialog.dismiss() } } //处理完成工单状态处理 operationViewModel.loadState.observe(this) { when (it) { - is LoadState.Loading -> LoadingDialogHub.show(this, "处理中,请稍后") + is LoadState.Loading -> LoadingDialog.show(this, "处理中,请稍后") is LoadState.Success -> { - LoadingDialogHub.dismiss() + LoadingDialog.dismiss() this.finish() } - else -> LoadingDialogHub.dismiss() + else -> LoadingDialog.dismiss() } } } diff --git a/app/src/main/java/com/casic/app/smartwell/view/OrderNotConfirmedDetailActivity.kt b/app/src/main/java/com/casic/app/smartwell/view/OrderNotConfirmedDetailActivity.kt index 8e036d2..687ec86 100644 --- a/app/src/main/java/com/casic/app/smartwell/view/OrderNotConfirmedDetailActivity.kt +++ b/app/src/main/java/com/casic/app/smartwell/view/OrderNotConfirmedDetailActivity.kt @@ -36,7 +36,7 @@ import com.pengxh.kt.lite.extensions.show import com.pengxh.kt.lite.utils.Constant import com.pengxh.kt.lite.utils.LoadState -import com.pengxh.kt.lite.utils.LoadingDialogHub +import com.pengxh.kt.lite.utils.LoadingDialog import com.pengxh.kt.lite.widget.TitleBarView import com.pengxh.kt.lite.widget.dialog.AlertControlDialog import com.pengxh.kt.lite.widget.dialog.AlertMessageDialog @@ -80,7 +80,7 @@ } override fun initOnCreate(savedInstanceState: Bundle?) { - val jobId = intent.getStringExtra(Constant.INTENT_PARAM)!! + val jobId = intent.getStringExtra(Constant.INTENT_PARAM_KEY)!! //初始化图片九宫格 //左外边距,左内边距,右内边距,右外边距 val viewWidth = getScreenWidth() - (10 + 10 + 10 + 10).dp2px(this) @@ -263,41 +263,41 @@ //数据加载状态处理 orderViewModel.loadState.observe(this) { when (it) { - is LoadState.Loading -> LoadingDialogHub.show(this, "数据加载中,请稍后") - else -> LoadingDialogHub.dismiss() + is LoadState.Loading -> LoadingDialog.show(this, "数据加载中,请稍后") + else -> LoadingDialog.dismiss() } } uploadImageViewModel.loadState.observe(this) { when (it) { - LoadState.Loading -> LoadingDialogHub.show(this, "图片上传中,请稍后") - else -> LoadingDialogHub.dismiss() + LoadState.Loading -> LoadingDialog.show(this, "图片上传中,请稍后") + else -> LoadingDialog.dismiss() } } //转单状态处理 operationViewModel.loadState.observe(this) { when (it) { - is LoadState.Loading -> LoadingDialogHub.show(this, "转单中,请稍后") + is LoadState.Loading -> LoadingDialog.show(this, "转单中,请稍后") is LoadState.Success -> { - LoadingDialogHub.dismiss() + LoadingDialog.dismiss() this.finish() } - else -> LoadingDialogHub.dismiss() + else -> LoadingDialog.dismiss() } } //确认工单状态处理 operationViewModel.loadState.observe(this) { when (it) { - is LoadState.Loading -> LoadingDialogHub.show(this, "处理中,请稍后") + is LoadState.Loading -> LoadingDialog.show(this, "处理中,请稍后") is LoadState.Success -> { - LoadingDialogHub.dismiss() + LoadingDialog.dismiss() this.finish() } - else -> LoadingDialogHub.dismiss() + else -> LoadingDialog.dismiss() } } } diff --git a/app/src/main/java/com/casic/app/smartwell/view/OrderNotProcessedDetailActivity.kt b/app/src/main/java/com/casic/app/smartwell/view/OrderNotProcessedDetailActivity.kt index d3f22dc..0c97a52 100644 --- a/app/src/main/java/com/casic/app/smartwell/view/OrderNotProcessedDetailActivity.kt +++ b/app/src/main/java/com/casic/app/smartwell/view/OrderNotProcessedDetailActivity.kt @@ -18,7 +18,7 @@ import com.pengxh.kt.lite.extensions.show import com.pengxh.kt.lite.utils.Constant import com.pengxh.kt.lite.utils.LoadState -import com.pengxh.kt.lite.utils.LoadingDialogHub +import com.pengxh.kt.lite.utils.LoadingDialog import com.pengxh.kt.lite.widget.TitleBarView import com.pengxh.kt.lite.widget.dialog.AlertControlDialog import com.pengxh.kt.lite.widget.dialog.AlertMessageDialog @@ -50,7 +50,7 @@ } override fun initOnCreate(savedInstanceState: Bundle?) { - this.jobId = intent.getStringExtra(Constant.INTENT_PARAM)!! + this.jobId = intent.getStringExtra(Constant.INTENT_PARAM_KEY)!! orderViewModel = ViewModelProvider(this)[OrderViewModel::class.java] operationViewModel = ViewModelProvider(this)[OperationViewModel::class.java] wellViewModel = ViewModelProvider(this)[WellViewModel::class.java] @@ -162,21 +162,21 @@ //数据加载状态处理 orderViewModel.loadState.observe(this) { when (it) { - is LoadState.Loading -> LoadingDialogHub.show(this, "数据加载中,请稍后") - else -> LoadingDialogHub.dismiss() + is LoadState.Loading -> LoadingDialog.show(this, "数据加载中,请稍后") + else -> LoadingDialog.dismiss() } } //接单状态处理 operationViewModel.loadState.observe(this) { when (it) { - is LoadState.Loading -> LoadingDialogHub.show(this, "接单中,请稍后") + is LoadState.Loading -> LoadingDialog.show(this, "接单中,请稍后") is LoadState.Success -> { - LoadingDialogHub.dismiss() + LoadingDialog.dismiss() this.finish() } - else -> LoadingDialogHub.dismiss() + else -> LoadingDialog.dismiss() } } } diff --git a/app/src/main/java/com/casic/app/smartwell/view/SearchResultActivity.kt b/app/src/main/java/com/casic/app/smartwell/view/SearchResultActivity.kt index 6a92917..4f3a674 100644 --- a/app/src/main/java/com/casic/app/smartwell/view/SearchResultActivity.kt +++ b/app/src/main/java/com/casic/app/smartwell/view/SearchResultActivity.kt @@ -19,7 +19,7 @@ import com.pengxh.kt.lite.extensions.show import com.pengxh.kt.lite.utils.Constant import com.pengxh.kt.lite.utils.LoadState -import com.pengxh.kt.lite.utils.LoadingDialogHub +import com.pengxh.kt.lite.utils.LoadingDialog import com.pengxh.kt.lite.utils.WeakReferenceHandler import com.pengxh.kt.lite.widget.TitleBarView import com.pengxh.kt.lite.widget.dialog.AlertControlDialog @@ -56,7 +56,7 @@ } override fun initOnCreate(savedInstanceState: Bundle?) { - args = intent.getStringArrayListExtra(Constant.INTENT_PARAM)!! + args = intent.getStringArrayListExtra(Constant.INTENT_PARAM_KEY)!! orderViewModel = ViewModelProvider(this)[OrderViewModel::class.java] operationViewModel = ViewModelProvider(this)[OperationViewModel::class.java] @@ -101,24 +101,24 @@ } } - binding.resultRecyclerView.addItemDecoration( - RecyclerViewItemOffsets(0, 5, 0, 5) + binding.recyclerView.addItemDecoration( + RecyclerViewItemOffsets(0, 7, 0, 7) ) } override fun observeRequestState() { orderViewModel.loadState.observe(this) { when (it) { - is LoadState.Loading -> LoadingDialogHub.show(this, "数据加载中,请稍后") - else -> LoadingDialogHub.dismiss() + is LoadState.Loading -> LoadingDialog.show(this, "数据加载中,请稍后") + else -> LoadingDialog.dismiss() } } //接单状态处理 operationViewModel.loadState.observe(this) { when (it) { - is LoadState.Loading -> LoadingDialogHub.show(this, "接单中,请稍后") + is LoadState.Loading -> LoadingDialog.show(this, "接单中,请稍后") is LoadState.Success -> { - LoadingDialogHub.dismiss() + LoadingDialog.dismiss() //接单成功之后刷新列表 dataBeans.removeAt(clickedPosition) searchResultAdapter.notifyItemRemoved(clickedPosition) @@ -127,7 +127,7 @@ ) } - else -> LoadingDialogHub.dismiss() + else -> LoadingDialog.dismiss() } } } @@ -162,7 +162,7 @@ } else { binding.emptyInclude.emptyView.hide() searchResultAdapter = SearchResultAdapter(this, dataBeans) - binding.resultRecyclerView.adapter = searchResultAdapter + binding.recyclerView.adapter = searchResultAdapter searchResultAdapter.setOnItemClickListener(object : SearchResultAdapter.OnItemClickListener { override fun onClicked(position: Int) { diff --git a/app/src/main/java/com/casic/app/smartwell/view/UnDeployWellActivity.kt b/app/src/main/java/com/casic/app/smartwell/view/UnDeployWellActivity.kt index 7f7cd3c..555c278 100644 --- a/app/src/main/java/com/casic/app/smartwell/view/UnDeployWellActivity.kt +++ b/app/src/main/java/com/casic/app/smartwell/view/UnDeployWellActivity.kt @@ -81,8 +81,8 @@ } } - binding.undeployListView.addItemDecoration( - RecyclerViewItemOffsets(0, 5, 0, 5) + binding.recyclerView.addItemDecoration( + RecyclerViewItemOffsets(0, 7, 0, 7) ) } @@ -147,12 +147,11 @@ } else { item.deep.toString() + "m" } - viewHolder.setText(R.id.wellNameView, item.wellName) + viewHolder.setText(R.id.wellTypeView, item.wellTypeName) .setText(R.id.wellDepthView, "深:${deep}") .setText(R.id.wellCodeView, "点位编号:${item.wellCode}") - .setText(R.id.wellTypeView, "点位类型:${item.wellTypeName}") .setText(R.id.ownerShipView, "权属单位:${item.deptName}") - .setText(R.id.wellLocationView, "点位置:${item.position}") + .setText(R.id.wellLocationView, "点位位置:${item.position}") .setOnClickListener( R.id.operationButton, object : View.OnClickListener { override fun onClick(v: View?) { @@ -185,7 +184,7 @@ ) } } - binding.undeployListView.adapter = unDeployAdapter + binding.recyclerView.adapter = unDeployAdapter unDeployAdapter.setOnItemClickedListener(object : NormalRecyclerAdapter.OnItemClickedListener { override fun onItemClicked(position: Int, t: WellListModel.DataBean.RowsBean) { diff --git a/app/src/main/java/com/casic/app/smartwell/view/WellDetailActivity.kt b/app/src/main/java/com/casic/app/smartwell/view/WellDetailActivity.kt index b50d067..eb8b468 100644 --- a/app/src/main/java/com/casic/app/smartwell/view/WellDetailActivity.kt +++ b/app/src/main/java/com/casic/app/smartwell/view/WellDetailActivity.kt @@ -16,7 +16,7 @@ import com.pengxh.kt.lite.extensions.show import com.pengxh.kt.lite.utils.Constant import com.pengxh.kt.lite.utils.LoadState -import com.pengxh.kt.lite.utils.LoadingDialogHub +import com.pengxh.kt.lite.utils.LoadingDialog import com.pengxh.kt.lite.widget.TitleBarView import com.pengxh.kt.lite.widget.dialog.AlertMessageDialog @@ -44,7 +44,7 @@ } override fun initOnCreate(savedInstanceState: Bundle?) { - val wellId = intent.getStringExtra(Constant.INTENT_PARAM)!! + val wellId = intent.getStringExtra(Constant.INTENT_PARAM_KEY)!! wellViewModel = ViewModelProvider(this)[WellViewModel::class.java] wellViewModel.getWellDetail(wellId) wellViewModel.wellDetailModel.observe(this) { @@ -132,8 +132,8 @@ override fun observeRequestState() { wellViewModel.loadState.observe(this) { when (it) { - is LoadState.Loading -> LoadingDialogHub.show(this, "数据加载中,请稍后") - else -> LoadingDialogHub.dismiss() + is LoadState.Loading -> LoadingDialog.show(this, "数据加载中,请稍后") + else -> LoadingDialog.dismiss() } } } diff --git a/app/src/main/java/com/casic/app/smartwell/view/WellManagementActivity.kt b/app/src/main/java/com/casic/app/smartwell/view/WellManagementActivity.kt index 084da95..457096b 100644 --- a/app/src/main/java/com/casic/app/smartwell/view/WellManagementActivity.kt +++ b/app/src/main/java/com/casic/app/smartwell/view/WellManagementActivity.kt @@ -94,8 +94,8 @@ } } - binding.wellListView.addItemDecoration( - RecyclerViewItemOffsets(0, 5, 0, 5) + binding.recyclerView.addItemDecoration( + RecyclerViewItemOffsets(0, 7, 0, 7) ) } @@ -175,13 +175,12 @@ } else { item.deep.toString() + "m" } - viewHolder.setText(R.id.wellNameView, item.wellName) + viewHolder.setText(R.id.wellTypeView, item.wellTypeName) .setText(R.id.wellStateView, "已${item.bfztName}") .setText(R.id.wellDepthView, "深:${deep}") .setText(R.id.wellCodeView, "点位编号:${item.wellCode}") - .setText(R.id.wellTypeView, "点位类型:${item.wellTypeName}") .setText(R.id.ownerShipView, "权属单位:${item.deptName}") - .setText(R.id.wellLocationView, "点位置:${item.position}") + .setText(R.id.wellLocationView, "点位位置:${item.position}") .setOnClickListener( R.id.navigationButton, object : View.OnClickListener { override fun onClick(v: View?) { @@ -200,7 +199,7 @@ ) } } - binding.wellListView.adapter = wellListAdapter + binding.recyclerView.adapter = wellListAdapter wellListAdapter.setOnItemClickedListener(object : NormalRecyclerAdapter.OnItemClickedListener { override fun onItemClicked(position: Int, t: WellListModel.DataBean.RowsBean) { diff --git a/app/src/main/java/com/casic/app/smartwell/view/WellMonitorActivity.kt b/app/src/main/java/com/casic/app/smartwell/view/WellMonitorActivity.kt index e3573eb..b87bdb7 100644 --- a/app/src/main/java/com/casic/app/smartwell/view/WellMonitorActivity.kt +++ b/app/src/main/java/com/casic/app/smartwell/view/WellMonitorActivity.kt @@ -11,7 +11,7 @@ import com.pengxh.kt.lite.base.KotlinBaseActivity import com.pengxh.kt.lite.utils.Constant import com.pengxh.kt.lite.utils.LoadState -import com.pengxh.kt.lite.utils.LoadingDialogHub +import com.pengxh.kt.lite.utils.LoadingDialog import com.pengxh.kt.lite.widget.TitleBarView class WellMonitorActivity : KotlinBaseActivity() { @@ -36,7 +36,7 @@ } override fun initOnCreate(savedInstanceState: Bundle?) { - val wellId = intent.getStringExtra(Constant.INTENT_PARAM)!! + val wellId = intent.getStringExtra(Constant.INTENT_PARAM_KEY)!! wellViewModel = ViewModelProvider(this)[WellViewModel::class.java] wellViewModel.getMonitorResult(wellId) wellViewModel.monitorModel.observe(this) { @@ -56,8 +56,8 @@ override fun observeRequestState() { wellViewModel.loadState.observe(this) { when (it) { - is LoadState.Loading -> LoadingDialogHub.show(this, "数据加载中,请稍后") - else -> LoadingDialogHub.dismiss() + is LoadState.Loading -> LoadingDialog.show(this, "数据加载中,请稍后") + else -> LoadingDialog.dismiss() } } } diff --git a/app/src/main/java/com/casic/app/smartwell/view/WellOperationActivity.kt b/app/src/main/java/com/casic/app/smartwell/view/WellOperationActivity.kt index 8d333bf..347ebb6 100644 --- a/app/src/main/java/com/casic/app/smartwell/view/WellOperationActivity.kt +++ b/app/src/main/java/com/casic/app/smartwell/view/WellOperationActivity.kt @@ -23,7 +23,7 @@ import com.pengxh.kt.lite.extensions.navigatePageTo import com.pengxh.kt.lite.extensions.show import com.pengxh.kt.lite.utils.LoadState -import com.pengxh.kt.lite.utils.LoadingDialogHub +import com.pengxh.kt.lite.utils.LoadingDialog import com.pengxh.kt.lite.utils.WeakReferenceHandler import com.pengxh.kt.lite.widget.dialog.AlertControlDialog @@ -109,8 +109,8 @@ } } - binding.operationListView.addItemDecoration( - RecyclerViewItemOffsets(0, 5, 0, 5) + binding.recyclerView.addItemDecoration( + RecyclerViewItemOffsets(0, 7, 0, 7) ) } @@ -123,13 +123,13 @@ override fun observeRequestState() { wellViewModel.loadState.observe(this) { when (it) { - is LoadState.Loading -> LoadingDialogHub.show(this, "处理中,请稍后") + is LoadState.Loading -> LoadingDialog.show(this, "处理中,请稍后") is LoadState.Success -> { - LoadingDialogHub.dismiss() + LoadingDialog.dismiss() wellOperationAdapter.notifyItemChanged(clickedPosition) } - else -> LoadingDialogHub.dismiss() + else -> LoadingDialog.dismiss() } } } @@ -203,24 +203,23 @@ if (item.bfztName == "布防") { viewHolder.setImageResource( R.id.wellStateView, R.drawable.bg_solid_text_green_radius_5 - ).setText(R.id.wellStateView, "撤防") + ).setText(R.id.operationButton, "撤防") } else { viewHolder.setImageResource( R.id.wellStateView, R.drawable.bg_solid_text_red_radius_5 - ).setText(R.id.wellStateView, "布防") + ).setText(R.id.operationButton, "布防") } val deep = if (item.deep.toString().isBlank()) { "未知" } else { item.deep.toString() + "m" } - viewHolder.setText(R.id.wellNameView, item.wellName) + viewHolder.setText(R.id.wellTypeView, item.wellTypeName) .setText(R.id.wellStateView, "已${item.bfztName}") .setText(R.id.wellDepthView, "深:${deep}") .setText(R.id.wellCodeView, "点位编号:${item.wellCode}") - .setText(R.id.wellTypeView, "点位类型:${item.wellTypeName}") .setText(R.id.ownerShipView, "权属单位:${item.deptName}") - .setText(R.id.wellLocationView, "点位置:${item.position}") + .setText(R.id.wellLocationView, "点位位置:${item.position}") .setOnClickListener( R.id.operationButton, object : View.OnClickListener { override fun onClick(v: View?) { @@ -280,7 +279,7 @@ ) } } - binding.operationListView.adapter = wellOperationAdapter + binding.recyclerView.adapter = wellOperationAdapter wellOperationAdapter.setOnItemClickedListener(object : NormalRecyclerAdapter.OnItemClickedListener { override fun onItemClicked(position: Int, t: WellListModel.DataBean.RowsBean) { diff --git a/app/src/main/res/drawable/ic_down.xml b/app/src/main/res/drawable/ic_down.xml index 20e6476..6987e6c 100644 --- a/app/src/main/res/drawable/ic_down.xml +++ b/app/src/main/res/drawable/ic_down.xml @@ -1,6 +1,6 @@ + + diff --git a/app/src/main/res/layout/activity_about_us.xml b/app/src/main/res/layout/activity_about_us.xml index 9091a00..d5fbd0d 100644 --- a/app/src/main/res/layout/activity_about_us.xml +++ b/app/src/main/res/layout/activity_about_us.xml @@ -12,13 +12,7 @@ android:layout_width="match_parent" android:layout_height="wrap_content" android:background="@color/mainThemeColor" - app:tbv_left_image="@drawable/ic_title_left" - app:tbv_only_show_title="false" - app:tbv_show_left_image="true" - app:tbv_show_right_image="false" - app:tbv_text="关于我们" - app:tbv_text_color="@color/white" - app:tbv_text_size="@dimen/sp_18" /> + app:tbv_text="关于我们" /> + app:tbv_text="修改密码" /> + app:tbv_text="布防列表" /> + app:tbv_text="帮助中心" /> + app:tbv_text="工单详情" /> + app:tbv_text="工单详情" /> + app:tbv_text="工单详情" /> + app:tbv_text="工单详情" /> + app:tbv_text="超时工单" /> + app:tbv_text="工单查询" /> + app:tbv_text="查询结果" /> + app:tbv_text="撤防列表" /> + app:tbv_text="个人资料" /> + app:tbv_text="点位详情" /> + app:tbv_text="监控内容" /> - - - - - - + android:layout_height="wrap_content" + android:background="@color/mainThemeColor" + app:tbv_show_left_image="false" + app:tbv_show_right_image="true" + app:tbv_text="首页" /> - + - + - - - - - - + android:layout_height="wrap_content" + android:background="@color/mainThemeColor" + app:tbv_right_image="@drawable/ic_search_white" + app:tbv_show_left_image="false" + app:tbv_show_right_image="true" + app:tbv_text="工单" /> - - - - - - \ No newline at end of file diff --git a/app/build.gradle b/app/build.gradle index 296fb6f..c18c251 100644 --- a/app/build.gradle +++ b/app/build.gradle @@ -40,10 +40,6 @@ // VIVO 相关应用参数 VIVO_APP_ID : "105749048", VIVO_APP_KEY : "e460fbf2c689e0f8c58ecc6aa62e1803", - - // 小米相关应用参数 -// XIAOMI_APP_ID : "", -// XIAOMI_APP_KEY : "", ] // 版本名后面添加一句话,意思就是flavor dimension 它的维度就是该版本号,多渠道打包很重要 @@ -107,7 +103,7 @@ dependencies { implementation fileTree(dir: 'libs', include: ['*.jar']) //基础依赖库 - implementation 'com.github.AndroidCoderPeng:Kotlin-lite-lib:1.0.10' + implementation 'com.github.AndroidCoderPeng:Kotlin-lite-lib:1.1.0' implementation 'androidx.appcompat:appcompat:1.6.1' implementation 'androidx.core:core-ktx:1.9.0' implementation 'androidx.constraintlayout:constraintlayout:2.1.4' @@ -165,8 +161,6 @@ implementation 'commons-codec:commons-codec:1.15' implementation 'com.android.support:support-annotations:28.0.0' implementation 'com.assist-v3:vivo:3.1.2' // vivo -// implementation 'com.getui.opt:xmp:3.3.1' // 小米 - //数据库框架 implementation 'org.greenrobot:greendao:3.3.0' //数据库升级 diff --git a/app/src/main/AndroidManifest.xml b/app/src/main/AndroidManifest.xml index c0af158..e0519bf 100644 --- a/app/src/main/AndroidManifest.xml +++ b/app/src/main/AndroidManifest.xml @@ -90,10 +90,10 @@ - + + android:value="ee96d8b5e12de3fbb29949efd57418a8" /> () @@ -150,7 +158,7 @@ val cameraPosition = CameraPosition(centerLatLng, 14f, 0f, 0f) val cameraUpdate = CameraUpdateFactory.newCameraPosition(cameraPosition) withContext(Dispatchers.Main) { - LoadingDialogHub.dismiss() + LoadingDialog.dismiss() aMap.animateCamera(cameraUpdate, 1500, null) } } @@ -239,11 +247,6 @@ } override fun initEvent() { - binding.rightOptionView.setOnClickListener { - val x = binding.rightOptionView.width - easyPopupWindow.width - easyPopupWindow.showAsDropDown(binding.rightOptionView, x, 0) - } - //撤防点位 binding.unDeployedLayout.setOnClickListener { requireContext().navigatePageTo() @@ -263,11 +266,11 @@ override fun observeRequestState() { wellViewModel.loadState.observe(this) { when (it) { - is LoadState.Loading -> LoadingDialogHub.show( + is LoadState.Loading -> LoadingDialog.show( requireActivity(), "数据加载中,请稍后..." ) - else -> LoadingDialogHub.dismiss() + else -> LoadingDialog.dismiss() } } } @@ -376,7 +379,7 @@ }).build().show() } }) - infoPopup.showAsDropDown(binding.rightOptionView) +// infoPopup.showAsDropDown(binding.rightOptionView) } override fun onCameraChange(p0: CameraPosition?) { diff --git a/app/src/main/java/com/casic/app/smartwell/fragment/HomePageNoClusterFragment.kt b/app/src/main/java/com/casic/app/smartwell/fragment/HomePageNoClusterFragment.kt index 802426a..b25f743 100644 --- a/app/src/main/java/com/casic/app/smartwell/fragment/HomePageNoClusterFragment.kt +++ b/app/src/main/java/com/casic/app/smartwell/fragment/HomePageNoClusterFragment.kt @@ -38,8 +38,9 @@ import com.pengxh.kt.lite.extensions.navigatePageTo import com.pengxh.kt.lite.extensions.show import com.pengxh.kt.lite.utils.LoadState -import com.pengxh.kt.lite.utils.LoadingDialogHub +import com.pengxh.kt.lite.utils.LoadingDialog import com.pengxh.kt.lite.widget.EasyPopupWindow +import com.pengxh.kt.lite.widget.TitleBarView import com.pengxh.kt.lite.widget.dialog.AlertControlDialog import kotlinx.coroutines.Dispatchers import kotlinx.coroutines.launch @@ -78,7 +79,15 @@ override fun setupTopBarLayout() { binding.rootView.initImmersionBar(this, false, R.color.mainThemeColor) - binding.titleView.text = "首页" + binding.titleView.setOnClickListener(object : TitleBarView.OnClickListener { + override fun onLeftClick() { + + } + + override fun onRightClick() { + easyPopupWindow.showAsDropDown(binding.titleView, binding.titleView.width, 0) + } + }) } override fun initOnCreate(savedInstanceState: Bundle?) { @@ -112,7 +121,7 @@ //渲染井位置 lifecycleScope.launch(Dispatchers.Main) { - LoadingDialogHub.show(requireActivity(), "数据加载中,请稍后") + LoadingDialog.show(requireActivity(), "数据加载中,请稍后") withContext(Dispatchers.IO) { //取Well缓存 val allMarkerOptions = ArrayList() @@ -144,7 +153,7 @@ val cameraPosition = CameraPosition(centerLatLng, 14f, 0f, 0f) val cameraUpdate = CameraUpdateFactory.newCameraPosition(cameraPosition) withContext(Dispatchers.Main) { - LoadingDialogHub.dismiss() + LoadingDialog.dismiss() aMap.animateCamera(cameraUpdate, 1500, null) } } @@ -238,11 +247,6 @@ } override fun initEvent() { - binding.rightOptionView.setOnClickListener { - val x = binding.rightOptionView.width - easyPopupWindow.width - easyPopupWindow.showAsDropDown(binding.rightOptionView, x, 0) - } - //撤防点位 binding.unDeployedLayout.setOnClickListener { requireContext().navigatePageTo() @@ -262,11 +266,11 @@ override fun observeRequestState() { wellViewModel.loadState.observe(this) { when (it) { - is LoadState.Loading -> LoadingDialogHub.show( + is LoadState.Loading -> LoadingDialog.show( requireActivity(), "数据加载中,请稍后..." ) - else -> LoadingDialogHub.dismiss() + else -> LoadingDialog.dismiss() } } } diff --git a/app/src/main/java/com/casic/app/smartwell/fragment/MinePageFragment.kt b/app/src/main/java/com/casic/app/smartwell/fragment/MinePageFragment.kt index 09a570c..dcb48f8 100644 --- a/app/src/main/java/com/casic/app/smartwell/fragment/MinePageFragment.kt +++ b/app/src/main/java/com/casic/app/smartwell/fragment/MinePageFragment.kt @@ -35,7 +35,7 @@ import com.pengxh.kt.lite.utils.ActivityStackManager import com.pengxh.kt.lite.utils.FileDownloadManager import com.pengxh.kt.lite.utils.LoadState -import com.pengxh.kt.lite.utils.LoadingDialogHub +import com.pengxh.kt.lite.utils.LoadingDialog import com.pengxh.kt.lite.widget.dialog.AlertControlDialog import com.pengxh.kt.lite.widget.dialog.BottomActionSheet import kotlinx.coroutines.Dispatchers @@ -60,7 +60,6 @@ override fun setupTopBarLayout() { binding.rootView.initImmersionBar(this, false, R.color.mainThemeColor) - binding.titleInclude.titleView.text = "我的" } override fun initOnCreate(savedInstanceState: Bundle?) { @@ -155,27 +154,27 @@ override fun observeRequestState() { userViewModel.loadState.observe(this) { when (it) { - is LoadState.Loading -> LoadingDialogHub.show( + is LoadState.Loading -> LoadingDialog.show( requireActivity(), "检查版本中,请稍后" ) - else -> LoadingDialogHub.dismiss() + else -> LoadingDialog.dismiss() } } wellViewModel.loadState.observe(this) { when (it) { - is LoadState.Loading -> LoadingDialogHub.show( + is LoadState.Loading -> LoadingDialog.show( requireActivity(), "数据更新中,请稍后" ) is LoadState.Fail -> { - LoadingDialogHub.dismiss() + LoadingDialog.dismiss() "数据更新超时".show(requireContext()) } else -> { - LoadingDialogHub.dismiss() + LoadingDialog.dismiss() AlertControlDialog.Builder().setContext(requireContext()).setTitle("温馨提示") .setMessage("数据更新成功,请重启应用").setNegativeButton("取消") .setPositiveButton("确定").setOnDialogButtonClickListener(object : @@ -197,17 +196,17 @@ lineViewModel.loadState.observe(this) { when (it) { - is LoadState.Loading -> LoadingDialogHub.show( + is LoadState.Loading -> LoadingDialog.show( requireActivity(), "数据更新中,请稍后" ) is LoadState.Fail -> { - LoadingDialogHub.dismiss() + LoadingDialog.dismiss() "数据更新超时".show(requireContext()) } else -> { - LoadingDialogHub.dismiss() + LoadingDialog.dismiss() AlertControlDialog.Builder().setContext(requireContext()).setTitle("温馨提示") .setMessage("数据更新成功,请重启应用").setNegativeButton("取消") .setPositiveButton("确定").setOnDialogButtonClickListener(object : diff --git a/app/src/main/java/com/casic/app/smartwell/fragment/NoticePageFragment.kt b/app/src/main/java/com/casic/app/smartwell/fragment/NoticePageFragment.kt index 171b555..3c93f54 100644 --- a/app/src/main/java/com/casic/app/smartwell/fragment/NoticePageFragment.kt +++ b/app/src/main/java/com/casic/app/smartwell/fragment/NoticePageFragment.kt @@ -48,7 +48,6 @@ override fun setupTopBarLayout() { binding.rootView.initImmersionBar(this, false, R.color.mainThemeColor) - binding.titleInclude.titleView.text = "消息" } override fun initOnCreate(savedInstanceState: Bundle?) { diff --git a/app/src/main/java/com/casic/app/smartwell/fragment/OrderListFragment.kt b/app/src/main/java/com/casic/app/smartwell/fragment/OrderListFragment.kt index 93ff35b..5e38acb 100644 --- a/app/src/main/java/com/casic/app/smartwell/fragment/OrderListFragment.kt +++ b/app/src/main/java/com/casic/app/smartwell/fragment/OrderListFragment.kt @@ -12,6 +12,7 @@ import com.casic.app.smartwell.view.SearchOrderActivity import com.pengxh.kt.lite.base.KotlinBaseFragment import com.pengxh.kt.lite.extensions.navigatePageTo +import com.pengxh.kt.lite.widget.TitleBarView class OrderListFragment : KotlinBaseFragment() { @@ -25,15 +26,22 @@ } override fun initViewBinding( - inflater: LayoutInflater, - container: ViewGroup? + inflater: LayoutInflater, container: ViewGroup? ): FragmentOrderBinding { return FragmentOrderBinding.inflate(inflater, container, false) } override fun setupTopBarLayout() { binding.rootView.initImmersionBar(this, false, R.color.mainThemeColor) - binding.titleView.text = "工单" + binding.titleView.setOnClickListener(object : TitleBarView.OnClickListener { + override fun onLeftClick() { + + } + + override fun onRightClick() { + requireContext().navigatePageTo() + } + }) } override fun initOnCreate(savedInstanceState: Bundle?) { @@ -51,8 +59,6 @@ } override fun initEvent() { - binding.rightOptionView.setOnClickListener { - requireContext().navigatePageTo() - } + } } \ No newline at end of file diff --git a/app/src/main/java/com/casic/app/smartwell/fragment/OrderNotProcessedFragment.kt b/app/src/main/java/com/casic/app/smartwell/fragment/OrderNotProcessedFragment.kt index 0b3d09d..2b6f21d 100644 --- a/app/src/main/java/com/casic/app/smartwell/fragment/OrderNotProcessedFragment.kt +++ b/app/src/main/java/com/casic/app/smartwell/fragment/OrderNotProcessedFragment.kt @@ -18,7 +18,7 @@ import com.pengxh.kt.lite.extensions.navigatePageTo import com.pengxh.kt.lite.extensions.show import com.pengxh.kt.lite.utils.LoadState -import com.pengxh.kt.lite.utils.LoadingDialogHub +import com.pengxh.kt.lite.utils.LoadingDialog import com.pengxh.kt.lite.utils.WeakReferenceHandler import com.pengxh.kt.lite.widget.dialog.AlertControlDialog @@ -78,8 +78,8 @@ operationViewModel = ViewModelProvider(this)[OperationViewModel::class.java] - binding.notProcessedView.addItemDecoration( - RecyclerViewItemOffsets(0, 5, 0, 5) + binding.recyclerView.addItemDecoration( + RecyclerViewItemOffsets(0, 7, 0, 7) ) } @@ -87,9 +87,9 @@ //接单状态处理 operationViewModel.loadState.observe(this) { when (it) { - is LoadState.Loading -> LoadingDialogHub.show(requireActivity(), "接单中,请稍后") + is LoadState.Loading -> LoadingDialog.show(requireActivity(), "接单中,请稍后") is LoadState.Success -> { - LoadingDialogHub.dismiss() + LoadingDialog.dismiss() //接单成功之后刷新列表 dataBeans.removeAt(clickedPosition) notProcessedAdapter.notifyItemRemoved(clickedPosition) @@ -98,7 +98,7 @@ ) } - else -> LoadingDialogHub.dismiss() + else -> LoadingDialog.dismiss() } } } @@ -131,7 +131,7 @@ } else { binding.emptyInclude.emptyView.hide() notProcessedAdapter = OrderNotProcessedAdapter(requireContext(), dataBeans) - binding.notProcessedView.adapter = notProcessedAdapter + binding.recyclerView.adapter = notProcessedAdapter notProcessedAdapter.setOnItemClickListener(object : OrderNotProcessedAdapter.OnItemClickListener { override fun onClicked(position: Int) { diff --git a/app/src/main/java/com/casic/app/smartwell/fragment/OvertimeNotAcceptFragment.kt b/app/src/main/java/com/casic/app/smartwell/fragment/OvertimeNotAcceptFragment.kt index a198545..9b318ca 100644 --- a/app/src/main/java/com/casic/app/smartwell/fragment/OvertimeNotAcceptFragment.kt +++ b/app/src/main/java/com/casic/app/smartwell/fragment/OvertimeNotAcceptFragment.kt @@ -18,7 +18,7 @@ import com.pengxh.kt.lite.extensions.navigatePageTo import com.pengxh.kt.lite.extensions.show import com.pengxh.kt.lite.utils.LoadState -import com.pengxh.kt.lite.utils.LoadingDialogHub +import com.pengxh.kt.lite.utils.LoadingDialog import com.pengxh.kt.lite.utils.WeakReferenceHandler import com.pengxh.kt.lite.widget.dialog.AlertControlDialog @@ -81,8 +81,8 @@ operationViewModel = ViewModelProvider(this)[OperationViewModel::class.java] - binding.notProcessedView.addItemDecoration( - RecyclerViewItemOffsets(0, 5, 0, 5) + binding.recyclerView.addItemDecoration( + RecyclerViewItemOffsets(0, 7, 0, 7) ) } @@ -90,9 +90,9 @@ //接单状态处理 operationViewModel.loadState.observe(this) { when (it) { - is LoadState.Loading -> LoadingDialogHub.show(requireActivity(), "接单中,请稍后") + is LoadState.Loading -> LoadingDialog.show(requireActivity(), "接单中,请稍后") is LoadState.Success -> { - LoadingDialogHub.dismiss() + LoadingDialog.dismiss() //接单成功之后刷新列表 dataBeans.removeAt(clickedPosition) notProcessedAdapter.notifyItemRemoved(clickedPosition) @@ -101,7 +101,7 @@ ) } - else -> LoadingDialogHub.dismiss() + else -> LoadingDialog.dismiss() } } } @@ -134,7 +134,7 @@ } else { binding.emptyInclude.emptyView.hide() notProcessedAdapter = OrderNotProcessedAdapter(requireContext(), dataBeans) - binding.notProcessedView.adapter = notProcessedAdapter + binding.recyclerView.adapter = notProcessedAdapter notProcessedAdapter.setOnItemClickListener(object : OrderNotProcessedAdapter.OnItemClickListener { override fun onClicked(position: Int) { diff --git a/app/src/main/java/com/casic/app/smartwell/greendao/DaoMaster.java b/app/src/main/java/com/casic/app/smartwell/greendao/DaoMaster.java index fdcf3a7..1e52b74 100644 --- a/app/src/main/java/com/casic/app/smartwell/greendao/DaoMaster.java +++ b/app/src/main/java/com/casic/app/smartwell/greendao/DaoMaster.java @@ -13,25 +13,20 @@ // THIS CODE IS GENERATED BY greenDAO, DO NOT EDIT. - /** * Master of DAO (schema version 4): knows all DAOs. */ public class DaoMaster extends AbstractDaoMaster { public static final int SCHEMA_VERSION = 4; - /** - * Creates underlying database table using DAOs. - */ + /** Creates underlying database table using DAOs. */ public static void createAllTables(Database db, boolean ifNotExists) { MapWellLocalBeanDao.createTable(db, ifNotExists); NoticeLocaleBeanDao.createTable(db, ifNotExists); PipeLocalBeanDao.createTable(db, ifNotExists); } - /** - * Drops underlying database table using DAOs. - */ + /** Drops underlying database table using DAOs. */ public static void dropAllTables(Database db, boolean ifExists) { MapWellLocalBeanDao.dropTable(db, ifExists); NoticeLocaleBeanDao.dropTable(db, ifExists); @@ -86,9 +81,7 @@ } } - /** - * WARNING: Drops all table on Upgrade! Use only during development. - */ + /** WARNING: Drops all table on Upgrade! Use only during development. */ public static class DevOpenHelper extends OpenHelper { public DevOpenHelper(Context context, String name) { super(context, name); diff --git a/app/src/main/java/com/casic/app/smartwell/greendao/DaoSession.java b/app/src/main/java/com/casic/app/smartwell/greendao/DaoSession.java index 0b36d17..3e40e3b 100644 --- a/app/src/main/java/com/casic/app/smartwell/greendao/DaoSession.java +++ b/app/src/main/java/com/casic/app/smartwell/greendao/DaoSession.java @@ -16,7 +16,7 @@ /** * {@inheritDoc} - * + * * @see org.greenrobot.greendao.AbstractDaoSession */ public class DaoSession extends AbstractDaoSession { @@ -50,7 +50,7 @@ registerDao(NoticeLocaleBean.class, noticeLocaleBeanDao); registerDao(PipeLocalBean.class, pipeLocalBeanDao); } - + public void clear() { mapWellLocalBeanDaoConfig.clearIdentityScope(); noticeLocaleBeanDaoConfig.clearIdentityScope(); diff --git a/app/src/main/java/com/casic/app/smartwell/greendao/MapWellLocalBeanDao.java b/app/src/main/java/com/casic/app/smartwell/greendao/MapWellLocalBeanDao.java index 8908fda..407bc92 100644 --- a/app/src/main/java/com/casic/app/smartwell/greendao/MapWellLocalBeanDao.java +++ b/app/src/main/java/com/casic/app/smartwell/greendao/MapWellLocalBeanDao.java @@ -12,10 +12,9 @@ import org.greenrobot.greendao.internal.DaoConfig; // THIS CODE IS GENERATED BY greenDAO, DO NOT EDIT. - -/** +/** * DAO for table "MAP_WELL_LOCAL_BEAN". - */ +*/ public class MapWellLocalBeanDao extends AbstractDao { public static final String TABLENAME = "MAP_WELL_LOCAL_BEAN"; @@ -57,16 +56,14 @@ public MapWellLocalBeanDao(DaoConfig config) { super(config); } - + public MapWellLocalBeanDao(DaoConfig config, DaoSession daoSession) { super(config, daoSession); } - /** - * Creates the underlying database table. - */ + /** Creates the underlying database table. */ public static void createTable(Database db, boolean ifNotExists) { - String constraint = ifNotExists ? "IF NOT EXISTS " : ""; + String constraint = ifNotExists? "IF NOT EXISTS ": ""; db.execSQL("CREATE TABLE " + constraint + "\"MAP_WELL_LOCAL_BEAN\" (" + // "\"_id\" INTEGER PRIMARY KEY AUTOINCREMENT ," + // 0: kId "\"AREA\" TEXT," + // 1: area @@ -96,9 +93,7 @@ "\"WELL_TYPE_NAME\" TEXT);"); // 25: wellTypeName } - /** - * Drops the underlying database table. - */ + /** Drops the underlying database table. */ public static void dropTable(Database db, boolean ifExists) { String sql = "DROP TABLE " + (ifExists ? "IF EXISTS " : "") + "\"MAP_WELL_LOCAL_BEAN\""; db.execSQL(sql); @@ -107,132 +102,132 @@ @Override protected final void bindValues(DatabaseStatement stmt, MapWellLocalBean entity) { stmt.clearBindings(); - + Long kId = entity.getKId(); if (kId != null) { stmt.bindLong(1, kId); } - + String area = entity.getArea(); if (area != null) { stmt.bindString(2, area); } - + String bfzt = entity.getBfzt(); if (bfzt != null) { stmt.bindString(3, bfzt); } - + String bfztName = entity.getBfztName(); if (bfztName != null) { stmt.bindString(4, bfztName); } - + String coordinateX = entity.getCoordinateX(); if (coordinateX != null) { stmt.bindString(5, coordinateX); } - + String coordinateY = entity.getCoordinateY(); if (coordinateY != null) { stmt.bindString(6, coordinateY); } - + String deep = entity.getDeep(); if (deep != null) { stmt.bindString(7, deep); } - + String deptName = entity.getDeptName(); if (deptName != null) { stmt.bindString(8, deptName); } - + String deptid = entity.getDeptid(); if (deptid != null) { stmt.bindString(9, deptid); } - + String id = entity.getId(); if (id != null) { stmt.bindString(10, id); } - + String latBaidu = entity.getLatBaidu(); if (latBaidu != null) { stmt.bindString(11, latBaidu); } - + String latGaode = entity.getLatGaode(); if (latGaode != null) { stmt.bindString(12, latGaode); } - + String lngBaidu = entity.getLngBaidu(); if (lngBaidu != null) { stmt.bindString(13, lngBaidu); } - + String lngGaode = entity.getLngGaode(); if (lngGaode != null) { stmt.bindString(14, lngGaode); } - + String notes = entity.getNotes(); if (notes != null) { stmt.bindString(15, notes); } - + String photos = entity.getPhotos(); if (photos != null) { stmt.bindString(16, photos); } - + String position = entity.getPosition(); if (position != null) { stmt.bindString(17, position); } - + String staff = entity.getStaff(); if (staff != null) { stmt.bindString(18, staff); } - + String tel = entity.getTel(); if (tel != null) { stmt.bindString(19, tel); } - + String ts = entity.getTs(); if (ts != null) { stmt.bindString(20, ts); } - + String valid = entity.getValid(); if (valid != null) { stmt.bindString(21, valid); } - + String watchData = entity.getWatchData(); if (watchData != null) { stmt.bindString(22, watchData); } - + String wellCode = entity.getWellCode(); if (wellCode != null) { stmt.bindString(23, wellCode); } - + String wellName = entity.getWellName(); if (wellName != null) { stmt.bindString(24, wellName); } - + String wellType = entity.getWellType(); if (wellType != null) { stmt.bindString(25, wellType); } - + String wellTypeName = entity.getWellTypeName(); if (wellTypeName != null) { stmt.bindString(26, wellTypeName); @@ -242,132 +237,132 @@ @Override protected final void bindValues(SQLiteStatement stmt, MapWellLocalBean entity) { stmt.clearBindings(); - + Long kId = entity.getKId(); if (kId != null) { stmt.bindLong(1, kId); } - + String area = entity.getArea(); if (area != null) { stmt.bindString(2, area); } - + String bfzt = entity.getBfzt(); if (bfzt != null) { stmt.bindString(3, bfzt); } - + String bfztName = entity.getBfztName(); if (bfztName != null) { stmt.bindString(4, bfztName); } - + String coordinateX = entity.getCoordinateX(); if (coordinateX != null) { stmt.bindString(5, coordinateX); } - + String coordinateY = entity.getCoordinateY(); if (coordinateY != null) { stmt.bindString(6, coordinateY); } - + String deep = entity.getDeep(); if (deep != null) { stmt.bindString(7, deep); } - + String deptName = entity.getDeptName(); if (deptName != null) { stmt.bindString(8, deptName); } - + String deptid = entity.getDeptid(); if (deptid != null) { stmt.bindString(9, deptid); } - + String id = entity.getId(); if (id != null) { stmt.bindString(10, id); } - + String latBaidu = entity.getLatBaidu(); if (latBaidu != null) { stmt.bindString(11, latBaidu); } - + String latGaode = entity.getLatGaode(); if (latGaode != null) { stmt.bindString(12, latGaode); } - + String lngBaidu = entity.getLngBaidu(); if (lngBaidu != null) { stmt.bindString(13, lngBaidu); } - + String lngGaode = entity.getLngGaode(); if (lngGaode != null) { stmt.bindString(14, lngGaode); } - + String notes = entity.getNotes(); if (notes != null) { stmt.bindString(15, notes); } - + String photos = entity.getPhotos(); if (photos != null) { stmt.bindString(16, photos); } - + String position = entity.getPosition(); if (position != null) { stmt.bindString(17, position); } - + String staff = entity.getStaff(); if (staff != null) { stmt.bindString(18, staff); } - + String tel = entity.getTel(); if (tel != null) { stmt.bindString(19, tel); } - + String ts = entity.getTs(); if (ts != null) { stmt.bindString(20, ts); } - + String valid = entity.getValid(); if (valid != null) { stmt.bindString(21, valid); } - + String watchData = entity.getWatchData(); if (watchData != null) { stmt.bindString(22, watchData); } - + String wellCode = entity.getWellCode(); if (wellCode != null) { stmt.bindString(23, wellCode); } - + String wellName = entity.getWellName(); if (wellName != null) { stmt.bindString(24, wellName); } - + String wellType = entity.getWellType(); if (wellType != null) { stmt.bindString(25, wellType); } - + String wellTypeName = entity.getWellTypeName(); if (wellTypeName != null) { stmt.bindString(26, wellTypeName); @@ -377,41 +372,41 @@ @Override public Long readKey(Cursor cursor, int offset) { return cursor.isNull(offset + 0) ? null : cursor.getLong(offset + 0); - } + } @Override public MapWellLocalBean readEntity(Cursor cursor, int offset) { MapWellLocalBean entity = new MapWellLocalBean( // - cursor.isNull(offset + 0) ? null : cursor.getLong(offset + 0), // kId - cursor.isNull(offset + 1) ? null : cursor.getString(offset + 1), // area - cursor.isNull(offset + 2) ? null : cursor.getString(offset + 2), // bfzt - cursor.isNull(offset + 3) ? null : cursor.getString(offset + 3), // bfztName - cursor.isNull(offset + 4) ? null : cursor.getString(offset + 4), // coordinateX - cursor.isNull(offset + 5) ? null : cursor.getString(offset + 5), // coordinateY - cursor.isNull(offset + 6) ? null : cursor.getString(offset + 6), // deep - cursor.isNull(offset + 7) ? null : cursor.getString(offset + 7), // deptName - cursor.isNull(offset + 8) ? null : cursor.getString(offset + 8), // deptid - cursor.isNull(offset + 9) ? null : cursor.getString(offset + 9), // id - cursor.isNull(offset + 10) ? null : cursor.getString(offset + 10), // latBaidu - cursor.isNull(offset + 11) ? null : cursor.getString(offset + 11), // latGaode - cursor.isNull(offset + 12) ? null : cursor.getString(offset + 12), // lngBaidu - cursor.isNull(offset + 13) ? null : cursor.getString(offset + 13), // lngGaode - cursor.isNull(offset + 14) ? null : cursor.getString(offset + 14), // notes - cursor.isNull(offset + 15) ? null : cursor.getString(offset + 15), // photos - cursor.isNull(offset + 16) ? null : cursor.getString(offset + 16), // position - cursor.isNull(offset + 17) ? null : cursor.getString(offset + 17), // staff - cursor.isNull(offset + 18) ? null : cursor.getString(offset + 18), // tel - cursor.isNull(offset + 19) ? null : cursor.getString(offset + 19), // ts - cursor.isNull(offset + 20) ? null : cursor.getString(offset + 20), // valid - cursor.isNull(offset + 21) ? null : cursor.getString(offset + 21), // watchData - cursor.isNull(offset + 22) ? null : cursor.getString(offset + 22), // wellCode - cursor.isNull(offset + 23) ? null : cursor.getString(offset + 23), // wellName - cursor.isNull(offset + 24) ? null : cursor.getString(offset + 24), // wellType - cursor.isNull(offset + 25) ? null : cursor.getString(offset + 25) // wellTypeName + cursor.isNull(offset + 0) ? null : cursor.getLong(offset + 0), // kId + cursor.isNull(offset + 1) ? null : cursor.getString(offset + 1), // area + cursor.isNull(offset + 2) ? null : cursor.getString(offset + 2), // bfzt + cursor.isNull(offset + 3) ? null : cursor.getString(offset + 3), // bfztName + cursor.isNull(offset + 4) ? null : cursor.getString(offset + 4), // coordinateX + cursor.isNull(offset + 5) ? null : cursor.getString(offset + 5), // coordinateY + cursor.isNull(offset + 6) ? null : cursor.getString(offset + 6), // deep + cursor.isNull(offset + 7) ? null : cursor.getString(offset + 7), // deptName + cursor.isNull(offset + 8) ? null : cursor.getString(offset + 8), // deptid + cursor.isNull(offset + 9) ? null : cursor.getString(offset + 9), // id + cursor.isNull(offset + 10) ? null : cursor.getString(offset + 10), // latBaidu + cursor.isNull(offset + 11) ? null : cursor.getString(offset + 11), // latGaode + cursor.isNull(offset + 12) ? null : cursor.getString(offset + 12), // lngBaidu + cursor.isNull(offset + 13) ? null : cursor.getString(offset + 13), // lngGaode + cursor.isNull(offset + 14) ? null : cursor.getString(offset + 14), // notes + cursor.isNull(offset + 15) ? null : cursor.getString(offset + 15), // photos + cursor.isNull(offset + 16) ? null : cursor.getString(offset + 16), // position + cursor.isNull(offset + 17) ? null : cursor.getString(offset + 17), // staff + cursor.isNull(offset + 18) ? null : cursor.getString(offset + 18), // tel + cursor.isNull(offset + 19) ? null : cursor.getString(offset + 19), // ts + cursor.isNull(offset + 20) ? null : cursor.getString(offset + 20), // valid + cursor.isNull(offset + 21) ? null : cursor.getString(offset + 21), // watchData + cursor.isNull(offset + 22) ? null : cursor.getString(offset + 22), // wellCode + cursor.isNull(offset + 23) ? null : cursor.getString(offset + 23), // wellName + cursor.isNull(offset + 24) ? null : cursor.getString(offset + 24), // wellType + cursor.isNull(offset + 25) ? null : cursor.getString(offset + 25) // wellTypeName ); return entity; } - + @Override public void readEntity(Cursor cursor, MapWellLocalBean entity, int offset) { entity.setKId(cursor.isNull(offset + 0) ? null : cursor.getLong(offset + 0)); @@ -440,17 +435,17 @@ entity.setWellName(cursor.isNull(offset + 23) ? null : cursor.getString(offset + 23)); entity.setWellType(cursor.isNull(offset + 24) ? null : cursor.getString(offset + 24)); entity.setWellTypeName(cursor.isNull(offset + 25) ? null : cursor.getString(offset + 25)); - } - + } + @Override protected final Long updateKeyAfterInsert(MapWellLocalBean entity, long rowId) { entity.setKId(rowId); return rowId; } - + @Override public Long getKey(MapWellLocalBean entity) { - if (entity != null) { + if(entity != null) { return entity.getKId(); } else { return null; @@ -466,5 +461,5 @@ protected final boolean isEntityUpdateable() { return true; } - + } diff --git a/app/src/main/java/com/casic/app/smartwell/greendao/NoticeLocaleBeanDao.java b/app/src/main/java/com/casic/app/smartwell/greendao/NoticeLocaleBeanDao.java index 64312ed..deb2d49 100644 --- a/app/src/main/java/com/casic/app/smartwell/greendao/NoticeLocaleBeanDao.java +++ b/app/src/main/java/com/casic/app/smartwell/greendao/NoticeLocaleBeanDao.java @@ -12,10 +12,9 @@ import org.greenrobot.greendao.internal.DaoConfig; // THIS CODE IS GENERATED BY greenDAO, DO NOT EDIT. - -/** +/** * DAO for table "NOTICE_LOCALE_BEAN". - */ +*/ public class NoticeLocaleBeanDao extends AbstractDao { public static final String TABLENAME = "NOTICE_LOCALE_BEAN"; @@ -43,16 +42,14 @@ public NoticeLocaleBeanDao(DaoConfig config) { super(config); } - + public NoticeLocaleBeanDao(DaoConfig config, DaoSession daoSession) { super(config, daoSession); } - /** - * Creates the underlying database table. - */ + /** Creates the underlying database table. */ public static void createTable(Database db, boolean ifNotExists) { - String constraint = ifNotExists ? "IF NOT EXISTS " : ""; + String constraint = ifNotExists? "IF NOT EXISTS ": ""; db.execSQL("CREATE TABLE " + constraint + "\"NOTICE_LOCALE_BEAN\" (" + // "\"_id\" INTEGER PRIMARY KEY AUTOINCREMENT ," + // 0: id "\"MESSAGE_ID\" TEXT UNIQUE ," + // 1: messageId @@ -68,9 +65,7 @@ "\"NOTICE_TIME\" TEXT);"); // 11: noticeTime } - /** - * Drops the underlying database table. - */ + /** Drops the underlying database table. */ public static void dropTable(Database db, boolean ifExists) { String sql = "DROP TABLE " + (ifExists ? "IF EXISTS " : "") + "\"NOTICE_LOCALE_BEAN\""; db.execSQL(sql); @@ -79,62 +74,62 @@ @Override protected final void bindValues(DatabaseStatement stmt, NoticeLocaleBean entity) { stmt.clearBindings(); - + Long id = entity.getId(); if (id != null) { stmt.bindLong(1, id); } - + String messageId = entity.getMessageId(); if (messageId != null) { stmt.bindString(2, messageId); } - + String appid = entity.getAppid(); if (appid != null) { stmt.bindString(3, appid); } - + String clientId = entity.getClientId(); if (clientId != null) { stmt.bindString(4, clientId); } - + String taskId = entity.getTaskId(); if (taskId != null) { stmt.bindString(5, taskId); } - + String userId = entity.getUserId(); if (userId != null) { stmt.bindString(6, userId); } - + String title = entity.getTitle(); if (title != null) { stmt.bindString(7, title); } - + String content = entity.getContent(); if (content != null) { stmt.bindString(8, content); } - + String deviceCode = entity.getDeviceCode(); if (deviceCode != null) { stmt.bindString(9, deviceCode); } - + String jobId = entity.getJobId(); if (jobId != null) { stmt.bindString(10, jobId); } - + String isRead = entity.getIsRead(); if (isRead != null) { stmt.bindString(11, isRead); } - + String noticeTime = entity.getNoticeTime(); if (noticeTime != null) { stmt.bindString(12, noticeTime); @@ -144,62 +139,62 @@ @Override protected final void bindValues(SQLiteStatement stmt, NoticeLocaleBean entity) { stmt.clearBindings(); - + Long id = entity.getId(); if (id != null) { stmt.bindLong(1, id); } - + String messageId = entity.getMessageId(); if (messageId != null) { stmt.bindString(2, messageId); } - + String appid = entity.getAppid(); if (appid != null) { stmt.bindString(3, appid); } - + String clientId = entity.getClientId(); if (clientId != null) { stmt.bindString(4, clientId); } - + String taskId = entity.getTaskId(); if (taskId != null) { stmt.bindString(5, taskId); } - + String userId = entity.getUserId(); if (userId != null) { stmt.bindString(6, userId); } - + String title = entity.getTitle(); if (title != null) { stmt.bindString(7, title); } - + String content = entity.getContent(); if (content != null) { stmt.bindString(8, content); } - + String deviceCode = entity.getDeviceCode(); if (deviceCode != null) { stmt.bindString(9, deviceCode); } - + String jobId = entity.getJobId(); if (jobId != null) { stmt.bindString(10, jobId); } - + String isRead = entity.getIsRead(); if (isRead != null) { stmt.bindString(11, isRead); } - + String noticeTime = entity.getNoticeTime(); if (noticeTime != null) { stmt.bindString(12, noticeTime); @@ -209,27 +204,27 @@ @Override public Long readKey(Cursor cursor, int offset) { return cursor.isNull(offset + 0) ? null : cursor.getLong(offset + 0); - } + } @Override public NoticeLocaleBean readEntity(Cursor cursor, int offset) { NoticeLocaleBean entity = new NoticeLocaleBean( // - cursor.isNull(offset + 0) ? null : cursor.getLong(offset + 0), // id - cursor.isNull(offset + 1) ? null : cursor.getString(offset + 1), // messageId - cursor.isNull(offset + 2) ? null : cursor.getString(offset + 2), // appid - cursor.isNull(offset + 3) ? null : cursor.getString(offset + 3), // clientId - cursor.isNull(offset + 4) ? null : cursor.getString(offset + 4), // taskId - cursor.isNull(offset + 5) ? null : cursor.getString(offset + 5), // userId - cursor.isNull(offset + 6) ? null : cursor.getString(offset + 6), // title - cursor.isNull(offset + 7) ? null : cursor.getString(offset + 7), // content - cursor.isNull(offset + 8) ? null : cursor.getString(offset + 8), // deviceCode - cursor.isNull(offset + 9) ? null : cursor.getString(offset + 9), // jobId - cursor.isNull(offset + 10) ? null : cursor.getString(offset + 10), // isRead - cursor.isNull(offset + 11) ? null : cursor.getString(offset + 11) // noticeTime + cursor.isNull(offset + 0) ? null : cursor.getLong(offset + 0), // id + cursor.isNull(offset + 1) ? null : cursor.getString(offset + 1), // messageId + cursor.isNull(offset + 2) ? null : cursor.getString(offset + 2), // appid + cursor.isNull(offset + 3) ? null : cursor.getString(offset + 3), // clientId + cursor.isNull(offset + 4) ? null : cursor.getString(offset + 4), // taskId + cursor.isNull(offset + 5) ? null : cursor.getString(offset + 5), // userId + cursor.isNull(offset + 6) ? null : cursor.getString(offset + 6), // title + cursor.isNull(offset + 7) ? null : cursor.getString(offset + 7), // content + cursor.isNull(offset + 8) ? null : cursor.getString(offset + 8), // deviceCode + cursor.isNull(offset + 9) ? null : cursor.getString(offset + 9), // jobId + cursor.isNull(offset + 10) ? null : cursor.getString(offset + 10), // isRead + cursor.isNull(offset + 11) ? null : cursor.getString(offset + 11) // noticeTime ); return entity; } - + @Override public void readEntity(Cursor cursor, NoticeLocaleBean entity, int offset) { entity.setId(cursor.isNull(offset + 0) ? null : cursor.getLong(offset + 0)); @@ -244,17 +239,17 @@ entity.setJobId(cursor.isNull(offset + 9) ? null : cursor.getString(offset + 9)); entity.setIsRead(cursor.isNull(offset + 10) ? null : cursor.getString(offset + 10)); entity.setNoticeTime(cursor.isNull(offset + 11) ? null : cursor.getString(offset + 11)); - } - + } + @Override protected final Long updateKeyAfterInsert(NoticeLocaleBean entity, long rowId) { entity.setId(rowId); return rowId; } - + @Override public Long getKey(NoticeLocaleBean entity) { - if (entity != null) { + if(entity != null) { return entity.getId(); } else { return null; @@ -270,5 +265,5 @@ protected final boolean isEntityUpdateable() { return true; } - + } diff --git a/app/src/main/java/com/casic/app/smartwell/greendao/PipeLocalBeanDao.java b/app/src/main/java/com/casic/app/smartwell/greendao/PipeLocalBeanDao.java index aab4d3f..df5515a 100644 --- a/app/src/main/java/com/casic/app/smartwell/greendao/PipeLocalBeanDao.java +++ b/app/src/main/java/com/casic/app/smartwell/greendao/PipeLocalBeanDao.java @@ -12,10 +12,9 @@ import org.greenrobot.greendao.internal.DaoConfig; // THIS CODE IS GENERATED BY greenDAO, DO NOT EDIT. - -/** +/** * DAO for table "PIPE_LOCAL_BEAN". - */ +*/ public class PipeLocalBeanDao extends AbstractDao { public static final String TABLENAME = "PIPE_LOCAL_BEAN"; @@ -37,16 +36,14 @@ public PipeLocalBeanDao(DaoConfig config) { super(config); } - + public PipeLocalBeanDao(DaoConfig config, DaoSession daoSession) { super(config, daoSession); } - /** - * Creates the underlying database table. - */ + /** Creates the underlying database table. */ public static void createTable(Database db, boolean ifNotExists) { - String constraint = ifNotExists ? "IF NOT EXISTS " : ""; + String constraint = ifNotExists? "IF NOT EXISTS ": ""; db.execSQL("CREATE TABLE " + constraint + "\"PIPE_LOCAL_BEAN\" (" + // "\"_id\" INTEGER PRIMARY KEY AUTOINCREMENT ," + // 0: id "\"PIPE_CODE\" TEXT," + // 1: pipeCode @@ -56,9 +53,7 @@ "\"START_LONGITUDE_GD\" TEXT);"); // 5: startLongitudeGd } - /** - * Drops the underlying database table. - */ + /** Drops the underlying database table. */ public static void dropTable(Database db, boolean ifExists) { String sql = "DROP TABLE " + (ifExists ? "IF EXISTS " : "") + "\"PIPE_LOCAL_BEAN\""; db.execSQL(sql); @@ -67,32 +62,32 @@ @Override protected final void bindValues(DatabaseStatement stmt, PipeLocalBean entity) { stmt.clearBindings(); - + Long id = entity.getId(); if (id != null) { stmt.bindLong(1, id); } - + String pipeCode = entity.getPipeCode(); if (pipeCode != null) { stmt.bindString(2, pipeCode); } - + String endLatitudeGd = entity.getEndLatitudeGd(); if (endLatitudeGd != null) { stmt.bindString(3, endLatitudeGd); } - + String endLongitudeGd = entity.getEndLongitudeGd(); if (endLongitudeGd != null) { stmt.bindString(4, endLongitudeGd); } - + String startLatitudeGd = entity.getStartLatitudeGd(); if (startLatitudeGd != null) { stmt.bindString(5, startLatitudeGd); } - + String startLongitudeGd = entity.getStartLongitudeGd(); if (startLongitudeGd != null) { stmt.bindString(6, startLongitudeGd); @@ -102,32 +97,32 @@ @Override protected final void bindValues(SQLiteStatement stmt, PipeLocalBean entity) { stmt.clearBindings(); - + Long id = entity.getId(); if (id != null) { stmt.bindLong(1, id); } - + String pipeCode = entity.getPipeCode(); if (pipeCode != null) { stmt.bindString(2, pipeCode); } - + String endLatitudeGd = entity.getEndLatitudeGd(); if (endLatitudeGd != null) { stmt.bindString(3, endLatitudeGd); } - + String endLongitudeGd = entity.getEndLongitudeGd(); if (endLongitudeGd != null) { stmt.bindString(4, endLongitudeGd); } - + String startLatitudeGd = entity.getStartLatitudeGd(); if (startLatitudeGd != null) { stmt.bindString(5, startLatitudeGd); } - + String startLongitudeGd = entity.getStartLongitudeGd(); if (startLongitudeGd != null) { stmt.bindString(6, startLongitudeGd); @@ -137,21 +132,21 @@ @Override public Long readKey(Cursor cursor, int offset) { return cursor.isNull(offset + 0) ? null : cursor.getLong(offset + 0); - } + } @Override public PipeLocalBean readEntity(Cursor cursor, int offset) { PipeLocalBean entity = new PipeLocalBean( // - cursor.isNull(offset + 0) ? null : cursor.getLong(offset + 0), // id - cursor.isNull(offset + 1) ? null : cursor.getString(offset + 1), // pipeCode - cursor.isNull(offset + 2) ? null : cursor.getString(offset + 2), // endLatitudeGd - cursor.isNull(offset + 3) ? null : cursor.getString(offset + 3), // endLongitudeGd - cursor.isNull(offset + 4) ? null : cursor.getString(offset + 4), // startLatitudeGd - cursor.isNull(offset + 5) ? null : cursor.getString(offset + 5) // startLongitudeGd + cursor.isNull(offset + 0) ? null : cursor.getLong(offset + 0), // id + cursor.isNull(offset + 1) ? null : cursor.getString(offset + 1), // pipeCode + cursor.isNull(offset + 2) ? null : cursor.getString(offset + 2), // endLatitudeGd + cursor.isNull(offset + 3) ? null : cursor.getString(offset + 3), // endLongitudeGd + cursor.isNull(offset + 4) ? null : cursor.getString(offset + 4), // startLatitudeGd + cursor.isNull(offset + 5) ? null : cursor.getString(offset + 5) // startLongitudeGd ); return entity; } - + @Override public void readEntity(Cursor cursor, PipeLocalBean entity, int offset) { entity.setId(cursor.isNull(offset + 0) ? null : cursor.getLong(offset + 0)); @@ -160,17 +155,17 @@ entity.setEndLongitudeGd(cursor.isNull(offset + 3) ? null : cursor.getString(offset + 3)); entity.setStartLatitudeGd(cursor.isNull(offset + 4) ? null : cursor.getString(offset + 4)); entity.setStartLongitudeGd(cursor.isNull(offset + 5) ? null : cursor.getString(offset + 5)); - } - + } + @Override protected final Long updateKeyAfterInsert(PipeLocalBean entity, long rowId) { entity.setId(rowId); return rowId; } - + @Override public Long getKey(PipeLocalBean entity) { - if (entity != null) { + if(entity != null) { return entity.getId(); } else { return null; @@ -186,5 +181,5 @@ protected final boolean isEntityUpdateable() { return true; } - + } diff --git a/app/src/main/java/com/casic/app/smartwell/view/ChangePasswordActivity.kt b/app/src/main/java/com/casic/app/smartwell/view/ChangePasswordActivity.kt index 8e41039..9f1dd40 100644 --- a/app/src/main/java/com/casic/app/smartwell/view/ChangePasswordActivity.kt +++ b/app/src/main/java/com/casic/app/smartwell/view/ChangePasswordActivity.kt @@ -14,7 +14,7 @@ import com.pengxh.kt.lite.extensions.show import com.pengxh.kt.lite.utils.ActivityStackManager import com.pengxh.kt.lite.utils.LoadState -import com.pengxh.kt.lite.utils.LoadingDialogHub +import com.pengxh.kt.lite.utils.LoadingDialog import com.pengxh.kt.lite.widget.TitleBarView import java.nio.charset.StandardCharsets @@ -46,15 +46,15 @@ override fun observeRequestState() { userViewModel.loadState.observe(this) { when (it) { - is LoadState.Loading -> LoadingDialogHub.show(this, "修改中,请稍后") + is LoadState.Loading -> LoadingDialog.show(this, "修改中,请稍后") is LoadState.Success -> { - LoadingDialogHub.dismiss() + LoadingDialog.dismiss() AuthenticationHelper.removeToken() this.navigatePageTo() ActivityStackManager.finishAllActivity() } - else -> LoadingDialogHub.dismiss() + else -> LoadingDialog.dismiss() } } } diff --git a/app/src/main/java/com/casic/app/smartwell/view/DeployedWellActivity.kt b/app/src/main/java/com/casic/app/smartwell/view/DeployedWellActivity.kt index fb4339c..28a5078 100644 --- a/app/src/main/java/com/casic/app/smartwell/view/DeployedWellActivity.kt +++ b/app/src/main/java/com/casic/app/smartwell/view/DeployedWellActivity.kt @@ -83,8 +83,8 @@ } //添加分割线 - binding.deployedListView.addItemDecoration( - RecyclerViewItemOffsets(0, 5, 0, 5) + binding.recyclerView.addItemDecoration( + RecyclerViewItemOffsets(0, 7, 0, 7) ) } @@ -149,12 +149,11 @@ } else { item.deep.toString() + "m" } - viewHolder.setText(R.id.wellNameView, item.wellName) + viewHolder.setText(R.id.wellTypeView, item.wellTypeName) .setText(R.id.wellDepthView, "深:${deep}") .setText(R.id.wellCodeView, "点位编号:${item.wellCode}") - .setText(R.id.wellTypeView, "点位类型:${item.wellTypeName}") .setText(R.id.ownerShipView, "权属单位:${item.deptName}") - .setText(R.id.wellLocationView, "点位置:${item.position}") + .setText(R.id.wellLocationView, "点位位置:${item.position}") .setOnClickListener( R.id.operationButton, object : View.OnClickListener { override fun onClick(v: View?) { @@ -207,7 +206,7 @@ }) } } - binding.deployedListView.adapter = deployAdapter + binding.recyclerView.adapter = deployAdapter deployAdapter.setOnItemClickedListener(object : NormalRecyclerAdapter.OnItemClickedListener { override fun onItemClicked(position: Int, t: WellListModel.DataBean.RowsBean) { diff --git a/app/src/main/java/com/casic/app/smartwell/view/LoginActivity.kt b/app/src/main/java/com/casic/app/smartwell/view/LoginActivity.kt index e4bb0e3..834527b 100644 --- a/app/src/main/java/com/casic/app/smartwell/view/LoginActivity.kt +++ b/app/src/main/java/com/casic/app/smartwell/view/LoginActivity.kt @@ -21,7 +21,7 @@ import com.pengxh.kt.lite.extensions.navigatePageTo import com.pengxh.kt.lite.extensions.readAssetsFile import com.pengxh.kt.lite.extensions.show -import com.pengxh.kt.lite.utils.LoadingDialogHub +import com.pengxh.kt.lite.utils.LoadingDialog import com.pengxh.kt.lite.utils.SaveKeyValues import kotlinx.coroutines.Dispatchers import kotlinx.coroutines.launch @@ -106,11 +106,11 @@ override fun observeRequestState() { authenticateViewModel.loadState.observe(this) { - LoadingDialogHub.show(this, "登录中,请稍后") + LoadingDialog.show(this, "登录中,请稍后") } loginViewModel.loadState.observe(this) { - LoadingDialogHub.dismiss() + LoadingDialog.dismiss() } } diff --git a/app/src/main/java/com/casic/app/smartwell/view/OrderCompletedDetailActivity.kt b/app/src/main/java/com/casic/app/smartwell/view/OrderCompletedDetailActivity.kt index db8ad1f..75cd905 100644 --- a/app/src/main/java/com/casic/app/smartwell/view/OrderCompletedDetailActivity.kt +++ b/app/src/main/java/com/casic/app/smartwell/view/OrderCompletedDetailActivity.kt @@ -17,7 +17,7 @@ import com.pengxh.kt.lite.extensions.show import com.pengxh.kt.lite.utils.Constant import com.pengxh.kt.lite.utils.LoadState -import com.pengxh.kt.lite.utils.LoadingDialogHub +import com.pengxh.kt.lite.utils.LoadingDialog import com.pengxh.kt.lite.widget.TitleBarView import com.pengxh.kt.lite.widget.dialog.AlertMessageDialog @@ -44,7 +44,7 @@ } override fun initOnCreate(savedInstanceState: Bundle?) { - val jobId = intent.getStringExtra(Constant.INTENT_PARAM)!! + val jobId = intent.getStringExtra(Constant.INTENT_PARAM_KEY)!! orderViewModel = ViewModelProvider(this)[OrderViewModel::class.java] orderViewModel.getWorkOrderDetail(jobId) orderViewModel.detailModel.observe(this) { @@ -154,8 +154,8 @@ override fun observeRequestState() { orderViewModel.loadState.observe(this) { when (it) { - is LoadState.Loading -> LoadingDialogHub.show(this, "数据加载中,请稍后") - else -> LoadingDialogHub.dismiss() + is LoadState.Loading -> LoadingDialog.show(this, "数据加载中,请稍后") + else -> LoadingDialog.dismiss() } } } diff --git a/app/src/main/java/com/casic/app/smartwell/view/OrderInHandleDetailActivity.kt b/app/src/main/java/com/casic/app/smartwell/view/OrderInHandleDetailActivity.kt index d70a979..04a7d5d 100644 --- a/app/src/main/java/com/casic/app/smartwell/view/OrderInHandleDetailActivity.kt +++ b/app/src/main/java/com/casic/app/smartwell/view/OrderInHandleDetailActivity.kt @@ -38,7 +38,7 @@ import com.pengxh.kt.lite.extensions.show import com.pengxh.kt.lite.utils.Constant import com.pengxh.kt.lite.utils.LoadState -import com.pengxh.kt.lite.utils.LoadingDialogHub +import com.pengxh.kt.lite.utils.LoadingDialog import com.pengxh.kt.lite.widget.TitleBarView import com.pengxh.kt.lite.widget.dialog.AlertControlDialog import com.pengxh.kt.lite.widget.dialog.AlertMessageDialog @@ -93,7 +93,7 @@ ) binding.addImageRecyclerView.adapter = imageAdapter - val jobId = intent.getStringExtra(Constant.INTENT_PARAM)!!//初始化图片九宫格 + val jobId = intent.getStringExtra(Constant.INTENT_PARAM_KEY)!!//初始化图片九宫格 orderViewModel.getWorkOrderDetail(jobId) orderViewModel.detailModel.observe(this) { if (it.code == 200) { @@ -312,41 +312,41 @@ override fun observeRequestState() { orderViewModel.loadState.observe(this) { when (it) { - is LoadState.Loading -> LoadingDialogHub.show(this, "数据加载中,请稍后") - else -> LoadingDialogHub.dismiss() + is LoadState.Loading -> LoadingDialog.show(this, "数据加载中,请稍后") + else -> LoadingDialog.dismiss() } } uploadImageViewModel.loadState.observe(this) { when (it) { - LoadState.Loading -> LoadingDialogHub.show(this, "图片上传中,请稍后...") - else -> LoadingDialogHub.dismiss() + LoadState.Loading -> LoadingDialog.show(this, "图片上传中,请稍后...") + else -> LoadingDialog.dismiss() } } //转单状态处理 operationViewModel.loadState.observe(this) { when (it) { - is LoadState.Loading -> LoadingDialogHub.show(this, "转单中,请稍后") + is LoadState.Loading -> LoadingDialog.show(this, "转单中,请稍后") is LoadState.Success -> { - LoadingDialogHub.dismiss() + LoadingDialog.dismiss() this.finish() } - else -> LoadingDialogHub.dismiss() + else -> LoadingDialog.dismiss() } } //处理完成工单状态处理 operationViewModel.loadState.observe(this) { when (it) { - is LoadState.Loading -> LoadingDialogHub.show(this, "处理中,请稍后") + is LoadState.Loading -> LoadingDialog.show(this, "处理中,请稍后") is LoadState.Success -> { - LoadingDialogHub.dismiss() + LoadingDialog.dismiss() this.finish() } - else -> LoadingDialogHub.dismiss() + else -> LoadingDialog.dismiss() } } } diff --git a/app/src/main/java/com/casic/app/smartwell/view/OrderNotConfirmedDetailActivity.kt b/app/src/main/java/com/casic/app/smartwell/view/OrderNotConfirmedDetailActivity.kt index 8e036d2..687ec86 100644 --- a/app/src/main/java/com/casic/app/smartwell/view/OrderNotConfirmedDetailActivity.kt +++ b/app/src/main/java/com/casic/app/smartwell/view/OrderNotConfirmedDetailActivity.kt @@ -36,7 +36,7 @@ import com.pengxh.kt.lite.extensions.show import com.pengxh.kt.lite.utils.Constant import com.pengxh.kt.lite.utils.LoadState -import com.pengxh.kt.lite.utils.LoadingDialogHub +import com.pengxh.kt.lite.utils.LoadingDialog import com.pengxh.kt.lite.widget.TitleBarView import com.pengxh.kt.lite.widget.dialog.AlertControlDialog import com.pengxh.kt.lite.widget.dialog.AlertMessageDialog @@ -80,7 +80,7 @@ } override fun initOnCreate(savedInstanceState: Bundle?) { - val jobId = intent.getStringExtra(Constant.INTENT_PARAM)!! + val jobId = intent.getStringExtra(Constant.INTENT_PARAM_KEY)!! //初始化图片九宫格 //左外边距,左内边距,右内边距,右外边距 val viewWidth = getScreenWidth() - (10 + 10 + 10 + 10).dp2px(this) @@ -263,41 +263,41 @@ //数据加载状态处理 orderViewModel.loadState.observe(this) { when (it) { - is LoadState.Loading -> LoadingDialogHub.show(this, "数据加载中,请稍后") - else -> LoadingDialogHub.dismiss() + is LoadState.Loading -> LoadingDialog.show(this, "数据加载中,请稍后") + else -> LoadingDialog.dismiss() } } uploadImageViewModel.loadState.observe(this) { when (it) { - LoadState.Loading -> LoadingDialogHub.show(this, "图片上传中,请稍后") - else -> LoadingDialogHub.dismiss() + LoadState.Loading -> LoadingDialog.show(this, "图片上传中,请稍后") + else -> LoadingDialog.dismiss() } } //转单状态处理 operationViewModel.loadState.observe(this) { when (it) { - is LoadState.Loading -> LoadingDialogHub.show(this, "转单中,请稍后") + is LoadState.Loading -> LoadingDialog.show(this, "转单中,请稍后") is LoadState.Success -> { - LoadingDialogHub.dismiss() + LoadingDialog.dismiss() this.finish() } - else -> LoadingDialogHub.dismiss() + else -> LoadingDialog.dismiss() } } //确认工单状态处理 operationViewModel.loadState.observe(this) { when (it) { - is LoadState.Loading -> LoadingDialogHub.show(this, "处理中,请稍后") + is LoadState.Loading -> LoadingDialog.show(this, "处理中,请稍后") is LoadState.Success -> { - LoadingDialogHub.dismiss() + LoadingDialog.dismiss() this.finish() } - else -> LoadingDialogHub.dismiss() + else -> LoadingDialog.dismiss() } } } diff --git a/app/src/main/java/com/casic/app/smartwell/view/OrderNotProcessedDetailActivity.kt b/app/src/main/java/com/casic/app/smartwell/view/OrderNotProcessedDetailActivity.kt index d3f22dc..0c97a52 100644 --- a/app/src/main/java/com/casic/app/smartwell/view/OrderNotProcessedDetailActivity.kt +++ b/app/src/main/java/com/casic/app/smartwell/view/OrderNotProcessedDetailActivity.kt @@ -18,7 +18,7 @@ import com.pengxh.kt.lite.extensions.show import com.pengxh.kt.lite.utils.Constant import com.pengxh.kt.lite.utils.LoadState -import com.pengxh.kt.lite.utils.LoadingDialogHub +import com.pengxh.kt.lite.utils.LoadingDialog import com.pengxh.kt.lite.widget.TitleBarView import com.pengxh.kt.lite.widget.dialog.AlertControlDialog import com.pengxh.kt.lite.widget.dialog.AlertMessageDialog @@ -50,7 +50,7 @@ } override fun initOnCreate(savedInstanceState: Bundle?) { - this.jobId = intent.getStringExtra(Constant.INTENT_PARAM)!! + this.jobId = intent.getStringExtra(Constant.INTENT_PARAM_KEY)!! orderViewModel = ViewModelProvider(this)[OrderViewModel::class.java] operationViewModel = ViewModelProvider(this)[OperationViewModel::class.java] wellViewModel = ViewModelProvider(this)[WellViewModel::class.java] @@ -162,21 +162,21 @@ //数据加载状态处理 orderViewModel.loadState.observe(this) { when (it) { - is LoadState.Loading -> LoadingDialogHub.show(this, "数据加载中,请稍后") - else -> LoadingDialogHub.dismiss() + is LoadState.Loading -> LoadingDialog.show(this, "数据加载中,请稍后") + else -> LoadingDialog.dismiss() } } //接单状态处理 operationViewModel.loadState.observe(this) { when (it) { - is LoadState.Loading -> LoadingDialogHub.show(this, "接单中,请稍后") + is LoadState.Loading -> LoadingDialog.show(this, "接单中,请稍后") is LoadState.Success -> { - LoadingDialogHub.dismiss() + LoadingDialog.dismiss() this.finish() } - else -> LoadingDialogHub.dismiss() + else -> LoadingDialog.dismiss() } } } diff --git a/app/src/main/java/com/casic/app/smartwell/view/SearchResultActivity.kt b/app/src/main/java/com/casic/app/smartwell/view/SearchResultActivity.kt index 6a92917..4f3a674 100644 --- a/app/src/main/java/com/casic/app/smartwell/view/SearchResultActivity.kt +++ b/app/src/main/java/com/casic/app/smartwell/view/SearchResultActivity.kt @@ -19,7 +19,7 @@ import com.pengxh.kt.lite.extensions.show import com.pengxh.kt.lite.utils.Constant import com.pengxh.kt.lite.utils.LoadState -import com.pengxh.kt.lite.utils.LoadingDialogHub +import com.pengxh.kt.lite.utils.LoadingDialog import com.pengxh.kt.lite.utils.WeakReferenceHandler import com.pengxh.kt.lite.widget.TitleBarView import com.pengxh.kt.lite.widget.dialog.AlertControlDialog @@ -56,7 +56,7 @@ } override fun initOnCreate(savedInstanceState: Bundle?) { - args = intent.getStringArrayListExtra(Constant.INTENT_PARAM)!! + args = intent.getStringArrayListExtra(Constant.INTENT_PARAM_KEY)!! orderViewModel = ViewModelProvider(this)[OrderViewModel::class.java] operationViewModel = ViewModelProvider(this)[OperationViewModel::class.java] @@ -101,24 +101,24 @@ } } - binding.resultRecyclerView.addItemDecoration( - RecyclerViewItemOffsets(0, 5, 0, 5) + binding.recyclerView.addItemDecoration( + RecyclerViewItemOffsets(0, 7, 0, 7) ) } override fun observeRequestState() { orderViewModel.loadState.observe(this) { when (it) { - is LoadState.Loading -> LoadingDialogHub.show(this, "数据加载中,请稍后") - else -> LoadingDialogHub.dismiss() + is LoadState.Loading -> LoadingDialog.show(this, "数据加载中,请稍后") + else -> LoadingDialog.dismiss() } } //接单状态处理 operationViewModel.loadState.observe(this) { when (it) { - is LoadState.Loading -> LoadingDialogHub.show(this, "接单中,请稍后") + is LoadState.Loading -> LoadingDialog.show(this, "接单中,请稍后") is LoadState.Success -> { - LoadingDialogHub.dismiss() + LoadingDialog.dismiss() //接单成功之后刷新列表 dataBeans.removeAt(clickedPosition) searchResultAdapter.notifyItemRemoved(clickedPosition) @@ -127,7 +127,7 @@ ) } - else -> LoadingDialogHub.dismiss() + else -> LoadingDialog.dismiss() } } } @@ -162,7 +162,7 @@ } else { binding.emptyInclude.emptyView.hide() searchResultAdapter = SearchResultAdapter(this, dataBeans) - binding.resultRecyclerView.adapter = searchResultAdapter + binding.recyclerView.adapter = searchResultAdapter searchResultAdapter.setOnItemClickListener(object : SearchResultAdapter.OnItemClickListener { override fun onClicked(position: Int) { diff --git a/app/src/main/java/com/casic/app/smartwell/view/UnDeployWellActivity.kt b/app/src/main/java/com/casic/app/smartwell/view/UnDeployWellActivity.kt index 7f7cd3c..555c278 100644 --- a/app/src/main/java/com/casic/app/smartwell/view/UnDeployWellActivity.kt +++ b/app/src/main/java/com/casic/app/smartwell/view/UnDeployWellActivity.kt @@ -81,8 +81,8 @@ } } - binding.undeployListView.addItemDecoration( - RecyclerViewItemOffsets(0, 5, 0, 5) + binding.recyclerView.addItemDecoration( + RecyclerViewItemOffsets(0, 7, 0, 7) ) } @@ -147,12 +147,11 @@ } else { item.deep.toString() + "m" } - viewHolder.setText(R.id.wellNameView, item.wellName) + viewHolder.setText(R.id.wellTypeView, item.wellTypeName) .setText(R.id.wellDepthView, "深:${deep}") .setText(R.id.wellCodeView, "点位编号:${item.wellCode}") - .setText(R.id.wellTypeView, "点位类型:${item.wellTypeName}") .setText(R.id.ownerShipView, "权属单位:${item.deptName}") - .setText(R.id.wellLocationView, "点位置:${item.position}") + .setText(R.id.wellLocationView, "点位位置:${item.position}") .setOnClickListener( R.id.operationButton, object : View.OnClickListener { override fun onClick(v: View?) { @@ -185,7 +184,7 @@ ) } } - binding.undeployListView.adapter = unDeployAdapter + binding.recyclerView.adapter = unDeployAdapter unDeployAdapter.setOnItemClickedListener(object : NormalRecyclerAdapter.OnItemClickedListener { override fun onItemClicked(position: Int, t: WellListModel.DataBean.RowsBean) { diff --git a/app/src/main/java/com/casic/app/smartwell/view/WellDetailActivity.kt b/app/src/main/java/com/casic/app/smartwell/view/WellDetailActivity.kt index b50d067..eb8b468 100644 --- a/app/src/main/java/com/casic/app/smartwell/view/WellDetailActivity.kt +++ b/app/src/main/java/com/casic/app/smartwell/view/WellDetailActivity.kt @@ -16,7 +16,7 @@ import com.pengxh.kt.lite.extensions.show import com.pengxh.kt.lite.utils.Constant import com.pengxh.kt.lite.utils.LoadState -import com.pengxh.kt.lite.utils.LoadingDialogHub +import com.pengxh.kt.lite.utils.LoadingDialog import com.pengxh.kt.lite.widget.TitleBarView import com.pengxh.kt.lite.widget.dialog.AlertMessageDialog @@ -44,7 +44,7 @@ } override fun initOnCreate(savedInstanceState: Bundle?) { - val wellId = intent.getStringExtra(Constant.INTENT_PARAM)!! + val wellId = intent.getStringExtra(Constant.INTENT_PARAM_KEY)!! wellViewModel = ViewModelProvider(this)[WellViewModel::class.java] wellViewModel.getWellDetail(wellId) wellViewModel.wellDetailModel.observe(this) { @@ -132,8 +132,8 @@ override fun observeRequestState() { wellViewModel.loadState.observe(this) { when (it) { - is LoadState.Loading -> LoadingDialogHub.show(this, "数据加载中,请稍后") - else -> LoadingDialogHub.dismiss() + is LoadState.Loading -> LoadingDialog.show(this, "数据加载中,请稍后") + else -> LoadingDialog.dismiss() } } } diff --git a/app/src/main/java/com/casic/app/smartwell/view/WellManagementActivity.kt b/app/src/main/java/com/casic/app/smartwell/view/WellManagementActivity.kt index 084da95..457096b 100644 --- a/app/src/main/java/com/casic/app/smartwell/view/WellManagementActivity.kt +++ b/app/src/main/java/com/casic/app/smartwell/view/WellManagementActivity.kt @@ -94,8 +94,8 @@ } } - binding.wellListView.addItemDecoration( - RecyclerViewItemOffsets(0, 5, 0, 5) + binding.recyclerView.addItemDecoration( + RecyclerViewItemOffsets(0, 7, 0, 7) ) } @@ -175,13 +175,12 @@ } else { item.deep.toString() + "m" } - viewHolder.setText(R.id.wellNameView, item.wellName) + viewHolder.setText(R.id.wellTypeView, item.wellTypeName) .setText(R.id.wellStateView, "已${item.bfztName}") .setText(R.id.wellDepthView, "深:${deep}") .setText(R.id.wellCodeView, "点位编号:${item.wellCode}") - .setText(R.id.wellTypeView, "点位类型:${item.wellTypeName}") .setText(R.id.ownerShipView, "权属单位:${item.deptName}") - .setText(R.id.wellLocationView, "点位置:${item.position}") + .setText(R.id.wellLocationView, "点位位置:${item.position}") .setOnClickListener( R.id.navigationButton, object : View.OnClickListener { override fun onClick(v: View?) { @@ -200,7 +199,7 @@ ) } } - binding.wellListView.adapter = wellListAdapter + binding.recyclerView.adapter = wellListAdapter wellListAdapter.setOnItemClickedListener(object : NormalRecyclerAdapter.OnItemClickedListener { override fun onItemClicked(position: Int, t: WellListModel.DataBean.RowsBean) { diff --git a/app/src/main/java/com/casic/app/smartwell/view/WellMonitorActivity.kt b/app/src/main/java/com/casic/app/smartwell/view/WellMonitorActivity.kt index e3573eb..b87bdb7 100644 --- a/app/src/main/java/com/casic/app/smartwell/view/WellMonitorActivity.kt +++ b/app/src/main/java/com/casic/app/smartwell/view/WellMonitorActivity.kt @@ -11,7 +11,7 @@ import com.pengxh.kt.lite.base.KotlinBaseActivity import com.pengxh.kt.lite.utils.Constant import com.pengxh.kt.lite.utils.LoadState -import com.pengxh.kt.lite.utils.LoadingDialogHub +import com.pengxh.kt.lite.utils.LoadingDialog import com.pengxh.kt.lite.widget.TitleBarView class WellMonitorActivity : KotlinBaseActivity() { @@ -36,7 +36,7 @@ } override fun initOnCreate(savedInstanceState: Bundle?) { - val wellId = intent.getStringExtra(Constant.INTENT_PARAM)!! + val wellId = intent.getStringExtra(Constant.INTENT_PARAM_KEY)!! wellViewModel = ViewModelProvider(this)[WellViewModel::class.java] wellViewModel.getMonitorResult(wellId) wellViewModel.monitorModel.observe(this) { @@ -56,8 +56,8 @@ override fun observeRequestState() { wellViewModel.loadState.observe(this) { when (it) { - is LoadState.Loading -> LoadingDialogHub.show(this, "数据加载中,请稍后") - else -> LoadingDialogHub.dismiss() + is LoadState.Loading -> LoadingDialog.show(this, "数据加载中,请稍后") + else -> LoadingDialog.dismiss() } } } diff --git a/app/src/main/java/com/casic/app/smartwell/view/WellOperationActivity.kt b/app/src/main/java/com/casic/app/smartwell/view/WellOperationActivity.kt index 8d333bf..347ebb6 100644 --- a/app/src/main/java/com/casic/app/smartwell/view/WellOperationActivity.kt +++ b/app/src/main/java/com/casic/app/smartwell/view/WellOperationActivity.kt @@ -23,7 +23,7 @@ import com.pengxh.kt.lite.extensions.navigatePageTo import com.pengxh.kt.lite.extensions.show import com.pengxh.kt.lite.utils.LoadState -import com.pengxh.kt.lite.utils.LoadingDialogHub +import com.pengxh.kt.lite.utils.LoadingDialog import com.pengxh.kt.lite.utils.WeakReferenceHandler import com.pengxh.kt.lite.widget.dialog.AlertControlDialog @@ -109,8 +109,8 @@ } } - binding.operationListView.addItemDecoration( - RecyclerViewItemOffsets(0, 5, 0, 5) + binding.recyclerView.addItemDecoration( + RecyclerViewItemOffsets(0, 7, 0, 7) ) } @@ -123,13 +123,13 @@ override fun observeRequestState() { wellViewModel.loadState.observe(this) { when (it) { - is LoadState.Loading -> LoadingDialogHub.show(this, "处理中,请稍后") + is LoadState.Loading -> LoadingDialog.show(this, "处理中,请稍后") is LoadState.Success -> { - LoadingDialogHub.dismiss() + LoadingDialog.dismiss() wellOperationAdapter.notifyItemChanged(clickedPosition) } - else -> LoadingDialogHub.dismiss() + else -> LoadingDialog.dismiss() } } } @@ -203,24 +203,23 @@ if (item.bfztName == "布防") { viewHolder.setImageResource( R.id.wellStateView, R.drawable.bg_solid_text_green_radius_5 - ).setText(R.id.wellStateView, "撤防") + ).setText(R.id.operationButton, "撤防") } else { viewHolder.setImageResource( R.id.wellStateView, R.drawable.bg_solid_text_red_radius_5 - ).setText(R.id.wellStateView, "布防") + ).setText(R.id.operationButton, "布防") } val deep = if (item.deep.toString().isBlank()) { "未知" } else { item.deep.toString() + "m" } - viewHolder.setText(R.id.wellNameView, item.wellName) + viewHolder.setText(R.id.wellTypeView, item.wellTypeName) .setText(R.id.wellStateView, "已${item.bfztName}") .setText(R.id.wellDepthView, "深:${deep}") .setText(R.id.wellCodeView, "点位编号:${item.wellCode}") - .setText(R.id.wellTypeView, "点位类型:${item.wellTypeName}") .setText(R.id.ownerShipView, "权属单位:${item.deptName}") - .setText(R.id.wellLocationView, "点位置:${item.position}") + .setText(R.id.wellLocationView, "点位位置:${item.position}") .setOnClickListener( R.id.operationButton, object : View.OnClickListener { override fun onClick(v: View?) { @@ -280,7 +279,7 @@ ) } } - binding.operationListView.adapter = wellOperationAdapter + binding.recyclerView.adapter = wellOperationAdapter wellOperationAdapter.setOnItemClickedListener(object : NormalRecyclerAdapter.OnItemClickedListener { override fun onItemClicked(position: Int, t: WellListModel.DataBean.RowsBean) { diff --git a/app/src/main/res/drawable/ic_down.xml b/app/src/main/res/drawable/ic_down.xml index 20e6476..6987e6c 100644 --- a/app/src/main/res/drawable/ic_down.xml +++ b/app/src/main/res/drawable/ic_down.xml @@ -1,6 +1,6 @@ + + diff --git a/app/src/main/res/layout/activity_about_us.xml b/app/src/main/res/layout/activity_about_us.xml index 9091a00..d5fbd0d 100644 --- a/app/src/main/res/layout/activity_about_us.xml +++ b/app/src/main/res/layout/activity_about_us.xml @@ -12,13 +12,7 @@ android:layout_width="match_parent" android:layout_height="wrap_content" android:background="@color/mainThemeColor" - app:tbv_left_image="@drawable/ic_title_left" - app:tbv_only_show_title="false" - app:tbv_show_left_image="true" - app:tbv_show_right_image="false" - app:tbv_text="关于我们" - app:tbv_text_color="@color/white" - app:tbv_text_size="@dimen/sp_18" /> + app:tbv_text="关于我们" /> + app:tbv_text="修改密码" /> + app:tbv_text="布防列表" /> + app:tbv_text="帮助中心" /> + app:tbv_text="工单详情" /> + app:tbv_text="工单详情" /> + app:tbv_text="工单详情" /> + app:tbv_text="工单详情" /> + app:tbv_text="超时工单" /> + app:tbv_text="工单查询" /> + app:tbv_text="查询结果" /> + app:tbv_text="撤防列表" /> + app:tbv_text="个人资料" /> + app:tbv_text="点位详情" /> + app:tbv_text="监控内容" /> - - - - - - + android:layout_height="wrap_content" + android:background="@color/mainThemeColor" + app:tbv_show_left_image="false" + app:tbv_show_right_image="true" + app:tbv_text="首页" /> - + - + - - - - - - + android:layout_height="wrap_content" + android:background="@color/mainThemeColor" + app:tbv_right_image="@drawable/ic_search_white" + app:tbv_show_left_image="false" + app:tbv_show_right_image="true" + app:tbv_text="工单" /> - - - - - - \ No newline at end of file diff --git a/app/src/main/res/layout/item_deployed_rv.xml b/app/src/main/res/layout/item_deployed_rv.xml index 391ad28..fadcf1d 100644 --- a/app/src/main/res/layout/item_deployed_rv.xml +++ b/app/src/main/res/layout/item_deployed_rv.xml @@ -3,10 +3,9 @@ xmlns:app="http://schemas.android.com/apk/res-auto" android:layout_width="match_parent" android:layout_height="wrap_content" - android:layout_marginHorizontal="@dimen/dp_5" android:background="@drawable/bg_solid_layout_white_radius_10" android:orientation="vertical" - android:padding="@dimen/dp_5"> + android:padding="@dimen/dp_7"> @@ -42,63 +41,63 @@ android:textColor="@color/subTextColor" /> - - - - - + android:gravity="center" + android:orientation="horizontal"> - + - + - + + + + + + android:gravity="center" + android:orientation="vertical"> - - + + + + + \ No newline at end of file diff --git a/app/build.gradle b/app/build.gradle index 296fb6f..c18c251 100644 --- a/app/build.gradle +++ b/app/build.gradle @@ -40,10 +40,6 @@ // VIVO 相关应用参数 VIVO_APP_ID : "105749048", VIVO_APP_KEY : "e460fbf2c689e0f8c58ecc6aa62e1803", - - // 小米相关应用参数 -// XIAOMI_APP_ID : "", -// XIAOMI_APP_KEY : "", ] // 版本名后面添加一句话,意思就是flavor dimension 它的维度就是该版本号,多渠道打包很重要 @@ -107,7 +103,7 @@ dependencies { implementation fileTree(dir: 'libs', include: ['*.jar']) //基础依赖库 - implementation 'com.github.AndroidCoderPeng:Kotlin-lite-lib:1.0.10' + implementation 'com.github.AndroidCoderPeng:Kotlin-lite-lib:1.1.0' implementation 'androidx.appcompat:appcompat:1.6.1' implementation 'androidx.core:core-ktx:1.9.0' implementation 'androidx.constraintlayout:constraintlayout:2.1.4' @@ -165,8 +161,6 @@ implementation 'commons-codec:commons-codec:1.15' implementation 'com.android.support:support-annotations:28.0.0' implementation 'com.assist-v3:vivo:3.1.2' // vivo -// implementation 'com.getui.opt:xmp:3.3.1' // 小米 - //数据库框架 implementation 'org.greenrobot:greendao:3.3.0' //数据库升级 diff --git a/app/src/main/AndroidManifest.xml b/app/src/main/AndroidManifest.xml index c0af158..e0519bf 100644 --- a/app/src/main/AndroidManifest.xml +++ b/app/src/main/AndroidManifest.xml @@ -90,10 +90,10 @@ - + + android:value="ee96d8b5e12de3fbb29949efd57418a8" /> () @@ -150,7 +158,7 @@ val cameraPosition = CameraPosition(centerLatLng, 14f, 0f, 0f) val cameraUpdate = CameraUpdateFactory.newCameraPosition(cameraPosition) withContext(Dispatchers.Main) { - LoadingDialogHub.dismiss() + LoadingDialog.dismiss() aMap.animateCamera(cameraUpdate, 1500, null) } } @@ -239,11 +247,6 @@ } override fun initEvent() { - binding.rightOptionView.setOnClickListener { - val x = binding.rightOptionView.width - easyPopupWindow.width - easyPopupWindow.showAsDropDown(binding.rightOptionView, x, 0) - } - //撤防点位 binding.unDeployedLayout.setOnClickListener { requireContext().navigatePageTo() @@ -263,11 +266,11 @@ override fun observeRequestState() { wellViewModel.loadState.observe(this) { when (it) { - is LoadState.Loading -> LoadingDialogHub.show( + is LoadState.Loading -> LoadingDialog.show( requireActivity(), "数据加载中,请稍后..." ) - else -> LoadingDialogHub.dismiss() + else -> LoadingDialog.dismiss() } } } @@ -376,7 +379,7 @@ }).build().show() } }) - infoPopup.showAsDropDown(binding.rightOptionView) +// infoPopup.showAsDropDown(binding.rightOptionView) } override fun onCameraChange(p0: CameraPosition?) { diff --git a/app/src/main/java/com/casic/app/smartwell/fragment/HomePageNoClusterFragment.kt b/app/src/main/java/com/casic/app/smartwell/fragment/HomePageNoClusterFragment.kt index 802426a..b25f743 100644 --- a/app/src/main/java/com/casic/app/smartwell/fragment/HomePageNoClusterFragment.kt +++ b/app/src/main/java/com/casic/app/smartwell/fragment/HomePageNoClusterFragment.kt @@ -38,8 +38,9 @@ import com.pengxh.kt.lite.extensions.navigatePageTo import com.pengxh.kt.lite.extensions.show import com.pengxh.kt.lite.utils.LoadState -import com.pengxh.kt.lite.utils.LoadingDialogHub +import com.pengxh.kt.lite.utils.LoadingDialog import com.pengxh.kt.lite.widget.EasyPopupWindow +import com.pengxh.kt.lite.widget.TitleBarView import com.pengxh.kt.lite.widget.dialog.AlertControlDialog import kotlinx.coroutines.Dispatchers import kotlinx.coroutines.launch @@ -78,7 +79,15 @@ override fun setupTopBarLayout() { binding.rootView.initImmersionBar(this, false, R.color.mainThemeColor) - binding.titleView.text = "首页" + binding.titleView.setOnClickListener(object : TitleBarView.OnClickListener { + override fun onLeftClick() { + + } + + override fun onRightClick() { + easyPopupWindow.showAsDropDown(binding.titleView, binding.titleView.width, 0) + } + }) } override fun initOnCreate(savedInstanceState: Bundle?) { @@ -112,7 +121,7 @@ //渲染井位置 lifecycleScope.launch(Dispatchers.Main) { - LoadingDialogHub.show(requireActivity(), "数据加载中,请稍后") + LoadingDialog.show(requireActivity(), "数据加载中,请稍后") withContext(Dispatchers.IO) { //取Well缓存 val allMarkerOptions = ArrayList() @@ -144,7 +153,7 @@ val cameraPosition = CameraPosition(centerLatLng, 14f, 0f, 0f) val cameraUpdate = CameraUpdateFactory.newCameraPosition(cameraPosition) withContext(Dispatchers.Main) { - LoadingDialogHub.dismiss() + LoadingDialog.dismiss() aMap.animateCamera(cameraUpdate, 1500, null) } } @@ -238,11 +247,6 @@ } override fun initEvent() { - binding.rightOptionView.setOnClickListener { - val x = binding.rightOptionView.width - easyPopupWindow.width - easyPopupWindow.showAsDropDown(binding.rightOptionView, x, 0) - } - //撤防点位 binding.unDeployedLayout.setOnClickListener { requireContext().navigatePageTo() @@ -262,11 +266,11 @@ override fun observeRequestState() { wellViewModel.loadState.observe(this) { when (it) { - is LoadState.Loading -> LoadingDialogHub.show( + is LoadState.Loading -> LoadingDialog.show( requireActivity(), "数据加载中,请稍后..." ) - else -> LoadingDialogHub.dismiss() + else -> LoadingDialog.dismiss() } } } diff --git a/app/src/main/java/com/casic/app/smartwell/fragment/MinePageFragment.kt b/app/src/main/java/com/casic/app/smartwell/fragment/MinePageFragment.kt index 09a570c..dcb48f8 100644 --- a/app/src/main/java/com/casic/app/smartwell/fragment/MinePageFragment.kt +++ b/app/src/main/java/com/casic/app/smartwell/fragment/MinePageFragment.kt @@ -35,7 +35,7 @@ import com.pengxh.kt.lite.utils.ActivityStackManager import com.pengxh.kt.lite.utils.FileDownloadManager import com.pengxh.kt.lite.utils.LoadState -import com.pengxh.kt.lite.utils.LoadingDialogHub +import com.pengxh.kt.lite.utils.LoadingDialog import com.pengxh.kt.lite.widget.dialog.AlertControlDialog import com.pengxh.kt.lite.widget.dialog.BottomActionSheet import kotlinx.coroutines.Dispatchers @@ -60,7 +60,6 @@ override fun setupTopBarLayout() { binding.rootView.initImmersionBar(this, false, R.color.mainThemeColor) - binding.titleInclude.titleView.text = "我的" } override fun initOnCreate(savedInstanceState: Bundle?) { @@ -155,27 +154,27 @@ override fun observeRequestState() { userViewModel.loadState.observe(this) { when (it) { - is LoadState.Loading -> LoadingDialogHub.show( + is LoadState.Loading -> LoadingDialog.show( requireActivity(), "检查版本中,请稍后" ) - else -> LoadingDialogHub.dismiss() + else -> LoadingDialog.dismiss() } } wellViewModel.loadState.observe(this) { when (it) { - is LoadState.Loading -> LoadingDialogHub.show( + is LoadState.Loading -> LoadingDialog.show( requireActivity(), "数据更新中,请稍后" ) is LoadState.Fail -> { - LoadingDialogHub.dismiss() + LoadingDialog.dismiss() "数据更新超时".show(requireContext()) } else -> { - LoadingDialogHub.dismiss() + LoadingDialog.dismiss() AlertControlDialog.Builder().setContext(requireContext()).setTitle("温馨提示") .setMessage("数据更新成功,请重启应用").setNegativeButton("取消") .setPositiveButton("确定").setOnDialogButtonClickListener(object : @@ -197,17 +196,17 @@ lineViewModel.loadState.observe(this) { when (it) { - is LoadState.Loading -> LoadingDialogHub.show( + is LoadState.Loading -> LoadingDialog.show( requireActivity(), "数据更新中,请稍后" ) is LoadState.Fail -> { - LoadingDialogHub.dismiss() + LoadingDialog.dismiss() "数据更新超时".show(requireContext()) } else -> { - LoadingDialogHub.dismiss() + LoadingDialog.dismiss() AlertControlDialog.Builder().setContext(requireContext()).setTitle("温馨提示") .setMessage("数据更新成功,请重启应用").setNegativeButton("取消") .setPositiveButton("确定").setOnDialogButtonClickListener(object : diff --git a/app/src/main/java/com/casic/app/smartwell/fragment/NoticePageFragment.kt b/app/src/main/java/com/casic/app/smartwell/fragment/NoticePageFragment.kt index 171b555..3c93f54 100644 --- a/app/src/main/java/com/casic/app/smartwell/fragment/NoticePageFragment.kt +++ b/app/src/main/java/com/casic/app/smartwell/fragment/NoticePageFragment.kt @@ -48,7 +48,6 @@ override fun setupTopBarLayout() { binding.rootView.initImmersionBar(this, false, R.color.mainThemeColor) - binding.titleInclude.titleView.text = "消息" } override fun initOnCreate(savedInstanceState: Bundle?) { diff --git a/app/src/main/java/com/casic/app/smartwell/fragment/OrderListFragment.kt b/app/src/main/java/com/casic/app/smartwell/fragment/OrderListFragment.kt index 93ff35b..5e38acb 100644 --- a/app/src/main/java/com/casic/app/smartwell/fragment/OrderListFragment.kt +++ b/app/src/main/java/com/casic/app/smartwell/fragment/OrderListFragment.kt @@ -12,6 +12,7 @@ import com.casic.app.smartwell.view.SearchOrderActivity import com.pengxh.kt.lite.base.KotlinBaseFragment import com.pengxh.kt.lite.extensions.navigatePageTo +import com.pengxh.kt.lite.widget.TitleBarView class OrderListFragment : KotlinBaseFragment() { @@ -25,15 +26,22 @@ } override fun initViewBinding( - inflater: LayoutInflater, - container: ViewGroup? + inflater: LayoutInflater, container: ViewGroup? ): FragmentOrderBinding { return FragmentOrderBinding.inflate(inflater, container, false) } override fun setupTopBarLayout() { binding.rootView.initImmersionBar(this, false, R.color.mainThemeColor) - binding.titleView.text = "工单" + binding.titleView.setOnClickListener(object : TitleBarView.OnClickListener { + override fun onLeftClick() { + + } + + override fun onRightClick() { + requireContext().navigatePageTo() + } + }) } override fun initOnCreate(savedInstanceState: Bundle?) { @@ -51,8 +59,6 @@ } override fun initEvent() { - binding.rightOptionView.setOnClickListener { - requireContext().navigatePageTo() - } + } } \ No newline at end of file diff --git a/app/src/main/java/com/casic/app/smartwell/fragment/OrderNotProcessedFragment.kt b/app/src/main/java/com/casic/app/smartwell/fragment/OrderNotProcessedFragment.kt index 0b3d09d..2b6f21d 100644 --- a/app/src/main/java/com/casic/app/smartwell/fragment/OrderNotProcessedFragment.kt +++ b/app/src/main/java/com/casic/app/smartwell/fragment/OrderNotProcessedFragment.kt @@ -18,7 +18,7 @@ import com.pengxh.kt.lite.extensions.navigatePageTo import com.pengxh.kt.lite.extensions.show import com.pengxh.kt.lite.utils.LoadState -import com.pengxh.kt.lite.utils.LoadingDialogHub +import com.pengxh.kt.lite.utils.LoadingDialog import com.pengxh.kt.lite.utils.WeakReferenceHandler import com.pengxh.kt.lite.widget.dialog.AlertControlDialog @@ -78,8 +78,8 @@ operationViewModel = ViewModelProvider(this)[OperationViewModel::class.java] - binding.notProcessedView.addItemDecoration( - RecyclerViewItemOffsets(0, 5, 0, 5) + binding.recyclerView.addItemDecoration( + RecyclerViewItemOffsets(0, 7, 0, 7) ) } @@ -87,9 +87,9 @@ //接单状态处理 operationViewModel.loadState.observe(this) { when (it) { - is LoadState.Loading -> LoadingDialogHub.show(requireActivity(), "接单中,请稍后") + is LoadState.Loading -> LoadingDialog.show(requireActivity(), "接单中,请稍后") is LoadState.Success -> { - LoadingDialogHub.dismiss() + LoadingDialog.dismiss() //接单成功之后刷新列表 dataBeans.removeAt(clickedPosition) notProcessedAdapter.notifyItemRemoved(clickedPosition) @@ -98,7 +98,7 @@ ) } - else -> LoadingDialogHub.dismiss() + else -> LoadingDialog.dismiss() } } } @@ -131,7 +131,7 @@ } else { binding.emptyInclude.emptyView.hide() notProcessedAdapter = OrderNotProcessedAdapter(requireContext(), dataBeans) - binding.notProcessedView.adapter = notProcessedAdapter + binding.recyclerView.adapter = notProcessedAdapter notProcessedAdapter.setOnItemClickListener(object : OrderNotProcessedAdapter.OnItemClickListener { override fun onClicked(position: Int) { diff --git a/app/src/main/java/com/casic/app/smartwell/fragment/OvertimeNotAcceptFragment.kt b/app/src/main/java/com/casic/app/smartwell/fragment/OvertimeNotAcceptFragment.kt index a198545..9b318ca 100644 --- a/app/src/main/java/com/casic/app/smartwell/fragment/OvertimeNotAcceptFragment.kt +++ b/app/src/main/java/com/casic/app/smartwell/fragment/OvertimeNotAcceptFragment.kt @@ -18,7 +18,7 @@ import com.pengxh.kt.lite.extensions.navigatePageTo import com.pengxh.kt.lite.extensions.show import com.pengxh.kt.lite.utils.LoadState -import com.pengxh.kt.lite.utils.LoadingDialogHub +import com.pengxh.kt.lite.utils.LoadingDialog import com.pengxh.kt.lite.utils.WeakReferenceHandler import com.pengxh.kt.lite.widget.dialog.AlertControlDialog @@ -81,8 +81,8 @@ operationViewModel = ViewModelProvider(this)[OperationViewModel::class.java] - binding.notProcessedView.addItemDecoration( - RecyclerViewItemOffsets(0, 5, 0, 5) + binding.recyclerView.addItemDecoration( + RecyclerViewItemOffsets(0, 7, 0, 7) ) } @@ -90,9 +90,9 @@ //接单状态处理 operationViewModel.loadState.observe(this) { when (it) { - is LoadState.Loading -> LoadingDialogHub.show(requireActivity(), "接单中,请稍后") + is LoadState.Loading -> LoadingDialog.show(requireActivity(), "接单中,请稍后") is LoadState.Success -> { - LoadingDialogHub.dismiss() + LoadingDialog.dismiss() //接单成功之后刷新列表 dataBeans.removeAt(clickedPosition) notProcessedAdapter.notifyItemRemoved(clickedPosition) @@ -101,7 +101,7 @@ ) } - else -> LoadingDialogHub.dismiss() + else -> LoadingDialog.dismiss() } } } @@ -134,7 +134,7 @@ } else { binding.emptyInclude.emptyView.hide() notProcessedAdapter = OrderNotProcessedAdapter(requireContext(), dataBeans) - binding.notProcessedView.adapter = notProcessedAdapter + binding.recyclerView.adapter = notProcessedAdapter notProcessedAdapter.setOnItemClickListener(object : OrderNotProcessedAdapter.OnItemClickListener { override fun onClicked(position: Int) { diff --git a/app/src/main/java/com/casic/app/smartwell/greendao/DaoMaster.java b/app/src/main/java/com/casic/app/smartwell/greendao/DaoMaster.java index fdcf3a7..1e52b74 100644 --- a/app/src/main/java/com/casic/app/smartwell/greendao/DaoMaster.java +++ b/app/src/main/java/com/casic/app/smartwell/greendao/DaoMaster.java @@ -13,25 +13,20 @@ // THIS CODE IS GENERATED BY greenDAO, DO NOT EDIT. - /** * Master of DAO (schema version 4): knows all DAOs. */ public class DaoMaster extends AbstractDaoMaster { public static final int SCHEMA_VERSION = 4; - /** - * Creates underlying database table using DAOs. - */ + /** Creates underlying database table using DAOs. */ public static void createAllTables(Database db, boolean ifNotExists) { MapWellLocalBeanDao.createTable(db, ifNotExists); NoticeLocaleBeanDao.createTable(db, ifNotExists); PipeLocalBeanDao.createTable(db, ifNotExists); } - /** - * Drops underlying database table using DAOs. - */ + /** Drops underlying database table using DAOs. */ public static void dropAllTables(Database db, boolean ifExists) { MapWellLocalBeanDao.dropTable(db, ifExists); NoticeLocaleBeanDao.dropTable(db, ifExists); @@ -86,9 +81,7 @@ } } - /** - * WARNING: Drops all table on Upgrade! Use only during development. - */ + /** WARNING: Drops all table on Upgrade! Use only during development. */ public static class DevOpenHelper extends OpenHelper { public DevOpenHelper(Context context, String name) { super(context, name); diff --git a/app/src/main/java/com/casic/app/smartwell/greendao/DaoSession.java b/app/src/main/java/com/casic/app/smartwell/greendao/DaoSession.java index 0b36d17..3e40e3b 100644 --- a/app/src/main/java/com/casic/app/smartwell/greendao/DaoSession.java +++ b/app/src/main/java/com/casic/app/smartwell/greendao/DaoSession.java @@ -16,7 +16,7 @@ /** * {@inheritDoc} - * + * * @see org.greenrobot.greendao.AbstractDaoSession */ public class DaoSession extends AbstractDaoSession { @@ -50,7 +50,7 @@ registerDao(NoticeLocaleBean.class, noticeLocaleBeanDao); registerDao(PipeLocalBean.class, pipeLocalBeanDao); } - + public void clear() { mapWellLocalBeanDaoConfig.clearIdentityScope(); noticeLocaleBeanDaoConfig.clearIdentityScope(); diff --git a/app/src/main/java/com/casic/app/smartwell/greendao/MapWellLocalBeanDao.java b/app/src/main/java/com/casic/app/smartwell/greendao/MapWellLocalBeanDao.java index 8908fda..407bc92 100644 --- a/app/src/main/java/com/casic/app/smartwell/greendao/MapWellLocalBeanDao.java +++ b/app/src/main/java/com/casic/app/smartwell/greendao/MapWellLocalBeanDao.java @@ -12,10 +12,9 @@ import org.greenrobot.greendao.internal.DaoConfig; // THIS CODE IS GENERATED BY greenDAO, DO NOT EDIT. - -/** +/** * DAO for table "MAP_WELL_LOCAL_BEAN". - */ +*/ public class MapWellLocalBeanDao extends AbstractDao { public static final String TABLENAME = "MAP_WELL_LOCAL_BEAN"; @@ -57,16 +56,14 @@ public MapWellLocalBeanDao(DaoConfig config) { super(config); } - + public MapWellLocalBeanDao(DaoConfig config, DaoSession daoSession) { super(config, daoSession); } - /** - * Creates the underlying database table. - */ + /** Creates the underlying database table. */ public static void createTable(Database db, boolean ifNotExists) { - String constraint = ifNotExists ? "IF NOT EXISTS " : ""; + String constraint = ifNotExists? "IF NOT EXISTS ": ""; db.execSQL("CREATE TABLE " + constraint + "\"MAP_WELL_LOCAL_BEAN\" (" + // "\"_id\" INTEGER PRIMARY KEY AUTOINCREMENT ," + // 0: kId "\"AREA\" TEXT," + // 1: area @@ -96,9 +93,7 @@ "\"WELL_TYPE_NAME\" TEXT);"); // 25: wellTypeName } - /** - * Drops the underlying database table. - */ + /** Drops the underlying database table. */ public static void dropTable(Database db, boolean ifExists) { String sql = "DROP TABLE " + (ifExists ? "IF EXISTS " : "") + "\"MAP_WELL_LOCAL_BEAN\""; db.execSQL(sql); @@ -107,132 +102,132 @@ @Override protected final void bindValues(DatabaseStatement stmt, MapWellLocalBean entity) { stmt.clearBindings(); - + Long kId = entity.getKId(); if (kId != null) { stmt.bindLong(1, kId); } - + String area = entity.getArea(); if (area != null) { stmt.bindString(2, area); } - + String bfzt = entity.getBfzt(); if (bfzt != null) { stmt.bindString(3, bfzt); } - + String bfztName = entity.getBfztName(); if (bfztName != null) { stmt.bindString(4, bfztName); } - + String coordinateX = entity.getCoordinateX(); if (coordinateX != null) { stmt.bindString(5, coordinateX); } - + String coordinateY = entity.getCoordinateY(); if (coordinateY != null) { stmt.bindString(6, coordinateY); } - + String deep = entity.getDeep(); if (deep != null) { stmt.bindString(7, deep); } - + String deptName = entity.getDeptName(); if (deptName != null) { stmt.bindString(8, deptName); } - + String deptid = entity.getDeptid(); if (deptid != null) { stmt.bindString(9, deptid); } - + String id = entity.getId(); if (id != null) { stmt.bindString(10, id); } - + String latBaidu = entity.getLatBaidu(); if (latBaidu != null) { stmt.bindString(11, latBaidu); } - + String latGaode = entity.getLatGaode(); if (latGaode != null) { stmt.bindString(12, latGaode); } - + String lngBaidu = entity.getLngBaidu(); if (lngBaidu != null) { stmt.bindString(13, lngBaidu); } - + String lngGaode = entity.getLngGaode(); if (lngGaode != null) { stmt.bindString(14, lngGaode); } - + String notes = entity.getNotes(); if (notes != null) { stmt.bindString(15, notes); } - + String photos = entity.getPhotos(); if (photos != null) { stmt.bindString(16, photos); } - + String position = entity.getPosition(); if (position != null) { stmt.bindString(17, position); } - + String staff = entity.getStaff(); if (staff != null) { stmt.bindString(18, staff); } - + String tel = entity.getTel(); if (tel != null) { stmt.bindString(19, tel); } - + String ts = entity.getTs(); if (ts != null) { stmt.bindString(20, ts); } - + String valid = entity.getValid(); if (valid != null) { stmt.bindString(21, valid); } - + String watchData = entity.getWatchData(); if (watchData != null) { stmt.bindString(22, watchData); } - + String wellCode = entity.getWellCode(); if (wellCode != null) { stmt.bindString(23, wellCode); } - + String wellName = entity.getWellName(); if (wellName != null) { stmt.bindString(24, wellName); } - + String wellType = entity.getWellType(); if (wellType != null) { stmt.bindString(25, wellType); } - + String wellTypeName = entity.getWellTypeName(); if (wellTypeName != null) { stmt.bindString(26, wellTypeName); @@ -242,132 +237,132 @@ @Override protected final void bindValues(SQLiteStatement stmt, MapWellLocalBean entity) { stmt.clearBindings(); - + Long kId = entity.getKId(); if (kId != null) { stmt.bindLong(1, kId); } - + String area = entity.getArea(); if (area != null) { stmt.bindString(2, area); } - + String bfzt = entity.getBfzt(); if (bfzt != null) { stmt.bindString(3, bfzt); } - + String bfztName = entity.getBfztName(); if (bfztName != null) { stmt.bindString(4, bfztName); } - + String coordinateX = entity.getCoordinateX(); if (coordinateX != null) { stmt.bindString(5, coordinateX); } - + String coordinateY = entity.getCoordinateY(); if (coordinateY != null) { stmt.bindString(6, coordinateY); } - + String deep = entity.getDeep(); if (deep != null) { stmt.bindString(7, deep); } - + String deptName = entity.getDeptName(); if (deptName != null) { stmt.bindString(8, deptName); } - + String deptid = entity.getDeptid(); if (deptid != null) { stmt.bindString(9, deptid); } - + String id = entity.getId(); if (id != null) { stmt.bindString(10, id); } - + String latBaidu = entity.getLatBaidu(); if (latBaidu != null) { stmt.bindString(11, latBaidu); } - + String latGaode = entity.getLatGaode(); if (latGaode != null) { stmt.bindString(12, latGaode); } - + String lngBaidu = entity.getLngBaidu(); if (lngBaidu != null) { stmt.bindString(13, lngBaidu); } - + String lngGaode = entity.getLngGaode(); if (lngGaode != null) { stmt.bindString(14, lngGaode); } - + String notes = entity.getNotes(); if (notes != null) { stmt.bindString(15, notes); } - + String photos = entity.getPhotos(); if (photos != null) { stmt.bindString(16, photos); } - + String position = entity.getPosition(); if (position != null) { stmt.bindString(17, position); } - + String staff = entity.getStaff(); if (staff != null) { stmt.bindString(18, staff); } - + String tel = entity.getTel(); if (tel != null) { stmt.bindString(19, tel); } - + String ts = entity.getTs(); if (ts != null) { stmt.bindString(20, ts); } - + String valid = entity.getValid(); if (valid != null) { stmt.bindString(21, valid); } - + String watchData = entity.getWatchData(); if (watchData != null) { stmt.bindString(22, watchData); } - + String wellCode = entity.getWellCode(); if (wellCode != null) { stmt.bindString(23, wellCode); } - + String wellName = entity.getWellName(); if (wellName != null) { stmt.bindString(24, wellName); } - + String wellType = entity.getWellType(); if (wellType != null) { stmt.bindString(25, wellType); } - + String wellTypeName = entity.getWellTypeName(); if (wellTypeName != null) { stmt.bindString(26, wellTypeName); @@ -377,41 +372,41 @@ @Override public Long readKey(Cursor cursor, int offset) { return cursor.isNull(offset + 0) ? null : cursor.getLong(offset + 0); - } + } @Override public MapWellLocalBean readEntity(Cursor cursor, int offset) { MapWellLocalBean entity = new MapWellLocalBean( // - cursor.isNull(offset + 0) ? null : cursor.getLong(offset + 0), // kId - cursor.isNull(offset + 1) ? null : cursor.getString(offset + 1), // area - cursor.isNull(offset + 2) ? null : cursor.getString(offset + 2), // bfzt - cursor.isNull(offset + 3) ? null : cursor.getString(offset + 3), // bfztName - cursor.isNull(offset + 4) ? null : cursor.getString(offset + 4), // coordinateX - cursor.isNull(offset + 5) ? null : cursor.getString(offset + 5), // coordinateY - cursor.isNull(offset + 6) ? null : cursor.getString(offset + 6), // deep - cursor.isNull(offset + 7) ? null : cursor.getString(offset + 7), // deptName - cursor.isNull(offset + 8) ? null : cursor.getString(offset + 8), // deptid - cursor.isNull(offset + 9) ? null : cursor.getString(offset + 9), // id - cursor.isNull(offset + 10) ? null : cursor.getString(offset + 10), // latBaidu - cursor.isNull(offset + 11) ? null : cursor.getString(offset + 11), // latGaode - cursor.isNull(offset + 12) ? null : cursor.getString(offset + 12), // lngBaidu - cursor.isNull(offset + 13) ? null : cursor.getString(offset + 13), // lngGaode - cursor.isNull(offset + 14) ? null : cursor.getString(offset + 14), // notes - cursor.isNull(offset + 15) ? null : cursor.getString(offset + 15), // photos - cursor.isNull(offset + 16) ? null : cursor.getString(offset + 16), // position - cursor.isNull(offset + 17) ? null : cursor.getString(offset + 17), // staff - cursor.isNull(offset + 18) ? null : cursor.getString(offset + 18), // tel - cursor.isNull(offset + 19) ? null : cursor.getString(offset + 19), // ts - cursor.isNull(offset + 20) ? null : cursor.getString(offset + 20), // valid - cursor.isNull(offset + 21) ? null : cursor.getString(offset + 21), // watchData - cursor.isNull(offset + 22) ? null : cursor.getString(offset + 22), // wellCode - cursor.isNull(offset + 23) ? null : cursor.getString(offset + 23), // wellName - cursor.isNull(offset + 24) ? null : cursor.getString(offset + 24), // wellType - cursor.isNull(offset + 25) ? null : cursor.getString(offset + 25) // wellTypeName + cursor.isNull(offset + 0) ? null : cursor.getLong(offset + 0), // kId + cursor.isNull(offset + 1) ? null : cursor.getString(offset + 1), // area + cursor.isNull(offset + 2) ? null : cursor.getString(offset + 2), // bfzt + cursor.isNull(offset + 3) ? null : cursor.getString(offset + 3), // bfztName + cursor.isNull(offset + 4) ? null : cursor.getString(offset + 4), // coordinateX + cursor.isNull(offset + 5) ? null : cursor.getString(offset + 5), // coordinateY + cursor.isNull(offset + 6) ? null : cursor.getString(offset + 6), // deep + cursor.isNull(offset + 7) ? null : cursor.getString(offset + 7), // deptName + cursor.isNull(offset + 8) ? null : cursor.getString(offset + 8), // deptid + cursor.isNull(offset + 9) ? null : cursor.getString(offset + 9), // id + cursor.isNull(offset + 10) ? null : cursor.getString(offset + 10), // latBaidu + cursor.isNull(offset + 11) ? null : cursor.getString(offset + 11), // latGaode + cursor.isNull(offset + 12) ? null : cursor.getString(offset + 12), // lngBaidu + cursor.isNull(offset + 13) ? null : cursor.getString(offset + 13), // lngGaode + cursor.isNull(offset + 14) ? null : cursor.getString(offset + 14), // notes + cursor.isNull(offset + 15) ? null : cursor.getString(offset + 15), // photos + cursor.isNull(offset + 16) ? null : cursor.getString(offset + 16), // position + cursor.isNull(offset + 17) ? null : cursor.getString(offset + 17), // staff + cursor.isNull(offset + 18) ? null : cursor.getString(offset + 18), // tel + cursor.isNull(offset + 19) ? null : cursor.getString(offset + 19), // ts + cursor.isNull(offset + 20) ? null : cursor.getString(offset + 20), // valid + cursor.isNull(offset + 21) ? null : cursor.getString(offset + 21), // watchData + cursor.isNull(offset + 22) ? null : cursor.getString(offset + 22), // wellCode + cursor.isNull(offset + 23) ? null : cursor.getString(offset + 23), // wellName + cursor.isNull(offset + 24) ? null : cursor.getString(offset + 24), // wellType + cursor.isNull(offset + 25) ? null : cursor.getString(offset + 25) // wellTypeName ); return entity; } - + @Override public void readEntity(Cursor cursor, MapWellLocalBean entity, int offset) { entity.setKId(cursor.isNull(offset + 0) ? null : cursor.getLong(offset + 0)); @@ -440,17 +435,17 @@ entity.setWellName(cursor.isNull(offset + 23) ? null : cursor.getString(offset + 23)); entity.setWellType(cursor.isNull(offset + 24) ? null : cursor.getString(offset + 24)); entity.setWellTypeName(cursor.isNull(offset + 25) ? null : cursor.getString(offset + 25)); - } - + } + @Override protected final Long updateKeyAfterInsert(MapWellLocalBean entity, long rowId) { entity.setKId(rowId); return rowId; } - + @Override public Long getKey(MapWellLocalBean entity) { - if (entity != null) { + if(entity != null) { return entity.getKId(); } else { return null; @@ -466,5 +461,5 @@ protected final boolean isEntityUpdateable() { return true; } - + } diff --git a/app/src/main/java/com/casic/app/smartwell/greendao/NoticeLocaleBeanDao.java b/app/src/main/java/com/casic/app/smartwell/greendao/NoticeLocaleBeanDao.java index 64312ed..deb2d49 100644 --- a/app/src/main/java/com/casic/app/smartwell/greendao/NoticeLocaleBeanDao.java +++ b/app/src/main/java/com/casic/app/smartwell/greendao/NoticeLocaleBeanDao.java @@ -12,10 +12,9 @@ import org.greenrobot.greendao.internal.DaoConfig; // THIS CODE IS GENERATED BY greenDAO, DO NOT EDIT. - -/** +/** * DAO for table "NOTICE_LOCALE_BEAN". - */ +*/ public class NoticeLocaleBeanDao extends AbstractDao { public static final String TABLENAME = "NOTICE_LOCALE_BEAN"; @@ -43,16 +42,14 @@ public NoticeLocaleBeanDao(DaoConfig config) { super(config); } - + public NoticeLocaleBeanDao(DaoConfig config, DaoSession daoSession) { super(config, daoSession); } - /** - * Creates the underlying database table. - */ + /** Creates the underlying database table. */ public static void createTable(Database db, boolean ifNotExists) { - String constraint = ifNotExists ? "IF NOT EXISTS " : ""; + String constraint = ifNotExists? "IF NOT EXISTS ": ""; db.execSQL("CREATE TABLE " + constraint + "\"NOTICE_LOCALE_BEAN\" (" + // "\"_id\" INTEGER PRIMARY KEY AUTOINCREMENT ," + // 0: id "\"MESSAGE_ID\" TEXT UNIQUE ," + // 1: messageId @@ -68,9 +65,7 @@ "\"NOTICE_TIME\" TEXT);"); // 11: noticeTime } - /** - * Drops the underlying database table. - */ + /** Drops the underlying database table. */ public static void dropTable(Database db, boolean ifExists) { String sql = "DROP TABLE " + (ifExists ? "IF EXISTS " : "") + "\"NOTICE_LOCALE_BEAN\""; db.execSQL(sql); @@ -79,62 +74,62 @@ @Override protected final void bindValues(DatabaseStatement stmt, NoticeLocaleBean entity) { stmt.clearBindings(); - + Long id = entity.getId(); if (id != null) { stmt.bindLong(1, id); } - + String messageId = entity.getMessageId(); if (messageId != null) { stmt.bindString(2, messageId); } - + String appid = entity.getAppid(); if (appid != null) { stmt.bindString(3, appid); } - + String clientId = entity.getClientId(); if (clientId != null) { stmt.bindString(4, clientId); } - + String taskId = entity.getTaskId(); if (taskId != null) { stmt.bindString(5, taskId); } - + String userId = entity.getUserId(); if (userId != null) { stmt.bindString(6, userId); } - + String title = entity.getTitle(); if (title != null) { stmt.bindString(7, title); } - + String content = entity.getContent(); if (content != null) { stmt.bindString(8, content); } - + String deviceCode = entity.getDeviceCode(); if (deviceCode != null) { stmt.bindString(9, deviceCode); } - + String jobId = entity.getJobId(); if (jobId != null) { stmt.bindString(10, jobId); } - + String isRead = entity.getIsRead(); if (isRead != null) { stmt.bindString(11, isRead); } - + String noticeTime = entity.getNoticeTime(); if (noticeTime != null) { stmt.bindString(12, noticeTime); @@ -144,62 +139,62 @@ @Override protected final void bindValues(SQLiteStatement stmt, NoticeLocaleBean entity) { stmt.clearBindings(); - + Long id = entity.getId(); if (id != null) { stmt.bindLong(1, id); } - + String messageId = entity.getMessageId(); if (messageId != null) { stmt.bindString(2, messageId); } - + String appid = entity.getAppid(); if (appid != null) { stmt.bindString(3, appid); } - + String clientId = entity.getClientId(); if (clientId != null) { stmt.bindString(4, clientId); } - + String taskId = entity.getTaskId(); if (taskId != null) { stmt.bindString(5, taskId); } - + String userId = entity.getUserId(); if (userId != null) { stmt.bindString(6, userId); } - + String title = entity.getTitle(); if (title != null) { stmt.bindString(7, title); } - + String content = entity.getContent(); if (content != null) { stmt.bindString(8, content); } - + String deviceCode = entity.getDeviceCode(); if (deviceCode != null) { stmt.bindString(9, deviceCode); } - + String jobId = entity.getJobId(); if (jobId != null) { stmt.bindString(10, jobId); } - + String isRead = entity.getIsRead(); if (isRead != null) { stmt.bindString(11, isRead); } - + String noticeTime = entity.getNoticeTime(); if (noticeTime != null) { stmt.bindString(12, noticeTime); @@ -209,27 +204,27 @@ @Override public Long readKey(Cursor cursor, int offset) { return cursor.isNull(offset + 0) ? null : cursor.getLong(offset + 0); - } + } @Override public NoticeLocaleBean readEntity(Cursor cursor, int offset) { NoticeLocaleBean entity = new NoticeLocaleBean( // - cursor.isNull(offset + 0) ? null : cursor.getLong(offset + 0), // id - cursor.isNull(offset + 1) ? null : cursor.getString(offset + 1), // messageId - cursor.isNull(offset + 2) ? null : cursor.getString(offset + 2), // appid - cursor.isNull(offset + 3) ? null : cursor.getString(offset + 3), // clientId - cursor.isNull(offset + 4) ? null : cursor.getString(offset + 4), // taskId - cursor.isNull(offset + 5) ? null : cursor.getString(offset + 5), // userId - cursor.isNull(offset + 6) ? null : cursor.getString(offset + 6), // title - cursor.isNull(offset + 7) ? null : cursor.getString(offset + 7), // content - cursor.isNull(offset + 8) ? null : cursor.getString(offset + 8), // deviceCode - cursor.isNull(offset + 9) ? null : cursor.getString(offset + 9), // jobId - cursor.isNull(offset + 10) ? null : cursor.getString(offset + 10), // isRead - cursor.isNull(offset + 11) ? null : cursor.getString(offset + 11) // noticeTime + cursor.isNull(offset + 0) ? null : cursor.getLong(offset + 0), // id + cursor.isNull(offset + 1) ? null : cursor.getString(offset + 1), // messageId + cursor.isNull(offset + 2) ? null : cursor.getString(offset + 2), // appid + cursor.isNull(offset + 3) ? null : cursor.getString(offset + 3), // clientId + cursor.isNull(offset + 4) ? null : cursor.getString(offset + 4), // taskId + cursor.isNull(offset + 5) ? null : cursor.getString(offset + 5), // userId + cursor.isNull(offset + 6) ? null : cursor.getString(offset + 6), // title + cursor.isNull(offset + 7) ? null : cursor.getString(offset + 7), // content + cursor.isNull(offset + 8) ? null : cursor.getString(offset + 8), // deviceCode + cursor.isNull(offset + 9) ? null : cursor.getString(offset + 9), // jobId + cursor.isNull(offset + 10) ? null : cursor.getString(offset + 10), // isRead + cursor.isNull(offset + 11) ? null : cursor.getString(offset + 11) // noticeTime ); return entity; } - + @Override public void readEntity(Cursor cursor, NoticeLocaleBean entity, int offset) { entity.setId(cursor.isNull(offset + 0) ? null : cursor.getLong(offset + 0)); @@ -244,17 +239,17 @@ entity.setJobId(cursor.isNull(offset + 9) ? null : cursor.getString(offset + 9)); entity.setIsRead(cursor.isNull(offset + 10) ? null : cursor.getString(offset + 10)); entity.setNoticeTime(cursor.isNull(offset + 11) ? null : cursor.getString(offset + 11)); - } - + } + @Override protected final Long updateKeyAfterInsert(NoticeLocaleBean entity, long rowId) { entity.setId(rowId); return rowId; } - + @Override public Long getKey(NoticeLocaleBean entity) { - if (entity != null) { + if(entity != null) { return entity.getId(); } else { return null; @@ -270,5 +265,5 @@ protected final boolean isEntityUpdateable() { return true; } - + } diff --git a/app/src/main/java/com/casic/app/smartwell/greendao/PipeLocalBeanDao.java b/app/src/main/java/com/casic/app/smartwell/greendao/PipeLocalBeanDao.java index aab4d3f..df5515a 100644 --- a/app/src/main/java/com/casic/app/smartwell/greendao/PipeLocalBeanDao.java +++ b/app/src/main/java/com/casic/app/smartwell/greendao/PipeLocalBeanDao.java @@ -12,10 +12,9 @@ import org.greenrobot.greendao.internal.DaoConfig; // THIS CODE IS GENERATED BY greenDAO, DO NOT EDIT. - -/** +/** * DAO for table "PIPE_LOCAL_BEAN". - */ +*/ public class PipeLocalBeanDao extends AbstractDao { public static final String TABLENAME = "PIPE_LOCAL_BEAN"; @@ -37,16 +36,14 @@ public PipeLocalBeanDao(DaoConfig config) { super(config); } - + public PipeLocalBeanDao(DaoConfig config, DaoSession daoSession) { super(config, daoSession); } - /** - * Creates the underlying database table. - */ + /** Creates the underlying database table. */ public static void createTable(Database db, boolean ifNotExists) { - String constraint = ifNotExists ? "IF NOT EXISTS " : ""; + String constraint = ifNotExists? "IF NOT EXISTS ": ""; db.execSQL("CREATE TABLE " + constraint + "\"PIPE_LOCAL_BEAN\" (" + // "\"_id\" INTEGER PRIMARY KEY AUTOINCREMENT ," + // 0: id "\"PIPE_CODE\" TEXT," + // 1: pipeCode @@ -56,9 +53,7 @@ "\"START_LONGITUDE_GD\" TEXT);"); // 5: startLongitudeGd } - /** - * Drops the underlying database table. - */ + /** Drops the underlying database table. */ public static void dropTable(Database db, boolean ifExists) { String sql = "DROP TABLE " + (ifExists ? "IF EXISTS " : "") + "\"PIPE_LOCAL_BEAN\""; db.execSQL(sql); @@ -67,32 +62,32 @@ @Override protected final void bindValues(DatabaseStatement stmt, PipeLocalBean entity) { stmt.clearBindings(); - + Long id = entity.getId(); if (id != null) { stmt.bindLong(1, id); } - + String pipeCode = entity.getPipeCode(); if (pipeCode != null) { stmt.bindString(2, pipeCode); } - + String endLatitudeGd = entity.getEndLatitudeGd(); if (endLatitudeGd != null) { stmt.bindString(3, endLatitudeGd); } - + String endLongitudeGd = entity.getEndLongitudeGd(); if (endLongitudeGd != null) { stmt.bindString(4, endLongitudeGd); } - + String startLatitudeGd = entity.getStartLatitudeGd(); if (startLatitudeGd != null) { stmt.bindString(5, startLatitudeGd); } - + String startLongitudeGd = entity.getStartLongitudeGd(); if (startLongitudeGd != null) { stmt.bindString(6, startLongitudeGd); @@ -102,32 +97,32 @@ @Override protected final void bindValues(SQLiteStatement stmt, PipeLocalBean entity) { stmt.clearBindings(); - + Long id = entity.getId(); if (id != null) { stmt.bindLong(1, id); } - + String pipeCode = entity.getPipeCode(); if (pipeCode != null) { stmt.bindString(2, pipeCode); } - + String endLatitudeGd = entity.getEndLatitudeGd(); if (endLatitudeGd != null) { stmt.bindString(3, endLatitudeGd); } - + String endLongitudeGd = entity.getEndLongitudeGd(); if (endLongitudeGd != null) { stmt.bindString(4, endLongitudeGd); } - + String startLatitudeGd = entity.getStartLatitudeGd(); if (startLatitudeGd != null) { stmt.bindString(5, startLatitudeGd); } - + String startLongitudeGd = entity.getStartLongitudeGd(); if (startLongitudeGd != null) { stmt.bindString(6, startLongitudeGd); @@ -137,21 +132,21 @@ @Override public Long readKey(Cursor cursor, int offset) { return cursor.isNull(offset + 0) ? null : cursor.getLong(offset + 0); - } + } @Override public PipeLocalBean readEntity(Cursor cursor, int offset) { PipeLocalBean entity = new PipeLocalBean( // - cursor.isNull(offset + 0) ? null : cursor.getLong(offset + 0), // id - cursor.isNull(offset + 1) ? null : cursor.getString(offset + 1), // pipeCode - cursor.isNull(offset + 2) ? null : cursor.getString(offset + 2), // endLatitudeGd - cursor.isNull(offset + 3) ? null : cursor.getString(offset + 3), // endLongitudeGd - cursor.isNull(offset + 4) ? null : cursor.getString(offset + 4), // startLatitudeGd - cursor.isNull(offset + 5) ? null : cursor.getString(offset + 5) // startLongitudeGd + cursor.isNull(offset + 0) ? null : cursor.getLong(offset + 0), // id + cursor.isNull(offset + 1) ? null : cursor.getString(offset + 1), // pipeCode + cursor.isNull(offset + 2) ? null : cursor.getString(offset + 2), // endLatitudeGd + cursor.isNull(offset + 3) ? null : cursor.getString(offset + 3), // endLongitudeGd + cursor.isNull(offset + 4) ? null : cursor.getString(offset + 4), // startLatitudeGd + cursor.isNull(offset + 5) ? null : cursor.getString(offset + 5) // startLongitudeGd ); return entity; } - + @Override public void readEntity(Cursor cursor, PipeLocalBean entity, int offset) { entity.setId(cursor.isNull(offset + 0) ? null : cursor.getLong(offset + 0)); @@ -160,17 +155,17 @@ entity.setEndLongitudeGd(cursor.isNull(offset + 3) ? null : cursor.getString(offset + 3)); entity.setStartLatitudeGd(cursor.isNull(offset + 4) ? null : cursor.getString(offset + 4)); entity.setStartLongitudeGd(cursor.isNull(offset + 5) ? null : cursor.getString(offset + 5)); - } - + } + @Override protected final Long updateKeyAfterInsert(PipeLocalBean entity, long rowId) { entity.setId(rowId); return rowId; } - + @Override public Long getKey(PipeLocalBean entity) { - if (entity != null) { + if(entity != null) { return entity.getId(); } else { return null; @@ -186,5 +181,5 @@ protected final boolean isEntityUpdateable() { return true; } - + } diff --git a/app/src/main/java/com/casic/app/smartwell/view/ChangePasswordActivity.kt b/app/src/main/java/com/casic/app/smartwell/view/ChangePasswordActivity.kt index 8e41039..9f1dd40 100644 --- a/app/src/main/java/com/casic/app/smartwell/view/ChangePasswordActivity.kt +++ b/app/src/main/java/com/casic/app/smartwell/view/ChangePasswordActivity.kt @@ -14,7 +14,7 @@ import com.pengxh.kt.lite.extensions.show import com.pengxh.kt.lite.utils.ActivityStackManager import com.pengxh.kt.lite.utils.LoadState -import com.pengxh.kt.lite.utils.LoadingDialogHub +import com.pengxh.kt.lite.utils.LoadingDialog import com.pengxh.kt.lite.widget.TitleBarView import java.nio.charset.StandardCharsets @@ -46,15 +46,15 @@ override fun observeRequestState() { userViewModel.loadState.observe(this) { when (it) { - is LoadState.Loading -> LoadingDialogHub.show(this, "修改中,请稍后") + is LoadState.Loading -> LoadingDialog.show(this, "修改中,请稍后") is LoadState.Success -> { - LoadingDialogHub.dismiss() + LoadingDialog.dismiss() AuthenticationHelper.removeToken() this.navigatePageTo() ActivityStackManager.finishAllActivity() } - else -> LoadingDialogHub.dismiss() + else -> LoadingDialog.dismiss() } } } diff --git a/app/src/main/java/com/casic/app/smartwell/view/DeployedWellActivity.kt b/app/src/main/java/com/casic/app/smartwell/view/DeployedWellActivity.kt index fb4339c..28a5078 100644 --- a/app/src/main/java/com/casic/app/smartwell/view/DeployedWellActivity.kt +++ b/app/src/main/java/com/casic/app/smartwell/view/DeployedWellActivity.kt @@ -83,8 +83,8 @@ } //添加分割线 - binding.deployedListView.addItemDecoration( - RecyclerViewItemOffsets(0, 5, 0, 5) + binding.recyclerView.addItemDecoration( + RecyclerViewItemOffsets(0, 7, 0, 7) ) } @@ -149,12 +149,11 @@ } else { item.deep.toString() + "m" } - viewHolder.setText(R.id.wellNameView, item.wellName) + viewHolder.setText(R.id.wellTypeView, item.wellTypeName) .setText(R.id.wellDepthView, "深:${deep}") .setText(R.id.wellCodeView, "点位编号:${item.wellCode}") - .setText(R.id.wellTypeView, "点位类型:${item.wellTypeName}") .setText(R.id.ownerShipView, "权属单位:${item.deptName}") - .setText(R.id.wellLocationView, "点位置:${item.position}") + .setText(R.id.wellLocationView, "点位位置:${item.position}") .setOnClickListener( R.id.operationButton, object : View.OnClickListener { override fun onClick(v: View?) { @@ -207,7 +206,7 @@ }) } } - binding.deployedListView.adapter = deployAdapter + binding.recyclerView.adapter = deployAdapter deployAdapter.setOnItemClickedListener(object : NormalRecyclerAdapter.OnItemClickedListener { override fun onItemClicked(position: Int, t: WellListModel.DataBean.RowsBean) { diff --git a/app/src/main/java/com/casic/app/smartwell/view/LoginActivity.kt b/app/src/main/java/com/casic/app/smartwell/view/LoginActivity.kt index e4bb0e3..834527b 100644 --- a/app/src/main/java/com/casic/app/smartwell/view/LoginActivity.kt +++ b/app/src/main/java/com/casic/app/smartwell/view/LoginActivity.kt @@ -21,7 +21,7 @@ import com.pengxh.kt.lite.extensions.navigatePageTo import com.pengxh.kt.lite.extensions.readAssetsFile import com.pengxh.kt.lite.extensions.show -import com.pengxh.kt.lite.utils.LoadingDialogHub +import com.pengxh.kt.lite.utils.LoadingDialog import com.pengxh.kt.lite.utils.SaveKeyValues import kotlinx.coroutines.Dispatchers import kotlinx.coroutines.launch @@ -106,11 +106,11 @@ override fun observeRequestState() { authenticateViewModel.loadState.observe(this) { - LoadingDialogHub.show(this, "登录中,请稍后") + LoadingDialog.show(this, "登录中,请稍后") } loginViewModel.loadState.observe(this) { - LoadingDialogHub.dismiss() + LoadingDialog.dismiss() } } diff --git a/app/src/main/java/com/casic/app/smartwell/view/OrderCompletedDetailActivity.kt b/app/src/main/java/com/casic/app/smartwell/view/OrderCompletedDetailActivity.kt index db8ad1f..75cd905 100644 --- a/app/src/main/java/com/casic/app/smartwell/view/OrderCompletedDetailActivity.kt +++ b/app/src/main/java/com/casic/app/smartwell/view/OrderCompletedDetailActivity.kt @@ -17,7 +17,7 @@ import com.pengxh.kt.lite.extensions.show import com.pengxh.kt.lite.utils.Constant import com.pengxh.kt.lite.utils.LoadState -import com.pengxh.kt.lite.utils.LoadingDialogHub +import com.pengxh.kt.lite.utils.LoadingDialog import com.pengxh.kt.lite.widget.TitleBarView import com.pengxh.kt.lite.widget.dialog.AlertMessageDialog @@ -44,7 +44,7 @@ } override fun initOnCreate(savedInstanceState: Bundle?) { - val jobId = intent.getStringExtra(Constant.INTENT_PARAM)!! + val jobId = intent.getStringExtra(Constant.INTENT_PARAM_KEY)!! orderViewModel = ViewModelProvider(this)[OrderViewModel::class.java] orderViewModel.getWorkOrderDetail(jobId) orderViewModel.detailModel.observe(this) { @@ -154,8 +154,8 @@ override fun observeRequestState() { orderViewModel.loadState.observe(this) { when (it) { - is LoadState.Loading -> LoadingDialogHub.show(this, "数据加载中,请稍后") - else -> LoadingDialogHub.dismiss() + is LoadState.Loading -> LoadingDialog.show(this, "数据加载中,请稍后") + else -> LoadingDialog.dismiss() } } } diff --git a/app/src/main/java/com/casic/app/smartwell/view/OrderInHandleDetailActivity.kt b/app/src/main/java/com/casic/app/smartwell/view/OrderInHandleDetailActivity.kt index d70a979..04a7d5d 100644 --- a/app/src/main/java/com/casic/app/smartwell/view/OrderInHandleDetailActivity.kt +++ b/app/src/main/java/com/casic/app/smartwell/view/OrderInHandleDetailActivity.kt @@ -38,7 +38,7 @@ import com.pengxh.kt.lite.extensions.show import com.pengxh.kt.lite.utils.Constant import com.pengxh.kt.lite.utils.LoadState -import com.pengxh.kt.lite.utils.LoadingDialogHub +import com.pengxh.kt.lite.utils.LoadingDialog import com.pengxh.kt.lite.widget.TitleBarView import com.pengxh.kt.lite.widget.dialog.AlertControlDialog import com.pengxh.kt.lite.widget.dialog.AlertMessageDialog @@ -93,7 +93,7 @@ ) binding.addImageRecyclerView.adapter = imageAdapter - val jobId = intent.getStringExtra(Constant.INTENT_PARAM)!!//初始化图片九宫格 + val jobId = intent.getStringExtra(Constant.INTENT_PARAM_KEY)!!//初始化图片九宫格 orderViewModel.getWorkOrderDetail(jobId) orderViewModel.detailModel.observe(this) { if (it.code == 200) { @@ -312,41 +312,41 @@ override fun observeRequestState() { orderViewModel.loadState.observe(this) { when (it) { - is LoadState.Loading -> LoadingDialogHub.show(this, "数据加载中,请稍后") - else -> LoadingDialogHub.dismiss() + is LoadState.Loading -> LoadingDialog.show(this, "数据加载中,请稍后") + else -> LoadingDialog.dismiss() } } uploadImageViewModel.loadState.observe(this) { when (it) { - LoadState.Loading -> LoadingDialogHub.show(this, "图片上传中,请稍后...") - else -> LoadingDialogHub.dismiss() + LoadState.Loading -> LoadingDialog.show(this, "图片上传中,请稍后...") + else -> LoadingDialog.dismiss() } } //转单状态处理 operationViewModel.loadState.observe(this) { when (it) { - is LoadState.Loading -> LoadingDialogHub.show(this, "转单中,请稍后") + is LoadState.Loading -> LoadingDialog.show(this, "转单中,请稍后") is LoadState.Success -> { - LoadingDialogHub.dismiss() + LoadingDialog.dismiss() this.finish() } - else -> LoadingDialogHub.dismiss() + else -> LoadingDialog.dismiss() } } //处理完成工单状态处理 operationViewModel.loadState.observe(this) { when (it) { - is LoadState.Loading -> LoadingDialogHub.show(this, "处理中,请稍后") + is LoadState.Loading -> LoadingDialog.show(this, "处理中,请稍后") is LoadState.Success -> { - LoadingDialogHub.dismiss() + LoadingDialog.dismiss() this.finish() } - else -> LoadingDialogHub.dismiss() + else -> LoadingDialog.dismiss() } } } diff --git a/app/src/main/java/com/casic/app/smartwell/view/OrderNotConfirmedDetailActivity.kt b/app/src/main/java/com/casic/app/smartwell/view/OrderNotConfirmedDetailActivity.kt index 8e036d2..687ec86 100644 --- a/app/src/main/java/com/casic/app/smartwell/view/OrderNotConfirmedDetailActivity.kt +++ b/app/src/main/java/com/casic/app/smartwell/view/OrderNotConfirmedDetailActivity.kt @@ -36,7 +36,7 @@ import com.pengxh.kt.lite.extensions.show import com.pengxh.kt.lite.utils.Constant import com.pengxh.kt.lite.utils.LoadState -import com.pengxh.kt.lite.utils.LoadingDialogHub +import com.pengxh.kt.lite.utils.LoadingDialog import com.pengxh.kt.lite.widget.TitleBarView import com.pengxh.kt.lite.widget.dialog.AlertControlDialog import com.pengxh.kt.lite.widget.dialog.AlertMessageDialog @@ -80,7 +80,7 @@ } override fun initOnCreate(savedInstanceState: Bundle?) { - val jobId = intent.getStringExtra(Constant.INTENT_PARAM)!! + val jobId = intent.getStringExtra(Constant.INTENT_PARAM_KEY)!! //初始化图片九宫格 //左外边距,左内边距,右内边距,右外边距 val viewWidth = getScreenWidth() - (10 + 10 + 10 + 10).dp2px(this) @@ -263,41 +263,41 @@ //数据加载状态处理 orderViewModel.loadState.observe(this) { when (it) { - is LoadState.Loading -> LoadingDialogHub.show(this, "数据加载中,请稍后") - else -> LoadingDialogHub.dismiss() + is LoadState.Loading -> LoadingDialog.show(this, "数据加载中,请稍后") + else -> LoadingDialog.dismiss() } } uploadImageViewModel.loadState.observe(this) { when (it) { - LoadState.Loading -> LoadingDialogHub.show(this, "图片上传中,请稍后") - else -> LoadingDialogHub.dismiss() + LoadState.Loading -> LoadingDialog.show(this, "图片上传中,请稍后") + else -> LoadingDialog.dismiss() } } //转单状态处理 operationViewModel.loadState.observe(this) { when (it) { - is LoadState.Loading -> LoadingDialogHub.show(this, "转单中,请稍后") + is LoadState.Loading -> LoadingDialog.show(this, "转单中,请稍后") is LoadState.Success -> { - LoadingDialogHub.dismiss() + LoadingDialog.dismiss() this.finish() } - else -> LoadingDialogHub.dismiss() + else -> LoadingDialog.dismiss() } } //确认工单状态处理 operationViewModel.loadState.observe(this) { when (it) { - is LoadState.Loading -> LoadingDialogHub.show(this, "处理中,请稍后") + is LoadState.Loading -> LoadingDialog.show(this, "处理中,请稍后") is LoadState.Success -> { - LoadingDialogHub.dismiss() + LoadingDialog.dismiss() this.finish() } - else -> LoadingDialogHub.dismiss() + else -> LoadingDialog.dismiss() } } } diff --git a/app/src/main/java/com/casic/app/smartwell/view/OrderNotProcessedDetailActivity.kt b/app/src/main/java/com/casic/app/smartwell/view/OrderNotProcessedDetailActivity.kt index d3f22dc..0c97a52 100644 --- a/app/src/main/java/com/casic/app/smartwell/view/OrderNotProcessedDetailActivity.kt +++ b/app/src/main/java/com/casic/app/smartwell/view/OrderNotProcessedDetailActivity.kt @@ -18,7 +18,7 @@ import com.pengxh.kt.lite.extensions.show import com.pengxh.kt.lite.utils.Constant import com.pengxh.kt.lite.utils.LoadState -import com.pengxh.kt.lite.utils.LoadingDialogHub +import com.pengxh.kt.lite.utils.LoadingDialog import com.pengxh.kt.lite.widget.TitleBarView import com.pengxh.kt.lite.widget.dialog.AlertControlDialog import com.pengxh.kt.lite.widget.dialog.AlertMessageDialog @@ -50,7 +50,7 @@ } override fun initOnCreate(savedInstanceState: Bundle?) { - this.jobId = intent.getStringExtra(Constant.INTENT_PARAM)!! + this.jobId = intent.getStringExtra(Constant.INTENT_PARAM_KEY)!! orderViewModel = ViewModelProvider(this)[OrderViewModel::class.java] operationViewModel = ViewModelProvider(this)[OperationViewModel::class.java] wellViewModel = ViewModelProvider(this)[WellViewModel::class.java] @@ -162,21 +162,21 @@ //数据加载状态处理 orderViewModel.loadState.observe(this) { when (it) { - is LoadState.Loading -> LoadingDialogHub.show(this, "数据加载中,请稍后") - else -> LoadingDialogHub.dismiss() + is LoadState.Loading -> LoadingDialog.show(this, "数据加载中,请稍后") + else -> LoadingDialog.dismiss() } } //接单状态处理 operationViewModel.loadState.observe(this) { when (it) { - is LoadState.Loading -> LoadingDialogHub.show(this, "接单中,请稍后") + is LoadState.Loading -> LoadingDialog.show(this, "接单中,请稍后") is LoadState.Success -> { - LoadingDialogHub.dismiss() + LoadingDialog.dismiss() this.finish() } - else -> LoadingDialogHub.dismiss() + else -> LoadingDialog.dismiss() } } } diff --git a/app/src/main/java/com/casic/app/smartwell/view/SearchResultActivity.kt b/app/src/main/java/com/casic/app/smartwell/view/SearchResultActivity.kt index 6a92917..4f3a674 100644 --- a/app/src/main/java/com/casic/app/smartwell/view/SearchResultActivity.kt +++ b/app/src/main/java/com/casic/app/smartwell/view/SearchResultActivity.kt @@ -19,7 +19,7 @@ import com.pengxh.kt.lite.extensions.show import com.pengxh.kt.lite.utils.Constant import com.pengxh.kt.lite.utils.LoadState -import com.pengxh.kt.lite.utils.LoadingDialogHub +import com.pengxh.kt.lite.utils.LoadingDialog import com.pengxh.kt.lite.utils.WeakReferenceHandler import com.pengxh.kt.lite.widget.TitleBarView import com.pengxh.kt.lite.widget.dialog.AlertControlDialog @@ -56,7 +56,7 @@ } override fun initOnCreate(savedInstanceState: Bundle?) { - args = intent.getStringArrayListExtra(Constant.INTENT_PARAM)!! + args = intent.getStringArrayListExtra(Constant.INTENT_PARAM_KEY)!! orderViewModel = ViewModelProvider(this)[OrderViewModel::class.java] operationViewModel = ViewModelProvider(this)[OperationViewModel::class.java] @@ -101,24 +101,24 @@ } } - binding.resultRecyclerView.addItemDecoration( - RecyclerViewItemOffsets(0, 5, 0, 5) + binding.recyclerView.addItemDecoration( + RecyclerViewItemOffsets(0, 7, 0, 7) ) } override fun observeRequestState() { orderViewModel.loadState.observe(this) { when (it) { - is LoadState.Loading -> LoadingDialogHub.show(this, "数据加载中,请稍后") - else -> LoadingDialogHub.dismiss() + is LoadState.Loading -> LoadingDialog.show(this, "数据加载中,请稍后") + else -> LoadingDialog.dismiss() } } //接单状态处理 operationViewModel.loadState.observe(this) { when (it) { - is LoadState.Loading -> LoadingDialogHub.show(this, "接单中,请稍后") + is LoadState.Loading -> LoadingDialog.show(this, "接单中,请稍后") is LoadState.Success -> { - LoadingDialogHub.dismiss() + LoadingDialog.dismiss() //接单成功之后刷新列表 dataBeans.removeAt(clickedPosition) searchResultAdapter.notifyItemRemoved(clickedPosition) @@ -127,7 +127,7 @@ ) } - else -> LoadingDialogHub.dismiss() + else -> LoadingDialog.dismiss() } } } @@ -162,7 +162,7 @@ } else { binding.emptyInclude.emptyView.hide() searchResultAdapter = SearchResultAdapter(this, dataBeans) - binding.resultRecyclerView.adapter = searchResultAdapter + binding.recyclerView.adapter = searchResultAdapter searchResultAdapter.setOnItemClickListener(object : SearchResultAdapter.OnItemClickListener { override fun onClicked(position: Int) { diff --git a/app/src/main/java/com/casic/app/smartwell/view/UnDeployWellActivity.kt b/app/src/main/java/com/casic/app/smartwell/view/UnDeployWellActivity.kt index 7f7cd3c..555c278 100644 --- a/app/src/main/java/com/casic/app/smartwell/view/UnDeployWellActivity.kt +++ b/app/src/main/java/com/casic/app/smartwell/view/UnDeployWellActivity.kt @@ -81,8 +81,8 @@ } } - binding.undeployListView.addItemDecoration( - RecyclerViewItemOffsets(0, 5, 0, 5) + binding.recyclerView.addItemDecoration( + RecyclerViewItemOffsets(0, 7, 0, 7) ) } @@ -147,12 +147,11 @@ } else { item.deep.toString() + "m" } - viewHolder.setText(R.id.wellNameView, item.wellName) + viewHolder.setText(R.id.wellTypeView, item.wellTypeName) .setText(R.id.wellDepthView, "深:${deep}") .setText(R.id.wellCodeView, "点位编号:${item.wellCode}") - .setText(R.id.wellTypeView, "点位类型:${item.wellTypeName}") .setText(R.id.ownerShipView, "权属单位:${item.deptName}") - .setText(R.id.wellLocationView, "点位置:${item.position}") + .setText(R.id.wellLocationView, "点位位置:${item.position}") .setOnClickListener( R.id.operationButton, object : View.OnClickListener { override fun onClick(v: View?) { @@ -185,7 +184,7 @@ ) } } - binding.undeployListView.adapter = unDeployAdapter + binding.recyclerView.adapter = unDeployAdapter unDeployAdapter.setOnItemClickedListener(object : NormalRecyclerAdapter.OnItemClickedListener { override fun onItemClicked(position: Int, t: WellListModel.DataBean.RowsBean) { diff --git a/app/src/main/java/com/casic/app/smartwell/view/WellDetailActivity.kt b/app/src/main/java/com/casic/app/smartwell/view/WellDetailActivity.kt index b50d067..eb8b468 100644 --- a/app/src/main/java/com/casic/app/smartwell/view/WellDetailActivity.kt +++ b/app/src/main/java/com/casic/app/smartwell/view/WellDetailActivity.kt @@ -16,7 +16,7 @@ import com.pengxh.kt.lite.extensions.show import com.pengxh.kt.lite.utils.Constant import com.pengxh.kt.lite.utils.LoadState -import com.pengxh.kt.lite.utils.LoadingDialogHub +import com.pengxh.kt.lite.utils.LoadingDialog import com.pengxh.kt.lite.widget.TitleBarView import com.pengxh.kt.lite.widget.dialog.AlertMessageDialog @@ -44,7 +44,7 @@ } override fun initOnCreate(savedInstanceState: Bundle?) { - val wellId = intent.getStringExtra(Constant.INTENT_PARAM)!! + val wellId = intent.getStringExtra(Constant.INTENT_PARAM_KEY)!! wellViewModel = ViewModelProvider(this)[WellViewModel::class.java] wellViewModel.getWellDetail(wellId) wellViewModel.wellDetailModel.observe(this) { @@ -132,8 +132,8 @@ override fun observeRequestState() { wellViewModel.loadState.observe(this) { when (it) { - is LoadState.Loading -> LoadingDialogHub.show(this, "数据加载中,请稍后") - else -> LoadingDialogHub.dismiss() + is LoadState.Loading -> LoadingDialog.show(this, "数据加载中,请稍后") + else -> LoadingDialog.dismiss() } } } diff --git a/app/src/main/java/com/casic/app/smartwell/view/WellManagementActivity.kt b/app/src/main/java/com/casic/app/smartwell/view/WellManagementActivity.kt index 084da95..457096b 100644 --- a/app/src/main/java/com/casic/app/smartwell/view/WellManagementActivity.kt +++ b/app/src/main/java/com/casic/app/smartwell/view/WellManagementActivity.kt @@ -94,8 +94,8 @@ } } - binding.wellListView.addItemDecoration( - RecyclerViewItemOffsets(0, 5, 0, 5) + binding.recyclerView.addItemDecoration( + RecyclerViewItemOffsets(0, 7, 0, 7) ) } @@ -175,13 +175,12 @@ } else { item.deep.toString() + "m" } - viewHolder.setText(R.id.wellNameView, item.wellName) + viewHolder.setText(R.id.wellTypeView, item.wellTypeName) .setText(R.id.wellStateView, "已${item.bfztName}") .setText(R.id.wellDepthView, "深:${deep}") .setText(R.id.wellCodeView, "点位编号:${item.wellCode}") - .setText(R.id.wellTypeView, "点位类型:${item.wellTypeName}") .setText(R.id.ownerShipView, "权属单位:${item.deptName}") - .setText(R.id.wellLocationView, "点位置:${item.position}") + .setText(R.id.wellLocationView, "点位位置:${item.position}") .setOnClickListener( R.id.navigationButton, object : View.OnClickListener { override fun onClick(v: View?) { @@ -200,7 +199,7 @@ ) } } - binding.wellListView.adapter = wellListAdapter + binding.recyclerView.adapter = wellListAdapter wellListAdapter.setOnItemClickedListener(object : NormalRecyclerAdapter.OnItemClickedListener { override fun onItemClicked(position: Int, t: WellListModel.DataBean.RowsBean) { diff --git a/app/src/main/java/com/casic/app/smartwell/view/WellMonitorActivity.kt b/app/src/main/java/com/casic/app/smartwell/view/WellMonitorActivity.kt index e3573eb..b87bdb7 100644 --- a/app/src/main/java/com/casic/app/smartwell/view/WellMonitorActivity.kt +++ b/app/src/main/java/com/casic/app/smartwell/view/WellMonitorActivity.kt @@ -11,7 +11,7 @@ import com.pengxh.kt.lite.base.KotlinBaseActivity import com.pengxh.kt.lite.utils.Constant import com.pengxh.kt.lite.utils.LoadState -import com.pengxh.kt.lite.utils.LoadingDialogHub +import com.pengxh.kt.lite.utils.LoadingDialog import com.pengxh.kt.lite.widget.TitleBarView class WellMonitorActivity : KotlinBaseActivity() { @@ -36,7 +36,7 @@ } override fun initOnCreate(savedInstanceState: Bundle?) { - val wellId = intent.getStringExtra(Constant.INTENT_PARAM)!! + val wellId = intent.getStringExtra(Constant.INTENT_PARAM_KEY)!! wellViewModel = ViewModelProvider(this)[WellViewModel::class.java] wellViewModel.getMonitorResult(wellId) wellViewModel.monitorModel.observe(this) { @@ -56,8 +56,8 @@ override fun observeRequestState() { wellViewModel.loadState.observe(this) { when (it) { - is LoadState.Loading -> LoadingDialogHub.show(this, "数据加载中,请稍后") - else -> LoadingDialogHub.dismiss() + is LoadState.Loading -> LoadingDialog.show(this, "数据加载中,请稍后") + else -> LoadingDialog.dismiss() } } } diff --git a/app/src/main/java/com/casic/app/smartwell/view/WellOperationActivity.kt b/app/src/main/java/com/casic/app/smartwell/view/WellOperationActivity.kt index 8d333bf..347ebb6 100644 --- a/app/src/main/java/com/casic/app/smartwell/view/WellOperationActivity.kt +++ b/app/src/main/java/com/casic/app/smartwell/view/WellOperationActivity.kt @@ -23,7 +23,7 @@ import com.pengxh.kt.lite.extensions.navigatePageTo import com.pengxh.kt.lite.extensions.show import com.pengxh.kt.lite.utils.LoadState -import com.pengxh.kt.lite.utils.LoadingDialogHub +import com.pengxh.kt.lite.utils.LoadingDialog import com.pengxh.kt.lite.utils.WeakReferenceHandler import com.pengxh.kt.lite.widget.dialog.AlertControlDialog @@ -109,8 +109,8 @@ } } - binding.operationListView.addItemDecoration( - RecyclerViewItemOffsets(0, 5, 0, 5) + binding.recyclerView.addItemDecoration( + RecyclerViewItemOffsets(0, 7, 0, 7) ) } @@ -123,13 +123,13 @@ override fun observeRequestState() { wellViewModel.loadState.observe(this) { when (it) { - is LoadState.Loading -> LoadingDialogHub.show(this, "处理中,请稍后") + is LoadState.Loading -> LoadingDialog.show(this, "处理中,请稍后") is LoadState.Success -> { - LoadingDialogHub.dismiss() + LoadingDialog.dismiss() wellOperationAdapter.notifyItemChanged(clickedPosition) } - else -> LoadingDialogHub.dismiss() + else -> LoadingDialog.dismiss() } } } @@ -203,24 +203,23 @@ if (item.bfztName == "布防") { viewHolder.setImageResource( R.id.wellStateView, R.drawable.bg_solid_text_green_radius_5 - ).setText(R.id.wellStateView, "撤防") + ).setText(R.id.operationButton, "撤防") } else { viewHolder.setImageResource( R.id.wellStateView, R.drawable.bg_solid_text_red_radius_5 - ).setText(R.id.wellStateView, "布防") + ).setText(R.id.operationButton, "布防") } val deep = if (item.deep.toString().isBlank()) { "未知" } else { item.deep.toString() + "m" } - viewHolder.setText(R.id.wellNameView, item.wellName) + viewHolder.setText(R.id.wellTypeView, item.wellTypeName) .setText(R.id.wellStateView, "已${item.bfztName}") .setText(R.id.wellDepthView, "深:${deep}") .setText(R.id.wellCodeView, "点位编号:${item.wellCode}") - .setText(R.id.wellTypeView, "点位类型:${item.wellTypeName}") .setText(R.id.ownerShipView, "权属单位:${item.deptName}") - .setText(R.id.wellLocationView, "点位置:${item.position}") + .setText(R.id.wellLocationView, "点位位置:${item.position}") .setOnClickListener( R.id.operationButton, object : View.OnClickListener { override fun onClick(v: View?) { @@ -280,7 +279,7 @@ ) } } - binding.operationListView.adapter = wellOperationAdapter + binding.recyclerView.adapter = wellOperationAdapter wellOperationAdapter.setOnItemClickedListener(object : NormalRecyclerAdapter.OnItemClickedListener { override fun onItemClicked(position: Int, t: WellListModel.DataBean.RowsBean) { diff --git a/app/src/main/res/drawable/ic_down.xml b/app/src/main/res/drawable/ic_down.xml index 20e6476..6987e6c 100644 --- a/app/src/main/res/drawable/ic_down.xml +++ b/app/src/main/res/drawable/ic_down.xml @@ -1,6 +1,6 @@ + + diff --git a/app/src/main/res/layout/activity_about_us.xml b/app/src/main/res/layout/activity_about_us.xml index 9091a00..d5fbd0d 100644 --- a/app/src/main/res/layout/activity_about_us.xml +++ b/app/src/main/res/layout/activity_about_us.xml @@ -12,13 +12,7 @@ android:layout_width="match_parent" android:layout_height="wrap_content" android:background="@color/mainThemeColor" - app:tbv_left_image="@drawable/ic_title_left" - app:tbv_only_show_title="false" - app:tbv_show_left_image="true" - app:tbv_show_right_image="false" - app:tbv_text="关于我们" - app:tbv_text_color="@color/white" - app:tbv_text_size="@dimen/sp_18" /> + app:tbv_text="关于我们" /> + app:tbv_text="修改密码" /> + app:tbv_text="布防列表" /> + app:tbv_text="帮助中心" /> + app:tbv_text="工单详情" /> + app:tbv_text="工单详情" /> + app:tbv_text="工单详情" /> + app:tbv_text="工单详情" /> + app:tbv_text="超时工单" /> + app:tbv_text="工单查询" /> + app:tbv_text="查询结果" /> + app:tbv_text="撤防列表" /> + app:tbv_text="个人资料" /> + app:tbv_text="点位详情" /> + app:tbv_text="监控内容" /> - - - - - - + android:layout_height="wrap_content" + android:background="@color/mainThemeColor" + app:tbv_show_left_image="false" + app:tbv_show_right_image="true" + app:tbv_text="首页" /> - + - + - - - - - - + android:layout_height="wrap_content" + android:background="@color/mainThemeColor" + app:tbv_right_image="@drawable/ic_search_white" + app:tbv_show_left_image="false" + app:tbv_show_right_image="true" + app:tbv_text="工单" /> - - - - - - \ No newline at end of file diff --git a/app/src/main/res/layout/item_deployed_rv.xml b/app/src/main/res/layout/item_deployed_rv.xml index 391ad28..fadcf1d 100644 --- a/app/src/main/res/layout/item_deployed_rv.xml +++ b/app/src/main/res/layout/item_deployed_rv.xml @@ -3,10 +3,9 @@ xmlns:app="http://schemas.android.com/apk/res-auto" android:layout_width="match_parent" android:layout_height="wrap_content" - android:layout_marginHorizontal="@dimen/dp_5" android:background="@drawable/bg_solid_layout_white_radius_10" android:orientation="vertical" - android:padding="@dimen/dp_5"> + android:padding="@dimen/dp_7"> @@ -42,63 +41,63 @@ android:textColor="@color/subTextColor" /> - - - - - + android:gravity="center" + android:orientation="horizontal"> - + - + - + + + + + + android:gravity="center" + android:orientation="vertical"> - - + + + + + \ No newline at end of file diff --git a/app/src/main/res/layout/item_order_completed_rv.xml b/app/src/main/res/layout/item_order_completed_rv.xml index e4ff890..3c78a0f 100644 --- a/app/src/main/res/layout/item_order_completed_rv.xml +++ b/app/src/main/res/layout/item_order_completed_rv.xml @@ -96,6 +96,7 @@ android:layout_height="wrap_content" android:layout_alignParentEnd="true" android:layout_centerVertical="true" + android:padding="@dimen/dp_10" android:src="@drawable/ic_down" /> diff --git a/app/build.gradle b/app/build.gradle index 296fb6f..c18c251 100644 --- a/app/build.gradle +++ b/app/build.gradle @@ -40,10 +40,6 @@ // VIVO 相关应用参数 VIVO_APP_ID : "105749048", VIVO_APP_KEY : "e460fbf2c689e0f8c58ecc6aa62e1803", - - // 小米相关应用参数 -// XIAOMI_APP_ID : "", -// XIAOMI_APP_KEY : "", ] // 版本名后面添加一句话,意思就是flavor dimension 它的维度就是该版本号,多渠道打包很重要 @@ -107,7 +103,7 @@ dependencies { implementation fileTree(dir: 'libs', include: ['*.jar']) //基础依赖库 - implementation 'com.github.AndroidCoderPeng:Kotlin-lite-lib:1.0.10' + implementation 'com.github.AndroidCoderPeng:Kotlin-lite-lib:1.1.0' implementation 'androidx.appcompat:appcompat:1.6.1' implementation 'androidx.core:core-ktx:1.9.0' implementation 'androidx.constraintlayout:constraintlayout:2.1.4' @@ -165,8 +161,6 @@ implementation 'commons-codec:commons-codec:1.15' implementation 'com.android.support:support-annotations:28.0.0' implementation 'com.assist-v3:vivo:3.1.2' // vivo -// implementation 'com.getui.opt:xmp:3.3.1' // 小米 - //数据库框架 implementation 'org.greenrobot:greendao:3.3.0' //数据库升级 diff --git a/app/src/main/AndroidManifest.xml b/app/src/main/AndroidManifest.xml index c0af158..e0519bf 100644 --- a/app/src/main/AndroidManifest.xml +++ b/app/src/main/AndroidManifest.xml @@ -90,10 +90,10 @@ - + + android:value="ee96d8b5e12de3fbb29949efd57418a8" /> () @@ -150,7 +158,7 @@ val cameraPosition = CameraPosition(centerLatLng, 14f, 0f, 0f) val cameraUpdate = CameraUpdateFactory.newCameraPosition(cameraPosition) withContext(Dispatchers.Main) { - LoadingDialogHub.dismiss() + LoadingDialog.dismiss() aMap.animateCamera(cameraUpdate, 1500, null) } } @@ -239,11 +247,6 @@ } override fun initEvent() { - binding.rightOptionView.setOnClickListener { - val x = binding.rightOptionView.width - easyPopupWindow.width - easyPopupWindow.showAsDropDown(binding.rightOptionView, x, 0) - } - //撤防点位 binding.unDeployedLayout.setOnClickListener { requireContext().navigatePageTo() @@ -263,11 +266,11 @@ override fun observeRequestState() { wellViewModel.loadState.observe(this) { when (it) { - is LoadState.Loading -> LoadingDialogHub.show( + is LoadState.Loading -> LoadingDialog.show( requireActivity(), "数据加载中,请稍后..." ) - else -> LoadingDialogHub.dismiss() + else -> LoadingDialog.dismiss() } } } @@ -376,7 +379,7 @@ }).build().show() } }) - infoPopup.showAsDropDown(binding.rightOptionView) +// infoPopup.showAsDropDown(binding.rightOptionView) } override fun onCameraChange(p0: CameraPosition?) { diff --git a/app/src/main/java/com/casic/app/smartwell/fragment/HomePageNoClusterFragment.kt b/app/src/main/java/com/casic/app/smartwell/fragment/HomePageNoClusterFragment.kt index 802426a..b25f743 100644 --- a/app/src/main/java/com/casic/app/smartwell/fragment/HomePageNoClusterFragment.kt +++ b/app/src/main/java/com/casic/app/smartwell/fragment/HomePageNoClusterFragment.kt @@ -38,8 +38,9 @@ import com.pengxh.kt.lite.extensions.navigatePageTo import com.pengxh.kt.lite.extensions.show import com.pengxh.kt.lite.utils.LoadState -import com.pengxh.kt.lite.utils.LoadingDialogHub +import com.pengxh.kt.lite.utils.LoadingDialog import com.pengxh.kt.lite.widget.EasyPopupWindow +import com.pengxh.kt.lite.widget.TitleBarView import com.pengxh.kt.lite.widget.dialog.AlertControlDialog import kotlinx.coroutines.Dispatchers import kotlinx.coroutines.launch @@ -78,7 +79,15 @@ override fun setupTopBarLayout() { binding.rootView.initImmersionBar(this, false, R.color.mainThemeColor) - binding.titleView.text = "首页" + binding.titleView.setOnClickListener(object : TitleBarView.OnClickListener { + override fun onLeftClick() { + + } + + override fun onRightClick() { + easyPopupWindow.showAsDropDown(binding.titleView, binding.titleView.width, 0) + } + }) } override fun initOnCreate(savedInstanceState: Bundle?) { @@ -112,7 +121,7 @@ //渲染井位置 lifecycleScope.launch(Dispatchers.Main) { - LoadingDialogHub.show(requireActivity(), "数据加载中,请稍后") + LoadingDialog.show(requireActivity(), "数据加载中,请稍后") withContext(Dispatchers.IO) { //取Well缓存 val allMarkerOptions = ArrayList() @@ -144,7 +153,7 @@ val cameraPosition = CameraPosition(centerLatLng, 14f, 0f, 0f) val cameraUpdate = CameraUpdateFactory.newCameraPosition(cameraPosition) withContext(Dispatchers.Main) { - LoadingDialogHub.dismiss() + LoadingDialog.dismiss() aMap.animateCamera(cameraUpdate, 1500, null) } } @@ -238,11 +247,6 @@ } override fun initEvent() { - binding.rightOptionView.setOnClickListener { - val x = binding.rightOptionView.width - easyPopupWindow.width - easyPopupWindow.showAsDropDown(binding.rightOptionView, x, 0) - } - //撤防点位 binding.unDeployedLayout.setOnClickListener { requireContext().navigatePageTo() @@ -262,11 +266,11 @@ override fun observeRequestState() { wellViewModel.loadState.observe(this) { when (it) { - is LoadState.Loading -> LoadingDialogHub.show( + is LoadState.Loading -> LoadingDialog.show( requireActivity(), "数据加载中,请稍后..." ) - else -> LoadingDialogHub.dismiss() + else -> LoadingDialog.dismiss() } } } diff --git a/app/src/main/java/com/casic/app/smartwell/fragment/MinePageFragment.kt b/app/src/main/java/com/casic/app/smartwell/fragment/MinePageFragment.kt index 09a570c..dcb48f8 100644 --- a/app/src/main/java/com/casic/app/smartwell/fragment/MinePageFragment.kt +++ b/app/src/main/java/com/casic/app/smartwell/fragment/MinePageFragment.kt @@ -35,7 +35,7 @@ import com.pengxh.kt.lite.utils.ActivityStackManager import com.pengxh.kt.lite.utils.FileDownloadManager import com.pengxh.kt.lite.utils.LoadState -import com.pengxh.kt.lite.utils.LoadingDialogHub +import com.pengxh.kt.lite.utils.LoadingDialog import com.pengxh.kt.lite.widget.dialog.AlertControlDialog import com.pengxh.kt.lite.widget.dialog.BottomActionSheet import kotlinx.coroutines.Dispatchers @@ -60,7 +60,6 @@ override fun setupTopBarLayout() { binding.rootView.initImmersionBar(this, false, R.color.mainThemeColor) - binding.titleInclude.titleView.text = "我的" } override fun initOnCreate(savedInstanceState: Bundle?) { @@ -155,27 +154,27 @@ override fun observeRequestState() { userViewModel.loadState.observe(this) { when (it) { - is LoadState.Loading -> LoadingDialogHub.show( + is LoadState.Loading -> LoadingDialog.show( requireActivity(), "检查版本中,请稍后" ) - else -> LoadingDialogHub.dismiss() + else -> LoadingDialog.dismiss() } } wellViewModel.loadState.observe(this) { when (it) { - is LoadState.Loading -> LoadingDialogHub.show( + is LoadState.Loading -> LoadingDialog.show( requireActivity(), "数据更新中,请稍后" ) is LoadState.Fail -> { - LoadingDialogHub.dismiss() + LoadingDialog.dismiss() "数据更新超时".show(requireContext()) } else -> { - LoadingDialogHub.dismiss() + LoadingDialog.dismiss() AlertControlDialog.Builder().setContext(requireContext()).setTitle("温馨提示") .setMessage("数据更新成功,请重启应用").setNegativeButton("取消") .setPositiveButton("确定").setOnDialogButtonClickListener(object : @@ -197,17 +196,17 @@ lineViewModel.loadState.observe(this) { when (it) { - is LoadState.Loading -> LoadingDialogHub.show( + is LoadState.Loading -> LoadingDialog.show( requireActivity(), "数据更新中,请稍后" ) is LoadState.Fail -> { - LoadingDialogHub.dismiss() + LoadingDialog.dismiss() "数据更新超时".show(requireContext()) } else -> { - LoadingDialogHub.dismiss() + LoadingDialog.dismiss() AlertControlDialog.Builder().setContext(requireContext()).setTitle("温馨提示") .setMessage("数据更新成功,请重启应用").setNegativeButton("取消") .setPositiveButton("确定").setOnDialogButtonClickListener(object : diff --git a/app/src/main/java/com/casic/app/smartwell/fragment/NoticePageFragment.kt b/app/src/main/java/com/casic/app/smartwell/fragment/NoticePageFragment.kt index 171b555..3c93f54 100644 --- a/app/src/main/java/com/casic/app/smartwell/fragment/NoticePageFragment.kt +++ b/app/src/main/java/com/casic/app/smartwell/fragment/NoticePageFragment.kt @@ -48,7 +48,6 @@ override fun setupTopBarLayout() { binding.rootView.initImmersionBar(this, false, R.color.mainThemeColor) - binding.titleInclude.titleView.text = "消息" } override fun initOnCreate(savedInstanceState: Bundle?) { diff --git a/app/src/main/java/com/casic/app/smartwell/fragment/OrderListFragment.kt b/app/src/main/java/com/casic/app/smartwell/fragment/OrderListFragment.kt index 93ff35b..5e38acb 100644 --- a/app/src/main/java/com/casic/app/smartwell/fragment/OrderListFragment.kt +++ b/app/src/main/java/com/casic/app/smartwell/fragment/OrderListFragment.kt @@ -12,6 +12,7 @@ import com.casic.app.smartwell.view.SearchOrderActivity import com.pengxh.kt.lite.base.KotlinBaseFragment import com.pengxh.kt.lite.extensions.navigatePageTo +import com.pengxh.kt.lite.widget.TitleBarView class OrderListFragment : KotlinBaseFragment() { @@ -25,15 +26,22 @@ } override fun initViewBinding( - inflater: LayoutInflater, - container: ViewGroup? + inflater: LayoutInflater, container: ViewGroup? ): FragmentOrderBinding { return FragmentOrderBinding.inflate(inflater, container, false) } override fun setupTopBarLayout() { binding.rootView.initImmersionBar(this, false, R.color.mainThemeColor) - binding.titleView.text = "工单" + binding.titleView.setOnClickListener(object : TitleBarView.OnClickListener { + override fun onLeftClick() { + + } + + override fun onRightClick() { + requireContext().navigatePageTo() + } + }) } override fun initOnCreate(savedInstanceState: Bundle?) { @@ -51,8 +59,6 @@ } override fun initEvent() { - binding.rightOptionView.setOnClickListener { - requireContext().navigatePageTo() - } + } } \ No newline at end of file diff --git a/app/src/main/java/com/casic/app/smartwell/fragment/OrderNotProcessedFragment.kt b/app/src/main/java/com/casic/app/smartwell/fragment/OrderNotProcessedFragment.kt index 0b3d09d..2b6f21d 100644 --- a/app/src/main/java/com/casic/app/smartwell/fragment/OrderNotProcessedFragment.kt +++ b/app/src/main/java/com/casic/app/smartwell/fragment/OrderNotProcessedFragment.kt @@ -18,7 +18,7 @@ import com.pengxh.kt.lite.extensions.navigatePageTo import com.pengxh.kt.lite.extensions.show import com.pengxh.kt.lite.utils.LoadState -import com.pengxh.kt.lite.utils.LoadingDialogHub +import com.pengxh.kt.lite.utils.LoadingDialog import com.pengxh.kt.lite.utils.WeakReferenceHandler import com.pengxh.kt.lite.widget.dialog.AlertControlDialog @@ -78,8 +78,8 @@ operationViewModel = ViewModelProvider(this)[OperationViewModel::class.java] - binding.notProcessedView.addItemDecoration( - RecyclerViewItemOffsets(0, 5, 0, 5) + binding.recyclerView.addItemDecoration( + RecyclerViewItemOffsets(0, 7, 0, 7) ) } @@ -87,9 +87,9 @@ //接单状态处理 operationViewModel.loadState.observe(this) { when (it) { - is LoadState.Loading -> LoadingDialogHub.show(requireActivity(), "接单中,请稍后") + is LoadState.Loading -> LoadingDialog.show(requireActivity(), "接单中,请稍后") is LoadState.Success -> { - LoadingDialogHub.dismiss() + LoadingDialog.dismiss() //接单成功之后刷新列表 dataBeans.removeAt(clickedPosition) notProcessedAdapter.notifyItemRemoved(clickedPosition) @@ -98,7 +98,7 @@ ) } - else -> LoadingDialogHub.dismiss() + else -> LoadingDialog.dismiss() } } } @@ -131,7 +131,7 @@ } else { binding.emptyInclude.emptyView.hide() notProcessedAdapter = OrderNotProcessedAdapter(requireContext(), dataBeans) - binding.notProcessedView.adapter = notProcessedAdapter + binding.recyclerView.adapter = notProcessedAdapter notProcessedAdapter.setOnItemClickListener(object : OrderNotProcessedAdapter.OnItemClickListener { override fun onClicked(position: Int) { diff --git a/app/src/main/java/com/casic/app/smartwell/fragment/OvertimeNotAcceptFragment.kt b/app/src/main/java/com/casic/app/smartwell/fragment/OvertimeNotAcceptFragment.kt index a198545..9b318ca 100644 --- a/app/src/main/java/com/casic/app/smartwell/fragment/OvertimeNotAcceptFragment.kt +++ b/app/src/main/java/com/casic/app/smartwell/fragment/OvertimeNotAcceptFragment.kt @@ -18,7 +18,7 @@ import com.pengxh.kt.lite.extensions.navigatePageTo import com.pengxh.kt.lite.extensions.show import com.pengxh.kt.lite.utils.LoadState -import com.pengxh.kt.lite.utils.LoadingDialogHub +import com.pengxh.kt.lite.utils.LoadingDialog import com.pengxh.kt.lite.utils.WeakReferenceHandler import com.pengxh.kt.lite.widget.dialog.AlertControlDialog @@ -81,8 +81,8 @@ operationViewModel = ViewModelProvider(this)[OperationViewModel::class.java] - binding.notProcessedView.addItemDecoration( - RecyclerViewItemOffsets(0, 5, 0, 5) + binding.recyclerView.addItemDecoration( + RecyclerViewItemOffsets(0, 7, 0, 7) ) } @@ -90,9 +90,9 @@ //接单状态处理 operationViewModel.loadState.observe(this) { when (it) { - is LoadState.Loading -> LoadingDialogHub.show(requireActivity(), "接单中,请稍后") + is LoadState.Loading -> LoadingDialog.show(requireActivity(), "接单中,请稍后") is LoadState.Success -> { - LoadingDialogHub.dismiss() + LoadingDialog.dismiss() //接单成功之后刷新列表 dataBeans.removeAt(clickedPosition) notProcessedAdapter.notifyItemRemoved(clickedPosition) @@ -101,7 +101,7 @@ ) } - else -> LoadingDialogHub.dismiss() + else -> LoadingDialog.dismiss() } } } @@ -134,7 +134,7 @@ } else { binding.emptyInclude.emptyView.hide() notProcessedAdapter = OrderNotProcessedAdapter(requireContext(), dataBeans) - binding.notProcessedView.adapter = notProcessedAdapter + binding.recyclerView.adapter = notProcessedAdapter notProcessedAdapter.setOnItemClickListener(object : OrderNotProcessedAdapter.OnItemClickListener { override fun onClicked(position: Int) { diff --git a/app/src/main/java/com/casic/app/smartwell/greendao/DaoMaster.java b/app/src/main/java/com/casic/app/smartwell/greendao/DaoMaster.java index fdcf3a7..1e52b74 100644 --- a/app/src/main/java/com/casic/app/smartwell/greendao/DaoMaster.java +++ b/app/src/main/java/com/casic/app/smartwell/greendao/DaoMaster.java @@ -13,25 +13,20 @@ // THIS CODE IS GENERATED BY greenDAO, DO NOT EDIT. - /** * Master of DAO (schema version 4): knows all DAOs. */ public class DaoMaster extends AbstractDaoMaster { public static final int SCHEMA_VERSION = 4; - /** - * Creates underlying database table using DAOs. - */ + /** Creates underlying database table using DAOs. */ public static void createAllTables(Database db, boolean ifNotExists) { MapWellLocalBeanDao.createTable(db, ifNotExists); NoticeLocaleBeanDao.createTable(db, ifNotExists); PipeLocalBeanDao.createTable(db, ifNotExists); } - /** - * Drops underlying database table using DAOs. - */ + /** Drops underlying database table using DAOs. */ public static void dropAllTables(Database db, boolean ifExists) { MapWellLocalBeanDao.dropTable(db, ifExists); NoticeLocaleBeanDao.dropTable(db, ifExists); @@ -86,9 +81,7 @@ } } - /** - * WARNING: Drops all table on Upgrade! Use only during development. - */ + /** WARNING: Drops all table on Upgrade! Use only during development. */ public static class DevOpenHelper extends OpenHelper { public DevOpenHelper(Context context, String name) { super(context, name); diff --git a/app/src/main/java/com/casic/app/smartwell/greendao/DaoSession.java b/app/src/main/java/com/casic/app/smartwell/greendao/DaoSession.java index 0b36d17..3e40e3b 100644 --- a/app/src/main/java/com/casic/app/smartwell/greendao/DaoSession.java +++ b/app/src/main/java/com/casic/app/smartwell/greendao/DaoSession.java @@ -16,7 +16,7 @@ /** * {@inheritDoc} - * + * * @see org.greenrobot.greendao.AbstractDaoSession */ public class DaoSession extends AbstractDaoSession { @@ -50,7 +50,7 @@ registerDao(NoticeLocaleBean.class, noticeLocaleBeanDao); registerDao(PipeLocalBean.class, pipeLocalBeanDao); } - + public void clear() { mapWellLocalBeanDaoConfig.clearIdentityScope(); noticeLocaleBeanDaoConfig.clearIdentityScope(); diff --git a/app/src/main/java/com/casic/app/smartwell/greendao/MapWellLocalBeanDao.java b/app/src/main/java/com/casic/app/smartwell/greendao/MapWellLocalBeanDao.java index 8908fda..407bc92 100644 --- a/app/src/main/java/com/casic/app/smartwell/greendao/MapWellLocalBeanDao.java +++ b/app/src/main/java/com/casic/app/smartwell/greendao/MapWellLocalBeanDao.java @@ -12,10 +12,9 @@ import org.greenrobot.greendao.internal.DaoConfig; // THIS CODE IS GENERATED BY greenDAO, DO NOT EDIT. - -/** +/** * DAO for table "MAP_WELL_LOCAL_BEAN". - */ +*/ public class MapWellLocalBeanDao extends AbstractDao { public static final String TABLENAME = "MAP_WELL_LOCAL_BEAN"; @@ -57,16 +56,14 @@ public MapWellLocalBeanDao(DaoConfig config) { super(config); } - + public MapWellLocalBeanDao(DaoConfig config, DaoSession daoSession) { super(config, daoSession); } - /** - * Creates the underlying database table. - */ + /** Creates the underlying database table. */ public static void createTable(Database db, boolean ifNotExists) { - String constraint = ifNotExists ? "IF NOT EXISTS " : ""; + String constraint = ifNotExists? "IF NOT EXISTS ": ""; db.execSQL("CREATE TABLE " + constraint + "\"MAP_WELL_LOCAL_BEAN\" (" + // "\"_id\" INTEGER PRIMARY KEY AUTOINCREMENT ," + // 0: kId "\"AREA\" TEXT," + // 1: area @@ -96,9 +93,7 @@ "\"WELL_TYPE_NAME\" TEXT);"); // 25: wellTypeName } - /** - * Drops the underlying database table. - */ + /** Drops the underlying database table. */ public static void dropTable(Database db, boolean ifExists) { String sql = "DROP TABLE " + (ifExists ? "IF EXISTS " : "") + "\"MAP_WELL_LOCAL_BEAN\""; db.execSQL(sql); @@ -107,132 +102,132 @@ @Override protected final void bindValues(DatabaseStatement stmt, MapWellLocalBean entity) { stmt.clearBindings(); - + Long kId = entity.getKId(); if (kId != null) { stmt.bindLong(1, kId); } - + String area = entity.getArea(); if (area != null) { stmt.bindString(2, area); } - + String bfzt = entity.getBfzt(); if (bfzt != null) { stmt.bindString(3, bfzt); } - + String bfztName = entity.getBfztName(); if (bfztName != null) { stmt.bindString(4, bfztName); } - + String coordinateX = entity.getCoordinateX(); if (coordinateX != null) { stmt.bindString(5, coordinateX); } - + String coordinateY = entity.getCoordinateY(); if (coordinateY != null) { stmt.bindString(6, coordinateY); } - + String deep = entity.getDeep(); if (deep != null) { stmt.bindString(7, deep); } - + String deptName = entity.getDeptName(); if (deptName != null) { stmt.bindString(8, deptName); } - + String deptid = entity.getDeptid(); if (deptid != null) { stmt.bindString(9, deptid); } - + String id = entity.getId(); if (id != null) { stmt.bindString(10, id); } - + String latBaidu = entity.getLatBaidu(); if (latBaidu != null) { stmt.bindString(11, latBaidu); } - + String latGaode = entity.getLatGaode(); if (latGaode != null) { stmt.bindString(12, latGaode); } - + String lngBaidu = entity.getLngBaidu(); if (lngBaidu != null) { stmt.bindString(13, lngBaidu); } - + String lngGaode = entity.getLngGaode(); if (lngGaode != null) { stmt.bindString(14, lngGaode); } - + String notes = entity.getNotes(); if (notes != null) { stmt.bindString(15, notes); } - + String photos = entity.getPhotos(); if (photos != null) { stmt.bindString(16, photos); } - + String position = entity.getPosition(); if (position != null) { stmt.bindString(17, position); } - + String staff = entity.getStaff(); if (staff != null) { stmt.bindString(18, staff); } - + String tel = entity.getTel(); if (tel != null) { stmt.bindString(19, tel); } - + String ts = entity.getTs(); if (ts != null) { stmt.bindString(20, ts); } - + String valid = entity.getValid(); if (valid != null) { stmt.bindString(21, valid); } - + String watchData = entity.getWatchData(); if (watchData != null) { stmt.bindString(22, watchData); } - + String wellCode = entity.getWellCode(); if (wellCode != null) { stmt.bindString(23, wellCode); } - + String wellName = entity.getWellName(); if (wellName != null) { stmt.bindString(24, wellName); } - + String wellType = entity.getWellType(); if (wellType != null) { stmt.bindString(25, wellType); } - + String wellTypeName = entity.getWellTypeName(); if (wellTypeName != null) { stmt.bindString(26, wellTypeName); @@ -242,132 +237,132 @@ @Override protected final void bindValues(SQLiteStatement stmt, MapWellLocalBean entity) { stmt.clearBindings(); - + Long kId = entity.getKId(); if (kId != null) { stmt.bindLong(1, kId); } - + String area = entity.getArea(); if (area != null) { stmt.bindString(2, area); } - + String bfzt = entity.getBfzt(); if (bfzt != null) { stmt.bindString(3, bfzt); } - + String bfztName = entity.getBfztName(); if (bfztName != null) { stmt.bindString(4, bfztName); } - + String coordinateX = entity.getCoordinateX(); if (coordinateX != null) { stmt.bindString(5, coordinateX); } - + String coordinateY = entity.getCoordinateY(); if (coordinateY != null) { stmt.bindString(6, coordinateY); } - + String deep = entity.getDeep(); if (deep != null) { stmt.bindString(7, deep); } - + String deptName = entity.getDeptName(); if (deptName != null) { stmt.bindString(8, deptName); } - + String deptid = entity.getDeptid(); if (deptid != null) { stmt.bindString(9, deptid); } - + String id = entity.getId(); if (id != null) { stmt.bindString(10, id); } - + String latBaidu = entity.getLatBaidu(); if (latBaidu != null) { stmt.bindString(11, latBaidu); } - + String latGaode = entity.getLatGaode(); if (latGaode != null) { stmt.bindString(12, latGaode); } - + String lngBaidu = entity.getLngBaidu(); if (lngBaidu != null) { stmt.bindString(13, lngBaidu); } - + String lngGaode = entity.getLngGaode(); if (lngGaode != null) { stmt.bindString(14, lngGaode); } - + String notes = entity.getNotes(); if (notes != null) { stmt.bindString(15, notes); } - + String photos = entity.getPhotos(); if (photos != null) { stmt.bindString(16, photos); } - + String position = entity.getPosition(); if (position != null) { stmt.bindString(17, position); } - + String staff = entity.getStaff(); if (staff != null) { stmt.bindString(18, staff); } - + String tel = entity.getTel(); if (tel != null) { stmt.bindString(19, tel); } - + String ts = entity.getTs(); if (ts != null) { stmt.bindString(20, ts); } - + String valid = entity.getValid(); if (valid != null) { stmt.bindString(21, valid); } - + String watchData = entity.getWatchData(); if (watchData != null) { stmt.bindString(22, watchData); } - + String wellCode = entity.getWellCode(); if (wellCode != null) { stmt.bindString(23, wellCode); } - + String wellName = entity.getWellName(); if (wellName != null) { stmt.bindString(24, wellName); } - + String wellType = entity.getWellType(); if (wellType != null) { stmt.bindString(25, wellType); } - + String wellTypeName = entity.getWellTypeName(); if (wellTypeName != null) { stmt.bindString(26, wellTypeName); @@ -377,41 +372,41 @@ @Override public Long readKey(Cursor cursor, int offset) { return cursor.isNull(offset + 0) ? null : cursor.getLong(offset + 0); - } + } @Override public MapWellLocalBean readEntity(Cursor cursor, int offset) { MapWellLocalBean entity = new MapWellLocalBean( // - cursor.isNull(offset + 0) ? null : cursor.getLong(offset + 0), // kId - cursor.isNull(offset + 1) ? null : cursor.getString(offset + 1), // area - cursor.isNull(offset + 2) ? null : cursor.getString(offset + 2), // bfzt - cursor.isNull(offset + 3) ? null : cursor.getString(offset + 3), // bfztName - cursor.isNull(offset + 4) ? null : cursor.getString(offset + 4), // coordinateX - cursor.isNull(offset + 5) ? null : cursor.getString(offset + 5), // coordinateY - cursor.isNull(offset + 6) ? null : cursor.getString(offset + 6), // deep - cursor.isNull(offset + 7) ? null : cursor.getString(offset + 7), // deptName - cursor.isNull(offset + 8) ? null : cursor.getString(offset + 8), // deptid - cursor.isNull(offset + 9) ? null : cursor.getString(offset + 9), // id - cursor.isNull(offset + 10) ? null : cursor.getString(offset + 10), // latBaidu - cursor.isNull(offset + 11) ? null : cursor.getString(offset + 11), // latGaode - cursor.isNull(offset + 12) ? null : cursor.getString(offset + 12), // lngBaidu - cursor.isNull(offset + 13) ? null : cursor.getString(offset + 13), // lngGaode - cursor.isNull(offset + 14) ? null : cursor.getString(offset + 14), // notes - cursor.isNull(offset + 15) ? null : cursor.getString(offset + 15), // photos - cursor.isNull(offset + 16) ? null : cursor.getString(offset + 16), // position - cursor.isNull(offset + 17) ? null : cursor.getString(offset + 17), // staff - cursor.isNull(offset + 18) ? null : cursor.getString(offset + 18), // tel - cursor.isNull(offset + 19) ? null : cursor.getString(offset + 19), // ts - cursor.isNull(offset + 20) ? null : cursor.getString(offset + 20), // valid - cursor.isNull(offset + 21) ? null : cursor.getString(offset + 21), // watchData - cursor.isNull(offset + 22) ? null : cursor.getString(offset + 22), // wellCode - cursor.isNull(offset + 23) ? null : cursor.getString(offset + 23), // wellName - cursor.isNull(offset + 24) ? null : cursor.getString(offset + 24), // wellType - cursor.isNull(offset + 25) ? null : cursor.getString(offset + 25) // wellTypeName + cursor.isNull(offset + 0) ? null : cursor.getLong(offset + 0), // kId + cursor.isNull(offset + 1) ? null : cursor.getString(offset + 1), // area + cursor.isNull(offset + 2) ? null : cursor.getString(offset + 2), // bfzt + cursor.isNull(offset + 3) ? null : cursor.getString(offset + 3), // bfztName + cursor.isNull(offset + 4) ? null : cursor.getString(offset + 4), // coordinateX + cursor.isNull(offset + 5) ? null : cursor.getString(offset + 5), // coordinateY + cursor.isNull(offset + 6) ? null : cursor.getString(offset + 6), // deep + cursor.isNull(offset + 7) ? null : cursor.getString(offset + 7), // deptName + cursor.isNull(offset + 8) ? null : cursor.getString(offset + 8), // deptid + cursor.isNull(offset + 9) ? null : cursor.getString(offset + 9), // id + cursor.isNull(offset + 10) ? null : cursor.getString(offset + 10), // latBaidu + cursor.isNull(offset + 11) ? null : cursor.getString(offset + 11), // latGaode + cursor.isNull(offset + 12) ? null : cursor.getString(offset + 12), // lngBaidu + cursor.isNull(offset + 13) ? null : cursor.getString(offset + 13), // lngGaode + cursor.isNull(offset + 14) ? null : cursor.getString(offset + 14), // notes + cursor.isNull(offset + 15) ? null : cursor.getString(offset + 15), // photos + cursor.isNull(offset + 16) ? null : cursor.getString(offset + 16), // position + cursor.isNull(offset + 17) ? null : cursor.getString(offset + 17), // staff + cursor.isNull(offset + 18) ? null : cursor.getString(offset + 18), // tel + cursor.isNull(offset + 19) ? null : cursor.getString(offset + 19), // ts + cursor.isNull(offset + 20) ? null : cursor.getString(offset + 20), // valid + cursor.isNull(offset + 21) ? null : cursor.getString(offset + 21), // watchData + cursor.isNull(offset + 22) ? null : cursor.getString(offset + 22), // wellCode + cursor.isNull(offset + 23) ? null : cursor.getString(offset + 23), // wellName + cursor.isNull(offset + 24) ? null : cursor.getString(offset + 24), // wellType + cursor.isNull(offset + 25) ? null : cursor.getString(offset + 25) // wellTypeName ); return entity; } - + @Override public void readEntity(Cursor cursor, MapWellLocalBean entity, int offset) { entity.setKId(cursor.isNull(offset + 0) ? null : cursor.getLong(offset + 0)); @@ -440,17 +435,17 @@ entity.setWellName(cursor.isNull(offset + 23) ? null : cursor.getString(offset + 23)); entity.setWellType(cursor.isNull(offset + 24) ? null : cursor.getString(offset + 24)); entity.setWellTypeName(cursor.isNull(offset + 25) ? null : cursor.getString(offset + 25)); - } - + } + @Override protected final Long updateKeyAfterInsert(MapWellLocalBean entity, long rowId) { entity.setKId(rowId); return rowId; } - + @Override public Long getKey(MapWellLocalBean entity) { - if (entity != null) { + if(entity != null) { return entity.getKId(); } else { return null; @@ -466,5 +461,5 @@ protected final boolean isEntityUpdateable() { return true; } - + } diff --git a/app/src/main/java/com/casic/app/smartwell/greendao/NoticeLocaleBeanDao.java b/app/src/main/java/com/casic/app/smartwell/greendao/NoticeLocaleBeanDao.java index 64312ed..deb2d49 100644 --- a/app/src/main/java/com/casic/app/smartwell/greendao/NoticeLocaleBeanDao.java +++ b/app/src/main/java/com/casic/app/smartwell/greendao/NoticeLocaleBeanDao.java @@ -12,10 +12,9 @@ import org.greenrobot.greendao.internal.DaoConfig; // THIS CODE IS GENERATED BY greenDAO, DO NOT EDIT. - -/** +/** * DAO for table "NOTICE_LOCALE_BEAN". - */ +*/ public class NoticeLocaleBeanDao extends AbstractDao { public static final String TABLENAME = "NOTICE_LOCALE_BEAN"; @@ -43,16 +42,14 @@ public NoticeLocaleBeanDao(DaoConfig config) { super(config); } - + public NoticeLocaleBeanDao(DaoConfig config, DaoSession daoSession) { super(config, daoSession); } - /** - * Creates the underlying database table. - */ + /** Creates the underlying database table. */ public static void createTable(Database db, boolean ifNotExists) { - String constraint = ifNotExists ? "IF NOT EXISTS " : ""; + String constraint = ifNotExists? "IF NOT EXISTS ": ""; db.execSQL("CREATE TABLE " + constraint + "\"NOTICE_LOCALE_BEAN\" (" + // "\"_id\" INTEGER PRIMARY KEY AUTOINCREMENT ," + // 0: id "\"MESSAGE_ID\" TEXT UNIQUE ," + // 1: messageId @@ -68,9 +65,7 @@ "\"NOTICE_TIME\" TEXT);"); // 11: noticeTime } - /** - * Drops the underlying database table. - */ + /** Drops the underlying database table. */ public static void dropTable(Database db, boolean ifExists) { String sql = "DROP TABLE " + (ifExists ? "IF EXISTS " : "") + "\"NOTICE_LOCALE_BEAN\""; db.execSQL(sql); @@ -79,62 +74,62 @@ @Override protected final void bindValues(DatabaseStatement stmt, NoticeLocaleBean entity) { stmt.clearBindings(); - + Long id = entity.getId(); if (id != null) { stmt.bindLong(1, id); } - + String messageId = entity.getMessageId(); if (messageId != null) { stmt.bindString(2, messageId); } - + String appid = entity.getAppid(); if (appid != null) { stmt.bindString(3, appid); } - + String clientId = entity.getClientId(); if (clientId != null) { stmt.bindString(4, clientId); } - + String taskId = entity.getTaskId(); if (taskId != null) { stmt.bindString(5, taskId); } - + String userId = entity.getUserId(); if (userId != null) { stmt.bindString(6, userId); } - + String title = entity.getTitle(); if (title != null) { stmt.bindString(7, title); } - + String content = entity.getContent(); if (content != null) { stmt.bindString(8, content); } - + String deviceCode = entity.getDeviceCode(); if (deviceCode != null) { stmt.bindString(9, deviceCode); } - + String jobId = entity.getJobId(); if (jobId != null) { stmt.bindString(10, jobId); } - + String isRead = entity.getIsRead(); if (isRead != null) { stmt.bindString(11, isRead); } - + String noticeTime = entity.getNoticeTime(); if (noticeTime != null) { stmt.bindString(12, noticeTime); @@ -144,62 +139,62 @@ @Override protected final void bindValues(SQLiteStatement stmt, NoticeLocaleBean entity) { stmt.clearBindings(); - + Long id = entity.getId(); if (id != null) { stmt.bindLong(1, id); } - + String messageId = entity.getMessageId(); if (messageId != null) { stmt.bindString(2, messageId); } - + String appid = entity.getAppid(); if (appid != null) { stmt.bindString(3, appid); } - + String clientId = entity.getClientId(); if (clientId != null) { stmt.bindString(4, clientId); } - + String taskId = entity.getTaskId(); if (taskId != null) { stmt.bindString(5, taskId); } - + String userId = entity.getUserId(); if (userId != null) { stmt.bindString(6, userId); } - + String title = entity.getTitle(); if (title != null) { stmt.bindString(7, title); } - + String content = entity.getContent(); if (content != null) { stmt.bindString(8, content); } - + String deviceCode = entity.getDeviceCode(); if (deviceCode != null) { stmt.bindString(9, deviceCode); } - + String jobId = entity.getJobId(); if (jobId != null) { stmt.bindString(10, jobId); } - + String isRead = entity.getIsRead(); if (isRead != null) { stmt.bindString(11, isRead); } - + String noticeTime = entity.getNoticeTime(); if (noticeTime != null) { stmt.bindString(12, noticeTime); @@ -209,27 +204,27 @@ @Override public Long readKey(Cursor cursor, int offset) { return cursor.isNull(offset + 0) ? null : cursor.getLong(offset + 0); - } + } @Override public NoticeLocaleBean readEntity(Cursor cursor, int offset) { NoticeLocaleBean entity = new NoticeLocaleBean( // - cursor.isNull(offset + 0) ? null : cursor.getLong(offset + 0), // id - cursor.isNull(offset + 1) ? null : cursor.getString(offset + 1), // messageId - cursor.isNull(offset + 2) ? null : cursor.getString(offset + 2), // appid - cursor.isNull(offset + 3) ? null : cursor.getString(offset + 3), // clientId - cursor.isNull(offset + 4) ? null : cursor.getString(offset + 4), // taskId - cursor.isNull(offset + 5) ? null : cursor.getString(offset + 5), // userId - cursor.isNull(offset + 6) ? null : cursor.getString(offset + 6), // title - cursor.isNull(offset + 7) ? null : cursor.getString(offset + 7), // content - cursor.isNull(offset + 8) ? null : cursor.getString(offset + 8), // deviceCode - cursor.isNull(offset + 9) ? null : cursor.getString(offset + 9), // jobId - cursor.isNull(offset + 10) ? null : cursor.getString(offset + 10), // isRead - cursor.isNull(offset + 11) ? null : cursor.getString(offset + 11) // noticeTime + cursor.isNull(offset + 0) ? null : cursor.getLong(offset + 0), // id + cursor.isNull(offset + 1) ? null : cursor.getString(offset + 1), // messageId + cursor.isNull(offset + 2) ? null : cursor.getString(offset + 2), // appid + cursor.isNull(offset + 3) ? null : cursor.getString(offset + 3), // clientId + cursor.isNull(offset + 4) ? null : cursor.getString(offset + 4), // taskId + cursor.isNull(offset + 5) ? null : cursor.getString(offset + 5), // userId + cursor.isNull(offset + 6) ? null : cursor.getString(offset + 6), // title + cursor.isNull(offset + 7) ? null : cursor.getString(offset + 7), // content + cursor.isNull(offset + 8) ? null : cursor.getString(offset + 8), // deviceCode + cursor.isNull(offset + 9) ? null : cursor.getString(offset + 9), // jobId + cursor.isNull(offset + 10) ? null : cursor.getString(offset + 10), // isRead + cursor.isNull(offset + 11) ? null : cursor.getString(offset + 11) // noticeTime ); return entity; } - + @Override public void readEntity(Cursor cursor, NoticeLocaleBean entity, int offset) { entity.setId(cursor.isNull(offset + 0) ? null : cursor.getLong(offset + 0)); @@ -244,17 +239,17 @@ entity.setJobId(cursor.isNull(offset + 9) ? null : cursor.getString(offset + 9)); entity.setIsRead(cursor.isNull(offset + 10) ? null : cursor.getString(offset + 10)); entity.setNoticeTime(cursor.isNull(offset + 11) ? null : cursor.getString(offset + 11)); - } - + } + @Override protected final Long updateKeyAfterInsert(NoticeLocaleBean entity, long rowId) { entity.setId(rowId); return rowId; } - + @Override public Long getKey(NoticeLocaleBean entity) { - if (entity != null) { + if(entity != null) { return entity.getId(); } else { return null; @@ -270,5 +265,5 @@ protected final boolean isEntityUpdateable() { return true; } - + } diff --git a/app/src/main/java/com/casic/app/smartwell/greendao/PipeLocalBeanDao.java b/app/src/main/java/com/casic/app/smartwell/greendao/PipeLocalBeanDao.java index aab4d3f..df5515a 100644 --- a/app/src/main/java/com/casic/app/smartwell/greendao/PipeLocalBeanDao.java +++ b/app/src/main/java/com/casic/app/smartwell/greendao/PipeLocalBeanDao.java @@ -12,10 +12,9 @@ import org.greenrobot.greendao.internal.DaoConfig; // THIS CODE IS GENERATED BY greenDAO, DO NOT EDIT. - -/** +/** * DAO for table "PIPE_LOCAL_BEAN". - */ +*/ public class PipeLocalBeanDao extends AbstractDao { public static final String TABLENAME = "PIPE_LOCAL_BEAN"; @@ -37,16 +36,14 @@ public PipeLocalBeanDao(DaoConfig config) { super(config); } - + public PipeLocalBeanDao(DaoConfig config, DaoSession daoSession) { super(config, daoSession); } - /** - * Creates the underlying database table. - */ + /** Creates the underlying database table. */ public static void createTable(Database db, boolean ifNotExists) { - String constraint = ifNotExists ? "IF NOT EXISTS " : ""; + String constraint = ifNotExists? "IF NOT EXISTS ": ""; db.execSQL("CREATE TABLE " + constraint + "\"PIPE_LOCAL_BEAN\" (" + // "\"_id\" INTEGER PRIMARY KEY AUTOINCREMENT ," + // 0: id "\"PIPE_CODE\" TEXT," + // 1: pipeCode @@ -56,9 +53,7 @@ "\"START_LONGITUDE_GD\" TEXT);"); // 5: startLongitudeGd } - /** - * Drops the underlying database table. - */ + /** Drops the underlying database table. */ public static void dropTable(Database db, boolean ifExists) { String sql = "DROP TABLE " + (ifExists ? "IF EXISTS " : "") + "\"PIPE_LOCAL_BEAN\""; db.execSQL(sql); @@ -67,32 +62,32 @@ @Override protected final void bindValues(DatabaseStatement stmt, PipeLocalBean entity) { stmt.clearBindings(); - + Long id = entity.getId(); if (id != null) { stmt.bindLong(1, id); } - + String pipeCode = entity.getPipeCode(); if (pipeCode != null) { stmt.bindString(2, pipeCode); } - + String endLatitudeGd = entity.getEndLatitudeGd(); if (endLatitudeGd != null) { stmt.bindString(3, endLatitudeGd); } - + String endLongitudeGd = entity.getEndLongitudeGd(); if (endLongitudeGd != null) { stmt.bindString(4, endLongitudeGd); } - + String startLatitudeGd = entity.getStartLatitudeGd(); if (startLatitudeGd != null) { stmt.bindString(5, startLatitudeGd); } - + String startLongitudeGd = entity.getStartLongitudeGd(); if (startLongitudeGd != null) { stmt.bindString(6, startLongitudeGd); @@ -102,32 +97,32 @@ @Override protected final void bindValues(SQLiteStatement stmt, PipeLocalBean entity) { stmt.clearBindings(); - + Long id = entity.getId(); if (id != null) { stmt.bindLong(1, id); } - + String pipeCode = entity.getPipeCode(); if (pipeCode != null) { stmt.bindString(2, pipeCode); } - + String endLatitudeGd = entity.getEndLatitudeGd(); if (endLatitudeGd != null) { stmt.bindString(3, endLatitudeGd); } - + String endLongitudeGd = entity.getEndLongitudeGd(); if (endLongitudeGd != null) { stmt.bindString(4, endLongitudeGd); } - + String startLatitudeGd = entity.getStartLatitudeGd(); if (startLatitudeGd != null) { stmt.bindString(5, startLatitudeGd); } - + String startLongitudeGd = entity.getStartLongitudeGd(); if (startLongitudeGd != null) { stmt.bindString(6, startLongitudeGd); @@ -137,21 +132,21 @@ @Override public Long readKey(Cursor cursor, int offset) { return cursor.isNull(offset + 0) ? null : cursor.getLong(offset + 0); - } + } @Override public PipeLocalBean readEntity(Cursor cursor, int offset) { PipeLocalBean entity = new PipeLocalBean( // - cursor.isNull(offset + 0) ? null : cursor.getLong(offset + 0), // id - cursor.isNull(offset + 1) ? null : cursor.getString(offset + 1), // pipeCode - cursor.isNull(offset + 2) ? null : cursor.getString(offset + 2), // endLatitudeGd - cursor.isNull(offset + 3) ? null : cursor.getString(offset + 3), // endLongitudeGd - cursor.isNull(offset + 4) ? null : cursor.getString(offset + 4), // startLatitudeGd - cursor.isNull(offset + 5) ? null : cursor.getString(offset + 5) // startLongitudeGd + cursor.isNull(offset + 0) ? null : cursor.getLong(offset + 0), // id + cursor.isNull(offset + 1) ? null : cursor.getString(offset + 1), // pipeCode + cursor.isNull(offset + 2) ? null : cursor.getString(offset + 2), // endLatitudeGd + cursor.isNull(offset + 3) ? null : cursor.getString(offset + 3), // endLongitudeGd + cursor.isNull(offset + 4) ? null : cursor.getString(offset + 4), // startLatitudeGd + cursor.isNull(offset + 5) ? null : cursor.getString(offset + 5) // startLongitudeGd ); return entity; } - + @Override public void readEntity(Cursor cursor, PipeLocalBean entity, int offset) { entity.setId(cursor.isNull(offset + 0) ? null : cursor.getLong(offset + 0)); @@ -160,17 +155,17 @@ entity.setEndLongitudeGd(cursor.isNull(offset + 3) ? null : cursor.getString(offset + 3)); entity.setStartLatitudeGd(cursor.isNull(offset + 4) ? null : cursor.getString(offset + 4)); entity.setStartLongitudeGd(cursor.isNull(offset + 5) ? null : cursor.getString(offset + 5)); - } - + } + @Override protected final Long updateKeyAfterInsert(PipeLocalBean entity, long rowId) { entity.setId(rowId); return rowId; } - + @Override public Long getKey(PipeLocalBean entity) { - if (entity != null) { + if(entity != null) { return entity.getId(); } else { return null; @@ -186,5 +181,5 @@ protected final boolean isEntityUpdateable() { return true; } - + } diff --git a/app/src/main/java/com/casic/app/smartwell/view/ChangePasswordActivity.kt b/app/src/main/java/com/casic/app/smartwell/view/ChangePasswordActivity.kt index 8e41039..9f1dd40 100644 --- a/app/src/main/java/com/casic/app/smartwell/view/ChangePasswordActivity.kt +++ b/app/src/main/java/com/casic/app/smartwell/view/ChangePasswordActivity.kt @@ -14,7 +14,7 @@ import com.pengxh.kt.lite.extensions.show import com.pengxh.kt.lite.utils.ActivityStackManager import com.pengxh.kt.lite.utils.LoadState -import com.pengxh.kt.lite.utils.LoadingDialogHub +import com.pengxh.kt.lite.utils.LoadingDialog import com.pengxh.kt.lite.widget.TitleBarView import java.nio.charset.StandardCharsets @@ -46,15 +46,15 @@ override fun observeRequestState() { userViewModel.loadState.observe(this) { when (it) { - is LoadState.Loading -> LoadingDialogHub.show(this, "修改中,请稍后") + is LoadState.Loading -> LoadingDialog.show(this, "修改中,请稍后") is LoadState.Success -> { - LoadingDialogHub.dismiss() + LoadingDialog.dismiss() AuthenticationHelper.removeToken() this.navigatePageTo() ActivityStackManager.finishAllActivity() } - else -> LoadingDialogHub.dismiss() + else -> LoadingDialog.dismiss() } } } diff --git a/app/src/main/java/com/casic/app/smartwell/view/DeployedWellActivity.kt b/app/src/main/java/com/casic/app/smartwell/view/DeployedWellActivity.kt index fb4339c..28a5078 100644 --- a/app/src/main/java/com/casic/app/smartwell/view/DeployedWellActivity.kt +++ b/app/src/main/java/com/casic/app/smartwell/view/DeployedWellActivity.kt @@ -83,8 +83,8 @@ } //添加分割线 - binding.deployedListView.addItemDecoration( - RecyclerViewItemOffsets(0, 5, 0, 5) + binding.recyclerView.addItemDecoration( + RecyclerViewItemOffsets(0, 7, 0, 7) ) } @@ -149,12 +149,11 @@ } else { item.deep.toString() + "m" } - viewHolder.setText(R.id.wellNameView, item.wellName) + viewHolder.setText(R.id.wellTypeView, item.wellTypeName) .setText(R.id.wellDepthView, "深:${deep}") .setText(R.id.wellCodeView, "点位编号:${item.wellCode}") - .setText(R.id.wellTypeView, "点位类型:${item.wellTypeName}") .setText(R.id.ownerShipView, "权属单位:${item.deptName}") - .setText(R.id.wellLocationView, "点位置:${item.position}") + .setText(R.id.wellLocationView, "点位位置:${item.position}") .setOnClickListener( R.id.operationButton, object : View.OnClickListener { override fun onClick(v: View?) { @@ -207,7 +206,7 @@ }) } } - binding.deployedListView.adapter = deployAdapter + binding.recyclerView.adapter = deployAdapter deployAdapter.setOnItemClickedListener(object : NormalRecyclerAdapter.OnItemClickedListener { override fun onItemClicked(position: Int, t: WellListModel.DataBean.RowsBean) { diff --git a/app/src/main/java/com/casic/app/smartwell/view/LoginActivity.kt b/app/src/main/java/com/casic/app/smartwell/view/LoginActivity.kt index e4bb0e3..834527b 100644 --- a/app/src/main/java/com/casic/app/smartwell/view/LoginActivity.kt +++ b/app/src/main/java/com/casic/app/smartwell/view/LoginActivity.kt @@ -21,7 +21,7 @@ import com.pengxh.kt.lite.extensions.navigatePageTo import com.pengxh.kt.lite.extensions.readAssetsFile import com.pengxh.kt.lite.extensions.show -import com.pengxh.kt.lite.utils.LoadingDialogHub +import com.pengxh.kt.lite.utils.LoadingDialog import com.pengxh.kt.lite.utils.SaveKeyValues import kotlinx.coroutines.Dispatchers import kotlinx.coroutines.launch @@ -106,11 +106,11 @@ override fun observeRequestState() { authenticateViewModel.loadState.observe(this) { - LoadingDialogHub.show(this, "登录中,请稍后") + LoadingDialog.show(this, "登录中,请稍后") } loginViewModel.loadState.observe(this) { - LoadingDialogHub.dismiss() + LoadingDialog.dismiss() } } diff --git a/app/src/main/java/com/casic/app/smartwell/view/OrderCompletedDetailActivity.kt b/app/src/main/java/com/casic/app/smartwell/view/OrderCompletedDetailActivity.kt index db8ad1f..75cd905 100644 --- a/app/src/main/java/com/casic/app/smartwell/view/OrderCompletedDetailActivity.kt +++ b/app/src/main/java/com/casic/app/smartwell/view/OrderCompletedDetailActivity.kt @@ -17,7 +17,7 @@ import com.pengxh.kt.lite.extensions.show import com.pengxh.kt.lite.utils.Constant import com.pengxh.kt.lite.utils.LoadState -import com.pengxh.kt.lite.utils.LoadingDialogHub +import com.pengxh.kt.lite.utils.LoadingDialog import com.pengxh.kt.lite.widget.TitleBarView import com.pengxh.kt.lite.widget.dialog.AlertMessageDialog @@ -44,7 +44,7 @@ } override fun initOnCreate(savedInstanceState: Bundle?) { - val jobId = intent.getStringExtra(Constant.INTENT_PARAM)!! + val jobId = intent.getStringExtra(Constant.INTENT_PARAM_KEY)!! orderViewModel = ViewModelProvider(this)[OrderViewModel::class.java] orderViewModel.getWorkOrderDetail(jobId) orderViewModel.detailModel.observe(this) { @@ -154,8 +154,8 @@ override fun observeRequestState() { orderViewModel.loadState.observe(this) { when (it) { - is LoadState.Loading -> LoadingDialogHub.show(this, "数据加载中,请稍后") - else -> LoadingDialogHub.dismiss() + is LoadState.Loading -> LoadingDialog.show(this, "数据加载中,请稍后") + else -> LoadingDialog.dismiss() } } } diff --git a/app/src/main/java/com/casic/app/smartwell/view/OrderInHandleDetailActivity.kt b/app/src/main/java/com/casic/app/smartwell/view/OrderInHandleDetailActivity.kt index d70a979..04a7d5d 100644 --- a/app/src/main/java/com/casic/app/smartwell/view/OrderInHandleDetailActivity.kt +++ b/app/src/main/java/com/casic/app/smartwell/view/OrderInHandleDetailActivity.kt @@ -38,7 +38,7 @@ import com.pengxh.kt.lite.extensions.show import com.pengxh.kt.lite.utils.Constant import com.pengxh.kt.lite.utils.LoadState -import com.pengxh.kt.lite.utils.LoadingDialogHub +import com.pengxh.kt.lite.utils.LoadingDialog import com.pengxh.kt.lite.widget.TitleBarView import com.pengxh.kt.lite.widget.dialog.AlertControlDialog import com.pengxh.kt.lite.widget.dialog.AlertMessageDialog @@ -93,7 +93,7 @@ ) binding.addImageRecyclerView.adapter = imageAdapter - val jobId = intent.getStringExtra(Constant.INTENT_PARAM)!!//初始化图片九宫格 + val jobId = intent.getStringExtra(Constant.INTENT_PARAM_KEY)!!//初始化图片九宫格 orderViewModel.getWorkOrderDetail(jobId) orderViewModel.detailModel.observe(this) { if (it.code == 200) { @@ -312,41 +312,41 @@ override fun observeRequestState() { orderViewModel.loadState.observe(this) { when (it) { - is LoadState.Loading -> LoadingDialogHub.show(this, "数据加载中,请稍后") - else -> LoadingDialogHub.dismiss() + is LoadState.Loading -> LoadingDialog.show(this, "数据加载中,请稍后") + else -> LoadingDialog.dismiss() } } uploadImageViewModel.loadState.observe(this) { when (it) { - LoadState.Loading -> LoadingDialogHub.show(this, "图片上传中,请稍后...") - else -> LoadingDialogHub.dismiss() + LoadState.Loading -> LoadingDialog.show(this, "图片上传中,请稍后...") + else -> LoadingDialog.dismiss() } } //转单状态处理 operationViewModel.loadState.observe(this) { when (it) { - is LoadState.Loading -> LoadingDialogHub.show(this, "转单中,请稍后") + is LoadState.Loading -> LoadingDialog.show(this, "转单中,请稍后") is LoadState.Success -> { - LoadingDialogHub.dismiss() + LoadingDialog.dismiss() this.finish() } - else -> LoadingDialogHub.dismiss() + else -> LoadingDialog.dismiss() } } //处理完成工单状态处理 operationViewModel.loadState.observe(this) { when (it) { - is LoadState.Loading -> LoadingDialogHub.show(this, "处理中,请稍后") + is LoadState.Loading -> LoadingDialog.show(this, "处理中,请稍后") is LoadState.Success -> { - LoadingDialogHub.dismiss() + LoadingDialog.dismiss() this.finish() } - else -> LoadingDialogHub.dismiss() + else -> LoadingDialog.dismiss() } } } diff --git a/app/src/main/java/com/casic/app/smartwell/view/OrderNotConfirmedDetailActivity.kt b/app/src/main/java/com/casic/app/smartwell/view/OrderNotConfirmedDetailActivity.kt index 8e036d2..687ec86 100644 --- a/app/src/main/java/com/casic/app/smartwell/view/OrderNotConfirmedDetailActivity.kt +++ b/app/src/main/java/com/casic/app/smartwell/view/OrderNotConfirmedDetailActivity.kt @@ -36,7 +36,7 @@ import com.pengxh.kt.lite.extensions.show import com.pengxh.kt.lite.utils.Constant import com.pengxh.kt.lite.utils.LoadState -import com.pengxh.kt.lite.utils.LoadingDialogHub +import com.pengxh.kt.lite.utils.LoadingDialog import com.pengxh.kt.lite.widget.TitleBarView import com.pengxh.kt.lite.widget.dialog.AlertControlDialog import com.pengxh.kt.lite.widget.dialog.AlertMessageDialog @@ -80,7 +80,7 @@ } override fun initOnCreate(savedInstanceState: Bundle?) { - val jobId = intent.getStringExtra(Constant.INTENT_PARAM)!! + val jobId = intent.getStringExtra(Constant.INTENT_PARAM_KEY)!! //初始化图片九宫格 //左外边距,左内边距,右内边距,右外边距 val viewWidth = getScreenWidth() - (10 + 10 + 10 + 10).dp2px(this) @@ -263,41 +263,41 @@ //数据加载状态处理 orderViewModel.loadState.observe(this) { when (it) { - is LoadState.Loading -> LoadingDialogHub.show(this, "数据加载中,请稍后") - else -> LoadingDialogHub.dismiss() + is LoadState.Loading -> LoadingDialog.show(this, "数据加载中,请稍后") + else -> LoadingDialog.dismiss() } } uploadImageViewModel.loadState.observe(this) { when (it) { - LoadState.Loading -> LoadingDialogHub.show(this, "图片上传中,请稍后") - else -> LoadingDialogHub.dismiss() + LoadState.Loading -> LoadingDialog.show(this, "图片上传中,请稍后") + else -> LoadingDialog.dismiss() } } //转单状态处理 operationViewModel.loadState.observe(this) { when (it) { - is LoadState.Loading -> LoadingDialogHub.show(this, "转单中,请稍后") + is LoadState.Loading -> LoadingDialog.show(this, "转单中,请稍后") is LoadState.Success -> { - LoadingDialogHub.dismiss() + LoadingDialog.dismiss() this.finish() } - else -> LoadingDialogHub.dismiss() + else -> LoadingDialog.dismiss() } } //确认工单状态处理 operationViewModel.loadState.observe(this) { when (it) { - is LoadState.Loading -> LoadingDialogHub.show(this, "处理中,请稍后") + is LoadState.Loading -> LoadingDialog.show(this, "处理中,请稍后") is LoadState.Success -> { - LoadingDialogHub.dismiss() + LoadingDialog.dismiss() this.finish() } - else -> LoadingDialogHub.dismiss() + else -> LoadingDialog.dismiss() } } } diff --git a/app/src/main/java/com/casic/app/smartwell/view/OrderNotProcessedDetailActivity.kt b/app/src/main/java/com/casic/app/smartwell/view/OrderNotProcessedDetailActivity.kt index d3f22dc..0c97a52 100644 --- a/app/src/main/java/com/casic/app/smartwell/view/OrderNotProcessedDetailActivity.kt +++ b/app/src/main/java/com/casic/app/smartwell/view/OrderNotProcessedDetailActivity.kt @@ -18,7 +18,7 @@ import com.pengxh.kt.lite.extensions.show import com.pengxh.kt.lite.utils.Constant import com.pengxh.kt.lite.utils.LoadState -import com.pengxh.kt.lite.utils.LoadingDialogHub +import com.pengxh.kt.lite.utils.LoadingDialog import com.pengxh.kt.lite.widget.TitleBarView import com.pengxh.kt.lite.widget.dialog.AlertControlDialog import com.pengxh.kt.lite.widget.dialog.AlertMessageDialog @@ -50,7 +50,7 @@ } override fun initOnCreate(savedInstanceState: Bundle?) { - this.jobId = intent.getStringExtra(Constant.INTENT_PARAM)!! + this.jobId = intent.getStringExtra(Constant.INTENT_PARAM_KEY)!! orderViewModel = ViewModelProvider(this)[OrderViewModel::class.java] operationViewModel = ViewModelProvider(this)[OperationViewModel::class.java] wellViewModel = ViewModelProvider(this)[WellViewModel::class.java] @@ -162,21 +162,21 @@ //数据加载状态处理 orderViewModel.loadState.observe(this) { when (it) { - is LoadState.Loading -> LoadingDialogHub.show(this, "数据加载中,请稍后") - else -> LoadingDialogHub.dismiss() + is LoadState.Loading -> LoadingDialog.show(this, "数据加载中,请稍后") + else -> LoadingDialog.dismiss() } } //接单状态处理 operationViewModel.loadState.observe(this) { when (it) { - is LoadState.Loading -> LoadingDialogHub.show(this, "接单中,请稍后") + is LoadState.Loading -> LoadingDialog.show(this, "接单中,请稍后") is LoadState.Success -> { - LoadingDialogHub.dismiss() + LoadingDialog.dismiss() this.finish() } - else -> LoadingDialogHub.dismiss() + else -> LoadingDialog.dismiss() } } } diff --git a/app/src/main/java/com/casic/app/smartwell/view/SearchResultActivity.kt b/app/src/main/java/com/casic/app/smartwell/view/SearchResultActivity.kt index 6a92917..4f3a674 100644 --- a/app/src/main/java/com/casic/app/smartwell/view/SearchResultActivity.kt +++ b/app/src/main/java/com/casic/app/smartwell/view/SearchResultActivity.kt @@ -19,7 +19,7 @@ import com.pengxh.kt.lite.extensions.show import com.pengxh.kt.lite.utils.Constant import com.pengxh.kt.lite.utils.LoadState -import com.pengxh.kt.lite.utils.LoadingDialogHub +import com.pengxh.kt.lite.utils.LoadingDialog import com.pengxh.kt.lite.utils.WeakReferenceHandler import com.pengxh.kt.lite.widget.TitleBarView import com.pengxh.kt.lite.widget.dialog.AlertControlDialog @@ -56,7 +56,7 @@ } override fun initOnCreate(savedInstanceState: Bundle?) { - args = intent.getStringArrayListExtra(Constant.INTENT_PARAM)!! + args = intent.getStringArrayListExtra(Constant.INTENT_PARAM_KEY)!! orderViewModel = ViewModelProvider(this)[OrderViewModel::class.java] operationViewModel = ViewModelProvider(this)[OperationViewModel::class.java] @@ -101,24 +101,24 @@ } } - binding.resultRecyclerView.addItemDecoration( - RecyclerViewItemOffsets(0, 5, 0, 5) + binding.recyclerView.addItemDecoration( + RecyclerViewItemOffsets(0, 7, 0, 7) ) } override fun observeRequestState() { orderViewModel.loadState.observe(this) { when (it) { - is LoadState.Loading -> LoadingDialogHub.show(this, "数据加载中,请稍后") - else -> LoadingDialogHub.dismiss() + is LoadState.Loading -> LoadingDialog.show(this, "数据加载中,请稍后") + else -> LoadingDialog.dismiss() } } //接单状态处理 operationViewModel.loadState.observe(this) { when (it) { - is LoadState.Loading -> LoadingDialogHub.show(this, "接单中,请稍后") + is LoadState.Loading -> LoadingDialog.show(this, "接单中,请稍后") is LoadState.Success -> { - LoadingDialogHub.dismiss() + LoadingDialog.dismiss() //接单成功之后刷新列表 dataBeans.removeAt(clickedPosition) searchResultAdapter.notifyItemRemoved(clickedPosition) @@ -127,7 +127,7 @@ ) } - else -> LoadingDialogHub.dismiss() + else -> LoadingDialog.dismiss() } } } @@ -162,7 +162,7 @@ } else { binding.emptyInclude.emptyView.hide() searchResultAdapter = SearchResultAdapter(this, dataBeans) - binding.resultRecyclerView.adapter = searchResultAdapter + binding.recyclerView.adapter = searchResultAdapter searchResultAdapter.setOnItemClickListener(object : SearchResultAdapter.OnItemClickListener { override fun onClicked(position: Int) { diff --git a/app/src/main/java/com/casic/app/smartwell/view/UnDeployWellActivity.kt b/app/src/main/java/com/casic/app/smartwell/view/UnDeployWellActivity.kt index 7f7cd3c..555c278 100644 --- a/app/src/main/java/com/casic/app/smartwell/view/UnDeployWellActivity.kt +++ b/app/src/main/java/com/casic/app/smartwell/view/UnDeployWellActivity.kt @@ -81,8 +81,8 @@ } } - binding.undeployListView.addItemDecoration( - RecyclerViewItemOffsets(0, 5, 0, 5) + binding.recyclerView.addItemDecoration( + RecyclerViewItemOffsets(0, 7, 0, 7) ) } @@ -147,12 +147,11 @@ } else { item.deep.toString() + "m" } - viewHolder.setText(R.id.wellNameView, item.wellName) + viewHolder.setText(R.id.wellTypeView, item.wellTypeName) .setText(R.id.wellDepthView, "深:${deep}") .setText(R.id.wellCodeView, "点位编号:${item.wellCode}") - .setText(R.id.wellTypeView, "点位类型:${item.wellTypeName}") .setText(R.id.ownerShipView, "权属单位:${item.deptName}") - .setText(R.id.wellLocationView, "点位置:${item.position}") + .setText(R.id.wellLocationView, "点位位置:${item.position}") .setOnClickListener( R.id.operationButton, object : View.OnClickListener { override fun onClick(v: View?) { @@ -185,7 +184,7 @@ ) } } - binding.undeployListView.adapter = unDeployAdapter + binding.recyclerView.adapter = unDeployAdapter unDeployAdapter.setOnItemClickedListener(object : NormalRecyclerAdapter.OnItemClickedListener { override fun onItemClicked(position: Int, t: WellListModel.DataBean.RowsBean) { diff --git a/app/src/main/java/com/casic/app/smartwell/view/WellDetailActivity.kt b/app/src/main/java/com/casic/app/smartwell/view/WellDetailActivity.kt index b50d067..eb8b468 100644 --- a/app/src/main/java/com/casic/app/smartwell/view/WellDetailActivity.kt +++ b/app/src/main/java/com/casic/app/smartwell/view/WellDetailActivity.kt @@ -16,7 +16,7 @@ import com.pengxh.kt.lite.extensions.show import com.pengxh.kt.lite.utils.Constant import com.pengxh.kt.lite.utils.LoadState -import com.pengxh.kt.lite.utils.LoadingDialogHub +import com.pengxh.kt.lite.utils.LoadingDialog import com.pengxh.kt.lite.widget.TitleBarView import com.pengxh.kt.lite.widget.dialog.AlertMessageDialog @@ -44,7 +44,7 @@ } override fun initOnCreate(savedInstanceState: Bundle?) { - val wellId = intent.getStringExtra(Constant.INTENT_PARAM)!! + val wellId = intent.getStringExtra(Constant.INTENT_PARAM_KEY)!! wellViewModel = ViewModelProvider(this)[WellViewModel::class.java] wellViewModel.getWellDetail(wellId) wellViewModel.wellDetailModel.observe(this) { @@ -132,8 +132,8 @@ override fun observeRequestState() { wellViewModel.loadState.observe(this) { when (it) { - is LoadState.Loading -> LoadingDialogHub.show(this, "数据加载中,请稍后") - else -> LoadingDialogHub.dismiss() + is LoadState.Loading -> LoadingDialog.show(this, "数据加载中,请稍后") + else -> LoadingDialog.dismiss() } } } diff --git a/app/src/main/java/com/casic/app/smartwell/view/WellManagementActivity.kt b/app/src/main/java/com/casic/app/smartwell/view/WellManagementActivity.kt index 084da95..457096b 100644 --- a/app/src/main/java/com/casic/app/smartwell/view/WellManagementActivity.kt +++ b/app/src/main/java/com/casic/app/smartwell/view/WellManagementActivity.kt @@ -94,8 +94,8 @@ } } - binding.wellListView.addItemDecoration( - RecyclerViewItemOffsets(0, 5, 0, 5) + binding.recyclerView.addItemDecoration( + RecyclerViewItemOffsets(0, 7, 0, 7) ) } @@ -175,13 +175,12 @@ } else { item.deep.toString() + "m" } - viewHolder.setText(R.id.wellNameView, item.wellName) + viewHolder.setText(R.id.wellTypeView, item.wellTypeName) .setText(R.id.wellStateView, "已${item.bfztName}") .setText(R.id.wellDepthView, "深:${deep}") .setText(R.id.wellCodeView, "点位编号:${item.wellCode}") - .setText(R.id.wellTypeView, "点位类型:${item.wellTypeName}") .setText(R.id.ownerShipView, "权属单位:${item.deptName}") - .setText(R.id.wellLocationView, "点位置:${item.position}") + .setText(R.id.wellLocationView, "点位位置:${item.position}") .setOnClickListener( R.id.navigationButton, object : View.OnClickListener { override fun onClick(v: View?) { @@ -200,7 +199,7 @@ ) } } - binding.wellListView.adapter = wellListAdapter + binding.recyclerView.adapter = wellListAdapter wellListAdapter.setOnItemClickedListener(object : NormalRecyclerAdapter.OnItemClickedListener { override fun onItemClicked(position: Int, t: WellListModel.DataBean.RowsBean) { diff --git a/app/src/main/java/com/casic/app/smartwell/view/WellMonitorActivity.kt b/app/src/main/java/com/casic/app/smartwell/view/WellMonitorActivity.kt index e3573eb..b87bdb7 100644 --- a/app/src/main/java/com/casic/app/smartwell/view/WellMonitorActivity.kt +++ b/app/src/main/java/com/casic/app/smartwell/view/WellMonitorActivity.kt @@ -11,7 +11,7 @@ import com.pengxh.kt.lite.base.KotlinBaseActivity import com.pengxh.kt.lite.utils.Constant import com.pengxh.kt.lite.utils.LoadState -import com.pengxh.kt.lite.utils.LoadingDialogHub +import com.pengxh.kt.lite.utils.LoadingDialog import com.pengxh.kt.lite.widget.TitleBarView class WellMonitorActivity : KotlinBaseActivity() { @@ -36,7 +36,7 @@ } override fun initOnCreate(savedInstanceState: Bundle?) { - val wellId = intent.getStringExtra(Constant.INTENT_PARAM)!! + val wellId = intent.getStringExtra(Constant.INTENT_PARAM_KEY)!! wellViewModel = ViewModelProvider(this)[WellViewModel::class.java] wellViewModel.getMonitorResult(wellId) wellViewModel.monitorModel.observe(this) { @@ -56,8 +56,8 @@ override fun observeRequestState() { wellViewModel.loadState.observe(this) { when (it) { - is LoadState.Loading -> LoadingDialogHub.show(this, "数据加载中,请稍后") - else -> LoadingDialogHub.dismiss() + is LoadState.Loading -> LoadingDialog.show(this, "数据加载中,请稍后") + else -> LoadingDialog.dismiss() } } } diff --git a/app/src/main/java/com/casic/app/smartwell/view/WellOperationActivity.kt b/app/src/main/java/com/casic/app/smartwell/view/WellOperationActivity.kt index 8d333bf..347ebb6 100644 --- a/app/src/main/java/com/casic/app/smartwell/view/WellOperationActivity.kt +++ b/app/src/main/java/com/casic/app/smartwell/view/WellOperationActivity.kt @@ -23,7 +23,7 @@ import com.pengxh.kt.lite.extensions.navigatePageTo import com.pengxh.kt.lite.extensions.show import com.pengxh.kt.lite.utils.LoadState -import com.pengxh.kt.lite.utils.LoadingDialogHub +import com.pengxh.kt.lite.utils.LoadingDialog import com.pengxh.kt.lite.utils.WeakReferenceHandler import com.pengxh.kt.lite.widget.dialog.AlertControlDialog @@ -109,8 +109,8 @@ } } - binding.operationListView.addItemDecoration( - RecyclerViewItemOffsets(0, 5, 0, 5) + binding.recyclerView.addItemDecoration( + RecyclerViewItemOffsets(0, 7, 0, 7) ) } @@ -123,13 +123,13 @@ override fun observeRequestState() { wellViewModel.loadState.observe(this) { when (it) { - is LoadState.Loading -> LoadingDialogHub.show(this, "处理中,请稍后") + is LoadState.Loading -> LoadingDialog.show(this, "处理中,请稍后") is LoadState.Success -> { - LoadingDialogHub.dismiss() + LoadingDialog.dismiss() wellOperationAdapter.notifyItemChanged(clickedPosition) } - else -> LoadingDialogHub.dismiss() + else -> LoadingDialog.dismiss() } } } @@ -203,24 +203,23 @@ if (item.bfztName == "布防") { viewHolder.setImageResource( R.id.wellStateView, R.drawable.bg_solid_text_green_radius_5 - ).setText(R.id.wellStateView, "撤防") + ).setText(R.id.operationButton, "撤防") } else { viewHolder.setImageResource( R.id.wellStateView, R.drawable.bg_solid_text_red_radius_5 - ).setText(R.id.wellStateView, "布防") + ).setText(R.id.operationButton, "布防") } val deep = if (item.deep.toString().isBlank()) { "未知" } else { item.deep.toString() + "m" } - viewHolder.setText(R.id.wellNameView, item.wellName) + viewHolder.setText(R.id.wellTypeView, item.wellTypeName) .setText(R.id.wellStateView, "已${item.bfztName}") .setText(R.id.wellDepthView, "深:${deep}") .setText(R.id.wellCodeView, "点位编号:${item.wellCode}") - .setText(R.id.wellTypeView, "点位类型:${item.wellTypeName}") .setText(R.id.ownerShipView, "权属单位:${item.deptName}") - .setText(R.id.wellLocationView, "点位置:${item.position}") + .setText(R.id.wellLocationView, "点位位置:${item.position}") .setOnClickListener( R.id.operationButton, object : View.OnClickListener { override fun onClick(v: View?) { @@ -280,7 +279,7 @@ ) } } - binding.operationListView.adapter = wellOperationAdapter + binding.recyclerView.adapter = wellOperationAdapter wellOperationAdapter.setOnItemClickedListener(object : NormalRecyclerAdapter.OnItemClickedListener { override fun onItemClicked(position: Int, t: WellListModel.DataBean.RowsBean) { diff --git a/app/src/main/res/drawable/ic_down.xml b/app/src/main/res/drawable/ic_down.xml index 20e6476..6987e6c 100644 --- a/app/src/main/res/drawable/ic_down.xml +++ b/app/src/main/res/drawable/ic_down.xml @@ -1,6 +1,6 @@ + + diff --git a/app/src/main/res/layout/activity_about_us.xml b/app/src/main/res/layout/activity_about_us.xml index 9091a00..d5fbd0d 100644 --- a/app/src/main/res/layout/activity_about_us.xml +++ b/app/src/main/res/layout/activity_about_us.xml @@ -12,13 +12,7 @@ android:layout_width="match_parent" android:layout_height="wrap_content" android:background="@color/mainThemeColor" - app:tbv_left_image="@drawable/ic_title_left" - app:tbv_only_show_title="false" - app:tbv_show_left_image="true" - app:tbv_show_right_image="false" - app:tbv_text="关于我们" - app:tbv_text_color="@color/white" - app:tbv_text_size="@dimen/sp_18" /> + app:tbv_text="关于我们" /> + app:tbv_text="修改密码" /> + app:tbv_text="布防列表" /> + app:tbv_text="帮助中心" /> + app:tbv_text="工单详情" /> + app:tbv_text="工单详情" /> + app:tbv_text="工单详情" /> + app:tbv_text="工单详情" /> + app:tbv_text="超时工单" /> + app:tbv_text="工单查询" /> + app:tbv_text="查询结果" /> + app:tbv_text="撤防列表" /> + app:tbv_text="个人资料" /> + app:tbv_text="点位详情" /> + app:tbv_text="监控内容" /> - - - - - - + android:layout_height="wrap_content" + android:background="@color/mainThemeColor" + app:tbv_show_left_image="false" + app:tbv_show_right_image="true" + app:tbv_text="首页" /> - + - + - - - - - - + android:layout_height="wrap_content" + android:background="@color/mainThemeColor" + app:tbv_right_image="@drawable/ic_search_white" + app:tbv_show_left_image="false" + app:tbv_show_right_image="true" + app:tbv_text="工单" /> - - - - - - \ No newline at end of file diff --git a/app/src/main/res/layout/item_deployed_rv.xml b/app/src/main/res/layout/item_deployed_rv.xml index 391ad28..fadcf1d 100644 --- a/app/src/main/res/layout/item_deployed_rv.xml +++ b/app/src/main/res/layout/item_deployed_rv.xml @@ -3,10 +3,9 @@ xmlns:app="http://schemas.android.com/apk/res-auto" android:layout_width="match_parent" android:layout_height="wrap_content" - android:layout_marginHorizontal="@dimen/dp_5" android:background="@drawable/bg_solid_layout_white_radius_10" android:orientation="vertical" - android:padding="@dimen/dp_5"> + android:padding="@dimen/dp_7"> @@ -42,63 +41,63 @@ android:textColor="@color/subTextColor" /> - - - - - + android:gravity="center" + android:orientation="horizontal"> - + - + - + + + + + + android:gravity="center" + android:orientation="vertical"> - - + + + + + \ No newline at end of file diff --git a/app/src/main/res/layout/item_order_completed_rv.xml b/app/src/main/res/layout/item_order_completed_rv.xml index e4ff890..3c78a0f 100644 --- a/app/src/main/res/layout/item_order_completed_rv.xml +++ b/app/src/main/res/layout/item_order_completed_rv.xml @@ -96,6 +96,7 @@ android:layout_height="wrap_content" android:layout_alignParentEnd="true" android:layout_centerVertical="true" + android:padding="@dimen/dp_10" android:src="@drawable/ic_down" /> diff --git a/app/src/main/res/layout/item_order_in_handle_rv.xml b/app/src/main/res/layout/item_order_in_handle_rv.xml index e4ff890..3c78a0f 100644 --- a/app/src/main/res/layout/item_order_in_handle_rv.xml +++ b/app/src/main/res/layout/item_order_in_handle_rv.xml @@ -96,6 +96,7 @@ android:layout_height="wrap_content" android:layout_alignParentEnd="true" android:layout_centerVertical="true" + android:padding="@dimen/dp_10" android:src="@drawable/ic_down" /> diff --git a/app/build.gradle b/app/build.gradle index 296fb6f..c18c251 100644 --- a/app/build.gradle +++ b/app/build.gradle @@ -40,10 +40,6 @@ // VIVO 相关应用参数 VIVO_APP_ID : "105749048", VIVO_APP_KEY : "e460fbf2c689e0f8c58ecc6aa62e1803", - - // 小米相关应用参数 -// XIAOMI_APP_ID : "", -// XIAOMI_APP_KEY : "", ] // 版本名后面添加一句话,意思就是flavor dimension 它的维度就是该版本号,多渠道打包很重要 @@ -107,7 +103,7 @@ dependencies { implementation fileTree(dir: 'libs', include: ['*.jar']) //基础依赖库 - implementation 'com.github.AndroidCoderPeng:Kotlin-lite-lib:1.0.10' + implementation 'com.github.AndroidCoderPeng:Kotlin-lite-lib:1.1.0' implementation 'androidx.appcompat:appcompat:1.6.1' implementation 'androidx.core:core-ktx:1.9.0' implementation 'androidx.constraintlayout:constraintlayout:2.1.4' @@ -165,8 +161,6 @@ implementation 'commons-codec:commons-codec:1.15' implementation 'com.android.support:support-annotations:28.0.0' implementation 'com.assist-v3:vivo:3.1.2' // vivo -// implementation 'com.getui.opt:xmp:3.3.1' // 小米 - //数据库框架 implementation 'org.greenrobot:greendao:3.3.0' //数据库升级 diff --git a/app/src/main/AndroidManifest.xml b/app/src/main/AndroidManifest.xml index c0af158..e0519bf 100644 --- a/app/src/main/AndroidManifest.xml +++ b/app/src/main/AndroidManifest.xml @@ -90,10 +90,10 @@ - + + android:value="ee96d8b5e12de3fbb29949efd57418a8" /> () @@ -150,7 +158,7 @@ val cameraPosition = CameraPosition(centerLatLng, 14f, 0f, 0f) val cameraUpdate = CameraUpdateFactory.newCameraPosition(cameraPosition) withContext(Dispatchers.Main) { - LoadingDialogHub.dismiss() + LoadingDialog.dismiss() aMap.animateCamera(cameraUpdate, 1500, null) } } @@ -239,11 +247,6 @@ } override fun initEvent() { - binding.rightOptionView.setOnClickListener { - val x = binding.rightOptionView.width - easyPopupWindow.width - easyPopupWindow.showAsDropDown(binding.rightOptionView, x, 0) - } - //撤防点位 binding.unDeployedLayout.setOnClickListener { requireContext().navigatePageTo() @@ -263,11 +266,11 @@ override fun observeRequestState() { wellViewModel.loadState.observe(this) { when (it) { - is LoadState.Loading -> LoadingDialogHub.show( + is LoadState.Loading -> LoadingDialog.show( requireActivity(), "数据加载中,请稍后..." ) - else -> LoadingDialogHub.dismiss() + else -> LoadingDialog.dismiss() } } } @@ -376,7 +379,7 @@ }).build().show() } }) - infoPopup.showAsDropDown(binding.rightOptionView) +// infoPopup.showAsDropDown(binding.rightOptionView) } override fun onCameraChange(p0: CameraPosition?) { diff --git a/app/src/main/java/com/casic/app/smartwell/fragment/HomePageNoClusterFragment.kt b/app/src/main/java/com/casic/app/smartwell/fragment/HomePageNoClusterFragment.kt index 802426a..b25f743 100644 --- a/app/src/main/java/com/casic/app/smartwell/fragment/HomePageNoClusterFragment.kt +++ b/app/src/main/java/com/casic/app/smartwell/fragment/HomePageNoClusterFragment.kt @@ -38,8 +38,9 @@ import com.pengxh.kt.lite.extensions.navigatePageTo import com.pengxh.kt.lite.extensions.show import com.pengxh.kt.lite.utils.LoadState -import com.pengxh.kt.lite.utils.LoadingDialogHub +import com.pengxh.kt.lite.utils.LoadingDialog import com.pengxh.kt.lite.widget.EasyPopupWindow +import com.pengxh.kt.lite.widget.TitleBarView import com.pengxh.kt.lite.widget.dialog.AlertControlDialog import kotlinx.coroutines.Dispatchers import kotlinx.coroutines.launch @@ -78,7 +79,15 @@ override fun setupTopBarLayout() { binding.rootView.initImmersionBar(this, false, R.color.mainThemeColor) - binding.titleView.text = "首页" + binding.titleView.setOnClickListener(object : TitleBarView.OnClickListener { + override fun onLeftClick() { + + } + + override fun onRightClick() { + easyPopupWindow.showAsDropDown(binding.titleView, binding.titleView.width, 0) + } + }) } override fun initOnCreate(savedInstanceState: Bundle?) { @@ -112,7 +121,7 @@ //渲染井位置 lifecycleScope.launch(Dispatchers.Main) { - LoadingDialogHub.show(requireActivity(), "数据加载中,请稍后") + LoadingDialog.show(requireActivity(), "数据加载中,请稍后") withContext(Dispatchers.IO) { //取Well缓存 val allMarkerOptions = ArrayList() @@ -144,7 +153,7 @@ val cameraPosition = CameraPosition(centerLatLng, 14f, 0f, 0f) val cameraUpdate = CameraUpdateFactory.newCameraPosition(cameraPosition) withContext(Dispatchers.Main) { - LoadingDialogHub.dismiss() + LoadingDialog.dismiss() aMap.animateCamera(cameraUpdate, 1500, null) } } @@ -238,11 +247,6 @@ } override fun initEvent() { - binding.rightOptionView.setOnClickListener { - val x = binding.rightOptionView.width - easyPopupWindow.width - easyPopupWindow.showAsDropDown(binding.rightOptionView, x, 0) - } - //撤防点位 binding.unDeployedLayout.setOnClickListener { requireContext().navigatePageTo() @@ -262,11 +266,11 @@ override fun observeRequestState() { wellViewModel.loadState.observe(this) { when (it) { - is LoadState.Loading -> LoadingDialogHub.show( + is LoadState.Loading -> LoadingDialog.show( requireActivity(), "数据加载中,请稍后..." ) - else -> LoadingDialogHub.dismiss() + else -> LoadingDialog.dismiss() } } } diff --git a/app/src/main/java/com/casic/app/smartwell/fragment/MinePageFragment.kt b/app/src/main/java/com/casic/app/smartwell/fragment/MinePageFragment.kt index 09a570c..dcb48f8 100644 --- a/app/src/main/java/com/casic/app/smartwell/fragment/MinePageFragment.kt +++ b/app/src/main/java/com/casic/app/smartwell/fragment/MinePageFragment.kt @@ -35,7 +35,7 @@ import com.pengxh.kt.lite.utils.ActivityStackManager import com.pengxh.kt.lite.utils.FileDownloadManager import com.pengxh.kt.lite.utils.LoadState -import com.pengxh.kt.lite.utils.LoadingDialogHub +import com.pengxh.kt.lite.utils.LoadingDialog import com.pengxh.kt.lite.widget.dialog.AlertControlDialog import com.pengxh.kt.lite.widget.dialog.BottomActionSheet import kotlinx.coroutines.Dispatchers @@ -60,7 +60,6 @@ override fun setupTopBarLayout() { binding.rootView.initImmersionBar(this, false, R.color.mainThemeColor) - binding.titleInclude.titleView.text = "我的" } override fun initOnCreate(savedInstanceState: Bundle?) { @@ -155,27 +154,27 @@ override fun observeRequestState() { userViewModel.loadState.observe(this) { when (it) { - is LoadState.Loading -> LoadingDialogHub.show( + is LoadState.Loading -> LoadingDialog.show( requireActivity(), "检查版本中,请稍后" ) - else -> LoadingDialogHub.dismiss() + else -> LoadingDialog.dismiss() } } wellViewModel.loadState.observe(this) { when (it) { - is LoadState.Loading -> LoadingDialogHub.show( + is LoadState.Loading -> LoadingDialog.show( requireActivity(), "数据更新中,请稍后" ) is LoadState.Fail -> { - LoadingDialogHub.dismiss() + LoadingDialog.dismiss() "数据更新超时".show(requireContext()) } else -> { - LoadingDialogHub.dismiss() + LoadingDialog.dismiss() AlertControlDialog.Builder().setContext(requireContext()).setTitle("温馨提示") .setMessage("数据更新成功,请重启应用").setNegativeButton("取消") .setPositiveButton("确定").setOnDialogButtonClickListener(object : @@ -197,17 +196,17 @@ lineViewModel.loadState.observe(this) { when (it) { - is LoadState.Loading -> LoadingDialogHub.show( + is LoadState.Loading -> LoadingDialog.show( requireActivity(), "数据更新中,请稍后" ) is LoadState.Fail -> { - LoadingDialogHub.dismiss() + LoadingDialog.dismiss() "数据更新超时".show(requireContext()) } else -> { - LoadingDialogHub.dismiss() + LoadingDialog.dismiss() AlertControlDialog.Builder().setContext(requireContext()).setTitle("温馨提示") .setMessage("数据更新成功,请重启应用").setNegativeButton("取消") .setPositiveButton("确定").setOnDialogButtonClickListener(object : diff --git a/app/src/main/java/com/casic/app/smartwell/fragment/NoticePageFragment.kt b/app/src/main/java/com/casic/app/smartwell/fragment/NoticePageFragment.kt index 171b555..3c93f54 100644 --- a/app/src/main/java/com/casic/app/smartwell/fragment/NoticePageFragment.kt +++ b/app/src/main/java/com/casic/app/smartwell/fragment/NoticePageFragment.kt @@ -48,7 +48,6 @@ override fun setupTopBarLayout() { binding.rootView.initImmersionBar(this, false, R.color.mainThemeColor) - binding.titleInclude.titleView.text = "消息" } override fun initOnCreate(savedInstanceState: Bundle?) { diff --git a/app/src/main/java/com/casic/app/smartwell/fragment/OrderListFragment.kt b/app/src/main/java/com/casic/app/smartwell/fragment/OrderListFragment.kt index 93ff35b..5e38acb 100644 --- a/app/src/main/java/com/casic/app/smartwell/fragment/OrderListFragment.kt +++ b/app/src/main/java/com/casic/app/smartwell/fragment/OrderListFragment.kt @@ -12,6 +12,7 @@ import com.casic.app.smartwell.view.SearchOrderActivity import com.pengxh.kt.lite.base.KotlinBaseFragment import com.pengxh.kt.lite.extensions.navigatePageTo +import com.pengxh.kt.lite.widget.TitleBarView class OrderListFragment : KotlinBaseFragment() { @@ -25,15 +26,22 @@ } override fun initViewBinding( - inflater: LayoutInflater, - container: ViewGroup? + inflater: LayoutInflater, container: ViewGroup? ): FragmentOrderBinding { return FragmentOrderBinding.inflate(inflater, container, false) } override fun setupTopBarLayout() { binding.rootView.initImmersionBar(this, false, R.color.mainThemeColor) - binding.titleView.text = "工单" + binding.titleView.setOnClickListener(object : TitleBarView.OnClickListener { + override fun onLeftClick() { + + } + + override fun onRightClick() { + requireContext().navigatePageTo() + } + }) } override fun initOnCreate(savedInstanceState: Bundle?) { @@ -51,8 +59,6 @@ } override fun initEvent() { - binding.rightOptionView.setOnClickListener { - requireContext().navigatePageTo() - } + } } \ No newline at end of file diff --git a/app/src/main/java/com/casic/app/smartwell/fragment/OrderNotProcessedFragment.kt b/app/src/main/java/com/casic/app/smartwell/fragment/OrderNotProcessedFragment.kt index 0b3d09d..2b6f21d 100644 --- a/app/src/main/java/com/casic/app/smartwell/fragment/OrderNotProcessedFragment.kt +++ b/app/src/main/java/com/casic/app/smartwell/fragment/OrderNotProcessedFragment.kt @@ -18,7 +18,7 @@ import com.pengxh.kt.lite.extensions.navigatePageTo import com.pengxh.kt.lite.extensions.show import com.pengxh.kt.lite.utils.LoadState -import com.pengxh.kt.lite.utils.LoadingDialogHub +import com.pengxh.kt.lite.utils.LoadingDialog import com.pengxh.kt.lite.utils.WeakReferenceHandler import com.pengxh.kt.lite.widget.dialog.AlertControlDialog @@ -78,8 +78,8 @@ operationViewModel = ViewModelProvider(this)[OperationViewModel::class.java] - binding.notProcessedView.addItemDecoration( - RecyclerViewItemOffsets(0, 5, 0, 5) + binding.recyclerView.addItemDecoration( + RecyclerViewItemOffsets(0, 7, 0, 7) ) } @@ -87,9 +87,9 @@ //接单状态处理 operationViewModel.loadState.observe(this) { when (it) { - is LoadState.Loading -> LoadingDialogHub.show(requireActivity(), "接单中,请稍后") + is LoadState.Loading -> LoadingDialog.show(requireActivity(), "接单中,请稍后") is LoadState.Success -> { - LoadingDialogHub.dismiss() + LoadingDialog.dismiss() //接单成功之后刷新列表 dataBeans.removeAt(clickedPosition) notProcessedAdapter.notifyItemRemoved(clickedPosition) @@ -98,7 +98,7 @@ ) } - else -> LoadingDialogHub.dismiss() + else -> LoadingDialog.dismiss() } } } @@ -131,7 +131,7 @@ } else { binding.emptyInclude.emptyView.hide() notProcessedAdapter = OrderNotProcessedAdapter(requireContext(), dataBeans) - binding.notProcessedView.adapter = notProcessedAdapter + binding.recyclerView.adapter = notProcessedAdapter notProcessedAdapter.setOnItemClickListener(object : OrderNotProcessedAdapter.OnItemClickListener { override fun onClicked(position: Int) { diff --git a/app/src/main/java/com/casic/app/smartwell/fragment/OvertimeNotAcceptFragment.kt b/app/src/main/java/com/casic/app/smartwell/fragment/OvertimeNotAcceptFragment.kt index a198545..9b318ca 100644 --- a/app/src/main/java/com/casic/app/smartwell/fragment/OvertimeNotAcceptFragment.kt +++ b/app/src/main/java/com/casic/app/smartwell/fragment/OvertimeNotAcceptFragment.kt @@ -18,7 +18,7 @@ import com.pengxh.kt.lite.extensions.navigatePageTo import com.pengxh.kt.lite.extensions.show import com.pengxh.kt.lite.utils.LoadState -import com.pengxh.kt.lite.utils.LoadingDialogHub +import com.pengxh.kt.lite.utils.LoadingDialog import com.pengxh.kt.lite.utils.WeakReferenceHandler import com.pengxh.kt.lite.widget.dialog.AlertControlDialog @@ -81,8 +81,8 @@ operationViewModel = ViewModelProvider(this)[OperationViewModel::class.java] - binding.notProcessedView.addItemDecoration( - RecyclerViewItemOffsets(0, 5, 0, 5) + binding.recyclerView.addItemDecoration( + RecyclerViewItemOffsets(0, 7, 0, 7) ) } @@ -90,9 +90,9 @@ //接单状态处理 operationViewModel.loadState.observe(this) { when (it) { - is LoadState.Loading -> LoadingDialogHub.show(requireActivity(), "接单中,请稍后") + is LoadState.Loading -> LoadingDialog.show(requireActivity(), "接单中,请稍后") is LoadState.Success -> { - LoadingDialogHub.dismiss() + LoadingDialog.dismiss() //接单成功之后刷新列表 dataBeans.removeAt(clickedPosition) notProcessedAdapter.notifyItemRemoved(clickedPosition) @@ -101,7 +101,7 @@ ) } - else -> LoadingDialogHub.dismiss() + else -> LoadingDialog.dismiss() } } } @@ -134,7 +134,7 @@ } else { binding.emptyInclude.emptyView.hide() notProcessedAdapter = OrderNotProcessedAdapter(requireContext(), dataBeans) - binding.notProcessedView.adapter = notProcessedAdapter + binding.recyclerView.adapter = notProcessedAdapter notProcessedAdapter.setOnItemClickListener(object : OrderNotProcessedAdapter.OnItemClickListener { override fun onClicked(position: Int) { diff --git a/app/src/main/java/com/casic/app/smartwell/greendao/DaoMaster.java b/app/src/main/java/com/casic/app/smartwell/greendao/DaoMaster.java index fdcf3a7..1e52b74 100644 --- a/app/src/main/java/com/casic/app/smartwell/greendao/DaoMaster.java +++ b/app/src/main/java/com/casic/app/smartwell/greendao/DaoMaster.java @@ -13,25 +13,20 @@ // THIS CODE IS GENERATED BY greenDAO, DO NOT EDIT. - /** * Master of DAO (schema version 4): knows all DAOs. */ public class DaoMaster extends AbstractDaoMaster { public static final int SCHEMA_VERSION = 4; - /** - * Creates underlying database table using DAOs. - */ + /** Creates underlying database table using DAOs. */ public static void createAllTables(Database db, boolean ifNotExists) { MapWellLocalBeanDao.createTable(db, ifNotExists); NoticeLocaleBeanDao.createTable(db, ifNotExists); PipeLocalBeanDao.createTable(db, ifNotExists); } - /** - * Drops underlying database table using DAOs. - */ + /** Drops underlying database table using DAOs. */ public static void dropAllTables(Database db, boolean ifExists) { MapWellLocalBeanDao.dropTable(db, ifExists); NoticeLocaleBeanDao.dropTable(db, ifExists); @@ -86,9 +81,7 @@ } } - /** - * WARNING: Drops all table on Upgrade! Use only during development. - */ + /** WARNING: Drops all table on Upgrade! Use only during development. */ public static class DevOpenHelper extends OpenHelper { public DevOpenHelper(Context context, String name) { super(context, name); diff --git a/app/src/main/java/com/casic/app/smartwell/greendao/DaoSession.java b/app/src/main/java/com/casic/app/smartwell/greendao/DaoSession.java index 0b36d17..3e40e3b 100644 --- a/app/src/main/java/com/casic/app/smartwell/greendao/DaoSession.java +++ b/app/src/main/java/com/casic/app/smartwell/greendao/DaoSession.java @@ -16,7 +16,7 @@ /** * {@inheritDoc} - * + * * @see org.greenrobot.greendao.AbstractDaoSession */ public class DaoSession extends AbstractDaoSession { @@ -50,7 +50,7 @@ registerDao(NoticeLocaleBean.class, noticeLocaleBeanDao); registerDao(PipeLocalBean.class, pipeLocalBeanDao); } - + public void clear() { mapWellLocalBeanDaoConfig.clearIdentityScope(); noticeLocaleBeanDaoConfig.clearIdentityScope(); diff --git a/app/src/main/java/com/casic/app/smartwell/greendao/MapWellLocalBeanDao.java b/app/src/main/java/com/casic/app/smartwell/greendao/MapWellLocalBeanDao.java index 8908fda..407bc92 100644 --- a/app/src/main/java/com/casic/app/smartwell/greendao/MapWellLocalBeanDao.java +++ b/app/src/main/java/com/casic/app/smartwell/greendao/MapWellLocalBeanDao.java @@ -12,10 +12,9 @@ import org.greenrobot.greendao.internal.DaoConfig; // THIS CODE IS GENERATED BY greenDAO, DO NOT EDIT. - -/** +/** * DAO for table "MAP_WELL_LOCAL_BEAN". - */ +*/ public class MapWellLocalBeanDao extends AbstractDao { public static final String TABLENAME = "MAP_WELL_LOCAL_BEAN"; @@ -57,16 +56,14 @@ public MapWellLocalBeanDao(DaoConfig config) { super(config); } - + public MapWellLocalBeanDao(DaoConfig config, DaoSession daoSession) { super(config, daoSession); } - /** - * Creates the underlying database table. - */ + /** Creates the underlying database table. */ public static void createTable(Database db, boolean ifNotExists) { - String constraint = ifNotExists ? "IF NOT EXISTS " : ""; + String constraint = ifNotExists? "IF NOT EXISTS ": ""; db.execSQL("CREATE TABLE " + constraint + "\"MAP_WELL_LOCAL_BEAN\" (" + // "\"_id\" INTEGER PRIMARY KEY AUTOINCREMENT ," + // 0: kId "\"AREA\" TEXT," + // 1: area @@ -96,9 +93,7 @@ "\"WELL_TYPE_NAME\" TEXT);"); // 25: wellTypeName } - /** - * Drops the underlying database table. - */ + /** Drops the underlying database table. */ public static void dropTable(Database db, boolean ifExists) { String sql = "DROP TABLE " + (ifExists ? "IF EXISTS " : "") + "\"MAP_WELL_LOCAL_BEAN\""; db.execSQL(sql); @@ -107,132 +102,132 @@ @Override protected final void bindValues(DatabaseStatement stmt, MapWellLocalBean entity) { stmt.clearBindings(); - + Long kId = entity.getKId(); if (kId != null) { stmt.bindLong(1, kId); } - + String area = entity.getArea(); if (area != null) { stmt.bindString(2, area); } - + String bfzt = entity.getBfzt(); if (bfzt != null) { stmt.bindString(3, bfzt); } - + String bfztName = entity.getBfztName(); if (bfztName != null) { stmt.bindString(4, bfztName); } - + String coordinateX = entity.getCoordinateX(); if (coordinateX != null) { stmt.bindString(5, coordinateX); } - + String coordinateY = entity.getCoordinateY(); if (coordinateY != null) { stmt.bindString(6, coordinateY); } - + String deep = entity.getDeep(); if (deep != null) { stmt.bindString(7, deep); } - + String deptName = entity.getDeptName(); if (deptName != null) { stmt.bindString(8, deptName); } - + String deptid = entity.getDeptid(); if (deptid != null) { stmt.bindString(9, deptid); } - + String id = entity.getId(); if (id != null) { stmt.bindString(10, id); } - + String latBaidu = entity.getLatBaidu(); if (latBaidu != null) { stmt.bindString(11, latBaidu); } - + String latGaode = entity.getLatGaode(); if (latGaode != null) { stmt.bindString(12, latGaode); } - + String lngBaidu = entity.getLngBaidu(); if (lngBaidu != null) { stmt.bindString(13, lngBaidu); } - + String lngGaode = entity.getLngGaode(); if (lngGaode != null) { stmt.bindString(14, lngGaode); } - + String notes = entity.getNotes(); if (notes != null) { stmt.bindString(15, notes); } - + String photos = entity.getPhotos(); if (photos != null) { stmt.bindString(16, photos); } - + String position = entity.getPosition(); if (position != null) { stmt.bindString(17, position); } - + String staff = entity.getStaff(); if (staff != null) { stmt.bindString(18, staff); } - + String tel = entity.getTel(); if (tel != null) { stmt.bindString(19, tel); } - + String ts = entity.getTs(); if (ts != null) { stmt.bindString(20, ts); } - + String valid = entity.getValid(); if (valid != null) { stmt.bindString(21, valid); } - + String watchData = entity.getWatchData(); if (watchData != null) { stmt.bindString(22, watchData); } - + String wellCode = entity.getWellCode(); if (wellCode != null) { stmt.bindString(23, wellCode); } - + String wellName = entity.getWellName(); if (wellName != null) { stmt.bindString(24, wellName); } - + String wellType = entity.getWellType(); if (wellType != null) { stmt.bindString(25, wellType); } - + String wellTypeName = entity.getWellTypeName(); if (wellTypeName != null) { stmt.bindString(26, wellTypeName); @@ -242,132 +237,132 @@ @Override protected final void bindValues(SQLiteStatement stmt, MapWellLocalBean entity) { stmt.clearBindings(); - + Long kId = entity.getKId(); if (kId != null) { stmt.bindLong(1, kId); } - + String area = entity.getArea(); if (area != null) { stmt.bindString(2, area); } - + String bfzt = entity.getBfzt(); if (bfzt != null) { stmt.bindString(3, bfzt); } - + String bfztName = entity.getBfztName(); if (bfztName != null) { stmt.bindString(4, bfztName); } - + String coordinateX = entity.getCoordinateX(); if (coordinateX != null) { stmt.bindString(5, coordinateX); } - + String coordinateY = entity.getCoordinateY(); if (coordinateY != null) { stmt.bindString(6, coordinateY); } - + String deep = entity.getDeep(); if (deep != null) { stmt.bindString(7, deep); } - + String deptName = entity.getDeptName(); if (deptName != null) { stmt.bindString(8, deptName); } - + String deptid = entity.getDeptid(); if (deptid != null) { stmt.bindString(9, deptid); } - + String id = entity.getId(); if (id != null) { stmt.bindString(10, id); } - + String latBaidu = entity.getLatBaidu(); if (latBaidu != null) { stmt.bindString(11, latBaidu); } - + String latGaode = entity.getLatGaode(); if (latGaode != null) { stmt.bindString(12, latGaode); } - + String lngBaidu = entity.getLngBaidu(); if (lngBaidu != null) { stmt.bindString(13, lngBaidu); } - + String lngGaode = entity.getLngGaode(); if (lngGaode != null) { stmt.bindString(14, lngGaode); } - + String notes = entity.getNotes(); if (notes != null) { stmt.bindString(15, notes); } - + String photos = entity.getPhotos(); if (photos != null) { stmt.bindString(16, photos); } - + String position = entity.getPosition(); if (position != null) { stmt.bindString(17, position); } - + String staff = entity.getStaff(); if (staff != null) { stmt.bindString(18, staff); } - + String tel = entity.getTel(); if (tel != null) { stmt.bindString(19, tel); } - + String ts = entity.getTs(); if (ts != null) { stmt.bindString(20, ts); } - + String valid = entity.getValid(); if (valid != null) { stmt.bindString(21, valid); } - + String watchData = entity.getWatchData(); if (watchData != null) { stmt.bindString(22, watchData); } - + String wellCode = entity.getWellCode(); if (wellCode != null) { stmt.bindString(23, wellCode); } - + String wellName = entity.getWellName(); if (wellName != null) { stmt.bindString(24, wellName); } - + String wellType = entity.getWellType(); if (wellType != null) { stmt.bindString(25, wellType); } - + String wellTypeName = entity.getWellTypeName(); if (wellTypeName != null) { stmt.bindString(26, wellTypeName); @@ -377,41 +372,41 @@ @Override public Long readKey(Cursor cursor, int offset) { return cursor.isNull(offset + 0) ? null : cursor.getLong(offset + 0); - } + } @Override public MapWellLocalBean readEntity(Cursor cursor, int offset) { MapWellLocalBean entity = new MapWellLocalBean( // - cursor.isNull(offset + 0) ? null : cursor.getLong(offset + 0), // kId - cursor.isNull(offset + 1) ? null : cursor.getString(offset + 1), // area - cursor.isNull(offset + 2) ? null : cursor.getString(offset + 2), // bfzt - cursor.isNull(offset + 3) ? null : cursor.getString(offset + 3), // bfztName - cursor.isNull(offset + 4) ? null : cursor.getString(offset + 4), // coordinateX - cursor.isNull(offset + 5) ? null : cursor.getString(offset + 5), // coordinateY - cursor.isNull(offset + 6) ? null : cursor.getString(offset + 6), // deep - cursor.isNull(offset + 7) ? null : cursor.getString(offset + 7), // deptName - cursor.isNull(offset + 8) ? null : cursor.getString(offset + 8), // deptid - cursor.isNull(offset + 9) ? null : cursor.getString(offset + 9), // id - cursor.isNull(offset + 10) ? null : cursor.getString(offset + 10), // latBaidu - cursor.isNull(offset + 11) ? null : cursor.getString(offset + 11), // latGaode - cursor.isNull(offset + 12) ? null : cursor.getString(offset + 12), // lngBaidu - cursor.isNull(offset + 13) ? null : cursor.getString(offset + 13), // lngGaode - cursor.isNull(offset + 14) ? null : cursor.getString(offset + 14), // notes - cursor.isNull(offset + 15) ? null : cursor.getString(offset + 15), // photos - cursor.isNull(offset + 16) ? null : cursor.getString(offset + 16), // position - cursor.isNull(offset + 17) ? null : cursor.getString(offset + 17), // staff - cursor.isNull(offset + 18) ? null : cursor.getString(offset + 18), // tel - cursor.isNull(offset + 19) ? null : cursor.getString(offset + 19), // ts - cursor.isNull(offset + 20) ? null : cursor.getString(offset + 20), // valid - cursor.isNull(offset + 21) ? null : cursor.getString(offset + 21), // watchData - cursor.isNull(offset + 22) ? null : cursor.getString(offset + 22), // wellCode - cursor.isNull(offset + 23) ? null : cursor.getString(offset + 23), // wellName - cursor.isNull(offset + 24) ? null : cursor.getString(offset + 24), // wellType - cursor.isNull(offset + 25) ? null : cursor.getString(offset + 25) // wellTypeName + cursor.isNull(offset + 0) ? null : cursor.getLong(offset + 0), // kId + cursor.isNull(offset + 1) ? null : cursor.getString(offset + 1), // area + cursor.isNull(offset + 2) ? null : cursor.getString(offset + 2), // bfzt + cursor.isNull(offset + 3) ? null : cursor.getString(offset + 3), // bfztName + cursor.isNull(offset + 4) ? null : cursor.getString(offset + 4), // coordinateX + cursor.isNull(offset + 5) ? null : cursor.getString(offset + 5), // coordinateY + cursor.isNull(offset + 6) ? null : cursor.getString(offset + 6), // deep + cursor.isNull(offset + 7) ? null : cursor.getString(offset + 7), // deptName + cursor.isNull(offset + 8) ? null : cursor.getString(offset + 8), // deptid + cursor.isNull(offset + 9) ? null : cursor.getString(offset + 9), // id + cursor.isNull(offset + 10) ? null : cursor.getString(offset + 10), // latBaidu + cursor.isNull(offset + 11) ? null : cursor.getString(offset + 11), // latGaode + cursor.isNull(offset + 12) ? null : cursor.getString(offset + 12), // lngBaidu + cursor.isNull(offset + 13) ? null : cursor.getString(offset + 13), // lngGaode + cursor.isNull(offset + 14) ? null : cursor.getString(offset + 14), // notes + cursor.isNull(offset + 15) ? null : cursor.getString(offset + 15), // photos + cursor.isNull(offset + 16) ? null : cursor.getString(offset + 16), // position + cursor.isNull(offset + 17) ? null : cursor.getString(offset + 17), // staff + cursor.isNull(offset + 18) ? null : cursor.getString(offset + 18), // tel + cursor.isNull(offset + 19) ? null : cursor.getString(offset + 19), // ts + cursor.isNull(offset + 20) ? null : cursor.getString(offset + 20), // valid + cursor.isNull(offset + 21) ? null : cursor.getString(offset + 21), // watchData + cursor.isNull(offset + 22) ? null : cursor.getString(offset + 22), // wellCode + cursor.isNull(offset + 23) ? null : cursor.getString(offset + 23), // wellName + cursor.isNull(offset + 24) ? null : cursor.getString(offset + 24), // wellType + cursor.isNull(offset + 25) ? null : cursor.getString(offset + 25) // wellTypeName ); return entity; } - + @Override public void readEntity(Cursor cursor, MapWellLocalBean entity, int offset) { entity.setKId(cursor.isNull(offset + 0) ? null : cursor.getLong(offset + 0)); @@ -440,17 +435,17 @@ entity.setWellName(cursor.isNull(offset + 23) ? null : cursor.getString(offset + 23)); entity.setWellType(cursor.isNull(offset + 24) ? null : cursor.getString(offset + 24)); entity.setWellTypeName(cursor.isNull(offset + 25) ? null : cursor.getString(offset + 25)); - } - + } + @Override protected final Long updateKeyAfterInsert(MapWellLocalBean entity, long rowId) { entity.setKId(rowId); return rowId; } - + @Override public Long getKey(MapWellLocalBean entity) { - if (entity != null) { + if(entity != null) { return entity.getKId(); } else { return null; @@ -466,5 +461,5 @@ protected final boolean isEntityUpdateable() { return true; } - + } diff --git a/app/src/main/java/com/casic/app/smartwell/greendao/NoticeLocaleBeanDao.java b/app/src/main/java/com/casic/app/smartwell/greendao/NoticeLocaleBeanDao.java index 64312ed..deb2d49 100644 --- a/app/src/main/java/com/casic/app/smartwell/greendao/NoticeLocaleBeanDao.java +++ b/app/src/main/java/com/casic/app/smartwell/greendao/NoticeLocaleBeanDao.java @@ -12,10 +12,9 @@ import org.greenrobot.greendao.internal.DaoConfig; // THIS CODE IS GENERATED BY greenDAO, DO NOT EDIT. - -/** +/** * DAO for table "NOTICE_LOCALE_BEAN". - */ +*/ public class NoticeLocaleBeanDao extends AbstractDao { public static final String TABLENAME = "NOTICE_LOCALE_BEAN"; @@ -43,16 +42,14 @@ public NoticeLocaleBeanDao(DaoConfig config) { super(config); } - + public NoticeLocaleBeanDao(DaoConfig config, DaoSession daoSession) { super(config, daoSession); } - /** - * Creates the underlying database table. - */ + /** Creates the underlying database table. */ public static void createTable(Database db, boolean ifNotExists) { - String constraint = ifNotExists ? "IF NOT EXISTS " : ""; + String constraint = ifNotExists? "IF NOT EXISTS ": ""; db.execSQL("CREATE TABLE " + constraint + "\"NOTICE_LOCALE_BEAN\" (" + // "\"_id\" INTEGER PRIMARY KEY AUTOINCREMENT ," + // 0: id "\"MESSAGE_ID\" TEXT UNIQUE ," + // 1: messageId @@ -68,9 +65,7 @@ "\"NOTICE_TIME\" TEXT);"); // 11: noticeTime } - /** - * Drops the underlying database table. - */ + /** Drops the underlying database table. */ public static void dropTable(Database db, boolean ifExists) { String sql = "DROP TABLE " + (ifExists ? "IF EXISTS " : "") + "\"NOTICE_LOCALE_BEAN\""; db.execSQL(sql); @@ -79,62 +74,62 @@ @Override protected final void bindValues(DatabaseStatement stmt, NoticeLocaleBean entity) { stmt.clearBindings(); - + Long id = entity.getId(); if (id != null) { stmt.bindLong(1, id); } - + String messageId = entity.getMessageId(); if (messageId != null) { stmt.bindString(2, messageId); } - + String appid = entity.getAppid(); if (appid != null) { stmt.bindString(3, appid); } - + String clientId = entity.getClientId(); if (clientId != null) { stmt.bindString(4, clientId); } - + String taskId = entity.getTaskId(); if (taskId != null) { stmt.bindString(5, taskId); } - + String userId = entity.getUserId(); if (userId != null) { stmt.bindString(6, userId); } - + String title = entity.getTitle(); if (title != null) { stmt.bindString(7, title); } - + String content = entity.getContent(); if (content != null) { stmt.bindString(8, content); } - + String deviceCode = entity.getDeviceCode(); if (deviceCode != null) { stmt.bindString(9, deviceCode); } - + String jobId = entity.getJobId(); if (jobId != null) { stmt.bindString(10, jobId); } - + String isRead = entity.getIsRead(); if (isRead != null) { stmt.bindString(11, isRead); } - + String noticeTime = entity.getNoticeTime(); if (noticeTime != null) { stmt.bindString(12, noticeTime); @@ -144,62 +139,62 @@ @Override protected final void bindValues(SQLiteStatement stmt, NoticeLocaleBean entity) { stmt.clearBindings(); - + Long id = entity.getId(); if (id != null) { stmt.bindLong(1, id); } - + String messageId = entity.getMessageId(); if (messageId != null) { stmt.bindString(2, messageId); } - + String appid = entity.getAppid(); if (appid != null) { stmt.bindString(3, appid); } - + String clientId = entity.getClientId(); if (clientId != null) { stmt.bindString(4, clientId); } - + String taskId = entity.getTaskId(); if (taskId != null) { stmt.bindString(5, taskId); } - + String userId = entity.getUserId(); if (userId != null) { stmt.bindString(6, userId); } - + String title = entity.getTitle(); if (title != null) { stmt.bindString(7, title); } - + String content = entity.getContent(); if (content != null) { stmt.bindString(8, content); } - + String deviceCode = entity.getDeviceCode(); if (deviceCode != null) { stmt.bindString(9, deviceCode); } - + String jobId = entity.getJobId(); if (jobId != null) { stmt.bindString(10, jobId); } - + String isRead = entity.getIsRead(); if (isRead != null) { stmt.bindString(11, isRead); } - + String noticeTime = entity.getNoticeTime(); if (noticeTime != null) { stmt.bindString(12, noticeTime); @@ -209,27 +204,27 @@ @Override public Long readKey(Cursor cursor, int offset) { return cursor.isNull(offset + 0) ? null : cursor.getLong(offset + 0); - } + } @Override public NoticeLocaleBean readEntity(Cursor cursor, int offset) { NoticeLocaleBean entity = new NoticeLocaleBean( // - cursor.isNull(offset + 0) ? null : cursor.getLong(offset + 0), // id - cursor.isNull(offset + 1) ? null : cursor.getString(offset + 1), // messageId - cursor.isNull(offset + 2) ? null : cursor.getString(offset + 2), // appid - cursor.isNull(offset + 3) ? null : cursor.getString(offset + 3), // clientId - cursor.isNull(offset + 4) ? null : cursor.getString(offset + 4), // taskId - cursor.isNull(offset + 5) ? null : cursor.getString(offset + 5), // userId - cursor.isNull(offset + 6) ? null : cursor.getString(offset + 6), // title - cursor.isNull(offset + 7) ? null : cursor.getString(offset + 7), // content - cursor.isNull(offset + 8) ? null : cursor.getString(offset + 8), // deviceCode - cursor.isNull(offset + 9) ? null : cursor.getString(offset + 9), // jobId - cursor.isNull(offset + 10) ? null : cursor.getString(offset + 10), // isRead - cursor.isNull(offset + 11) ? null : cursor.getString(offset + 11) // noticeTime + cursor.isNull(offset + 0) ? null : cursor.getLong(offset + 0), // id + cursor.isNull(offset + 1) ? null : cursor.getString(offset + 1), // messageId + cursor.isNull(offset + 2) ? null : cursor.getString(offset + 2), // appid + cursor.isNull(offset + 3) ? null : cursor.getString(offset + 3), // clientId + cursor.isNull(offset + 4) ? null : cursor.getString(offset + 4), // taskId + cursor.isNull(offset + 5) ? null : cursor.getString(offset + 5), // userId + cursor.isNull(offset + 6) ? null : cursor.getString(offset + 6), // title + cursor.isNull(offset + 7) ? null : cursor.getString(offset + 7), // content + cursor.isNull(offset + 8) ? null : cursor.getString(offset + 8), // deviceCode + cursor.isNull(offset + 9) ? null : cursor.getString(offset + 9), // jobId + cursor.isNull(offset + 10) ? null : cursor.getString(offset + 10), // isRead + cursor.isNull(offset + 11) ? null : cursor.getString(offset + 11) // noticeTime ); return entity; } - + @Override public void readEntity(Cursor cursor, NoticeLocaleBean entity, int offset) { entity.setId(cursor.isNull(offset + 0) ? null : cursor.getLong(offset + 0)); @@ -244,17 +239,17 @@ entity.setJobId(cursor.isNull(offset + 9) ? null : cursor.getString(offset + 9)); entity.setIsRead(cursor.isNull(offset + 10) ? null : cursor.getString(offset + 10)); entity.setNoticeTime(cursor.isNull(offset + 11) ? null : cursor.getString(offset + 11)); - } - + } + @Override protected final Long updateKeyAfterInsert(NoticeLocaleBean entity, long rowId) { entity.setId(rowId); return rowId; } - + @Override public Long getKey(NoticeLocaleBean entity) { - if (entity != null) { + if(entity != null) { return entity.getId(); } else { return null; @@ -270,5 +265,5 @@ protected final boolean isEntityUpdateable() { return true; } - + } diff --git a/app/src/main/java/com/casic/app/smartwell/greendao/PipeLocalBeanDao.java b/app/src/main/java/com/casic/app/smartwell/greendao/PipeLocalBeanDao.java index aab4d3f..df5515a 100644 --- a/app/src/main/java/com/casic/app/smartwell/greendao/PipeLocalBeanDao.java +++ b/app/src/main/java/com/casic/app/smartwell/greendao/PipeLocalBeanDao.java @@ -12,10 +12,9 @@ import org.greenrobot.greendao.internal.DaoConfig; // THIS CODE IS GENERATED BY greenDAO, DO NOT EDIT. - -/** +/** * DAO for table "PIPE_LOCAL_BEAN". - */ +*/ public class PipeLocalBeanDao extends AbstractDao { public static final String TABLENAME = "PIPE_LOCAL_BEAN"; @@ -37,16 +36,14 @@ public PipeLocalBeanDao(DaoConfig config) { super(config); } - + public PipeLocalBeanDao(DaoConfig config, DaoSession daoSession) { super(config, daoSession); } - /** - * Creates the underlying database table. - */ + /** Creates the underlying database table. */ public static void createTable(Database db, boolean ifNotExists) { - String constraint = ifNotExists ? "IF NOT EXISTS " : ""; + String constraint = ifNotExists? "IF NOT EXISTS ": ""; db.execSQL("CREATE TABLE " + constraint + "\"PIPE_LOCAL_BEAN\" (" + // "\"_id\" INTEGER PRIMARY KEY AUTOINCREMENT ," + // 0: id "\"PIPE_CODE\" TEXT," + // 1: pipeCode @@ -56,9 +53,7 @@ "\"START_LONGITUDE_GD\" TEXT);"); // 5: startLongitudeGd } - /** - * Drops the underlying database table. - */ + /** Drops the underlying database table. */ public static void dropTable(Database db, boolean ifExists) { String sql = "DROP TABLE " + (ifExists ? "IF EXISTS " : "") + "\"PIPE_LOCAL_BEAN\""; db.execSQL(sql); @@ -67,32 +62,32 @@ @Override protected final void bindValues(DatabaseStatement stmt, PipeLocalBean entity) { stmt.clearBindings(); - + Long id = entity.getId(); if (id != null) { stmt.bindLong(1, id); } - + String pipeCode = entity.getPipeCode(); if (pipeCode != null) { stmt.bindString(2, pipeCode); } - + String endLatitudeGd = entity.getEndLatitudeGd(); if (endLatitudeGd != null) { stmt.bindString(3, endLatitudeGd); } - + String endLongitudeGd = entity.getEndLongitudeGd(); if (endLongitudeGd != null) { stmt.bindString(4, endLongitudeGd); } - + String startLatitudeGd = entity.getStartLatitudeGd(); if (startLatitudeGd != null) { stmt.bindString(5, startLatitudeGd); } - + String startLongitudeGd = entity.getStartLongitudeGd(); if (startLongitudeGd != null) { stmt.bindString(6, startLongitudeGd); @@ -102,32 +97,32 @@ @Override protected final void bindValues(SQLiteStatement stmt, PipeLocalBean entity) { stmt.clearBindings(); - + Long id = entity.getId(); if (id != null) { stmt.bindLong(1, id); } - + String pipeCode = entity.getPipeCode(); if (pipeCode != null) { stmt.bindString(2, pipeCode); } - + String endLatitudeGd = entity.getEndLatitudeGd(); if (endLatitudeGd != null) { stmt.bindString(3, endLatitudeGd); } - + String endLongitudeGd = entity.getEndLongitudeGd(); if (endLongitudeGd != null) { stmt.bindString(4, endLongitudeGd); } - + String startLatitudeGd = entity.getStartLatitudeGd(); if (startLatitudeGd != null) { stmt.bindString(5, startLatitudeGd); } - + String startLongitudeGd = entity.getStartLongitudeGd(); if (startLongitudeGd != null) { stmt.bindString(6, startLongitudeGd); @@ -137,21 +132,21 @@ @Override public Long readKey(Cursor cursor, int offset) { return cursor.isNull(offset + 0) ? null : cursor.getLong(offset + 0); - } + } @Override public PipeLocalBean readEntity(Cursor cursor, int offset) { PipeLocalBean entity = new PipeLocalBean( // - cursor.isNull(offset + 0) ? null : cursor.getLong(offset + 0), // id - cursor.isNull(offset + 1) ? null : cursor.getString(offset + 1), // pipeCode - cursor.isNull(offset + 2) ? null : cursor.getString(offset + 2), // endLatitudeGd - cursor.isNull(offset + 3) ? null : cursor.getString(offset + 3), // endLongitudeGd - cursor.isNull(offset + 4) ? null : cursor.getString(offset + 4), // startLatitudeGd - cursor.isNull(offset + 5) ? null : cursor.getString(offset + 5) // startLongitudeGd + cursor.isNull(offset + 0) ? null : cursor.getLong(offset + 0), // id + cursor.isNull(offset + 1) ? null : cursor.getString(offset + 1), // pipeCode + cursor.isNull(offset + 2) ? null : cursor.getString(offset + 2), // endLatitudeGd + cursor.isNull(offset + 3) ? null : cursor.getString(offset + 3), // endLongitudeGd + cursor.isNull(offset + 4) ? null : cursor.getString(offset + 4), // startLatitudeGd + cursor.isNull(offset + 5) ? null : cursor.getString(offset + 5) // startLongitudeGd ); return entity; } - + @Override public void readEntity(Cursor cursor, PipeLocalBean entity, int offset) { entity.setId(cursor.isNull(offset + 0) ? null : cursor.getLong(offset + 0)); @@ -160,17 +155,17 @@ entity.setEndLongitudeGd(cursor.isNull(offset + 3) ? null : cursor.getString(offset + 3)); entity.setStartLatitudeGd(cursor.isNull(offset + 4) ? null : cursor.getString(offset + 4)); entity.setStartLongitudeGd(cursor.isNull(offset + 5) ? null : cursor.getString(offset + 5)); - } - + } + @Override protected final Long updateKeyAfterInsert(PipeLocalBean entity, long rowId) { entity.setId(rowId); return rowId; } - + @Override public Long getKey(PipeLocalBean entity) { - if (entity != null) { + if(entity != null) { return entity.getId(); } else { return null; @@ -186,5 +181,5 @@ protected final boolean isEntityUpdateable() { return true; } - + } diff --git a/app/src/main/java/com/casic/app/smartwell/view/ChangePasswordActivity.kt b/app/src/main/java/com/casic/app/smartwell/view/ChangePasswordActivity.kt index 8e41039..9f1dd40 100644 --- a/app/src/main/java/com/casic/app/smartwell/view/ChangePasswordActivity.kt +++ b/app/src/main/java/com/casic/app/smartwell/view/ChangePasswordActivity.kt @@ -14,7 +14,7 @@ import com.pengxh.kt.lite.extensions.show import com.pengxh.kt.lite.utils.ActivityStackManager import com.pengxh.kt.lite.utils.LoadState -import com.pengxh.kt.lite.utils.LoadingDialogHub +import com.pengxh.kt.lite.utils.LoadingDialog import com.pengxh.kt.lite.widget.TitleBarView import java.nio.charset.StandardCharsets @@ -46,15 +46,15 @@ override fun observeRequestState() { userViewModel.loadState.observe(this) { when (it) { - is LoadState.Loading -> LoadingDialogHub.show(this, "修改中,请稍后") + is LoadState.Loading -> LoadingDialog.show(this, "修改中,请稍后") is LoadState.Success -> { - LoadingDialogHub.dismiss() + LoadingDialog.dismiss() AuthenticationHelper.removeToken() this.navigatePageTo() ActivityStackManager.finishAllActivity() } - else -> LoadingDialogHub.dismiss() + else -> LoadingDialog.dismiss() } } } diff --git a/app/src/main/java/com/casic/app/smartwell/view/DeployedWellActivity.kt b/app/src/main/java/com/casic/app/smartwell/view/DeployedWellActivity.kt index fb4339c..28a5078 100644 --- a/app/src/main/java/com/casic/app/smartwell/view/DeployedWellActivity.kt +++ b/app/src/main/java/com/casic/app/smartwell/view/DeployedWellActivity.kt @@ -83,8 +83,8 @@ } //添加分割线 - binding.deployedListView.addItemDecoration( - RecyclerViewItemOffsets(0, 5, 0, 5) + binding.recyclerView.addItemDecoration( + RecyclerViewItemOffsets(0, 7, 0, 7) ) } @@ -149,12 +149,11 @@ } else { item.deep.toString() + "m" } - viewHolder.setText(R.id.wellNameView, item.wellName) + viewHolder.setText(R.id.wellTypeView, item.wellTypeName) .setText(R.id.wellDepthView, "深:${deep}") .setText(R.id.wellCodeView, "点位编号:${item.wellCode}") - .setText(R.id.wellTypeView, "点位类型:${item.wellTypeName}") .setText(R.id.ownerShipView, "权属单位:${item.deptName}") - .setText(R.id.wellLocationView, "点位置:${item.position}") + .setText(R.id.wellLocationView, "点位位置:${item.position}") .setOnClickListener( R.id.operationButton, object : View.OnClickListener { override fun onClick(v: View?) { @@ -207,7 +206,7 @@ }) } } - binding.deployedListView.adapter = deployAdapter + binding.recyclerView.adapter = deployAdapter deployAdapter.setOnItemClickedListener(object : NormalRecyclerAdapter.OnItemClickedListener { override fun onItemClicked(position: Int, t: WellListModel.DataBean.RowsBean) { diff --git a/app/src/main/java/com/casic/app/smartwell/view/LoginActivity.kt b/app/src/main/java/com/casic/app/smartwell/view/LoginActivity.kt index e4bb0e3..834527b 100644 --- a/app/src/main/java/com/casic/app/smartwell/view/LoginActivity.kt +++ b/app/src/main/java/com/casic/app/smartwell/view/LoginActivity.kt @@ -21,7 +21,7 @@ import com.pengxh.kt.lite.extensions.navigatePageTo import com.pengxh.kt.lite.extensions.readAssetsFile import com.pengxh.kt.lite.extensions.show -import com.pengxh.kt.lite.utils.LoadingDialogHub +import com.pengxh.kt.lite.utils.LoadingDialog import com.pengxh.kt.lite.utils.SaveKeyValues import kotlinx.coroutines.Dispatchers import kotlinx.coroutines.launch @@ -106,11 +106,11 @@ override fun observeRequestState() { authenticateViewModel.loadState.observe(this) { - LoadingDialogHub.show(this, "登录中,请稍后") + LoadingDialog.show(this, "登录中,请稍后") } loginViewModel.loadState.observe(this) { - LoadingDialogHub.dismiss() + LoadingDialog.dismiss() } } diff --git a/app/src/main/java/com/casic/app/smartwell/view/OrderCompletedDetailActivity.kt b/app/src/main/java/com/casic/app/smartwell/view/OrderCompletedDetailActivity.kt index db8ad1f..75cd905 100644 --- a/app/src/main/java/com/casic/app/smartwell/view/OrderCompletedDetailActivity.kt +++ b/app/src/main/java/com/casic/app/smartwell/view/OrderCompletedDetailActivity.kt @@ -17,7 +17,7 @@ import com.pengxh.kt.lite.extensions.show import com.pengxh.kt.lite.utils.Constant import com.pengxh.kt.lite.utils.LoadState -import com.pengxh.kt.lite.utils.LoadingDialogHub +import com.pengxh.kt.lite.utils.LoadingDialog import com.pengxh.kt.lite.widget.TitleBarView import com.pengxh.kt.lite.widget.dialog.AlertMessageDialog @@ -44,7 +44,7 @@ } override fun initOnCreate(savedInstanceState: Bundle?) { - val jobId = intent.getStringExtra(Constant.INTENT_PARAM)!! + val jobId = intent.getStringExtra(Constant.INTENT_PARAM_KEY)!! orderViewModel = ViewModelProvider(this)[OrderViewModel::class.java] orderViewModel.getWorkOrderDetail(jobId) orderViewModel.detailModel.observe(this) { @@ -154,8 +154,8 @@ override fun observeRequestState() { orderViewModel.loadState.observe(this) { when (it) { - is LoadState.Loading -> LoadingDialogHub.show(this, "数据加载中,请稍后") - else -> LoadingDialogHub.dismiss() + is LoadState.Loading -> LoadingDialog.show(this, "数据加载中,请稍后") + else -> LoadingDialog.dismiss() } } } diff --git a/app/src/main/java/com/casic/app/smartwell/view/OrderInHandleDetailActivity.kt b/app/src/main/java/com/casic/app/smartwell/view/OrderInHandleDetailActivity.kt index d70a979..04a7d5d 100644 --- a/app/src/main/java/com/casic/app/smartwell/view/OrderInHandleDetailActivity.kt +++ b/app/src/main/java/com/casic/app/smartwell/view/OrderInHandleDetailActivity.kt @@ -38,7 +38,7 @@ import com.pengxh.kt.lite.extensions.show import com.pengxh.kt.lite.utils.Constant import com.pengxh.kt.lite.utils.LoadState -import com.pengxh.kt.lite.utils.LoadingDialogHub +import com.pengxh.kt.lite.utils.LoadingDialog import com.pengxh.kt.lite.widget.TitleBarView import com.pengxh.kt.lite.widget.dialog.AlertControlDialog import com.pengxh.kt.lite.widget.dialog.AlertMessageDialog @@ -93,7 +93,7 @@ ) binding.addImageRecyclerView.adapter = imageAdapter - val jobId = intent.getStringExtra(Constant.INTENT_PARAM)!!//初始化图片九宫格 + val jobId = intent.getStringExtra(Constant.INTENT_PARAM_KEY)!!//初始化图片九宫格 orderViewModel.getWorkOrderDetail(jobId) orderViewModel.detailModel.observe(this) { if (it.code == 200) { @@ -312,41 +312,41 @@ override fun observeRequestState() { orderViewModel.loadState.observe(this) { when (it) { - is LoadState.Loading -> LoadingDialogHub.show(this, "数据加载中,请稍后") - else -> LoadingDialogHub.dismiss() + is LoadState.Loading -> LoadingDialog.show(this, "数据加载中,请稍后") + else -> LoadingDialog.dismiss() } } uploadImageViewModel.loadState.observe(this) { when (it) { - LoadState.Loading -> LoadingDialogHub.show(this, "图片上传中,请稍后...") - else -> LoadingDialogHub.dismiss() + LoadState.Loading -> LoadingDialog.show(this, "图片上传中,请稍后...") + else -> LoadingDialog.dismiss() } } //转单状态处理 operationViewModel.loadState.observe(this) { when (it) { - is LoadState.Loading -> LoadingDialogHub.show(this, "转单中,请稍后") + is LoadState.Loading -> LoadingDialog.show(this, "转单中,请稍后") is LoadState.Success -> { - LoadingDialogHub.dismiss() + LoadingDialog.dismiss() this.finish() } - else -> LoadingDialogHub.dismiss() + else -> LoadingDialog.dismiss() } } //处理完成工单状态处理 operationViewModel.loadState.observe(this) { when (it) { - is LoadState.Loading -> LoadingDialogHub.show(this, "处理中,请稍后") + is LoadState.Loading -> LoadingDialog.show(this, "处理中,请稍后") is LoadState.Success -> { - LoadingDialogHub.dismiss() + LoadingDialog.dismiss() this.finish() } - else -> LoadingDialogHub.dismiss() + else -> LoadingDialog.dismiss() } } } diff --git a/app/src/main/java/com/casic/app/smartwell/view/OrderNotConfirmedDetailActivity.kt b/app/src/main/java/com/casic/app/smartwell/view/OrderNotConfirmedDetailActivity.kt index 8e036d2..687ec86 100644 --- a/app/src/main/java/com/casic/app/smartwell/view/OrderNotConfirmedDetailActivity.kt +++ b/app/src/main/java/com/casic/app/smartwell/view/OrderNotConfirmedDetailActivity.kt @@ -36,7 +36,7 @@ import com.pengxh.kt.lite.extensions.show import com.pengxh.kt.lite.utils.Constant import com.pengxh.kt.lite.utils.LoadState -import com.pengxh.kt.lite.utils.LoadingDialogHub +import com.pengxh.kt.lite.utils.LoadingDialog import com.pengxh.kt.lite.widget.TitleBarView import com.pengxh.kt.lite.widget.dialog.AlertControlDialog import com.pengxh.kt.lite.widget.dialog.AlertMessageDialog @@ -80,7 +80,7 @@ } override fun initOnCreate(savedInstanceState: Bundle?) { - val jobId = intent.getStringExtra(Constant.INTENT_PARAM)!! + val jobId = intent.getStringExtra(Constant.INTENT_PARAM_KEY)!! //初始化图片九宫格 //左外边距,左内边距,右内边距,右外边距 val viewWidth = getScreenWidth() - (10 + 10 + 10 + 10).dp2px(this) @@ -263,41 +263,41 @@ //数据加载状态处理 orderViewModel.loadState.observe(this) { when (it) { - is LoadState.Loading -> LoadingDialogHub.show(this, "数据加载中,请稍后") - else -> LoadingDialogHub.dismiss() + is LoadState.Loading -> LoadingDialog.show(this, "数据加载中,请稍后") + else -> LoadingDialog.dismiss() } } uploadImageViewModel.loadState.observe(this) { when (it) { - LoadState.Loading -> LoadingDialogHub.show(this, "图片上传中,请稍后") - else -> LoadingDialogHub.dismiss() + LoadState.Loading -> LoadingDialog.show(this, "图片上传中,请稍后") + else -> LoadingDialog.dismiss() } } //转单状态处理 operationViewModel.loadState.observe(this) { when (it) { - is LoadState.Loading -> LoadingDialogHub.show(this, "转单中,请稍后") + is LoadState.Loading -> LoadingDialog.show(this, "转单中,请稍后") is LoadState.Success -> { - LoadingDialogHub.dismiss() + LoadingDialog.dismiss() this.finish() } - else -> LoadingDialogHub.dismiss() + else -> LoadingDialog.dismiss() } } //确认工单状态处理 operationViewModel.loadState.observe(this) { when (it) { - is LoadState.Loading -> LoadingDialogHub.show(this, "处理中,请稍后") + is LoadState.Loading -> LoadingDialog.show(this, "处理中,请稍后") is LoadState.Success -> { - LoadingDialogHub.dismiss() + LoadingDialog.dismiss() this.finish() } - else -> LoadingDialogHub.dismiss() + else -> LoadingDialog.dismiss() } } } diff --git a/app/src/main/java/com/casic/app/smartwell/view/OrderNotProcessedDetailActivity.kt b/app/src/main/java/com/casic/app/smartwell/view/OrderNotProcessedDetailActivity.kt index d3f22dc..0c97a52 100644 --- a/app/src/main/java/com/casic/app/smartwell/view/OrderNotProcessedDetailActivity.kt +++ b/app/src/main/java/com/casic/app/smartwell/view/OrderNotProcessedDetailActivity.kt @@ -18,7 +18,7 @@ import com.pengxh.kt.lite.extensions.show import com.pengxh.kt.lite.utils.Constant import com.pengxh.kt.lite.utils.LoadState -import com.pengxh.kt.lite.utils.LoadingDialogHub +import com.pengxh.kt.lite.utils.LoadingDialog import com.pengxh.kt.lite.widget.TitleBarView import com.pengxh.kt.lite.widget.dialog.AlertControlDialog import com.pengxh.kt.lite.widget.dialog.AlertMessageDialog @@ -50,7 +50,7 @@ } override fun initOnCreate(savedInstanceState: Bundle?) { - this.jobId = intent.getStringExtra(Constant.INTENT_PARAM)!! + this.jobId = intent.getStringExtra(Constant.INTENT_PARAM_KEY)!! orderViewModel = ViewModelProvider(this)[OrderViewModel::class.java] operationViewModel = ViewModelProvider(this)[OperationViewModel::class.java] wellViewModel = ViewModelProvider(this)[WellViewModel::class.java] @@ -162,21 +162,21 @@ //数据加载状态处理 orderViewModel.loadState.observe(this) { when (it) { - is LoadState.Loading -> LoadingDialogHub.show(this, "数据加载中,请稍后") - else -> LoadingDialogHub.dismiss() + is LoadState.Loading -> LoadingDialog.show(this, "数据加载中,请稍后") + else -> LoadingDialog.dismiss() } } //接单状态处理 operationViewModel.loadState.observe(this) { when (it) { - is LoadState.Loading -> LoadingDialogHub.show(this, "接单中,请稍后") + is LoadState.Loading -> LoadingDialog.show(this, "接单中,请稍后") is LoadState.Success -> { - LoadingDialogHub.dismiss() + LoadingDialog.dismiss() this.finish() } - else -> LoadingDialogHub.dismiss() + else -> LoadingDialog.dismiss() } } } diff --git a/app/src/main/java/com/casic/app/smartwell/view/SearchResultActivity.kt b/app/src/main/java/com/casic/app/smartwell/view/SearchResultActivity.kt index 6a92917..4f3a674 100644 --- a/app/src/main/java/com/casic/app/smartwell/view/SearchResultActivity.kt +++ b/app/src/main/java/com/casic/app/smartwell/view/SearchResultActivity.kt @@ -19,7 +19,7 @@ import com.pengxh.kt.lite.extensions.show import com.pengxh.kt.lite.utils.Constant import com.pengxh.kt.lite.utils.LoadState -import com.pengxh.kt.lite.utils.LoadingDialogHub +import com.pengxh.kt.lite.utils.LoadingDialog import com.pengxh.kt.lite.utils.WeakReferenceHandler import com.pengxh.kt.lite.widget.TitleBarView import com.pengxh.kt.lite.widget.dialog.AlertControlDialog @@ -56,7 +56,7 @@ } override fun initOnCreate(savedInstanceState: Bundle?) { - args = intent.getStringArrayListExtra(Constant.INTENT_PARAM)!! + args = intent.getStringArrayListExtra(Constant.INTENT_PARAM_KEY)!! orderViewModel = ViewModelProvider(this)[OrderViewModel::class.java] operationViewModel = ViewModelProvider(this)[OperationViewModel::class.java] @@ -101,24 +101,24 @@ } } - binding.resultRecyclerView.addItemDecoration( - RecyclerViewItemOffsets(0, 5, 0, 5) + binding.recyclerView.addItemDecoration( + RecyclerViewItemOffsets(0, 7, 0, 7) ) } override fun observeRequestState() { orderViewModel.loadState.observe(this) { when (it) { - is LoadState.Loading -> LoadingDialogHub.show(this, "数据加载中,请稍后") - else -> LoadingDialogHub.dismiss() + is LoadState.Loading -> LoadingDialog.show(this, "数据加载中,请稍后") + else -> LoadingDialog.dismiss() } } //接单状态处理 operationViewModel.loadState.observe(this) { when (it) { - is LoadState.Loading -> LoadingDialogHub.show(this, "接单中,请稍后") + is LoadState.Loading -> LoadingDialog.show(this, "接单中,请稍后") is LoadState.Success -> { - LoadingDialogHub.dismiss() + LoadingDialog.dismiss() //接单成功之后刷新列表 dataBeans.removeAt(clickedPosition) searchResultAdapter.notifyItemRemoved(clickedPosition) @@ -127,7 +127,7 @@ ) } - else -> LoadingDialogHub.dismiss() + else -> LoadingDialog.dismiss() } } } @@ -162,7 +162,7 @@ } else { binding.emptyInclude.emptyView.hide() searchResultAdapter = SearchResultAdapter(this, dataBeans) - binding.resultRecyclerView.adapter = searchResultAdapter + binding.recyclerView.adapter = searchResultAdapter searchResultAdapter.setOnItemClickListener(object : SearchResultAdapter.OnItemClickListener { override fun onClicked(position: Int) { diff --git a/app/src/main/java/com/casic/app/smartwell/view/UnDeployWellActivity.kt b/app/src/main/java/com/casic/app/smartwell/view/UnDeployWellActivity.kt index 7f7cd3c..555c278 100644 --- a/app/src/main/java/com/casic/app/smartwell/view/UnDeployWellActivity.kt +++ b/app/src/main/java/com/casic/app/smartwell/view/UnDeployWellActivity.kt @@ -81,8 +81,8 @@ } } - binding.undeployListView.addItemDecoration( - RecyclerViewItemOffsets(0, 5, 0, 5) + binding.recyclerView.addItemDecoration( + RecyclerViewItemOffsets(0, 7, 0, 7) ) } @@ -147,12 +147,11 @@ } else { item.deep.toString() + "m" } - viewHolder.setText(R.id.wellNameView, item.wellName) + viewHolder.setText(R.id.wellTypeView, item.wellTypeName) .setText(R.id.wellDepthView, "深:${deep}") .setText(R.id.wellCodeView, "点位编号:${item.wellCode}") - .setText(R.id.wellTypeView, "点位类型:${item.wellTypeName}") .setText(R.id.ownerShipView, "权属单位:${item.deptName}") - .setText(R.id.wellLocationView, "点位置:${item.position}") + .setText(R.id.wellLocationView, "点位位置:${item.position}") .setOnClickListener( R.id.operationButton, object : View.OnClickListener { override fun onClick(v: View?) { @@ -185,7 +184,7 @@ ) } } - binding.undeployListView.adapter = unDeployAdapter + binding.recyclerView.adapter = unDeployAdapter unDeployAdapter.setOnItemClickedListener(object : NormalRecyclerAdapter.OnItemClickedListener { override fun onItemClicked(position: Int, t: WellListModel.DataBean.RowsBean) { diff --git a/app/src/main/java/com/casic/app/smartwell/view/WellDetailActivity.kt b/app/src/main/java/com/casic/app/smartwell/view/WellDetailActivity.kt index b50d067..eb8b468 100644 --- a/app/src/main/java/com/casic/app/smartwell/view/WellDetailActivity.kt +++ b/app/src/main/java/com/casic/app/smartwell/view/WellDetailActivity.kt @@ -16,7 +16,7 @@ import com.pengxh.kt.lite.extensions.show import com.pengxh.kt.lite.utils.Constant import com.pengxh.kt.lite.utils.LoadState -import com.pengxh.kt.lite.utils.LoadingDialogHub +import com.pengxh.kt.lite.utils.LoadingDialog import com.pengxh.kt.lite.widget.TitleBarView import com.pengxh.kt.lite.widget.dialog.AlertMessageDialog @@ -44,7 +44,7 @@ } override fun initOnCreate(savedInstanceState: Bundle?) { - val wellId = intent.getStringExtra(Constant.INTENT_PARAM)!! + val wellId = intent.getStringExtra(Constant.INTENT_PARAM_KEY)!! wellViewModel = ViewModelProvider(this)[WellViewModel::class.java] wellViewModel.getWellDetail(wellId) wellViewModel.wellDetailModel.observe(this) { @@ -132,8 +132,8 @@ override fun observeRequestState() { wellViewModel.loadState.observe(this) { when (it) { - is LoadState.Loading -> LoadingDialogHub.show(this, "数据加载中,请稍后") - else -> LoadingDialogHub.dismiss() + is LoadState.Loading -> LoadingDialog.show(this, "数据加载中,请稍后") + else -> LoadingDialog.dismiss() } } } diff --git a/app/src/main/java/com/casic/app/smartwell/view/WellManagementActivity.kt b/app/src/main/java/com/casic/app/smartwell/view/WellManagementActivity.kt index 084da95..457096b 100644 --- a/app/src/main/java/com/casic/app/smartwell/view/WellManagementActivity.kt +++ b/app/src/main/java/com/casic/app/smartwell/view/WellManagementActivity.kt @@ -94,8 +94,8 @@ } } - binding.wellListView.addItemDecoration( - RecyclerViewItemOffsets(0, 5, 0, 5) + binding.recyclerView.addItemDecoration( + RecyclerViewItemOffsets(0, 7, 0, 7) ) } @@ -175,13 +175,12 @@ } else { item.deep.toString() + "m" } - viewHolder.setText(R.id.wellNameView, item.wellName) + viewHolder.setText(R.id.wellTypeView, item.wellTypeName) .setText(R.id.wellStateView, "已${item.bfztName}") .setText(R.id.wellDepthView, "深:${deep}") .setText(R.id.wellCodeView, "点位编号:${item.wellCode}") - .setText(R.id.wellTypeView, "点位类型:${item.wellTypeName}") .setText(R.id.ownerShipView, "权属单位:${item.deptName}") - .setText(R.id.wellLocationView, "点位置:${item.position}") + .setText(R.id.wellLocationView, "点位位置:${item.position}") .setOnClickListener( R.id.navigationButton, object : View.OnClickListener { override fun onClick(v: View?) { @@ -200,7 +199,7 @@ ) } } - binding.wellListView.adapter = wellListAdapter + binding.recyclerView.adapter = wellListAdapter wellListAdapter.setOnItemClickedListener(object : NormalRecyclerAdapter.OnItemClickedListener { override fun onItemClicked(position: Int, t: WellListModel.DataBean.RowsBean) { diff --git a/app/src/main/java/com/casic/app/smartwell/view/WellMonitorActivity.kt b/app/src/main/java/com/casic/app/smartwell/view/WellMonitorActivity.kt index e3573eb..b87bdb7 100644 --- a/app/src/main/java/com/casic/app/smartwell/view/WellMonitorActivity.kt +++ b/app/src/main/java/com/casic/app/smartwell/view/WellMonitorActivity.kt @@ -11,7 +11,7 @@ import com.pengxh.kt.lite.base.KotlinBaseActivity import com.pengxh.kt.lite.utils.Constant import com.pengxh.kt.lite.utils.LoadState -import com.pengxh.kt.lite.utils.LoadingDialogHub +import com.pengxh.kt.lite.utils.LoadingDialog import com.pengxh.kt.lite.widget.TitleBarView class WellMonitorActivity : KotlinBaseActivity() { @@ -36,7 +36,7 @@ } override fun initOnCreate(savedInstanceState: Bundle?) { - val wellId = intent.getStringExtra(Constant.INTENT_PARAM)!! + val wellId = intent.getStringExtra(Constant.INTENT_PARAM_KEY)!! wellViewModel = ViewModelProvider(this)[WellViewModel::class.java] wellViewModel.getMonitorResult(wellId) wellViewModel.monitorModel.observe(this) { @@ -56,8 +56,8 @@ override fun observeRequestState() { wellViewModel.loadState.observe(this) { when (it) { - is LoadState.Loading -> LoadingDialogHub.show(this, "数据加载中,请稍后") - else -> LoadingDialogHub.dismiss() + is LoadState.Loading -> LoadingDialog.show(this, "数据加载中,请稍后") + else -> LoadingDialog.dismiss() } } } diff --git a/app/src/main/java/com/casic/app/smartwell/view/WellOperationActivity.kt b/app/src/main/java/com/casic/app/smartwell/view/WellOperationActivity.kt index 8d333bf..347ebb6 100644 --- a/app/src/main/java/com/casic/app/smartwell/view/WellOperationActivity.kt +++ b/app/src/main/java/com/casic/app/smartwell/view/WellOperationActivity.kt @@ -23,7 +23,7 @@ import com.pengxh.kt.lite.extensions.navigatePageTo import com.pengxh.kt.lite.extensions.show import com.pengxh.kt.lite.utils.LoadState -import com.pengxh.kt.lite.utils.LoadingDialogHub +import com.pengxh.kt.lite.utils.LoadingDialog import com.pengxh.kt.lite.utils.WeakReferenceHandler import com.pengxh.kt.lite.widget.dialog.AlertControlDialog @@ -109,8 +109,8 @@ } } - binding.operationListView.addItemDecoration( - RecyclerViewItemOffsets(0, 5, 0, 5) + binding.recyclerView.addItemDecoration( + RecyclerViewItemOffsets(0, 7, 0, 7) ) } @@ -123,13 +123,13 @@ override fun observeRequestState() { wellViewModel.loadState.observe(this) { when (it) { - is LoadState.Loading -> LoadingDialogHub.show(this, "处理中,请稍后") + is LoadState.Loading -> LoadingDialog.show(this, "处理中,请稍后") is LoadState.Success -> { - LoadingDialogHub.dismiss() + LoadingDialog.dismiss() wellOperationAdapter.notifyItemChanged(clickedPosition) } - else -> LoadingDialogHub.dismiss() + else -> LoadingDialog.dismiss() } } } @@ -203,24 +203,23 @@ if (item.bfztName == "布防") { viewHolder.setImageResource( R.id.wellStateView, R.drawable.bg_solid_text_green_radius_5 - ).setText(R.id.wellStateView, "撤防") + ).setText(R.id.operationButton, "撤防") } else { viewHolder.setImageResource( R.id.wellStateView, R.drawable.bg_solid_text_red_radius_5 - ).setText(R.id.wellStateView, "布防") + ).setText(R.id.operationButton, "布防") } val deep = if (item.deep.toString().isBlank()) { "未知" } else { item.deep.toString() + "m" } - viewHolder.setText(R.id.wellNameView, item.wellName) + viewHolder.setText(R.id.wellTypeView, item.wellTypeName) .setText(R.id.wellStateView, "已${item.bfztName}") .setText(R.id.wellDepthView, "深:${deep}") .setText(R.id.wellCodeView, "点位编号:${item.wellCode}") - .setText(R.id.wellTypeView, "点位类型:${item.wellTypeName}") .setText(R.id.ownerShipView, "权属单位:${item.deptName}") - .setText(R.id.wellLocationView, "点位置:${item.position}") + .setText(R.id.wellLocationView, "点位位置:${item.position}") .setOnClickListener( R.id.operationButton, object : View.OnClickListener { override fun onClick(v: View?) { @@ -280,7 +279,7 @@ ) } } - binding.operationListView.adapter = wellOperationAdapter + binding.recyclerView.adapter = wellOperationAdapter wellOperationAdapter.setOnItemClickedListener(object : NormalRecyclerAdapter.OnItemClickedListener { override fun onItemClicked(position: Int, t: WellListModel.DataBean.RowsBean) { diff --git a/app/src/main/res/drawable/ic_down.xml b/app/src/main/res/drawable/ic_down.xml index 20e6476..6987e6c 100644 --- a/app/src/main/res/drawable/ic_down.xml +++ b/app/src/main/res/drawable/ic_down.xml @@ -1,6 +1,6 @@ + + diff --git a/app/src/main/res/layout/activity_about_us.xml b/app/src/main/res/layout/activity_about_us.xml index 9091a00..d5fbd0d 100644 --- a/app/src/main/res/layout/activity_about_us.xml +++ b/app/src/main/res/layout/activity_about_us.xml @@ -12,13 +12,7 @@ android:layout_width="match_parent" android:layout_height="wrap_content" android:background="@color/mainThemeColor" - app:tbv_left_image="@drawable/ic_title_left" - app:tbv_only_show_title="false" - app:tbv_show_left_image="true" - app:tbv_show_right_image="false" - app:tbv_text="关于我们" - app:tbv_text_color="@color/white" - app:tbv_text_size="@dimen/sp_18" /> + app:tbv_text="关于我们" /> + app:tbv_text="修改密码" /> + app:tbv_text="布防列表" /> + app:tbv_text="帮助中心" /> + app:tbv_text="工单详情" /> + app:tbv_text="工单详情" /> + app:tbv_text="工单详情" /> + app:tbv_text="工单详情" /> + app:tbv_text="超时工单" /> + app:tbv_text="工单查询" /> + app:tbv_text="查询结果" /> + app:tbv_text="撤防列表" /> + app:tbv_text="个人资料" /> + app:tbv_text="点位详情" /> + app:tbv_text="监控内容" /> - - - - - - + android:layout_height="wrap_content" + android:background="@color/mainThemeColor" + app:tbv_show_left_image="false" + app:tbv_show_right_image="true" + app:tbv_text="首页" /> - + - + - - - - - - + android:layout_height="wrap_content" + android:background="@color/mainThemeColor" + app:tbv_right_image="@drawable/ic_search_white" + app:tbv_show_left_image="false" + app:tbv_show_right_image="true" + app:tbv_text="工单" /> - - - - - - \ No newline at end of file diff --git a/app/src/main/res/layout/item_deployed_rv.xml b/app/src/main/res/layout/item_deployed_rv.xml index 391ad28..fadcf1d 100644 --- a/app/src/main/res/layout/item_deployed_rv.xml +++ b/app/src/main/res/layout/item_deployed_rv.xml @@ -3,10 +3,9 @@ xmlns:app="http://schemas.android.com/apk/res-auto" android:layout_width="match_parent" android:layout_height="wrap_content" - android:layout_marginHorizontal="@dimen/dp_5" android:background="@drawable/bg_solid_layout_white_radius_10" android:orientation="vertical" - android:padding="@dimen/dp_5"> + android:padding="@dimen/dp_7"> @@ -42,63 +41,63 @@ android:textColor="@color/subTextColor" /> - - - - - + android:gravity="center" + android:orientation="horizontal"> - + - + - + + + + + + android:gravity="center" + android:orientation="vertical"> - - + + + + + \ No newline at end of file diff --git a/app/src/main/res/layout/item_order_completed_rv.xml b/app/src/main/res/layout/item_order_completed_rv.xml index e4ff890..3c78a0f 100644 --- a/app/src/main/res/layout/item_order_completed_rv.xml +++ b/app/src/main/res/layout/item_order_completed_rv.xml @@ -96,6 +96,7 @@ android:layout_height="wrap_content" android:layout_alignParentEnd="true" android:layout_centerVertical="true" + android:padding="@dimen/dp_10" android:src="@drawable/ic_down" /> diff --git a/app/src/main/res/layout/item_order_in_handle_rv.xml b/app/src/main/res/layout/item_order_in_handle_rv.xml index e4ff890..3c78a0f 100644 --- a/app/src/main/res/layout/item_order_in_handle_rv.xml +++ b/app/src/main/res/layout/item_order_in_handle_rv.xml @@ -96,6 +96,7 @@ android:layout_height="wrap_content" android:layout_alignParentEnd="true" android:layout_centerVertical="true" + android:padding="@dimen/dp_10" android:src="@drawable/ic_down" /> diff --git a/app/src/main/res/layout/item_order_not_confirmed_rv.xml b/app/src/main/res/layout/item_order_not_confirmed_rv.xml index d848810..795d7e8 100644 --- a/app/src/main/res/layout/item_order_not_confirmed_rv.xml +++ b/app/src/main/res/layout/item_order_not_confirmed_rv.xml @@ -96,6 +96,7 @@ android:layout_height="wrap_content" android:layout_alignParentEnd="true" android:layout_centerVertical="true" + android:padding="@dimen/dp_10" android:src="@drawable/ic_down" /> diff --git a/app/build.gradle b/app/build.gradle index 296fb6f..c18c251 100644 --- a/app/build.gradle +++ b/app/build.gradle @@ -40,10 +40,6 @@ // VIVO 相关应用参数 VIVO_APP_ID : "105749048", VIVO_APP_KEY : "e460fbf2c689e0f8c58ecc6aa62e1803", - - // 小米相关应用参数 -// XIAOMI_APP_ID : "", -// XIAOMI_APP_KEY : "", ] // 版本名后面添加一句话,意思就是flavor dimension 它的维度就是该版本号,多渠道打包很重要 @@ -107,7 +103,7 @@ dependencies { implementation fileTree(dir: 'libs', include: ['*.jar']) //基础依赖库 - implementation 'com.github.AndroidCoderPeng:Kotlin-lite-lib:1.0.10' + implementation 'com.github.AndroidCoderPeng:Kotlin-lite-lib:1.1.0' implementation 'androidx.appcompat:appcompat:1.6.1' implementation 'androidx.core:core-ktx:1.9.0' implementation 'androidx.constraintlayout:constraintlayout:2.1.4' @@ -165,8 +161,6 @@ implementation 'commons-codec:commons-codec:1.15' implementation 'com.android.support:support-annotations:28.0.0' implementation 'com.assist-v3:vivo:3.1.2' // vivo -// implementation 'com.getui.opt:xmp:3.3.1' // 小米 - //数据库框架 implementation 'org.greenrobot:greendao:3.3.0' //数据库升级 diff --git a/app/src/main/AndroidManifest.xml b/app/src/main/AndroidManifest.xml index c0af158..e0519bf 100644 --- a/app/src/main/AndroidManifest.xml +++ b/app/src/main/AndroidManifest.xml @@ -90,10 +90,10 @@ - + + android:value="ee96d8b5e12de3fbb29949efd57418a8" /> () @@ -150,7 +158,7 @@ val cameraPosition = CameraPosition(centerLatLng, 14f, 0f, 0f) val cameraUpdate = CameraUpdateFactory.newCameraPosition(cameraPosition) withContext(Dispatchers.Main) { - LoadingDialogHub.dismiss() + LoadingDialog.dismiss() aMap.animateCamera(cameraUpdate, 1500, null) } } @@ -239,11 +247,6 @@ } override fun initEvent() { - binding.rightOptionView.setOnClickListener { - val x = binding.rightOptionView.width - easyPopupWindow.width - easyPopupWindow.showAsDropDown(binding.rightOptionView, x, 0) - } - //撤防点位 binding.unDeployedLayout.setOnClickListener { requireContext().navigatePageTo() @@ -263,11 +266,11 @@ override fun observeRequestState() { wellViewModel.loadState.observe(this) { when (it) { - is LoadState.Loading -> LoadingDialogHub.show( + is LoadState.Loading -> LoadingDialog.show( requireActivity(), "数据加载中,请稍后..." ) - else -> LoadingDialogHub.dismiss() + else -> LoadingDialog.dismiss() } } } @@ -376,7 +379,7 @@ }).build().show() } }) - infoPopup.showAsDropDown(binding.rightOptionView) +// infoPopup.showAsDropDown(binding.rightOptionView) } override fun onCameraChange(p0: CameraPosition?) { diff --git a/app/src/main/java/com/casic/app/smartwell/fragment/HomePageNoClusterFragment.kt b/app/src/main/java/com/casic/app/smartwell/fragment/HomePageNoClusterFragment.kt index 802426a..b25f743 100644 --- a/app/src/main/java/com/casic/app/smartwell/fragment/HomePageNoClusterFragment.kt +++ b/app/src/main/java/com/casic/app/smartwell/fragment/HomePageNoClusterFragment.kt @@ -38,8 +38,9 @@ import com.pengxh.kt.lite.extensions.navigatePageTo import com.pengxh.kt.lite.extensions.show import com.pengxh.kt.lite.utils.LoadState -import com.pengxh.kt.lite.utils.LoadingDialogHub +import com.pengxh.kt.lite.utils.LoadingDialog import com.pengxh.kt.lite.widget.EasyPopupWindow +import com.pengxh.kt.lite.widget.TitleBarView import com.pengxh.kt.lite.widget.dialog.AlertControlDialog import kotlinx.coroutines.Dispatchers import kotlinx.coroutines.launch @@ -78,7 +79,15 @@ override fun setupTopBarLayout() { binding.rootView.initImmersionBar(this, false, R.color.mainThemeColor) - binding.titleView.text = "首页" + binding.titleView.setOnClickListener(object : TitleBarView.OnClickListener { + override fun onLeftClick() { + + } + + override fun onRightClick() { + easyPopupWindow.showAsDropDown(binding.titleView, binding.titleView.width, 0) + } + }) } override fun initOnCreate(savedInstanceState: Bundle?) { @@ -112,7 +121,7 @@ //渲染井位置 lifecycleScope.launch(Dispatchers.Main) { - LoadingDialogHub.show(requireActivity(), "数据加载中,请稍后") + LoadingDialog.show(requireActivity(), "数据加载中,请稍后") withContext(Dispatchers.IO) { //取Well缓存 val allMarkerOptions = ArrayList() @@ -144,7 +153,7 @@ val cameraPosition = CameraPosition(centerLatLng, 14f, 0f, 0f) val cameraUpdate = CameraUpdateFactory.newCameraPosition(cameraPosition) withContext(Dispatchers.Main) { - LoadingDialogHub.dismiss() + LoadingDialog.dismiss() aMap.animateCamera(cameraUpdate, 1500, null) } } @@ -238,11 +247,6 @@ } override fun initEvent() { - binding.rightOptionView.setOnClickListener { - val x = binding.rightOptionView.width - easyPopupWindow.width - easyPopupWindow.showAsDropDown(binding.rightOptionView, x, 0) - } - //撤防点位 binding.unDeployedLayout.setOnClickListener { requireContext().navigatePageTo() @@ -262,11 +266,11 @@ override fun observeRequestState() { wellViewModel.loadState.observe(this) { when (it) { - is LoadState.Loading -> LoadingDialogHub.show( + is LoadState.Loading -> LoadingDialog.show( requireActivity(), "数据加载中,请稍后..." ) - else -> LoadingDialogHub.dismiss() + else -> LoadingDialog.dismiss() } } } diff --git a/app/src/main/java/com/casic/app/smartwell/fragment/MinePageFragment.kt b/app/src/main/java/com/casic/app/smartwell/fragment/MinePageFragment.kt index 09a570c..dcb48f8 100644 --- a/app/src/main/java/com/casic/app/smartwell/fragment/MinePageFragment.kt +++ b/app/src/main/java/com/casic/app/smartwell/fragment/MinePageFragment.kt @@ -35,7 +35,7 @@ import com.pengxh.kt.lite.utils.ActivityStackManager import com.pengxh.kt.lite.utils.FileDownloadManager import com.pengxh.kt.lite.utils.LoadState -import com.pengxh.kt.lite.utils.LoadingDialogHub +import com.pengxh.kt.lite.utils.LoadingDialog import com.pengxh.kt.lite.widget.dialog.AlertControlDialog import com.pengxh.kt.lite.widget.dialog.BottomActionSheet import kotlinx.coroutines.Dispatchers @@ -60,7 +60,6 @@ override fun setupTopBarLayout() { binding.rootView.initImmersionBar(this, false, R.color.mainThemeColor) - binding.titleInclude.titleView.text = "我的" } override fun initOnCreate(savedInstanceState: Bundle?) { @@ -155,27 +154,27 @@ override fun observeRequestState() { userViewModel.loadState.observe(this) { when (it) { - is LoadState.Loading -> LoadingDialogHub.show( + is LoadState.Loading -> LoadingDialog.show( requireActivity(), "检查版本中,请稍后" ) - else -> LoadingDialogHub.dismiss() + else -> LoadingDialog.dismiss() } } wellViewModel.loadState.observe(this) { when (it) { - is LoadState.Loading -> LoadingDialogHub.show( + is LoadState.Loading -> LoadingDialog.show( requireActivity(), "数据更新中,请稍后" ) is LoadState.Fail -> { - LoadingDialogHub.dismiss() + LoadingDialog.dismiss() "数据更新超时".show(requireContext()) } else -> { - LoadingDialogHub.dismiss() + LoadingDialog.dismiss() AlertControlDialog.Builder().setContext(requireContext()).setTitle("温馨提示") .setMessage("数据更新成功,请重启应用").setNegativeButton("取消") .setPositiveButton("确定").setOnDialogButtonClickListener(object : @@ -197,17 +196,17 @@ lineViewModel.loadState.observe(this) { when (it) { - is LoadState.Loading -> LoadingDialogHub.show( + is LoadState.Loading -> LoadingDialog.show( requireActivity(), "数据更新中,请稍后" ) is LoadState.Fail -> { - LoadingDialogHub.dismiss() + LoadingDialog.dismiss() "数据更新超时".show(requireContext()) } else -> { - LoadingDialogHub.dismiss() + LoadingDialog.dismiss() AlertControlDialog.Builder().setContext(requireContext()).setTitle("温馨提示") .setMessage("数据更新成功,请重启应用").setNegativeButton("取消") .setPositiveButton("确定").setOnDialogButtonClickListener(object : diff --git a/app/src/main/java/com/casic/app/smartwell/fragment/NoticePageFragment.kt b/app/src/main/java/com/casic/app/smartwell/fragment/NoticePageFragment.kt index 171b555..3c93f54 100644 --- a/app/src/main/java/com/casic/app/smartwell/fragment/NoticePageFragment.kt +++ b/app/src/main/java/com/casic/app/smartwell/fragment/NoticePageFragment.kt @@ -48,7 +48,6 @@ override fun setupTopBarLayout() { binding.rootView.initImmersionBar(this, false, R.color.mainThemeColor) - binding.titleInclude.titleView.text = "消息" } override fun initOnCreate(savedInstanceState: Bundle?) { diff --git a/app/src/main/java/com/casic/app/smartwell/fragment/OrderListFragment.kt b/app/src/main/java/com/casic/app/smartwell/fragment/OrderListFragment.kt index 93ff35b..5e38acb 100644 --- a/app/src/main/java/com/casic/app/smartwell/fragment/OrderListFragment.kt +++ b/app/src/main/java/com/casic/app/smartwell/fragment/OrderListFragment.kt @@ -12,6 +12,7 @@ import com.casic.app.smartwell.view.SearchOrderActivity import com.pengxh.kt.lite.base.KotlinBaseFragment import com.pengxh.kt.lite.extensions.navigatePageTo +import com.pengxh.kt.lite.widget.TitleBarView class OrderListFragment : KotlinBaseFragment() { @@ -25,15 +26,22 @@ } override fun initViewBinding( - inflater: LayoutInflater, - container: ViewGroup? + inflater: LayoutInflater, container: ViewGroup? ): FragmentOrderBinding { return FragmentOrderBinding.inflate(inflater, container, false) } override fun setupTopBarLayout() { binding.rootView.initImmersionBar(this, false, R.color.mainThemeColor) - binding.titleView.text = "工单" + binding.titleView.setOnClickListener(object : TitleBarView.OnClickListener { + override fun onLeftClick() { + + } + + override fun onRightClick() { + requireContext().navigatePageTo() + } + }) } override fun initOnCreate(savedInstanceState: Bundle?) { @@ -51,8 +59,6 @@ } override fun initEvent() { - binding.rightOptionView.setOnClickListener { - requireContext().navigatePageTo() - } + } } \ No newline at end of file diff --git a/app/src/main/java/com/casic/app/smartwell/fragment/OrderNotProcessedFragment.kt b/app/src/main/java/com/casic/app/smartwell/fragment/OrderNotProcessedFragment.kt index 0b3d09d..2b6f21d 100644 --- a/app/src/main/java/com/casic/app/smartwell/fragment/OrderNotProcessedFragment.kt +++ b/app/src/main/java/com/casic/app/smartwell/fragment/OrderNotProcessedFragment.kt @@ -18,7 +18,7 @@ import com.pengxh.kt.lite.extensions.navigatePageTo import com.pengxh.kt.lite.extensions.show import com.pengxh.kt.lite.utils.LoadState -import com.pengxh.kt.lite.utils.LoadingDialogHub +import com.pengxh.kt.lite.utils.LoadingDialog import com.pengxh.kt.lite.utils.WeakReferenceHandler import com.pengxh.kt.lite.widget.dialog.AlertControlDialog @@ -78,8 +78,8 @@ operationViewModel = ViewModelProvider(this)[OperationViewModel::class.java] - binding.notProcessedView.addItemDecoration( - RecyclerViewItemOffsets(0, 5, 0, 5) + binding.recyclerView.addItemDecoration( + RecyclerViewItemOffsets(0, 7, 0, 7) ) } @@ -87,9 +87,9 @@ //接单状态处理 operationViewModel.loadState.observe(this) { when (it) { - is LoadState.Loading -> LoadingDialogHub.show(requireActivity(), "接单中,请稍后") + is LoadState.Loading -> LoadingDialog.show(requireActivity(), "接单中,请稍后") is LoadState.Success -> { - LoadingDialogHub.dismiss() + LoadingDialog.dismiss() //接单成功之后刷新列表 dataBeans.removeAt(clickedPosition) notProcessedAdapter.notifyItemRemoved(clickedPosition) @@ -98,7 +98,7 @@ ) } - else -> LoadingDialogHub.dismiss() + else -> LoadingDialog.dismiss() } } } @@ -131,7 +131,7 @@ } else { binding.emptyInclude.emptyView.hide() notProcessedAdapter = OrderNotProcessedAdapter(requireContext(), dataBeans) - binding.notProcessedView.adapter = notProcessedAdapter + binding.recyclerView.adapter = notProcessedAdapter notProcessedAdapter.setOnItemClickListener(object : OrderNotProcessedAdapter.OnItemClickListener { override fun onClicked(position: Int) { diff --git a/app/src/main/java/com/casic/app/smartwell/fragment/OvertimeNotAcceptFragment.kt b/app/src/main/java/com/casic/app/smartwell/fragment/OvertimeNotAcceptFragment.kt index a198545..9b318ca 100644 --- a/app/src/main/java/com/casic/app/smartwell/fragment/OvertimeNotAcceptFragment.kt +++ b/app/src/main/java/com/casic/app/smartwell/fragment/OvertimeNotAcceptFragment.kt @@ -18,7 +18,7 @@ import com.pengxh.kt.lite.extensions.navigatePageTo import com.pengxh.kt.lite.extensions.show import com.pengxh.kt.lite.utils.LoadState -import com.pengxh.kt.lite.utils.LoadingDialogHub +import com.pengxh.kt.lite.utils.LoadingDialog import com.pengxh.kt.lite.utils.WeakReferenceHandler import com.pengxh.kt.lite.widget.dialog.AlertControlDialog @@ -81,8 +81,8 @@ operationViewModel = ViewModelProvider(this)[OperationViewModel::class.java] - binding.notProcessedView.addItemDecoration( - RecyclerViewItemOffsets(0, 5, 0, 5) + binding.recyclerView.addItemDecoration( + RecyclerViewItemOffsets(0, 7, 0, 7) ) } @@ -90,9 +90,9 @@ //接单状态处理 operationViewModel.loadState.observe(this) { when (it) { - is LoadState.Loading -> LoadingDialogHub.show(requireActivity(), "接单中,请稍后") + is LoadState.Loading -> LoadingDialog.show(requireActivity(), "接单中,请稍后") is LoadState.Success -> { - LoadingDialogHub.dismiss() + LoadingDialog.dismiss() //接单成功之后刷新列表 dataBeans.removeAt(clickedPosition) notProcessedAdapter.notifyItemRemoved(clickedPosition) @@ -101,7 +101,7 @@ ) } - else -> LoadingDialogHub.dismiss() + else -> LoadingDialog.dismiss() } } } @@ -134,7 +134,7 @@ } else { binding.emptyInclude.emptyView.hide() notProcessedAdapter = OrderNotProcessedAdapter(requireContext(), dataBeans) - binding.notProcessedView.adapter = notProcessedAdapter + binding.recyclerView.adapter = notProcessedAdapter notProcessedAdapter.setOnItemClickListener(object : OrderNotProcessedAdapter.OnItemClickListener { override fun onClicked(position: Int) { diff --git a/app/src/main/java/com/casic/app/smartwell/greendao/DaoMaster.java b/app/src/main/java/com/casic/app/smartwell/greendao/DaoMaster.java index fdcf3a7..1e52b74 100644 --- a/app/src/main/java/com/casic/app/smartwell/greendao/DaoMaster.java +++ b/app/src/main/java/com/casic/app/smartwell/greendao/DaoMaster.java @@ -13,25 +13,20 @@ // THIS CODE IS GENERATED BY greenDAO, DO NOT EDIT. - /** * Master of DAO (schema version 4): knows all DAOs. */ public class DaoMaster extends AbstractDaoMaster { public static final int SCHEMA_VERSION = 4; - /** - * Creates underlying database table using DAOs. - */ + /** Creates underlying database table using DAOs. */ public static void createAllTables(Database db, boolean ifNotExists) { MapWellLocalBeanDao.createTable(db, ifNotExists); NoticeLocaleBeanDao.createTable(db, ifNotExists); PipeLocalBeanDao.createTable(db, ifNotExists); } - /** - * Drops underlying database table using DAOs. - */ + /** Drops underlying database table using DAOs. */ public static void dropAllTables(Database db, boolean ifExists) { MapWellLocalBeanDao.dropTable(db, ifExists); NoticeLocaleBeanDao.dropTable(db, ifExists); @@ -86,9 +81,7 @@ } } - /** - * WARNING: Drops all table on Upgrade! Use only during development. - */ + /** WARNING: Drops all table on Upgrade! Use only during development. */ public static class DevOpenHelper extends OpenHelper { public DevOpenHelper(Context context, String name) { super(context, name); diff --git a/app/src/main/java/com/casic/app/smartwell/greendao/DaoSession.java b/app/src/main/java/com/casic/app/smartwell/greendao/DaoSession.java index 0b36d17..3e40e3b 100644 --- a/app/src/main/java/com/casic/app/smartwell/greendao/DaoSession.java +++ b/app/src/main/java/com/casic/app/smartwell/greendao/DaoSession.java @@ -16,7 +16,7 @@ /** * {@inheritDoc} - * + * * @see org.greenrobot.greendao.AbstractDaoSession */ public class DaoSession extends AbstractDaoSession { @@ -50,7 +50,7 @@ registerDao(NoticeLocaleBean.class, noticeLocaleBeanDao); registerDao(PipeLocalBean.class, pipeLocalBeanDao); } - + public void clear() { mapWellLocalBeanDaoConfig.clearIdentityScope(); noticeLocaleBeanDaoConfig.clearIdentityScope(); diff --git a/app/src/main/java/com/casic/app/smartwell/greendao/MapWellLocalBeanDao.java b/app/src/main/java/com/casic/app/smartwell/greendao/MapWellLocalBeanDao.java index 8908fda..407bc92 100644 --- a/app/src/main/java/com/casic/app/smartwell/greendao/MapWellLocalBeanDao.java +++ b/app/src/main/java/com/casic/app/smartwell/greendao/MapWellLocalBeanDao.java @@ -12,10 +12,9 @@ import org.greenrobot.greendao.internal.DaoConfig; // THIS CODE IS GENERATED BY greenDAO, DO NOT EDIT. - -/** +/** * DAO for table "MAP_WELL_LOCAL_BEAN". - */ +*/ public class MapWellLocalBeanDao extends AbstractDao { public static final String TABLENAME = "MAP_WELL_LOCAL_BEAN"; @@ -57,16 +56,14 @@ public MapWellLocalBeanDao(DaoConfig config) { super(config); } - + public MapWellLocalBeanDao(DaoConfig config, DaoSession daoSession) { super(config, daoSession); } - /** - * Creates the underlying database table. - */ + /** Creates the underlying database table. */ public static void createTable(Database db, boolean ifNotExists) { - String constraint = ifNotExists ? "IF NOT EXISTS " : ""; + String constraint = ifNotExists? "IF NOT EXISTS ": ""; db.execSQL("CREATE TABLE " + constraint + "\"MAP_WELL_LOCAL_BEAN\" (" + // "\"_id\" INTEGER PRIMARY KEY AUTOINCREMENT ," + // 0: kId "\"AREA\" TEXT," + // 1: area @@ -96,9 +93,7 @@ "\"WELL_TYPE_NAME\" TEXT);"); // 25: wellTypeName } - /** - * Drops the underlying database table. - */ + /** Drops the underlying database table. */ public static void dropTable(Database db, boolean ifExists) { String sql = "DROP TABLE " + (ifExists ? "IF EXISTS " : "") + "\"MAP_WELL_LOCAL_BEAN\""; db.execSQL(sql); @@ -107,132 +102,132 @@ @Override protected final void bindValues(DatabaseStatement stmt, MapWellLocalBean entity) { stmt.clearBindings(); - + Long kId = entity.getKId(); if (kId != null) { stmt.bindLong(1, kId); } - + String area = entity.getArea(); if (area != null) { stmt.bindString(2, area); } - + String bfzt = entity.getBfzt(); if (bfzt != null) { stmt.bindString(3, bfzt); } - + String bfztName = entity.getBfztName(); if (bfztName != null) { stmt.bindString(4, bfztName); } - + String coordinateX = entity.getCoordinateX(); if (coordinateX != null) { stmt.bindString(5, coordinateX); } - + String coordinateY = entity.getCoordinateY(); if (coordinateY != null) { stmt.bindString(6, coordinateY); } - + String deep = entity.getDeep(); if (deep != null) { stmt.bindString(7, deep); } - + String deptName = entity.getDeptName(); if (deptName != null) { stmt.bindString(8, deptName); } - + String deptid = entity.getDeptid(); if (deptid != null) { stmt.bindString(9, deptid); } - + String id = entity.getId(); if (id != null) { stmt.bindString(10, id); } - + String latBaidu = entity.getLatBaidu(); if (latBaidu != null) { stmt.bindString(11, latBaidu); } - + String latGaode = entity.getLatGaode(); if (latGaode != null) { stmt.bindString(12, latGaode); } - + String lngBaidu = entity.getLngBaidu(); if (lngBaidu != null) { stmt.bindString(13, lngBaidu); } - + String lngGaode = entity.getLngGaode(); if (lngGaode != null) { stmt.bindString(14, lngGaode); } - + String notes = entity.getNotes(); if (notes != null) { stmt.bindString(15, notes); } - + String photos = entity.getPhotos(); if (photos != null) { stmt.bindString(16, photos); } - + String position = entity.getPosition(); if (position != null) { stmt.bindString(17, position); } - + String staff = entity.getStaff(); if (staff != null) { stmt.bindString(18, staff); } - + String tel = entity.getTel(); if (tel != null) { stmt.bindString(19, tel); } - + String ts = entity.getTs(); if (ts != null) { stmt.bindString(20, ts); } - + String valid = entity.getValid(); if (valid != null) { stmt.bindString(21, valid); } - + String watchData = entity.getWatchData(); if (watchData != null) { stmt.bindString(22, watchData); } - + String wellCode = entity.getWellCode(); if (wellCode != null) { stmt.bindString(23, wellCode); } - + String wellName = entity.getWellName(); if (wellName != null) { stmt.bindString(24, wellName); } - + String wellType = entity.getWellType(); if (wellType != null) { stmt.bindString(25, wellType); } - + String wellTypeName = entity.getWellTypeName(); if (wellTypeName != null) { stmt.bindString(26, wellTypeName); @@ -242,132 +237,132 @@ @Override protected final void bindValues(SQLiteStatement stmt, MapWellLocalBean entity) { stmt.clearBindings(); - + Long kId = entity.getKId(); if (kId != null) { stmt.bindLong(1, kId); } - + String area = entity.getArea(); if (area != null) { stmt.bindString(2, area); } - + String bfzt = entity.getBfzt(); if (bfzt != null) { stmt.bindString(3, bfzt); } - + String bfztName = entity.getBfztName(); if (bfztName != null) { stmt.bindString(4, bfztName); } - + String coordinateX = entity.getCoordinateX(); if (coordinateX != null) { stmt.bindString(5, coordinateX); } - + String coordinateY = entity.getCoordinateY(); if (coordinateY != null) { stmt.bindString(6, coordinateY); } - + String deep = entity.getDeep(); if (deep != null) { stmt.bindString(7, deep); } - + String deptName = entity.getDeptName(); if (deptName != null) { stmt.bindString(8, deptName); } - + String deptid = entity.getDeptid(); if (deptid != null) { stmt.bindString(9, deptid); } - + String id = entity.getId(); if (id != null) { stmt.bindString(10, id); } - + String latBaidu = entity.getLatBaidu(); if (latBaidu != null) { stmt.bindString(11, latBaidu); } - + String latGaode = entity.getLatGaode(); if (latGaode != null) { stmt.bindString(12, latGaode); } - + String lngBaidu = entity.getLngBaidu(); if (lngBaidu != null) { stmt.bindString(13, lngBaidu); } - + String lngGaode = entity.getLngGaode(); if (lngGaode != null) { stmt.bindString(14, lngGaode); } - + String notes = entity.getNotes(); if (notes != null) { stmt.bindString(15, notes); } - + String photos = entity.getPhotos(); if (photos != null) { stmt.bindString(16, photos); } - + String position = entity.getPosition(); if (position != null) { stmt.bindString(17, position); } - + String staff = entity.getStaff(); if (staff != null) { stmt.bindString(18, staff); } - + String tel = entity.getTel(); if (tel != null) { stmt.bindString(19, tel); } - + String ts = entity.getTs(); if (ts != null) { stmt.bindString(20, ts); } - + String valid = entity.getValid(); if (valid != null) { stmt.bindString(21, valid); } - + String watchData = entity.getWatchData(); if (watchData != null) { stmt.bindString(22, watchData); } - + String wellCode = entity.getWellCode(); if (wellCode != null) { stmt.bindString(23, wellCode); } - + String wellName = entity.getWellName(); if (wellName != null) { stmt.bindString(24, wellName); } - + String wellType = entity.getWellType(); if (wellType != null) { stmt.bindString(25, wellType); } - + String wellTypeName = entity.getWellTypeName(); if (wellTypeName != null) { stmt.bindString(26, wellTypeName); @@ -377,41 +372,41 @@ @Override public Long readKey(Cursor cursor, int offset) { return cursor.isNull(offset + 0) ? null : cursor.getLong(offset + 0); - } + } @Override public MapWellLocalBean readEntity(Cursor cursor, int offset) { MapWellLocalBean entity = new MapWellLocalBean( // - cursor.isNull(offset + 0) ? null : cursor.getLong(offset + 0), // kId - cursor.isNull(offset + 1) ? null : cursor.getString(offset + 1), // area - cursor.isNull(offset + 2) ? null : cursor.getString(offset + 2), // bfzt - cursor.isNull(offset + 3) ? null : cursor.getString(offset + 3), // bfztName - cursor.isNull(offset + 4) ? null : cursor.getString(offset + 4), // coordinateX - cursor.isNull(offset + 5) ? null : cursor.getString(offset + 5), // coordinateY - cursor.isNull(offset + 6) ? null : cursor.getString(offset + 6), // deep - cursor.isNull(offset + 7) ? null : cursor.getString(offset + 7), // deptName - cursor.isNull(offset + 8) ? null : cursor.getString(offset + 8), // deptid - cursor.isNull(offset + 9) ? null : cursor.getString(offset + 9), // id - cursor.isNull(offset + 10) ? null : cursor.getString(offset + 10), // latBaidu - cursor.isNull(offset + 11) ? null : cursor.getString(offset + 11), // latGaode - cursor.isNull(offset + 12) ? null : cursor.getString(offset + 12), // lngBaidu - cursor.isNull(offset + 13) ? null : cursor.getString(offset + 13), // lngGaode - cursor.isNull(offset + 14) ? null : cursor.getString(offset + 14), // notes - cursor.isNull(offset + 15) ? null : cursor.getString(offset + 15), // photos - cursor.isNull(offset + 16) ? null : cursor.getString(offset + 16), // position - cursor.isNull(offset + 17) ? null : cursor.getString(offset + 17), // staff - cursor.isNull(offset + 18) ? null : cursor.getString(offset + 18), // tel - cursor.isNull(offset + 19) ? null : cursor.getString(offset + 19), // ts - cursor.isNull(offset + 20) ? null : cursor.getString(offset + 20), // valid - cursor.isNull(offset + 21) ? null : cursor.getString(offset + 21), // watchData - cursor.isNull(offset + 22) ? null : cursor.getString(offset + 22), // wellCode - cursor.isNull(offset + 23) ? null : cursor.getString(offset + 23), // wellName - cursor.isNull(offset + 24) ? null : cursor.getString(offset + 24), // wellType - cursor.isNull(offset + 25) ? null : cursor.getString(offset + 25) // wellTypeName + cursor.isNull(offset + 0) ? null : cursor.getLong(offset + 0), // kId + cursor.isNull(offset + 1) ? null : cursor.getString(offset + 1), // area + cursor.isNull(offset + 2) ? null : cursor.getString(offset + 2), // bfzt + cursor.isNull(offset + 3) ? null : cursor.getString(offset + 3), // bfztName + cursor.isNull(offset + 4) ? null : cursor.getString(offset + 4), // coordinateX + cursor.isNull(offset + 5) ? null : cursor.getString(offset + 5), // coordinateY + cursor.isNull(offset + 6) ? null : cursor.getString(offset + 6), // deep + cursor.isNull(offset + 7) ? null : cursor.getString(offset + 7), // deptName + cursor.isNull(offset + 8) ? null : cursor.getString(offset + 8), // deptid + cursor.isNull(offset + 9) ? null : cursor.getString(offset + 9), // id + cursor.isNull(offset + 10) ? null : cursor.getString(offset + 10), // latBaidu + cursor.isNull(offset + 11) ? null : cursor.getString(offset + 11), // latGaode + cursor.isNull(offset + 12) ? null : cursor.getString(offset + 12), // lngBaidu + cursor.isNull(offset + 13) ? null : cursor.getString(offset + 13), // lngGaode + cursor.isNull(offset + 14) ? null : cursor.getString(offset + 14), // notes + cursor.isNull(offset + 15) ? null : cursor.getString(offset + 15), // photos + cursor.isNull(offset + 16) ? null : cursor.getString(offset + 16), // position + cursor.isNull(offset + 17) ? null : cursor.getString(offset + 17), // staff + cursor.isNull(offset + 18) ? null : cursor.getString(offset + 18), // tel + cursor.isNull(offset + 19) ? null : cursor.getString(offset + 19), // ts + cursor.isNull(offset + 20) ? null : cursor.getString(offset + 20), // valid + cursor.isNull(offset + 21) ? null : cursor.getString(offset + 21), // watchData + cursor.isNull(offset + 22) ? null : cursor.getString(offset + 22), // wellCode + cursor.isNull(offset + 23) ? null : cursor.getString(offset + 23), // wellName + cursor.isNull(offset + 24) ? null : cursor.getString(offset + 24), // wellType + cursor.isNull(offset + 25) ? null : cursor.getString(offset + 25) // wellTypeName ); return entity; } - + @Override public void readEntity(Cursor cursor, MapWellLocalBean entity, int offset) { entity.setKId(cursor.isNull(offset + 0) ? null : cursor.getLong(offset + 0)); @@ -440,17 +435,17 @@ entity.setWellName(cursor.isNull(offset + 23) ? null : cursor.getString(offset + 23)); entity.setWellType(cursor.isNull(offset + 24) ? null : cursor.getString(offset + 24)); entity.setWellTypeName(cursor.isNull(offset + 25) ? null : cursor.getString(offset + 25)); - } - + } + @Override protected final Long updateKeyAfterInsert(MapWellLocalBean entity, long rowId) { entity.setKId(rowId); return rowId; } - + @Override public Long getKey(MapWellLocalBean entity) { - if (entity != null) { + if(entity != null) { return entity.getKId(); } else { return null; @@ -466,5 +461,5 @@ protected final boolean isEntityUpdateable() { return true; } - + } diff --git a/app/src/main/java/com/casic/app/smartwell/greendao/NoticeLocaleBeanDao.java b/app/src/main/java/com/casic/app/smartwell/greendao/NoticeLocaleBeanDao.java index 64312ed..deb2d49 100644 --- a/app/src/main/java/com/casic/app/smartwell/greendao/NoticeLocaleBeanDao.java +++ b/app/src/main/java/com/casic/app/smartwell/greendao/NoticeLocaleBeanDao.java @@ -12,10 +12,9 @@ import org.greenrobot.greendao.internal.DaoConfig; // THIS CODE IS GENERATED BY greenDAO, DO NOT EDIT. - -/** +/** * DAO for table "NOTICE_LOCALE_BEAN". - */ +*/ public class NoticeLocaleBeanDao extends AbstractDao { public static final String TABLENAME = "NOTICE_LOCALE_BEAN"; @@ -43,16 +42,14 @@ public NoticeLocaleBeanDao(DaoConfig config) { super(config); } - + public NoticeLocaleBeanDao(DaoConfig config, DaoSession daoSession) { super(config, daoSession); } - /** - * Creates the underlying database table. - */ + /** Creates the underlying database table. */ public static void createTable(Database db, boolean ifNotExists) { - String constraint = ifNotExists ? "IF NOT EXISTS " : ""; + String constraint = ifNotExists? "IF NOT EXISTS ": ""; db.execSQL("CREATE TABLE " + constraint + "\"NOTICE_LOCALE_BEAN\" (" + // "\"_id\" INTEGER PRIMARY KEY AUTOINCREMENT ," + // 0: id "\"MESSAGE_ID\" TEXT UNIQUE ," + // 1: messageId @@ -68,9 +65,7 @@ "\"NOTICE_TIME\" TEXT);"); // 11: noticeTime } - /** - * Drops the underlying database table. - */ + /** Drops the underlying database table. */ public static void dropTable(Database db, boolean ifExists) { String sql = "DROP TABLE " + (ifExists ? "IF EXISTS " : "") + "\"NOTICE_LOCALE_BEAN\""; db.execSQL(sql); @@ -79,62 +74,62 @@ @Override protected final void bindValues(DatabaseStatement stmt, NoticeLocaleBean entity) { stmt.clearBindings(); - + Long id = entity.getId(); if (id != null) { stmt.bindLong(1, id); } - + String messageId = entity.getMessageId(); if (messageId != null) { stmt.bindString(2, messageId); } - + String appid = entity.getAppid(); if (appid != null) { stmt.bindString(3, appid); } - + String clientId = entity.getClientId(); if (clientId != null) { stmt.bindString(4, clientId); } - + String taskId = entity.getTaskId(); if (taskId != null) { stmt.bindString(5, taskId); } - + String userId = entity.getUserId(); if (userId != null) { stmt.bindString(6, userId); } - + String title = entity.getTitle(); if (title != null) { stmt.bindString(7, title); } - + String content = entity.getContent(); if (content != null) { stmt.bindString(8, content); } - + String deviceCode = entity.getDeviceCode(); if (deviceCode != null) { stmt.bindString(9, deviceCode); } - + String jobId = entity.getJobId(); if (jobId != null) { stmt.bindString(10, jobId); } - + String isRead = entity.getIsRead(); if (isRead != null) { stmt.bindString(11, isRead); } - + String noticeTime = entity.getNoticeTime(); if (noticeTime != null) { stmt.bindString(12, noticeTime); @@ -144,62 +139,62 @@ @Override protected final void bindValues(SQLiteStatement stmt, NoticeLocaleBean entity) { stmt.clearBindings(); - + Long id = entity.getId(); if (id != null) { stmt.bindLong(1, id); } - + String messageId = entity.getMessageId(); if (messageId != null) { stmt.bindString(2, messageId); } - + String appid = entity.getAppid(); if (appid != null) { stmt.bindString(3, appid); } - + String clientId = entity.getClientId(); if (clientId != null) { stmt.bindString(4, clientId); } - + String taskId = entity.getTaskId(); if (taskId != null) { stmt.bindString(5, taskId); } - + String userId = entity.getUserId(); if (userId != null) { stmt.bindString(6, userId); } - + String title = entity.getTitle(); if (title != null) { stmt.bindString(7, title); } - + String content = entity.getContent(); if (content != null) { stmt.bindString(8, content); } - + String deviceCode = entity.getDeviceCode(); if (deviceCode != null) { stmt.bindString(9, deviceCode); } - + String jobId = entity.getJobId(); if (jobId != null) { stmt.bindString(10, jobId); } - + String isRead = entity.getIsRead(); if (isRead != null) { stmt.bindString(11, isRead); } - + String noticeTime = entity.getNoticeTime(); if (noticeTime != null) { stmt.bindString(12, noticeTime); @@ -209,27 +204,27 @@ @Override public Long readKey(Cursor cursor, int offset) { return cursor.isNull(offset + 0) ? null : cursor.getLong(offset + 0); - } + } @Override public NoticeLocaleBean readEntity(Cursor cursor, int offset) { NoticeLocaleBean entity = new NoticeLocaleBean( // - cursor.isNull(offset + 0) ? null : cursor.getLong(offset + 0), // id - cursor.isNull(offset + 1) ? null : cursor.getString(offset + 1), // messageId - cursor.isNull(offset + 2) ? null : cursor.getString(offset + 2), // appid - cursor.isNull(offset + 3) ? null : cursor.getString(offset + 3), // clientId - cursor.isNull(offset + 4) ? null : cursor.getString(offset + 4), // taskId - cursor.isNull(offset + 5) ? null : cursor.getString(offset + 5), // userId - cursor.isNull(offset + 6) ? null : cursor.getString(offset + 6), // title - cursor.isNull(offset + 7) ? null : cursor.getString(offset + 7), // content - cursor.isNull(offset + 8) ? null : cursor.getString(offset + 8), // deviceCode - cursor.isNull(offset + 9) ? null : cursor.getString(offset + 9), // jobId - cursor.isNull(offset + 10) ? null : cursor.getString(offset + 10), // isRead - cursor.isNull(offset + 11) ? null : cursor.getString(offset + 11) // noticeTime + cursor.isNull(offset + 0) ? null : cursor.getLong(offset + 0), // id + cursor.isNull(offset + 1) ? null : cursor.getString(offset + 1), // messageId + cursor.isNull(offset + 2) ? null : cursor.getString(offset + 2), // appid + cursor.isNull(offset + 3) ? null : cursor.getString(offset + 3), // clientId + cursor.isNull(offset + 4) ? null : cursor.getString(offset + 4), // taskId + cursor.isNull(offset + 5) ? null : cursor.getString(offset + 5), // userId + cursor.isNull(offset + 6) ? null : cursor.getString(offset + 6), // title + cursor.isNull(offset + 7) ? null : cursor.getString(offset + 7), // content + cursor.isNull(offset + 8) ? null : cursor.getString(offset + 8), // deviceCode + cursor.isNull(offset + 9) ? null : cursor.getString(offset + 9), // jobId + cursor.isNull(offset + 10) ? null : cursor.getString(offset + 10), // isRead + cursor.isNull(offset + 11) ? null : cursor.getString(offset + 11) // noticeTime ); return entity; } - + @Override public void readEntity(Cursor cursor, NoticeLocaleBean entity, int offset) { entity.setId(cursor.isNull(offset + 0) ? null : cursor.getLong(offset + 0)); @@ -244,17 +239,17 @@ entity.setJobId(cursor.isNull(offset + 9) ? null : cursor.getString(offset + 9)); entity.setIsRead(cursor.isNull(offset + 10) ? null : cursor.getString(offset + 10)); entity.setNoticeTime(cursor.isNull(offset + 11) ? null : cursor.getString(offset + 11)); - } - + } + @Override protected final Long updateKeyAfterInsert(NoticeLocaleBean entity, long rowId) { entity.setId(rowId); return rowId; } - + @Override public Long getKey(NoticeLocaleBean entity) { - if (entity != null) { + if(entity != null) { return entity.getId(); } else { return null; @@ -270,5 +265,5 @@ protected final boolean isEntityUpdateable() { return true; } - + } diff --git a/app/src/main/java/com/casic/app/smartwell/greendao/PipeLocalBeanDao.java b/app/src/main/java/com/casic/app/smartwell/greendao/PipeLocalBeanDao.java index aab4d3f..df5515a 100644 --- a/app/src/main/java/com/casic/app/smartwell/greendao/PipeLocalBeanDao.java +++ b/app/src/main/java/com/casic/app/smartwell/greendao/PipeLocalBeanDao.java @@ -12,10 +12,9 @@ import org.greenrobot.greendao.internal.DaoConfig; // THIS CODE IS GENERATED BY greenDAO, DO NOT EDIT. - -/** +/** * DAO for table "PIPE_LOCAL_BEAN". - */ +*/ public class PipeLocalBeanDao extends AbstractDao { public static final String TABLENAME = "PIPE_LOCAL_BEAN"; @@ -37,16 +36,14 @@ public PipeLocalBeanDao(DaoConfig config) { super(config); } - + public PipeLocalBeanDao(DaoConfig config, DaoSession daoSession) { super(config, daoSession); } - /** - * Creates the underlying database table. - */ + /** Creates the underlying database table. */ public static void createTable(Database db, boolean ifNotExists) { - String constraint = ifNotExists ? "IF NOT EXISTS " : ""; + String constraint = ifNotExists? "IF NOT EXISTS ": ""; db.execSQL("CREATE TABLE " + constraint + "\"PIPE_LOCAL_BEAN\" (" + // "\"_id\" INTEGER PRIMARY KEY AUTOINCREMENT ," + // 0: id "\"PIPE_CODE\" TEXT," + // 1: pipeCode @@ -56,9 +53,7 @@ "\"START_LONGITUDE_GD\" TEXT);"); // 5: startLongitudeGd } - /** - * Drops the underlying database table. - */ + /** Drops the underlying database table. */ public static void dropTable(Database db, boolean ifExists) { String sql = "DROP TABLE " + (ifExists ? "IF EXISTS " : "") + "\"PIPE_LOCAL_BEAN\""; db.execSQL(sql); @@ -67,32 +62,32 @@ @Override protected final void bindValues(DatabaseStatement stmt, PipeLocalBean entity) { stmt.clearBindings(); - + Long id = entity.getId(); if (id != null) { stmt.bindLong(1, id); } - + String pipeCode = entity.getPipeCode(); if (pipeCode != null) { stmt.bindString(2, pipeCode); } - + String endLatitudeGd = entity.getEndLatitudeGd(); if (endLatitudeGd != null) { stmt.bindString(3, endLatitudeGd); } - + String endLongitudeGd = entity.getEndLongitudeGd(); if (endLongitudeGd != null) { stmt.bindString(4, endLongitudeGd); } - + String startLatitudeGd = entity.getStartLatitudeGd(); if (startLatitudeGd != null) { stmt.bindString(5, startLatitudeGd); } - + String startLongitudeGd = entity.getStartLongitudeGd(); if (startLongitudeGd != null) { stmt.bindString(6, startLongitudeGd); @@ -102,32 +97,32 @@ @Override protected final void bindValues(SQLiteStatement stmt, PipeLocalBean entity) { stmt.clearBindings(); - + Long id = entity.getId(); if (id != null) { stmt.bindLong(1, id); } - + String pipeCode = entity.getPipeCode(); if (pipeCode != null) { stmt.bindString(2, pipeCode); } - + String endLatitudeGd = entity.getEndLatitudeGd(); if (endLatitudeGd != null) { stmt.bindString(3, endLatitudeGd); } - + String endLongitudeGd = entity.getEndLongitudeGd(); if (endLongitudeGd != null) { stmt.bindString(4, endLongitudeGd); } - + String startLatitudeGd = entity.getStartLatitudeGd(); if (startLatitudeGd != null) { stmt.bindString(5, startLatitudeGd); } - + String startLongitudeGd = entity.getStartLongitudeGd(); if (startLongitudeGd != null) { stmt.bindString(6, startLongitudeGd); @@ -137,21 +132,21 @@ @Override public Long readKey(Cursor cursor, int offset) { return cursor.isNull(offset + 0) ? null : cursor.getLong(offset + 0); - } + } @Override public PipeLocalBean readEntity(Cursor cursor, int offset) { PipeLocalBean entity = new PipeLocalBean( // - cursor.isNull(offset + 0) ? null : cursor.getLong(offset + 0), // id - cursor.isNull(offset + 1) ? null : cursor.getString(offset + 1), // pipeCode - cursor.isNull(offset + 2) ? null : cursor.getString(offset + 2), // endLatitudeGd - cursor.isNull(offset + 3) ? null : cursor.getString(offset + 3), // endLongitudeGd - cursor.isNull(offset + 4) ? null : cursor.getString(offset + 4), // startLatitudeGd - cursor.isNull(offset + 5) ? null : cursor.getString(offset + 5) // startLongitudeGd + cursor.isNull(offset + 0) ? null : cursor.getLong(offset + 0), // id + cursor.isNull(offset + 1) ? null : cursor.getString(offset + 1), // pipeCode + cursor.isNull(offset + 2) ? null : cursor.getString(offset + 2), // endLatitudeGd + cursor.isNull(offset + 3) ? null : cursor.getString(offset + 3), // endLongitudeGd + cursor.isNull(offset + 4) ? null : cursor.getString(offset + 4), // startLatitudeGd + cursor.isNull(offset + 5) ? null : cursor.getString(offset + 5) // startLongitudeGd ); return entity; } - + @Override public void readEntity(Cursor cursor, PipeLocalBean entity, int offset) { entity.setId(cursor.isNull(offset + 0) ? null : cursor.getLong(offset + 0)); @@ -160,17 +155,17 @@ entity.setEndLongitudeGd(cursor.isNull(offset + 3) ? null : cursor.getString(offset + 3)); entity.setStartLatitudeGd(cursor.isNull(offset + 4) ? null : cursor.getString(offset + 4)); entity.setStartLongitudeGd(cursor.isNull(offset + 5) ? null : cursor.getString(offset + 5)); - } - + } + @Override protected final Long updateKeyAfterInsert(PipeLocalBean entity, long rowId) { entity.setId(rowId); return rowId; } - + @Override public Long getKey(PipeLocalBean entity) { - if (entity != null) { + if(entity != null) { return entity.getId(); } else { return null; @@ -186,5 +181,5 @@ protected final boolean isEntityUpdateable() { return true; } - + } diff --git a/app/src/main/java/com/casic/app/smartwell/view/ChangePasswordActivity.kt b/app/src/main/java/com/casic/app/smartwell/view/ChangePasswordActivity.kt index 8e41039..9f1dd40 100644 --- a/app/src/main/java/com/casic/app/smartwell/view/ChangePasswordActivity.kt +++ b/app/src/main/java/com/casic/app/smartwell/view/ChangePasswordActivity.kt @@ -14,7 +14,7 @@ import com.pengxh.kt.lite.extensions.show import com.pengxh.kt.lite.utils.ActivityStackManager import com.pengxh.kt.lite.utils.LoadState -import com.pengxh.kt.lite.utils.LoadingDialogHub +import com.pengxh.kt.lite.utils.LoadingDialog import com.pengxh.kt.lite.widget.TitleBarView import java.nio.charset.StandardCharsets @@ -46,15 +46,15 @@ override fun observeRequestState() { userViewModel.loadState.observe(this) { when (it) { - is LoadState.Loading -> LoadingDialogHub.show(this, "修改中,请稍后") + is LoadState.Loading -> LoadingDialog.show(this, "修改中,请稍后") is LoadState.Success -> { - LoadingDialogHub.dismiss() + LoadingDialog.dismiss() AuthenticationHelper.removeToken() this.navigatePageTo() ActivityStackManager.finishAllActivity() } - else -> LoadingDialogHub.dismiss() + else -> LoadingDialog.dismiss() } } } diff --git a/app/src/main/java/com/casic/app/smartwell/view/DeployedWellActivity.kt b/app/src/main/java/com/casic/app/smartwell/view/DeployedWellActivity.kt index fb4339c..28a5078 100644 --- a/app/src/main/java/com/casic/app/smartwell/view/DeployedWellActivity.kt +++ b/app/src/main/java/com/casic/app/smartwell/view/DeployedWellActivity.kt @@ -83,8 +83,8 @@ } //添加分割线 - binding.deployedListView.addItemDecoration( - RecyclerViewItemOffsets(0, 5, 0, 5) + binding.recyclerView.addItemDecoration( + RecyclerViewItemOffsets(0, 7, 0, 7) ) } @@ -149,12 +149,11 @@ } else { item.deep.toString() + "m" } - viewHolder.setText(R.id.wellNameView, item.wellName) + viewHolder.setText(R.id.wellTypeView, item.wellTypeName) .setText(R.id.wellDepthView, "深:${deep}") .setText(R.id.wellCodeView, "点位编号:${item.wellCode}") - .setText(R.id.wellTypeView, "点位类型:${item.wellTypeName}") .setText(R.id.ownerShipView, "权属单位:${item.deptName}") - .setText(R.id.wellLocationView, "点位置:${item.position}") + .setText(R.id.wellLocationView, "点位位置:${item.position}") .setOnClickListener( R.id.operationButton, object : View.OnClickListener { override fun onClick(v: View?) { @@ -207,7 +206,7 @@ }) } } - binding.deployedListView.adapter = deployAdapter + binding.recyclerView.adapter = deployAdapter deployAdapter.setOnItemClickedListener(object : NormalRecyclerAdapter.OnItemClickedListener { override fun onItemClicked(position: Int, t: WellListModel.DataBean.RowsBean) { diff --git a/app/src/main/java/com/casic/app/smartwell/view/LoginActivity.kt b/app/src/main/java/com/casic/app/smartwell/view/LoginActivity.kt index e4bb0e3..834527b 100644 --- a/app/src/main/java/com/casic/app/smartwell/view/LoginActivity.kt +++ b/app/src/main/java/com/casic/app/smartwell/view/LoginActivity.kt @@ -21,7 +21,7 @@ import com.pengxh.kt.lite.extensions.navigatePageTo import com.pengxh.kt.lite.extensions.readAssetsFile import com.pengxh.kt.lite.extensions.show -import com.pengxh.kt.lite.utils.LoadingDialogHub +import com.pengxh.kt.lite.utils.LoadingDialog import com.pengxh.kt.lite.utils.SaveKeyValues import kotlinx.coroutines.Dispatchers import kotlinx.coroutines.launch @@ -106,11 +106,11 @@ override fun observeRequestState() { authenticateViewModel.loadState.observe(this) { - LoadingDialogHub.show(this, "登录中,请稍后") + LoadingDialog.show(this, "登录中,请稍后") } loginViewModel.loadState.observe(this) { - LoadingDialogHub.dismiss() + LoadingDialog.dismiss() } } diff --git a/app/src/main/java/com/casic/app/smartwell/view/OrderCompletedDetailActivity.kt b/app/src/main/java/com/casic/app/smartwell/view/OrderCompletedDetailActivity.kt index db8ad1f..75cd905 100644 --- a/app/src/main/java/com/casic/app/smartwell/view/OrderCompletedDetailActivity.kt +++ b/app/src/main/java/com/casic/app/smartwell/view/OrderCompletedDetailActivity.kt @@ -17,7 +17,7 @@ import com.pengxh.kt.lite.extensions.show import com.pengxh.kt.lite.utils.Constant import com.pengxh.kt.lite.utils.LoadState -import com.pengxh.kt.lite.utils.LoadingDialogHub +import com.pengxh.kt.lite.utils.LoadingDialog import com.pengxh.kt.lite.widget.TitleBarView import com.pengxh.kt.lite.widget.dialog.AlertMessageDialog @@ -44,7 +44,7 @@ } override fun initOnCreate(savedInstanceState: Bundle?) { - val jobId = intent.getStringExtra(Constant.INTENT_PARAM)!! + val jobId = intent.getStringExtra(Constant.INTENT_PARAM_KEY)!! orderViewModel = ViewModelProvider(this)[OrderViewModel::class.java] orderViewModel.getWorkOrderDetail(jobId) orderViewModel.detailModel.observe(this) { @@ -154,8 +154,8 @@ override fun observeRequestState() { orderViewModel.loadState.observe(this) { when (it) { - is LoadState.Loading -> LoadingDialogHub.show(this, "数据加载中,请稍后") - else -> LoadingDialogHub.dismiss() + is LoadState.Loading -> LoadingDialog.show(this, "数据加载中,请稍后") + else -> LoadingDialog.dismiss() } } } diff --git a/app/src/main/java/com/casic/app/smartwell/view/OrderInHandleDetailActivity.kt b/app/src/main/java/com/casic/app/smartwell/view/OrderInHandleDetailActivity.kt index d70a979..04a7d5d 100644 --- a/app/src/main/java/com/casic/app/smartwell/view/OrderInHandleDetailActivity.kt +++ b/app/src/main/java/com/casic/app/smartwell/view/OrderInHandleDetailActivity.kt @@ -38,7 +38,7 @@ import com.pengxh.kt.lite.extensions.show import com.pengxh.kt.lite.utils.Constant import com.pengxh.kt.lite.utils.LoadState -import com.pengxh.kt.lite.utils.LoadingDialogHub +import com.pengxh.kt.lite.utils.LoadingDialog import com.pengxh.kt.lite.widget.TitleBarView import com.pengxh.kt.lite.widget.dialog.AlertControlDialog import com.pengxh.kt.lite.widget.dialog.AlertMessageDialog @@ -93,7 +93,7 @@ ) binding.addImageRecyclerView.adapter = imageAdapter - val jobId = intent.getStringExtra(Constant.INTENT_PARAM)!!//初始化图片九宫格 + val jobId = intent.getStringExtra(Constant.INTENT_PARAM_KEY)!!//初始化图片九宫格 orderViewModel.getWorkOrderDetail(jobId) orderViewModel.detailModel.observe(this) { if (it.code == 200) { @@ -312,41 +312,41 @@ override fun observeRequestState() { orderViewModel.loadState.observe(this) { when (it) { - is LoadState.Loading -> LoadingDialogHub.show(this, "数据加载中,请稍后") - else -> LoadingDialogHub.dismiss() + is LoadState.Loading -> LoadingDialog.show(this, "数据加载中,请稍后") + else -> LoadingDialog.dismiss() } } uploadImageViewModel.loadState.observe(this) { when (it) { - LoadState.Loading -> LoadingDialogHub.show(this, "图片上传中,请稍后...") - else -> LoadingDialogHub.dismiss() + LoadState.Loading -> LoadingDialog.show(this, "图片上传中,请稍后...") + else -> LoadingDialog.dismiss() } } //转单状态处理 operationViewModel.loadState.observe(this) { when (it) { - is LoadState.Loading -> LoadingDialogHub.show(this, "转单中,请稍后") + is LoadState.Loading -> LoadingDialog.show(this, "转单中,请稍后") is LoadState.Success -> { - LoadingDialogHub.dismiss() + LoadingDialog.dismiss() this.finish() } - else -> LoadingDialogHub.dismiss() + else -> LoadingDialog.dismiss() } } //处理完成工单状态处理 operationViewModel.loadState.observe(this) { when (it) { - is LoadState.Loading -> LoadingDialogHub.show(this, "处理中,请稍后") + is LoadState.Loading -> LoadingDialog.show(this, "处理中,请稍后") is LoadState.Success -> { - LoadingDialogHub.dismiss() + LoadingDialog.dismiss() this.finish() } - else -> LoadingDialogHub.dismiss() + else -> LoadingDialog.dismiss() } } } diff --git a/app/src/main/java/com/casic/app/smartwell/view/OrderNotConfirmedDetailActivity.kt b/app/src/main/java/com/casic/app/smartwell/view/OrderNotConfirmedDetailActivity.kt index 8e036d2..687ec86 100644 --- a/app/src/main/java/com/casic/app/smartwell/view/OrderNotConfirmedDetailActivity.kt +++ b/app/src/main/java/com/casic/app/smartwell/view/OrderNotConfirmedDetailActivity.kt @@ -36,7 +36,7 @@ import com.pengxh.kt.lite.extensions.show import com.pengxh.kt.lite.utils.Constant import com.pengxh.kt.lite.utils.LoadState -import com.pengxh.kt.lite.utils.LoadingDialogHub +import com.pengxh.kt.lite.utils.LoadingDialog import com.pengxh.kt.lite.widget.TitleBarView import com.pengxh.kt.lite.widget.dialog.AlertControlDialog import com.pengxh.kt.lite.widget.dialog.AlertMessageDialog @@ -80,7 +80,7 @@ } override fun initOnCreate(savedInstanceState: Bundle?) { - val jobId = intent.getStringExtra(Constant.INTENT_PARAM)!! + val jobId = intent.getStringExtra(Constant.INTENT_PARAM_KEY)!! //初始化图片九宫格 //左外边距,左内边距,右内边距,右外边距 val viewWidth = getScreenWidth() - (10 + 10 + 10 + 10).dp2px(this) @@ -263,41 +263,41 @@ //数据加载状态处理 orderViewModel.loadState.observe(this) { when (it) { - is LoadState.Loading -> LoadingDialogHub.show(this, "数据加载中,请稍后") - else -> LoadingDialogHub.dismiss() + is LoadState.Loading -> LoadingDialog.show(this, "数据加载中,请稍后") + else -> LoadingDialog.dismiss() } } uploadImageViewModel.loadState.observe(this) { when (it) { - LoadState.Loading -> LoadingDialogHub.show(this, "图片上传中,请稍后") - else -> LoadingDialogHub.dismiss() + LoadState.Loading -> LoadingDialog.show(this, "图片上传中,请稍后") + else -> LoadingDialog.dismiss() } } //转单状态处理 operationViewModel.loadState.observe(this) { when (it) { - is LoadState.Loading -> LoadingDialogHub.show(this, "转单中,请稍后") + is LoadState.Loading -> LoadingDialog.show(this, "转单中,请稍后") is LoadState.Success -> { - LoadingDialogHub.dismiss() + LoadingDialog.dismiss() this.finish() } - else -> LoadingDialogHub.dismiss() + else -> LoadingDialog.dismiss() } } //确认工单状态处理 operationViewModel.loadState.observe(this) { when (it) { - is LoadState.Loading -> LoadingDialogHub.show(this, "处理中,请稍后") + is LoadState.Loading -> LoadingDialog.show(this, "处理中,请稍后") is LoadState.Success -> { - LoadingDialogHub.dismiss() + LoadingDialog.dismiss() this.finish() } - else -> LoadingDialogHub.dismiss() + else -> LoadingDialog.dismiss() } } } diff --git a/app/src/main/java/com/casic/app/smartwell/view/OrderNotProcessedDetailActivity.kt b/app/src/main/java/com/casic/app/smartwell/view/OrderNotProcessedDetailActivity.kt index d3f22dc..0c97a52 100644 --- a/app/src/main/java/com/casic/app/smartwell/view/OrderNotProcessedDetailActivity.kt +++ b/app/src/main/java/com/casic/app/smartwell/view/OrderNotProcessedDetailActivity.kt @@ -18,7 +18,7 @@ import com.pengxh.kt.lite.extensions.show import com.pengxh.kt.lite.utils.Constant import com.pengxh.kt.lite.utils.LoadState -import com.pengxh.kt.lite.utils.LoadingDialogHub +import com.pengxh.kt.lite.utils.LoadingDialog import com.pengxh.kt.lite.widget.TitleBarView import com.pengxh.kt.lite.widget.dialog.AlertControlDialog import com.pengxh.kt.lite.widget.dialog.AlertMessageDialog @@ -50,7 +50,7 @@ } override fun initOnCreate(savedInstanceState: Bundle?) { - this.jobId = intent.getStringExtra(Constant.INTENT_PARAM)!! + this.jobId = intent.getStringExtra(Constant.INTENT_PARAM_KEY)!! orderViewModel = ViewModelProvider(this)[OrderViewModel::class.java] operationViewModel = ViewModelProvider(this)[OperationViewModel::class.java] wellViewModel = ViewModelProvider(this)[WellViewModel::class.java] @@ -162,21 +162,21 @@ //数据加载状态处理 orderViewModel.loadState.observe(this) { when (it) { - is LoadState.Loading -> LoadingDialogHub.show(this, "数据加载中,请稍后") - else -> LoadingDialogHub.dismiss() + is LoadState.Loading -> LoadingDialog.show(this, "数据加载中,请稍后") + else -> LoadingDialog.dismiss() } } //接单状态处理 operationViewModel.loadState.observe(this) { when (it) { - is LoadState.Loading -> LoadingDialogHub.show(this, "接单中,请稍后") + is LoadState.Loading -> LoadingDialog.show(this, "接单中,请稍后") is LoadState.Success -> { - LoadingDialogHub.dismiss() + LoadingDialog.dismiss() this.finish() } - else -> LoadingDialogHub.dismiss() + else -> LoadingDialog.dismiss() } } } diff --git a/app/src/main/java/com/casic/app/smartwell/view/SearchResultActivity.kt b/app/src/main/java/com/casic/app/smartwell/view/SearchResultActivity.kt index 6a92917..4f3a674 100644 --- a/app/src/main/java/com/casic/app/smartwell/view/SearchResultActivity.kt +++ b/app/src/main/java/com/casic/app/smartwell/view/SearchResultActivity.kt @@ -19,7 +19,7 @@ import com.pengxh.kt.lite.extensions.show import com.pengxh.kt.lite.utils.Constant import com.pengxh.kt.lite.utils.LoadState -import com.pengxh.kt.lite.utils.LoadingDialogHub +import com.pengxh.kt.lite.utils.LoadingDialog import com.pengxh.kt.lite.utils.WeakReferenceHandler import com.pengxh.kt.lite.widget.TitleBarView import com.pengxh.kt.lite.widget.dialog.AlertControlDialog @@ -56,7 +56,7 @@ } override fun initOnCreate(savedInstanceState: Bundle?) { - args = intent.getStringArrayListExtra(Constant.INTENT_PARAM)!! + args = intent.getStringArrayListExtra(Constant.INTENT_PARAM_KEY)!! orderViewModel = ViewModelProvider(this)[OrderViewModel::class.java] operationViewModel = ViewModelProvider(this)[OperationViewModel::class.java] @@ -101,24 +101,24 @@ } } - binding.resultRecyclerView.addItemDecoration( - RecyclerViewItemOffsets(0, 5, 0, 5) + binding.recyclerView.addItemDecoration( + RecyclerViewItemOffsets(0, 7, 0, 7) ) } override fun observeRequestState() { orderViewModel.loadState.observe(this) { when (it) { - is LoadState.Loading -> LoadingDialogHub.show(this, "数据加载中,请稍后") - else -> LoadingDialogHub.dismiss() + is LoadState.Loading -> LoadingDialog.show(this, "数据加载中,请稍后") + else -> LoadingDialog.dismiss() } } //接单状态处理 operationViewModel.loadState.observe(this) { when (it) { - is LoadState.Loading -> LoadingDialogHub.show(this, "接单中,请稍后") + is LoadState.Loading -> LoadingDialog.show(this, "接单中,请稍后") is LoadState.Success -> { - LoadingDialogHub.dismiss() + LoadingDialog.dismiss() //接单成功之后刷新列表 dataBeans.removeAt(clickedPosition) searchResultAdapter.notifyItemRemoved(clickedPosition) @@ -127,7 +127,7 @@ ) } - else -> LoadingDialogHub.dismiss() + else -> LoadingDialog.dismiss() } } } @@ -162,7 +162,7 @@ } else { binding.emptyInclude.emptyView.hide() searchResultAdapter = SearchResultAdapter(this, dataBeans) - binding.resultRecyclerView.adapter = searchResultAdapter + binding.recyclerView.adapter = searchResultAdapter searchResultAdapter.setOnItemClickListener(object : SearchResultAdapter.OnItemClickListener { override fun onClicked(position: Int) { diff --git a/app/src/main/java/com/casic/app/smartwell/view/UnDeployWellActivity.kt b/app/src/main/java/com/casic/app/smartwell/view/UnDeployWellActivity.kt index 7f7cd3c..555c278 100644 --- a/app/src/main/java/com/casic/app/smartwell/view/UnDeployWellActivity.kt +++ b/app/src/main/java/com/casic/app/smartwell/view/UnDeployWellActivity.kt @@ -81,8 +81,8 @@ } } - binding.undeployListView.addItemDecoration( - RecyclerViewItemOffsets(0, 5, 0, 5) + binding.recyclerView.addItemDecoration( + RecyclerViewItemOffsets(0, 7, 0, 7) ) } @@ -147,12 +147,11 @@ } else { item.deep.toString() + "m" } - viewHolder.setText(R.id.wellNameView, item.wellName) + viewHolder.setText(R.id.wellTypeView, item.wellTypeName) .setText(R.id.wellDepthView, "深:${deep}") .setText(R.id.wellCodeView, "点位编号:${item.wellCode}") - .setText(R.id.wellTypeView, "点位类型:${item.wellTypeName}") .setText(R.id.ownerShipView, "权属单位:${item.deptName}") - .setText(R.id.wellLocationView, "点位置:${item.position}") + .setText(R.id.wellLocationView, "点位位置:${item.position}") .setOnClickListener( R.id.operationButton, object : View.OnClickListener { override fun onClick(v: View?) { @@ -185,7 +184,7 @@ ) } } - binding.undeployListView.adapter = unDeployAdapter + binding.recyclerView.adapter = unDeployAdapter unDeployAdapter.setOnItemClickedListener(object : NormalRecyclerAdapter.OnItemClickedListener { override fun onItemClicked(position: Int, t: WellListModel.DataBean.RowsBean) { diff --git a/app/src/main/java/com/casic/app/smartwell/view/WellDetailActivity.kt b/app/src/main/java/com/casic/app/smartwell/view/WellDetailActivity.kt index b50d067..eb8b468 100644 --- a/app/src/main/java/com/casic/app/smartwell/view/WellDetailActivity.kt +++ b/app/src/main/java/com/casic/app/smartwell/view/WellDetailActivity.kt @@ -16,7 +16,7 @@ import com.pengxh.kt.lite.extensions.show import com.pengxh.kt.lite.utils.Constant import com.pengxh.kt.lite.utils.LoadState -import com.pengxh.kt.lite.utils.LoadingDialogHub +import com.pengxh.kt.lite.utils.LoadingDialog import com.pengxh.kt.lite.widget.TitleBarView import com.pengxh.kt.lite.widget.dialog.AlertMessageDialog @@ -44,7 +44,7 @@ } override fun initOnCreate(savedInstanceState: Bundle?) { - val wellId = intent.getStringExtra(Constant.INTENT_PARAM)!! + val wellId = intent.getStringExtra(Constant.INTENT_PARAM_KEY)!! wellViewModel = ViewModelProvider(this)[WellViewModel::class.java] wellViewModel.getWellDetail(wellId) wellViewModel.wellDetailModel.observe(this) { @@ -132,8 +132,8 @@ override fun observeRequestState() { wellViewModel.loadState.observe(this) { when (it) { - is LoadState.Loading -> LoadingDialogHub.show(this, "数据加载中,请稍后") - else -> LoadingDialogHub.dismiss() + is LoadState.Loading -> LoadingDialog.show(this, "数据加载中,请稍后") + else -> LoadingDialog.dismiss() } } } diff --git a/app/src/main/java/com/casic/app/smartwell/view/WellManagementActivity.kt b/app/src/main/java/com/casic/app/smartwell/view/WellManagementActivity.kt index 084da95..457096b 100644 --- a/app/src/main/java/com/casic/app/smartwell/view/WellManagementActivity.kt +++ b/app/src/main/java/com/casic/app/smartwell/view/WellManagementActivity.kt @@ -94,8 +94,8 @@ } } - binding.wellListView.addItemDecoration( - RecyclerViewItemOffsets(0, 5, 0, 5) + binding.recyclerView.addItemDecoration( + RecyclerViewItemOffsets(0, 7, 0, 7) ) } @@ -175,13 +175,12 @@ } else { item.deep.toString() + "m" } - viewHolder.setText(R.id.wellNameView, item.wellName) + viewHolder.setText(R.id.wellTypeView, item.wellTypeName) .setText(R.id.wellStateView, "已${item.bfztName}") .setText(R.id.wellDepthView, "深:${deep}") .setText(R.id.wellCodeView, "点位编号:${item.wellCode}") - .setText(R.id.wellTypeView, "点位类型:${item.wellTypeName}") .setText(R.id.ownerShipView, "权属单位:${item.deptName}") - .setText(R.id.wellLocationView, "点位置:${item.position}") + .setText(R.id.wellLocationView, "点位位置:${item.position}") .setOnClickListener( R.id.navigationButton, object : View.OnClickListener { override fun onClick(v: View?) { @@ -200,7 +199,7 @@ ) } } - binding.wellListView.adapter = wellListAdapter + binding.recyclerView.adapter = wellListAdapter wellListAdapter.setOnItemClickedListener(object : NormalRecyclerAdapter.OnItemClickedListener { override fun onItemClicked(position: Int, t: WellListModel.DataBean.RowsBean) { diff --git a/app/src/main/java/com/casic/app/smartwell/view/WellMonitorActivity.kt b/app/src/main/java/com/casic/app/smartwell/view/WellMonitorActivity.kt index e3573eb..b87bdb7 100644 --- a/app/src/main/java/com/casic/app/smartwell/view/WellMonitorActivity.kt +++ b/app/src/main/java/com/casic/app/smartwell/view/WellMonitorActivity.kt @@ -11,7 +11,7 @@ import com.pengxh.kt.lite.base.KotlinBaseActivity import com.pengxh.kt.lite.utils.Constant import com.pengxh.kt.lite.utils.LoadState -import com.pengxh.kt.lite.utils.LoadingDialogHub +import com.pengxh.kt.lite.utils.LoadingDialog import com.pengxh.kt.lite.widget.TitleBarView class WellMonitorActivity : KotlinBaseActivity() { @@ -36,7 +36,7 @@ } override fun initOnCreate(savedInstanceState: Bundle?) { - val wellId = intent.getStringExtra(Constant.INTENT_PARAM)!! + val wellId = intent.getStringExtra(Constant.INTENT_PARAM_KEY)!! wellViewModel = ViewModelProvider(this)[WellViewModel::class.java] wellViewModel.getMonitorResult(wellId) wellViewModel.monitorModel.observe(this) { @@ -56,8 +56,8 @@ override fun observeRequestState() { wellViewModel.loadState.observe(this) { when (it) { - is LoadState.Loading -> LoadingDialogHub.show(this, "数据加载中,请稍后") - else -> LoadingDialogHub.dismiss() + is LoadState.Loading -> LoadingDialog.show(this, "数据加载中,请稍后") + else -> LoadingDialog.dismiss() } } } diff --git a/app/src/main/java/com/casic/app/smartwell/view/WellOperationActivity.kt b/app/src/main/java/com/casic/app/smartwell/view/WellOperationActivity.kt index 8d333bf..347ebb6 100644 --- a/app/src/main/java/com/casic/app/smartwell/view/WellOperationActivity.kt +++ b/app/src/main/java/com/casic/app/smartwell/view/WellOperationActivity.kt @@ -23,7 +23,7 @@ import com.pengxh.kt.lite.extensions.navigatePageTo import com.pengxh.kt.lite.extensions.show import com.pengxh.kt.lite.utils.LoadState -import com.pengxh.kt.lite.utils.LoadingDialogHub +import com.pengxh.kt.lite.utils.LoadingDialog import com.pengxh.kt.lite.utils.WeakReferenceHandler import com.pengxh.kt.lite.widget.dialog.AlertControlDialog @@ -109,8 +109,8 @@ } } - binding.operationListView.addItemDecoration( - RecyclerViewItemOffsets(0, 5, 0, 5) + binding.recyclerView.addItemDecoration( + RecyclerViewItemOffsets(0, 7, 0, 7) ) } @@ -123,13 +123,13 @@ override fun observeRequestState() { wellViewModel.loadState.observe(this) { when (it) { - is LoadState.Loading -> LoadingDialogHub.show(this, "处理中,请稍后") + is LoadState.Loading -> LoadingDialog.show(this, "处理中,请稍后") is LoadState.Success -> { - LoadingDialogHub.dismiss() + LoadingDialog.dismiss() wellOperationAdapter.notifyItemChanged(clickedPosition) } - else -> LoadingDialogHub.dismiss() + else -> LoadingDialog.dismiss() } } } @@ -203,24 +203,23 @@ if (item.bfztName == "布防") { viewHolder.setImageResource( R.id.wellStateView, R.drawable.bg_solid_text_green_radius_5 - ).setText(R.id.wellStateView, "撤防") + ).setText(R.id.operationButton, "撤防") } else { viewHolder.setImageResource( R.id.wellStateView, R.drawable.bg_solid_text_red_radius_5 - ).setText(R.id.wellStateView, "布防") + ).setText(R.id.operationButton, "布防") } val deep = if (item.deep.toString().isBlank()) { "未知" } else { item.deep.toString() + "m" } - viewHolder.setText(R.id.wellNameView, item.wellName) + viewHolder.setText(R.id.wellTypeView, item.wellTypeName) .setText(R.id.wellStateView, "已${item.bfztName}") .setText(R.id.wellDepthView, "深:${deep}") .setText(R.id.wellCodeView, "点位编号:${item.wellCode}") - .setText(R.id.wellTypeView, "点位类型:${item.wellTypeName}") .setText(R.id.ownerShipView, "权属单位:${item.deptName}") - .setText(R.id.wellLocationView, "点位置:${item.position}") + .setText(R.id.wellLocationView, "点位位置:${item.position}") .setOnClickListener( R.id.operationButton, object : View.OnClickListener { override fun onClick(v: View?) { @@ -280,7 +279,7 @@ ) } } - binding.operationListView.adapter = wellOperationAdapter + binding.recyclerView.adapter = wellOperationAdapter wellOperationAdapter.setOnItemClickedListener(object : NormalRecyclerAdapter.OnItemClickedListener { override fun onItemClicked(position: Int, t: WellListModel.DataBean.RowsBean) { diff --git a/app/src/main/res/drawable/ic_down.xml b/app/src/main/res/drawable/ic_down.xml index 20e6476..6987e6c 100644 --- a/app/src/main/res/drawable/ic_down.xml +++ b/app/src/main/res/drawable/ic_down.xml @@ -1,6 +1,6 @@ + + diff --git a/app/src/main/res/layout/activity_about_us.xml b/app/src/main/res/layout/activity_about_us.xml index 9091a00..d5fbd0d 100644 --- a/app/src/main/res/layout/activity_about_us.xml +++ b/app/src/main/res/layout/activity_about_us.xml @@ -12,13 +12,7 @@ android:layout_width="match_parent" android:layout_height="wrap_content" android:background="@color/mainThemeColor" - app:tbv_left_image="@drawable/ic_title_left" - app:tbv_only_show_title="false" - app:tbv_show_left_image="true" - app:tbv_show_right_image="false" - app:tbv_text="关于我们" - app:tbv_text_color="@color/white" - app:tbv_text_size="@dimen/sp_18" /> + app:tbv_text="关于我们" /> + app:tbv_text="修改密码" /> + app:tbv_text="布防列表" /> + app:tbv_text="帮助中心" /> + app:tbv_text="工单详情" /> + app:tbv_text="工单详情" /> + app:tbv_text="工单详情" /> + app:tbv_text="工单详情" /> + app:tbv_text="超时工单" /> + app:tbv_text="工单查询" /> + app:tbv_text="查询结果" /> + app:tbv_text="撤防列表" /> + app:tbv_text="个人资料" /> + app:tbv_text="点位详情" /> + app:tbv_text="监控内容" /> - - - - - - + android:layout_height="wrap_content" + android:background="@color/mainThemeColor" + app:tbv_show_left_image="false" + app:tbv_show_right_image="true" + app:tbv_text="首页" /> - + - + - - - - - - + android:layout_height="wrap_content" + android:background="@color/mainThemeColor" + app:tbv_right_image="@drawable/ic_search_white" + app:tbv_show_left_image="false" + app:tbv_show_right_image="true" + app:tbv_text="工单" /> - - - - - - \ No newline at end of file diff --git a/app/src/main/res/layout/item_deployed_rv.xml b/app/src/main/res/layout/item_deployed_rv.xml index 391ad28..fadcf1d 100644 --- a/app/src/main/res/layout/item_deployed_rv.xml +++ b/app/src/main/res/layout/item_deployed_rv.xml @@ -3,10 +3,9 @@ xmlns:app="http://schemas.android.com/apk/res-auto" android:layout_width="match_parent" android:layout_height="wrap_content" - android:layout_marginHorizontal="@dimen/dp_5" android:background="@drawable/bg_solid_layout_white_radius_10" android:orientation="vertical" - android:padding="@dimen/dp_5"> + android:padding="@dimen/dp_7"> @@ -42,63 +41,63 @@ android:textColor="@color/subTextColor" /> - - - - - + android:gravity="center" + android:orientation="horizontal"> - + - + - + + + + + + android:gravity="center" + android:orientation="vertical"> - - + + + + + \ No newline at end of file diff --git a/app/src/main/res/layout/item_order_completed_rv.xml b/app/src/main/res/layout/item_order_completed_rv.xml index e4ff890..3c78a0f 100644 --- a/app/src/main/res/layout/item_order_completed_rv.xml +++ b/app/src/main/res/layout/item_order_completed_rv.xml @@ -96,6 +96,7 @@ android:layout_height="wrap_content" android:layout_alignParentEnd="true" android:layout_centerVertical="true" + android:padding="@dimen/dp_10" android:src="@drawable/ic_down" /> diff --git a/app/src/main/res/layout/item_order_in_handle_rv.xml b/app/src/main/res/layout/item_order_in_handle_rv.xml index e4ff890..3c78a0f 100644 --- a/app/src/main/res/layout/item_order_in_handle_rv.xml +++ b/app/src/main/res/layout/item_order_in_handle_rv.xml @@ -96,6 +96,7 @@ android:layout_height="wrap_content" android:layout_alignParentEnd="true" android:layout_centerVertical="true" + android:padding="@dimen/dp_10" android:src="@drawable/ic_down" /> diff --git a/app/src/main/res/layout/item_order_not_confirmed_rv.xml b/app/src/main/res/layout/item_order_not_confirmed_rv.xml index d848810..795d7e8 100644 --- a/app/src/main/res/layout/item_order_not_confirmed_rv.xml +++ b/app/src/main/res/layout/item_order_not_confirmed_rv.xml @@ -96,6 +96,7 @@ android:layout_height="wrap_content" android:layout_alignParentEnd="true" android:layout_centerVertical="true" + android:padding="@dimen/dp_10" android:src="@drawable/ic_down" /> diff --git a/app/src/main/res/layout/item_order_not_processed_rv.xml b/app/src/main/res/layout/item_order_not_processed_rv.xml index 33138d4..7e943c6 100644 --- a/app/src/main/res/layout/item_order_not_processed_rv.xml +++ b/app/src/main/res/layout/item_order_not_processed_rv.xml @@ -3,10 +3,9 @@ xmlns:app="http://schemas.android.com/apk/res-auto" android:layout_width="match_parent" android:layout_height="wrap_content" - android:layout_marginHorizontal="@dimen/dp_5" android:background="@drawable/bg_solid_layout_white_radius_10" android:orientation="vertical" - android:padding="@dimen/dp_5"> + android:padding="@dimen/dp_7"> - + + android:value="ee96d8b5e12de3fbb29949efd57418a8" /> () @@ -150,7 +158,7 @@ val cameraPosition = CameraPosition(centerLatLng, 14f, 0f, 0f) val cameraUpdate = CameraUpdateFactory.newCameraPosition(cameraPosition) withContext(Dispatchers.Main) { - LoadingDialogHub.dismiss() + LoadingDialog.dismiss() aMap.animateCamera(cameraUpdate, 1500, null) } } @@ -239,11 +247,6 @@ } override fun initEvent() { - binding.rightOptionView.setOnClickListener { - val x = binding.rightOptionView.width - easyPopupWindow.width - easyPopupWindow.showAsDropDown(binding.rightOptionView, x, 0) - } - //撤防点位 binding.unDeployedLayout.setOnClickListener { requireContext().navigatePageTo() @@ -263,11 +266,11 @@ override fun observeRequestState() { wellViewModel.loadState.observe(this) { when (it) { - is LoadState.Loading -> LoadingDialogHub.show( + is LoadState.Loading -> LoadingDialog.show( requireActivity(), "数据加载中,请稍后..." ) - else -> LoadingDialogHub.dismiss() + else -> LoadingDialog.dismiss() } } } @@ -376,7 +379,7 @@ }).build().show() } }) - infoPopup.showAsDropDown(binding.rightOptionView) +// infoPopup.showAsDropDown(binding.rightOptionView) } override fun onCameraChange(p0: CameraPosition?) { diff --git a/app/src/main/java/com/casic/app/smartwell/fragment/HomePageNoClusterFragment.kt b/app/src/main/java/com/casic/app/smartwell/fragment/HomePageNoClusterFragment.kt index 802426a..b25f743 100644 --- a/app/src/main/java/com/casic/app/smartwell/fragment/HomePageNoClusterFragment.kt +++ b/app/src/main/java/com/casic/app/smartwell/fragment/HomePageNoClusterFragment.kt @@ -38,8 +38,9 @@ import com.pengxh.kt.lite.extensions.navigatePageTo import com.pengxh.kt.lite.extensions.show import com.pengxh.kt.lite.utils.LoadState -import com.pengxh.kt.lite.utils.LoadingDialogHub +import com.pengxh.kt.lite.utils.LoadingDialog import com.pengxh.kt.lite.widget.EasyPopupWindow +import com.pengxh.kt.lite.widget.TitleBarView import com.pengxh.kt.lite.widget.dialog.AlertControlDialog import kotlinx.coroutines.Dispatchers import kotlinx.coroutines.launch @@ -78,7 +79,15 @@ override fun setupTopBarLayout() { binding.rootView.initImmersionBar(this, false, R.color.mainThemeColor) - binding.titleView.text = "首页" + binding.titleView.setOnClickListener(object : TitleBarView.OnClickListener { + override fun onLeftClick() { + + } + + override fun onRightClick() { + easyPopupWindow.showAsDropDown(binding.titleView, binding.titleView.width, 0) + } + }) } override fun initOnCreate(savedInstanceState: Bundle?) { @@ -112,7 +121,7 @@ //渲染井位置 lifecycleScope.launch(Dispatchers.Main) { - LoadingDialogHub.show(requireActivity(), "数据加载中,请稍后") + LoadingDialog.show(requireActivity(), "数据加载中,请稍后") withContext(Dispatchers.IO) { //取Well缓存 val allMarkerOptions = ArrayList() @@ -144,7 +153,7 @@ val cameraPosition = CameraPosition(centerLatLng, 14f, 0f, 0f) val cameraUpdate = CameraUpdateFactory.newCameraPosition(cameraPosition) withContext(Dispatchers.Main) { - LoadingDialogHub.dismiss() + LoadingDialog.dismiss() aMap.animateCamera(cameraUpdate, 1500, null) } } @@ -238,11 +247,6 @@ } override fun initEvent() { - binding.rightOptionView.setOnClickListener { - val x = binding.rightOptionView.width - easyPopupWindow.width - easyPopupWindow.showAsDropDown(binding.rightOptionView, x, 0) - } - //撤防点位 binding.unDeployedLayout.setOnClickListener { requireContext().navigatePageTo() @@ -262,11 +266,11 @@ override fun observeRequestState() { wellViewModel.loadState.observe(this) { when (it) { - is LoadState.Loading -> LoadingDialogHub.show( + is LoadState.Loading -> LoadingDialog.show( requireActivity(), "数据加载中,请稍后..." ) - else -> LoadingDialogHub.dismiss() + else -> LoadingDialog.dismiss() } } } diff --git a/app/src/main/java/com/casic/app/smartwell/fragment/MinePageFragment.kt b/app/src/main/java/com/casic/app/smartwell/fragment/MinePageFragment.kt index 09a570c..dcb48f8 100644 --- a/app/src/main/java/com/casic/app/smartwell/fragment/MinePageFragment.kt +++ b/app/src/main/java/com/casic/app/smartwell/fragment/MinePageFragment.kt @@ -35,7 +35,7 @@ import com.pengxh.kt.lite.utils.ActivityStackManager import com.pengxh.kt.lite.utils.FileDownloadManager import com.pengxh.kt.lite.utils.LoadState -import com.pengxh.kt.lite.utils.LoadingDialogHub +import com.pengxh.kt.lite.utils.LoadingDialog import com.pengxh.kt.lite.widget.dialog.AlertControlDialog import com.pengxh.kt.lite.widget.dialog.BottomActionSheet import kotlinx.coroutines.Dispatchers @@ -60,7 +60,6 @@ override fun setupTopBarLayout() { binding.rootView.initImmersionBar(this, false, R.color.mainThemeColor) - binding.titleInclude.titleView.text = "我的" } override fun initOnCreate(savedInstanceState: Bundle?) { @@ -155,27 +154,27 @@ override fun observeRequestState() { userViewModel.loadState.observe(this) { when (it) { - is LoadState.Loading -> LoadingDialogHub.show( + is LoadState.Loading -> LoadingDialog.show( requireActivity(), "检查版本中,请稍后" ) - else -> LoadingDialogHub.dismiss() + else -> LoadingDialog.dismiss() } } wellViewModel.loadState.observe(this) { when (it) { - is LoadState.Loading -> LoadingDialogHub.show( + is LoadState.Loading -> LoadingDialog.show( requireActivity(), "数据更新中,请稍后" ) is LoadState.Fail -> { - LoadingDialogHub.dismiss() + LoadingDialog.dismiss() "数据更新超时".show(requireContext()) } else -> { - LoadingDialogHub.dismiss() + LoadingDialog.dismiss() AlertControlDialog.Builder().setContext(requireContext()).setTitle("温馨提示") .setMessage("数据更新成功,请重启应用").setNegativeButton("取消") .setPositiveButton("确定").setOnDialogButtonClickListener(object : @@ -197,17 +196,17 @@ lineViewModel.loadState.observe(this) { when (it) { - is LoadState.Loading -> LoadingDialogHub.show( + is LoadState.Loading -> LoadingDialog.show( requireActivity(), "数据更新中,请稍后" ) is LoadState.Fail -> { - LoadingDialogHub.dismiss() + LoadingDialog.dismiss() "数据更新超时".show(requireContext()) } else -> { - LoadingDialogHub.dismiss() + LoadingDialog.dismiss() AlertControlDialog.Builder().setContext(requireContext()).setTitle("温馨提示") .setMessage("数据更新成功,请重启应用").setNegativeButton("取消") .setPositiveButton("确定").setOnDialogButtonClickListener(object : diff --git a/app/src/main/java/com/casic/app/smartwell/fragment/NoticePageFragment.kt b/app/src/main/java/com/casic/app/smartwell/fragment/NoticePageFragment.kt index 171b555..3c93f54 100644 --- a/app/src/main/java/com/casic/app/smartwell/fragment/NoticePageFragment.kt +++ b/app/src/main/java/com/casic/app/smartwell/fragment/NoticePageFragment.kt @@ -48,7 +48,6 @@ override fun setupTopBarLayout() { binding.rootView.initImmersionBar(this, false, R.color.mainThemeColor) - binding.titleInclude.titleView.text = "消息" } override fun initOnCreate(savedInstanceState: Bundle?) { diff --git a/app/src/main/java/com/casic/app/smartwell/fragment/OrderListFragment.kt b/app/src/main/java/com/casic/app/smartwell/fragment/OrderListFragment.kt index 93ff35b..5e38acb 100644 --- a/app/src/main/java/com/casic/app/smartwell/fragment/OrderListFragment.kt +++ b/app/src/main/java/com/casic/app/smartwell/fragment/OrderListFragment.kt @@ -12,6 +12,7 @@ import com.casic.app.smartwell.view.SearchOrderActivity import com.pengxh.kt.lite.base.KotlinBaseFragment import com.pengxh.kt.lite.extensions.navigatePageTo +import com.pengxh.kt.lite.widget.TitleBarView class OrderListFragment : KotlinBaseFragment() { @@ -25,15 +26,22 @@ } override fun initViewBinding( - inflater: LayoutInflater, - container: ViewGroup? + inflater: LayoutInflater, container: ViewGroup? ): FragmentOrderBinding { return FragmentOrderBinding.inflate(inflater, container, false) } override fun setupTopBarLayout() { binding.rootView.initImmersionBar(this, false, R.color.mainThemeColor) - binding.titleView.text = "工单" + binding.titleView.setOnClickListener(object : TitleBarView.OnClickListener { + override fun onLeftClick() { + + } + + override fun onRightClick() { + requireContext().navigatePageTo() + } + }) } override fun initOnCreate(savedInstanceState: Bundle?) { @@ -51,8 +59,6 @@ } override fun initEvent() { - binding.rightOptionView.setOnClickListener { - requireContext().navigatePageTo() - } + } } \ No newline at end of file diff --git a/app/src/main/java/com/casic/app/smartwell/fragment/OrderNotProcessedFragment.kt b/app/src/main/java/com/casic/app/smartwell/fragment/OrderNotProcessedFragment.kt index 0b3d09d..2b6f21d 100644 --- a/app/src/main/java/com/casic/app/smartwell/fragment/OrderNotProcessedFragment.kt +++ b/app/src/main/java/com/casic/app/smartwell/fragment/OrderNotProcessedFragment.kt @@ -18,7 +18,7 @@ import com.pengxh.kt.lite.extensions.navigatePageTo import com.pengxh.kt.lite.extensions.show import com.pengxh.kt.lite.utils.LoadState -import com.pengxh.kt.lite.utils.LoadingDialogHub +import com.pengxh.kt.lite.utils.LoadingDialog import com.pengxh.kt.lite.utils.WeakReferenceHandler import com.pengxh.kt.lite.widget.dialog.AlertControlDialog @@ -78,8 +78,8 @@ operationViewModel = ViewModelProvider(this)[OperationViewModel::class.java] - binding.notProcessedView.addItemDecoration( - RecyclerViewItemOffsets(0, 5, 0, 5) + binding.recyclerView.addItemDecoration( + RecyclerViewItemOffsets(0, 7, 0, 7) ) } @@ -87,9 +87,9 @@ //接单状态处理 operationViewModel.loadState.observe(this) { when (it) { - is LoadState.Loading -> LoadingDialogHub.show(requireActivity(), "接单中,请稍后") + is LoadState.Loading -> LoadingDialog.show(requireActivity(), "接单中,请稍后") is LoadState.Success -> { - LoadingDialogHub.dismiss() + LoadingDialog.dismiss() //接单成功之后刷新列表 dataBeans.removeAt(clickedPosition) notProcessedAdapter.notifyItemRemoved(clickedPosition) @@ -98,7 +98,7 @@ ) } - else -> LoadingDialogHub.dismiss() + else -> LoadingDialog.dismiss() } } } @@ -131,7 +131,7 @@ } else { binding.emptyInclude.emptyView.hide() notProcessedAdapter = OrderNotProcessedAdapter(requireContext(), dataBeans) - binding.notProcessedView.adapter = notProcessedAdapter + binding.recyclerView.adapter = notProcessedAdapter notProcessedAdapter.setOnItemClickListener(object : OrderNotProcessedAdapter.OnItemClickListener { override fun onClicked(position: Int) { diff --git a/app/src/main/java/com/casic/app/smartwell/fragment/OvertimeNotAcceptFragment.kt b/app/src/main/java/com/casic/app/smartwell/fragment/OvertimeNotAcceptFragment.kt index a198545..9b318ca 100644 --- a/app/src/main/java/com/casic/app/smartwell/fragment/OvertimeNotAcceptFragment.kt +++ b/app/src/main/java/com/casic/app/smartwell/fragment/OvertimeNotAcceptFragment.kt @@ -18,7 +18,7 @@ import com.pengxh.kt.lite.extensions.navigatePageTo import com.pengxh.kt.lite.extensions.show import com.pengxh.kt.lite.utils.LoadState -import com.pengxh.kt.lite.utils.LoadingDialogHub +import com.pengxh.kt.lite.utils.LoadingDialog import com.pengxh.kt.lite.utils.WeakReferenceHandler import com.pengxh.kt.lite.widget.dialog.AlertControlDialog @@ -81,8 +81,8 @@ operationViewModel = ViewModelProvider(this)[OperationViewModel::class.java] - binding.notProcessedView.addItemDecoration( - RecyclerViewItemOffsets(0, 5, 0, 5) + binding.recyclerView.addItemDecoration( + RecyclerViewItemOffsets(0, 7, 0, 7) ) } @@ -90,9 +90,9 @@ //接单状态处理 operationViewModel.loadState.observe(this) { when (it) { - is LoadState.Loading -> LoadingDialogHub.show(requireActivity(), "接单中,请稍后") + is LoadState.Loading -> LoadingDialog.show(requireActivity(), "接单中,请稍后") is LoadState.Success -> { - LoadingDialogHub.dismiss() + LoadingDialog.dismiss() //接单成功之后刷新列表 dataBeans.removeAt(clickedPosition) notProcessedAdapter.notifyItemRemoved(clickedPosition) @@ -101,7 +101,7 @@ ) } - else -> LoadingDialogHub.dismiss() + else -> LoadingDialog.dismiss() } } } @@ -134,7 +134,7 @@ } else { binding.emptyInclude.emptyView.hide() notProcessedAdapter = OrderNotProcessedAdapter(requireContext(), dataBeans) - binding.notProcessedView.adapter = notProcessedAdapter + binding.recyclerView.adapter = notProcessedAdapter notProcessedAdapter.setOnItemClickListener(object : OrderNotProcessedAdapter.OnItemClickListener { override fun onClicked(position: Int) { diff --git a/app/src/main/java/com/casic/app/smartwell/greendao/DaoMaster.java b/app/src/main/java/com/casic/app/smartwell/greendao/DaoMaster.java index fdcf3a7..1e52b74 100644 --- a/app/src/main/java/com/casic/app/smartwell/greendao/DaoMaster.java +++ b/app/src/main/java/com/casic/app/smartwell/greendao/DaoMaster.java @@ -13,25 +13,20 @@ // THIS CODE IS GENERATED BY greenDAO, DO NOT EDIT. - /** * Master of DAO (schema version 4): knows all DAOs. */ public class DaoMaster extends AbstractDaoMaster { public static final int SCHEMA_VERSION = 4; - /** - * Creates underlying database table using DAOs. - */ + /** Creates underlying database table using DAOs. */ public static void createAllTables(Database db, boolean ifNotExists) { MapWellLocalBeanDao.createTable(db, ifNotExists); NoticeLocaleBeanDao.createTable(db, ifNotExists); PipeLocalBeanDao.createTable(db, ifNotExists); } - /** - * Drops underlying database table using DAOs. - */ + /** Drops underlying database table using DAOs. */ public static void dropAllTables(Database db, boolean ifExists) { MapWellLocalBeanDao.dropTable(db, ifExists); NoticeLocaleBeanDao.dropTable(db, ifExists); @@ -86,9 +81,7 @@ } } - /** - * WARNING: Drops all table on Upgrade! Use only during development. - */ + /** WARNING: Drops all table on Upgrade! Use only during development. */ public static class DevOpenHelper extends OpenHelper { public DevOpenHelper(Context context, String name) { super(context, name); diff --git a/app/src/main/java/com/casic/app/smartwell/greendao/DaoSession.java b/app/src/main/java/com/casic/app/smartwell/greendao/DaoSession.java index 0b36d17..3e40e3b 100644 --- a/app/src/main/java/com/casic/app/smartwell/greendao/DaoSession.java +++ b/app/src/main/java/com/casic/app/smartwell/greendao/DaoSession.java @@ -16,7 +16,7 @@ /** * {@inheritDoc} - * + * * @see org.greenrobot.greendao.AbstractDaoSession */ public class DaoSession extends AbstractDaoSession { @@ -50,7 +50,7 @@ registerDao(NoticeLocaleBean.class, noticeLocaleBeanDao); registerDao(PipeLocalBean.class, pipeLocalBeanDao); } - + public void clear() { mapWellLocalBeanDaoConfig.clearIdentityScope(); noticeLocaleBeanDaoConfig.clearIdentityScope(); diff --git a/app/src/main/java/com/casic/app/smartwell/greendao/MapWellLocalBeanDao.java b/app/src/main/java/com/casic/app/smartwell/greendao/MapWellLocalBeanDao.java index 8908fda..407bc92 100644 --- a/app/src/main/java/com/casic/app/smartwell/greendao/MapWellLocalBeanDao.java +++ b/app/src/main/java/com/casic/app/smartwell/greendao/MapWellLocalBeanDao.java @@ -12,10 +12,9 @@ import org.greenrobot.greendao.internal.DaoConfig; // THIS CODE IS GENERATED BY greenDAO, DO NOT EDIT. - -/** +/** * DAO for table "MAP_WELL_LOCAL_BEAN". - */ +*/ public class MapWellLocalBeanDao extends AbstractDao { public static final String TABLENAME = "MAP_WELL_LOCAL_BEAN"; @@ -57,16 +56,14 @@ public MapWellLocalBeanDao(DaoConfig config) { super(config); } - + public MapWellLocalBeanDao(DaoConfig config, DaoSession daoSession) { super(config, daoSession); } - /** - * Creates the underlying database table. - */ + /** Creates the underlying database table. */ public static void createTable(Database db, boolean ifNotExists) { - String constraint = ifNotExists ? "IF NOT EXISTS " : ""; + String constraint = ifNotExists? "IF NOT EXISTS ": ""; db.execSQL("CREATE TABLE " + constraint + "\"MAP_WELL_LOCAL_BEAN\" (" + // "\"_id\" INTEGER PRIMARY KEY AUTOINCREMENT ," + // 0: kId "\"AREA\" TEXT," + // 1: area @@ -96,9 +93,7 @@ "\"WELL_TYPE_NAME\" TEXT);"); // 25: wellTypeName } - /** - * Drops the underlying database table. - */ + /** Drops the underlying database table. */ public static void dropTable(Database db, boolean ifExists) { String sql = "DROP TABLE " + (ifExists ? "IF EXISTS " : "") + "\"MAP_WELL_LOCAL_BEAN\""; db.execSQL(sql); @@ -107,132 +102,132 @@ @Override protected final void bindValues(DatabaseStatement stmt, MapWellLocalBean entity) { stmt.clearBindings(); - + Long kId = entity.getKId(); if (kId != null) { stmt.bindLong(1, kId); } - + String area = entity.getArea(); if (area != null) { stmt.bindString(2, area); } - + String bfzt = entity.getBfzt(); if (bfzt != null) { stmt.bindString(3, bfzt); } - + String bfztName = entity.getBfztName(); if (bfztName != null) { stmt.bindString(4, bfztName); } - + String coordinateX = entity.getCoordinateX(); if (coordinateX != null) { stmt.bindString(5, coordinateX); } - + String coordinateY = entity.getCoordinateY(); if (coordinateY != null) { stmt.bindString(6, coordinateY); } - + String deep = entity.getDeep(); if (deep != null) { stmt.bindString(7, deep); } - + String deptName = entity.getDeptName(); if (deptName != null) { stmt.bindString(8, deptName); } - + String deptid = entity.getDeptid(); if (deptid != null) { stmt.bindString(9, deptid); } - + String id = entity.getId(); if (id != null) { stmt.bindString(10, id); } - + String latBaidu = entity.getLatBaidu(); if (latBaidu != null) { stmt.bindString(11, latBaidu); } - + String latGaode = entity.getLatGaode(); if (latGaode != null) { stmt.bindString(12, latGaode); } - + String lngBaidu = entity.getLngBaidu(); if (lngBaidu != null) { stmt.bindString(13, lngBaidu); } - + String lngGaode = entity.getLngGaode(); if (lngGaode != null) { stmt.bindString(14, lngGaode); } - + String notes = entity.getNotes(); if (notes != null) { stmt.bindString(15, notes); } - + String photos = entity.getPhotos(); if (photos != null) { stmt.bindString(16, photos); } - + String position = entity.getPosition(); if (position != null) { stmt.bindString(17, position); } - + String staff = entity.getStaff(); if (staff != null) { stmt.bindString(18, staff); } - + String tel = entity.getTel(); if (tel != null) { stmt.bindString(19, tel); } - + String ts = entity.getTs(); if (ts != null) { stmt.bindString(20, ts); } - + String valid = entity.getValid(); if (valid != null) { stmt.bindString(21, valid); } - + String watchData = entity.getWatchData(); if (watchData != null) { stmt.bindString(22, watchData); } - + String wellCode = entity.getWellCode(); if (wellCode != null) { stmt.bindString(23, wellCode); } - + String wellName = entity.getWellName(); if (wellName != null) { stmt.bindString(24, wellName); } - + String wellType = entity.getWellType(); if (wellType != null) { stmt.bindString(25, wellType); } - + String wellTypeName = entity.getWellTypeName(); if (wellTypeName != null) { stmt.bindString(26, wellTypeName); @@ -242,132 +237,132 @@ @Override protected final void bindValues(SQLiteStatement stmt, MapWellLocalBean entity) { stmt.clearBindings(); - + Long kId = entity.getKId(); if (kId != null) { stmt.bindLong(1, kId); } - + String area = entity.getArea(); if (area != null) { stmt.bindString(2, area); } - + String bfzt = entity.getBfzt(); if (bfzt != null) { stmt.bindString(3, bfzt); } - + String bfztName = entity.getBfztName(); if (bfztName != null) { stmt.bindString(4, bfztName); } - + String coordinateX = entity.getCoordinateX(); if (coordinateX != null) { stmt.bindString(5, coordinateX); } - + String coordinateY = entity.getCoordinateY(); if (coordinateY != null) { stmt.bindString(6, coordinateY); } - + String deep = entity.getDeep(); if (deep != null) { stmt.bindString(7, deep); } - + String deptName = entity.getDeptName(); if (deptName != null) { stmt.bindString(8, deptName); } - + String deptid = entity.getDeptid(); if (deptid != null) { stmt.bindString(9, deptid); } - + String id = entity.getId(); if (id != null) { stmt.bindString(10, id); } - + String latBaidu = entity.getLatBaidu(); if (latBaidu != null) { stmt.bindString(11, latBaidu); } - + String latGaode = entity.getLatGaode(); if (latGaode != null) { stmt.bindString(12, latGaode); } - + String lngBaidu = entity.getLngBaidu(); if (lngBaidu != null) { stmt.bindString(13, lngBaidu); } - + String lngGaode = entity.getLngGaode(); if (lngGaode != null) { stmt.bindString(14, lngGaode); } - + String notes = entity.getNotes(); if (notes != null) { stmt.bindString(15, notes); } - + String photos = entity.getPhotos(); if (photos != null) { stmt.bindString(16, photos); } - + String position = entity.getPosition(); if (position != null) { stmt.bindString(17, position); } - + String staff = entity.getStaff(); if (staff != null) { stmt.bindString(18, staff); } - + String tel = entity.getTel(); if (tel != null) { stmt.bindString(19, tel); } - + String ts = entity.getTs(); if (ts != null) { stmt.bindString(20, ts); } - + String valid = entity.getValid(); if (valid != null) { stmt.bindString(21, valid); } - + String watchData = entity.getWatchData(); if (watchData != null) { stmt.bindString(22, watchData); } - + String wellCode = entity.getWellCode(); if (wellCode != null) { stmt.bindString(23, wellCode); } - + String wellName = entity.getWellName(); if (wellName != null) { stmt.bindString(24, wellName); } - + String wellType = entity.getWellType(); if (wellType != null) { stmt.bindString(25, wellType); } - + String wellTypeName = entity.getWellTypeName(); if (wellTypeName != null) { stmt.bindString(26, wellTypeName); @@ -377,41 +372,41 @@ @Override public Long readKey(Cursor cursor, int offset) { return cursor.isNull(offset + 0) ? null : cursor.getLong(offset + 0); - } + } @Override public MapWellLocalBean readEntity(Cursor cursor, int offset) { MapWellLocalBean entity = new MapWellLocalBean( // - cursor.isNull(offset + 0) ? null : cursor.getLong(offset + 0), // kId - cursor.isNull(offset + 1) ? null : cursor.getString(offset + 1), // area - cursor.isNull(offset + 2) ? null : cursor.getString(offset + 2), // bfzt - cursor.isNull(offset + 3) ? null : cursor.getString(offset + 3), // bfztName - cursor.isNull(offset + 4) ? null : cursor.getString(offset + 4), // coordinateX - cursor.isNull(offset + 5) ? null : cursor.getString(offset + 5), // coordinateY - cursor.isNull(offset + 6) ? null : cursor.getString(offset + 6), // deep - cursor.isNull(offset + 7) ? null : cursor.getString(offset + 7), // deptName - cursor.isNull(offset + 8) ? null : cursor.getString(offset + 8), // deptid - cursor.isNull(offset + 9) ? null : cursor.getString(offset + 9), // id - cursor.isNull(offset + 10) ? null : cursor.getString(offset + 10), // latBaidu - cursor.isNull(offset + 11) ? null : cursor.getString(offset + 11), // latGaode - cursor.isNull(offset + 12) ? null : cursor.getString(offset + 12), // lngBaidu - cursor.isNull(offset + 13) ? null : cursor.getString(offset + 13), // lngGaode - cursor.isNull(offset + 14) ? null : cursor.getString(offset + 14), // notes - cursor.isNull(offset + 15) ? null : cursor.getString(offset + 15), // photos - cursor.isNull(offset + 16) ? null : cursor.getString(offset + 16), // position - cursor.isNull(offset + 17) ? null : cursor.getString(offset + 17), // staff - cursor.isNull(offset + 18) ? null : cursor.getString(offset + 18), // tel - cursor.isNull(offset + 19) ? null : cursor.getString(offset + 19), // ts - cursor.isNull(offset + 20) ? null : cursor.getString(offset + 20), // valid - cursor.isNull(offset + 21) ? null : cursor.getString(offset + 21), // watchData - cursor.isNull(offset + 22) ? null : cursor.getString(offset + 22), // wellCode - cursor.isNull(offset + 23) ? null : cursor.getString(offset + 23), // wellName - cursor.isNull(offset + 24) ? null : cursor.getString(offset + 24), // wellType - cursor.isNull(offset + 25) ? null : cursor.getString(offset + 25) // wellTypeName + cursor.isNull(offset + 0) ? null : cursor.getLong(offset + 0), // kId + cursor.isNull(offset + 1) ? null : cursor.getString(offset + 1), // area + cursor.isNull(offset + 2) ? null : cursor.getString(offset + 2), // bfzt + cursor.isNull(offset + 3) ? null : cursor.getString(offset + 3), // bfztName + cursor.isNull(offset + 4) ? null : cursor.getString(offset + 4), // coordinateX + cursor.isNull(offset + 5) ? null : cursor.getString(offset + 5), // coordinateY + cursor.isNull(offset + 6) ? null : cursor.getString(offset + 6), // deep + cursor.isNull(offset + 7) ? null : cursor.getString(offset + 7), // deptName + cursor.isNull(offset + 8) ? null : cursor.getString(offset + 8), // deptid + cursor.isNull(offset + 9) ? null : cursor.getString(offset + 9), // id + cursor.isNull(offset + 10) ? null : cursor.getString(offset + 10), // latBaidu + cursor.isNull(offset + 11) ? null : cursor.getString(offset + 11), // latGaode + cursor.isNull(offset + 12) ? null : cursor.getString(offset + 12), // lngBaidu + cursor.isNull(offset + 13) ? null : cursor.getString(offset + 13), // lngGaode + cursor.isNull(offset + 14) ? null : cursor.getString(offset + 14), // notes + cursor.isNull(offset + 15) ? null : cursor.getString(offset + 15), // photos + cursor.isNull(offset + 16) ? null : cursor.getString(offset + 16), // position + cursor.isNull(offset + 17) ? null : cursor.getString(offset + 17), // staff + cursor.isNull(offset + 18) ? null : cursor.getString(offset + 18), // tel + cursor.isNull(offset + 19) ? null : cursor.getString(offset + 19), // ts + cursor.isNull(offset + 20) ? null : cursor.getString(offset + 20), // valid + cursor.isNull(offset + 21) ? null : cursor.getString(offset + 21), // watchData + cursor.isNull(offset + 22) ? null : cursor.getString(offset + 22), // wellCode + cursor.isNull(offset + 23) ? null : cursor.getString(offset + 23), // wellName + cursor.isNull(offset + 24) ? null : cursor.getString(offset + 24), // wellType + cursor.isNull(offset + 25) ? null : cursor.getString(offset + 25) // wellTypeName ); return entity; } - + @Override public void readEntity(Cursor cursor, MapWellLocalBean entity, int offset) { entity.setKId(cursor.isNull(offset + 0) ? null : cursor.getLong(offset + 0)); @@ -440,17 +435,17 @@ entity.setWellName(cursor.isNull(offset + 23) ? null : cursor.getString(offset + 23)); entity.setWellType(cursor.isNull(offset + 24) ? null : cursor.getString(offset + 24)); entity.setWellTypeName(cursor.isNull(offset + 25) ? null : cursor.getString(offset + 25)); - } - + } + @Override protected final Long updateKeyAfterInsert(MapWellLocalBean entity, long rowId) { entity.setKId(rowId); return rowId; } - + @Override public Long getKey(MapWellLocalBean entity) { - if (entity != null) { + if(entity != null) { return entity.getKId(); } else { return null; @@ -466,5 +461,5 @@ protected final boolean isEntityUpdateable() { return true; } - + } diff --git a/app/src/main/java/com/casic/app/smartwell/greendao/NoticeLocaleBeanDao.java b/app/src/main/java/com/casic/app/smartwell/greendao/NoticeLocaleBeanDao.java index 64312ed..deb2d49 100644 --- a/app/src/main/java/com/casic/app/smartwell/greendao/NoticeLocaleBeanDao.java +++ b/app/src/main/java/com/casic/app/smartwell/greendao/NoticeLocaleBeanDao.java @@ -12,10 +12,9 @@ import org.greenrobot.greendao.internal.DaoConfig; // THIS CODE IS GENERATED BY greenDAO, DO NOT EDIT. - -/** +/** * DAO for table "NOTICE_LOCALE_BEAN". - */ +*/ public class NoticeLocaleBeanDao extends AbstractDao { public static final String TABLENAME = "NOTICE_LOCALE_BEAN"; @@ -43,16 +42,14 @@ public NoticeLocaleBeanDao(DaoConfig config) { super(config); } - + public NoticeLocaleBeanDao(DaoConfig config, DaoSession daoSession) { super(config, daoSession); } - /** - * Creates the underlying database table. - */ + /** Creates the underlying database table. */ public static void createTable(Database db, boolean ifNotExists) { - String constraint = ifNotExists ? "IF NOT EXISTS " : ""; + String constraint = ifNotExists? "IF NOT EXISTS ": ""; db.execSQL("CREATE TABLE " + constraint + "\"NOTICE_LOCALE_BEAN\" (" + // "\"_id\" INTEGER PRIMARY KEY AUTOINCREMENT ," + // 0: id "\"MESSAGE_ID\" TEXT UNIQUE ," + // 1: messageId @@ -68,9 +65,7 @@ "\"NOTICE_TIME\" TEXT);"); // 11: noticeTime } - /** - * Drops the underlying database table. - */ + /** Drops the underlying database table. */ public static void dropTable(Database db, boolean ifExists) { String sql = "DROP TABLE " + (ifExists ? "IF EXISTS " : "") + "\"NOTICE_LOCALE_BEAN\""; db.execSQL(sql); @@ -79,62 +74,62 @@ @Override protected final void bindValues(DatabaseStatement stmt, NoticeLocaleBean entity) { stmt.clearBindings(); - + Long id = entity.getId(); if (id != null) { stmt.bindLong(1, id); } - + String messageId = entity.getMessageId(); if (messageId != null) { stmt.bindString(2, messageId); } - + String appid = entity.getAppid(); if (appid != null) { stmt.bindString(3, appid); } - + String clientId = entity.getClientId(); if (clientId != null) { stmt.bindString(4, clientId); } - + String taskId = entity.getTaskId(); if (taskId != null) { stmt.bindString(5, taskId); } - + String userId = entity.getUserId(); if (userId != null) { stmt.bindString(6, userId); } - + String title = entity.getTitle(); if (title != null) { stmt.bindString(7, title); } - + String content = entity.getContent(); if (content != null) { stmt.bindString(8, content); } - + String deviceCode = entity.getDeviceCode(); if (deviceCode != null) { stmt.bindString(9, deviceCode); } - + String jobId = entity.getJobId(); if (jobId != null) { stmt.bindString(10, jobId); } - + String isRead = entity.getIsRead(); if (isRead != null) { stmt.bindString(11, isRead); } - + String noticeTime = entity.getNoticeTime(); if (noticeTime != null) { stmt.bindString(12, noticeTime); @@ -144,62 +139,62 @@ @Override protected final void bindValues(SQLiteStatement stmt, NoticeLocaleBean entity) { stmt.clearBindings(); - + Long id = entity.getId(); if (id != null) { stmt.bindLong(1, id); } - + String messageId = entity.getMessageId(); if (messageId != null) { stmt.bindString(2, messageId); } - + String appid = entity.getAppid(); if (appid != null) { stmt.bindString(3, appid); } - + String clientId = entity.getClientId(); if (clientId != null) { stmt.bindString(4, clientId); } - + String taskId = entity.getTaskId(); if (taskId != null) { stmt.bindString(5, taskId); } - + String userId = entity.getUserId(); if (userId != null) { stmt.bindString(6, userId); } - + String title = entity.getTitle(); if (title != null) { stmt.bindString(7, title); } - + String content = entity.getContent(); if (content != null) { stmt.bindString(8, content); } - + String deviceCode = entity.getDeviceCode(); if (deviceCode != null) { stmt.bindString(9, deviceCode); } - + String jobId = entity.getJobId(); if (jobId != null) { stmt.bindString(10, jobId); } - + String isRead = entity.getIsRead(); if (isRead != null) { stmt.bindString(11, isRead); } - + String noticeTime = entity.getNoticeTime(); if (noticeTime != null) { stmt.bindString(12, noticeTime); @@ -209,27 +204,27 @@ @Override public Long readKey(Cursor cursor, int offset) { return cursor.isNull(offset + 0) ? null : cursor.getLong(offset + 0); - } + } @Override public NoticeLocaleBean readEntity(Cursor cursor, int offset) { NoticeLocaleBean entity = new NoticeLocaleBean( // - cursor.isNull(offset + 0) ? null : cursor.getLong(offset + 0), // id - cursor.isNull(offset + 1) ? null : cursor.getString(offset + 1), // messageId - cursor.isNull(offset + 2) ? null : cursor.getString(offset + 2), // appid - cursor.isNull(offset + 3) ? null : cursor.getString(offset + 3), // clientId - cursor.isNull(offset + 4) ? null : cursor.getString(offset + 4), // taskId - cursor.isNull(offset + 5) ? null : cursor.getString(offset + 5), // userId - cursor.isNull(offset + 6) ? null : cursor.getString(offset + 6), // title - cursor.isNull(offset + 7) ? null : cursor.getString(offset + 7), // content - cursor.isNull(offset + 8) ? null : cursor.getString(offset + 8), // deviceCode - cursor.isNull(offset + 9) ? null : cursor.getString(offset + 9), // jobId - cursor.isNull(offset + 10) ? null : cursor.getString(offset + 10), // isRead - cursor.isNull(offset + 11) ? null : cursor.getString(offset + 11) // noticeTime + cursor.isNull(offset + 0) ? null : cursor.getLong(offset + 0), // id + cursor.isNull(offset + 1) ? null : cursor.getString(offset + 1), // messageId + cursor.isNull(offset + 2) ? null : cursor.getString(offset + 2), // appid + cursor.isNull(offset + 3) ? null : cursor.getString(offset + 3), // clientId + cursor.isNull(offset + 4) ? null : cursor.getString(offset + 4), // taskId + cursor.isNull(offset + 5) ? null : cursor.getString(offset + 5), // userId + cursor.isNull(offset + 6) ? null : cursor.getString(offset + 6), // title + cursor.isNull(offset + 7) ? null : cursor.getString(offset + 7), // content + cursor.isNull(offset + 8) ? null : cursor.getString(offset + 8), // deviceCode + cursor.isNull(offset + 9) ? null : cursor.getString(offset + 9), // jobId + cursor.isNull(offset + 10) ? null : cursor.getString(offset + 10), // isRead + cursor.isNull(offset + 11) ? null : cursor.getString(offset + 11) // noticeTime ); return entity; } - + @Override public void readEntity(Cursor cursor, NoticeLocaleBean entity, int offset) { entity.setId(cursor.isNull(offset + 0) ? null : cursor.getLong(offset + 0)); @@ -244,17 +239,17 @@ entity.setJobId(cursor.isNull(offset + 9) ? null : cursor.getString(offset + 9)); entity.setIsRead(cursor.isNull(offset + 10) ? null : cursor.getString(offset + 10)); entity.setNoticeTime(cursor.isNull(offset + 11) ? null : cursor.getString(offset + 11)); - } - + } + @Override protected final Long updateKeyAfterInsert(NoticeLocaleBean entity, long rowId) { entity.setId(rowId); return rowId; } - + @Override public Long getKey(NoticeLocaleBean entity) { - if (entity != null) { + if(entity != null) { return entity.getId(); } else { return null; @@ -270,5 +265,5 @@ protected final boolean isEntityUpdateable() { return true; } - + } diff --git a/app/src/main/java/com/casic/app/smartwell/greendao/PipeLocalBeanDao.java b/app/src/main/java/com/casic/app/smartwell/greendao/PipeLocalBeanDao.java index aab4d3f..df5515a 100644 --- a/app/src/main/java/com/casic/app/smartwell/greendao/PipeLocalBeanDao.java +++ b/app/src/main/java/com/casic/app/smartwell/greendao/PipeLocalBeanDao.java @@ -12,10 +12,9 @@ import org.greenrobot.greendao.internal.DaoConfig; // THIS CODE IS GENERATED BY greenDAO, DO NOT EDIT. - -/** +/** * DAO for table "PIPE_LOCAL_BEAN". - */ +*/ public class PipeLocalBeanDao extends AbstractDao { public static final String TABLENAME = "PIPE_LOCAL_BEAN"; @@ -37,16 +36,14 @@ public PipeLocalBeanDao(DaoConfig config) { super(config); } - + public PipeLocalBeanDao(DaoConfig config, DaoSession daoSession) { super(config, daoSession); } - /** - * Creates the underlying database table. - */ + /** Creates the underlying database table. */ public static void createTable(Database db, boolean ifNotExists) { - String constraint = ifNotExists ? "IF NOT EXISTS " : ""; + String constraint = ifNotExists? "IF NOT EXISTS ": ""; db.execSQL("CREATE TABLE " + constraint + "\"PIPE_LOCAL_BEAN\" (" + // "\"_id\" INTEGER PRIMARY KEY AUTOINCREMENT ," + // 0: id "\"PIPE_CODE\" TEXT," + // 1: pipeCode @@ -56,9 +53,7 @@ "\"START_LONGITUDE_GD\" TEXT);"); // 5: startLongitudeGd } - /** - * Drops the underlying database table. - */ + /** Drops the underlying database table. */ public static void dropTable(Database db, boolean ifExists) { String sql = "DROP TABLE " + (ifExists ? "IF EXISTS " : "") + "\"PIPE_LOCAL_BEAN\""; db.execSQL(sql); @@ -67,32 +62,32 @@ @Override protected final void bindValues(DatabaseStatement stmt, PipeLocalBean entity) { stmt.clearBindings(); - + Long id = entity.getId(); if (id != null) { stmt.bindLong(1, id); } - + String pipeCode = entity.getPipeCode(); if (pipeCode != null) { stmt.bindString(2, pipeCode); } - + String endLatitudeGd = entity.getEndLatitudeGd(); if (endLatitudeGd != null) { stmt.bindString(3, endLatitudeGd); } - + String endLongitudeGd = entity.getEndLongitudeGd(); if (endLongitudeGd != null) { stmt.bindString(4, endLongitudeGd); } - + String startLatitudeGd = entity.getStartLatitudeGd(); if (startLatitudeGd != null) { stmt.bindString(5, startLatitudeGd); } - + String startLongitudeGd = entity.getStartLongitudeGd(); if (startLongitudeGd != null) { stmt.bindString(6, startLongitudeGd); @@ -102,32 +97,32 @@ @Override protected final void bindValues(SQLiteStatement stmt, PipeLocalBean entity) { stmt.clearBindings(); - + Long id = entity.getId(); if (id != null) { stmt.bindLong(1, id); } - + String pipeCode = entity.getPipeCode(); if (pipeCode != null) { stmt.bindString(2, pipeCode); } - + String endLatitudeGd = entity.getEndLatitudeGd(); if (endLatitudeGd != null) { stmt.bindString(3, endLatitudeGd); } - + String endLongitudeGd = entity.getEndLongitudeGd(); if (endLongitudeGd != null) { stmt.bindString(4, endLongitudeGd); } - + String startLatitudeGd = entity.getStartLatitudeGd(); if (startLatitudeGd != null) { stmt.bindString(5, startLatitudeGd); } - + String startLongitudeGd = entity.getStartLongitudeGd(); if (startLongitudeGd != null) { stmt.bindString(6, startLongitudeGd); @@ -137,21 +132,21 @@ @Override public Long readKey(Cursor cursor, int offset) { return cursor.isNull(offset + 0) ? null : cursor.getLong(offset + 0); - } + } @Override public PipeLocalBean readEntity(Cursor cursor, int offset) { PipeLocalBean entity = new PipeLocalBean( // - cursor.isNull(offset + 0) ? null : cursor.getLong(offset + 0), // id - cursor.isNull(offset + 1) ? null : cursor.getString(offset + 1), // pipeCode - cursor.isNull(offset + 2) ? null : cursor.getString(offset + 2), // endLatitudeGd - cursor.isNull(offset + 3) ? null : cursor.getString(offset + 3), // endLongitudeGd - cursor.isNull(offset + 4) ? null : cursor.getString(offset + 4), // startLatitudeGd - cursor.isNull(offset + 5) ? null : cursor.getString(offset + 5) // startLongitudeGd + cursor.isNull(offset + 0) ? null : cursor.getLong(offset + 0), // id + cursor.isNull(offset + 1) ? null : cursor.getString(offset + 1), // pipeCode + cursor.isNull(offset + 2) ? null : cursor.getString(offset + 2), // endLatitudeGd + cursor.isNull(offset + 3) ? null : cursor.getString(offset + 3), // endLongitudeGd + cursor.isNull(offset + 4) ? null : cursor.getString(offset + 4), // startLatitudeGd + cursor.isNull(offset + 5) ? null : cursor.getString(offset + 5) // startLongitudeGd ); return entity; } - + @Override public void readEntity(Cursor cursor, PipeLocalBean entity, int offset) { entity.setId(cursor.isNull(offset + 0) ? null : cursor.getLong(offset + 0)); @@ -160,17 +155,17 @@ entity.setEndLongitudeGd(cursor.isNull(offset + 3) ? null : cursor.getString(offset + 3)); entity.setStartLatitudeGd(cursor.isNull(offset + 4) ? null : cursor.getString(offset + 4)); entity.setStartLongitudeGd(cursor.isNull(offset + 5) ? null : cursor.getString(offset + 5)); - } - + } + @Override protected final Long updateKeyAfterInsert(PipeLocalBean entity, long rowId) { entity.setId(rowId); return rowId; } - + @Override public Long getKey(PipeLocalBean entity) { - if (entity != null) { + if(entity != null) { return entity.getId(); } else { return null; @@ -186,5 +181,5 @@ protected final boolean isEntityUpdateable() { return true; } - + } diff --git a/app/src/main/java/com/casic/app/smartwell/view/ChangePasswordActivity.kt b/app/src/main/java/com/casic/app/smartwell/view/ChangePasswordActivity.kt index 8e41039..9f1dd40 100644 --- a/app/src/main/java/com/casic/app/smartwell/view/ChangePasswordActivity.kt +++ b/app/src/main/java/com/casic/app/smartwell/view/ChangePasswordActivity.kt @@ -14,7 +14,7 @@ import com.pengxh.kt.lite.extensions.show import com.pengxh.kt.lite.utils.ActivityStackManager import com.pengxh.kt.lite.utils.LoadState -import com.pengxh.kt.lite.utils.LoadingDialogHub +import com.pengxh.kt.lite.utils.LoadingDialog import com.pengxh.kt.lite.widget.TitleBarView import java.nio.charset.StandardCharsets @@ -46,15 +46,15 @@ override fun observeRequestState() { userViewModel.loadState.observe(this) { when (it) { - is LoadState.Loading -> LoadingDialogHub.show(this, "修改中,请稍后") + is LoadState.Loading -> LoadingDialog.show(this, "修改中,请稍后") is LoadState.Success -> { - LoadingDialogHub.dismiss() + LoadingDialog.dismiss() AuthenticationHelper.removeToken() this.navigatePageTo() ActivityStackManager.finishAllActivity() } - else -> LoadingDialogHub.dismiss() + else -> LoadingDialog.dismiss() } } } diff --git a/app/src/main/java/com/casic/app/smartwell/view/DeployedWellActivity.kt b/app/src/main/java/com/casic/app/smartwell/view/DeployedWellActivity.kt index fb4339c..28a5078 100644 --- a/app/src/main/java/com/casic/app/smartwell/view/DeployedWellActivity.kt +++ b/app/src/main/java/com/casic/app/smartwell/view/DeployedWellActivity.kt @@ -83,8 +83,8 @@ } //添加分割线 - binding.deployedListView.addItemDecoration( - RecyclerViewItemOffsets(0, 5, 0, 5) + binding.recyclerView.addItemDecoration( + RecyclerViewItemOffsets(0, 7, 0, 7) ) } @@ -149,12 +149,11 @@ } else { item.deep.toString() + "m" } - viewHolder.setText(R.id.wellNameView, item.wellName) + viewHolder.setText(R.id.wellTypeView, item.wellTypeName) .setText(R.id.wellDepthView, "深:${deep}") .setText(R.id.wellCodeView, "点位编号:${item.wellCode}") - .setText(R.id.wellTypeView, "点位类型:${item.wellTypeName}") .setText(R.id.ownerShipView, "权属单位:${item.deptName}") - .setText(R.id.wellLocationView, "点位置:${item.position}") + .setText(R.id.wellLocationView, "点位位置:${item.position}") .setOnClickListener( R.id.operationButton, object : View.OnClickListener { override fun onClick(v: View?) { @@ -207,7 +206,7 @@ }) } } - binding.deployedListView.adapter = deployAdapter + binding.recyclerView.adapter = deployAdapter deployAdapter.setOnItemClickedListener(object : NormalRecyclerAdapter.OnItemClickedListener { override fun onItemClicked(position: Int, t: WellListModel.DataBean.RowsBean) { diff --git a/app/src/main/java/com/casic/app/smartwell/view/LoginActivity.kt b/app/src/main/java/com/casic/app/smartwell/view/LoginActivity.kt index e4bb0e3..834527b 100644 --- a/app/src/main/java/com/casic/app/smartwell/view/LoginActivity.kt +++ b/app/src/main/java/com/casic/app/smartwell/view/LoginActivity.kt @@ -21,7 +21,7 @@ import com.pengxh.kt.lite.extensions.navigatePageTo import com.pengxh.kt.lite.extensions.readAssetsFile import com.pengxh.kt.lite.extensions.show -import com.pengxh.kt.lite.utils.LoadingDialogHub +import com.pengxh.kt.lite.utils.LoadingDialog import com.pengxh.kt.lite.utils.SaveKeyValues import kotlinx.coroutines.Dispatchers import kotlinx.coroutines.launch @@ -106,11 +106,11 @@ override fun observeRequestState() { authenticateViewModel.loadState.observe(this) { - LoadingDialogHub.show(this, "登录中,请稍后") + LoadingDialog.show(this, "登录中,请稍后") } loginViewModel.loadState.observe(this) { - LoadingDialogHub.dismiss() + LoadingDialog.dismiss() } } diff --git a/app/src/main/java/com/casic/app/smartwell/view/OrderCompletedDetailActivity.kt b/app/src/main/java/com/casic/app/smartwell/view/OrderCompletedDetailActivity.kt index db8ad1f..75cd905 100644 --- a/app/src/main/java/com/casic/app/smartwell/view/OrderCompletedDetailActivity.kt +++ b/app/src/main/java/com/casic/app/smartwell/view/OrderCompletedDetailActivity.kt @@ -17,7 +17,7 @@ import com.pengxh.kt.lite.extensions.show import com.pengxh.kt.lite.utils.Constant import com.pengxh.kt.lite.utils.LoadState -import com.pengxh.kt.lite.utils.LoadingDialogHub +import com.pengxh.kt.lite.utils.LoadingDialog import com.pengxh.kt.lite.widget.TitleBarView import com.pengxh.kt.lite.widget.dialog.AlertMessageDialog @@ -44,7 +44,7 @@ } override fun initOnCreate(savedInstanceState: Bundle?) { - val jobId = intent.getStringExtra(Constant.INTENT_PARAM)!! + val jobId = intent.getStringExtra(Constant.INTENT_PARAM_KEY)!! orderViewModel = ViewModelProvider(this)[OrderViewModel::class.java] orderViewModel.getWorkOrderDetail(jobId) orderViewModel.detailModel.observe(this) { @@ -154,8 +154,8 @@ override fun observeRequestState() { orderViewModel.loadState.observe(this) { when (it) { - is LoadState.Loading -> LoadingDialogHub.show(this, "数据加载中,请稍后") - else -> LoadingDialogHub.dismiss() + is LoadState.Loading -> LoadingDialog.show(this, "数据加载中,请稍后") + else -> LoadingDialog.dismiss() } } } diff --git a/app/src/main/java/com/casic/app/smartwell/view/OrderInHandleDetailActivity.kt b/app/src/main/java/com/casic/app/smartwell/view/OrderInHandleDetailActivity.kt index d70a979..04a7d5d 100644 --- a/app/src/main/java/com/casic/app/smartwell/view/OrderInHandleDetailActivity.kt +++ b/app/src/main/java/com/casic/app/smartwell/view/OrderInHandleDetailActivity.kt @@ -38,7 +38,7 @@ import com.pengxh.kt.lite.extensions.show import com.pengxh.kt.lite.utils.Constant import com.pengxh.kt.lite.utils.LoadState -import com.pengxh.kt.lite.utils.LoadingDialogHub +import com.pengxh.kt.lite.utils.LoadingDialog import com.pengxh.kt.lite.widget.TitleBarView import com.pengxh.kt.lite.widget.dialog.AlertControlDialog import com.pengxh.kt.lite.widget.dialog.AlertMessageDialog @@ -93,7 +93,7 @@ ) binding.addImageRecyclerView.adapter = imageAdapter - val jobId = intent.getStringExtra(Constant.INTENT_PARAM)!!//初始化图片九宫格 + val jobId = intent.getStringExtra(Constant.INTENT_PARAM_KEY)!!//初始化图片九宫格 orderViewModel.getWorkOrderDetail(jobId) orderViewModel.detailModel.observe(this) { if (it.code == 200) { @@ -312,41 +312,41 @@ override fun observeRequestState() { orderViewModel.loadState.observe(this) { when (it) { - is LoadState.Loading -> LoadingDialogHub.show(this, "数据加载中,请稍后") - else -> LoadingDialogHub.dismiss() + is LoadState.Loading -> LoadingDialog.show(this, "数据加载中,请稍后") + else -> LoadingDialog.dismiss() } } uploadImageViewModel.loadState.observe(this) { when (it) { - LoadState.Loading -> LoadingDialogHub.show(this, "图片上传中,请稍后...") - else -> LoadingDialogHub.dismiss() + LoadState.Loading -> LoadingDialog.show(this, "图片上传中,请稍后...") + else -> LoadingDialog.dismiss() } } //转单状态处理 operationViewModel.loadState.observe(this) { when (it) { - is LoadState.Loading -> LoadingDialogHub.show(this, "转单中,请稍后") + is LoadState.Loading -> LoadingDialog.show(this, "转单中,请稍后") is LoadState.Success -> { - LoadingDialogHub.dismiss() + LoadingDialog.dismiss() this.finish() } - else -> LoadingDialogHub.dismiss() + else -> LoadingDialog.dismiss() } } //处理完成工单状态处理 operationViewModel.loadState.observe(this) { when (it) { - is LoadState.Loading -> LoadingDialogHub.show(this, "处理中,请稍后") + is LoadState.Loading -> LoadingDialog.show(this, "处理中,请稍后") is LoadState.Success -> { - LoadingDialogHub.dismiss() + LoadingDialog.dismiss() this.finish() } - else -> LoadingDialogHub.dismiss() + else -> LoadingDialog.dismiss() } } } diff --git a/app/src/main/java/com/casic/app/smartwell/view/OrderNotConfirmedDetailActivity.kt b/app/src/main/java/com/casic/app/smartwell/view/OrderNotConfirmedDetailActivity.kt index 8e036d2..687ec86 100644 --- a/app/src/main/java/com/casic/app/smartwell/view/OrderNotConfirmedDetailActivity.kt +++ b/app/src/main/java/com/casic/app/smartwell/view/OrderNotConfirmedDetailActivity.kt @@ -36,7 +36,7 @@ import com.pengxh.kt.lite.extensions.show import com.pengxh.kt.lite.utils.Constant import com.pengxh.kt.lite.utils.LoadState -import com.pengxh.kt.lite.utils.LoadingDialogHub +import com.pengxh.kt.lite.utils.LoadingDialog import com.pengxh.kt.lite.widget.TitleBarView import com.pengxh.kt.lite.widget.dialog.AlertControlDialog import com.pengxh.kt.lite.widget.dialog.AlertMessageDialog @@ -80,7 +80,7 @@ } override fun initOnCreate(savedInstanceState: Bundle?) { - val jobId = intent.getStringExtra(Constant.INTENT_PARAM)!! + val jobId = intent.getStringExtra(Constant.INTENT_PARAM_KEY)!! //初始化图片九宫格 //左外边距,左内边距,右内边距,右外边距 val viewWidth = getScreenWidth() - (10 + 10 + 10 + 10).dp2px(this) @@ -263,41 +263,41 @@ //数据加载状态处理 orderViewModel.loadState.observe(this) { when (it) { - is LoadState.Loading -> LoadingDialogHub.show(this, "数据加载中,请稍后") - else -> LoadingDialogHub.dismiss() + is LoadState.Loading -> LoadingDialog.show(this, "数据加载中,请稍后") + else -> LoadingDialog.dismiss() } } uploadImageViewModel.loadState.observe(this) { when (it) { - LoadState.Loading -> LoadingDialogHub.show(this, "图片上传中,请稍后") - else -> LoadingDialogHub.dismiss() + LoadState.Loading -> LoadingDialog.show(this, "图片上传中,请稍后") + else -> LoadingDialog.dismiss() } } //转单状态处理 operationViewModel.loadState.observe(this) { when (it) { - is LoadState.Loading -> LoadingDialogHub.show(this, "转单中,请稍后") + is LoadState.Loading -> LoadingDialog.show(this, "转单中,请稍后") is LoadState.Success -> { - LoadingDialogHub.dismiss() + LoadingDialog.dismiss() this.finish() } - else -> LoadingDialogHub.dismiss() + else -> LoadingDialog.dismiss() } } //确认工单状态处理 operationViewModel.loadState.observe(this) { when (it) { - is LoadState.Loading -> LoadingDialogHub.show(this, "处理中,请稍后") + is LoadState.Loading -> LoadingDialog.show(this, "处理中,请稍后") is LoadState.Success -> { - LoadingDialogHub.dismiss() + LoadingDialog.dismiss() this.finish() } - else -> LoadingDialogHub.dismiss() + else -> LoadingDialog.dismiss() } } } diff --git a/app/src/main/java/com/casic/app/smartwell/view/OrderNotProcessedDetailActivity.kt b/app/src/main/java/com/casic/app/smartwell/view/OrderNotProcessedDetailActivity.kt index d3f22dc..0c97a52 100644 --- a/app/src/main/java/com/casic/app/smartwell/view/OrderNotProcessedDetailActivity.kt +++ b/app/src/main/java/com/casic/app/smartwell/view/OrderNotProcessedDetailActivity.kt @@ -18,7 +18,7 @@ import com.pengxh.kt.lite.extensions.show import com.pengxh.kt.lite.utils.Constant import com.pengxh.kt.lite.utils.LoadState -import com.pengxh.kt.lite.utils.LoadingDialogHub +import com.pengxh.kt.lite.utils.LoadingDialog import com.pengxh.kt.lite.widget.TitleBarView import com.pengxh.kt.lite.widget.dialog.AlertControlDialog import com.pengxh.kt.lite.widget.dialog.AlertMessageDialog @@ -50,7 +50,7 @@ } override fun initOnCreate(savedInstanceState: Bundle?) { - this.jobId = intent.getStringExtra(Constant.INTENT_PARAM)!! + this.jobId = intent.getStringExtra(Constant.INTENT_PARAM_KEY)!! orderViewModel = ViewModelProvider(this)[OrderViewModel::class.java] operationViewModel = ViewModelProvider(this)[OperationViewModel::class.java] wellViewModel = ViewModelProvider(this)[WellViewModel::class.java] @@ -162,21 +162,21 @@ //数据加载状态处理 orderViewModel.loadState.observe(this) { when (it) { - is LoadState.Loading -> LoadingDialogHub.show(this, "数据加载中,请稍后") - else -> LoadingDialogHub.dismiss() + is LoadState.Loading -> LoadingDialog.show(this, "数据加载中,请稍后") + else -> LoadingDialog.dismiss() } } //接单状态处理 operationViewModel.loadState.observe(this) { when (it) { - is LoadState.Loading -> LoadingDialogHub.show(this, "接单中,请稍后") + is LoadState.Loading -> LoadingDialog.show(this, "接单中,请稍后") is LoadState.Success -> { - LoadingDialogHub.dismiss() + LoadingDialog.dismiss() this.finish() } - else -> LoadingDialogHub.dismiss() + else -> LoadingDialog.dismiss() } } } diff --git a/app/src/main/java/com/casic/app/smartwell/view/SearchResultActivity.kt b/app/src/main/java/com/casic/app/smartwell/view/SearchResultActivity.kt index 6a92917..4f3a674 100644 --- a/app/src/main/java/com/casic/app/smartwell/view/SearchResultActivity.kt +++ b/app/src/main/java/com/casic/app/smartwell/view/SearchResultActivity.kt @@ -19,7 +19,7 @@ import com.pengxh.kt.lite.extensions.show import com.pengxh.kt.lite.utils.Constant import com.pengxh.kt.lite.utils.LoadState -import com.pengxh.kt.lite.utils.LoadingDialogHub +import com.pengxh.kt.lite.utils.LoadingDialog import com.pengxh.kt.lite.utils.WeakReferenceHandler import com.pengxh.kt.lite.widget.TitleBarView import com.pengxh.kt.lite.widget.dialog.AlertControlDialog @@ -56,7 +56,7 @@ } override fun initOnCreate(savedInstanceState: Bundle?) { - args = intent.getStringArrayListExtra(Constant.INTENT_PARAM)!! + args = intent.getStringArrayListExtra(Constant.INTENT_PARAM_KEY)!! orderViewModel = ViewModelProvider(this)[OrderViewModel::class.java] operationViewModel = ViewModelProvider(this)[OperationViewModel::class.java] @@ -101,24 +101,24 @@ } } - binding.resultRecyclerView.addItemDecoration( - RecyclerViewItemOffsets(0, 5, 0, 5) + binding.recyclerView.addItemDecoration( + RecyclerViewItemOffsets(0, 7, 0, 7) ) } override fun observeRequestState() { orderViewModel.loadState.observe(this) { when (it) { - is LoadState.Loading -> LoadingDialogHub.show(this, "数据加载中,请稍后") - else -> LoadingDialogHub.dismiss() + is LoadState.Loading -> LoadingDialog.show(this, "数据加载中,请稍后") + else -> LoadingDialog.dismiss() } } //接单状态处理 operationViewModel.loadState.observe(this) { when (it) { - is LoadState.Loading -> LoadingDialogHub.show(this, "接单中,请稍后") + is LoadState.Loading -> LoadingDialog.show(this, "接单中,请稍后") is LoadState.Success -> { - LoadingDialogHub.dismiss() + LoadingDialog.dismiss() //接单成功之后刷新列表 dataBeans.removeAt(clickedPosition) searchResultAdapter.notifyItemRemoved(clickedPosition) @@ -127,7 +127,7 @@ ) } - else -> LoadingDialogHub.dismiss() + else -> LoadingDialog.dismiss() } } } @@ -162,7 +162,7 @@ } else { binding.emptyInclude.emptyView.hide() searchResultAdapter = SearchResultAdapter(this, dataBeans) - binding.resultRecyclerView.adapter = searchResultAdapter + binding.recyclerView.adapter = searchResultAdapter searchResultAdapter.setOnItemClickListener(object : SearchResultAdapter.OnItemClickListener { override fun onClicked(position: Int) { diff --git a/app/src/main/java/com/casic/app/smartwell/view/UnDeployWellActivity.kt b/app/src/main/java/com/casic/app/smartwell/view/UnDeployWellActivity.kt index 7f7cd3c..555c278 100644 --- a/app/src/main/java/com/casic/app/smartwell/view/UnDeployWellActivity.kt +++ b/app/src/main/java/com/casic/app/smartwell/view/UnDeployWellActivity.kt @@ -81,8 +81,8 @@ } } - binding.undeployListView.addItemDecoration( - RecyclerViewItemOffsets(0, 5, 0, 5) + binding.recyclerView.addItemDecoration( + RecyclerViewItemOffsets(0, 7, 0, 7) ) } @@ -147,12 +147,11 @@ } else { item.deep.toString() + "m" } - viewHolder.setText(R.id.wellNameView, item.wellName) + viewHolder.setText(R.id.wellTypeView, item.wellTypeName) .setText(R.id.wellDepthView, "深:${deep}") .setText(R.id.wellCodeView, "点位编号:${item.wellCode}") - .setText(R.id.wellTypeView, "点位类型:${item.wellTypeName}") .setText(R.id.ownerShipView, "权属单位:${item.deptName}") - .setText(R.id.wellLocationView, "点位置:${item.position}") + .setText(R.id.wellLocationView, "点位位置:${item.position}") .setOnClickListener( R.id.operationButton, object : View.OnClickListener { override fun onClick(v: View?) { @@ -185,7 +184,7 @@ ) } } - binding.undeployListView.adapter = unDeployAdapter + binding.recyclerView.adapter = unDeployAdapter unDeployAdapter.setOnItemClickedListener(object : NormalRecyclerAdapter.OnItemClickedListener { override fun onItemClicked(position: Int, t: WellListModel.DataBean.RowsBean) { diff --git a/app/src/main/java/com/casic/app/smartwell/view/WellDetailActivity.kt b/app/src/main/java/com/casic/app/smartwell/view/WellDetailActivity.kt index b50d067..eb8b468 100644 --- a/app/src/main/java/com/casic/app/smartwell/view/WellDetailActivity.kt +++ b/app/src/main/java/com/casic/app/smartwell/view/WellDetailActivity.kt @@ -16,7 +16,7 @@ import com.pengxh.kt.lite.extensions.show import com.pengxh.kt.lite.utils.Constant import com.pengxh.kt.lite.utils.LoadState -import com.pengxh.kt.lite.utils.LoadingDialogHub +import com.pengxh.kt.lite.utils.LoadingDialog import com.pengxh.kt.lite.widget.TitleBarView import com.pengxh.kt.lite.widget.dialog.AlertMessageDialog @@ -44,7 +44,7 @@ } override fun initOnCreate(savedInstanceState: Bundle?) { - val wellId = intent.getStringExtra(Constant.INTENT_PARAM)!! + val wellId = intent.getStringExtra(Constant.INTENT_PARAM_KEY)!! wellViewModel = ViewModelProvider(this)[WellViewModel::class.java] wellViewModel.getWellDetail(wellId) wellViewModel.wellDetailModel.observe(this) { @@ -132,8 +132,8 @@ override fun observeRequestState() { wellViewModel.loadState.observe(this) { when (it) { - is LoadState.Loading -> LoadingDialogHub.show(this, "数据加载中,请稍后") - else -> LoadingDialogHub.dismiss() + is LoadState.Loading -> LoadingDialog.show(this, "数据加载中,请稍后") + else -> LoadingDialog.dismiss() } } } diff --git a/app/src/main/java/com/casic/app/smartwell/view/WellManagementActivity.kt b/app/src/main/java/com/casic/app/smartwell/view/WellManagementActivity.kt index 084da95..457096b 100644 --- a/app/src/main/java/com/casic/app/smartwell/view/WellManagementActivity.kt +++ b/app/src/main/java/com/casic/app/smartwell/view/WellManagementActivity.kt @@ -94,8 +94,8 @@ } } - binding.wellListView.addItemDecoration( - RecyclerViewItemOffsets(0, 5, 0, 5) + binding.recyclerView.addItemDecoration( + RecyclerViewItemOffsets(0, 7, 0, 7) ) } @@ -175,13 +175,12 @@ } else { item.deep.toString() + "m" } - viewHolder.setText(R.id.wellNameView, item.wellName) + viewHolder.setText(R.id.wellTypeView, item.wellTypeName) .setText(R.id.wellStateView, "已${item.bfztName}") .setText(R.id.wellDepthView, "深:${deep}") .setText(R.id.wellCodeView, "点位编号:${item.wellCode}") - .setText(R.id.wellTypeView, "点位类型:${item.wellTypeName}") .setText(R.id.ownerShipView, "权属单位:${item.deptName}") - .setText(R.id.wellLocationView, "点位置:${item.position}") + .setText(R.id.wellLocationView, "点位位置:${item.position}") .setOnClickListener( R.id.navigationButton, object : View.OnClickListener { override fun onClick(v: View?) { @@ -200,7 +199,7 @@ ) } } - binding.wellListView.adapter = wellListAdapter + binding.recyclerView.adapter = wellListAdapter wellListAdapter.setOnItemClickedListener(object : NormalRecyclerAdapter.OnItemClickedListener { override fun onItemClicked(position: Int, t: WellListModel.DataBean.RowsBean) { diff --git a/app/src/main/java/com/casic/app/smartwell/view/WellMonitorActivity.kt b/app/src/main/java/com/casic/app/smartwell/view/WellMonitorActivity.kt index e3573eb..b87bdb7 100644 --- a/app/src/main/java/com/casic/app/smartwell/view/WellMonitorActivity.kt +++ b/app/src/main/java/com/casic/app/smartwell/view/WellMonitorActivity.kt @@ -11,7 +11,7 @@ import com.pengxh.kt.lite.base.KotlinBaseActivity import com.pengxh.kt.lite.utils.Constant import com.pengxh.kt.lite.utils.LoadState -import com.pengxh.kt.lite.utils.LoadingDialogHub +import com.pengxh.kt.lite.utils.LoadingDialog import com.pengxh.kt.lite.widget.TitleBarView class WellMonitorActivity : KotlinBaseActivity() { @@ -36,7 +36,7 @@ } override fun initOnCreate(savedInstanceState: Bundle?) { - val wellId = intent.getStringExtra(Constant.INTENT_PARAM)!! + val wellId = intent.getStringExtra(Constant.INTENT_PARAM_KEY)!! wellViewModel = ViewModelProvider(this)[WellViewModel::class.java] wellViewModel.getMonitorResult(wellId) wellViewModel.monitorModel.observe(this) { @@ -56,8 +56,8 @@ override fun observeRequestState() { wellViewModel.loadState.observe(this) { when (it) { - is LoadState.Loading -> LoadingDialogHub.show(this, "数据加载中,请稍后") - else -> LoadingDialogHub.dismiss() + is LoadState.Loading -> LoadingDialog.show(this, "数据加载中,请稍后") + else -> LoadingDialog.dismiss() } } } diff --git a/app/src/main/java/com/casic/app/smartwell/view/WellOperationActivity.kt b/app/src/main/java/com/casic/app/smartwell/view/WellOperationActivity.kt index 8d333bf..347ebb6 100644 --- a/app/src/main/java/com/casic/app/smartwell/view/WellOperationActivity.kt +++ b/app/src/main/java/com/casic/app/smartwell/view/WellOperationActivity.kt @@ -23,7 +23,7 @@ import com.pengxh.kt.lite.extensions.navigatePageTo import com.pengxh.kt.lite.extensions.show import com.pengxh.kt.lite.utils.LoadState -import com.pengxh.kt.lite.utils.LoadingDialogHub +import com.pengxh.kt.lite.utils.LoadingDialog import com.pengxh.kt.lite.utils.WeakReferenceHandler import com.pengxh.kt.lite.widget.dialog.AlertControlDialog @@ -109,8 +109,8 @@ } } - binding.operationListView.addItemDecoration( - RecyclerViewItemOffsets(0, 5, 0, 5) + binding.recyclerView.addItemDecoration( + RecyclerViewItemOffsets(0, 7, 0, 7) ) } @@ -123,13 +123,13 @@ override fun observeRequestState() { wellViewModel.loadState.observe(this) { when (it) { - is LoadState.Loading -> LoadingDialogHub.show(this, "处理中,请稍后") + is LoadState.Loading -> LoadingDialog.show(this, "处理中,请稍后") is LoadState.Success -> { - LoadingDialogHub.dismiss() + LoadingDialog.dismiss() wellOperationAdapter.notifyItemChanged(clickedPosition) } - else -> LoadingDialogHub.dismiss() + else -> LoadingDialog.dismiss() } } } @@ -203,24 +203,23 @@ if (item.bfztName == "布防") { viewHolder.setImageResource( R.id.wellStateView, R.drawable.bg_solid_text_green_radius_5 - ).setText(R.id.wellStateView, "撤防") + ).setText(R.id.operationButton, "撤防") } else { viewHolder.setImageResource( R.id.wellStateView, R.drawable.bg_solid_text_red_radius_5 - ).setText(R.id.wellStateView, "布防") + ).setText(R.id.operationButton, "布防") } val deep = if (item.deep.toString().isBlank()) { "未知" } else { item.deep.toString() + "m" } - viewHolder.setText(R.id.wellNameView, item.wellName) + viewHolder.setText(R.id.wellTypeView, item.wellTypeName) .setText(R.id.wellStateView, "已${item.bfztName}") .setText(R.id.wellDepthView, "深:${deep}") .setText(R.id.wellCodeView, "点位编号:${item.wellCode}") - .setText(R.id.wellTypeView, "点位类型:${item.wellTypeName}") .setText(R.id.ownerShipView, "权属单位:${item.deptName}") - .setText(R.id.wellLocationView, "点位置:${item.position}") + .setText(R.id.wellLocationView, "点位位置:${item.position}") .setOnClickListener( R.id.operationButton, object : View.OnClickListener { override fun onClick(v: View?) { @@ -280,7 +279,7 @@ ) } } - binding.operationListView.adapter = wellOperationAdapter + binding.recyclerView.adapter = wellOperationAdapter wellOperationAdapter.setOnItemClickedListener(object : NormalRecyclerAdapter.OnItemClickedListener { override fun onItemClicked(position: Int, t: WellListModel.DataBean.RowsBean) { diff --git a/app/src/main/res/drawable/ic_down.xml b/app/src/main/res/drawable/ic_down.xml index 20e6476..6987e6c 100644 --- a/app/src/main/res/drawable/ic_down.xml +++ b/app/src/main/res/drawable/ic_down.xml @@ -1,6 +1,6 @@ + + diff --git a/app/src/main/res/layout/activity_about_us.xml b/app/src/main/res/layout/activity_about_us.xml index 9091a00..d5fbd0d 100644 --- a/app/src/main/res/layout/activity_about_us.xml +++ b/app/src/main/res/layout/activity_about_us.xml @@ -12,13 +12,7 @@ android:layout_width="match_parent" android:layout_height="wrap_content" android:background="@color/mainThemeColor" - app:tbv_left_image="@drawable/ic_title_left" - app:tbv_only_show_title="false" - app:tbv_show_left_image="true" - app:tbv_show_right_image="false" - app:tbv_text="关于我们" - app:tbv_text_color="@color/white" - app:tbv_text_size="@dimen/sp_18" /> + app:tbv_text="关于我们" /> + app:tbv_text="修改密码" /> + app:tbv_text="布防列表" /> + app:tbv_text="帮助中心" /> + app:tbv_text="工单详情" /> + app:tbv_text="工单详情" /> + app:tbv_text="工单详情" /> + app:tbv_text="工单详情" /> + app:tbv_text="超时工单" /> + app:tbv_text="工单查询" /> + app:tbv_text="查询结果" /> + app:tbv_text="撤防列表" /> + app:tbv_text="个人资料" /> + app:tbv_text="点位详情" /> + app:tbv_text="监控内容" /> - - - - - - + android:layout_height="wrap_content" + android:background="@color/mainThemeColor" + app:tbv_show_left_image="false" + app:tbv_show_right_image="true" + app:tbv_text="首页" /> - + - + - - - - - - + android:layout_height="wrap_content" + android:background="@color/mainThemeColor" + app:tbv_right_image="@drawable/ic_search_white" + app:tbv_show_left_image="false" + app:tbv_show_right_image="true" + app:tbv_text="工单" /> - - - - - - \ No newline at end of file diff --git a/app/src/main/res/layout/item_deployed_rv.xml b/app/src/main/res/layout/item_deployed_rv.xml index 391ad28..fadcf1d 100644 --- a/app/src/main/res/layout/item_deployed_rv.xml +++ b/app/src/main/res/layout/item_deployed_rv.xml @@ -3,10 +3,9 @@ xmlns:app="http://schemas.android.com/apk/res-auto" android:layout_width="match_parent" android:layout_height="wrap_content" - android:layout_marginHorizontal="@dimen/dp_5" android:background="@drawable/bg_solid_layout_white_radius_10" android:orientation="vertical" - android:padding="@dimen/dp_5"> + android:padding="@dimen/dp_7"> @@ -42,63 +41,63 @@ android:textColor="@color/subTextColor" /> - - - - - + android:gravity="center" + android:orientation="horizontal"> - + - + - + + + + + + android:gravity="center" + android:orientation="vertical"> - - + + + + + \ No newline at end of file diff --git a/app/src/main/res/layout/item_order_completed_rv.xml b/app/src/main/res/layout/item_order_completed_rv.xml index e4ff890..3c78a0f 100644 --- a/app/src/main/res/layout/item_order_completed_rv.xml +++ b/app/src/main/res/layout/item_order_completed_rv.xml @@ -96,6 +96,7 @@ android:layout_height="wrap_content" android:layout_alignParentEnd="true" android:layout_centerVertical="true" + android:padding="@dimen/dp_10" android:src="@drawable/ic_down" /> diff --git a/app/src/main/res/layout/item_order_in_handle_rv.xml b/app/src/main/res/layout/item_order_in_handle_rv.xml index e4ff890..3c78a0f 100644 --- a/app/src/main/res/layout/item_order_in_handle_rv.xml +++ b/app/src/main/res/layout/item_order_in_handle_rv.xml @@ -96,6 +96,7 @@ android:layout_height="wrap_content" android:layout_alignParentEnd="true" android:layout_centerVertical="true" + android:padding="@dimen/dp_10" android:src="@drawable/ic_down" /> diff --git a/app/src/main/res/layout/item_order_not_confirmed_rv.xml b/app/src/main/res/layout/item_order_not_confirmed_rv.xml index d848810..795d7e8 100644 --- a/app/src/main/res/layout/item_order_not_confirmed_rv.xml +++ b/app/src/main/res/layout/item_order_not_confirmed_rv.xml @@ -96,6 +96,7 @@ android:layout_height="wrap_content" android:layout_alignParentEnd="true" android:layout_centerVertical="true" + android:padding="@dimen/dp_10" android:src="@drawable/ic_down" /> diff --git a/app/src/main/res/layout/item_order_not_processed_rv.xml b/app/src/main/res/layout/item_order_not_processed_rv.xml index 33138d4..7e943c6 100644 --- a/app/src/main/res/layout/item_order_not_processed_rv.xml +++ b/app/src/main/res/layout/item_order_not_processed_rv.xml @@ -3,10 +3,9 @@ xmlns:app="http://schemas.android.com/apk/res-auto" android:layout_width="match_parent" android:layout_height="wrap_content" - android:layout_marginHorizontal="@dimen/dp_5" android:background="@drawable/bg_solid_layout_white_radius_10" android:orientation="vertical" - android:padding="@dimen/dp_5"> + android:padding="@dimen/dp_7"> + android:padding="@dimen/dp_7"> - - + + diff --git a/app/build.gradle b/app/build.gradle index 296fb6f..c18c251 100644 --- a/app/build.gradle +++ b/app/build.gradle @@ -40,10 +40,6 @@ // VIVO 相关应用参数 VIVO_APP_ID : "105749048", VIVO_APP_KEY : "e460fbf2c689e0f8c58ecc6aa62e1803", - - // 小米相关应用参数 -// XIAOMI_APP_ID : "", -// XIAOMI_APP_KEY : "", ] // 版本名后面添加一句话,意思就是flavor dimension 它的维度就是该版本号,多渠道打包很重要 @@ -107,7 +103,7 @@ dependencies { implementation fileTree(dir: 'libs', include: ['*.jar']) //基础依赖库 - implementation 'com.github.AndroidCoderPeng:Kotlin-lite-lib:1.0.10' + implementation 'com.github.AndroidCoderPeng:Kotlin-lite-lib:1.1.0' implementation 'androidx.appcompat:appcompat:1.6.1' implementation 'androidx.core:core-ktx:1.9.0' implementation 'androidx.constraintlayout:constraintlayout:2.1.4' @@ -165,8 +161,6 @@ implementation 'commons-codec:commons-codec:1.15' implementation 'com.android.support:support-annotations:28.0.0' implementation 'com.assist-v3:vivo:3.1.2' // vivo -// implementation 'com.getui.opt:xmp:3.3.1' // 小米 - //数据库框架 implementation 'org.greenrobot:greendao:3.3.0' //数据库升级 diff --git a/app/src/main/AndroidManifest.xml b/app/src/main/AndroidManifest.xml index c0af158..e0519bf 100644 --- a/app/src/main/AndroidManifest.xml +++ b/app/src/main/AndroidManifest.xml @@ -90,10 +90,10 @@ - + + android:value="ee96d8b5e12de3fbb29949efd57418a8" /> () @@ -150,7 +158,7 @@ val cameraPosition = CameraPosition(centerLatLng, 14f, 0f, 0f) val cameraUpdate = CameraUpdateFactory.newCameraPosition(cameraPosition) withContext(Dispatchers.Main) { - LoadingDialogHub.dismiss() + LoadingDialog.dismiss() aMap.animateCamera(cameraUpdate, 1500, null) } } @@ -239,11 +247,6 @@ } override fun initEvent() { - binding.rightOptionView.setOnClickListener { - val x = binding.rightOptionView.width - easyPopupWindow.width - easyPopupWindow.showAsDropDown(binding.rightOptionView, x, 0) - } - //撤防点位 binding.unDeployedLayout.setOnClickListener { requireContext().navigatePageTo() @@ -263,11 +266,11 @@ override fun observeRequestState() { wellViewModel.loadState.observe(this) { when (it) { - is LoadState.Loading -> LoadingDialogHub.show( + is LoadState.Loading -> LoadingDialog.show( requireActivity(), "数据加载中,请稍后..." ) - else -> LoadingDialogHub.dismiss() + else -> LoadingDialog.dismiss() } } } @@ -376,7 +379,7 @@ }).build().show() } }) - infoPopup.showAsDropDown(binding.rightOptionView) +// infoPopup.showAsDropDown(binding.rightOptionView) } override fun onCameraChange(p0: CameraPosition?) { diff --git a/app/src/main/java/com/casic/app/smartwell/fragment/HomePageNoClusterFragment.kt b/app/src/main/java/com/casic/app/smartwell/fragment/HomePageNoClusterFragment.kt index 802426a..b25f743 100644 --- a/app/src/main/java/com/casic/app/smartwell/fragment/HomePageNoClusterFragment.kt +++ b/app/src/main/java/com/casic/app/smartwell/fragment/HomePageNoClusterFragment.kt @@ -38,8 +38,9 @@ import com.pengxh.kt.lite.extensions.navigatePageTo import com.pengxh.kt.lite.extensions.show import com.pengxh.kt.lite.utils.LoadState -import com.pengxh.kt.lite.utils.LoadingDialogHub +import com.pengxh.kt.lite.utils.LoadingDialog import com.pengxh.kt.lite.widget.EasyPopupWindow +import com.pengxh.kt.lite.widget.TitleBarView import com.pengxh.kt.lite.widget.dialog.AlertControlDialog import kotlinx.coroutines.Dispatchers import kotlinx.coroutines.launch @@ -78,7 +79,15 @@ override fun setupTopBarLayout() { binding.rootView.initImmersionBar(this, false, R.color.mainThemeColor) - binding.titleView.text = "首页" + binding.titleView.setOnClickListener(object : TitleBarView.OnClickListener { + override fun onLeftClick() { + + } + + override fun onRightClick() { + easyPopupWindow.showAsDropDown(binding.titleView, binding.titleView.width, 0) + } + }) } override fun initOnCreate(savedInstanceState: Bundle?) { @@ -112,7 +121,7 @@ //渲染井位置 lifecycleScope.launch(Dispatchers.Main) { - LoadingDialogHub.show(requireActivity(), "数据加载中,请稍后") + LoadingDialog.show(requireActivity(), "数据加载中,请稍后") withContext(Dispatchers.IO) { //取Well缓存 val allMarkerOptions = ArrayList() @@ -144,7 +153,7 @@ val cameraPosition = CameraPosition(centerLatLng, 14f, 0f, 0f) val cameraUpdate = CameraUpdateFactory.newCameraPosition(cameraPosition) withContext(Dispatchers.Main) { - LoadingDialogHub.dismiss() + LoadingDialog.dismiss() aMap.animateCamera(cameraUpdate, 1500, null) } } @@ -238,11 +247,6 @@ } override fun initEvent() { - binding.rightOptionView.setOnClickListener { - val x = binding.rightOptionView.width - easyPopupWindow.width - easyPopupWindow.showAsDropDown(binding.rightOptionView, x, 0) - } - //撤防点位 binding.unDeployedLayout.setOnClickListener { requireContext().navigatePageTo() @@ -262,11 +266,11 @@ override fun observeRequestState() { wellViewModel.loadState.observe(this) { when (it) { - is LoadState.Loading -> LoadingDialogHub.show( + is LoadState.Loading -> LoadingDialog.show( requireActivity(), "数据加载中,请稍后..." ) - else -> LoadingDialogHub.dismiss() + else -> LoadingDialog.dismiss() } } } diff --git a/app/src/main/java/com/casic/app/smartwell/fragment/MinePageFragment.kt b/app/src/main/java/com/casic/app/smartwell/fragment/MinePageFragment.kt index 09a570c..dcb48f8 100644 --- a/app/src/main/java/com/casic/app/smartwell/fragment/MinePageFragment.kt +++ b/app/src/main/java/com/casic/app/smartwell/fragment/MinePageFragment.kt @@ -35,7 +35,7 @@ import com.pengxh.kt.lite.utils.ActivityStackManager import com.pengxh.kt.lite.utils.FileDownloadManager import com.pengxh.kt.lite.utils.LoadState -import com.pengxh.kt.lite.utils.LoadingDialogHub +import com.pengxh.kt.lite.utils.LoadingDialog import com.pengxh.kt.lite.widget.dialog.AlertControlDialog import com.pengxh.kt.lite.widget.dialog.BottomActionSheet import kotlinx.coroutines.Dispatchers @@ -60,7 +60,6 @@ override fun setupTopBarLayout() { binding.rootView.initImmersionBar(this, false, R.color.mainThemeColor) - binding.titleInclude.titleView.text = "我的" } override fun initOnCreate(savedInstanceState: Bundle?) { @@ -155,27 +154,27 @@ override fun observeRequestState() { userViewModel.loadState.observe(this) { when (it) { - is LoadState.Loading -> LoadingDialogHub.show( + is LoadState.Loading -> LoadingDialog.show( requireActivity(), "检查版本中,请稍后" ) - else -> LoadingDialogHub.dismiss() + else -> LoadingDialog.dismiss() } } wellViewModel.loadState.observe(this) { when (it) { - is LoadState.Loading -> LoadingDialogHub.show( + is LoadState.Loading -> LoadingDialog.show( requireActivity(), "数据更新中,请稍后" ) is LoadState.Fail -> { - LoadingDialogHub.dismiss() + LoadingDialog.dismiss() "数据更新超时".show(requireContext()) } else -> { - LoadingDialogHub.dismiss() + LoadingDialog.dismiss() AlertControlDialog.Builder().setContext(requireContext()).setTitle("温馨提示") .setMessage("数据更新成功,请重启应用").setNegativeButton("取消") .setPositiveButton("确定").setOnDialogButtonClickListener(object : @@ -197,17 +196,17 @@ lineViewModel.loadState.observe(this) { when (it) { - is LoadState.Loading -> LoadingDialogHub.show( + is LoadState.Loading -> LoadingDialog.show( requireActivity(), "数据更新中,请稍后" ) is LoadState.Fail -> { - LoadingDialogHub.dismiss() + LoadingDialog.dismiss() "数据更新超时".show(requireContext()) } else -> { - LoadingDialogHub.dismiss() + LoadingDialog.dismiss() AlertControlDialog.Builder().setContext(requireContext()).setTitle("温馨提示") .setMessage("数据更新成功,请重启应用").setNegativeButton("取消") .setPositiveButton("确定").setOnDialogButtonClickListener(object : diff --git a/app/src/main/java/com/casic/app/smartwell/fragment/NoticePageFragment.kt b/app/src/main/java/com/casic/app/smartwell/fragment/NoticePageFragment.kt index 171b555..3c93f54 100644 --- a/app/src/main/java/com/casic/app/smartwell/fragment/NoticePageFragment.kt +++ b/app/src/main/java/com/casic/app/smartwell/fragment/NoticePageFragment.kt @@ -48,7 +48,6 @@ override fun setupTopBarLayout() { binding.rootView.initImmersionBar(this, false, R.color.mainThemeColor) - binding.titleInclude.titleView.text = "消息" } override fun initOnCreate(savedInstanceState: Bundle?) { diff --git a/app/src/main/java/com/casic/app/smartwell/fragment/OrderListFragment.kt b/app/src/main/java/com/casic/app/smartwell/fragment/OrderListFragment.kt index 93ff35b..5e38acb 100644 --- a/app/src/main/java/com/casic/app/smartwell/fragment/OrderListFragment.kt +++ b/app/src/main/java/com/casic/app/smartwell/fragment/OrderListFragment.kt @@ -12,6 +12,7 @@ import com.casic.app.smartwell.view.SearchOrderActivity import com.pengxh.kt.lite.base.KotlinBaseFragment import com.pengxh.kt.lite.extensions.navigatePageTo +import com.pengxh.kt.lite.widget.TitleBarView class OrderListFragment : KotlinBaseFragment() { @@ -25,15 +26,22 @@ } override fun initViewBinding( - inflater: LayoutInflater, - container: ViewGroup? + inflater: LayoutInflater, container: ViewGroup? ): FragmentOrderBinding { return FragmentOrderBinding.inflate(inflater, container, false) } override fun setupTopBarLayout() { binding.rootView.initImmersionBar(this, false, R.color.mainThemeColor) - binding.titleView.text = "工单" + binding.titleView.setOnClickListener(object : TitleBarView.OnClickListener { + override fun onLeftClick() { + + } + + override fun onRightClick() { + requireContext().navigatePageTo() + } + }) } override fun initOnCreate(savedInstanceState: Bundle?) { @@ -51,8 +59,6 @@ } override fun initEvent() { - binding.rightOptionView.setOnClickListener { - requireContext().navigatePageTo() - } + } } \ No newline at end of file diff --git a/app/src/main/java/com/casic/app/smartwell/fragment/OrderNotProcessedFragment.kt b/app/src/main/java/com/casic/app/smartwell/fragment/OrderNotProcessedFragment.kt index 0b3d09d..2b6f21d 100644 --- a/app/src/main/java/com/casic/app/smartwell/fragment/OrderNotProcessedFragment.kt +++ b/app/src/main/java/com/casic/app/smartwell/fragment/OrderNotProcessedFragment.kt @@ -18,7 +18,7 @@ import com.pengxh.kt.lite.extensions.navigatePageTo import com.pengxh.kt.lite.extensions.show import com.pengxh.kt.lite.utils.LoadState -import com.pengxh.kt.lite.utils.LoadingDialogHub +import com.pengxh.kt.lite.utils.LoadingDialog import com.pengxh.kt.lite.utils.WeakReferenceHandler import com.pengxh.kt.lite.widget.dialog.AlertControlDialog @@ -78,8 +78,8 @@ operationViewModel = ViewModelProvider(this)[OperationViewModel::class.java] - binding.notProcessedView.addItemDecoration( - RecyclerViewItemOffsets(0, 5, 0, 5) + binding.recyclerView.addItemDecoration( + RecyclerViewItemOffsets(0, 7, 0, 7) ) } @@ -87,9 +87,9 @@ //接单状态处理 operationViewModel.loadState.observe(this) { when (it) { - is LoadState.Loading -> LoadingDialogHub.show(requireActivity(), "接单中,请稍后") + is LoadState.Loading -> LoadingDialog.show(requireActivity(), "接单中,请稍后") is LoadState.Success -> { - LoadingDialogHub.dismiss() + LoadingDialog.dismiss() //接单成功之后刷新列表 dataBeans.removeAt(clickedPosition) notProcessedAdapter.notifyItemRemoved(clickedPosition) @@ -98,7 +98,7 @@ ) } - else -> LoadingDialogHub.dismiss() + else -> LoadingDialog.dismiss() } } } @@ -131,7 +131,7 @@ } else { binding.emptyInclude.emptyView.hide() notProcessedAdapter = OrderNotProcessedAdapter(requireContext(), dataBeans) - binding.notProcessedView.adapter = notProcessedAdapter + binding.recyclerView.adapter = notProcessedAdapter notProcessedAdapter.setOnItemClickListener(object : OrderNotProcessedAdapter.OnItemClickListener { override fun onClicked(position: Int) { diff --git a/app/src/main/java/com/casic/app/smartwell/fragment/OvertimeNotAcceptFragment.kt b/app/src/main/java/com/casic/app/smartwell/fragment/OvertimeNotAcceptFragment.kt index a198545..9b318ca 100644 --- a/app/src/main/java/com/casic/app/smartwell/fragment/OvertimeNotAcceptFragment.kt +++ b/app/src/main/java/com/casic/app/smartwell/fragment/OvertimeNotAcceptFragment.kt @@ -18,7 +18,7 @@ import com.pengxh.kt.lite.extensions.navigatePageTo import com.pengxh.kt.lite.extensions.show import com.pengxh.kt.lite.utils.LoadState -import com.pengxh.kt.lite.utils.LoadingDialogHub +import com.pengxh.kt.lite.utils.LoadingDialog import com.pengxh.kt.lite.utils.WeakReferenceHandler import com.pengxh.kt.lite.widget.dialog.AlertControlDialog @@ -81,8 +81,8 @@ operationViewModel = ViewModelProvider(this)[OperationViewModel::class.java] - binding.notProcessedView.addItemDecoration( - RecyclerViewItemOffsets(0, 5, 0, 5) + binding.recyclerView.addItemDecoration( + RecyclerViewItemOffsets(0, 7, 0, 7) ) } @@ -90,9 +90,9 @@ //接单状态处理 operationViewModel.loadState.observe(this) { when (it) { - is LoadState.Loading -> LoadingDialogHub.show(requireActivity(), "接单中,请稍后") + is LoadState.Loading -> LoadingDialog.show(requireActivity(), "接单中,请稍后") is LoadState.Success -> { - LoadingDialogHub.dismiss() + LoadingDialog.dismiss() //接单成功之后刷新列表 dataBeans.removeAt(clickedPosition) notProcessedAdapter.notifyItemRemoved(clickedPosition) @@ -101,7 +101,7 @@ ) } - else -> LoadingDialogHub.dismiss() + else -> LoadingDialog.dismiss() } } } @@ -134,7 +134,7 @@ } else { binding.emptyInclude.emptyView.hide() notProcessedAdapter = OrderNotProcessedAdapter(requireContext(), dataBeans) - binding.notProcessedView.adapter = notProcessedAdapter + binding.recyclerView.adapter = notProcessedAdapter notProcessedAdapter.setOnItemClickListener(object : OrderNotProcessedAdapter.OnItemClickListener { override fun onClicked(position: Int) { diff --git a/app/src/main/java/com/casic/app/smartwell/greendao/DaoMaster.java b/app/src/main/java/com/casic/app/smartwell/greendao/DaoMaster.java index fdcf3a7..1e52b74 100644 --- a/app/src/main/java/com/casic/app/smartwell/greendao/DaoMaster.java +++ b/app/src/main/java/com/casic/app/smartwell/greendao/DaoMaster.java @@ -13,25 +13,20 @@ // THIS CODE IS GENERATED BY greenDAO, DO NOT EDIT. - /** * Master of DAO (schema version 4): knows all DAOs. */ public class DaoMaster extends AbstractDaoMaster { public static final int SCHEMA_VERSION = 4; - /** - * Creates underlying database table using DAOs. - */ + /** Creates underlying database table using DAOs. */ public static void createAllTables(Database db, boolean ifNotExists) { MapWellLocalBeanDao.createTable(db, ifNotExists); NoticeLocaleBeanDao.createTable(db, ifNotExists); PipeLocalBeanDao.createTable(db, ifNotExists); } - /** - * Drops underlying database table using DAOs. - */ + /** Drops underlying database table using DAOs. */ public static void dropAllTables(Database db, boolean ifExists) { MapWellLocalBeanDao.dropTable(db, ifExists); NoticeLocaleBeanDao.dropTable(db, ifExists); @@ -86,9 +81,7 @@ } } - /** - * WARNING: Drops all table on Upgrade! Use only during development. - */ + /** WARNING: Drops all table on Upgrade! Use only during development. */ public static class DevOpenHelper extends OpenHelper { public DevOpenHelper(Context context, String name) { super(context, name); diff --git a/app/src/main/java/com/casic/app/smartwell/greendao/DaoSession.java b/app/src/main/java/com/casic/app/smartwell/greendao/DaoSession.java index 0b36d17..3e40e3b 100644 --- a/app/src/main/java/com/casic/app/smartwell/greendao/DaoSession.java +++ b/app/src/main/java/com/casic/app/smartwell/greendao/DaoSession.java @@ -16,7 +16,7 @@ /** * {@inheritDoc} - * + * * @see org.greenrobot.greendao.AbstractDaoSession */ public class DaoSession extends AbstractDaoSession { @@ -50,7 +50,7 @@ registerDao(NoticeLocaleBean.class, noticeLocaleBeanDao); registerDao(PipeLocalBean.class, pipeLocalBeanDao); } - + public void clear() { mapWellLocalBeanDaoConfig.clearIdentityScope(); noticeLocaleBeanDaoConfig.clearIdentityScope(); diff --git a/app/src/main/java/com/casic/app/smartwell/greendao/MapWellLocalBeanDao.java b/app/src/main/java/com/casic/app/smartwell/greendao/MapWellLocalBeanDao.java index 8908fda..407bc92 100644 --- a/app/src/main/java/com/casic/app/smartwell/greendao/MapWellLocalBeanDao.java +++ b/app/src/main/java/com/casic/app/smartwell/greendao/MapWellLocalBeanDao.java @@ -12,10 +12,9 @@ import org.greenrobot.greendao.internal.DaoConfig; // THIS CODE IS GENERATED BY greenDAO, DO NOT EDIT. - -/** +/** * DAO for table "MAP_WELL_LOCAL_BEAN". - */ +*/ public class MapWellLocalBeanDao extends AbstractDao { public static final String TABLENAME = "MAP_WELL_LOCAL_BEAN"; @@ -57,16 +56,14 @@ public MapWellLocalBeanDao(DaoConfig config) { super(config); } - + public MapWellLocalBeanDao(DaoConfig config, DaoSession daoSession) { super(config, daoSession); } - /** - * Creates the underlying database table. - */ + /** Creates the underlying database table. */ public static void createTable(Database db, boolean ifNotExists) { - String constraint = ifNotExists ? "IF NOT EXISTS " : ""; + String constraint = ifNotExists? "IF NOT EXISTS ": ""; db.execSQL("CREATE TABLE " + constraint + "\"MAP_WELL_LOCAL_BEAN\" (" + // "\"_id\" INTEGER PRIMARY KEY AUTOINCREMENT ," + // 0: kId "\"AREA\" TEXT," + // 1: area @@ -96,9 +93,7 @@ "\"WELL_TYPE_NAME\" TEXT);"); // 25: wellTypeName } - /** - * Drops the underlying database table. - */ + /** Drops the underlying database table. */ public static void dropTable(Database db, boolean ifExists) { String sql = "DROP TABLE " + (ifExists ? "IF EXISTS " : "") + "\"MAP_WELL_LOCAL_BEAN\""; db.execSQL(sql); @@ -107,132 +102,132 @@ @Override protected final void bindValues(DatabaseStatement stmt, MapWellLocalBean entity) { stmt.clearBindings(); - + Long kId = entity.getKId(); if (kId != null) { stmt.bindLong(1, kId); } - + String area = entity.getArea(); if (area != null) { stmt.bindString(2, area); } - + String bfzt = entity.getBfzt(); if (bfzt != null) { stmt.bindString(3, bfzt); } - + String bfztName = entity.getBfztName(); if (bfztName != null) { stmt.bindString(4, bfztName); } - + String coordinateX = entity.getCoordinateX(); if (coordinateX != null) { stmt.bindString(5, coordinateX); } - + String coordinateY = entity.getCoordinateY(); if (coordinateY != null) { stmt.bindString(6, coordinateY); } - + String deep = entity.getDeep(); if (deep != null) { stmt.bindString(7, deep); } - + String deptName = entity.getDeptName(); if (deptName != null) { stmt.bindString(8, deptName); } - + String deptid = entity.getDeptid(); if (deptid != null) { stmt.bindString(9, deptid); } - + String id = entity.getId(); if (id != null) { stmt.bindString(10, id); } - + String latBaidu = entity.getLatBaidu(); if (latBaidu != null) { stmt.bindString(11, latBaidu); } - + String latGaode = entity.getLatGaode(); if (latGaode != null) { stmt.bindString(12, latGaode); } - + String lngBaidu = entity.getLngBaidu(); if (lngBaidu != null) { stmt.bindString(13, lngBaidu); } - + String lngGaode = entity.getLngGaode(); if (lngGaode != null) { stmt.bindString(14, lngGaode); } - + String notes = entity.getNotes(); if (notes != null) { stmt.bindString(15, notes); } - + String photos = entity.getPhotos(); if (photos != null) { stmt.bindString(16, photos); } - + String position = entity.getPosition(); if (position != null) { stmt.bindString(17, position); } - + String staff = entity.getStaff(); if (staff != null) { stmt.bindString(18, staff); } - + String tel = entity.getTel(); if (tel != null) { stmt.bindString(19, tel); } - + String ts = entity.getTs(); if (ts != null) { stmt.bindString(20, ts); } - + String valid = entity.getValid(); if (valid != null) { stmt.bindString(21, valid); } - + String watchData = entity.getWatchData(); if (watchData != null) { stmt.bindString(22, watchData); } - + String wellCode = entity.getWellCode(); if (wellCode != null) { stmt.bindString(23, wellCode); } - + String wellName = entity.getWellName(); if (wellName != null) { stmt.bindString(24, wellName); } - + String wellType = entity.getWellType(); if (wellType != null) { stmt.bindString(25, wellType); } - + String wellTypeName = entity.getWellTypeName(); if (wellTypeName != null) { stmt.bindString(26, wellTypeName); @@ -242,132 +237,132 @@ @Override protected final void bindValues(SQLiteStatement stmt, MapWellLocalBean entity) { stmt.clearBindings(); - + Long kId = entity.getKId(); if (kId != null) { stmt.bindLong(1, kId); } - + String area = entity.getArea(); if (area != null) { stmt.bindString(2, area); } - + String bfzt = entity.getBfzt(); if (bfzt != null) { stmt.bindString(3, bfzt); } - + String bfztName = entity.getBfztName(); if (bfztName != null) { stmt.bindString(4, bfztName); } - + String coordinateX = entity.getCoordinateX(); if (coordinateX != null) { stmt.bindString(5, coordinateX); } - + String coordinateY = entity.getCoordinateY(); if (coordinateY != null) { stmt.bindString(6, coordinateY); } - + String deep = entity.getDeep(); if (deep != null) { stmt.bindString(7, deep); } - + String deptName = entity.getDeptName(); if (deptName != null) { stmt.bindString(8, deptName); } - + String deptid = entity.getDeptid(); if (deptid != null) { stmt.bindString(9, deptid); } - + String id = entity.getId(); if (id != null) { stmt.bindString(10, id); } - + String latBaidu = entity.getLatBaidu(); if (latBaidu != null) { stmt.bindString(11, latBaidu); } - + String latGaode = entity.getLatGaode(); if (latGaode != null) { stmt.bindString(12, latGaode); } - + String lngBaidu = entity.getLngBaidu(); if (lngBaidu != null) { stmt.bindString(13, lngBaidu); } - + String lngGaode = entity.getLngGaode(); if (lngGaode != null) { stmt.bindString(14, lngGaode); } - + String notes = entity.getNotes(); if (notes != null) { stmt.bindString(15, notes); } - + String photos = entity.getPhotos(); if (photos != null) { stmt.bindString(16, photos); } - + String position = entity.getPosition(); if (position != null) { stmt.bindString(17, position); } - + String staff = entity.getStaff(); if (staff != null) { stmt.bindString(18, staff); } - + String tel = entity.getTel(); if (tel != null) { stmt.bindString(19, tel); } - + String ts = entity.getTs(); if (ts != null) { stmt.bindString(20, ts); } - + String valid = entity.getValid(); if (valid != null) { stmt.bindString(21, valid); } - + String watchData = entity.getWatchData(); if (watchData != null) { stmt.bindString(22, watchData); } - + String wellCode = entity.getWellCode(); if (wellCode != null) { stmt.bindString(23, wellCode); } - + String wellName = entity.getWellName(); if (wellName != null) { stmt.bindString(24, wellName); } - + String wellType = entity.getWellType(); if (wellType != null) { stmt.bindString(25, wellType); } - + String wellTypeName = entity.getWellTypeName(); if (wellTypeName != null) { stmt.bindString(26, wellTypeName); @@ -377,41 +372,41 @@ @Override public Long readKey(Cursor cursor, int offset) { return cursor.isNull(offset + 0) ? null : cursor.getLong(offset + 0); - } + } @Override public MapWellLocalBean readEntity(Cursor cursor, int offset) { MapWellLocalBean entity = new MapWellLocalBean( // - cursor.isNull(offset + 0) ? null : cursor.getLong(offset + 0), // kId - cursor.isNull(offset + 1) ? null : cursor.getString(offset + 1), // area - cursor.isNull(offset + 2) ? null : cursor.getString(offset + 2), // bfzt - cursor.isNull(offset + 3) ? null : cursor.getString(offset + 3), // bfztName - cursor.isNull(offset + 4) ? null : cursor.getString(offset + 4), // coordinateX - cursor.isNull(offset + 5) ? null : cursor.getString(offset + 5), // coordinateY - cursor.isNull(offset + 6) ? null : cursor.getString(offset + 6), // deep - cursor.isNull(offset + 7) ? null : cursor.getString(offset + 7), // deptName - cursor.isNull(offset + 8) ? null : cursor.getString(offset + 8), // deptid - cursor.isNull(offset + 9) ? null : cursor.getString(offset + 9), // id - cursor.isNull(offset + 10) ? null : cursor.getString(offset + 10), // latBaidu - cursor.isNull(offset + 11) ? null : cursor.getString(offset + 11), // latGaode - cursor.isNull(offset + 12) ? null : cursor.getString(offset + 12), // lngBaidu - cursor.isNull(offset + 13) ? null : cursor.getString(offset + 13), // lngGaode - cursor.isNull(offset + 14) ? null : cursor.getString(offset + 14), // notes - cursor.isNull(offset + 15) ? null : cursor.getString(offset + 15), // photos - cursor.isNull(offset + 16) ? null : cursor.getString(offset + 16), // position - cursor.isNull(offset + 17) ? null : cursor.getString(offset + 17), // staff - cursor.isNull(offset + 18) ? null : cursor.getString(offset + 18), // tel - cursor.isNull(offset + 19) ? null : cursor.getString(offset + 19), // ts - cursor.isNull(offset + 20) ? null : cursor.getString(offset + 20), // valid - cursor.isNull(offset + 21) ? null : cursor.getString(offset + 21), // watchData - cursor.isNull(offset + 22) ? null : cursor.getString(offset + 22), // wellCode - cursor.isNull(offset + 23) ? null : cursor.getString(offset + 23), // wellName - cursor.isNull(offset + 24) ? null : cursor.getString(offset + 24), // wellType - cursor.isNull(offset + 25) ? null : cursor.getString(offset + 25) // wellTypeName + cursor.isNull(offset + 0) ? null : cursor.getLong(offset + 0), // kId + cursor.isNull(offset + 1) ? null : cursor.getString(offset + 1), // area + cursor.isNull(offset + 2) ? null : cursor.getString(offset + 2), // bfzt + cursor.isNull(offset + 3) ? null : cursor.getString(offset + 3), // bfztName + cursor.isNull(offset + 4) ? null : cursor.getString(offset + 4), // coordinateX + cursor.isNull(offset + 5) ? null : cursor.getString(offset + 5), // coordinateY + cursor.isNull(offset + 6) ? null : cursor.getString(offset + 6), // deep + cursor.isNull(offset + 7) ? null : cursor.getString(offset + 7), // deptName + cursor.isNull(offset + 8) ? null : cursor.getString(offset + 8), // deptid + cursor.isNull(offset + 9) ? null : cursor.getString(offset + 9), // id + cursor.isNull(offset + 10) ? null : cursor.getString(offset + 10), // latBaidu + cursor.isNull(offset + 11) ? null : cursor.getString(offset + 11), // latGaode + cursor.isNull(offset + 12) ? null : cursor.getString(offset + 12), // lngBaidu + cursor.isNull(offset + 13) ? null : cursor.getString(offset + 13), // lngGaode + cursor.isNull(offset + 14) ? null : cursor.getString(offset + 14), // notes + cursor.isNull(offset + 15) ? null : cursor.getString(offset + 15), // photos + cursor.isNull(offset + 16) ? null : cursor.getString(offset + 16), // position + cursor.isNull(offset + 17) ? null : cursor.getString(offset + 17), // staff + cursor.isNull(offset + 18) ? null : cursor.getString(offset + 18), // tel + cursor.isNull(offset + 19) ? null : cursor.getString(offset + 19), // ts + cursor.isNull(offset + 20) ? null : cursor.getString(offset + 20), // valid + cursor.isNull(offset + 21) ? null : cursor.getString(offset + 21), // watchData + cursor.isNull(offset + 22) ? null : cursor.getString(offset + 22), // wellCode + cursor.isNull(offset + 23) ? null : cursor.getString(offset + 23), // wellName + cursor.isNull(offset + 24) ? null : cursor.getString(offset + 24), // wellType + cursor.isNull(offset + 25) ? null : cursor.getString(offset + 25) // wellTypeName ); return entity; } - + @Override public void readEntity(Cursor cursor, MapWellLocalBean entity, int offset) { entity.setKId(cursor.isNull(offset + 0) ? null : cursor.getLong(offset + 0)); @@ -440,17 +435,17 @@ entity.setWellName(cursor.isNull(offset + 23) ? null : cursor.getString(offset + 23)); entity.setWellType(cursor.isNull(offset + 24) ? null : cursor.getString(offset + 24)); entity.setWellTypeName(cursor.isNull(offset + 25) ? null : cursor.getString(offset + 25)); - } - + } + @Override protected final Long updateKeyAfterInsert(MapWellLocalBean entity, long rowId) { entity.setKId(rowId); return rowId; } - + @Override public Long getKey(MapWellLocalBean entity) { - if (entity != null) { + if(entity != null) { return entity.getKId(); } else { return null; @@ -466,5 +461,5 @@ protected final boolean isEntityUpdateable() { return true; } - + } diff --git a/app/src/main/java/com/casic/app/smartwell/greendao/NoticeLocaleBeanDao.java b/app/src/main/java/com/casic/app/smartwell/greendao/NoticeLocaleBeanDao.java index 64312ed..deb2d49 100644 --- a/app/src/main/java/com/casic/app/smartwell/greendao/NoticeLocaleBeanDao.java +++ b/app/src/main/java/com/casic/app/smartwell/greendao/NoticeLocaleBeanDao.java @@ -12,10 +12,9 @@ import org.greenrobot.greendao.internal.DaoConfig; // THIS CODE IS GENERATED BY greenDAO, DO NOT EDIT. - -/** +/** * DAO for table "NOTICE_LOCALE_BEAN". - */ +*/ public class NoticeLocaleBeanDao extends AbstractDao { public static final String TABLENAME = "NOTICE_LOCALE_BEAN"; @@ -43,16 +42,14 @@ public NoticeLocaleBeanDao(DaoConfig config) { super(config); } - + public NoticeLocaleBeanDao(DaoConfig config, DaoSession daoSession) { super(config, daoSession); } - /** - * Creates the underlying database table. - */ + /** Creates the underlying database table. */ public static void createTable(Database db, boolean ifNotExists) { - String constraint = ifNotExists ? "IF NOT EXISTS " : ""; + String constraint = ifNotExists? "IF NOT EXISTS ": ""; db.execSQL("CREATE TABLE " + constraint + "\"NOTICE_LOCALE_BEAN\" (" + // "\"_id\" INTEGER PRIMARY KEY AUTOINCREMENT ," + // 0: id "\"MESSAGE_ID\" TEXT UNIQUE ," + // 1: messageId @@ -68,9 +65,7 @@ "\"NOTICE_TIME\" TEXT);"); // 11: noticeTime } - /** - * Drops the underlying database table. - */ + /** Drops the underlying database table. */ public static void dropTable(Database db, boolean ifExists) { String sql = "DROP TABLE " + (ifExists ? "IF EXISTS " : "") + "\"NOTICE_LOCALE_BEAN\""; db.execSQL(sql); @@ -79,62 +74,62 @@ @Override protected final void bindValues(DatabaseStatement stmt, NoticeLocaleBean entity) { stmt.clearBindings(); - + Long id = entity.getId(); if (id != null) { stmt.bindLong(1, id); } - + String messageId = entity.getMessageId(); if (messageId != null) { stmt.bindString(2, messageId); } - + String appid = entity.getAppid(); if (appid != null) { stmt.bindString(3, appid); } - + String clientId = entity.getClientId(); if (clientId != null) { stmt.bindString(4, clientId); } - + String taskId = entity.getTaskId(); if (taskId != null) { stmt.bindString(5, taskId); } - + String userId = entity.getUserId(); if (userId != null) { stmt.bindString(6, userId); } - + String title = entity.getTitle(); if (title != null) { stmt.bindString(7, title); } - + String content = entity.getContent(); if (content != null) { stmt.bindString(8, content); } - + String deviceCode = entity.getDeviceCode(); if (deviceCode != null) { stmt.bindString(9, deviceCode); } - + String jobId = entity.getJobId(); if (jobId != null) { stmt.bindString(10, jobId); } - + String isRead = entity.getIsRead(); if (isRead != null) { stmt.bindString(11, isRead); } - + String noticeTime = entity.getNoticeTime(); if (noticeTime != null) { stmt.bindString(12, noticeTime); @@ -144,62 +139,62 @@ @Override protected final void bindValues(SQLiteStatement stmt, NoticeLocaleBean entity) { stmt.clearBindings(); - + Long id = entity.getId(); if (id != null) { stmt.bindLong(1, id); } - + String messageId = entity.getMessageId(); if (messageId != null) { stmt.bindString(2, messageId); } - + String appid = entity.getAppid(); if (appid != null) { stmt.bindString(3, appid); } - + String clientId = entity.getClientId(); if (clientId != null) { stmt.bindString(4, clientId); } - + String taskId = entity.getTaskId(); if (taskId != null) { stmt.bindString(5, taskId); } - + String userId = entity.getUserId(); if (userId != null) { stmt.bindString(6, userId); } - + String title = entity.getTitle(); if (title != null) { stmt.bindString(7, title); } - + String content = entity.getContent(); if (content != null) { stmt.bindString(8, content); } - + String deviceCode = entity.getDeviceCode(); if (deviceCode != null) { stmt.bindString(9, deviceCode); } - + String jobId = entity.getJobId(); if (jobId != null) { stmt.bindString(10, jobId); } - + String isRead = entity.getIsRead(); if (isRead != null) { stmt.bindString(11, isRead); } - + String noticeTime = entity.getNoticeTime(); if (noticeTime != null) { stmt.bindString(12, noticeTime); @@ -209,27 +204,27 @@ @Override public Long readKey(Cursor cursor, int offset) { return cursor.isNull(offset + 0) ? null : cursor.getLong(offset + 0); - } + } @Override public NoticeLocaleBean readEntity(Cursor cursor, int offset) { NoticeLocaleBean entity = new NoticeLocaleBean( // - cursor.isNull(offset + 0) ? null : cursor.getLong(offset + 0), // id - cursor.isNull(offset + 1) ? null : cursor.getString(offset + 1), // messageId - cursor.isNull(offset + 2) ? null : cursor.getString(offset + 2), // appid - cursor.isNull(offset + 3) ? null : cursor.getString(offset + 3), // clientId - cursor.isNull(offset + 4) ? null : cursor.getString(offset + 4), // taskId - cursor.isNull(offset + 5) ? null : cursor.getString(offset + 5), // userId - cursor.isNull(offset + 6) ? null : cursor.getString(offset + 6), // title - cursor.isNull(offset + 7) ? null : cursor.getString(offset + 7), // content - cursor.isNull(offset + 8) ? null : cursor.getString(offset + 8), // deviceCode - cursor.isNull(offset + 9) ? null : cursor.getString(offset + 9), // jobId - cursor.isNull(offset + 10) ? null : cursor.getString(offset + 10), // isRead - cursor.isNull(offset + 11) ? null : cursor.getString(offset + 11) // noticeTime + cursor.isNull(offset + 0) ? null : cursor.getLong(offset + 0), // id + cursor.isNull(offset + 1) ? null : cursor.getString(offset + 1), // messageId + cursor.isNull(offset + 2) ? null : cursor.getString(offset + 2), // appid + cursor.isNull(offset + 3) ? null : cursor.getString(offset + 3), // clientId + cursor.isNull(offset + 4) ? null : cursor.getString(offset + 4), // taskId + cursor.isNull(offset + 5) ? null : cursor.getString(offset + 5), // userId + cursor.isNull(offset + 6) ? null : cursor.getString(offset + 6), // title + cursor.isNull(offset + 7) ? null : cursor.getString(offset + 7), // content + cursor.isNull(offset + 8) ? null : cursor.getString(offset + 8), // deviceCode + cursor.isNull(offset + 9) ? null : cursor.getString(offset + 9), // jobId + cursor.isNull(offset + 10) ? null : cursor.getString(offset + 10), // isRead + cursor.isNull(offset + 11) ? null : cursor.getString(offset + 11) // noticeTime ); return entity; } - + @Override public void readEntity(Cursor cursor, NoticeLocaleBean entity, int offset) { entity.setId(cursor.isNull(offset + 0) ? null : cursor.getLong(offset + 0)); @@ -244,17 +239,17 @@ entity.setJobId(cursor.isNull(offset + 9) ? null : cursor.getString(offset + 9)); entity.setIsRead(cursor.isNull(offset + 10) ? null : cursor.getString(offset + 10)); entity.setNoticeTime(cursor.isNull(offset + 11) ? null : cursor.getString(offset + 11)); - } - + } + @Override protected final Long updateKeyAfterInsert(NoticeLocaleBean entity, long rowId) { entity.setId(rowId); return rowId; } - + @Override public Long getKey(NoticeLocaleBean entity) { - if (entity != null) { + if(entity != null) { return entity.getId(); } else { return null; @@ -270,5 +265,5 @@ protected final boolean isEntityUpdateable() { return true; } - + } diff --git a/app/src/main/java/com/casic/app/smartwell/greendao/PipeLocalBeanDao.java b/app/src/main/java/com/casic/app/smartwell/greendao/PipeLocalBeanDao.java index aab4d3f..df5515a 100644 --- a/app/src/main/java/com/casic/app/smartwell/greendao/PipeLocalBeanDao.java +++ b/app/src/main/java/com/casic/app/smartwell/greendao/PipeLocalBeanDao.java @@ -12,10 +12,9 @@ import org.greenrobot.greendao.internal.DaoConfig; // THIS CODE IS GENERATED BY greenDAO, DO NOT EDIT. - -/** +/** * DAO for table "PIPE_LOCAL_BEAN". - */ +*/ public class PipeLocalBeanDao extends AbstractDao { public static final String TABLENAME = "PIPE_LOCAL_BEAN"; @@ -37,16 +36,14 @@ public PipeLocalBeanDao(DaoConfig config) { super(config); } - + public PipeLocalBeanDao(DaoConfig config, DaoSession daoSession) { super(config, daoSession); } - /** - * Creates the underlying database table. - */ + /** Creates the underlying database table. */ public static void createTable(Database db, boolean ifNotExists) { - String constraint = ifNotExists ? "IF NOT EXISTS " : ""; + String constraint = ifNotExists? "IF NOT EXISTS ": ""; db.execSQL("CREATE TABLE " + constraint + "\"PIPE_LOCAL_BEAN\" (" + // "\"_id\" INTEGER PRIMARY KEY AUTOINCREMENT ," + // 0: id "\"PIPE_CODE\" TEXT," + // 1: pipeCode @@ -56,9 +53,7 @@ "\"START_LONGITUDE_GD\" TEXT);"); // 5: startLongitudeGd } - /** - * Drops the underlying database table. - */ + /** Drops the underlying database table. */ public static void dropTable(Database db, boolean ifExists) { String sql = "DROP TABLE " + (ifExists ? "IF EXISTS " : "") + "\"PIPE_LOCAL_BEAN\""; db.execSQL(sql); @@ -67,32 +62,32 @@ @Override protected final void bindValues(DatabaseStatement stmt, PipeLocalBean entity) { stmt.clearBindings(); - + Long id = entity.getId(); if (id != null) { stmt.bindLong(1, id); } - + String pipeCode = entity.getPipeCode(); if (pipeCode != null) { stmt.bindString(2, pipeCode); } - + String endLatitudeGd = entity.getEndLatitudeGd(); if (endLatitudeGd != null) { stmt.bindString(3, endLatitudeGd); } - + String endLongitudeGd = entity.getEndLongitudeGd(); if (endLongitudeGd != null) { stmt.bindString(4, endLongitudeGd); } - + String startLatitudeGd = entity.getStartLatitudeGd(); if (startLatitudeGd != null) { stmt.bindString(5, startLatitudeGd); } - + String startLongitudeGd = entity.getStartLongitudeGd(); if (startLongitudeGd != null) { stmt.bindString(6, startLongitudeGd); @@ -102,32 +97,32 @@ @Override protected final void bindValues(SQLiteStatement stmt, PipeLocalBean entity) { stmt.clearBindings(); - + Long id = entity.getId(); if (id != null) { stmt.bindLong(1, id); } - + String pipeCode = entity.getPipeCode(); if (pipeCode != null) { stmt.bindString(2, pipeCode); } - + String endLatitudeGd = entity.getEndLatitudeGd(); if (endLatitudeGd != null) { stmt.bindString(3, endLatitudeGd); } - + String endLongitudeGd = entity.getEndLongitudeGd(); if (endLongitudeGd != null) { stmt.bindString(4, endLongitudeGd); } - + String startLatitudeGd = entity.getStartLatitudeGd(); if (startLatitudeGd != null) { stmt.bindString(5, startLatitudeGd); } - + String startLongitudeGd = entity.getStartLongitudeGd(); if (startLongitudeGd != null) { stmt.bindString(6, startLongitudeGd); @@ -137,21 +132,21 @@ @Override public Long readKey(Cursor cursor, int offset) { return cursor.isNull(offset + 0) ? null : cursor.getLong(offset + 0); - } + } @Override public PipeLocalBean readEntity(Cursor cursor, int offset) { PipeLocalBean entity = new PipeLocalBean( // - cursor.isNull(offset + 0) ? null : cursor.getLong(offset + 0), // id - cursor.isNull(offset + 1) ? null : cursor.getString(offset + 1), // pipeCode - cursor.isNull(offset + 2) ? null : cursor.getString(offset + 2), // endLatitudeGd - cursor.isNull(offset + 3) ? null : cursor.getString(offset + 3), // endLongitudeGd - cursor.isNull(offset + 4) ? null : cursor.getString(offset + 4), // startLatitudeGd - cursor.isNull(offset + 5) ? null : cursor.getString(offset + 5) // startLongitudeGd + cursor.isNull(offset + 0) ? null : cursor.getLong(offset + 0), // id + cursor.isNull(offset + 1) ? null : cursor.getString(offset + 1), // pipeCode + cursor.isNull(offset + 2) ? null : cursor.getString(offset + 2), // endLatitudeGd + cursor.isNull(offset + 3) ? null : cursor.getString(offset + 3), // endLongitudeGd + cursor.isNull(offset + 4) ? null : cursor.getString(offset + 4), // startLatitudeGd + cursor.isNull(offset + 5) ? null : cursor.getString(offset + 5) // startLongitudeGd ); return entity; } - + @Override public void readEntity(Cursor cursor, PipeLocalBean entity, int offset) { entity.setId(cursor.isNull(offset + 0) ? null : cursor.getLong(offset + 0)); @@ -160,17 +155,17 @@ entity.setEndLongitudeGd(cursor.isNull(offset + 3) ? null : cursor.getString(offset + 3)); entity.setStartLatitudeGd(cursor.isNull(offset + 4) ? null : cursor.getString(offset + 4)); entity.setStartLongitudeGd(cursor.isNull(offset + 5) ? null : cursor.getString(offset + 5)); - } - + } + @Override protected final Long updateKeyAfterInsert(PipeLocalBean entity, long rowId) { entity.setId(rowId); return rowId; } - + @Override public Long getKey(PipeLocalBean entity) { - if (entity != null) { + if(entity != null) { return entity.getId(); } else { return null; @@ -186,5 +181,5 @@ protected final boolean isEntityUpdateable() { return true; } - + } diff --git a/app/src/main/java/com/casic/app/smartwell/view/ChangePasswordActivity.kt b/app/src/main/java/com/casic/app/smartwell/view/ChangePasswordActivity.kt index 8e41039..9f1dd40 100644 --- a/app/src/main/java/com/casic/app/smartwell/view/ChangePasswordActivity.kt +++ b/app/src/main/java/com/casic/app/smartwell/view/ChangePasswordActivity.kt @@ -14,7 +14,7 @@ import com.pengxh.kt.lite.extensions.show import com.pengxh.kt.lite.utils.ActivityStackManager import com.pengxh.kt.lite.utils.LoadState -import com.pengxh.kt.lite.utils.LoadingDialogHub +import com.pengxh.kt.lite.utils.LoadingDialog import com.pengxh.kt.lite.widget.TitleBarView import java.nio.charset.StandardCharsets @@ -46,15 +46,15 @@ override fun observeRequestState() { userViewModel.loadState.observe(this) { when (it) { - is LoadState.Loading -> LoadingDialogHub.show(this, "修改中,请稍后") + is LoadState.Loading -> LoadingDialog.show(this, "修改中,请稍后") is LoadState.Success -> { - LoadingDialogHub.dismiss() + LoadingDialog.dismiss() AuthenticationHelper.removeToken() this.navigatePageTo() ActivityStackManager.finishAllActivity() } - else -> LoadingDialogHub.dismiss() + else -> LoadingDialog.dismiss() } } } diff --git a/app/src/main/java/com/casic/app/smartwell/view/DeployedWellActivity.kt b/app/src/main/java/com/casic/app/smartwell/view/DeployedWellActivity.kt index fb4339c..28a5078 100644 --- a/app/src/main/java/com/casic/app/smartwell/view/DeployedWellActivity.kt +++ b/app/src/main/java/com/casic/app/smartwell/view/DeployedWellActivity.kt @@ -83,8 +83,8 @@ } //添加分割线 - binding.deployedListView.addItemDecoration( - RecyclerViewItemOffsets(0, 5, 0, 5) + binding.recyclerView.addItemDecoration( + RecyclerViewItemOffsets(0, 7, 0, 7) ) } @@ -149,12 +149,11 @@ } else { item.deep.toString() + "m" } - viewHolder.setText(R.id.wellNameView, item.wellName) + viewHolder.setText(R.id.wellTypeView, item.wellTypeName) .setText(R.id.wellDepthView, "深:${deep}") .setText(R.id.wellCodeView, "点位编号:${item.wellCode}") - .setText(R.id.wellTypeView, "点位类型:${item.wellTypeName}") .setText(R.id.ownerShipView, "权属单位:${item.deptName}") - .setText(R.id.wellLocationView, "点位置:${item.position}") + .setText(R.id.wellLocationView, "点位位置:${item.position}") .setOnClickListener( R.id.operationButton, object : View.OnClickListener { override fun onClick(v: View?) { @@ -207,7 +206,7 @@ }) } } - binding.deployedListView.adapter = deployAdapter + binding.recyclerView.adapter = deployAdapter deployAdapter.setOnItemClickedListener(object : NormalRecyclerAdapter.OnItemClickedListener { override fun onItemClicked(position: Int, t: WellListModel.DataBean.RowsBean) { diff --git a/app/src/main/java/com/casic/app/smartwell/view/LoginActivity.kt b/app/src/main/java/com/casic/app/smartwell/view/LoginActivity.kt index e4bb0e3..834527b 100644 --- a/app/src/main/java/com/casic/app/smartwell/view/LoginActivity.kt +++ b/app/src/main/java/com/casic/app/smartwell/view/LoginActivity.kt @@ -21,7 +21,7 @@ import com.pengxh.kt.lite.extensions.navigatePageTo import com.pengxh.kt.lite.extensions.readAssetsFile import com.pengxh.kt.lite.extensions.show -import com.pengxh.kt.lite.utils.LoadingDialogHub +import com.pengxh.kt.lite.utils.LoadingDialog import com.pengxh.kt.lite.utils.SaveKeyValues import kotlinx.coroutines.Dispatchers import kotlinx.coroutines.launch @@ -106,11 +106,11 @@ override fun observeRequestState() { authenticateViewModel.loadState.observe(this) { - LoadingDialogHub.show(this, "登录中,请稍后") + LoadingDialog.show(this, "登录中,请稍后") } loginViewModel.loadState.observe(this) { - LoadingDialogHub.dismiss() + LoadingDialog.dismiss() } } diff --git a/app/src/main/java/com/casic/app/smartwell/view/OrderCompletedDetailActivity.kt b/app/src/main/java/com/casic/app/smartwell/view/OrderCompletedDetailActivity.kt index db8ad1f..75cd905 100644 --- a/app/src/main/java/com/casic/app/smartwell/view/OrderCompletedDetailActivity.kt +++ b/app/src/main/java/com/casic/app/smartwell/view/OrderCompletedDetailActivity.kt @@ -17,7 +17,7 @@ import com.pengxh.kt.lite.extensions.show import com.pengxh.kt.lite.utils.Constant import com.pengxh.kt.lite.utils.LoadState -import com.pengxh.kt.lite.utils.LoadingDialogHub +import com.pengxh.kt.lite.utils.LoadingDialog import com.pengxh.kt.lite.widget.TitleBarView import com.pengxh.kt.lite.widget.dialog.AlertMessageDialog @@ -44,7 +44,7 @@ } override fun initOnCreate(savedInstanceState: Bundle?) { - val jobId = intent.getStringExtra(Constant.INTENT_PARAM)!! + val jobId = intent.getStringExtra(Constant.INTENT_PARAM_KEY)!! orderViewModel = ViewModelProvider(this)[OrderViewModel::class.java] orderViewModel.getWorkOrderDetail(jobId) orderViewModel.detailModel.observe(this) { @@ -154,8 +154,8 @@ override fun observeRequestState() { orderViewModel.loadState.observe(this) { when (it) { - is LoadState.Loading -> LoadingDialogHub.show(this, "数据加载中,请稍后") - else -> LoadingDialogHub.dismiss() + is LoadState.Loading -> LoadingDialog.show(this, "数据加载中,请稍后") + else -> LoadingDialog.dismiss() } } } diff --git a/app/src/main/java/com/casic/app/smartwell/view/OrderInHandleDetailActivity.kt b/app/src/main/java/com/casic/app/smartwell/view/OrderInHandleDetailActivity.kt index d70a979..04a7d5d 100644 --- a/app/src/main/java/com/casic/app/smartwell/view/OrderInHandleDetailActivity.kt +++ b/app/src/main/java/com/casic/app/smartwell/view/OrderInHandleDetailActivity.kt @@ -38,7 +38,7 @@ import com.pengxh.kt.lite.extensions.show import com.pengxh.kt.lite.utils.Constant import com.pengxh.kt.lite.utils.LoadState -import com.pengxh.kt.lite.utils.LoadingDialogHub +import com.pengxh.kt.lite.utils.LoadingDialog import com.pengxh.kt.lite.widget.TitleBarView import com.pengxh.kt.lite.widget.dialog.AlertControlDialog import com.pengxh.kt.lite.widget.dialog.AlertMessageDialog @@ -93,7 +93,7 @@ ) binding.addImageRecyclerView.adapter = imageAdapter - val jobId = intent.getStringExtra(Constant.INTENT_PARAM)!!//初始化图片九宫格 + val jobId = intent.getStringExtra(Constant.INTENT_PARAM_KEY)!!//初始化图片九宫格 orderViewModel.getWorkOrderDetail(jobId) orderViewModel.detailModel.observe(this) { if (it.code == 200) { @@ -312,41 +312,41 @@ override fun observeRequestState() { orderViewModel.loadState.observe(this) { when (it) { - is LoadState.Loading -> LoadingDialogHub.show(this, "数据加载中,请稍后") - else -> LoadingDialogHub.dismiss() + is LoadState.Loading -> LoadingDialog.show(this, "数据加载中,请稍后") + else -> LoadingDialog.dismiss() } } uploadImageViewModel.loadState.observe(this) { when (it) { - LoadState.Loading -> LoadingDialogHub.show(this, "图片上传中,请稍后...") - else -> LoadingDialogHub.dismiss() + LoadState.Loading -> LoadingDialog.show(this, "图片上传中,请稍后...") + else -> LoadingDialog.dismiss() } } //转单状态处理 operationViewModel.loadState.observe(this) { when (it) { - is LoadState.Loading -> LoadingDialogHub.show(this, "转单中,请稍后") + is LoadState.Loading -> LoadingDialog.show(this, "转单中,请稍后") is LoadState.Success -> { - LoadingDialogHub.dismiss() + LoadingDialog.dismiss() this.finish() } - else -> LoadingDialogHub.dismiss() + else -> LoadingDialog.dismiss() } } //处理完成工单状态处理 operationViewModel.loadState.observe(this) { when (it) { - is LoadState.Loading -> LoadingDialogHub.show(this, "处理中,请稍后") + is LoadState.Loading -> LoadingDialog.show(this, "处理中,请稍后") is LoadState.Success -> { - LoadingDialogHub.dismiss() + LoadingDialog.dismiss() this.finish() } - else -> LoadingDialogHub.dismiss() + else -> LoadingDialog.dismiss() } } } diff --git a/app/src/main/java/com/casic/app/smartwell/view/OrderNotConfirmedDetailActivity.kt b/app/src/main/java/com/casic/app/smartwell/view/OrderNotConfirmedDetailActivity.kt index 8e036d2..687ec86 100644 --- a/app/src/main/java/com/casic/app/smartwell/view/OrderNotConfirmedDetailActivity.kt +++ b/app/src/main/java/com/casic/app/smartwell/view/OrderNotConfirmedDetailActivity.kt @@ -36,7 +36,7 @@ import com.pengxh.kt.lite.extensions.show import com.pengxh.kt.lite.utils.Constant import com.pengxh.kt.lite.utils.LoadState -import com.pengxh.kt.lite.utils.LoadingDialogHub +import com.pengxh.kt.lite.utils.LoadingDialog import com.pengxh.kt.lite.widget.TitleBarView import com.pengxh.kt.lite.widget.dialog.AlertControlDialog import com.pengxh.kt.lite.widget.dialog.AlertMessageDialog @@ -80,7 +80,7 @@ } override fun initOnCreate(savedInstanceState: Bundle?) { - val jobId = intent.getStringExtra(Constant.INTENT_PARAM)!! + val jobId = intent.getStringExtra(Constant.INTENT_PARAM_KEY)!! //初始化图片九宫格 //左外边距,左内边距,右内边距,右外边距 val viewWidth = getScreenWidth() - (10 + 10 + 10 + 10).dp2px(this) @@ -263,41 +263,41 @@ //数据加载状态处理 orderViewModel.loadState.observe(this) { when (it) { - is LoadState.Loading -> LoadingDialogHub.show(this, "数据加载中,请稍后") - else -> LoadingDialogHub.dismiss() + is LoadState.Loading -> LoadingDialog.show(this, "数据加载中,请稍后") + else -> LoadingDialog.dismiss() } } uploadImageViewModel.loadState.observe(this) { when (it) { - LoadState.Loading -> LoadingDialogHub.show(this, "图片上传中,请稍后") - else -> LoadingDialogHub.dismiss() + LoadState.Loading -> LoadingDialog.show(this, "图片上传中,请稍后") + else -> LoadingDialog.dismiss() } } //转单状态处理 operationViewModel.loadState.observe(this) { when (it) { - is LoadState.Loading -> LoadingDialogHub.show(this, "转单中,请稍后") + is LoadState.Loading -> LoadingDialog.show(this, "转单中,请稍后") is LoadState.Success -> { - LoadingDialogHub.dismiss() + LoadingDialog.dismiss() this.finish() } - else -> LoadingDialogHub.dismiss() + else -> LoadingDialog.dismiss() } } //确认工单状态处理 operationViewModel.loadState.observe(this) { when (it) { - is LoadState.Loading -> LoadingDialogHub.show(this, "处理中,请稍后") + is LoadState.Loading -> LoadingDialog.show(this, "处理中,请稍后") is LoadState.Success -> { - LoadingDialogHub.dismiss() + LoadingDialog.dismiss() this.finish() } - else -> LoadingDialogHub.dismiss() + else -> LoadingDialog.dismiss() } } } diff --git a/app/src/main/java/com/casic/app/smartwell/view/OrderNotProcessedDetailActivity.kt b/app/src/main/java/com/casic/app/smartwell/view/OrderNotProcessedDetailActivity.kt index d3f22dc..0c97a52 100644 --- a/app/src/main/java/com/casic/app/smartwell/view/OrderNotProcessedDetailActivity.kt +++ b/app/src/main/java/com/casic/app/smartwell/view/OrderNotProcessedDetailActivity.kt @@ -18,7 +18,7 @@ import com.pengxh.kt.lite.extensions.show import com.pengxh.kt.lite.utils.Constant import com.pengxh.kt.lite.utils.LoadState -import com.pengxh.kt.lite.utils.LoadingDialogHub +import com.pengxh.kt.lite.utils.LoadingDialog import com.pengxh.kt.lite.widget.TitleBarView import com.pengxh.kt.lite.widget.dialog.AlertControlDialog import com.pengxh.kt.lite.widget.dialog.AlertMessageDialog @@ -50,7 +50,7 @@ } override fun initOnCreate(savedInstanceState: Bundle?) { - this.jobId = intent.getStringExtra(Constant.INTENT_PARAM)!! + this.jobId = intent.getStringExtra(Constant.INTENT_PARAM_KEY)!! orderViewModel = ViewModelProvider(this)[OrderViewModel::class.java] operationViewModel = ViewModelProvider(this)[OperationViewModel::class.java] wellViewModel = ViewModelProvider(this)[WellViewModel::class.java] @@ -162,21 +162,21 @@ //数据加载状态处理 orderViewModel.loadState.observe(this) { when (it) { - is LoadState.Loading -> LoadingDialogHub.show(this, "数据加载中,请稍后") - else -> LoadingDialogHub.dismiss() + is LoadState.Loading -> LoadingDialog.show(this, "数据加载中,请稍后") + else -> LoadingDialog.dismiss() } } //接单状态处理 operationViewModel.loadState.observe(this) { when (it) { - is LoadState.Loading -> LoadingDialogHub.show(this, "接单中,请稍后") + is LoadState.Loading -> LoadingDialog.show(this, "接单中,请稍后") is LoadState.Success -> { - LoadingDialogHub.dismiss() + LoadingDialog.dismiss() this.finish() } - else -> LoadingDialogHub.dismiss() + else -> LoadingDialog.dismiss() } } } diff --git a/app/src/main/java/com/casic/app/smartwell/view/SearchResultActivity.kt b/app/src/main/java/com/casic/app/smartwell/view/SearchResultActivity.kt index 6a92917..4f3a674 100644 --- a/app/src/main/java/com/casic/app/smartwell/view/SearchResultActivity.kt +++ b/app/src/main/java/com/casic/app/smartwell/view/SearchResultActivity.kt @@ -19,7 +19,7 @@ import com.pengxh.kt.lite.extensions.show import com.pengxh.kt.lite.utils.Constant import com.pengxh.kt.lite.utils.LoadState -import com.pengxh.kt.lite.utils.LoadingDialogHub +import com.pengxh.kt.lite.utils.LoadingDialog import com.pengxh.kt.lite.utils.WeakReferenceHandler import com.pengxh.kt.lite.widget.TitleBarView import com.pengxh.kt.lite.widget.dialog.AlertControlDialog @@ -56,7 +56,7 @@ } override fun initOnCreate(savedInstanceState: Bundle?) { - args = intent.getStringArrayListExtra(Constant.INTENT_PARAM)!! + args = intent.getStringArrayListExtra(Constant.INTENT_PARAM_KEY)!! orderViewModel = ViewModelProvider(this)[OrderViewModel::class.java] operationViewModel = ViewModelProvider(this)[OperationViewModel::class.java] @@ -101,24 +101,24 @@ } } - binding.resultRecyclerView.addItemDecoration( - RecyclerViewItemOffsets(0, 5, 0, 5) + binding.recyclerView.addItemDecoration( + RecyclerViewItemOffsets(0, 7, 0, 7) ) } override fun observeRequestState() { orderViewModel.loadState.observe(this) { when (it) { - is LoadState.Loading -> LoadingDialogHub.show(this, "数据加载中,请稍后") - else -> LoadingDialogHub.dismiss() + is LoadState.Loading -> LoadingDialog.show(this, "数据加载中,请稍后") + else -> LoadingDialog.dismiss() } } //接单状态处理 operationViewModel.loadState.observe(this) { when (it) { - is LoadState.Loading -> LoadingDialogHub.show(this, "接单中,请稍后") + is LoadState.Loading -> LoadingDialog.show(this, "接单中,请稍后") is LoadState.Success -> { - LoadingDialogHub.dismiss() + LoadingDialog.dismiss() //接单成功之后刷新列表 dataBeans.removeAt(clickedPosition) searchResultAdapter.notifyItemRemoved(clickedPosition) @@ -127,7 +127,7 @@ ) } - else -> LoadingDialogHub.dismiss() + else -> LoadingDialog.dismiss() } } } @@ -162,7 +162,7 @@ } else { binding.emptyInclude.emptyView.hide() searchResultAdapter = SearchResultAdapter(this, dataBeans) - binding.resultRecyclerView.adapter = searchResultAdapter + binding.recyclerView.adapter = searchResultAdapter searchResultAdapter.setOnItemClickListener(object : SearchResultAdapter.OnItemClickListener { override fun onClicked(position: Int) { diff --git a/app/src/main/java/com/casic/app/smartwell/view/UnDeployWellActivity.kt b/app/src/main/java/com/casic/app/smartwell/view/UnDeployWellActivity.kt index 7f7cd3c..555c278 100644 --- a/app/src/main/java/com/casic/app/smartwell/view/UnDeployWellActivity.kt +++ b/app/src/main/java/com/casic/app/smartwell/view/UnDeployWellActivity.kt @@ -81,8 +81,8 @@ } } - binding.undeployListView.addItemDecoration( - RecyclerViewItemOffsets(0, 5, 0, 5) + binding.recyclerView.addItemDecoration( + RecyclerViewItemOffsets(0, 7, 0, 7) ) } @@ -147,12 +147,11 @@ } else { item.deep.toString() + "m" } - viewHolder.setText(R.id.wellNameView, item.wellName) + viewHolder.setText(R.id.wellTypeView, item.wellTypeName) .setText(R.id.wellDepthView, "深:${deep}") .setText(R.id.wellCodeView, "点位编号:${item.wellCode}") - .setText(R.id.wellTypeView, "点位类型:${item.wellTypeName}") .setText(R.id.ownerShipView, "权属单位:${item.deptName}") - .setText(R.id.wellLocationView, "点位置:${item.position}") + .setText(R.id.wellLocationView, "点位位置:${item.position}") .setOnClickListener( R.id.operationButton, object : View.OnClickListener { override fun onClick(v: View?) { @@ -185,7 +184,7 @@ ) } } - binding.undeployListView.adapter = unDeployAdapter + binding.recyclerView.adapter = unDeployAdapter unDeployAdapter.setOnItemClickedListener(object : NormalRecyclerAdapter.OnItemClickedListener { override fun onItemClicked(position: Int, t: WellListModel.DataBean.RowsBean) { diff --git a/app/src/main/java/com/casic/app/smartwell/view/WellDetailActivity.kt b/app/src/main/java/com/casic/app/smartwell/view/WellDetailActivity.kt index b50d067..eb8b468 100644 --- a/app/src/main/java/com/casic/app/smartwell/view/WellDetailActivity.kt +++ b/app/src/main/java/com/casic/app/smartwell/view/WellDetailActivity.kt @@ -16,7 +16,7 @@ import com.pengxh.kt.lite.extensions.show import com.pengxh.kt.lite.utils.Constant import com.pengxh.kt.lite.utils.LoadState -import com.pengxh.kt.lite.utils.LoadingDialogHub +import com.pengxh.kt.lite.utils.LoadingDialog import com.pengxh.kt.lite.widget.TitleBarView import com.pengxh.kt.lite.widget.dialog.AlertMessageDialog @@ -44,7 +44,7 @@ } override fun initOnCreate(savedInstanceState: Bundle?) { - val wellId = intent.getStringExtra(Constant.INTENT_PARAM)!! + val wellId = intent.getStringExtra(Constant.INTENT_PARAM_KEY)!! wellViewModel = ViewModelProvider(this)[WellViewModel::class.java] wellViewModel.getWellDetail(wellId) wellViewModel.wellDetailModel.observe(this) { @@ -132,8 +132,8 @@ override fun observeRequestState() { wellViewModel.loadState.observe(this) { when (it) { - is LoadState.Loading -> LoadingDialogHub.show(this, "数据加载中,请稍后") - else -> LoadingDialogHub.dismiss() + is LoadState.Loading -> LoadingDialog.show(this, "数据加载中,请稍后") + else -> LoadingDialog.dismiss() } } } diff --git a/app/src/main/java/com/casic/app/smartwell/view/WellManagementActivity.kt b/app/src/main/java/com/casic/app/smartwell/view/WellManagementActivity.kt index 084da95..457096b 100644 --- a/app/src/main/java/com/casic/app/smartwell/view/WellManagementActivity.kt +++ b/app/src/main/java/com/casic/app/smartwell/view/WellManagementActivity.kt @@ -94,8 +94,8 @@ } } - binding.wellListView.addItemDecoration( - RecyclerViewItemOffsets(0, 5, 0, 5) + binding.recyclerView.addItemDecoration( + RecyclerViewItemOffsets(0, 7, 0, 7) ) } @@ -175,13 +175,12 @@ } else { item.deep.toString() + "m" } - viewHolder.setText(R.id.wellNameView, item.wellName) + viewHolder.setText(R.id.wellTypeView, item.wellTypeName) .setText(R.id.wellStateView, "已${item.bfztName}") .setText(R.id.wellDepthView, "深:${deep}") .setText(R.id.wellCodeView, "点位编号:${item.wellCode}") - .setText(R.id.wellTypeView, "点位类型:${item.wellTypeName}") .setText(R.id.ownerShipView, "权属单位:${item.deptName}") - .setText(R.id.wellLocationView, "点位置:${item.position}") + .setText(R.id.wellLocationView, "点位位置:${item.position}") .setOnClickListener( R.id.navigationButton, object : View.OnClickListener { override fun onClick(v: View?) { @@ -200,7 +199,7 @@ ) } } - binding.wellListView.adapter = wellListAdapter + binding.recyclerView.adapter = wellListAdapter wellListAdapter.setOnItemClickedListener(object : NormalRecyclerAdapter.OnItemClickedListener { override fun onItemClicked(position: Int, t: WellListModel.DataBean.RowsBean) { diff --git a/app/src/main/java/com/casic/app/smartwell/view/WellMonitorActivity.kt b/app/src/main/java/com/casic/app/smartwell/view/WellMonitorActivity.kt index e3573eb..b87bdb7 100644 --- a/app/src/main/java/com/casic/app/smartwell/view/WellMonitorActivity.kt +++ b/app/src/main/java/com/casic/app/smartwell/view/WellMonitorActivity.kt @@ -11,7 +11,7 @@ import com.pengxh.kt.lite.base.KotlinBaseActivity import com.pengxh.kt.lite.utils.Constant import com.pengxh.kt.lite.utils.LoadState -import com.pengxh.kt.lite.utils.LoadingDialogHub +import com.pengxh.kt.lite.utils.LoadingDialog import com.pengxh.kt.lite.widget.TitleBarView class WellMonitorActivity : KotlinBaseActivity() { @@ -36,7 +36,7 @@ } override fun initOnCreate(savedInstanceState: Bundle?) { - val wellId = intent.getStringExtra(Constant.INTENT_PARAM)!! + val wellId = intent.getStringExtra(Constant.INTENT_PARAM_KEY)!! wellViewModel = ViewModelProvider(this)[WellViewModel::class.java] wellViewModel.getMonitorResult(wellId) wellViewModel.monitorModel.observe(this) { @@ -56,8 +56,8 @@ override fun observeRequestState() { wellViewModel.loadState.observe(this) { when (it) { - is LoadState.Loading -> LoadingDialogHub.show(this, "数据加载中,请稍后") - else -> LoadingDialogHub.dismiss() + is LoadState.Loading -> LoadingDialog.show(this, "数据加载中,请稍后") + else -> LoadingDialog.dismiss() } } } diff --git a/app/src/main/java/com/casic/app/smartwell/view/WellOperationActivity.kt b/app/src/main/java/com/casic/app/smartwell/view/WellOperationActivity.kt index 8d333bf..347ebb6 100644 --- a/app/src/main/java/com/casic/app/smartwell/view/WellOperationActivity.kt +++ b/app/src/main/java/com/casic/app/smartwell/view/WellOperationActivity.kt @@ -23,7 +23,7 @@ import com.pengxh.kt.lite.extensions.navigatePageTo import com.pengxh.kt.lite.extensions.show import com.pengxh.kt.lite.utils.LoadState -import com.pengxh.kt.lite.utils.LoadingDialogHub +import com.pengxh.kt.lite.utils.LoadingDialog import com.pengxh.kt.lite.utils.WeakReferenceHandler import com.pengxh.kt.lite.widget.dialog.AlertControlDialog @@ -109,8 +109,8 @@ } } - binding.operationListView.addItemDecoration( - RecyclerViewItemOffsets(0, 5, 0, 5) + binding.recyclerView.addItemDecoration( + RecyclerViewItemOffsets(0, 7, 0, 7) ) } @@ -123,13 +123,13 @@ override fun observeRequestState() { wellViewModel.loadState.observe(this) { when (it) { - is LoadState.Loading -> LoadingDialogHub.show(this, "处理中,请稍后") + is LoadState.Loading -> LoadingDialog.show(this, "处理中,请稍后") is LoadState.Success -> { - LoadingDialogHub.dismiss() + LoadingDialog.dismiss() wellOperationAdapter.notifyItemChanged(clickedPosition) } - else -> LoadingDialogHub.dismiss() + else -> LoadingDialog.dismiss() } } } @@ -203,24 +203,23 @@ if (item.bfztName == "布防") { viewHolder.setImageResource( R.id.wellStateView, R.drawable.bg_solid_text_green_radius_5 - ).setText(R.id.wellStateView, "撤防") + ).setText(R.id.operationButton, "撤防") } else { viewHolder.setImageResource( R.id.wellStateView, R.drawable.bg_solid_text_red_radius_5 - ).setText(R.id.wellStateView, "布防") + ).setText(R.id.operationButton, "布防") } val deep = if (item.deep.toString().isBlank()) { "未知" } else { item.deep.toString() + "m" } - viewHolder.setText(R.id.wellNameView, item.wellName) + viewHolder.setText(R.id.wellTypeView, item.wellTypeName) .setText(R.id.wellStateView, "已${item.bfztName}") .setText(R.id.wellDepthView, "深:${deep}") .setText(R.id.wellCodeView, "点位编号:${item.wellCode}") - .setText(R.id.wellTypeView, "点位类型:${item.wellTypeName}") .setText(R.id.ownerShipView, "权属单位:${item.deptName}") - .setText(R.id.wellLocationView, "点位置:${item.position}") + .setText(R.id.wellLocationView, "点位位置:${item.position}") .setOnClickListener( R.id.operationButton, object : View.OnClickListener { override fun onClick(v: View?) { @@ -280,7 +279,7 @@ ) } } - binding.operationListView.adapter = wellOperationAdapter + binding.recyclerView.adapter = wellOperationAdapter wellOperationAdapter.setOnItemClickedListener(object : NormalRecyclerAdapter.OnItemClickedListener { override fun onItemClicked(position: Int, t: WellListModel.DataBean.RowsBean) { diff --git a/app/src/main/res/drawable/ic_down.xml b/app/src/main/res/drawable/ic_down.xml index 20e6476..6987e6c 100644 --- a/app/src/main/res/drawable/ic_down.xml +++ b/app/src/main/res/drawable/ic_down.xml @@ -1,6 +1,6 @@ + + diff --git a/app/src/main/res/layout/activity_about_us.xml b/app/src/main/res/layout/activity_about_us.xml index 9091a00..d5fbd0d 100644 --- a/app/src/main/res/layout/activity_about_us.xml +++ b/app/src/main/res/layout/activity_about_us.xml @@ -12,13 +12,7 @@ android:layout_width="match_parent" android:layout_height="wrap_content" android:background="@color/mainThemeColor" - app:tbv_left_image="@drawable/ic_title_left" - app:tbv_only_show_title="false" - app:tbv_show_left_image="true" - app:tbv_show_right_image="false" - app:tbv_text="关于我们" - app:tbv_text_color="@color/white" - app:tbv_text_size="@dimen/sp_18" /> + app:tbv_text="关于我们" /> + app:tbv_text="修改密码" /> + app:tbv_text="布防列表" /> + app:tbv_text="帮助中心" /> + app:tbv_text="工单详情" /> + app:tbv_text="工单详情" /> + app:tbv_text="工单详情" /> + app:tbv_text="工单详情" /> + app:tbv_text="超时工单" /> + app:tbv_text="工单查询" /> + app:tbv_text="查询结果" /> + app:tbv_text="撤防列表" /> + app:tbv_text="个人资料" /> + app:tbv_text="点位详情" /> + app:tbv_text="监控内容" /> - - - - - - + android:layout_height="wrap_content" + android:background="@color/mainThemeColor" + app:tbv_show_left_image="false" + app:tbv_show_right_image="true" + app:tbv_text="首页" /> - + - + - - - - - - + android:layout_height="wrap_content" + android:background="@color/mainThemeColor" + app:tbv_right_image="@drawable/ic_search_white" + app:tbv_show_left_image="false" + app:tbv_show_right_image="true" + app:tbv_text="工单" /> - - - - - - \ No newline at end of file diff --git a/app/src/main/res/layout/item_deployed_rv.xml b/app/src/main/res/layout/item_deployed_rv.xml index 391ad28..fadcf1d 100644 --- a/app/src/main/res/layout/item_deployed_rv.xml +++ b/app/src/main/res/layout/item_deployed_rv.xml @@ -3,10 +3,9 @@ xmlns:app="http://schemas.android.com/apk/res-auto" android:layout_width="match_parent" android:layout_height="wrap_content" - android:layout_marginHorizontal="@dimen/dp_5" android:background="@drawable/bg_solid_layout_white_radius_10" android:orientation="vertical" - android:padding="@dimen/dp_5"> + android:padding="@dimen/dp_7"> @@ -42,63 +41,63 @@ android:textColor="@color/subTextColor" /> - - - - - + android:gravity="center" + android:orientation="horizontal"> - + - + - + + + + + + android:gravity="center" + android:orientation="vertical"> - - + + + + + \ No newline at end of file diff --git a/app/src/main/res/layout/item_order_completed_rv.xml b/app/src/main/res/layout/item_order_completed_rv.xml index e4ff890..3c78a0f 100644 --- a/app/src/main/res/layout/item_order_completed_rv.xml +++ b/app/src/main/res/layout/item_order_completed_rv.xml @@ -96,6 +96,7 @@ android:layout_height="wrap_content" android:layout_alignParentEnd="true" android:layout_centerVertical="true" + android:padding="@dimen/dp_10" android:src="@drawable/ic_down" /> diff --git a/app/src/main/res/layout/item_order_in_handle_rv.xml b/app/src/main/res/layout/item_order_in_handle_rv.xml index e4ff890..3c78a0f 100644 --- a/app/src/main/res/layout/item_order_in_handle_rv.xml +++ b/app/src/main/res/layout/item_order_in_handle_rv.xml @@ -96,6 +96,7 @@ android:layout_height="wrap_content" android:layout_alignParentEnd="true" android:layout_centerVertical="true" + android:padding="@dimen/dp_10" android:src="@drawable/ic_down" /> diff --git a/app/src/main/res/layout/item_order_not_confirmed_rv.xml b/app/src/main/res/layout/item_order_not_confirmed_rv.xml index d848810..795d7e8 100644 --- a/app/src/main/res/layout/item_order_not_confirmed_rv.xml +++ b/app/src/main/res/layout/item_order_not_confirmed_rv.xml @@ -96,6 +96,7 @@ android:layout_height="wrap_content" android:layout_alignParentEnd="true" android:layout_centerVertical="true" + android:padding="@dimen/dp_10" android:src="@drawable/ic_down" /> diff --git a/app/src/main/res/layout/item_order_not_processed_rv.xml b/app/src/main/res/layout/item_order_not_processed_rv.xml index 33138d4..7e943c6 100644 --- a/app/src/main/res/layout/item_order_not_processed_rv.xml +++ b/app/src/main/res/layout/item_order_not_processed_rv.xml @@ -3,10 +3,9 @@ xmlns:app="http://schemas.android.com/apk/res-auto" android:layout_width="match_parent" android:layout_height="wrap_content" - android:layout_marginHorizontal="@dimen/dp_5" android:background="@drawable/bg_solid_layout_white_radius_10" android:orientation="vertical" - android:padding="@dimen/dp_5"> + android:padding="@dimen/dp_7"> + android:padding="@dimen/dp_7"> - - + + diff --git a/app/src/main/res/layout/item_undeploy_rv.xml b/app/src/main/res/layout/item_undeploy_rv.xml index 934e472..4f14f5e 100644 --- a/app/src/main/res/layout/item_undeploy_rv.xml +++ b/app/src/main/res/layout/item_undeploy_rv.xml @@ -3,10 +3,9 @@ xmlns:app="http://schemas.android.com/apk/res-auto" android:layout_width="match_parent" android:layout_height="wrap_content" - android:layout_marginHorizontal="@dimen/dp_5" android:background="@drawable/bg_solid_layout_white_radius_10" android:orientation="vertical" - android:padding="@dimen/dp_5"> + android:padding="@dimen/dp_7"> @@ -42,63 +41,63 @@ android:textColor="@color/subTextColor" /> - - - - - + android:gravity="center" + android:orientation="horizontal"> - + - + - + + + + + + android:gravity="center" + android:orientation="vertical"> - - + + + + + \ No newline at end of file diff --git a/app/build.gradle b/app/build.gradle index 296fb6f..c18c251 100644 --- a/app/build.gradle +++ b/app/build.gradle @@ -40,10 +40,6 @@ // VIVO 相关应用参数 VIVO_APP_ID : "105749048", VIVO_APP_KEY : "e460fbf2c689e0f8c58ecc6aa62e1803", - - // 小米相关应用参数 -// XIAOMI_APP_ID : "", -// XIAOMI_APP_KEY : "", ] // 版本名后面添加一句话,意思就是flavor dimension 它的维度就是该版本号,多渠道打包很重要 @@ -107,7 +103,7 @@ dependencies { implementation fileTree(dir: 'libs', include: ['*.jar']) //基础依赖库 - implementation 'com.github.AndroidCoderPeng:Kotlin-lite-lib:1.0.10' + implementation 'com.github.AndroidCoderPeng:Kotlin-lite-lib:1.1.0' implementation 'androidx.appcompat:appcompat:1.6.1' implementation 'androidx.core:core-ktx:1.9.0' implementation 'androidx.constraintlayout:constraintlayout:2.1.4' @@ -165,8 +161,6 @@ implementation 'commons-codec:commons-codec:1.15' implementation 'com.android.support:support-annotations:28.0.0' implementation 'com.assist-v3:vivo:3.1.2' // vivo -// implementation 'com.getui.opt:xmp:3.3.1' // 小米 - //数据库框架 implementation 'org.greenrobot:greendao:3.3.0' //数据库升级 diff --git a/app/src/main/AndroidManifest.xml b/app/src/main/AndroidManifest.xml index c0af158..e0519bf 100644 --- a/app/src/main/AndroidManifest.xml +++ b/app/src/main/AndroidManifest.xml @@ -90,10 +90,10 @@ - + + android:value="ee96d8b5e12de3fbb29949efd57418a8" /> () @@ -150,7 +158,7 @@ val cameraPosition = CameraPosition(centerLatLng, 14f, 0f, 0f) val cameraUpdate = CameraUpdateFactory.newCameraPosition(cameraPosition) withContext(Dispatchers.Main) { - LoadingDialogHub.dismiss() + LoadingDialog.dismiss() aMap.animateCamera(cameraUpdate, 1500, null) } } @@ -239,11 +247,6 @@ } override fun initEvent() { - binding.rightOptionView.setOnClickListener { - val x = binding.rightOptionView.width - easyPopupWindow.width - easyPopupWindow.showAsDropDown(binding.rightOptionView, x, 0) - } - //撤防点位 binding.unDeployedLayout.setOnClickListener { requireContext().navigatePageTo() @@ -263,11 +266,11 @@ override fun observeRequestState() { wellViewModel.loadState.observe(this) { when (it) { - is LoadState.Loading -> LoadingDialogHub.show( + is LoadState.Loading -> LoadingDialog.show( requireActivity(), "数据加载中,请稍后..." ) - else -> LoadingDialogHub.dismiss() + else -> LoadingDialog.dismiss() } } } @@ -376,7 +379,7 @@ }).build().show() } }) - infoPopup.showAsDropDown(binding.rightOptionView) +// infoPopup.showAsDropDown(binding.rightOptionView) } override fun onCameraChange(p0: CameraPosition?) { diff --git a/app/src/main/java/com/casic/app/smartwell/fragment/HomePageNoClusterFragment.kt b/app/src/main/java/com/casic/app/smartwell/fragment/HomePageNoClusterFragment.kt index 802426a..b25f743 100644 --- a/app/src/main/java/com/casic/app/smartwell/fragment/HomePageNoClusterFragment.kt +++ b/app/src/main/java/com/casic/app/smartwell/fragment/HomePageNoClusterFragment.kt @@ -38,8 +38,9 @@ import com.pengxh.kt.lite.extensions.navigatePageTo import com.pengxh.kt.lite.extensions.show import com.pengxh.kt.lite.utils.LoadState -import com.pengxh.kt.lite.utils.LoadingDialogHub +import com.pengxh.kt.lite.utils.LoadingDialog import com.pengxh.kt.lite.widget.EasyPopupWindow +import com.pengxh.kt.lite.widget.TitleBarView import com.pengxh.kt.lite.widget.dialog.AlertControlDialog import kotlinx.coroutines.Dispatchers import kotlinx.coroutines.launch @@ -78,7 +79,15 @@ override fun setupTopBarLayout() { binding.rootView.initImmersionBar(this, false, R.color.mainThemeColor) - binding.titleView.text = "首页" + binding.titleView.setOnClickListener(object : TitleBarView.OnClickListener { + override fun onLeftClick() { + + } + + override fun onRightClick() { + easyPopupWindow.showAsDropDown(binding.titleView, binding.titleView.width, 0) + } + }) } override fun initOnCreate(savedInstanceState: Bundle?) { @@ -112,7 +121,7 @@ //渲染井位置 lifecycleScope.launch(Dispatchers.Main) { - LoadingDialogHub.show(requireActivity(), "数据加载中,请稍后") + LoadingDialog.show(requireActivity(), "数据加载中,请稍后") withContext(Dispatchers.IO) { //取Well缓存 val allMarkerOptions = ArrayList() @@ -144,7 +153,7 @@ val cameraPosition = CameraPosition(centerLatLng, 14f, 0f, 0f) val cameraUpdate = CameraUpdateFactory.newCameraPosition(cameraPosition) withContext(Dispatchers.Main) { - LoadingDialogHub.dismiss() + LoadingDialog.dismiss() aMap.animateCamera(cameraUpdate, 1500, null) } } @@ -238,11 +247,6 @@ } override fun initEvent() { - binding.rightOptionView.setOnClickListener { - val x = binding.rightOptionView.width - easyPopupWindow.width - easyPopupWindow.showAsDropDown(binding.rightOptionView, x, 0) - } - //撤防点位 binding.unDeployedLayout.setOnClickListener { requireContext().navigatePageTo() @@ -262,11 +266,11 @@ override fun observeRequestState() { wellViewModel.loadState.observe(this) { when (it) { - is LoadState.Loading -> LoadingDialogHub.show( + is LoadState.Loading -> LoadingDialog.show( requireActivity(), "数据加载中,请稍后..." ) - else -> LoadingDialogHub.dismiss() + else -> LoadingDialog.dismiss() } } } diff --git a/app/src/main/java/com/casic/app/smartwell/fragment/MinePageFragment.kt b/app/src/main/java/com/casic/app/smartwell/fragment/MinePageFragment.kt index 09a570c..dcb48f8 100644 --- a/app/src/main/java/com/casic/app/smartwell/fragment/MinePageFragment.kt +++ b/app/src/main/java/com/casic/app/smartwell/fragment/MinePageFragment.kt @@ -35,7 +35,7 @@ import com.pengxh.kt.lite.utils.ActivityStackManager import com.pengxh.kt.lite.utils.FileDownloadManager import com.pengxh.kt.lite.utils.LoadState -import com.pengxh.kt.lite.utils.LoadingDialogHub +import com.pengxh.kt.lite.utils.LoadingDialog import com.pengxh.kt.lite.widget.dialog.AlertControlDialog import com.pengxh.kt.lite.widget.dialog.BottomActionSheet import kotlinx.coroutines.Dispatchers @@ -60,7 +60,6 @@ override fun setupTopBarLayout() { binding.rootView.initImmersionBar(this, false, R.color.mainThemeColor) - binding.titleInclude.titleView.text = "我的" } override fun initOnCreate(savedInstanceState: Bundle?) { @@ -155,27 +154,27 @@ override fun observeRequestState() { userViewModel.loadState.observe(this) { when (it) { - is LoadState.Loading -> LoadingDialogHub.show( + is LoadState.Loading -> LoadingDialog.show( requireActivity(), "检查版本中,请稍后" ) - else -> LoadingDialogHub.dismiss() + else -> LoadingDialog.dismiss() } } wellViewModel.loadState.observe(this) { when (it) { - is LoadState.Loading -> LoadingDialogHub.show( + is LoadState.Loading -> LoadingDialog.show( requireActivity(), "数据更新中,请稍后" ) is LoadState.Fail -> { - LoadingDialogHub.dismiss() + LoadingDialog.dismiss() "数据更新超时".show(requireContext()) } else -> { - LoadingDialogHub.dismiss() + LoadingDialog.dismiss() AlertControlDialog.Builder().setContext(requireContext()).setTitle("温馨提示") .setMessage("数据更新成功,请重启应用").setNegativeButton("取消") .setPositiveButton("确定").setOnDialogButtonClickListener(object : @@ -197,17 +196,17 @@ lineViewModel.loadState.observe(this) { when (it) { - is LoadState.Loading -> LoadingDialogHub.show( + is LoadState.Loading -> LoadingDialog.show( requireActivity(), "数据更新中,请稍后" ) is LoadState.Fail -> { - LoadingDialogHub.dismiss() + LoadingDialog.dismiss() "数据更新超时".show(requireContext()) } else -> { - LoadingDialogHub.dismiss() + LoadingDialog.dismiss() AlertControlDialog.Builder().setContext(requireContext()).setTitle("温馨提示") .setMessage("数据更新成功,请重启应用").setNegativeButton("取消") .setPositiveButton("确定").setOnDialogButtonClickListener(object : diff --git a/app/src/main/java/com/casic/app/smartwell/fragment/NoticePageFragment.kt b/app/src/main/java/com/casic/app/smartwell/fragment/NoticePageFragment.kt index 171b555..3c93f54 100644 --- a/app/src/main/java/com/casic/app/smartwell/fragment/NoticePageFragment.kt +++ b/app/src/main/java/com/casic/app/smartwell/fragment/NoticePageFragment.kt @@ -48,7 +48,6 @@ override fun setupTopBarLayout() { binding.rootView.initImmersionBar(this, false, R.color.mainThemeColor) - binding.titleInclude.titleView.text = "消息" } override fun initOnCreate(savedInstanceState: Bundle?) { diff --git a/app/src/main/java/com/casic/app/smartwell/fragment/OrderListFragment.kt b/app/src/main/java/com/casic/app/smartwell/fragment/OrderListFragment.kt index 93ff35b..5e38acb 100644 --- a/app/src/main/java/com/casic/app/smartwell/fragment/OrderListFragment.kt +++ b/app/src/main/java/com/casic/app/smartwell/fragment/OrderListFragment.kt @@ -12,6 +12,7 @@ import com.casic.app.smartwell.view.SearchOrderActivity import com.pengxh.kt.lite.base.KotlinBaseFragment import com.pengxh.kt.lite.extensions.navigatePageTo +import com.pengxh.kt.lite.widget.TitleBarView class OrderListFragment : KotlinBaseFragment() { @@ -25,15 +26,22 @@ } override fun initViewBinding( - inflater: LayoutInflater, - container: ViewGroup? + inflater: LayoutInflater, container: ViewGroup? ): FragmentOrderBinding { return FragmentOrderBinding.inflate(inflater, container, false) } override fun setupTopBarLayout() { binding.rootView.initImmersionBar(this, false, R.color.mainThemeColor) - binding.titleView.text = "工单" + binding.titleView.setOnClickListener(object : TitleBarView.OnClickListener { + override fun onLeftClick() { + + } + + override fun onRightClick() { + requireContext().navigatePageTo() + } + }) } override fun initOnCreate(savedInstanceState: Bundle?) { @@ -51,8 +59,6 @@ } override fun initEvent() { - binding.rightOptionView.setOnClickListener { - requireContext().navigatePageTo() - } + } } \ No newline at end of file diff --git a/app/src/main/java/com/casic/app/smartwell/fragment/OrderNotProcessedFragment.kt b/app/src/main/java/com/casic/app/smartwell/fragment/OrderNotProcessedFragment.kt index 0b3d09d..2b6f21d 100644 --- a/app/src/main/java/com/casic/app/smartwell/fragment/OrderNotProcessedFragment.kt +++ b/app/src/main/java/com/casic/app/smartwell/fragment/OrderNotProcessedFragment.kt @@ -18,7 +18,7 @@ import com.pengxh.kt.lite.extensions.navigatePageTo import com.pengxh.kt.lite.extensions.show import com.pengxh.kt.lite.utils.LoadState -import com.pengxh.kt.lite.utils.LoadingDialogHub +import com.pengxh.kt.lite.utils.LoadingDialog import com.pengxh.kt.lite.utils.WeakReferenceHandler import com.pengxh.kt.lite.widget.dialog.AlertControlDialog @@ -78,8 +78,8 @@ operationViewModel = ViewModelProvider(this)[OperationViewModel::class.java] - binding.notProcessedView.addItemDecoration( - RecyclerViewItemOffsets(0, 5, 0, 5) + binding.recyclerView.addItemDecoration( + RecyclerViewItemOffsets(0, 7, 0, 7) ) } @@ -87,9 +87,9 @@ //接单状态处理 operationViewModel.loadState.observe(this) { when (it) { - is LoadState.Loading -> LoadingDialogHub.show(requireActivity(), "接单中,请稍后") + is LoadState.Loading -> LoadingDialog.show(requireActivity(), "接单中,请稍后") is LoadState.Success -> { - LoadingDialogHub.dismiss() + LoadingDialog.dismiss() //接单成功之后刷新列表 dataBeans.removeAt(clickedPosition) notProcessedAdapter.notifyItemRemoved(clickedPosition) @@ -98,7 +98,7 @@ ) } - else -> LoadingDialogHub.dismiss() + else -> LoadingDialog.dismiss() } } } @@ -131,7 +131,7 @@ } else { binding.emptyInclude.emptyView.hide() notProcessedAdapter = OrderNotProcessedAdapter(requireContext(), dataBeans) - binding.notProcessedView.adapter = notProcessedAdapter + binding.recyclerView.adapter = notProcessedAdapter notProcessedAdapter.setOnItemClickListener(object : OrderNotProcessedAdapter.OnItemClickListener { override fun onClicked(position: Int) { diff --git a/app/src/main/java/com/casic/app/smartwell/fragment/OvertimeNotAcceptFragment.kt b/app/src/main/java/com/casic/app/smartwell/fragment/OvertimeNotAcceptFragment.kt index a198545..9b318ca 100644 --- a/app/src/main/java/com/casic/app/smartwell/fragment/OvertimeNotAcceptFragment.kt +++ b/app/src/main/java/com/casic/app/smartwell/fragment/OvertimeNotAcceptFragment.kt @@ -18,7 +18,7 @@ import com.pengxh.kt.lite.extensions.navigatePageTo import com.pengxh.kt.lite.extensions.show import com.pengxh.kt.lite.utils.LoadState -import com.pengxh.kt.lite.utils.LoadingDialogHub +import com.pengxh.kt.lite.utils.LoadingDialog import com.pengxh.kt.lite.utils.WeakReferenceHandler import com.pengxh.kt.lite.widget.dialog.AlertControlDialog @@ -81,8 +81,8 @@ operationViewModel = ViewModelProvider(this)[OperationViewModel::class.java] - binding.notProcessedView.addItemDecoration( - RecyclerViewItemOffsets(0, 5, 0, 5) + binding.recyclerView.addItemDecoration( + RecyclerViewItemOffsets(0, 7, 0, 7) ) } @@ -90,9 +90,9 @@ //接单状态处理 operationViewModel.loadState.observe(this) { when (it) { - is LoadState.Loading -> LoadingDialogHub.show(requireActivity(), "接单中,请稍后") + is LoadState.Loading -> LoadingDialog.show(requireActivity(), "接单中,请稍后") is LoadState.Success -> { - LoadingDialogHub.dismiss() + LoadingDialog.dismiss() //接单成功之后刷新列表 dataBeans.removeAt(clickedPosition) notProcessedAdapter.notifyItemRemoved(clickedPosition) @@ -101,7 +101,7 @@ ) } - else -> LoadingDialogHub.dismiss() + else -> LoadingDialog.dismiss() } } } @@ -134,7 +134,7 @@ } else { binding.emptyInclude.emptyView.hide() notProcessedAdapter = OrderNotProcessedAdapter(requireContext(), dataBeans) - binding.notProcessedView.adapter = notProcessedAdapter + binding.recyclerView.adapter = notProcessedAdapter notProcessedAdapter.setOnItemClickListener(object : OrderNotProcessedAdapter.OnItemClickListener { override fun onClicked(position: Int) { diff --git a/app/src/main/java/com/casic/app/smartwell/greendao/DaoMaster.java b/app/src/main/java/com/casic/app/smartwell/greendao/DaoMaster.java index fdcf3a7..1e52b74 100644 --- a/app/src/main/java/com/casic/app/smartwell/greendao/DaoMaster.java +++ b/app/src/main/java/com/casic/app/smartwell/greendao/DaoMaster.java @@ -13,25 +13,20 @@ // THIS CODE IS GENERATED BY greenDAO, DO NOT EDIT. - /** * Master of DAO (schema version 4): knows all DAOs. */ public class DaoMaster extends AbstractDaoMaster { public static final int SCHEMA_VERSION = 4; - /** - * Creates underlying database table using DAOs. - */ + /** Creates underlying database table using DAOs. */ public static void createAllTables(Database db, boolean ifNotExists) { MapWellLocalBeanDao.createTable(db, ifNotExists); NoticeLocaleBeanDao.createTable(db, ifNotExists); PipeLocalBeanDao.createTable(db, ifNotExists); } - /** - * Drops underlying database table using DAOs. - */ + /** Drops underlying database table using DAOs. */ public static void dropAllTables(Database db, boolean ifExists) { MapWellLocalBeanDao.dropTable(db, ifExists); NoticeLocaleBeanDao.dropTable(db, ifExists); @@ -86,9 +81,7 @@ } } - /** - * WARNING: Drops all table on Upgrade! Use only during development. - */ + /** WARNING: Drops all table on Upgrade! Use only during development. */ public static class DevOpenHelper extends OpenHelper { public DevOpenHelper(Context context, String name) { super(context, name); diff --git a/app/src/main/java/com/casic/app/smartwell/greendao/DaoSession.java b/app/src/main/java/com/casic/app/smartwell/greendao/DaoSession.java index 0b36d17..3e40e3b 100644 --- a/app/src/main/java/com/casic/app/smartwell/greendao/DaoSession.java +++ b/app/src/main/java/com/casic/app/smartwell/greendao/DaoSession.java @@ -16,7 +16,7 @@ /** * {@inheritDoc} - * + * * @see org.greenrobot.greendao.AbstractDaoSession */ public class DaoSession extends AbstractDaoSession { @@ -50,7 +50,7 @@ registerDao(NoticeLocaleBean.class, noticeLocaleBeanDao); registerDao(PipeLocalBean.class, pipeLocalBeanDao); } - + public void clear() { mapWellLocalBeanDaoConfig.clearIdentityScope(); noticeLocaleBeanDaoConfig.clearIdentityScope(); diff --git a/app/src/main/java/com/casic/app/smartwell/greendao/MapWellLocalBeanDao.java b/app/src/main/java/com/casic/app/smartwell/greendao/MapWellLocalBeanDao.java index 8908fda..407bc92 100644 --- a/app/src/main/java/com/casic/app/smartwell/greendao/MapWellLocalBeanDao.java +++ b/app/src/main/java/com/casic/app/smartwell/greendao/MapWellLocalBeanDao.java @@ -12,10 +12,9 @@ import org.greenrobot.greendao.internal.DaoConfig; // THIS CODE IS GENERATED BY greenDAO, DO NOT EDIT. - -/** +/** * DAO for table "MAP_WELL_LOCAL_BEAN". - */ +*/ public class MapWellLocalBeanDao extends AbstractDao { public static final String TABLENAME = "MAP_WELL_LOCAL_BEAN"; @@ -57,16 +56,14 @@ public MapWellLocalBeanDao(DaoConfig config) { super(config); } - + public MapWellLocalBeanDao(DaoConfig config, DaoSession daoSession) { super(config, daoSession); } - /** - * Creates the underlying database table. - */ + /** Creates the underlying database table. */ public static void createTable(Database db, boolean ifNotExists) { - String constraint = ifNotExists ? "IF NOT EXISTS " : ""; + String constraint = ifNotExists? "IF NOT EXISTS ": ""; db.execSQL("CREATE TABLE " + constraint + "\"MAP_WELL_LOCAL_BEAN\" (" + // "\"_id\" INTEGER PRIMARY KEY AUTOINCREMENT ," + // 0: kId "\"AREA\" TEXT," + // 1: area @@ -96,9 +93,7 @@ "\"WELL_TYPE_NAME\" TEXT);"); // 25: wellTypeName } - /** - * Drops the underlying database table. - */ + /** Drops the underlying database table. */ public static void dropTable(Database db, boolean ifExists) { String sql = "DROP TABLE " + (ifExists ? "IF EXISTS " : "") + "\"MAP_WELL_LOCAL_BEAN\""; db.execSQL(sql); @@ -107,132 +102,132 @@ @Override protected final void bindValues(DatabaseStatement stmt, MapWellLocalBean entity) { stmt.clearBindings(); - + Long kId = entity.getKId(); if (kId != null) { stmt.bindLong(1, kId); } - + String area = entity.getArea(); if (area != null) { stmt.bindString(2, area); } - + String bfzt = entity.getBfzt(); if (bfzt != null) { stmt.bindString(3, bfzt); } - + String bfztName = entity.getBfztName(); if (bfztName != null) { stmt.bindString(4, bfztName); } - + String coordinateX = entity.getCoordinateX(); if (coordinateX != null) { stmt.bindString(5, coordinateX); } - + String coordinateY = entity.getCoordinateY(); if (coordinateY != null) { stmt.bindString(6, coordinateY); } - + String deep = entity.getDeep(); if (deep != null) { stmt.bindString(7, deep); } - + String deptName = entity.getDeptName(); if (deptName != null) { stmt.bindString(8, deptName); } - + String deptid = entity.getDeptid(); if (deptid != null) { stmt.bindString(9, deptid); } - + String id = entity.getId(); if (id != null) { stmt.bindString(10, id); } - + String latBaidu = entity.getLatBaidu(); if (latBaidu != null) { stmt.bindString(11, latBaidu); } - + String latGaode = entity.getLatGaode(); if (latGaode != null) { stmt.bindString(12, latGaode); } - + String lngBaidu = entity.getLngBaidu(); if (lngBaidu != null) { stmt.bindString(13, lngBaidu); } - + String lngGaode = entity.getLngGaode(); if (lngGaode != null) { stmt.bindString(14, lngGaode); } - + String notes = entity.getNotes(); if (notes != null) { stmt.bindString(15, notes); } - + String photos = entity.getPhotos(); if (photos != null) { stmt.bindString(16, photos); } - + String position = entity.getPosition(); if (position != null) { stmt.bindString(17, position); } - + String staff = entity.getStaff(); if (staff != null) { stmt.bindString(18, staff); } - + String tel = entity.getTel(); if (tel != null) { stmt.bindString(19, tel); } - + String ts = entity.getTs(); if (ts != null) { stmt.bindString(20, ts); } - + String valid = entity.getValid(); if (valid != null) { stmt.bindString(21, valid); } - + String watchData = entity.getWatchData(); if (watchData != null) { stmt.bindString(22, watchData); } - + String wellCode = entity.getWellCode(); if (wellCode != null) { stmt.bindString(23, wellCode); } - + String wellName = entity.getWellName(); if (wellName != null) { stmt.bindString(24, wellName); } - + String wellType = entity.getWellType(); if (wellType != null) { stmt.bindString(25, wellType); } - + String wellTypeName = entity.getWellTypeName(); if (wellTypeName != null) { stmt.bindString(26, wellTypeName); @@ -242,132 +237,132 @@ @Override protected final void bindValues(SQLiteStatement stmt, MapWellLocalBean entity) { stmt.clearBindings(); - + Long kId = entity.getKId(); if (kId != null) { stmt.bindLong(1, kId); } - + String area = entity.getArea(); if (area != null) { stmt.bindString(2, area); } - + String bfzt = entity.getBfzt(); if (bfzt != null) { stmt.bindString(3, bfzt); } - + String bfztName = entity.getBfztName(); if (bfztName != null) { stmt.bindString(4, bfztName); } - + String coordinateX = entity.getCoordinateX(); if (coordinateX != null) { stmt.bindString(5, coordinateX); } - + String coordinateY = entity.getCoordinateY(); if (coordinateY != null) { stmt.bindString(6, coordinateY); } - + String deep = entity.getDeep(); if (deep != null) { stmt.bindString(7, deep); } - + String deptName = entity.getDeptName(); if (deptName != null) { stmt.bindString(8, deptName); } - + String deptid = entity.getDeptid(); if (deptid != null) { stmt.bindString(9, deptid); } - + String id = entity.getId(); if (id != null) { stmt.bindString(10, id); } - + String latBaidu = entity.getLatBaidu(); if (latBaidu != null) { stmt.bindString(11, latBaidu); } - + String latGaode = entity.getLatGaode(); if (latGaode != null) { stmt.bindString(12, latGaode); } - + String lngBaidu = entity.getLngBaidu(); if (lngBaidu != null) { stmt.bindString(13, lngBaidu); } - + String lngGaode = entity.getLngGaode(); if (lngGaode != null) { stmt.bindString(14, lngGaode); } - + String notes = entity.getNotes(); if (notes != null) { stmt.bindString(15, notes); } - + String photos = entity.getPhotos(); if (photos != null) { stmt.bindString(16, photos); } - + String position = entity.getPosition(); if (position != null) { stmt.bindString(17, position); } - + String staff = entity.getStaff(); if (staff != null) { stmt.bindString(18, staff); } - + String tel = entity.getTel(); if (tel != null) { stmt.bindString(19, tel); } - + String ts = entity.getTs(); if (ts != null) { stmt.bindString(20, ts); } - + String valid = entity.getValid(); if (valid != null) { stmt.bindString(21, valid); } - + String watchData = entity.getWatchData(); if (watchData != null) { stmt.bindString(22, watchData); } - + String wellCode = entity.getWellCode(); if (wellCode != null) { stmt.bindString(23, wellCode); } - + String wellName = entity.getWellName(); if (wellName != null) { stmt.bindString(24, wellName); } - + String wellType = entity.getWellType(); if (wellType != null) { stmt.bindString(25, wellType); } - + String wellTypeName = entity.getWellTypeName(); if (wellTypeName != null) { stmt.bindString(26, wellTypeName); @@ -377,41 +372,41 @@ @Override public Long readKey(Cursor cursor, int offset) { return cursor.isNull(offset + 0) ? null : cursor.getLong(offset + 0); - } + } @Override public MapWellLocalBean readEntity(Cursor cursor, int offset) { MapWellLocalBean entity = new MapWellLocalBean( // - cursor.isNull(offset + 0) ? null : cursor.getLong(offset + 0), // kId - cursor.isNull(offset + 1) ? null : cursor.getString(offset + 1), // area - cursor.isNull(offset + 2) ? null : cursor.getString(offset + 2), // bfzt - cursor.isNull(offset + 3) ? null : cursor.getString(offset + 3), // bfztName - cursor.isNull(offset + 4) ? null : cursor.getString(offset + 4), // coordinateX - cursor.isNull(offset + 5) ? null : cursor.getString(offset + 5), // coordinateY - cursor.isNull(offset + 6) ? null : cursor.getString(offset + 6), // deep - cursor.isNull(offset + 7) ? null : cursor.getString(offset + 7), // deptName - cursor.isNull(offset + 8) ? null : cursor.getString(offset + 8), // deptid - cursor.isNull(offset + 9) ? null : cursor.getString(offset + 9), // id - cursor.isNull(offset + 10) ? null : cursor.getString(offset + 10), // latBaidu - cursor.isNull(offset + 11) ? null : cursor.getString(offset + 11), // latGaode - cursor.isNull(offset + 12) ? null : cursor.getString(offset + 12), // lngBaidu - cursor.isNull(offset + 13) ? null : cursor.getString(offset + 13), // lngGaode - cursor.isNull(offset + 14) ? null : cursor.getString(offset + 14), // notes - cursor.isNull(offset + 15) ? null : cursor.getString(offset + 15), // photos - cursor.isNull(offset + 16) ? null : cursor.getString(offset + 16), // position - cursor.isNull(offset + 17) ? null : cursor.getString(offset + 17), // staff - cursor.isNull(offset + 18) ? null : cursor.getString(offset + 18), // tel - cursor.isNull(offset + 19) ? null : cursor.getString(offset + 19), // ts - cursor.isNull(offset + 20) ? null : cursor.getString(offset + 20), // valid - cursor.isNull(offset + 21) ? null : cursor.getString(offset + 21), // watchData - cursor.isNull(offset + 22) ? null : cursor.getString(offset + 22), // wellCode - cursor.isNull(offset + 23) ? null : cursor.getString(offset + 23), // wellName - cursor.isNull(offset + 24) ? null : cursor.getString(offset + 24), // wellType - cursor.isNull(offset + 25) ? null : cursor.getString(offset + 25) // wellTypeName + cursor.isNull(offset + 0) ? null : cursor.getLong(offset + 0), // kId + cursor.isNull(offset + 1) ? null : cursor.getString(offset + 1), // area + cursor.isNull(offset + 2) ? null : cursor.getString(offset + 2), // bfzt + cursor.isNull(offset + 3) ? null : cursor.getString(offset + 3), // bfztName + cursor.isNull(offset + 4) ? null : cursor.getString(offset + 4), // coordinateX + cursor.isNull(offset + 5) ? null : cursor.getString(offset + 5), // coordinateY + cursor.isNull(offset + 6) ? null : cursor.getString(offset + 6), // deep + cursor.isNull(offset + 7) ? null : cursor.getString(offset + 7), // deptName + cursor.isNull(offset + 8) ? null : cursor.getString(offset + 8), // deptid + cursor.isNull(offset + 9) ? null : cursor.getString(offset + 9), // id + cursor.isNull(offset + 10) ? null : cursor.getString(offset + 10), // latBaidu + cursor.isNull(offset + 11) ? null : cursor.getString(offset + 11), // latGaode + cursor.isNull(offset + 12) ? null : cursor.getString(offset + 12), // lngBaidu + cursor.isNull(offset + 13) ? null : cursor.getString(offset + 13), // lngGaode + cursor.isNull(offset + 14) ? null : cursor.getString(offset + 14), // notes + cursor.isNull(offset + 15) ? null : cursor.getString(offset + 15), // photos + cursor.isNull(offset + 16) ? null : cursor.getString(offset + 16), // position + cursor.isNull(offset + 17) ? null : cursor.getString(offset + 17), // staff + cursor.isNull(offset + 18) ? null : cursor.getString(offset + 18), // tel + cursor.isNull(offset + 19) ? null : cursor.getString(offset + 19), // ts + cursor.isNull(offset + 20) ? null : cursor.getString(offset + 20), // valid + cursor.isNull(offset + 21) ? null : cursor.getString(offset + 21), // watchData + cursor.isNull(offset + 22) ? null : cursor.getString(offset + 22), // wellCode + cursor.isNull(offset + 23) ? null : cursor.getString(offset + 23), // wellName + cursor.isNull(offset + 24) ? null : cursor.getString(offset + 24), // wellType + cursor.isNull(offset + 25) ? null : cursor.getString(offset + 25) // wellTypeName ); return entity; } - + @Override public void readEntity(Cursor cursor, MapWellLocalBean entity, int offset) { entity.setKId(cursor.isNull(offset + 0) ? null : cursor.getLong(offset + 0)); @@ -440,17 +435,17 @@ entity.setWellName(cursor.isNull(offset + 23) ? null : cursor.getString(offset + 23)); entity.setWellType(cursor.isNull(offset + 24) ? null : cursor.getString(offset + 24)); entity.setWellTypeName(cursor.isNull(offset + 25) ? null : cursor.getString(offset + 25)); - } - + } + @Override protected final Long updateKeyAfterInsert(MapWellLocalBean entity, long rowId) { entity.setKId(rowId); return rowId; } - + @Override public Long getKey(MapWellLocalBean entity) { - if (entity != null) { + if(entity != null) { return entity.getKId(); } else { return null; @@ -466,5 +461,5 @@ protected final boolean isEntityUpdateable() { return true; } - + } diff --git a/app/src/main/java/com/casic/app/smartwell/greendao/NoticeLocaleBeanDao.java b/app/src/main/java/com/casic/app/smartwell/greendao/NoticeLocaleBeanDao.java index 64312ed..deb2d49 100644 --- a/app/src/main/java/com/casic/app/smartwell/greendao/NoticeLocaleBeanDao.java +++ b/app/src/main/java/com/casic/app/smartwell/greendao/NoticeLocaleBeanDao.java @@ -12,10 +12,9 @@ import org.greenrobot.greendao.internal.DaoConfig; // THIS CODE IS GENERATED BY greenDAO, DO NOT EDIT. - -/** +/** * DAO for table "NOTICE_LOCALE_BEAN". - */ +*/ public class NoticeLocaleBeanDao extends AbstractDao { public static final String TABLENAME = "NOTICE_LOCALE_BEAN"; @@ -43,16 +42,14 @@ public NoticeLocaleBeanDao(DaoConfig config) { super(config); } - + public NoticeLocaleBeanDao(DaoConfig config, DaoSession daoSession) { super(config, daoSession); } - /** - * Creates the underlying database table. - */ + /** Creates the underlying database table. */ public static void createTable(Database db, boolean ifNotExists) { - String constraint = ifNotExists ? "IF NOT EXISTS " : ""; + String constraint = ifNotExists? "IF NOT EXISTS ": ""; db.execSQL("CREATE TABLE " + constraint + "\"NOTICE_LOCALE_BEAN\" (" + // "\"_id\" INTEGER PRIMARY KEY AUTOINCREMENT ," + // 0: id "\"MESSAGE_ID\" TEXT UNIQUE ," + // 1: messageId @@ -68,9 +65,7 @@ "\"NOTICE_TIME\" TEXT);"); // 11: noticeTime } - /** - * Drops the underlying database table. - */ + /** Drops the underlying database table. */ public static void dropTable(Database db, boolean ifExists) { String sql = "DROP TABLE " + (ifExists ? "IF EXISTS " : "") + "\"NOTICE_LOCALE_BEAN\""; db.execSQL(sql); @@ -79,62 +74,62 @@ @Override protected final void bindValues(DatabaseStatement stmt, NoticeLocaleBean entity) { stmt.clearBindings(); - + Long id = entity.getId(); if (id != null) { stmt.bindLong(1, id); } - + String messageId = entity.getMessageId(); if (messageId != null) { stmt.bindString(2, messageId); } - + String appid = entity.getAppid(); if (appid != null) { stmt.bindString(3, appid); } - + String clientId = entity.getClientId(); if (clientId != null) { stmt.bindString(4, clientId); } - + String taskId = entity.getTaskId(); if (taskId != null) { stmt.bindString(5, taskId); } - + String userId = entity.getUserId(); if (userId != null) { stmt.bindString(6, userId); } - + String title = entity.getTitle(); if (title != null) { stmt.bindString(7, title); } - + String content = entity.getContent(); if (content != null) { stmt.bindString(8, content); } - + String deviceCode = entity.getDeviceCode(); if (deviceCode != null) { stmt.bindString(9, deviceCode); } - + String jobId = entity.getJobId(); if (jobId != null) { stmt.bindString(10, jobId); } - + String isRead = entity.getIsRead(); if (isRead != null) { stmt.bindString(11, isRead); } - + String noticeTime = entity.getNoticeTime(); if (noticeTime != null) { stmt.bindString(12, noticeTime); @@ -144,62 +139,62 @@ @Override protected final void bindValues(SQLiteStatement stmt, NoticeLocaleBean entity) { stmt.clearBindings(); - + Long id = entity.getId(); if (id != null) { stmt.bindLong(1, id); } - + String messageId = entity.getMessageId(); if (messageId != null) { stmt.bindString(2, messageId); } - + String appid = entity.getAppid(); if (appid != null) { stmt.bindString(3, appid); } - + String clientId = entity.getClientId(); if (clientId != null) { stmt.bindString(4, clientId); } - + String taskId = entity.getTaskId(); if (taskId != null) { stmt.bindString(5, taskId); } - + String userId = entity.getUserId(); if (userId != null) { stmt.bindString(6, userId); } - + String title = entity.getTitle(); if (title != null) { stmt.bindString(7, title); } - + String content = entity.getContent(); if (content != null) { stmt.bindString(8, content); } - + String deviceCode = entity.getDeviceCode(); if (deviceCode != null) { stmt.bindString(9, deviceCode); } - + String jobId = entity.getJobId(); if (jobId != null) { stmt.bindString(10, jobId); } - + String isRead = entity.getIsRead(); if (isRead != null) { stmt.bindString(11, isRead); } - + String noticeTime = entity.getNoticeTime(); if (noticeTime != null) { stmt.bindString(12, noticeTime); @@ -209,27 +204,27 @@ @Override public Long readKey(Cursor cursor, int offset) { return cursor.isNull(offset + 0) ? null : cursor.getLong(offset + 0); - } + } @Override public NoticeLocaleBean readEntity(Cursor cursor, int offset) { NoticeLocaleBean entity = new NoticeLocaleBean( // - cursor.isNull(offset + 0) ? null : cursor.getLong(offset + 0), // id - cursor.isNull(offset + 1) ? null : cursor.getString(offset + 1), // messageId - cursor.isNull(offset + 2) ? null : cursor.getString(offset + 2), // appid - cursor.isNull(offset + 3) ? null : cursor.getString(offset + 3), // clientId - cursor.isNull(offset + 4) ? null : cursor.getString(offset + 4), // taskId - cursor.isNull(offset + 5) ? null : cursor.getString(offset + 5), // userId - cursor.isNull(offset + 6) ? null : cursor.getString(offset + 6), // title - cursor.isNull(offset + 7) ? null : cursor.getString(offset + 7), // content - cursor.isNull(offset + 8) ? null : cursor.getString(offset + 8), // deviceCode - cursor.isNull(offset + 9) ? null : cursor.getString(offset + 9), // jobId - cursor.isNull(offset + 10) ? null : cursor.getString(offset + 10), // isRead - cursor.isNull(offset + 11) ? null : cursor.getString(offset + 11) // noticeTime + cursor.isNull(offset + 0) ? null : cursor.getLong(offset + 0), // id + cursor.isNull(offset + 1) ? null : cursor.getString(offset + 1), // messageId + cursor.isNull(offset + 2) ? null : cursor.getString(offset + 2), // appid + cursor.isNull(offset + 3) ? null : cursor.getString(offset + 3), // clientId + cursor.isNull(offset + 4) ? null : cursor.getString(offset + 4), // taskId + cursor.isNull(offset + 5) ? null : cursor.getString(offset + 5), // userId + cursor.isNull(offset + 6) ? null : cursor.getString(offset + 6), // title + cursor.isNull(offset + 7) ? null : cursor.getString(offset + 7), // content + cursor.isNull(offset + 8) ? null : cursor.getString(offset + 8), // deviceCode + cursor.isNull(offset + 9) ? null : cursor.getString(offset + 9), // jobId + cursor.isNull(offset + 10) ? null : cursor.getString(offset + 10), // isRead + cursor.isNull(offset + 11) ? null : cursor.getString(offset + 11) // noticeTime ); return entity; } - + @Override public void readEntity(Cursor cursor, NoticeLocaleBean entity, int offset) { entity.setId(cursor.isNull(offset + 0) ? null : cursor.getLong(offset + 0)); @@ -244,17 +239,17 @@ entity.setJobId(cursor.isNull(offset + 9) ? null : cursor.getString(offset + 9)); entity.setIsRead(cursor.isNull(offset + 10) ? null : cursor.getString(offset + 10)); entity.setNoticeTime(cursor.isNull(offset + 11) ? null : cursor.getString(offset + 11)); - } - + } + @Override protected final Long updateKeyAfterInsert(NoticeLocaleBean entity, long rowId) { entity.setId(rowId); return rowId; } - + @Override public Long getKey(NoticeLocaleBean entity) { - if (entity != null) { + if(entity != null) { return entity.getId(); } else { return null; @@ -270,5 +265,5 @@ protected final boolean isEntityUpdateable() { return true; } - + } diff --git a/app/src/main/java/com/casic/app/smartwell/greendao/PipeLocalBeanDao.java b/app/src/main/java/com/casic/app/smartwell/greendao/PipeLocalBeanDao.java index aab4d3f..df5515a 100644 --- a/app/src/main/java/com/casic/app/smartwell/greendao/PipeLocalBeanDao.java +++ b/app/src/main/java/com/casic/app/smartwell/greendao/PipeLocalBeanDao.java @@ -12,10 +12,9 @@ import org.greenrobot.greendao.internal.DaoConfig; // THIS CODE IS GENERATED BY greenDAO, DO NOT EDIT. - -/** +/** * DAO for table "PIPE_LOCAL_BEAN". - */ +*/ public class PipeLocalBeanDao extends AbstractDao { public static final String TABLENAME = "PIPE_LOCAL_BEAN"; @@ -37,16 +36,14 @@ public PipeLocalBeanDao(DaoConfig config) { super(config); } - + public PipeLocalBeanDao(DaoConfig config, DaoSession daoSession) { super(config, daoSession); } - /** - * Creates the underlying database table. - */ + /** Creates the underlying database table. */ public static void createTable(Database db, boolean ifNotExists) { - String constraint = ifNotExists ? "IF NOT EXISTS " : ""; + String constraint = ifNotExists? "IF NOT EXISTS ": ""; db.execSQL("CREATE TABLE " + constraint + "\"PIPE_LOCAL_BEAN\" (" + // "\"_id\" INTEGER PRIMARY KEY AUTOINCREMENT ," + // 0: id "\"PIPE_CODE\" TEXT," + // 1: pipeCode @@ -56,9 +53,7 @@ "\"START_LONGITUDE_GD\" TEXT);"); // 5: startLongitudeGd } - /** - * Drops the underlying database table. - */ + /** Drops the underlying database table. */ public static void dropTable(Database db, boolean ifExists) { String sql = "DROP TABLE " + (ifExists ? "IF EXISTS " : "") + "\"PIPE_LOCAL_BEAN\""; db.execSQL(sql); @@ -67,32 +62,32 @@ @Override protected final void bindValues(DatabaseStatement stmt, PipeLocalBean entity) { stmt.clearBindings(); - + Long id = entity.getId(); if (id != null) { stmt.bindLong(1, id); } - + String pipeCode = entity.getPipeCode(); if (pipeCode != null) { stmt.bindString(2, pipeCode); } - + String endLatitudeGd = entity.getEndLatitudeGd(); if (endLatitudeGd != null) { stmt.bindString(3, endLatitudeGd); } - + String endLongitudeGd = entity.getEndLongitudeGd(); if (endLongitudeGd != null) { stmt.bindString(4, endLongitudeGd); } - + String startLatitudeGd = entity.getStartLatitudeGd(); if (startLatitudeGd != null) { stmt.bindString(5, startLatitudeGd); } - + String startLongitudeGd = entity.getStartLongitudeGd(); if (startLongitudeGd != null) { stmt.bindString(6, startLongitudeGd); @@ -102,32 +97,32 @@ @Override protected final void bindValues(SQLiteStatement stmt, PipeLocalBean entity) { stmt.clearBindings(); - + Long id = entity.getId(); if (id != null) { stmt.bindLong(1, id); } - + String pipeCode = entity.getPipeCode(); if (pipeCode != null) { stmt.bindString(2, pipeCode); } - + String endLatitudeGd = entity.getEndLatitudeGd(); if (endLatitudeGd != null) { stmt.bindString(3, endLatitudeGd); } - + String endLongitudeGd = entity.getEndLongitudeGd(); if (endLongitudeGd != null) { stmt.bindString(4, endLongitudeGd); } - + String startLatitudeGd = entity.getStartLatitudeGd(); if (startLatitudeGd != null) { stmt.bindString(5, startLatitudeGd); } - + String startLongitudeGd = entity.getStartLongitudeGd(); if (startLongitudeGd != null) { stmt.bindString(6, startLongitudeGd); @@ -137,21 +132,21 @@ @Override public Long readKey(Cursor cursor, int offset) { return cursor.isNull(offset + 0) ? null : cursor.getLong(offset + 0); - } + } @Override public PipeLocalBean readEntity(Cursor cursor, int offset) { PipeLocalBean entity = new PipeLocalBean( // - cursor.isNull(offset + 0) ? null : cursor.getLong(offset + 0), // id - cursor.isNull(offset + 1) ? null : cursor.getString(offset + 1), // pipeCode - cursor.isNull(offset + 2) ? null : cursor.getString(offset + 2), // endLatitudeGd - cursor.isNull(offset + 3) ? null : cursor.getString(offset + 3), // endLongitudeGd - cursor.isNull(offset + 4) ? null : cursor.getString(offset + 4), // startLatitudeGd - cursor.isNull(offset + 5) ? null : cursor.getString(offset + 5) // startLongitudeGd + cursor.isNull(offset + 0) ? null : cursor.getLong(offset + 0), // id + cursor.isNull(offset + 1) ? null : cursor.getString(offset + 1), // pipeCode + cursor.isNull(offset + 2) ? null : cursor.getString(offset + 2), // endLatitudeGd + cursor.isNull(offset + 3) ? null : cursor.getString(offset + 3), // endLongitudeGd + cursor.isNull(offset + 4) ? null : cursor.getString(offset + 4), // startLatitudeGd + cursor.isNull(offset + 5) ? null : cursor.getString(offset + 5) // startLongitudeGd ); return entity; } - + @Override public void readEntity(Cursor cursor, PipeLocalBean entity, int offset) { entity.setId(cursor.isNull(offset + 0) ? null : cursor.getLong(offset + 0)); @@ -160,17 +155,17 @@ entity.setEndLongitudeGd(cursor.isNull(offset + 3) ? null : cursor.getString(offset + 3)); entity.setStartLatitudeGd(cursor.isNull(offset + 4) ? null : cursor.getString(offset + 4)); entity.setStartLongitudeGd(cursor.isNull(offset + 5) ? null : cursor.getString(offset + 5)); - } - + } + @Override protected final Long updateKeyAfterInsert(PipeLocalBean entity, long rowId) { entity.setId(rowId); return rowId; } - + @Override public Long getKey(PipeLocalBean entity) { - if (entity != null) { + if(entity != null) { return entity.getId(); } else { return null; @@ -186,5 +181,5 @@ protected final boolean isEntityUpdateable() { return true; } - + } diff --git a/app/src/main/java/com/casic/app/smartwell/view/ChangePasswordActivity.kt b/app/src/main/java/com/casic/app/smartwell/view/ChangePasswordActivity.kt index 8e41039..9f1dd40 100644 --- a/app/src/main/java/com/casic/app/smartwell/view/ChangePasswordActivity.kt +++ b/app/src/main/java/com/casic/app/smartwell/view/ChangePasswordActivity.kt @@ -14,7 +14,7 @@ import com.pengxh.kt.lite.extensions.show import com.pengxh.kt.lite.utils.ActivityStackManager import com.pengxh.kt.lite.utils.LoadState -import com.pengxh.kt.lite.utils.LoadingDialogHub +import com.pengxh.kt.lite.utils.LoadingDialog import com.pengxh.kt.lite.widget.TitleBarView import java.nio.charset.StandardCharsets @@ -46,15 +46,15 @@ override fun observeRequestState() { userViewModel.loadState.observe(this) { when (it) { - is LoadState.Loading -> LoadingDialogHub.show(this, "修改中,请稍后") + is LoadState.Loading -> LoadingDialog.show(this, "修改中,请稍后") is LoadState.Success -> { - LoadingDialogHub.dismiss() + LoadingDialog.dismiss() AuthenticationHelper.removeToken() this.navigatePageTo() ActivityStackManager.finishAllActivity() } - else -> LoadingDialogHub.dismiss() + else -> LoadingDialog.dismiss() } } } diff --git a/app/src/main/java/com/casic/app/smartwell/view/DeployedWellActivity.kt b/app/src/main/java/com/casic/app/smartwell/view/DeployedWellActivity.kt index fb4339c..28a5078 100644 --- a/app/src/main/java/com/casic/app/smartwell/view/DeployedWellActivity.kt +++ b/app/src/main/java/com/casic/app/smartwell/view/DeployedWellActivity.kt @@ -83,8 +83,8 @@ } //添加分割线 - binding.deployedListView.addItemDecoration( - RecyclerViewItemOffsets(0, 5, 0, 5) + binding.recyclerView.addItemDecoration( + RecyclerViewItemOffsets(0, 7, 0, 7) ) } @@ -149,12 +149,11 @@ } else { item.deep.toString() + "m" } - viewHolder.setText(R.id.wellNameView, item.wellName) + viewHolder.setText(R.id.wellTypeView, item.wellTypeName) .setText(R.id.wellDepthView, "深:${deep}") .setText(R.id.wellCodeView, "点位编号:${item.wellCode}") - .setText(R.id.wellTypeView, "点位类型:${item.wellTypeName}") .setText(R.id.ownerShipView, "权属单位:${item.deptName}") - .setText(R.id.wellLocationView, "点位置:${item.position}") + .setText(R.id.wellLocationView, "点位位置:${item.position}") .setOnClickListener( R.id.operationButton, object : View.OnClickListener { override fun onClick(v: View?) { @@ -207,7 +206,7 @@ }) } } - binding.deployedListView.adapter = deployAdapter + binding.recyclerView.adapter = deployAdapter deployAdapter.setOnItemClickedListener(object : NormalRecyclerAdapter.OnItemClickedListener { override fun onItemClicked(position: Int, t: WellListModel.DataBean.RowsBean) { diff --git a/app/src/main/java/com/casic/app/smartwell/view/LoginActivity.kt b/app/src/main/java/com/casic/app/smartwell/view/LoginActivity.kt index e4bb0e3..834527b 100644 --- a/app/src/main/java/com/casic/app/smartwell/view/LoginActivity.kt +++ b/app/src/main/java/com/casic/app/smartwell/view/LoginActivity.kt @@ -21,7 +21,7 @@ import com.pengxh.kt.lite.extensions.navigatePageTo import com.pengxh.kt.lite.extensions.readAssetsFile import com.pengxh.kt.lite.extensions.show -import com.pengxh.kt.lite.utils.LoadingDialogHub +import com.pengxh.kt.lite.utils.LoadingDialog import com.pengxh.kt.lite.utils.SaveKeyValues import kotlinx.coroutines.Dispatchers import kotlinx.coroutines.launch @@ -106,11 +106,11 @@ override fun observeRequestState() { authenticateViewModel.loadState.observe(this) { - LoadingDialogHub.show(this, "登录中,请稍后") + LoadingDialog.show(this, "登录中,请稍后") } loginViewModel.loadState.observe(this) { - LoadingDialogHub.dismiss() + LoadingDialog.dismiss() } } diff --git a/app/src/main/java/com/casic/app/smartwell/view/OrderCompletedDetailActivity.kt b/app/src/main/java/com/casic/app/smartwell/view/OrderCompletedDetailActivity.kt index db8ad1f..75cd905 100644 --- a/app/src/main/java/com/casic/app/smartwell/view/OrderCompletedDetailActivity.kt +++ b/app/src/main/java/com/casic/app/smartwell/view/OrderCompletedDetailActivity.kt @@ -17,7 +17,7 @@ import com.pengxh.kt.lite.extensions.show import com.pengxh.kt.lite.utils.Constant import com.pengxh.kt.lite.utils.LoadState -import com.pengxh.kt.lite.utils.LoadingDialogHub +import com.pengxh.kt.lite.utils.LoadingDialog import com.pengxh.kt.lite.widget.TitleBarView import com.pengxh.kt.lite.widget.dialog.AlertMessageDialog @@ -44,7 +44,7 @@ } override fun initOnCreate(savedInstanceState: Bundle?) { - val jobId = intent.getStringExtra(Constant.INTENT_PARAM)!! + val jobId = intent.getStringExtra(Constant.INTENT_PARAM_KEY)!! orderViewModel = ViewModelProvider(this)[OrderViewModel::class.java] orderViewModel.getWorkOrderDetail(jobId) orderViewModel.detailModel.observe(this) { @@ -154,8 +154,8 @@ override fun observeRequestState() { orderViewModel.loadState.observe(this) { when (it) { - is LoadState.Loading -> LoadingDialogHub.show(this, "数据加载中,请稍后") - else -> LoadingDialogHub.dismiss() + is LoadState.Loading -> LoadingDialog.show(this, "数据加载中,请稍后") + else -> LoadingDialog.dismiss() } } } diff --git a/app/src/main/java/com/casic/app/smartwell/view/OrderInHandleDetailActivity.kt b/app/src/main/java/com/casic/app/smartwell/view/OrderInHandleDetailActivity.kt index d70a979..04a7d5d 100644 --- a/app/src/main/java/com/casic/app/smartwell/view/OrderInHandleDetailActivity.kt +++ b/app/src/main/java/com/casic/app/smartwell/view/OrderInHandleDetailActivity.kt @@ -38,7 +38,7 @@ import com.pengxh.kt.lite.extensions.show import com.pengxh.kt.lite.utils.Constant import com.pengxh.kt.lite.utils.LoadState -import com.pengxh.kt.lite.utils.LoadingDialogHub +import com.pengxh.kt.lite.utils.LoadingDialog import com.pengxh.kt.lite.widget.TitleBarView import com.pengxh.kt.lite.widget.dialog.AlertControlDialog import com.pengxh.kt.lite.widget.dialog.AlertMessageDialog @@ -93,7 +93,7 @@ ) binding.addImageRecyclerView.adapter = imageAdapter - val jobId = intent.getStringExtra(Constant.INTENT_PARAM)!!//初始化图片九宫格 + val jobId = intent.getStringExtra(Constant.INTENT_PARAM_KEY)!!//初始化图片九宫格 orderViewModel.getWorkOrderDetail(jobId) orderViewModel.detailModel.observe(this) { if (it.code == 200) { @@ -312,41 +312,41 @@ override fun observeRequestState() { orderViewModel.loadState.observe(this) { when (it) { - is LoadState.Loading -> LoadingDialogHub.show(this, "数据加载中,请稍后") - else -> LoadingDialogHub.dismiss() + is LoadState.Loading -> LoadingDialog.show(this, "数据加载中,请稍后") + else -> LoadingDialog.dismiss() } } uploadImageViewModel.loadState.observe(this) { when (it) { - LoadState.Loading -> LoadingDialogHub.show(this, "图片上传中,请稍后...") - else -> LoadingDialogHub.dismiss() + LoadState.Loading -> LoadingDialog.show(this, "图片上传中,请稍后...") + else -> LoadingDialog.dismiss() } } //转单状态处理 operationViewModel.loadState.observe(this) { when (it) { - is LoadState.Loading -> LoadingDialogHub.show(this, "转单中,请稍后") + is LoadState.Loading -> LoadingDialog.show(this, "转单中,请稍后") is LoadState.Success -> { - LoadingDialogHub.dismiss() + LoadingDialog.dismiss() this.finish() } - else -> LoadingDialogHub.dismiss() + else -> LoadingDialog.dismiss() } } //处理完成工单状态处理 operationViewModel.loadState.observe(this) { when (it) { - is LoadState.Loading -> LoadingDialogHub.show(this, "处理中,请稍后") + is LoadState.Loading -> LoadingDialog.show(this, "处理中,请稍后") is LoadState.Success -> { - LoadingDialogHub.dismiss() + LoadingDialog.dismiss() this.finish() } - else -> LoadingDialogHub.dismiss() + else -> LoadingDialog.dismiss() } } } diff --git a/app/src/main/java/com/casic/app/smartwell/view/OrderNotConfirmedDetailActivity.kt b/app/src/main/java/com/casic/app/smartwell/view/OrderNotConfirmedDetailActivity.kt index 8e036d2..687ec86 100644 --- a/app/src/main/java/com/casic/app/smartwell/view/OrderNotConfirmedDetailActivity.kt +++ b/app/src/main/java/com/casic/app/smartwell/view/OrderNotConfirmedDetailActivity.kt @@ -36,7 +36,7 @@ import com.pengxh.kt.lite.extensions.show import com.pengxh.kt.lite.utils.Constant import com.pengxh.kt.lite.utils.LoadState -import com.pengxh.kt.lite.utils.LoadingDialogHub +import com.pengxh.kt.lite.utils.LoadingDialog import com.pengxh.kt.lite.widget.TitleBarView import com.pengxh.kt.lite.widget.dialog.AlertControlDialog import com.pengxh.kt.lite.widget.dialog.AlertMessageDialog @@ -80,7 +80,7 @@ } override fun initOnCreate(savedInstanceState: Bundle?) { - val jobId = intent.getStringExtra(Constant.INTENT_PARAM)!! + val jobId = intent.getStringExtra(Constant.INTENT_PARAM_KEY)!! //初始化图片九宫格 //左外边距,左内边距,右内边距,右外边距 val viewWidth = getScreenWidth() - (10 + 10 + 10 + 10).dp2px(this) @@ -263,41 +263,41 @@ //数据加载状态处理 orderViewModel.loadState.observe(this) { when (it) { - is LoadState.Loading -> LoadingDialogHub.show(this, "数据加载中,请稍后") - else -> LoadingDialogHub.dismiss() + is LoadState.Loading -> LoadingDialog.show(this, "数据加载中,请稍后") + else -> LoadingDialog.dismiss() } } uploadImageViewModel.loadState.observe(this) { when (it) { - LoadState.Loading -> LoadingDialogHub.show(this, "图片上传中,请稍后") - else -> LoadingDialogHub.dismiss() + LoadState.Loading -> LoadingDialog.show(this, "图片上传中,请稍后") + else -> LoadingDialog.dismiss() } } //转单状态处理 operationViewModel.loadState.observe(this) { when (it) { - is LoadState.Loading -> LoadingDialogHub.show(this, "转单中,请稍后") + is LoadState.Loading -> LoadingDialog.show(this, "转单中,请稍后") is LoadState.Success -> { - LoadingDialogHub.dismiss() + LoadingDialog.dismiss() this.finish() } - else -> LoadingDialogHub.dismiss() + else -> LoadingDialog.dismiss() } } //确认工单状态处理 operationViewModel.loadState.observe(this) { when (it) { - is LoadState.Loading -> LoadingDialogHub.show(this, "处理中,请稍后") + is LoadState.Loading -> LoadingDialog.show(this, "处理中,请稍后") is LoadState.Success -> { - LoadingDialogHub.dismiss() + LoadingDialog.dismiss() this.finish() } - else -> LoadingDialogHub.dismiss() + else -> LoadingDialog.dismiss() } } } diff --git a/app/src/main/java/com/casic/app/smartwell/view/OrderNotProcessedDetailActivity.kt b/app/src/main/java/com/casic/app/smartwell/view/OrderNotProcessedDetailActivity.kt index d3f22dc..0c97a52 100644 --- a/app/src/main/java/com/casic/app/smartwell/view/OrderNotProcessedDetailActivity.kt +++ b/app/src/main/java/com/casic/app/smartwell/view/OrderNotProcessedDetailActivity.kt @@ -18,7 +18,7 @@ import com.pengxh.kt.lite.extensions.show import com.pengxh.kt.lite.utils.Constant import com.pengxh.kt.lite.utils.LoadState -import com.pengxh.kt.lite.utils.LoadingDialogHub +import com.pengxh.kt.lite.utils.LoadingDialog import com.pengxh.kt.lite.widget.TitleBarView import com.pengxh.kt.lite.widget.dialog.AlertControlDialog import com.pengxh.kt.lite.widget.dialog.AlertMessageDialog @@ -50,7 +50,7 @@ } override fun initOnCreate(savedInstanceState: Bundle?) { - this.jobId = intent.getStringExtra(Constant.INTENT_PARAM)!! + this.jobId = intent.getStringExtra(Constant.INTENT_PARAM_KEY)!! orderViewModel = ViewModelProvider(this)[OrderViewModel::class.java] operationViewModel = ViewModelProvider(this)[OperationViewModel::class.java] wellViewModel = ViewModelProvider(this)[WellViewModel::class.java] @@ -162,21 +162,21 @@ //数据加载状态处理 orderViewModel.loadState.observe(this) { when (it) { - is LoadState.Loading -> LoadingDialogHub.show(this, "数据加载中,请稍后") - else -> LoadingDialogHub.dismiss() + is LoadState.Loading -> LoadingDialog.show(this, "数据加载中,请稍后") + else -> LoadingDialog.dismiss() } } //接单状态处理 operationViewModel.loadState.observe(this) { when (it) { - is LoadState.Loading -> LoadingDialogHub.show(this, "接单中,请稍后") + is LoadState.Loading -> LoadingDialog.show(this, "接单中,请稍后") is LoadState.Success -> { - LoadingDialogHub.dismiss() + LoadingDialog.dismiss() this.finish() } - else -> LoadingDialogHub.dismiss() + else -> LoadingDialog.dismiss() } } } diff --git a/app/src/main/java/com/casic/app/smartwell/view/SearchResultActivity.kt b/app/src/main/java/com/casic/app/smartwell/view/SearchResultActivity.kt index 6a92917..4f3a674 100644 --- a/app/src/main/java/com/casic/app/smartwell/view/SearchResultActivity.kt +++ b/app/src/main/java/com/casic/app/smartwell/view/SearchResultActivity.kt @@ -19,7 +19,7 @@ import com.pengxh.kt.lite.extensions.show import com.pengxh.kt.lite.utils.Constant import com.pengxh.kt.lite.utils.LoadState -import com.pengxh.kt.lite.utils.LoadingDialogHub +import com.pengxh.kt.lite.utils.LoadingDialog import com.pengxh.kt.lite.utils.WeakReferenceHandler import com.pengxh.kt.lite.widget.TitleBarView import com.pengxh.kt.lite.widget.dialog.AlertControlDialog @@ -56,7 +56,7 @@ } override fun initOnCreate(savedInstanceState: Bundle?) { - args = intent.getStringArrayListExtra(Constant.INTENT_PARAM)!! + args = intent.getStringArrayListExtra(Constant.INTENT_PARAM_KEY)!! orderViewModel = ViewModelProvider(this)[OrderViewModel::class.java] operationViewModel = ViewModelProvider(this)[OperationViewModel::class.java] @@ -101,24 +101,24 @@ } } - binding.resultRecyclerView.addItemDecoration( - RecyclerViewItemOffsets(0, 5, 0, 5) + binding.recyclerView.addItemDecoration( + RecyclerViewItemOffsets(0, 7, 0, 7) ) } override fun observeRequestState() { orderViewModel.loadState.observe(this) { when (it) { - is LoadState.Loading -> LoadingDialogHub.show(this, "数据加载中,请稍后") - else -> LoadingDialogHub.dismiss() + is LoadState.Loading -> LoadingDialog.show(this, "数据加载中,请稍后") + else -> LoadingDialog.dismiss() } } //接单状态处理 operationViewModel.loadState.observe(this) { when (it) { - is LoadState.Loading -> LoadingDialogHub.show(this, "接单中,请稍后") + is LoadState.Loading -> LoadingDialog.show(this, "接单中,请稍后") is LoadState.Success -> { - LoadingDialogHub.dismiss() + LoadingDialog.dismiss() //接单成功之后刷新列表 dataBeans.removeAt(clickedPosition) searchResultAdapter.notifyItemRemoved(clickedPosition) @@ -127,7 +127,7 @@ ) } - else -> LoadingDialogHub.dismiss() + else -> LoadingDialog.dismiss() } } } @@ -162,7 +162,7 @@ } else { binding.emptyInclude.emptyView.hide() searchResultAdapter = SearchResultAdapter(this, dataBeans) - binding.resultRecyclerView.adapter = searchResultAdapter + binding.recyclerView.adapter = searchResultAdapter searchResultAdapter.setOnItemClickListener(object : SearchResultAdapter.OnItemClickListener { override fun onClicked(position: Int) { diff --git a/app/src/main/java/com/casic/app/smartwell/view/UnDeployWellActivity.kt b/app/src/main/java/com/casic/app/smartwell/view/UnDeployWellActivity.kt index 7f7cd3c..555c278 100644 --- a/app/src/main/java/com/casic/app/smartwell/view/UnDeployWellActivity.kt +++ b/app/src/main/java/com/casic/app/smartwell/view/UnDeployWellActivity.kt @@ -81,8 +81,8 @@ } } - binding.undeployListView.addItemDecoration( - RecyclerViewItemOffsets(0, 5, 0, 5) + binding.recyclerView.addItemDecoration( + RecyclerViewItemOffsets(0, 7, 0, 7) ) } @@ -147,12 +147,11 @@ } else { item.deep.toString() + "m" } - viewHolder.setText(R.id.wellNameView, item.wellName) + viewHolder.setText(R.id.wellTypeView, item.wellTypeName) .setText(R.id.wellDepthView, "深:${deep}") .setText(R.id.wellCodeView, "点位编号:${item.wellCode}") - .setText(R.id.wellTypeView, "点位类型:${item.wellTypeName}") .setText(R.id.ownerShipView, "权属单位:${item.deptName}") - .setText(R.id.wellLocationView, "点位置:${item.position}") + .setText(R.id.wellLocationView, "点位位置:${item.position}") .setOnClickListener( R.id.operationButton, object : View.OnClickListener { override fun onClick(v: View?) { @@ -185,7 +184,7 @@ ) } } - binding.undeployListView.adapter = unDeployAdapter + binding.recyclerView.adapter = unDeployAdapter unDeployAdapter.setOnItemClickedListener(object : NormalRecyclerAdapter.OnItemClickedListener { override fun onItemClicked(position: Int, t: WellListModel.DataBean.RowsBean) { diff --git a/app/src/main/java/com/casic/app/smartwell/view/WellDetailActivity.kt b/app/src/main/java/com/casic/app/smartwell/view/WellDetailActivity.kt index b50d067..eb8b468 100644 --- a/app/src/main/java/com/casic/app/smartwell/view/WellDetailActivity.kt +++ b/app/src/main/java/com/casic/app/smartwell/view/WellDetailActivity.kt @@ -16,7 +16,7 @@ import com.pengxh.kt.lite.extensions.show import com.pengxh.kt.lite.utils.Constant import com.pengxh.kt.lite.utils.LoadState -import com.pengxh.kt.lite.utils.LoadingDialogHub +import com.pengxh.kt.lite.utils.LoadingDialog import com.pengxh.kt.lite.widget.TitleBarView import com.pengxh.kt.lite.widget.dialog.AlertMessageDialog @@ -44,7 +44,7 @@ } override fun initOnCreate(savedInstanceState: Bundle?) { - val wellId = intent.getStringExtra(Constant.INTENT_PARAM)!! + val wellId = intent.getStringExtra(Constant.INTENT_PARAM_KEY)!! wellViewModel = ViewModelProvider(this)[WellViewModel::class.java] wellViewModel.getWellDetail(wellId) wellViewModel.wellDetailModel.observe(this) { @@ -132,8 +132,8 @@ override fun observeRequestState() { wellViewModel.loadState.observe(this) { when (it) { - is LoadState.Loading -> LoadingDialogHub.show(this, "数据加载中,请稍后") - else -> LoadingDialogHub.dismiss() + is LoadState.Loading -> LoadingDialog.show(this, "数据加载中,请稍后") + else -> LoadingDialog.dismiss() } } } diff --git a/app/src/main/java/com/casic/app/smartwell/view/WellManagementActivity.kt b/app/src/main/java/com/casic/app/smartwell/view/WellManagementActivity.kt index 084da95..457096b 100644 --- a/app/src/main/java/com/casic/app/smartwell/view/WellManagementActivity.kt +++ b/app/src/main/java/com/casic/app/smartwell/view/WellManagementActivity.kt @@ -94,8 +94,8 @@ } } - binding.wellListView.addItemDecoration( - RecyclerViewItemOffsets(0, 5, 0, 5) + binding.recyclerView.addItemDecoration( + RecyclerViewItemOffsets(0, 7, 0, 7) ) } @@ -175,13 +175,12 @@ } else { item.deep.toString() + "m" } - viewHolder.setText(R.id.wellNameView, item.wellName) + viewHolder.setText(R.id.wellTypeView, item.wellTypeName) .setText(R.id.wellStateView, "已${item.bfztName}") .setText(R.id.wellDepthView, "深:${deep}") .setText(R.id.wellCodeView, "点位编号:${item.wellCode}") - .setText(R.id.wellTypeView, "点位类型:${item.wellTypeName}") .setText(R.id.ownerShipView, "权属单位:${item.deptName}") - .setText(R.id.wellLocationView, "点位置:${item.position}") + .setText(R.id.wellLocationView, "点位位置:${item.position}") .setOnClickListener( R.id.navigationButton, object : View.OnClickListener { override fun onClick(v: View?) { @@ -200,7 +199,7 @@ ) } } - binding.wellListView.adapter = wellListAdapter + binding.recyclerView.adapter = wellListAdapter wellListAdapter.setOnItemClickedListener(object : NormalRecyclerAdapter.OnItemClickedListener { override fun onItemClicked(position: Int, t: WellListModel.DataBean.RowsBean) { diff --git a/app/src/main/java/com/casic/app/smartwell/view/WellMonitorActivity.kt b/app/src/main/java/com/casic/app/smartwell/view/WellMonitorActivity.kt index e3573eb..b87bdb7 100644 --- a/app/src/main/java/com/casic/app/smartwell/view/WellMonitorActivity.kt +++ b/app/src/main/java/com/casic/app/smartwell/view/WellMonitorActivity.kt @@ -11,7 +11,7 @@ import com.pengxh.kt.lite.base.KotlinBaseActivity import com.pengxh.kt.lite.utils.Constant import com.pengxh.kt.lite.utils.LoadState -import com.pengxh.kt.lite.utils.LoadingDialogHub +import com.pengxh.kt.lite.utils.LoadingDialog import com.pengxh.kt.lite.widget.TitleBarView class WellMonitorActivity : KotlinBaseActivity() { @@ -36,7 +36,7 @@ } override fun initOnCreate(savedInstanceState: Bundle?) { - val wellId = intent.getStringExtra(Constant.INTENT_PARAM)!! + val wellId = intent.getStringExtra(Constant.INTENT_PARAM_KEY)!! wellViewModel = ViewModelProvider(this)[WellViewModel::class.java] wellViewModel.getMonitorResult(wellId) wellViewModel.monitorModel.observe(this) { @@ -56,8 +56,8 @@ override fun observeRequestState() { wellViewModel.loadState.observe(this) { when (it) { - is LoadState.Loading -> LoadingDialogHub.show(this, "数据加载中,请稍后") - else -> LoadingDialogHub.dismiss() + is LoadState.Loading -> LoadingDialog.show(this, "数据加载中,请稍后") + else -> LoadingDialog.dismiss() } } } diff --git a/app/src/main/java/com/casic/app/smartwell/view/WellOperationActivity.kt b/app/src/main/java/com/casic/app/smartwell/view/WellOperationActivity.kt index 8d333bf..347ebb6 100644 --- a/app/src/main/java/com/casic/app/smartwell/view/WellOperationActivity.kt +++ b/app/src/main/java/com/casic/app/smartwell/view/WellOperationActivity.kt @@ -23,7 +23,7 @@ import com.pengxh.kt.lite.extensions.navigatePageTo import com.pengxh.kt.lite.extensions.show import com.pengxh.kt.lite.utils.LoadState -import com.pengxh.kt.lite.utils.LoadingDialogHub +import com.pengxh.kt.lite.utils.LoadingDialog import com.pengxh.kt.lite.utils.WeakReferenceHandler import com.pengxh.kt.lite.widget.dialog.AlertControlDialog @@ -109,8 +109,8 @@ } } - binding.operationListView.addItemDecoration( - RecyclerViewItemOffsets(0, 5, 0, 5) + binding.recyclerView.addItemDecoration( + RecyclerViewItemOffsets(0, 7, 0, 7) ) } @@ -123,13 +123,13 @@ override fun observeRequestState() { wellViewModel.loadState.observe(this) { when (it) { - is LoadState.Loading -> LoadingDialogHub.show(this, "处理中,请稍后") + is LoadState.Loading -> LoadingDialog.show(this, "处理中,请稍后") is LoadState.Success -> { - LoadingDialogHub.dismiss() + LoadingDialog.dismiss() wellOperationAdapter.notifyItemChanged(clickedPosition) } - else -> LoadingDialogHub.dismiss() + else -> LoadingDialog.dismiss() } } } @@ -203,24 +203,23 @@ if (item.bfztName == "布防") { viewHolder.setImageResource( R.id.wellStateView, R.drawable.bg_solid_text_green_radius_5 - ).setText(R.id.wellStateView, "撤防") + ).setText(R.id.operationButton, "撤防") } else { viewHolder.setImageResource( R.id.wellStateView, R.drawable.bg_solid_text_red_radius_5 - ).setText(R.id.wellStateView, "布防") + ).setText(R.id.operationButton, "布防") } val deep = if (item.deep.toString().isBlank()) { "未知" } else { item.deep.toString() + "m" } - viewHolder.setText(R.id.wellNameView, item.wellName) + viewHolder.setText(R.id.wellTypeView, item.wellTypeName) .setText(R.id.wellStateView, "已${item.bfztName}") .setText(R.id.wellDepthView, "深:${deep}") .setText(R.id.wellCodeView, "点位编号:${item.wellCode}") - .setText(R.id.wellTypeView, "点位类型:${item.wellTypeName}") .setText(R.id.ownerShipView, "权属单位:${item.deptName}") - .setText(R.id.wellLocationView, "点位置:${item.position}") + .setText(R.id.wellLocationView, "点位位置:${item.position}") .setOnClickListener( R.id.operationButton, object : View.OnClickListener { override fun onClick(v: View?) { @@ -280,7 +279,7 @@ ) } } - binding.operationListView.adapter = wellOperationAdapter + binding.recyclerView.adapter = wellOperationAdapter wellOperationAdapter.setOnItemClickedListener(object : NormalRecyclerAdapter.OnItemClickedListener { override fun onItemClicked(position: Int, t: WellListModel.DataBean.RowsBean) { diff --git a/app/src/main/res/drawable/ic_down.xml b/app/src/main/res/drawable/ic_down.xml index 20e6476..6987e6c 100644 --- a/app/src/main/res/drawable/ic_down.xml +++ b/app/src/main/res/drawable/ic_down.xml @@ -1,6 +1,6 @@ + + diff --git a/app/src/main/res/layout/activity_about_us.xml b/app/src/main/res/layout/activity_about_us.xml index 9091a00..d5fbd0d 100644 --- a/app/src/main/res/layout/activity_about_us.xml +++ b/app/src/main/res/layout/activity_about_us.xml @@ -12,13 +12,7 @@ android:layout_width="match_parent" android:layout_height="wrap_content" android:background="@color/mainThemeColor" - app:tbv_left_image="@drawable/ic_title_left" - app:tbv_only_show_title="false" - app:tbv_show_left_image="true" - app:tbv_show_right_image="false" - app:tbv_text="关于我们" - app:tbv_text_color="@color/white" - app:tbv_text_size="@dimen/sp_18" /> + app:tbv_text="关于我们" /> + app:tbv_text="修改密码" /> + app:tbv_text="布防列表" /> + app:tbv_text="帮助中心" /> + app:tbv_text="工单详情" /> + app:tbv_text="工单详情" /> + app:tbv_text="工单详情" /> + app:tbv_text="工单详情" /> + app:tbv_text="超时工单" /> + app:tbv_text="工单查询" /> + app:tbv_text="查询结果" /> + app:tbv_text="撤防列表" /> + app:tbv_text="个人资料" /> + app:tbv_text="点位详情" /> + app:tbv_text="监控内容" /> - - - - - - + android:layout_height="wrap_content" + android:background="@color/mainThemeColor" + app:tbv_show_left_image="false" + app:tbv_show_right_image="true" + app:tbv_text="首页" /> - + - + - - - - - - + android:layout_height="wrap_content" + android:background="@color/mainThemeColor" + app:tbv_right_image="@drawable/ic_search_white" + app:tbv_show_left_image="false" + app:tbv_show_right_image="true" + app:tbv_text="工单" /> - - - - - - \ No newline at end of file diff --git a/app/src/main/res/layout/item_deployed_rv.xml b/app/src/main/res/layout/item_deployed_rv.xml index 391ad28..fadcf1d 100644 --- a/app/src/main/res/layout/item_deployed_rv.xml +++ b/app/src/main/res/layout/item_deployed_rv.xml @@ -3,10 +3,9 @@ xmlns:app="http://schemas.android.com/apk/res-auto" android:layout_width="match_parent" android:layout_height="wrap_content" - android:layout_marginHorizontal="@dimen/dp_5" android:background="@drawable/bg_solid_layout_white_radius_10" android:orientation="vertical" - android:padding="@dimen/dp_5"> + android:padding="@dimen/dp_7"> @@ -42,63 +41,63 @@ android:textColor="@color/subTextColor" /> - - - - - + android:gravity="center" + android:orientation="horizontal"> - + - + - + + + + + + android:gravity="center" + android:orientation="vertical"> - - + + + + + \ No newline at end of file diff --git a/app/src/main/res/layout/item_order_completed_rv.xml b/app/src/main/res/layout/item_order_completed_rv.xml index e4ff890..3c78a0f 100644 --- a/app/src/main/res/layout/item_order_completed_rv.xml +++ b/app/src/main/res/layout/item_order_completed_rv.xml @@ -96,6 +96,7 @@ android:layout_height="wrap_content" android:layout_alignParentEnd="true" android:layout_centerVertical="true" + android:padding="@dimen/dp_10" android:src="@drawable/ic_down" /> diff --git a/app/src/main/res/layout/item_order_in_handle_rv.xml b/app/src/main/res/layout/item_order_in_handle_rv.xml index e4ff890..3c78a0f 100644 --- a/app/src/main/res/layout/item_order_in_handle_rv.xml +++ b/app/src/main/res/layout/item_order_in_handle_rv.xml @@ -96,6 +96,7 @@ android:layout_height="wrap_content" android:layout_alignParentEnd="true" android:layout_centerVertical="true" + android:padding="@dimen/dp_10" android:src="@drawable/ic_down" /> diff --git a/app/src/main/res/layout/item_order_not_confirmed_rv.xml b/app/src/main/res/layout/item_order_not_confirmed_rv.xml index d848810..795d7e8 100644 --- a/app/src/main/res/layout/item_order_not_confirmed_rv.xml +++ b/app/src/main/res/layout/item_order_not_confirmed_rv.xml @@ -96,6 +96,7 @@ android:layout_height="wrap_content" android:layout_alignParentEnd="true" android:layout_centerVertical="true" + android:padding="@dimen/dp_10" android:src="@drawable/ic_down" /> diff --git a/app/src/main/res/layout/item_order_not_processed_rv.xml b/app/src/main/res/layout/item_order_not_processed_rv.xml index 33138d4..7e943c6 100644 --- a/app/src/main/res/layout/item_order_not_processed_rv.xml +++ b/app/src/main/res/layout/item_order_not_processed_rv.xml @@ -3,10 +3,9 @@ xmlns:app="http://schemas.android.com/apk/res-auto" android:layout_width="match_parent" android:layout_height="wrap_content" - android:layout_marginHorizontal="@dimen/dp_5" android:background="@drawable/bg_solid_layout_white_radius_10" android:orientation="vertical" - android:padding="@dimen/dp_5"> + android:padding="@dimen/dp_7"> + android:padding="@dimen/dp_7"> - - + + diff --git a/app/src/main/res/layout/item_undeploy_rv.xml b/app/src/main/res/layout/item_undeploy_rv.xml index 934e472..4f14f5e 100644 --- a/app/src/main/res/layout/item_undeploy_rv.xml +++ b/app/src/main/res/layout/item_undeploy_rv.xml @@ -3,10 +3,9 @@ xmlns:app="http://schemas.android.com/apk/res-auto" android:layout_width="match_parent" android:layout_height="wrap_content" - android:layout_marginHorizontal="@dimen/dp_5" android:background="@drawable/bg_solid_layout_white_radius_10" android:orientation="vertical" - android:padding="@dimen/dp_5"> + android:padding="@dimen/dp_7"> @@ -42,63 +41,63 @@ android:textColor="@color/subTextColor" /> - - - - - + android:gravity="center" + android:orientation="horizontal"> - + - + - + + + + + + android:gravity="center" + android:orientation="vertical"> - - + + + + + \ No newline at end of file diff --git a/app/src/main/res/layout/item_well_list_rv.xml b/app/src/main/res/layout/item_well_list_rv.xml index 7da09a1..8fc7eb2 100644 --- a/app/src/main/res/layout/item_well_list_rv.xml +++ b/app/src/main/res/layout/item_well_list_rv.xml @@ -1,12 +1,10 @@ + android:padding="@dimen/dp_7"> @@ -38,6 +36,7 @@ android:id="@+id/wellDepthView" android:layout_width="wrap_content" android:layout_height="wrap_content" + android:paddingHorizontal="@dimen/dp_5" android:text="深:5.5" android:textColor="@color/subTextColor" /> @@ -47,47 +46,42 @@ android:layout_width="wrap_content" android:layout_height="wrap_content" android:layout_marginTop="@dimen/dp_5" - android:text="井编号:W00002" - android:textColor="@color/subTextColor" /> - - - - + android:layout_height="wrap_content" + android:orientation="horizontal"> - + android:orientation="vertical"> - + + + + + + android:padding="@dimen/dp_5" + android:src="@drawable/ic_navigation" /> \ No newline at end of file diff --git a/app/build.gradle b/app/build.gradle index 296fb6f..c18c251 100644 --- a/app/build.gradle +++ b/app/build.gradle @@ -40,10 +40,6 @@ // VIVO 相关应用参数 VIVO_APP_ID : "105749048", VIVO_APP_KEY : "e460fbf2c689e0f8c58ecc6aa62e1803", - - // 小米相关应用参数 -// XIAOMI_APP_ID : "", -// XIAOMI_APP_KEY : "", ] // 版本名后面添加一句话,意思就是flavor dimension 它的维度就是该版本号,多渠道打包很重要 @@ -107,7 +103,7 @@ dependencies { implementation fileTree(dir: 'libs', include: ['*.jar']) //基础依赖库 - implementation 'com.github.AndroidCoderPeng:Kotlin-lite-lib:1.0.10' + implementation 'com.github.AndroidCoderPeng:Kotlin-lite-lib:1.1.0' implementation 'androidx.appcompat:appcompat:1.6.1' implementation 'androidx.core:core-ktx:1.9.0' implementation 'androidx.constraintlayout:constraintlayout:2.1.4' @@ -165,8 +161,6 @@ implementation 'commons-codec:commons-codec:1.15' implementation 'com.android.support:support-annotations:28.0.0' implementation 'com.assist-v3:vivo:3.1.2' // vivo -// implementation 'com.getui.opt:xmp:3.3.1' // 小米 - //数据库框架 implementation 'org.greenrobot:greendao:3.3.0' //数据库升级 diff --git a/app/src/main/AndroidManifest.xml b/app/src/main/AndroidManifest.xml index c0af158..e0519bf 100644 --- a/app/src/main/AndroidManifest.xml +++ b/app/src/main/AndroidManifest.xml @@ -90,10 +90,10 @@ - + + android:value="ee96d8b5e12de3fbb29949efd57418a8" /> () @@ -150,7 +158,7 @@ val cameraPosition = CameraPosition(centerLatLng, 14f, 0f, 0f) val cameraUpdate = CameraUpdateFactory.newCameraPosition(cameraPosition) withContext(Dispatchers.Main) { - LoadingDialogHub.dismiss() + LoadingDialog.dismiss() aMap.animateCamera(cameraUpdate, 1500, null) } } @@ -239,11 +247,6 @@ } override fun initEvent() { - binding.rightOptionView.setOnClickListener { - val x = binding.rightOptionView.width - easyPopupWindow.width - easyPopupWindow.showAsDropDown(binding.rightOptionView, x, 0) - } - //撤防点位 binding.unDeployedLayout.setOnClickListener { requireContext().navigatePageTo() @@ -263,11 +266,11 @@ override fun observeRequestState() { wellViewModel.loadState.observe(this) { when (it) { - is LoadState.Loading -> LoadingDialogHub.show( + is LoadState.Loading -> LoadingDialog.show( requireActivity(), "数据加载中,请稍后..." ) - else -> LoadingDialogHub.dismiss() + else -> LoadingDialog.dismiss() } } } @@ -376,7 +379,7 @@ }).build().show() } }) - infoPopup.showAsDropDown(binding.rightOptionView) +// infoPopup.showAsDropDown(binding.rightOptionView) } override fun onCameraChange(p0: CameraPosition?) { diff --git a/app/src/main/java/com/casic/app/smartwell/fragment/HomePageNoClusterFragment.kt b/app/src/main/java/com/casic/app/smartwell/fragment/HomePageNoClusterFragment.kt index 802426a..b25f743 100644 --- a/app/src/main/java/com/casic/app/smartwell/fragment/HomePageNoClusterFragment.kt +++ b/app/src/main/java/com/casic/app/smartwell/fragment/HomePageNoClusterFragment.kt @@ -38,8 +38,9 @@ import com.pengxh.kt.lite.extensions.navigatePageTo import com.pengxh.kt.lite.extensions.show import com.pengxh.kt.lite.utils.LoadState -import com.pengxh.kt.lite.utils.LoadingDialogHub +import com.pengxh.kt.lite.utils.LoadingDialog import com.pengxh.kt.lite.widget.EasyPopupWindow +import com.pengxh.kt.lite.widget.TitleBarView import com.pengxh.kt.lite.widget.dialog.AlertControlDialog import kotlinx.coroutines.Dispatchers import kotlinx.coroutines.launch @@ -78,7 +79,15 @@ override fun setupTopBarLayout() { binding.rootView.initImmersionBar(this, false, R.color.mainThemeColor) - binding.titleView.text = "首页" + binding.titleView.setOnClickListener(object : TitleBarView.OnClickListener { + override fun onLeftClick() { + + } + + override fun onRightClick() { + easyPopupWindow.showAsDropDown(binding.titleView, binding.titleView.width, 0) + } + }) } override fun initOnCreate(savedInstanceState: Bundle?) { @@ -112,7 +121,7 @@ //渲染井位置 lifecycleScope.launch(Dispatchers.Main) { - LoadingDialogHub.show(requireActivity(), "数据加载中,请稍后") + LoadingDialog.show(requireActivity(), "数据加载中,请稍后") withContext(Dispatchers.IO) { //取Well缓存 val allMarkerOptions = ArrayList() @@ -144,7 +153,7 @@ val cameraPosition = CameraPosition(centerLatLng, 14f, 0f, 0f) val cameraUpdate = CameraUpdateFactory.newCameraPosition(cameraPosition) withContext(Dispatchers.Main) { - LoadingDialogHub.dismiss() + LoadingDialog.dismiss() aMap.animateCamera(cameraUpdate, 1500, null) } } @@ -238,11 +247,6 @@ } override fun initEvent() { - binding.rightOptionView.setOnClickListener { - val x = binding.rightOptionView.width - easyPopupWindow.width - easyPopupWindow.showAsDropDown(binding.rightOptionView, x, 0) - } - //撤防点位 binding.unDeployedLayout.setOnClickListener { requireContext().navigatePageTo() @@ -262,11 +266,11 @@ override fun observeRequestState() { wellViewModel.loadState.observe(this) { when (it) { - is LoadState.Loading -> LoadingDialogHub.show( + is LoadState.Loading -> LoadingDialog.show( requireActivity(), "数据加载中,请稍后..." ) - else -> LoadingDialogHub.dismiss() + else -> LoadingDialog.dismiss() } } } diff --git a/app/src/main/java/com/casic/app/smartwell/fragment/MinePageFragment.kt b/app/src/main/java/com/casic/app/smartwell/fragment/MinePageFragment.kt index 09a570c..dcb48f8 100644 --- a/app/src/main/java/com/casic/app/smartwell/fragment/MinePageFragment.kt +++ b/app/src/main/java/com/casic/app/smartwell/fragment/MinePageFragment.kt @@ -35,7 +35,7 @@ import com.pengxh.kt.lite.utils.ActivityStackManager import com.pengxh.kt.lite.utils.FileDownloadManager import com.pengxh.kt.lite.utils.LoadState -import com.pengxh.kt.lite.utils.LoadingDialogHub +import com.pengxh.kt.lite.utils.LoadingDialog import com.pengxh.kt.lite.widget.dialog.AlertControlDialog import com.pengxh.kt.lite.widget.dialog.BottomActionSheet import kotlinx.coroutines.Dispatchers @@ -60,7 +60,6 @@ override fun setupTopBarLayout() { binding.rootView.initImmersionBar(this, false, R.color.mainThemeColor) - binding.titleInclude.titleView.text = "我的" } override fun initOnCreate(savedInstanceState: Bundle?) { @@ -155,27 +154,27 @@ override fun observeRequestState() { userViewModel.loadState.observe(this) { when (it) { - is LoadState.Loading -> LoadingDialogHub.show( + is LoadState.Loading -> LoadingDialog.show( requireActivity(), "检查版本中,请稍后" ) - else -> LoadingDialogHub.dismiss() + else -> LoadingDialog.dismiss() } } wellViewModel.loadState.observe(this) { when (it) { - is LoadState.Loading -> LoadingDialogHub.show( + is LoadState.Loading -> LoadingDialog.show( requireActivity(), "数据更新中,请稍后" ) is LoadState.Fail -> { - LoadingDialogHub.dismiss() + LoadingDialog.dismiss() "数据更新超时".show(requireContext()) } else -> { - LoadingDialogHub.dismiss() + LoadingDialog.dismiss() AlertControlDialog.Builder().setContext(requireContext()).setTitle("温馨提示") .setMessage("数据更新成功,请重启应用").setNegativeButton("取消") .setPositiveButton("确定").setOnDialogButtonClickListener(object : @@ -197,17 +196,17 @@ lineViewModel.loadState.observe(this) { when (it) { - is LoadState.Loading -> LoadingDialogHub.show( + is LoadState.Loading -> LoadingDialog.show( requireActivity(), "数据更新中,请稍后" ) is LoadState.Fail -> { - LoadingDialogHub.dismiss() + LoadingDialog.dismiss() "数据更新超时".show(requireContext()) } else -> { - LoadingDialogHub.dismiss() + LoadingDialog.dismiss() AlertControlDialog.Builder().setContext(requireContext()).setTitle("温馨提示") .setMessage("数据更新成功,请重启应用").setNegativeButton("取消") .setPositiveButton("确定").setOnDialogButtonClickListener(object : diff --git a/app/src/main/java/com/casic/app/smartwell/fragment/NoticePageFragment.kt b/app/src/main/java/com/casic/app/smartwell/fragment/NoticePageFragment.kt index 171b555..3c93f54 100644 --- a/app/src/main/java/com/casic/app/smartwell/fragment/NoticePageFragment.kt +++ b/app/src/main/java/com/casic/app/smartwell/fragment/NoticePageFragment.kt @@ -48,7 +48,6 @@ override fun setupTopBarLayout() { binding.rootView.initImmersionBar(this, false, R.color.mainThemeColor) - binding.titleInclude.titleView.text = "消息" } override fun initOnCreate(savedInstanceState: Bundle?) { diff --git a/app/src/main/java/com/casic/app/smartwell/fragment/OrderListFragment.kt b/app/src/main/java/com/casic/app/smartwell/fragment/OrderListFragment.kt index 93ff35b..5e38acb 100644 --- a/app/src/main/java/com/casic/app/smartwell/fragment/OrderListFragment.kt +++ b/app/src/main/java/com/casic/app/smartwell/fragment/OrderListFragment.kt @@ -12,6 +12,7 @@ import com.casic.app.smartwell.view.SearchOrderActivity import com.pengxh.kt.lite.base.KotlinBaseFragment import com.pengxh.kt.lite.extensions.navigatePageTo +import com.pengxh.kt.lite.widget.TitleBarView class OrderListFragment : KotlinBaseFragment() { @@ -25,15 +26,22 @@ } override fun initViewBinding( - inflater: LayoutInflater, - container: ViewGroup? + inflater: LayoutInflater, container: ViewGroup? ): FragmentOrderBinding { return FragmentOrderBinding.inflate(inflater, container, false) } override fun setupTopBarLayout() { binding.rootView.initImmersionBar(this, false, R.color.mainThemeColor) - binding.titleView.text = "工单" + binding.titleView.setOnClickListener(object : TitleBarView.OnClickListener { + override fun onLeftClick() { + + } + + override fun onRightClick() { + requireContext().navigatePageTo() + } + }) } override fun initOnCreate(savedInstanceState: Bundle?) { @@ -51,8 +59,6 @@ } override fun initEvent() { - binding.rightOptionView.setOnClickListener { - requireContext().navigatePageTo() - } + } } \ No newline at end of file diff --git a/app/src/main/java/com/casic/app/smartwell/fragment/OrderNotProcessedFragment.kt b/app/src/main/java/com/casic/app/smartwell/fragment/OrderNotProcessedFragment.kt index 0b3d09d..2b6f21d 100644 --- a/app/src/main/java/com/casic/app/smartwell/fragment/OrderNotProcessedFragment.kt +++ b/app/src/main/java/com/casic/app/smartwell/fragment/OrderNotProcessedFragment.kt @@ -18,7 +18,7 @@ import com.pengxh.kt.lite.extensions.navigatePageTo import com.pengxh.kt.lite.extensions.show import com.pengxh.kt.lite.utils.LoadState -import com.pengxh.kt.lite.utils.LoadingDialogHub +import com.pengxh.kt.lite.utils.LoadingDialog import com.pengxh.kt.lite.utils.WeakReferenceHandler import com.pengxh.kt.lite.widget.dialog.AlertControlDialog @@ -78,8 +78,8 @@ operationViewModel = ViewModelProvider(this)[OperationViewModel::class.java] - binding.notProcessedView.addItemDecoration( - RecyclerViewItemOffsets(0, 5, 0, 5) + binding.recyclerView.addItemDecoration( + RecyclerViewItemOffsets(0, 7, 0, 7) ) } @@ -87,9 +87,9 @@ //接单状态处理 operationViewModel.loadState.observe(this) { when (it) { - is LoadState.Loading -> LoadingDialogHub.show(requireActivity(), "接单中,请稍后") + is LoadState.Loading -> LoadingDialog.show(requireActivity(), "接单中,请稍后") is LoadState.Success -> { - LoadingDialogHub.dismiss() + LoadingDialog.dismiss() //接单成功之后刷新列表 dataBeans.removeAt(clickedPosition) notProcessedAdapter.notifyItemRemoved(clickedPosition) @@ -98,7 +98,7 @@ ) } - else -> LoadingDialogHub.dismiss() + else -> LoadingDialog.dismiss() } } } @@ -131,7 +131,7 @@ } else { binding.emptyInclude.emptyView.hide() notProcessedAdapter = OrderNotProcessedAdapter(requireContext(), dataBeans) - binding.notProcessedView.adapter = notProcessedAdapter + binding.recyclerView.adapter = notProcessedAdapter notProcessedAdapter.setOnItemClickListener(object : OrderNotProcessedAdapter.OnItemClickListener { override fun onClicked(position: Int) { diff --git a/app/src/main/java/com/casic/app/smartwell/fragment/OvertimeNotAcceptFragment.kt b/app/src/main/java/com/casic/app/smartwell/fragment/OvertimeNotAcceptFragment.kt index a198545..9b318ca 100644 --- a/app/src/main/java/com/casic/app/smartwell/fragment/OvertimeNotAcceptFragment.kt +++ b/app/src/main/java/com/casic/app/smartwell/fragment/OvertimeNotAcceptFragment.kt @@ -18,7 +18,7 @@ import com.pengxh.kt.lite.extensions.navigatePageTo import com.pengxh.kt.lite.extensions.show import com.pengxh.kt.lite.utils.LoadState -import com.pengxh.kt.lite.utils.LoadingDialogHub +import com.pengxh.kt.lite.utils.LoadingDialog import com.pengxh.kt.lite.utils.WeakReferenceHandler import com.pengxh.kt.lite.widget.dialog.AlertControlDialog @@ -81,8 +81,8 @@ operationViewModel = ViewModelProvider(this)[OperationViewModel::class.java] - binding.notProcessedView.addItemDecoration( - RecyclerViewItemOffsets(0, 5, 0, 5) + binding.recyclerView.addItemDecoration( + RecyclerViewItemOffsets(0, 7, 0, 7) ) } @@ -90,9 +90,9 @@ //接单状态处理 operationViewModel.loadState.observe(this) { when (it) { - is LoadState.Loading -> LoadingDialogHub.show(requireActivity(), "接单中,请稍后") + is LoadState.Loading -> LoadingDialog.show(requireActivity(), "接单中,请稍后") is LoadState.Success -> { - LoadingDialogHub.dismiss() + LoadingDialog.dismiss() //接单成功之后刷新列表 dataBeans.removeAt(clickedPosition) notProcessedAdapter.notifyItemRemoved(clickedPosition) @@ -101,7 +101,7 @@ ) } - else -> LoadingDialogHub.dismiss() + else -> LoadingDialog.dismiss() } } } @@ -134,7 +134,7 @@ } else { binding.emptyInclude.emptyView.hide() notProcessedAdapter = OrderNotProcessedAdapter(requireContext(), dataBeans) - binding.notProcessedView.adapter = notProcessedAdapter + binding.recyclerView.adapter = notProcessedAdapter notProcessedAdapter.setOnItemClickListener(object : OrderNotProcessedAdapter.OnItemClickListener { override fun onClicked(position: Int) { diff --git a/app/src/main/java/com/casic/app/smartwell/greendao/DaoMaster.java b/app/src/main/java/com/casic/app/smartwell/greendao/DaoMaster.java index fdcf3a7..1e52b74 100644 --- a/app/src/main/java/com/casic/app/smartwell/greendao/DaoMaster.java +++ b/app/src/main/java/com/casic/app/smartwell/greendao/DaoMaster.java @@ -13,25 +13,20 @@ // THIS CODE IS GENERATED BY greenDAO, DO NOT EDIT. - /** * Master of DAO (schema version 4): knows all DAOs. */ public class DaoMaster extends AbstractDaoMaster { public static final int SCHEMA_VERSION = 4; - /** - * Creates underlying database table using DAOs. - */ + /** Creates underlying database table using DAOs. */ public static void createAllTables(Database db, boolean ifNotExists) { MapWellLocalBeanDao.createTable(db, ifNotExists); NoticeLocaleBeanDao.createTable(db, ifNotExists); PipeLocalBeanDao.createTable(db, ifNotExists); } - /** - * Drops underlying database table using DAOs. - */ + /** Drops underlying database table using DAOs. */ public static void dropAllTables(Database db, boolean ifExists) { MapWellLocalBeanDao.dropTable(db, ifExists); NoticeLocaleBeanDao.dropTable(db, ifExists); @@ -86,9 +81,7 @@ } } - /** - * WARNING: Drops all table on Upgrade! Use only during development. - */ + /** WARNING: Drops all table on Upgrade! Use only during development. */ public static class DevOpenHelper extends OpenHelper { public DevOpenHelper(Context context, String name) { super(context, name); diff --git a/app/src/main/java/com/casic/app/smartwell/greendao/DaoSession.java b/app/src/main/java/com/casic/app/smartwell/greendao/DaoSession.java index 0b36d17..3e40e3b 100644 --- a/app/src/main/java/com/casic/app/smartwell/greendao/DaoSession.java +++ b/app/src/main/java/com/casic/app/smartwell/greendao/DaoSession.java @@ -16,7 +16,7 @@ /** * {@inheritDoc} - * + * * @see org.greenrobot.greendao.AbstractDaoSession */ public class DaoSession extends AbstractDaoSession { @@ -50,7 +50,7 @@ registerDao(NoticeLocaleBean.class, noticeLocaleBeanDao); registerDao(PipeLocalBean.class, pipeLocalBeanDao); } - + public void clear() { mapWellLocalBeanDaoConfig.clearIdentityScope(); noticeLocaleBeanDaoConfig.clearIdentityScope(); diff --git a/app/src/main/java/com/casic/app/smartwell/greendao/MapWellLocalBeanDao.java b/app/src/main/java/com/casic/app/smartwell/greendao/MapWellLocalBeanDao.java index 8908fda..407bc92 100644 --- a/app/src/main/java/com/casic/app/smartwell/greendao/MapWellLocalBeanDao.java +++ b/app/src/main/java/com/casic/app/smartwell/greendao/MapWellLocalBeanDao.java @@ -12,10 +12,9 @@ import org.greenrobot.greendao.internal.DaoConfig; // THIS CODE IS GENERATED BY greenDAO, DO NOT EDIT. - -/** +/** * DAO for table "MAP_WELL_LOCAL_BEAN". - */ +*/ public class MapWellLocalBeanDao extends AbstractDao { public static final String TABLENAME = "MAP_WELL_LOCAL_BEAN"; @@ -57,16 +56,14 @@ public MapWellLocalBeanDao(DaoConfig config) { super(config); } - + public MapWellLocalBeanDao(DaoConfig config, DaoSession daoSession) { super(config, daoSession); } - /** - * Creates the underlying database table. - */ + /** Creates the underlying database table. */ public static void createTable(Database db, boolean ifNotExists) { - String constraint = ifNotExists ? "IF NOT EXISTS " : ""; + String constraint = ifNotExists? "IF NOT EXISTS ": ""; db.execSQL("CREATE TABLE " + constraint + "\"MAP_WELL_LOCAL_BEAN\" (" + // "\"_id\" INTEGER PRIMARY KEY AUTOINCREMENT ," + // 0: kId "\"AREA\" TEXT," + // 1: area @@ -96,9 +93,7 @@ "\"WELL_TYPE_NAME\" TEXT);"); // 25: wellTypeName } - /** - * Drops the underlying database table. - */ + /** Drops the underlying database table. */ public static void dropTable(Database db, boolean ifExists) { String sql = "DROP TABLE " + (ifExists ? "IF EXISTS " : "") + "\"MAP_WELL_LOCAL_BEAN\""; db.execSQL(sql); @@ -107,132 +102,132 @@ @Override protected final void bindValues(DatabaseStatement stmt, MapWellLocalBean entity) { stmt.clearBindings(); - + Long kId = entity.getKId(); if (kId != null) { stmt.bindLong(1, kId); } - + String area = entity.getArea(); if (area != null) { stmt.bindString(2, area); } - + String bfzt = entity.getBfzt(); if (bfzt != null) { stmt.bindString(3, bfzt); } - + String bfztName = entity.getBfztName(); if (bfztName != null) { stmt.bindString(4, bfztName); } - + String coordinateX = entity.getCoordinateX(); if (coordinateX != null) { stmt.bindString(5, coordinateX); } - + String coordinateY = entity.getCoordinateY(); if (coordinateY != null) { stmt.bindString(6, coordinateY); } - + String deep = entity.getDeep(); if (deep != null) { stmt.bindString(7, deep); } - + String deptName = entity.getDeptName(); if (deptName != null) { stmt.bindString(8, deptName); } - + String deptid = entity.getDeptid(); if (deptid != null) { stmt.bindString(9, deptid); } - + String id = entity.getId(); if (id != null) { stmt.bindString(10, id); } - + String latBaidu = entity.getLatBaidu(); if (latBaidu != null) { stmt.bindString(11, latBaidu); } - + String latGaode = entity.getLatGaode(); if (latGaode != null) { stmt.bindString(12, latGaode); } - + String lngBaidu = entity.getLngBaidu(); if (lngBaidu != null) { stmt.bindString(13, lngBaidu); } - + String lngGaode = entity.getLngGaode(); if (lngGaode != null) { stmt.bindString(14, lngGaode); } - + String notes = entity.getNotes(); if (notes != null) { stmt.bindString(15, notes); } - + String photos = entity.getPhotos(); if (photos != null) { stmt.bindString(16, photos); } - + String position = entity.getPosition(); if (position != null) { stmt.bindString(17, position); } - + String staff = entity.getStaff(); if (staff != null) { stmt.bindString(18, staff); } - + String tel = entity.getTel(); if (tel != null) { stmt.bindString(19, tel); } - + String ts = entity.getTs(); if (ts != null) { stmt.bindString(20, ts); } - + String valid = entity.getValid(); if (valid != null) { stmt.bindString(21, valid); } - + String watchData = entity.getWatchData(); if (watchData != null) { stmt.bindString(22, watchData); } - + String wellCode = entity.getWellCode(); if (wellCode != null) { stmt.bindString(23, wellCode); } - + String wellName = entity.getWellName(); if (wellName != null) { stmt.bindString(24, wellName); } - + String wellType = entity.getWellType(); if (wellType != null) { stmt.bindString(25, wellType); } - + String wellTypeName = entity.getWellTypeName(); if (wellTypeName != null) { stmt.bindString(26, wellTypeName); @@ -242,132 +237,132 @@ @Override protected final void bindValues(SQLiteStatement stmt, MapWellLocalBean entity) { stmt.clearBindings(); - + Long kId = entity.getKId(); if (kId != null) { stmt.bindLong(1, kId); } - + String area = entity.getArea(); if (area != null) { stmt.bindString(2, area); } - + String bfzt = entity.getBfzt(); if (bfzt != null) { stmt.bindString(3, bfzt); } - + String bfztName = entity.getBfztName(); if (bfztName != null) { stmt.bindString(4, bfztName); } - + String coordinateX = entity.getCoordinateX(); if (coordinateX != null) { stmt.bindString(5, coordinateX); } - + String coordinateY = entity.getCoordinateY(); if (coordinateY != null) { stmt.bindString(6, coordinateY); } - + String deep = entity.getDeep(); if (deep != null) { stmt.bindString(7, deep); } - + String deptName = entity.getDeptName(); if (deptName != null) { stmt.bindString(8, deptName); } - + String deptid = entity.getDeptid(); if (deptid != null) { stmt.bindString(9, deptid); } - + String id = entity.getId(); if (id != null) { stmt.bindString(10, id); } - + String latBaidu = entity.getLatBaidu(); if (latBaidu != null) { stmt.bindString(11, latBaidu); } - + String latGaode = entity.getLatGaode(); if (latGaode != null) { stmt.bindString(12, latGaode); } - + String lngBaidu = entity.getLngBaidu(); if (lngBaidu != null) { stmt.bindString(13, lngBaidu); } - + String lngGaode = entity.getLngGaode(); if (lngGaode != null) { stmt.bindString(14, lngGaode); } - + String notes = entity.getNotes(); if (notes != null) { stmt.bindString(15, notes); } - + String photos = entity.getPhotos(); if (photos != null) { stmt.bindString(16, photos); } - + String position = entity.getPosition(); if (position != null) { stmt.bindString(17, position); } - + String staff = entity.getStaff(); if (staff != null) { stmt.bindString(18, staff); } - + String tel = entity.getTel(); if (tel != null) { stmt.bindString(19, tel); } - + String ts = entity.getTs(); if (ts != null) { stmt.bindString(20, ts); } - + String valid = entity.getValid(); if (valid != null) { stmt.bindString(21, valid); } - + String watchData = entity.getWatchData(); if (watchData != null) { stmt.bindString(22, watchData); } - + String wellCode = entity.getWellCode(); if (wellCode != null) { stmt.bindString(23, wellCode); } - + String wellName = entity.getWellName(); if (wellName != null) { stmt.bindString(24, wellName); } - + String wellType = entity.getWellType(); if (wellType != null) { stmt.bindString(25, wellType); } - + String wellTypeName = entity.getWellTypeName(); if (wellTypeName != null) { stmt.bindString(26, wellTypeName); @@ -377,41 +372,41 @@ @Override public Long readKey(Cursor cursor, int offset) { return cursor.isNull(offset + 0) ? null : cursor.getLong(offset + 0); - } + } @Override public MapWellLocalBean readEntity(Cursor cursor, int offset) { MapWellLocalBean entity = new MapWellLocalBean( // - cursor.isNull(offset + 0) ? null : cursor.getLong(offset + 0), // kId - cursor.isNull(offset + 1) ? null : cursor.getString(offset + 1), // area - cursor.isNull(offset + 2) ? null : cursor.getString(offset + 2), // bfzt - cursor.isNull(offset + 3) ? null : cursor.getString(offset + 3), // bfztName - cursor.isNull(offset + 4) ? null : cursor.getString(offset + 4), // coordinateX - cursor.isNull(offset + 5) ? null : cursor.getString(offset + 5), // coordinateY - cursor.isNull(offset + 6) ? null : cursor.getString(offset + 6), // deep - cursor.isNull(offset + 7) ? null : cursor.getString(offset + 7), // deptName - cursor.isNull(offset + 8) ? null : cursor.getString(offset + 8), // deptid - cursor.isNull(offset + 9) ? null : cursor.getString(offset + 9), // id - cursor.isNull(offset + 10) ? null : cursor.getString(offset + 10), // latBaidu - cursor.isNull(offset + 11) ? null : cursor.getString(offset + 11), // latGaode - cursor.isNull(offset + 12) ? null : cursor.getString(offset + 12), // lngBaidu - cursor.isNull(offset + 13) ? null : cursor.getString(offset + 13), // lngGaode - cursor.isNull(offset + 14) ? null : cursor.getString(offset + 14), // notes - cursor.isNull(offset + 15) ? null : cursor.getString(offset + 15), // photos - cursor.isNull(offset + 16) ? null : cursor.getString(offset + 16), // position - cursor.isNull(offset + 17) ? null : cursor.getString(offset + 17), // staff - cursor.isNull(offset + 18) ? null : cursor.getString(offset + 18), // tel - cursor.isNull(offset + 19) ? null : cursor.getString(offset + 19), // ts - cursor.isNull(offset + 20) ? null : cursor.getString(offset + 20), // valid - cursor.isNull(offset + 21) ? null : cursor.getString(offset + 21), // watchData - cursor.isNull(offset + 22) ? null : cursor.getString(offset + 22), // wellCode - cursor.isNull(offset + 23) ? null : cursor.getString(offset + 23), // wellName - cursor.isNull(offset + 24) ? null : cursor.getString(offset + 24), // wellType - cursor.isNull(offset + 25) ? null : cursor.getString(offset + 25) // wellTypeName + cursor.isNull(offset + 0) ? null : cursor.getLong(offset + 0), // kId + cursor.isNull(offset + 1) ? null : cursor.getString(offset + 1), // area + cursor.isNull(offset + 2) ? null : cursor.getString(offset + 2), // bfzt + cursor.isNull(offset + 3) ? null : cursor.getString(offset + 3), // bfztName + cursor.isNull(offset + 4) ? null : cursor.getString(offset + 4), // coordinateX + cursor.isNull(offset + 5) ? null : cursor.getString(offset + 5), // coordinateY + cursor.isNull(offset + 6) ? null : cursor.getString(offset + 6), // deep + cursor.isNull(offset + 7) ? null : cursor.getString(offset + 7), // deptName + cursor.isNull(offset + 8) ? null : cursor.getString(offset + 8), // deptid + cursor.isNull(offset + 9) ? null : cursor.getString(offset + 9), // id + cursor.isNull(offset + 10) ? null : cursor.getString(offset + 10), // latBaidu + cursor.isNull(offset + 11) ? null : cursor.getString(offset + 11), // latGaode + cursor.isNull(offset + 12) ? null : cursor.getString(offset + 12), // lngBaidu + cursor.isNull(offset + 13) ? null : cursor.getString(offset + 13), // lngGaode + cursor.isNull(offset + 14) ? null : cursor.getString(offset + 14), // notes + cursor.isNull(offset + 15) ? null : cursor.getString(offset + 15), // photos + cursor.isNull(offset + 16) ? null : cursor.getString(offset + 16), // position + cursor.isNull(offset + 17) ? null : cursor.getString(offset + 17), // staff + cursor.isNull(offset + 18) ? null : cursor.getString(offset + 18), // tel + cursor.isNull(offset + 19) ? null : cursor.getString(offset + 19), // ts + cursor.isNull(offset + 20) ? null : cursor.getString(offset + 20), // valid + cursor.isNull(offset + 21) ? null : cursor.getString(offset + 21), // watchData + cursor.isNull(offset + 22) ? null : cursor.getString(offset + 22), // wellCode + cursor.isNull(offset + 23) ? null : cursor.getString(offset + 23), // wellName + cursor.isNull(offset + 24) ? null : cursor.getString(offset + 24), // wellType + cursor.isNull(offset + 25) ? null : cursor.getString(offset + 25) // wellTypeName ); return entity; } - + @Override public void readEntity(Cursor cursor, MapWellLocalBean entity, int offset) { entity.setKId(cursor.isNull(offset + 0) ? null : cursor.getLong(offset + 0)); @@ -440,17 +435,17 @@ entity.setWellName(cursor.isNull(offset + 23) ? null : cursor.getString(offset + 23)); entity.setWellType(cursor.isNull(offset + 24) ? null : cursor.getString(offset + 24)); entity.setWellTypeName(cursor.isNull(offset + 25) ? null : cursor.getString(offset + 25)); - } - + } + @Override protected final Long updateKeyAfterInsert(MapWellLocalBean entity, long rowId) { entity.setKId(rowId); return rowId; } - + @Override public Long getKey(MapWellLocalBean entity) { - if (entity != null) { + if(entity != null) { return entity.getKId(); } else { return null; @@ -466,5 +461,5 @@ protected final boolean isEntityUpdateable() { return true; } - + } diff --git a/app/src/main/java/com/casic/app/smartwell/greendao/NoticeLocaleBeanDao.java b/app/src/main/java/com/casic/app/smartwell/greendao/NoticeLocaleBeanDao.java index 64312ed..deb2d49 100644 --- a/app/src/main/java/com/casic/app/smartwell/greendao/NoticeLocaleBeanDao.java +++ b/app/src/main/java/com/casic/app/smartwell/greendao/NoticeLocaleBeanDao.java @@ -12,10 +12,9 @@ import org.greenrobot.greendao.internal.DaoConfig; // THIS CODE IS GENERATED BY greenDAO, DO NOT EDIT. - -/** +/** * DAO for table "NOTICE_LOCALE_BEAN". - */ +*/ public class NoticeLocaleBeanDao extends AbstractDao { public static final String TABLENAME = "NOTICE_LOCALE_BEAN"; @@ -43,16 +42,14 @@ public NoticeLocaleBeanDao(DaoConfig config) { super(config); } - + public NoticeLocaleBeanDao(DaoConfig config, DaoSession daoSession) { super(config, daoSession); } - /** - * Creates the underlying database table. - */ + /** Creates the underlying database table. */ public static void createTable(Database db, boolean ifNotExists) { - String constraint = ifNotExists ? "IF NOT EXISTS " : ""; + String constraint = ifNotExists? "IF NOT EXISTS ": ""; db.execSQL("CREATE TABLE " + constraint + "\"NOTICE_LOCALE_BEAN\" (" + // "\"_id\" INTEGER PRIMARY KEY AUTOINCREMENT ," + // 0: id "\"MESSAGE_ID\" TEXT UNIQUE ," + // 1: messageId @@ -68,9 +65,7 @@ "\"NOTICE_TIME\" TEXT);"); // 11: noticeTime } - /** - * Drops the underlying database table. - */ + /** Drops the underlying database table. */ public static void dropTable(Database db, boolean ifExists) { String sql = "DROP TABLE " + (ifExists ? "IF EXISTS " : "") + "\"NOTICE_LOCALE_BEAN\""; db.execSQL(sql); @@ -79,62 +74,62 @@ @Override protected final void bindValues(DatabaseStatement stmt, NoticeLocaleBean entity) { stmt.clearBindings(); - + Long id = entity.getId(); if (id != null) { stmt.bindLong(1, id); } - + String messageId = entity.getMessageId(); if (messageId != null) { stmt.bindString(2, messageId); } - + String appid = entity.getAppid(); if (appid != null) { stmt.bindString(3, appid); } - + String clientId = entity.getClientId(); if (clientId != null) { stmt.bindString(4, clientId); } - + String taskId = entity.getTaskId(); if (taskId != null) { stmt.bindString(5, taskId); } - + String userId = entity.getUserId(); if (userId != null) { stmt.bindString(6, userId); } - + String title = entity.getTitle(); if (title != null) { stmt.bindString(7, title); } - + String content = entity.getContent(); if (content != null) { stmt.bindString(8, content); } - + String deviceCode = entity.getDeviceCode(); if (deviceCode != null) { stmt.bindString(9, deviceCode); } - + String jobId = entity.getJobId(); if (jobId != null) { stmt.bindString(10, jobId); } - + String isRead = entity.getIsRead(); if (isRead != null) { stmt.bindString(11, isRead); } - + String noticeTime = entity.getNoticeTime(); if (noticeTime != null) { stmt.bindString(12, noticeTime); @@ -144,62 +139,62 @@ @Override protected final void bindValues(SQLiteStatement stmt, NoticeLocaleBean entity) { stmt.clearBindings(); - + Long id = entity.getId(); if (id != null) { stmt.bindLong(1, id); } - + String messageId = entity.getMessageId(); if (messageId != null) { stmt.bindString(2, messageId); } - + String appid = entity.getAppid(); if (appid != null) { stmt.bindString(3, appid); } - + String clientId = entity.getClientId(); if (clientId != null) { stmt.bindString(4, clientId); } - + String taskId = entity.getTaskId(); if (taskId != null) { stmt.bindString(5, taskId); } - + String userId = entity.getUserId(); if (userId != null) { stmt.bindString(6, userId); } - + String title = entity.getTitle(); if (title != null) { stmt.bindString(7, title); } - + String content = entity.getContent(); if (content != null) { stmt.bindString(8, content); } - + String deviceCode = entity.getDeviceCode(); if (deviceCode != null) { stmt.bindString(9, deviceCode); } - + String jobId = entity.getJobId(); if (jobId != null) { stmt.bindString(10, jobId); } - + String isRead = entity.getIsRead(); if (isRead != null) { stmt.bindString(11, isRead); } - + String noticeTime = entity.getNoticeTime(); if (noticeTime != null) { stmt.bindString(12, noticeTime); @@ -209,27 +204,27 @@ @Override public Long readKey(Cursor cursor, int offset) { return cursor.isNull(offset + 0) ? null : cursor.getLong(offset + 0); - } + } @Override public NoticeLocaleBean readEntity(Cursor cursor, int offset) { NoticeLocaleBean entity = new NoticeLocaleBean( // - cursor.isNull(offset + 0) ? null : cursor.getLong(offset + 0), // id - cursor.isNull(offset + 1) ? null : cursor.getString(offset + 1), // messageId - cursor.isNull(offset + 2) ? null : cursor.getString(offset + 2), // appid - cursor.isNull(offset + 3) ? null : cursor.getString(offset + 3), // clientId - cursor.isNull(offset + 4) ? null : cursor.getString(offset + 4), // taskId - cursor.isNull(offset + 5) ? null : cursor.getString(offset + 5), // userId - cursor.isNull(offset + 6) ? null : cursor.getString(offset + 6), // title - cursor.isNull(offset + 7) ? null : cursor.getString(offset + 7), // content - cursor.isNull(offset + 8) ? null : cursor.getString(offset + 8), // deviceCode - cursor.isNull(offset + 9) ? null : cursor.getString(offset + 9), // jobId - cursor.isNull(offset + 10) ? null : cursor.getString(offset + 10), // isRead - cursor.isNull(offset + 11) ? null : cursor.getString(offset + 11) // noticeTime + cursor.isNull(offset + 0) ? null : cursor.getLong(offset + 0), // id + cursor.isNull(offset + 1) ? null : cursor.getString(offset + 1), // messageId + cursor.isNull(offset + 2) ? null : cursor.getString(offset + 2), // appid + cursor.isNull(offset + 3) ? null : cursor.getString(offset + 3), // clientId + cursor.isNull(offset + 4) ? null : cursor.getString(offset + 4), // taskId + cursor.isNull(offset + 5) ? null : cursor.getString(offset + 5), // userId + cursor.isNull(offset + 6) ? null : cursor.getString(offset + 6), // title + cursor.isNull(offset + 7) ? null : cursor.getString(offset + 7), // content + cursor.isNull(offset + 8) ? null : cursor.getString(offset + 8), // deviceCode + cursor.isNull(offset + 9) ? null : cursor.getString(offset + 9), // jobId + cursor.isNull(offset + 10) ? null : cursor.getString(offset + 10), // isRead + cursor.isNull(offset + 11) ? null : cursor.getString(offset + 11) // noticeTime ); return entity; } - + @Override public void readEntity(Cursor cursor, NoticeLocaleBean entity, int offset) { entity.setId(cursor.isNull(offset + 0) ? null : cursor.getLong(offset + 0)); @@ -244,17 +239,17 @@ entity.setJobId(cursor.isNull(offset + 9) ? null : cursor.getString(offset + 9)); entity.setIsRead(cursor.isNull(offset + 10) ? null : cursor.getString(offset + 10)); entity.setNoticeTime(cursor.isNull(offset + 11) ? null : cursor.getString(offset + 11)); - } - + } + @Override protected final Long updateKeyAfterInsert(NoticeLocaleBean entity, long rowId) { entity.setId(rowId); return rowId; } - + @Override public Long getKey(NoticeLocaleBean entity) { - if (entity != null) { + if(entity != null) { return entity.getId(); } else { return null; @@ -270,5 +265,5 @@ protected final boolean isEntityUpdateable() { return true; } - + } diff --git a/app/src/main/java/com/casic/app/smartwell/greendao/PipeLocalBeanDao.java b/app/src/main/java/com/casic/app/smartwell/greendao/PipeLocalBeanDao.java index aab4d3f..df5515a 100644 --- a/app/src/main/java/com/casic/app/smartwell/greendao/PipeLocalBeanDao.java +++ b/app/src/main/java/com/casic/app/smartwell/greendao/PipeLocalBeanDao.java @@ -12,10 +12,9 @@ import org.greenrobot.greendao.internal.DaoConfig; // THIS CODE IS GENERATED BY greenDAO, DO NOT EDIT. - -/** +/** * DAO for table "PIPE_LOCAL_BEAN". - */ +*/ public class PipeLocalBeanDao extends AbstractDao { public static final String TABLENAME = "PIPE_LOCAL_BEAN"; @@ -37,16 +36,14 @@ public PipeLocalBeanDao(DaoConfig config) { super(config); } - + public PipeLocalBeanDao(DaoConfig config, DaoSession daoSession) { super(config, daoSession); } - /** - * Creates the underlying database table. - */ + /** Creates the underlying database table. */ public static void createTable(Database db, boolean ifNotExists) { - String constraint = ifNotExists ? "IF NOT EXISTS " : ""; + String constraint = ifNotExists? "IF NOT EXISTS ": ""; db.execSQL("CREATE TABLE " + constraint + "\"PIPE_LOCAL_BEAN\" (" + // "\"_id\" INTEGER PRIMARY KEY AUTOINCREMENT ," + // 0: id "\"PIPE_CODE\" TEXT," + // 1: pipeCode @@ -56,9 +53,7 @@ "\"START_LONGITUDE_GD\" TEXT);"); // 5: startLongitudeGd } - /** - * Drops the underlying database table. - */ + /** Drops the underlying database table. */ public static void dropTable(Database db, boolean ifExists) { String sql = "DROP TABLE " + (ifExists ? "IF EXISTS " : "") + "\"PIPE_LOCAL_BEAN\""; db.execSQL(sql); @@ -67,32 +62,32 @@ @Override protected final void bindValues(DatabaseStatement stmt, PipeLocalBean entity) { stmt.clearBindings(); - + Long id = entity.getId(); if (id != null) { stmt.bindLong(1, id); } - + String pipeCode = entity.getPipeCode(); if (pipeCode != null) { stmt.bindString(2, pipeCode); } - + String endLatitudeGd = entity.getEndLatitudeGd(); if (endLatitudeGd != null) { stmt.bindString(3, endLatitudeGd); } - + String endLongitudeGd = entity.getEndLongitudeGd(); if (endLongitudeGd != null) { stmt.bindString(4, endLongitudeGd); } - + String startLatitudeGd = entity.getStartLatitudeGd(); if (startLatitudeGd != null) { stmt.bindString(5, startLatitudeGd); } - + String startLongitudeGd = entity.getStartLongitudeGd(); if (startLongitudeGd != null) { stmt.bindString(6, startLongitudeGd); @@ -102,32 +97,32 @@ @Override protected final void bindValues(SQLiteStatement stmt, PipeLocalBean entity) { stmt.clearBindings(); - + Long id = entity.getId(); if (id != null) { stmt.bindLong(1, id); } - + String pipeCode = entity.getPipeCode(); if (pipeCode != null) { stmt.bindString(2, pipeCode); } - + String endLatitudeGd = entity.getEndLatitudeGd(); if (endLatitudeGd != null) { stmt.bindString(3, endLatitudeGd); } - + String endLongitudeGd = entity.getEndLongitudeGd(); if (endLongitudeGd != null) { stmt.bindString(4, endLongitudeGd); } - + String startLatitudeGd = entity.getStartLatitudeGd(); if (startLatitudeGd != null) { stmt.bindString(5, startLatitudeGd); } - + String startLongitudeGd = entity.getStartLongitudeGd(); if (startLongitudeGd != null) { stmt.bindString(6, startLongitudeGd); @@ -137,21 +132,21 @@ @Override public Long readKey(Cursor cursor, int offset) { return cursor.isNull(offset + 0) ? null : cursor.getLong(offset + 0); - } + } @Override public PipeLocalBean readEntity(Cursor cursor, int offset) { PipeLocalBean entity = new PipeLocalBean( // - cursor.isNull(offset + 0) ? null : cursor.getLong(offset + 0), // id - cursor.isNull(offset + 1) ? null : cursor.getString(offset + 1), // pipeCode - cursor.isNull(offset + 2) ? null : cursor.getString(offset + 2), // endLatitudeGd - cursor.isNull(offset + 3) ? null : cursor.getString(offset + 3), // endLongitudeGd - cursor.isNull(offset + 4) ? null : cursor.getString(offset + 4), // startLatitudeGd - cursor.isNull(offset + 5) ? null : cursor.getString(offset + 5) // startLongitudeGd + cursor.isNull(offset + 0) ? null : cursor.getLong(offset + 0), // id + cursor.isNull(offset + 1) ? null : cursor.getString(offset + 1), // pipeCode + cursor.isNull(offset + 2) ? null : cursor.getString(offset + 2), // endLatitudeGd + cursor.isNull(offset + 3) ? null : cursor.getString(offset + 3), // endLongitudeGd + cursor.isNull(offset + 4) ? null : cursor.getString(offset + 4), // startLatitudeGd + cursor.isNull(offset + 5) ? null : cursor.getString(offset + 5) // startLongitudeGd ); return entity; } - + @Override public void readEntity(Cursor cursor, PipeLocalBean entity, int offset) { entity.setId(cursor.isNull(offset + 0) ? null : cursor.getLong(offset + 0)); @@ -160,17 +155,17 @@ entity.setEndLongitudeGd(cursor.isNull(offset + 3) ? null : cursor.getString(offset + 3)); entity.setStartLatitudeGd(cursor.isNull(offset + 4) ? null : cursor.getString(offset + 4)); entity.setStartLongitudeGd(cursor.isNull(offset + 5) ? null : cursor.getString(offset + 5)); - } - + } + @Override protected final Long updateKeyAfterInsert(PipeLocalBean entity, long rowId) { entity.setId(rowId); return rowId; } - + @Override public Long getKey(PipeLocalBean entity) { - if (entity != null) { + if(entity != null) { return entity.getId(); } else { return null; @@ -186,5 +181,5 @@ protected final boolean isEntityUpdateable() { return true; } - + } diff --git a/app/src/main/java/com/casic/app/smartwell/view/ChangePasswordActivity.kt b/app/src/main/java/com/casic/app/smartwell/view/ChangePasswordActivity.kt index 8e41039..9f1dd40 100644 --- a/app/src/main/java/com/casic/app/smartwell/view/ChangePasswordActivity.kt +++ b/app/src/main/java/com/casic/app/smartwell/view/ChangePasswordActivity.kt @@ -14,7 +14,7 @@ import com.pengxh.kt.lite.extensions.show import com.pengxh.kt.lite.utils.ActivityStackManager import com.pengxh.kt.lite.utils.LoadState -import com.pengxh.kt.lite.utils.LoadingDialogHub +import com.pengxh.kt.lite.utils.LoadingDialog import com.pengxh.kt.lite.widget.TitleBarView import java.nio.charset.StandardCharsets @@ -46,15 +46,15 @@ override fun observeRequestState() { userViewModel.loadState.observe(this) { when (it) { - is LoadState.Loading -> LoadingDialogHub.show(this, "修改中,请稍后") + is LoadState.Loading -> LoadingDialog.show(this, "修改中,请稍后") is LoadState.Success -> { - LoadingDialogHub.dismiss() + LoadingDialog.dismiss() AuthenticationHelper.removeToken() this.navigatePageTo() ActivityStackManager.finishAllActivity() } - else -> LoadingDialogHub.dismiss() + else -> LoadingDialog.dismiss() } } } diff --git a/app/src/main/java/com/casic/app/smartwell/view/DeployedWellActivity.kt b/app/src/main/java/com/casic/app/smartwell/view/DeployedWellActivity.kt index fb4339c..28a5078 100644 --- a/app/src/main/java/com/casic/app/smartwell/view/DeployedWellActivity.kt +++ b/app/src/main/java/com/casic/app/smartwell/view/DeployedWellActivity.kt @@ -83,8 +83,8 @@ } //添加分割线 - binding.deployedListView.addItemDecoration( - RecyclerViewItemOffsets(0, 5, 0, 5) + binding.recyclerView.addItemDecoration( + RecyclerViewItemOffsets(0, 7, 0, 7) ) } @@ -149,12 +149,11 @@ } else { item.deep.toString() + "m" } - viewHolder.setText(R.id.wellNameView, item.wellName) + viewHolder.setText(R.id.wellTypeView, item.wellTypeName) .setText(R.id.wellDepthView, "深:${deep}") .setText(R.id.wellCodeView, "点位编号:${item.wellCode}") - .setText(R.id.wellTypeView, "点位类型:${item.wellTypeName}") .setText(R.id.ownerShipView, "权属单位:${item.deptName}") - .setText(R.id.wellLocationView, "点位置:${item.position}") + .setText(R.id.wellLocationView, "点位位置:${item.position}") .setOnClickListener( R.id.operationButton, object : View.OnClickListener { override fun onClick(v: View?) { @@ -207,7 +206,7 @@ }) } } - binding.deployedListView.adapter = deployAdapter + binding.recyclerView.adapter = deployAdapter deployAdapter.setOnItemClickedListener(object : NormalRecyclerAdapter.OnItemClickedListener { override fun onItemClicked(position: Int, t: WellListModel.DataBean.RowsBean) { diff --git a/app/src/main/java/com/casic/app/smartwell/view/LoginActivity.kt b/app/src/main/java/com/casic/app/smartwell/view/LoginActivity.kt index e4bb0e3..834527b 100644 --- a/app/src/main/java/com/casic/app/smartwell/view/LoginActivity.kt +++ b/app/src/main/java/com/casic/app/smartwell/view/LoginActivity.kt @@ -21,7 +21,7 @@ import com.pengxh.kt.lite.extensions.navigatePageTo import com.pengxh.kt.lite.extensions.readAssetsFile import com.pengxh.kt.lite.extensions.show -import com.pengxh.kt.lite.utils.LoadingDialogHub +import com.pengxh.kt.lite.utils.LoadingDialog import com.pengxh.kt.lite.utils.SaveKeyValues import kotlinx.coroutines.Dispatchers import kotlinx.coroutines.launch @@ -106,11 +106,11 @@ override fun observeRequestState() { authenticateViewModel.loadState.observe(this) { - LoadingDialogHub.show(this, "登录中,请稍后") + LoadingDialog.show(this, "登录中,请稍后") } loginViewModel.loadState.observe(this) { - LoadingDialogHub.dismiss() + LoadingDialog.dismiss() } } diff --git a/app/src/main/java/com/casic/app/smartwell/view/OrderCompletedDetailActivity.kt b/app/src/main/java/com/casic/app/smartwell/view/OrderCompletedDetailActivity.kt index db8ad1f..75cd905 100644 --- a/app/src/main/java/com/casic/app/smartwell/view/OrderCompletedDetailActivity.kt +++ b/app/src/main/java/com/casic/app/smartwell/view/OrderCompletedDetailActivity.kt @@ -17,7 +17,7 @@ import com.pengxh.kt.lite.extensions.show import com.pengxh.kt.lite.utils.Constant import com.pengxh.kt.lite.utils.LoadState -import com.pengxh.kt.lite.utils.LoadingDialogHub +import com.pengxh.kt.lite.utils.LoadingDialog import com.pengxh.kt.lite.widget.TitleBarView import com.pengxh.kt.lite.widget.dialog.AlertMessageDialog @@ -44,7 +44,7 @@ } override fun initOnCreate(savedInstanceState: Bundle?) { - val jobId = intent.getStringExtra(Constant.INTENT_PARAM)!! + val jobId = intent.getStringExtra(Constant.INTENT_PARAM_KEY)!! orderViewModel = ViewModelProvider(this)[OrderViewModel::class.java] orderViewModel.getWorkOrderDetail(jobId) orderViewModel.detailModel.observe(this) { @@ -154,8 +154,8 @@ override fun observeRequestState() { orderViewModel.loadState.observe(this) { when (it) { - is LoadState.Loading -> LoadingDialogHub.show(this, "数据加载中,请稍后") - else -> LoadingDialogHub.dismiss() + is LoadState.Loading -> LoadingDialog.show(this, "数据加载中,请稍后") + else -> LoadingDialog.dismiss() } } } diff --git a/app/src/main/java/com/casic/app/smartwell/view/OrderInHandleDetailActivity.kt b/app/src/main/java/com/casic/app/smartwell/view/OrderInHandleDetailActivity.kt index d70a979..04a7d5d 100644 --- a/app/src/main/java/com/casic/app/smartwell/view/OrderInHandleDetailActivity.kt +++ b/app/src/main/java/com/casic/app/smartwell/view/OrderInHandleDetailActivity.kt @@ -38,7 +38,7 @@ import com.pengxh.kt.lite.extensions.show import com.pengxh.kt.lite.utils.Constant import com.pengxh.kt.lite.utils.LoadState -import com.pengxh.kt.lite.utils.LoadingDialogHub +import com.pengxh.kt.lite.utils.LoadingDialog import com.pengxh.kt.lite.widget.TitleBarView import com.pengxh.kt.lite.widget.dialog.AlertControlDialog import com.pengxh.kt.lite.widget.dialog.AlertMessageDialog @@ -93,7 +93,7 @@ ) binding.addImageRecyclerView.adapter = imageAdapter - val jobId = intent.getStringExtra(Constant.INTENT_PARAM)!!//初始化图片九宫格 + val jobId = intent.getStringExtra(Constant.INTENT_PARAM_KEY)!!//初始化图片九宫格 orderViewModel.getWorkOrderDetail(jobId) orderViewModel.detailModel.observe(this) { if (it.code == 200) { @@ -312,41 +312,41 @@ override fun observeRequestState() { orderViewModel.loadState.observe(this) { when (it) { - is LoadState.Loading -> LoadingDialogHub.show(this, "数据加载中,请稍后") - else -> LoadingDialogHub.dismiss() + is LoadState.Loading -> LoadingDialog.show(this, "数据加载中,请稍后") + else -> LoadingDialog.dismiss() } } uploadImageViewModel.loadState.observe(this) { when (it) { - LoadState.Loading -> LoadingDialogHub.show(this, "图片上传中,请稍后...") - else -> LoadingDialogHub.dismiss() + LoadState.Loading -> LoadingDialog.show(this, "图片上传中,请稍后...") + else -> LoadingDialog.dismiss() } } //转单状态处理 operationViewModel.loadState.observe(this) { when (it) { - is LoadState.Loading -> LoadingDialogHub.show(this, "转单中,请稍后") + is LoadState.Loading -> LoadingDialog.show(this, "转单中,请稍后") is LoadState.Success -> { - LoadingDialogHub.dismiss() + LoadingDialog.dismiss() this.finish() } - else -> LoadingDialogHub.dismiss() + else -> LoadingDialog.dismiss() } } //处理完成工单状态处理 operationViewModel.loadState.observe(this) { when (it) { - is LoadState.Loading -> LoadingDialogHub.show(this, "处理中,请稍后") + is LoadState.Loading -> LoadingDialog.show(this, "处理中,请稍后") is LoadState.Success -> { - LoadingDialogHub.dismiss() + LoadingDialog.dismiss() this.finish() } - else -> LoadingDialogHub.dismiss() + else -> LoadingDialog.dismiss() } } } diff --git a/app/src/main/java/com/casic/app/smartwell/view/OrderNotConfirmedDetailActivity.kt b/app/src/main/java/com/casic/app/smartwell/view/OrderNotConfirmedDetailActivity.kt index 8e036d2..687ec86 100644 --- a/app/src/main/java/com/casic/app/smartwell/view/OrderNotConfirmedDetailActivity.kt +++ b/app/src/main/java/com/casic/app/smartwell/view/OrderNotConfirmedDetailActivity.kt @@ -36,7 +36,7 @@ import com.pengxh.kt.lite.extensions.show import com.pengxh.kt.lite.utils.Constant import com.pengxh.kt.lite.utils.LoadState -import com.pengxh.kt.lite.utils.LoadingDialogHub +import com.pengxh.kt.lite.utils.LoadingDialog import com.pengxh.kt.lite.widget.TitleBarView import com.pengxh.kt.lite.widget.dialog.AlertControlDialog import com.pengxh.kt.lite.widget.dialog.AlertMessageDialog @@ -80,7 +80,7 @@ } override fun initOnCreate(savedInstanceState: Bundle?) { - val jobId = intent.getStringExtra(Constant.INTENT_PARAM)!! + val jobId = intent.getStringExtra(Constant.INTENT_PARAM_KEY)!! //初始化图片九宫格 //左外边距,左内边距,右内边距,右外边距 val viewWidth = getScreenWidth() - (10 + 10 + 10 + 10).dp2px(this) @@ -263,41 +263,41 @@ //数据加载状态处理 orderViewModel.loadState.observe(this) { when (it) { - is LoadState.Loading -> LoadingDialogHub.show(this, "数据加载中,请稍后") - else -> LoadingDialogHub.dismiss() + is LoadState.Loading -> LoadingDialog.show(this, "数据加载中,请稍后") + else -> LoadingDialog.dismiss() } } uploadImageViewModel.loadState.observe(this) { when (it) { - LoadState.Loading -> LoadingDialogHub.show(this, "图片上传中,请稍后") - else -> LoadingDialogHub.dismiss() + LoadState.Loading -> LoadingDialog.show(this, "图片上传中,请稍后") + else -> LoadingDialog.dismiss() } } //转单状态处理 operationViewModel.loadState.observe(this) { when (it) { - is LoadState.Loading -> LoadingDialogHub.show(this, "转单中,请稍后") + is LoadState.Loading -> LoadingDialog.show(this, "转单中,请稍后") is LoadState.Success -> { - LoadingDialogHub.dismiss() + LoadingDialog.dismiss() this.finish() } - else -> LoadingDialogHub.dismiss() + else -> LoadingDialog.dismiss() } } //确认工单状态处理 operationViewModel.loadState.observe(this) { when (it) { - is LoadState.Loading -> LoadingDialogHub.show(this, "处理中,请稍后") + is LoadState.Loading -> LoadingDialog.show(this, "处理中,请稍后") is LoadState.Success -> { - LoadingDialogHub.dismiss() + LoadingDialog.dismiss() this.finish() } - else -> LoadingDialogHub.dismiss() + else -> LoadingDialog.dismiss() } } } diff --git a/app/src/main/java/com/casic/app/smartwell/view/OrderNotProcessedDetailActivity.kt b/app/src/main/java/com/casic/app/smartwell/view/OrderNotProcessedDetailActivity.kt index d3f22dc..0c97a52 100644 --- a/app/src/main/java/com/casic/app/smartwell/view/OrderNotProcessedDetailActivity.kt +++ b/app/src/main/java/com/casic/app/smartwell/view/OrderNotProcessedDetailActivity.kt @@ -18,7 +18,7 @@ import com.pengxh.kt.lite.extensions.show import com.pengxh.kt.lite.utils.Constant import com.pengxh.kt.lite.utils.LoadState -import com.pengxh.kt.lite.utils.LoadingDialogHub +import com.pengxh.kt.lite.utils.LoadingDialog import com.pengxh.kt.lite.widget.TitleBarView import com.pengxh.kt.lite.widget.dialog.AlertControlDialog import com.pengxh.kt.lite.widget.dialog.AlertMessageDialog @@ -50,7 +50,7 @@ } override fun initOnCreate(savedInstanceState: Bundle?) { - this.jobId = intent.getStringExtra(Constant.INTENT_PARAM)!! + this.jobId = intent.getStringExtra(Constant.INTENT_PARAM_KEY)!! orderViewModel = ViewModelProvider(this)[OrderViewModel::class.java] operationViewModel = ViewModelProvider(this)[OperationViewModel::class.java] wellViewModel = ViewModelProvider(this)[WellViewModel::class.java] @@ -162,21 +162,21 @@ //数据加载状态处理 orderViewModel.loadState.observe(this) { when (it) { - is LoadState.Loading -> LoadingDialogHub.show(this, "数据加载中,请稍后") - else -> LoadingDialogHub.dismiss() + is LoadState.Loading -> LoadingDialog.show(this, "数据加载中,请稍后") + else -> LoadingDialog.dismiss() } } //接单状态处理 operationViewModel.loadState.observe(this) { when (it) { - is LoadState.Loading -> LoadingDialogHub.show(this, "接单中,请稍后") + is LoadState.Loading -> LoadingDialog.show(this, "接单中,请稍后") is LoadState.Success -> { - LoadingDialogHub.dismiss() + LoadingDialog.dismiss() this.finish() } - else -> LoadingDialogHub.dismiss() + else -> LoadingDialog.dismiss() } } } diff --git a/app/src/main/java/com/casic/app/smartwell/view/SearchResultActivity.kt b/app/src/main/java/com/casic/app/smartwell/view/SearchResultActivity.kt index 6a92917..4f3a674 100644 --- a/app/src/main/java/com/casic/app/smartwell/view/SearchResultActivity.kt +++ b/app/src/main/java/com/casic/app/smartwell/view/SearchResultActivity.kt @@ -19,7 +19,7 @@ import com.pengxh.kt.lite.extensions.show import com.pengxh.kt.lite.utils.Constant import com.pengxh.kt.lite.utils.LoadState -import com.pengxh.kt.lite.utils.LoadingDialogHub +import com.pengxh.kt.lite.utils.LoadingDialog import com.pengxh.kt.lite.utils.WeakReferenceHandler import com.pengxh.kt.lite.widget.TitleBarView import com.pengxh.kt.lite.widget.dialog.AlertControlDialog @@ -56,7 +56,7 @@ } override fun initOnCreate(savedInstanceState: Bundle?) { - args = intent.getStringArrayListExtra(Constant.INTENT_PARAM)!! + args = intent.getStringArrayListExtra(Constant.INTENT_PARAM_KEY)!! orderViewModel = ViewModelProvider(this)[OrderViewModel::class.java] operationViewModel = ViewModelProvider(this)[OperationViewModel::class.java] @@ -101,24 +101,24 @@ } } - binding.resultRecyclerView.addItemDecoration( - RecyclerViewItemOffsets(0, 5, 0, 5) + binding.recyclerView.addItemDecoration( + RecyclerViewItemOffsets(0, 7, 0, 7) ) } override fun observeRequestState() { orderViewModel.loadState.observe(this) { when (it) { - is LoadState.Loading -> LoadingDialogHub.show(this, "数据加载中,请稍后") - else -> LoadingDialogHub.dismiss() + is LoadState.Loading -> LoadingDialog.show(this, "数据加载中,请稍后") + else -> LoadingDialog.dismiss() } } //接单状态处理 operationViewModel.loadState.observe(this) { when (it) { - is LoadState.Loading -> LoadingDialogHub.show(this, "接单中,请稍后") + is LoadState.Loading -> LoadingDialog.show(this, "接单中,请稍后") is LoadState.Success -> { - LoadingDialogHub.dismiss() + LoadingDialog.dismiss() //接单成功之后刷新列表 dataBeans.removeAt(clickedPosition) searchResultAdapter.notifyItemRemoved(clickedPosition) @@ -127,7 +127,7 @@ ) } - else -> LoadingDialogHub.dismiss() + else -> LoadingDialog.dismiss() } } } @@ -162,7 +162,7 @@ } else { binding.emptyInclude.emptyView.hide() searchResultAdapter = SearchResultAdapter(this, dataBeans) - binding.resultRecyclerView.adapter = searchResultAdapter + binding.recyclerView.adapter = searchResultAdapter searchResultAdapter.setOnItemClickListener(object : SearchResultAdapter.OnItemClickListener { override fun onClicked(position: Int) { diff --git a/app/src/main/java/com/casic/app/smartwell/view/UnDeployWellActivity.kt b/app/src/main/java/com/casic/app/smartwell/view/UnDeployWellActivity.kt index 7f7cd3c..555c278 100644 --- a/app/src/main/java/com/casic/app/smartwell/view/UnDeployWellActivity.kt +++ b/app/src/main/java/com/casic/app/smartwell/view/UnDeployWellActivity.kt @@ -81,8 +81,8 @@ } } - binding.undeployListView.addItemDecoration( - RecyclerViewItemOffsets(0, 5, 0, 5) + binding.recyclerView.addItemDecoration( + RecyclerViewItemOffsets(0, 7, 0, 7) ) } @@ -147,12 +147,11 @@ } else { item.deep.toString() + "m" } - viewHolder.setText(R.id.wellNameView, item.wellName) + viewHolder.setText(R.id.wellTypeView, item.wellTypeName) .setText(R.id.wellDepthView, "深:${deep}") .setText(R.id.wellCodeView, "点位编号:${item.wellCode}") - .setText(R.id.wellTypeView, "点位类型:${item.wellTypeName}") .setText(R.id.ownerShipView, "权属单位:${item.deptName}") - .setText(R.id.wellLocationView, "点位置:${item.position}") + .setText(R.id.wellLocationView, "点位位置:${item.position}") .setOnClickListener( R.id.operationButton, object : View.OnClickListener { override fun onClick(v: View?) { @@ -185,7 +184,7 @@ ) } } - binding.undeployListView.adapter = unDeployAdapter + binding.recyclerView.adapter = unDeployAdapter unDeployAdapter.setOnItemClickedListener(object : NormalRecyclerAdapter.OnItemClickedListener { override fun onItemClicked(position: Int, t: WellListModel.DataBean.RowsBean) { diff --git a/app/src/main/java/com/casic/app/smartwell/view/WellDetailActivity.kt b/app/src/main/java/com/casic/app/smartwell/view/WellDetailActivity.kt index b50d067..eb8b468 100644 --- a/app/src/main/java/com/casic/app/smartwell/view/WellDetailActivity.kt +++ b/app/src/main/java/com/casic/app/smartwell/view/WellDetailActivity.kt @@ -16,7 +16,7 @@ import com.pengxh.kt.lite.extensions.show import com.pengxh.kt.lite.utils.Constant import com.pengxh.kt.lite.utils.LoadState -import com.pengxh.kt.lite.utils.LoadingDialogHub +import com.pengxh.kt.lite.utils.LoadingDialog import com.pengxh.kt.lite.widget.TitleBarView import com.pengxh.kt.lite.widget.dialog.AlertMessageDialog @@ -44,7 +44,7 @@ } override fun initOnCreate(savedInstanceState: Bundle?) { - val wellId = intent.getStringExtra(Constant.INTENT_PARAM)!! + val wellId = intent.getStringExtra(Constant.INTENT_PARAM_KEY)!! wellViewModel = ViewModelProvider(this)[WellViewModel::class.java] wellViewModel.getWellDetail(wellId) wellViewModel.wellDetailModel.observe(this) { @@ -132,8 +132,8 @@ override fun observeRequestState() { wellViewModel.loadState.observe(this) { when (it) { - is LoadState.Loading -> LoadingDialogHub.show(this, "数据加载中,请稍后") - else -> LoadingDialogHub.dismiss() + is LoadState.Loading -> LoadingDialog.show(this, "数据加载中,请稍后") + else -> LoadingDialog.dismiss() } } } diff --git a/app/src/main/java/com/casic/app/smartwell/view/WellManagementActivity.kt b/app/src/main/java/com/casic/app/smartwell/view/WellManagementActivity.kt index 084da95..457096b 100644 --- a/app/src/main/java/com/casic/app/smartwell/view/WellManagementActivity.kt +++ b/app/src/main/java/com/casic/app/smartwell/view/WellManagementActivity.kt @@ -94,8 +94,8 @@ } } - binding.wellListView.addItemDecoration( - RecyclerViewItemOffsets(0, 5, 0, 5) + binding.recyclerView.addItemDecoration( + RecyclerViewItemOffsets(0, 7, 0, 7) ) } @@ -175,13 +175,12 @@ } else { item.deep.toString() + "m" } - viewHolder.setText(R.id.wellNameView, item.wellName) + viewHolder.setText(R.id.wellTypeView, item.wellTypeName) .setText(R.id.wellStateView, "已${item.bfztName}") .setText(R.id.wellDepthView, "深:${deep}") .setText(R.id.wellCodeView, "点位编号:${item.wellCode}") - .setText(R.id.wellTypeView, "点位类型:${item.wellTypeName}") .setText(R.id.ownerShipView, "权属单位:${item.deptName}") - .setText(R.id.wellLocationView, "点位置:${item.position}") + .setText(R.id.wellLocationView, "点位位置:${item.position}") .setOnClickListener( R.id.navigationButton, object : View.OnClickListener { override fun onClick(v: View?) { @@ -200,7 +199,7 @@ ) } } - binding.wellListView.adapter = wellListAdapter + binding.recyclerView.adapter = wellListAdapter wellListAdapter.setOnItemClickedListener(object : NormalRecyclerAdapter.OnItemClickedListener { override fun onItemClicked(position: Int, t: WellListModel.DataBean.RowsBean) { diff --git a/app/src/main/java/com/casic/app/smartwell/view/WellMonitorActivity.kt b/app/src/main/java/com/casic/app/smartwell/view/WellMonitorActivity.kt index e3573eb..b87bdb7 100644 --- a/app/src/main/java/com/casic/app/smartwell/view/WellMonitorActivity.kt +++ b/app/src/main/java/com/casic/app/smartwell/view/WellMonitorActivity.kt @@ -11,7 +11,7 @@ import com.pengxh.kt.lite.base.KotlinBaseActivity import com.pengxh.kt.lite.utils.Constant import com.pengxh.kt.lite.utils.LoadState -import com.pengxh.kt.lite.utils.LoadingDialogHub +import com.pengxh.kt.lite.utils.LoadingDialog import com.pengxh.kt.lite.widget.TitleBarView class WellMonitorActivity : KotlinBaseActivity() { @@ -36,7 +36,7 @@ } override fun initOnCreate(savedInstanceState: Bundle?) { - val wellId = intent.getStringExtra(Constant.INTENT_PARAM)!! + val wellId = intent.getStringExtra(Constant.INTENT_PARAM_KEY)!! wellViewModel = ViewModelProvider(this)[WellViewModel::class.java] wellViewModel.getMonitorResult(wellId) wellViewModel.monitorModel.observe(this) { @@ -56,8 +56,8 @@ override fun observeRequestState() { wellViewModel.loadState.observe(this) { when (it) { - is LoadState.Loading -> LoadingDialogHub.show(this, "数据加载中,请稍后") - else -> LoadingDialogHub.dismiss() + is LoadState.Loading -> LoadingDialog.show(this, "数据加载中,请稍后") + else -> LoadingDialog.dismiss() } } } diff --git a/app/src/main/java/com/casic/app/smartwell/view/WellOperationActivity.kt b/app/src/main/java/com/casic/app/smartwell/view/WellOperationActivity.kt index 8d333bf..347ebb6 100644 --- a/app/src/main/java/com/casic/app/smartwell/view/WellOperationActivity.kt +++ b/app/src/main/java/com/casic/app/smartwell/view/WellOperationActivity.kt @@ -23,7 +23,7 @@ import com.pengxh.kt.lite.extensions.navigatePageTo import com.pengxh.kt.lite.extensions.show import com.pengxh.kt.lite.utils.LoadState -import com.pengxh.kt.lite.utils.LoadingDialogHub +import com.pengxh.kt.lite.utils.LoadingDialog import com.pengxh.kt.lite.utils.WeakReferenceHandler import com.pengxh.kt.lite.widget.dialog.AlertControlDialog @@ -109,8 +109,8 @@ } } - binding.operationListView.addItemDecoration( - RecyclerViewItemOffsets(0, 5, 0, 5) + binding.recyclerView.addItemDecoration( + RecyclerViewItemOffsets(0, 7, 0, 7) ) } @@ -123,13 +123,13 @@ override fun observeRequestState() { wellViewModel.loadState.observe(this) { when (it) { - is LoadState.Loading -> LoadingDialogHub.show(this, "处理中,请稍后") + is LoadState.Loading -> LoadingDialog.show(this, "处理中,请稍后") is LoadState.Success -> { - LoadingDialogHub.dismiss() + LoadingDialog.dismiss() wellOperationAdapter.notifyItemChanged(clickedPosition) } - else -> LoadingDialogHub.dismiss() + else -> LoadingDialog.dismiss() } } } @@ -203,24 +203,23 @@ if (item.bfztName == "布防") { viewHolder.setImageResource( R.id.wellStateView, R.drawable.bg_solid_text_green_radius_5 - ).setText(R.id.wellStateView, "撤防") + ).setText(R.id.operationButton, "撤防") } else { viewHolder.setImageResource( R.id.wellStateView, R.drawable.bg_solid_text_red_radius_5 - ).setText(R.id.wellStateView, "布防") + ).setText(R.id.operationButton, "布防") } val deep = if (item.deep.toString().isBlank()) { "未知" } else { item.deep.toString() + "m" } - viewHolder.setText(R.id.wellNameView, item.wellName) + viewHolder.setText(R.id.wellTypeView, item.wellTypeName) .setText(R.id.wellStateView, "已${item.bfztName}") .setText(R.id.wellDepthView, "深:${deep}") .setText(R.id.wellCodeView, "点位编号:${item.wellCode}") - .setText(R.id.wellTypeView, "点位类型:${item.wellTypeName}") .setText(R.id.ownerShipView, "权属单位:${item.deptName}") - .setText(R.id.wellLocationView, "点位置:${item.position}") + .setText(R.id.wellLocationView, "点位位置:${item.position}") .setOnClickListener( R.id.operationButton, object : View.OnClickListener { override fun onClick(v: View?) { @@ -280,7 +279,7 @@ ) } } - binding.operationListView.adapter = wellOperationAdapter + binding.recyclerView.adapter = wellOperationAdapter wellOperationAdapter.setOnItemClickedListener(object : NormalRecyclerAdapter.OnItemClickedListener { override fun onItemClicked(position: Int, t: WellListModel.DataBean.RowsBean) { diff --git a/app/src/main/res/drawable/ic_down.xml b/app/src/main/res/drawable/ic_down.xml index 20e6476..6987e6c 100644 --- a/app/src/main/res/drawable/ic_down.xml +++ b/app/src/main/res/drawable/ic_down.xml @@ -1,6 +1,6 @@ + + diff --git a/app/src/main/res/layout/activity_about_us.xml b/app/src/main/res/layout/activity_about_us.xml index 9091a00..d5fbd0d 100644 --- a/app/src/main/res/layout/activity_about_us.xml +++ b/app/src/main/res/layout/activity_about_us.xml @@ -12,13 +12,7 @@ android:layout_width="match_parent" android:layout_height="wrap_content" android:background="@color/mainThemeColor" - app:tbv_left_image="@drawable/ic_title_left" - app:tbv_only_show_title="false" - app:tbv_show_left_image="true" - app:tbv_show_right_image="false" - app:tbv_text="关于我们" - app:tbv_text_color="@color/white" - app:tbv_text_size="@dimen/sp_18" /> + app:tbv_text="关于我们" /> + app:tbv_text="修改密码" /> + app:tbv_text="布防列表" /> + app:tbv_text="帮助中心" /> + app:tbv_text="工单详情" /> + app:tbv_text="工单详情" /> + app:tbv_text="工单详情" /> + app:tbv_text="工单详情" /> + app:tbv_text="超时工单" /> + app:tbv_text="工单查询" /> + app:tbv_text="查询结果" /> + app:tbv_text="撤防列表" /> + app:tbv_text="个人资料" /> + app:tbv_text="点位详情" /> + app:tbv_text="监控内容" /> - - - - - - + android:layout_height="wrap_content" + android:background="@color/mainThemeColor" + app:tbv_show_left_image="false" + app:tbv_show_right_image="true" + app:tbv_text="首页" /> - + - + - - - - - - + android:layout_height="wrap_content" + android:background="@color/mainThemeColor" + app:tbv_right_image="@drawable/ic_search_white" + app:tbv_show_left_image="false" + app:tbv_show_right_image="true" + app:tbv_text="工单" /> - - - - - - \ No newline at end of file diff --git a/app/src/main/res/layout/item_deployed_rv.xml b/app/src/main/res/layout/item_deployed_rv.xml index 391ad28..fadcf1d 100644 --- a/app/src/main/res/layout/item_deployed_rv.xml +++ b/app/src/main/res/layout/item_deployed_rv.xml @@ -3,10 +3,9 @@ xmlns:app="http://schemas.android.com/apk/res-auto" android:layout_width="match_parent" android:layout_height="wrap_content" - android:layout_marginHorizontal="@dimen/dp_5" android:background="@drawable/bg_solid_layout_white_radius_10" android:orientation="vertical" - android:padding="@dimen/dp_5"> + android:padding="@dimen/dp_7"> @@ -42,63 +41,63 @@ android:textColor="@color/subTextColor" /> - - - - - + android:gravity="center" + android:orientation="horizontal"> - + - + - + + + + + + android:gravity="center" + android:orientation="vertical"> - - + + + + + \ No newline at end of file diff --git a/app/src/main/res/layout/item_order_completed_rv.xml b/app/src/main/res/layout/item_order_completed_rv.xml index e4ff890..3c78a0f 100644 --- a/app/src/main/res/layout/item_order_completed_rv.xml +++ b/app/src/main/res/layout/item_order_completed_rv.xml @@ -96,6 +96,7 @@ android:layout_height="wrap_content" android:layout_alignParentEnd="true" android:layout_centerVertical="true" + android:padding="@dimen/dp_10" android:src="@drawable/ic_down" /> diff --git a/app/src/main/res/layout/item_order_in_handle_rv.xml b/app/src/main/res/layout/item_order_in_handle_rv.xml index e4ff890..3c78a0f 100644 --- a/app/src/main/res/layout/item_order_in_handle_rv.xml +++ b/app/src/main/res/layout/item_order_in_handle_rv.xml @@ -96,6 +96,7 @@ android:layout_height="wrap_content" android:layout_alignParentEnd="true" android:layout_centerVertical="true" + android:padding="@dimen/dp_10" android:src="@drawable/ic_down" /> diff --git a/app/src/main/res/layout/item_order_not_confirmed_rv.xml b/app/src/main/res/layout/item_order_not_confirmed_rv.xml index d848810..795d7e8 100644 --- a/app/src/main/res/layout/item_order_not_confirmed_rv.xml +++ b/app/src/main/res/layout/item_order_not_confirmed_rv.xml @@ -96,6 +96,7 @@ android:layout_height="wrap_content" android:layout_alignParentEnd="true" android:layout_centerVertical="true" + android:padding="@dimen/dp_10" android:src="@drawable/ic_down" /> diff --git a/app/src/main/res/layout/item_order_not_processed_rv.xml b/app/src/main/res/layout/item_order_not_processed_rv.xml index 33138d4..7e943c6 100644 --- a/app/src/main/res/layout/item_order_not_processed_rv.xml +++ b/app/src/main/res/layout/item_order_not_processed_rv.xml @@ -3,10 +3,9 @@ xmlns:app="http://schemas.android.com/apk/res-auto" android:layout_width="match_parent" android:layout_height="wrap_content" - android:layout_marginHorizontal="@dimen/dp_5" android:background="@drawable/bg_solid_layout_white_radius_10" android:orientation="vertical" - android:padding="@dimen/dp_5"> + android:padding="@dimen/dp_7"> + android:padding="@dimen/dp_7"> - - + + diff --git a/app/src/main/res/layout/item_undeploy_rv.xml b/app/src/main/res/layout/item_undeploy_rv.xml index 934e472..4f14f5e 100644 --- a/app/src/main/res/layout/item_undeploy_rv.xml +++ b/app/src/main/res/layout/item_undeploy_rv.xml @@ -3,10 +3,9 @@ xmlns:app="http://schemas.android.com/apk/res-auto" android:layout_width="match_parent" android:layout_height="wrap_content" - android:layout_marginHorizontal="@dimen/dp_5" android:background="@drawable/bg_solid_layout_white_radius_10" android:orientation="vertical" - android:padding="@dimen/dp_5"> + android:padding="@dimen/dp_7"> @@ -42,63 +41,63 @@ android:textColor="@color/subTextColor" /> - - - - - + android:gravity="center" + android:orientation="horizontal"> - + - + - + + + + + + android:gravity="center" + android:orientation="vertical"> - - + + + + + \ No newline at end of file diff --git a/app/src/main/res/layout/item_well_list_rv.xml b/app/src/main/res/layout/item_well_list_rv.xml index 7da09a1..8fc7eb2 100644 --- a/app/src/main/res/layout/item_well_list_rv.xml +++ b/app/src/main/res/layout/item_well_list_rv.xml @@ -1,12 +1,10 @@ + android:padding="@dimen/dp_7"> @@ -38,6 +36,7 @@ android:id="@+id/wellDepthView" android:layout_width="wrap_content" android:layout_height="wrap_content" + android:paddingHorizontal="@dimen/dp_5" android:text="深:5.5" android:textColor="@color/subTextColor" /> @@ -47,47 +46,42 @@ android:layout_width="wrap_content" android:layout_height="wrap_content" android:layout_marginTop="@dimen/dp_5" - android:text="井编号:W00002" - android:textColor="@color/subTextColor" /> - - - - + android:layout_height="wrap_content" + android:orientation="horizontal"> - + android:orientation="vertical"> - + + + + + + android:padding="@dimen/dp_5" + android:src="@drawable/ic_navigation" /> \ No newline at end of file diff --git a/app/src/main/res/layout/item_well_operation_rv.xml b/app/src/main/res/layout/item_well_operation_rv.xml index fb7096f..a6b2f54 100644 --- a/app/src/main/res/layout/item_well_operation_rv.xml +++ b/app/src/main/res/layout/item_well_operation_rv.xml @@ -3,10 +3,9 @@ xmlns:app="http://schemas.android.com/apk/res-auto" android:layout_width="match_parent" android:layout_height="wrap_content" - android:layout_marginHorizontal="@dimen/dp_5" android:background="@drawable/bg_solid_layout_white_radius_10" android:orientation="vertical" - android:padding="@dimen/dp_5"> + android:padding="@dimen/dp_7"> @@ -39,67 +38,68 @@ android:id="@+id/wellDepthView" android:layout_width="wrap_content" android:layout_height="wrap_content" + android:paddingHorizontal="@dimen/dp_5" android:text="深:5.5" android:textColor="@color/subTextColor" /> - - - - - + android:gravity="center" + android:orientation="horizontal"> - + - + - + + + + + + android:gravity="center" + android:orientation="vertical"> - - + + + + + \ No newline at end of file