编录点新增4
This commit is contained in:
@@ -78,7 +78,7 @@ android {
|
||||
}
|
||||
|
||||
dependencies {
|
||||
|
||||
implementation fileTree(include: ['*.jar', '*.aar'], dir: 'libs')
|
||||
api rootProject.ext.androidxLibs
|
||||
// ViewModel and LiveData
|
||||
api rootProject.ext.jetpackLibs
|
||||
@@ -112,4 +112,7 @@ dependencies {
|
||||
|
||||
implementation 'androidx.fragment:fragment-ktx:1.6.0'
|
||||
|
||||
// implementation 'com.zhihu.android:matisse:0.6.0'
|
||||
implementation project(':matisse')
|
||||
implementation 'com.github.hackware1993:MagicIndicator:1.7.0'
|
||||
}
|
||||
@@ -4,6 +4,7 @@
|
||||
package="com.zmkg.coaloperation">
|
||||
|
||||
<uses-permission android:name="android.permission.INTERNET" />
|
||||
<uses-permission android:name="android.permission.CAMERA" />
|
||||
<uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE" />
|
||||
<uses-permission android:name="android.permission.READ_EXTERNAL_STORAGE" />
|
||||
<uses-permission android:name="android.permission.MANAGE_EXTERNAL_STORAGE"
|
||||
@@ -17,6 +18,7 @@
|
||||
android:supportsRtl="true"
|
||||
android:theme="@style/Theme.AppTheme"
|
||||
android:usesCleartextTraffic="true"
|
||||
android:requestLegacyExternalStorage="true"
|
||||
android:networkSecurityConfig="@xml/network_security_config"
|
||||
tools:replace="android:allowBackup">
|
||||
|
||||
@@ -69,6 +71,7 @@
|
||||
<activity android:name=".ui.wateryield.WaterYieldObserveRecordActivity" />
|
||||
<activity android:name=".ui.geologging.GeologicalPointActivity" />
|
||||
<activity android:name=".ui.geologging.AddGeologicalPointActivity" />
|
||||
<activity android:name=".ui.geologging.AddGeoLoggingFaceActivity" />
|
||||
</application>
|
||||
|
||||
</manifest>
|
||||
@@ -73,6 +73,8 @@ class MyApplication : Application(), ViewModelStoreOwner {
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
fun initLoginStatusListener() {
|
||||
// TUILogin.addLoginListener(loginStatusListener)
|
||||
}
|
||||
|
||||
+32
@@ -0,0 +1,32 @@
|
||||
package com.zmkg.coaloperation.adapter
|
||||
|
||||
import android.view.LayoutInflater
|
||||
import android.view.ViewGroup
|
||||
import com.chad.library.adapter.base.BaseQuickAdapter
|
||||
import com.chad.library.adapter.base.viewholder.BaseViewHolder
|
||||
import com.zmkg.coaloperation.R
|
||||
import com.zmkg.coaloperation.databinding.ItemGeologicalListBinding
|
||||
import com.zmkg.coaloperation.db.entity.geologging.GeoLoggingFace
|
||||
|
||||
class GeoLoggingFaceAdapter(list: MutableList<GeoLoggingFace>):
|
||||
BaseQuickAdapter<GeoLoggingFace, GeoLoggingFaceAdapter.VH>(
|
||||
R.layout.item_geological_list, list
|
||||
){
|
||||
override fun onCreateViewHolder(parent: ViewGroup, viewType: Int): VH {
|
||||
val binding = ItemGeologicalListBinding.inflate(
|
||||
LayoutInflater.from(context), parent, false
|
||||
)
|
||||
return VH(binding).also {
|
||||
bindViewClickListener(it, viewType)
|
||||
}
|
||||
}
|
||||
override fun convert(
|
||||
holder: VH,
|
||||
item: GeoLoggingFace
|
||||
) {
|
||||
holder.binding.tvFaceName.text = item.surfaceName
|
||||
}
|
||||
|
||||
inner class VH(var binding: ItemGeologicalListBinding): BaseViewHolder(binding.root)
|
||||
|
||||
}
|
||||
+8
-1
@@ -7,6 +7,7 @@ import com.chad.library.adapter.base.viewholder.BaseViewHolder
|
||||
import com.zmkg.coaloperation.R
|
||||
import com.zmkg.coaloperation.bean.GeoPointImage
|
||||
import com.zmkg.coaloperation.databinding.ListItemPointImageBinding
|
||||
import com.zmkg.coaloperation.utils.load
|
||||
|
||||
class GeoPointImageAdapter(list: MutableList<GeoPointImage>):
|
||||
BaseQuickAdapter<GeoPointImage, GeoPointImageAdapter.VH>(
|
||||
@@ -26,7 +27,13 @@ class GeoPointImageAdapter(list: MutableList<GeoPointImage>):
|
||||
holder: VH,
|
||||
item: GeoPointImage
|
||||
) {
|
||||
holder.binding.ivPointImage.setImageResource(R.drawable.ic_add_image)
|
||||
holder.binding.ivPointImage.let {
|
||||
if (item.isAddFlag) {
|
||||
it.load(R.drawable.ic_add_image)
|
||||
} else {
|
||||
it.load(item.imagePath)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
inner class VH(var binding: ListItemPointImageBinding): BaseViewHolder(binding.root)
|
||||
|
||||
+59
-40
@@ -1,104 +1,123 @@
|
||||
package com.zmkg.coaloperation.adapter
|
||||
|
||||
import android.Manifest
|
||||
import android.app.Activity
|
||||
import android.view.LayoutInflater
|
||||
import android.widget.LinearLayout
|
||||
import androidx.core.view.updateLayoutParams
|
||||
import androidx.recyclerview.widget.GridLayoutManager
|
||||
import androidx.recyclerview.widget.LinearLayoutManager
|
||||
import androidx.recyclerview.widget.RecyclerView
|
||||
import com.chad.library.adapter.base.BaseMultiItemQuickAdapter
|
||||
import com.chad.library.adapter.base.viewholder.BaseViewHolder
|
||||
import com.zmkg.coaloperation.R
|
||||
import com.zmkg.coaloperation.base.BaseActivity
|
||||
import com.zmkg.coaloperation.bean.BaseItem
|
||||
import com.zmkg.coaloperation.bean.GeoPointImage
|
||||
import com.zmkg.coaloperation.bean.GeoPointMultiItem
|
||||
import com.zmkg.coaloperation.databinding.ListItemPointBaseHorizontalBinding
|
||||
import com.zmkg.coaloperation.databinding.ListItemPointBaseVerticalBinding
|
||||
import com.zmkg.coaloperation.ui.geologging.AddGeologicalPointFragment
|
||||
import com.zmkg.coaloperation.utils.GalleryUtils
|
||||
import com.zmkg.coaloperation.utils.gone
|
||||
import com.zmkg.coaloperation.utils.permission.StorageUtils
|
||||
import com.zmkg.coaloperation.utils.visible
|
||||
|
||||
class GeoPointMultiAdapter(list: MutableList<GeoPointMultiItem>):
|
||||
BaseMultiItemQuickAdapter<GeoPointMultiItem, BaseViewHolder>(list){
|
||||
class GeoPointMultiAdapter(list: MutableList<GeoPointMultiItem>) :
|
||||
BaseMultiItemQuickAdapter<GeoPointMultiItem, BaseViewHolder>(list) {
|
||||
|
||||
init {
|
||||
addItemType(GeoPointMultiItem.TYPE_BASE_INFO, R.layout.list_item_point_base_info)
|
||||
addItemType(GeoPointMultiItem.TYPE_LOGGING_INFO, R.layout.list_item_point_logging_info)
|
||||
addItemType(GeoPointMultiItem.TYPE_CALCULATE_INFO, R.layout.list_item_point_calculate_info)
|
||||
addItemType(GeoPointMultiItem.TYPE_UPLOAD_IMAGE, R.layout.list_item_point_upload_image)
|
||||
}
|
||||
init {
|
||||
addItemType(GeoPointMultiItem.TYPE_BASE_INFO, R.layout.list_item_point_base_info)
|
||||
addItemType(GeoPointMultiItem.TYPE_LOGGING_INFO, R.layout.list_item_point_logging_info)
|
||||
addItemType(GeoPointMultiItem.TYPE_CALCULATE_INFO, R.layout.list_item_point_calculate_info)
|
||||
addItemType(GeoPointMultiItem.TYPE_UPLOAD_IMAGE, R.layout.list_item_point_upload_image)
|
||||
}
|
||||
|
||||
override fun convert(
|
||||
holder: BaseViewHolder,
|
||||
item: GeoPointMultiItem
|
||||
) {
|
||||
when (holder.itemViewType) {
|
||||
GeoPointMultiItem.TYPE_BASE_INFO->{
|
||||
GeoPointMultiItem.TYPE_BASE_INFO -> {
|
||||
loadBaseInfo(holder, item)
|
||||
}
|
||||
GeoPointMultiItem.TYPE_LOGGING_INFO->{
|
||||
|
||||
GeoPointMultiItem.TYPE_LOGGING_INFO -> {
|
||||
loadLoggingInfo(holder, item)
|
||||
}
|
||||
GeoPointMultiItem.TYPE_CALCULATE_INFO->{
|
||||
|
||||
GeoPointMultiItem.TYPE_CALCULATE_INFO -> {
|
||||
loadCalculateInfo(holder, item)
|
||||
}
|
||||
GeoPointMultiItem.TYPE_UPLOAD_IMAGE->{
|
||||
|
||||
GeoPointMultiItem.TYPE_UPLOAD_IMAGE -> {
|
||||
loadUploadImage(holder, item)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
private fun loadUploadImage(holder: BaseViewHolder,item: GeoPointMultiItem) {
|
||||
private fun loadUploadImage(holder: BaseViewHolder, item: GeoPointMultiItem) {
|
||||
val rvImageList = holder.itemView.findViewById<RecyclerView>(R.id.rvImageList)
|
||||
val images = mutableListOf(
|
||||
GeoPointImage(),
|
||||
GeoPointImage(),
|
||||
GeoPointImage(),
|
||||
GeoPointImage()
|
||||
)
|
||||
rvImageList.let {rv->
|
||||
if (item.images == null) {
|
||||
item.images = mutableListOf()
|
||||
}
|
||||
rvImageList.let { rv ->
|
||||
rv.layoutManager = GridLayoutManager(rv.context, 4, GridLayoutManager.VERTICAL, false)
|
||||
rv.adapter = GeoPointImageAdapter(images).also {
|
||||
rv.adapter = GeoPointImageAdapter(item.images!!).also {
|
||||
it.setOnItemClickListener { adapter, view, position ->
|
||||
|
||||
}
|
||||
if (it.data[position].isAddFlag.not()) {
|
||||
return@setOnItemClickListener
|
||||
}
|
||||
(context as BaseActivity).let { activity ->
|
||||
StorageUtils.requestPermission(activity) {
|
||||
GalleryUtils.openGallery(context as Activity, AddGeologicalPointFragment.IMAGE_REQUEST_CODE)
|
||||
}
|
||||
} }
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
private fun loadCalculateInfo(holder: BaseViewHolder,item: GeoPointMultiItem) {}
|
||||
private fun loadCalculateInfo(holder: BaseViewHolder, item: GeoPointMultiItem) {}
|
||||
|
||||
private fun loadLoggingInfo(holder: BaseViewHolder,item: GeoPointMultiItem) {
|
||||
private fun loadLoggingInfo(holder: BaseViewHolder, item: GeoPointMultiItem) {
|
||||
|
||||
}
|
||||
|
||||
private fun loadBaseInfo(holder: BaseViewHolder,item: GeoPointMultiItem) {
|
||||
private fun loadBaseInfo(holder: BaseViewHolder, item: GeoPointMultiItem) {
|
||||
val llBaseTop = holder.itemView.findViewById<LinearLayout>(R.id.llBaseTop)
|
||||
val topList = mutableListOf(
|
||||
BaseItem(name = "点号", value = "1#"),
|
||||
BaseItem(name = "点距", value = "1#"),
|
||||
BaseItem(name = "累距", value = "78.874"),
|
||||
BaseItem(name = "点号", value = ""),
|
||||
BaseItem(name = "点距", value = ""),
|
||||
BaseItem(name = "累距", value = ""),
|
||||
)
|
||||
val bottomList = mutableListOf(
|
||||
BaseItem(name = "巷高", value = "2.855"),
|
||||
BaseItem(name = "顶板", value = "1024.491"),
|
||||
BaseItem(name = "底板", value = "1018.491"),
|
||||
BaseItem(name = "巷顶煤厚", value = "0.15"),
|
||||
BaseItem(name = "巷高", value = ""),
|
||||
BaseItem(name = "顶板", value = ""),
|
||||
BaseItem(name = "底板", value = ""),
|
||||
BaseItem(name = "巷顶煤厚", value = ""),
|
||||
)
|
||||
topList.forEach {
|
||||
val itemBinding = ListItemPointBaseHorizontalBinding.inflate(LayoutInflater.from(context), llBaseTop, false)
|
||||
val itemBinding = ListItemPointBaseHorizontalBinding.inflate(
|
||||
LayoutInflater.from(context),
|
||||
llBaseTop,
|
||||
false
|
||||
)
|
||||
itemBinding.run {
|
||||
tvItemName.text = it.name
|
||||
tvItemValue.text = it.value
|
||||
etInputValue.setText(it.value)
|
||||
}
|
||||
llBaseTop.addView(itemBinding.root)
|
||||
llBaseTop.addView(itemBinding.root)
|
||||
}
|
||||
val llBaseBottom = holder.itemView.findViewById<LinearLayout>(R.id.llBaseBottom)
|
||||
|
||||
bottomList.forEachIndexed {index, it ->
|
||||
val itemBinding = ListItemPointBaseVerticalBinding.inflate(LayoutInflater.from(context),llBaseBottom, false)
|
||||
bottomList.forEachIndexed { index, it ->
|
||||
val itemBinding = ListItemPointBaseVerticalBinding.inflate(
|
||||
LayoutInflater.from(context),
|
||||
llBaseBottom,
|
||||
false
|
||||
)
|
||||
itemBinding.run {
|
||||
tvItemName.text = it.name
|
||||
tvItemValue.text = it.value
|
||||
etInputValue.setText(it.value)
|
||||
dividerVertical.run {
|
||||
if (index == bottomList.size - 1) gone() else visible()
|
||||
}
|
||||
|
||||
@@ -0,0 +1,100 @@
|
||||
package com.zmkg.coaloperation.base;
|
||||
|
||||
import android.content.Intent;
|
||||
import android.net.Uri;
|
||||
import android.os.Bundle;
|
||||
|
||||
import androidx.activity.result.ActivityResultLauncher;
|
||||
import androidx.activity.result.contract.ActivityResultContracts;
|
||||
import androidx.appcompat.app.AppCompatActivity;
|
||||
import com.zmkg.coaloperation.bean.IActivityResult;
|
||||
|
||||
public class BaseActivity extends AppCompatActivity {
|
||||
|
||||
// public static final String COLOR_WHITE = "#FFFFFF";
|
||||
//
|
||||
// public void whiteStatusBar(boolean isFits) {
|
||||
// whiteStatusBar(isFits, false);
|
||||
// }
|
||||
//
|
||||
// public void whiteStatusBar(boolean isFits, boolean keyboardEnable) {
|
||||
// hasColorStatusBar(COLOR_WHITE, isFits, true, keyboardEnable);
|
||||
// }
|
||||
//
|
||||
// public void transparentStatusBar(boolean isFits, boolean isDarkFont) {
|
||||
// ImmersionBar.with(this)
|
||||
// .fitsSystemWindows(isFits)
|
||||
// .statusBarDarkFont(isDarkFont)
|
||||
// .transparentStatusBar()
|
||||
// .navigationBarColor(R.color.white)
|
||||
// .navigationBarDarkIcon(true)
|
||||
// .init();
|
||||
// }
|
||||
//
|
||||
// public void hasColorStatusBar(String statusBarColor, boolean isFits, boolean isDarkFont) {
|
||||
// hasColorStatusBar(statusBarColor, isFits, isDarkFont, false);
|
||||
// }
|
||||
//
|
||||
// public void hasColorStatusBar(String statusBarColor, boolean isFits, boolean isDarkFont, boolean keyboardEnable) {
|
||||
// ImmersionBar.with(this)
|
||||
// .fitsSystemWindows(isFits)
|
||||
// .statusBarColor(statusBarColor)
|
||||
// .statusBarDarkFont(isDarkFont)
|
||||
// .keyboardEnable(keyboardEnable)
|
||||
// .navigationBarColor(R.color.white)
|
||||
// .navigationBarDarkIcon(true)
|
||||
// .init();
|
||||
// }
|
||||
|
||||
private final ActivityResultLauncher<Intent> activityLauncher =
|
||||
registerForActivityResult(
|
||||
new ActivityResultContracts.StartActivityForResult(),
|
||||
result -> this.launchActivityCallback.callback(result)
|
||||
);
|
||||
private IActivityResult.LaunchActivityCallback launchActivityCallback;
|
||||
|
||||
public void launchActivityResult(Intent intent, IActivityResult.LaunchActivityCallback activityCallback) {
|
||||
this.launchActivityCallback = activityCallback;
|
||||
activityLauncher.launch(intent);
|
||||
}
|
||||
|
||||
private IActivityResult.LaunchTackPictureCallback launchTackPictureCallback;
|
||||
|
||||
private final ActivityResultLauncher<Uri> tackPictureLauncher =
|
||||
registerForActivityResult(
|
||||
new ActivityResultContracts.TakePicture(),
|
||||
result -> this.launchTackPictureCallback.callback(result)
|
||||
);
|
||||
|
||||
public void launchTackPicture(Uri uri, IActivityResult.LaunchTackPictureCallback callback) {
|
||||
this.launchTackPictureCallback = callback;
|
||||
tackPictureLauncher.launch(uri);
|
||||
}
|
||||
|
||||
private IActivityResult.RequestPermissionCallback launchPermissionCallback;
|
||||
|
||||
public void requestSinglePermissionResult(String permission, IActivityResult.RequestPermissionCallback permissionCallback) {
|
||||
this.launchPermissionCallback = permissionCallback;
|
||||
permissionLauncher.launch(permission);
|
||||
}
|
||||
|
||||
private final ActivityResultLauncher<String> permissionLauncher =
|
||||
registerForActivityResult(
|
||||
new ActivityResultContracts.RequestPermission(),
|
||||
result -> this.launchPermissionCallback.callback(result)
|
||||
);
|
||||
|
||||
private IActivityResult.RequestMultiplePermissionsCallback launchMultiplePermissionsCallback;
|
||||
|
||||
public void requestMultiplePermissionsResult(String[] permissions, IActivityResult.RequestMultiplePermissionsCallback permissionCallback) {
|
||||
this.launchMultiplePermissionsCallback = permissionCallback;
|
||||
multiplePermissionLauncher.launch(permissions);
|
||||
}
|
||||
|
||||
private final ActivityResultLauncher<String[]> multiplePermissionLauncher =
|
||||
registerForActivityResult(
|
||||
new ActivityResultContracts.RequestMultiplePermissions(),
|
||||
result -> this.launchMultiplePermissionsCallback.callback(result)
|
||||
);
|
||||
|
||||
}
|
||||
@@ -55,7 +55,7 @@ import java.sql.SQLException
|
||||
* 封装了ViewModel和DataBinding的Activity基类
|
||||
*/
|
||||
abstract class BaseVMBActivity<VM : BaseViewModel, B : ViewDataBinding>(private val contentViewResId: Int) :
|
||||
AppCompatActivity(), View.OnClickListener {
|
||||
BaseActivity(), View.OnClickListener {
|
||||
var mContext: Context? = null
|
||||
var mActivity: Activity? = null
|
||||
lateinit var mViewModel: VM
|
||||
@@ -447,4 +447,5 @@ abstract class BaseVMBActivity<VM : BaseViewModel, B : ViewDataBinding>(private
|
||||
return "0"
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,24 @@
|
||||
package com.zmkg.coaloperation.bean;
|
||||
|
||||
import androidx.activity.result.ActivityResult;
|
||||
|
||||
import java.util.Map;
|
||||
|
||||
public interface IActivityResult {
|
||||
|
||||
interface LaunchActivityCallback {
|
||||
void callback(ActivityResult result);
|
||||
}
|
||||
|
||||
interface LaunchTackPictureCallback {
|
||||
void callback(boolean result);
|
||||
}
|
||||
|
||||
interface RequestPermissionCallback {
|
||||
void callback(boolean result);
|
||||
}
|
||||
|
||||
interface RequestMultiplePermissionsCallback {
|
||||
void callback(Map<String,Boolean> result);
|
||||
}
|
||||
}
|
||||
@@ -63,6 +63,7 @@ data class GeoPointMultiItem(
|
||||
var pointName: String = "",
|
||||
var pointDistance: String = "",
|
||||
var totalDistance: String = "",
|
||||
var images: MutableList<GeoPointImage>?=null
|
||||
): MultiItemEntity {
|
||||
companion object {
|
||||
const val TYPE_BASE_INFO = 1
|
||||
@@ -73,5 +74,6 @@ data class GeoPointMultiItem(
|
||||
}
|
||||
|
||||
data class GeoPointImage(
|
||||
var imagePath: String = ""
|
||||
var imagePath: String = "",
|
||||
var isAddFlag:Boolean = false
|
||||
)
|
||||
+12
@@ -0,0 +1,12 @@
|
||||
package com.zmkg.coaloperation.db.entity.geologging
|
||||
|
||||
data class GeoLoggingFace(
|
||||
var surfaceId: Long = 0,
|
||||
|
||||
var userId: String = "",
|
||||
|
||||
/**
|
||||
* 工作面名称
|
||||
*/
|
||||
var surfaceName: String? = "",
|
||||
)
|
||||
+39
@@ -0,0 +1,39 @@
|
||||
package com.zmkg.coaloperation.ui.geologging
|
||||
|
||||
import android.os.Bundle
|
||||
import android.view.View
|
||||
import com.zmkg.coaloperation.R
|
||||
import com.zmkg.coaloperation.base.BaseVMBActivity
|
||||
import com.zmkg.coaloperation.base.viewmodel.TestViewModel
|
||||
import com.zmkg.coaloperation.databinding.ActivityAddGeoLoggingFaceBinding
|
||||
|
||||
class AddGeoLoggingFaceActivity :
|
||||
BaseVMBActivity<TestViewModel, ActivityAddGeoLoggingFaceBinding>(
|
||||
R.layout.activity_add_geo_logging_face
|
||||
) {
|
||||
|
||||
override fun initView(savedInstanceState: Bundle?) {
|
||||
mBinding.toolbarLay.title = "新增工作面"
|
||||
mBinding.btnAddFace.setOnClickListener {
|
||||
val faceName = mBinding.etWorkfaceName.text.toString().trim()
|
||||
if (faceName.isBlank()) {
|
||||
showToast("请输入工作面名称")
|
||||
return@setOnClickListener
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
override fun initData() {
|
||||
|
||||
}
|
||||
|
||||
override fun bindEvent() {
|
||||
|
||||
}
|
||||
|
||||
override fun processClick(v: View?) {
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
+107
-18
@@ -1,19 +1,40 @@
|
||||
package com.zmkg.coaloperation.ui.geologging
|
||||
|
||||
import android.content.Context
|
||||
import android.content.Intent
|
||||
import android.graphics.Color
|
||||
import android.graphics.drawable.GradientDrawable
|
||||
import android.os.Bundle
|
||||
import android.view.View
|
||||
import android.view.ViewGroup
|
||||
import android.widget.FrameLayout
|
||||
import android.widget.LinearLayout
|
||||
import androidx.core.graphics.toColorInt
|
||||
import androidx.core.view.marginLeft
|
||||
import androidx.core.view.marginStart
|
||||
import androidx.core.view.updateLayoutParams
|
||||
import androidx.fragment.app.Fragment
|
||||
import androidx.fragment.app.commit
|
||||
import com.zmkg.coaloperation.R
|
||||
import com.zmkg.coaloperation.base.BaseVMBActivity
|
||||
import com.zmkg.coaloperation.base.viewmodel.TestViewModel
|
||||
import com.zmkg.coaloperation.databinding.ActivityAddGeologicalPointBinding
|
||||
import com.zmkg.coaloperation.utils.dp
|
||||
import com.zmkg.coaloperation.utils.useShapeSetBackground
|
||||
import net.lucode.hackware.magicindicator.FragmentContainerHelper
|
||||
import net.lucode.hackware.magicindicator.buildins.commonnavigator.CommonNavigator
|
||||
import net.lucode.hackware.magicindicator.buildins.commonnavigator.abs.CommonNavigatorAdapter
|
||||
import net.lucode.hackware.magicindicator.buildins.commonnavigator.abs.IPagerTitleView
|
||||
import net.lucode.hackware.magicindicator.buildins.commonnavigator.indicators.LinePagerIndicator
|
||||
import net.lucode.hackware.magicindicator.buildins.commonnavigator.titles.ColorTransitionPagerTitleView
|
||||
|
||||
/**
|
||||
* 地质编录点新增
|
||||
*/
|
||||
class AddGeologicalPointActivity :
|
||||
BaseVMBActivity<TestViewModel, ActivityAddGeologicalPointBinding>(R.layout.activity_add_geological_point) {
|
||||
BaseVMBActivity<TestViewModel, ActivityAddGeologicalPointBinding>(
|
||||
R.layout.activity_add_geological_point
|
||||
) {
|
||||
|
||||
|
||||
override fun initView(savedInstanceState: Bundle?) {
|
||||
@@ -28,6 +49,8 @@ class AddGeologicalPointActivity :
|
||||
show(fragments[0])
|
||||
setReorderingAllowed(true)
|
||||
}
|
||||
initMagicIndicator()
|
||||
showFragment(0)
|
||||
}
|
||||
|
||||
override fun initData() {
|
||||
@@ -42,27 +65,93 @@ class AddGeologicalPointActivity :
|
||||
|
||||
private val fragments = mutableListOf<Fragment>()
|
||||
private fun initFragments() {
|
||||
fragments.apply {
|
||||
add(AddGeologicalPointFragment())
|
||||
add(AddGeologicalPointFragment())
|
||||
add(AddGeologicalPointFragment())
|
||||
add(AddGeologicalPointFragment())
|
||||
add(AddGeologicalPointFragment())
|
||||
titles.forEach { _ ->
|
||||
fragments.add(AddGeologicalPointFragment())
|
||||
}
|
||||
supportFragmentManager.commit {
|
||||
// add(R.id.fragment_container, fragments[0], "volume").hide(fragments[0])
|
||||
replace(R.id.frgContainerView, fragments[0], "point01")
|
||||
// supportFragmentManager.commit {
|
||||
//// add(R.id.fragment_container, fragments[0], "volume").hide(fragments[0])
|
||||
// replace(R.id.frgContainerView, fragments[0], "point01")
|
||||
// }
|
||||
}
|
||||
|
||||
// private fun switchFragment(position: Int) {
|
||||
// supportFragmentManager.commit {
|
||||
// setCustomAnimations(android.R.anim.fade_in, android.R.anim.fade_out)
|
||||
// fragments.forEachIndexed { index, fragment ->
|
||||
// if (index == position) show(fragment) else hide(fragment)
|
||||
// }
|
||||
// setReorderingAllowed(true)
|
||||
// }
|
||||
// }
|
||||
|
||||
override fun onActivityResult(requestCode: Int, resultCode: Int, data: Intent?) {
|
||||
super.onActivityResult(requestCode, resultCode, data)
|
||||
fragments[0].onActivityResult(requestCode, resultCode, data)
|
||||
}
|
||||
|
||||
private val titles = listOf("1#", "2#", "3#", "4#", "5#", "6#")
|
||||
private fun initMagicIndicator() {
|
||||
val commonNavigator = CommonNavigator(this).apply {
|
||||
adapter = object : CommonNavigatorAdapter() {
|
||||
override fun getCount() = titles.size
|
||||
override fun getTitleView(context: Context?, index: Int): IPagerTitleView {
|
||||
return ColorTransitionPagerTitleView(context).apply {
|
||||
// setPadding(
|
||||
// if (index == 0) 20.dp else 10.dp,
|
||||
// 10.dp,
|
||||
// if (index == titles.size - 1) 20.dp else 10.dp,
|
||||
// 10.dp
|
||||
// )
|
||||
// setPadding(10.dp, 5.dp,10.dp, 5.dp)
|
||||
width = 65.dp
|
||||
text = titles[index]
|
||||
textSize = 20f
|
||||
normalColor = Color.WHITE
|
||||
selectedColor = "#30E0A1".toColorInt()
|
||||
useShapeSetBackground(
|
||||
cornerRadius = 12.dp.toFloat(),
|
||||
solidColor = "#1430E0A1".toColorInt(),
|
||||
strokeColor = "#0C0D0E".toColorInt(),
|
||||
strokeWidth = 8.dp
|
||||
)
|
||||
// showToast(parent.javaClass.simpleName)
|
||||
// updateLayoutParams<LinearLayout.LayoutParams> {
|
||||
// topMargin = 10.dp
|
||||
// bottomMargin = 10.dp
|
||||
// leftMargin = if (index == 0) 20.dp else 10.dp
|
||||
// rightMargin = if (index == titles.size - 1) 20.dp else 10.dp
|
||||
// }
|
||||
setOnClickListener { showFragment(index) }
|
||||
}
|
||||
}
|
||||
|
||||
override fun getIndicator(context: Context?) = LinePagerIndicator(context).apply {
|
||||
// mode = LinePagerIndicator.MODE_WRAP_CONTENT
|
||||
// setColors("#30E0A1".toColorInt())
|
||||
// lineHeight = 1.dp.toFloat()
|
||||
//lineWidth = 10.dp.toFloat()
|
||||
// background = GradientDrawable().also {
|
||||
// it.shape = GradientDrawable.RECTANGLE
|
||||
// it.cornerRadius = 5.dp.toFloat()
|
||||
// it.setColor("#30E0A1".toColorInt())
|
||||
//// it.setStroke(strokeWidth, strokeColor)
|
||||
// }
|
||||
}
|
||||
}
|
||||
}
|
||||
mBinding.magicIndicator.let {
|
||||
fragmentContainerHelper = FragmentContainerHelper(it)
|
||||
it.navigator = commonNavigator
|
||||
}
|
||||
}
|
||||
|
||||
private fun switchFragment(position: Int) {
|
||||
supportFragmentManager.commit {
|
||||
setCustomAnimations(android.R.anim.fade_in, android.R.anim.fade_out)
|
||||
fragments.forEachIndexed { index, fragment ->
|
||||
if (index == position) show(fragment) else hide(fragment)
|
||||
}
|
||||
setReorderingAllowed(true)
|
||||
}
|
||||
private lateinit var fragmentContainerHelper:FragmentContainerHelper
|
||||
|
||||
private fun showFragment(position: Int) {
|
||||
supportFragmentManager.beginTransaction()
|
||||
.replace(R.id.frgContainerView, fragments[position])
|
||||
.commit()
|
||||
fragmentContainerHelper.handlePageSelected(position)
|
||||
}
|
||||
|
||||
}
|
||||
+33
-1
@@ -1,29 +1,44 @@
|
||||
package com.zmkg.coaloperation.ui.geologging
|
||||
|
||||
import android.app.Activity
|
||||
import android.content.Intent
|
||||
import android.os.Bundle
|
||||
import android.view.View
|
||||
import androidx.recyclerview.widget.LinearLayoutManager
|
||||
import com.zhihu.matisse.Matisse
|
||||
import com.zmkg.coaloperation.R
|
||||
import com.zmkg.coaloperation.adapter.GeoPointMultiAdapter
|
||||
import com.zmkg.coaloperation.base.BaseVMBFragment
|
||||
import com.zmkg.coaloperation.base.viewmodel.TestViewModel
|
||||
import com.zmkg.coaloperation.bean.GeoPointImage
|
||||
import com.zmkg.coaloperation.bean.GeoPointMultiItem
|
||||
import com.zmkg.coaloperation.databinding.FragmentAddGeologicalPointBinding
|
||||
|
||||
class AddGeologicalPointFragment :
|
||||
BaseVMBFragment<TestViewModel, FragmentAddGeologicalPointBinding>(R.layout.fragment_add_geological_point) {
|
||||
|
||||
companion object {
|
||||
const val IMAGE_REQUEST_CODE = 1000
|
||||
}
|
||||
|
||||
private val geoPointList: MutableList<GeoPointMultiItem> = mutableListOf()
|
||||
private val geoPointAdapter by lazy {
|
||||
GeoPointMultiAdapter(geoPointList)
|
||||
}
|
||||
|
||||
override fun initView(root: View?, savedInstanceState: Bundle?) {
|
||||
val imageList = mutableListOf<GeoPointImage>()
|
||||
imageList.add(GeoPointImage(isAddFlag = true))
|
||||
geoPointList.run {
|
||||
add(GeoPointMultiItem(itemType = GeoPointMultiItem.TYPE_BASE_INFO))
|
||||
add(GeoPointMultiItem(itemType = GeoPointMultiItem.TYPE_LOGGING_INFO))
|
||||
add(GeoPointMultiItem(itemType = GeoPointMultiItem.TYPE_CALCULATE_INFO))
|
||||
add(GeoPointMultiItem(itemType = GeoPointMultiItem.TYPE_UPLOAD_IMAGE))
|
||||
add(
|
||||
GeoPointMultiItem(
|
||||
itemType = GeoPointMultiItem.TYPE_UPLOAD_IMAGE,
|
||||
images = imageList
|
||||
)
|
||||
)
|
||||
}
|
||||
mBinding.rvPointList.let {
|
||||
it.layoutManager = LinearLayoutManager(it.context)
|
||||
@@ -39,4 +54,21 @@ class AddGeologicalPointFragment :
|
||||
|
||||
}
|
||||
|
||||
@Deprecated("Deprecated in Java")
|
||||
override fun onActivityResult(requestCode: Int, resultCode: Int, data: Intent?) {
|
||||
super.onActivityResult(requestCode, resultCode, data)
|
||||
if (requestCode == IMAGE_REQUEST_CODE && resultCode == Activity.RESULT_OK) {
|
||||
val uris = Matisse.obtainResult(data) // 获取选中URI列表
|
||||
val paths = Matisse.obtainPathResult(data) // 获取文件路径列表
|
||||
|
||||
geoPointList[3].let {
|
||||
paths?.forEach { path ->
|
||||
val size = it.images!!.size
|
||||
it.images!!.add(size - 1, GeoPointImage(imagePath = path))
|
||||
}
|
||||
}
|
||||
geoPointAdapter.notifyItemChanged(3)
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
+29
-1
@@ -2,10 +2,13 @@ package com.zmkg.coaloperation.ui.geologging
|
||||
|
||||
import android.os.Bundle
|
||||
import android.view.View
|
||||
import androidx.recyclerview.widget.LinearLayoutManager
|
||||
import com.zmkg.coaloperation.R
|
||||
import com.zmkg.coaloperation.adapter.GeoLoggingFaceAdapter
|
||||
import com.zmkg.coaloperation.base.BaseVMBActivity
|
||||
import com.zmkg.coaloperation.base.viewmodel.TestViewModel
|
||||
import com.zmkg.coaloperation.databinding.ActivityGeologicalBinding
|
||||
import com.zmkg.coaloperation.db.entity.geologging.GeoLoggingFace
|
||||
|
||||
/**
|
||||
* 地质编录
|
||||
@@ -13,11 +16,36 @@ import com.zmkg.coaloperation.databinding.ActivityGeologicalBinding
|
||||
class GeologicalActivity :
|
||||
BaseVMBActivity<TestViewModel, ActivityGeologicalBinding>(R.layout.activity_geological) {
|
||||
|
||||
val faceList: MutableList<GeoLoggingFace> = mutableListOf()
|
||||
val faceAdapter by lazy {
|
||||
GeoLoggingFaceAdapter(faceList).apply {
|
||||
setOnItemClickListener { adapter, view, position ->
|
||||
toActivity(GeologicalPointActivity::class.java)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
override fun initView(savedInstanceState: Bundle?) {
|
||||
mBinding.toolbarLay.title = "编录位置选择"
|
||||
mBinding.toolbarLay.rightText = "新增工作面"
|
||||
mBinding.toolbarLay.titleTvRight.setOnClickListener {
|
||||
toActivity(GeologicalPointActivity::class.java)
|
||||
toActivity(AddGeoLoggingFaceActivity::class.java)
|
||||
}
|
||||
|
||||
faceList.run {
|
||||
add(GeoLoggingFace(surfaceName = "5-20304回风工作面"))
|
||||
add(GeoLoggingFace(surfaceName = "5-20305回风工作面"))
|
||||
add(GeoLoggingFace(surfaceName = "5-20306回风工作面"))
|
||||
add(GeoLoggingFace(surfaceName = "5-20307回风工作面"))
|
||||
add(GeoLoggingFace(surfaceName = "5-20308回风工作面"))
|
||||
add(GeoLoggingFace(surfaceName = "5-20309回风工作面"))
|
||||
add(GeoLoggingFace(surfaceName = "5-20310回风工作面"))
|
||||
add(GeoLoggingFace(surfaceName = "5-20311回风工作面"))
|
||||
}
|
||||
|
||||
mBinding.rvGeoLogging.let {
|
||||
it.layoutManager = LinearLayoutManager(this)
|
||||
it.adapter = faceAdapter
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -7,6 +7,8 @@ import android.graphics.Color
|
||||
import android.graphics.drawable.GradientDrawable
|
||||
import android.util.TypedValue
|
||||
import android.view.View
|
||||
import android.widget.ImageView
|
||||
import com.bumptech.glide.Glide
|
||||
import kotlinx.coroutines.CoroutineScope
|
||||
import kotlinx.coroutines.Dispatchers
|
||||
import kotlinx.coroutines.Job
|
||||
@@ -126,4 +128,8 @@ fun View.useShapeSetBackground(
|
||||
this.background = shape
|
||||
}
|
||||
|
||||
fun ImageView.load(any:Any) {
|
||||
Glide.with(this.context).load(any).into(this)
|
||||
}
|
||||
|
||||
|
||||
|
||||
@@ -0,0 +1,28 @@
|
||||
package com.zmkg.coaloperation.utils
|
||||
|
||||
import android.app.Activity
|
||||
import android.content.pm.ActivityInfo
|
||||
import com.zhihu.matisse.Matisse
|
||||
import com.zhihu.matisse.MimeType
|
||||
import com.zhihu.matisse.R
|
||||
import com.zhihu.matisse.engine.impl.GlideEngine
|
||||
import com.zhihu.matisse.internal.entity.CaptureStrategy
|
||||
|
||||
object GalleryUtils {
|
||||
|
||||
fun openGallery(activity: Activity, requestCode:Int) {
|
||||
Matisse.from(activity)
|
||||
.choose(MimeType.ofImage(),false) // 只选图片
|
||||
.capture(true)
|
||||
.captureStrategy(CaptureStrategy(true, "${activity.packageName}.fileprovider", "coalImage"))
|
||||
.countable(true) // 显示选中数量
|
||||
.maxSelectable(9) // 最多选9张
|
||||
.gridExpectedSize(120.dp)
|
||||
.restrictOrientation(ActivityInfo.SCREEN_ORIENTATION_PORTRAIT)
|
||||
.thumbnailScale(0.8f)
|
||||
.theme(R.style.Matisse_Dracula)
|
||||
.imageEngine(GlideEngine()) // 必须设置引擎
|
||||
.forResult(requestCode)
|
||||
}
|
||||
|
||||
}
|
||||
+80
@@ -0,0 +1,80 @@
|
||||
package com.zmkg.coaloperation.utils.permission//package com.dheaven.mscapp.SIGFFCNFN.permission
|
||||
//
|
||||
//import androidx.activity.result.contract.ActivityResultContracts
|
||||
//import androidx.fragment.app.Fragment
|
||||
//
|
||||
//class InvisibleFragment : Fragment() {
|
||||
//
|
||||
// private var singlePermissionAction: ((Boolean) -> Unit)? = null
|
||||
// private var multiplePermissionAction: ((MutableMap<String,Boolean>) -> Unit)? = null
|
||||
//
|
||||
// private val singlePermissionLauncher = registerForActivityResult(
|
||||
// ActivityResultContracts.RequestPermission()
|
||||
// ) {
|
||||
// singlePermissionAction?.invoke(it)
|
||||
// }
|
||||
// private val multiplePermissionLauncher = registerForActivityResult(
|
||||
// ActivityResultContracts.RequestMultiplePermissions()
|
||||
// ) {
|
||||
// multiplePermissionAction?.invoke(it)
|
||||
// }
|
||||
//
|
||||
// private fun requestSinglePermission(permission: String, action: (Boolean) -> Unit) {
|
||||
// singlePermissionAction = action
|
||||
// singlePermissionLauncher.launch(permission)
|
||||
// }
|
||||
// private fun requestMultiplePermission(permission: Array<String>, action: (MutableMap<String,Boolean>) -> Unit) {
|
||||
// multiplePermissionAction = action
|
||||
// multiplePermissionLauncher.launch(permission)
|
||||
// }
|
||||
// fun requestNow(
|
||||
// callback: (granted: Boolean, deniedList: List<String>) -> Unit,
|
||||
// args: Array<String>
|
||||
// ) {
|
||||
// permissionCallback = callback
|
||||
//// requestPermissions(args, 1)
|
||||
//
|
||||
// if (args.size == 1) {
|
||||
// requestSinglePermission(args[0]) {
|
||||
// val deniedList = mutableListOf<String>()
|
||||
// if (it.not()) {
|
||||
// deniedList.add(args[0])
|
||||
// }
|
||||
// callback(it, deniedList)
|
||||
// }
|
||||
// return
|
||||
// }
|
||||
// requestMultiplePermission(args){
|
||||
// val deniedList = mutableListOf<String>()
|
||||
// it.entries.forEach { entry ->
|
||||
// entry.apply {
|
||||
// if (value.not()) {
|
||||
// deniedList.add(key)
|
||||
// }
|
||||
// }
|
||||
// }
|
||||
// val granted = deniedList.isEmpty()
|
||||
// callback(granted, deniedList)
|
||||
// }
|
||||
// }
|
||||
//
|
||||
//// override fun onRequestPermissionsResult(
|
||||
//// requestCode: Int,
|
||||
//// permissions: Array<String>,
|
||||
//// grantResults: IntArray
|
||||
//// ) {
|
||||
//// super.onRequestPermissionsResult(requestCode, permissions, grantResults)
|
||||
//// if (requestCode == 1) {
|
||||
//// val deniedList: MutableList<String> = ArrayList()
|
||||
//// for (i in grantResults.indices) {
|
||||
//// if (grantResults[i] != PackageManager.PERMISSION_GRANTED) {
|
||||
//// deniedList.add(permissions[i])
|
||||
//// }
|
||||
//// }
|
||||
//// val allGranted = deniedList.isEmpty()
|
||||
//// permissionCallback?.invoke(allGranted, deniedList)
|
||||
//// }
|
||||
//// }
|
||||
//
|
||||
// private var permissionCallback: ((granted: Boolean, deniedList: List<String>) -> Unit)? = null
|
||||
//}
|
||||
+51
@@ -0,0 +1,51 @@
|
||||
package com.dheaven.mscapp.SIGFFCNFN.permission
|
||||
|
||||
import com.zmkg.coaloperation.base.BaseActivity
|
||||
|
||||
object PermissionUtils {
|
||||
// private const val TAG = "InvisibleFragment"
|
||||
fun request(
|
||||
activity: BaseActivity,
|
||||
permissions: Array<String>,
|
||||
callback: (granted: Boolean, deniedList: List<String>) -> Unit
|
||||
) {
|
||||
if (permissions.isEmpty()) {
|
||||
return
|
||||
}
|
||||
// val fragmentManager = activity.supportFragmentManager
|
||||
// val fragment = fragmentManager.findFragmentByTag(TAG)
|
||||
// var invisibleFragment: InvisibleFragment? = null
|
||||
// if (invisibleFragment == null) {
|
||||
// invisibleFragment = InvisibleFragment()
|
||||
// fragmentManager.beginTransaction().add(invisibleFragment, TAG).commitNow()
|
||||
// } else {
|
||||
// invisibleFragment = fragment as InvisibleFragment
|
||||
// }
|
||||
// invisibleFragment.requestNow(callback, permissions)
|
||||
//单权限请求
|
||||
if (permissions.size == 1) {
|
||||
val permission = permissions[0]
|
||||
activity.requestSinglePermissionResult(permission) {
|
||||
val deniedList = mutableListOf<String>()
|
||||
if (it.not()) {
|
||||
deniedList.add(permission)
|
||||
}
|
||||
callback(it, deniedList)
|
||||
}
|
||||
return
|
||||
}
|
||||
//多权限请求
|
||||
activity.requestMultiplePermissionsResult(permissions) {
|
||||
val deniedList = mutableListOf<String>()
|
||||
it.entries.forEach { entry ->
|
||||
entry.apply {
|
||||
if (value.not()) {
|
||||
deniedList.add(key)
|
||||
}
|
||||
}
|
||||
}
|
||||
val granted = deniedList.isEmpty()
|
||||
callback(granted, deniedList)
|
||||
}
|
||||
}
|
||||
}
|
||||
+31
@@ -0,0 +1,31 @@
|
||||
package com.zmkg.coaloperation.utils.permission
|
||||
|
||||
import android.Manifest
|
||||
import android.content.Intent
|
||||
import android.os.Build
|
||||
import android.os.Environment
|
||||
import android.provider.Settings
|
||||
import com.zmkg.coaloperation.base.BaseActivity
|
||||
|
||||
object StorageUtils {
|
||||
|
||||
fun requestPermission(activity: BaseActivity, callback: () -> Unit) {
|
||||
activity.requestSinglePermissionResult(Manifest.permission.CAMERA) {
|
||||
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.R) {
|
||||
if (Environment.isExternalStorageManager()) {
|
||||
callback()
|
||||
} else {
|
||||
val intent = Intent(Settings.ACTION_MANAGE_ALL_FILES_ACCESS_PERMISSION)
|
||||
// activity.startActivityForResult(intent, MANAGE_REQUEST_CODE)
|
||||
activity.launchActivityResult(intent) {
|
||||
callback()
|
||||
}
|
||||
}
|
||||
} else {
|
||||
activity.requestSinglePermissionResult(Manifest.permission.WRITE_EXTERNAL_STORAGE) {
|
||||
callback()
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
Binary file not shown.
|
Before Width: | Height: | Size: 1.8 KiB After Width: | Height: | Size: 1.3 KiB |
@@ -0,0 +1,73 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<layout xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
xmlns:app="http://schemas.android.com/apk/res-auto"
|
||||
xmlns:tools="http://schemas.android.com/tools">
|
||||
|
||||
<data>
|
||||
|
||||
</data>
|
||||
|
||||
<LinearLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:background="@color/black_bg"
|
||||
android:orientation="vertical">
|
||||
|
||||
<include
|
||||
android:id="@+id/toolbar_lay"
|
||||
layout="@layout/lay_title_right_bar" />
|
||||
|
||||
<LinearLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="60dp"
|
||||
android:layout_marginHorizontal="20dp"
|
||||
android:background="@drawable/bg_stroke_gray"
|
||||
android:gravity="center_vertical"
|
||||
android:orientation="horizontal">
|
||||
|
||||
<TextView
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginStart="20dp"
|
||||
android:layout_weight="1"
|
||||
android:text="工作面名称"
|
||||
android:textColor="#6A6F87"
|
||||
android:textSize="16sp" />
|
||||
|
||||
<EditText
|
||||
android:id="@+id/etWorkfaceName"
|
||||
android:layout_width="80dp"
|
||||
android:layout_height="30dp"
|
||||
android:layout_marginEnd="15dp"
|
||||
android:background="@drawable/rectangle_stroke_grey_corner8"
|
||||
android:hint="请输入"
|
||||
android:maxLines="1"
|
||||
android:paddingStart="5dp"
|
||||
android:paddingEnd="5dp"
|
||||
android:textColor="@color/white"
|
||||
android:textColorHint="#757B8C"
|
||||
android:textCursorDrawable="@drawable/cursor_white"
|
||||
android:textSize="14sp" />
|
||||
|
||||
</LinearLayout>
|
||||
|
||||
<Space
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="0dp"
|
||||
android:layout_weight="1" />
|
||||
|
||||
<com.allen.library.shape.ShapeButton
|
||||
android:id="@+id/btnAddFace"
|
||||
style="?android:attr/buttonBarButtonStyle"
|
||||
android:layout_width="250dp"
|
||||
android:layout_height="50dp"
|
||||
android:layout_gravity="center"
|
||||
android:layout_marginBottom="35dp"
|
||||
android:text="确认新增"
|
||||
android:textColor="@color/white"
|
||||
android:textSize="14sp"
|
||||
app:shapeCornersRadius="36dp"
|
||||
app:shapeSolidColor="#21A69A" />
|
||||
|
||||
</LinearLayout>
|
||||
</layout>
|
||||
@@ -37,77 +37,9 @@
|
||||
app:shapeCornersRadius="36dp"
|
||||
app:shapeSolidColor="#21A69A" />
|
||||
|
||||
<LinearLayout
|
||||
<net.lucode.hackware.magicindicator.MagicIndicator
|
||||
android:id="@+id/magicIndicator"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="56dp"
|
||||
android:gravity="center_vertical"
|
||||
android:orientation="horizontal">
|
||||
|
||||
<com.allen.library.shape.ShapeTextView
|
||||
android:layout_width="35dp"
|
||||
android:layout_height="35dp"
|
||||
android:layout_marginStart="5dp"
|
||||
android:gravity="center"
|
||||
android:text="1#"
|
||||
android:textColor="#30E0A1"
|
||||
android:textSize="20sp"
|
||||
app:shapeCornersRadius="8dp"
|
||||
app:shapeSolidColor="#1430E0A1" />
|
||||
|
||||
<com.allen.library.shape.ShapeTextView
|
||||
android:layout_width="35dp"
|
||||
android:layout_height="35dp"
|
||||
android:layout_marginStart="5dp"
|
||||
android:gravity="center"
|
||||
android:text="1#"
|
||||
android:textColor="@color/white"
|
||||
android:textSize="20sp"
|
||||
app:shapeCornersRadius="8dp"
|
||||
app:shapeSolidColor="#1430E0A1" />
|
||||
|
||||
<com.allen.library.shape.ShapeTextView
|
||||
android:layout_width="35dp"
|
||||
android:layout_height="35dp"
|
||||
android:layout_marginStart="5dp"
|
||||
android:gravity="center"
|
||||
android:text="1#"
|
||||
android:textColor="@color/white"
|
||||
android:textSize="20sp"
|
||||
app:shapeCornersRadius="8dp"
|
||||
app:shapeSolidColor="#1430E0A1" />
|
||||
|
||||
<com.allen.library.shape.ShapeTextView
|
||||
android:layout_width="35dp"
|
||||
android:layout_height="35dp"
|
||||
android:layout_marginStart="5dp"
|
||||
android:gravity="center"
|
||||
android:text="1#"
|
||||
android:textColor="@color/white"
|
||||
android:textSize="20sp"
|
||||
app:shapeCornersRadius="8dp"
|
||||
app:shapeSolidColor="#1430E0A1" />
|
||||
|
||||
<com.allen.library.shape.ShapeTextView
|
||||
android:layout_width="35dp"
|
||||
android:layout_height="35dp"
|
||||
android:layout_marginStart="5dp"
|
||||
android:gravity="center"
|
||||
android:text="1#"
|
||||
android:textColor="@color/white"
|
||||
android:textSize="20sp"
|
||||
app:shapeCornersRadius="8dp"
|
||||
app:shapeSolidColor="#1430E0A1" />
|
||||
|
||||
<com.allen.library.shape.ShapeTextView
|
||||
android:layout_width="35dp"
|
||||
android:layout_height="35dp"
|
||||
android:layout_marginStart="5dp"
|
||||
android:gravity="center"
|
||||
android:text="1#"
|
||||
android:textColor="@color/white"
|
||||
android:textSize="20sp"
|
||||
app:shapeCornersRadius="8dp"
|
||||
app:shapeSolidColor="#1430E0A1" />
|
||||
</LinearLayout>
|
||||
android:layout_height="56dp"/>
|
||||
</LinearLayout>
|
||||
</layout>
|
||||
@@ -21,6 +21,7 @@
|
||||
android:id="@+id/rvGeoLogging"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:overScrollMode="never"
|
||||
tools:listitem="@layout/item_geological_list" />
|
||||
|
||||
</LinearLayout>
|
||||
|
||||
@@ -38,25 +38,25 @@
|
||||
android:paddingBottom="20dp">
|
||||
|
||||
<Button
|
||||
android:id="@+id/btnRecord"
|
||||
android:id="@+id/btnStartLogging"
|
||||
style="?android:attr/buttonBarButtonStyle"
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="44dp"
|
||||
android:layout_weight="1"
|
||||
android:background="@drawable/bg_btn_save"
|
||||
android:text="查看记录"
|
||||
android:text="开始编录"
|
||||
android:textColor="@color/white"
|
||||
android:textSize="14sp" />
|
||||
|
||||
<Button
|
||||
android:id="@+id/btnSubmit"
|
||||
android:id="@+id/btnCompleteLogging"
|
||||
style="?android:attr/buttonBarButtonStyle"
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="44dp"
|
||||
android:layout_marginStart="8dp"
|
||||
android:layout_weight="1"
|
||||
android:background="@drawable/bg_btn_export"
|
||||
android:text="确认提交"
|
||||
android:text="编录完成"
|
||||
android:textColor="@color/white"
|
||||
android:textSize="14sp" />
|
||||
</LinearLayout>
|
||||
|
||||
@@ -7,83 +7,35 @@
|
||||
|
||||
</data>
|
||||
|
||||
<LinearLayout
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:orientation="vertical">
|
||||
<com.allen.library.shape.ShapeLinearLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="74dp"
|
||||
android:layout_marginHorizontal="20dp"
|
||||
app:shapeCornersRadius="6dp"
|
||||
android:layout_marginVertical="5dp"
|
||||
android:gravity="center_vertical"
|
||||
app:shapeSolidColor="#1521A69A"
|
||||
app:shapeStrokeColor="#282C38"
|
||||
app:shapeStrokeWidth="1dp">
|
||||
|
||||
<com.allen.library.shape.ShapeRelativeLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="74dp"
|
||||
android:layout_marginHorizontal="20dp"
|
||||
android:layout_marginTop="10dp"
|
||||
app:shapeCornersRadius="6dp"
|
||||
app:shapeSolidColor="#1521A69A"
|
||||
app:shapeStrokeColor="#10514C"
|
||||
app:shapeStrokeWidth="1dp">
|
||||
<ImageView
|
||||
android:layout_width="30dp"
|
||||
android:layout_height="38dp"
|
||||
android:layout_marginStart="20dp"
|
||||
android:background="@drawable/ic_geological" />
|
||||
|
||||
<ImageView
|
||||
android:layout_width="30dp"
|
||||
android:layout_height="38dp"
|
||||
android:layout_centerVertical="true"
|
||||
android:layout_marginLeft="20dp"
|
||||
android:layout_marginRight="13dp"
|
||||
android:background="@drawable/ic_geological" />
|
||||
|
||||
<TextView
|
||||
android:id="@+id/title"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_centerVertical="true"
|
||||
android:layout_marginLeft="60dp"
|
||||
android:textColor="@color/white"
|
||||
android:textSize="14sp"
|
||||
tools:text="5-20304回风工作面" />
|
||||
|
||||
<ImageView
|
||||
android:id="@+id/expand"
|
||||
android:layout_width="36dp"
|
||||
android:layout_height="36dp"
|
||||
android:padding="6dp"
|
||||
android:layout_alignParentEnd="true"
|
||||
android:layout_centerVertical="true"
|
||||
android:layout_marginRight="13dp"
|
||||
android:src="@drawable/ic_arrow_right_gray"
|
||||
android:tag="0" />
|
||||
|
||||
|
||||
</com.allen.library.shape.ShapeRelativeLayout>
|
||||
|
||||
<LinearLayout
|
||||
android:id="@+id/record_layout"
|
||||
android:layout_width="match_parent"
|
||||
<TextView
|
||||
android:id="@+id/tvFaceName"
|
||||
android:layout_width="0dp"
|
||||
android:layout_weight="1"
|
||||
android:maxLines="1"
|
||||
android:ellipsize="end"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginTop="5dp"
|
||||
android:orientation="vertical"
|
||||
android:visibility="gone">
|
||||
android:layout_marginStart="10dp"
|
||||
android:textColor="@color/white"
|
||||
android:textSize="14sp"
|
||||
tools:text="5-20304回风工作面" />
|
||||
|
||||
<androidx.recyclerview.widget.RecyclerView
|
||||
android:id="@+id/rv_content"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="200dp"
|
||||
app:layoutManager="androidx.recyclerview.widget.LinearLayoutManager"
|
||||
tools:itemCount="3"
|
||||
tools:listitem="@layout/item_geological_list_content" />
|
||||
|
||||
<com.allen.library.shape.ShapeTextView
|
||||
android:id="@+id/start_record"
|
||||
android:layout_width="154dp"
|
||||
android:layout_height="44dp"
|
||||
android:layout_gravity="center_horizontal"
|
||||
android:layout_marginTop="20dp"
|
||||
android:gravity="center"
|
||||
android:text="开始记录"
|
||||
android:textColor="@color/white"
|
||||
app:shapeCornersRadius="30dp"
|
||||
app:shapeSolidColor="#21A69A" />
|
||||
|
||||
</LinearLayout>
|
||||
|
||||
</LinearLayout>
|
||||
</com.allen.library.shape.ShapeLinearLayout>
|
||||
|
||||
</layout>
|
||||
@@ -25,18 +25,22 @@
|
||||
android:layout_marginStart="20dp"
|
||||
tools:text="瓦斯含量" />
|
||||
|
||||
<TextView
|
||||
android:id="@+id/tvItemValue"
|
||||
<EditText
|
||||
android:id="@+id/etInputValue"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="50dp"
|
||||
android:layout_gravity="end"
|
||||
android:layout_marginEnd="15dp"
|
||||
android:minWidth="80dp"
|
||||
android:gravity="end|center_vertical"
|
||||
android:maxLines="1"
|
||||
android:ellipsize="end"
|
||||
android:textColor="@color/white"
|
||||
android:textSize="16sp"
|
||||
tools:text="15m/s" />
|
||||
android:hint="请输入"
|
||||
android:background="@color/transparent"
|
||||
android:textCursorDrawable="@drawable/cursor_white"
|
||||
android:textColorHint="#757B8C"
|
||||
android:textSize="16sp" />
|
||||
|
||||
<com.google.android.material.divider.MaterialDivider
|
||||
android:id="@+id/divider"
|
||||
|
||||
@@ -38,16 +38,19 @@
|
||||
android:layout_gravity="bottom"
|
||||
app:dividerColor="#20222B" />
|
||||
|
||||
<TextView
|
||||
android:id="@+id/tvItemValue"
|
||||
<EditText
|
||||
android:id="@+id/etInputValue"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="50dp"
|
||||
android:ellipsize="end"
|
||||
android:gravity="center"
|
||||
android:maxLines="1"
|
||||
android:background="@color/transparent"
|
||||
android:textCursorDrawable="@drawable/cursor_white"
|
||||
android:textColor="@color/white"
|
||||
android:textSize="14sp"
|
||||
tools:text="15m/s" />
|
||||
android:hint="请输入"
|
||||
android:textColorHint="#757B8C"
|
||||
android:textSize="14sp" />
|
||||
|
||||
</LinearLayout>
|
||||
|
||||
|
||||
@@ -62,13 +62,14 @@
|
||||
<LinearLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="50dp"
|
||||
android:paddingStart="20dp"
|
||||
android:paddingEnd="15dp"
|
||||
android:background="@drawable/bottom_border"
|
||||
android:orientation="horizontal">
|
||||
|
||||
<LinearLayout
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="50dp"
|
||||
android:layout_marginStart="20dp"
|
||||
android:layout_weight="1">
|
||||
|
||||
<TextView
|
||||
@@ -93,14 +94,17 @@
|
||||
android:textColor="@color/white"
|
||||
android:textSize="16sp"
|
||||
tools:text="1024.341" />
|
||||
|
||||
</LinearLayout>
|
||||
|
||||
<com.google.android.material.divider.MaterialDivider
|
||||
android:layout_width="1dp"
|
||||
android:layout_height="match_parent"
|
||||
android:layout_gravity="bottom"
|
||||
android:layout_marginHorizontal="8dp"
|
||||
app:dividerColor="#20222B" />
|
||||
<LinearLayout
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="50dp"
|
||||
android:layout_marginStart="15dp"
|
||||
android:layout_marginEnd="15dp"
|
||||
android:layout_weight="1">
|
||||
|
||||
<TextView
|
||||
@@ -133,8 +137,8 @@
|
||||
<LinearLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="50dp"
|
||||
android:layout_marginStart="20dp"
|
||||
android:layout_marginEnd="15dp"
|
||||
android:paddingStart="20dp"
|
||||
android:paddingEnd="15dp"
|
||||
android:background="@drawable/bottom_border"
|
||||
android:orientation="horizontal">
|
||||
|
||||
@@ -168,10 +172,16 @@
|
||||
|
||||
</LinearLayout>
|
||||
|
||||
|
||||
<com.google.android.material.divider.MaterialDivider
|
||||
android:layout_width="1dp"
|
||||
android:layout_height="match_parent"
|
||||
android:layout_gravity="bottom"
|
||||
android:layout_marginHorizontal="8dp"
|
||||
app:dividerColor="#20222B" />
|
||||
<LinearLayout
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="50dp"
|
||||
android:layout_marginStart="15dp"
|
||||
android:layout_weight="1">
|
||||
|
||||
<TextView
|
||||
|
||||
@@ -2,12 +2,15 @@
|
||||
<layout xmlns:android="http://schemas.android.com/apk/res/android">
|
||||
|
||||
<FrameLayout
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content">
|
||||
<ImageView
|
||||
android:id="@+id/ivPointImage"
|
||||
android:layout_width="60dp"
|
||||
android:layout_height="60dp"
|
||||
android:layout_width="70dp"
|
||||
android:layout_height="70dp"
|
||||
android:layout_marginVertical="5dp"
|
||||
android:layout_gravity="center"
|
||||
android:scaleType="centerCrop"
|
||||
android:src="@drawable/ic_add_image"/>
|
||||
</FrameLayout>
|
||||
</layout>
|
||||
@@ -24,8 +24,10 @@
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:overScrollMode="never"
|
||||
android:background="@drawable/bg_stroke_gray"
|
||||
tools:itemCount="4"
|
||||
app:spanCount="4"
|
||||
android:paddingVertical="5dp"
|
||||
android:orientation="vertical"
|
||||
tools:listitem="@layout/list_item_point_image"
|
||||
app:layoutManager="androidx.recyclerview.widget.GridLayoutManager"/>
|
||||
|
||||
@@ -1,4 +1,10 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<paths xmlns:android="http://schemas.android.com/apk/res/android">
|
||||
<external-path name="external_files" path="."/>
|
||||
<files-path name="my_files" path="." />
|
||||
<cache-path name="my_cache" path="." />
|
||||
<!-- <external-path name="my_external" path="." />-->
|
||||
<external-files-path name="external_files" path="." />
|
||||
<external-cache-path name="external_cache" path="." />
|
||||
<external-path name="external_storage" path="." />
|
||||
</paths>
|
||||
Reference in New Issue
Block a user