fix : bugfix

This commit is contained in:
eggmanQQQ
2024-11-13 10:45:08 +08:00
parent e2375029f0
commit 245dee330e
8 changed files with 64 additions and 57 deletions

View File

@@ -1799,7 +1799,9 @@ open class BaseRoomFragment<V : IBaseRoomView?, P1 : BaseRoomPresenter<V>?> :
onSendGiftBtnClick()
}
}
mBoomInfoDialog?.show(requireContext())
context?.let {
mBoomInfoDialog?.show(it)
}
}
private fun upDateBoomExp(){

View File

@@ -585,6 +585,7 @@ public abstract class BaseFragment extends RxFragment implements KeyEvent.Callba
return flag;
}
//todo do fix
protected DialogManager getDialogManager() {
FragmentActivity activity = getActivity();

View File

@@ -10,7 +10,7 @@ import java.lang.reflect.ParameterizedType
abstract class BaseViewBindingFragment<T : ViewBinding> : BaseFragment() {
protected var _binding: T? = null
//todo do fix
val binding get() = _binding!!
override fun onCreateView(inflater: LayoutInflater, container: ViewGroup?, savedInstanceState: Bundle?): View? {

View File

@@ -7,7 +7,6 @@ import android.view.View
import androidx.activity.viewModels
import androidx.fragment.app.Fragment
import androidx.viewpager2.adapter.FragmentStateAdapter
import com.netease.nim.uikit.StatusBarUtil
import com.chwl.app.R
import com.chwl.app.base.BaseViewBindingActivity
import com.chwl.app.base.TitleBar
@@ -26,6 +25,7 @@ import com.chwl.core.pay.event.UpdateWalletInfoEvent
import com.chwl.library.annatation.ActLayoutRes
import com.chwl.library.utils.FormatUtils
import com.chwl.library.utils.ResUtil
import com.netease.nim.uikit.StatusBarUtil
import org.greenrobot.eventbus.EventBus
import org.greenrobot.eventbus.Subscribe
import org.greenrobot.eventbus.ThreadMode
@@ -68,7 +68,6 @@ class DecorationStoreActivity : BaseViewBindingActivity<ActivityDecorationStoreB
decorationViewModel.bannerLiveData.observe(this) {
BannerHelper.setBanner(binding.rollView, it)
}
binding.tvCharge.setOnClickListener {
ChargeActivity.start(this)
}

View File

@@ -5,8 +5,8 @@ import androidx.lifecycle.MutableLiveData
import com.chwl.app.R
import com.chwl.app.base.BaseViewModel
import com.chwl.core.bean.response.ListResult
import com.chwl.core.decoration.bean.DecorationInfo
import com.chwl.core.decoration.DecorationModel
import com.chwl.core.decoration.bean.DecorationInfo
import com.chwl.core.home.bean.BannerInfo
import com.chwl.core.home.model.HomeModel
import com.chwl.core.utils.extension.toast
@@ -23,9 +23,7 @@ class DecorationViewModel : BaseViewModel() {
val decorationInfoListLiveData: LiveData<ListResult<DecorationInfo>> =
_decorationInfoListLiveData
init {
getBannerInfo()
}
fun getBannerInfo() {
safeLaunch(

View File

@@ -25,10 +25,8 @@ import com.chwl.core.pay.event.GetWalletInfoEvent
import com.chwl.core.pay.event.UpdateWalletInfoEvent
import com.chwl.core.room.game.bean.BaiShunGameConfig
import com.chwl.library.common.util.ClickUtils.click
import com.chwl.library.common.util.setViewWH
import com.chwl.library.common.util.setVis
import com.chwl.library.utils.ResUtil
import com.chwl.library.utils.ScreenUtils
import com.google.gson.Gson
import org.greenrobot.eventbus.EventBus
import org.greenrobot.eventbus.Subscribe
@@ -120,7 +118,7 @@ class LeaderccGameWebFragment : BaseViewBindingFragment<RoomGameFragmentBinding>
override fun onPageFinished(view: WebView?, url: String?) {
super.onPageFinished(view, url)
if (!isLoadError) {
binding.webView.isVisible = true
binding?.webView?.isVisible = true
}
}

View File

@@ -230,18 +230,6 @@ class VipCenterActivity : BaseViewBindingActivity<ActivityVipCenterBinding>(),
banner.setAdapter(adapter, false)
it?.let {
banner?.postDelayed(object : Runnable {
override fun run() {
val intExtra = intent?.getIntExtra(BundleKeys.KEY_EXTRA_1, -1)
if (intExtra == -1) {
banner.setCurrentItem(it.vipLevel-1)
} else {
if (intExtra != null) {
banner.setCurrentItem(intExtra-1)
}
}
}
}, 200)
if (it.ownAuthTypes?.contains(13) == true && mTitleBar.actionCount == 1) {
mTitleBar.addAction(object : TitleBar.ImageAction(R.drawable.ic_vip_setting) {
@@ -256,6 +244,19 @@ class VipCenterActivity : BaseViewBindingActivity<ActivityVipCenterBinding>(),
binding.slAuth.isVisible = true
// binding.tvNotOpen.text = getString(R.string.me_no_aristocracy_yet)
}
banner?.postDelayed(object : Runnable {
override fun run() {
val intExtra = intent?.getIntExtra(BundleKeys.KEY_EXTRA_1, -1)?.minus(1)
val vipIndex = (it?.vipLevel ?: 0) - 1
if (intExtra != null && intExtra > 0) {
banner.setCurrentItem(intExtra)
}else if (vipIndex > 0){
banner.setCurrentItem(vipIndex)
}
}
}, 200)
}
vipViewModel.currVipInfoLiveData.observe(this) {
@@ -288,6 +289,8 @@ class VipCenterActivity : BaseViewBindingActivity<ActivityVipCenterBinding>(),
}
}
})
}
override fun onItemClick(position: Int) {

View File

@@ -46,35 +46,38 @@ abstract class PickImageActionNew protected constructor(
val uri = data.data
if (uri != null) {
val file = copyFile(activity, uri)
file?.path?.let { path ->
val paths = mutableListOf(path)
PhotoCompressUtil.compress(BaseApp.getContext(),
paths,
PhotoCompressUtil.getCompressCachePath(),
object : PhotosCompressCallback {
override fun onSuccess(compressedImgList: ArrayList<String>) {
if (file == null) {
file?.path?.let { path ->
val paths = mutableListOf(path)
PhotoCompressUtil.compress(BaseApp.getContext(),
paths,
PhotoCompressUtil.getCompressCachePath(),
object : PhotosCompressCallback {
override fun onSuccess(compressedImgList: ArrayList<String>) {
// sendImageAfterSelfImagePicker(compressedImgList)
for (path in compressedImgList) {
val file = File(path)
if (TextUtils.isEmpty(path) || !file.exists()) {
SingleToastUtil.showToastShort(
path + ResUtil.getString(
R.string.xchat_android_core_file_filemodel_01
for (path in compressedImgList) {
val file = File(path)
if (TextUtils.isEmpty(path) || !file.exists()) {
SingleToastUtil.showToastShort(
path + ResUtil.getString(
R.string.xchat_android_core_file_filemodel_01
)
)
)
return
return
}
onPicked(file)
}
onPicked(file)
}
}
override fun onFail(e: Throwable) {
SingleToastUtil.showToastShort(R.string.picker_image_error)
}
})
override fun onFail(e: Throwable) {
SingleToastUtil.showToastShort(R.string.picker_image_error)
}
})
}
} else {
SingleToastUtil.showToastShort(R.string.picker_image_error)
}
}
}
}
}
@@ -93,23 +96,26 @@ abstract class PickImageActionNew protected constructor(
}
fun copyFile(context: Context, uri: Uri): File? {
var fileName = getName(context, uri)
try {
var fileName = getName(context, uri)
val outPutDir = context.getExternalFilesDir(null) ?: return null
val outPutDir = context.getExternalFilesDir(null) ?: return null
val outPutFile = File(outPutDir, fileName)
val outPutFile = File(outPutDir, fileName)
if (!outPutDir.exists()) {
outPutDir.mkdirs()
}
context.contentResolver.openInputStream(uri)?.use { inS ->
FileOutputStream(outPutFile).use { outS ->
inS.copyTo(outS)
if (!outPutDir.exists()) {
outPutDir.mkdirs()
}
return outPutFile
} ?: return null
context.contentResolver.openInputStream(uri)?.use { inS ->
FileOutputStream(outPutFile).use { outS ->
inS.copyTo(outS)
}
return outPutFile
} ?: return null
} catch (e: Exception) {
return null
}
}
fun getName(context: Context, uri: Uri,isImg:Boolean = true): String {