心动空间 优化帮助。
This commit is contained in:
@@ -8,6 +8,7 @@ import com.xscm.modulemain.activity.user.conacts.HeartCpContact
|
||||
import com.xscm.modulemain.activity.user.presenter.HeartCpPresenter
|
||||
import com.xscm.modulemain.adapter.ItemCpHeartAdapter
|
||||
import com.xscm.modulemain.databinding.ActivityHeartCpBinding
|
||||
import com.xscm.modulemain.dialog.DialogWebView
|
||||
import com.xscm.modulemain.dialog.RoomAuctionWebViewDialog
|
||||
import com.xscm.moduleutil.base.CommonAppContext
|
||||
import com.xscm.moduleutil.bean.HeartCpBean
|
||||
@@ -50,14 +51,9 @@ class HeartCpActivity : BaseMvpActivity<HeartCpPresenter, ActivityHeartCpBinding
|
||||
finish()
|
||||
}
|
||||
mBinding.ivHelp.setOnClickListener {
|
||||
val bundle = Bundle()
|
||||
bundle.putString(
|
||||
"url",
|
||||
CommonAppContext.getInstance()
|
||||
.getCurrentEnvironment().serverUrl + "api/Page/page_show?id=31"
|
||||
)
|
||||
val dialog = RoomAuctionWebViewDialog(this, bundle)
|
||||
dialog.show()
|
||||
val dialog = DialogWebView(this)
|
||||
dialog.show(CommonAppContext.getInstance()
|
||||
.getCurrentEnvironment().serverUrl + "api/Page/page_show?id=31")
|
||||
}
|
||||
|
||||
mBinding.ivHeadLeft.setOnClickListener {
|
||||
|
||||
@@ -31,13 +31,13 @@ class ItemCpHeartAdapter(
|
||||
|
||||
val cid = if (userId == item.from_user_id) {
|
||||
tv.setTextColor(context.getColor(R.color.ffff53cc))
|
||||
R.color.ffff53cc
|
||||
R.color.ff4a89ff
|
||||
} else {
|
||||
tv.setTextColor(context.getColor(R.color.ff4a89ff))
|
||||
R.color.ff4a89ff
|
||||
R.color.ffff53cc
|
||||
}
|
||||
if (item.remark.contains(userId.toString())) {
|
||||
val builder = getContentColor(item.from_user_info.nickname, item.remark, cid)
|
||||
if (item.remark.contains(item.to_user_info.nickname)) {
|
||||
val builder = getContentColor(item.to_user_info.nickname, item.remark, cid)
|
||||
helper.setText(R.id.tv_content, builder)
|
||||
} else {
|
||||
helper.setText(R.id.tv_content, item.remark)
|
||||
|
||||
@@ -0,0 +1,44 @@
|
||||
package com.xscm.modulemain.dialog
|
||||
|
||||
import android.content.Context
|
||||
import android.graphics.Color
|
||||
import com.xscm.modulemain.R
|
||||
import com.xscm.modulemain.databinding.WebviewDialogBinding
|
||||
import com.xscm.moduleutil.base.CommonAppContext
|
||||
import com.xscm.moduleutil.widget.dialog.BaseDialog
|
||||
|
||||
class DialogWebView(context: Context) : BaseDialog<WebviewDialogBinding>(context) {
|
||||
|
||||
|
||||
override fun getLayoutId(): Int {
|
||||
return R.layout.webview_dialog
|
||||
}
|
||||
|
||||
override fun initView() {
|
||||
mBinding.webview.setBackgroundColor(Color.TRANSPARENT)
|
||||
|
||||
|
||||
}
|
||||
|
||||
override fun initData() {
|
||||
mBinding.ivBack.setOnClickListener {
|
||||
dismiss()
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 显示网页内容的方法
|
||||
* @param url 要加载的网页URL地址
|
||||
*/
|
||||
fun show(url:String) {
|
||||
// 调用父类的show方法
|
||||
super.show()
|
||||
// 调用setWebView方法加载指定URL的网页
|
||||
setWebView(url)
|
||||
}
|
||||
|
||||
private fun setWebView(url: String) {
|
||||
mBinding.webview.getSettings().setJavaScriptEnabled(true)
|
||||
mBinding.webview.loadUrl(url)
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user