parent
367c7e48f0
commit
3dfc94b180
|
|
@ -769,7 +769,7 @@ private fun dealUniMpDownloadLaunch(
|
||||||
val uniMpId = uniMp.unimp_id
|
val uniMpId = uniMp.unimp_id
|
||||||
// 处理点击事件,微信模拟器
|
// 处理点击事件,微信模拟器
|
||||||
if (UniAppUtils.isDownloadUniMp(uniMp)) {
|
if (UniAppUtils.isDownloadUniMp(uniMp)) {
|
||||||
//强制更新(更新释放新版本并启动)
|
//没有下载或者强制更新(更新释放新版本并启动)
|
||||||
UniAppUtils.downloadWGT(
|
UniAppUtils.downloadWGT(
|
||||||
context,
|
context,
|
||||||
scope,
|
scope,
|
||||||
|
|
|
||||||
|
|
@ -1,11 +1,11 @@
|
||||||
package com.img.rabbit.pages.screen.make
|
package com.img.rabbit.pages.screen.make
|
||||||
|
|
||||||
import android.graphics.Bitmap
|
import android.graphics.Bitmap
|
||||||
import android.util.Log
|
|
||||||
import androidx.activity.compose.ManagedActivityResultLauncher
|
import androidx.activity.compose.ManagedActivityResultLauncher
|
||||||
import androidx.activity.compose.rememberLauncherForActivityResult
|
import androidx.activity.compose.rememberLauncherForActivityResult
|
||||||
import androidx.compose.foundation.Image
|
import androidx.compose.foundation.Image
|
||||||
import androidx.compose.foundation.background
|
import androidx.compose.foundation.background
|
||||||
|
import androidx.compose.foundation.border
|
||||||
import androidx.compose.foundation.clickable
|
import androidx.compose.foundation.clickable
|
||||||
import androidx.compose.foundation.interaction.MutableInteractionSource
|
import androidx.compose.foundation.interaction.MutableInteractionSource
|
||||||
import androidx.compose.foundation.layout.Arrangement
|
import androidx.compose.foundation.layout.Arrangement
|
||||||
|
|
@ -57,6 +57,9 @@ import kotlinx.coroutines.Dispatchers
|
||||||
import kotlinx.coroutines.launch
|
import kotlinx.coroutines.launch
|
||||||
import kotlinx.coroutines.withContext
|
import kotlinx.coroutines.withContext
|
||||||
import androidx.compose.ui.graphics.asAndroidBitmap
|
import androidx.compose.ui.graphics.asAndroidBitmap
|
||||||
|
import androidx.compose.ui.res.painterResource
|
||||||
|
import androidx.compose.ui.unit.sp
|
||||||
|
import com.img.rabbit.R
|
||||||
import com.img.rabbit.components.CenterToast
|
import com.img.rabbit.components.CenterToast
|
||||||
import io.moyuru.cropify.Cropify
|
import io.moyuru.cropify.Cropify
|
||||||
import io.moyuru.cropify.CropifyOption
|
import io.moyuru.cropify.CropifyOption
|
||||||
|
|
@ -98,14 +101,6 @@ fun LongImageScreen(navController: NavController) {
|
||||||
.fillMaxSize()
|
.fillMaxSize()
|
||||||
.background(Color(0xFFF4F4F4))
|
.background(Color(0xFFF4F4F4))
|
||||||
.navigationBarsPadding()
|
.navigationBarsPadding()
|
||||||
.clickable(
|
|
||||||
indication = null,
|
|
||||||
interactionSource = remember { MutableInteractionSource() }
|
|
||||||
){
|
|
||||||
if(imageItems.isEmpty()){
|
|
||||||
openMediaPicker(mediaPickerLauncher)
|
|
||||||
}
|
|
||||||
}
|
|
||||||
) {
|
) {
|
||||||
TitleBar(
|
TitleBar(
|
||||||
navController = navController,
|
navController = navController,
|
||||||
|
|
@ -121,31 +116,64 @@ fun LongImageScreen(navController: NavController) {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// 2. 预览列表(支持每张图独立缩放)
|
if(imageItems.isNotEmpty()){
|
||||||
LazyColumn(
|
// 2. 预览列表(支持每张图独立缩放)
|
||||||
modifier = Modifier.weight(1f).padding(start = 30.dp, end = 30.dp, bottom = 30.dp)
|
LazyColumn(
|
||||||
) {
|
modifier = Modifier.weight(1f).padding(start = 30.dp, end = 30.dp, bottom = 30.dp)
|
||||||
itemsIndexed(
|
) {
|
||||||
items = imageItems,
|
itemsIndexed(
|
||||||
// 使用 URI 和 Bitmap 的 hashCode 组合作为 Key
|
items = imageItems,
|
||||||
key = { index, item -> "${item.uri}_${item.bitmap.hashCode()}" }
|
// 使用 URI 和 Bitmap 的 hashCode 组合作为 Key
|
||||||
) { index, item ->
|
key = { index, item -> "${item.uri}_${item.bitmap.hashCode()}" }
|
||||||
Box(modifier = Modifier
|
) { index, item ->
|
||||||
.fillMaxWidth()
|
Box(modifier = Modifier
|
||||||
.clipToBounds()
|
.fillMaxWidth()
|
||||||
.clickable { editingIndex = index }
|
.clipToBounds()
|
||||||
|
.clickable { editingIndex = index }
|
||||||
|
) {
|
||||||
|
Image(
|
||||||
|
bitmap = item.bitmap.asImageBitmap(),
|
||||||
|
contentDescription = null,
|
||||||
|
contentScale = ContentScale.FillWidth,
|
||||||
|
modifier = Modifier
|
||||||
|
.fillMaxWidth()
|
||||||
|
.wrapContentHeight()
|
||||||
|
)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}else{
|
||||||
|
Box(modifier = Modifier
|
||||||
|
.fillMaxSize()
|
||||||
|
.padding(start = 15.dp, end = 15.dp, bottom = 60.dp)
|
||||||
|
.background(Color(0xFFFFFFFF))
|
||||||
|
.border(1.dp, Color(0xFFD8D8D8))
|
||||||
|
.clickable(
|
||||||
|
interactionSource = remember { MutableInteractionSource() },
|
||||||
|
indication = null
|
||||||
|
) {
|
||||||
|
openMediaPicker(mediaPickerLauncher)
|
||||||
|
}
|
||||||
|
){
|
||||||
|
// 空状态
|
||||||
|
Column(
|
||||||
|
modifier = Modifier
|
||||||
|
.align(Alignment.Center)
|
||||||
) {
|
) {
|
||||||
Image(
|
Image(
|
||||||
bitmap = item.bitmap.asImageBitmap(),
|
painter = painterResource(id = R.mipmap.ic_image_empty_pld),
|
||||||
contentDescription = null,
|
contentDescription = "拼图",
|
||||||
contentScale = ContentScale.FillWidth,
|
)
|
||||||
modifier = Modifier
|
Text(
|
||||||
.fillMaxWidth()
|
text = "点击选择图片",
|
||||||
.wrapContentHeight()
|
color = Color(0xFFD8D8D8),
|
||||||
|
fontSize = 12.sp,
|
||||||
|
modifier = Modifier.align(Alignment.CenterHorizontally)
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
editingIndex?.let { index ->
|
editingIndex?.let { index ->
|
||||||
FullScreenCropDialog(
|
FullScreenCropDialog(
|
||||||
item = imageItems[index],
|
item = imageItems[index],
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue