This commit is contained in:
juntao
2020-08-24 17:59:21 +08:00
parent e1793d57eb
commit c33eb6829a
9 changed files with 44 additions and 12 deletions

View File

@ -277,6 +277,11 @@ public class EntranceUtils {
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.KITKAT) {
Object object = bundle.get(key);
if (object instanceof Parcelable) {
if (object.toString().toLowerCase().contains("gameentity")) {
Utils.toast(HaloApp.getInstance().getApplication(), "暂不支持带游戏实体的页面保存捷径");
return;
}
String parcelableName = key + ":parcelable";
String parcelableType = object.getClass().getName();
String objectJsonString = GsonUtils.toJson(object);

View File

@ -60,6 +60,7 @@ import java.util.concurrent.atomic.AtomicBoolean;
import io.reactivex.android.schedulers.AndroidSchedulers;
import io.reactivex.schedulers.Schedulers;
import kotlin.text.StringsKt;
import retrofit2.HttpException;
/**
@ -282,7 +283,7 @@ public class MessageDetailAdapter extends BaseRecyclerAdapter<ViewHolder> {
} else {
viewHolder.thumb.displayGameIcon(mConcernEntity.getGameIcon(), null);
}
viewHolder.title.setText(mConcernEntity.getGameName());
viewHolder.title.setText(StringsKt.removeSuffix(mConcernEntity.getGameName(), "."));
NewsUtils.setNewsPublishOn(viewHolder.time, mConcernEntity.getTime());
viewHolder.share.setOnClickListener(v -> {

View File

@ -2,6 +2,7 @@ package com.gh.gamecenter.entity
import android.os.Parcelable
import com.google.gson.annotations.SerializedName
import kotlinx.android.parcel.IgnoredOnParcel
import kotlinx.android.parcel.Parcelize
@Parcelize
@ -21,11 +22,17 @@ data class AmwayCommentEntity(
var rawIcon: String? = null,
@SerializedName("icon_subscript")
var iconSubscript: String? = "",
var name: String,
@SerializedName(value="new_tag_style")
@SerializedName("name")
private var mName: String,
@SerializedName(value = "new_tag_style")
var tag: List<TagStyleEntity>? = arrayListOf(),
var star: Float) : Parcelable {
fun toGameEntity() : GameEntity {
@IgnoredOnParcel
val name: String?
get() = mName.removeSuffix(".")
fun toGameEntity(): GameEntity {
val gameEntity = GameEntity()
gameEntity.id = id
gameEntity.name = name

View File

@ -8,12 +8,14 @@ data class ForumEntity(
@SerializedName("game_id")
var gameId: String = "",
@SerializedName("game_name")
var gameName: String = "",
var mGameName: String = "",
@SerializedName("game_icon")
var gameIcon: String = "",
@SerializedName("is_follow")
var isFollow: Boolean = false
)
var isFollow: Boolean = false) {
val gameName: String?
get() = mGameName.removeSuffix(".")
}
data class ForumCategoryEntity(
@SerializedName("_id")

View File

@ -584,7 +584,8 @@ data class GameEntity(
data class SimpleGame(
@SerializedName("_id")
var id: String? = null,
var name: String? = "",
@SerializedName("name")
var mName: String? = "",
@SerializedName("name_suffix")
var nameSuffix: String? = null,
@SerializedName("icon")
@ -593,6 +594,11 @@ data class SimpleGame(
private var mRawIcon: String? = null,
@SerializedName("icon_subscript")
var iconSubscript: String? = null) : Parcelable {
@IgnoredOnParcel
val name: String?
get() = mName?.removeSuffix(".")
fun getIcon(): String {
return mRawIcon ?: mIcon ?: ""
}

View File

@ -269,6 +269,11 @@ class DescViewModel(application: Application,
hasShownCustomColumnTagsExpandHint = true
}
// 不存在缩起正文的自定义栏目默认全显示
if (TextUtils.isEmpty(rawItem.customColumn?.desBrief) && rawItem.customColumn?.name != "游戏简介") {
rawItem.customColumn?.showDesType = "all"
}
// 将自定义栏目正文内容里低版本 android 系统不支持的 HTML Tag 转为手动处理
if (!TextUtils.isEmpty(rawItem.customColumn?.desBrief)) {
rawItem.customColumn?.desFull = rawItem.customColumn?.desFull?.replaceUnsupportedHtmlTag()

View File

@ -51,6 +51,7 @@ import io.reactivex.android.schedulers.AndroidSchedulers;
import io.reactivex.functions.Consumer;
import io.reactivex.functions.Function;
import io.reactivex.schedulers.Schedulers;
import kotlin.text.StringsKt;
import retrofit2.HttpException;
/**
@ -356,7 +357,7 @@ class ConcernAdapter extends BaseRecyclerAdapter<ViewHolder> {
} else {
viewHolder.thumb.displayGameIcon(concernEntity.getGameIcon(), null);
}
viewHolder.title.setText(concernEntity.getGameName());
viewHolder.title.setText(StringsKt.removeSuffix(concernEntity.getGameName(), "."));
NewsUtils.setNewsPublishOn(viewHolder.time, concernEntity.getTime());
if ("libao".equals(concernEntity.getType())) {

View File

@ -5,6 +5,9 @@ import android.content.Intent;
import android.view.View;
import android.widget.RelativeLayout;
import androidx.annotation.Nullable;
import androidx.fragment.app.FragmentActivity;
import com.gh.base.BaseActivity;
import com.gh.base.BaseRecyclerViewHolder;
import com.gh.base.OnListClickListener;
@ -40,8 +43,6 @@ import com.lightgame.utils.Utils;
import java.util.ArrayList;
import java.util.List;
import androidx.annotation.Nullable;
import androidx.fragment.app.FragmentActivity;
import io.reactivex.android.schedulers.AndroidSchedulers;
import io.reactivex.schedulers.Schedulers;
import retrofit2.HttpException;

View File

@ -73,7 +73,11 @@ open class SearchDefaultFragment : BaseFragment<Any>() {
DirectUtils.directToLinkPage(requireContext(), mHotTagList!![it], "(搜索-$tagName)", "") // 不需要path
})
mHotSearchList = Config.getSettings()?.search?.hotSearch
mHotSearchList = Config.getSettings()?.search?.hotSearch?.apply {
for (hotSearch in this) {
hotSearch.name = hotSearch.name.removeSuffix(".")
}
}
mBinding.isExistHotSearch = mHotSearchList?.isNotEmpty()
mBinding.hotList.run {
layoutManager = GridLayoutManager(context, 2)