选择回单图片替换

This commit is contained in:
2024-04-18 08:40:38 +08:00
parent 16041dd0e6
commit 61864990b6
7 changed files with 24 additions and 12 deletions
@@ -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()
}
Binary file not shown.

After

Width:  |  Height:  |  Size: 597 KiB