选择回单图片替换
This commit is contained in:
parent
16041dd0e6
commit
61864990b6
@ -27,7 +27,11 @@ class AuthSuccActivity : BaseActivity<ActivityAuthSuccBinding>() {
|
||||
val get = BaseSPUtils.get(mContext, AppConfig.IS_GO_MINE, false) as Boolean
|
||||
|
||||
binding.run {
|
||||
btnLeft.text = if (BaseSPUtils.get(mContext, AppConfig.IS_GO_MINE, false) as Boolean) "回到个人中心" else "跳转首页"
|
||||
btnLeft.text = if (intent.extras?.getBoolean(
|
||||
AppConfig.IS_GO_MINE,
|
||||
false
|
||||
) == true
|
||||
) "回到个人中心" else "跳转首页"
|
||||
btnLeft.setOnClickListener {
|
||||
goLeftOrRight(type, true)
|
||||
}
|
||||
@ -49,9 +53,9 @@ class AuthSuccActivity : BaseActivity<ActivityAuthSuccBinding>() {
|
||||
private fun goLeftOrRight(type: Int?, isLeft: Boolean) {
|
||||
if (isLeft) {
|
||||
// ActivityUtils.finishToActivity(HomeActivity::class.java, false)
|
||||
ActivityUtils.startActivity(mContext,HomeActivity::class.java)
|
||||
ActivityUtils.startActivity(mContext, HomeActivity::class.java)
|
||||
} else {
|
||||
ActivityUtils.startActivity(mContext,AuthDrivingActivity::class.java)
|
||||
ActivityUtils.startActivity(mContext, AuthDrivingActivity::class.java)
|
||||
// ActivityUtils.finishToActivityAndGoNew(mContext,CarsManActivity::class.java,AuthDrivingActivity::class.java,false)
|
||||
}
|
||||
}
|
||||
|
@ -287,9 +287,12 @@ class AuthDrivingActivity : BaseActivity<ActivityAuthDrivingBinding>() {
|
||||
AuthTrailerActivity::class.java,
|
||||
Bundle().apply {
|
||||
putString(AppConfig.CAR_ID, t.data.carId)
|
||||
putBoolean(AppConfig.IS_GO_MINE,true)
|
||||
})
|
||||
} else {
|
||||
ActivityUtils.startActivity(mContext, AuthSuccActivity::class.java)
|
||||
ActivityUtils.startActivity(mContext, AuthSuccActivity::class.java,Bundle().apply {
|
||||
putBoolean(AppConfig.IS_GO_MINE,true)
|
||||
})
|
||||
}
|
||||
}
|
||||
}))
|
||||
|
@ -83,8 +83,9 @@ class CarsManActivity : BaseActivity<ActivityCarsManBinding>() {
|
||||
}
|
||||
|
||||
btnOk.setOnClickListener {
|
||||
BaseSPUtils.put(mContext,AppConfig.IS_GO_MINE,true)
|
||||
ActivityUtils.startActivity(mContext, AuthDrivingActivity::class.java)
|
||||
ActivityUtils.startActivity(mContext, AuthDrivingActivity::class.java,Bundle().apply {
|
||||
putBoolean(AppConfig.IS_GO_MINE,true)
|
||||
})
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -90,7 +90,7 @@ class WaybillUpPicActivity : BaseActivity<ActivityWaybillUppicBinding>() {
|
||||
myAdapter.setOnItemClickListener(object : OnItemClickListener {
|
||||
override fun onItemClick(v: View?, position: Int) {
|
||||
|
||||
PopsUtils.getInstance().showSelPic(mContext, myAdapter) {
|
||||
PopsUtils.getInstance().showSelPic(mContext,false, myAdapter) {
|
||||
OssServiceUtil.getInstance().run {
|
||||
asyncPutImage(it[0].realPath, this@WaybillUpPicActivity)
|
||||
setResultCallBack { data, oldPath ->
|
||||
@ -125,7 +125,7 @@ class WaybillUpPicActivity : BaseActivity<ActivityWaybillUppicBinding>() {
|
||||
}
|
||||
|
||||
override fun openPicture() {
|
||||
PopsUtils.getInstance().showSelPic(mContext, myAdapter) {
|
||||
PopsUtils.getInstance().showSelPic(mContext,false, myAdapter) {
|
||||
// TODO: 暂时注释
|
||||
OssServiceUtil.getInstance().run {
|
||||
asyncPutImage(it[0].realPath, this@WaybillUpPicActivity)
|
||||
@ -171,7 +171,7 @@ class WaybillUpPicActivity : BaseActivity<ActivityWaybillUppicBinding>() {
|
||||
myAdapter.selectMax = 1
|
||||
myAdapter.setOnItemClickListener(object : OnItemClickListener {
|
||||
override fun onItemClick(v: View?, position: Int) {
|
||||
PopsUtils.getInstance().showSelPic(mContext, myAdapter) {
|
||||
PopsUtils.getInstance().showSelPic(mContext,true, myAdapter) {
|
||||
OssServiceUtil.getInstance().run {
|
||||
asyncPutImage(it[0].realPath, this@WaybillUpPicActivity)
|
||||
setResultCallBack { data, oldPath ->
|
||||
@ -199,7 +199,7 @@ class WaybillUpPicActivity : BaseActivity<ActivityWaybillUppicBinding>() {
|
||||
}
|
||||
|
||||
override fun openPicture() {
|
||||
PopsUtils.getInstance().showSelPic(mContext, myAdapter) {
|
||||
PopsUtils.getInstance().showSelPic(mContext,true, myAdapter) {
|
||||
OssServiceUtil.getInstance().run {
|
||||
asyncPutImage(it[0].realPath, this@WaybillUpPicActivity)
|
||||
setResultCallBack { data, oldPath ->
|
||||
|
@ -2,6 +2,7 @@ package com.dahe.mylibrary.pop
|
||||
|
||||
import android.content.Context
|
||||
import android.widget.Button
|
||||
import android.widget.ImageView
|
||||
import com.dahe.mylibrary.R
|
||||
import com.dahe.mylibrary.adapter.GridImageAdapter
|
||||
import com.dahe.mylibrary.callback.OnPicResultListener
|
||||
@ -26,6 +27,7 @@ import kotlin.properties.Delegates
|
||||
class PopBottomPic(
|
||||
context: Context,
|
||||
num: Int = 1,
|
||||
var isReturn: Boolean,
|
||||
myAdapter: GridImageAdapter,
|
||||
onPicResultListener: OnPicResultListener
|
||||
) : BottomPopupView(context) {
|
||||
@ -49,6 +51,8 @@ class PopBottomPic(
|
||||
var paizhao = findViewById<Button>(R.id.btn_paizhao)
|
||||
var xiangce = findViewById<Button>(R.id.btnXiangce)
|
||||
var btnQuxiao = findViewById<Button>(R.id.btn_quxiao)
|
||||
var img = findViewById<ImageView>(R.id.img)
|
||||
if (isReturn) img.setBackgroundResource(R.drawable.huidan)
|
||||
paizhao.setOnClickListener {
|
||||
|
||||
// 单独拍照
|
||||
|
@ -27,10 +27,10 @@ class PopsUtils private constructor(){
|
||||
* @param myAdapter
|
||||
* @param listenter 结果回调
|
||||
*/
|
||||
fun showSelPic(ctx: Context,myAdapter: GridImageAdapter, listenter: OnPicResultListener){
|
||||
fun showSelPic(ctx: Context,isReturn : Boolean = false,myAdapter: GridImageAdapter, listenter: OnPicResultListener){
|
||||
XPopup.Builder(ctx)
|
||||
.dismissOnTouchOutside(true)
|
||||
.asCustom(PopBottomPic(ctx,1, myAdapter, listenter))
|
||||
.asCustom(PopBottomPic(ctx,1,isReturn, myAdapter, listenter))
|
||||
.show()
|
||||
}
|
||||
|
||||
|
BIN
mylibrary/src/main/res/drawable-xxhdpi/huidan.jpg
Normal file
BIN
mylibrary/src/main/res/drawable-xxhdpi/huidan.jpg
Normal file
Binary file not shown.
After Width: | Height: | Size: 597 KiB |
Loading…
Reference in New Issue
Block a user