日期,图片等选择器封装使用
This commit is contained in:
parent
5705e51a2d
commit
4c51daa245
@ -236,6 +236,15 @@
|
||||
android:configChanges="keyboardHidden|orientation|locale"
|
||||
android:screenOrientation="portrait"
|
||||
android:windowSoftInputMode="adjustPan|stateHidden" />
|
||||
|
||||
<activity
|
||||
android:name=".ui.mine.activity.CarTeamActivity"
|
||||
android:configChanges="keyboardHidden|orientation|locale"
|
||||
android:screenOrientation="portrait"
|
||||
android:windowSoftInputMode="adjustPan|stateHidden" />
|
||||
|
||||
|
||||
|
||||
<!-- 我的相关end -->
|
||||
|
||||
|
||||
|
@ -5,6 +5,8 @@ import com.dahe.gldriver.R
|
||||
import com.dahe.gldriver.databinding.ActivityAuthBankcardBinding
|
||||
import com.dahe.mylibrary.base.BaseActivity
|
||||
import com.dahe.mylibrary.utils.ActivityUtils
|
||||
import com.dahe.mylibrary.utils.ImageLoader
|
||||
import com.dahe.mylibrary.utils.PopsUtils
|
||||
|
||||
/**
|
||||
* @ClassName AuthBankCardActivity
|
||||
@ -15,9 +17,17 @@ import com.dahe.mylibrary.utils.ActivityUtils
|
||||
class AuthBankCardActivity : BaseActivity<ActivityAuthBankcardBinding>() {
|
||||
override fun initView(savedInstanceState: Bundle?) {
|
||||
setStatusBarColor(R.color.white)
|
||||
setTitleBar("实名认证",true)
|
||||
binding.btnOk.setOnClickListener {
|
||||
ActivityUtils.startActivity(mContext,AuthFaceActivity::class.java)
|
||||
setTitleBar("实名认证", true)
|
||||
|
||||
binding.run {
|
||||
btnOk.setOnClickListener {
|
||||
ActivityUtils.startActivity(mContext, AuthFaceActivity::class.java)
|
||||
}
|
||||
ivFront.setOnClickListener {
|
||||
PopsUtils.getInstance().showSimSelPic(mContext) {
|
||||
ImageLoader.getInstance().loadRoundImage(mContext, it[0].path, 12, ivFront)
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -3,13 +3,11 @@ package com.dahe.gldriver.ui.account.authperson
|
||||
import android.os.Bundle
|
||||
import com.dahe.gldriver.R
|
||||
import com.dahe.gldriver.databinding.ActivityAuthDriverBinding
|
||||
import com.dahe.gldriver.utils.PickDateUtils
|
||||
import com.dahe.gldriver.utils.SPUtils
|
||||
import com.dahe.mylibrary.utils.PickerUtils
|
||||
import com.dahe.mylibrary.base.BaseActivity
|
||||
import com.dahe.mylibrary.utils.ActivityUtils
|
||||
import com.dahe.mylibrary.utils.ToastUtils
|
||||
import com.github.gzuliyujiang.wheelpicker.contract.OnDatePickedListener
|
||||
import com.github.gzuliyujiang.wheelpicker.entity.DateEntity
|
||||
import com.dahe.mylibrary.utils.ImageLoader
|
||||
import com.dahe.mylibrary.utils.PopsUtils
|
||||
|
||||
/**
|
||||
* @ClassName AuthRoleActivity
|
||||
@ -29,7 +27,7 @@ class AuthDriverActivity : BaseActivity<ActivityAuthDriverBinding>() {
|
||||
|
||||
tvStart.run {
|
||||
setOnClickListener {
|
||||
PickDateUtils.getInstance()
|
||||
PickerUtils.getInstance()
|
||||
.showDate(this@AuthDriverActivity, "有效起始日期") { year, month, day ->
|
||||
this.text = "$year-$month-$day"
|
||||
}
|
||||
@ -37,7 +35,7 @@ class AuthDriverActivity : BaseActivity<ActivityAuthDriverBinding>() {
|
||||
}
|
||||
tvEnd.run {
|
||||
setOnClickListener {
|
||||
PickDateUtils.getInstance()
|
||||
PickerUtils.getInstance()
|
||||
.showDate(this@AuthDriverActivity, "有效结束日期") { year, month, day ->
|
||||
this.text = "$year-$month-$day"
|
||||
}
|
||||
@ -45,13 +43,27 @@ class AuthDriverActivity : BaseActivity<ActivityAuthDriverBinding>() {
|
||||
}
|
||||
tvCarType.run {
|
||||
setOnClickListener {
|
||||
PickDateUtils.getInstance()
|
||||
PickerUtils.getInstance()
|
||||
.showSelectCarType(this@AuthDriverActivity, "选择准驾车型") { _, item ->
|
||||
this.text = item.toString()
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
ivFront.setOnClickListener {
|
||||
PopsUtils.getInstance().showSimSelPic(mContext){
|
||||
var data = it[0]
|
||||
ImageLoader.getInstance().loadRoundImage(mContext,data.path,12,ivFront)
|
||||
}
|
||||
}
|
||||
|
||||
ivBack.setOnClickListener {
|
||||
PopsUtils.getInstance().showSimSelPic(mContext){
|
||||
var data = it[0]
|
||||
ImageLoader.getInstance().loadRoundImage(mContext,data.path,12,ivBack)
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -5,6 +5,8 @@ import com.dahe.gldriver.R
|
||||
import com.dahe.gldriver.databinding.ActivityAuthDrivingBinding
|
||||
import com.dahe.mylibrary.base.BaseActivity
|
||||
import com.dahe.mylibrary.utils.ActivityUtils
|
||||
import com.dahe.mylibrary.utils.ImageLoader
|
||||
import com.dahe.mylibrary.utils.PopsUtils
|
||||
|
||||
/**
|
||||
* @ClassName AuthRoleActivity
|
||||
@ -15,9 +17,27 @@ import com.dahe.mylibrary.utils.ActivityUtils
|
||||
class AuthDrivingActivity : BaseActivity<ActivityAuthDrivingBinding>() {
|
||||
override fun initView(savedInstanceState: Bundle?) {
|
||||
setStatusBarColor(R.color.white)
|
||||
setTitleBar("实名认证",true)
|
||||
setTitleBar("实名认证", true)
|
||||
binding.btnOk.setOnClickListener {
|
||||
ActivityUtils.startActivity(mContext,AuthRoadActivity::class.java)
|
||||
ActivityUtils.startActivity(mContext, AuthRoadActivity::class.java)
|
||||
}
|
||||
binding.run {
|
||||
ivFront.setOnClickListener {
|
||||
PopsUtils.getInstance().showSimSelPic(mContext) {
|
||||
ImageLoader.getInstance().loadRoundImage(mContext, it[0].path, 12, ivFront)
|
||||
}
|
||||
}
|
||||
|
||||
ivBack.setOnClickListener {
|
||||
PopsUtils.getInstance().showSimSelPic(mContext) {
|
||||
ImageLoader.getInstance().loadRoundImage(mContext, it[0].path, 12, ivBack)
|
||||
}
|
||||
}
|
||||
ivCar.setOnClickListener {
|
||||
PopsUtils.getInstance().showSimSelPic(mContext) {
|
||||
ImageLoader.getInstance().loadRoundImage(mContext, it[0].path, 12, ivCar)
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -3,9 +3,11 @@ package com.dahe.gldriver.ui.account.authperson
|
||||
import android.os.Bundle
|
||||
import com.dahe.gldriver.R
|
||||
import com.dahe.gldriver.databinding.ActivityAuthPersonBinding
|
||||
import com.dahe.gldriver.utils.PickDateUtils
|
||||
import com.dahe.mylibrary.utils.PickerUtils
|
||||
import com.dahe.mylibrary.base.BaseActivity
|
||||
import com.dahe.mylibrary.utils.ActivityUtils
|
||||
import com.dahe.mylibrary.utils.ImageLoader
|
||||
import com.dahe.mylibrary.utils.PopsUtils
|
||||
import com.dahe.mylibrary.utils.ToastUtils
|
||||
|
||||
/**
|
||||
@ -18,14 +20,15 @@ class AuthPersonActivity : BaseActivity<ActivityAuthPersonBinding>() {
|
||||
override fun initView(savedInstanceState: Bundle?) {
|
||||
setStatusBarColor(R.color.white)
|
||||
setTitleBar("实名认证", true)
|
||||
binding.btnOk.setOnClickListener {
|
||||
ActivityUtils.startActivity(mContext, AuthDriverActivity::class.java)
|
||||
}
|
||||
|
||||
binding.run {
|
||||
|
||||
btnOk.setOnClickListener {
|
||||
ActivityUtils.startActivity(mContext, AuthDriverActivity::class.java)
|
||||
}
|
||||
tvStart.run {
|
||||
setOnClickListener {
|
||||
PickDateUtils.getInstance()
|
||||
PickerUtils.getInstance()
|
||||
.showDate(this@AuthPersonActivity,"有效起始日期") { year, month, day ->
|
||||
this.text = "$year-$month-$day"
|
||||
}
|
||||
@ -33,12 +36,26 @@ class AuthPersonActivity : BaseActivity<ActivityAuthPersonBinding>() {
|
||||
}
|
||||
tvEnd.run {
|
||||
setOnClickListener {
|
||||
PickDateUtils.getInstance()
|
||||
PickerUtils.getInstance()
|
||||
.showDate(this@AuthPersonActivity,"有效结束日期") { year, month, day ->
|
||||
this.text = "$year-$month-$day"
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
ivFront.setOnClickListener {
|
||||
PopsUtils.getInstance().showSimSelPic(mContext){
|
||||
var data = it[0]
|
||||
ImageLoader.getInstance().loadRoundImage(mContext,data.path,12,ivFront)
|
||||
}
|
||||
}
|
||||
|
||||
ivBack.setOnClickListener {
|
||||
PopsUtils.getInstance().showSimSelPic(mContext){
|
||||
var data = it[0]
|
||||
ImageLoader.getInstance().loadRoundImage(mContext,data.path,12,ivBack)
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -3,9 +3,11 @@ package com.dahe.gldriver.ui.account.authperson
|
||||
import android.os.Bundle
|
||||
import com.dahe.gldriver.R
|
||||
import com.dahe.gldriver.databinding.ActivityAuthQualificationBinding
|
||||
import com.dahe.gldriver.utils.PickDateUtils
|
||||
import com.dahe.mylibrary.utils.PickerUtils
|
||||
import com.dahe.mylibrary.base.BaseActivity
|
||||
import com.dahe.mylibrary.utils.ActivityUtils
|
||||
import com.dahe.mylibrary.utils.ImageLoader
|
||||
import com.dahe.mylibrary.utils.PopsUtils
|
||||
|
||||
/**
|
||||
* @ClassName AuthQualificationActivity
|
||||
@ -24,12 +26,18 @@ class AuthQualificationActivity : BaseActivity<ActivityAuthQualificationBinding>
|
||||
binding.run {
|
||||
tvDate.run {
|
||||
setOnClickListener {
|
||||
PickDateUtils.getInstance()
|
||||
PickerUtils.getInstance()
|
||||
.showDate(this@AuthQualificationActivity,"选择有效期至") { year, month, day ->
|
||||
this.text = "$year-$month-$day"
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
ivFront.setOnClickListener {
|
||||
PopsUtils.getInstance().showSimSelPic(mContext){
|
||||
ImageLoader.getInstance().loadRoundImage(mContext,it[0].path,12,ivFront)
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -6,6 +6,10 @@ import com.dahe.gldriver.databinding.ActivityAuthRoadBinding
|
||||
import com.dahe.gldriver.ui.account.SelectRoleActivity
|
||||
import com.dahe.mylibrary.base.BaseActivity
|
||||
import com.dahe.mylibrary.utils.ActivityUtils
|
||||
import com.dahe.mylibrary.utils.ImageLoader
|
||||
import com.dahe.mylibrary.utils.PickerUtils
|
||||
import com.dahe.mylibrary.utils.PopsUtils
|
||||
import com.github.gzuliyujiang.wheelpicker.contract.OnDatePickedListener
|
||||
|
||||
/**
|
||||
* @ClassName AuthRoadActivity
|
||||
@ -17,8 +21,21 @@ class AuthRoadActivity : BaseActivity<ActivityAuthRoadBinding>() {
|
||||
override fun initView(savedInstanceState: Bundle?) {
|
||||
setStatusBarColor(R.color.white)
|
||||
setTitleBar("实名认证",true)
|
||||
binding.btnOk.setOnClickListener {
|
||||
ActivityUtils.startActivity(mContext, SelectRoleActivity::class.java)
|
||||
binding.run {
|
||||
btnOk.setOnClickListener {
|
||||
ActivityUtils.startActivity(mContext, SelectRoleActivity::class.java)
|
||||
}
|
||||
|
||||
tvDate.setOnClickListener {
|
||||
PickerUtils.getInstance().showDate(this@AuthRoadActivity){ year, month, day ->
|
||||
|
||||
}
|
||||
}
|
||||
ivFront.setOnClickListener {
|
||||
PopsUtils.getInstance().showSimSelPic(mContext) {
|
||||
ImageLoader.getInstance().loadRoundImage(mContext, it[0].path, 12, ivFront)
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -2,9 +2,14 @@ package com.dahe.gldriver.ui.account.authteam
|
||||
|
||||
import android.os.Bundle
|
||||
import android.view.View
|
||||
import android.widget.ImageView
|
||||
import com.dahe.gldriver.R
|
||||
import com.dahe.gldriver.databinding.ActivityAuthTeamBinding
|
||||
import com.dahe.mylibrary.base.BaseActivity
|
||||
import com.dahe.mylibrary.utils.ImageLoader
|
||||
import com.dahe.mylibrary.utils.PickerUtils
|
||||
import com.dahe.mylibrary.utils.PopsUtils
|
||||
import com.dahe.mylibrary.utils.ToastUtils
|
||||
|
||||
/**
|
||||
* @ClassName AuthTeamActivity
|
||||
@ -12,30 +17,98 @@ import com.dahe.mylibrary.base.BaseActivity
|
||||
* @Date 2024/1/25 16:44
|
||||
* @Description 个人车队认证
|
||||
*/
|
||||
class AuthTeamActivity : BaseActivity<ActivityAuthTeamBinding>() {
|
||||
class AuthTeamActivity : BaseActivity<ActivityAuthTeamBinding>(), View.OnClickListener {
|
||||
private var checkTeamType = 0 //0代表运输公司,1代表个人车队
|
||||
|
||||
|
||||
override fun initView(savedInstanceState: Bundle?) {
|
||||
setStatusBarColor(R.color.white)
|
||||
setTitleBar("身份认证",true)
|
||||
setTitleBar("身份认证", true)
|
||||
|
||||
binding.rgTeam.setOnCheckedChangeListener { _, i ->
|
||||
changeTeamType(if (i==binding.rbCom.id) 0 else 1)
|
||||
binding.run {
|
||||
rgTeam.setOnCheckedChangeListener { _, i ->
|
||||
changeTeamType(if (i == binding.rbCom.id) 0 else 1)
|
||||
}
|
||||
|
||||
ivBusiness.setOnClickListener {
|
||||
PopsUtils.getInstance().showSimSelPic(mContext) {
|
||||
ImageLoader.getInstance().loadRoundImage(mContext, it[0].path, 12, ivBusiness)
|
||||
}
|
||||
}
|
||||
|
||||
//运输公司 本人身份证
|
||||
ivPerFront.setOnClickListener {
|
||||
PopsUtils.getInstance().showSimSelPic(mContext) {
|
||||
ImageLoader.getInstance().loadRoundImage(mContext, it[0].path, 12, ivPerFront)
|
||||
}
|
||||
}
|
||||
|
||||
ivPerBack.setOnClickListener {
|
||||
PopsUtils.getInstance().showSimSelPic(mContext) {
|
||||
ImageLoader.getInstance().loadRoundImage(mContext, it[0].path, 12, ivPerBack)
|
||||
}
|
||||
}
|
||||
//个人车队 本人身份证
|
||||
ivFront.setOnClickListener {
|
||||
PopsUtils.getInstance().showSimSelPic(mContext) {
|
||||
ImageLoader.getInstance().loadRoundImage(mContext, it[0].path, 12, ivFront)
|
||||
}
|
||||
}
|
||||
|
||||
ivBank.setOnClickListener {
|
||||
PopsUtils.getInstance().showSimSelPic(mContext) {
|
||||
ImageLoader.getInstance().loadRoundImage(mContext, it[0].path, 12, ivBank)
|
||||
}
|
||||
}
|
||||
|
||||
ivBank.setOnClickListener {
|
||||
PopsUtils.getInstance().showSimSelPic(mContext) {
|
||||
ImageLoader.getInstance().loadRoundImage(mContext, it[0].path, 12, ivBank)
|
||||
}
|
||||
}
|
||||
|
||||
ivRoad.setOnClickListener {
|
||||
PopsUtils.getInstance().showSimSelPic(mContext) {
|
||||
ImageLoader.getInstance().loadRoundImage(mContext, it[0].path, 12, ivRoad)
|
||||
}
|
||||
}
|
||||
|
||||
tvComDate.setOnClickListener {
|
||||
PickerUtils.getInstance()
|
||||
.showDate(this@AuthTeamActivity, "请选择有效期至") { year, month, day ->
|
||||
tvComDate.text = "$year-$month-$day"
|
||||
}
|
||||
}
|
||||
|
||||
tvPerDate.setOnClickListener {
|
||||
PickerUtils.getInstance()
|
||||
.showDate(this@AuthTeamActivity, "请选择有效期至") { year, month, day ->
|
||||
tvPerDate.text = "$year-$month-$day"
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
override fun initDate() {
|
||||
}
|
||||
|
||||
private fun changeTeamType(type : Int){
|
||||
private fun changeTeamType(type: Int) {
|
||||
checkTeamType = type
|
||||
if (0==checkTeamType){
|
||||
if (0 == checkTeamType) {
|
||||
binding.llCom.visibility = View.VISIBLE
|
||||
binding.llPerson.visibility = View.GONE
|
||||
}else{
|
||||
} else {
|
||||
binding.llCom.visibility = View.GONE
|
||||
binding.llPerson.visibility = View.VISIBLE
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
override fun onClick(view: View?) {
|
||||
super.onClick(view)
|
||||
// when(view?.id){
|
||||
// binding.llCom.id->{}
|
||||
// }
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -8,6 +8,7 @@ import com.dahe.gldriver.base.WebActivity
|
||||
import com.dahe.gldriver.bean.GridBean
|
||||
import com.dahe.gldriver.databinding.FragmentMineBinding
|
||||
import com.dahe.gldriver.ui.account.authperson.AuthPartyActivity
|
||||
import com.dahe.gldriver.ui.mine.activity.CarTeamActivity
|
||||
import com.dahe.gldriver.ui.mine.activity.CarsManActivity
|
||||
import com.dahe.gldriver.ui.mine.activity.RulesActivity
|
||||
import com.dahe.gldriver.ui.mine.activity.WalletActivity
|
||||
@ -122,7 +123,7 @@ class MineFragment : BaseFragment<FragmentMineBinding>(), View.OnClickListener {
|
||||
private fun goPlats(pos: Int) {
|
||||
when (pos) {
|
||||
0 -> {
|
||||
ActivityUtils.startActivity(mContext, RulesActivity::class.java)
|
||||
ActivityUtils.startActivity(mContext, CarTeamActivity::class.java)
|
||||
}
|
||||
|
||||
1 -> {
|
||||
|
@ -0,0 +1,21 @@
|
||||
package com.dahe.gldriver.ui.mine.activity
|
||||
|
||||
import android.os.Bundle
|
||||
import com.dahe.gldriver.databinding.ActivityCarTeamBinding
|
||||
import com.dahe.mylibrary.base.BaseActivity
|
||||
|
||||
/**
|
||||
* @ClassName CarTeamActivity
|
||||
* @Author john
|
||||
* @Date 2024/2/6 16:38
|
||||
* @Description 车队管理
|
||||
*/
|
||||
class CarTeamActivity : BaseActivity<ActivityCarTeamBinding>() {
|
||||
override fun initView(savedInstanceState: Bundle?) {
|
||||
setStatusHeightParams(binding.rlTop)
|
||||
setTitleBar("车队管理",true,true)
|
||||
}
|
||||
|
||||
override fun initDate() {
|
||||
}
|
||||
}
|
@ -8,14 +8,14 @@ import com.dahe.gldriver.databinding.ActivityWaybillUppicBinding
|
||||
import com.dahe.mylibrary.adapter.GridImageAdapter
|
||||
import com.dahe.mylibrary.adapter.GridImageAdapter.OnItemClickListener
|
||||
import com.dahe.mylibrary.base.BaseActivity
|
||||
import com.dahe.mylibrary.pop.PopBottomPic
|
||||
import com.dahe.mylibrary.callback.OnPicResultListener
|
||||
import com.dahe.mylibrary.utils.ActivityUtils
|
||||
import com.dahe.mylibrary.utils.PopsUtils
|
||||
import com.dahe.mylibrary.utils.ToastUtils
|
||||
import com.dahe.mylibrary.weight.FullyGridLayoutManager
|
||||
import com.luck.picture.lib.decoration.GridSpacingItemDecoration
|
||||
import com.luck.picture.lib.entity.LocalMedia
|
||||
import com.luck.picture.lib.utils.DensityUtil
|
||||
import com.lxj.xpopup.XPopup
|
||||
|
||||
/**
|
||||
* @ClassName WaybillUpPicActivity
|
||||
@ -64,25 +64,25 @@ class WaybillUpPicActivity : BaseActivity<ActivityWaybillUppicBinding>() {
|
||||
|
||||
var myAdapter = GridImageAdapter(mContext, mData)
|
||||
|
||||
myAdapter.setOnItemClickListener(object :OnItemClickListener{
|
||||
myAdapter.setOnItemClickListener(object : OnItemClickListener {
|
||||
override fun onItemClick(v: View?, position: Int) {
|
||||
|
||||
}
|
||||
|
||||
override fun openPicture() {
|
||||
XPopup.Builder(mContext)
|
||||
.hasShadowBg(true)
|
||||
.dismissOnBackPressed(true)
|
||||
.dismissOnTouchOutside(true)
|
||||
.moveUpToKeyboard(false) //如果不加这个,评论弹窗会移动到软键盘上面
|
||||
.isViewMode(true)
|
||||
.isDestroyOnDismiss(true) //对于只使用一次的弹窗,推荐设置这个
|
||||
.asCustom(PopBottomPic(mContext,myAdapter, onPicResultListener = {
|
||||
ToastUtils.showToast(mContext,it.size.toString())
|
||||
myAdapter.data.addAll(it)
|
||||
myAdapter.notifyDataSetChanged()
|
||||
}))
|
||||
.show()
|
||||
PopsUtils.getInstance().showSelPic(mContext,myAdapter){
|
||||
myAdapter.data.addAll(it)
|
||||
myAdapter.notifyDataSetChanged()
|
||||
}
|
||||
// XPopup.Builder(mContext)
|
||||
// .dismissOnTouchOutside(true)
|
||||
// .asCustom(PopBottomPic(mContext, myAdapter, onPicResultListener = {
|
||||
// ToastUtils.showToast(mContext, it.size.toString())
|
||||
// myAdapter.data.addAll(it)
|
||||
// myAdapter.notifyDataSetChanged()
|
||||
// }))
|
||||
// .show()
|
||||
|
||||
}
|
||||
})
|
||||
|
||||
@ -91,6 +91,5 @@ class WaybillUpPicActivity : BaseActivity<ActivityWaybillUppicBinding>() {
|
||||
}
|
||||
|
||||
|
||||
|
||||
}
|
||||
}
|
BIN
app/src/main/res/drawable-xxhdpi/business.png
Normal file
BIN
app/src/main/res/drawable-xxhdpi/business.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 36 KiB |
@ -51,6 +51,7 @@
|
||||
|
||||
|
||||
<ImageView
|
||||
android:id="@+id/ivFront"
|
||||
android:layout_width="@dimen/dp_155"
|
||||
android:layout_height="@dimen/dp_97"
|
||||
android:layout_alignParentBottom="true"
|
||||
|
@ -51,21 +51,23 @@
|
||||
|
||||
|
||||
<ImageView
|
||||
android:id="@+id/ivFront"
|
||||
android:layout_width="@dimen/dp_155"
|
||||
android:layout_height="@dimen/dp_97"
|
||||
android:layout_alignParentBottom="true"
|
||||
android:layout_marginLeft="@dimen/dp_8"
|
||||
android:layout_marginBottom="@dimen/dp_22"
|
||||
android:background="@drawable/driver_front"></ImageView>
|
||||
android:background="@drawable/driver_front"/>
|
||||
|
||||
<ImageView
|
||||
android:id="@+id/ivBack"
|
||||
android:layout_width="@dimen/dp_155"
|
||||
android:layout_height="@dimen/dp_97"
|
||||
android:layout_alignParentRight="true"
|
||||
android:layout_alignParentBottom="true"
|
||||
android:layout_marginRight="@dimen/dp_8"
|
||||
android:layout_marginBottom="@dimen/dp_22"
|
||||
android:background="@drawable/driver_back"></ImageView>
|
||||
android:background="@drawable/driver_back"/>
|
||||
|
||||
</RelativeLayout>
|
||||
</androidx.cardview.widget.CardView>
|
||||
|
@ -51,6 +51,7 @@
|
||||
|
||||
|
||||
<ImageView
|
||||
android:id="@+id/ivFront"
|
||||
android:layout_width="@dimen/dp_155"
|
||||
android:layout_height="@dimen/dp_97"
|
||||
android:layout_alignParentBottom="true"
|
||||
@ -59,6 +60,7 @@
|
||||
android:background="@drawable/driving_front"></ImageView>
|
||||
|
||||
<ImageView
|
||||
android:id="@+id/ivBack"
|
||||
android:layout_width="@dimen/dp_155"
|
||||
android:layout_height="@dimen/dp_97"
|
||||
android:layout_alignParentRight="true"
|
||||
@ -96,6 +98,7 @@
|
||||
|
||||
|
||||
<ImageView
|
||||
android:id="@+id/ivCar"
|
||||
android:layout_width="@dimen/dp_155"
|
||||
android:layout_height="@dimen/dp_97"
|
||||
android:layout_alignParentBottom="true"
|
||||
|
@ -51,6 +51,7 @@
|
||||
|
||||
|
||||
<ImageView
|
||||
android:id="@+id/ivFront"
|
||||
android:layout_width="@dimen/dp_155"
|
||||
android:layout_height="@dimen/dp_97"
|
||||
android:layout_alignParentBottom="true"
|
||||
@ -59,6 +60,7 @@
|
||||
android:background="@drawable/person_front"></ImageView>
|
||||
|
||||
<ImageView
|
||||
android:id="@+id/ivBack"
|
||||
android:layout_width="@dimen/dp_155"
|
||||
android:layout_height="@dimen/dp_97"
|
||||
android:layout_alignParentRight="true"
|
||||
|
@ -51,6 +51,7 @@
|
||||
|
||||
|
||||
<ImageView
|
||||
android:id="@+id/ivFront"
|
||||
android:layout_width="@dimen/dp_155"
|
||||
android:layout_height="@dimen/dp_97"
|
||||
android:layout_alignParentBottom="true"
|
||||
|
@ -51,6 +51,7 @@
|
||||
|
||||
|
||||
<ImageView
|
||||
android:id="@+id/ivFront"
|
||||
android:layout_width="@dimen/dp_155"
|
||||
android:layout_height="@dimen/dp_97"
|
||||
android:layout_alignParentBottom="true"
|
||||
@ -123,6 +124,7 @@
|
||||
android:textSize="@dimen/sp_15"/>
|
||||
|
||||
<TextView
|
||||
android:id="@+id/tvDate"
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="@dimen/dp_34"
|
||||
android:layout_marginLeft="@dimen/dp_10"
|
||||
|
@ -128,7 +128,7 @@
|
||||
android:layout_centerHorizontal="true"
|
||||
android:layout_marginTop="@dimen/dp_58"
|
||||
android:layout_marginBottom="@dimen/dp_22"
|
||||
android:background="@drawable/person_front"></ImageView>
|
||||
android:background="@drawable/business"></ImageView>
|
||||
|
||||
<TextView
|
||||
android:id="@+id/tvBTitle"
|
||||
@ -149,7 +149,7 @@
|
||||
android:layout_centerHorizontal="true"
|
||||
android:layout_marginTop="@dimen/dp_22"
|
||||
android:layout_marginBottom="@dimen/dp_22"
|
||||
android:background="@drawable/person_front"></ImageView>
|
||||
android:background="@drawable/road"></ImageView>
|
||||
|
||||
<RelativeLayout
|
||||
android:layout_width="match_parent"
|
||||
@ -203,6 +203,7 @@
|
||||
android:textSize="@dimen/sp_15"></TextView>
|
||||
|
||||
<TextView
|
||||
android:id="@+id/tvComDate"
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="@dimen/dp_34"
|
||||
android:layout_marginLeft="@dimen/dp_10"
|
||||
@ -254,17 +255,19 @@
|
||||
android:layout_marginTop="@dimen/dp_20">
|
||||
|
||||
<ImageView
|
||||
android:id="@+id/ivPerFront"
|
||||
android:layout_width="@dimen/dp_155"
|
||||
android:layout_height="@dimen/dp_97"
|
||||
android:layout_marginLeft="@dimen/dp_8"
|
||||
android:background="@drawable/person_front" />
|
||||
android:background="@drawable/person_front"/>
|
||||
|
||||
<ImageView
|
||||
android:id="@+id/ivPerBack"
|
||||
android:layout_width="@dimen/dp_155"
|
||||
android:layout_height="@dimen/dp_97"
|
||||
android:layout_alignParentRight="true"
|
||||
android:layout_marginRight="@dimen/dp_8"
|
||||
android:background="@drawable/person_back" />
|
||||
android:background="@drawable/person_back"/>
|
||||
</RelativeLayout>
|
||||
|
||||
|
||||
@ -343,7 +346,7 @@
|
||||
android:textColor="@color/black"
|
||||
android:textSize="@dimen/sp_15"></TextView>
|
||||
|
||||
<EditText
|
||||
<TextView
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="@dimen/dp_34"
|
||||
android:layout_marginLeft="@dimen/dp_10"
|
||||
@ -355,7 +358,7 @@
|
||||
android:paddingRight="@dimen/dp_10"
|
||||
android:textColor="@color/black"
|
||||
android:textSize="@dimen/sp_15"
|
||||
tools:text="1990-05-24 至 2020-05-23"></EditText>
|
||||
tools:text="1990-05-24 至 2020-05-23"/>
|
||||
</LinearLayout>
|
||||
</LinearLayout>
|
||||
</androidx.cardview.widget.CardView>
|
||||
@ -409,6 +412,7 @@
|
||||
android:background="@drawable/person_front"></ImageView>
|
||||
|
||||
<ImageView
|
||||
android:id="@+id/ivBack"
|
||||
android:layout_width="@dimen/dp_155"
|
||||
android:layout_height="@dimen/dp_97"
|
||||
android:layout_alignParentRight="true"
|
||||
@ -498,7 +502,8 @@
|
||||
android:textColor="@color/black"
|
||||
android:textSize="@dimen/sp_15"></TextView>
|
||||
|
||||
<EditText
|
||||
<TextView
|
||||
android:id="@+id/tvPerDate"
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="@dimen/dp_34"
|
||||
android:layout_marginLeft="@dimen/dp_10"
|
||||
@ -509,7 +514,7 @@
|
||||
android:paddingRight="@dimen/dp_10"
|
||||
android:textColor="@color/black"
|
||||
android:textSize="@dimen/sp_15"
|
||||
tools:text="1990-05-24 至 2020-05-23"></EditText>
|
||||
tools:text="1990-05-24 至 2020-05-23"></TextView>
|
||||
</LinearLayout>
|
||||
|
||||
</RelativeLayout>
|
||||
@ -549,7 +554,7 @@
|
||||
android:layout_height="@dimen/dp_97"
|
||||
android:layout_gravity="center_horizontal"
|
||||
android:layout_marginTop="@dimen/dp_20"
|
||||
|
||||
android:id="@+id/ivBank"
|
||||
android:background="@drawable/bank_card"></ImageView>
|
||||
|
||||
<LinearLayout
|
||||
|
134
app/src/main/res/layout/activity_car_team.xml
Normal file
134
app/src/main/res/layout/activity_car_team.xml
Normal file
@ -0,0 +1,134 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
xmlns:app="http://schemas.android.com/apk/res-auto"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent">
|
||||
|
||||
<RelativeLayout
|
||||
android:id="@+id/rlTop"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="@dimen/dp_237"
|
||||
android:background="@drawable/wallet_bg">
|
||||
|
||||
<include layout="@layout/common_toolbar"></include>
|
||||
|
||||
</RelativeLayout>
|
||||
|
||||
<LinearLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginTop="@dimen/dp_100"
|
||||
android:orientation="vertical">
|
||||
|
||||
<androidx.cardview.widget.CardView
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="@dimen/dp_75"
|
||||
android:layout_marginLeft="@dimen/dp_15"
|
||||
android:layout_marginRight="@dimen/dp_15"
|
||||
android:background="@color/white"
|
||||
app:cardCornerRadius="@dimen/dp_8">
|
||||
|
||||
<LinearLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:gravity="center_vertical"
|
||||
android:orientation="horizontal"
|
||||
android:padding="@dimen/dp_12">
|
||||
|
||||
<ImageView
|
||||
android:layout_width="@dimen/dp_48"
|
||||
android:layout_height="@dimen/dp_48"
|
||||
android:background="@drawable/head_defaut" />
|
||||
|
||||
<TextView
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginLeft="@dimen/dp_10"
|
||||
android:text="王师傅的车队"
|
||||
android:textColor="@color/black"
|
||||
android:textSize="@dimen/sp_14" />
|
||||
|
||||
<TextView
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginLeft="@dimen/dp_6"
|
||||
android:background="@drawable/shape_orange_5"
|
||||
android:paddingLeft="@dimen/dp_4"
|
||||
android:paddingTop="@dimen/dp_2"
|
||||
android:paddingRight="@dimen/dp_4"
|
||||
android:paddingBottom="@dimen/dp_2"
|
||||
android:text="未认证"
|
||||
android:textColor="#FF4A02"
|
||||
android:textSize="@dimen/sp_9" />
|
||||
|
||||
<View
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_weight="1" />
|
||||
|
||||
<ImageView
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:background="@drawable/right_gray" />
|
||||
</LinearLayout>
|
||||
|
||||
</androidx.cardview.widget.CardView>
|
||||
|
||||
<androidx.cardview.widget.CardView
|
||||
android:layout_marginTop="@dimen/dp_10"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="@dimen/dp_50"
|
||||
android:layout_marginLeft="@dimen/dp_15"
|
||||
android:layout_marginRight="@dimen/dp_15"
|
||||
android:background="@color/white"
|
||||
app:cardCornerRadius="@dimen/dp_8">
|
||||
|
||||
<LinearLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:gravity="center_vertical"
|
||||
android:orientation="horizontal"
|
||||
android:padding="@dimen/dp_12">
|
||||
|
||||
<ImageView
|
||||
android:layout_width="@dimen/dp_48"
|
||||
android:layout_height="@dimen/dp_48"
|
||||
android:background="@drawable/head_defaut" />
|
||||
|
||||
<TextView
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginLeft="@dimen/dp_10"
|
||||
android:text="王师傅的车队"
|
||||
android:textColor="@color/black"
|
||||
android:textSize="@dimen/sp_14" />
|
||||
|
||||
<TextView
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginLeft="@dimen/dp_6"
|
||||
android:background="@drawable/shape_orange_5"
|
||||
android:paddingLeft="@dimen/dp_4"
|
||||
android:paddingTop="@dimen/dp_2"
|
||||
android:paddingRight="@dimen/dp_4"
|
||||
android:paddingBottom="@dimen/dp_2"
|
||||
android:text="未认证"
|
||||
android:textColor="#FF4A02"
|
||||
android:textSize="@dimen/sp_9" />
|
||||
|
||||
<View
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_weight="1" />
|
||||
|
||||
<ImageView
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:background="@drawable/right_gray" />
|
||||
</LinearLayout>
|
||||
|
||||
</androidx.cardview.widget.CardView>
|
||||
</LinearLayout>
|
||||
|
||||
|
||||
</RelativeLayout>
|
@ -174,6 +174,28 @@ public abstract class BaseActivity<VB extends ViewBinding> extends AppCompatActi
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 设置标题以及主题颜色
|
||||
*/
|
||||
protected void setTitleBar(String title, boolean isWhite, boolean isBack) {
|
||||
mToolbar = (Toolbar) findViewById(R.id.common_toolbar);
|
||||
mToolbar.setBackgroundColor(statusColor == -1 ? Color.TRANSPARENT : ContextCompat.getColor(mContext, statusColor));
|
||||
|
||||
if (isBack) {
|
||||
mToolbar.setNavigationIcon(isWhite ? R.drawable.left : R.drawable.left_black);
|
||||
mToolbar.setNavigationOnClickListener(view -> finish());
|
||||
}
|
||||
if (!TextUtils.isEmpty(title)) {//
|
||||
((TextView) findViewById(R.id.common_toolBar_title)).setTextColor(isWhite ? getColor(R.color.colorWhite) : getColor(R.color.black));
|
||||
((TextView) findViewById(R.id.common_toolBar_title)).setText(title);
|
||||
}
|
||||
if (isWhite){
|
||||
StatusBar.cancelLightStatusBar(this);//图标文字白色
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 显示右边标题
|
||||
*
|
||||
@ -202,10 +224,13 @@ public abstract class BaseActivity<VB extends ViewBinding> extends AppCompatActi
|
||||
* 设置距离顶部距离
|
||||
*/
|
||||
protected void setStatusHeightParams(View llContent) {
|
||||
RelativeLayout.LayoutParams closeLayoutParams = new RelativeLayout.LayoutParams(ViewGroup.LayoutParams.MATCH_PARENT, ViewGroup.LayoutParams.WRAP_CONTENT);
|
||||
closeLayoutParams.topMargin = ConvertUtils.dp2px(8) + BarUtils.getStatusBarHeight();
|
||||
// RelativeLayout.LayoutParams closeLayoutParams = new RelativeLayout.LayoutParams(ViewGroup.LayoutParams.MATCH_PARENT, ViewGroup.LayoutParams.WRAP_CONTENT);
|
||||
// closeLayoutParams.topMargin = BarUtils.getStatusBarHeight();
|
||||
llContent.setLayoutParams(closeLayoutParams);
|
||||
// closeLayoutParams.topMargin = BarUtils.getStatusBarHeight();
|
||||
// llContent.setLayoutParams(closeLayoutParams);
|
||||
|
||||
|
||||
llContent.setPadding(0,BarUtils.getStatusBarHeight(),0,0);
|
||||
}
|
||||
|
||||
protected abstract void initView(Bundle savedInstanceState);
|
||||
|
@ -5,7 +5,7 @@ package com.dahe.mylibrary.base
|
||||
* @Author 用户
|
||||
* @Date 2023/12/29 09:49
|
||||
* @Description //要实现单例类,就只需要继承这个 BaseSingleton 即可
|
||||
//P为参数,T为返回值
|
||||
//P为参数,T为返回值
|
||||
*/
|
||||
abstract class BaseSingleton<in P, out T> {
|
||||
|
||||
|
@ -0,0 +1,13 @@
|
||||
package com.dahe.mylibrary.callback
|
||||
|
||||
import com.luck.picture.lib.entity.LocalMedia
|
||||
|
||||
/**
|
||||
* @ClassName OnPicResultListener
|
||||
* @Author john
|
||||
* @Date 2024/2/6 14:48
|
||||
* @Description TODO
|
||||
*/
|
||||
fun interface OnPicResultListener {
|
||||
fun onResult(result: MutableList<LocalMedia>)
|
||||
}
|
@ -4,6 +4,7 @@ import android.content.Context
|
||||
import android.widget.Button
|
||||
import com.dahe.mylibrary.R
|
||||
import com.dahe.mylibrary.adapter.GridImageAdapter
|
||||
import com.dahe.mylibrary.callback.OnPicResultListener
|
||||
import com.dahe.mylibrary.utils.SelectPicUtils
|
||||
import com.dahe.mylibrary.utils.ToastUtils
|
||||
import com.dahe.mylibrary.weight.GlideEngine
|
||||
@ -26,11 +27,11 @@ import kotlin.math.min
|
||||
class PopBottomPic(
|
||||
context: Context,
|
||||
myAdapter: GridImageAdapter,
|
||||
onPicResultListener: onPicResultListener
|
||||
onPicResultListener: OnPicResultListener
|
||||
) : BottomPopupView(context) {
|
||||
|
||||
|
||||
private var listener: onPicResultListener
|
||||
private var listener: OnPicResultListener
|
||||
var myAdapter: GridImageAdapter
|
||||
|
||||
init {
|
||||
@ -38,12 +39,14 @@ class PopBottomPic(
|
||||
this.myAdapter = myAdapter
|
||||
}
|
||||
|
||||
|
||||
override fun getImplLayoutId() = R.layout.choice_car_timg
|
||||
|
||||
override fun onCreate() {
|
||||
super.onCreate()
|
||||
var paizhao = findViewById<Button>(R.id.btn_paizhao)
|
||||
var xiangce = findViewById<Button>(R.id.btnXiangce)
|
||||
var btnQuxiao = findViewById<Button>(R.id.btn_quxiao)
|
||||
paizhao.setOnClickListener {
|
||||
|
||||
// 单独拍照
|
||||
@ -103,6 +106,11 @@ class PopBottomPic(
|
||||
}
|
||||
})
|
||||
}
|
||||
|
||||
btnQuxiao.setOnClickListener {
|
||||
dismiss()
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
private fun openCam() {
|
||||
@ -110,13 +118,4 @@ class PopBottomPic(
|
||||
.openCamera(SelectMimeType.TYPE_IMAGE)
|
||||
}
|
||||
|
||||
|
||||
// private listener : onPicResultListener
|
||||
fun interface onPicResultListener {
|
||||
fun onResult(result: java.util.ArrayList<LocalMedia>)
|
||||
}
|
||||
|
||||
// fun setOnPicResultListener(listener: onPicResultListener){
|
||||
// this.listener
|
||||
// }
|
||||
}
|
@ -0,0 +1,120 @@
|
||||
package com.dahe.mylibrary.pop
|
||||
|
||||
import android.content.Context
|
||||
import android.widget.Button
|
||||
import com.dahe.mylibrary.R
|
||||
import com.dahe.mylibrary.adapter.GridImageAdapter
|
||||
import com.dahe.mylibrary.callback.OnPicResultListener
|
||||
import com.dahe.mylibrary.weight.GlideEngine
|
||||
import com.dahe.mylibrary.weight.ImageFileCompressEngine
|
||||
import com.luck.picture.lib.basic.PictureSelectionCameraModel
|
||||
import com.luck.picture.lib.basic.PictureSelectionModel
|
||||
import com.luck.picture.lib.basic.PictureSelector
|
||||
import com.luck.picture.lib.config.SelectMimeType
|
||||
import com.luck.picture.lib.config.SelectModeConfig
|
||||
import com.luck.picture.lib.entity.LocalMedia
|
||||
import com.luck.picture.lib.interfaces.OnResultCallbackListener
|
||||
import com.lxj.xpopup.core.BottomPopupView
|
||||
|
||||
/**
|
||||
* @ClassName PopBottomPic
|
||||
* @Author john
|
||||
* @Date 2024/1/31 11:11
|
||||
* @Description TODO
|
||||
*/
|
||||
class PopNorBottomPic(
|
||||
context: Context,
|
||||
onPicResultListener: OnPicResultListener
|
||||
) : BottomPopupView(context) {
|
||||
|
||||
|
||||
private var listener: OnPicResultListener
|
||||
|
||||
init {
|
||||
this.listener = onPicResultListener
|
||||
}
|
||||
|
||||
|
||||
override fun getImplLayoutId() = R.layout.choice_norcar_img
|
||||
|
||||
override fun onCreate() {
|
||||
super.onCreate()
|
||||
var paizhao = findViewById<Button>(R.id.btn_paizhao)
|
||||
var xiangce = findViewById<Button>(R.id.btnXiangce)
|
||||
var btnQuxiao = findViewById<Button>(R.id.btn_quxiao)
|
||||
paizhao.setOnClickListener {
|
||||
|
||||
// 单独拍照
|
||||
val cameraModel: PictureSelectionCameraModel = PictureSelector.create(context)
|
||||
.openCamera(SelectMimeType.TYPE_IMAGE)
|
||||
// .setCameraInterceptListener(getCustomCameraEvent())//自定义相机
|
||||
// .setRecordAudioInterceptListener(MainActivity.MeOnRecordAudioInterceptListener())//录音回调事件
|
||||
// .setCropEngine(ImageFileCropEngine())//裁剪
|
||||
.setCompressEngine(ImageFileCompressEngine())//压缩
|
||||
|
||||
// .setSelectLimitTipsListener(MainActivity.MeOnSelectLimitTipsListener())//拦截自定义提示
|
||||
// .setAddBitmapWatermarkListener(getAddBitmapWatermarkListener())//给图片添加水印
|
||||
// .setVideoThumbnailListener(getVideoThumbnailEventListener())//处理视频缩略图
|
||||
// .setCustomLoadingListener(getCustomLoadingListener())//自定义loading
|
||||
// .setSandboxFileEngine(MainActivity.MeSandboxFileEngine())//自定义沙盒文件处理
|
||||
// .isOriginalControl(cb_original.isChecked())//是否开启原图功能
|
||||
// .setPermissionDescriptionListener(getPermissionDescriptionListener())//权限说明
|
||||
// .setOutputAudioDir(getSandboxAudioOutputPath())//创建音频自定义输出目录
|
||||
// .setSelectedData(myAdapter.data)
|
||||
cameraModel.forResult(object : OnResultCallbackListener<LocalMedia> {
|
||||
override fun onResult(result: ArrayList<LocalMedia>?) {
|
||||
if (listener != null) {
|
||||
result?.let { it1 -> listener.onResult(it1) }
|
||||
}
|
||||
dismiss()
|
||||
}
|
||||
|
||||
override fun onCancel() {
|
||||
dismiss()
|
||||
}
|
||||
})
|
||||
|
||||
}
|
||||
|
||||
xiangce.setOnClickListener {
|
||||
|
||||
// 进入相册
|
||||
val selectionModel: PictureSelectionModel = PictureSelector.create(context)
|
||||
.openGallery(SelectMimeType.TYPE_IMAGE)
|
||||
.isDisplayCamera(false)//关闭拍照
|
||||
.setImageEngine(GlideEngine.createGlideEngine())
|
||||
.setCompressEngine(ImageFileCompressEngine())
|
||||
.isPreviewImage(true)
|
||||
.isMaxSelectEnabledMask(true)
|
||||
.setMaxSelectNum(1)
|
||||
.setSelectionMode(SelectModeConfig.SINGLE )
|
||||
.isGif(false)
|
||||
// .isDirectReturnSingle(true)
|
||||
// .setSelectedData(myAdapter.data)
|
||||
selectionModel.forResult(object : OnResultCallbackListener<LocalMedia> {
|
||||
override fun onResult(result: ArrayList<LocalMedia>) {
|
||||
if (listener != null) {
|
||||
result?.let { it1 -> listener.onResult(it1) }
|
||||
}
|
||||
dismiss()
|
||||
}
|
||||
|
||||
override fun onCancel() {
|
||||
dismiss()
|
||||
}
|
||||
})
|
||||
}
|
||||
|
||||
btnQuxiao.setOnClickListener {
|
||||
dismiss()
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
private fun openCam() {
|
||||
PictureSelector.create(context)
|
||||
.openCamera(SelectMimeType.TYPE_IMAGE)
|
||||
}
|
||||
|
||||
|
||||
}
|
@ -1,9 +1,6 @@
|
||||
package com.dahe.gldriver.utils
|
||||
package com.dahe.mylibrary.utils
|
||||
|
||||
import android.app.Activity
|
||||
import androidx.appcompat.app.AppCompatActivity
|
||||
import com.dahe.gldriver.R
|
||||
import com.dahe.mylibrary.base.SingletonHolder
|
||||
import com.dahe.mylibrary.base.SingletonNoPHolder
|
||||
import com.github.gzuliyujiang.wheelpicker.BirthdayPicker
|
||||
import com.github.gzuliyujiang.wheelpicker.OptionPicker
|
||||
@ -12,44 +9,49 @@ import com.github.gzuliyujiang.wheelpicker.contract.OnOptionPickedListener
|
||||
import com.github.gzuliyujiang.wheelpicker.entity.DateEntity
|
||||
|
||||
/**
|
||||
* @ClassName PickDateUtils
|
||||
* @ClassName PickUtils
|
||||
* @Author john
|
||||
* @Date 2024/2/5 14:48
|
||||
* @Description TODO
|
||||
* @Description 选择器工具类
|
||||
*/
|
||||
class PickDateUtils private constructor() {
|
||||
companion object : SingletonNoPHolder<PickDateUtils>(::PickDateUtils)
|
||||
class PickerUtils private constructor() {
|
||||
companion object : SingletonNoPHolder<PickerUtils>(::PickerUtils)
|
||||
|
||||
|
||||
/**
|
||||
* TODO
|
||||
* 底部弹出生日日期选择
|
||||
*@param title 日期选择title
|
||||
* @param activity
|
||||
* @param title 日期选择title
|
||||
* @param dateEntity 默认参数:默认当天
|
||||
* @param listener
|
||||
*/
|
||||
fun showDate(
|
||||
activity : AppCompatActivity,
|
||||
activity: AppCompatActivity,
|
||||
title: String = "",
|
||||
dateEntity: DateEntity = DateEntity.today(),
|
||||
listener: OnDatePickedListener
|
||||
) {
|
||||
|
||||
val picker = BirthdayPicker(activity)
|
||||
picker.setTitle(title)
|
||||
picker.setDefaultValue(dateEntity.year, dateEntity.month, dateEntity.day)
|
||||
picker.setOnDatePickedListener(listener)
|
||||
// picker.wheelLayout.setResetWhenLinkage(false)
|
||||
picker.wheelLayout.setResetWhenLinkage(false)
|
||||
picker.show()
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 选择驾驶证类型
|
||||
* @param activity
|
||||
* @param title
|
||||
* @param listener
|
||||
*/
|
||||
fun showSelectCarType(activity : AppCompatActivity,title: String = "", listener: OnOptionPickedListener) {
|
||||
fun showSelectCarType(
|
||||
activity: AppCompatActivity,
|
||||
title: String = "",
|
||||
listener: OnOptionPickedListener
|
||||
) {
|
||||
OptionPicker(activity)
|
||||
.run {
|
||||
setData("A1", "A2", "A3", "B1", "B2", "B3", "C1", "C2")
|
@ -0,0 +1,51 @@
|
||||
package com.dahe.mylibrary.utils
|
||||
|
||||
import android.content.Context
|
||||
import com.dahe.mylibrary.adapter.GridImageAdapter
|
||||
import com.dahe.mylibrary.base.SingletonHolder
|
||||
import com.dahe.mylibrary.base.SingletonNoPHolder
|
||||
import com.dahe.mylibrary.callback.OnPicResultListener
|
||||
import com.dahe.mylibrary.pop.PopBottomPic
|
||||
import com.dahe.mylibrary.pop.PopNorBottomPic
|
||||
import com.lxj.xpopup.XPopup
|
||||
|
||||
/**
|
||||
* @ClassName PopsUtils
|
||||
* @Author john
|
||||
* @Date 2024/2/6 10:11
|
||||
* @Description TODO
|
||||
*/
|
||||
class PopsUtils private constructor(){
|
||||
|
||||
|
||||
|
||||
companion object : SingletonNoPHolder<PopsUtils>(::PopsUtils)
|
||||
|
||||
/**
|
||||
* 选择装卸货照片
|
||||
*
|
||||
* @param myAdapter
|
||||
* @param listenter 结果回调
|
||||
*/
|
||||
fun showSelPic(ctx: Context,myAdapter: GridImageAdapter, listenter: OnPicResultListener){
|
||||
XPopup.Builder(ctx)
|
||||
.dismissOnTouchOutside(true)
|
||||
.asCustom(PopBottomPic(ctx, myAdapter, listenter))
|
||||
.show()
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 选择照片 拍照或者相机
|
||||
*
|
||||
* @param ctx
|
||||
* @param listenter
|
||||
*/
|
||||
fun showSimSelPic(ctx: Context, listenter: OnPicResultListener){
|
||||
|
||||
XPopup.Builder(ctx)
|
||||
.dismissOnTouchOutside(true)
|
||||
.asCustom(PopNorBottomPic(ctx, listenter))
|
||||
.show()
|
||||
}
|
||||
}
|
@ -59,7 +59,8 @@ class SelectPicUtils private constructor(
|
||||
|
||||
}
|
||||
|
||||
fun openCam(){}
|
||||
fun openCam(){
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
@ -1,17 +1,16 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:orientation="vertical">
|
||||
|
||||
<LinearLayout
|
||||
android:id="@+id/pop_layout"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_alignParentBottom="true"
|
||||
android:layout_marginLeft="@dimen/dp_12"
|
||||
android:layout_marginRight="@dimen/dp_12"
|
||||
android:layout_marginBottom="@dimen/dp_43"
|
||||
android:layout_marginBottom="@dimen/dp_20"
|
||||
android:background="@drawable/bg_bai"
|
||||
android:orientation="vertical"
|
||||
android:paddingTop="@dimen/dp_10">
|
||||
|
73
mylibrary/src/main/res/layout/choice_norcar_img.xml
Normal file
73
mylibrary/src/main/res/layout/choice_norcar_img.xml
Normal file
@ -0,0 +1,73 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:orientation="vertical">
|
||||
|
||||
<LinearLayout
|
||||
android:id="@+id/pop_layout"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginLeft="@dimen/dp_12"
|
||||
android:layout_marginRight="@dimen/dp_12"
|
||||
android:layout_marginBottom="@dimen/dp_20"
|
||||
android:background="@drawable/bg_bai"
|
||||
android:orientation="vertical"
|
||||
android:paddingTop="@dimen/dp_10">
|
||||
|
||||
|
||||
<LinearLayout
|
||||
android:id="@+id/llXc"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:orientation="vertical">
|
||||
|
||||
<Button
|
||||
android:id="@+id/btnXiangce"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:background="@null"
|
||||
android:text="相册"
|
||||
android:textColor="#000"
|
||||
android:textSize="@dimen/sp_15"
|
||||
|
||||
/>
|
||||
|
||||
<View
|
||||
android:id="@+id/v_1"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="@dimen/dp_1"
|
||||
android:layout_marginLeft="@dimen/dp_18"
|
||||
android:layout_marginRight="@dimen/dp_18"
|
||||
android:background="#EEEEEE" />
|
||||
</LinearLayout>
|
||||
|
||||
<Button
|
||||
android:id="@+id/btn_paizhao"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:background="@null"
|
||||
android:text="拍照"
|
||||
android:textColor="#000"
|
||||
android:textSize="@dimen/sp_15" />
|
||||
|
||||
<View
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="@dimen/dp_1"
|
||||
android:layout_marginLeft="@dimen/dp_18"
|
||||
android:layout_marginRight="@dimen/dp_18"
|
||||
android:background="#EEEEEE" />
|
||||
|
||||
<Button
|
||||
android:id="@+id/btn_quxiao"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:background="@null"
|
||||
android:text="取消"
|
||||
android:textColor="#ff999999"
|
||||
android:textSize="@dimen/sp_15"
|
||||
android:textStyle="normal" />
|
||||
|
||||
</LinearLayout>
|
||||
|
||||
</RelativeLayout>
|
Loading…
Reference in New Issue
Block a user