diff --git a/app/src/main/AndroidManifest.xml b/app/src/main/AndroidManifest.xml
index 75316f157c..8090cc1a66 100644
--- a/app/src/main/AndroidManifest.xml
+++ b/app/src/main/AndroidManifest.xml
@@ -514,6 +514,9 @@
+
{
+ MtaHelper.onEvent("评论说明弹窗", "滑动内容", gameName);
+ });
+ ok.setOnClickListener(v -> {
+ MtaHelper.onEvent("评论说明弹窗", "弹窗", "点击我知道了");
+ MtaHelper.onEvent("评论说明弹窗", "点击我知道了", gameName);
+ dialog.dismiss();
+ });
+
+ Window window = dialog.getWindow();
+ if (window != null) {
+ window.setBackgroundDrawable(new ColorDrawable(Color.TRANSPARENT));
+ }
+
+ dialog.requestWindowFeature(Window.FEATURE_NO_TITLE);
+ dialog.setContentView(contentView);
+ dialog.show();
+ }
+
public static void showPluggableNeverRemindDialog(Context context, String nameAndPlatform, @NonNull ConfirmListener listener) {
context = checkDialogContext(context);
diff --git a/app/src/main/java/com/gh/common/util/SpanBuilder.kt b/app/src/main/java/com/gh/common/util/SpanBuilder.kt
index cd32e74a22..7ce8e53711 100644
--- a/app/src/main/java/com/gh/common/util/SpanBuilder.kt
+++ b/app/src/main/java/com/gh/common/util/SpanBuilder.kt
@@ -5,10 +5,9 @@ import android.graphics.Color
import android.graphics.Typeface
import android.text.SpannableStringBuilder
import android.text.Spanned
-import android.text.style.AbsoluteSizeSpan
-import android.text.style.ForegroundColorSpan
-import android.text.style.StrikethroughSpan
-import android.text.style.StyleSpan
+import android.text.TextPaint
+import android.text.style.*
+import android.view.View
import androidx.annotation.DrawableRes
import androidx.core.content.ContextCompat
import com.gh.common.view.CenterImageSpan
@@ -65,6 +64,23 @@ class SpanBuilder(content: String) {
return this
}
+ fun click(start: Int, end: Int, colorRes: Int, onClick: () -> Unit): SpanBuilder {
+ val clickSpan = object : ClickableSpan() {
+ override fun updateDrawState(ds: TextPaint) {
+ super.updateDrawState(ds)
+ ds.color = ContextCompat.getColor(HaloApp.getInstance().application, colorRes)
+ ds.isUnderlineText = false
+ }
+
+ override fun onClick(widget: View) {
+ onClick.invoke()
+ }
+
+ }
+ spannableString.setSpan(clickSpan, start, end, Spanned.SPAN_EXCLUSIVE_EXCLUSIVE)
+ return this
+ }
+
fun build(): SpannableStringBuilder {
return spannableString
}
diff --git a/app/src/main/java/com/gh/gamecenter/gamedetail/desc/DescCommentsAdapter.kt b/app/src/main/java/com/gh/gamecenter/gamedetail/desc/DescCommentsAdapter.kt
index 76203a1548..ca4e0208a1 100644
--- a/app/src/main/java/com/gh/gamecenter/gamedetail/desc/DescCommentsAdapter.kt
+++ b/app/src/main/java/com/gh/gamecenter/gamedetail/desc/DescCommentsAdapter.kt
@@ -97,21 +97,17 @@ class DescCommentsAdapter(context: Context,
}
sdvUserBadge.setOnClickListener {
- val key = when (path) {
- "游戏详情:介绍" -> "游戏详情-玩家评论"
- "游戏详情:评分" -> "游戏详情-评论列表"
- "评论详情" -> "游戏评论详情"
- else -> ""
- }
- MtaHelper.onEvent("进入徽章墙_用户记录", key, "${commentData.user.name}(${commentData.user.id})")
- MtaHelper.onEvent("徽章中心", "进入徽章中心", key)
+ MtaHelper.onEvent("进入徽章墙_用户记录", "游戏详情-玩家评论", "${commentData.user.name}(${commentData.user.id})")
+ MtaHelper.onEvent("徽章中心", "进入徽章中心", "游戏详情-玩家评论")
DirectUtils.directToBadgeWall(mContext, commentData.user.id, commentData.user.name, commentData.user.icon)
}
userIcon.setOnClickListener {
- DirectUtils.directToHomeActivity(mContext, commentData.user.id, mEntrance, path)
+ DirectUtils.directToHomeActivity(mContext, commentData.user.id, mEntrance, "游戏详情-玩家评论")
+ MtaHelper.onEvent("游戏详情_新", "玩家评论_点击用户头像", mViewModel.game?.name)
}
userName.setOnClickListener {
userIcon.performClick()
+ MtaHelper.onEvent("游戏详情_新", "玩家评论_点击用户名字", mViewModel.game?.name)
}
tvBadgeName.setOnClickListener { sdvUserBadge.performClick() }
@@ -159,6 +155,7 @@ class DescCommentsAdapter(context: Context,
}
time.setOnClickListener {
if (commentData.isEditContent == true) {
+ MtaHelper.onEvent("游戏详情_新", "玩家评论-点击时间", mViewModel.game?.name)
val intent = CommentLogsActivity.getIntent(mContext, mViewModel.game!!.id, commentData.id)
mContext.startActivity(intent)
}
diff --git a/app/src/main/java/com/gh/gamecenter/gamedetail/rating/RatingAdapter.kt b/app/src/main/java/com/gh/gamecenter/gamedetail/rating/RatingAdapter.kt
index 75bf510128..66dc45cbe2 100644
--- a/app/src/main/java/com/gh/gamecenter/gamedetail/rating/RatingAdapter.kt
+++ b/app/src/main/java/com/gh/gamecenter/gamedetail/rating/RatingAdapter.kt
@@ -4,9 +4,12 @@ import android.app.Activity
import android.content.Context
import android.content.Intent
import android.util.SparseBooleanArray
+import android.view.Gravity
import android.view.View
import android.view.ViewGroup
+import android.widget.LinearLayout
import androidx.core.content.ContextCompat
+import androidx.recyclerview.widget.RecyclerView
import com.gh.common.constant.ItemViewType
import com.gh.common.util.*
import com.gh.gamecenter.R
@@ -25,7 +28,7 @@ class RatingAdapter(context: Context,
private val mEntrance: String) : ListAdapter(context) {
var ratingData: Rating? = null
- val path = "游戏详情:评分"
+ val path = if (mListViewModel.type == RatingViewModel.RatingType.RATING) "游戏详情:评分" else "折叠评论"
val headServiceCommentPosition = -1
val headMyCommentPosition = -2
@@ -45,10 +48,17 @@ class RatingAdapter(context: Context,
}
override fun getItemViewType(position: Int): Int {
- return when (position) {
- itemCount - 1 -> ItemViewType.ITEM_FOOTER
- 0 -> ItemViewType.ITEM_HEADER
- else -> ItemViewType.ITEM_BODY
+ return if (mListViewModel.type == RatingViewModel.RatingType.RATING) {
+ when (position) {
+ itemCount - 1 -> ItemViewType.ITEM_FOOTER
+ 0 -> ItemViewType.ITEM_HEADER
+ else -> ItemViewType.ITEM_BODY
+ }
+ } else {
+ when (position) {
+ itemCount - 1 -> ItemViewType.ITEM_FOOTER
+ else -> ItemViewType.ITEM_BODY
+ }
}
}
@@ -72,17 +82,46 @@ class RatingAdapter(context: Context,
override fun getItemCount(): Int {
var index = 0
- if (ratingData != null) index++
- if (mEntityList != null && ratingData != null) index += mEntityList.size
+ if (mListViewModel.type == RatingViewModel.RatingType.RATING) {
+ if (ratingData != null) index++
+ if (mEntityList != null && ratingData != null) index += mEntityList.size
+ } else {
+ if (mEntityList != null) index += mEntityList.size
+ }
if (index > 0) index++
return index
}
- override fun onBindViewHolder(holder: androidx.recyclerview.widget.RecyclerView.ViewHolder, position: Int) {
+ override fun onBindViewHolder(holder: RecyclerView.ViewHolder, position: Int) {
when (holder) {
is RatingItemViewHolder -> bindRatingItem(holder)
- is RatingCommentItemViewHolder -> initRatingComment(holder, mEntityList[position - 1], position - 1)
- is FooterViewHolder -> holder.initFooterViewHolder(mListViewModel, mIsLoading, isNetworkError, mIsOver)
+ is RatingCommentItemViewHolder -> {
+ if (mListViewModel.type == RatingViewModel.RatingType.RATING) {
+ initRatingComment(holder, mEntityList[position - 1], position - 1)
+ } else {
+ initRatingComment(holder, mEntityList[position], position)
+ }
+ }
+ is FooterViewHolder -> {
+ if (mIsOver && mListViewModel.type == RatingViewModel.RatingType.RATING) {
+ holder.initItemPadding()
+ val params = holder.itemView.layoutParams as RecyclerView.LayoutParams
+ params.height = 44F.dip2px()
+ holder.itemView.layoutParams = params
+ holder.itemView.background = ContextCompat.getDrawable(mContext, R.drawable.background_shape_white_radius_5)
+ holder.lineLeft.visibility = View.GONE
+ holder.lineRight.visibility = View.GONE
+ holder.loading.visibility = View.GONE
+ holder.hint.text = "查看折叠评论>"
+ holder.hint.textSize = 12F
+ holder.hint.setTextColor(ContextCompat.getColor(mContext, R.color.theme_font))
+ holder.itemView.setOnClickListener {
+ mContext.startActivity(RatingFoldActivity.getIntent(mContext, mListViewModel.game, mEntrance, path))
+ }
+ } else {
+ holder.initFooterViewHolder(mListViewModel, mIsLoading, isNetworkError, mIsOver)
+ }
+ }
}
}
@@ -108,6 +147,9 @@ class RatingAdapter(context: Context,
MtaHelper.onEvent("发表评论", "我要安利", mListViewModel.game.name)
skipRatingEdit(0.0F, "游戏详情-评论-[我要安利]", fromAmway = true, isSkipSuccessPage = false)
}
+ stopServerIv.setOnClickListener {
+ DialogUtils.showStopServerExplanationDialog(mContext, "", mListViewModel.game.name)
+ }
if (ratingData?.serviceComment != null) {
includeServiceComment.commentItem.visibility = View.VISIBLE
initRatingComment(RatingCommentItemViewHolder(includeServiceComment), ratingData?.serviceComment!!, headServiceCommentPosition)
@@ -123,7 +165,7 @@ class RatingAdapter(context: Context,
}
sort.setOnClickListener {
- holder.showPopWindow(sort, RatingItemViewHolder.POP_SORT) { text ->
+ holder.showPopWindow(sort, RatingItemViewHolder.POP_SORT, sort.text.toString()) { text ->
if (text != sort.text) {
sort.text = text
mListViewModel.filterList(text, filter.text.toString())
@@ -133,7 +175,7 @@ class RatingAdapter(context: Context,
}
filter.setOnClickListener {
- holder.showPopWindow(filter, RatingItemViewHolder.POP_FILTER) { text ->
+ holder.showPopWindow(filter, RatingItemViewHolder.POP_FILTER, filter.text.toString()) { text ->
if (text != filter.text) {
filter.text = text
mListViewModel.filterList(sort.text.toString(), text)
diff --git a/app/src/main/java/com/gh/gamecenter/gamedetail/rating/RatingCommentItemViewHolder.kt b/app/src/main/java/com/gh/gamecenter/gamedetail/rating/RatingCommentItemViewHolder.kt
index 999bd6e85d..55ed573076 100644
--- a/app/src/main/java/com/gh/gamecenter/gamedetail/rating/RatingCommentItemViewHolder.kt
+++ b/app/src/main/java/com/gh/gamecenter/gamedetail/rating/RatingCommentItemViewHolder.kt
@@ -91,7 +91,7 @@ class RatingCommentItemViewHolder(val binding: RatingCommentItemBinding) : BaseR
Picasso.with(context).load(Uri.parse(it)).priority(Picasso.Priority.HIGH).get()
}.subscribeOn(Schedulers.io())
.observeOn(AndroidSchedulers.mainThread())
- .subscribe ({
+ .subscribe({
val bitmapDrawable = BitmapDrawable(context.resources, it)
bitmapDrawable.setBounds(0, 0, DensityUtil.dip2px(16F), DensityUtil.dip2px(16F))
contentSpan.setSpan(CenterImageSpan(bitmapDrawable), commentData.replyData?.user?.name!!.length + 2, commentData.replyData?.user?.name!!.length + 3, Spanned.SPAN_EXCLUSIVE_EXCLUSIVE)
@@ -116,7 +116,7 @@ class RatingCommentItemViewHolder(val binding: RatingCommentItemBinding) : BaseR
}, commentData.replyData?.user?.name!!.length + 2, commentData.replyData?.user?.name!!.length + 3, Spanned.SPAN_EXCLUSIVE_EXCLUSIVE)
replyContent.movementMethod = CustomLinkMovementMethod.getInstance()
replyContent.text = contentSpan
- },{
+ }, {
it.printStackTrace()
})
} else {
@@ -149,21 +149,15 @@ class RatingCommentItemViewHolder(val binding: RatingCommentItemBinding) : BaseR
badge.visibility = View.GONE
}
userIcon.setOnClickListener {
- DirectUtils.directToHomeActivity(context, commentData.user.id, entrance, path)
+ DirectUtils.directToHomeActivity(context, commentData.user.id, entrance, getKey(path))
}
userName.setOnClickListener {
- DirectUtils.directToHomeActivity(context, commentData.user.id, entrance, path)
+ userIcon.performClick()
}
sdvUserBadge.setOnClickListener {
- val key = when (path) {
- "游戏详情:介绍" -> "游戏详情-玩家评论"
- "游戏详情:评分" -> "游戏详情-评论列表"
- "评论详情" -> "游戏评论详情"
- else -> ""
- }
- MtaHelper.onEvent("进入徽章墙_用户记录", key, "${commentData.user.name}(${commentData.user.id})")
- MtaHelper.onEvent("徽章中心", "进入徽章中心", key)
+ MtaHelper.onEvent("进入徽章墙_用户记录", getKey(path), "${commentData.user.name}(${commentData.user.id})")
+ MtaHelper.onEvent("徽章中心", "进入徽章中心", getKey(path))
DirectUtils.directToBadgeWall(context, commentData.user.id, commentData.user.name, commentData.user.icon)
}
tvBadgeName.setOnClickListener { sdvUserBadge.performClick() }
@@ -234,6 +228,16 @@ class RatingCommentItemViewHolder(val binding: RatingCommentItemBinding) : BaseR
}
}
+ private fun getKey(path: String): String {
+ return when (path) {
+ "游戏详情:介绍" -> "游戏详情-玩家评论"
+ "游戏详情:评分" -> "游戏详情-评论列表"
+ "评论详情" -> "游戏评论详情"
+ "折叠评论" -> "折叠评论"
+ else -> ""
+ }
+ }
+
private fun getSpan(context: Context, name: String, commentData: RatingComment): SpannableStringBuilder {
val spanned = SpanBuilder(name)
.color(context, 0, commentData.replyData?.user?.name!!.length, R.color.text_333333)
diff --git a/app/src/main/java/com/gh/gamecenter/gamedetail/rating/RatingFoldActivity.kt b/app/src/main/java/com/gh/gamecenter/gamedetail/rating/RatingFoldActivity.kt
new file mode 100644
index 0000000000..8b9dad38d1
--- /dev/null
+++ b/app/src/main/java/com/gh/gamecenter/gamedetail/rating/RatingFoldActivity.kt
@@ -0,0 +1,26 @@
+package com.gh.gamecenter.gamedetail.rating
+
+import android.content.Context
+import android.content.Intent
+import android.os.Bundle
+import com.gh.common.util.EntranceUtils
+import com.gh.gamecenter.NormalActivity
+import com.gh.gamecenter.entity.GameEntity
+
+class RatingFoldActivity : NormalActivity() {
+
+ override fun onCreate(savedInstanceState: Bundle?) {
+ super.onCreate(savedInstanceState)
+ setNavigationTitle("折叠评论")
+ }
+ companion object {
+ @JvmStatic
+ fun getIntent(context: Context, game: GameEntity, entrance: String, path: String): Intent {
+ val bundle = Bundle()
+ bundle.putParcelable(GameEntity.TAG, game)
+ bundle.putString(EntranceUtils.KEY_ENTRANCE, mergeEntranceAndPath(entrance, path))
+ bundle.putSerializable(EntranceUtils.KEY_LOCATION, RatingViewModel.RatingType.FOLD_RATING)
+ return getTargetIntent(context, RatingFoldActivity::class.java, RatingFragment::class.java, bundle)
+ }
+ }
+}
\ No newline at end of file
diff --git a/app/src/main/java/com/gh/gamecenter/gamedetail/rating/RatingFragment.kt b/app/src/main/java/com/gh/gamecenter/gamedetail/rating/RatingFragment.kt
index a993e63673..b4413e10ad 100644
--- a/app/src/main/java/com/gh/gamecenter/gamedetail/rating/RatingFragment.kt
+++ b/app/src/main/java/com/gh/gamecenter/gamedetail/rating/RatingFragment.kt
@@ -3,17 +3,21 @@ package com.gh.gamecenter.gamedetail.rating
import android.app.Activity
import android.content.Intent
import android.os.Bundle
+import android.text.method.LinkMovementMethod
import android.view.View
import android.widget.ProgressBar
+import android.widget.TextView
import androidx.core.content.ContextCompat
import androidx.databinding.BindingAdapter
import androidx.lifecycle.Observer
import androidx.lifecycle.ViewModelProviders
import androidx.recyclerview.widget.RecyclerView
-import com.gh.common.util.DisplayUtils
import com.gh.common.util.EntranceUtils
+import com.gh.common.util.SpanBuilder
+import com.gh.common.util.dip2px
import com.gh.common.view.VerticalItemDecoration
import com.gh.gamecenter.R
+import com.gh.gamecenter.WebActivity
import com.gh.gamecenter.baselist.ListFragment
import com.gh.gamecenter.baselist.LoadStatus
import com.gh.gamecenter.entity.GameEntity
@@ -31,6 +35,16 @@ class RatingFragment : ListFragment() {
private var mSkipGameComment: Boolean? = null
+ private var mRatingType: RatingViewModel.RatingType? = null
+
+ override fun getLayoutId(): Int {
+ return if (mRatingType == RatingViewModel.RatingType.RATING) {
+ super.getLayoutId()
+ } else {
+ R.layout.fragment_list_fold_rating
+ }
+ }
+
override fun onActivityResult(requestCode: Int, resultCode: Int, data: Intent?) {
super.onActivityResult(requestCode, resultCode, data)
if (requestCode == RATING_EDIT_REQUEST && resultCode == Activity.RESULT_OK) {
@@ -43,7 +57,7 @@ class RatingFragment : ListFragment() {
}
override fun getItemDecoration(): RecyclerView.ItemDecoration? {
- return VerticalItemDecoration(requireContext(), 12F, false, R.color.transparent)
+ return VerticalItemDecoration(requireContext(), 12F, mRatingType != RatingViewModel.RatingType.RATING, R.color.transparent)
}
override fun provideListAdapter(): RatingAdapter {
@@ -58,7 +72,7 @@ class RatingFragment : ListFragment() {
override fun provideListViewModel(): RatingViewModel {
val factory = RatingViewModel.Factory(
HaloApp.getInstance().application,
- arguments?.getParcelable(GameEntity.TAG)!!)
+ arguments?.getParcelable(GameEntity.TAG)!!, mRatingType!!)
return ViewModelProviders.of(this, factory).get(RatingViewModel::class.java)
}
@@ -67,11 +81,13 @@ class RatingFragment : ListFragment() {
}
override fun onCreate(savedInstanceState: Bundle?) {
+ mRatingType = arguments?.getSerializable(EntranceUtils.KEY_LOCATION) as? RatingViewModel.RatingType
+ ?: RatingViewModel.RatingType.RATING
super.onCreate(savedInstanceState)
mSkipGameComment = arguments?.getBoolean(EntranceUtils.KEY_SKIP_GAME_COMMENT)
- mListRv.setPadding(DisplayUtils.dip2px(20f), 0, DisplayUtils.dip2px(20f), 0)
+ mListRv.setPadding(20F.dip2px(), 0, 20F.dip2px(), 0)
mListRefresh?.setBackgroundColor(ContextCompat.getColor(requireContext(), R.color.transparent))
- mListRefresh?.isEnabled = false
+ mListRefresh?.isEnabled = mRatingType != RatingViewModel.RatingType.RATING
mListViewModel.ratingLiveData.observe(this, Observer {
mAdapter?.ratingData = it
mAdapter?.notifyDataSetChanged()
@@ -79,6 +95,18 @@ class RatingFragment : ListFragment() {
}
+ override fun onViewCreated(view: View, savedInstanceState: Bundle?) {
+ super.onViewCreated(view, savedInstanceState)
+ if (mRatingType == RatingViewModel.RatingType.FOLD_RATING) {
+ val foldRatingReasonTv = requireView().findViewById(R.id.foldRatingReasonTv)
+ val text = "折叠原因:因违反《光环助手评论规则》被管理员折叠"
+ foldRatingReasonTv.text = SpanBuilder(text).click(8, 18, R.color.theme_font) {
+ requireContext().startActivity(WebActivity.getCommentRulesIntent(requireContext()))
+ }.build()
+ foldRatingReasonTv.movementMethod = LinkMovementMethod()
+ }
+ }
+
override fun onLoadDone() {
super.onLoadDone()
if (mSkipGameComment == true) {
diff --git a/app/src/main/java/com/gh/gamecenter/gamedetail/rating/RatingItemViewHolder.kt b/app/src/main/java/com/gh/gamecenter/gamedetail/rating/RatingItemViewHolder.kt
index 76c1e8b83c..1a34b1fb8b 100644
--- a/app/src/main/java/com/gh/gamecenter/gamedetail/rating/RatingItemViewHolder.kt
+++ b/app/src/main/java/com/gh/gamecenter/gamedetail/rating/RatingItemViewHolder.kt
@@ -3,6 +3,7 @@ package com.gh.gamecenter.gamedetail.rating
import android.view.LayoutInflater
import android.widget.LinearLayout
import android.widget.TextView
+import androidx.core.content.ContextCompat
import com.gh.base.BaseRecyclerViewHolder
import com.gh.common.util.showAutoOrientation
import com.gh.common.view.BugFixedPopupWindow
@@ -15,13 +16,13 @@ class RatingItemViewHolder(val binding: RatingItemBinding) : BaseRecyclerViewHol
* 注意:
* contentList [POP_SORT] 和 [POP_FILTER] 文案的内容 与[RatingViewModel.filterList] 判断对应
*/
- fun showPopWindow(view: TextView, type: Int, clickListener: (String) -> Unit) {
+ fun showPopWindow(view: TextView, type: Int, selectedValue: String, clickListener: (String) -> Unit) {
val bottomDrawable = view.context.resources.getDrawable(R.drawable.game_comment_filter_top)
bottomDrawable.setBounds(0, 0, bottomDrawable.minimumWidth, bottomDrawable.minimumHeight)
view.setCompoundDrawables(null, null, bottomDrawable, null)
val contentList = when (type) {
- POP_SORT -> arrayListOf("最新", "热门")
+ POP_SORT -> arrayListOf("默认", "最新", "热门")
POP_FILTER -> arrayListOf("全部评论", "同设备", "1星", "2星", "3星", "4星", "5星")
else -> throw IllegalArgumentException()
}
@@ -41,6 +42,7 @@ class RatingItemViewHolder(val binding: RatingItemBinding) : BaseRecyclerViewHol
val hitText = item.findViewById(R.id.hint_text)
hitText.text = text
+ hitText.setTextColor(ContextCompat.getColor(view.context, if (text == selectedValue) R.color.theme_font else R.color.text_666666))
item.setOnClickListener {
popupWindow.dismiss()
diff --git a/app/src/main/java/com/gh/gamecenter/gamedetail/rating/RatingViewModel.kt b/app/src/main/java/com/gh/gamecenter/gamedetail/rating/RatingViewModel.kt
index 12947adef5..4880df1627 100644
--- a/app/src/main/java/com/gh/gamecenter/gamedetail/rating/RatingViewModel.kt
+++ b/app/src/main/java/com/gh/gamecenter/gamedetail/rating/RatingViewModel.kt
@@ -27,7 +27,7 @@ import io.reactivex.schedulers.Schedulers
import okhttp3.ResponseBody
import retrofit2.HttpException
-class RatingViewModel(application: Application, val game: GameEntity) : ListViewModel(application) {
+class RatingViewModel(application: Application, val game: GameEntity, val type: RatingType = RatingType.RATING) : ListViewModel(application) {
private val mApi = RetrofitManager.getInstance(getApplication()).api
@@ -36,7 +36,11 @@ class RatingViewModel(application: Application, val game: GameEntity) : ListView
var packageNameList = ArrayList()
init {
- initData()
+ if (type == RatingType.RATING) {
+ initData()
+ } else {
+ load(LoadType.NORMAL)
+ }
}
override fun provideDataObservable(page: Int): Observable>? {
@@ -166,9 +170,10 @@ class RatingViewModel(application: Application, val game: GameEntity) : ListView
}
class Factory(private val mApplication: Application,
- private val game: GameEntity) : ViewModelProvider.NewInstanceFactory() {
+ private val game: GameEntity,
+ val type: RatingType = RatingType.RATING) : ViewModelProvider.NewInstanceFactory() {
override fun create(modelClass: Class): T {
- return RatingViewModel(mApplication, game) as T
+ return RatingViewModel(mApplication, game, type) as T
}
}
@@ -177,4 +182,9 @@ class RatingViewModel(application: Application, val game: GameEntity) : ListView
private const val FILTER_DEVICE_KEY = "device"
private const val FILTER_START_KEY = "star"
}
+
+ enum class RatingType {
+ RATING,//评论列表
+ FOLD_RATING//折叠评论
+ }
}
\ No newline at end of file
diff --git a/app/src/main/res/drawable-xxhdpi/ic_fold_rating_remind.png b/app/src/main/res/drawable-xxhdpi/ic_fold_rating_remind.png
new file mode 100644
index 0000000000..1f3a89518e
Binary files /dev/null and b/app/src/main/res/drawable-xxhdpi/ic_fold_rating_remind.png differ
diff --git a/app/src/main/res/drawable-xxhdpi/ic_rating_remind.png b/app/src/main/res/drawable-xxhdpi/ic_rating_remind.png
new file mode 100644
index 0000000000..f4cb44d2a1
Binary files /dev/null and b/app/src/main/res/drawable-xxhdpi/ic_rating_remind.png differ
diff --git a/app/src/main/res/drawable/bg_fold_rating_reason.xml b/app/src/main/res/drawable/bg_fold_rating_reason.xml
new file mode 100644
index 0000000000..7d9aba6f13
--- /dev/null
+++ b/app/src/main/res/drawable/bg_fold_rating_reason.xml
@@ -0,0 +1,6 @@
+
+
+
+
+
\ No newline at end of file
diff --git a/app/src/main/res/drawable/bg_rating_stop_server_remind.xml b/app/src/main/res/drawable/bg_rating_stop_server_remind.xml
new file mode 100644
index 0000000000..ba7a95a36a
--- /dev/null
+++ b/app/src/main/res/drawable/bg_rating_stop_server_remind.xml
@@ -0,0 +1,6 @@
+
+
+
+
+
\ No newline at end of file
diff --git a/app/src/main/res/layout/dialog_kaifu_remind.xml b/app/src/main/res/layout/dialog_kaifu_remind.xml
index 66c636b349..8708a5b463 100644
--- a/app/src/main/res/layout/dialog_kaifu_remind.xml
+++ b/app/src/main/res/layout/dialog_kaifu_remind.xml
@@ -14,6 +14,7 @@
android:orientation="vertical">
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/app/src/main/res/layout/game_comment_hint_item.xml b/app/src/main/res/layout/game_comment_hint_item.xml
index 89393243f6..70f2f74f6a 100644
--- a/app/src/main/res/layout/game_comment_hint_item.xml
+++ b/app/src/main/res/layout/game_comment_hint_item.xml
@@ -7,5 +7,5 @@
android:gravity = "center"
android:orientation = "vertical"
android:text = "修改"
- android:textColor = "@color/text_3a3a3a"
- android:textSize = "12dp" />
\ No newline at end of file
+ android:textColor = "@color/text_666666"
+ android:textSize = "12sp" />
\ No newline at end of file
diff --git a/app/src/main/res/layout/rating_comment_item.xml b/app/src/main/res/layout/rating_comment_item.xml
index 458fe5118a..f00b25d983 100644
--- a/app/src/main/res/layout/rating_comment_item.xml
+++ b/app/src/main/res/layout/rating_comment_item.xml
@@ -314,9 +314,9 @@
android:layout_marginRight="20dp"
app:layout_constraintTop_toBottomOf="@id/line">
-
-
-
-
+
+
+
+
+
+
+
+
+
+
diff --git a/app/src/main/res/values/colors.xml b/app/src/main/res/values/colors.xml
index 8b5e6dbda2..bd241347d0 100644
--- a/app/src/main/res/values/colors.xml
+++ b/app/src/main/res/values/colors.xml
@@ -173,4 +173,5 @@
#3CB9FF
#E8F3FF
#05CBA3
+ #EDF4FB
\ No newline at end of file