1:添加炼仙传说功能
2:修改混淆,
This commit is contained in:
@@ -0,0 +1,74 @@
|
||||
package com.xscm.moduleutil.base
|
||||
|
||||
import android.app.Dialog
|
||||
import android.content.DialogInterface
|
||||
import android.graphics.Color
|
||||
import android.os.Bundle
|
||||
import android.view.Gravity
|
||||
import android.view.LayoutInflater
|
||||
import android.view.View
|
||||
import android.view.ViewGroup
|
||||
import android.view.Window
|
||||
import android.view.WindowManager
|
||||
import androidx.core.view.WindowCompat
|
||||
import androidx.databinding.DataBindingUtil
|
||||
import androidx.fragment.app.DialogFragment
|
||||
import androidx.viewbinding.ViewBinding
|
||||
import com.voice.lib_base.ext.inflateBindingWithGeneric
|
||||
import com.xscm.moduleutil.R
|
||||
|
||||
|
||||
open class BaseBottomFragmentDialog<B : ViewBinding?>(private val resourceID: Int) :
|
||||
DialogFragment() {
|
||||
var mDatabind: B? = null
|
||||
val mBinding: B get() = mDatabind!!
|
||||
|
||||
override fun onCreateDialog(savedInstanceState: Bundle?): Dialog {
|
||||
val dialog = Dialog(requireActivity(), R.style.myChooseDialog)
|
||||
mDatabind = DataBindingUtil.inflate(LayoutInflater.from(requireContext()), resourceID, null, false) as B
|
||||
dialog.requestWindowFeature(Window.FEATURE_NO_TITLE)
|
||||
dialog.setContentView(mBinding!!.root)
|
||||
val window = dialog.window
|
||||
val params = window!!.attributes
|
||||
params.width = WindowManager.LayoutParams.MATCH_PARENT
|
||||
params.height = WindowManager.LayoutParams.WRAP_CONTENT
|
||||
params.gravity = Gravity.BOTTOM
|
||||
window.attributes = params
|
||||
dialog.setCanceledOnTouchOutside(true)
|
||||
return dialog
|
||||
|
||||
}
|
||||
|
||||
override fun onCreateView(
|
||||
inflater: LayoutInflater,
|
||||
container: ViewGroup?,
|
||||
savedInstanceState: Bundle?
|
||||
): View? {
|
||||
mDatabind = inflateBindingWithGeneric(inflater, container, false)
|
||||
// return if (mBinding != null) mBinding!!.root else mDatabind?.root
|
||||
return mBinding?.root
|
||||
}
|
||||
|
||||
override fun onViewCreated(view: View, savedInstanceState: Bundle?) {
|
||||
super.onViewCreated(view, savedInstanceState)
|
||||
WindowCompat.setDecorFitsSystemWindows(requireDialog().window!!, false)
|
||||
requireDialog().setOnShowListener { dialog: DialogInterface? ->
|
||||
(view.parent as ViewGroup).setBackgroundColor(
|
||||
Color.TRANSPARENT
|
||||
)
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
override fun onDestroyView() {
|
||||
super.onDestroyView()
|
||||
mDatabind = null
|
||||
}
|
||||
|
||||
|
||||
|
||||
fun setBundleArgs(bundleArgs: Bundle?): BaseBottomFragmentDialog<B> {
|
||||
arguments = bundleArgs
|
||||
return this
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,68 @@
|
||||
package com.voice.lib_base.base.dialog
|
||||
|
||||
import android.app.Dialog
|
||||
import android.content.DialogInterface
|
||||
import android.graphics.Color
|
||||
import android.os.Bundle
|
||||
import android.view.LayoutInflater
|
||||
import android.view.View
|
||||
import android.view.ViewGroup
|
||||
import android.view.Window
|
||||
import android.view.WindowManager
|
||||
import androidx.core.view.WindowCompat
|
||||
import androidx.databinding.DataBindingUtil
|
||||
import androidx.databinding.ViewDataBinding
|
||||
import androidx.fragment.app.DialogFragment
|
||||
import androidx.viewbinding.ViewBinding
|
||||
import com.voice.lib_base.ext.inflateBindingWithGeneric
|
||||
import com.xscm.moduleutil.R
|
||||
|
||||
open class BaseFragmentDialog<B : ViewBinding?>(private val resourceID: Int) : DialogFragment() {
|
||||
var mDatabind: B? = null
|
||||
val mBinding: B get() = mDatabind!!
|
||||
|
||||
override fun onCreateDialog(savedInstanceState: Bundle?): Dialog {
|
||||
val dialog = Dialog(requireActivity(), R.style.myChooseDialog)
|
||||
dialog.requestWindowFeature(Window.FEATURE_NO_TITLE)
|
||||
mDatabind = DataBindingUtil.inflate<ViewDataBinding>(LayoutInflater.from(requireContext()), resourceID, null, false) as B
|
||||
dialog.setContentView(mDatabind!!.root)
|
||||
val window = dialog.window
|
||||
val params = window!!.attributes
|
||||
params.width = WindowManager.LayoutParams.MATCH_PARENT
|
||||
params.height = WindowManager.LayoutParams.WRAP_CONTENT
|
||||
window.attributes = params
|
||||
dialog.setCanceledOnTouchOutside(true)
|
||||
return dialog
|
||||
}
|
||||
|
||||
override fun onCreateView(
|
||||
inflater: LayoutInflater,
|
||||
container: ViewGroup?,
|
||||
savedInstanceState: Bundle?
|
||||
): View? {
|
||||
mDatabind = inflateBindingWithGeneric(inflater, container, false)
|
||||
return if (mBinding != null) mBinding!!.root else null
|
||||
}
|
||||
|
||||
override fun onViewCreated(view: View, savedInstanceState: Bundle?) {
|
||||
super.onViewCreated(view, savedInstanceState)
|
||||
WindowCompat.setDecorFitsSystemWindows(requireDialog().window!!, false)
|
||||
requireDialog().setOnShowListener { dialog: DialogInterface? ->
|
||||
(view.parent as ViewGroup).setBackgroundColor(
|
||||
Color.TRANSPARENT
|
||||
)
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
override fun onDestroyView() {
|
||||
super.onDestroyView()
|
||||
mDatabind = null
|
||||
}
|
||||
|
||||
|
||||
fun setBundleArgs(bundleArgs: Bundle?): BaseFragmentDialog<B> {
|
||||
arguments = bundleArgs
|
||||
return this
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,65 @@
|
||||
package com.xscm.moduleutil.base
|
||||
|
||||
import androidx.lifecycle.*
|
||||
import com.xscm.moduleutil.http.RetrofitClient
|
||||
import com.xscm.moduleutil.widget.room.PassRoomException
|
||||
import kotlinx.coroutines.CoroutineScope
|
||||
import kotlinx.coroutines.launch
|
||||
import okhttp3.MultipartBody
|
||||
|
||||
|
||||
/**
|
||||
*
|
||||
*/
|
||||
open class BaseViewModel : ViewModel(), LifecycleObserver {
|
||||
private var clickTime: Long = 0
|
||||
var baseRepository = RetrofitClient.getInstance()
|
||||
|
||||
private val passRoom by lazy { MutableLiveData<Exception>() }
|
||||
|
||||
private val error by lazy { MutableLiveData<Exception>() }
|
||||
|
||||
private val finally by lazy { MutableLiveData<Int>() }
|
||||
|
||||
|
||||
|
||||
|
||||
//进入房间
|
||||
|
||||
var imgListData: MutableLiveData<List<String>> = MutableLiveData()
|
||||
var addImgData = MutableLiveData<Any>()
|
||||
|
||||
|
||||
//运行在UI线程的协程
|
||||
fun launchUI(block: suspend CoroutineScope.() -> Unit) = viewModelScope.launch {
|
||||
try {
|
||||
block()
|
||||
} catch (e: Exception) {
|
||||
if (e is PassRoomException) {
|
||||
passRoom.value = e
|
||||
} else {
|
||||
error.value = e
|
||||
// throw e
|
||||
}
|
||||
|
||||
} finally {
|
||||
finally.value = 200
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 请求失败,出现异常
|
||||
*/
|
||||
fun getError(): LiveData<Exception> {
|
||||
return error
|
||||
}
|
||||
|
||||
/**
|
||||
* 请求完成,在此处做一些关闭操作
|
||||
*/
|
||||
fun getFinally(): LiveData<Int> {
|
||||
return finally
|
||||
}
|
||||
|
||||
}
|
||||
@@ -137,13 +137,13 @@ public class CommonAppContext extends MultiDexApplication implements Application
|
||||
@Getter
|
||||
public UnreadCountEvent unreadCountEvent;
|
||||
|
||||
public static int selectRelease = 1;
|
||||
public static int selectRelease = -1;
|
||||
|
||||
public int is_open = 0;//主题的开关
|
||||
|
||||
public String appId = "com.qxcm.qxlive";
|
||||
public String appVersionCode = "87";
|
||||
public String appVersionName = "1.0.9.7";
|
||||
public String appVersionCode = "88";
|
||||
public String appVersionName = "1.0.9.8";
|
||||
|
||||
@Override
|
||||
public void onCreate() {
|
||||
|
||||
@@ -0,0 +1,10 @@
|
||||
package com.xscm.moduleutil.base;
|
||||
|
||||
public class RealTimeMessages<T> {
|
||||
|
||||
public T data;
|
||||
|
||||
public int code;
|
||||
|
||||
|
||||
}
|
||||
@@ -0,0 +1,6 @@
|
||||
package com.xscm.moduleutil.base
|
||||
|
||||
|
||||
data class SocketBean(
|
||||
val code: Int, val data: Any
|
||||
)
|
||||
Reference in New Issue
Block a user